@nuxt/ui 3.1.2 → 3.1.3

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 (45) hide show
  1. package/.nuxt/ui/checkbox-group.ts +1 -1
  2. package/.nuxt/ui/context-menu.ts +2 -1
  3. package/.nuxt/ui/dropdown-menu.ts +2 -1
  4. package/.nuxt/ui/input-menu.ts +2 -2
  5. package/.nuxt/ui/navigation-menu.ts +43 -34
  6. package/.nuxt/ui/radio-group.ts +1 -1
  7. package/.nuxt/ui/select-menu.ts +2 -2
  8. package/.nuxt/ui/select.ts +2 -2
  9. package/.nuxt/ui/tooltip.ts +1 -1
  10. package/.nuxt/ui.css +4 -1
  11. package/dist/module.json +1 -1
  12. package/dist/module.mjs +2 -2
  13. package/dist/runtime/components/CommandPalette.vue +1 -1
  14. package/dist/runtime/components/ContextMenuContent.vue +58 -56
  15. package/dist/runtime/components/Drawer.vue +15 -1
  16. package/dist/runtime/components/DropdownMenuContent.vue +60 -58
  17. package/dist/runtime/components/Input.vue +1 -0
  18. package/dist/runtime/components/Input.vue.d.ts +7 -0
  19. package/dist/runtime/components/InputMenu.vue +3 -3
  20. package/dist/runtime/components/Modal.vue +2 -2
  21. package/dist/runtime/components/Modal.vue.d.ts +3 -0
  22. package/dist/runtime/components/NavigationMenu.vue +82 -24
  23. package/dist/runtime/components/NavigationMenu.vue.d.ts +30 -17
  24. package/dist/runtime/components/Popover.vue +4 -0
  25. package/dist/runtime/components/Popover.vue.d.ts +1 -0
  26. package/dist/runtime/components/Select.vue +3 -3
  27. package/dist/runtime/components/SelectMenu.vue +3 -3
  28. package/dist/runtime/components/Slideover.vue +9 -2
  29. package/dist/runtime/components/Slideover.vue.d.ts +3 -0
  30. package/dist/runtime/components/Textarea.vue +4 -1
  31. package/dist/runtime/components/Textarea.vue.d.ts +7 -1
  32. package/dist/runtime/locale/index.d.ts +6 -2
  33. package/dist/runtime/locale/index.js +6 -2
  34. package/dist/runtime/locale/ky.d.ts +3 -0
  35. package/dist/runtime/locale/ky.js +54 -0
  36. package/dist/runtime/locale/lt.d.ts +3 -0
  37. package/dist/runtime/locale/lt.js +54 -0
  38. package/dist/runtime/locale/mn.d.ts +3 -0
  39. package/dist/runtime/locale/mn.js +54 -0
  40. package/dist/runtime/locale/ms.d.ts +3 -0
  41. package/dist/runtime/locale/ms.js +54 -0
  42. package/dist/shared/{ui.BvUP-pSb.mjs → ui.Bix4DSU4.mjs} +51 -37
  43. package/dist/unplugin.mjs +1 -1
  44. package/dist/vite.mjs +1 -1
  45. package/package.json +19 -19
@@ -4,7 +4,7 @@ import theme from "#build/ui/input-menu";
4
4
 
5
5
  <script setup>
6
6
  import { computed, ref, toRef, onMounted, toRaw } from "vue";
7
- import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from "reka-ui";
7
+ import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, TagsInputRoot, TagsInputItem, TagsInputItemText, TagsInputItemDelete, TagsInputInput, useForwardPropsEmits, useFilter } from "reka-ui";
8
8
  import { defu } from "defu";
9
9
  import { isEqual } from "ohash/utils";
10
10
  import { reactivePick, createReusableTemplate } from "@vueuse/core";
