@nuxt/ui 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/.nuxt/ui/alert.ts +0 -5
  2. package/.nuxt/ui/badge.ts +30 -7
  3. package/.nuxt/ui/button-group.ts +0 -13
  4. package/.nuxt/ui/button.ts +2 -7
  5. package/.nuxt/ui/calendar.ts +1 -1
  6. package/.nuxt/ui/carousel.ts +0 -5
  7. package/.nuxt/ui/checkbox-group.ts +144 -1
  8. package/.nuxt/ui/color-picker.ts +2 -2
  9. package/.nuxt/ui/input-menu.ts +2 -11
  10. package/.nuxt/ui/input-number.ts +10 -0
  11. package/.nuxt/ui/input.ts +2 -11
  12. package/.nuxt/ui/link.ts +12 -5
  13. package/.nuxt/ui/select-menu.ts +2 -11
  14. package/.nuxt/ui/select.ts +2 -11
  15. package/.nuxt/ui/tabs.ts +4 -3
  16. package/.nuxt/ui/textarea.ts +2 -11
  17. package/.nuxt/ui/toast.ts +0 -5
  18. package/cli/templates.mjs +2 -2
  19. package/dist/module.json +1 -1
  20. package/dist/module.mjs +14 -5
  21. package/dist/runtime/components/Accordion.vue +9 -9
  22. package/dist/runtime/components/Accordion.vue.d.ts +2 -0
  23. package/dist/runtime/components/Alert.vue +1 -1
  24. package/dist/runtime/components/Avatar.vue +2 -2
  25. package/dist/runtime/components/AvatarGroup.vue +1 -1
  26. package/dist/runtime/components/Badge.vue +5 -3
  27. package/dist/runtime/components/Badge.vue.d.ts +2 -0
  28. package/dist/runtime/components/Breadcrumb.vue +8 -8
  29. package/dist/runtime/components/Breadcrumb.vue.d.ts +2 -0
  30. package/dist/runtime/components/Button.vue +2 -3
  31. package/dist/runtime/components/Button.vue.d.ts +1 -1
  32. package/dist/runtime/components/Calendar.vue +2 -1
  33. package/dist/runtime/components/Card.vue +1 -1
  34. package/dist/runtime/components/Carousel.vue +5 -2
  35. package/dist/runtime/components/Carousel.vue.d.ts +6 -1
  36. package/dist/runtime/components/Checkbox.vue +2 -2
  37. package/dist/runtime/components/CheckboxGroup.vue +8 -5
  38. package/dist/runtime/components/CheckboxGroup.vue.d.ts +7 -1
  39. package/dist/runtime/components/Chip.vue +1 -1
  40. package/dist/runtime/components/Collapsible.vue +1 -1
  41. package/dist/runtime/components/ColorPicker.vue +1 -1
  42. package/dist/runtime/components/CommandPalette.vue +17 -17
  43. package/dist/runtime/components/CommandPalette.vue.d.ts +2 -0
  44. package/dist/runtime/components/ContextMenu.vue.d.ts +2 -0
  45. package/dist/runtime/components/ContextMenuContent.vue +15 -15
  46. package/dist/runtime/components/DropdownMenu.vue.d.ts +2 -0
  47. package/dist/runtime/components/DropdownMenuContent.vue +15 -15
  48. package/dist/runtime/components/FormField.vue +5 -5
  49. package/dist/runtime/components/Input.vue +2 -2
  50. package/dist/runtime/components/Input.vue.d.ts +23 -29
  51. package/dist/runtime/components/InputMenu.vue +17 -17
  52. package/dist/runtime/components/InputMenu.vue.d.ts +210 -0
  53. package/dist/runtime/components/InputNumber.vue +13 -7
  54. package/dist/runtime/components/InputNumber.vue.d.ts +78 -0
  55. package/dist/runtime/components/Link.vue +5 -14
  56. package/dist/runtime/components/NavigationMenu.vue +35 -28
  57. package/dist/runtime/components/NavigationMenu.vue.d.ts +20 -2
  58. package/dist/runtime/components/Pagination.vue +1 -1
  59. package/dist/runtime/components/PinInput.vue +1 -1
  60. package/dist/runtime/components/Progress.vue +1 -1
  61. package/dist/runtime/components/RadioGroup.vue +8 -8
  62. package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
  63. package/dist/runtime/components/Select.vue +12 -12
  64. package/dist/runtime/components/Select.vue.d.ts +3 -1
  65. package/dist/runtime/components/SelectMenu.vue +13 -13
  66. package/dist/runtime/components/SelectMenu.vue.d.ts +2 -0
  67. package/dist/runtime/components/Separator.vue +1 -1
  68. package/dist/runtime/components/Slider.vue +16 -4
  69. package/dist/runtime/components/Slider.vue.d.ts +26 -20
  70. package/dist/runtime/components/Stepper.vue +10 -10
  71. package/dist/runtime/components/Stepper.vue.d.ts +2 -0
  72. package/dist/runtime/components/Switch.vue +1 -1
  73. package/dist/runtime/components/Table.vue +2 -2
  74. package/dist/runtime/components/Tabs.vue +6 -6
  75. package/dist/runtime/components/Tabs.vue.d.ts +2 -0
  76. package/dist/runtime/components/Textarea.vue +3 -3
  77. package/dist/runtime/components/Textarea.vue.d.ts +23 -30
  78. package/dist/runtime/components/Toast.vue +3 -2
  79. package/dist/runtime/components/Toast.vue.d.ts +6 -0
  80. package/dist/runtime/components/Toaster.vue +4 -4
  81. package/dist/runtime/components/Toaster.vue.d.ts +6 -0
  82. package/dist/runtime/components/Tree.vue +10 -10
  83. package/dist/runtime/components/Tree.vue.d.ts +2 -0
  84. package/dist/runtime/composables/useFormField.d.ts +1 -1
  85. package/dist/runtime/composables/useFormField.js +2 -1
  86. package/dist/runtime/inertia/components/Link.vue +46 -60
  87. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  88. package/dist/runtime/inertia/components/LinkBase.vue +68 -0
  89. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +25 -0
  90. package/dist/runtime/inertia/stubs.d.ts +1 -1
  91. package/dist/runtime/inertia/stubs.js +1 -1
  92. package/dist/runtime/locale/index.d.ts +1 -0
  93. package/dist/runtime/locale/index.js +1 -0
  94. package/dist/runtime/locale/sl.d.ts +3 -0
  95. package/dist/runtime/locale/sl.js +54 -0
  96. package/dist/runtime/utils/link.d.ts +1 -0
  97. package/dist/runtime/utils/link.js +12 -0
  98. package/dist/runtime/vue/components/Link.vue +27 -40
  99. package/dist/runtime/vue/composables/useAppConfig.js +3 -1
  100. package/dist/runtime/vue/stubs.d.ts +1 -1
  101. package/dist/runtime/vue/stubs.js +1 -1
  102. package/dist/shared/{ui.CbtTMMzt.mjs → ui.BvUP-pSb.mjs} +103 -16
  103. package/dist/unplugin.mjs +1 -1
  104. package/dist/vite.mjs +1 -1
  105. package/package.json +21 -21
