@bitrix24/b24ui-nuxt 0.5.11 → 0.6.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 (199) hide show
  1. package/.nuxt/b24ui/input-menu.ts +2 -2
  2. package/.nuxt/b24ui/select-menu.ts +4 -4
  3. package/.nuxt/b24ui/select.ts +2 -2
  4. package/dist/meta.d.mts +5208 -5061
  5. package/dist/meta.mjs +5208 -5061
  6. package/dist/module.json +3 -3
  7. package/dist/module.mjs +2 -2
  8. package/dist/runtime/components/Advice.vue +27 -54
  9. package/dist/runtime/components/Advice.vue.d.ts +170 -0
  10. package/dist/runtime/components/Alert.vue +35 -96
  11. package/dist/runtime/components/Alert.vue.d.ts +464 -0
  12. package/dist/runtime/components/App.vue +24 -34
  13. package/dist/runtime/components/App.vue.d.ts +23 -0
  14. package/dist/runtime/components/Avatar.vue +43 -81
  15. package/dist/runtime/components/Avatar.vue.d.ts +281 -0
  16. package/dist/runtime/components/AvatarGroup.vue +40 -76
  17. package/dist/runtime/components/AvatarGroup.vue.d.ts +204 -0
  18. package/dist/runtime/components/Badge.vue +40 -83
  19. package/dist/runtime/components/Badge.vue.d.ts +517 -0
  20. package/dist/runtime/components/Button.vue +96 -155
  21. package/dist/runtime/components/Button.vue.d.ts +640 -0
  22. package/dist/runtime/components/ButtonGroup.vue +19 -51
  23. package/dist/runtime/components/ButtonGroup.vue.d.ts +116 -0
  24. package/dist/runtime/components/Calendar.vue +73 -152
  25. package/dist/runtime/components/Calendar.vue.d.ts +437 -0
  26. package/dist/runtime/components/Checkbox.vue +42 -73
  27. package/dist/runtime/components/Checkbox.vue.d.ts +354 -0
  28. package/dist/runtime/components/Chip.vue +26 -74
  29. package/dist/runtime/components/Chip.vue.d.ts +271 -0
  30. package/dist/runtime/components/Collapsible.vue +22 -41
  31. package/dist/runtime/components/Collapsible.vue.d.ts +118 -0
  32. package/dist/runtime/components/Container.vue +13 -27
  33. package/dist/runtime/components/Container.vue.d.ts +27 -0
  34. package/dist/runtime/components/Countdown.vue +153 -378
  35. package/dist/runtime/components/Countdown.vue.d.ts +356 -0
  36. package/dist/runtime/components/DescriptionList.vue +78 -149
  37. package/dist/runtime/components/DescriptionList.vue.d.ts +379 -0
  38. package/dist/runtime/components/DropdownMenu.vue +38 -139
  39. package/dist/runtime/components/DropdownMenu.vue.d.ts +533 -0
  40. package/dist/runtime/components/DropdownMenuContent.vue +68 -80
  41. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +228 -0
  42. package/dist/runtime/components/Form.vue +130 -217
  43. package/dist/runtime/components/Form.vue.d.ts +55 -0
  44. package/dist/runtime/components/FormField.vue +36 -80
  45. package/dist/runtime/components/FormField.vue.d.ts +282 -0
  46. package/dist/runtime/components/Input.vue +79 -179
  47. package/dist/runtime/components/Input.vue.d.ts +755 -0
  48. package/dist/runtime/components/InputMenu.vue +185 -381
  49. package/dist/runtime/components/InputMenu.vue.d.ts +1523 -0
  50. package/dist/runtime/components/InputNumber.vue +77 -175
  51. package/dist/runtime/components/InputNumber.vue.d.ts +658 -0
  52. package/dist/runtime/components/Kbd.vue +18 -45
  53. package/dist/runtime/components/Kbd.vue.d.ts +109 -0
  54. package/dist/runtime/components/Link.vue +92 -173
  55. package/dist/runtime/components/Link.vue.d.ts +129 -0
  56. package/dist/runtime/components/LinkBase.vue +33 -42
  57. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  58. package/dist/runtime/components/Modal.vue +48 -127
  59. package/dist/runtime/components/Modal.vue.d.ts +327 -0
  60. package/dist/runtime/components/ModalDialogClose.vue +5 -8
  61. package/dist/runtime/components/ModalDialogClose.vue.d.ts +10 -0
  62. package/dist/runtime/components/Navbar.vue +15 -33
  63. package/dist/runtime/components/Navbar.vue.d.ts +101 -0
  64. package/dist/runtime/components/NavbarDivider.vue +15 -33
  65. package/dist/runtime/components/NavbarDivider.vue.d.ts +101 -0
  66. package/dist/runtime/components/NavbarSection.vue +15 -33
  67. package/dist/runtime/components/NavbarSection.vue.d.ts +101 -0
  68. package/dist/runtime/components/NavbarSpacer.vue +15 -33
  69. package/dist/runtime/components/NavbarSpacer.vue.d.ts +101 -0
  70. package/dist/runtime/components/NavigationMenu.vue +74 -208
  71. package/dist/runtime/components/NavigationMenu.vue.d.ts +824 -0
  72. package/dist/runtime/components/OverlayProvider.vue +14 -18
  73. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  74. package/dist/runtime/components/Popover.vue +40 -81
  75. package/dist/runtime/components/Popover.vue.d.ts +147 -0
  76. package/dist/runtime/components/Progress.vue +70 -136
  77. package/dist/runtime/components/Progress.vue.d.ts +592 -0
  78. package/dist/runtime/components/RadioGroup.vue +59 -134
  79. package/dist/runtime/components/RadioGroup.vue.d.ts +723 -0
  80. package/dist/runtime/components/Range.vue +46 -85
  81. package/dist/runtime/components/Range.vue.d.ts +417 -0
  82. package/dist/runtime/components/Select.vue +110 -260
  83. package/dist/runtime/components/Select.vue.d.ts +1201 -0
  84. package/dist/runtime/components/SelectMenu.vue +161 -347
  85. package/dist/runtime/components/SelectMenu.vue.d.ts +1298 -0
  86. package/dist/runtime/components/Separator.vue +28 -71
  87. package/dist/runtime/components/Separator.vue.d.ts +400 -0
  88. package/dist/runtime/components/Sidebar.vue +15 -33
  89. package/dist/runtime/components/Sidebar.vue.d.ts +101 -0
  90. package/dist/runtime/components/SidebarBody.vue +17 -38
  91. package/dist/runtime/components/SidebarBody.vue.d.ts +90 -0
  92. package/dist/runtime/components/SidebarFooter.vue +15 -33
  93. package/dist/runtime/components/SidebarFooter.vue.d.ts +101 -0
  94. package/dist/runtime/components/SidebarHeader.vue +15 -33
  95. package/dist/runtime/components/SidebarHeader.vue.d.ts +101 -0
  96. package/dist/runtime/components/SidebarHeading.vue +15 -33
  97. package/dist/runtime/components/SidebarHeading.vue.d.ts +101 -0
  98. package/dist/runtime/components/SidebarLayout.vue +34 -70
  99. package/dist/runtime/components/SidebarLayout.vue.d.ts +222 -0
  100. package/dist/runtime/components/SidebarSection.vue +15 -33
  101. package/dist/runtime/components/SidebarSection.vue.d.ts +101 -0
  102. package/dist/runtime/components/SidebarSpacer.vue +15 -33
  103. package/dist/runtime/components/SidebarSpacer.vue.d.ts +101 -0
  104. package/dist/runtime/components/Skeleton.vue +12 -22
  105. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  106. package/dist/runtime/components/Slideover.vue +50 -131
  107. package/dist/runtime/components/Slideover.vue.d.ts +360 -0
  108. package/dist/runtime/components/StackedLayout.vue +34 -73
  109. package/dist/runtime/components/StackedLayout.vue.d.ts +192 -0
  110. package/dist/runtime/components/Switch.vue +46 -95
  111. package/dist/runtime/components/Switch.vue.d.ts +587 -0
  112. package/dist/runtime/components/Tabs.vue +37 -105
  113. package/dist/runtime/components/Tabs.vue.d.ts +453 -0
  114. package/dist/runtime/components/Textarea.vue +92 -201
  115. package/dist/runtime/components/Textarea.vue.d.ts +601 -0
  116. package/dist/runtime/components/Toast.vue +47 -105
  117. package/dist/runtime/components/Toast.vue.d.ts +438 -0
  118. package/dist/runtime/components/Toaster.vue +70 -115
  119. package/dist/runtime/components/Toaster.vue.d.ts +219 -0
  120. package/dist/runtime/components/Tooltip.vue +36 -64
  121. package/dist/runtime/components/Tooltip.vue.d.ts +186 -0
  122. package/dist/runtime/components/content/TableWrapper.vue +24 -70
  123. package/dist/runtime/components/content/TableWrapper.vue.d.ts +237 -0
  124. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  125. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  126. package/dist/runtime/composables/useComponentIcons.d.ts +3 -3
  127. package/dist/runtime/composables/useFormField.d.ts +2 -2
  128. package/dist/runtime/composables/useOverlay.d.ts +14 -7
  129. package/dist/runtime/composables/useOverlay.js +14 -6
  130. package/dist/runtime/prose/A.vue +12 -23
  131. package/dist/runtime/prose/A.vue.d.ts +84 -0
  132. package/dist/runtime/prose/Blockquote.vue +12 -23
  133. package/dist/runtime/prose/Blockquote.vue.d.ts +84 -0
  134. package/dist/runtime/prose/Code.vue +14 -31
  135. package/dist/runtime/prose/Code.vue.d.ts +97 -0
  136. package/dist/runtime/prose/Em.vue +12 -23
  137. package/dist/runtime/prose/Em.vue.d.ts +84 -0
  138. package/dist/runtime/prose/H1.vue +12 -23
  139. package/dist/runtime/prose/H1.vue.d.ts +97 -0
  140. package/dist/runtime/prose/H2.vue +12 -23
  141. package/dist/runtime/prose/H2.vue.d.ts +123 -0
  142. package/dist/runtime/prose/H3.vue +12 -23
  143. package/dist/runtime/prose/H3.vue.d.ts +123 -0
  144. package/dist/runtime/prose/H4.vue +12 -23
  145. package/dist/runtime/prose/H4.vue.d.ts +123 -0
  146. package/dist/runtime/prose/H5.vue +12 -23
  147. package/dist/runtime/prose/H5.vue.d.ts +123 -0
  148. package/dist/runtime/prose/H6.vue +12 -23
  149. package/dist/runtime/prose/H6.vue.d.ts +123 -0
  150. package/dist/runtime/prose/Hr.vue +12 -19
  151. package/dist/runtime/prose/Hr.vue.d.ts +74 -0
  152. package/dist/runtime/prose/Img.vue +12 -23
  153. package/dist/runtime/prose/Img.vue.d.ts +77 -0
  154. package/dist/runtime/prose/Li.vue +12 -23
  155. package/dist/runtime/prose/Li.vue.d.ts +84 -0
  156. package/dist/runtime/prose/Ol.vue +12 -23
  157. package/dist/runtime/prose/Ol.vue.d.ts +84 -0
  158. package/dist/runtime/prose/P.vue +12 -23
  159. package/dist/runtime/prose/P.vue.d.ts +84 -0
  160. package/dist/runtime/prose/Pre.vue +16 -33
  161. package/dist/runtime/prose/Pre.vue.d.ts +117 -0
  162. package/dist/runtime/prose/Strong.vue +12 -23
  163. package/dist/runtime/prose/Strong.vue.d.ts +84 -0
  164. package/dist/runtime/prose/Table.vue +19 -54
  165. package/dist/runtime/prose/Table.vue.d.ts +144 -0
  166. package/dist/runtime/prose/Tbody.vue +12 -23
  167. package/dist/runtime/prose/Tbody.vue.d.ts +84 -0
  168. package/dist/runtime/prose/Td.vue +12 -23
  169. package/dist/runtime/prose/Td.vue.d.ts +84 -0
  170. package/dist/runtime/prose/Th.vue +12 -23
  171. package/dist/runtime/prose/Th.vue.d.ts +84 -0
  172. package/dist/runtime/prose/Thead.vue +12 -23
  173. package/dist/runtime/prose/Thead.vue.d.ts +84 -0
  174. package/dist/runtime/prose/Tr.vue +12 -23
  175. package/dist/runtime/prose/Tr.vue.d.ts +84 -0
  176. package/dist/runtime/prose/Ul.vue +12 -23
  177. package/dist/runtime/prose/Ul.vue.d.ts +84 -0
  178. package/dist/runtime/utils/link.d.ts +3 -3
  179. package/dist/runtime/vue/components/Link.vue +115 -202
  180. package/dist/runtime/vue/components/Link.vue.d.ts +129 -0
  181. package/dist/shared/{b24ui-nuxt.CS9Lf0os.mjs → b24ui-nuxt.BA6Y2FnC.mjs} +6 -6
  182. package/dist/types.d.mts +3 -5
  183. package/dist/unplugin.mjs +1 -1
  184. package/dist/vite.mjs +1 -1
  185. package/package.json +14 -22
  186. package/dist/meta.cjs +0 -72112
  187. package/dist/meta.d.cts +0 -72110
  188. package/dist/meta.d.ts +0 -72110
  189. package/dist/module.cjs +0 -63
  190. package/dist/module.d.cts +0 -15
  191. package/dist/module.d.ts +0 -15
  192. package/dist/shared/b24ui-nuxt.DrKwIWoc.cjs +0 -7721
  193. package/dist/types.d.ts +0 -7
  194. package/dist/unplugin.cjs +0 -236
  195. package/dist/unplugin.d.cts +0 -33
  196. package/dist/unplugin.d.ts +0 -33
  197. package/dist/vite.cjs +0 -21
  198. package/dist/vite.d.cts +0 -14
  199. package/dist/vite.d.ts +0 -14