@@ -311,7 +311,7 @@ defineExpose({
311
311
  </slot>
312
312
  </ComboboxEmpty>
313
313
 
314
- <ComboboxViewport :class="ui.viewport({ class: props.ui?.viewport })">
314
+ <div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
315
315
  <ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'top'" />
316
316
 
317
317
  <ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
@@ -362,7 +362,7 @@ defineExpose({
362
362
  </ComboboxGroup>
363
363
 
364
364
  <ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
365
- </ComboboxViewport>
365
+ </div>
366
366
 
367
367
  <slot name="content-bottom" />
368
368
 
@@ -28,7 +28,7 @@ const props = defineProps({
28
28
  defaultOpen: { type: Boolean, required: false },
29
29
  modal: { type: Boolean, required: false, default: true }
30
30
  });
31
- const emits = defineEmits(["after:leave", "close:prevent", "update:open"]);
31
+ const emits = defineEmits(["after:leave", "after:enter", "close:prevent", "update:open"]);
32
32
  const slots = defineSlots();
33
33
  const { t } = useLocale();
34
34
  const appConfig = useAppConfig();
@@ -66,7 +66,7 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.modal || {} }
66
66
  <DialogPortal v-bind="portalProps">
67
67
  <DialogOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
68
68
 
69
- <DialogContent :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" @after-leave="emits('after:leave')" v-on="contentEvents">
69
+ <DialogContent :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" @after-enter="emits('after:enter')" @after-leave="emits('after:leave')" v-on="contentEvents">
70
70
  <VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
71
71
  <DialogTitle v-if="title || !!slots.title">
72
72
  <slot name="title">
@@ -51,6 +51,7 @@ export interface ModalProps extends DialogRootProps {
51
51
  }
52
52
  export interface ModalEmits extends DialogRootEmits {
53
53
  'after:leave': [];
54
+ 'after:enter': [];
54
55
  'close:prevent': [];
55
56
  }
56
57
  export interface ModalSlots {
@@ -72,10 +73,12 @@ export interface ModalSlots {
72
73
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
73
74
  "update:open": (value: boolean) => any;
74
75
  "after:leave": () => any;
76
+ "after:enter": () => any;
75
77
  "close:prevent": () => any;
76
78
  }, string, import("vue").PublicProps, Readonly<ModalProps> & Readonly<{
77
79
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
78
80
  "onAfter:leave"?: (() => any) | undefined;
81
+ "onAfter:enter"?: (() => any) | undefined;
79
82
  "onClose:prevent"?: (() => any) | undefined;
80
83
  }>, {
81
84
  close: boolean | Partial<ButtonProps>;
@@ -4,8 +4,9 @@ import theme from "#build/ui/navigation-menu";
4
4
 
5
5
  <script setup>
6
6
  import { computed, toRef } from "vue";
7
- import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, useForwardPropsEmits } from "reka-ui";
8
- import { createReusableTemplate } from "@vueuse/core";
7
+ import { NavigationMenuRoot, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink, NavigationMenuIndicator, NavigationMenuViewport, AccordionRoot, AccordionItem, AccordionTrigger, AccordionContent, useForwardPropsEmits } from "reka-ui";
8
+ import { defu } from "defu";
9
+ import { reactivePick, createReusableTemplate } from "@vueuse/core";
9
10
  import { useAppConfig } from "#imports";
10
11
  import { get, isArrayOfArray } from "../utils";
11
12
  import { tv } from "../utils/tv";
@@ -15,7 +16,7 @@ import ULink from "./Link.vue";
15
16
  import UAvatar from "./Avatar.vue";
16
17
  import UIcon from "./Icon.vue";
17
18
  import UBadge from "./Badge.vue";
18
- import UCollapsible from "./Collapsible.vue";
19
+ import UPopover from "./Popover.vue";
19
20
  import UTooltip from "./Tooltip.vue";
20
21
  const props = defineProps({
21
22
  as: { type: null, required: false },
@@ -26,6 +27,8 @@ const props = defineProps({
26
27
  variant: { type: null, required: false },
27
28
  orientation: { type: null, required: false, default: "horizontal" },
28
29
  collapsed: { type: Boolean, required: false },
30
+ tooltip: { type: [Boolean, Object], required: false },
31
+ popover: { type: [Boolean, Object], required: false },
29
32
  highlight: { type: Boolean, required: false },
30
33
  highlightColor: { type: null, required: false },
31
34
  content: { type: Object, required: false },
@@ -41,7 +44,10 @@ const props = defineProps({
41
44
  disableHoverTrigger: { type: Boolean, required: false },
42
45
  skipDelayDuration: { type: Number, required: false },
43
46
  disablePointerLeaveClose: { type: Boolean, required: false },
44
- unmountOnHide: { type: Boolean, required: false, default: true }
47
+ unmountOnHide: { type: Boolean, required: false, default: true },
48
+ disabled: { type: Boolean, required: false },
49
+ type: { type: String, required: false, default: "multiple" },
50
+ collapsible: { type: Boolean, required: false, default: true }
45
51
  });
46
52
  const emits = defineEmits(["update:modelValue"]);
47
53
  const slots = defineSlots();
@@ -58,7 +64,10 @@ const rootProps = useForwardPropsEmits(computed(() => ({
58
64
  disablePointerLeaveClose: props.disablePointerLeaveClose,
59
65
  unmountOnHide: props.unmountOnHide
60
66
  })), emits);
67
+ const accordionProps = useForwardPropsEmits(reactivePick(props, "collapsible", "disabled", "type", "unmountOnHide"), emits);
61
68
  const contentProps = toRef(() => props.content);
69
+ const tooltipProps = toRef(() => defu(typeof props.tooltip === "boolean" ? {} : props.tooltip, { delayDuration: 0, content: { side: "right" } }));
70
+ const popoverProps = toRef(() => defu(typeof props.popover === "boolean" ? {} : props.popover, { mode: "hover", content: { side: "right", align: "start", alignOffset: 2 } }));
62
71
  const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate();
63
72
  const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
64
73
  props: {
@@ -69,7 +78,7 @@ const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
69
78
  });
70
79
  const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.navigationMenu || {} })({
71
80
  orientation: props.orientation,
72
- contentOrientation: props.contentOrientation,
81
+ contentOrientation: props.orientation === "vertical" ? void 0 : props.contentOrientation,
73
82
  collapsed: props.collapsed,
74
83
  color: props.color,
75
84
  variant: props.variant,
@@ -79,6 +88,21 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.navigationMen
79
88
  const lists = computed(
80
89
  () => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
81
90
  );
91
+ function getAccordionDefaultValue(list) {
92
+ function findItemsWithDefaultOpen(items, level = 0) {
93
+ return items.reduce((acc, item, index) => {
94
+ if (item.defaultOpen || item.open) {
95
+ acc.push(item.value || (level > 0 ? `item-${level}-${index}` : `item-${index}`));
96
+ }
97
+ if (item.children?.length) {
98
+ acc.push(...findItemsWithDefaultOpen(item.children, level + 1));
99
+ }
100
+ return acc;
101
+ }, []);
102
+ }
103
+ const indexes = findItemsWithDefaultOpen(list);
104
+ return props.type === "single" ? indexes[0] : indexes;
105
+ }
82
106
  </script>
83
107
 
84
108
  <template>
@@ -100,7 +124,7 @@ const lists = computed(
100
124
  <UIcon v-if="item.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.linkLabelExternalIcon({ class: [props.ui?.linkLabelExternalIcon, item.ui?.linkLabelExternalIcon], active })" />
101
125
  </span>
102
126
 
103
- <span v-if="(!collapsed || orientation !== 'vertical') && (item.badge || orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing'])" :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })">
127
+ <component :is="orientation === 'vertical' && item.children?.length && !collapsed ? AccordionTrigger : 'span'" v-if="(!collapsed || orientation !== 'vertical') && (item.badge || orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length || item.trailingIcon || !!slots[item.slot ? `${item.slot}-trailing` : 'item-trailing'])" as="span" :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })" @click.stop.prevent>
104
128
  <slot :name="item.slot ? `${item.slot}-trailing` : 'item-trailing'" :item="item" :active="active" :index="index">
105
129
  <UBadge
106
130
  v-if="item.badge"
@@ -111,36 +135,62 @@ const lists = computed(
111
135
  :class="ui.linkTrailingBadge({ class: [props.ui?.linkTrailingBadge, item.ui?.linkTrailingBadge] })"
112
136
  />
113
137
 
114
- <UIcon v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length && item.collapsible !== false" :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })" />
138
+ <UIcon v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) || orientation === 'vertical' && item.children?.length" :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })" />
115
139
  <UIcon v-else-if="item.trailingIcon" :name="item.trailingIcon" :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })" />
116
140
  </slot>
117
- </span>
141
+ </component>
118
142
  </slot>
119
143
  </DefineLinkTemplate>
120
144
 
121
145
  <DefineItemTemplate v-slot="{ item, index, level = 0 }">
122
146
  <component
123
- :is="orientation === 'vertical' && item.children?.length ? UCollapsible : NavigationMenuItem"
147
+ :is="orientation === 'vertical' && !collapsed ? AccordionItem : NavigationMenuItem"
124
148
  as="li"
125
- :value="item.value || `item-${index}`"
126
- :default-open="item.defaultOpen"
127
- :disabled="orientation === 'vertical' && item.children?.length ? item.collapsible === false : void 0"
128
- :unmount-on-hide="orientation === 'vertical' && item.children?.length ? unmountOnHide : void 0"
129
- :open="item.open"
149
+ :value="item.value || (level > 0 ? `item-${level}-${index}` : `item-${index}`)"
130
150
  >
131
- <div v-if="orientation === 'vertical' && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
151
+ <div v-if="orientation === 'vertical' && item.type === 'label' && !collapsed" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
132
152
  <ReuseLinkTemplate :item="item" :index="index" />
133
153
  </div>
134
- <ULink v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="orientation === 'vertical' && item.children?.length && item.collapsible !== false ? {} : pickLinkProps(item)" custom>
154
+ <ULink v-else-if="item.type !== 'label'" v-slot="{ active, ...slotProps }" v-bind="orientation === 'vertical' && item.children?.length && !collapsed && item.type === 'trigger' ? {} : pickLinkProps(item)" custom>
135
155
  <component
136
- :is="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : NavigationMenuLink"
156
+ :is="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content']) ? NavigationMenuTrigger : orientation === 'vertical' && item.children?.length && !collapsed && !slotProps.href ? AccordionTrigger : NavigationMenuLink"
137
157
  as-child
138
158
  :active="active || item.active"
139
159
  :disabled="item.disabled"
140
160
  @select="item.onSelect"
141
161
  >
142
- <UTooltip v-if="!!item.tooltip" :content="{ side: 'right' }" v-bind="item.tooltip">
143
- <ULinkBase v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: orientation === 'horizontal' || level > 0 })">
162
+ <UPopover v-if="orientation === 'vertical' && collapsed && item.children?.length && (!!props.popover || !!item.popover)" v-bind="{ ...popoverProps, ...typeof item.popover === 'boolean' ? {} : item.popover || {} }" :ui="{ content: ui.content({ class: [props.ui?.content, item.ui?.content] }) }">
163
+ <ULinkBase v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: level > 0 })">
164
+ <ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
165
+ </ULinkBase>
166
+
167
+ <template #content>
168
+ <slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active || item.active" :index="index">
169
+ <ul :class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })">
170
+ <li :class="ui.childLabel({ class: [props.ui?.childLabel, item.ui?.childLabel] })">
171
+ {{ get(item, props.labelKey) }}
172
+ </li>
173
+ <li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: [props.ui?.childItem, item.ui?.childItem] })">
174
+ <ULink v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
175
+ <NavigationMenuLink as-child :active="childActive" @select="childItem.onSelect">
176
+ <ULinkBase v-bind="childSlotProps" :class="ui.childLink({ class: [props.ui?.childLink, item.ui?.childLink, childItem.class], active: childActive })">
177
+ <UIcon v-if="childItem.icon" :name="childItem.icon" :class="ui.childLinkIcon({ class: [props.ui?.childLinkIcon, item.ui?.childLinkIcon], active: childActive })" />
178
+
179
+ <span :class="ui.childLinkLabel({ class: [props.ui?.childLinkLabel, item.ui?.childLinkLabel], active: childActive })">
180
+ {{ get(childItem, props.labelKey) }}
181
+
182
+ <UIcon v-if="childItem.target === '_blank' && externalIcon !== false" :name="typeof externalIcon === 'string' ? externalIcon : appConfig.ui.icons.external" :class="ui.childLinkLabelExternalIcon({ class: [props.ui?.childLinkLabelExternalIcon, item.ui?.childLinkLabelExternalIcon], active: childActive })" />
183
+ </span>
184
+ </ULinkBase>
185
+ </NavigationMenuLink>
186
+ </ULink>
187
+ </li>
188
+ </ul>
189
+ </slot>
190
+ </template>
191
+ </UPopover>
192
+ <UTooltip v-else-if="orientation === 'vertical' && collapsed && (!!props.tooltip || !!item.tooltip)" :text="get(item, props.labelKey)" v-bind="{ ...tooltipProps, ...typeof item.tooltip === 'boolean' ? {} : item.tooltip || {} }">
193
+ <ULinkBase v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: !!item.disabled, level: level > 0 })">
144
194
  <ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