@@ -185,7 +185,7 @@ function isSelectItem(item) {
185
185
  >
186
186
  <span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
187
187
  <slot name="create-item-label" :item="searchTerm">
188
- {{ t('selectMenu.create', { label: searchTerm }) }}
188
+ {{ t("selectMenu.create", { label: searchTerm }) }}
189
189
  </slot>
190
190
  </span>
191
191
  </ComboboxItem>
@@ -204,7 +204,7 @@ function isSelectItem(item) {
204
204
  @update:open="onUpdateOpen"
205
205
  >
206
206
  <ComboboxAnchor as-child>
207
- <ComboboxTrigger :class="ui.base({ class: [props.class, props.ui?.base] })" tabindex="0">
207
+ <ComboboxTrigger :class="ui.base({ class: [props.ui?.base, props.class] })" tabindex="0">
208
208
  <span v-if="isLeading || !!avatar || !!slots.leading" :class="ui.leading({ class: props.ui?.leading })">
209
209
  <slot name="leading" :model-value="modelValue" :open="open" :ui="ui">
210
210
  <UIcon v-if="isLeading && leadingIconName" :name="leadingIconName" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
@@ -218,7 +218,7 @@ function isSelectItem(item) {
218
218
  {{ displayedModelValue }}
219
219
  </span>
220
220
  <span v-else :class="ui.placeholder({ class: props.ui?.placeholder })">
221
- {{ placeholder ?? '\xA0' }}
221
+ {{ placeholder ?? "\xA0" }}
222
222
  </span>
223
223
  </template>
224
224
  </slot>
@@ -242,7 +242,7 @@ function isSelectItem(item) {
242
242
 
243
243
  <ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
244
244
  <slot name="empty" :search-term="searchTerm">
245
- {{ searchTerm ? t('selectMenu.noMatch', { searchTerm }) : t('selectMenu.noData') }}
245
+ {{ searchTerm ? t("selectMenu.noMatch", { searchTerm }) : t("selectMenu.noData") }}
246
246
  </slot>
247
247
  </ComboboxEmpty>
248
248
 
@@ -251,44 +251,44 @@ function isSelectItem(item) {
251
251
 
252
252
  <ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
253
253
  <template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
254
- <ComboboxLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: props.ui?.label })">
254
+ <ComboboxLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
255
255
  {{ get(item, props.labelKey) }}
256
256
  </ComboboxLabel>
257
257
 
258
- <ComboboxSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: props.ui?.separator })" />
258
+ <ComboboxSeparator v-else-if="isSelectItem(item) && item.type === 'separator'" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
259
259
 
260
260
  <ComboboxItem
261
261
  v-else
262
- :class="ui.item({ class: props.ui?.item })"
262
+ :class="ui.item({ class: [props.ui?.item, isSelectItem(item) && item.ui?.item, isSelectItem(item) && item.class] })"
263
263
  :disabled="isSelectItem(item) && item.disabled"
264
264
  :value="props.valueKey && isSelectItem(item) ? get(item, props.valueKey) : item"
265
265
  @select="onSelect($event, item)"
266
266
  >
267
267
  <slot name="item" :item="item" :index="index">
268
268
  <slot name="item-leading" :item="item" :index="index">
269
- <UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: props.ui?.itemLeadingIcon })" />
270
- <UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
269
+ <UIcon v-if="isSelectItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
270
+ <UAvatar v-else-if="isSelectItem(item) && item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [props.ui?.itemLeadingAvatar, item.ui?.itemLeadingAvatar] })" />
271
271
  <UChip
