File size: 1,618 Bytes
5f32fbd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@aware([
    'action',
    'icon',
    'stepper',
])
@props([
    'action' => null,
    'icon' => null,
    'stepper' => null,
    'force' => false,
])

@if($action || $stepper || $icon || $force)
    <div class="relative">
        {{ $slot }}

        {{-- Icon --}}
        @if ($icon)
            {!! $icon !!}
        @endif

        {{-- Action --}}
        @if ($action)
            <div class="absolute inset-y-0 end-0 border-s">
                {{ $action }}
            </div>
        @endif

        {{-- Stepper --}}
        @if ($stepper)
            <button
                    class="lqd-stepper-btn absolute start-0 top-0 inline-flex aspect-square h-full w-10 items-center justify-center rounded-input transition-colors hover:bg-heading-foreground hover:text-heading-background"
                    type="button"
                    @click="value = Math.max(min, value - step)"
            >
                <x-tabler-minus
                        class="w-4"
                        stroke-width="1.5"
                />
            </button>
            <button
                    class="lqd-stepper-btn absolute end-0 top-0 inline-flex aspect-square h-full w-10 items-center justify-center rounded-input transition-colors hover:bg-heading-foreground hover:text-heading-background"
                    type="button"
                    @click="value = Math.min(max, value + step)"
            >
                <x-tabler-plus
                        class="w-4"
                        stroke-width="1.5"
                />
            </button>
        @endif
    </div>
@else
    {{ $slot }}
@endif