@nuxt/ui 3.0.1 → 3.1.0

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 (228) hide show
  1. package/.nuxt/ui/accordion.ts +25 -4
  2. package/.nuxt/ui/alert.ts +52 -31
  3. package/.nuxt/ui/avatar-group.ts +24 -3
  4. package/.nuxt/ui/avatar.ts +26 -5
  5. package/.nuxt/ui/badge.ts +56 -35
  6. package/.nuxt/ui/breadcrumb.ts +28 -7
  7. package/.nuxt/ui/button-group.ts +23 -2
  8. package/.nuxt/ui/button.ts +66 -45
  9. package/.nuxt/ui/calendar.ts +39 -18
  10. package/.nuxt/ui/card.ts +28 -7
  11. package/.nuxt/ui/carousel.ts +29 -8
  12. package/.nuxt/ui/checkbox-group.ts +82 -0
  13. package/.nuxt/ui/checkbox.ts +163 -29
  14. package/.nuxt/ui/chip.ts +31 -10
  15. package/.nuxt/ui/collapsible.ts +23 -2
  16. package/.nuxt/ui/color-picker.ts +26 -5
  17. package/.nuxt/ui/command-palette.ts +37 -16
  18. package/.nuxt/ui/container.ts +24 -3
  19. package/.nuxt/ui/context-menu.ts +56 -35
  20. package/.nuxt/ui/drawer.ts +33 -12
  21. package/.nuxt/ui/dropdown-menu.ts +57 -36
  22. package/.nuxt/ui/form-field.ts +29 -8
  23. package/.nuxt/ui/form.ts +23 -2
  24. package/.nuxt/ui/index.ts +1 -0
  25. package/.nuxt/ui/input-menu.ts +65 -44
  26. package/.nuxt/ui/input-number.ts +43 -22
  27. package/.nuxt/ui/input.ts +46 -25
  28. package/.nuxt/ui/kbd.ts +27 -6
  29. package/.nuxt/ui/link.ts +26 -5
  30. package/.nuxt/ui/modal.ts +28 -7
  31. package/.nuxt/ui/navigation-menu.ts +103 -84
  32. package/.nuxt/ui/pagination.ts +23 -2
  33. package/.nuxt/ui/pin-input.ts +43 -22
  34. package/.nuxt/ui/popover.ts +25 -4
  35. package/.nuxt/ui/progress.ts +40 -19
  36. package/.nuxt/ui/radio-group.ts +273 -37
  37. package/.nuxt/ui/select-menu.ts +59 -35
  38. package/.nuxt/ui/select.ts +55 -34
  39. package/.nuxt/ui/separator.ts +31 -10
  40. package/.nuxt/ui/skeleton.ts +24 -3
  41. package/.nuxt/ui/slideover.ts +27 -6
  42. package/.nuxt/ui/slider.ts +39 -18
  43. package/.nuxt/ui/stepper.ts +41 -20
  44. package/.nuxt/ui/switch.ts +44 -23
  45. package/.nuxt/ui/table.ts +38 -17
  46. package/.nuxt/ui/tabs.ts +55 -34
  47. package/.nuxt/ui/textarea.ts +63 -37
  48. package/.nuxt/ui/toast.ts +47 -26
  49. package/.nuxt/ui/toaster.ts +23 -2
  50. package/.nuxt/ui/tooltip.ts +25 -4
  51. package/.nuxt/ui/tree.ts +41 -20
  52. package/.nuxt/ui.css +56 -12
  53. package/README.md +11 -0
  54. package/cli/templates.mjs +18 -17
  55. package/dist/module.d.mts +2 -1
  56. package/dist/module.json +5 -5
  57. package/dist/module.mjs +11 -7
  58. package/dist/runtime/components/Accordion.vue +36 -92
  59. package/dist/runtime/components/Accordion.vue.d.ts +91 -0
  60. package/dist/runtime/components/Alert.vue +37 -100
  61. package/dist/runtime/components/Alert.vue.d.ts +96 -0
  62. package/dist/runtime/components/App.vue +28 -34
  63. package/dist/runtime/components/App.vue.d.ts +24 -0
  64. package/dist/runtime/components/Avatar.vue +47 -78
  65. package/dist/runtime/components/Avatar.vue.d.ts +60 -0
  66. package/dist/runtime/components/AvatarGroup.vue +40 -77
  67. package/dist/runtime/components/AvatarGroup.vue.d.ts +40 -0
  68. package/dist/runtime/components/Badge.vue +33 -62
  69. package/dist/runtime/components/Badge.vue.d.ts +62 -0
  70. package/dist/runtime/components/Breadcrumb.vue +36 -88
  71. package/dist/runtime/components/Breadcrumb.vue.d.ts +82 -0
  72. package/dist/runtime/components/Button.vue +96 -105
  73. package/dist/runtime/components/Button.vue.d.ts +73 -0
  74. package/dist/runtime/components/ButtonGroup.vue +20 -46
  75. package/dist/runtime/components/ButtonGroup.vue.d.ts +55 -0
  76. package/dist/runtime/components/Calendar.vue +73 -127
  77. package/dist/runtime/components/Calendar.vue.d.ts +107 -0
  78. package/dist/runtime/components/Card.vue +18 -40
  79. package/dist/runtime/components/Card.vue.d.ts +38 -0
  80. package/dist/runtime/components/Carousel.vue +112 -230
  81. package/dist/runtime/components/Carousel.vue.d.ts +120 -0
  82. package/dist/runtime/components/Checkbox.vue +52 -93
  83. package/dist/runtime/components/Checkbox.vue.d.ts +76 -0
  84. package/dist/runtime/components/CheckboxGroup.vue +121 -0
  85. package/dist/runtime/components/CheckboxGroup.vue.d.ts +75 -0
  86. package/dist/runtime/components/Chip.vue +26 -69
  87. package/dist/runtime/components/Chip.vue.d.ts +71 -0
  88. package/dist/runtime/components/Collapsible.vue +22 -41
  89. package/dist/runtime/components/Collapsible.vue.d.ts +50 -0
  90. package/dist/runtime/components/ColorPicker.vue +111 -197
  91. package/dist/runtime/components/ColorPicker.vue.d.ts +63 -0
  92. package/dist/runtime/components/CommandPalette.vue +94 -234
  93. package/dist/runtime/components/CommandPalette.vue.d.ts +173 -0
  94. package/dist/runtime/components/Container.vue +15 -28
  95. package/dist/runtime/components/Container.vue.d.ts +27 -0
  96. package/dist/runtime/components/ContextMenu.vue +32 -119
  97. package/dist/runtime/components/ContextMenu.vue.d.ts +127 -0
  98. package/dist/runtime/components/ContextMenuContent.vue +71 -72
  99. package/dist/runtime/components/ContextMenuContent.vue.d.ts +105 -0
  100. package/dist/runtime/components/Drawer.vue +49 -87
  101. package/dist/runtime/components/Drawer.vue.d.ts +88 -0
  102. package/dist/runtime/components/DropdownMenu.vue +37 -129
  103. package/dist/runtime/components/DropdownMenu.vue.d.ts +141 -0
  104. package/dist/runtime/components/DropdownMenuContent.vue +76 -79
  105. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +55 -0
  106. package/dist/runtime/components/Form.vue +135 -219
  107. package/dist/runtime/components/Form.vue.d.ts +66 -0
  108. package/dist/runtime/components/FormField.vue +36 -77
  109. package/dist/runtime/components/FormField.vue.d.ts +70 -0
  110. package/dist/runtime/components/Icon.vue +12 -19
  111. package/dist/runtime/components/Icon.vue.d.ts +17 -0
  112. package/dist/runtime/components/Input.vue +82 -140
  113. package/dist/runtime/components/Input.vue.d.ts +91 -0
  114. package/dist/runtime/components/InputMenu.vue +193 -302
  115. package/dist/runtime/components/InputMenu.vue.d.ts +312 -0
  116. package/dist/runtime/components/InputNumber.vue +71 -133
  117. package/dist/runtime/components/InputNumber.vue.d.ts +193 -0
  118. package/dist/runtime/components/Kbd.vue +20 -46
  119. package/dist/runtime/components/Kbd.vue.d.ts +55 -0
  120. package/dist/runtime/components/Link.vue +98 -173
  121. package/dist/runtime/components/Link.vue.d.ts +124 -0
  122. package/dist/runtime/components/LinkBase.vue +33 -41
  123. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  124. package/dist/runtime/components/Modal.vue +53 -116
  125. package/dist/runtime/components/Modal.vue.d.ts +109 -0
  126. package/dist/runtime/components/NavigationMenu.vue +78 -186
  127. package/dist/runtime/components/NavigationMenu.vue.d.ts +159 -0
  128. package/dist/runtime/components/OverlayProvider.vue +14 -18
  129. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  130. package/dist/runtime/components/Pagination.vue +46 -140
  131. package/dist/runtime/components/Pagination.vue.d.ts +143 -0
  132. package/dist/runtime/components/PinInput.vue +61 -78
  133. package/dist/runtime/components/PinInput.vue.d.ts +68 -0
  134. package/dist/runtime/components/Popover.vue +47 -84
  135. package/dist/runtime/components/Popover.vue.d.ts +80 -0
  136. package/dist/runtime/components/Progress.vue +70 -131
  137. package/dist/runtime/components/Progress.vue.d.ts +97 -0
  138. package/dist/runtime/components/RadioGroup.vue +75 -126
  139. package/dist/runtime/components/RadioGroup.vue.d.ts +88 -0
  140. package/dist/runtime/components/Select.vue +115 -202
  141. package/dist/runtime/components/Select.vue.d.ts +139 -0
  142. package/dist/runtime/components/SelectMenu.vue +167 -281
  143. package/dist/runtime/components/SelectMenu.vue.d.ts +184 -0
  144. package/dist/runtime/components/Separator.vue +29 -71
  145. package/dist/runtime/components/Separator.vue.d.ts +75 -0
  146. package/dist/runtime/components/Skeleton.vue +21 -23
  147. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  148. package/dist/runtime/components/Slideover.vue +53 -120
  149. package/dist/runtime/components/Slideover.vue.d.ts +111 -0
  150. package/dist/runtime/components/Slider.vue +46 -84
  151. package/dist/runtime/components/Slider.vue.d.ts +71 -0
  152. package/dist/runtime/components/Stepper.vue +44 -113
  153. package/dist/runtime/components/Stepper.vue.d.ts +89 -0
  154. package/dist/runtime/components/Switch.vue +45 -93
  155. package/dist/runtime/components/Switch.vue.d.ts +73 -0
  156. package/dist/runtime/components/Table.vue +165 -264
  157. package/dist/runtime/components/Table.vue.d.ts +183 -0
  158. package/dist/runtime/components/Tabs.vue +40 -105
  159. package/dist/runtime/components/Tabs.vue.d.ts +104 -0
  160. package/dist/runtime/components/Textarea.vue +113 -158
  161. package/dist/runtime/components/Textarea.vue.d.ts +95 -0
  162. package/dist/runtime/components/Toast.vue +49 -110
  163. package/dist/runtime/components/Toast.vue.d.ts +95 -0
  164. package/dist/runtime/components/Toaster.vue +70 -107
  165. package/dist/runtime/components/Toaster.vue.d.ts +63 -0
  166. package/dist/runtime/components/Tooltip.vue +38 -65
  167. package/dist/runtime/components/Tooltip.vue.d.ts +65 -0
  168. package/dist/runtime/components/Tree.vue +57 -150
  169. package/dist/runtime/components/Tree.vue.d.ts +128 -0
  170. package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
  171. package/dist/runtime/composables/defineShortcuts.js +0 -1
  172. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  173. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  174. package/dist/runtime/composables/useFormField.d.ts +2 -2
  175. package/dist/runtime/composables/useFormField.js +1 -1
  176. package/dist/runtime/composables/useOverlay.d.ts +16 -8
  177. package/dist/runtime/composables/useOverlay.js +14 -6
  178. package/dist/runtime/composables/usePortal.d.ts +6 -0
  179. package/dist/runtime/composables/usePortal.js +17 -0
  180. package/dist/runtime/index.css +1 -1
  181. package/dist/runtime/inertia/components/Link.vue +146 -0
  182. package/dist/runtime/inertia/components/Link.vue.d.ts +92 -0
  183. package/dist/runtime/inertia/stubs.d.ts +43 -0
  184. package/dist/runtime/inertia/stubs.js +82 -0
  185. package/dist/runtime/locale/bg.d.ts +3 -0
  186. package/dist/runtime/locale/bg.js +54 -0
  187. package/dist/runtime/locale/hy.d.ts +3 -0
  188. package/dist/runtime/locale/hy.js +54 -0
  189. package/dist/runtime/locale/index.d.ts +6 -1
  190. package/dist/runtime/locale/index.js +6 -1
  191. package/dist/runtime/locale/kk.d.ts +3 -0
  192. package/dist/runtime/locale/kk.js +54 -0
  193. package/dist/runtime/locale/tj.d.ts +3 -0
  194. package/dist/runtime/locale/tj.js +54 -0
  195. package/dist/runtime/locale/ug_cn.d.ts +3 -0
  196. package/dist/runtime/locale/ug_cn.js +55 -0
  197. package/dist/runtime/types/form.d.ts +5 -1
  198. package/dist/runtime/types/index.d.ts +2 -0
  199. package/dist/runtime/types/index.js +2 -0
  200. package/dist/runtime/types/utils.d.ts +70 -10
  201. package/dist/runtime/utils/index.d.ts +1 -0
  202. package/dist/runtime/utils/index.js +3 -0
  203. package/dist/runtime/utils/link.d.ts +4 -27
  204. package/dist/runtime/utils/link.js +32 -1
  205. package/dist/runtime/utils/tv.js +2 -2
  206. package/dist/runtime/vue/components/Icon.vue +7 -8
  207. package/dist/runtime/vue/components/Icon.vue.d.ts +14 -0
  208. package/dist/runtime/vue/components/Link.vue +118 -199
  209. package/dist/runtime/vue/components/Link.vue.d.ts +124 -0
  210. package/dist/runtime/vue/stubs.d.ts +5 -0
  211. package/dist/runtime/vue/stubs.js +11 -2
  212. package/dist/shared/{ui.BCaWD5Ek.mjs → ui.D7lOOabO.mjs} +623 -364
  213. package/dist/types.d.mts +5 -1
  214. package/dist/unplugin.d.mts +6 -1
  215. package/dist/unplugin.mjs +25 -4
  216. package/dist/vite.mjs +1 -1
  217. package/package.json +122 -64
  218. package/dist/module.cjs +0 -62
  219. package/dist/module.d.cts +0 -44
  220. package/dist/module.d.ts +0 -44
  221. package/dist/shared/ui.C6uTSFTI.cjs +0 -3555
  222. package/dist/types.d.ts +0 -1
  223. package/dist/unplugin.cjs +0 -232
  224. package/dist/unplugin.d.cts +0 -61
  225. package/dist/unplugin.d.ts +0 -61
  226. package/dist/vite.cjs +0 -23
  227. package/dist/vite.d.cts +0 -15
  228. package/dist/vite.d.ts +0 -15
