File tree Expand file tree Collapse file tree 4 files changed +31
-23
lines changed Expand file tree Collapse file tree 4 files changed +31
-23
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ public function boot(): void
48
48
49
49
public function registerComponents ()
50
50
{
51
+ // Just rename <x-icon> provided from BladeUI to <x-svg> to not collide with ours
52
+ Blade::component ('BladeUI\Icons\Components\Icon ' , 'svg ' );
53
+
51
54
Blade::component ('alert ' , Alert::class);
52
55
Blade::component ('badge ' , Badge::class);
53
56
Blade::component ('button ' , Button::class);
Original file line number Diff line number Diff line change @@ -19,6 +19,11 @@ public function __construct(
19
19
$ this ->uuid = md5 (serialize ($ this ));
20
20
}
21
21
22
+ public function icon (): string
23
+ {
24
+ return "heroicon- {$ this ->name }" ;
25
+ }
26
+
22
27
public function classes (): string
23
28
{
24
29
if (Str::contains ($ this ->class , ['w- ' , 'h- ' ])) {
@@ -31,7 +36,7 @@ public function classes(): string
31
36
public function render (): View |Closure |string
32
37
{
33
38
return <<<'HTML'
34
- @ svg("heroicon-{$name}", "$classes()")
39
+ <x- svg :name="$icon()" :class= "$classes()" />
35
40
HTML;
36
41
}
37
42
}
Original file line number Diff line number Diff line change @@ -55,17 +55,7 @@ public function render(): View|Closure|string
55
55
</div>
56
56
@endif
57
57
58
- <div class="flex-1 relative">
59
- <!-- ICON -->
60
- @if($icon)
61
- <x-icon :name="$icon" class="absolute top-1/2 -translate-y-1/2 ml-3 text-gray-400 " />
62
- @endif
63
-
64
- <!-- RIGHT ICON -->
65
- @if($iconRight)
66
- <x-icon :name="$iconRight" class="absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 " />
67
- @endif
68
-
58
+ <div class="flex-1 relative">
69
59
<!-- MONEY SETUP -->
70
60
@if($money)
71
61
<div x-data="{display: ''}" x-init="display = $wire.{{ $modelName() }}?.replace('.', '{{ $fractionSeparator }}')">
@@ -99,6 +89,16 @@ public function render(): View|Closure|string
99
89
}}
100
90
/>
101
91
92
+ <!-- ICON -->
93
+ @if($icon)
94
+ <x-icon :name="$icon" class="absolute top-1/2 -translate-y-1/2 left-3 text-gray-400 " />
95
+ @endif
96
+
97
+ <!-- RIGHT ICON -->
98
+ @if($iconRight)
99
+ <x-icon :name="$iconRight" class="absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 " />
100
+ @endif
101
+
102
102
<!-- INLINE LABEL -->
103
103
@if($label && $inline)
104
104
<label for="{{ $uuid }}" class="absolute text-gray-400 duration-300 transform -translate-y-1 scale-75 top-2 z-10 origin-[0] bg-white rounded dark:bg-gray-900 px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-1 @if($inline && $icon) left-9 @else left-3 @endif">
Original file line number Diff line number Diff line change @@ -39,17 +39,7 @@ public function render(): View|Closure|string
39
39
<label class="label label-text font-semibold">{{ $label }}</label>
40
40
@endif
41
41
42
- <div class="relative">
43
- <!-- ICON -->
44
- @if($icon)
45
- <x-icon :name="$icon" class="absolute top-1/2 -translate-y-1/2 ml-3 text-gray-400" />
46
- @endif
47
-
48
- <!-- RIGHT ICON -->
49
- @if($iconRight)
50
- <x-icon :name="$iconRight" class="absolute top-1/2 right-8 -translate-y-1/2 text-gray-400 " />
51
- @endif
52
-
42
+ <div class="relative">
53
43
<select
54
44
{{ $attributes->whereDoesntStartWith('class') }}
55
45
{{ $attributes->class([
@@ -71,6 +61,16 @@ public function render(): View|Closure|string
71
61
@endforeach
72
62
</select>
73
63
64
+ <!-- ICON -->
65
+ @if($icon)
66
+ <x-icon :name="$icon" class="absolute top-1/2 -translate-y-1/2 left-3 text-gray-400" />
67
+ @endif
68
+
69
+ <!-- RIGHT ICON -->
70
+ @if($iconRight)
71
+ <x-icon :name="$iconRight" class="absolute top-1/2 right-8 -translate-y-1/2 text-gray-400 " />
72
+ @endif
73
+
74
74
<!-- INLINE LABEL -->
75
75
@if($label && $inline)
76
76
<label class="absolute text-gray-500 duration-300 transform -translate-y-1 scale-75 top-2 z-10 origin-[0] bg-white rounded dark:bg-gray-900 px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-1 @if($inline && $icon) left-9 @else left-3 @endif">
You can’t perform that action at this time.
0 commit comments