@@ -0,0 +1,379 @@
1
+ import type { VariantProps } from 'tailwind-variants';
2
+ import type { AvatarProps, ButtonProps, IconComponent } from '../types';
3
+ import type { DynamicSlots } from '../types/utils';
4
+ declare const descriptionList: import("tailwind-variants").TVReturnType<{
5
+ size: {
6
+ sm: {
7
+ legend: string;
8
+ text: string;
9
+ container: string;
10
+ labelWrapper: string;
11
+ avatarSize: string;
12
+ label: string;
13
+ descriptionWrapper: string;
14
+ description: string;
15
+ footer: string;
16
+ };
17
+ md: {
18
+ legend: string;
19
+ text: string;
20
+ container: string;
21
+ labelWrapper: string;
22
+ avatarSize: string;
23
+ label: string;
24
+ descriptionWrapper: string;
25
+ description: string;
26
+ footer: string;
27
+ };
28
+ };
29
+ orientation: {
30
+ horizontal: {
31
+ descriptionWrapper: string;
32
+ actions: string;
33
+ };
34
+ vertical: {
35
+ descriptionWrapper: string;
36
+ actions: string;
37
+ };
38
+ };
39
+ title: {
40
+ true: {
41
+ description: string;
42
+ };
43
+ };
44
+ }, {
45
+ root: string;
46
+ legend: string;
47
+ text: string;
48
+ container: string;
49
+ labelWrapper: string;
50
+ icon: string;
51
+ avatar: string;
52
+ avatarSize: string;
53
+ label: string;
54
+ descriptionWrapper: string;
55
+ description: string;
56
+ actions: string;
57
+ footer: string;
58
+ }, undefined, {
59
+ size: {
60
+ sm: {
61
+ legend: string;
62
+ text: string;
63
+ container: string;
64
+ labelWrapper: string;
65
+ avatarSize: string;
66
+ label: string;
67
+ descriptionWrapper: string;
68
+ description: string;
69
+ footer: string;
70
+ };
71
+ md: {
72
+ legend: string;
73
+ text: string;
74
+ container: string;
75
+ labelWrapper: string;
76
+ avatarSize: string;
77
+ label: string;
78
+ descriptionWrapper: string;
79
+ description: string;
80
+ footer: string;
81
+ };
82
+ };
83
+ orientation: {
84
+ horizontal: {
85
+ descriptionWrapper: string;
86
+ actions: string;
87
+ };
88
+ vertical: {
89
+ descriptionWrapper: string;
90
+ actions: string;
91
+ };
92
+ };
93
+ title: {
94
+ true: {
95
+ description: string;
96
+ };
97
+ };
98
+ }, {
99
+ root: string;
100
+ legend: string;
101
+ text: string;
102
+ container: string;
103
+ labelWrapper: string;
104
+ icon: string;
105
+ avatar: string;
106
+ avatarSize: string;
107
+ label: string;
108
+ descriptionWrapper: string;
109
+ description: string;
110
+ actions: string;
111
+ footer: string;
112
+ }, import("tailwind-variants").TVReturnType<{
113
+ size: {
114
+ sm: {
115
+ legend: string;
116
+ text: string;
117
+ container: string;
118
+ labelWrapper: string;
119
+ avatarSize: string;
120
+ label: string;
121
+ descriptionWrapper: string;
122
+ description: string;
123
+ footer: string;
124
+ };
125
+ md: {
126
+ legend: string;
127
+ text: string;
128
+ container: string;
129
+ labelWrapper: string;
130
+ avatarSize: string;
131
+ label: string;
132
+ descriptionWrapper: string;
133
+ description: string;
134
+ footer: string;
135
+ };
136
+ };
137
+ orientation: {
138
+ horizontal: {
139
+ descriptionWrapper: string;
140
+ actions: string;
141
+ };
142
+ vertical: {
143
+ descriptionWrapper: string;
144
+ actions: string;
145
+ };
146
+ };
147
+ title: {
148
+ true: {
149
+ description: string;
150
+ };
151
+ };
152
+ }, {
153
+ root: string;
154
+ legend: string;
155
+ text: string;
156
+ container: string;
157
+ labelWrapper: string;
158
+ icon: string;
159
+ avatar: string;
160
+ avatarSize: string;
161
+ label: string;
162
+ descriptionWrapper: string;
163
+ description: string;
164
+ actions: string;
165
+ footer: string;
166
+ }, undefined, {
167
+ size: {
168
+ sm: {
169
+ legend: string;
170
+ text: string;
171
+ container: string;
172
+ labelWrapper: string;
173
+ avatarSize: string;
174
+ label: string;
175
+ descriptionWrapper: string;
176
+ description: string;
177
+ footer: string;
178
+ };
179
+ md: {
180
+ legend: string;
181
+ text: string;
182
+ container: string;
183
+ labelWrapper: string;
184
+ avatarSize: string;
185
+ label: string;
186
+ descriptionWrapper: string;
187
+ description: string;
188
+ footer: string;
189
+ };
190
+ };
191
+ orientation: {
192
+ horizontal: {
193
+ descriptionWrapper: string;
194
+ actions: string;
195
+ };
196
+ vertical: {
197
+ descriptionWrapper: string;
198
+ actions: string;
199
+ };
200
+ };
201
+ title: {
202
+ true: {
203
+ description: string;
204
+ };
205
+ };
206
+ }, {
207
+ root: string;
208
+ legend: string;
209
+ text: string;
210
+ container: string;
211
+ labelWrapper: string;
212
+ icon: string;
213
+ avatar: string;
214
+ avatarSize: string;
215
+ label: string;
216
+ descriptionWrapper: string;
217
+ description: string;
218
+ actions: string;
219
+ footer: string;
220
+ }, import("tailwind-variants").TVReturnType<{
221
+ size: {
222
+ sm: {
223
+ legend: string;
224
+ text: string;
225
+ container: string;
226
+ labelWrapper: string;
227
+ avatarSize: string;
228
+ label: string;
229
+ descriptionWrapper: string;
230
+ description: string;
231
+ footer: string;
232
+ };
233
+ md: {
234
+ legend: string;
235
+ text: string;
236
+ container: string;
237
+ labelWrapper: string;
238
+ avatarSize: string;
239
+ label: string;
240
+ descriptionWrapper: string;
241
+ description: string;
242
+ footer: string;
243
+ };
244
+ };
245
+ orientation: {
246
+ horizontal: {
247
+ descriptionWrapper: string;
248
+ actions: string;
249
+ };
250
+ vertical: {
251
+ descriptionWrapper: string;
252
+ actions: string;
253
+ };
254
+ };
255
+ title: {
256
+ true: {
257
+ description: string;
258
+ };
259
+ };
260
+ }, {
261
+ root: string;
262
+ legend: string;
263
+ text: string;
264
+ container: string;
265
+ labelWrapper: string;
266
+ icon: string;
267
+ avatar: string;
268
+ avatarSize: string;
269
+ label: string;
270
+ descriptionWrapper: string;
271
+ description: string;
272
+ actions: string;
273
+ footer: string;
274
+ }, undefined, unknown, unknown, undefined>>>;
275
+ type DescriptionListVariants = VariantProps<typeof descriptionList>;
276
+ export interface DescriptionListItem {
277
+ label?: string;
278
+ /**
279
+ * Display an icon on the left side.
280
+ * @IconComponent
281
+ */
282
+ icon?: IconComponent;
283
+ avatar?: AvatarProps;
284
+ slot?: string;
285
+ description?: string;
286
+ /**
287
+ * The orientation between the content and the actions.
288
+ * @defaultValue 'vertical'
289
+ */
290
+ orientation?: DescriptionListVariants['orientation'];
291
+ /**
292
+ * Display a list of actions:
293
+ * - under the description when orientation is `vertical`
294
+ * - next to the description when orientation is `horizontal`
295
+ * `{ size: 'xs' }`{lang="ts"}
296
+ */
297
+ actions?: ButtonProps[];
298
+ class?: any;
299
+ b24ui?: Partial<typeof descriptionList.slots>;
300
+ [key: string]: any;
301
+ }
302
+ export interface DescriptionListProps<T extends DescriptionListItem = DescriptionListItem> {
303
+ legend?: string;
304
+ text?: string;
305
+ /**
306
+ * The key used to get the label from the item.
307
+ * @defaultValue 'label'
308
+ */
309
+ labelKey?: string;
310
+ /**
311
+ * The key used to get the description from the item.
312
+ * @defaultValue 'description'
313
+ */
314
+ descriptionKey?: string;
315
+ items?: T[];
316
+ /**
317
+ * @defaultValue 'md'
318
+ */
319
+ size?: DescriptionListVariants['size'];
320
+ class?: any;
321
+ b24ui?: Partial<typeof descriptionList.slots>;
322
+ }
323
+ type SlotProps<T extends DescriptionListItem> = (props: {
324
+ item: T;
325
+ index: number;
326
+ }) => any;
327
+ export type DescriptionListSlots<T extends DescriptionListItem = DescriptionListItem> = {
328
+ legend(props?: {}): any;
329
+ text(props?: {}): any;
330
+ leading: SlotProps<T>;
331
+ label: SlotProps<T>;
332
+ description: SlotProps<T>;
333
+ actions: SlotProps<T>;
334
+ content: SlotProps<T>;
335
+ footer(props?: {
336
+ b24ui: any;
337
+ }): any;
338
+ } & DynamicSlots<T, undefined, {
339
+ index: number;
340
+ }>;
341
+ declare const _default: <T extends DescriptionListItem>(__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<{
342
+ props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, never> & DescriptionListProps<T> & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
343
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
344
+ attrs: any;
345
+ slots: Readonly<{
346
+ legend(props?: {}): any;
347
+ text(props?: {}): any;
348
+ leading: SlotProps<T>;
349
+ label: SlotProps<T>;
350
+ description: SlotProps<T>;
351
+ actions: SlotProps<T>;
352
+ content: SlotProps<T>;
353
+ footer(props?: {
354
+ b24ui: any;
355
+ }): any;
356
+ } & DynamicSlots<T, undefined, {
357
+ index: number;
358
+ }>> & {
359
+ legend(props?: {}): any;
360
+ text(props?: {}): any;
361
+ leading: SlotProps<T>;
362
+ label: SlotProps<T>;
363
+ description: SlotProps<T>;
364
+ actions: SlotProps<T>;
365
+ content: SlotProps<T>;
366
+ footer(props?: {
367
+ b24ui: any;
368
+ }): any;
369
+ } & DynamicSlots<T, undefined, {
370
+ index: number;
371
+ }>;
372
+ emit: {};
373
+ }>) => import("vue").VNode & {
374
+ __ctx?: Awaited<typeof __VLS_setup>;
375
+ };
376
+ export default _default;
377
+ type __VLS_PrettifyLocal<T> = {
378
+ [K in keyof T]: T[K];
379
+ } & {};
@@ -1,144 +1,43 @@
1
- <!-- eslint-disable vue/block-tag-newline -->
2
- <script lang="ts">
3
- import type { VariantProps } from 'tailwind-variants'
4
- import type { DropdownMenuRootProps, DropdownMenuRootEmits, DropdownMenuContentProps, DropdownMenuContentEmits, DropdownMenuArrowProps } from 'reka-ui'
5
- import type { AppConfig } from '@nuxt/schema'
6
- import _appConfig from '#build/app.config'
7
- import theme from '#build/b24ui/dropdown-menu'
8
- import { tv } from '../utils/tv'
9
- import type { AvatarProps, KbdProps, LinkProps, IconComponent } from '../types'
10
- import type {
11
- ArrayOrNested,
12
- DynamicSlots,
13
- MergeTypes,
14
- NestedItem,
15
- PartialString,
16
- EmitsToProps
17
- } from '../types/utils'
18
-
19
- const appConfigDropdownMenu = _appConfig as AppConfig & { b24ui: { dropdownMenu: Partial<typeof theme> } }
20
-
21
- const dropdownMenu = tv({ extend: tv(theme), ...(appConfigDropdownMenu.b24ui?.dropdownMenu || {}) })
22
-
23
- type DropdownMenuVariants = VariantProps<typeof dropdownMenu>
24
-
25
- export interface DropdownMenuItem extends Omit<LinkProps, 'type' | 'raw' | 'custom'> {
26
- label?: string
27
- /**
28
- * Display an icon on the left side.
29
- * @IconComponent
30
- */
31
- icon?: IconComponent
32
- color?: DropdownMenuVariants['color']
33
- avatar?: AvatarProps
34
- content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>
35
- kbds?: KbdProps['value'][] | KbdProps[]
36
- /**
37
- * The item type.
38
- * @defaultValue 'link'
39
- */
40
- type?: 'label' | 'separator' | 'link' | 'checkbox'
41
- slot?: string
42
- loading?: boolean
43
- disabled?: boolean
44
- checked?: boolean
45
- open?: boolean
46
- defaultOpen?: boolean
47
- children?: ArrayOrNested<DropdownMenuItem>
48
- onSelect?(e: Event): void
49
- onUpdateChecked?(checked: boolean): void
50
- [key: string]: any
51
- }
52
-
53
- export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>> extends Omit<DropdownMenuRootProps, 'dir'> {
54
- /**
55
- * @defaultValue 'md'
56
- */
57
- size?: DropdownMenuVariants['size']
58
- items?: T
59
- /**
60
- * The icon displayed when an item is checked.
61
- * @defaultValue icons.check
62
- * @IconComponent
63
- */
64
- checkedIcon?: IconComponent
65
- /**
66
- * The icon displayed when the item is an external link.
67
- * Set to `false` to hide the external icon.
68
- * @defaultValue icons.external
69
- * @IconComponent
70
- */
71
- externalIcon?: boolean | IconComponent
72
- /**
73
- * The content of the menu.
74
- * @defaultValue { side: 'bottom', sideOffset: 8, collisionPadding: 8 }
75
- */
76
- content?: Omit<DropdownMenuContentProps, 'as' | 'asChild' | 'forceMount'> & Partial<EmitsToProps<DropdownMenuContentEmits>>
77
- /**
78
- * Display an arrow alongside the menu.
79
- * @defaultValue false
80
- */
81
- arrow?: boolean | Omit<DropdownMenuArrowProps, 'as' | 'asChild'>
82
- /**
83
- * Render the menu in a portal.
84
- * @defaultValue true
85
- */
86
- portal?: boolean
87
- /**
88
- * The key used to get the label from the item.
89
- * @defaultValue 'label'
90
- */
91
- labelKey?: keyof NestedItem<T>
92
- /**
93
- * @defaultValue false
94
- */
95
- disabled?: boolean
96
- class?: any
97
- b24ui?: PartialString<typeof dropdownMenu.slots>
98
- }
99
-
100
- export interface DropdownMenuEmits extends DropdownMenuRootEmits {}
101
-
102
- type SlotProps<T extends DropdownMenuItem> = (props: { item: T, active?: boolean, index: number }) => any
103
-
104
- export type DropdownMenuSlots<
105
- A extends ArrayOrNested<DropdownMenuItem> = ArrayOrNested<DropdownMenuItem>,
106
- T extends NestedItem<A> = NestedItem<A>
107
- > = {
108
- 'default'(props: { open: boolean }): any
109
- 'item': SlotProps<T>
110
- 'item-leading': SlotProps<T>
111
- 'item-label': SlotProps<T>
112
- 'item-trailing': SlotProps<T>
113
- } & DynamicSlots<MergeTypes<T>, 'leading' | 'label' | 'trailing', { active?: boolean, index: number }>
114
-
1
+ <script>
2
+ import _appConfig from "#build/app.config";
3
+ import theme from "#build/b24ui/dropdown-menu";
4
+ import { tv } from "../utils/tv";
5
+ const appConfigDropdownMenu = _appConfig;
6
+ const dropdownMenu = tv({ extend: tv(theme), ...appConfigDropdownMenu.b24ui?.dropdownMenu || {} });
115
7
  </script>