@@ -1,93 +1,87 @@
1
- <!-- eslint-disable vue/block-tag-newline -->
2
- <script lang="ts">
3
- import type { DropdownMenuContentProps as RekaDropdownMenuContentProps, DropdownMenuContentEmits as RekaDropdownMenuContentEmits } from 'reka-ui'
4
- import theme from '#build/ui/dropdown-menu'
5
- import { tv } from '../utils/tv'
6
- import type { KbdProps, AvatarProps, DropdownMenuItem, DropdownMenuSlots } from '../types'
7
-
8
- const _dropdownMenu = tv(theme)()
9
-
10
- interface DropdownMenuContentProps<T> extends Omit<RekaDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
11
- items?: T[] | T[][]
12
- portal?: boolean
13
- sub?: boolean
14
- labelKey: string
15
- /**
16
- * @IconifyIcon
17
- */
18
- checkedIcon?: string
19
- /**
20
- * @IconifyIcon
21
- */
22
- loadingIcon?: string
23
- /**
24
- * @IconifyIcon
25
- */
26
- externalIcon?: boolean | string
27
- class?: any
28
- ui: typeof _dropdownMenu
29
- uiOverride?: any
30
- }
31
-
32
- interface DropdownMenuContentEmits extends RekaDropdownMenuContentEmits {}
33
-
34
- type DropdownMenuContentSlots<T extends { slot?: string }> = Omit<DropdownMenuSlots<T>, 'default'> & {
35
- default(props?: {}): any
36
- }
1
+ <script>
37
2
 