272
272
  v-else-if="isSelectItem(item) && item.chip"
273
273
  :size="props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
274
274
  inset
275
275
  standalone
276
276
  v-bind="item.chip"
277
- :class="ui.itemLeadingChip({ class: props.ui?.itemLeadingChip })"
277
+ :class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
278
278
  />
279
279
  </slot>
280
280
 
281
- <span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
281
+ <span :class="ui.itemLabel({ class: [props.ui?.itemLabel, isSelectItem(item) && item.ui?.itemLabel] })">
282
282
  <slot name="item-label" :item="item" :index="index">
283
283
  {{ isSelectItem(item) ? get(item, props.labelKey) : item }}
284
284
  </slot>
285
285
  </span>
286
286
 
287
- <span :class="ui.itemTrailing({ class: props.ui?.itemTrailing })">
287
+ <span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isSelectItem(item) && item.ui?.itemTrailing] })">
288
288
  <slot name="item-trailing" :item="item" :index="index" />
289
289
 
290
290
  <ComboboxItemIndicator as-child>
291
- <UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: props.ui?.itemTrailingIcon })" />
291
+ <UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isSelectItem(item) && item.ui?.itemTrailingIcon] })" />
292
292
  </ComboboxItemIndicator>
293
293
  </span>
294
294
  </slot>
@@ -20,6 +20,8 @@ interface _SelectMenuItem {
20
20
  type?: 'label' | 'separator' | 'item';
21
21
  disabled?: boolean;
22
22
  onSelect?(e?: Event): void;
23
+ class?: any;
24
+ ui?: Pick<SelectMenu['slots'], 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChipSize' | 'itemLeadingChip' | 'itemLabel' | 'itemTrailing' | 'itemTrailingIcon'>;
23
25
  [key: string]: any;
24
26
  }
25
27
  export type SelectMenuItem = _SelectMenuItem | AcceptableValue | boolean;
@@ -35,7 +35,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.separator ||
35
35
  </script>
36
36
 
37
37
  <template>
38
- <Separator v-bind="rootProps" :class="ui.root({ class: [props.class, props.ui?.root] })">
38
+ <Separator v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
39
39
  <div :class="ui.border({ class: props.ui?.border })" />
40
40
 
41
41
  <template v-if="label || icon || avatar || !!slots.default">
@@ -9,11 +9,13 @@ import { reactivePick } from "@vueuse/core";
9
9
  import { useAppConfig } from "#imports";
10
10
  import { useFormField } from "../composables/useFormField";
11
11
  import { tv } from "../utils/tv";
