@nuxt/ui 3.0.2 → 3.1.1

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 (221) hide show
  1. package/.nuxt/ui/accordion.ts +2 -2
  2. package/.nuxt/ui/alert.ts +29 -29
  3. package/.nuxt/ui/avatar-group.ts +1 -1
  4. package/.nuxt/ui/avatar.ts +3 -3
  5. package/.nuxt/ui/badge.ts +33 -33
  6. package/.nuxt/ui/breadcrumb.ts +5 -5
  7. package/.nuxt/ui/button.ts +43 -43
  8. package/.nuxt/ui/calendar.ts +17 -17
  9. package/.nuxt/ui/card.ts +5 -5
  10. package/.nuxt/ui/carousel.ts +6 -6
  11. package/.nuxt/ui/checkbox-group.ts +61 -0
  12. package/.nuxt/ui/checkbox.ts +140 -27
  13. package/.nuxt/ui/chip.ts +8 -8
  14. package/.nuxt/ui/color-picker.ts +3 -3
  15. package/.nuxt/ui/command-palette.ts +14 -14
  16. package/.nuxt/ui/context-menu.ts +33 -33
  17. package/.nuxt/ui/drawer.ts +10 -10
  18. package/.nuxt/ui/dropdown-menu.ts +34 -34
  19. package/.nuxt/ui/form-field.ts +6 -6
  20. package/.nuxt/ui/index.ts +1 -0
  21. package/.nuxt/ui/input-menu.ts +42 -42
  22. package/.nuxt/ui/input-number.ts +20 -20
  23. package/.nuxt/ui/input.ts +23 -23
  24. package/.nuxt/ui/kbd.ts +4 -4
  25. package/.nuxt/ui/link.ts +3 -3
  26. package/.nuxt/ui/modal.ts +5 -5
  27. package/.nuxt/ui/navigation-menu.ts +78 -80
  28. package/.nuxt/ui/pin-input.ts +20 -20
  29. package/.nuxt/ui/popover.ts +2 -2
  30. package/.nuxt/ui/progress.ts +17 -17
  31. package/.nuxt/ui/radio-group.ts +250 -35
  32. package/.nuxt/ui/select-menu.ts +36 -33
  33. package/.nuxt/ui/select.ts +32 -32
  34. package/.nuxt/ui/separator.ts +8 -8
  35. package/.nuxt/ui/skeleton.ts +1 -1
  36. package/.nuxt/ui/slideover.ts +4 -4
  37. package/.nuxt/ui/slider.ts +16 -16
  38. package/.nuxt/ui/stepper.ts +18 -18
  39. package/.nuxt/ui/switch.ts +20 -20
  40. package/.nuxt/ui/table.ts +15 -15
  41. package/.nuxt/ui/tabs.ts +32 -32
  42. package/.nuxt/ui/textarea.ts +40 -35
  43. package/.nuxt/ui/toast.ts +24 -24
  44. package/.nuxt/ui/tooltip.ts +2 -2
  45. package/.nuxt/ui/tree.ts +18 -18
  46. package/.nuxt/ui.css +63 -12
  47. package/README.md +15 -0
  48. package/cli/templates.mjs +18 -17
  49. package/dist/module.json +5 -5
  50. package/dist/module.mjs +12 -7
  51. package/dist/runtime/components/Accordion.vue +36 -93
  52. package/dist/runtime/components/Accordion.vue.d.ts +75 -0
  53. package/dist/runtime/components/Alert.vue +37 -100
  54. package/dist/runtime/components/Alert.vue.d.ts +81 -0
  55. package/dist/runtime/components/App.vue +28 -34
  56. package/dist/runtime/components/App.vue.d.ts +24 -0
  57. package/dist/runtime/components/Avatar.vue +42 -75
  58. package/dist/runtime/components/Avatar.vue.d.ts +39 -0
  59. package/dist/runtime/components/AvatarGroup.vue +40 -77
  60. package/dist/runtime/components/AvatarGroup.vue.d.ts +31 -0
  61. package/dist/runtime/components/Badge.vue +33 -62
  62. package/dist/runtime/components/Badge.vue.d.ts +41 -0
  63. package/dist/runtime/components/Breadcrumb.vue +37 -90
  64. package/dist/runtime/components/Breadcrumb.vue.d.ts +64 -0
  65. package/dist/runtime/components/Button.vue +95 -104
  66. package/dist/runtime/components/Button.vue.d.ts +48 -0
  67. package/dist/runtime/components/ButtonGroup.vue +20 -46
  68. package/dist/runtime/components/ButtonGroup.vue.d.ts +34 -0
  69. package/dist/runtime/components/Calendar.vue +67 -150
  70. package/dist/runtime/components/Calendar.vue.d.ts +111 -0
  71. package/dist/runtime/components/Card.vue +18 -40
  72. package/dist/runtime/components/Card.vue.d.ts +29 -0
  73. package/dist/runtime/components/Carousel.vue +112 -234
  74. package/dist/runtime/components/Carousel.vue.d.ts +122 -0
  75. package/dist/runtime/components/Checkbox.vue +52 -93
  76. package/dist/runtime/components/Checkbox.vue.d.ts +73 -0
  77. package/dist/runtime/components/CheckboxGroup.vue +121 -0
  78. package/dist/runtime/components/CheckboxGroup.vue.d.ts +78 -0
  79. package/dist/runtime/components/Chip.vue +26 -69
  80. package/dist/runtime/components/Chip.vue.d.ts +57 -0
  81. package/dist/runtime/components/Collapsible.vue +22 -41
  82. package/dist/runtime/components/Collapsible.vue.d.ts +35 -0
  83. package/dist/runtime/components/ColorPicker.vue +111 -197
  84. package/dist/runtime/components/ColorPicker.vue.d.ts +48 -0
  85. package/dist/runtime/components/CommandPalette.vue +96 -237
  86. package/dist/runtime/components/CommandPalette.vue.d.ts +161 -0
  87. package/dist/runtime/components/Container.vue +15 -28
  88. package/dist/runtime/components/Container.vue.d.ts +18 -0
  89. package/dist/runtime/components/ContextMenu.vue +34 -133
  90. package/dist/runtime/components/ContextMenu.vue.d.ts +107 -0
  91. package/dist/runtime/components/ContextMenuContent.vue +73 -81
  92. package/dist/runtime/components/ContextMenuContent.vue.d.ts +65 -0
  93. package/dist/runtime/components/Drawer.vue +49 -83
  94. package/dist/runtime/components/Drawer.vue.d.ts +78 -0
  95. package/dist/runtime/components/DropdownMenu.vue +39 -142
  96. package/dist/runtime/components/DropdownMenu.vue.d.ts +117 -0
  97. package/dist/runtime/components/DropdownMenuContent.vue +78 -88
  98. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +68 -0
  99. package/dist/runtime/components/Form.vue +135 -220
  100. package/dist/runtime/components/Form.vue.d.ts +69 -0
  101. package/dist/runtime/components/FormField.vue +35 -77
  102. package/dist/runtime/components/FormField.vue.d.ts +61 -0
  103. package/dist/runtime/components/Icon.vue +12 -19
  104. package/dist/runtime/components/Icon.vue.d.ts +8 -0
  105. package/dist/runtime/components/Input.vue +82 -140
  106. package/dist/runtime/components/Input.vue.d.ts +76 -0
  107. package/dist/runtime/components/InputMenu.vue +185 -332
  108. package/dist/runtime/components/InputMenu.vue.d.ts +324 -0
  109. package/dist/runtime/components/InputNumber.vue +71 -133
  110. package/dist/runtime/components/InputNumber.vue.d.ts +182 -0
  111. package/dist/runtime/components/Kbd.vue +20 -46
  112. package/dist/runtime/components/Kbd.vue.d.ts +34 -0
  113. package/dist/runtime/components/Link.vue +98 -176
  114. package/dist/runtime/components/Link.vue.d.ts +93 -0
  115. package/dist/runtime/components/LinkBase.vue +33 -42
  116. package/dist/runtime/components/LinkBase.vue.d.ts +25 -0
  117. package/dist/runtime/components/Modal.vue +53 -116
  118. package/dist/runtime/components/Modal.vue.d.ts +93 -0
  119. package/dist/runtime/components/NavigationMenu.vue +77 -209
  120. package/dist/runtime/components/NavigationMenu.vue.d.ts +139 -0
  121. package/dist/runtime/components/OverlayProvider.vue +14 -18
  122. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  123. package/dist/runtime/components/Pagination.vue +46 -140
  124. package/dist/runtime/components/Pagination.vue.d.ts +119 -0
  125. package/dist/runtime/components/PinInput.vue +61 -78
  126. package/dist/runtime/components/PinInput.vue.d.ts +57 -0
  127. package/dist/runtime/components/Popover.vue +47 -84
  128. package/dist/runtime/components/Popover.vue.d.ts +63 -0
  129. package/dist/runtime/components/Progress.vue +70 -131
  130. package/dist/runtime/components/Progress.vue.d.ts +66 -0
  131. package/dist/runtime/components/RadioGroup.vue +70 -132
  132. package/dist/runtime/components/RadioGroup.vue.d.ts +91 -0
  133. package/dist/runtime/components/Select.vue +110 -224
  134. package/dist/runtime/components/Select.vue.d.ts +145 -0
  135. package/dist/runtime/components/SelectMenu.vue +161 -310
  136. package/dist/runtime/components/SelectMenu.vue.d.ts +196 -0
  137. package/dist/runtime/components/Separator.vue +29 -71
  138. package/dist/runtime/components/Separator.vue.d.ts +54 -0
  139. package/dist/runtime/components/Skeleton.vue +21 -23
  140. package/dist/runtime/components/Skeleton.vue.d.ts +17 -0
  141. package/dist/runtime/components/Slideover.vue +53 -120
  142. package/dist/runtime/components/Slideover.vue.d.ts +94 -0
  143. package/dist/runtime/components/Slider.vue +46 -84
  144. package/dist/runtime/components/Slider.vue.d.ts +52 -0
  145. package/dist/runtime/components/Stepper.vue +45 -115
  146. package/dist/runtime/components/Stepper.vue.d.ts +83 -0
  147. package/dist/runtime/components/Switch.vue +45 -93
  148. package/dist/runtime/components/Switch.vue.d.ts +70 -0
  149. package/dist/runtime/components/Table.vue +163 -267
  150. package/dist/runtime/components/Table.vue.d.ts +183 -0
  151. package/dist/runtime/components/Tabs.vue +41 -107
  152. package/dist/runtime/components/Tabs.vue.d.ts +88 -0
  153. package/dist/runtime/components/Textarea.vue +113 -158
  154. package/dist/runtime/components/Textarea.vue.d.ts +78 -0
  155. package/dist/runtime/components/Toast.vue +49 -110
  156. package/dist/runtime/components/Toast.vue.d.ts +157 -0
  157. package/dist/runtime/components/Toaster.vue +70 -107
  158. package/dist/runtime/components/Toaster.vue.d.ts +38 -0
  159. package/dist/runtime/components/Tooltip.vue +38 -65
  160. package/dist/runtime/components/Tooltip.vue.d.ts +50 -0
  161. package/dist/runtime/components/Tree.vue +59 -166
  162. package/dist/runtime/components/Tree.vue.d.ts +111 -0
  163. package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
  164. package/dist/runtime/composables/defineShortcuts.js +6 -0
  165. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  166. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  167. package/dist/runtime/composables/useFormField.d.ts +2 -2
  168. package/dist/runtime/composables/useKbd.d.ts +1 -0
  169. package/dist/runtime/composables/useKbd.js +4 -3
  170. package/dist/runtime/composables/useOverlay.d.ts +14 -8
  171. package/dist/runtime/composables/useOverlay.js +20 -7
  172. package/dist/runtime/composables/usePortal.d.ts +6 -0
  173. package/dist/runtime/composables/usePortal.js +17 -0
  174. package/dist/runtime/index.css +1 -1
  175. package/dist/runtime/inertia/components/Link.vue +146 -0
  176. package/dist/runtime/inertia/components/Link.vue.d.ts +63 -0
  177. package/dist/runtime/inertia/stubs.d.ts +43 -0
  178. package/dist/runtime/inertia/stubs.js +82 -0
  179. package/dist/runtime/locale/bg.d.ts +3 -0
  180. package/dist/runtime/locale/bg.js +54 -0
  181. package/dist/runtime/locale/index.d.ts +5 -1
  182. package/dist/runtime/locale/index.js +5 -1
  183. package/dist/runtime/locale/kk.d.ts +3 -0
  184. package/dist/runtime/locale/kk.js +54 -0
  185. package/dist/runtime/locale/tj.d.ts +3 -0
  186. package/dist/runtime/locale/tj.js +54 -0
  187. package/dist/runtime/locale/ug_cn.d.ts +3 -0
  188. package/dist/runtime/locale/ug_cn.js +55 -0
  189. package/dist/runtime/types/form.d.ts +4 -1
  190. package/dist/runtime/types/index.d.ts +1 -0
  191. package/dist/runtime/types/index.js +1 -0
  192. package/dist/runtime/types/tv.d.ts +53 -0
  193. package/dist/runtime/types/tv.js +0 -0
  194. package/dist/runtime/types/utils.d.ts +7 -17
  195. package/dist/runtime/types/utils.js +1 -0
  196. package/dist/runtime/utils/link.d.ts +3 -3
  197. package/dist/runtime/utils/link.js +1 -0
  198. package/dist/runtime/utils/tv.js +2 -2
  199. package/dist/runtime/vue/components/Icon.vue +7 -8
  200. package/dist/runtime/vue/components/Icon.vue.d.ts +5 -0
  201. package/dist/runtime/vue/components/Link.vue +118 -202
  202. package/dist/runtime/vue/components/Link.vue.d.ts +93 -0
  203. package/dist/runtime/vue/stubs.d.ts +2 -2
  204. package/dist/shared/{ui.BkNUP964.mjs → ui.CbtTMMzt.mjs} +631 -366
  205. package/dist/types.d.mts +3 -5
  206. package/dist/unplugin.d.mts +6 -2
  207. package/dist/unplugin.mjs +25 -4
  208. package/dist/vite.d.mts +1 -1
  209. package/dist/vite.mjs +2 -2
  210. package/package.json +96 -54
  211. package/dist/module.cjs +0 -62
  212. package/dist/module.d.cts +0 -45
  213. package/dist/module.d.ts +0 -45
  214. package/dist/shared/ui.BL-XB3u1.cjs +0 -3555
  215. package/dist/types.d.ts +0 -7
  216. package/dist/unplugin.cjs +0 -232
  217. package/dist/unplugin.d.cts +0 -62
  218. package/dist/unplugin.d.ts +0 -62
  219. package/dist/vite.cjs +0 -23
  220. package/dist/vite.d.cts +0 -15
  221. package/dist/vite.d.ts +0 -15