38
3
  </script>
39
4
 
40
- <script setup lang="ts" generic="T extends DropdownMenuItem">
41
- import { computed } from 'vue'
42
- import { DropdownMenu } from 'reka-ui/namespaced'
43
- import { useForwardPropsEmits } from 'reka-ui'
44
- import { reactiveOmit, createReusableTemplate } from '@vueuse/core'
45
- import { useAppConfig } from '#imports'
46
- import { omit, get } from '../utils'
47
- import { pickLinkProps } from '../utils/link'
48
- import ULinkBase from './LinkBase.vue'
49
- import ULink from './Link.vue'
50
- import UAvatar from './Avatar.vue'
51
- import UIcon from './Icon.vue'
52
- import UKbd from './Kbd.vue'
53
- // eslint-disable-next-line import/no-self-import
54
- import UDropdownMenuContent from './DropdownMenuContent.vue'
55
-
56
- const props = defineProps<DropdownMenuContentProps<T>>()
57
- const emits = defineEmits<DropdownMenuContentEmits>()
58
- const slots = defineSlots<DropdownMenuContentSlots<T>>()
59
-
60
- const appConfig = useAppConfig()
61
- const contentProps = useForwardPropsEmits(reactiveOmit(props, 'sub', 'items', 'portal', 'labelKey', 'checkedIcon', 'loadingIcon', 'externalIcon', 'class', 'ui', 'uiOverride'), emits)
62
- const proxySlots = omit(slots, ['default']) as Record<string, DropdownMenuContentSlots<T>[string]>
63
-
64
- const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate<{ item: DropdownMenuItem, active?: boolean, index: number }>()
65
-
66
- const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0]) ? props.items : [props.items]) as T[][] : [])
5
+ <script setup>
6
+ import { computed, toRef } from "vue";
7
+ import { DropdownMenu } from "reka-ui/namespaced";
8
+ import { useForwardPropsEmits } from "reka-ui";
9
+ import { reactiveOmit, createReusableTemplate } from "@vueuse/core";
10
+ import { useAppConfig } from "#imports";
11
+ import { useLocale } from "../composables/useLocale";
12
+ import { usePortal } from "../composables/usePortal";
13
+ import { omit, get, isArrayOfArray } from "../utils";
14
+ import { pickLinkProps } from "../utils/link";
15
+ import ULinkBase from "./LinkBase.vue";
16
+ import ULink from "./Link.vue";
17
+ import UAvatar from "./Avatar.vue";
18
+ import UIcon from "./Icon.vue";
19
+ import UKbd from "./Kbd.vue";
20
+ import UDropdownMenuContent from "./DropdownMenuContent.vue";
21
+ const props = defineProps({
22
+ items: { type: null, required: false },
23
+ portal: { type: [Boolean, String], required: false, skipCheck: true },
24
+ sub: { type: Boolean, required: false },
25
+ labelKey: { type: null, required: true },
26
+ checkedIcon: { type: String, required: false },
27
+ loadingIcon: { type: String, required: false },
28
+ externalIcon: { type: [Boolean, String], required: false },
29
+ class: { type: null, required: false },
30
+ ui: { type: null, required: true },
31
+ uiOverride: { type: null, required: false },
32
+ loop: { type: Boolean, required: false },
33
+ side: { type: null, required: false },
34
+ sideOffset: { type: Number, required: false },
35
+ align: { type: null, required: false },
36
+ alignOffset: { type: Number, required: false },
37
+ avoidCollisions: { type: Boolean, required: false },
38
+ collisionBoundary: { type: null, required: false },
39
+ collisionPadding: { type: [Number, Object], required: false },
40
+ arrowPadding: { type: Number, required: false },
41
+ sticky: { type: String, required: false },
42
+ hideWhenDetached: { type: Boolean, required: false },
43
+ positionStrategy: { type: String, required: false },
44
+ updatePositionStrategy: { type: String, required: false },
45
+ disableUpdateOnLayoutShift: { type: Boolean, required: false },
46
+ prioritizePosition: { type: Boolean, required: false },
47
+ reference: { type: null, required: false }
48
+ });
49
+ const emits = defineEmits(["escapeKeyDown", "pointerDownOutside", "focusOutside", "interactOutside", "closeAutoFocus"]);
50
+ const slots = defineSlots();
51
+ const { dir } = useLocale();
52
+ const appConfig = useAppConfig();
53
+ const portalProps = usePortal(toRef(() => props.portal));
54
+ const contentProps = useForwardPropsEmits(reactiveOmit(props, "sub", "items", "portal", "labelKey", "checkedIcon", "loadingIcon", "externalIcon", "class", "ui", "uiOverride"), emits);
55
+ const proxySlots = omit(slots, ["default"]);
56
+ const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate();
57
+ const childrenIcon = computed(() => dir.value === "rtl" ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight);
58
+ const groups = computed(
59
+ () => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
60
+ );
67
61
  </script>
