Skip to content

Commit d1afe90

Browse files
fix(components): add missing ui prop in prose proxy components (#5205)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
1 parent 84f87a5 commit d1afe90

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/runtime/components/prose/Accordion.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
<script lang="ts">
22
import type { AppConfig } from '@nuxt/schema'
33
import theme from '#build/ui/prose/accordion'
4+
import type { AccordionProps } from '../../types'
45
import type { ComponentConfig } from '../../types/tv'
56
67
type ProseAccordion = ComponentConfig<typeof theme, AppConfig, 'accordion', 'ui.prose'>
78
89
export interface ProseAccordionProps {
910
type?: 'single' | 'multiple'
1011
class?: any
12+
ui?: ProseAccordion['slots'] & AccordionProps['ui']
1113
}
1214
1315
export interface ProseAccordionSlots {
@@ -29,6 +31,7 @@ const slots = defineSlots<ProseAccordionSlots>()
2931
3032
const appConfig = useAppConfig() as ProseAccordion['AppConfig']
3133
34+
// eslint-disable-next-line vue/no-dupe-keys
3235
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.prose?.accordion || {}) }))
3336
3437
const rerenderCount = ref(1)
@@ -62,7 +65,7 @@ onBeforeUpdate(() => rerenderCount.value++)
6265
</script>
6366

6467
<template>
65-
<UAccordion :type="type" :items="items" :unmount-on-hide="false" :class="props.class" :ui="transformUI(ui())">
68+
<UAccordion :type="type" :items="items" :unmount-on-hide="false" :class="props.class" :ui="transformUI(ui(), props.ui)">
6669
<template #content="{ item }">
6770
<component :is="item.component" />
6871
</template>

src/runtime/components/prose/Collapsible.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import type { AppConfig } from '@nuxt/schema'
33
import theme from '#build/ui/prose/collapsible'
4-
import type { IconProps } from '../../types'
4+
import type { IconProps, CollapsibleProps } from '../../types'
55
import type { ComponentConfig } from '../../types/tv'
66
77
type ProseCollapsible = ComponentConfig<typeof theme, AppConfig, 'collapsible', 'ui.prose'>
@@ -28,7 +28,7 @@ export interface ProseCollapsibleProps {
2828
*/
2929
closeText?: string
3030
class?: any
31-
ui?: ProseCollapsible['slots']
31+
ui?: ProseCollapsible['slots'] & CollapsibleProps['ui']
3232
}
3333
3434
export interface ProseCollapsibleSlots {
@@ -56,7 +56,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.prose?.colla
5656
</script>
5757

5858
<template>
59-
<UCollapsible :unmount-on-hide="false" :class="props.class" :ui="transformUI(ui)">
59+
<UCollapsible :unmount-on-hide="false" :class="props.class" :ui="transformUI(ui, props.ui)">
6060
<template #default="{ open }">
6161
<button :class="ui.trigger({ class: props.ui?.trigger })">
6262
<UIcon :name="icon || appConfig.ui.icons.chevronDown" :class="ui.triggerIcon({ class: props.ui?.triggerIcon })" />

src/runtime/components/prose/Tabs.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts">
22
import type { AppConfig } from '@nuxt/schema'
33
import theme from '#build/ui/prose/tabs'
4+
import type { TabsProps } from '../../types'
45
import type { ComponentConfig } from '../../types/tv'
56
67
type ProseTabs = ComponentConfig<typeof theme, AppConfig, 'tabs', 'ui.prose'>
@@ -20,6 +21,7 @@ export interface ProseTabsProps {
2021
*/
2122
hash?: string
2223
class?: any
24+
ui?: ProseTabs['slots'] & TabsProps['ui']
2325
}
2426
2527
export interface ProseTabsSlots {
@@ -43,6 +45,7 @@ const model = defineModel<string>()
4345
4446
const appConfig = useAppConfig() as ProseTabs['AppConfig']
4547
48+
// eslint-disable-next-line vue/no-dupe-keys
4649
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.prose?.tabs || {}) }))
4750
4851
const rerenderCount = ref(1)
@@ -112,7 +115,7 @@ onBeforeUpdate(() => rerenderCount.value++)
112115
:items="items"
113116
:class="props.class"
114117
:unmount-on-hide="false"
115-
:ui="transformUI(ui())"
118+
:ui="transformUI(ui(), props.ui)"
116119
@update:model-value="onUpdateModelValue"
117120
>
118121
<template #content="{ item }">

0 commit comments

Comments
 (0)