@byyuurin/ui 0.0.11 → 0.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 (289) hide show
  1. package/README.md +170 -58
  2. package/dist/module.d.mts +4 -13
  3. package/dist/module.json +4 -4
  4. package/dist/module.mjs +54 -20
  5. package/dist/runtime/components/Accordion.vue +28 -23
  6. package/dist/runtime/components/Accordion.vue.d.ts +51 -29
  7. package/dist/runtime/components/Alert.vue +47 -27
  8. package/dist/runtime/components/Alert.vue.d.ts +37 -25
  9. package/dist/runtime/components/App.vue +9 -8
  10. package/dist/runtime/components/App.vue.d.ts +22 -20
  11. package/dist/runtime/components/Avatar.vue +65 -21
  12. package/dist/runtime/components/Avatar.vue.d.ts +27 -13
  13. package/dist/runtime/components/AvatarGroup.vue +14 -10
  14. package/dist/runtime/components/AvatarGroup.vue.d.ts +12 -9
  15. package/dist/runtime/components/Badge.vue +64 -32
  16. package/dist/runtime/components/Badge.vue.d.ts +30 -29
  17. package/dist/runtime/components/Breadcrumb.vue +40 -22
  18. package/dist/runtime/components/Breadcrumb.vue.d.ts +48 -21
  19. package/dist/runtime/components/Button.vue +113 -52
  20. package/dist/runtime/components/Button.vue.d.ts +36 -20
  21. package/dist/runtime/components/Calendar.vue +48 -39
  22. package/dist/runtime/components/Calendar.vue.d.ts +58 -31
  23. package/dist/runtime/components/Card.vue +18 -14
  24. package/dist/runtime/components/Card.vue.d.ts +18 -14
  25. package/dist/runtime/components/Carousel.vue +80 -46
  26. package/dist/runtime/components/Carousel.vue.d.ts +46 -25
  27. package/dist/runtime/components/Checkbox.vue +60 -35
  28. package/dist/runtime/components/Checkbox.vue.d.ts +35 -28
  29. package/dist/runtime/components/Chip.vue +35 -32
  30. package/dist/runtime/components/Chip.vue.d.ts +33 -15
  31. package/dist/runtime/components/Collapsible.vue +13 -9
  32. package/dist/runtime/components/Collapsible.vue.d.ts +16 -8
  33. package/dist/runtime/components/Drawer.vue +80 -70
  34. package/dist/runtime/components/Drawer.vue.d.ts +51 -28
  35. package/dist/runtime/components/DropdownMenu.vue +23 -16
  36. package/dist/runtime/components/DropdownMenu.vue.d.ts +77 -36
  37. package/dist/runtime/components/DropdownMenuContent.vue +133 -103
  38. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +38 -26
  39. package/dist/runtime/components/FieldGroup.vue +33 -0
  40. package/dist/runtime/components/FieldGroup.vue.d.ts +33 -0
  41. package/dist/runtime/components/Form.vue +172 -88
  42. package/dist/runtime/components/Form.vue.d.ts +69 -44
  43. package/dist/runtime/components/FormField.vue +108 -0
  44. package/dist/runtime/components/FormField.vue.d.ts +63 -0
  45. package/dist/runtime/components/Icon.vue +20 -0
  46. package/dist/runtime/components/Icon.vue.d.ts +9 -0
  47. package/dist/runtime/components/Input.vue +82 -77
  48. package/dist/runtime/components/Input.vue.d.ts +55 -43
  49. package/dist/runtime/components/InputNumber.vue +65 -49
  50. package/dist/runtime/components/InputNumber.vue.d.ts +51 -105
  51. package/dist/runtime/components/Kbd.vue +11 -5
  52. package/dist/runtime/components/Kbd.vue.d.ts +17 -11
  53. package/dist/runtime/components/Link.vue +54 -197
  54. package/dist/runtime/components/Link.vue.d.ts +17 -17
  55. package/dist/runtime/components/LinkBase.vue +11 -33
  56. package/dist/runtime/components/LinkBase.vue.d.ts +8 -3
  57. package/dist/runtime/components/Modal.vue +53 -39
  58. package/dist/runtime/components/Modal.vue.d.ts +64 -34
  59. package/dist/runtime/components/NavigationMenu.vue +336 -0
  60. package/dist/runtime/components/NavigationMenu.vue.d.ts +181 -0
  61. package/dist/runtime/components/OverlayProvider.vue +3 -3
  62. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -1
  63. package/dist/runtime/components/Pagination.vue +39 -47
  64. package/dist/runtime/components/Pagination.vue.d.ts +54 -31
  65. package/dist/runtime/components/PinInput.vue +46 -32
  66. package/dist/runtime/components/PinInput.vue.d.ts +40 -21
  67. package/dist/runtime/components/Popover.vue +33 -19
  68. package/dist/runtime/components/Popover.vue.d.ts +57 -32
  69. package/dist/runtime/components/Progress.vue +31 -26
  70. package/dist/runtime/components/Progress.vue.d.ts +32 -23
  71. package/dist/runtime/components/RadioGroup.vue +75 -48
  72. package/dist/runtime/components/RadioGroup.vue.d.ts +58 -36
  73. package/dist/runtime/components/ScrollArea.vue +33 -31
  74. package/dist/runtime/components/ScrollArea.vue.d.ts +9 -5
  75. package/dist/runtime/components/Select.vue +166 -76
  76. package/dist/runtime/components/Select.vue.d.ts +206 -65
  77. package/dist/runtime/components/Separator.vue +42 -16
  78. package/dist/runtime/components/Separator.vue.d.ts +35 -14
  79. package/dist/runtime/components/Skeleton.vue +18 -6
  80. package/dist/runtime/components/Skeleton.vue.d.ts +4 -4
  81. package/dist/runtime/components/Slider.vue +42 -24
  82. package/dist/runtime/components/Slider.vue.d.ts +43 -27
  83. package/dist/runtime/components/Switch.vue +40 -31
  84. package/dist/runtime/components/Switch.vue.d.ts +36 -27
  85. package/dist/runtime/components/Table.vue +279 -51
  86. package/dist/runtime/components/Table.vue.d.ts +151 -65
  87. package/dist/runtime/components/Tabs.vue +70 -23
  88. package/dist/runtime/components/Tabs.vue.d.ts +61 -29
  89. package/dist/runtime/components/Textarea.vue +102 -54
  90. package/dist/runtime/components/Textarea.vue.d.ts +57 -41
  91. package/dist/runtime/components/Toast.vue +84 -38
  92. package/dist/runtime/components/Toast.vue.d.ts +48 -27
  93. package/dist/runtime/components/ToastProvider.vue +31 -22
  94. package/dist/runtime/components/ToastProvider.vue.d.ts +30 -17
  95. package/dist/runtime/components/Tooltip.vue +33 -21
  96. package/dist/runtime/components/Tooltip.vue.d.ts +37 -15
  97. package/dist/runtime/composables/defineShortcuts.d.ts +16 -0
  98. package/dist/runtime/composables/defineShortcuts.js +129 -0
  99. package/dist/runtime/composables/useAvatarGroup.d.ts +8 -3
  100. package/dist/runtime/composables/useAvatarGroup.js +10 -3
  101. package/dist/runtime/composables/useComponentIcons.d.ts +9 -6
  102. package/dist/runtime/composables/useComponentIcons.js +4 -4
  103. package/dist/runtime/composables/useFieldGroup.d.ts +8 -0
  104. package/dist/runtime/composables/useFieldGroup.js +14 -0
  105. package/dist/runtime/composables/useFormField.d.ts +62 -0
  106. package/dist/runtime/composables/useFormField.js +99 -0
  107. package/dist/runtime/composables/useKbd.d.ts +3 -2
  108. package/dist/runtime/composables/useKbd.js +3 -2
  109. package/dist/runtime/composables/useLocale.d.ts +68 -5
  110. package/dist/runtime/composables/useLocale.js +11 -11
  111. package/dist/runtime/composables/useOverlay.d.ts +51 -15
  112. package/dist/runtime/composables/useOverlay.js +44 -30
  113. package/dist/runtime/composables/usePortal.d.ts +6 -0
  114. package/dist/runtime/composables/usePortal.js +17 -0
  115. package/dist/runtime/composables/useToast.d.ts +12 -5
  116. package/dist/runtime/composables/useToast.js +12 -7
  117. package/dist/runtime/locale/en.d.ts +30 -1
  118. package/dist/runtime/locale/en.js +2 -1
  119. package/dist/runtime/locale/index.d.ts +2 -2
  120. package/dist/runtime/locale/index.js +1 -1
  121. package/dist/runtime/locale/zh_tw.d.ts +31 -0
  122. package/dist/runtime/locale/{zh-tw.js → zh_tw.js} +2 -1
  123. package/dist/runtime/plugins/colors.d.ts +2 -0
  124. package/dist/runtime/plugins/colors.js +50 -0
  125. package/dist/runtime/types/app.config.d.ts +6 -0
  126. package/dist/runtime/types/form.d.ts +58 -17
  127. package/dist/runtime/types/form.js +11 -0
  128. package/dist/runtime/types/index.d.ts +51 -8
  129. package/dist/runtime/types/index.js +45 -2
  130. package/dist/runtime/types/input.d.ts +8 -0
  131. package/dist/runtime/types/locale.d.ts +5 -0
  132. package/dist/runtime/types/style.d.ts +33 -0
  133. package/dist/runtime/types/style.js +0 -0
  134. package/dist/runtime/types/unocss.d.ts +4 -0
  135. package/dist/runtime/types/utils.d.ts +38 -37
  136. package/dist/runtime/utils/form.d.ts +5 -1
  137. package/dist/runtime/utils/form.js +49 -0
  138. package/dist/runtime/utils/index.d.ts +10 -13
  139. package/dist/runtime/utils/index.js +41 -48
  140. package/dist/runtime/utils/link.d.ts +3 -2
  141. package/dist/runtime/utils/link.js +16 -2
  142. package/dist/runtime/utils/locale.d.ts +5 -0
  143. package/dist/runtime/utils/locale.js +10 -0
  144. package/dist/runtime/utils/style.d.ts +94 -0
  145. package/dist/runtime/utils/style.js +37 -0
  146. package/dist/runtime/vue/components/Icon.vue +15 -0
  147. package/dist/runtime/vue/components/Icon.vue.d.ts +7 -0
  148. package/dist/runtime/vue/components/Link.vue +163 -0
  149. package/dist/runtime/vue/components/Link.vue.d.ts +95 -0
  150. package/dist/runtime/vue/composables/useAppConfig.d.ts +1 -0
  151. package/dist/runtime/vue/composables/useAppConfig.js +4 -0
  152. package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
  153. package/dist/runtime/vue/plugins/color-mode.js +6 -0
  154. package/dist/runtime/vue/plugins/head.d.ts +4 -0
  155. package/dist/runtime/vue/plugins/head.js +9 -0
  156. package/dist/runtime/vue/stubs.d.ts +16 -1
  157. package/dist/runtime/vue/stubs.js +32 -1
  158. package/dist/setup.d.mts +13 -0
  159. package/dist/setup.mjs +12 -0
  160. package/dist/shared/ui.CzIlLITK.mjs +51 -0
  161. package/dist/shared/ui.DSyJHSTk.mjs +3787 -0
  162. package/dist/shared/ui.DpbffTXs.d.mts +84 -0
  163. package/dist/shared/ui.IulR-OYx.d.mts +64 -0
  164. package/dist/types.d.mts +3 -1
  165. package/dist/unocss.d.mts +12 -52
  166. package/dist/unocss.mjs +144 -254
  167. package/dist/unplugin.d.mts +13 -26
  168. package/dist/unplugin.mjs +193 -18
  169. package/dist/vite.d.mts +10 -1
  170. package/dist/vite.mjs +12 -3
  171. package/package.json +154 -87
  172. package/vue-plugin.d.ts +5 -0
  173. package/dist/module.d.ts +0 -13
  174. package/dist/module.mjs.map +0 -1
  175. package/dist/runtime/app/injections.d.ts +0 -9331
  176. package/dist/runtime/app/injections.js +0 -61
  177. package/dist/runtime/components/ButtonGroup.vue +0 -26
  178. package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -26
  179. package/dist/runtime/components/FormItem.vue +0 -90
  180. package/dist/runtime/components/FormItem.vue.d.ts +0 -60
  181. package/dist/runtime/composables/useButtonGroup.d.ts +0 -5
  182. package/dist/runtime/composables/useButtonGroup.js +0 -9
  183. package/dist/runtime/composables/useFormItem.d.ts +0 -27
  184. package/dist/runtime/composables/useFormItem.js +0 -64
  185. package/dist/runtime/composables/useTheme.d.ts +0 -9
  186. package/dist/runtime/composables/useTheme.js +0 -23
  187. package/dist/runtime/index.d.ts +0 -44
  188. package/dist/runtime/index.js +0 -44
  189. package/dist/runtime/locale/zh-tw.d.ts +0 -2
  190. package/dist/runtime/theme/accordion.d.ts +0 -50
  191. package/dist/runtime/theme/accordion.js +0 -28
  192. package/dist/runtime/theme/alert.d.ts +0 -119
  193. package/dist/runtime/theme/alert.js +0 -47
  194. package/dist/runtime/theme/app.d.ts +0 -19
  195. package/dist/runtime/theme/app.js +0 -19
  196. package/dist/runtime/theme/avatar-group.d.ts +0 -46
  197. package/dist/runtime/theme/avatar-group.js +0 -32
  198. package/dist/runtime/theme/avatar.d.ts +0 -50
  199. package/dist/runtime/theme/avatar.js +0 -34
  200. package/dist/runtime/theme/badge.d.ts +0 -76
  201. package/dist/runtime/theme/badge.js +0 -92
  202. package/dist/runtime/theme/breadcrumb.d.ts +0 -61
  203. package/dist/runtime/theme/breadcrumb.js +0 -44
  204. package/dist/runtime/theme/button-group.d.ts +0 -60
  205. package/dist/runtime/theme/button-group.js +0 -42
  206. package/dist/runtime/theme/button.d.ts +0 -184
  207. package/dist/runtime/theme/button.js +0 -164
  208. package/dist/runtime/theme/calendar.d.ts +0 -58
  209. package/dist/runtime/theme/calendar.js +0 -86
  210. package/dist/runtime/theme/card.d.ts +0 -56
  211. package/dist/runtime/theme/card.js +0 -37
  212. package/dist/runtime/theme/carousel.d.ts +0 -107
  213. package/dist/runtime/theme/carousel.js +0 -43
  214. package/dist/runtime/theme/checkbox.d.ts +0 -82
  215. package/dist/runtime/theme/checkbox.js +0 -54
  216. package/dist/runtime/theme/chip.d.ts +0 -61
  217. package/dist/runtime/theme/chip.js +0 -66
  218. package/dist/runtime/theme/collapsible.d.ts +0 -32
  219. package/dist/runtime/theme/collapsible.js +0 -10
  220. package/dist/runtime/theme/drawer.d.ts +0 -142
  221. package/dist/runtime/theme/drawer.js +0 -113
  222. package/dist/runtime/theme/dropdown-menu.d.ts +0 -65
  223. package/dist/runtime/theme/dropdown-menu.js +0 -83
  224. package/dist/runtime/theme/form-item.d.ts +0 -70
  225. package/dist/runtime/theme/form-item.js +0 -34
  226. package/dist/runtime/theme/form.d.ts +0 -2
  227. package/dist/runtime/theme/form.js +0 -7
  228. package/dist/runtime/theme/index.d.ts +0 -41
  229. package/dist/runtime/theme/index.js +0 -41
  230. package/dist/runtime/theme/input-number.d.ts +0 -115
  231. package/dist/runtime/theme/input-number.js +0 -95
  232. package/dist/runtime/theme/input.d.ts +0 -172
  233. package/dist/runtime/theme/input.js +0 -151
  234. package/dist/runtime/theme/kbd.d.ts +0 -33
  235. package/dist/runtime/theme/kbd.js +0 -26
  236. package/dist/runtime/theme/link.d.ts +0 -38
  237. package/dist/runtime/theme/link.js +0 -26
  238. package/dist/runtime/theme/modal.d.ts +0 -42
  239. package/dist/runtime/theme/modal.js +0 -55
  240. package/dist/runtime/theme/pagination.d.ts +0 -74
  241. package/dist/runtime/theme/pagination.js +0 -17
  242. package/dist/runtime/theme/pinInput.d.ts +0 -94
  243. package/dist/runtime/theme/pinInput.js +0 -111
  244. package/dist/runtime/theme/popover.d.ts +0 -32
  245. package/dist/runtime/theme/popover.js +0 -13
  246. package/dist/runtime/theme/progress.d.ts +0 -180
  247. package/dist/runtime/theme/progress.js +0 -95
  248. package/dist/runtime/theme/radio-group.d.ts +0 -104
  249. package/dist/runtime/theme/radio-group.js +0 -61
  250. package/dist/runtime/theme/scroll-area.d.ts +0 -67
  251. package/dist/runtime/theme/scroll-area.js +0 -33
  252. package/dist/runtime/theme/select.d.ts +0 -186
  253. package/dist/runtime/theme/select.js +0 -173
  254. package/dist/runtime/theme/separator.d.ts +0 -74
  255. package/dist/runtime/theme/separator.js +0 -53
  256. package/dist/runtime/theme/skeleton.d.ts +0 -2
  257. package/dist/runtime/theme/skeleton.js +0 -7
  258. package/dist/runtime/theme/slider.d.ts +0 -70
  259. package/dist/runtime/theme/slider.js +0 -52
  260. package/dist/runtime/theme/switch.d.ts +0 -116
  261. package/dist/runtime/theme/switch.js +0 -78
  262. package/dist/runtime/theme/table.d.ts +0 -86
  263. package/dist/runtime/theme/table.js +0 -36
  264. package/dist/runtime/theme/tabs.d.ts +0 -129
  265. package/dist/runtime/theme/tabs.js +0 -146
  266. package/dist/runtime/theme/textarea.d.ts +0 -90
  267. package/dist/runtime/theme/textarea.js +0 -116
  268. package/dist/runtime/theme/toast-provider.d.ts +0 -116
  269. package/dist/runtime/theme/toast-provider.js +0 -97
  270. package/dist/runtime/theme/toast.d.ts +0 -83
  271. package/dist/runtime/theme/toast.js +0 -35
  272. package/dist/runtime/theme/tooltip.d.ts +0 -38
  273. package/dist/runtime/theme/tooltip.js +0 -11
  274. package/dist/runtime/types/components.d.ts +0 -42
  275. package/dist/runtime/utils/extend-theme.d.ts +0 -9
  276. package/dist/runtime/utils/extend-theme.js +0 -27
  277. package/dist/runtime/utils/styler.d.ts +0 -4
  278. package/dist/runtime/utils/styler.js +0 -10
  279. package/dist/runtime/utils/translator.d.ts +0 -18
  280. package/dist/runtime/utils/translator.js +0 -8
  281. package/dist/shared/ui.D1BTWZFB.mjs +0 -5
  282. package/dist/shared/ui.D1BTWZFB.mjs.map +0 -1
  283. package/dist/unocss.d.ts +0 -52
  284. package/dist/unocss.mjs.map +0 -1
  285. package/dist/unplugin.d.ts +0 -26
  286. package/dist/unplugin.mjs.map +0 -1
  287. package/dist/vite.d.ts +0 -9
  288. package/dist/vite.mjs.map +0 -1
  289. /package/dist/runtime/types/{components.js → input.js} +0 -0