@@ -0,0 +1,196 @@
1
+ import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxContentEmits, ComboboxArrowProps } from 'reka-ui';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import theme from '#build/ui/select-menu';
4
+ import type { UseComponentIconsProps } from '../composables/useComponentIcons';
5
+ import type { AvatarProps, ChipProps, InputProps } from '../types';
6
+ import type { AcceptableValue, ArrayOrNested, GetItemKeys, GetModelValue, GetModelValueEmits, NestedItem, EmitsToProps, ComponentConfig } from '../types/utils';
7
+ type SelectMenu = ComponentConfig<typeof theme, AppConfig, 'selectMenu'>;
8
+ interface _SelectMenuItem {
9
+ label?: string;
10
+ /**
11
+ * @IconifyIcon
12
+ */
13
+ icon?: string;
14
+ avatar?: AvatarProps;
15
+ chip?: ChipProps;
16
+ /**
17
+ * The item type.
18
+ * @defaultValue 'item'
19
+ */
20
+ type?: 'label' | 'separator' | 'item';
21
+ disabled?: boolean;
22
+ onSelect?(e?: Event): void;
23
+ [key: string]: any;
24
+ }
25
+ export type SelectMenuItem = _SelectMenuItem | AcceptableValue | boolean;
26
+ export interface SelectMenuProps<T extends ArrayOrNested<SelectMenuItem> = ArrayOrNested<SelectMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false> extends Pick<ComboboxRootProps<T>, 'open' | 'defaultOpen' | 'disabled' | 'name' | 'resetSearchTermOnBlur' | 'resetSearchTermOnSelect' | 'highlightOnHover'>, UseComponentIconsProps {
27
+ id?: string;
28
+ /** The placeholder text when the select is empty. */
29
+ placeholder?: string;
30
+ /**
31
+ * Whether to display the search input or not.
32
+ * Can be an object to pass additional props to the input.
33
+ * `{ placeholder: 'Search...', variant: 'none' }`{lang="ts-type"}
34
+ * @defaultValue true
35
+ */
36
+ searchInput?: boolean | InputProps;
37
+ /**
38
+ * @defaultValue 'primary'
39
+ */
40
+ color?: SelectMenu['variants']['color'];
41
+ /**
42
+ * @defaultValue 'outline'
43
+ */
44
+ variant?: SelectMenu['variants']['variant'];
45
+ /**
46
+ * @defaultValue 'md'
47
+ */
48
+ size?: SelectMenu['variants']['size'];
49
+ required?: boolean;
50
+ /**
51
+ * The icon displayed to open the menu.
52
+ * @defaultValue appConfig.ui.icons.chevronDown
53
+ * @IconifyIcon
54
+ */
55
+ trailingIcon?: string;
56
+ /**
57
+ * The icon displayed when an item is selected.
58
+ * @defaultValue appConfig.ui.icons.check
59
+ * @IconifyIcon
60
+ */
61
+ selectedIcon?: string;
62
+ /**
63
+ * The content of the menu.
64
+ * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }
65
+ */
66
+ content?: Omit<ComboboxContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<ComboboxContentEmits>>;
67
+ /**
68
+ * Display an arrow alongside the menu.
69
+ * @defaultValue false
70
+ * @IconifyIcon
71
+ */
72
+ arrow?: boolean | Omit<ComboboxArrowProps, 'as' | 'asChild'>;
73
+ /**
74
+ * Render the menu in a portal.
75
+ * @defaultValue true
76
+ */
77
+ portal?: boolean | string | HTMLElement;
78
+ /**
79
+ * When `items` is an array of objects, select the field to use as the value instead of the object itself.
80
+ * @defaultValue undefined
81
+ */
82
+ valueKey?: VK;
83
+ /**
84
+ * When `items` is an array of objects, select the field to use as the label.
85
+ * @defaultValue 'label'
86
+ */
87
+ labelKey?: keyof NestedItem<T>;
88
+ items?: T;
89
+ /** The value of the SelectMenu when initially rendered. Use when you do not need to control the state of the SelectMenu. */
90
+ defaultValue?: GetModelValue<T, VK, M>;
91
+ /** The controlled value of the SelectMenu. Can be binded-with with `v-model`. */
92
+ modelValue?: GetModelValue<T, VK, M>;
93
+ /** Whether multiple options can be selected or not. */
94
+ multiple?: M & boolean;
95
+ /** Highlight the ring color like a focus state. */
96
+ highlight?: boolean;
97
+ /**
98
+ * Determines if custom user input that does not exist in options can be added.
99
+ * @defaultValue false
100
+ */
101
+ createItem?: boolean | 'always' | {
102
+ position?: 'top' | 'bottom';
103
+ when?: 'empty' | 'always';
104
+ };
105
+ /**
106
+ * Fields to filter items by.
107
+ * @defaultValue [labelKey]
108
+ */
109
+ filterFields?: string[];
110
+ /**
111
+ * When `true`, disable the default filters, useful for custom filtering (useAsyncData, useFetch, etc.).
112
+ * @defaultValue false
113
+ */
114
+ ignoreFilter?: boolean;
115
+ class?: any;
116
+ ui?: SelectMenu['slots'];
117
+ }
118
+ export type SelectMenuEmits<A extends ArrayOrNested<SelectMenuItem>, VK extends GetItemKeys<A> | undefined, M extends boolean> = Pick<ComboboxRootEmits, 'update:open'> & {
119
+ change: [payload: Event];
120
+ blur: [payload: FocusEvent];
121
+ focus: [payload: FocusEvent];
122
+ create: [item: string];
123
+ /** Event handler when highlighted element changes. */
124
+ highlight: [
125
+ payload: {
126
+ ref: HTMLElement;
127
+ value: GetModelValue<A, VK, M>;
128
+ } | undefined
129
+ ];
130
+ } & GetModelValueEmits<A, VK, M>;
131
+ type SlotProps<T extends SelectMenuItem> = (props: {
132
+ item: T;
133
+ index: number;
134
+ }) => any;
135
+ export interface SelectMenuSlots<A extends ArrayOrNested<SelectMenuItem> = ArrayOrNested<SelectMenuItem>, VK extends GetItemKeys<A> | undefined = undefined, M extends boolean = false, T extends NestedItem<A> = NestedItem<A>> {
136
+ 'leading'(props: {
137
+ modelValue?: GetModelValue<A, VK, M>;
138
+ open: boolean;
139
+ ui: {
140
+ [K in keyof Required<SelectMenu['slots']>]: (props?: Record<string, any>) => string;
141
+ };
142
+ }): any;
143
+ 'default'(props: {
144
+ modelValue?: GetModelValue<A, VK, M>;
145
+ open: boolean;
146
+ }): any;
147
+ 'trailing'(props: {
148
+ modelValue?: GetModelValue<A, VK, M>;
149
+ open: boolean;
150
+ ui: {
151
+ [K in keyof Required<SelectMenu['slots']>]: (props?: Record<string, any>) => string;
152
+ };
153
+ }): any;
154
+ 'empty'(props: {
155
+ searchTerm?: string;
156
+ }): any;
157
+ 'item': SlotProps<T>;
158
+ 'item-leading': SlotProps<T>;
159
+ 'item-label': SlotProps<T>;
160
+ 'item-trailing': SlotProps<T>;
161
+ 'content-top': (props?: {}) => any;
162
+ 'content-bottom': (props?: {}) => any;
163
+ 'create-item-label'(props: {
164
+ item: string;
165
+ }): any;
166
+ }
167
+ declare const _default: <T extends ArrayOrNested<SelectMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false>(__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<{
168
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
169
+ readonly onBlur?: ((payload: FocusEvent) => any) | undefined;
170
+ readonly onChange?: ((payload: Event) => any) | undefined;
171
+ readonly onFocus?: ((payload: FocusEvent) => any) | undefined;
172
+ readonly onCreate?: ((item: string) => any) | undefined;
173
+ readonly "onUpdate:open"?: ((value: boolean) => any) | undefined;
174
+ readonly "onUpdate:modelValue"?: ((payload: GetModelValue<T, VK, M>) => any) | undefined;
175
+ readonly onHighlight?: ((payload: {
176
+ ref: HTMLElement;
177
+ value: GetModelValue<T, VK, M>;
178
+ } | undefined) => any) | undefined;
179
+ readonly "onUpdate:searchTerm"?: ((value: string) => any) | undefined;
180
+ } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onFocus" | "onBlur" | "onChange" | "onUpdate:open" | "onUpdate:modelValue" | "onHighlight" | "onUpdate:searchTerm" | "onCreate"> & (SelectMenuProps<T, VK, M> & {
181
+ searchTerm?: string;
182
+ }) & Partial<{}>> & import("vue").PublicProps;
183
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
184
+ attrs: any;
185
+ slots: SelectMenuSlots<T, VK, M, NestedItem<T>>;
186
+ emit: (((evt: "blur", payload: FocusEvent) => void) & ((evt: "change", payload: Event) => void) & ((evt: "focus", payload: FocusEvent) => void) & ((evt: "create", item: string) => void) & ((evt: "update:open", value: boolean) => void) & ((evt: "update:modelValue", payload: GetModelValue<T, VK, M>) => void) & ((evt: "highlight", payload: {
187
+ ref: HTMLElement;
188
+ value: GetModelValue<T, VK, M>;
189
+ } | undefined) => void)) & ((evt: "update:searchTerm", value: string) => void);
190
+ }>) => import("vue").VNode & {
191
+ __ctx?: Awaited<typeof __VLS_setup>;
192
+ };
193
+ export default _default;
194
+ type __VLS_PrettifyLocal<T> = {
195
+ [K in keyof T]: T[K];
196
+ } & {};
@@ -1,79 +1,37 @@
1
- <script lang="ts">
2
- import type { VariantProps } from 'tailwind-variants'
3
- import type { SeparatorProps as _SeparatorProps } from 'reka-ui'
4
- import type { AppConfig } from '@nuxt/schema'
5
- import _appConfig from '#build/app.config'
6
- import theme from '#build/ui/separator'
7
- import { tv } from '../utils/tv'
8
- import type { AvatarProps } from '../types'
9
-
10
- const appConfigSeparator = _appConfig as AppConfig & { ui: { separator: Partial<typeof theme> } }
11
-
12
- const separator = tv({ extend: tv(theme), ...(appConfigSeparator.ui?.separator || {}) })
13
-
14
- type SeparatorVariants = VariantProps<typeof separator>
15
-
16
- export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
17
- /**
18
- * The element or component this component should render as.
19
- * @defaultValue 'div'
20
- */
21
- as?: any
22
- /** Display a label in the middle. */
23
- label?: string
24
- /**
25
- * Display an icon in the middle.
26
- * @IconifyIcon
27
- */
28
- icon?: string
29
- /** Display an avatar in the middle. */
30
- avatar?: AvatarProps
31
- /**
32
- * @defaultValue 'neutral'
33
- */
34
- color?: SeparatorVariants['color']
35
- /**
36
- * @defaultValue 'xs'
37
- */
38
- size?: SeparatorVariants['size']
39
- /**
40
- * @defaultValue 'solid'
41
- */
42
- type?: SeparatorVariants['type']
43
- /**
44
- * The orientation of the separator.
45
- * @defaultValue 'horizontal'
46
- */
47
- orientation?: _SeparatorProps['orientation']
48
- class?: any
49
- ui?: Partial<typeof separator.slots>
50
- }
51
-
52
- export interface SeparatorSlots {
53
- default(props?: {}): any
54
- }
1
+ <script>
2
+ import theme from "#build/ui/separator";
55
3
  </script>
