├── .github
├── CONTRIBUTING.md
├── FUNDING.yml
├── SECURITY.md
└── workflows
│ └── release.yml
├── .gitignore
├── .idea
├── .gitignore
├── laravel-idea.xml
├── misc.xml
├── modules.xml
└── vcs.xml
├── LICENSE
├── README.md
├── composer.json
├── composer.lock
├── config
└── icon-picker.php
├── dist
└── plugin.css
├── package-lock.json
├── package.json
├── postcss.config.js
├── release.config.js
├── resources
├── css
│ └── plugin.css
└── views
│ ├── forms
│ └── icon-picker.blade.php
│ ├── item.blade.php
│ ├── placeholder.blade.php
│ └── tables
│ └── icon-column.blade.php
├── src
├── FilamentIconPickerServiceProvider.php
├── Forms
│ ├── Concerns
│ │ └── CanBeCacheable.php
│ └── IconPicker.php
├── Layout.php
└── Tables
│ └── IconColumn.php
└── tailwind.config.js
/.github/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Contributions are **welcome** and will be fully **credited**.
4 |
5 | Please read and understand the contribution guide before creating an issue or pull request.
6 |
7 | ## Etiquette
8 |
9 | This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10 | held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11 | extremely unfair for them to suffer abuse or anger for their hard work.
12 |
13 | Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14 | world that developers are civilized and selfless people.
15 |
16 | It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17 | quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
18 |
19 | ## Viability
20 |
21 | When requesting or submitting new features, first consider whether it might be useful to others. Open
22 | source projects are used by many developers, who may have entirely different needs to your own. Think about
23 | whether or not your feature is likely to be used by other users of the project.
24 |
25 | ## Procedure
26 |
27 | Before filing an issue:
28 |
29 | - Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30 | - Check to make sure your feature suggestion isn't already present within the project.
31 | - Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32 | - Check the pull requests tab to ensure that the feature isn't already in progress.
33 |
34 | Before submitting a pull request:
35 |
36 | - Check the codebase to ensure that your feature doesn't already exist.
37 | - Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
38 |
39 | ## Requirements
40 |
41 | If the project maintainer has any additional requirements, you will find them listed here.
42 |
43 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).
44 |
45 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests.
46 |
47 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
48 |
49 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
50 |
51 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
52 |
53 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
54 |
55 | **Happy coding**!
56 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: LukasFreyCZ
2 |
--------------------------------------------------------------------------------
/.github/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | If you discover any security related issues, please email office@guava.cz instead of using the issue tracker.
4 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 | on:
3 | push:
4 | branches:
5 | - main
6 | jobs:
7 | release:
8 | name: Release
9 | runs-on: ubuntu-latest
10 | steps:
11 | - name: Checkout
12 | uses: actions/checkout@v2
13 | with:
14 | fetch-depth: 0
15 | - name: Setup Node.js
16 | uses: actions/setup-node@v2
17 | with:
18 | node-version: 'lts/*'
19 | - name: Install dependencies
20 | run: npm ci
21 | - name: Release
22 | env:
23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 | run: npx semantic-release
25 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | /vendor/
3 | node_modules/
4 | npm-debug.log
5 | yarn-error.log
6 |
7 | # Laravel 4 specific
8 | bootstrap/compiled.php
9 | app/storage/
10 |
11 | # Laravel 5 & Lumen specific
12 | public/storage
13 | public/hot
14 |
15 | # Laravel 5 & Lumen specific with changed public path
16 | public_html/storage
17 | public_html/hot
18 |
19 | storage/*.key
20 | .env
21 | Homestead.yaml
22 | Homestead.json
23 | /.vagrant
24 | .phpunit.result.cache
25 |
26 | .DS_Store
27 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/.idea/laravel-idea.xml:
--------------------------------------------------------------------------------
1 |
2 | |
142 |
143 |
144 |
145 | #### Sets
146 | By default, the plugin will use all available [blade icon sets](https://github.com/blade-ui-kit/blade-icons#icon-packages) installed. If you want to use only specific icon sets, you can change the default via the `icon-picker.sets` configuration or on a case-by-case basis:
147 | ```php
148 | // Search both herocions and fontawesome icons
149 | IconPicker::make('icon')
150 | ->sets(['heroicons', 'fontawesome-solid']);
151 | ```
152 |
153 | **When installing new sets, please make sure to clear your cache, if you can't find your icons in the icon picker.**
154 |
155 |
156 | #### Allow/Disallow icons
157 | For detailed control over the icons, there are two options available to allow and disallow certain icons.
158 | ```php
159 | // Allow ONLY heroicon-o-user and heroicon-o-users
160 | IconPicker::make('icon')
161 | ->allowIcons(['heroicon-o-user', 'heroicon-o-users']);
162 | ```
163 |
164 | ```php
165 | // Allow ALL fontawesome icons, EXCEPT fas-user
166 | IconPicker::make('icon')
167 | ->disallowIcons(['fas-user']);
168 | ```
169 |
170 |
171 | #### Layout
172 | The icon picker comes with two layouts. The default, `Layout::FLOATING` is the standard layout used in Filament Selects. The search results will appear in a pop over window.
173 |
174 | The `Layout::ON_TOP` will render the search results always on the page.
175 |
176 | ```php
177 | //
178 | IconPicker::make('icon')
179 | ->layout(Layout::FLOATING) // default
180 | //or
181 | ->layout(Layout::ON_TOP)
182 | ```
183 |
184 | #### Custom Item Template
185 | Out of the box, the search results render a preview of the icon and their identifier.
186 | You are free to customize this using the `->itemTemplate()` option:
187 |
188 | ```php
189 | // Render your.blade.template instead of the default template.
190 | // Make sure to pass the $icon as parameter to be able to render it in your view.
191 | IconPicker::make('icon')
192 | ->itemTemplate(
193 | fn($icon) => view('your.blade.template', ['icon' => $icon])
194 | );
195 | ```
196 |
197 | #### Caching
198 | Depending on how many icon packs you use and their size, the loading time
199 | for getting the search results can be high. In order to mitigate this
200 | issue a bit, search results are by default cached (for 7 days).
201 |
202 | You can configure the default caching options for all icon pickers in the configuration file.
203 |
204 | To configure a specific IconPicker, these methods are available:
205 | ```php
206 | IconPicker::make('icon')
207 | // Disable caching
208 | ->cacheable(false)
209 |
210 | // Cache for one hour
211 | ->cacheDuration(3600);
212 | ```
213 |
214 | [//]: # (## Testing)
215 |
216 | [//]: # ()
217 | [//]: # (```bash)
218 |
219 | [//]: # (composer test)
220 |
221 | [//]: # (```)
222 |
223 | ## Changelog
224 |
225 | Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
226 |
227 | ## Contributing
228 |
229 | Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
230 |
231 | ## Security Vulnerabilities
232 |
233 | Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
234 |
235 | ## Credits
236 |
237 | - [Lukas Frey](https://github.com/LukasFreyCZ)
238 | - [All Contributors](../../contributors)
239 |
240 | ## License
241 |
242 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
243 |
244 | ## Other packages
245 | - [Laravel Populator](https://github.com/GuavaCZ/laravel-populator)
246 | - [Filament Drafts](https://github.com/GuavaCZ/filament-drafts)
247 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "guava/filament-icon-picker",
3 | "description": "A filament plugin that adds an icon picker field.",
4 | "type": "library",
5 | "license": "MIT",
6 | "authors": [
7 | {
8 | "name": "Lukas Frey",
9 | "email": "mail@lukasfrey.cz"
10 | }
11 | ],
12 | "autoload": {
13 | "psr-4": {
14 | "Guava\\FilamentIconPicker\\": "src"
15 | }
16 | },
17 | "require-dev": {
18 | "orchestra/testbench": "^7.0|^8.0|^9.0"
19 | },
20 | "require": {
21 | "php": "^8.0",
22 | "filament/filament": "^3.0@stable"
23 | },
24 | "extra": {
25 | "laravel": {
26 | "providers": [
27 | "Guava\\FilamentIconPicker\\FilamentIconPickerServiceProvider"
28 | ]
29 | }
30 | },
31 | "minimum-stability": "dev",
32 | "prefer-stable": true
33 | }
34 |
--------------------------------------------------------------------------------
/config/icon-picker.php:
--------------------------------------------------------------------------------
1 | null,
19 | // example:
20 | // 'sets' => 'heroicons',
21 | // 'sets' => [
22 | // 'heroicons',
23 | // 'fontawesome-solid',
24 | // ],
25 |
26 | /*
27 | |--------------------------------------------------------------------------
28 | | Default Columns
29 | |--------------------------------------------------------------------------
30 | |
31 | | This is the default value for the columns configuration. It is used by
32 | | every icon picker, when not set explicitly.
33 | |
34 | | Can be either an integer from 1 - 12 or an array of integers
35 | | with breakpoints (default, sm, md, lg, xl, 2xl) as the key.
36 | |
37 | */
38 | 'columns' => 1,
39 | // example:
40 | // 'columns' => [
41 | // 'default' => 1,
42 | // 'lg' => 3,
43 | // '2xl' => 5,
44 | // ],
45 |
46 | /*
47 | |--------------------------------------------------------------------------
48 | | Default Layout
49 | |--------------------------------------------------------------------------
50 | |
51 | | This is the default value for the layout configuration. It is used by
52 | | every icon picker, when not set explicitly.
53 | |
54 | | FLOATING: The select will behave the same way as the default filament
55 | | select. It will show when selected and hide when clicked outside.
56 | |
57 | | ON_TOP: The select options will always be visible in a catalogue-like
58 | | grid view.
59 | |
60 | */
61 | 'layout' => \Guava\FilamentIconPicker\Layout::FLOATING,
62 |
63 | /*
64 | |--------------------------------------------------------------------------
65 | | Caching
66 | |--------------------------------------------------------------------------
67 | |
68 | | This section lets you configure the caching option of the plugin.
69 | |
70 | | Since icon packs are often packed with a lots of icons,
71 | | searching through all of them can take quite a lot of time, which is
72 | | why the plugin caches each field with it's configuration and search queries.
73 | |
74 | | This section let's you configure how caching should be done or disable it
75 | | if you wish.
76 | |
77 | */
78 | 'cache' => [
79 | 'enabled' => true,
80 | 'duration' => '7 days',
81 | ],
82 |
83 | ];
84 |
--------------------------------------------------------------------------------
/dist/plugin.css:
--------------------------------------------------------------------------------
1 | .filament-icon-picker .choices>.choices__list{padding-left:.5rem;padding-right:.5rem}.filament-icon-picker .choices>.choices__inner>.choices__list.choices__list--single{width:100%}.filament-icon-picker.filament-icon-picker-on_top .choices>.choices__list{visibility:visible;position:relative;padding-left:.5rem;padding-right:.5rem}.filament-icon-picker.filament-icon-picker-on_top .choices>.choices__inner{background-image:none;padding-left:.75rem;padding-right:.75rem}.filament-icon-picker.filament-icon-picker-on_top .choices>.choices__inner>.choices__list.choices__list--single{position:relative;padding-left:0;padding-right:0}.filament-icon-picker.filament-icon-picker-on_top .choices>.choices__inner>.choices__list.choices__list--single .choices__button{position:absolute;margin-right:.5rem}.filament-icon-picker .choices>.choices__list .choices__list{gap:.5rem;padding-bottom:.5rem}.filament-icon-picker .choices>.choices__list .choices__list .choices__item{border-radius:.5rem;border-width:1px;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filament-icon-picker .choices>.choices__list .choices__list .choices__item:hover{cursor:pointer}.filament-icon-picker .choices>.choices__list .choices__list .choices__item.choices__item--disabled,.filament-icon-picker .choices>.choices__list .choices__list .choices__item.has-no-choices,.filament-icon-picker .choices>.choices__list .choices__list .choices__item.has-no-results{border-style:none;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.filament-icon-picker .choices>.choices__list .choices__list{display:grid}.\!h-16{height:4rem!important}.h-12{height:3rem}.w-12{width:3rem}.shrink-0{flex-shrink:0}.grow-0{flex-grow:0}.filament-icon-picker .choices>.choices__list .choices__list .choices__item.choices__item--disabled,.filament-icon-picker .choices>.choices__list .choices__list .choices__item.has-no-choices,.filament-icon-picker .choices>.choices__list .choices__list .choices__item.has-no-results{grid-column:1/-1}.filament-icon-picker[default="1"] .choices>.choices__list .choices__list{grid-template-columns:repeat(1,minmax(0,1fr))}.filament-icon-picker[default="2"] .choices>.choices__list .choices__list{grid-template-columns:repeat(2,minmax(0,1fr))}.filament-icon-picker[default="3"] .choices>.choices__list .choices__list{grid-template-columns:repeat(3,minmax(0,1fr))}.filament-icon-picker[default="4"] .choices>.choices__list .choices__list{grid-template-columns:repeat(4,minmax(0,1fr))}.filament-icon-picker[default="5"] .choices>.choices__list .choices__list{grid-template-columns:repeat(5,minmax(0,1fr))}.filament-icon-picker[default="6"] .choices>.choices__list .choices__list{grid-template-columns:repeat(6,minmax(0,1fr))}.filament-icon-picker[default="7"] .choices>.choices__list .choices__list{grid-template-columns:repeat(7,minmax(0,1fr))}.filament-icon-picker[default="8"] .choices>.choices__list .choices__list{grid-template-columns:repeat(8,minmax(0,1fr))}.filament-icon-picker[default="9"] .choices>.choices__list .choices__list{grid-template-columns:repeat(9,minmax(0,1fr))}.filament-icon-picker[default="10"] .choices>.choices__list .choices__list{grid-template-columns:repeat(10,minmax(0,1fr))}.filament-icon-picker[default="11"] .choices>.choices__list .choices__list{grid-template-columns:repeat(11,minmax(0,1fr))}.filament-icon-picker[default="12"] .choices>.choices__list .choices__list{grid-template-columns:repeat(12,minmax(0,1fr))}@media (min-width:640px){.filament-icon-picker[sm="1"] .choices>.choices__list .choices__list{grid-template-columns:repeat(1,minmax(0,1fr))}.filament-icon-picker[sm="2"] .choices>.choices__list .choices__list{grid-template-columns:repeat(2,minmax(0,1fr))}.filament-icon-picker[sm="3"] .choices>.choices__list .choices__list{grid-template-columns:repeat(3,minmax(0,1fr))}.filament-icon-picker[sm="4"] .choices>.choices__list .choices__list{grid-template-columns:repeat(4,minmax(0,1fr))}.filament-icon-picker[sm="5"] .choices>.choices__list .choices__list{grid-template-columns:repeat(5,minmax(0,1fr))}.filament-icon-picker[sm="6"] .choices>.choices__list .choices__list{grid-template-columns:repeat(6,minmax(0,1fr))}.filament-icon-picker[sm="7"] .choices>.choices__list .choices__list{grid-template-columns:repeat(7,minmax(0,1fr))}.filament-icon-picker[sm="8"] .choices>.choices__list .choices__list{grid-template-columns:repeat(8,minmax(0,1fr))}.filament-icon-picker[sm="9"] .choices>.choices__list .choices__list{grid-template-columns:repeat(9,minmax(0,1fr))}.filament-icon-picker[sm="10"] .choices>.choices__list .choices__list{grid-template-columns:repeat(10,minmax(0,1fr))}.filament-icon-picker[sm="11"] .choices>.choices__list .choices__list{grid-template-columns:repeat(11,minmax(0,1fr))}.filament-icon-picker[sm="12"] .choices>.choices__list .choices__list{grid-template-columns:repeat(12,minmax(0,1fr))}}@media (min-width:768px){.filament-icon-picker[md="1"] .choices>.choices__list .choices__list{grid-template-columns:repeat(1,minmax(0,1fr))}.filament-icon-picker[md="2"] .choices>.choices__list .choices__list{grid-template-columns:repeat(2,minmax(0,1fr))}.filament-icon-picker[md="3"] .choices>.choices__list .choices__list{grid-template-columns:repeat(3,minmax(0,1fr))}.filament-icon-picker[md="4"] .choices>.choices__list .choices__list{grid-template-columns:repeat(4,minmax(0,1fr))}.filament-icon-picker[md="5"] .choices>.choices__list .choices__list{grid-template-columns:repeat(5,minmax(0,1fr))}.filament-icon-picker[md="6"] .choices>.choices__list .choices__list{grid-template-columns:repeat(6,minmax(0,1fr))}.filament-icon-picker[md="7"] .choices>.choices__list .choices__list{grid-template-columns:repeat(7,minmax(0,1fr))}.filament-icon-picker[md="8"] .choices>.choices__list .choices__list{grid-template-columns:repeat(8,minmax(0,1fr))}.filament-icon-picker[md="9"] .choices>.choices__list .choices__list{grid-template-columns:repeat(9,minmax(0,1fr))}.filament-icon-picker[md="10"] .choices>.choices__list .choices__list{grid-template-columns:repeat(10,minmax(0,1fr))}.filament-icon-picker[md="11"] .choices>.choices__list .choices__list{grid-template-columns:repeat(11,minmax(0,1fr))}.filament-icon-picker[md="12"] .choices>.choices__list .choices__list{grid-template-columns:repeat(12,minmax(0,1fr))}}@media (min-width:1024px){.filament-icon-picker[lg="1"] .choices>.choices__list .choices__list{grid-template-columns:repeat(1,minmax(0,1fr))}.filament-icon-picker[lg="2"] .choices>.choices__list .choices__list{grid-template-columns:repeat(2,minmax(0,1fr))}.filament-icon-picker[lg="3"] .choices>.choices__list .choices__list{grid-template-columns:repeat(3,minmax(0,1fr))}.filament-icon-picker[lg="4"] .choices>.choices__list .choices__list{grid-template-columns:repeat(4,minmax(0,1fr))}.filament-icon-picker[lg="5"] .choices>.choices__list .choices__list{grid-template-columns:repeat(5,minmax(0,1fr))}.filament-icon-picker[lg="6"] .choices>.choices__list .choices__list{grid-template-columns:repeat(6,minmax(0,1fr))}.filament-icon-picker[lg="7"] .choices>.choices__list .choices__list{grid-template-columns:repeat(7,minmax(0,1fr))}.filament-icon-picker[lg="8"] .choices>.choices__list .choices__list{grid-template-columns:repeat(8,minmax(0,1fr))}.filament-icon-picker[lg="9"] .choices>.choices__list .choices__list{grid-template-columns:repeat(9,minmax(0,1fr))}.filament-icon-picker[lg="10"] .choices>.choices__list .choices__list{grid-template-columns:repeat(10,minmax(0,1fr))}.filament-icon-picker[lg="11"] .choices>.choices__list .choices__list{grid-template-columns:repeat(11,minmax(0,1fr))}.filament-icon-picker[lg="12"] .choices>.choices__list .choices__list{grid-template-columns:repeat(12,minmax(0,1fr))}}@media (min-width:1280px){.filament-icon-picker[xl="1"] .choices>.choices__list .choices__list{grid-template-columns:repeat(1,minmax(0,1fr))}.filament-icon-picker[xl="2"] .choices>.choices__list .choices__list{grid-template-columns:repeat(2,minmax(0,1fr))}.filament-icon-picker[xl="3"] .choices>.choices__list .choices__list{grid-template-columns:repeat(3,minmax(0,1fr))}.filament-icon-picker[xl="4"] .choices>.choices__list .choices__list{grid-template-columns:repeat(4,minmax(0,1fr))}.filament-icon-picker[xl="5"] .choices>.choices__list .choices__list{grid-template-columns:repeat(5,minmax(0,1fr))}.filament-icon-picker[xl="6"] .choices>.choices__list .choices__list{grid-template-columns:repeat(6,minmax(0,1fr))}.filament-icon-picker[xl="7"] .choices>.choices__list .choices__list{grid-template-columns:repeat(7,minmax(0,1fr))}.filament-icon-picker[xl="8"] .choices>.choices__list .choices__list{grid-template-columns:repeat(8,minmax(0,1fr))}.filament-icon-picker[xl="9"] .choices>.choices__list .choices__list{grid-template-columns:repeat(9,minmax(0,1fr))}.filament-icon-picker[xl="10"] .choices>.choices__list .choices__list{grid-template-columns:repeat(10,minmax(0,1fr))}.filament-icon-picker[xl="11"] .choices>.choices__list .choices__list{grid-template-columns:repeat(11,minmax(0,1fr))}.filament-icon-picker[xl="12"] .choices>.choices__list .choices__list{grid-template-columns:repeat(12,minmax(0,1fr))}}@media (min-width:1536px){.filament-icon-picker[\2xl="1"] .choices>.choices__list .choices__list{grid-template-columns:repeat(1,minmax(0,1fr))}.filament-icon-picker[\2xl="2"] .choices>.choices__list .choices__list{grid-template-columns:repeat(2,minmax(0,1fr))}.filament-icon-picker[\2xl="3"] .choices>.choices__list .choices__list{grid-template-columns:repeat(3,minmax(0,1fr))}.filament-icon-picker[\2xl="4"] .choices>.choices__list .choices__list{grid-template-columns:repeat(4,minmax(0,1fr))}.filament-icon-picker[\2xl="5"] .choices>.choices__list .choices__list{grid-template-columns:repeat(5,minmax(0,1fr))}.filament-icon-picker[\2xl="6"] .choices>.choices__list .choices__list{grid-template-columns:repeat(6,minmax(0,1fr))}.filament-icon-picker[\2xl="7"] .choices>.choices__list .choices__list{grid-template-columns:repeat(7,minmax(0,1fr))}.filament-icon-picker[\2xl="8"] .choices>.choices__list .choices__list{grid-template-columns:repeat(8,minmax(0,1fr))}.filament-icon-picker[\2xl="9"] .choices>.choices__list .choices__list{grid-template-columns:repeat(9,minmax(0,1fr))}.filament-icon-picker[\2xl="10"] .choices>.choices__list .choices__list{grid-template-columns:repeat(10,minmax(0,1fr))}.filament-icon-picker[\2xl="11"] .choices>.choices__list .choices__list{grid-template-columns:repeat(11,minmax(0,1fr))}.filament-icon-picker[\2xl="12"] .choices>.choices__list .choices__list{grid-template-columns:repeat(12,minmax(0,1fr))}}
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@guava/filament-icon-picker",
3 | "scripts": {
4 | "dev": "npx tailwindcss -i resources/css/plugin.css -o dist/plugin.css --postcss --watch",
5 | "build": "npx tailwindcss -i resources/css/plugin.css -o dist/plugin.css --postcss --minify && npm run purge",
6 | "purge": "filament-purge -i dist/plugin.css -o dist/plugin.css -v 3.x"
7 | },
8 | "devDependencies": {
9 | "@semantic-release/changelog": "^6.0.1",
10 | "@semantic-release/commit-analyzer": "^9.0.2",
11 | "@semantic-release/github": "^8.0.6",
12 | "@semantic-release/release-notes-generator": "^10.0.3",
13 | "autoprefixer": "^10.4.12",
14 | "postcss": "^8.4.17",
15 | "semantic-release": "^19.0.5",
16 | "tailwindcss": "^3.1.8"
17 | },
18 | "dependencies": {
19 | "@awcodes/filament-plugin-purge": "^1.0.2",
20 | "conventional-changelog-conventionalcommits": "^5.0.0",
21 | "postcss-for": "^2.1.1"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | plugins: {
3 | "postcss-for": {},
4 | tailwindcss: {},
5 | autoprefixer: {},
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/release.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "plugins": [
3 | ["@semantic-release/commit-analyzer", {
4 | "preset": "conventionalcommits",
5 | "releaseRules": [
6 | {"type": "docs", "scope":"README", "release": "patch"},
7 | {"type": "refactor", "release": "patch"},
8 | {"type": "chore", "release": "patch"},
9 | {"type": "style", "release": "patch"},
10 | {"type": "test", "release": "patch"},
11 | {"type": "perf", "release": "patch"}
12 | ],
13 | "presetConfig": {
14 | "types": [
15 | {"type": "feat", "section": "Features"},
16 | {"type": "fix", "section": "Bug Fixes"},
17 | {"type": "chore", "hidden": true},
18 | {"type": "docs", "hidden": true},
19 | {"type": "style", "hidden": true},
20 | {"type": "refactor", "hidden": true},
21 | {"type": "perf", "hidden": true},
22 | {"type": "test", "hidden": true}
23 | ]
24 | }
25 | }],
26 | ["@semantic-release/release-notes-generator", {
27 | "preset": "conventionalcommits"
28 | }],
29 | ["@semantic-release/github", {
30 | "assets": [
31 | {"path": "dist/plugin.css", "label": "CSS distribution"},
32 | ]
33 | }],
34 | ["@semantic-release/changelog",
35 | {
36 | "changelogFile": "CHANGELOG.md"
37 | }
38 | ],
39 | ["@semantic-release/npm", {
40 | "tarballDir": "release",
41 | "npmPublish": false
42 | }],
43 | ],
44 | "branches": ["main", "next"],
45 | "tagFormat": "${version}"
46 | }
47 |
--------------------------------------------------------------------------------
/resources/css/plugin.css:
--------------------------------------------------------------------------------
1 | @tailwind components;
2 | @tailwind utilities;
3 |
4 | @layer components {
5 | .filament-icon-picker .choices > .choices__list {
6 | @apply px-2;
7 | }
8 |
9 | .filament-icon-picker .choices > .choices__inner > .choices__list.choices__list--single {
10 | @apply w-full;
11 | }
12 |
13 | .filament-icon-picker.filament-icon-picker-on_top .choices > .choices__list {
14 | @apply visible relative px-2;
15 | }
16 |
17 | .filament-icon-picker.filament-icon-picker-on_top .choices > .choices__inner {
18 | @apply bg-none px-3;
19 | }
20 |
21 | .filament-icon-picker.filament-icon-picker-on_top .choices > .choices__inner > .choices__list.choices__list--single {
22 | @apply relative px-0;
23 | }
24 |
25 | .filament-icon-picker.filament-icon-picker-on_top .choices > .choices__inner > .choices__list.choices__list--single .choices__button {
26 | @apply absolute mr-2;
27 | }
28 |
29 | .filament-icon-picker .choices > .choices__list .choices__list {
30 | @apply pb-2 gap-2;
31 | }
32 |
33 | .filament-icon-picker .choices > .choices__list .choices__list .choices__item {
34 | @apply hover:cursor-pointer border-[1px] rounded-lg shadow-sm;
35 | }
36 |
37 | .filament-icon-picker .choices > .choices__list .choices__list .choices__item.has-no-choices,
38 | .filament-icon-picker .choices > .choices__list .choices__list .choices__item.has-no-results,
39 | .filament-icon-picker .choices > .choices__list .choices__list .choices__item.choices__item--disabled {
40 | @apply border-none shadow-none;
41 | }
42 |
43 | .filament-icon-picker .choices > .choices__list .choices__list {
44 | @apply grid;
45 | }
46 | }
47 | .filament-icon-picker .choices > .choices__list .choices__list .choices__item.has-no-choices,
48 | .filament-icon-picker .choices > .choices__list .choices__list .choices__item.has-no-results,
49 | .filament-icon-picker .choices > .choices__list .choices__list .choices__item.choices__item--disabled {
50 | @apply col-span-full;
51 | }
52 |
53 | @for $i from 1 to 12 {
54 | .filament-icon-picker[default="$(i)"] .choices > .choices__list .choices__list {
55 | @apply grid-cols-[repeat($(i),_minmax(0,_1fr))]
56 | }
57 | }
58 |
59 | @for $i from 1 to 12 {
60 | .filament-icon-picker[sm="$(i)"] .choices > .choices__list .choices__list {
61 | @apply sm:grid-cols-[repeat($(i),_minmax(0,_1fr))]
62 | }
63 | }
64 | @for $i from 1 to 12 {
65 | .filament-icon-picker[md="$(i)"] .choices > .choices__list .choices__list {
66 | @apply md:grid-cols-[repeat($(i),_minmax(0,_1fr))]
67 | }
68 | }
69 | @for $i from 1 to 12 {
70 | .filament-icon-picker[lg="$(i)"] .choices > .choices__list .choices__list {
71 | @apply lg:grid-cols-[repeat($(i),_minmax(0,_1fr))]
72 | }
73 | }
74 | @for $i from 1 to 12 {
75 | .filament-icon-picker[xl="$(i)"] .choices > .choices__list .choices__list {
76 | @apply xl:grid-cols-[repeat($(i),_minmax(0,_1fr))]
77 | }
78 | }
79 | @for $i from 1 to 12 {
80 | .filament-icon-picker[\2xl="$(i)"] .choices > .choices__list .choices__list {
81 | @apply 2xl:grid-cols-[repeat($(i),_minmax(0,_1fr))]
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/resources/views/forms/icon-picker.blade.php:
--------------------------------------------------------------------------------
1 |