68
62
 
69
63
  <template>
70
64
  <DefineItemTemplate v-slot="{ item, active, index }">
71
- <slot :name="item.slot || 'item'" :item="(item as T)" :index="index">
72
- <slot :name="item.slot ? `${item.slot}-leading`: 'item-leading'" :item="(item as T)" :active="active" :index="index">
65
+ <slot :name="item.slot || 'item'" :item="item" :index="index">
66
+ <slot :name="item.slot ? `${item.slot}-leading` : 'item-leading'" :item="item" :active="active" :index="index">
73
67
  <UIcon v-if="item.loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, loading: true })" />
74
68
  <UIcon v-else-if="item.icon" :name="item.icon" :class="ui.itemLeadingIcon({ class: uiOverride?.itemLeadingIcon, color: item?.color, active })" />
75
- <UAvatar v-else-if="item.avatar" :size="((props.uiOverride?.itemLeadingAvatarSize || ui.itemLeadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.itemLeadingAvatar({ class: uiOverride?.itemLeadingAvatar, 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 })" />
76
70
  </slot>
77
71
 
78
- <span v-if="get(item, props.labelKey as string) || !!slots[item.slot ? `${item.slot}-label`: 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
79
- <slot :name="item.slot ? `${item.slot}-label`: 'item-label'" :item="(item as T)" :active="active" :index="index">
80
- {{ get(item, props.labelKey as string) }}
72
+ <span v-if="get(item, props.labelKey) || !!slots[item.slot ? `${item.slot}-label` : 'item-label']" :class="ui.itemLabel({ class: uiOverride?.itemLabel, active })">
73
+ <slot :name="item.slot ? `${item.slot}-label` : 'item-label'" :item="item" :active="active" :index="index">
74
+ {{ get(item, props.labelKey) }}
81
75
  </slot>