@@ -1,63 +1,93 @@
1
- import type { VariantProps } from '@byyuurin/ui-kit';
2
1
  import type { DialogContentEmits, DialogContentProps, DialogRootEmits, DialogRootProps } from 'reka-ui';
3
- import type { modal } from '../theme/index.js';
4
- import type { ButtonProps, ComponentAttrs, EmitsToProps } from '../types/index.js';
5
- export interface ModalEmits extends DialogRootEmits {
6
- 'after-leave': [];
7
- }
8
- export interface ModalSlots {
9
- default?: (props: {
10
- open: boolean;
11
- }) => any;
12
- content?: any;
13
- header?: any;
14
- title?: any;
15
- description?: any;
16
- close?: (props: {
17
- ui: ComponentAttrs<typeof modal>['ui'];
18
- }) => any;
19
- body?: any;
20
- footer?: any;
21
- }
22
- type ModalVariants = VariantProps<typeof modal>;
23
- export interface ModalProps extends ComponentAttrs<typeof modal>, DialogRootProps {
2
+ import theme from '#build/ui/modal';
3
+ import type { ButtonProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps } from '../types';
4
+ import type { EmitsToProps, StaticSlot } from '../types/utils';
5
+ export interface ModalProps extends ComponentBaseProps, DialogRootProps {
24
6
  title?: string;
25
7
  description?: string;
26
- size?: ModalVariants['size'];
8
+ /** The content of the modal. */
27
9
  content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DialogContentEmits>>;
28
- /** @default true */
29
- portal?: boolean;
30
- /** @default true */
10
+ /**
11
+ * Render an overlay behind the modal.
12
+ * @default true
13
+ */
31
14
  overlay?: boolean;
32
- /** @default true */
15
+ /**
16
+ * Animate the modal when opening or closing.
17
+ * @default true
18
+ */
33
19
  transition?: boolean;
34
20
  /**
35
- * When `false`, the modal will not close when clicking outside or pressing escape.
21
+ * When `true`, the modal will take up the full screen.
22
+ * @default false
23
+ */
24
+ fullscreen?: boolean;
25
+ /**
26
+ * Render the modal in a portal.
36
27
  * @default true
37
28
  */
38
- dismissible?: boolean;
29
+ portal?: boolean | string | HTMLElement;
39
30
  /**
40
31
  * Display a close button to dismiss the modal.
41
32
  * @default true
42
33
  */
43
- close?: ButtonProps | boolean;
34
+ close?: boolean | Partial<ButtonProps>;
44
35
  /** @default app.icons.close */
45
- closeIcon?: string;
36
+ closeIcon?: IconProps['name'];
37
+ /**
38
+ * When `false`, the modal will not close when clicking outside or pressing escape.
39
+ * @default true
40
+ */
41
+ dismissible?: boolean;
42
+ ui?: ComponentUIProps<typeof theme>;
43
+ }
44
+ export interface ModalEmits extends DialogRootEmits {
45
+ 'after-leave': [];
46
+ 'after-enter': [];
47
+ 'close-prevent': [];
48
+ }
49
+ export interface ModalSlots {
50
+ default: StaticSlot<{
51
+ open: boolean;
52
+ }>;
53
+ content: StaticSlot<{
54
+ close: () => void;
55
+ }>;
56
+ header: StaticSlot<{
57
+ close: () => void;
58
+ }>;
59
+ title: StaticSlot;
60
+ description: StaticSlot;
61
+ close?: StaticSlot<{
62
+ close: () => void;
63
+ ui: ComponentStyler<typeof theme>;
64
+ }>;
65
+ body: StaticSlot<{
66
+ close: () => void;
67
+ }>;
68
+ footer: StaticSlot<{
69
+ close: () => void;
70
+ }>;
46
71
  }
47
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
72
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ModalProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
48
73
  "update:open": (value: boolean) => any;
49
74
  "after-leave": () => any;
75
+ "after-enter": () => any;
76
+ "close-prevent": () => any;
50
77
  }, string, import("vue").PublicProps, Readonly<ModalProps> & Readonly<{
51
78
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
52
79
  "onAfter-leave"?: (() => any) | undefined;
80
+ "onAfter-enter"?: (() => any) | undefined;
81
+ "onClose-prevent"?: (() => any) | undefined;
53
82
  }>, {
54
- close: ButtonProps | boolean;
55
83
  overlay: boolean;
84
+ close: boolean | Partial<ButtonProps>;
56
85
  transition: boolean;
57
86
  modal: boolean;
58
- portal: boolean;
87
+ portal: boolean | string | HTMLElement;
59
88
  dismissible: boolean;
60
89
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ModalSlots>;
90
+ declare const _default: typeof __VLS_export;
61
91
  export default _default;
62
92
  type __VLS_WithSlots<T, S> = T & {
63
93
  new (): {
@@ -0,0 +1,336 @@
1
+ <script>
2
+ import theme from "#build/ui/navigation-menu";
3
+ </script>
4
+
5
+ <script setup>
6
+ import { createReusableTemplate, reactivePick } from "@vueuse/core";
7
+ import { defu } from "defu";
8
+ import { AccordionContent, AccordionItem, AccordionRoot, AccordionTrigger, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuViewport, useForwardPropsEmits } from "reka-ui";
9
+ import { computed, toRef } from "vue";
10
+ import { useAppConfig } from "#imports";
11
+ import { get, isArrayOfArray, pickLinkProps } from "../utils";
12
+ import { cv, merge } from "../utils/style";
13
+ import Avatar from "./Avatar.vue";
14
+ import Badge from "./Badge.vue";
15
+ import Icon from "./Icon.vue";
16
+ import Link from "./Link.vue";
17
+ import LinkBase from "./LinkBase.vue";
18
+ import Popover from "./Popover.vue";
19
+ import Tooltip from "./Tooltip.vue";
20
+ defineOptions({ inheritAttrs: false });
21
+ const props = defineProps({
22
+ as: { type: null, required: false },
23
+ trailingIcon: { type: [String, Object], required: false },
24
+ externalIcon: { type: [Boolean, String, Object], required: false, default: true },
25
+ items: { type: null, required: false },
26
+ color: { type: null, required: false },
27
+ variant: { type: null, required: false },
28
+ orientation: { type: null, required: false, default: "horizontal" },
29
+ collapsed: { type: Boolean, required: false },
30
+ tooltip: { type: [Boolean, Object], required: false, default: true },
31
+ popover: { type: [Boolean, Object], required: false, default: true },
32
+ highlight: { type: Boolean, required: false },
33
+ highlightColor: { type: null, required: false },
34
+ content: { type: Object, required: false },
35
+ contentOrientation: { type: null, required: false, default: "horizontal" },
36
+ arrow: { type: Boolean, required: false },
37
+ labelKey: { type: null, required: false, default: "label" },
38
+ ui: { type: null, required: false },
39
+ class: { type: [Object, String, Number, Boolean, null, Array], required: false, skipCheck: true },
40
+ modelValue: { type: String, required: false },
41
+ defaultValue: { type: String, required: false },
42
+ delayDuration: { type: Number, required: false, default: 0 },
43
+ disableClickTrigger: { type: Boolean, required: false },
44
+ disableHoverTrigger: { type: Boolean, required: false },
45
+ skipDelayDuration: { type: Number, required: false },
46
+ disablePointerLeaveClose: { type: Boolean, required: false },
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 }
51
+ });
52
+ const emit = defineEmits(["update:modelValue"]);
53
+ const slots = defineSlots();
54
+ const rootProps = useForwardPropsEmits(computed(() => ({
55
+ as: props.as,
56
+ modelValue: props.modelValue,
57
+ defaultValue: props.defaultValue,
58
+ delayDuration: props.delayDuration,
59
+ skipDelayDuration: props.skipDelayDuration,
60
+ orientation: props.orientation,
61
+ disableClickTrigger: props.disableClickTrigger,
62
+ disableHoverTrigger: props.disableHoverTrigger,
63
+ disablePointerLeaveClose: props.disablePointerLeaveClose,
64
+ unmountOnHide: props.unmountOnHide
65
+ })), emit);
66
+ const accordionProps = useForwardPropsEmits(reactivePick(props, "collapsible", "disabled", "type", "unmountOnHide"), emit);
67
+ const contentProps = toRef(() => props.content);
68
+ const tooltipProps = toRef(() => defu(typeof props.tooltip === "boolean" ? {} : props.tooltip, { delayDuration: 0, content: { side: "right" } }));
69
+ const popoverProps = toRef(() => defu(typeof props.popover === "boolean" ? {} : props.popover, { mode: "hover", content: { side: "right", align: "start", alignOffset: 2 } }));
70
+ const [DefineLinkTemplate, ReuseLinkTemplate] = createReusableTemplate();
71
+ const [DefineItemTemplate, ReuseItemTemplate] = createReusableTemplate({
72
+ props: {
73
+ item: Object,
74
+ index: Number,
75
+ level: Number
76
+ }
77
+ });
78
+ const lists = computed(
79
+ () => props.items?.length ? isArrayOfArray(props.items) ? props.items : [props.items] : []
80
+ );
81
+ const appConfig = useAppConfig();
82
+ const ui = computed(() => {
83
+ const styler = cv(merge(theme, appConfig.ui.navigationMenu));
84
+ return styler({
85
+ ...props,
86
+ contentOrientation: props.orientation === "vertical" ? void 0 : props.contentOrientation,
87
+ highlightColor: props.highlightColor || props.color
88
+ });
89
+ });
90
+ function getAccordionDefaultValue(list, level = 0) {
91
+ const indexes = list.reduce((acc, item, index) => {
92
+ if (item.defaultOpen || item.open)
93
+ acc.push(item.value || (level > 0 ? `item-${level}-${index}` : `item-${index}`));
94
+ return acc;
95
+ }, []);
96
+ return props.type === "single" ? indexes[0] : indexes;
97
+ }
98
+ </script>
99
+
100
+ <template>
101
+ <DefineLinkTemplate v-slot="{ item, active, index }">
102
+ <slot :name="item.slot || 'item'" :item="item" :index="index" :active="active" :ui="ui">
103
+ <slot :name="`${item.slot || 'item'}-leading`" :item="item" :active="active" :index="index" :ui="ui">
104
+ <Avatar
105
+ v-if="item.avatar"
106
+ :size="item.ui?.linkLeadingAvatarSize || props.ui?.linkLeadingAvatarSize || ui.linkLeadingAvatarSize()"
107
+ v-bind="item.avatar"
108
+ :class="ui.linkLeadingAvatar({ class: [props.ui?.linkLeadingAvatar, item.ui?.linkLeadingAvatar], active, disabled: item.disabled })"
109
+ data-part="link-leading-avatar"
110
+ />
111
+ <Icon
112
+ v-else-if="item.icon"
113
+ :name="item.icon"
114
+ :class="ui.linkLeadingIcon({ class: [props.ui?.linkLeadingIcon, item.ui?.linkLeadingIcon], active, disabled: !!item.disabled })"
115
+ data-part="link-leading-icon"
116
+ />
117
+ </slot>
118
+
119
+ <span
120
+ v-if="(!props.collapsed || props.orientation !== 'vertical') && (get(item, props.labelKey) || slots[`${item.slot || 'item'}-label`])"
121
+ :class="ui.linkLabel({ class: [props.ui?.linkLabel, item.ui?.linkLabel] })"
122
+ data-part="link-label"
123
+ >
124
+ <slot :name="`${item.slot || 'item'}-label`" :item="item" :active="active" :index="index">
125
+ {{ get(item, props.labelKey) }}
126
+ </slot>
127
+
128
+ <Icon
129
+ v-if="item.target === '_blank' && props.externalIcon !== false"
130
+ :name="typeof props.externalIcon === 'string' ? props.externalIcon : appConfig.ui.icons.external"
131
+ :class="ui.linkLabelExternalIcon({ class: [props.ui?.linkLabelExternalIcon, item.ui?.linkLabelExternalIcon], active })"
132
+ data-part="link-label-external-icon"
133
+ />
134
+ </span>
135
+
136
+ <component
137
+ :is="props.orientation === 'vertical' && item.children?.length && !props.collapsed ? AccordionTrigger : 'span'"
138
+ v-if="(!props.collapsed || props.orientation !== 'vertical') && (item.badge !== void 0 || orientation === 'horizontal' && (item.children?.length || !!slots[`${item.slot || 'item'}-content`]) || orientation === 'vertical' && item.children?.length || item.trailingIcon || !!slots[`${item.slot || 'item'}-trailing`])"
139
+ as="span"
140
+ :class="ui.linkTrailing({ class: [props.ui?.linkTrailing, item.ui?.linkTrailing] })"
141
+ data-part="link-trailing"
142
+ @click.stop.prevent
143
+ >
144
+ <slot :name="`${item.slot || 'item'}-trailing`" :item="item" :active="active" :index="index" :ui="ui">
145
+ <Badge
146
+ v-if="item.badge !== void 0"
147
+ color="neutral"
148
+ variant="outline"
149
+ :size="item.ui?.linkTrailingBadgeSize || props.ui?.linkTrailingBadgeSize || ui.linkTrailingBadgeSize()"
150
+ v-bind="typeof item.badge === 'string' || typeof item.badge === 'number' ? { label: item.badge } : item.badge"
151
+ :class="ui.linkTrailingBadge({ class: [props.ui?.linkTrailingBadge, item.ui?.linkTrailingBadge] })"
152
+ data-part="link-trailing-badge"
153
+ />
154
+
155
+ <Icon
156
+ v-if="orientation === 'horizontal' && (item.children?.length || !!slots[`${item.slot || 'item'}-content`]) || orientation === 'vertical' && item.children?.length"
157
+ :name="item.trailingIcon || props.trailingIcon || appConfig.ui.icons.chevronDown"
158
+ :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })"
159
+ data-part="link-trailing-icon"
160
+ />
161
+ <Icon
162
+ v-else-if="item.trailingIcon"
163
+ :name="item.trailingIcon"
164
+ :class="ui.linkTrailingIcon({ class: [props.ui?.linkTrailingIcon, item.ui?.linkTrailingIcon], active })"
165
+ data-part="link-trailing-icon"
166
+ />
167
+ </slot>
168
+ </component>
169
+ </slot>
170
+ </DefineLinkTemplate>
171
+
172
+ <DefineItemTemplate v-slot="{ item, index, level = 0 }">
173
+ <component
174
+ :is="props.orientation === 'vertical' && !props.collapsed ? AccordionItem : NavigationMenuItem"
175
+ as="li"
176
+ :value="item.value || (level > 0 ? `item-${level}-${index}` : `item-${index}`)"
177
+ >
178
+ <div v-if="props.orientation === 'vertical' && item.type === 'label' && !props.collapsed" :class="ui.label({ class: [props.ui?.label, item.ui?.label, item.class] })" data-part="label">
179
+ <ReuseLinkTemplate :item="item" :index="index" />
180
+ </div>
181
+ <Link
182
+ v-else-if="item.type !== 'label'"
183
+ v-slot="{ active, ...slotProps }"
184
+ v-bind="props.orientation === 'vertical' && item.children?.length && !props.collapsed && item.type === 'trigger' ? {} : pickLinkProps(item)"
185
+ custom
186
+ >
187
+ <component
188
+ :is="
189
+ props.orientation === 'horizontal' && (item.children?.length || slots[`${item.slot || 'item'}-content`]) ? NavigationMenuTrigger : orientation === 'vertical' && item.children?.length && !collapsed && !slotProps.href ? AccordionTrigger : NavigationMenuLink
190
+ "
191
+ :active="active || item.active"
192
+ :disabled="item.disabled"
193
+ as-child
194
+ @select="item.onSelect"
195
+ >
196
+ <Popover
197
+ v-if="props.orientation === 'vertical' && props.collapsed && item.children?.length && (!!props.popover || !!item.popover)"
198
+ v-bind="{ ...popoverProps, ...typeof item.popover === 'boolean' ? {} : item.popover || {} }"
199
+ :ui="{ content: ui.content({ class: [props.ui?.content, item.ui?.content] }) }"
200
+ data-part="content"
201
+ >
202
+ <LinkBase
203
+ v-bind="slotProps"
204
+ :class="ui.link({
205
+ class: [props.ui?.link, item.ui?.link, item.class],
206
+ active: active || item.active,
207
+ disabled: item.disabled,
208
+ level: level > 0
209
+ })"
210
+ data-part="link"
211
+ >
212
+ <ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
213
+ </LinkBase>
214
+
215
+ <template #content="{ close }">
216
+ <slot :name="`${item.slot || 'item'}-content`" :item="item" :active="active || item.active" :index="index" :ui="ui" :close="close">
217
+ <ul :class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })" data-part="child-list">
218
+ <li :class="ui.childLabel({ class: [props.ui?.childLabel, item.ui?.childLabel] })" data-part="child-label">
219
+ {{ get(item, props.labelKey) }}
220
+ </li>
221
+ <li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: [props.ui?.childItem, item.ui?.childItem] })" data-part="child-item">
222
+ <Link v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
223
+ <NavigationMenuLink :active="childActive" as-child @select="childItem.onSelect">
224
+ <LinkBase v-bind="childSlotProps" :class="ui.childLink({ class: [props.ui?.childLink, item.ui?.childLink, childItem.class], active: childActive })" data-part="child-link">
225
+ <Icon v-if="childItem.icon" :name="childItem.icon" :class="ui.childLinkIcon({ class: [props.ui?.childLinkIcon, item.ui?.childLinkIcon], active: childActive })" data-part="child-link-icon" />
226
+
227
+ <span :class="ui.childLinkLabel({ class: [props.ui?.childLinkLabel, item.ui?.childLinkLabel], active: childActive })" data-part="child-link-label">
228
+ {{ get(childItem, props.labelKey) }}
229
+
230
+ <Icon v-if="childItem.target === '_blank' && props.externalIcon !== false" :name="typeof props.externalIcon === 'string' ? props.externalIcon : appConfig.ui.icons.external" :class="ui.childLinkLabelExternalIcon({ class: [props.ui?.childLinkLabelExternalIcon, item.ui?.childLinkLabelExternalIcon], active: childActive })" data-part="child-link-label-external-icon" />
231
+ </span>
232
+ </LinkBase>
233
+ </NavigationMenuLink>
234
+ </Link>
235
+ </li>
236
+ </ul>
237
+ </slot>
238
+ </template>
239
+ </Popover>
240
+ <Tooltip v-else-if="props.orientation === 'vertical' && props.collapsed && (!!props.tooltip || !!item.tooltip)" :text="get(item, props.labelKey)" v-bind="{ ...tooltipProps, ...typeof item.tooltip === 'boolean' ? {} : item.tooltip || {} }">
241
+ <LinkBase 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 })" data-part="link">
242
+ <ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
243
+ </LinkBase>
244
+ </Tooltip>
245
+ <LinkBase v-else v-bind="slotProps" :class="ui.link({ class: [props.ui?.link, item.ui?.link, item.class], active: active || item.active, disabled: item.disabled, level: props.orientation === 'horizontal' || level > 0 })" data-part="link">
246
+ <ReuseLinkTemplate :item="item" :active="active || item.active" :index="index" />
247
+ </LinkBase>
248
+ </component>
249
+
250
+ <NavigationMenuContent
251
+ v-if="props.orientation === 'horizontal' && (item.children?.length || slots[`${item.slot || 'item'}-content`])"
252
+ v-bind="contentProps"
253
+ :class="ui.content({ class: [props.ui?.content, item.ui?.content] })"
254
+ data-part="content"
255
+ >
256
+ <slot :name="`${item.slot || 'item'}-content`" :item="item" :active="active" :index="index" :ui="ui">
257
+ <ul :class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })" data-part="child-list">
258
+ <li v-for="(childItem, childIndex) in item.children" :key="childIndex" :class="ui.childItem({ class: [props.ui?.childItem, item.ui?.childItem] })" data-part="child-item">
259
+ <Link v-slot="{ active: childActive, ...childSlotProps }" v-bind="pickLinkProps(childItem)" custom>
260
+ <NavigationMenuLink :active="childActive" as-child @select="childItem.onSelect">
261
+ <LinkBase v-bind="childSlotProps" :class="ui.childLink({ class: [props.ui?.childLink, item.ui?.childLink, childItem.class], active: childActive })" data-part="child-link">
262
+ <Icon v-if="childItem.icon" :name="childItem.icon" :class="ui.childLinkIcon({ class: [props.ui?.childLinkIcon, item.ui?.childLinkIcon], active: childActive })" data-part="child-link-icon" />
263
+
264
+ <div :class="ui.childLinkWrapper({ class: [props.ui?.childLinkWrapper, item.ui?.childLinkWrapper] })" data-part="child-link-wrapper">
265
+ <p :class="ui.childLinkLabel({ class: [props.ui?.childLinkLabel, item.ui?.childLinkLabel], active: childActive })" data-part="child-link-label">
266
+ {{ get(childItem, props.labelKey) }}
267
+
268
+ <Icon v-if="childItem.target === '_blank' && props.externalIcon !== false" :name="typeof props.externalIcon === 'string' ? props.externalIcon : appConfig.ui.icons.external" :class="ui.childLinkLabelExternalIcon({ class: [props.ui?.childLinkLabelExternalIcon, item.ui?.childLinkLabelExternalIcon], active: childActive })" data-part="child-link-label-external-icon" />
269
+ </p>
270
+ <p v-if="childItem.description" :class="ui.childLinkDescription({ class: [props.ui?.childLinkDescription, item.ui?.childLinkDescription], active: childActive })" data-part="child-link-description">
271
+ {{ childItem.description }}
272
+ </p>
273
+ </div>
274
+ </LinkBase>
275
+ </NavigationMenuLink>
276
+ </Link>
277
+ </li>
278
+ </ul>
279
+ </slot>
280
+ </NavigationMenuContent>
281
+ </Link>
282
+
283
+ <AccordionContent v-if="props.orientation === 'vertical' && item.children?.length && !props.collapsed" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })" data-part="content">
284
+ <AccordionRoot
285
+ v-bind="{ ...accordionProps, defaultValue: getAccordionDefaultValue(item.children, level + 1) }"
286
+ as="ul"
287
+ :class="ui.childList({ class: [props.ui?.childList, item.ui?.childList] })"
288
+ data-part="child-list"
289
+ >
290
+ <ReuseItemTemplate
291
+ v-for="(childItem, childIndex) in item.children"
292
+ :key="childIndex"
293
+ :item="childItem"
294
+ :index="childIndex"
295
+ :level="level + 1"
296
+ :class="ui.childItem({ class: [props.ui?.childItem, item.ui?.childItem] })"
297
+ data-part="child-item"
298
+ />
299
+ </AccordionRoot>
300
+ </AccordionContent>
301
+ </component>
302
+ </DefineItemTemplate>
303
+
304
+ <NavigationMenuRoot
305
+ v-bind="{ ...rootProps, ...$attrs }"
306
+ :class="ui.root({ class: [props.ui?.root, props.class] })"
307
+ :data-collapsed="props.collapsed"
308
+ data-part="root"
309
+ >
310
+ <slot name="list-leading"></slot>
311
+
312
+ <template v-for="(list, listIndex) in lists" :key="`list-${listIndex}`">
313
+ <component
314
+ v-bind="props.orientation === 'vertical' && !props.collapsed ? { ...accordionProps, defaultValue: getAccordionDefaultValue(list) } : {}"
315
+ :is="props.orientation === 'vertical' && !props.collapsed ? AccordionRoot : NavigationMenuList"
316
+ as="ul"
317
+ :class="ui.list({ class: props.ui?.list })"
318
+ data-part="list"
319
+ >
320
+ <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] })" data-part="item" />
321
+ </component>
322
+
323
+ <div v-if="props.orientation === 'vertical' && listIndex < lists.length - 1" :class="ui.separator({ class: props.ui?.separator })" data-part="separator"></div>
324
+ </template>
325
+
326
+ <slot name="list-trailing"></slot>
327
+
328
+ <div v-if="props.orientation === 'horizontal'" :class="ui.viewportWrapper({ class: props.ui?.viewportWrapper })" data-part="viewport-wrapper">
329
+ <NavigationMenuIndicator v-if="props.arrow" :class="ui.indicator({ class: props.ui?.indicator })" data-part="indicator">
330
+ <div :class="ui.arrow({ class: props.ui?.arrow })" data-part="arrow"></div>
331
+ </NavigationMenuIndicator>
332
+
333
+ <NavigationMenuViewport :class="ui.viewport({ class: props.ui?.viewport })" data-part="viewport" />
334
+ </div>
335
+ </NavigationMenuRoot>
336
+ </template>
@@ -0,0 +1,181 @@
1
+ import type { VariantProps } from '@byyuurin/ui-kit';
2
+ import type { AccordionRootProps, NavigationMenuContentEmits, NavigationMenuContentProps, NavigationMenuRootEmits, NavigationMenuRootProps } from 'reka-ui';
3
+ import theme from '#build/ui/navigation-menu';
4
+ import type { AvatarProps, BadgeProps, ComponentBaseProps, ComponentStyler, ComponentUIProps, IconProps, LinkProps, PopoverProps, TooltipProps } from '../types';
5
+ import type { ArrayOrNested, DynamicSlots, EmitsToProps, GetItemKeys, MergeTypes, NestedItem, StaticSlot } from '../types/utils';
6
+ export interface NavigationMenuChildItem extends Omit<NavigationMenuItem, 'type' | 'ui'> {
7
+ /** Description is only used when `orientation` is `horizontal`. */
8
+ description?: string;
9
+ [key: string]: any;
10
+ }
11
+ export interface NavigationMenuItem extends ComponentBaseProps, Omit<LinkProps, 'type' | 'raw' | 'custom'> {
12
+ label?: string;
13
+ icon?: IconProps['name'];
14
+ avatar?: AvatarProps;
15
+ /**
16
+ * Display a chip on the item.
17
+ * `{ size: 'xs', variant: 'outline' }`
18
+ */
19
+ badge?: string | number | BadgeProps;
20
+ /**
21
+ * Display a tooltip on the item when the menu is collapsed with the label of the item.
22
+ *
23
+ * This has priority over the global `tooltip` prop.
24
+ */
25
+ tooltip?: boolean | TooltipProps;
26
+ /**
27
+ * Display a popover on the item when the menu is collapsed with the children list.
28
+ *
29
+ * This has priority over the global `popover` prop.
30
+ */
31
+ popover?: boolean | PopoverProps;
32
+ trailingIcon?: IconProps['name'];
33
+ /**
34
+ * The type of the item.
35
+ *
36
+ * The `label` type is only displayed in `vertical` orientation.
37
+ *
38
+ * The `trigger` type is used to force the item to be collapsible when its a link in `vertical` orientation.
39
+ * @default "link"
40
+ */
41
+ type?: 'label' | 'trigger' | 'link';
42
+ slot?: string;
43
+ /**
44
+ * The value of the item. Avoid using `index` as the value to prevent conflicts in horizontal orientation with Reka UI.
45
+ * @default `item-${index}`
46
+ */
47
+ value?: string;
48
+ children?: NavigationMenuChildItem[];
49
+ defaultOpen?: boolean;
50
+ open?: boolean;
51
+ onSelect?: (e: Event) => void;
52
+ ui?: Pick<ComponentUIProps<typeof theme>, 'item' | 'linkLeadingAvatarSize' | 'linkLeadingAvatar' | 'linkLeadingIcon' | 'linkLabel' | 'linkLabelExternalIcon' | 'linkTrailing' | 'linkTrailingBadgeSize' | 'linkTrailingBadge' | 'linkTrailingIcon' | 'label' | 'link' | 'content' | 'childList' | 'childLabel' | 'childItem' | 'childLink' | 'childLinkIcon' | 'childLinkWrapper' | 'childLinkLabel' | 'childLinkLabelExternalIcon' | 'childLinkDescription'>;
53
+ [key: string]: any;
54
+ }
55
+ type ThemeVariants = VariantProps<typeof theme>;
56
+ export interface NavigationMenuProps<T extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>> extends ComponentBaseProps, Pick<NavigationMenuRootProps, 'modelValue' | 'defaultValue' | 'delayDuration' | 'disableClickTrigger' | 'disableHoverTrigger' | 'skipDelayDuration' | 'disablePointerLeaveClose' | 'unmountOnHide'>, Pick<AccordionRootProps, 'disabled' | 'type' | 'collapsible'> {
57
+ /**
58
+ * The element or component this component should render as.
59
+ * @default "div"
60
+ */
61
+ as?: NavigationMenuRootProps['as'];
62
+ /**
63
+ * The icon displayed to open the menu.
64
+ * @default app.icons.chevronDown
65
+ */
66
+ trailingIcon?: IconProps['name'];
67
+ /**
68
+ * The icon displayed when the item is an external link.
69
+ * Set to `false` to hide the external icon.
70
+ * @default app.icons.external
71
+ */
72
+ externalIcon?: boolean | IconProps['name'];
73
+ items?: T;
74
+ /** @default "primary" */
75
+ color?: ThemeVariants['color'];
76
+ /** @default "pill" */
77
+ variant?: ThemeVariants['variant'];
78
+ /**
79
+ * The orientation of the menu.
80
+ * @default "horizontal"
81
+ */
82
+ orientation?: NavigationMenuRootProps['orientation'];
83
+ /**
84
+ * Collapse the navigation menu to only show icons.
85
+ * Only works when `orientation` is `vertical`.
86
+ * @default false
87
+ */
88
+ collapsed?: boolean;
89
+ /**
90
+ * Display a tooltip on the items when the menu is collapsed with the label of the item.
91
+ * @default true
92
+ */
93
+ tooltip?: boolean | TooltipProps;
94
+ /**
95
+ * Display a popover on the items when the menu is collapsed with the children list.
96
+ * @default true
97
+ */
98
+ popover?: boolean | PopoverProps;
99
+ /** Display a line next to the active item. */
100
+ highlight?: boolean;
101
+ /** @default "primary" */
102
+ highlightColor?: ThemeVariants['color'];
103
+ /** The content of the menu. */
104
+ content?: Omit<NavigationMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<NavigationMenuContentEmits>>;
105
+ /**
106
+ * The orientation of the content.
107
+ * Only works when `orientation` is `horizontal`.
108
+ * @default "horizontal"
109
+ */
110
+ contentOrientation?: ThemeVariants['contentOrientation'];
111
+ /**
112
+ * Display an arrow alongside the menu.
113
+ * @default false
114
+ */
115
+ arrow?: boolean;
116
+ /**
117
+ * The key used to get the label from the item.
118
+ * @default "label"
119
+ */
120
+ labelKey?: GetItemKeys<T>;
121
+ ui?: ComponentUIProps<typeof theme>;
122
+ }
123
+ export interface NavigationMenuEmits extends NavigationMenuRootEmits {
124
+ }
125
+ export type NavigationMenuSlots<A extends ArrayOrNested<NavigationMenuItem> = ArrayOrNested<NavigationMenuItem>, T extends NestedItem<A> = NestedItem<A>> = {
126
+ 'item': StaticSlot<{
127
+ item: T;
128
+ index: number;
129
+ active: boolean;
130
+ ui: ComponentStyler<typeof theme>;
131
+ }>;
132
+ 'item-leading': StaticSlot<{
133
+ item: T;
134
+ index: number;
135
+ active: boolean;
136
+ ui: ComponentStyler<typeof theme>;
137
+ }>;
138
+ 'item-label': StaticSlot<{
139
+ item: T;
140
+ index: number;
141
+ active: boolean;
142
+ }>;
143
+ 'item-trailing': StaticSlot<{
144
+ item: T;
145
+ index: number;
146
+ active: boolean;
147
+ ui: ComponentStyler<typeof theme>;
148
+ }>;
149
+ 'item-content': StaticSlot<{
150
+ item: T;
151
+ index: number;
152
+ active: boolean;
153
+ ui: ComponentStyler<typeof theme>;
154
+ close: () => void;
155
+ }>;
156
+ 'list-leading': StaticSlot;
157
+ 'list-trailing': StaticSlot;
158
+ } & DynamicSlots<MergeTypes<T>, 'label', {
159
+ index: number;
160
+ active: boolean;
161
+ }> & DynamicSlots<MergeTypes<T>, 'leading' | 'trailing' | 'content', {
162
+ index: number;
163
+ active: boolean;
164
+ ui: ComponentStyler<typeof theme>;
165
+ }>;
166
+ declare const __VLS_export: <T extends ArrayOrNested<NavigationMenuItem>>(__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<{
167
+ props: __VLS_PrettifyLocal<NavigationMenuProps<T> & {
168
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
169
+ }> & import("vue").PublicProps;
170
+ expose: (exposed: {}) => void;
171
+ attrs: any;
172
+ slots: NavigationMenuSlots<T, NestedItem<T>>;
173
+ emit: (evt: "update:modelValue", value: string) => void;
174
+ }>) => import("vue").VNode & {
175
+ __ctx?: Awaited<typeof __VLS_setup>;
176
+ };
177
+ declare const _default: typeof __VLS_export;
178
+ export default _default;
179
+ type __VLS_PrettifyLocal<T> = {
180
+ [K in keyof T as K]: T[K];
181
+ } & {};
@@ -3,7 +3,7 @@ import { computed } from "vue";
3
3
  import { useOverlay } from "../composables/useOverlay";
4
4
  const { overlays, unmount, close } = useOverlay();
5
5
  const mountedOverlays = computed(() => overlays.filter((overlay) => overlay.isMounted));
6
- function onOverlayUnmount(id) {
6
+ function onAfterLeave(id) {
7
7
  close(id);
8
8
  unmount(id);
9
9
  }
@@ -18,8 +18,8 @@ function onClose(id, value) {
18
18
  v-for="overlay in mountedOverlays"
19
19
  :key="overlay.id"
20
20
  v-bind="overlay.props"
21
- v-model:open="overlay.modelValue"
21
+ v-model:open="overlay.isOpen"
22
22
  @close="onClose(overlay.id, $event)"
23
- @after-leave="onOverlayUnmount(overlay.id)"
23
+ @after-leave="onAfterLeave(overlay.id)"
24
24
  />
25
25
  </template>