12
+ import UTooltip from "./Tooltip.vue";
12
13
  const props = defineProps({
13
14
  as: { type: null, required: false },
14
15
  size: { type: null, required: false },
15
16
  color: { type: null, required: false },
16
17
  orientation: { type: null, required: false, default: "horizontal" },
18
+ tooltip: { type: [Boolean, Object], required: false },
17
19
  defaultValue: { type: [Number, Array], required: false },
18
20
  class: { type: null, required: false },
19
21
  ui: { type: null, required: false },
@@ -26,7 +28,7 @@ const props = defineProps({
26
28
  minStepsBetweenThumbs: { type: Number, required: false }
27
29
  });
28
30
  const emits = defineEmits(["update:modelValue", "change"]);
29
- const modelValue = defineModel({ type: [Number, Array] });
31
+ const modelValue = defineModel({ type: null });
30
32
  const appConfig = useAppConfig();
31
33
  const rootProps = useForwardPropsEmits(reactivePick(props, "as", "orientation", "min", "max", "step", "minStepsBetweenThumbs", "inverted"), emits);
32
34
  const { id, emitFormChange, emitFormInput, size, color, name, disabled, ariaAttrs } = useFormField(props);
@@ -47,7 +49,7 @@ const sliderValue = computed({
47
49
  modelValue.value = value?.length !== 1 ? value : value[0];
48
50
  }
49
51
  });
50
- const thumbsCount = computed(() => sliderValue.value?.length ?? 1);
52
+ const thumbs = computed(() => sliderValue.value?.length ?? 1);
51
53
  const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slider || {} })({
52
54
  disabled: disabled.value,
53
55
  size: size.value,
@@ -68,7 +70,7 @@ function onChange(value) {
68
70
  v-model="sliderValue"
69
71
  :name="name"
70
72
  :disabled="disabled"
71
- :class="ui.root({ class: [props.class, props.ui?.root] })"
73
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
72
74
  :default-value="defaultSliderValue"
73
75
  @update:model-value="emitFormInput()"
74
76
  @value-commit="onChange"
@@ -77,6 +79,16 @@ function onChange(value) {
77
79
  <SliderRange :class="ui.range({ class: props.ui?.range })" />
78
80
  </SliderTrack>
79
81
 
80
- <SliderThumb v-for="count in thumbsCount" :key="count" :class="ui.thumb({ class: props.ui?.thumb })" />
82
+ <template v-for="thumb in thumbs" :key="thumb">
83
+ <UTooltip
84
+ v-if="!!tooltip"
85
+ :text="thumbs > 1 ? String(sliderValue?.[thumb - 1]) : String(sliderValue)"
86
+ disable-closing-trigger
87
+ v-bind="typeof tooltip === 'object' ? tooltip : {}"
88
+ >
89
+ <SliderThumb :class="ui.thumb({ class: props.ui?.thumb })" />
90
+ </UTooltip>
91
+ <SliderThumb v-else :class="ui.thumb({ class: props.ui?.thumb })" />
92
+ </template>
81
93
  </SliderRoot>
82
94
  </template>
@@ -1,6 +1,7 @@
1
1
  import type { SliderRootProps } from 'reka-ui';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/slider';
4
+ import type { TooltipProps } from '../types';
4
5
  import type { ComponentConfig } from '../types/utils';
5
6
  type Slider = ComponentConfig<typeof theme, AppConfig, 'slider'>;
6
7
  export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' | 'inverted' | 'min' | 'max' | 'step' | 'minStepsBetweenThumbs'> {
@@ -22,31 +23,36 @@ export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' |
22
23
  * @defaultValue 'horizontal'
23
24
  */
24
25
  orientation?: SliderRootProps['orientation'];
26
+ /**
27
+ * Display a tooltip around the slider thumbs with the current value.
28
+ * `{ disableClosingTrigger: true }`{lang="ts-type"}
29
+ * @defaultValue false
30
+ */
31
+ tooltip?: boolean | TooltipProps;
25
32
  /** The value of the slider when initially rendered. Use when you do not need to control the state of the slider. */
26
33
  defaultValue?: number | number[];
27
34
  class?: any;
28
35
  ui?: Slider['slots'];
29
36
  }
30
- export interface SliderEmits {
31
- (e: 'update:modelValue', payload: number | number[]): void;
37
+ export interface SliderEmits<T extends number | number[] = number | number[]> {
38
+ (e: 'update:modelValue', payload: T): void;
32
39
  (e: 'change', payload: Event): void;
33
40
  }
34
- declare const _default: import("vue").DefineComponent<SliderProps & {
35
- modelValue?: number | number[];
36
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
- "update:modelValue": (value: number | number[] | undefined) => any;
38
- } & {
39
- change: (payload: Event) => any;
40
- "update:modelValue": (payload: number | number[]) => any;
41
- }, string, import("vue").PublicProps, Readonly<SliderProps & {
42
- modelValue?: number | number[];
43
- }> & Readonly<{
44
- onChange?: ((payload: Event) => any) | undefined;
45
- "onUpdate:modelValue"?: ((payload: number | number[]) => any) | undefined;
46
- }>, {
47
- orientation: "horizontal" | "vertical";
48
- step: number;
49
- max: number;
50
- min: number;
51
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
+ declare const _default: <T extends number | number[]>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
42
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
43
+ readonly onChange?: ((payload: Event) => any) | undefined;
44
+ readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
45
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onChange" | "onUpdate:modelValue"> & (SliderProps & {
46
+ modelValue?: T;
47
+ }) & Partial<{}>> & import("vue").PublicProps;
48
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
49
+ attrs: any;
50
+ slots: {};
51
+ emit: SliderEmits<T> & ((evt: "update:modelValue", value: T | undefined) => void);
52
+ }>) => import("vue").VNode & {
53
+ __ctx?: Awaited<typeof __VLS_setup>;
54
+ };
52
55
  export default _default;
56
+ type __VLS_PrettifyLocal<T> = {
57
+ [K in keyof T]: T[K];
58
+ } & {};
@@ -62,20 +62,20 @@ defineExpose({
62
62
  </script>
63
63
 
64
64
  <template>
65
- <StepperRoot v-bind="rootProps" v-model="currentStepIndex" :class="ui.root({ class: [props.class, props.ui?.root] })">
65
+ <StepperRoot v-bind="rootProps" v-model="currentStepIndex" :class="ui.root({ class: [props.ui?.root, props.class] })">
66
66
  <div :class="ui.header({ class: props.ui?.header })">
67
67
  <StepperItem
68
68
  v-for="(item, count) in items"
69
69
  :key="item.value ?? count"
70
70
  :step="count"
71
71
  :disabled="item.disabled || props.disabled"
72
- :class="ui.item({ class: props.ui?.item })"
72
+ :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
73
73
  >
74
- <div :class="ui.container({ class: props.ui?.container })">
75
- <StepperTrigger :class="ui.trigger({ class: props.ui?.trigger })">
76
- <StepperIndicator :class="ui.indicator({ class: props.ui?.indicator })">
74
+ <div :class="ui.container({ class: [props.ui?.container, item.ui?.container] })">
75
+ <StepperTrigger :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })">
76
+ <StepperIndicator :class="ui.indicator({ class: [props.ui?.indicator, item.ui?.indicator] })">
77
77
  <slot name="indicator" :item="item">
78
- <UIcon v-if="item.icon" :name="item.icon" :class="ui.icon({ class: props.ui?.icon })" />
78
+ <UIcon v-if="item.icon" :name="item.icon" :class="ui.icon({ class: [props.ui?.icon, item.ui?.icon] })" />
79
79
  <template v-else>
80
80
  {{ count + 1 }}
81
81
  </template>
@@ -85,17 +85,17 @@ defineExpose({
85
85
 
86
86
  <StepperSeparator
87
87
  v-if="count < items.length - 1"
88
- :class="ui.separator({ class: props.ui?.separator })"
88
+ :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator] })"
89
89
  />