56
4
 
57
- <script setup lang="ts">
58
- import { computed } from 'vue'
59
- import { Separator, useForwardProps } from 'reka-ui'
60
- import { reactivePick } from '@vueuse/core'
61
- import UIcon from './Icon.vue'
62
- import UAvatar from './Avatar.vue'
63
-
64
- const props = withDefaults(defineProps<SeparatorProps>(), {
65
- orientation: 'horizontal'
66
- })
67
- const slots = defineSlots<SeparatorSlots>()
68
-
69
- const rootProps = useForwardProps(reactivePick(props, 'as', 'decorative', 'orientation'))
70
-
71
- const ui = computed(() => separator({
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { Separator, useForwardProps } from "reka-ui";
8
+ import { reactivePick } from "@vueuse/core";
9
+ import { useAppConfig } from "#imports";
10
+ import { tv } from "../utils/tv";
11
+ import UIcon from "./Icon.vue";
12
+ import UAvatar from "./Avatar.vue";
13
+ const props = defineProps({
14
+ as: { type: null, required: false },
15
+ label: { type: String, required: false },
16
+ icon: { type: String, required: false },
17
+ avatar: { type: Object, required: false },
18
+ color: { type: null, required: false },
19
+ size: { type: null, required: false },
20
+ type: { type: null, required: false },
21
+ orientation: { type: null, required: false, default: "horizontal" },
22
+ class: { type: null, required: false },
23
+ ui: { type: null, required: false },
24
+ decorative: { type: Boolean, required: false }
25
+ });
26
+ const slots = defineSlots();
27
+ const appConfig = useAppConfig();
28
+ const rootProps = useForwardProps(reactivePick(props, "as", "decorative", "orientation"));
29
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.separator || {} })({
72
30
  color: props.color,
73
31
  orientation: props.orientation,
74
32
  size: props.size,
75
33
  type: props.type
76
- }))
34
+ }));
77
35
  </script>
