Skip to content
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
09a6914
feat(stepper): add iconClass prop to stepper items
J-Michalek May 4, 2025
9124f12
test(stepper): add case for iconClass prop
J-Michalek May 4, 2025
1b906b5
docs(stepper): add iconClass prop
J-Michalek May 4, 2025
9902987
test(stepper): remove obsolete snapshot entry
J-Michalek May 4, 2025
16c68c7
test(stepper): update snapshot for vue tests
J-Michalek May 4, 2025
7331409
Merge branch 'nuxt:v3' into feat/stepper-icon-class
J-Michalek May 5, 2025
1197806
feat(accordion): add ui field in items
J-Michalek May 6, 2025
7c7a6f8
Merge branch 'feat/stepper-icon-class' of https://github.com/J-Michal…
J-Michalek May 6, 2025
2145147
test(accordion): add new snapshot entry for vue tests
J-Michalek May 6, 2025
161b2ba
docs(accordion): add ui field in items
J-Michalek May 6, 2025
4c8f564
feat(tabs): add ui field on items
J-Michalek May 6, 2025
31153d3
docs(tabs): add ui field on items
J-Michalek May 6, 2025
cac3e20
test(tabs): add ui field on items
J-Michalek May 6, 2025
47ae811
feat(stepper): add ui field on items
May 7, 2025
b3feac5
test(stepper): add ui field on items
May 7, 2025
c1ab96e
docs(stepper): add ui field on items
May 7, 2025
11daf42
feat(breadcrumb): add ui field on items
May 7, 2025
66a79a0
test(breadcrumb): add ui field on items
May 7, 2025
473b0b7
docs(breadcrumb): add ui field on items
May 7, 2025
9a4043e
feat(checkbox-group): add ui field on items
May 7, 2025
0feed77
test(checkbox-group): add ui field on items
May 7, 2025
591be49
docs(checkbox-group): add ui field on items
May 7, 2025
b3c19fa
docs(breadcrumb): fix description for object type
May 7, 2025
9ac59b5
feat(radio-group): add ui field on items
May 7, 2025
69a36a4
test(radio-group): add ui field on items
May 7, 2025
3402866
docs(radio-group): add ui field on items
May 7, 2025
824cecd
feat(input-menu): add ui field on items
May 7, 2025
402f06c
test(input-menu): add ui field on items
May 7, 2025
96d521a
docs(input-menu): add ui field on items
May 7, 2025
4269961
feat(tree): add ui field on items
May 7, 2025
68d04b1
test(tree): add ui field on items
May 7, 2025
ec91d84
docs(tree): add ui field on items
May 7, 2025
0c1386e
Merge branch 'nuxt:v3' into feat/stepper-icon-class
J-Michalek May 8, 2025
1f83f92
feat(select): add ui field in items
J-Michalek May 8, 2025
263f737
test(select): add ui field in items
J-Michalek May 8, 2025
81e6fa2
docs(select): add ui field in items
J-Michalek May 8, 2025
cd23183
test(according): unite title for ui field in items cases
J-Michalek May 8, 2025
ab6d2a0
test(tabs): unite title for ui field in items cases
J-Michalek May 8, 2025
d3a5ec9
feat(select-menu): add ui field on items
J-Michalek May 8, 2025
818c40b
test(select-menu): add ui field on items
J-Michalek May 8, 2025
adfb6b3
docs(select-menu): add ui field on items
J-Michalek May 8, 2025
1214fcb
feat(navigation-menu): add ui field on items
J-Michalek May 8, 2025
1d83c1f
test(navigation-menu): add ui field on items
J-Michalek May 8, 2025
caeab7b
docs(navigation-menu): add ui field on items
J-Michalek May 8, 2025
addf0ba
feat(dropdown-menu): add ui field on items
J-Michalek May 8, 2025
1681f45
test(dropdown-menu): add ui field on items
J-Michalek May 8, 2025
cc46cfc
docs(dropdown-menu): add ui field on items
J-Michalek May 8, 2025
94e97db
fix(dropdown-menu): add missing label ui field on items
J-Michalek May 8, 2025
5aefd44
fix(dropdown-menu): add missing separator ui field on items
J-Michalek May 8, 2025
fbd07a7
feat(context-menu): add ui field on items
J-Michalek May 8, 2025
dc34129
test(context-menu): add ui field on items
J-Michalek May 8, 2025
b4bfcda
docs(context-menu): add ui field on items
J-Michalek May 8, 2025
2a270ea
feat(carousel): add ui field on items
J-Michalek May 8, 2025
2aca477
test(carousel): add ui field on items
J-Michalek May 8, 2025
9977bad
docs(carousel): add ui field on items
J-Michalek May 8, 2025
9a7309a
test(carousel): fix listing issues
J-Michalek May 8, 2025
58bc81d
Merge branch 'v3' into feat/stepper-icon-class
J-Michalek May 9, 2025
29798bf
docs(stepper): remove iconClass field
J-Michalek May 9, 2025
65947d4
docs(carousel): adjust objects description
J-Michalek May 9, 2025
e9a2568
Merge branch 'v3' into feat/stepper-icon-class
J-Michalek May 9, 2025
89015ed
Merge branch 'feat/stepper-icon-class' of https://github.com/J-Michal…
J-Michalek May 9, 2025
229a04d
feat(components): add class field to items along with the ui field
May 10, 2025
2b13de4
Merge branch 'v3' of https://github.com/J-Michalek/ui into feat/stepp…
May 10, 2025
2d404a9
test(navigation-menu): update snapshots
May 10, 2025
e9337e2
feat(breadcrumb)!: move item.class to root element of the item
May 10, 2025
72dfb4d
feat(navigation-menu)!: move item.class to root element of the item
May 10, 2025
0c64fd2
Merge branch 'v3' of https://github.com/J-Michalek/ui into feat/stepp…
May 10, 2025
57bd7f3
Merge branch 'v3' into feat/stepper-icon-class
J-Michalek May 10, 2025
feb7ca7
fix(navigation-menu): bind item.ui.link to ULinkBase
May 10, 2025
229560c
Merge branch 'feat/stepper-icon-class' of https://github.com/J-Michal…
May 10, 2025
bc577bc
Merge branch 'v3' into feat/stepper-icon-class
benjamincanac May 13, 2025
8c99769
docs: move `class` under `ui`
benjamincanac May 13, 2025
2ba32d5
fix: wrong overrides
benjamincanac May 13, 2025
0ad223f
test: update snapshots
benjamincanac May 13, 2025
8c03897
chore: move `class` over `ui` for consistency
benjamincanac May 13, 2025
fbc2c07
fix(CheckboxGroup): proxy checkbox ui
benjamincanac May 13, 2025
fd9b3ed
fix(ContextMenu/DropdownMenu): handle item.class for all item types
benjamincanac May 13, 2025
b8b0e87
fix(InputMenu/Select/SelectMenu): handle item.class for all item types
benjamincanac May 13, 2025
ba3b7b9
docs(checkbox-group): missing ui
benjamincanac May 13, 2025
51c4cd8
fix(Stepper): remove `iconClass`
benjamincanac May 13, 2025
2c10dae
test(accordion): remove duplicated tests
May 13, 2025
242a74b
feat(command-palette): add ui and class fields to items
May 13, 2025
8e7e881
test(components): remove cases for ui and class fields in items
May 13, 2025
64bcf9e
docs(command-pallete): move ui and class fields under items
May 13, 2025
8619c90
docs(command-palette): move ui under class for consistency
May 13, 2025
76dffc0
up
benjamincanac May 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/content/3.components/accordion.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
3 changes: 2 additions & 1 deletion docs/content/3.components/breadcrumb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
5 changes: 5 additions & 0 deletions docs/content/3.components/carousel.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/checkbox-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/command-palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The CommandPalette component filters groups and ranks matching commands by relev
- [`ignoreFilter?: boolean`{lang="ts-type"}](#with-ignore-filter)
- [`postFilter?: (searchTerm: string, items: T[]) => T[]`{lang="ts-type"}](#with-post-filtered-items)
- `highlightedIcon?: string`{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"}
- `class?: any`{lang="ts-type"}

::caution
You must provide an `id` for each group otherwise the group will be ignored.
Expand Down
3 changes: 2 additions & 1 deletion docs/content/3.components/context-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 2 additions & 1 deletion docs/content/3.components/dropdown-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/input-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
5 changes: 3 additions & 2 deletions docs/content/3.components/navigation-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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`

::

Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/radio-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/select-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/stepper.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
2 changes: 2 additions & 0 deletions docs/content/3.components/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 10 additions & 8 deletions src/runtime/components/Accordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export interface AccordionItem {
/** A unique value for the accordion item. Defaults to the index. */
value?: string
disabled?: boolean
class?: any
ui?: Pick<Accordion['slots'], 'item' | 'header' | 'trigger' | 'leadingIcon' | 'label' | 'trailingIcon' | 'content' | 'body'>
[key: string]: any
}

Expand Down Expand Up @@ -96,27 +98,27 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.accordion ||
:key="index"
:value="item.value || String(index)"
:disabled="item.disabled"
:class="ui.item({ class: props.ui?.item })"
:class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
>
<AccordionHeader as="div" :class="ui.header({ class: props.ui?.header })">
<AccordionTrigger :class="ui.trigger({ class: props.ui?.trigger, disabled: item.disabled })">
<AccordionHeader as="div" :class="ui.header({ class: [props.ui?.header, item.ui?.header] })">
<AccordionTrigger :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger], disabled: item.disabled })">
<slot name="leading" :item="item" :index="index" :open="open">
<UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
<UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item?.ui?.leadingIcon] })" />
</slot>

<span v-if="get(item, props.labelKey as string) || !!slots.default" :class="ui.label({ class: props.ui?.label })">
<span v-if="get(item, props.labelKey as string) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
<slot :item="item" :index="index" :open="open">{{ get(item, props.labelKey as string) }}</slot>
</span>

<slot name="trailing" :item="item" :index="index" :open="open">
<UIcon :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.trailingIcon({ class: props.ui?.trailingIcon })" />
<UIcon :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.trailingIcon({ class: [props.ui?.trailingIcon, item.ui?.trailingIcon] })" />
</slot>
</AccordionTrigger>
</AccordionHeader>

<AccordionContent v-if="item.content || !!slots.content || (item.slot && !!slots[item.slot as keyof AccordionSlots<T>]) || !!slots.body || (item.slot && !!slots[`${item.slot}-body` as keyof AccordionSlots<T>])" :class="ui.content({ class: props.ui?.content })">
<AccordionContent v-if="item.content || !!slots.content || (item.slot && !!slots[item.slot as keyof AccordionSlots<T>]) || !!slots.body || (item.slot && !!slots[`${item.slot}-body` as keyof AccordionSlots<T>])" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
<slot :name="((item.slot || 'content') as keyof AccordionSlots<T>)" :item="(item as Extract<T, { slot: string; }>)" :index="index" :open="open">
<div :class="ui.body({ class: props.ui?.body })">
<div :class="ui.body({ class: [props.ui?.body, item.ui?.body] })">
<slot :name="((item.slot ? `${item.slot}-body`: 'body') as keyof AccordionSlots<T>)" :item="(item as Extract<T, { slot: string; }>)" :index="index" :open="open">
{{ item.content }}
</slot>
Expand Down
16 changes: 9 additions & 7 deletions src/runtime/components/Breadcrumb.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export interface BreadcrumbItem extends Omit<LinkProps, 'raw' | 'custom'> {
icon?: string
avatar?: AvatarProps
slot?: string
class?: any
ui?: Pick<Breadcrumb['slots'], 'item' | 'link' | 'linkLeadingIcon' | 'linkLeadingAvatar' | 'linkLabel' | 'separator' | 'separatorIcon'>
[key: string]: any
}

Expand Down Expand Up @@ -84,16 +86,16 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb |
<Primitive :as="as" aria-label="breadcrumb" :class="ui.root({ class: [props.ui?.root, props.class] })">
<ol :class="ui.list({ class: props.ui?.list })">
<template v-for="(item, index) in items" :key="index">
<li :class="ui.item({ class: props.ui?.item })">
<li :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })">
<ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
<ULinkBase v-bind="slotProps" as="span" :aria-current="active && (index === items!.length - 1) ? 'page' : undefined" :class="ui.link({ class: [props.ui?.link, item.class], active: index === items!.length - 1, disabled: !!item.disabled, to: !!item.to })">
<ULinkBase v-bind="slotProps" as="span" :aria-current="active && (index === items!.length - 1) ? 'page' : undefined" :class="ui.link({ class: [props.ui?.link, item.ui?.link], active: index === items!.length - 1, disabled: !!item.disabled, to: !!item.to })">
<slot :name="((item.slot || 'item') as keyof BreadcrumbSlots<T>)" :item="item" :index="index">
<slot :name="((item.slot ? `${item.slot}-leading`: 'item-leading') as keyof BreadcrumbSlots<T>)" :item="item" :active="index === items!.length - 1" :index="index">
<UIcon v-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: props.ui?.linkLeadingIcon, active: index === items!.length - 1 })" />
<UAvatar v-else-if="item.avatar" :size="((props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: props.ui?.linkLeadingAvatar, active: index === items!.length - 1 })" />
<UIcon v-if="item.icon" :name="item.icon" :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active: index === items!.length - 1 })" />
<UAvatar v-else-if="item.avatar" :size="((props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active: index === items!.length - 1 })" />
</slot>

<span v-if="get(item, props.labelKey as string) || !!slots[(item.slot ? `${item.slot}-label`: 'item-label') as keyof BreadcrumbSlots<T>]" :class="ui.linkLabel({ class: props.ui?.linkLabel })">
<span v-if="get(item, props.labelKey as string) || !!slots[(item.slot ? `${item.slot}-label`: 'item-label') as keyof BreadcrumbSlots<T>]" :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })">
<slot :name="((item.slot ? `${item.slot}-label`: 'item-label') as keyof BreadcrumbSlots<T>)" :item="item" :active="index === items!.length - 1" :index="index">
{{ get(item, props.labelKey as string) }}
</slot>
Expand All @@ -105,9 +107,9 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.breadcrumb |
</ULink>
</li>

<li v-if="index < items!.length - 1" role="presentation" aria-hidden="true" :class="ui.separator({ class: props.ui?.separator })">
<li v-if="index < items!.length - 1" role="presentation" aria-hidden="true" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })">
<slot name="separator">
<UIcon :name="separatorIcon" :class="ui.separatorIcon({ class: props.ui?.separatorIcon })" />
<UIcon :name="separatorIcon" :class="ui.separatorIcon({ class: [props.ui?.separatorIcon, item.ui?.separatorIcon] })" />
</slot>
</li>
</template>
Expand Down
14 changes: 12 additions & 2 deletions src/runtime/components/Carousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ import type { ComponentConfig } from '../types/utils'

type Carousel = ComponentConfig<typeof theme, AppConfig, 'carousel'>

export type CarouselItem = AcceptableValue
interface _CarouselItem {
class?: any
ui?: Pick<Carousel['slots'], 'item'>
[key: string]: any
}

export type CarouselItem = _CarouselItem | AcceptableValue

export interface CarouselProps<T extends CarouselItem = CarouselItem> extends Omit<EmblaOptionsType, 'axis' | 'container' | 'slides' | 'direction'> {
/**
Expand Down Expand Up @@ -254,6 +260,10 @@ function onSelect(api: EmblaCarouselType) {
emits('select', selectedIndex.value)
}

function isCarouselItem(item: CarouselItem): item is _CarouselItem {
return typeof item === 'object' && item !== null
}

onMounted(() => {
if (!emblaApi.value) {
return
Expand Down Expand Up @@ -288,7 +298,7 @@ defineExpose({
:key="index"
role="group"
aria-roledescription="slide"
:class="ui.item({ class: props.ui?.item })"
:class="ui.item({ class: [props.ui?.item, isCarouselItem(item) && item.ui?.item, isCarouselItem(item) && item.class] })"
>
<slot :item="item" :index="index" />
</div>
Expand Down
Loading