Skip to content

Commit b680be3

Browse files
committed
fix: core shows only Lucide icons: the default bulk delete action, scaffolded menu items, date pickers, select, login prompt and skeletons no longer use flowbite icons and inline SVG AdminForth/2005
1 parent 8e9711b commit b680be3

18 files changed

Lines changed: 26 additions & 108 deletions

‎adminforth/commands/createApp/templates/index.ts.hbs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const admin = new AdminForth({
7070
{ type: 'heading', label: 'SYSTEM' },
7171
{
7272
label: 'Users',
73-
icon: 'flowbite:user-solid',
73+
icon: 'lucide:user',
7474
resourceId: 'adminuser'
7575
},
7676
],

‎adminforth/commands/createResource/injectResourceIntoIndex.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export async function injectResourceIntoIndex({
1818
table,
1919
resourceId,
2020
label,
21-
icon = "flowbite:user-solid",
21+
icon = "lucide:user",
2222
}) {
2323
let code = await fs.readFile(indexFilePath, "utf-8");
2424
const ast = recast.parse(code, { parser });

‎adminforth/commands/createResource/main.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ export default async function createResource(args) {
5959
table: resourceId,
6060
resourceId: resourceId,
6161
label: toTitleCase(table.table),
62-
icon: "flowbite:user-solid",
62+
icon: "lucide:user",
6363
});
6464
}

‎adminforth/design/system-concepts.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Below `sm` (640px) a Dialog or Modal docks to the bottom edge as a sheet: full w
3838
- Use Lucide: `@iconify-prerendered/vue-lucide` in components (`IconPencil`, `IconTrash2`), `lucide:<name>` in config (`icon: 'lucide:download'`).
3939
- 16px (`w-4 h-4`) in controls and menus. Icons are muted (`text-lightInputIconColor`), destructive items color their icon too.
4040
- Don't add icons from other sets; replace flowbite, heroicons and humbleicons icons with Lucide when you touch a component. The old sets stay installed because apps and older plugins still import them.
41+
- Don't draw icons with inline `<svg>` or keep them as own `.vue` files, take the Lucide component. Inline SVG is only for graphics which are not icons: the two-tone `Spinner` ring, the `Toast` timer ring, charts.
4142

4243
## Moving off flowbite
4344

