@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
@@ -64,29 +64,29 @@ const groups = computed(
64
64
  <DefineItemTemplate v-slot="{ item, active, index }">
65
65
  <slot :name="item.slot || 'item'" :item="item" :index="index">
66
66
  <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
67
- <UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, loading: true })" />
68
- <UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, active })" />
69
- <UAvatar v-else-if="item.avatar" :size="props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, active })" />
67
+ <UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, loading: true })" />
68
+ <UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [uiOverride?.itemLeadingIcon, item.ui?.itemLeadingIcon], color: item?.color, active })" />
69
+ <UAvatar v-else-if="item.avatar" :size="item.ui?.itemLeadingAvatarSize || props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: [uiOverride?.itemLeadingAvatar, item.ui?.itemLeadingAvatar], active })" />
70
70
  </slot>
71
71
 
72
- <span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
72
+ <span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: [uiOverride?.itemLabel, item.ui?.itemLabel], active })">
73
73
  <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
74
74
  {{ get(item, props.labelKey) }}
75
75
  </slot>
76
76
 
77
- <UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: uiOverride?.itemLabelExternalIcon, color: item?.color, active })" />
77
+ <UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.itemLabelExternalIcon({ class: [uiOverride?.itemLabelExternalIcon, item.ui?.itemLabelExternalIcon], color: item?.color, active })" />
78
78
  </span>
79
79
 
80
- <span :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
80
+ <span :class="ui.itemTrailing({ class: [uiOverride?.itemTrailing, item.ui?.itemTrailing] })">
81
81
  <slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
82
- <UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color, active })" />
83
- <span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
84
- <UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
82
+ <UIcon v-if="item.children?.length" :name="childrenIcon" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color, active })" />
83
+ <span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: [uiOverride?.itemTrailingKbds, item.ui?.itemTrailingKbds] })">
84
+ <UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="item.ui?.itemTrailingKbdsSize || props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
85
85
  </span>
86
86
  </slot>
87
87
 
88
88
  <DropdownMenu.ItemIndicator as-child>
89
- <UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color })" />
89
+ <UIcon :name="checkedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [uiOverride?.itemTrailingIcon, item.ui?.itemTrailingIcon], color: item?.color })" />
90
90
  </DropdownMenu.ItemIndicator>
91
91
  </span>
92
92
  </slot>
@@ -98,17 +98,17 @@ const groups = computed(
98
98
 
99
99
  <DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
100
100
  <template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
101
- <DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: uiOverride?.label })">
101
+ <DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: [uiOverride?.label, item.ui?.label, item.class] })">
102
102
  <ReuseItemTemplate :item="item" :index="index" />
103
103
  </DropdownMenu.Label>
104
- <DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: uiOverride?.separator })" />
104
+ <DropdownMenu.Separator v-else-if="item.type === 'separator'" :class="ui.separator({ class: [uiOverride?.separator, item.ui?.separator, item.class] })" />
105
105
  <DropdownMenu.Sub v-else-if="item?.children?.length" :open="item.open" :default-open="item.defaultOpen">
106
106
  <DropdownMenu.SubTrigger
107
107
  as="button"
108
108
  type="button"
109
109
  :disabled="item.disabled"
110
110
  :text-value="get(item, props.labelKey)"
111
- :class="ui.item({ class: uiOverride?.item, color: item?.color })"
111
+ :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
112
112
  >
113
113
  <ReuseItemTemplate :item="item" :index="index" />
114
114
  </DropdownMenu.SubTrigger>
@@ -139,7 +139,7 @@ const groups = computed(
139
139
  :model-value="item.checked"
140
140
  :disabled="item.disabled"
141
141
  :text-value="get(item, props.labelKey)"
142
- :class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color })"
142
+ :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color })"
143
143
  @update:model-value="item.onUpdateChecked"
144
144
  @select="item.onSelect"
145
145
  >
