├── dist
└── manifest.json
├── src
├── helpers.php
├── Flux.php
└── ClassBuilder.php
├── stubs
└── resources
│ └── views
│ └── flux
│ ├── checkbox
│ ├── all.blade.php
│ ├── group
│ │ ├── index.blade.php
│ │ └── variants
│ │ │ └── default.blade.php
│ ├── index.blade.php
│ ├── variants
│ │ └── default.blade.php
│ └── indicator.blade.php
│ ├── otp
│ ├── separator.blade.php
│ ├── group.blade.php
│ ├── input.blade.php
│ └── index.blade.php
│ ├── spacer.blade.php
│ ├── modal
│ ├── close.blade.php
│ └── trigger.blade.php
│ ├── sidebar
│ ├── spacer.blade.php
│ ├── nav.blade.php
│ ├── header.blade.php
│ ├── toggle.blade.php
│ ├── backdrop.blade.php
│ ├── index.blade.php
│ ├── collapse.blade.php
│ └── profile.blade.php
│ ├── callout
│ ├── text.blade.php
│ ├── link.blade.php
│ └── heading.blade.php
│ ├── breadcrumbs
│ └── index.blade.php
│ ├── menu
│ ├── radio
│ │ ├── group.blade.php
│ │ └── index.blade.php
│ ├── checkbox
│ │ ├── group.blade.php
│ │ └── index.blade.php
│ ├── separator.blade.php
│ ├── heading.blade.php
│ ├── index.blade.php
│ ├── group.blade.php
│ └── submenu.blade.php
│ ├── skeleton
│ ├── group.blade.php
│ ├── index.blade.php
│ └── line.blade.php
│ ├── legend.blade.php
│ ├── radio
│ ├── group
│ │ ├── index.blade.php
│ │ └── variants
│ │ │ ├── default.blade.php
│ │ │ └── segmented.blade.php
│ ├── index.blade.php
│ ├── variants
│ │ ├── default.blade.php
│ │ └── segmented.blade.php
│ └── indicator.blade.php
│ ├── navmenu
│ ├── separator.blade.php
│ └── index.blade.php
│ ├── select
│ ├── index.blade.php
│ ├── option
│ │ ├── variants
│ │ │ └── default.blade.php
│ │ └── index.blade.php
│ └── variants
│ │ └── default.blade.php
│ ├── container.blade.php
│ ├── with-container.blade.php
│ ├── icon
│ ├── index.blade.php
│ ├── minus.blade.php
│ ├── stop.blade.php
│ ├── slash.blade.php
│ ├── plus.blade.php
│ ├── chevron-up.blade.php
│ ├── play.blade.php
│ ├── minus-circle.blade.php
│ ├── chevron-left.blade.php
│ ├── chevron-right.blade.php
│ ├── chevron-down.blade.php
│ ├── equals.blade.php
│ ├── arrow-down-right.blade.php
│ ├── check.blade.php
│ ├── cloud.blade.php
│ ├── ellipsis-vertical.blade.php
│ ├── clock.blade.php
│ ├── ellipsis-horizontal.blade.php
│ ├── arrow-up-left.blade.php
│ ├── arrow-up-right.blade.php
│ ├── x-mark.blade.php
│ ├── bars-2.blade.php
│ ├── arrow-down-left.blade.php
│ ├── arrow-up.blade.php
│ ├── arrow-long-up.blade.php
│ ├── magnifying-glass.blade.php
│ ├── arrow-down.blade.php
│ ├── arrow-left.blade.php
│ ├── arrow-right.blade.php
│ ├── arrow-long-down.blade.php
│ ├── arrow-long-left.blade.php
│ ├── arrow-long-right.blade.php
│ ├── bolt.blade.php
│ ├── italic.blade.php
│ ├── pause.blade.php
│ ├── cube.blade.php
│ ├── user.blade.php
│ ├── view-columns.blade.php
│ ├── bookmark.blade.php
│ ├── exclamation-circle.blade.php
│ ├── plus-circle.blade.php
│ ├── check-circle.blade.php
│ ├── moon.blade.php
│ ├── pencil.blade.php
│ ├── lock-open.blade.php
│ ├── arrow-turn-down-right.blade.php
│ ├── arrow-turn-up-left.blade.php
│ ├── arrow-turn-up-right.blade.php
│ ├── no-symbol.blade.php
│ ├── arrow-turn-down-left.blade.php
│ ├── arrow-turn-right-down.blade.php
│ ├── paper-airplane.blade.php
│ ├── arrow-turn-left-down.blade.php
│ ├── arrow-turn-right-up.blade.php
│ ├── arrow-up-circle.blade.php
│ ├── underline.blade.php
│ ├── arrow-down-circle.blade.php
│ ├── arrow-left-circle.blade.php
│ └── arrow-right-circle.blade.php
│ ├── navlist
│ ├── index.blade.php
│ └── group.blade.php
│ ├── button-or-div.blade.php
│ ├── footer.blade.php
│ ├── navbar
│ └── index.blade.php
│ ├── avatar
│ └── group.blade.php
│ ├── description.blade.php
│ ├── input
│ ├── group
│ │ ├── affix.blade.php
│ │ ├── prefix.blade.php
│ │ └── suffix.blade.php
│ ├── expandable.blade.php
│ ├── clearable.blade.php
│ ├── copyable.blade.php
│ └── viewable.blade.php
│ ├── main.blade.php
│ ├── subheading.blade.php
│ ├── aside.blade.php
│ ├── tooltip
│ ├── content.blade.php
│ └── index.blade.php
│ ├── dropdown.blade.php
│ ├── with-tooltip.blade.php
│ ├── badge
│ └── close.blade.php
│ ├── with-reversed-inline-field.blade.php
│ ├── with-inline-field.blade.php
│ ├── button-or-link-pure.blade.php
│ ├── header.blade.php
│ ├── error.blade.php
│ ├── separator.blade.php
│ ├── fieldset.blade.php
│ ├── heading.blade.php
│ ├── link.blade.php
│ ├── label.blade.php
│ ├── textarea.blade.php
│ ├── with-field.blade.php
│ ├── text.blade.php
│ ├── button-or-link.blade.php
│ ├── field.blade.php
│ └── profile.blade.php
└── composer.json
/dist/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "/flux.js": "618aa74b"
3 | }
--------------------------------------------------------------------------------
/src/helpers.php:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/otp/separator.blade.php:
--------------------------------------------------------------------------------
1 | —
--------------------------------------------------------------------------------
/stubs/resources/views/flux/otp/group.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {{ $slot }}
3 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/spacer.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
class('flex-1') }} data-flux-spacer>
4 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/modal/close.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
4 | {{ $slot }}
5 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/sidebar/spacer.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | class('flex-1 pointer-events-none') }} data-flux-sidebar-spacer>
--------------------------------------------------------------------------------
/stubs/resources/views/flux/callout/text.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | class('text-sm') }} data-slot="text">
4 | {{ $slot }}
5 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/breadcrumbs/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | class('flex') }} data-flux-breadcrumbs>
4 | {{ $slot }}
5 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/menu/radio/group.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
4 | {{ $slot }}
5 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/sidebar/nav.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/skeleton/group.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'animate' => null,
5 | ])
6 |
7 |
8 | {{ $slot }}
9 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/legend.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/menu/checkbox/group.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
4 | {{ $slot }}
5 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/sidebar/header.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | class('flex items-center justify-between gap-2 min-h-10') }} data-flux-sidebar-header>
4 | {{ $slot }}
5 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/menu/separator.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/radio/group/index.blade.php:
--------------------------------------------------------------------------------
1 | @props([
2 | 'variant' => 'default',
3 | ])
4 |
5 | {{ $slot }}
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/checkbox/group/index.blade.php:
--------------------------------------------------------------------------------
1 | @props([
2 | 'variant' => 'default',
3 | ])
4 |
5 | {{ $slot }}
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/navmenu/separator.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/select/index.blade.php:
--------------------------------------------------------------------------------
1 | @props([
2 | 'variant' => 'default',
3 | ])
4 |
5 |
6 | {{ $slot }}
7 |
8 |
--------------------------------------------------------------------------------
/src/Flux.php:
--------------------------------------------------------------------------------
1 | add('mx-auto w-full [:where(&)]:max-w-7xl px-6 lg:px-8')
6 | ;
7 | @endphp
8 |
9 | class($classes) }} data-flux-container>
10 | {{ $slot }}
11 |
12 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/select/option/variants/default.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'value' => null,
5 | ])
6 |
7 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/with-container.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'container' => null,
5 | ])
6 |
7 |
8 |
9 | {{ $slot }}
10 |
11 |
12 | {{ $slot }}
13 |
14 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/sidebar/toggle.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 |
12 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/icon/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | {{-- Credit: Heroicons (https://heroicons.com) --}}
4 |
5 | @props([
6 | 'icon' => null,
7 | 'name' => null,
8 | ])
9 |
10 | @php
11 | $icon = $name ?? $icon;
12 | @endphp
13 |
14 | {{ $slot }}
15 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/navlist/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'variant' => null,
5 | ])
6 |
7 | @php
8 | $classes = Flux::classes()
9 | ->add('flex flex-col')
10 | ->add('overflow-visible min-h-auto')
11 | ;
12 | @endphp
13 |
14 |
17 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/button-or-div.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'as' => null,
5 | ])
6 |
7 |
8 |
11 |
12 |
13 | {{ $slot }}
14 |
15 |
16 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/sidebar/backdrop.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes()
5 | ->add('z-20 fixed inset-0 bg-black/10 hidden')
6 | ->add('data-flux-sidebar-on-mobile:not-data-flux-sidebar-collapsed-mobile:block')
7 | ;
8 | @endphp
9 |
10 | class($classes) }} data-flux-sidebar-backdrop>
11 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/footer.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes('[grid-area:footer]')
5 | ->add($attributes->has('container') ? '' : 'p-6 lg:p-8')
6 | ;
7 | @endphp
8 |
9 | class($classes) }} data-flux-footer>
10 |
11 | {{ $slot }}
12 |
13 |
14 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/navbar/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'scrollable' => false,
5 | 'variant' => null,
6 | ])
7 |
8 | @php
9 | $classes = Flux::classes()
10 | ->add('flex items-center gap-1 py-3')
11 | ->add($scrollable ? ['overflow-x-auto overflow-y-hidden'] : [])
12 | ;
13 | @endphp
14 |
15 |
18 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/navmenu/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes()
5 | ->add('[:where(&)]:min-w-48 p-[.3125rem]')
6 | ->add('rounded-lg shadow-xs')
7 | ->add('border border-zinc-200 dark:border-zinc-600')
8 | ->add('bg-white dark:bg-zinc-700')
9 | ;
10 | @endphp
11 |
12 |
15 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/avatar/group.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes()
5 | ->add('flex isolate')
6 | ->add('*:not-first:-ml-2 **:ring-white **:dark:ring-zinc-900')
7 | ->add('**:data-[slot=avatar]:ring-4 **:data-[slot=avatar]:data-[size=sm]:ring-2 **:data-[slot=avatar]:data-[size=xs]:ring-2')
8 | ;
9 | @endphp
10 |
11 | class($classes) }}>
12 | {{ $slot }}
13 |
14 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/description.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php $srOnly = $srOnly ??= $attributes->pluck('sr-only'); @endphp
4 |
5 | @props([
6 | 'srOnly' => null,
7 | ])
8 |
9 | @php
10 | $classes = Flux::classes()
11 | ->add('text-sm text-zinc-500 dark:text-white/60')
12 | ->add($srOnly ? 'sr-only' : '')
13 | ;
14 | @endphp
15 |
16 | class($classes) }} data-flux-description>
17 | {{ $slot }}
18 |
19 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/input/group/affix.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes([
5 | 'flex items-center px-4 text-sm whitespace-nowrap',
6 | 'text-zinc-800 dark:text-zinc-200',
7 | 'bg-zinc-800/5 dark:bg-white/20',
8 | 'border-zinc-200 dark:border-white/10',
9 | 'border border-x-zinc-100 shadow-xs',
10 | ]);
11 | @endphp
12 |
13 | class($classes) }} data-flux-input-group-label>
14 | {{ $slot }}
15 |
16 |
--------------------------------------------------------------------------------
/src/ClassBuilder.php:
--------------------------------------------------------------------------------
1 | pending[] = Arr::toCssClasses($classes);
15 |
16 | return $this;
17 | }
18 |
19 | public function __toString()
20 | {
21 | return (string) collect($this->pending)->join(' ');
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/main.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'container' => null,
5 | ])
6 |
7 | @php
8 | $classes = Flux::classes('[grid-area:main]')
9 | ->add('p-6 lg:p-8')
10 | ->add('[[data-flux-container]_&]:px-0') // If there is a wrapping container, let IT handle the x padding...
11 | ->add($container ? 'mx-auto w-full [:where(&)]:max-w-7xl' : '')
12 | ;
13 | @endphp
14 |
15 | class($classes) }} data-flux-main>
16 | {{ $slot }}
17 |
18 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/menu/heading.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes([
5 | 'p-2 pb-1 w-full',
6 | 'flex items-center',
7 | 'text-start text-xs font-medium',
8 | 'text-zinc-500 font-medium dark:text-zinc-300',
9 | ]);
10 | @endphp
11 |
12 | class($classes) }} data-flux-menu-heading>
13 |
14 |
15 |
{{ $slot }}
16 |
17 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/input/group/prefix.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes([
5 | 'flex items-center px-4 text-sm whitespace-nowrap',
6 | 'text-zinc-800 dark:text-zinc-200',
7 | 'bg-zinc-800/5 dark:bg-white/20',
8 | 'border-zinc-200 dark:border-white/10',
9 | 'rounded-s-lg',
10 | 'border-s border-t border-b shadow-xs',
11 | ]);
12 | @endphp
13 |
14 | class($classes) }} data-flux-input-group-prefix>
15 | {{ $slot }}
16 |
17 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/input/group/suffix.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes([
5 | 'flex items-center px-4 text-sm whitespace-nowrap',
6 | 'text-zinc-800 dark:text-zinc-200',
7 | 'bg-zinc-800/5 dark:bg-white/20',
8 | 'border-zinc-200 dark:border-white/10',
9 | 'rounded-e-lg',
10 | 'border-e border-t border-b shadow-xs',
11 | ]);
12 | @endphp
13 |
14 | class($classes) }} data-flux-input-group-suffix>
15 | {{ $slot }}
16 |
17 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/menu/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes()
5 | ->add('[:where(&)]:min-w-48 p-[.3125rem]')
6 | ->add('rounded-lg shadow-xs')
7 | ->add('border border-zinc-200 dark:border-zinc-600')
8 | ->add('bg-white dark:bg-zinc-700')
9 | ->add('focus:outline-hidden')
10 | ;
11 | @endphp
12 |
13 | class($classes) }}
15 | popover="manual"
16 | data-flux-menu
17 | >
18 | {{ $slot }}
19 |
20 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/input/expandable.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $attributes = $attributes->merge([
5 | 'variant' => 'subtle',
6 | 'class' => '-me-1',
7 | 'square' => true,
8 | 'size' => null,
9 | ]);
10 | @endphp
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/subheading.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'size' => 'base',
5 | ])
6 |
7 | @php
8 | $classes = Flux::classes()
9 | ->add(match ($size) {
10 | 'xl' => 'text-lg',
11 | 'lg' => 'text-base',
12 | default => 'text-sm',
13 | 'sm' => 'text-xs',
14 | })
15 | ->add('[:where(&)]:text-zinc-500 [:where(&)]:dark:text-white/70')
16 | ;
17 | @endphp
18 |
19 | class($classes) }} data-flux-subheading>
20 | {{ $slot }}
21 |
22 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/radio/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @aware([ 'variant' ])
4 |
5 | @props([
6 | 'variant' => 'default',
7 | ])
8 |
9 | @php
10 | // This prevents variants picked up by `@aware()` from other wrapping components like flux::modal from being used here...
11 | $variant = $variant !== 'default' && Flux::componentExists('radio.variants.' . $variant)
12 | ? $variant
13 | : 'default';
14 | @endphp
15 |
16 | {{ $slot }}
17 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/select/option/index.blade.php:
--------------------------------------------------------------------------------
1 | @aware([ 'variant' ])
2 |
3 | @props([
4 | 'variant' => 'default',
5 | ])
6 |
7 | @php
8 | // This prevents variants picked up by `@aware()` from other wrapping components like flux::modal from being used here...
9 | $variant = $variant !== 'default' && Flux::componentExists('select.variants.' . $variant)
10 | ? 'custom'
11 | : 'default';
12 | @endphp
13 |
14 | {{ $slot }}
15 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/callout/link.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'external' => null,
5 | ])
6 |
7 | @php
8 | $classes = Flux::classes()
9 | ->add('inline font-medium')
10 | ->add('underline underline-offset-[6px] hover:decoration-current')
11 | ->add('decoration-zinc-800/20 dark:decoration-white/20')
12 | ;
13 | @endphp
14 | {{-- NOTE: It's important that this file has NO newline at the end of the file. --}}
15 | class($classes) }} target="_blank">{{ $slot }}
--------------------------------------------------------------------------------
/stubs/resources/views/flux/checkbox/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @aware([ 'variant' ])
4 |
5 | @props([
6 | 'variant' => 'default',
7 | ])
8 |
9 | @php
10 | // This prevents variants picked up by `@aware()` from other wrapping components like flux::modal from being used here...
11 | $variant = $variant !== 'default' && Flux::componentExists('checkbox.variants.' . $variant)
12 | ? $variant
13 | : 'default';
14 | @endphp
15 |
16 | {{ $slot }}
17 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/modal/trigger.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'shortcut' => null,
5 | 'name' => null,
6 | ])
7 |
8 | class('contents') }}
10 | x-data
11 | x-on:click="$el.querySelector('button[disabled]') || $dispatch('modal-show', { name: '{{ $name }}' })"
12 | @if ($shortcut)
13 | x-on:keydown.{{ $shortcut }}.document="$event.preventDefault(); $dispatch('modal-show', { name: '{{ $name }}' })"
14 | @endif
15 | data-flux-modal-trigger
16 | >
17 | {{ $slot }}
18 |
19 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/aside.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'sticky' => null,
5 | ])
6 |
7 | @php
8 | $classes = Flux::classes('[grid-area:aside]');
9 |
10 | if ($sticky) {
11 | $attributes = $attributes->merge([
12 | 'x-data' => '',
13 | 'x-bind:style' => '{ position: \'sticky\', top: $el.offsetTop + \'px\', \'max-height\': \'calc(100dvh - \' + $el.offsetTop + \'px)\' }',
14 | 'class' => 'max-h-[100vh] overflow-y-auto',
15 | ]);
16 | }
17 | @endphp
18 |
19 | class($classes) }} data-flux-aside>
20 | {{ $slot }}
21 |
22 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/tooltip/content.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'kbd' => null,
5 | ])
6 |
7 | @php
8 | $classes = Flux::classes([
9 | 'relative py-2 px-2.5',
10 | 'rounded-md',
11 | 'text-xs text-white font-medium',
12 | 'bg-zinc-800 dark:bg-zinc-700 dark:border dark:border-white/10',
13 | 'p-0 overflow-visible',
14 | ]);
15 | @endphp
16 |
17 | class($classes) }} data-flux-tooltip-content>
18 | {{ $slot }}
19 |
20 |
21 | {{ $kbd }}
22 |
23 |
24 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/dropdown.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'position' => 'bottom',
5 | 'align' => 'start',
6 | ])
7 |
8 | @php
9 | // Support adding the .self modifier to the wire:model directive...
10 | if (($wireModel = $attributes->wire('model')) && $wireModel->directive && ! $wireModel->hasModifier('self')) {
11 | unset($attributes[$wireModel->directive]);
12 |
13 | $wireModel->directive .= '.self';
14 |
15 | $attributes = $attributes->merge([$wireModel->directive => $wireModel->value]);
16 | }
17 | @endphp
18 |
19 |
20 | {{ $slot }}
21 |
22 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/otp/input.blade.php:
--------------------------------------------------------------------------------
1 | @aware(['mode' => 'numeric', 'private' => false])
2 |
3 | @php
4 | $attributes = $attributes
5 | ->merge([
6 | 'class' => 'w-8! grow-0 has-focus-within:z-10',
7 | 'class:input' => 'px-0! py-3 text-center disabled:opacity-75 disabled:shadow-xs! dark:disabled:shadow-none!',
8 | ])
9 | ->merge(['data-flux-otp-input' => ''])
10 | ;
11 |
12 | if ($mode == 'numeric') {
13 | $attributes = $attributes->merge(['inputmode' => 'numeric']);
14 | }
15 |
16 | if ($private) {
17 | $attributes = $attributes->merge(['type' => 'password']);
18 | }
19 | @endphp
20 |
21 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/radio/variants/default.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'name' => $attributes->whereStartsWith('wire:model')->first(),
5 | ])
6 |
7 |
8 | {{-- We have to put tabindex="-1" here because otherwise, Livewire requests will wipe out tabindex state, --}}
9 | {{-- even with durable attributes for some reason... --}}
10 | {{-- We are redundantly setting the size of this container to 1.125rem so that the focus outline isn't oblong. --}}
11 | class('flex size-[1.125rem] rounded-full mt-px outline-offset-2') }} data-flux-control data-flux-radio tabindex="-1">
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/menu/group.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'heading' => null,
5 | ])
6 |
7 | @php
8 | $classes = Flux::classes()
9 | ->add('-mx-[.3125rem] px-[.3125rem]')
10 | ->add('[&+&>[data-flux-menu-separator-top]]:hidden [&:first-child>[data-flux-menu-separator-top]]:hidden [&:last-child>[data-flux-menu-separator-bottom]]:hidden')
11 | ;
12 | @endphp
13 |
14 | class($classes) }} role="group" data-flux-menu-group>
15 |
16 |
17 |
18 | {{ $heading }}
19 |
20 |
21 | {{ $slot }}
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/with-tooltip.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | extract(Flux::forwardedAttributes($attributes, [
5 | 'tooltipPosition',
6 | 'tooltipKbd',
7 | 'tooltip',
8 | ]));
9 | @endphp
10 |
11 | @php $tooltipPosition = $tooltipPosition ??= $attributes->pluck('tooltip:position'); @endphp
12 | @php $tooltipKbd = $tooltipKbd ??= $attributes->pluck('tooltip:kbd'); @endphp
13 | @php $tooltip = $tooltip ??= $attributes->pluck('tooltip'); @endphp
14 |
15 | @props([
16 | 'tooltipPosition' => 'top',
17 | 'tooltipKbd' => null,
18 | 'tooltip' => null,
19 | ])
20 |
21 |
22 |
23 | {{ $slot }}
24 |
25 |
26 | {{ $slot }}
27 |
28 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/checkbox/variants/default.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'name' => null,
5 | ])
6 |
7 | @php
8 | // We only want to show the name attribute on the checkbox if it has been set
9 | // manually, but not if it has been set from the wire:model attribute...
10 | $showName = isset($name);
11 |
12 | if (! isset($name)) {
13 | $name = $attributes->whereStartsWith('wire:model')->first();
14 | }
15 |
16 | $classes = Flux::classes()
17 | ->add('flex size-[1.125rem] rounded-[.3rem] mt-px outline-offset-2')
18 | ;
19 | @endphp
20 |
21 |
22 | class($classes) }} @if($showName) name="{{ $name }}" @endif data-flux-control data-flux-checkbox>
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/badge/close.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php $iconVariant ??= $attributes->pluck('icon:variant'); @endphp
4 |
5 | @props([
6 | 'iconVariant' => 'micro',
7 | 'icon' => 'x-mark',
8 | ])
9 |
10 | @php
11 | // When using the outline icon variant, we need to size it down to match the default icon sizes...
12 | $iconClasses = Flux::classes()->add($iconVariant === 'outline' ? 'size-4' : '');
13 |
14 | $classes = Flux::classes()
15 | ->add('p-1 -my-1 -me-1 opacity-50 hover:opacity-100')
16 | ;
17 | @endphp
18 |
19 |
26 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/with-reversed-inline-field.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | extract(flux::forwardedattributes($attributes, [
3 | 'name',
4 | 'description',
5 | 'label',
6 | ]));
7 | @endphp
8 |
9 | @props([
10 | 'name' => $attributes->whereStartsWith('wire:model')->first(),
11 | 'description' => null,
12 | 'label' => null,
13 | ])
14 |
15 |
16 |
17 |
18 | {{ $label }}
19 |
20 |
21 |
22 | {{ $description }}
23 |
24 |
25 | {{ $slot }}
26 |
27 |
28 |
29 |
30 | {{ $slot }}
31 |
32 |
33 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/input/clearable.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $attributes = $attributes->merge([
5 | 'variant' => 'subtle',
6 | 'class' => '-me-1 [[data-flux-input]:has(input:placeholder-shown)_&]:hidden [[data-flux-input]:has(input[disabled])_&]:hidden',
7 | 'square' => true,
8 | 'size' => null,
9 | ]);
10 | @endphp
11 |
12 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/otp/index.blade.php:
--------------------------------------------------------------------------------
1 | @props([
2 | 'length' => null,
3 | 'private' => false,
4 | ])
5 |
6 | @php
7 | $classes = Flux::classes()
8 | ->add('flex items-center gap-2 isolate w-fit')
9 | ->add('[&_[data-flux-input-group]]:w-auto')
10 | @endphp
11 |
12 |
13 | class($classes) }}
15 | data-flux-otp
16 | data-flux-control
17 | role="group"
18 | data-flux-input-aria-label="{{ __('Character {current} of {total}') }}"
19 | >
20 | isEmpty() && $length): ?>
21 |
22 |
23 |
24 |
25 | {{ $slot }}
26 |
27 |
28 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/with-inline-field.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | extract(flux::forwardedattributes($attributes, [
3 | 'name',
4 | 'description',
5 | 'label',
6 | ]));
7 | @endphp
8 |
9 | @props([
10 | 'name' => $attributes->whereStartsWith('wire:model')->first(),
11 | 'description' => null,
12 | 'label' => null,
13 | ])
14 |
15 |
16 |
17 | {{ $slot }}
18 |
19 |
20 | {{ $label }}
21 |
22 |
23 |
24 | {{ $description }}
25 |
26 |
27 |
28 |
29 |
30 | {{ $slot }}
31 |
32 |
33 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/button-or-link-pure.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | extract(Flux::forwardedAttributes($attributes, [
5 | 'type',
6 | 'href',
7 | 'as',
8 | ]));
9 | @endphp
10 |
11 | @props([
12 | 'type' => 'button',
13 | 'href' => null,
14 | 'as' => null,
15 | ])
16 |
17 |
18 |
19 | {{ $slot }}
20 |
21 |
22 | {{-- We are using e() here to escape the href attribute value instead of "{{ }}" because the latter will escape the entire attribute value, including the "&" character... --}}
23 |
24 | {{ $slot }}
25 |
26 |
27 |
30 |
31 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/checkbox/group/variants/default.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | $classes = Flux::classes()
3 | ->add('*:data-flux-field:mb-3')
4 | ->add('[&>[data-flux-field]:has(>[data-flux-description])]:mb-4')
5 | ->add('[&>[data-flux-field]:last-child]:mb-0!')
6 | ;
7 |
8 | // Support adding the .self modifier to the wire:model directive...
9 | if (($wireModel = $attributes->wire('model')) && $wireModel->directive && ! $wireModel->hasModifier('self')) {
10 | unset($attributes[$wireModel->directive]);
11 |
12 | $wireModel->directive .= '.self';
13 |
14 | $attributes = $attributes->merge([$wireModel->directive => $wireModel->value]);
15 | }
16 | @endphp
17 |
18 |
19 | class($classes) }} data-flux-checkbox-group>
20 | {{ $slot }}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/header.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'sticky' => null,
5 | 'container' => null,
6 | ])
7 |
8 | @php
9 | $classes = Flux::classes('[grid-area:header]')
10 | ->add('z-10 min-h-14')
11 | ->add($container ? '' : 'flex items-center px-6 lg:px-8')
12 | ;
13 |
14 | if ($sticky) {
15 | $attributes = $attributes->merge([
16 | 'x-data' => '',
17 | 'x-bind:style' => '{ position: \'sticky\', top: $el.offsetTop + \'px\', \'max-height\': \'calc(100vh - \' + $el.offsetTop + \'px)\' }',
18 | ]);
19 | }
20 | @endphp
21 |
22 | class($classes) }} data-flux-header>
23 | @if ($container)
24 |
25 | {{ $slot }}
26 |
27 | @else
28 | {{ $slot }}
29 | @endif
30 |
31 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/callout/heading.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php $iconVariant ??= $attributes->pluck('icon:variant'); @endphp
4 |
5 | @props([
6 | 'iconVariant' => 'mini',
7 | 'icon' => null,
8 | ])
9 |
10 | @php
11 | $classes = Flux::classes()
12 | ->add('flex items-center gap-2 text-sm font-medium')
13 | ;
14 |
15 | $iconClasses = Flux::classes()
16 | ->add('inline-block size-5 text-[var(--callout-icon)] dark:text-[var(--callout-icon)]')
17 | ->add($attributes->pluck('class:icon'))
18 | ;
19 | @endphp
20 |
21 | class($classes) }} data-slot="heading">
22 |
23 |
24 |
25 | {{ $icon }}
26 |
27 |
28 | {{ $slot }}
29 |
30 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/input/copyable.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $attributes = $attributes->merge([
5 | 'variant' => 'subtle',
6 | 'class' => '-me-1',
7 | 'square' => true,
8 | 'size' => null,
9 | ]);
10 | @endphp
11 |
12 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/radio/group/variants/default.blade.php:
--------------------------------------------------------------------------------
1 | @props([
2 | 'name' => null,
3 | 'variant' => null,
4 | ])
5 |
6 | @php
7 | // We only want to show the name attribute it has been set manually
8 | // but not if it has been set from the `wire:model` attribute...
9 | $showName = isset($name);
10 | if (! isset($name)) {
11 | $name = $attributes->whereStartsWith('wire:model')->first();
12 | }
13 |
14 | $classes = Flux::classes()
15 | // Adjust spacing between fields...
16 | ->add('*:data-flux-field:mb-3')
17 | ->add('[&>[data-flux-field]:has(>[data-flux-description])]:mb-4')
18 | ->add('[&>[data-flux-field]:last-child]:mb-0!')
19 | ;
20 | @endphp
21 |
22 |
23 | class($classes) }} @if($showName) name="{{ $name }}" @endif data-flux-radio-group>
24 | {{ $slot }}
25 |
26 |
27 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/radio/group/variants/segmented.blade.php:
--------------------------------------------------------------------------------
1 | @props([
2 | 'name' => null,
3 | 'variant' => null,
4 | 'size' => null,
5 | ])
6 |
7 | @php
8 | // We only want to show the name attribute on the checkbox if it has been set
9 | // manually, but not if it has been set from the wire:model attribute...
10 | $showName = isset($name);
11 |
12 | if (! isset($name)) {
13 | $name = $attributes->whereStartsWith('wire:model')->first();
14 | }
15 |
16 | $classes = Flux::classes()
17 | ->add('block flex p-1')
18 | ->add('rounded-lg bg-zinc-800/5 dark:bg-white/10')
19 | ->add($size === 'sm' ? 'h-8 py-[3px] px-[3px]' : 'h-10 p-1')
20 | ->add($size === 'sm' ? '-my-px h-[calc(2rem+2px)]' : '')
21 | ;
22 | @endphp
23 |
24 |
25 | class($classes) }} @if($showName) name="{{ $name }}" @endif data-flux-radio-group-segmented>
26 | {{ $slot }}
27 |
28 |
29 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/error.blade.php:
--------------------------------------------------------------------------------
1 | @props([
2 | 'icon' => 'exclamation-triangle',
3 | 'bag' => 'default',
4 | 'message' => null,
5 | 'nested' => true,
6 | 'name' => null,
7 | ])
8 |
9 | @php
10 | $errorBag = $errors->getBag($bag);
11 | $message ??= $name ? $errorBag->first($name) : null;
12 |
13 | if ($name && (is_null($message) || $message === '') && filter_var($nested, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) !== false) {
14 | $message = $errorBag->first($name . '.*');
15 | }
16 |
17 | $classes = Flux::classes('mt-3 text-sm font-medium text-red-500 dark:text-red-400')
18 | ->add($message ? '' : 'hidden');
19 | @endphp
20 |
21 | class($classes) }} data-flux-error>
22 |
23 |
24 |
25 |
26 |
27 | {{ $message }}
28 |
29 |
30 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/skeleton/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @aware(['animate' => null])
4 |
5 | @props([
6 | 'animate' => null,
7 | ])
8 |
9 | @php
10 | $classes = Flux::classes()
11 | ->add('[:where(&)]:h-4 [:where(&)]:rounded-md [:where(&)]:bg-zinc-400/20')
12 | ->add(match ($animate) {
13 | 'shimmer' => [
14 | 'relative before:absolute before:inset-0 before:-translate-x-full',
15 | 'overflow-hidden isolate',
16 | '[:where(&)]:[--flux-shimmer-color:white]',
17 | 'dark:[:where(&)]:[--flux-shimmer-color:var(--color-zinc-900)]',
18 | 'before:z-10 before:animate-[flux-shimmer_2s_infinite]',
19 | 'before:bg-gradient-to-r before:from-transparent before:via-[var(--flux-shimmer-color)]/50 dark:before:via-[var(--flux-shimmer-color)]/50 before:to-transparent',
20 | ],
21 | 'pulse' => 'animate-pulse',
22 | default => '',
23 | })
24 | ;
25 | @endphp
26 |
27 | class($classes) }} data-flux-skeleton>
28 | {{ $slot }}
29 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "livewire/flux",
3 | "description": "The official UI component library for Livewire.",
4 | "keywords": ["flux", "laravel", "livewire", "components", "ui"],
5 | "license": "proprietary",
6 | "authors": [
7 | {
8 | "name": "Caleb Porzio",
9 | "email": "calebporzio@gmail.com"
10 | }
11 | ],
12 | "require": {
13 | "php": "^8.1",
14 | "illuminate/console": "^10.0|^11.0|^12.0",
15 | "illuminate/support": "^10.0|^11.0|^12.0",
16 | "illuminate/view": "^10.0|^11.0|^12.0",
17 | "symfony/console": "^6.0|^7.0",
18 | "livewire/livewire": "^3.5.19|^4.0",
19 | "laravel/prompts": "^0.1|^0.2|^0.3"
20 | },
21 | "conflict": {
22 | "livewire/blaze": "<1.0.0"
23 | },
24 | "autoload": {
25 | "psr-4": {
26 | "Flux\\": "src/"
27 | }
28 | },
29 | "extra": {
30 | "laravel": {
31 | "providers": [
32 | "Flux\\FluxServiceProvider"
33 | ],
34 | "aliases": {
35 | "Flux": "Flux\\Flux"
36 | }
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/skeleton/line.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @aware(['animate' => null])
4 |
5 | @props([
6 | 'size' => 'base',
7 | 'animate' => null,
8 | ])
9 |
10 | @php
11 | $classes = Flux::classes()
12 | ->add('[:where(&)]:w-full')
13 | ->add(match ($size) {
14 | 'base' => '[:where(&)]:h-5 py-[3px]',
15 | 'lg' => 'h-6 py-[2px]',
16 | })
17 | ->add(match ($animate) {
18 | 'shimmer' => [
19 | 'relative before:absolute before:inset-0 before:-translate-x-full',
20 | 'overflow-hidden isolate',
21 | '[:where(&)]:[--flux-shimmer-color:white]',
22 | 'dark:[:where(&)]:[--flux-shimmer-color:var(--color-zinc-900)]',
23 | 'before:z-10 before:animate-[flux-shimmer_2s_infinite]',
24 | 'before:bg-gradient-to-r before:from-transparent before:via-[var(--flux-shimmer-color)]/50 dark:before:via-[var(--flux-shimmer-color)]/50 before:to-transparent',
25 | ],
26 | 'pulse' => 'animate-pulse',
27 | default => '',
28 | })
29 | ;
30 | @endphp
31 |
32 | class($classes) }} data-flux-skeleton-line>
33 |
{{ $slot }}
34 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/separator.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'orientation' => null,
5 | 'vertical' => false,
6 | 'variant' => null,
7 | 'faint' => false,
8 | 'text' => null,
9 | ])
10 |
11 | @php
12 | $orientation ??= $vertical ? 'vertical' : 'horizontal';
13 |
14 | $classes = Flux::classes('border-0 [print-color-adjust:exact]')
15 | ->add(match ($variant) {
16 | 'subtle' => 'bg-zinc-800/5 dark:bg-white/10',
17 | default => 'bg-zinc-800/15 dark:bg-white/20',
18 | })
19 | ->add(match ($orientation) {
20 | 'horizontal' => 'h-px w-full',
21 | 'vertical' => 'self-stretch self-center w-px',
22 | })
23 | ;
24 | @endphp
25 |
26 |
27 |
28 |
class([$classes, 'grow']) }}>
29 |
30 |
{{ $text }}
31 |
32 |
class([$classes, 'grow']) }}>
33 |
34 |
35 | class($classes, 'shrink-0') }} data-flux-separator>
36 |
37 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/fieldset.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'legend' => null,
5 | 'description' => null,
6 | ])
7 |
8 | @php
9 | $classes = Flux::classes()
10 | ->add('[&[disabled]_[data-flux-label]]:opacity-50') // Dim labels when the fieldset is disabled...
11 | ->add('[&[disabled]_[data-flux-legend]]:opacity-50') // Dim legend when the fieldset is disabled...
12 |
13 | // Adjust spacing between fields...
14 | ->add('*:data-flux-field:mb-3')
15 |
16 | // Adjust spacing between fields...
17 | ->add('*:data-flux-field:mb-3')
18 | ->add('[&>[data-flux-field]:has(>[data-flux-description])]:mb-4')
19 | ->add('[&>[data-flux-field]:last-child]:mb-0!')
20 |
21 | // Adjust spacing below legend...
22 | ->add('[&>legend]:mb-4')
23 | ->add('[&>legend:has(+[data-flux-description])]:mb-2')
24 |
25 | // Adjust spacing below description...
26 | ->add('[&>legend+[data-flux-description]]:mb-4')
27 | ;
28 | @endphp
29 |
30 |
41 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/tooltip/index.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'interactive' => null,
5 | 'position' => 'top',
6 | 'align' => 'center',
7 | 'content' => null,
8 | 'kbd' => null,
9 | 'toggleable' => null,
10 | ])
11 |
12 | @php
13 | // Support adding the .self modifier to the wire:model directive...
14 | if (($wireModel = $attributes->wire('model')) && $wireModel->directive && ! $wireModel->hasModifier('self')) {
15 | unset($attributes[$wireModel->directive]);
16 |
17 | $wireModel->directive .= '.self';
18 |
19 | $attributes = $attributes->merge([$wireModel->directive => $wireModel->value]);
20 | }
21 | @endphp
22 |
23 |
24 |
25 | {{ $slot }}
26 |
27 |
28 | {{ $content }}
29 |
30 |
31 |
32 |
33 | {{ $slot }}
34 |
35 |
36 | {{ $content }}
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/radio/indicator.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes()
5 | ->add('shrink-0 size-[1.125rem] rounded-full')
6 | ->add('text-sm text-zinc-700 dark:text-zinc-800')
7 | ->add('shadow-xs [ui-radio[disabled]_&]:opacity-75 [ui-radio[data-checked][disabled]_&]:opacity-50 [ui-radio[disabled]_&]:shadow-none [ui-radio[data-checked]_&]:shadow-none')
8 | ->add('flex justify-center items-center [ui-radio[data-checked]_&>div]:block')
9 | ->add([
10 | 'border',
11 | 'border-zinc-300 dark:border-white/10',
12 | '[ui-radio[disabled]_&]:border-zinc-200 dark:[ui-radio[disabled]_&]:border-white/5',
13 | '[ui-radio[data-checked]_&]:border-transparent data-indeterminate:border-transparent',
14 | '[ui-radio[data-checked]_&]:[ui-radio[disabled]_&]:border-transparent data-indeterminate:border-transparent',
15 | '[print-color-adjust:exact]',
16 | ])
17 | ->add([
18 | 'bg-white dark:bg-white/10',
19 | '[ui-radio[data-checked]_&]:bg-[var(--color-accent)]',
20 | 'hover:[ui-radio[data-checked]_&]:bg-(--color-accent)',
21 | 'focus:[ui-radio[data-checked]_&]:bg-(--color-accent)',
22 | ])
23 | ;
24 | @endphp
25 |
26 | class($classes) }} data-flux-radio-indicator>
27 |
28 |
29 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/input/viewable.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $attributes = $attributes->merge([
5 | 'variant' => 'subtle',
6 | 'class' => '-me-1',
7 | 'square' => true,
8 | 'size' => null,
9 | ]);
10 | @endphp
11 |
12 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/heading.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'size' => 'base',
5 | 'accent' => false,
6 | 'level' => null,
7 | ])
8 |
9 | @php
10 | $classes = Flux::classes()
11 | ->add('font-medium')
12 | ->add(match ($accent) {
13 | true => 'text-[var(--color-accent-content)]',
14 | default => '[:where(&)]:text-zinc-800 [:where(&)]:dark:text-white',
15 | })
16 | ->add(match ($size) {
17 | 'xl' => 'text-2xl [&:has(+[data-flux-subheading])]:mb-2 [[data-flux-subheading]+&]:mt-2',
18 | 'lg' => 'text-base [&:has(+[data-flux-subheading])]:mb-2 [[data-flux-subheading]+&]:mt-2',
19 | default => 'text-sm [&:has(+[data-flux-subheading])]:mb-2 [[data-flux-subheading]+&]:mt-2',
20 | })
21 | ;
22 | @endphp
23 |
24 |
25 | class($classes) }} data-flux-heading>{{ $slot }}
26 |
27 | @break
28 |
29 | class($classes) }} data-flux-heading>{{ $slot }}
30 |
31 | @break
32 |
33 | class($classes) }} data-flux-heading>{{ $slot }}
34 |
35 | @break
36 |
37 | class($classes) }} data-flux-heading>{{ $slot }}
38 |
39 | @break
40 |
41 | class($classes) }} data-flux-heading>{{ $slot }}
42 |
43 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/link.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'as' => null,
5 | 'external' => null,
6 | 'accent' => true,
7 | 'variant' => null,
8 | 'strong' => false,
9 | ])
10 |
11 | @php
12 | $classes = Flux::classes()
13 | ->add('inline font-medium')
14 | ->add('underline-offset-[6px] hover:decoration-current')
15 | ->add(match ($variant) {
16 | 'ghost' => 'no-underline hover:underline',
17 | 'subtle' => 'no-underline',
18 | default => 'underline',
19 | })
20 | ->add('[[data-color]>&]:text-inherit [[data-color]>&]:decoration-current/20 dark:[[data-color]>&]:decoration-current/50 [[data-color]>&]:hover:decoration-current')
21 | ->add(match ($variant) {
22 | 'subtle' => 'text-zinc-500 dark:text-white/70 hover:text-zinc-800 dark:hover:text-white',
23 | default => match ($accent) {
24 | true => 'text-[var(--color-accent-content)] decoration-[color-mix(in_oklab,var(--color-accent-content),transparent_80%)]',
25 | false => 'text-zinc-800 dark:text-white decoration-zinc-800/20 dark:decoration-white/20',
26 | },
27 | })
28 | ;
29 | @endphp
30 | {{-- NOTE: It's important that this file has NO newline at the end of the file. --}}
31 | class($classes) }} data-flux-link target="_blank">{{ $slot }}
--------------------------------------------------------------------------------
/stubs/resources/views/flux/label.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php $srOnly = $srOnly ??= $attributes->pluck('sr-only'); @endphp
4 |
5 | @props([
6 | 'badge' => null,
7 | 'aside' => null,
8 | 'trailing' => null,
9 | 'srOnly' => null,
10 | ])
11 |
12 | @php
13 | $classes = Flux::classes()
14 | ->add('inline-flex items-center')
15 | ->add('text-sm font-medium')
16 | ->add($srOnly ? 'sr-only' : '')
17 | ->add('[:where(&)]:text-zinc-800 [:where(&)]:dark:text-white')
18 | ->add('[&:has([data-flux-label-trailing])]:flex')
19 | ;
20 | @endphp
21 |
22 | class($classes) }} data-flux-label>
23 | {{ $slot }}
24 |
25 |
26 |
27 | {{ $badge }}
28 |
29 |
30 |
31 | {{ $badge }}
32 |
33 |
34 |
35 |
36 |
37 | {{ $aside }}
38 |
39 |
40 |
41 |
42 |
43 | {{ $trailing }}
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/textarea.blade.php:
--------------------------------------------------------------------------------
1 | @props([
2 | 'name' => $attributes->whereStartsWith('wire:model')->first(),
3 | 'resize' => 'vertical',
4 | 'invalid' => null,
5 | 'rows' => 4,
6 | ])
7 |
8 | @php
9 | $invalid ??= ($name && $errors->has($name));
10 |
11 | $classes = Flux::classes()
12 | ->add('block p-3 w-full')
13 | ->add('shadow-xs disabled:shadow-none border rounded-lg')
14 | ->add('bg-white dark:bg-white/10 dark:disabled:bg-white/[7%]')
15 | ->add($resize ? 'resize-y' : 'resize-none')
16 | ->add('text-base sm:text-sm text-zinc-700 disabled:text-zinc-500 placeholder-zinc-400 disabled:placeholder-zinc-400/70 dark:text-zinc-300 dark:disabled:text-zinc-400 dark:placeholder-zinc-400 dark:disabled:placeholder-zinc-500')
17 | ->add($invalid ? 'border-red-500' : 'border-zinc-200 border-b-zinc-300/80 dark:border-white/10')
18 | ;
19 |
20 | $resizeStyle = match ($resize) {
21 | 'none' => 'resize: none',
22 | 'both' => 'resize: both',
23 | 'horizontal' => 'resize: horizontal',
24 | 'vertical' => 'resize: vertical',
25 | };
26 | @endphp
27 |
28 |
29 |
38 |
39 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/menu/submenu.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php $iconTrailing ??= $attributes->pluck('icon:trailing'); @endphp
4 | @php $iconVariant ??= $attributes->pluck('icon:variant'); @endphp
5 |
6 | @props([
7 | 'iconVariant' => 'mini',
8 | 'iconTrailing' => null,
9 | 'heading' => '',
10 | 'icon' => null,
11 | 'keepOpen' => false,
12 | ])
13 |
14 | @php
15 | $iconClasses = Flux::classes()
16 | ->add('ms-auto text-zinc-400 [[data-flux-menu-item]:hover_&]:text-current')
17 | // When using the outline icon variant, we need to size it down to match the default icon sizes...
18 | ->add($iconVariant === 'outline' ? 'size-5' : '');
19 | @endphp
20 |
21 |
22 |
23 | {{ $heading }}
24 |
25 |
26 |
27 |
28 |
29 | {{ $iconTrailing }}
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 | {{ $slot }}
39 |
40 |
41 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/navlist/group.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'expandable' => false,
5 | 'expanded' => true,
6 | 'heading' => null,
7 | ])
8 |
9 |
10 | class('group/disclosure') }} @if ($expanded === true) open @endif data-flux-navlist-group>
11 |
19 |
20 |
21 |
22 |
23 | {{ $slot }}
24 |
25 |
26 |
27 | class('block space-y-[2px]') }}>
28 |
31 |
32 |
33 | {{ $slot }}
34 |
35 |
36 |
37 | class('block space-y-[2px]') }}>
38 | {{ $slot }}
39 |
40 |
41 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/with-field.blade.php:
--------------------------------------------------------------------------------
1 | @php
2 | extract(Flux::forwardedAttributes($attributes, [
3 | 'name',
4 | 'descriptionTrailing',
5 | 'description',
6 | 'label',
7 | 'badge',
8 | ]));
9 | @endphp
10 |
11 | @php $descriptionTrailing = $descriptionTrailing ??= $attributes->pluck('description:trailing'); @endphp
12 |
13 | @props([
14 | 'name' => $attributes->whereStartsWith('wire:model')->first(),
15 | 'descriptionTrailing' => null,
16 | 'description' => null,
17 | 'label' => null,
18 | 'badge' => null,
19 | ])
20 |
21 |
22 | $badge]);
26 | $descriptionAttributes = Flux::attributesAfter('description:', $attributes, []);
27 | $errorAttributes = Flux::attributesAfter('error:', $attributes, ['name' => $name]);
28 | ?>
29 |
30 |
31 | {{ $label }}
32 |
33 |
34 |
35 | {{ $description }}
36 |
37 |
38 | {{ $slot }}
39 |
40 |
41 |
42 |
43 | {{ $descriptionTrailing }}
44 |
45 |
46 |
47 | {{ $slot }}
48 |
49 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/checkbox/indicator.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @php
4 | $classes = Flux::classes()
5 | ->add('shrink-0 size-[1.125rem] rounded-[.3rem] flex justify-center items-center')
6 | ->add('text-sm text-zinc-700 dark:text-zinc-800')
7 | ->add('shadow-xs [ui-checkbox[disabled]_&]:opacity-75 [ui-checkbox[data-checked][disabled]_&]:opacity-50 [ui-checkbox[disabled]_&]:shadow-none [ui-checkbox[data-checked]_&]:shadow-none [ui-checkbox[data-indeterminate]_&]:shadow-none')
8 | ->add('[ui-checkbox[data-checked]:not([data-indeterminate])_&>svg:first-child]:block [ui-checkbox[data-indeterminate]_&>svg:last-child]:block')
9 | ->add([
10 | 'border',
11 | 'border-zinc-300 dark:border-white/10',
12 | '[ui-checkbox[disabled]_&]:border-zinc-200 dark:[ui-checkbox[disabled]_&]:border-white/5',
13 | '[ui-checkbox[data-checked]_&]:border-transparent [ui-checkbox[data-indeterminate]_&]:border-transparent',
14 | '[ui-checkbox[disabled][data-checked]_&]:border-transparent [ui-checkbox[disabled][data-indeterminate]_&]:border-transparent',
15 | '[print-color-adjust:exact]',
16 | ])
17 | ->add([
18 | 'bg-white dark:bg-white/10',
19 | '[ui-checkbox[data-checked]_&]:bg-[var(--color-accent)]',
20 | 'hover:[ui-checkbox[data-checked]_&]:bg-(--color-accent)',
21 | 'focus:[ui-checkbox[data-checked]_&]:bg-(--color-accent)',
22 | '[ui-checkbox[data-indeterminate]_&]:bg-[var(--color-accent)]',
23 | 'hover:[ui-checkbox[data-indeterminate]_&]:bg-(--color-accent)',
24 | 'focus:[ui-checkbox[data-indeterminate]_&]:bg-(--color-accent)',
25 | ])
26 | ;
27 | @endphp
28 |
29 | class($classes) }} data-flux-checkbox-indicator>
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/icon/minus.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | {{-- Credit: Heroicons (https://heroicons.com) --}}
4 |
5 | @props([
6 | 'variant' => 'outline',
7 | ])
8 |
9 | @php
10 | $classes = Flux::classes('shrink-0')
11 | ->add(match($variant) {
12 | 'outline' => '[:where(&)]:size-6',
13 | 'solid' => '[:where(&)]:size-6',
14 | 'mini' => '[:where(&)]:size-5',
15 | 'micro' => '[:where(&)]:size-4',
16 | });
17 | @endphp
18 |
19 |
20 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 |
40 |
41 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/stubs/resources/views/flux/select/variants/default.blade.php:
--------------------------------------------------------------------------------
1 | @blaze
2 |
3 | @props([
4 | 'name' => $attributes->whereStartsWith('wire:model')->first(),
5 | 'placeholder' => null,
6 | 'invalid' => null,
7 | 'size' => null,
8 | ])
9 |
10 | @php
11 | $invalid ??= ($name && $errors->has($name));
12 |
13 | $classes = Flux::classes()
14 | ->add('appearance-none') // Strip the browser's default