145
195
  </ULinkBase>
146
196
  </UTooltip>
@@ -150,7 +200,7 @@ const lists = computed(
150
200
  </component>
151
201
 
152
202
  <NavigationMenuContent v-if="orientation === 'horizontal' && (item.children?.length || !!slots[item.slot ? `${item.slot}-content` : 'item-content'])" v-bind="contentProps" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
153
- <slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active" :index="index">
203
+ <slot :name="item.slot ? `${item.slot}-content` : 'item-content'" :item="item" :active="active || item.active" :index="index">
154
204
  <ul :class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })">
155
205
  <li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: [props.ui?.childItem, item.ui?.childItem] })">
156
206
  <ULink v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
@@ -177,7 +227,7 @@ const lists = computed(
177
227
  </NavigationMenuContent>
178
228
  </ULink>
179
229
 
180
- <template v-if="orientation === 'vertical' && item.children?.length" #content>
230
+ <AccordionContent v-if="orientation === 'vertical' && item.children?.length && !collapsed" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
181
231
  <ul :class="ui.childList({ class: props.ui?.childList })">
182
232
  <ReuseItemTemplate
183
233
  v-for="(childItem, childIndex) in item.children"
@@ -188,7 +238,7 @@ const lists = computed(
188
238
  :class="ui.childItem({ class: [props.ui?.childItem, childItem.ui?.childItem] })"
189
239
  />
190
240
  </ul>
191
- </template>
241
+ </AccordionContent>
192
242
  </component>
193
243
  </DefineItemTemplate>
194
244
 
@@ -196,9 +246,17 @@ const lists = computed(
196
246
  <slot name="list-leading" />
197
247
 
198
248
  <template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
199
- <NavigationMenuList :class="ui.list({ class: props.ui?.list })">
249
+ <component
250
+ v-bind="orientation === 'vertical' && !collapsed ? {
251
+ ...accordionProps,
252
+ defaultValue: getAccordionDefaultValue(list)
253
+ } : {}"
254
+ :is="orientation === 'vertical' && !collapsed ? AccordionRoot : NavigationMenuList"
255
+ as="ul"
256
+ :class="ui.list({ class: props.ui?.list })"
257
+ >
200
258
  <ReuseItemTemplate v-for="(item, index) in list" :key="`list-${listIndex}-${index}`" :item="item" :index="index" :class="ui.item({ class: [props.ui?.item, item.ui?.item] })" />
201
- </NavigationMenuList>
259
+ </component>
202
260
 
203
261
  <div v-if="orientation === 'vertical' && listIndex < lists.length - 1" :class="ui.separator({ class: props.ui?.separator })" />
204
262
  </template>
@@ -1,7 +1,7 @@
1
- import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, NavigationMenuContentEmits, CollapsibleRootProps } from 'reka-ui';
1
+ import type { NavigationMenuRootProps, NavigationMenuRootEmits, NavigationMenuContentProps, NavigationMenuContentEmits, AccordionRootProps } from 'reka-ui';
2
2
  import type { AppConfig } from '@nuxt/schema';
3
3
  import theme from '#build/ui/navigation-menu';
4
- import type { AvatarProps, BadgeProps, LinkProps, TooltipProps } from '../types';
4
+ import type { AvatarProps, BadgeProps, LinkProps, PopoverProps, TooltipProps } from '../types';
5
5
  import type { ArrayOrNested, DynamicSlots, MergeTypes, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
6
6
  type NavigationMenu = ComponentConfig<typeof theme, AppConfig, 'navigationMenu'>;
7
7
  export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type' | 'ui'> {
@@ -9,7 +9,7 @@ export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type'
9
9
  description?: string;
10
10
  [key: string]: any;
11
11
  }
12
- export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'>, Pick<CollapsibleRootProps, 'defaultOpen' | 'open'> {
12
+ export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
13
13
  label?: string;
14
14
  /**
15
15
  * @IconifyIcon
@@ -22,40 +22,41 @@ export interface NavigationMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'cu
22
22
  */
23
23
  badge?: string | number | BadgeProps;
24
24
  /**
25
- * Display a tooltip on the item.
26
- * Only works when `type` is `link`.
27
- * `{ content: { side: 'right' } }`{lang="ts-type"}
25
+ * Display a tooltip on the item when the menu is collapsed with the label of the item.
26
+ * This has priority over the global `tooltip` prop.
28
27
  */
29
- tooltip?: TooltipProps;
28
+ tooltip?: boolean | TooltipProps;
29
+ /**
30
+ * Display a popover on the item when the menu is collapsed with the children list.
31
+ * This has priority over the global `popover` prop.
32
+ */
33
+ popover?: boolean | PopoverProps;
30
34
  /**
31
35
  * @IconifyIcon
32
36
  */
33
37
  trailingIcon?: string;
34
38
  /**
35
39
  * The type of the item.
36
- * The `label` type only works on `vertical` orientation.
40
+ * The `label` type is only displayed in `vertical` orientation.
41
+ * The `trigger` type is used to force the item to be collapsible when its a link in `vertical` orientation.
37
42
  * @defaultValue 'link'
38
43
  */
39
- type?: 'label' | 'link';
44
+ type?: 'label' | 'trigger' | 'link';
40
45
  slot?: string;
41
46
  /**
42
47
  * The value of the item. Avoid using `index` as the value to prevent conflicts in horizontal orientation with Reka UI.
43
48
  * @defaultValue `item-${index}`
44
49
  */
45
50
  value?: string;
46
- /**
47
- * Make the item collapsible.
48
- * Only works when `orientation` is `vertical`.
49
- * @defaultValue true
50
- */
51
- collapsible?: boolean;
52
51
  children?: NavigationMenuChildItem[];
52
+ defaultOpen?: boolean;
53
+ open?: boolean;
53
54
  onSelect?(e: Event): void;
54
55
  class?: any;
55
- ui?: Pick<NavigationMenu['slots'], 'item' | 'linkLeadingAvatarSize' | 'linkLeadingAvatar' | 'linkLeadingIcon' | 'linkLabel' | 'linkLabelExternalIcon' | 'linkTrailing' | 'linkTrailingBadgeSize' | 'linkTrailingBadge' | 'linkTrailingIcon' | 'label' | 'link' | 'content' | 'childList' | 'childItem' | 'childLink' | 'childLinkIcon' | 'childLinkWrapper' | 'childLinkLabel' | 'childLinkLabelExternalIcon' | 'childLinkDescription'>;
56
+ ui?: Pick<NavigationMenu['slots'], 'item' | 'linkLeadingAvatarSize' | 'linkLeadingAvatar' | 'linkLeadingIcon' | 'linkLabel' | 'linkLabelExternalIcon' | 'linkTrailing' | 'linkTrailingBadgeSize' | 'linkTrailingBadge' | 'linkTrailingIcon' | 'label' | 'link' | 'content' | 'childList' | 'childLabel' | 'childItem' | 'childLink' | 'childLinkIcon' | 'childLinkWrapper' | 'childLinkLabel' | 'childLinkLabelExternalIcon' | 'childLinkDescription'>;
56
57
  [key: string]: any;
57
58
  }
