From 02fe76d1f03f8ed12effb4cf3cd9d8ff5c0889af Mon Sep 17 00:00:00 2001 From: zernonia <59365435+zernonia@users.noreply.github.com> Date: Wed, 27 Sep 2023 12:26:24 +0800 Subject: [PATCH] refactor: replace iconify icons with `@radix-icons/vue` for newyork style (#87) * refactor: changes all instance of unplugin-icons to radix-icons * chore: build registry * test: fix new deps --- apps/www/__registry__/index.ts | 42 ++++++ apps/www/package.json | 1 + .../default/example/Cards/DataTable.vue | 7 +- .../registry/default/example/Cards/index.vue | 125 ------------------ .../ui/menubar/MenubarCheckboxItem.vue | 4 +- .../default/ui/menubar/MenubarRadioItem.vue | 4 +- .../default/ui/radio-group/RadioGroupItem.vue | 4 +- .../registry/default/ui/select/SelectItem.vue | 4 +- .../registry/new-york/example/AlertDemo.vue | 4 +- .../registry/new-york/example/CardDemo.vue | 8 +- .../new-york/example/Cards/ActivityGoal.vue | 7 +- .../new-york/example/Cards/DataTable.vue | 7 +- .../new-york/example/CollapsibleDemo.vue | 4 +- .../new-york/example/ComboboxDemo.vue | 7 +- .../new-york/example/DataTableDemo.vue | 7 +- .../new-york/example/DataTableDemoColumn.vue | 4 +- .../new-york/example/DatePickerDemo.vue | 4 +- .../new-york/example/DatePickerWithRange.vue | 4 +- .../new-york/example/HoverCardDemo.vue | 4 +- .../registry/new-york/example/ToggleDemo.vue | 4 +- .../ui/accordion/AccordionTrigger.vue | 4 +- .../new-york/ui/checkbox/Checkbox.vue | 4 +- .../context-menu/ContextMenuCheckboxItem.vue | 4 +- .../ui/context-menu/ContextMenuRadioItem.vue | 4 +- .../new-york/ui/dialog/DialogContent.vue | 4 +- .../DropdownMenuCheckboxItem.vue | 4 +- .../dropdown-menu/DropdownMenuRadioItem.vue | 4 +- .../dropdown-menu/DropdownMenuSubTrigger.vue | 4 +- .../ui/menubar/MenubarCheckboxItem.vue | 4 +- .../new-york/ui/menubar/MenubarRadioItem.vue | 4 +- .../navigation-menu/NavigationMenuTrigger.vue | 4 +- .../ui/radio-group/RadioGroupItem.vue | 4 +- .../new-york/ui/select/SelectItem.vue | 4 +- .../new-york/ui/select/SelectTrigger.vue | 4 +- .../new-york/ui/sheet/SheetContent.vue | 4 +- apps/www/src/lib/registry/registry.ts | 2 +- .../registry/styles/default/menubar.json | 4 +- .../registry/styles/default/radio-group.json | 2 +- .../registry/styles/default/select.json | 2 +- .../registry/styles/default/textarea.json | 2 +- .../registry/styles/new-york/accordion.json | 2 +- .../registry/styles/new-york/checkbox.json | 2 +- .../styles/new-york/context-menu.json | 4 +- .../registry/styles/new-york/dialog.json | 2 +- .../styles/new-york/dropdown-menu.json | 6 +- .../registry/styles/new-york/menubar.json | 4 +- .../styles/new-york/navigation-menu.json | 2 +- .../registry/styles/new-york/radio-group.json | 2 +- .../registry/styles/new-york/select.json | 4 +- .../registry/styles/new-york/sheet.json | 2 +- packages/cli/src/commands/init.ts | 2 +- packages/cli/test/commands/init.test.ts | 1 + pnpm-lock.yaml | 11 ++ 53 files changed, 147 insertions(+), 224 deletions(-) delete mode 100644 apps/www/src/lib/registry/default/example/Cards/index.vue diff --git a/apps/www/__registry__/index.ts b/apps/www/__registry__/index.ts index 4f8045fe..73cd6b10 100644 --- a/apps/www/__registry__/index.ts +++ b/apps/www/__registry__/index.ts @@ -415,6 +415,27 @@ export const Index = { component: () => import('../src/lib/registry/default/example/TypographyTable.vue').then(m => m.default), files: ['../src/lib/registry/default/example/TypographyTable.vue'], }, + ActivityGoal: { + name: 'ActivityGoal', + type: 'components:example', + registryDependencies: ['button', 'card', 'themes', 'config'], + component: () => import('../src/lib/registry/default/example/ActivityGoal.vue').then(m => m.default), + files: ['../src/lib/registry/default/example/ActivityGoal.vue'], + }, + DataTable: { + name: 'DataTable', + type: 'components:example', + registryDependencies: ['button', 'checkbox', 'dropdown-menu', 'input', 'table', 'card', 'utils'], + component: () => import('../src/lib/registry/default/example/DataTable.vue').then(m => m.default), + files: ['../src/lib/registry/default/example/DataTable.vue'], + }, + Metric: { + name: 'Metric', + type: 'components:example', + registryDependencies: ['card', 'config'], + component: () => import('../src/lib/registry/default/example/Metric.vue').then(m => m.default), + files: ['../src/lib/registry/default/example/Metric.vue'], + }, }, 'new-york': { AccordionDemo: { @@ -830,5 +851,26 @@ export const Index = { component: () => import('../src/lib/registry/new-york/example/TypographyTable.vue').then(m => m.default), files: ['../src/lib/registry/new-york/example/TypographyTable.vue'], }, + ActivityGoal: { + name: 'ActivityGoal', + type: 'components:example', + registryDependencies: ['button', 'card', 'themes', 'config'], + component: () => import('../src/lib/registry/new-york/example/ActivityGoal.vue').then(m => m.default), + files: ['../src/lib/registry/new-york/example/ActivityGoal.vue'], + }, + DataTable: { + name: 'DataTable', + type: 'components:example', + registryDependencies: ['button', 'checkbox', 'dropdown-menu', 'input', 'table', 'card', 'utils'], + component: () => import('../src/lib/registry/new-york/example/DataTable.vue').then(m => m.default), + files: ['../src/lib/registry/new-york/example/DataTable.vue'], + }, + Metric: { + name: 'Metric', + type: 'components:example', + registryDependencies: ['card', 'config'], + component: () => import('../src/lib/registry/new-york/example/Metric.vue').then(m => m.default), + files: ['../src/lib/registry/new-york/example/Metric.vue'], + }, }, } diff --git a/apps/www/package.json b/apps/www/package.json index 3a146d65..0c994fa1 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -13,6 +13,7 @@ }, "dependencies": { "@morev/vue-transitions": "^2.3.6", + "@radix-icons/vue": "^1.0.0", "@tanstack/vue-table": "^8.9.9", "@unovis/ts": "^1.2.1", "@unovis/vue": "1.3.0-alpha.3", diff --git a/apps/www/src/lib/registry/default/example/Cards/DataTable.vue b/apps/www/src/lib/registry/default/example/Cards/DataTable.vue index 561ae80e..a6d201ff 100644 --- a/apps/www/src/lib/registry/default/example/Cards/DataTable.vue +++ b/apps/www/src/lib/registry/default/example/Cards/DataTable.vue @@ -14,9 +14,8 @@ import { useVueTable, } from '@tanstack/vue-table' import { h, ref } from 'vue' +import { CaretSortIcon, ChevronDownIcon } from '@radix-icons/vue' import DropdownAction from '../DataTableDemoColumn.vue' -import RadixIconsCaretSort from '~icons/radix-icons/caret-sort' -import RadixIconsChevronDown from '~icons/radix-icons/chevron-down' import { Button } from '@/lib/registry/default/ui/button' import { Checkbox } from '@/lib/registry/default/ui/checkbox' @@ -105,7 +104,7 @@ const columns: ColumnDef[] = [ return h(Button, { variant: 'ghost', onClick: () => column.toggleSorting(column.getIsSorted() === 'asc'), - }, ['Email', h(RadixIconsCaretSort, { class: 'ml-2 h-4 w-4' })]) + }, ['Email', h(CaretSortIcon, { class: 'ml-2 h-4 w-4' })]) }, cell: ({ row }) => h('div', { class: 'lowercase' }, row.getValue('email')), }, @@ -180,7 +179,7 @@ const table = useVueTable({ diff --git a/apps/www/src/lib/registry/default/example/Cards/index.vue b/apps/www/src/lib/registry/default/example/Cards/index.vue deleted file mode 100644 index 44ad59d6..00000000 --- a/apps/www/src/lib/registry/default/example/Cards/index.vue +++ /dev/null @@ -1,125 +0,0 @@ - - - diff --git a/apps/www/src/lib/registry/default/ui/menubar/MenubarCheckboxItem.vue b/apps/www/src/lib/registry/default/ui/menubar/MenubarCheckboxItem.vue index fe9002a2..b0274d9b 100644 --- a/apps/www/src/lib/registry/default/ui/menubar/MenubarCheckboxItem.vue +++ b/apps/www/src/lib/registry/default/ui/menubar/MenubarCheckboxItem.vue @@ -5,8 +5,8 @@ import { type MenubarCheckboxItemProps, MenubarItemIndicator, } from 'radix-vue' +import { Check } from 'lucide-vue-next' import { cn } from '@/lib/utils' -import RadixIconsCheck from '~icons/radix-icons/check' const props = defineProps() @@ -28,7 +28,7 @@ const emit = defineEmits() - + diff --git a/apps/www/src/lib/registry/default/ui/menubar/MenubarRadioItem.vue b/apps/www/src/lib/registry/default/ui/menubar/MenubarRadioItem.vue index 960389aa..4619f96a 100644 --- a/apps/www/src/lib/registry/default/ui/menubar/MenubarRadioItem.vue +++ b/apps/www/src/lib/registry/default/ui/menubar/MenubarRadioItem.vue @@ -5,8 +5,8 @@ import { type MenubarRadioItemEmits, type MenubarRadioItemProps, } from 'radix-vue' +import { Circle } from 'lucide-vue-next' import { cn } from '@/lib/utils' -import RiCheckboxBlankCircleFill from '~icons/ri/checkbox-blank-circle-fill' const props = defineProps() @@ -27,7 +27,7 @@ const emits = defineEmits() - + diff --git a/apps/www/src/lib/registry/default/ui/radio-group/RadioGroupItem.vue b/apps/www/src/lib/registry/default/ui/radio-group/RadioGroupItem.vue index 6d74489d..b9af78cf 100644 --- a/apps/www/src/lib/registry/default/ui/radio-group/RadioGroupItem.vue +++ b/apps/www/src/lib/registry/default/ui/radio-group/RadioGroupItem.vue @@ -4,8 +4,8 @@ import { RadioGroupItem, type RadioGroupItemProps, } from 'radix-vue' +import { Circle } from 'lucide-vue-next' import { cn } from '@/lib/utils' -import RiCheckboxBlankCircleFill from '~icons/ri/checkbox-blank-circle-fill' const props = defineProps() @@ -23,7 +23,7 @@ const props = defineProps() - + diff --git a/apps/www/src/lib/registry/default/ui/select/SelectItem.vue b/apps/www/src/lib/registry/default/ui/select/SelectItem.vue index 5ebbd0be..cae5d6ec 100644 --- a/apps/www/src/lib/registry/default/ui/select/SelectItem.vue +++ b/apps/www/src/lib/registry/default/ui/select/SelectItem.vue @@ -5,8 +5,8 @@ import { type SelectItemProps, SelectItemText, } from 'radix-vue' +import { Check } from 'lucide-vue-next' import { cn } from '@/lib/utils' -import RadixIconsCheck from '~icons/radix-icons/check' const props = defineProps() @@ -23,7 +23,7 @@ const props = defineProps() > - + diff --git a/apps/www/src/lib/registry/new-york/example/AlertDemo.vue b/apps/www/src/lib/registry/new-york/example/AlertDemo.vue index cd4a8796..ebb70284 100644 --- a/apps/www/src/lib/registry/new-york/example/AlertDemo.vue +++ b/apps/www/src/lib/registry/new-york/example/AlertDemo.vue @@ -1,11 +1,11 @@ diff --git a/apps/www/src/lib/registry/new-york/ui/select/SelectItem.vue b/apps/www/src/lib/registry/new-york/ui/select/SelectItem.vue index 5ebbd0be..e5c533c3 100644 --- a/apps/www/src/lib/registry/new-york/ui/select/SelectItem.vue +++ b/apps/www/src/lib/registry/new-york/ui/select/SelectItem.vue @@ -5,8 +5,8 @@ import { type SelectItemProps, SelectItemText, } from 'radix-vue' +import { CheckIcon } from '@radix-icons/vue' import { cn } from '@/lib/utils' -import RadixIconsCheck from '~icons/radix-icons/check' const props = defineProps() @@ -23,7 +23,7 @@ const props = defineProps() > - + diff --git a/apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue b/apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue index 2811c5bc..15219cd1 100644 --- a/apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue +++ b/apps/www/src/lib/registry/new-york/ui/select/SelectTrigger.vue @@ -1,6 +1,6 @@ \n\n\n" + "content": "\n\n\n" }, { "name": "MenubarContent.vue", @@ -41,7 +41,7 @@ }, { "name": "MenubarRadioItem.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "MenubarSeparator.vue", diff --git a/apps/www/src/public/registry/styles/default/radio-group.json b/apps/www/src/public/registry/styles/default/radio-group.json index e05dcd8c..6bdf20b7 100644 --- a/apps/www/src/public/registry/styles/default/radio-group.json +++ b/apps/www/src/public/registry/styles/default/radio-group.json @@ -13,7 +13,7 @@ }, { "name": "RadioGroupItem.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "index.ts", diff --git a/apps/www/src/public/registry/styles/default/select.json b/apps/www/src/public/registry/styles/default/select.json index 285f7f16..8cd6d903 100644 --- a/apps/www/src/public/registry/styles/default/select.json +++ b/apps/www/src/public/registry/styles/default/select.json @@ -21,7 +21,7 @@ }, { "name": "SelectItem.vue", - "content": "\n\n\n" + "content": "\n\n\n" }, { "name": "SelectItemText.vue", diff --git a/apps/www/src/public/registry/styles/default/textarea.json b/apps/www/src/public/registry/styles/default/textarea.json index 7ceaf393..66db3556 100644 --- a/apps/www/src/public/registry/styles/default/textarea.json +++ b/apps/www/src/public/registry/styles/default/textarea.json @@ -7,7 +7,7 @@ "files": [ { "name": "Textarea.vue", - "content": "\n\n