90
90
  </div>
91
91
 
92
- <div :class="ui.wrapper({ class: props.ui?.wrapper })">
93
- <StepperTitle :class="ui.title({ class: props.ui?.title })">
92
+ <div :class="ui.wrapper({ class: [props.ui?.wrapper, item.ui?.wrapper] })">
93
+ <StepperTitle as="div" :class="ui.title({ class: [props.ui?.title, item.ui?.title] })">
94
94
  <slot name="title" :item="item">
95
95
  {{ item.title }}
96
96
  </slot>
97
97
  </StepperTitle>
98
- <StepperDescription :class="ui.description({ class: props.ui?.description })">
98
+ <StepperDescription as="div" :class="ui.description({ class: [props.ui?.description, item.ui?.description] })">
99
99
  <slot name="description" :item="item">
100
100
  {{ item.description }}
101
101
  </slot>
@@ -14,6 +14,8 @@ export interface StepperItem {
14
14
  icon?: string;
15
15
  content?: string;
16
16
  disabled?: boolean;
17
+ class?: any;
18
+ ui?: Pick<Stepper['slots'], 'item' | 'container' | 'trigger' | 'indicator' | 'icon' | 'separator' | 'wrapper' | 'title' | 'description'>;
17
19
  [key: string]: any;
18
20
  }