58
- export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'> {
59
+ export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'>, Pick<AccordionRootProps, 'disabled' | 'type' | 'collapsible'> {
59
60
  /**
60
61
  * The element or component this component should render as.
61
62
  * @defaultValue 'div'
@@ -94,6 +95,18 @@ export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem>
94
95
  * @defaultValue false
95
96
  */
96
97
  collapsed?: boolean;
98
+ /**
99
+ * Display a tooltip on the items when the menu is collapsed with the label of the item.
100
+ * `{ delayDuration: 0, content: { side: 'right' } }`{lang="ts-type"}
101
+ * @defaultValue false
102
+ */
103
+ tooltip?: boolean | TooltipProps;
104
+ /**
105
+ * Display a popover on the items when the menu is collapsed with the children list.
106
+ * `{ mode: 'hover', content: { side: 'right', align: 'start', alignOffset: 2 } }`{lang="ts-type"}
107
+ * @defaultValue false
108
+ */
109
+ popover?: boolean | PopoverProps;
97
110
  /** Display a line next to the active item. */
98
111
  highlight?: boolean;
99
112
  /**
@@ -58,6 +58,10 @@ const Component = computed(() => props.mode === "hover" ? HoverCard : Popover);
58
58
  <slot :open="open" />
59
59
  </Component.Trigger>
60
60
 
61
+ <Component.Anchor v-if="'Anchor' in Component && !!slots.anchor" as-child>
62
+ <slot name="anchor" />
63
+ </Component.Anchor>
64
+
61
65
  <Component.Portal v-bind="portalProps">
62
66
  <Component.Content v-bind="contentProps" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-on="contentEvents">
63
67
  <slot name="content" />
@@ -41,6 +41,7 @@ export interface PopoverSlots {
41
41
  open: boolean;
42
42
  }): any;
43
43
  content(props?: {}): any;
44
+ anchor(props?: {}): any;
44
45
  }
45
46
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<PopoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
46
47
  "update:open": (value: boolean) => any;
@@ -4,7 +4,7 @@ import theme from "#build/ui/select";
4
4
 
5
5
  <script setup>
6
6
  import { computed, toRef } from "vue";
7
- import { SelectRoot, SelectArrow, SelectTrigger, SelectPortal, SelectContent, SelectViewport, SelectLabel, SelectGroup, SelectItem, SelectItemIndicator, SelectItemText, SelectSeparator, useForwardPropsEmits } from "reka-ui";
7
+ import { SelectRoot, SelectArrow, SelectTrigger, SelectPortal, SelectContent, SelectLabel, SelectGroup, SelectItem, SelectItemIndicator, SelectItemText, SelectSeparator, useForwardPropsEmits } from "reka-ui";
8
8
  import { defu } from "defu";
9
9
  import { reactivePick } from "@vueuse/core";
10
10
  import { useAppConfig } from "#imports";
@@ -148,7 +148,7 @@ function isSelectItem(item) {
148
148
  <SelectContent :class="ui.content({ class: props.ui?.content })" v-bind="contentProps">
149
149
  <slot name="content-top" />
150
150
 
151
- <SelectViewport :class="ui.viewport({ class: props.ui?.viewport })">
151
+ <div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
152
152
  <SelectGroup v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
153
153
  <template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
154
154
  <SelectLabel v-if="isSelectItem(item) && item.type === 'label'" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })">
@@ -195,7 +195,7 @@ function isSelectItem(item) {
195
195
  </SelectItem>
196
196
  </template>
197
197
  </SelectGroup>
198
- </SelectViewport>
198
+ </div>
199
199
 
200
200
  <slot name="content-bottom" />
201
201
 
@@ -4,7 +4,7 @@ import theme from "#build/ui/select-menu";
4
4
 
5
5
  <script setup>
6
6
  import { computed, toRef, toRaw } from "vue";
7
- import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxViewport, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, FocusScope, useForwardPropsEmits, useFilter } from "reka-ui";
7
+ import { ComboboxRoot, ComboboxArrow, ComboboxAnchor, ComboboxInput, ComboboxTrigger, ComboboxPortal, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxLabel, ComboboxSeparator, ComboboxItem, ComboboxItemIndicator, FocusScope, useForwardPropsEmits, useFilter } from "reka-ui";
8
8
  import { defu } from "defu";
9
9
  import { reactivePick, createReusableTemplate } from "@vueuse/core";
10
10
  import { useAppConfig } from "#imports";
@@ -246,7 +246,7 @@ function isSelectItem(item) {
246
246
  </slot>
247
247
  </ComboboxEmpty>
248
248
 
249
- <ComboboxViewport :class="ui.viewport({ class: props.ui?.viewport })">
249
+ <div role="presentation" :class="ui.viewport({ class: props.ui?.viewport })">
250
250
  <ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'top'" />
251
251
 
252
252
  <ComboboxGroup v-for="(group, groupIndex) in filteredGroups" :key="`group-${groupIndex}`" :class="ui.group({ class: props.ui?.group })">
@@ -297,7 +297,7 @@ function isSelectItem(item) {
297
297
  </ComboboxGroup>
298
298
 
299
299
  <ReuseCreateItemTemplate v-if="createItem && createItemPosition === 'bottom'" />
300
- </ComboboxViewport>
300
+ </div>
301
301
 
302
302
  <slot name="content-bottom" />
303
303
  </FocusScope>
@@ -28,7 +28,7 @@ const props = defineProps({
28
28
  defaultOpen: { type: Boolean, required: false },
29
29
  modal: { type: Boolean, required: false, default: true }
30
30
  });
31
- const emits = defineEmits(["after:leave", "close:prevent", "update:open"]);
31
+ const emits = defineEmits(["after:leave", "after:enter", "close:prevent", "update:open"]);
32
32
  const slots = defineSlots();
33
33
  const { t } = useLocale();
34
34
  const appConfig = useAppConfig();
@@ -66,7 +66,14 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slideover ||
66
66
  <DialogPortal v-bind="portalProps">
67
67
  <DialogOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
68
68
 
69
- <DialogContent :data-side="side" :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })" v-bind="contentProps" @after-leave="emits('after:leave')" v-on="contentEvents">
69
+ <DialogContent
70
+ :data-side="side"
71
+ :class="ui.content({ class: [!slots.default && props.class, props.ui?.content] })"
72
+ v-bind="contentProps"
73
+ @after-enter="emits('after:enter')"
74
+ @after-leave="emits('after:leave')"
75
+ v-on="contentEvents"
76
+ >
70
77
  <VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
71
78
  <DialogTitle v-if="title || !!slots.title">
72
79
  <slot name="title">
@@ -51,6 +51,7 @@ export interface SlideoverProps extends DialogRootProps {
51
51
  }
52
52
  export interface SlideoverEmits extends DialogRootEmits {
53
53
  'after:leave': [];
54
+ 'after:enter': [];
54
55
  'close:prevent': [];
55
56
  }
56
57
  export interface SlideoverSlots {
@@ -72,10 +73,12 @@ export interface SlideoverSlots {
72
73
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SlideoverProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
73
74
  "update:open": (value: boolean) => any;
74
75
  "after:leave": () => any;
76
+ "after:enter": () => any;
75
77
  "close:prevent": () => any;
76
78
  }, string, import("vue").PublicProps, Readonly<SlideoverProps> & Readonly<{
77
79
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
78
80
  "onAfter:leave"?: (() => any) | undefined;
81
+ "onAfter:enter"?: (() => any) | undefined;
79
82
  "onClose:prevent"?: (() => any) | undefined;
80
83
  }>, {
81
84
  close: boolean | Partial<ButtonProps>;
@@ -10,6 +10,8 @@ import { useComponentIcons } from "../composables/useComponentIcons";
10
10
  import { useFormField } from "../composables/useFormField";
11
11
  import { looseToNumber } from "../utils";
12
12
  import { tv } from "../utils/tv";
13
+ import UIcon from "./Icon.vue";
14
+ import UAvatar from "./Avatar.vue";
13
15
  defineOptions({ inheritAttrs: false });
14
16
  const props = defineProps({
15
17
  as: { type: null, required: false },
@@ -25,10 +27,11 @@ const props = defineProps({
25
27
  autoresize: { type: Boolean, required: false },
26
28
  autoresizeDelay: { type: Number, required: false, default: 0 },
27
29
  disabled: { type: Boolean, required: false },
28
- class: { type: null, required: false },
29
30
  rows: { type: Number, required: false, default: 3 },
30
31
  maxrows: { type: Number, required: false, default: 0 },
31
32
  highlight: { type: Boolean, required: false },
33
+ modelModifiers: { type: Object, required: false },
34
+ class: { type: null, required: false },
32
35
  ui: { type: null, required: false },
33
36
  icon: { type: String, required: false },
34
37
  avatar: { type: Object, required: false },
@@ -31,11 +31,17 @@ export interface TextareaProps extends UseComponentIconsProps {
31
31
  autoresize?: boolean;
32
32
  autoresizeDelay?: number;
33
33
  disabled?: boolean;
34
- class?: any;
35
34
  rows?: number;
36
35
  maxrows?: number;
37
36
  /** Highlight the ring color like a focus state. */