82
76
 
83
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 })" />
84
78
  </span>
85
79
 
86
80
  <span :class="ui.itemTrailing({ class: uiOverride?.itemTrailing })">
87
- <slot :name="item.slot ? `${item.slot}-trailing`: 'item-trailing'" :item="(item as T)" :active="active" :index="index">
88
- <UIcon v-if="item.children?.length" :name="appConfig.ui.icons.chevronRight" :class="ui.itemTrailingIcon({ class: uiOverride?.itemTrailingIcon, color: item?.color, active })" />
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 })" />
89
83
  <span v-else-if="item.kbds?.length" :class="ui.itemTrailingKbds({ class: uiOverride?.itemTrailingKbds })">
90
- <UKbd v-for="(kbd, kbdIndex) in item.kbds" :key="kbdIndex" :size="((props.uiOverride?.itemTrailingKbdsSize || ui.itemTrailingKbdsSize()) as KbdProps['size'])" v-bind="typeof kbd === 'string' ? { value: kbd } : kbd" />
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" />
91
85
  </span>
92
86
  </slot>
93
87
 
@@ -98,8 +92,10 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
98
92
  </slot>
99
93
  </DefineItemTemplate>
100
94
 
101
- <DropdownMenu.Portal :disabled="!portal">
95
+ <DropdownMenu.Portal v-bind="portalProps">
102
96
  <component :is="sub ? DropdownMenu.SubContent : DropdownMenu.Content" :class="props.class" v-bind="contentProps">