78
36
 
79
37
  <template>
@@ -85,7 +43,7 @@ const ui = computed(() => separator({
85
43
  <slot>
86
44
  <span v-if="label" :class="ui.label({ class: props.ui?.label })">{{ label }}</span>
87
45
  <UIcon v-else-if="icon" :name="icon" :class="ui.icon({ class: props.ui?.icon })" />
88
- <UAvatar v-else-if="avatar" :size="((props.ui?.avatarSize || ui.avatarSize()) as AvatarProps['size'])" v-bind="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
46
+ <UAvatar v-else-if="avatar" :size="props.ui?.avatarSize || ui.avatarSize()" v-bind="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
89
47
  </slot>
90
48
  </div>
91
49
 
@@ -0,0 +1,54 @@
1
+ import { Separator } from 'reka-ui';
2
+ import type { SeparatorProps as _SeparatorProps } from 'reka-ui';
3
+ import type { AppConfig } from '@nuxt/schema';
4
+ import theme from '#build/ui/separator';
5
+ import type { AvatarProps } from '../types';
6
+ import type { ComponentConfig } from '../types/utils';
7
+ type Separator = ComponentConfig<typeof theme, AppConfig, 'separator'>;
8
+ export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
9
+ /**
10
+ * The element or component this component should render as.
11
+ * @defaultValue 'div'
12
+ */
13
+ as?: any;
14
+ /** Display a label in the middle. */
15
+ label?: string;
16
+ /**
17
+ * Display an icon in the middle.
18
+ * @IconifyIcon
19
+ */
20
+ icon?: string;
21
+ /** Display an avatar in the middle. */
22
+ avatar?: AvatarProps;
23
+ /**
24
+ * @defaultValue 'neutral'
25
+ */
26
+ color?: Separator['variants']['color'];
27
+ /**
28
+ * @defaultValue 'xs'
29
+ */
30
+ size?: Separator['variants']['size'];
31
+ /**
32
+ * @defaultValue 'solid'
33
+ */
34
+ type?: Separator['variants']['type'];
35
+ /**
36
+ * The orientation of the separator.
37
+ * @defaultValue 'horizontal'
38
+ */
39
+ orientation?: _SeparatorProps['orientation'];
40
+ class?: any;
41
+ ui?: Separator['slots'];
42
+ }
43
+ export interface SeparatorSlots {
44
+ default(props?: {}): any;
45
+ }
46
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SeparatorProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SeparatorProps> & Readonly<{}>, {
47
+ orientation: "horizontal" | "vertical";
48
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, SeparatorSlots>;
49
+ export default _default;
50
+ type __VLS_WithSlots<T, S> = T & {
51
+ new (): {
52
+ $slots: S;
53
+ };
54
+ };
@@ -1,31 +1,29 @@
1
- <script lang="ts">
2
- import type { AppConfig } from '@nuxt/schema'
3
- import _appConfig from '#build/app.config'
4
- import theme from '#build/ui/skeleton'
5
- import { tv } from '../utils/tv'
6
-
7
- const appConfigSkeleton = _appConfig as AppConfig & { ui: { skeleton: Partial<typeof theme> } }
8
-
9
- const skeleton = tv({ extend: tv(theme), ...(appConfigSkeleton.ui?.skeleton || {}) })
10
-
11
- export interface SkeletonProps {
12
- /**
13
- * The element or component this component should render as.
14
- * @defaultValue 'div'
15
- */
16
- as?: any
17
- class?: any
18
- }
1
+ <script>
2
+ import theme from "#build/ui/skeleton";
19
3
  </script>
20
4
 
21
- <script setup lang="ts">
22
- import { Primitive } from 'reka-ui'
23
-
24
- const props = defineProps<SkeletonProps>()
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { Primitive } from "reka-ui";
8
+ import { useAppConfig } from "#imports";
9
+ import { tv } from "../utils/tv";
10
+ const props = defineProps({
11
+ as: { type: null, required: false },
12
+ class: { type: null, required: false }
13
+ });
14
+ const appConfig = useAppConfig();
15
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.skeleton || {} }));
25
16
  </script>