38
37
  highlight?: boolean;
38
+ modelModifiers?: {
39
+ string?: boolean;
40
+ trim?: boolean;
41
+ lazy?: boolean;
42
+ nullify?: boolean;
43
+ };
44
+ class?: any;
39
45
  ui?: Textarea['slots'];
40
46
  }
41
47
  export interface TextareaEmits<T extends AcceptableValue = AcceptableValue> {
@@ -21,9 +21,13 @@ export { default as hy } from './hy';
21
21
  export { default as id } from './id';
22
22
  export { default as it } from './it';
23
23
  export { default as ja } from './ja';
24
- export { default as km } from './km';
25
24
  export { default as kk } from './kk';
25
+ export { default as km } from './km';
26
26
  export { default as ko } from './ko';
27
+ export { default as ky } from './ky';
28
+ export { default as lt } from './lt';
29
+ export { default as mn } from './mn';
30
+ export { default as ms } from './ms';
27
31
  export { default as nb_no } from './nb_no';
28
32
  export { default as nl } from './nl';
29
33
  export { default as pl } from './pl';
@@ -37,8 +41,8 @@ export { default as sv } from './sv';
37
41
  export { default as th } from './th';
38
42
  export { default as tj } from './tj';
39
43
  export { default as tr } from './tr';
40
- export { default as uk } from './uk';
41
44
  export { default as ug_cn } from './ug_cn';
45
+ export { default as uk } from './uk';
42
46
  export { default as ur } from './ur';
43
47
  export { default as uz } from './uz';
44
48
  export { default as vi } from './vi';
@@ -21,9 +21,13 @@ export { default as hy } from "./hy.js";
21
21
  export { default as id } from "./id.js";
22
22
  export { default as it } from "./it.js";
23
23
  export { default as ja } from "./ja.js";
24
- export { default as km } from "./km.js";
25
24
  export { default as kk } from "./kk.js";
25
+ export { default as km } from "./km.js";
26
26
  export { default as ko } from "./ko.js";
27
+ export { default as ky } from "./ky.js";
28
+ export { default as lt } from "./lt.js";
29
+ export { default as mn } from "./mn.js";
30
+ export { default as ms } from "./ms.js";
27
31
  export { default as nb_no } from "./nb_no.js";
28
32
  export { default as nl } from "./nl.js";
29
33
  export { default as pl } from "./pl.js";
@@ -37,8 +41,8 @@ export { default as sv } from "./sv.js";
37
41
  export { default as th } from "./th.js";
38
42
  export { default as tj } from "./tj.js";
39
43
  export { default as tr } from "./tr.js";
40
- export { default as uk } from "./uk.js";
41
44
  export { default as ug_cn } from "./ug_cn.js";
45
+ export { default as uk } from "./uk.js";
42
46
  export { default as ur } from "./ur.js";
43
47
  export { default as uz } from "./uz.js";
44
48
  export { default as vi } from "./vi.js";
@@ -0,0 +1,3 @@
1
+ import type { Messages } from '../types';
2
+ declare const _default: import("../types").Locale<Messages>;
3
+ export default _default;