@@ -153,7 +153,7 @@ const groups = computed(
153
153
  @select="item.onSelect"
154
154
  >
155
155
  <ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
156
- <ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color, active })">
156
+ <ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.ui?.item, item.class], color: item?.color, active })">
157
157
  <ReuseItemTemplate :item="item" :active="active" :index="index" />
158
158
  </ULinkBase>
159
159
  </ULink>
@@ -50,7 +50,7 @@ provide(formFieldInjectionKey, computed(() => ({
50
50
  </script>
51
51
 
52
52
  <template>
53
- <Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
53
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
54
54
  <div :class="ui.wrapper({ class: props.ui?.wrapper })">
55
55
  <div v-if="label || !!slots.label" :class="ui.labelWrapper({ class: props.ui?.labelWrapper })">
56
56
  <Label :for="id" :class="ui.label({ class: props.ui?.label })">
@@ -75,16 +75,16 @@ provide(formFieldInjectionKey, computed(() => ({
75
75
  <div :class="[(label || !!slots.label || description || !!slots.description) && ui.container({ class: props.ui?.container })]">
76
76
  <slot :error="error" />
77
77
 
78
- <p v-if="typeof error === 'string' && error || !!slots.error" :id="`${ariaId}-error`" :class="ui.error({ class: props.ui?.error })">
78
+ <div v-if="typeof error === 'string' && error || !!slots.error" :id="`${ariaId}-error`" :class="ui.error({ class: props.ui?.error })">
79
79
  <slot name="error" :error="error">
80
80
  {{ error }}
81
81
  </slot>
82
- </p>
83
- <p v-else-if="help || !!slots.help" :class="ui.help({ class: props.ui?.help })">
82
+ </div>
83
+ <div v-else-if="help || !!slots.help" :class="ui.help({ class: props.ui?.help })">
84
84
  <slot name="help" :help="help">
85
85
  {{ help }}
86
86
  </slot>
87
- </p>
87
+ </div>
88
88
  </div>
89
89
  </Primitive>
90
90
  </template>
@@ -42,7 +42,7 @@ const props = defineProps({
42
42
  });
43
43
  const emits = defineEmits(["update:modelValue", "blur", "change"]);
44
44
  const slots = defineSlots();
45
- const [modelValue, modelModifiers] = defineModel({ type: [String, Number, null] });
45
+ const [modelValue, modelModifiers] = defineModel({ type: null });
46
46
  const appConfig = useAppConfig();
47
47
  const { emitFormBlur, emitFormInput, emitFormChange, size: formGroupSize, color, id, name, highlight, disabled, emitFormFocus, ariaAttrs } = useFormField(props, { deferInputValidation: true });
48
48
  const { orientation, size: buttonGroupSize } = useButtonGroup(props);
@@ -109,7 +109,7 @@ defineExpose({
109
109
  </script>
110
110
 
111
111
  <template>
112
- <Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
112
+ <Primitive :as="as" :class="ui.root({ class: [props.ui?.root, props.class] })">
113
113
  <input
114
114
  :id="id"
115
115
  ref="inputRef"
@@ -2,7 +2,7 @@ import type { InputHTMLAttributes } from 'vue';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/input';
4
4
  import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
- import type { ComponentConfig } from '../types/utils';
5
+ import type { AcceptableValue, ComponentConfig } from '../types/utils';
6
6
  type Input = ComponentConfig<typeof theme, AppConfig, 'input'>;
7
7
  export interface InputProps extends UseComponentIconsProps {
8
8
  /**
@@ -37,8 +37,8 @@ export interface InputProps extends UseComponentIconsProps {
37
37
  class?: any;
38
38
  ui?: Input['slots'];
39
39
  }
40
- export interface InputEmits {
41
- (e: 'update:modelValue', payload: string | number): void;
40
+ export interface InputEmits<T extends AcceptableValue = AcceptableValue> {
41
+ (e: 'update:modelValue', payload: T): void;
42
42
  (e: 'blur', event: FocusEvent): void;
43
43
  (e: 'change', event: Event): void;
44
44
  }
@@ -47,30 +47,24 @@ export interface InputSlots {
47
47
  default(props?: {}): any;
48
48
  trailing(props?: {}): any;
49
49
  }
50
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<InputProps & {
51
- modelValue?: string | number | null;
52
- }, {
53
- inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
54
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
55
- "update:modelValue": (value: string | number | null | undefined) => any;
56
- } & {
57
- blur: (event: FocusEvent) => any;
58
- change: (event: Event) => any;
59
- "update:modelValue": (payload: string | number) => any;
60
- }, string, import("vue").PublicProps, Readonly<InputProps & {
61
- modelValue?: string | number | null;
62
- }> & Readonly<{
63
- onBlur?: ((event: FocusEvent) => any) | undefined;
64
- onChange?: ((event: Event) => any) | undefined;
65
- "onUpdate:modelValue"?: ((payload: string | number) => any) | undefined;
66
- }>, {
67
- type: import("vue").InputTypeHTMLAttribute;
68
- autocomplete: string;
69
- autofocusDelay: number;
70
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, InputSlots>;
71
- export default _default;
72
- type __VLS_WithSlots<T, S> = T & {
73
- new (): {
74
- $slots: S;
75
- };
50
+ 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<{
51
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
52
+ readonly onBlur?: ((event: FocusEvent) => any) | undefined;
53
+ readonly onChange?: ((event: Event) => any) | undefined;
54
+ readonly "onUpdate:modelValue"?: ((payload: T) => any) | undefined;
55
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onBlur" | "onChange" | "onUpdate:modelValue"> & (InputProps & {
56
+ modelValue?: T;
57
+ }) & Partial<{}>> & import("vue").PublicProps;
58
+ expose(exposed: import("vue").ShallowUnwrapRef<{
59
+ inputRef: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
60
+ }>): void;
61
+ attrs: any;
62
+ slots: InputSlots;
63
+ emit: InputEmits<T> & ((evt: "update:modelValue", value: T | undefined) => void);
64
+ }>) => import("vue").VNode & {
65
+ __ctx?: Awaited<typeof __VLS_setup>;
76
66
  };
67
+ export default _default;
68
+ type __VLS_PrettifyLocal<T> = {
69
+ [K in keyof T]: T[K];
70
+ } & {};
@@ -216,7 +216,7 @@ defineExpose({
216
216
  >
217
217
  <span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
218
218
  <slot name="create-item-label" :item="searchTerm">
219
- {{ t('inputMenu.create', { label: searchTerm }) }}
219
+ {{ t("inputMenu.create", { label: searchTerm }) }}
220
220
  </slot>
221
221
  </span>
222
222
  </ComboboxItem>
@@ -229,7 +229,7 @@ defineExpose({
229
229
  v-bind="rootProps"
230
230
  :name="name"
231
231
  :disabled="disabled"
232
- :class="ui.root({ class: [props.class, props.ui?.root] })"
232
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
233
233
  :as-child="!!multiple"
234
234
  ignore-filter
235
235
  @update:model-value="onUpdate"
@@ -249,16 +249,16 @@ defineExpose({
249
249
  @focus="onFocus"
250
250
  @remove-tag="onRemoveTag"
251
251
  >
252
- <TagsInputItem v-for="(item, index) in tags" :key="index" :value="item" :class="ui.tagsItem({ class: props.ui?.tagsItem })">
253
- <TagsInputItemText :class="ui.tagsItemText({ class: props.ui?.tagsItemText })">
252
+ <TagsInputItem v-for="(item, index) in tags" :key="index" :value="item" :class="ui.tagsItem({ class: [props.ui?.tagsItem, isInputItem(item) && item.ui?.tagsItem] })">
253
+ <TagsInputItemText :class="ui.tagsItemText({ class: [props.ui?.tagsItemText, isInputItem(item) && item.ui?.tagsItemText] })">
254
254
  <slot name="tags-item-text" :item="item" :index="index">
255
255
  {{ displayValue(item) }}
256
256
  </slot>
257
257
  </TagsInputItemText>
258
258
 
259
- <TagsInputItemDelete :class="ui.tagsItemDelete({ class: props.ui?.tagsItemDelete })" :disabled="disabled">
259
+ <TagsInputItemDelete :class="ui.tagsItemDelete({ class: [props.ui?.tagsItemDelete, isInputItem(item) && item.ui?.tagsItemDelete] })" :disabled="disabled">
260
260
  <slot name="tags-item-delete" :item="item" :index="index">
261
- <UIcon :name="deleteIcon || appConfig.ui.icons.close" :class="ui.tagsItemDeleteIcon({ class: props.ui?.tagsItemDeleteIcon })" />
261
+ <UIcon :name="deleteIcon || appConfig.ui.icons.close" :class="ui.tagsItemDeleteIcon({ class: [props.ui?.tagsItemDeleteIcon, isInputItem(item) && item.ui?.tagsItemDeleteIcon] })" />
262
262
  </slot>
263
263
  </TagsInputItemDelete>
264
264
  </TagsInputItem>
@@ -307,7 +307,7 @@ defineExpose({
307
307
 
308
308
  <ComboboxEmpty :class="ui.empty({ class: props.ui?.empty })">
309
309
  <slot name="empty" :search-term="searchTerm">
310
- {{ searchTerm ? t('inputMenu.noMatch', { searchTerm }) : t('inputMenu.noData') }}
310
+ {{ searchTerm ? t("inputMenu.noMatch", { searchTerm }) : t("inputMenu.noData") }}
311
311
  </slot>
312
312
  </ComboboxEmpty>
313
313
 
@@ -316,44 +316,44 @@ defineExpose({
316
316
 
317
317
  <ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
318
318
  <template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
319
- <ComboboxLabel v-if="isInputItem(item) && item.type === 'label'" :class="ui.label({ class: props.ui?.label })">
319
+ <ComboboxLabel v-if="isInputItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
320
320
  {{ get(item, props.labelKey) }}
321
321
  </ComboboxLabel>
322
322
 
323
- <ComboboxSeparator v-else-if="isInputItem(item) && item.type === 'separator'" :class="ui.separator({ class: props.ui?.separator })" />
323
+ <ComboboxSeparator v-else-if="isInputItem(item) && item.type === 'separator'" :class="ui.separator({ class: [props.ui?.separator, item.ui?.separator, item.class] })" />
324
324
 
325
325
  <ComboboxItem
326
326
  v-else
327
- :class="ui.item({ class: props.ui?.item })"
327
+ :class="ui.item({ class: [props.ui?.item, isInputItem(item) && item.ui?.item, isInputItem(item) && item.class] })"
328
328
  :disabled="isInputItem(item) && item.disabled"
329
329
  :value="props.valueKey && isInputItem(item) ? get(item, props.valueKey) : item"
330
330
  @select="onSelect($event, item)"
331
331
  >
332
332
  <slot name="item" :item="item" :index="index">
333
333
  <slot name="item-leading" :item="item" :index="index">
334
- <UIcon v-if="isInputItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: props.ui?.itemLeadingIcon })" />
335
- <UAvatar v-else-if="isInputItem(item) && item.avatar" :size="props.ui?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: props.ui?.itemLeadingAvatar })" />
334
+ <UIcon v-if="isInputItem(item) && item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: [props.ui?.itemLeadingIcon, item.ui?.itemLeadingIcon] })" />
335
+ <UAvatar v-else-if="isInputItem(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] })" />
336
336
  <UChip
337
337
  v-else-if="isInputItem(item) && item.chip"
338
- :size="props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
338
+ :size="item.ui?.itemLeadingChipSize || props.ui?.itemLeadingChipSize || ui.itemLeadingChipSize()"
339
339
  inset
340
340
  standalone
341
341
  v-bind="item.chip"
342
- :class="ui.itemLeadingChip({ class: props.ui?.itemLeadingChip })"
342
+ :class="ui.itemLeadingChip({ class: [props.ui?.itemLeadingChip, item.ui?.itemLeadingChip] })"
343
343
  />
344
344
  </slot>
345
345
 
346
- <span :class="ui.itemLabel({ class: props.ui?.itemLabel })">
346
+ <span :class="ui.itemLabel({ class: [props.ui?.itemLabel, isInputItem(item) && item.ui?.itemLabel] })">
347
347
  <slot name="item-label" :item="item" :index="index">
348
348
  {{ isInputItem(item) ? get(item, props.labelKey) : item }}
349
349
  </slot>
350
350
  </span>
351
351
 
352
- <span :class="ui.itemTrailing({ class: props.ui?.itemTrailing })">
352
+ <span :class="ui.itemTrailing({ class: [props.ui?.itemTrailing, isInputItem(item) && item.ui?.itemTrailing] })">
353
353
  <slot name="item-trailing" :item="item" :index="index" />
354
354
 
355
355
  <ComboboxItemIndicator as-child>
356
- <UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: props.ui?.itemTrailingIcon })" />
356
+ <UIcon :name="selectedIcon || appConfig.ui.icons.check" :class="ui.itemTrailingIcon({ class: [props.ui?.itemTrailingIcon, isInputItem(item) && item.ui?.itemTrailingIcon] })" />
357
357
  </ComboboxItemIndicator>
358
358
  </span>
359
359
  </slot>
@@ -21,6 +21,8 @@ interface _InputMenuItem {
21
21
  type?: 'label' | 'separator' | 'item';
22
22
  disabled?: boolean;
23
23
  onSelect?(e?: Event): void;
24
+ class?: any;
25
+ ui?: Pick<InputMenu['slots'], 'tagsItem' | 'tagsItemText' | 'tagsItemDelete' | 'tagsItemDeleteIcon' | 'label' | 'separator' | 'item' | 'itemLeadingIcon' | 'itemLeadingAvatarSize' | 'itemLeadingAvatar' | 'itemLeadingChip' | 'itemLeadingChipSize' | 'itemLabel' | 'itemTrailing' | 'itemTrailingIcon'>;
24
26
  [key: string]: any;
25
27
  }
26
28
  export type InputMenuItem = _InputMenuItem | AcceptableValue | boolean;
@@ -204,6 +206,110 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
204
206
  };
205
207
  $refs: {
206
208
  [x: string]: unknown;
209
+ } & {
210
+ primitiveElement: ({
211
+ $: import("vue").ComponentInternalInstance;
212
+ $data: {};
213
+ $props: {
214
+ readonly modelValue?: string | undefined;
215
+ readonly autoFocus?: boolean | undefined;
216
+ readonly disabled?: boolean | undefined;
217
+ readonly asChild?: boolean | undefined;
218
+ readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
219
+ readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
220
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
221
+ $attrs: {
222
+ [x: string]: unknown;
223
+ };
224
+ $refs: {
225
+ [x: string]: unknown;
226
+ } & {
227
+ primitiveElement: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
228
+ asChild: {
229
+ type: BooleanConstructor;
230
+ default: boolean;
231
+ };
232
+ as: {
233
+ type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
234
+ default: string;
235
+ };
236
+ }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
237
+ [key: string]: any;
238
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
239
+ asChild: boolean;
240
+ as: import("reka-ui").AsTag | import("vue").Component;
241
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
242
+ P: {};
243
+ B: {};
244
+ D: {};
245
+ C: {};
246
+ M: {};
247
+ Defaults: {};
248
+ }, Readonly<import("vue").ExtractPropTypes<{
249
+ asChild: {
250
+ type: BooleanConstructor;
251
+ default: boolean;
252
+ };
253
+ as: {
254
+ type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
255
+ default: string;
256
+ };
257
+ }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
258
+ [key: string]: any;
259
+ }>, {}, {}, {}, {
260
+ asChild: boolean;
261
+ as: import("reka-ui").AsTag | import("vue").Component;
262
+ }> | null;
263
+ };
264
+ $slots: Readonly<{
265
+ [name: string]: import("vue").Slot<any> | undefined;
266
+ }>;
267
+ $root: import("vue").ComponentPublicInstance | null;
268
+ $parent: import("vue").ComponentPublicInstance | null;
269
+ $host: Element | null;
270
+ $emit: (event: "update:modelValue", args_0: string) => void;
271
+ $el: any;
272
+ $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ListboxFilterProps> & Readonly<{
273
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
274
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
275
+ "update:modelValue": (args_0: string) => any;
276
+ }, string, {
277
+ as: import("reka-ui").AsTag | import("vue").Component;
278
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
279
+ beforeCreate?: (() => void) | (() => void)[];
280
+ created?: (() => void) | (() => void)[];
281
+ beforeMount?: (() => void) | (() => void)[];
282
+ mounted?: (() => void) | (() => void)[];
283
+ beforeUpdate?: (() => void) | (() => void)[];
284
+ updated?: (() => void) | (() => void)[];
285
+ activated?: (() => void) | (() => void)[];
286
+ deactivated?: (() => void) | (() => void)[];
287
+ beforeDestroy?: (() => void) | (() => void)[];
288
+ beforeUnmount?: (() => void) | (() => void)[];
289
+ destroyed?: (() => void) | (() => void)[];
290
+ unmounted?: (() => void) | (() => void)[];
291
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
292
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
293
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
294
+ };
295
+ $forceUpdate: () => void;
296
+ $nextTick: typeof import("vue").nextTick;
297
+ $watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
298
+ } & Readonly<{
299
+ as: import("reka-ui").AsTag | import("vue").Component;
300
+ }> & Omit<Readonly<import("reka-ui").ListboxFilterProps> & Readonly<{
301
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
302
+ }>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
303
+ $slots: Readonly<{
304
+ default: (props: {
305
+ modelValue: string | undefined;
306
+ }) => any;
307
+ }> & {
308
+ default: (props: {
309
+ modelValue: string | undefined;
310
+ }) => any;
311
+ };
312
+ }) | null;
207
313
  };
208
314
  $slots: Readonly<{
209
315
  [name: string]: import("vue").Slot<any> | undefined;
@@ -264,6 +370,110 @@ declare const _default: <T extends ArrayOrNested<InputMenuItem>, VK extends GetI
264
370
  };
265
371
  $refs: {
266
372
  [x: string]: unknown;
373
+ } & {
374
+ primitiveElement: ({
375
+ $: import("vue").ComponentInternalInstance;
376
+ $data: {};
377
+ $props: {
378
+ readonly modelValue?: string | undefined;
379
+ readonly autoFocus?: boolean | undefined;
380
+ readonly disabled?: boolean | undefined;
381
+ readonly asChild?: boolean | undefined;
382
+ readonly as?: (import("reka-ui").AsTag | import("vue").Component) | undefined;
383
+ readonly "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
384
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
385
+ $attrs: {
386
+ [x: string]: unknown;
387
+ };
388
+ $refs: {
389
+ [x: string]: unknown;
390
+ } & {
391
+ primitiveElement: import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
392
+ asChild: {
393
+ type: BooleanConstructor;
394
+ default: boolean;
395
+ };
396
+ as: {
397
+ type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
398
+ default: string;
399
+ };
400
+ }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
401
+ [key: string]: any;
402
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
403
+ asChild: boolean;
404
+ as: import("reka-ui").AsTag | import("vue").Component;
405
+ }, true, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
406
+ P: {};
407
+ B: {};
408
+ D: {};
409
+ C: {};
410
+ M: {};
411
+ Defaults: {};
412
+ }, Readonly<import("vue").ExtractPropTypes<{
413
+ asChild: {
414
+ type: BooleanConstructor;
415
+ default: boolean;
416
+ };
417
+ as: {
418
+ type: import("vue").PropType<import("reka-ui").AsTag | import("vue").Component>;
419
+ default: string;
420
+ };
421
+ }>> & Readonly<{}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
422
+ [key: string]: any;
423
+ }>, {}, {}, {}, {
424
+ asChild: boolean;
425
+ as: import("reka-ui").AsTag | import("vue").Component;
426
+ }> | null;
427
+ };
428
+ $slots: Readonly<{
429
+ [name: string]: import("vue").Slot<any> | undefined;
430
+ }>;
431
+ $root: import("vue").ComponentPublicInstance | null;
432
+ $parent: import("vue").ComponentPublicInstance | null;
433
+ $host: Element | null;
434
+ $emit: (event: "update:modelValue", args_0: string) => void;
435
+ $el: any;
436
+ $options: import("vue").ComponentOptionsBase<Readonly<import("reka-ui").ListboxFilterProps> & Readonly<{
437
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
438
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
439
+ "update:modelValue": (args_0: string) => any;
440
+ }, string, {
441
+ as: import("reka-ui").AsTag | import("vue").Component;
442
+ }, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
443
+ beforeCreate?: (() => void) | (() => void)[];
444
+ created?: (() => void) | (() => void)[];
445
+ beforeMount?: (() => void) | (() => void)[];
446
+ mounted?: (() => void) | (() => void)[];
447
+ beforeUpdate?: (() => void) | (() => void)[];
448
+ updated?: (() => void) | (() => void)[];
449
+ activated?: (() => void) | (() => void)[];
450
+ deactivated?: (() => void) | (() => void)[];
451
+ beforeDestroy?: (() => void) | (() => void)[];
452
+ beforeUnmount?: (() => void) | (() => void)[];
453
+ destroyed?: (() => void) | (() => void)[];
454
+ unmounted?: (() => void) | (() => void)[];
455
+ renderTracked?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
456
+ renderTriggered?: ((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[];
457
+ errorCaptured?: ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance | null, info: string) => boolean | void)[];
458
+ };
459
+ $forceUpdate: () => void;
460
+ $nextTick: typeof import("vue").nextTick;
461
+ $watch<T_1 extends string | ((...args: any) => any)>(source: T_1, cb: T_1 extends (...args: any) => infer R ? (...args: [R, R, import("@vue/reactivity").OnCleanup]) => any : (...args: [any, any, import("@vue/reactivity").OnCleanup]) => any, options?: import("vue").WatchOptions): import("vue").WatchStopHandle;
462
+ } & Readonly<{
463
+ as: import("reka-ui").AsTag | import("vue").Component;
464
+ }> & Omit<Readonly<import("reka-ui").ListboxFilterProps> & Readonly<{
465
+ "onUpdate:modelValue"?: ((args_0: string) => any) | undefined;
466
+ }>, "as"> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {} & {
467
+ $slots: Readonly<{
468
+ default: (props: {
469
+ modelValue: string | undefined;
470
+ }) => any;
471
+ }> & {
472
+ default: (props: {
473
+ modelValue: string | undefined;
474
+ }) => any;
475
+ };
476
+ }) | null;
267
477
  };
268
478
  $slots: Readonly<{
269
479
  [name: string]: import("vue").Slot<any> | undefined;
@@ -7,6 +7,7 @@ import { onMounted, ref, computed } from "vue";
7
7
  import { NumberFieldRoot, NumberFieldInput, NumberFieldDecrement, NumberFieldIncrement, useForwardPropsEmits } from "reka-ui";
8
8
  import { reactivePick } from "@vueuse/core";
9
9
  import { useAppConfig } from "#imports";
10
+ import { useButtonGroup } from "../composables/useButtonGroup";
10
11
  import { useFormField } from "../composables/useFormField";
11
12
  import { useLocale } from "../composables/useLocale";
12
13
  import { tv } from "../utils/tv";
@@ -22,8 +23,10 @@ const props = defineProps({
22
23
  orientation: { type: String, required: false, default: "horizontal" },
23
24
  increment: { type: Object, required: false },
24
25
  incrementIcon: { type: String, required: false },
26
+ incrementDisabled: { type: Boolean, required: false },
25
27
  decrement: { type: Object, required: false },
26
28
  decrementIcon: { type: String, required: false },
29
+ decrementDisabled: { type: Boolean, required: false },
27
30
  autofocus: { type: Boolean, required: false },
28
31
  autofocusDelay: { type: Number, required: false },
29
32
  locale: { type: String, required: false },
@@ -44,17 +47,20 @@ const props = defineProps({
44
47
  });
45
48
  const emits = defineEmits(["update:modelValue", "blur", "change"]);
46
49
  defineSlots();
50
+ const { t, code: codeLocale } = useLocale();
47
51
  const appConfig = useAppConfig();
48
52
  const rootProps = useForwardPropsEmits(reactivePick(props, "as", "modelValue", "defaultValue", "min", "max", "step", "stepSnapping", "formatOptions", "disableWheelChange"), emits);
49
- const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size, name, highlight, disabled, ariaAttrs } = useFormField(props);
50
- const { t, code: codeLocale } = useLocale();
53
+ const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formGroupSize, name, highlight, disabled, ariaAttrs } = useFormField(props);
54
+ const { orientation, size: buttonGroupSize } = useButtonGroup(props);
51
55
  const locale = computed(() => props.locale || codeLocale.value);
56
+ const inputSize = computed(() => buttonGroupSize.value || formGroupSize.value);
52
57
  const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.inputNumber || {} })({
53
58
  color: color.value,
54
59
  variant: props.variant,
55
- size: size.value,
60
+ size: inputSize.value,
56
61
  highlight: highlight.value,
57
- orientation: props.orientation
62
+ orientation: props.orientation,
63
+ buttonGroup: orientation.value
58
64
  }));
59
65
  const incrementIcon = computed(() => props.incrementIcon || (props.orientation === "horizontal" ? appConfig.ui.icons.plus : appConfig.ui.icons.chevronUp));
60
66
  const decrementIcon = computed(() => props.decrementIcon || (props.orientation === "horizontal" ? appConfig.ui.icons.minus : appConfig.ui.icons.chevronDown));
@@ -88,7 +94,7 @@ defineExpose({
88
94
  <NumberFieldRoot
89
95
  v-bind="rootProps"
90
96
  :id="id"
91
- :class="ui.root({ class: [props.class, props.ui?.root] })"
97
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
92
98
  :name="name"
93
99
  :disabled="disabled"
94
100
  :locale="locale"
@@ -105,7 +111,7 @@ defineExpose({
105
111
  />
106
112
 
107
113
  <div :class="ui.increment({ class: props.ui?.increment })">
108
- <NumberFieldIncrement as-child :disabled="disabled">
114
+ <NumberFieldIncrement as-child :disabled="disabled || incrementDisabled">
109
115
  <slot name="increment">
110
116
  <UButton
111
117
  :icon="incrementIcon"
@@ -120,7 +126,7 @@ defineExpose({
120
126
  </div>
121
127
 
122
128
  <div :class="ui.decrement({ class: props.ui?.decrement })">
123
- <NumberFieldDecrement as-child :disabled="disabled">
129
+ <NumberFieldDecrement as-child :disabled="disabled || decrementDisabled">
124
130
  <slot name="decrement">
125
131
  <UButton
126
132
  :icon="decrementIcon"