‎adminforth/modules/configValidator.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ export default class ConfigValidator implements IConfigValidator {
270270

271271
bulkActions.push({
272272
label: `Delete checked`,
273-
icon: 'flowbite:trash-bin-outline',
273+
icon: 'lucide:trash-2',
274274
confirm: {
275275
title: 'Are you sure you want to delete selected items?',
276276
message: 'Deleting {count} item. This process is irreversible. | Deleting {count} items. This process is irreversible.',

‎adminforth/spa/src/afcl/DatePicker.vue‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div>
2323
<div class="relative">
2424
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
25-
<IconTime class="w-4 h-4 text-lightDatePickerIcon dark:text-darkDatePickerIcon bg-lightDatePickerButtonBackground dark:bg-darkDatePickerButtonBackground"/>
25+
<IconClock class="w-4 h-4 text-lightDatePickerIcon dark:text-darkDatePickerIcon bg-lightDatePickerButtonBackground dark:bg-darkDatePickerButtonBackground"/>
2626
</div>
2727
<input v-model="startTime" type="time" id="start-time" step="1"
2828
class="af-pick-time-button bg-lightDatePickerButtonBackground border border-lightDatePickerButtonBorder text-lightDatePickerButtonText text-sm rounded-default block w-full px-2.5 py-1.5 leading-5 shadow-customLight focus:outline-none focus:ring-[3px] focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder dark:bg-darkInputBackground dark:border-darkInputBorder dark:placeholder-darkInputPlaceholderText dark:text-darkDatePickerButtonText focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder"
@@ -35,12 +35,7 @@
3535
class="text-lightDatePickerExpandText dark:text-darkDatePickerExpandText text-[13px] font-medium hover:underline p-0 inline-flex items-center gap-0.5 mb-2"
3636
:class="{hidden: column.type !== 'datetime'}"
3737
@click="toggleTimeInputs">{{ showTimeInputs ? $t('Hide time') : $t('Show time') }}
38-
<svg class="w-4 h-4" :class="{'rotate-180': showTimeInputs}" aria-hidden="true"
39-
xmlns="http://www.w3.org/2000/svg" width="24" height="24"
40-
fill="none" viewBox="0 0 24 24">
41-
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
42-
d="m8 10 4 4 4-4"/>
43-
</svg>
38+
<IconChevronDown class="w-4 h-4" :class="{'rotate-180': showTimeInputs}"/>
4439
</button>
4540
</div>
4641
</div>
@@ -53,8 +48,7 @@ import utc from 'dayjs/plugin/utc';
5348
import {useCoreStore} from '@/stores/core';
5449
import {FLEXIBLE_DATEPICKER_FORMAT} from '@/utils/dateUtils';
5550
56-
import IconCalendar from "@/components/icons/IconCalendar.vue";
57-
import IconTime from "@/components/icons/IconTime.vue";
51+
import { IconCalendar, IconChevronDown, IconClock } from '@iconify-prerendered/vue-lucide';
5852
5953
const coreStore = useCoreStore();
6054
dayjs.extend(utc)

‎adminforth/spa/src/afcl/Select.vue‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,7 @@
106106
class="z-index-100 flex-shrink-0 ml-1 h-4 w-4 -mr-1 rounded-full inline-flex items-center justify-center text-lightDropdownMultipleSelectIcon hover:text-lightDropdownMultipleSelectIconHover dark:text-darkDropdownMultipleSelectIcon dark:hover:text-darkDropdownMultipleSelectIconHover focus:outline-none focus:text-lightDropdownMultipleSelectIconFocus focus:bg-lightDropdownMultipleSelectIconFocusBackground dark:focus:text-darkDropdownMultipleSelectIconFocus dark:focus:bg-darkDropdownMultipleSelectIconFocusBackground"
107107
>
108108
<span class="sr-only">{{ $t('Remove item') }}</span>
109-
<svg class="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8">
110-
<path
111-
stroke-linecap="round"
112-
stroke-linejoin="round"
113-
stroke-width="1.5"
114-
d="M1 1l6 6m0-6L1 7"
115-
/>
116-
</svg>
109+
<IconX class="h-3 w-3" />
117110
</button>
118111
</div>
119112
</template>
@@ -123,7 +116,7 @@
123116

124117
<script setup lang="ts">
125118
import { ref, computed, onMounted, onUnmounted, watch, nextTick, useId,type PropType, type Ref } from 'vue';
126-
import { IconChevronDown } from '@iconify-prerendered/vue-lucide';
119+
import { IconChevronDown, IconX } from '@iconify-prerendered/vue-lucide';
127120
import { useElementSize } from '@vueuse/core'
128121
129122
type ISingleSelectModelValue = string | number | boolean | null;
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
<template>
22
<div v-if="type === 'image'" role="status" class="flex animate-pulse items-center justify-center bg-lightSkeletonBackgroundColor rounded dark:bg-darkSkeletonBackgroundColor">
3-
<svg class="w-10 h-10 text-lightSkeletonIconColor dark:text-darkSkeletonIconColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 18">
4-
<path d="M18 0H2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2Zm-5.5 4a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3Zm4.376 10.481A1 1 0 0 1 16 15H4a1 1 0 0 1-.895-1.447l3.5-7A1 1 0 0 1 7.468 6a.965.965 0 0 1 .9.5l2.775 4.757 1.546-1.887a1 1 0 0 1 1.618.1l2.541 4a1 1 0 0 1 .028 1.011Z"/>
5-
</svg>
3+
<IconImage class="w-10 h-10 text-lightSkeletonIconColor dark:text-darkSkeletonIconColor" />
64
</div>
75
<div v-else-if="type === 'video'" role="status" class="flex items-center justify-center max-w-sm bg-lightSkeletonBackgroundColor rounded-lg animate-pulse dark:bg-darkSkeletonBackgroundColor">
8-
<svg class="w-10 h-10 text-lightSkeletonIconColor dark:text-darkSkeletonIconColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 16 20">
9-
<path d="M5 5V.13a2.96 2.96 0 0 0-1.293.749L.879 3.707A2.98 2.98 0 0 0 .13 5H5Z"/>
10-
<path d="M14.066 0H7v5a2 2 0 0 1-2 2H0v11a1.97 1.97 0 0 0 1.934 2h12.132A1.97 1.97 0 0 0 16 18V2a1.97 1.97 0 0 0-1.934-2ZM9 13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2Zm4 .382a1 1 0 0 1-1.447.894L10 13v-2l1.553-1.276a1 1 0 0 1 1.447.894v2.764Z"/>
11-
</svg>
6+
<IconVideo class="w-10 h-10 text-lightSkeletonIconColor dark:text-darkSkeletonIconColor" />
127
<span class="sr-only">Loading...</span>
138
</div>
14-
<svg v-else-if="type === 'avatar'" class="me-3 animate-pulse text-lightSkeletonIconColor dark:text-darkSkeletonBackgroundColor" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
15-
<path d="M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 5a3 3 0 1 1 0 6 3 3 0 0 1 0-6Zm0 13a8.949 8.949 0 0 1-4.951-1.488A3.987 3.987 0 0 1 9 13h2a3.987 3.987 0 0 1 3.951 3.512A8.949 8.949 0 0 1 10 18Z"/>
16-
</svg>
17-
<div
18-
v-else-if="type === 'input'"
19-
role="input"
9+
<IconCircleUserRound v-else-if="type === 'avatar'" class="me-3 animate-pulse text-lightSkeletonIconColor dark:text-darkSkeletonBackgroundColor" />
10+
<div
11+
v-else-if="type === 'input'"
12+
role="input"
2013
:class="['animate-pulse bg-lightSkeletonBackgroundColor dark:bg-darkSkeletonBackgroundColor rounded-default', $attrs.class]"
2114
></div>
2215
<div v-else role="status" class="flex items-center justify-center animate-pulse bg-lightSkeletonIconColor rounded-full dark:bg-darkSkeletonBackgroundColor">
@@ -25,7 +18,9 @@
2518
</template>
2619

2720
<script setup lang="ts">
21+
import { IconCircleUserRound, IconImage, IconVideo } from '@iconify-prerendered/vue-lucide';
22+
2823
defineProps<{
2924
type?: string,
3025
}>();
31-
</script>
26+
</script>

‎adminforth/spa/src/components/CustomDateRangePicker.vue‎

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<div>
2828
<div class="relative">
2929
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
30-
<IconTime class="w-4 h-4 text-lightDatePickerIcon dark:text-darkDatePickerIcon bg-lightDatePickerButtonBackground dark:bg-darkDatePickerButtonBackground"/>
30+
<IconClock class="w-4 h-4 text-lightDatePickerIcon dark:text-darkDatePickerIcon bg-lightDatePickerButtonBackground dark:bg-darkDatePickerButtonBackground"/>
3131
</div>
3232

3333
<input v-model="startTime" type="time" id="start-time"
@@ -39,7 +39,7 @@
3939
<div>
4040
<div class="relative">
4141
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
42-
<IconTime class="w-4 h-4 text-lightDatePickerIcon dark:text-darkDatePickerIcon bg-lightDatePickerButtonBackground dark:bg-darkDatePickerButtonBackground"/>
42+
<IconClock class="w-4 h-4 text-lightDatePickerIcon dark:text-darkDatePickerIcon bg-lightDatePickerButtonBackground dark:bg-darkDatePickerButtonBackground"/>
4343
</div>
4444

4545
<input v-model="endTime" type="time" id="end-time"
@@ -53,12 +53,7 @@
5353
class="text-lightPrimary dark:text-darkPrimary text-[13px] font-medium hover:underline p-0 inline-flex items-center gap-0.5 mb-2"
5454
:class="{hidden: column.type !== 'datetime'}"
5555
@click="toggleTimeInputs">{{ showTimeInputs ? $t('Hide time') : $t('Show time') }}
56-
<svg class="w-4 h-4" :class="{'rotate-180': showTimeInputs}" aria-hidden="true"
57-
xmlns="http://www.w3.org/2000/svg" width="24" height="24"
58-
fill="none" viewBox="0 0 24 24">
59-
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
60-
d="m8 10 4 4 4-4"/>
61-
</svg>
56+
<IconChevronDown class="w-4 h-4" :class="{'rotate-180': showTimeInputs}"/>
6257
</button>
6358
</div>
6459
</div>
@@ -71,8 +66,7 @@ import utc from 'dayjs/plugin/utc';
7166
import {useCoreStore} from '@/stores/core';
7267
import {FLEXIBLE_DATEPICKER_FORMAT} from '@/utils';
7368
74-
import IconCalendar from "@/components/icons/IconCalendar.vue";
75-
import IconTime from "@/components/icons/IconTime.vue";
69+
import { IconCalendar, IconChevronDown, IconClock } from '@iconify-prerendered/vue-lucide';
7670
7771
const coreStore = useCoreStore();
7872
dayjs.extend(utc)

‎adminforth/spa/src/components/icons/IconCalendar.vue‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)