Skip to content

Commit a39885f

Browse files
committed
✨ mis a jour des composants wireui
1 parent 260a8ae commit a39885f

17 files changed

+608
-15173
lines changed

composer.lock

Lines changed: 0 additions & 14838 deletions
This file was deleted.

resources/views/components/articles/card-with-author.blade.php

Whitespace-only changes.

resources/views/components/view-mode.blade.php

Whitespace-only changes.

resources/views/vendor/blade-ui-kit/components/forms/inputs/input.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@if ($value)value="{{ $value }}"@endif
1010
@if ($errors->has($name))aria-invalid="true"@endif
1111
{{ $attributes->class([
12-
'bg-skin-input shadow-sm focus:ring-flag-green focus:border-flag-green block w-full placeholder-skin-input focus:outline-none focus:placeholder-skin-input-focus font-normal text-skin-base sm:text-sm border-skin-input rounded-md',
12+
'bg-skin-input shadow-sm focus:ring-flag-green focus:border-flag-green block w-full placeholder-skin-input focus:outline-none focus:placeholder-skin-input-focus text-skin-base sm:text-sm border-skin-input rounded-md',
1313
'flex-1 block w-full min-w-0 rounded-none rounded-r-md' => $attributes->get('leading-addon'),
1414
'pl-16 sm:pl-14' => $attributes->get('inline-addon'),
1515
'pl-10' => $attributes->get('leading-icon') || $attributes->get('isPhone'),
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<div {{ $attributes->class($avatarClasses) }}>
2+
@if ($label)
3+
<span class="font-medium text-white dark:text-gray-200">
4+
{{ $label }}
5+
</span>
6+
@endif
7+
8+
@if ($src)
9+
<img @class([
10+
'shrink-0 object-cover object-center',
11+
'rounded-sm' => $squared,
12+
'rounded-full' => !$squared,
13+
$size,
14+
])
15+
src="{{ $src }}"
16+
/>
17+
@endif
18+
19+
@if (!$src && !$label)
20+
<svg
21+
class="shrink-0 text-gray-300 bg-gray-100 dark:bg-gray-600"
22+
fill="currentColor"
23+
viewBox="0 0 24 24">
24+
<path d="M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z" />
25+
</svg>
26+
@endif
27+
</div>
Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,46 @@
1-
<button {{ $attributes->merge([
2-
'class' => $classes,
3-
'type' => 'button'
4-
]) }}
5-
wire:loading.attr="disabled">
1+
@php
2+
$tag = $href ? 'a' : 'button';
3+
$defaultAttributes = [
4+
'wire:loading.attr' => 'disabled',
5+
'wire:loading.class' => '!cursor-wait',
6+
'wire:target' => ($spinner && strlen($spinner) > 1) ? $spinner : null,
7+
];
8+
$href === null
9+
? $defaultAttributes['type'] = 'button'
10+
: $defaultAttributes['href'] = $href;
11+
@endphp
12+
13+
<{{ $tag }} {{ $attributes->merge($defaultAttributes) }}>
614
@if ($icon)
715
<x-dynamic-component
8-
:component="WireUiComponent::resolve('icon')"
16+
:component="WireUi::component('icon')"
917
:name="$icon"
10-
class="w-4 h-4 shrink-0"
18+
class="{{ $iconSize }} shrink-0"
1119
/>
1220
@endif
1321

1422
{{ $label ?? $slot }}
1523

1624
@if ($rightIcon)
1725
<x-dynamic-component
18-
:component="WireUiComponent::resolve('icon')"
26+
:component="WireUi::component('icon')"
1927
:name="$rightIcon"
20-
class="w-4 h-4"
28+
class="{{ $iconSize }} shrink-0"
29+
:wire:loading.remove="(bool) $spinner"
2130
/>
2231
@endif
2332

2433
@if ($spinner)
25-
<svg class="animate-spin w-4 h-4"
26-
xmlns="http://www.w3.org/2000/svg"
27-
fill="none"
28-
viewBox="0 0 24 24"
29-
@if (preg_replace('/[^a-zA-Z]+/', '', $spinner))
30-
wire:target="{{ $spinner }}"
31-
@endif
32-
wire:loading>
34+
<svg class="animate-spin {{ $iconSize }} shrink-0"
35+
xmlns="http://www.w3.org/2000/svg"
36+
fill="none"
37+
viewBox="0 0 24 24"
38+
@if (preg_replace('/[^a-zA-Z]+/', '', $spinner))
39+
wire:target="{{ $spinner }}"
40+
@endif
41+
wire:loading.delay{{ $loadingDelay ? ".{$loadingDelay}":'' }}>
3342
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
3443
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
3544
</svg>
3645
@endif
37-
</button>
46+
</{{ $tag}}>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
@php
2+
$tag = $href ? 'a' : 'button';
3+
4+
$defaultAttributes = [
5+
'wire:loading.attr' => 'disabled',
6+
'wire:loading.class' => '!cursor-wait',
7+
];
8+
9+
$href === null
10+
? $defaultAttributes['type'] = 'button'
11+
: $defaultAttributes['href'] = $href;
12+
@endphp
13+
14+
<{{ $tag }} {{ $attributes->merge($defaultAttributes) }}>
15+
<div @if($spinner)
16+
@if (preg_replace('/[^a-zA-Z]+/', '', $spinner))
17+
wire:target="{{ $spinner }}"
18+
@endif
19+
wire:loading.remove
20+
@endif>
21+
@if ($icon)
22+
<x-dynamic-component
23+
:component="WireUi::component('icon')"
24+
:name="$icon"
25+
class="{{ $iconSize }} shrink-0"
26+
/>
27+
@else
28+
{{ $label ?? $slot }}
29+
@endif
30+
</div>
31+
32+
@if ($spinner)
33+
<svg class="animate-spin {{ $iconSize }} shrink-0"
34+
xmlns="http://www.w3.org/2000/svg"
35+
fill="none"
36+
viewBox="0 0 24 24"
37+
@if (preg_replace('/[^a-zA-Z]+/', '', $spinner))
38+
wire:target="{{ $spinner }}"
39+
@endif
40+
wire:loading.delay{{ $loadingDelay ? ".{$loadingDelay}":'' }}>
41+
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
42+
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
43+
</svg>
44+
@endif
45+
</{{ $tag }}>
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<div x-data="wireui_color_picker({
2+
colorNameAsValue: @boolean($colorNameAsValue),
3+
4+
@if ($attributes->wire('model')->value())
5+
wireModifiers: @js($attributes->wireModifiers()),
6+
wireModel: @entangle($attributes->wire('model')),
7+
@endif
8+
9+
@if ($colors)
10+
colors: @js($getColors())
11+
@endif
12+
})" {{ $attributes->only(['class', 'wire:key'])->class('relative') }}>
13+
<x-dynamic-component
14+
{{ $attributes->except(['class', 'wire:key'])->whereDoesntStartWith('wire:model') }}
15+
:component="WireUi::component('input')"
16+
x-model="{{ $colorNameAsValue ? 'selected.name' : 'selected.value' }}"
17+
x-bind:class="{ 'pl-8': selected.value }"
18+
x-on:input="setColor($event.target.value)"
19+
x-ref="input"
20+
:label="$label"
21+
:prefix="null"
22+
:icon="null">
23+
<x-slot name="prefix">
24+
<template x-if="selected.value">
25+
<div
26+
class="w-4 h-4 rounded shadow border"
27+
:style="{ 'background-color': selected.value }"
28+
></div>
29+
</template>
30+
</x-slot>
31+
32+
<x-slot name="append">
33+
<div class="absolute inset-y-0 right-0 flex items-center p-0.5">
34+
<x-dynamic-component
35+
:component="WireUi::component('button')"
36+
class="h-full rounded-r-md"
37+
primary
38+
flat
39+
squared
40+
x-on:click="toggle"
41+
trigger>
42+
<x-dynamic-component
43+
:component="WireUi::component('icon')"
44+
class="
45+
w-4 h-4 group-focus:text-primary-700 text-gray-400 dark:text-gray-600
46+
dark:group-hover:text-gray-500 dark:group-focus:text-primary-500
47+
"
48+
:name="$rightIcon"
49+
/>
50+
</x-dynamic-component>
51+
</div>
52+
</x-slot>
53+
</x-dynamic-component>
54+
55+
<x-wireui::parts.popover
56+
:margin="(bool) $label"
57+
class="
58+
max-h-56 py-3 px-2 sm:py-2 sm:px-1 sm:w-72 sm:rounded-xl
59+
overflow-y-auto soft-scrollbar border border-secondary-200
60+
">
61+
<div class="flex flex-wrap items-center justify-center gap-1 sm:gap-0.5 max-w-[18rem] mx-auto">
62+
<span class="sr-only">dropdown-open</span>
63+
64+
<template x-for="(color, index) in colors" :key="index">
65+
<button class="
66+
w-6 h-6 rounded shadow-lg border hover:scale-125 transition-all ease-in-out duration-100 cursor-pointer
67+
hover:border-gray-400 focus:outline-none focus:ring-2 focus:ring-primary-600 sdark:focus:ring-gray-400
68+
dark:border-0 dark:hover:ring-2 dark:hover:ring-gray-400
69+
"
70+
:style="{ 'background-color': color.value }"
71+
x-on:click="select(color)"
72+
:title="color.name"
73+
type="button">
74+
</button>
75+
</template>
76+
</div>
77+
</x-wireui::parts.popover>
78+
</div>

0 commit comments

Comments
 (0)