97
+ <slot name="content-top" />
98
+
103
99
  <DropdownMenu.Group v-for="(group, groupIndex) in groups" :key="`group-${groupIndex}`" :class="ui.group({ class: uiOverride?.group })">
104
100
  <template v-for="(item, index) in group" :key="`group-${groupIndex}-${index}`">
105
101
  <DropdownMenu.Label v-if="item.type === 'label'" :class="ui.label({ class: uiOverride?.label })">
@@ -111,7 +107,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
111
107
  as="button"
112
108
  type="button"
113
109
  :disabled="item.disabled"
114
- :text-value="get(item, props.labelKey as string)"
110
+ :text-value="get(item, props.labelKey)"
115
111
  :class="ui.item({ class: uiOverride?.item, color: item?.color })"
116
112
  >
117
113
  <ReuseItemTemplate :item="item" :index="index" />
@@ -124,7 +120,6 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
124
120
  :ui-override="uiOverride"
125
121
  :portal="portal"
126
122
  :items="item.children"
127
- side="right"
128
123
  align="start"
129
124
  :align-offset="-4"
130
125
  :side-offset="3"
@@ -134,7 +129,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
134
129
  :external-icon="externalIcon"
135
130
  v-bind="item.content"
136
131
  >
137
- <template v-for="(_, name) in proxySlots" #[name]="slotData: any">
132
+ <template v-for="(_, name) in proxySlots" #[name]="slotData">
138
133
  <slot :name="name" v-bind="slotData" />