116
8
 
117
- <script setup lang="ts" generic="T extends ArrayOrNested<DropdownMenuItem>">
118
- import { computed, toRef } from 'vue'
119
- import { defu } from 'defu'
120
- import { DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuArrow, useForwardPropsEmits } from 'reka-ui'
121
- import { reactivePick } from '@vueuse/core'
122
- import { omit } from '../utils'
123
- import B24DropdownMenuContent from './DropdownMenuContent.vue'
124
-
125
- const props = withDefaults(defineProps<DropdownMenuProps<T>>(), {
126
- portal: true,
127
- modal: true,
128
- externalIcon: true,
129
- labelKey: 'label'
130
- })
131
- const emits = defineEmits<DropdownMenuEmits>()
132
- const slots = defineSlots<DropdownMenuSlots<T>>()
133
-
134
- const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultOpen', 'open', 'modal'), emits)
135
- const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8 }) as DropdownMenuContentProps)
136
- const arrowProps = toRef(() => props.arrow as DropdownMenuArrowProps)
137
- const proxySlots = omit(slots, ['default'])
138
-
9
+ <script setup>
10
+ import { computed, toRef } from "vue";
11
+ import { defu } from "defu";
12
+ import { DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuArrow, useForwardPropsEmits } from "reka-ui";
13
+ import { reactivePick } from "@vueuse/core";
14
+ import { omit } from "../utils";
15
+ import B24DropdownMenuContent from "./DropdownMenuContent.vue";
16
+ const props = defineProps({
17
+ size: { type: null, required: false },
18
+ items: { type: null, required: false },
19
+ checkedIcon: { type: [Function, Object], required: false },
20
+ externalIcon: { type: [Boolean, Function, Object], required: false, default: true },
21
+ content: { type: Object, required: false },
22
+ arrow: { type: [Boolean, Object], required: false },
23
+ portal: { type: Boolean, required: false, default: true },
24
+ labelKey: { type: null, required: false, default: "label" },
25
+ disabled: { type: Boolean, required: false },
26
+ class: { type: null, required: false },
27
+ b24ui: { type: null, required: false },
28
+ defaultOpen: { type: Boolean, required: false },
29
+ open: { type: Boolean, required: false },
30
+ modal: { type: Boolean, required: false, default: true }
31
+ });
32
+ const emits = defineEmits(["update:open"]);
33
+ const slots = defineSlots();
34
+ const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "modal"), emits);
35
+ const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
36
+ const arrowProps = toRef(() => props.arrow);
37
+ const proxySlots = omit(slots, ["default"]);
139
38
  const b24ui = computed(() => dropdownMenu({
140
39
  size: props.size
141
- }))
40
+ }));
142
41
  </script>
143
42
 
144
43
  <template>
@@ -154,12 +53,12 @@ const b24ui = computed(() => dropdownMenu({
154
53
  v-bind="contentProps"
155
54
  :items="items"
156
55
  :portal="portal"
157
- :label-key="(labelKey as keyof NestedItem<T>)"
56
+ :label-key="labelKey"
158
57
  :checked-icon="checkedIcon"
159
58
  :external-icon="externalIcon"
160
59
  >
161
60
  <template v-for="(_, name) in proxySlots" #[name]="slotData">
162
- <slot :name="(name as keyof DropdownMenuSlots<T>)" v-bind="slotData" />
61
+ <slot :name="name" v-bind="slotData" />
163
62
  </template>
164
63
 
165
64
  <DropdownMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="b24ui.arrow({ class: props.b24ui?.arrow })" />