19
21
  export interface StepperProps<T extends StepperItem = StepperItem> extends Pick<StepperRootProps, 'linear'> {
@@ -53,7 +53,7 @@ function onUpdate(value) {
53
53
  </script>
54
54
 
55
55
  <template>
56
- <Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
56
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
57
57
  <div :class="ui.container({ class: props.ui?.container })">
58
58
  <SwitchRoot
59
59
  :id="id"
@@ -189,7 +189,7 @@ defineExpose({
189
189
  </script>
190
190
 
191
191
  <template>
192
- <Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
192
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
193
193
  <table ref="tableRef" :class="ui.base({ class: [props.ui?.base] })">
194
194
  <caption v-if="caption || !!slots.caption" :class="ui.caption({ class: [props.ui?.caption] })">
195
195
  <slot name="caption">
@@ -270,7 +270,7 @@ defineExpose({
270
270
  <tr v-else>
271
271
  <td :colspan="columns?.length" :class="ui.empty({ class: props.ui?.empty })">
272
272
  <slot name="empty">
273
- {{ empty || t('table.noData') }}
273
+ {{ empty || t("table.noData") }}
274
274
  </slot>
275
275
  </td>
276
276
  </tr>
@@ -40,19 +40,19 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tabs || {} })
40
40
  </script>
41
41
 
42
42
  <template>
43
- <TabsRoot v-bind="rootProps" :class="ui.root({ class: [props.class, props.ui?.root] })">
43
+ <TabsRoot v-bind="rootProps" :class="ui.root({ class: [props.ui?.root, props.class] })">
44
44
  <TabsList :class="ui.list({ class: props.ui?.list })">
45
45
  <TabsIndicator :class="ui.indicator({ class: props.ui?.indicator })" />
46
46
 
47
47
  <slot name="list-leading" />
48
48
 
49
- <TabsTrigger v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :disabled="item.disabled" :class="ui.trigger({ class: props.ui?.trigger })">
49
+ <TabsTrigger v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :disabled="item.disabled" :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger] })">
50
50
  <slot name="leading" :item="item" :index="index">
51
- <UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
52
- <UAvatar v-else-if="item.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
51
+ <UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item.ui?.leadingIcon] })" />
52
+ <UAvatar v-else-if="item.avatar" :size="props.ui?.leadingAvatarSize || ui.leadingAvatarSize()" v-bind="item.avatar" :class="ui.leadingAvatar({ class: [props.ui?.leadingAvatar, item.ui?.leadingAvatar] })" />
53
53
  </slot>
54
54
 
55
- <span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: props.ui?.label })">
55
+ <span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
56
56
  <slot :item="item" :index="index">{{ get(item, props.labelKey) }}</slot>
57
57
  </span>
58
58
 
@@ -63,7 +63,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.tabs || {} })
63
63
  </TabsList>
64
64
 
65
65
  <template v-if="!!content">
66
- <TabsContent v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :class="ui.content({ class: props.ui?.content })">
66
+ <TabsContent v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :class="ui.content({ class: [props.ui?.content, item.ui?.content, item.class] })">
67
67
  <slot :name="item.slot || 'content'" :item="item" :index="index">
68
68
  {{ item.content }}
69
69
  </slot>
@@ -16,6 +16,8 @@ export interface TabsItem {
16
16
  /** A unique value for the tab item. Defaults to the index. */
17
17
  value?: string | number;
18
18
  disabled?: boolean;
19
+ class?: any;
20
+ ui?: Pick<Tabs['slots'], 'trigger' | 'leadingIcon' | 'leadingAvatar' | 'label' | 'content'>;
19
21
  [key: string]: any;
20
22
  }
21
23
  export interface TabsProps<T extends TabsItem = TabsItem> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
@@ -39,9 +39,9 @@ const props = defineProps({
39
39
  loading: { type: Boolean, required: false },
40
40
  loadingIcon: { type: String, required: false }
41
41
  });
42
- const slots = defineSlots();
43
42
  const emits = defineEmits(["update:modelValue", "blur", "change"]);