26
17
 
27
18
  <template>
28
- <Primitive :as="as" :class="skeleton({ class: props.class })">
19
+ <Primitive
20
+ :as="as"
21
+ aria-busy="true"
22
+ aria-label="loading"
23
+ aria-live="polite"
24
+ role="alert"
25
+ :class="ui({ class: props.class })"
26
+ >
29
27
  <slot />
30
28
  </Primitive>
31
29
  </template>
@@ -0,0 +1,17 @@
1
+ export interface SkeletonProps {
2
+ /**
3
+ * The element or component this component should render as.
4
+ * @defaultValue 'div'
5
+ */
6
+ as?: any;
7
+ class?: any;
8
+ }
9
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<SkeletonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SkeletonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
10
+ default?: (props: {}) => any;
11
+ }>;
12
+ export default _default;
13
+ type __VLS_WithSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -1,127 +1,60 @@
1
- <script lang="ts">
2
- import type { VariantProps } from 'tailwind-variants'
3
- import type { DialogRootProps, DialogRootEmits, DialogContentProps, DialogContentEmits } from 'reka-ui'
4
- import type { AppConfig } from '@nuxt/schema'
5
- import _appConfig from '#build/app.config'
6
- import theme from '#build/ui/slideover'
7
- import { tv } from '../utils/tv'
8
- import type { ButtonProps } from '../types'
9
- import type { EmitsToProps } from '../types/utils'
10
-
11
- const appConfigSlideover = _appConfig as AppConfig & { ui: { slideover: Partial<typeof theme> } }
12
-
13
- const slideover = tv({ extend: tv(theme), ...(appConfigSlideover.ui?.slideover || {}) })
14
-
15
- type SlideoverVariants = VariantProps<typeof slideover>
16
-
17
- export interface SlideoverProps extends DialogRootProps {
18
- title?: string
19
- description?: string
20
- /** The content of the slideover. */
21
- content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DialogContentEmits>>
22
- /**
23
- * Render an overlay behind the slideover.
24
- * @defaultValue true
25
- */
26
- overlay?: boolean
27
- /**
28
- * Animate the slideover when opening or closing.
29
- * @defaultValue true
30
- */
31
- transition?: boolean
32
- /**
33
- * The side of the slideover.
34
- * @defaultValue 'right'
35
- */
36
- side?: SlideoverVariants['side']
37
- /**
38
- * Render the slideover in a portal.
39
- * @defaultValue true
40
- */
41
- portal?: boolean
42
- /**
43
- * Display a close button to dismiss the slideover.
44
- * `{ size: 'md', color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
45
- * @defaultValue true
46
- */
47
- close?: boolean | Partial<ButtonProps>
48
- /**
49
- * The icon displayed in the close button.
50
- * @defaultValue appConfig.ui.icons.close
51
- * @IconifyIcon
52
- */
53
- closeIcon?: string
54
- /**
55
- * When `false`, the slideover will not close when clicking outside or pressing escape.
56
- * @defaultValue true
57
- */
58
- dismissible?: boolean
59
- class?: any
60
- ui?: Partial<typeof slideover.slots>
61
- }
62
-
63
- export interface SlideoverEmits extends DialogRootEmits {
64
- 'after:leave': []
65
- }
66
-
67
- export interface SlideoverSlots {
68
- default(props: { open: boolean }): any
69
- content(props?: {}): any
70
- header(props?: {}): any
71
- title(props?: {}): any
72
- description(props?: {}): any
73
- close(props: { ui: ReturnType<typeof slideover> }): any
74
- body(props?: {}): any
75
- footer(props?: {}): any
76
- }
1
+ <script>
2
+ import theme from "#build/ui/slideover";
77
3
  </script>
