From 17c725686466a2574977f90547011ab0089fbae7 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Tue, 2 Apr 2024 19:13:15 +0200 Subject: [PATCH] chore(theme): use kebab case --- cli/utils/templates.mjs | 7 ++++--- package.json | 1 + playground/pages/form-field.vue | 2 +- playground/pages/radio-group.vue | 3 +-- pnpm-lock.yaml | 3 +++ src/runtime/components/DropdownMenu.vue | 2 +- src/runtime/components/FormField.vue | 2 +- src/runtime/components/NavigationMenu.vue | 2 +- src/runtime/components/RadioGroup.vue | 2 +- src/templates.ts | 5 +++-- src/theme/{dropdownMenu.ts => dropdown-menu.ts} | 0 src/theme/{formField.ts => form-field.ts} | 0 src/theme/index.ts | 8 ++++---- src/theme/{navigationMenu.ts => navigation-menu.ts} | 0 src/theme/{radioGroup.ts => radio-group.ts} | 0 15 files changed, 21 insertions(+), 16 deletions(-) rename src/theme/{dropdownMenu.ts => dropdown-menu.ts} (100%) rename src/theme/{formField.ts => form-field.ts} (100%) rename src/theme/{navigationMenu.ts => navigation-menu.ts} (100%) rename src/theme/{radioGroup.ts => radio-group.ts} (100%) diff --git a/cli/utils/templates.mjs b/cli/utils/templates.mjs index 0de57453..d2b882b9 100644 --- a/cli/utils/templates.mjs +++ b/cli/utils/templates.mjs @@ -19,6 +19,7 @@ const playground = ({ name }) => { const component = ({ name }) => { const upperName = splitByCase(name).map(p => upperFirst(p)).join('') const camelName = camelCase(name) + const kebabName = kebabCase(name) return { filename: `src/runtime/components/${upperName}.vue`, @@ -28,7 +29,7 @@ import { tv, type VariantProps } from 'tailwind-variants' import type { ${upperName}RootProps, ${upperName}RootEmits } from 'radix-vue' import type { AppConfig } from '@nuxt/schema' import _appConfig from '#build/app.config' -import theme from '#build/ui/${camelName}' +import theme from '#build/ui/${kebabName}' const appConfig = _appConfig as AppConfig & { ui: { ${camelName}: Partial } } @@ -68,10 +69,10 @@ const ui = computed(() => tv({ extend: ${camelName}, slots: props.ui })()) } const theme = ({ name }) => { - const camelName = camelCase(name) + const kebabName = kebabCase(name) return { - filename: `src/theme/${camelName}.ts`, + filename: `src/theme/${kebabName}.ts`, contents: ` export default (config: { colors: string[] }) => ({ slots: { diff --git a/package.json b/package.json index d920c5b1..ae8dbf01 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "nuxt-icon": "^0.6.10", "ohash": "^1.1.3", "radix-vue": "^1.6.1", + "scule": "^1.3.0", "tailwind-variants": "^0.2.1", "tailwindcss": "4.0.0-alpha.10" }, diff --git a/playground/pages/form-field.vue b/playground/pages/form-field.vue index 47f87349..d9191208 100644 --- a/playground/pages/form-field.vue +++ b/playground/pages/form-field.vue @@ -1,5 +1,5 @@