Skip to content

Commit

Permalink
add dynamic icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiritin committed May 27, 2024
1 parent 037f187 commit 8bb6b58
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/Filament/Resources/AppResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,14 @@ public static function form(Form $form): Form
Checkbox::make('public')->hint('App is publicly visible (ignoring group selection)'),
TextInput::make('name')->required(),
TextInput::make('description')->required(),
Select::make('icon')->options([
"TicketDuotone" => "TicketDuotone",
"CogsDuotone" => "CogsDuotone",
])->hint('Request new Icons @ Thiritin')->required(),
Select::make('icon')->options(function () {
return collect(scandir(resource_path('js/Components/Icons')))
->filter(fn($icon) => !in_array($icon, ['.', '..']))
->map(fn($icon) => str_replace('.vue', '', $icon))
->values()
->keyBy(fn($icon) => $icon)
->toArray();
})->hint('Request new Icons @ Thiritin')->required(),
TextInput::make('url')->url(),
]),
Card::make()->schema([
Expand Down
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/ChairOfficeSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 448 512"><!--!Font Awesome Pro 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.-->
<path
d="M64 224v-64c0-17.7-14.3-32-32-32S0 142.3 0 160v64c0 17.7 14.3 32 32 32s32-14.3 32-32zm352-96c-17.7 0-32 14.3-32 32v64c0 17.7 14.3 32 32 32s32-14.3 32-32v-64c0-17.7-14.3-32-32-32zm-64-64c0-35.4-28.7-64-64-64H160c-35.4 0-64 28.7-64 64v192h256V64zm51.7 245.9A32 32 0 0 0 373.3 288H74.7c-13.8 0-26 8.8-30.4 21.9l-10.7 32C26.8 362.6 42.2 384 64 384H192v67.4c-28.3 6-51 19.7-61.9 37.2-6.4 10.3 2.4 23.4 15 23.4h157.7c12.6 0 21.4-13.1 15-23.4-10.9-17.5-33.6-31.2-61.9-37.2V384h128c21.8 0 37.3-21.4 30.4-42.1l-10.7-32z"/>
</svg>
</template>

<style scoped>
</style>
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/FoldersSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 640 512"><!--!Font Awesome Pro 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc.-->
<path
d="M96 336V128H48c-26.5 0-48 21.5-48 48v288c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48v-48H176c-44.1 0-80-35.9-80-80zM592 64H400L336 0H176c-26.5 0-48 21.5-48 48v288c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48z"/>
</svg>
</template>

<style scoped>
</style>
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/IdBadgeSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 384 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path
d="M336 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM144 32h96c8.8 0 16 7.2 16 16s-7.2 16-16 16h-96c-8.8 0-16-7.2-16-16s7.2-16 16-16zm48 128c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H102.4C90 416 80 407.4 80 396.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2z"/>
</svg>
</template>

<style scoped>
</style>
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/QuestionSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 384 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path
d="M202 0C122.2 0 70.5 32.7 29.9 91c-7.4 10.6-5.1 25.1 5.2 32.9l43.1 32.7c10.4 7.9 25.1 6 33.3-4.1 25-31.4 43.6-49.4 82.8-49.4 30.8 0 68.8 19.8 68.8 49.6 0 22.6-18.6 34.1-49 51.2-35.4 19.9-82.3 44.6-82.3 106.4V320c0 13.3 10.7 24 24 24h72.5c13.3 0 24-10.7 24-24v-5.8c0-42.9 125.3-44.6 125.3-160.6C377.5 66.3 286.9 0 202 0zM192 373.5c-38.2 0-69.3 31.1-69.3 69.3 0 38.2 31.1 69.3 69.3 69.3s69.3-31.1 69.3-69.3-31.1-69.3-69.3-69.3z"/>
</svg>
</template>

<style scoped>
</style>
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/ShipSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 640 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path
d="M496.6 372.6l70-70c16.9-16.9 9.9-45.8-12.8-53.1L512 236.1V96c0-17.7-14.3-32-32-32h-64V24c0-13.3-10.7-24-24-24H248c-13.3 0-24 10.7-24 24v40h-64c-17.7 0-32 14.3-32 32v140.1l-41.8 13.4c-22.8 7.3-29.8 36.2-12.8 53.1l70 70C125.8 416.3 85.6 448 24 448c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24 61 0 107.5-20.6 143.3-59.4C181.7 487.4 216 512 256 512h128c40 0 74.3-24.6 88.7-59.4C508.5 491.4 555 512 616 512c13.3 0 24-10.7 24-24v-16c0-13.3-10.7-24-24-24-60.8 0-101.5-31-119.4-75.4zM192 128h256v87.5l-118.2-38a32 32 0 0 0 -19.6 0L192 215.5V128z"/>
</svg>
</template>

<style scoped>
</style>
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/StoreSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 616 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path
d="M602 118.6L537.1 15C531.3 5.7 521 0 510 0H106C95 0 84.7 5.7 78.9 15L14 118.6c-33.5 53.5-3.8 127.9 58.8 136.4 4.5 .6 9.1 .9 13.7 .9 29.6 0 55.8-13 73.8-33.1 18 20.1 44.3 33.1 73.8 33.1 29.6 0 55.8-13 73.8-33.1 18 20.1 44.3 33.1 73.8 33.1 29.6 0 55.8-13 73.8-33.1 18.1 20.1 44.3 33.1 73.8 33.1 4.7 0 9.2-.3 13.7-.9 62.8-8.4 92.6-82.8 59-136.4zM529.5 288c-10 0-19.9-1.5-29.5-3.8V384H116v-99.8c-9.6 2.2-19.5 3.8-29.5 3.8-6 0-12.1-.4-18-1.2-5.6-.8-11.1-2.1-16.4-3.6V480c0 17.7 14.3 32 32 32h448c17.7 0 32-14.3 32-32V283.2c-5.4 1.6-10.8 2.9-16.4 3.6-6.1 .8-12.1 1.2-18.2 1.2z"/>
</svg>
</template>

<style scoped>
</style>
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/TruckLoadingSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 640 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path
d="M50.2 375.6c2.3 8.5 11.1 13.6 19.6 11.3l216.4-58c8.5-2.3 13.6-11.1 11.3-19.6l-49.7-185.5c-2.3-8.5-11.1-13.6-19.6-11.3L151 133.3l24.8 92.7-61.8 16.5-24.8-92.7-77.3 20.7C3.4 172.8-1.7 181.6 .6 190.1l49.6 185.5zM384 0c-17.7 0-32 14.3-32 32v323.6L5.9 450c-4.3 1.2-6.8 5.6-5.6 9.8l12.6 46.3c1.2 4.3 5.6 6.8 9.8 5.6l393.7-107.4C418.8 464.1 467.6 512 528 512c61.9 0 112-50.1 112-112V0H384zm144 448c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48z"/>
</svg>
</template>

<style scoped>
</style>
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/UserShieldSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 640 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path
d="M622.3 271.1l-115.2-45c-4.1-1.6-12.6-3.7-22.2 0l-115.2 45c-10.7 4.2-17.7 14-17.7 24.9 0 111.6 68.7 188.8 132.9 213.9 9.6 3.7 18 1.6 22.2 0C558.4 489.9 640 420.5 640 296c0-10.9-7-20.7-17.7-24.9zM496 462.4V273.3l95.5 37.3c-5.6 87.1-60.9 135.4-95.5 151.8zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm96 40c0-2.5 .8-4.8 1.1-7.2-2.5-.1-4.9-.8-7.5-.8h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c6.8 0 13.3-1.5 19.2-4-54-42.9-99.2-116.7-99.2-212z"/>
</svg>
</template>

<style scoped>
</style>
15 changes: 15 additions & 0 deletions resources/js/Components/Icons/VideoSolidIcon.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<script setup>
</script>

<template>
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path
d="M336.2 64H47.8C21.4 64 0 85.4 0 111.8v288.4C0 426.6 21.4 448 47.8 448h288.4c26.4 0 47.8-21.4 47.8-47.8V111.8c0-26.4-21.4-47.8-47.8-47.8zm189.4 37.7L416 177.3v157.4l109.6 75.5c21.2 14.6 50.4-.3 50.4-25.8V127.5c0-25.4-29.1-40.4-50.4-25.8z"/>
</svg>
</template>

<style scoped>
</style>

0 comments on commit 8bb6b58

Please sign in to comment.