78
4
 
79
- <script setup lang="ts">
80
- import { computed, toRef } from 'vue'
81
- import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, VisuallyHidden, useForwardPropsEmits } from 'reka-ui'
82
- import { reactivePick } from '@vueuse/core'
83
- import { useAppConfig } from '#imports'
84
- import { useLocale } from '../composables/useLocale'
85
- import UButton from './Button.vue'
86
-
87
- const props = withDefaults(defineProps<SlideoverProps>(), {
88
- close: true,
89
- portal: true,
90
- overlay: true,
91
- transition: true,
92
- modal: true,
93
- dismissible: true,
94
- side: 'right'
95
- })
96
- const emits = defineEmits<SlideoverEmits>()
97
- const slots = defineSlots<SlideoverSlots>()
98
-
99
- const { t } = useLocale()
100
- const appConfig = useAppConfig()
101
-
102
- const rootProps = useForwardPropsEmits(reactivePick(props, 'open', 'defaultOpen', 'modal'), emits)
103
- const contentProps = toRef(() => props.content)
5
+ <script setup>
6
+ import { computed, toRef } from "vue";
7
+ import { DialogRoot, DialogTrigger, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription, DialogClose, VisuallyHidden, useForwardPropsEmits } from "reka-ui";
8
+ import { reactivePick } from "@vueuse/core";
9
+ import { useAppConfig } from "#imports";
10
+ import { useLocale } from "../composables/useLocale";
11
+ import { usePortal } from "../composables/usePortal";
12
+ import { tv } from "../utils/tv";
13
+ import UButton from "./Button.vue";
14
+ const props = defineProps({
15
+ title: { type: String, required: false },
16
+ description: { type: String, required: false },
17
+ content: { type: Object, required: false },
18
+ overlay: { type: Boolean, required: false, default: true },
19
+ transition: { type: Boolean, required: false, default: true },
20
+ side: { type: null, required: false, default: "right" },
21
+ portal: { type: [Boolean, String], required: false, skipCheck: true, default: true },
22
+ close: { type: [Boolean, Object], required: false, default: true },
23
+ closeIcon: { type: String, required: false },
24
+ dismissible: { type: Boolean, required: false, default: true },
25
+ class: { type: null, required: false },
26
+ ui: { type: null, required: false },
27
+ open: { type: Boolean, required: false },
28
+ defaultOpen: { type: Boolean, required: false },
29
+ modal: { type: Boolean, required: false, default: true }
30
+ });
31
+ const emits = defineEmits(["after:leave", "close:prevent", "update:open"]);
32
+ const slots = defineSlots();
33
+ const { t } = useLocale();
34
+ const appConfig = useAppConfig();
35
+ const rootProps = useForwardPropsEmits(reactivePick(props, "open", "defaultOpen", "modal"), emits);
36
+ const portalProps = usePortal(toRef(() => props.portal));
37
+ const contentProps = toRef(() => props.content);
104
38
  const contentEvents = computed(() => {
105
- const events = {
106
- closeAutoFocus: (e: Event) => e.preventDefault()
107
- }
108
-
39
+ const defaultEvents = {
40
+ closeAutoFocus: (e) => e.preventDefault()
41
+ };
109
42
  if (!props.dismissible) {
110
- return {
111
- pointerDownOutside: (e: Event) => e.preventDefault(),
112
- interactOutside: (e: Event) => e.preventDefault(),
113
- escapeKeyDown: (e: Event) => e.preventDefault(),
114
- ...events
115
- }
43
+ const events = ["pointerDownOutside", "interactOutside", "escapeKeyDown", "closeAutoFocus"];
44
+ return events.reduce((acc, curr) => {
45
+ acc[curr] = (e) => {
46
+ e.preventDefault();
47
+ emits("close:prevent");
48
+ };
49
+ return acc;
50
+ }, {});
116
51
  }
117
-
118
- return events
119
- })
120
-
121
- const ui = computed(() => slideover({
52
+ return defaultEvents;
53
+ });
54
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.slideover || {} })({
122
55
  transition: props.transition,
123
56
  side: props.side
124
- }))
57
+ }));
125
58
  </script>
126
59
 
127
60
  <template>
@@ -130,11 +63,11 @@ const ui = computed(() => slideover({
130
63
  <slot :open="open" />
131
64
  </DialogTrigger>
132
65
 
133
- <DialogPortal :disabled="!portal">
66
+ <DialogPortal v-bind="portalProps">
134
67
  <DialogOverlay v-if="overlay" :class="ui.overlay({ class: props.ui?.overlay })" />
135
68
 
136
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">
137
- <VisuallyHidden v-if="!!slots.content && ((title || !!slots.title) || (description || !!slots.description))">
70
+ <VisuallyHidden v-if="!!slots.content && (title || !!slots.title || (description || !!slots.description))">
138
71
  <DialogTitle v-if="title || !!slots.title">
139
72
  <slot name="title">
140
73
  {{ title }}
@@ -174,7 +107,7 @@ const ui = computed(() => slideover({
174
107
  color="neutral"
175
108
  variant="ghost"
176
109
  :aria-label="t('slideover.close')"
177
- v-bind="(typeof close === 'object' ? close as Partial<ButtonProps> : {})"
110
+ v-bind="typeof close === 'object' ? close : {}"
178
111
  :class="ui.close({ class: props.ui?.close })"
179
112
  />
180
113
  </slot>