File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929 "laravel/installer" : " ^5.17" ,
3030 "laravel/prompts" : " ^0.3" ,
3131 "nunomaduro/termwind" : " ^2.3" ,
32+ "sikessem/ui" : " ^0.9" ,
3233 "spatie/laravel-package-tools" : " ^1.92" ,
3334 "symfony/console" : " ^7.3"
3435 },
Original file line number Diff line number Diff line change 2626 "filament/support" : " ^4.0" ,
2727 "illuminate/console" : " ^12.26" ,
2828 "illuminate/support" : " ^12.26" ,
29+ "sikessem/ui" : " ^0.9" ,
2930 "spatie/laravel-package-tools" : " ^1.92"
3031 },
3132 "autoload" : {
Original file line number Diff line number Diff line change 77use Filament \Forms \Components \Select ;
88use Filament \Support \Icons \Heroicon ;
99use Loom \Rules \IconRule ;
10+ use Sikessem \UI \Facade as UI ;
1011
1112class IconField extends Field
1213{
@@ -15,9 +16,26 @@ public static function make(?string $name = null): Select
1516 $ name ??= loom ()->config ('components.icon.name ' , 'icon ' );
1617
1718 return Select::make ($ name )
18- ->options (array_column (Heroicon::cases (), 'value ' , 'value ' ))
19+ ->options (function () {
20+ $ icons = array_column (Heroicon::cases (), 'value ' , 'value ' );
21+
22+ foreach ($ icons as $ name => $ icon ) {
23+ $ icon = str_starts_with ($ icon , 'o- ' )
24+ ? "heroicon- {$ icon }"
25+ : "heroicon-s- {$ icon }" ;
26+ $ icons [$ name ] = UI ::render (<<<HTML
27+ <span class="inline-flex items-center justify-center gap-1">
28+ <x-filament::icon icon=' {$ icon }'/>
29+ {$ name }
30+ </span>
31+ HTML );
32+ }
33+
34+ return $ icons ;
35+ })
1936 ->rule (new IconRule )
2037 ->searchable ()
38+ ->allowHtml ()
2139 ->label (loom ()->trans ('components.icon ' ));
2240 }
2341}
You can’t perform that action at this time.
0 commit comments