diff --git a/docs/app/pages/[...slug].vue b/docs/app/pages/[...slug].vue index a56108d3..8492b53e 100644 --- a/docs/app/pages/[...slug].vue +++ b/docs/app/pages/[...slug].vue @@ -65,13 +65,17 @@ if (!import.meta.prerender) { }) } -const type = page.value?.path.includes('components') ? 'Vue Component ' : page.value?.path.includes('composables') ? 'Vue Composable ' : '' +const title = page.value?.navigation?.title ? page.value.navigation.title : page.value?.title +const prefix = page.value?.path.includes('components') || page.value?.path.includes('composables') ? 'Vue ' : '' +const suffix = page.value?.path.includes('components') ? 'Component ' : page.value?.path.includes('composables') ? 'Composable ' : '' +const description = page.value?.description + useSeoMeta({ - titleTemplate: `%s ${type}- Nuxt UI ${page.value.module === 'ui-pro' ? 'Pro' : ''} ${page.value.framework === 'vue' ? ' for Vue' : ''}`, - title: page.value.navigation?.title ? page.value.navigation.title : page.value.title, - ogTitle: `${page.value.navigation?.title ? page.value.navigation.title : page.value.title} ${type}- Nuxt UI ${page.value.module === 'ui-pro' ? 'Pro' : ''} ${page.value.framework === 'vue' ? ' for Vue' : ''}`, - description: page.value.description, - ogDescription: page.value.description + titleTemplate: `${prefix}%s ${suffix}- Nuxt UI ${page.value?.module === 'ui-pro' ? 'Pro' : ''} ${page.value?.framework === 'vue' ? ' for Vue' : ''}`, + title, + ogTitle: `${prefix}${title} ${suffix}- Nuxt UI ${page.value?.module === 'ui-pro' ? 'Pro' : ''} ${page.value?.framework === 'vue' ? ' for Vue' : ''}`, + description, + ogDescription: description }) if (route.path.startsWith('/components')) { diff --git a/docs/content/1.getting-started/3.theme.md b/docs/content/1.getting-started/3.theme.md index ac6d2db3..391bad02 100644 --- a/docs/content/1.getting-started/3.theme.md +++ b/docs/content/1.getting-started/3.theme.md @@ -229,6 +229,10 @@ export default defineConfig({ :: +::caution +When configuring your theme colors, you must use either color names from the [default Tailwind palette](https://tailwindcss.com/docs/colors) (like 'blue', 'green', etc.) or reference custom colors that you've previously defined in your [CSS file](#theme). +:: + ### Extend colors ::framework-only diff --git a/docs/content/3.components/accordion.md b/docs/content/3.components/accordion.md index cc83f157..e825bd3e 100644 --- a/docs/content/3.components/accordion.md +++ b/docs/content/3.components/accordion.md @@ -23,6 +23,8 @@ Use the `items` prop as an array of objects with the following properties: - `value?: string`{lang="ts-type"} - `disabled?: boolean`{lang="ts-type"} - [`slot?: string`{lang="ts-type"}](#with-custom-slot) +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, header?: ClassNameValue, trigger?: ClassNameValue, leadingIcon?: ClassNameValue, label?: ClassNameValue, trailingIcon?: ClassNameValue, content?: ClassNameValue, body?: ClassNameValue }`{lang="ts-type"} ::component-code --- diff --git a/docs/content/3.components/breadcrumb.md b/docs/content/3.components/breadcrumb.md index 6e5540e5..d7aa63aa 100644 --- a/docs/content/3.components/breadcrumb.md +++ b/docs/content/3.components/breadcrumb.md @@ -16,8 +16,9 @@ Use the `items` prop as an array of objects with the following properties: - `label?: string`{lang="ts-type"} - `icon?: string`{lang="ts-type"} - `avatar?: AvatarProps`{lang="ts-type"} -- `class?: any`{lang="ts-type"} - [`slot?: string`{lang="ts-type"}](#with-custom-slot) +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, link?: ClassNameValue, linkLeadingIcon?: ClassNameValue, linkLeadingAvatar?: ClassNameValue, linkLabel?: ClassNameValue, separator?: ClassNameValue, separatorIcon?: ClassNameValue }`{lang="ts-type"} You can pass any property from the [Link](/components/link#props) component such as `to`, `target`, etc. diff --git a/docs/content/3.components/carousel.md b/docs/content/3.components/carousel.md index afb0f78e..862c2a04 100644 --- a/docs/content/3.components/carousel.md +++ b/docs/content/3.components/carousel.md @@ -27,6 +27,11 @@ class: 'p-8' --- :: +You can also pass an array of objects with the following properties: + +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue }`{lang="ts-type"} + You can control how many items are visible by using the [`basis`](https://tailwindcss.com/docs/flex-basis) / [`width`](https://tailwindcss.com/docs/width) utility classes on the `item`: ::component-example diff --git a/docs/content/3.components/checkbox-group.md b/docs/content/3.components/checkbox-group.md index 665f0ea2..e9daadba 100644 --- a/docs/content/3.components/checkbox-group.md +++ b/docs/content/3.components/checkbox-group.md @@ -49,6 +49,8 @@ You can also pass an array of objects with the following properties: - `description?: string`{lang="ts-type"} - [`value?: string`{lang="ts-type"}](#value-key) - `disabled?: boolean`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, container?: ClassNameValue, base?: ClassNameValue, 'indicator'?: ClassNameValue, icon?: ClassNameValue, wrapper?: ClassNameValue, label?: ClassNameValue, description?: ClassNameValue }`{lang="ts-type"} ::component-code --- @@ -199,6 +201,7 @@ items: variant: - list - card + - table props: color: 'primary' variant: 'card' @@ -229,6 +232,7 @@ items: variant: - list - card + - table props: size: 'xl' variant: 'list' @@ -259,6 +263,7 @@ items: variant: - list - card + - table props: orientation: 'horizontal' variant: 'list' @@ -293,6 +298,7 @@ items: variant: - list - card + - table props: indicator: 'end' variant: 'card' diff --git a/docs/content/3.components/command-palette.md b/docs/content/3.components/command-palette.md index c25c4274..30b3e72e 100644 --- a/docs/content/3.components/command-palette.md +++ b/docs/content/3.components/command-palette.md @@ -53,6 +53,8 @@ Each group contains an `items` array of objects that define the commands. Each i - `disabled?: boolean`{lang="ts-type"} - [`slot?: string`{lang="ts-type"}](#with-custom-slot) - `onSelect?(e?: Event): void`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, itemLeadingIcon?: ClassNameValue, itemLeadingAvatarSize?: ClassNameValue, itemLeadingAvatar?: ClassNameValue, itemLeadingChipSize?: ClassNameValue, itemLeadingChip?: ClassNameValue, itemLabel?: ClassNameValue, itemLabelPrefix?: ClassNameValue, itemLabelBase?: ClassNameValue, itemLabelSuffix?: ClassNameValue, itemTrailing?: ClassNameValue, itemTrailingKbds?: ClassNameValue, itemTrailingKbdsSize?: ClassNameValue, itemTrailingHighlightedIcon?: ClassNameValue, itemTrailingIcon?: ClassNameValue,}`{lang="ts-type"} You can pass any property from the [Link](/components/link#props) component such as `to`, `target`, etc. diff --git a/docs/content/3.components/context-menu.md b/docs/content/3.components/context-menu.md index 9b14fce5..3d007e83 100644 --- a/docs/content/3.components/context-menu.md +++ b/docs/content/3.components/context-menu.md @@ -28,11 +28,12 @@ Use the `items` prop as an array of objects with the following properties: - [`color?: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"`{lang="ts-type"}](#with-color-items) - [`checked?: boolean`{lang="ts-type"}](#with-checkbox-items) - `disabled?: boolean`{lang="ts-type"} -- `class?: any`{lang="ts-type"} - [`slot?: string`{lang="ts-type"}](#with-custom-slot) - `onSelect?(e: Event): void`{lang="ts-type"} - [`onUpdateChecked?(checked: boolean): void`{lang="ts-type"}](#with-checkbox-items) - `children?: ContextMenuItem[] | ContextMenuItem[][]`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, label?: ClassNameValue, separator?: ClassNameValue, itemLeadingIcon?: ClassNameValue, itemLeadingAvatarSize?: ClassNameValue, itemLeadingAvatar?: ClassNameValue, itemLabel?: ClassNameValue, itemLabelExternalIcon?: ClassNameValue, itemTrailing?: ClassNameValue, itemTrailingIcon?: ClassNameValue, itemTrailingKbds?: ClassNameValue, itemTrailingKbdsSize?: ClassNameValue }`{lang="ts-type"} You can pass any property from the [Link](/components/link#props) component such as `to`, `target`, etc. diff --git a/docs/content/3.components/dropdown-menu.md b/docs/content/3.components/dropdown-menu.md index 7d7c3f54..34ed4a78 100644 --- a/docs/content/3.components/dropdown-menu.md +++ b/docs/content/3.components/dropdown-menu.md @@ -28,11 +28,12 @@ Use the `items` prop as an array of objects with the following properties: - [`color?: "error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral"`{lang="ts-type"}](#with-color-items) - [`checked?: boolean`{lang="ts-type"}](#with-checkbox-items) - `disabled?: boolean`{lang="ts-type"} -- `class?: any`{lang="ts-type"} - [`slot?: string`{lang="ts-type"}](#with-custom-slot) - `onSelect?(e: Event): void`{lang="ts-type"} - [`onUpdateChecked?(checked: boolean): void`{lang="ts-type"}](#with-checkbox-items) - `children?: DropdownMenuItem[] | DropdownMenuItem[][]`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, label?: ClassNameValue, separator?: ClassNameValue, itemLeadingIcon?: ClassNameValue, itemLeadingAvatarSize?: ClassNameValue, itemLeadingAvatar?: ClassNameValue, itemLabel?: ClassNameValue, itemLabelExternalIcon?: ClassNameValue, itemTrailing?: ClassNameValue, itemTrailingIcon?: ClassNameValue, itemTrailingKbds?: ClassNameValue, itemTrailingKbdsSize?: ClassNameValue }`{lang="ts-type"} You can pass any property from the [Link](/components/link#props) component such as `to`, `target`, etc. diff --git a/docs/content/3.components/input-menu.md b/docs/content/3.components/input-menu.md index fbd8d411..c8e69624 100644 --- a/docs/content/3.components/input-menu.md +++ b/docs/content/3.components/input-menu.md @@ -55,6 +55,8 @@ You can also pass an array of objects with the following properties: - [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items) - `disabled?: boolean`{lang="ts-type"} - `onSelect?(e: Event): void`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { tagsItem?: ClassNameValue, tagsItemText?: ClassNameValue, tagsItemDelete?: ClassNameValue, tagsItemDeleteIcon?: ClassNameValue, label?: ClassNameValue, separator?: ClassNameValue, item?: ClassNameValue, itemLeadingIcon?: ClassNameValue, itemLeadingAvatarSize?: ClassNameValue, itemLeadingAvatar?: ClassNameValue, itemLeadingChip?: ClassNameValue, itemLeadingChipSize?: ClassNameValue, itemLabel?: ClassNameValue, itemTrailing?: ClassNameValue, itemTrailingIcon?: ClassNameValue }`{lang="ts-type"} ::component-code --- diff --git a/docs/content/3.components/navigation-menu.md b/docs/content/3.components/navigation-menu.md index b1c98c9b..f7b286bd 100644 --- a/docs/content/3.components/navigation-menu.md +++ b/docs/content/3.components/navigation-menu.md @@ -29,10 +29,11 @@ Use the `items` prop as an array of objects with the following properties: - `open?: boolean`{lang="ts-type"} - `value?: string`{lang="ts-type"} - `disabled?: boolean`{lang="ts-type"} -- `class?: any`{lang="ts-type"} - [`slot?: string`{lang="ts-type"}](#with-custom-slot) - `onSelect?(e: Event): void`{lang="ts-type"} - `children?: NavigationMenuChildItem[]`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { linkLeadingAvatarSize?: ClassNameValue, linkLeadingAvatar?: ClassNameValue, linkLeadingIcon?: ClassNameValue, linkLabel?: ClassNameValue, linkLabelExternalIcon?: ClassNameValue, linkTrailing?: ClassNameValue, linkTrailingBadgeSize?: ClassNameValue, linkTrailingBadge?: ClassNameValue, linkTrailingIcon?: ClassNameValue, label?: ClassNameValue, link?: ClassNameValue, content?: ClassNameValue, childList?: ClassNameValue, childItem?: ClassNameValue, childLink?: ClassNameValue, childLinkIcon?: ClassNameValue, childLinkWrapper?: ClassNameValue, childLinkLabel?: ClassNameValue, childLinkLabelExternalIcon?: ClassNameValue, childLinkDescription?: ClassNameValue }`{lang="ts-type"} You can pass any property from the [Link](/components/link#props) component such as `to`, `target`, etc. @@ -134,8 +135,8 @@ Each item can take a `children` array of objects with the following properties t - `label: string` - `description?: string` - `icon?: string` -- `class?: any` - `onSelect?(e: Event): void` +- `class?: any` :: diff --git a/docs/content/3.components/radio-group.md b/docs/content/3.components/radio-group.md index f4b50ec5..c7d5f13d 100644 --- a/docs/content/3.components/radio-group.md +++ b/docs/content/3.components/radio-group.md @@ -46,6 +46,8 @@ You can also pass an array of objects with the following properties: - `description?: string`{lang="ts-type"} - [`value?: string`{lang="ts-type"}](#value-key) - `disabled?: boolean`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, container?: ClassNameValue, base?: ClassNameValue, 'indicator'?: ClassNameValue, wrapper?: ClassNameValue, label?: ClassNameValue, description?: ClassNameValue }`{lang="ts-type"} ::component-code --- diff --git a/docs/content/3.components/select-menu.md b/docs/content/3.components/select-menu.md index 82f711f5..fbdbcc5a 100644 --- a/docs/content/3.components/select-menu.md +++ b/docs/content/3.components/select-menu.md @@ -57,6 +57,8 @@ You can also pass an array of objects with the following properties: - [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items) - `disabled?: boolean`{lang="ts-type"} - `onSelect?(e: Event): void`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { label?: ClassNameValue, separator?: ClassNameValue, item?: ClassNameValue, itemLeadingIcon?: ClassNameValue, itemLeadingAvatarSize?: ClassNameValue, itemLeadingAvatar?: ClassNameValue, itemLeadingChipSize?: ClassNameValue, itemLeadingChip?: ClassNameValue, itemLabel?: ClassNameValue, itemTrailing?: ClassNameValue, itemTrailingIcon?: ClassNameValue }`{lang="ts-type"} ::component-code --- diff --git a/docs/content/3.components/select.md b/docs/content/3.components/select.md index 2f32b0df..5a642c15 100644 --- a/docs/content/3.components/select.md +++ b/docs/content/3.components/select.md @@ -48,6 +48,8 @@ You can also pass an array of objects with the following properties: - [`avatar?: AvatarProps`{lang="ts-type"}](#with-avatar-in-items) - [`chip?: ChipProps`{lang="ts-type"}](#with-chip-in-items) - `disabled?: boolean`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { label?: ClassNameValue, separator?: ClassNameValue, item?: ClassNameValue, itemLeadingIcon?: ClassNameValue, itemLeadingAvatarSize?: ClassNameValue, itemLeadingAvatar?: ClassNameValue, itemLeadingChipSize?: ClassNameValue, itemLeadingChip?: ClassNameValue, itemLabel?: ClassNameValue, itemTrailing?: ClassNameValue, itemTrailingIcon?: ClassNameValue }`{lang="ts-type"} ::component-code --- diff --git a/docs/content/3.components/stepper.md b/docs/content/3.components/stepper.md index ca5d2145..5622d123 100644 --- a/docs/content/3.components/stepper.md +++ b/docs/content/3.components/stepper.md @@ -23,6 +23,8 @@ Use the `items` prop as an array of objects with the following properties: - `value?: string | number`{lang="ts-type"} - `disabled?: boolean`{lang="ts-type"} - [`slot?: string`{lang="ts-type"}](#with-custom-slot) +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, container?: ClassNameValue, trigger?: ClassNameValue, indicator?: ClassNameValue, icon?: ClassNameValue, separator?: ClassNameValue, wrapper?: ClassNameValue, title?: ClassNameValue, description?: ClassNameValue }`{lang="ts-type"} ::component-code --- diff --git a/docs/content/3.components/tabs.md b/docs/content/3.components/tabs.md index 6c08d410..3dc8a564 100644 --- a/docs/content/3.components/tabs.md +++ b/docs/content/3.components/tabs.md @@ -23,6 +23,8 @@ Use the `items` prop as an array of objects with the following properties: - `value?: string | number`{lang="ts-type"} - `disabled?: boolean`{lang="ts-type"} - [`slot?: string`{lang="ts-type"}](#with-custom-slot) +- `class?: any`{lang="ts-type"} +- `ui?: { trigger?: ClassNameValue, leadingIcon?: ClassNameValue, leadingAvatar?: ClassNameValue, label?: ClassNameValue, content?: ClassNameValue }`{lang="ts-type"} ::component-code --- diff --git a/docs/content/3.components/tree.md b/docs/content/3.components/tree.md index 95f96001..35fe5aca 100644 --- a/docs/content/3.components/tree.md +++ b/docs/content/3.components/tree.md @@ -26,6 +26,8 @@ Use the `items` prop as an array of objects with the following properties: - `children?: TreeItem[]`{lang="ts-type"} - `onToggle?(e: Event): void`{lang="ts-type"} - `onSelect?(e?: Event): void`{lang="ts-type"} +- `class?: any`{lang="ts-type"} +- `ui?: { item?: ClassNameValue, itemWithChildren?: ClassNameValue, link?: ClassNameValue, linkLeadingIcon?: ClassNameValue, linkLabel?: ClassNameValue, linkTrailing?: ClassNameValue, linkTrailingIcon?: ClassNameValue, listWithChildren?: ClassNameValue }`{lang="ts-type"} ::note A unique identifier is required for each item. The component will use the `value` prop as identifier, falling back to `label` if `value` is not provided. One of these must be provided for the component to work properly. diff --git a/playground/app/pages/components/badge.vue b/playground/app/pages/components/badge.vue index 8694c259..b85227ee 100644 --- a/playground/app/pages/components/badge.vue +++ b/playground/app/pages/components/badge.vue @@ -36,14 +36,27 @@ const variants = Object.keys(theme.variants.variant) as Array -
+
-
+
-
+
+
+ +
+
+ +
diff --git a/playground/app/pages/components/checkbox-group.vue b/playground/app/pages/components/checkbox-group.vue index edac0bb2..ddf0fef6 100644 --- a/playground/app/pages/components/checkbox-group.vue +++ b/playground/app/pages/components/checkbox-group.vue @@ -1,9 +1,8 @@ diff --git a/src/runtime/components/Breadcrumb.vue b/src/runtime/components/Breadcrumb.vue index f2a309ba..3ba83c99 100644 --- a/src/runtime/components/Breadcrumb.vue +++ b/src/runtime/components/Breadcrumb.vue @@ -15,6 +15,8 @@ export interface BreadcrumbItem extends Omit { icon?: string avatar?: AvatarProps slot?: string + class?: any + ui?: Pick [key: string]: any } @@ -84,16 +86,16 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb |
    diff --git a/src/runtime/components/Button.vue b/src/runtime/components/Button.vue index e4a9efa9..343438e2 100644 --- a/src/runtime/components/Button.vue +++ b/src/runtime/components/Button.vue @@ -1,9 +1,8 @@ -