44
- const [modelValue, modelModifiers] = defineModel({ type: [String, Number, null] });
43
+ const slots = defineSlots();
44
+ const [modelValue, modelModifiers] = defineModel({ type: null });
45
45
  const appConfig = useAppConfig();
46
46
  const { emitFormFocus, emitFormBlur, emitFormInput, emitFormChange, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField(props, { deferInputValidation: true });
47
47
  const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props);
@@ -130,7 +130,7 @@ defineExpose({
130
130
  </script>
131
131
 
132
132
  <template>
133
- <Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
133
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
134
134
  <textarea
135
135
  :id="id"
136
136
  ref="textareaRef"
@@ -1,7 +1,7 @@
1
1
  import type { AppConfig } from '@nuxt/schema';
2
2
  import theme from '#build/ui/textarea';
3
3
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
4
- import type { ComponentConfig } from '../types/utils';
4
+ import type { AcceptableValue, ComponentConfig } from '../types/utils';
5
5
  type Textarea = ComponentConfig<typeof theme, AppConfig, 'textarea'>;
6
6
  export interface TextareaProps extends UseComponentIconsProps {
7
7
  /**
@@ -38,8 +38,8 @@ export interface TextareaProps extends UseComponentIconsProps {
38
38
  highlight?: boolean;
39
39
  ui?: Textarea['slots'];
40
40
  }
41
- export interface TextareaEmits {
42
- (e: 'update:modelValue', payload: string | number): void;
41
+ export interface TextareaEmits<T extends AcceptableValue = AcceptableValue> {
42
+ (e: 'update:modelValue', payload: T): void;
43
43
  (e: 'blur', event: FocusEvent): void;
44
44
  (e: 'change', event: Event): void;
45
45
  }
@@ -48,31 +48,24 @@ export interface TextareaSlots {
48
48
  default(props?: {}): any;
49
49
  trailing(props?: {}): any;
50
50
  }
51
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<TextareaProps & {
52
- modelValue?: string | number | null;
53
- }, {
54
- textareaRef: import("vue").Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
55
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
56
- "update:modelValue": (value: string | number | null | undefined) => any;
57
- } & {
58
- blur: (event: FocusEvent) => any;
59
- change: (event: Event) => any;
60
- "update:modelValue": (payload: string | number) => any;
61
- }, string, import("vue").PublicProps, Readonly<TextareaProps & {
62
- modelValue?: string | number | null;
63
- }> & Readonly<{
64
- onBlur?: ((event: FocusEvent) => any) | undefined;
65
- onChange?: ((event: Event) => any) | undefined;
66
- "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
67
- }>, {
68
- autofocusDelay: number;
69
- autoresizeDelay: number;
70
- rows: number;
71
- maxrows: number;
72
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, TextareaSlots>;
73
- export default _default;
74
- type __VLS_WithSlots<T, S> = T & {
75
- new (): {
76
- $slots: S;
77
- };
51
+ declare const _default: <T extends AcceptableValue>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
52
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
53
+ readonly onBlur?: ((event: FocusEvent) => any) | undefined;
54
+ readonly onChange?: ((event: Event) => any) | undefined;
55
+ readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
56
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & (TextareaProps & {
57
+ modelValue?: T;
58
+ }) & Partial<{}>> & import("vue").PublicProps;
59
+ expose(exposed: import("vue").ShallowUnwrapRef<{
60
+ textareaRef: import("vue").Ref<HTMLTextAreaElement | null, HTMLTextAreaElement | null>;
61
+ }>): void;
62
+ attrs: any;
63
+ slots: TextareaSlots;
64
+ emit: TextareaEmits<T> & ((evt: "update:modelValue", value: T | undefined) => void);
65
+ }>) => import("vue").VNode & {
66
+ __ctx?: Awaited<typeof __VLS_setup>;
78
67
  };
68
+ export default _default;
69
+ type __VLS_PrettifyLocal<T> = {
70
+ [K in keyof T]: T[K];
71
+ } & {};
@@ -20,6 +20,7 @@ const props = defineProps({
20
20
  avatar: { type: Object, required: false },
21
21
  color: { type: null, required: false },
22
22
  orientation: { type: null, required: false, default: "vertical" },
23
+ progress: { type: Boolean, required: false, default: true },
23
24
  actions: { type: Array, required: false },
24
25
  close: { type: [Boolean, Object], required: false, default: true },
25
26
  closeIcon: { type: String, required: false },
@@ -61,7 +62,7 @@ defineExpose({
61
62
  v-slot="{ remaining, duration }"
62
63
  v-bind="rootProps"
63
64
  :data-orientation="orientation"
64
- :class="ui.root({ class: [props.class, props.ui?.root] })"
65
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
65
66
  :style="{ '--height': height }"
66
67
  >
67
68
  <slot name="leading">
@@ -124,6 +125,6 @@ defineExpose({
124
125
  </ToastClose>
125
126
  </div>
126
127
 
127
- <div v-if="remaining > 0 && duration" :class="ui.progress({ class: props.ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
128
+ <div v-if="progress && remaining > 0 && duration" :class="ui.progress({ class: props.ui?.progress })" :style="{ width: `${remaining / duration * 100}%` }" />
128
129
  </ToastRoot>
129
130
  </template>
@@ -26,6 +26,11 @@ export interface ToastProps extends Pick<ToastRootProps, 'defaultOpen' | 'open'
26
26
  * @defaultValue 'vertical'
27
27
  */
28
28
  orientation?: Toast['variants']['orientation'];
29
+ /**
30
+ * Whether to show the progress bar.
31
+ * @defaultValue true
32
+ */
33
+ progress?: boolean;
29
34
  /**
30
35
  * Display a list of actions:
31
36
  * - under the title and description when orientation is `vertical`
@@ -147,6 +152,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToastProps
147
152
  }>, "currentTarget">) => any) | undefined;
148
153
  }>, {
149
154
  close: boolean | Partial<ButtonProps>;
155
+ progress: boolean;
150
156
  orientation: Toast["variants"]["orientation"];
151
157
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ToastSlots>;
152
158
  export default _default;
@@ -18,6 +18,7 @@ import UToast from "./Toast.vue";
18
18
  const props = defineProps({
19
19
  position: { type: null, required: false },
20
20
  expand: { type: Boolean, required: false, default: true },
21
+ progress: { type: Boolean, required: false, default: true },
21
22
  portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
22
23
  class: { type: null, required: false },
23
24
  ui: { type: null, required: false },
@@ -73,6 +74,7 @@ function getOffset(index) {
73
74
  v-for="(toast, index) of toasts"
74
75
  :key="toast.id"
75
76
  ref="refs"
77
+ :progress="progress"
76
78
  v-bind="omit(toast, ['id', 'close'])"
77
79
  :close="toast.close"
78
80
  :data-expanded="expanded"
@@ -85,9 +87,7 @@ function getOffset(index) {
85
87
  '--translate': expanded ? 'calc(var(--offset) * var(--translate-factor))' : 'calc(var(--before) * var(--gap))',
86
88
  '--transform': 'translateY(var(--translate)) scale(var(--scale))'
87
89
  }"
88
- :class="[ui.base(), {
89
- 'cursor-pointer': !!toast.onClick
90
- }]"
90
+ :class="ui.base({ class: [props.ui?.base, toast.onClick ? 'cursor-pointer' : void 0] })"
91
91
  @update:open="onUpdateOpen($event, toast.id)"
92
92
  @click="toast.onClick && toast.onClick(toast)"
93
93
  />
@@ -95,7 +95,7 @@ function getOffset(index) {
95
95
  <ToastPortal v-bind="portalProps">
96
96
  <ToastViewport
97
97
  :data-expanded="expanded"
98
- :class="ui.viewport({ class: [props.class, props.ui?.viewport] })"
98
+ :class="ui.viewport({ class: [props.ui?.viewport, props.class] })"
99
99
  :style="{
100
100
  '--scale-factor': '0.05',
101
101
  '--translate-factor': position?.startsWith('top') ? '1px' : '-1px',
@@ -14,6 +14,11 @@ export interface ToasterProps extends Omit<ToastProviderProps, 'swipeDirection'>
14
14
  * @defaultValue true
15
15
  */
16
16
  expand?: boolean;
17
+ /**
18
+ * Whether to show the progress bar on all toasts.
19
+ * @defaultValue true
20
+ */
21
+ progress?: boolean;
17
22
  /**
18
23
  * Render the toaster in a portal.
19
24
  * @defaultValue true
@@ -26,6 +31,7 @@ export interface ToasterSlots {
26
31
  default(props?: {}): any;
27
32
  }
28
33
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ToasterProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ToasterProps> & Readonly<{}>, {
34
+ progress: boolean;
29
35
  duration: number;
30
36
  expand: boolean;
31
37
  portal: boolean | string | HTMLElement;