diff --git a/packages/actions/src/ActionGroup.php b/packages/actions/src/ActionGroup.php index 017d115b18..9304078bff 100644 --- a/packages/actions/src/ActionGroup.php +++ b/packages/actions/src/ActionGroup.php @@ -8,6 +8,7 @@ use Filament\Support\Concerns\HasBadge; use Filament\Support\Concerns\HasColor; use Filament\Support\Concerns\HasExtraAttributes; use Filament\Support\Concerns\HasIcon; +use Filament\Support\Facades\FilamentIcon; use Livewire\Component; class ActionGroup extends ViewComponent implements HasLivewire @@ -194,7 +195,7 @@ class ActionGroup extends ViewComponent implements HasLivewire public function getIcon(): string { - return $this->getBaseIcon() ?? 'heroicon-m-ellipsis-vertical'; + return $this->getBaseIcon() ?? FilamentIcon::resolve('actions::action-group') ?? 'heroicon-m-ellipsis-vertical'; } public function isHidden(): bool diff --git a/packages/actions/src/Concerns/CanRequireConfirmation.php b/packages/actions/src/Concerns/CanRequireConfirmation.php index f5cd54e108..de1f5f710f 100644 --- a/packages/actions/src/Concerns/CanRequireConfirmation.php +++ b/packages/actions/src/Concerns/CanRequireConfirmation.php @@ -5,6 +5,7 @@ namespace Filament\Actions\Concerns; use Closure; use Filament\Actions\MountableAction; use Filament\Support\Enums\Alignment; +use Filament\Support\Facades\FilamentIcon; trait CanRequireConfirmation { @@ -12,7 +13,7 @@ trait CanRequireConfirmation { $this->modalAlignment(fn (MountableAction $action): ?Alignment => $action->evaluate($condition) ? Alignment::Center : null); $this->modalFooterActionsAlignment(fn (MountableAction $action): ?Alignment => $action->evaluate($condition) ? Alignment::Center : null); - $this->modalIcon(fn (MountableAction $action): ?string => $action->evaluate($condition) ? 'heroicon-o-exclamation-triangle' : null); + $this->modalIcon(fn (MountableAction $action): ?string => $action->evaluate($condition) ? (FilamentIcon::resolve('actions::modal.confirmation') ?? 'heroicon-o-exclamation-triangle') : null); $this->modalDescription(fn (MountableAction $action): ?string => $action->evaluate($condition) ? __('filament-actions::modal.confirmation') : null); $this->modalSubmitActionLabel(fn (MountableAction $action): ?string => $action->evaluate($condition) ? __('filament-actions::modal.actions.confirm.label') : null); $this->modalWidth(fn (MountableAction $action): ?string => $action->evaluate($condition) ? 'md' : null); diff --git a/packages/actions/src/CreateAction.php b/packages/actions/src/CreateAction.php index 6ab60aaf99..7d1887dde0 100644 --- a/packages/actions/src/CreateAction.php +++ b/packages/actions/src/CreateAction.php @@ -6,6 +6,7 @@ use Closure; use Filament\Actions\Concerns\CanCustomizeProcess; use Filament\Actions\Contracts\HasActions; use Filament\Forms\Form; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\Relation; @@ -42,7 +43,7 @@ class CreateAction extends Action $this->successNotificationTitle(__('filament-actions::create.single.notifications.created.title')); - $this->groupedIcon('heroicon-m-plus'); + $this->groupedIcon(FilamentIcon::resolve('actions::create-action.grouped') ?? 'heroicon-m-plus'); $this->record(null); diff --git a/packages/actions/src/EditAction.php b/packages/actions/src/EditAction.php index 6228da83f5..3b19cbd0a7 100644 --- a/packages/actions/src/EditAction.php +++ b/packages/actions/src/EditAction.php @@ -5,6 +5,7 @@ namespace Filament\Actions; use Closure; use Filament\Actions\Concerns\CanCustomizeProcess; use Filament\Actions\Contracts\HasActions; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Database\Eloquent\Model; class EditAction extends Action @@ -30,7 +31,7 @@ class EditAction extends Action $this->successNotificationTitle(__('filament-actions::edit.single.notifications.saved.title')); - $this->groupedIcon('heroicon-m-pencil-square'); + $this->groupedIcon(FilamentIcon::resolve('actions::edit-action.grouped') ?? 'heroicon-m-pencil-square'); $this->fillForm(function (HasActions $livewire, Model $record): array { if ($translatableContentDriver = $livewire->makeFilamentTranslatableContentDriver()) { diff --git a/packages/actions/src/ViewAction.php b/packages/actions/src/ViewAction.php index ebbbe7d2f8..becf46f843 100644 --- a/packages/actions/src/ViewAction.php +++ b/packages/actions/src/ViewAction.php @@ -4,6 +4,7 @@ namespace Filament\Actions; use Closure; use Filament\Actions\Contracts\HasActions; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Database\Eloquent\Model; class ViewAction extends Action @@ -28,7 +29,7 @@ class ViewAction extends Action $this->color('gray'); - $this->groupedIcon('heroicon-m-eye'); + $this->groupedIcon(FilamentIcon::resolve('actions::view-action.grouped') ?? 'heroicon-m-eye'); $this->disabledForm(); diff --git a/packages/forms/src/Components/Builder.php b/packages/forms/src/Components/Builder.php index 8ac4675df1..d22cb2f7e6 100644 --- a/packages/forms/src/Components/Builder.php +++ b/packages/forms/src/Components/Builder.php @@ -7,6 +7,7 @@ use Filament\Forms\ComponentContainer; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Builder\Block; use Filament\Support\Enums\ActionSize; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Support\Arr; use Illuminate\Support\Str; @@ -228,7 +229,7 @@ class Builder extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getCloneActionName()) ->label(__('filament-forms::components.builder.actions.clone.label')) - ->icon('heroicon-m-square-2-stack') + ->icon(FilamentIcon::resolve('forms::components.builder.actions.clone') ?? 'heroicon-m-square-2-stack') ->color('gray') ->action(function (array $arguments, Builder $component): void { $newUuid = $component->generateUuid(); @@ -271,7 +272,7 @@ class Builder extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getDeleteActionName()) ->label(__('filament-forms::components.builder.actions.delete.label')) - ->icon('heroicon-m-trash') + ->icon(FilamentIcon::resolve('forms::components.builder.actions.delete') ?? 'heroicon-m-trash') ->color('danger') ->action(function (array $arguments, Builder $component): void { $items = $component->getState(); @@ -310,7 +311,7 @@ class Builder extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getMoveDownActionName()) ->label(__('filament-forms::components.builder.actions.move_down.label')) - ->icon('heroicon-m-arrow-down') + ->icon(FilamentIcon::resolve('forms::components.builder.actions.move-down') ?? 'heroicon-m-arrow-down') ->color('gray') ->action(function (array $arguments, Builder $component): void { $items = array_move_after($component->getState(), $arguments['item']); @@ -348,7 +349,7 @@ class Builder extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getMoveUpActionName()) ->label(__('filament-forms::components.builder.actions.move_up.label')) - ->icon('heroicon-m-arrow-up') + ->icon(FilamentIcon::resolve('forms::components.builder.actions.move-up') ?? 'heroicon-m-arrow-up') ->color('gray') ->action(function (array $arguments, Builder $component): void { $items = array_move_before($component->getState(), $arguments['item']); @@ -393,7 +394,7 @@ class Builder extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getReorderActionName()) ->label(__('filament-forms::components.builder.actions.reorder.label')) - ->icon('heroicon-m-arrows-up-down') + ->icon(FilamentIcon::resolve('forms::components.builder.actions.reorder') ?? 'heroicon-m-arrows-up-down') ->color('gray') ->action(function (array $arguments, Builder $component): void { $items = [ @@ -435,7 +436,7 @@ class Builder extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getCollapseActionName()) ->label(__('filament-forms::components.builder.actions.collapse.label')) - ->icon('heroicon-m-chevron-up') + ->icon(FilamentIcon::resolve('forms::components.builder.actions.collapse') ?? 'heroicon-m-chevron-up') ->color('gray') ->livewireClickHandlerEnabled(false) ->iconButton() @@ -466,7 +467,7 @@ class Builder extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getExpandActionName()) ->label(__('filament-forms::components.builder.actions.expand.label')) - ->icon('heroicon-m-chevron-down') + ->icon(FilamentIcon::resolve('forms::components.builder.actions.expand') ?? 'heroicon-m-chevron-down') ->color('gray') ->livewireClickHandlerEnabled(false) ->iconButton() diff --git a/packages/forms/src/Components/FileUpload.php b/packages/forms/src/Components/FileUpload.php index bcf14eeeb7..d1d3efdd2f 100644 --- a/packages/forms/src/Components/FileUpload.php +++ b/packages/forms/src/Components/FileUpload.php @@ -6,6 +6,7 @@ use Closure; use Exception; use Filament\Support\Concerns\HasAlignment; use Filament\Support\Concerns\HasExtraAlpineAttributes; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Support\Collection; use Illuminate\Support\HtmlString; @@ -474,71 +475,71 @@ class FileUpload extends BaseFileUpload 'zoom' => [ [ 'label' => __('filament-forms::components.file_upload.editor.actions.drag_move.label'), - 'iconHtml' => new HtmlString(''), + 'iconHtml' => ($icon = FilamentIcon::resolve('forms::components.file-upload.editor.actions.drag-move')) ? svg($icon, $iconSizeClasses)->toHtml() : new HtmlString(''), 'alpineClickHandler' => "editor.setDragMode('move')", ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.drag_crop.label'), - 'iconHtml' => new HtmlString(''), + 'iconHtml' => ($icon = FilamentIcon::resolve('forms::components.file-upload.editor.actions.drag-crop')) ? svg($icon, $iconSizeClasses)->toHtml() : new HtmlString(''), 'alpineClickHandler' => "editor.setDragMode('crop')", ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.zoom_in.label'), - 'iconHtml' => svg('heroicon-o-magnifying-glass-plus', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.zoom-in') ?? 'heroicon-o-magnifying-glass-plus', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.zoom(0.1)', ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.zoom_out.label'), - 'iconHtml' => svg('heroicon-o-magnifying-glass-minus', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.zoom-out') ?? 'heroicon-o-magnifying-glass-minus', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.zoom(-0.1)', ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.zoom_100.label'), - 'iconHtml' => svg('heroicon-o-arrows-pointing-out', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.zoom-100') ?? 'heroicon-o-arrows-pointing-out', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.zoomTo(1)', ], ], 'move' => [ [ 'label' => __('filament-forms::components.file_upload.editor.actions.move_left.label'), - 'iconHtml' => svg('heroicon-o-arrow-left-circle', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.move-left') ?? 'heroicon-o-arrow-left-circle', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.move(-10, 0)', ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.move_right.label'), - 'iconHtml' => svg('heroicon-o-arrow-right-circle', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.move-right') ?? 'heroicon-o-arrow-right-circle', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.move(10, 0)', ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.move_up.label'), - 'iconHtml' => svg('heroicon-o-arrow-up-circle', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.move-up') ?? 'heroicon-o-arrow-up-circle', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.move(0, -10)', ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.move_down.label'), - 'iconHtml' => svg('heroicon-o-arrow-down-circle', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.move-down') ?? 'heroicon-o-arrow-down-circle', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.move(0, 10)', ], ], 'transform' => [ [ 'label' => __('filament-forms::components.file_upload.editor.actions.rotate_left.label'), - 'iconHtml' => svg('heroicon-o-arrow-uturn-left', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.rotate-left') ?? 'heroicon-o-arrow-uturn-left', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.rotate(-90)', ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.rotate_right.label'), - 'iconHtml' => svg('heroicon-o-arrow-uturn-right', $iconSizeClasses)->toHtml(), + 'iconHtml' => svg(FilamentIcon::resolve('forms::components.file-upload.editor.actions.rotate-right') ?? 'heroicon-o-arrow-uturn-right', $iconSizeClasses)->toHtml(), 'alpineClickHandler' => 'editor.rotate(90)', ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.flip_horizontal.label'), - 'iconHtml' => new HtmlString(''), + 'iconHtml' => ($icon = FilamentIcon::resolve('forms::components.file-upload.editor.actions.flip-horizontal')) ? svg($icon, $iconSizeClasses)->toHtml() : new HtmlString(''), 'alpineClickHandler' => 'editor.scaleX(-editor.getData().scaleX || -1)', ], [ 'label' => __('filament-forms::components.file_upload.editor.actions.flip_vertical.label'), - 'iconHtml' => new HtmlString(''), + 'iconHtml' => ($icon = FilamentIcon::resolve('forms::components.file-upload.editor.actions.flip-vertical')) ? svg($icon, $iconSizeClasses)->toHtml() : new HtmlString(''), 'alpineClickHandler' => 'editor.scaleY(-editor.getData().scaleY || -1)', ], ], diff --git a/packages/forms/src/Components/KeyValue.php b/packages/forms/src/Components/KeyValue.php index 02d239bdc6..e0b50313a8 100644 --- a/packages/forms/src/Components/KeyValue.php +++ b/packages/forms/src/Components/KeyValue.php @@ -6,6 +6,7 @@ use Closure; use Filament\Forms\Components\Actions\Action; use Filament\Support\Concerns\HasExtraAlpineAttributes; use Filament\Support\Enums\ActionSize; +use Filament\Support\Facades\FilamentIcon; class KeyValue extends Field { @@ -100,7 +101,7 @@ class KeyValue extends Field { $action = Action::make($this->getDeleteActionName()) ->label(__('filament-forms::components.key_value.actions.delete.label')) - ->icon('heroicon-m-trash') + ->icon(FilamentIcon::resolve('forms::components.key-value.actions.delete') ?? 'heroicon-m-trash') ->color('danger') ->livewireClickHandlerEnabled(false) ->iconButton() @@ -132,7 +133,7 @@ class KeyValue extends Field { $action = Action::make($this->getReorderActionName()) ->label(__('filament-forms::components.key_value.actions.reorder.label')) - ->icon('heroicon-m-arrows-up-down') + ->icon(FilamentIcon::resolve('forms::components.key-value.actions.reorder') ?? 'heroicon-m-arrows-up-down') ->color('gray') ->livewireClickHandlerEnabled(false) ->iconButton() diff --git a/packages/forms/src/Components/Repeater.php b/packages/forms/src/Components/Repeater.php index 8e5001aab6..a3fc11f3fb 100644 --- a/packages/forms/src/Components/Repeater.php +++ b/packages/forms/src/Components/Repeater.php @@ -7,6 +7,7 @@ use Filament\Forms\ComponentContainer; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Contracts\HasForms; use Filament\Support\Enums\ActionSize; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Model; @@ -253,7 +254,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getCloneActionName()) ->label(__('filament-forms::components.repeater.actions.clone.label')) - ->icon('heroicon-m-square-2-stack') + ->icon(FilamentIcon::resolve('forms::components.repeater.actions.clone') ?? 'heroicon-m-square-2-stack') ->color('gray') ->action(function (array $arguments, Repeater $component): void { $newUuid = $component->generateUuid(); @@ -296,7 +297,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getDeleteActionName()) ->label(__('filament-forms::components.repeater.actions.delete.label')) - ->icon('heroicon-m-trash') + ->icon(FilamentIcon::resolve('forms::components.repeater.actions.delete') ?? 'heroicon-m-trash') ->color('danger') ->action(function (array $arguments, Repeater $component): void { $items = $component->getState(); @@ -335,7 +336,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getMoveDownActionName()) ->label(__('filament-forms::components.repeater.actions.move_down.label')) - ->icon('heroicon-m-arrow-down') + ->icon(FilamentIcon::resolve('forms::components.repeater.actions.move-down') ?? 'heroicon-m-arrow-down') ->color('gray') ->action(function (array $arguments, Repeater $component): void { $items = array_move_after($component->getState(), $arguments['item']); @@ -373,7 +374,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getMoveUpActionName()) ->label(__('filament-forms::components.repeater.actions.move_up.label')) - ->icon('heroicon-m-arrow-up') + ->icon(FilamentIcon::resolve('forms::components.repeater.actions.move-up') ?? 'heroicon-m-arrow-up') ->color('gray') ->action(function (array $arguments, Repeater $component): void { $items = array_move_before($component->getState(), $arguments['item']); @@ -411,7 +412,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getReorderActionName()) ->label(__('filament-forms::components.repeater.actions.reorder.label')) - ->icon('heroicon-m-arrows-up-down') + ->icon(FilamentIcon::resolve('forms::components.repeater.actions.reorder') ?? 'heroicon-m-arrows-up-down') ->color('gray') ->action(function (array $arguments, Repeater $component): void { $items = [ @@ -453,7 +454,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getCollapseActionName()) ->label(__('filament-forms::components.repeater.actions.collapse.label')) - ->icon('heroicon-m-chevron-up') + ->icon(FilamentIcon::resolve('forms::components.repeater.actions.collapse') ?? 'heroicon-m-chevron-up') ->color('gray') ->livewireClickHandlerEnabled(false) ->iconButton() @@ -484,7 +485,7 @@ class Repeater extends Field implements Contracts\CanConcealComponents { $action = Action::make($this->getExpandActionName()) ->label(__('filament-forms::components.repeater.actions.expand.label')) - ->icon('heroicon-m-chevron-down') + ->icon(FilamentIcon::resolve('forms::components.repeater.actions.expand') ?? 'heroicon-m-chevron-down') ->color('gray') ->livewireClickHandlerEnabled(false) ->iconButton() diff --git a/packages/forms/src/Components/Select.php b/packages/forms/src/Components/Select.php index ef6aa4321c..26ec26499a 100644 --- a/packages/forms/src/Components/Select.php +++ b/packages/forms/src/Components/Select.php @@ -8,6 +8,7 @@ use Filament\Forms\ComponentContainer; use Filament\Forms\Components\Actions\Action; use Filament\Forms\Form; use Filament\Support\Concerns\HasExtraAlpineAttributes; +use Filament\Support\Facades\FilamentIcon; use Filament\Support\Services\RelationshipJoiner; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Contracts\Support\Htmlable; @@ -304,7 +305,7 @@ class Select extends Field implements Contracts\HasAffixActions, Contracts\HasNe $action->halt(); }) ->color('gray') - ->icon('heroicon-m-plus') + ->icon(FilamentIcon::resolve('forms::components.select.actions.create-option') ?? 'heroicon-m-plus') ->iconButton() ->modalHeading($this->getCreateOptionModalHeading() ?? __('filament-forms::components.select.actions.create_option.modal.heading')) ->modalSubmitActionLabel(__('filament-forms::components.select.actions.create_option.modal.actions.create.label')) @@ -445,7 +446,7 @@ class Select extends Field implements Contracts\HasAffixActions, Contracts\HasNe $livewire->dispatch('filament-forms::select.refreshSelectedOptionLabel', livewireId: $livewire->getId(), statePath: $statePath); }) ->color('gray') - ->icon('heroicon-m-pencil-square') + ->icon(FilamentIcon::resolve('forms::components.select.actions.edit-option') ?? 'heroicon-m-pencil-square') ->iconButton() ->modalHeading($this->getEditOptionModalHeading() ?? __('filament-forms::components.select.actions.edit_option.modal.heading')) ->modalSubmitActionLabel(__('filament-forms::components.select.actions.edit_option.modal.actions.save.label')); diff --git a/packages/notifications/src/Notification.php b/packages/notifications/src/Notification.php index 7d1b305cb9..8865b34b0f 100644 --- a/packages/notifications/src/Notification.php +++ b/packages/notifications/src/Notification.php @@ -10,6 +10,7 @@ use Filament\Support\Components\ViewComponent; use Filament\Support\Concerns\HasColor; use Filament\Support\Concerns\HasIcon; use Filament\Support\Concerns\HasIconColor; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Contracts\Support\Arrayable; use Illuminate\Database\Eloquent\Model; @@ -237,7 +238,7 @@ class Notification extends ViewComponent implements Arrayable public function danger(): static { - $this->icon('heroicon-o-x-circle'); + $this->icon(FilamentIcon::resolve('notifications::notification.danger') ?? 'heroicon-o-x-circle'); $this->iconColor('danger'); return $this; @@ -245,7 +246,7 @@ class Notification extends ViewComponent implements Arrayable public function info(): static { - $this->icon('heroicon-o-information-circle'); + $this->icon(FilamentIcon::resolve('notifications::notification.info') ?? 'heroicon-o-information-circle'); $this->iconColor('info'); return $this; @@ -253,7 +254,7 @@ class Notification extends ViewComponent implements Arrayable public function success(): static { - $this->icon('heroicon-o-check-circle'); + $this->icon(FilamentIcon::resolve('notifications::notification.success') ?? 'heroicon-o-check-circle'); $this->iconColor('success'); return $this; @@ -261,7 +262,7 @@ class Notification extends ViewComponent implements Arrayable public function warning(): static { - $this->icon('heroicon-o-exclamation-circle'); + $this->icon(FilamentIcon::resolve('notifications::notification.warning') ?? 'heroicon-o-exclamation-circle'); $this->iconColor('warning'); return $this; diff --git a/packages/panels/resources/views/components/tenant-menu.blade.php b/packages/panels/resources/views/components/tenant-menu.blade.php index 2c92407436..5a55a19181 100644 --- a/packages/panels/resources/views/components/tenant-menu.blade.php +++ b/packages/panels/resources/views/components/tenant-menu.blade.php @@ -91,9 +91,10 @@ {{ $profileItem?->getLabel() ?? filament()->getTenantProfilePage()::getLabel() }} @@ -103,9 +104,10 @@ {{ $billingItem?->getLabel() ?? __('filament-panels::layout.actions.billing.label') }} @@ -148,9 +150,10 @@ {{ $registrationItem?->getLabel() ?? filament()->getTenantRegistrationPage()::getLabel() }} diff --git a/packages/panels/src/Pages/Auth/PasswordReset/RequestPasswordReset.php b/packages/panels/src/Pages/Auth/PasswordReset/RequestPasswordReset.php index e8df35ba9b..74d8173d35 100644 --- a/packages/panels/src/Pages/Auth/PasswordReset/RequestPasswordReset.php +++ b/packages/panels/src/Pages/Auth/PasswordReset/RequestPasswordReset.php @@ -15,6 +15,7 @@ use Filament\Notifications\Auth\ResetPassword as ResetPasswordNotification; use Filament\Notifications\Notification; use Filament\Pages\Concerns\InteractsWithFormActions; use Filament\Pages\SimplePage; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Contracts\Auth\CanResetPassword; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Support\Facades\Password; @@ -138,8 +139,8 @@ class RequestPasswordReset extends SimplePage ->link() ->label(__('filament-panels::pages/auth/password-reset/request-password-reset.actions.login.label')) ->icon(match (__('filament-panels::layout.direction')) { - 'rtl' => 'heroicon-m-arrow-right', - default => 'heroicon-m-arrow-left', + 'rtl' => FilamentIcon::resolve('panels::pages.password-reset.request-password-reset.actions.login.rtl') ?? 'heroicon-m-arrow-right', + default => FilamentIcon::resolve('panels::pages.password-reset.request-password-reset.actions.login') ?? 'heroicon-m-arrow-left', }) ->url(filament()->getLoginUrl()); } diff --git a/packages/panels/src/Resources/Pages/EditRecord.php b/packages/panels/src/Resources/Pages/EditRecord.php index f23ed48a91..01157fd0d3 100644 --- a/packages/panels/src/Resources/Pages/EditRecord.php +++ b/packages/panels/src/Resources/Pages/EditRecord.php @@ -9,11 +9,13 @@ use Filament\Actions\ForceDeleteAction; use Filament\Actions\ReplicateAction; use Filament\Actions\RestoreAction; use Filament\Actions\ViewAction; +use Filament\Facades\Filament; use Filament\Forms\Form; use Filament\Infolists\Infolist; use Filament\Notifications\Notification; use Filament\Pages\Concerns\InteractsWithFormActions; use Filament\Support\Exceptions\Halt; +use Filament\Support\Facades\FilamentIcon; use Filament\Support\Facades\FilamentView; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Database\Eloquent\Model; @@ -41,7 +43,12 @@ class EditRecord extends Page public ?string $previousUrl = null; - protected static ?string $navigationIcon = 'heroicon-o-pencil'; + public static function getNavigationIcon(): ?string + { + return static::$navigationIcon + ?? FilamentIcon::resolve('panels::resources.pages.edit-record.navigation-item') + ?? (Filament::hasTopNavigation() ? 'heroicon-m-pencil-square' : 'heroicon-o-pencil-square'); + } public function getBreadcrumb(): string { diff --git a/packages/panels/src/Resources/Pages/ManageRelatedRecords.php b/packages/panels/src/Resources/Pages/ManageRelatedRecords.php index 3e20f1f8d8..0130def549 100644 --- a/packages/panels/src/Resources/Pages/ManageRelatedRecords.php +++ b/packages/panels/src/Resources/Pages/ManageRelatedRecords.php @@ -2,12 +2,14 @@ namespace Filament\Resources\Pages; +use Filament\Facades\Filament; use Filament\Forms\Form; use Filament\Infolists\Infolist; use Filament\Resources\Concerns\InteractsWithRelationshipTable; use Filament\Resources\RelationManagers\RelationGroup; use Filament\Resources\RelationManagers\RelationManager; use Filament\Resources\RelationManagers\RelationManagerConfiguration; +use Filament\Support\Facades\FilamentIcon; use Filament\Tables; use Filament\Tables\Actions\BulkAction; use Illuminate\Auth\Access\AuthorizationException; @@ -59,7 +61,12 @@ class ManageRelatedRecords extends Page implements Tables\Contracts\HasTable #[Url] public ?string $activeTab = null; - protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack'; + public static function getNavigationIcon(): ?string + { + return static::$navigationIcon + ?? FilamentIcon::resolve('panels::resources.pages.manage-related-records.navigation-item') + ?? (Filament::hasTopNavigation() ? 'heroicon-m-rectangle-stack' : 'heroicon-o-rectangle-stack'); + } public function mount(int | string $record): void { diff --git a/packages/panels/src/Resources/Pages/ViewRecord.php b/packages/panels/src/Resources/Pages/ViewRecord.php index b86257bd9e..71a91d3f34 100644 --- a/packages/panels/src/Resources/Pages/ViewRecord.php +++ b/packages/panels/src/Resources/Pages/ViewRecord.php @@ -8,9 +8,11 @@ use Filament\Actions\EditAction; use Filament\Actions\ForceDeleteAction; use Filament\Actions\ReplicateAction; use Filament\Actions\RestoreAction; +use Filament\Facades\Filament; use Filament\Forms\Form; use Filament\Infolists\Infolist; use Filament\Pages\Concerns\InteractsWithFormActions; +use Filament\Support\Facades\FilamentIcon; use Illuminate\Contracts\Support\Htmlable; use Illuminate\Database\Eloquent\Model; @@ -28,13 +30,18 @@ class ViewRecord extends Page */ protected static string $view = 'filament-panels::resources.pages.view-record'; - protected static ?string $navigationIcon = 'heroicon-o-eye'; - /** * @var array | null */ public ?array $data = []; + public static function getNavigationIcon(): ?string + { + return static::$navigationIcon + ?? FilamentIcon::resolve('panels::resources.pages.view-record.navigation-item') + ?? (Filament::hasTopNavigation() ? 'heroicon-m-eye' : 'heroicon-o-eye'); + } + public function getBreadcrumb(): string { return static::$breadcrumb ?? __('filament-panels::resources/pages/view-record.breadcrumb'); diff --git a/packages/support/docs/03-icons.md b/packages/support/docs/03-icons.md index bb786485f4..361a7de3bc 100644 --- a/packages/support/docs/03-icons.md +++ b/packages/support/docs/03-icons.md @@ -69,12 +69,20 @@ Alternatively, you may pass an SVG element into the component's slot instead of ### Panel Builder icon aliases - `panels::global-search.field` - Global search field -- `panels::pages.dashboard.navigation-item` - Dashboard navigation item +- `panels::pages.dashboard.navigation-item` - Dashboard page navigation item +- `panels::resources.pages.edit-record.navigation-item` - Resource edit record page navigation item +- `panels::resources.pages.manage-related-records.navigation-item` - Resource manage related records page navigation item +- `panels::resources.pages.view-record.navigation-item` - Resource view record page navigation item +- `panels::pages.password-reset.request-password-reset.actions.login` - Trigger button of the login action on the request password reset page +- `panels::pages.password-reset.request-password-reset.actions.login.rtl` - Trigger button of the login action on the request password reset page (right-to-left direction) - `panels::sidebar.collapse-button` - Button to collapse the sidebar - `panels::sidebar.collapse-button.rtl` - Button to collapse the sidebar (right-to-left direction) - `panels::sidebar.expand-button` - Button to expand the sidebar - `panels::sidebar.expand-button.rtl` - Button to expand the sidebar (right-to-left direction) - `panels::sidebar.group.collapse-button` - Collapse button for a sidebar group +- `panels::tenant-menu.billing-button` - Billing button in the tenant menu +- `panels::tenant-menu.profile-button` - Profile button in the tenant menu +- `panels::tenant-menu.registration-button` - Registration button in the tenant menu - `panels::tenant-menu.toggle-button` - Button to toggle the tenant menu - `panels::theme-switcher.light-button` - Button to switch to the light theme from the theme switcher - `panels::theme-switcher.dark-button` - Button to switch to the dark theme from the theme switcher @@ -91,11 +99,48 @@ Alternatively, you may pass an SVG element into the component's slot instead of ### Form Builder icon aliases +- `forms::components.builder.actions.clone` - Trigger button of a clone action in a builder item +- `forms::components.builder.actions.collapse` - Trigger button of a collapse action in a builder item +- `forms::components.builder.actions.delete` - Trigger button of a delete action in a builder item +- `forms::components.builder.actions.expand` - Trigger button of an expand action in a builder item +- `forms::components.builder.actions.move-down` - Trigger button of a move down action in a builder item +- `forms::components.builder.actions.move-up` - Trigger button of a move up action in a builder item +- `forms::components.builder.actions.reorder` - Trigger button of a reorder action in a builder item - `forms::components.checkbox-list.search-field` - Search input in a checkbox list +- `forms::components.file-upload.editor.actions.drag-crop` - Trigger button of a drag crop action in a file upload editor +- `forms::components.file-upload.editor.actions.drag-move` - Trigger button of a drag move action in a file upload editor +- `forms::components.file-upload.editor.actions.flip-horizontal` - Trigger button of a flip horizontal action in a file upload editor +- `forms::components.file-upload.editor.actions.flip-vertical` - Trigger button of a flip vertical action in a file upload editor +- `forms::components.file-upload.editor.actions.move-down` - Trigger button of a move down action in a file upload editor +- `forms::components.file-upload.editor.actions.move-left` - Trigger button of a move left action in a file upload editor +- `forms::components.file-upload.editor.actions.move-right` - Trigger button of a move right action in a file upload editor +- `forms::components.file-upload.editor.actions.move-up` - Trigger button of a move up action in a file upload editor +- `forms::components.file-upload.editor.actions.rotate-left` - Trigger button of a rotate left action in a file upload editor +- `forms::components.file-upload.editor.actions.rotate-right` - Trigger button of a rotate right action in a file upload editor +- `forms::components.file-upload.editor.actions.zoom-100` - Trigger button of a zoom 100 action in a file upload editor +- `forms::components.file-upload.editor.actions.zoom-in` - Trigger button of a zoom in action in a file upload editor +- `forms::components.file-upload.editor.actions.zoom-out` - Trigger button of a zoom out action in a file upload editor +- `forms::components.key-value.actions.delete` - Trigger button of a delete action in a key-value field item +- `forms::components.key-value.actions.reorder` - Trigger button of a reorder action in a key-value field item +- `forms::components.repeater.actions.clone` - Trigger button of a clone action in a repeater item +- `forms::components.repeater.actions.collapse` - Trigger button of a collapse action in a repeater item +- `forms::components.repeater.actions.delete` - Trigger button of a delete action in a repeater item +- `forms::components.repeater.actions.expand` - Trigger button of an expand action in a repeater item +- `forms::components.repeater.actions.move-down` - Trigger button of a move down action in a repeater item +- `forms::components.repeater.actions.move-up` - Trigger button of a move up action in a repeater item +- `forms::components.repeater.actions.reorder` - Trigger button of a reorder action in a repeater item +- `forms::components.select.actions.create-option` - Trigger button of a create option action in a select field +- `forms::components.select.actions.edit-option` - Trigger button of an edit option action in a select field - `forms::components.wizard.completed-step` - Completed step in a wizard ### Table Builder icon aliases +- `tables::actions.disable-reordering` - Trigger button of the disable reordering action +- `tables::actions.enable-reordering` - Trigger button of the enable reordering action +- `tables::actions.filter` - Trigger button of the filter action +- `tables::actions.group` - Trigger button of a group records action +- `tables::actions.open-bulk-actions` - Trigger button of an open bulk actions action +- `tables::actions.toggle-columns` - Trigger button of the toggle columns action - `tables::columns.collapse-button` - Button to collapse a column - `tables::columns.icon-column.false` - Falsy state of an icon column - `tables::columns.icon-column.true` - Truthy state of an icon column @@ -111,9 +156,15 @@ Alternatively, you may pass an SVG element into the component's slot instead of - `notifications::database.modal.empty-state` - Empty state of the database notifications modal - `notifications::notification.close-button` - Button to close a notification +- `notifications::notification.danger` - Danger notification +- `notifications::notification.info` - Info notification +- `notifications::notification.success` - Success notification +- `notifications::notification.warning` - Warning notification ### Actions icon aliases +- `actions::action-group` - Trigger button of an action group +- `actions::create-action.grouped` - Trigger button of a grouped create action - `actions::delete-action` - Trigger button of a delete action - `actions::delete-action.grouped` - Trigger button of a grouped delete action - `actions::delete-action.modal` - Modal of a delete action @@ -121,14 +172,19 @@ Alternatively, you may pass an SVG element into the component's slot instead of - `actions::detach-action.modal` - Modal of a detach action - `actions::dissociate-action` - Trigger button of a dissociate action - `actions::dissociate-action.modal` - Modal of a dissociate action +- `actions::edit-action` - Trigger button of an edit action +- `actions::edit-action.grouped` - Trigger button of a grouped edit action - `actions::force-delete-action` - Trigger button of a force delete action - `actions::force-delete-action.grouped` - Trigger button of a grouped force delete action - `actions::force-delete-action.modal` - Modal of a force delete action +- `actions::modal.confirmation` - Modal of an action that requires confirmation - `actions::replicate-action` - Trigger button of a replicate action - `actions::replicate-action.grouped` - Trigger button of a grouped replicate action - `actions::restore-action` - Trigger button of a restore action - `actions::restore-action.grouped` - Trigger button of a grouped restore action - `actions::restore-action.modal` - Modal of a restore action +- `actions::view-action` - Trigger button of a view action +- `actions::view-action.grouped` - Trigger button of a grouped view action ### Infolist Builder icon aliases diff --git a/packages/tables/src/Actions/BulkActionGroup.php b/packages/tables/src/Actions/BulkActionGroup.php index b32809d28d..30beca6fa9 100644 --- a/packages/tables/src/Actions/BulkActionGroup.php +++ b/packages/tables/src/Actions/BulkActionGroup.php @@ -2,6 +2,8 @@ namespace Filament\Tables\Actions; +use Filament\Support\Facades\FilamentIcon; + class BulkActionGroup extends ActionGroup { protected function setUp(): void @@ -10,7 +12,7 @@ class BulkActionGroup extends ActionGroup $this->label(__('filament-tables::table.actions.open_bulk_actions.label')); - $this->icon('heroicon-m-ellipsis-vertical'); + $this->icon(FilamentIcon::resolve('tables::actions.open-bulk-actions') ?? 'heroicon-m-ellipsis-vertical'); $this->color('gray'); diff --git a/packages/tables/src/Actions/EditAction.php b/packages/tables/src/Actions/EditAction.php index e376366bf5..7aed9d5739 100644 --- a/packages/tables/src/Actions/EditAction.php +++ b/packages/tables/src/Actions/EditAction.php @@ -4,6 +4,7 @@ namespace Filament\Tables\Actions; use Closure; use Filament\Actions\Concerns\CanCustomizeProcess; +use Filament\Support\Facades\FilamentIcon; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -32,7 +33,7 @@ class EditAction extends Action $this->successNotificationTitle(__('filament-actions::edit.single.notifications.saved.title')); - $this->icon('heroicon-m-pencil-square'); + $this->icon(FilamentIcon::resolve('actions::edit-action') ?? 'heroicon-m-pencil-square'); $this->fillForm(function (Model $record, Table $table): array { if ($translatableContentDriver = $table->makeTranslatableContentDriver()) { diff --git a/packages/tables/src/Actions/ViewAction.php b/packages/tables/src/Actions/ViewAction.php index 037e79fd08..ff23d00eb6 100644 --- a/packages/tables/src/Actions/ViewAction.php +++ b/packages/tables/src/Actions/ViewAction.php @@ -4,6 +4,7 @@ namespace Filament\Tables\Actions; use Closure; use Filament\Actions\StaticAction; +use Filament\Support\Facades\FilamentIcon; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Model; @@ -29,7 +30,7 @@ class ViewAction extends Action $this->color('gray'); - $this->icon('heroicon-m-eye'); + $this->icon(FilamentIcon::resolve('actions::view-action') ?? 'heroicon-m-eye'); $this->disabledForm(); diff --git a/packages/tables/src/Table/Concerns/CanGroupRecords.php b/packages/tables/src/Table/Concerns/CanGroupRecords.php index 9a51fa25d1..cdd298db44 100644 --- a/packages/tables/src/Table/Concerns/CanGroupRecords.php +++ b/packages/tables/src/Table/Concerns/CanGroupRecords.php @@ -4,6 +4,7 @@ namespace Filament\Tables\Table\Concerns; use Closure; use Filament\Support\Enums\ActionSize; +use Filament\Support\Facades\FilamentIcon; use Filament\Tables\Actions\Action; use Filament\Tables\Grouping\Group; @@ -71,7 +72,7 @@ trait CanGroupRecords $action = Action::make('groupRecords') ->label(__('filament-tables::table.actions.group.label')) ->iconButton() - ->icon('heroicon-m-rectangle-stack') + ->icon(FilamentIcon::resolve('tables::actions.group') ?? 'heroicon-m-rectangle-stack') ->color('gray') ->livewireClickHandlerEnabled(false) ->table($this); diff --git a/packages/tables/src/Table/Concerns/CanReorderRecords.php b/packages/tables/src/Table/Concerns/CanReorderRecords.php index dae299f926..0ef4727f8f 100644 --- a/packages/tables/src/Table/Concerns/CanReorderRecords.php +++ b/packages/tables/src/Table/Concerns/CanReorderRecords.php @@ -3,6 +3,7 @@ namespace Filament\Tables\Table\Concerns; use Closure; +use Filament\Support\Facades\FilamentIcon; use Filament\Tables\Actions\Action; trait CanReorderRecords @@ -36,7 +37,7 @@ trait CanReorderRecords $action = Action::make('reorderRecords') ->label($isReordering ? __('filament-tables::table.actions.disable_reordering.label') : __('filament-tables::table.actions.enable_reordering.label')) ->iconButton() - ->icon($isReordering ? 'heroicon-m-check' : 'heroicon-m-arrows-up-down') + ->icon($isReordering ? (FilamentIcon::resolve('tables::actions.disable-reordering') ?? 'heroicon-m-check') : (FilamentIcon::resolve('tables::actions.enable-reordering') ?? 'heroicon-m-arrows-up-down')) ->color('gray') ->action('toggleTableReordering') ->table($this); diff --git a/packages/tables/src/Table/Concerns/CanToggleColumns.php b/packages/tables/src/Table/Concerns/CanToggleColumns.php index 319b42a6b6..fee4b9e825 100644 --- a/packages/tables/src/Table/Concerns/CanToggleColumns.php +++ b/packages/tables/src/Table/Concerns/CanToggleColumns.php @@ -5,6 +5,7 @@ namespace Filament\Tables\Table\Concerns; use Closure; use Filament\Forms\Form; use Filament\Support\Enums\ActionSize; +use Filament\Support\Facades\FilamentIcon; use Filament\Tables\Actions\Action; trait CanToggleColumns @@ -56,7 +57,7 @@ trait CanToggleColumns $action = Action::make('toggleColumns') ->label(__('filament-tables::table.actions.toggle_columns.label')) ->iconButton() - ->icon('heroicon-m-view-columns') + ->icon(FilamentIcon::resolve('tables::actions.toggle-columns') ?? 'heroicon-m-view-columns') ->color('gray') ->livewireClickHandlerEnabled(false) ->table($this); diff --git a/packages/tables/src/Table/Concerns/HasFilters.php b/packages/tables/src/Table/Concerns/HasFilters.php index fe3251aa9e..4daf3be346 100644 --- a/packages/tables/src/Table/Concerns/HasFilters.php +++ b/packages/tables/src/Table/Concerns/HasFilters.php @@ -5,6 +5,7 @@ namespace Filament\Tables\Table\Concerns; use Closure; use Filament\Forms\Form; use Filament\Support\Enums\ActionSize; +use Filament\Support\Facades\FilamentIcon; use Filament\Tables\Actions\Action; use Filament\Tables\Enums\FiltersLayout; use Filament\Tables\Filters\BaseFilter; @@ -140,7 +141,7 @@ trait HasFilters $action = Action::make('openFilters') ->label(__('filament-tables::table.actions.filter.label')) ->iconButton() - ->icon('heroicon-m-funnel') + ->icon(FilamentIcon::resolve('tables::actions.filter') ?? 'heroicon-m-funnel') ->color('gray') ->livewireClickHandlerEnabled(false) ->modalSubmitAction(false)