139
134
  </template>
140
135
  </UDropdownMenuContent>
@@ -143,7 +138,7 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
143
138
  v-else-if="item.type === 'checkbox'"
144
139
  :model-value="item.checked"
145
140
  :disabled="item.disabled"
146
- :text-value="get(item, props.labelKey as string)"
141
+ :text-value="get(item, props.labelKey)"
147
142
  :class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color })"
148
143
  @update:model-value="item.onUpdateChecked"
149
144
  @select="item.onSelect"
@@ -154,10 +149,10 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
154
149
  v-else
155
150
  as-child
156
151
  :disabled="item.disabled"
157
- :text-value="get(item, props.labelKey as string)"
152
+ :text-value="get(item, props.labelKey)"
158
153
  @select="item.onSelect"
159
154
  >
160
- <ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item as Omit<DropdownMenuItem, 'type'>)" custom>
155
+ <ULink v-slot="{ active, ...slotProps }" v-bind="pickLinkProps(item)" custom>
161
156
  <ULinkBase v-bind="slotProps" :class="ui.item({ class: [uiOverride?.item, item.class], color: item?.color, active })">
162
157
  <ReuseItemTemplate :item="item" :active="active" :index="index" />
163
158
  </ULinkBase>
@@ -167,6 +162,8 @@ const groups = computed(() => props.items?.length ? (Array.isArray(props.items[0
167
162
  </DropdownMenu.Group>
168
163
 
169
164
  <slot />
165
+
166
+ <slot name="content-bottom" />
170
167
  </component>
171
168
  </DropdownMenu.Portal>
172
169
  </template>
@@ -0,0 +1,55 @@
1
+ import { DropdownMenu } from 'reka-ui/namespaced';
2
+ import type { DropdownMenuContentProps as RekaDropdownMenuContentProps } from 'reka-ui';
3
+ import type { AppConfig } from '@nuxt/schema';
4
+ import type theme from '#build/ui/dropdown-menu';
5
+ import type { DropdownMenuItem, DropdownMenuSlots } from '../types';
6
+ import type { ArrayOrNested, NestedItem, ComponentConfig } from '../types/utils';
7
+ type DropdownMenu = ComponentConfig<typeof theme, AppConfig, 'dropdownMenu'>;
8
+ interface DropdownMenuContentProps<T extends ArrayOrNested<DropdownMenuItem>> extends Omit<RekaDropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> {
9
+ items?: T;
10
+ portal?: boolean | string | HTMLElement;
11
+ sub?: boolean;
12
+ labelKey: keyof NestedItem<T>;
13
+ /**
14
+ * @IconifyIcon
15
+ */
16
+ checkedIcon?: string;
17
+ /**
18
+ * @IconifyIcon
19
+ */
20
+ loadingIcon?: string;
21
+ /**
22
+ * @IconifyIcon
23
+ */
24
+ externalIcon?: boolean | string;
25
+ class?: any;
26
+ ui: {
27
+ [K in keyof Required<DropdownMenu['slots']>]: (props?: Record<string, any>) => string;
28
+ };
29
+ uiOverride?: DropdownMenu['slots'];
30
+ }
31
+ declare const _default: <T extends ArrayOrNested<DropdownMenuItem>>(__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<{
32
+ props: __VLS_PrettifyLocal<any & DropdownMenuContentProps<T> & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
33
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
34
+ attrs: any;
35
+ slots: Readonly<Omit<DropdownMenuSlots<T>, "default"> & {
36
+ default(props?: {}): any;
37
+ }> & Omit<DropdownMenuSlots<T>, "default"> & {
38
+ default(props?: {}): any;
39
+ };
40
+ emit: ((evt: "escapeKeyDown", event: KeyboardEvent) => void) & ((evt: "pointerDownOutside", event: CustomEvent<{
41
+ originalEvent: PointerEvent;
42
+ }>) => void) & ((evt: "focusOutside", event: CustomEvent<{
43
+ originalEvent: FocusEvent;
44
+ }>) => void) & ((evt: "interactOutside", event: CustomEvent<{
45
+ originalEvent: PointerEvent;
46
+ }> | CustomEvent<{
47
+ originalEvent: FocusEvent;
48
+ }>) => void) & ((evt: "closeAutoFocus", event: Event) => void);
49
+ }>) => import("vue").VNode & {
50
+ __ctx?: Awaited<typeof __VLS_setup>;
51
+ };
52
+ export default _default;
53
+ type __VLS_PrettifyLocal<T> = {
54
+ [K in keyof T]: T[K];
55
+ } & {};