@bitrix24/b24ui-nuxt 0.5.9 → 0.5.10

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 (196) hide show
  1. package/.nuxt/b24ui/navigation-menu.ts +0 -2
  2. package/.nuxt/b24ui/popover.ts +1 -1
  3. package/dist/meta.d.mts +4789 -4897
  4. package/dist/meta.mjs +4789 -4897
  5. package/dist/module.json +5 -5
  6. package/dist/module.mjs +11 -7
  7. package/dist/runtime/components/Advice.vue +47 -54
  8. package/dist/runtime/components/Advice.vue.d.ts +170 -0
  9. package/dist/runtime/components/Alert.vue +71 -96
  10. package/dist/runtime/components/Alert.vue.d.ts +464 -0
  11. package/dist/runtime/components/App.vue +37 -34
  12. package/dist/runtime/components/App.vue.d.ts +23 -0
  13. package/dist/runtime/components/Avatar.vue +69 -81
  14. package/dist/runtime/components/Avatar.vue.d.ts +281 -0
  15. package/dist/runtime/components/AvatarGroup.vue +53 -76
  16. package/dist/runtime/components/AvatarGroup.vue.d.ts +204 -0
  17. package/dist/runtime/components/Badge.vue +83 -83
  18. package/dist/runtime/components/Badge.vue.d.ts +517 -0
  19. package/dist/runtime/components/Button.vue +219 -149
  20. package/dist/runtime/components/Button.vue.d.ts +640 -0
  21. package/dist/runtime/components/ButtonGroup.vue +35 -51
  22. package/dist/runtime/components/ButtonGroup.vue.d.ts +116 -0
  23. package/dist/runtime/components/Calendar.vue +186 -152
  24. package/dist/runtime/components/Calendar.vue.d.ts +437 -0
  25. package/dist/runtime/components/Checkbox.vue +84 -73
  26. package/dist/runtime/components/Checkbox.vue.d.ts +354 -0
  27. package/dist/runtime/components/Chip.vue +59 -74
  28. package/dist/runtime/components/Chip.vue.d.ts +271 -0
  29. package/dist/runtime/components/Collapsible.vue +44 -41
  30. package/dist/runtime/components/Collapsible.vue.d.ts +118 -0
  31. package/dist/runtime/components/Container.vue +18 -27
  32. package/dist/runtime/components/Container.vue.d.ts +27 -0
  33. package/dist/runtime/components/Countdown.vue +198 -378
  34. package/dist/runtime/components/Countdown.vue.d.ts +356 -0
  35. package/dist/runtime/components/DescriptionList.vue +102 -149
  36. package/dist/runtime/components/DescriptionList.vue.d.ts +379 -0
  37. package/dist/runtime/components/DropdownMenu.vue +83 -139
  38. package/dist/runtime/components/DropdownMenu.vue.d.ts +533 -0
  39. package/dist/runtime/components/DropdownMenuContent.vue +137 -81
  40. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +228 -0
  41. package/dist/runtime/components/Form.vue +162 -216
  42. package/dist/runtime/components/Form.vue.d.ts +55 -0
  43. package/dist/runtime/components/FormField.vue +76 -80
  44. package/dist/runtime/components/FormField.vue.d.ts +282 -0
  45. package/dist/runtime/components/Input.vue +160 -179
  46. package/dist/runtime/components/Input.vue.d.ts +755 -0
  47. package/dist/runtime/components/InputMenu.vue +300 -381
  48. package/dist/runtime/components/InputMenu.vue.d.ts +1504 -0
  49. package/dist/runtime/components/InputNumber.vue +178 -175
  50. package/dist/runtime/components/InputNumber.vue.d.ts +658 -0
  51. package/dist/runtime/components/Kbd.vue +33 -45
  52. package/dist/runtime/components/Kbd.vue.d.ts +109 -0
  53. package/dist/runtime/components/Link.vue +179 -173
  54. package/dist/runtime/components/Link.vue.d.ts +129 -0
  55. package/dist/runtime/components/LinkBase.vue +64 -42
  56. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  57. package/dist/runtime/components/Modal.vue +105 -127
  58. package/dist/runtime/components/Modal.vue.d.ts +327 -0
  59. package/dist/runtime/components/ModalDialogClose.vue +4 -8
  60. package/dist/runtime/components/ModalDialogClose.vue.d.ts +10 -0
  61. package/dist/runtime/components/Navbar.vue +24 -33
  62. package/dist/runtime/components/Navbar.vue.d.ts +101 -0
  63. package/dist/runtime/components/NavbarDivider.vue +24 -33
  64. package/dist/runtime/components/NavbarDivider.vue.d.ts +101 -0
  65. package/dist/runtime/components/NavbarSection.vue +24 -33
  66. package/dist/runtime/components/NavbarSection.vue.d.ts +101 -0
  67. package/dist/runtime/components/NavbarSpacer.vue +24 -33
  68. package/dist/runtime/components/NavbarSpacer.vue.d.ts +101 -0
  69. package/dist/runtime/components/NavigationMenu.vue +152 -216
  70. package/dist/runtime/components/NavigationMenu.vue.d.ts +824 -0
  71. package/dist/runtime/components/OverlayProvider.vue +13 -17
  72. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  73. package/dist/runtime/components/Popover.vue +81 -81
  74. package/dist/runtime/components/Popover.vue.d.ts +147 -0
  75. package/dist/runtime/components/Progress.vue +109 -136
  76. package/dist/runtime/components/Progress.vue.d.ts +592 -0
  77. package/dist/runtime/components/RadioGroup.vue +120 -134
  78. package/dist/runtime/components/RadioGroup.vue.d.ts +723 -0
  79. package/dist/runtime/components/Range.vue +94 -85
  80. package/dist/runtime/components/Range.vue.d.ts +417 -0
  81. package/dist/runtime/components/Select.vue +212 -260
  82. package/dist/runtime/components/Select.vue.d.ts +1200 -0
  83. package/dist/runtime/components/SelectMenu.vue +272 -366
  84. package/dist/runtime/components/SelectMenu.vue.d.ts +1298 -0
  85. package/dist/runtime/components/Separator.vue +61 -71
  86. package/dist/runtime/components/Separator.vue.d.ts +400 -0
  87. package/dist/runtime/components/Sidebar.vue +24 -33
  88. package/dist/runtime/components/Sidebar.vue.d.ts +101 -0
  89. package/dist/runtime/components/SidebarBody.vue +30 -38
  90. package/dist/runtime/components/SidebarBody.vue.d.ts +90 -0
  91. package/dist/runtime/components/SidebarFooter.vue +24 -33
  92. package/dist/runtime/components/SidebarFooter.vue.d.ts +101 -0
  93. package/dist/runtime/components/SidebarHeader.vue +24 -33
  94. package/dist/runtime/components/SidebarHeader.vue.d.ts +101 -0
  95. package/dist/runtime/components/SidebarHeading.vue +24 -33
  96. package/dist/runtime/components/SidebarHeading.vue.d.ts +101 -0
  97. package/dist/runtime/components/SidebarLayout.vue +40 -70
  98. package/dist/runtime/components/SidebarLayout.vue.d.ts +222 -0
  99. package/dist/runtime/components/SidebarSection.vue +24 -33
  100. package/dist/runtime/components/SidebarSection.vue.d.ts +101 -0
  101. package/dist/runtime/components/SidebarSpacer.vue +24 -33
  102. package/dist/runtime/components/SidebarSpacer.vue.d.ts +101 -0
  103. package/dist/runtime/components/Skeleton.vue +17 -22
  104. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  105. package/dist/runtime/components/Slideover.vue +108 -131
  106. package/dist/runtime/components/Slideover.vue.d.ts +360 -0
  107. package/dist/runtime/components/StackedLayout.vue +40 -73
  108. package/dist/runtime/components/StackedLayout.vue.d.ts +192 -0
  109. package/dist/runtime/components/Switch.vue +100 -95
  110. package/dist/runtime/components/Switch.vue.d.ts +587 -0
  111. package/dist/runtime/components/Tabs.vue +83 -105
  112. package/dist/runtime/components/Tabs.vue.d.ts +453 -0
  113. package/dist/runtime/components/Textarea.vue +177 -201
  114. package/dist/runtime/components/Textarea.vue.d.ts +601 -0
  115. package/dist/runtime/components/Toast.vue +94 -105
  116. package/dist/runtime/components/Toast.vue.d.ts +438 -0
  117. package/dist/runtime/components/Toaster.vue +94 -111
  118. package/dist/runtime/components/Toaster.vue.d.ts +219 -0
  119. package/dist/runtime/components/Tooltip.vue +78 -64
  120. package/dist/runtime/components/Tooltip.vue.d.ts +186 -0
  121. package/dist/runtime/components/content/TableWrapper.vue +58 -70
  122. package/dist/runtime/components/content/TableWrapper.vue.d.ts +237 -0
  123. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  124. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  125. package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
  126. package/dist/runtime/composables/useFormField.d.ts +1 -1
  127. package/dist/runtime/prose/A.vue +18 -23
  128. package/dist/runtime/prose/A.vue.d.ts +84 -0
  129. package/dist/runtime/prose/Blockquote.vue +18 -23
  130. package/dist/runtime/prose/Blockquote.vue.d.ts +84 -0
  131. package/dist/runtime/prose/Code.vue +23 -31
  132. package/dist/runtime/prose/Code.vue.d.ts +97 -0
  133. package/dist/runtime/prose/Em.vue +18 -23
  134. package/dist/runtime/prose/Em.vue.d.ts +84 -0
  135. package/dist/runtime/prose/H1.vue +18 -23
  136. package/dist/runtime/prose/H1.vue.d.ts +97 -0
  137. package/dist/runtime/prose/H2.vue +18 -23
  138. package/dist/runtime/prose/H2.vue.d.ts +123 -0
  139. package/dist/runtime/prose/H3.vue +18 -23
  140. package/dist/runtime/prose/H3.vue.d.ts +123 -0
  141. package/dist/runtime/prose/H4.vue +18 -23
  142. package/dist/runtime/prose/H4.vue.d.ts +123 -0
  143. package/dist/runtime/prose/H5.vue +18 -23
  144. package/dist/runtime/prose/H5.vue.d.ts +123 -0
  145. package/dist/runtime/prose/H6.vue +18 -23
  146. package/dist/runtime/prose/H6.vue.d.ts +123 -0
  147. package/dist/runtime/prose/Hr.vue +18 -19
  148. package/dist/runtime/prose/Hr.vue.d.ts +74 -0
  149. package/dist/runtime/prose/Img.vue +18 -23
  150. package/dist/runtime/prose/Img.vue.d.ts +77 -0
  151. package/dist/runtime/prose/Li.vue +18 -23
  152. package/dist/runtime/prose/Li.vue.d.ts +84 -0
  153. package/dist/runtime/prose/Ol.vue +18 -23
  154. package/dist/runtime/prose/Ol.vue.d.ts +84 -0
  155. package/dist/runtime/prose/P.vue +18 -23
  156. package/dist/runtime/prose/P.vue.d.ts +84 -0
  157. package/dist/runtime/prose/Pre.vue +28 -33
  158. package/dist/runtime/prose/Pre.vue.d.ts +117 -0
  159. package/dist/runtime/prose/Strong.vue +18 -23
  160. package/dist/runtime/prose/Strong.vue.d.ts +84 -0
  161. package/dist/runtime/prose/Table.vue +44 -54
  162. package/dist/runtime/prose/Table.vue.d.ts +144 -0
  163. package/dist/runtime/prose/Tbody.vue +18 -23
  164. package/dist/runtime/prose/Tbody.vue.d.ts +84 -0
  165. package/dist/runtime/prose/Td.vue +18 -23
  166. package/dist/runtime/prose/Td.vue.d.ts +84 -0
  167. package/dist/runtime/prose/Th.vue +18 -23
  168. package/dist/runtime/prose/Th.vue.d.ts +84 -0
  169. package/dist/runtime/prose/Thead.vue +18 -23
  170. package/dist/runtime/prose/Thead.vue.d.ts +84 -0
  171. package/dist/runtime/prose/Tr.vue +18 -23
  172. package/dist/runtime/prose/Tr.vue.d.ts +84 -0
  173. package/dist/runtime/prose/Ul.vue +18 -23
  174. package/dist/runtime/prose/Ul.vue.d.ts +84 -0
  175. package/dist/runtime/vue/components/Link.vue +201 -202
  176. package/dist/runtime/vue/components/Link.vue.d.ts +129 -0
  177. package/dist/runtime/vue/stubs.d.ts +3 -3
  178. package/dist/shared/{b24ui-nuxt.C1lGF53R.mjs → b24ui-nuxt.CS9Lf0os.mjs} +4 -3
  179. package/dist/types.d.mts +3 -5
  180. package/dist/unplugin.mjs +1 -1
  181. package/dist/vite.mjs +1 -1
  182. package/package.json +59 -32
  183. package/dist/meta.cjs +0 -72220
  184. package/dist/meta.d.cts +0 -72218
  185. package/dist/meta.d.ts +0 -72218
  186. package/dist/module.cjs +0 -59
  187. package/dist/module.d.cts +0 -15
  188. package/dist/module.d.ts +0 -15
  189. package/dist/shared/b24ui-nuxt.BVg3rkkG.cjs +0 -7720
  190. package/dist/types.d.ts +0 -7
  191. package/dist/unplugin.cjs +0 -236
  192. package/dist/unplugin.d.cts +0 -33
  193. package/dist/unplugin.d.ts +0 -33
  194. package/dist/vite.cjs +0 -21
  195. package/dist/vite.d.cts +0 -14
  196. 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,88 @@
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 { useForwardPropsEmits } from "reka-ui";
13
+ import { reactivePick } from "@vueuse/core";
14
+ import { omit } from "../utils";
15
+ const props = defineProps({
16
+ size: {
17
+ type: null,
18
+ required: false
19
+ },
20
+ items: {
21
+ type: null,
22
+ required: false
23
+ },
24
+ checkedIcon: {
25
+ type: [Function, Object],
26
+ required: false
27
+ },
28
+ externalIcon: {
29
+ type: [Boolean, Function, Object],
30
+ required: false,
31
+ default: true
32
+ },
33
+ content: {
34
+ type: Object,
35
+ required: false
36
+ },
37
+ arrow: {
38
+ type: [Boolean, Object],
39
+ required: false
40
+ },
41
+ portal: {
42
+ type: Boolean,
43
+ required: false,
44
+ default: true
45
+ },
46
+ labelKey: {
47
+ type: null,
48
+ required: false,
49
+ default: "label"
50
+ },
51
+ disabled: {
52
+ type: Boolean,
53
+ required: false
54
+ },
55
+ class: {
56
+ type: null,
57
+ required: false
58
+ },
59
+ b24ui: {
60
+ type: null,
61
+ required: false
62
+ },
63
+ defaultOpen: {
64
+ type: Boolean,
65
+ required: false
66
+ },
67
+ open: {
68
+ type: Boolean,
69
+ required: false
70
+ },
71
+ modal: {
72
+ type: Boolean,
73
+ required: false,
74
+ default: true
75
+ }
76
+ });
77
+ const emits = defineEmits(["update:open"]);
78
+ const slots = defineSlots();
79
+ const rootProps = useForwardPropsEmits(reactivePick(props, "defaultOpen", "open", "modal"), emits);
80
+ const contentProps = toRef(() => defu(props.content, { side: "bottom", sideOffset: 8, collisionPadding: 8 }));
81
+ const arrowProps = toRef(() => props.arrow);
82
+ const proxySlots = omit(slots, ["default"]);
139
83
  const b24ui = computed(() => dropdownMenu({
140
84
  size: props.size
141
- }))
85
+ }));
142
86
  </script>
143
87
 
144
88
  <template>
@@ -154,12 +98,12 @@ const b24ui = computed(() => dropdownMenu({
154
98
  v-bind="contentProps"
155
99
  :items="items"
156
100
  :portal="portal"
157
- :label-key="(labelKey as keyof NestedItem<T>)"
101
+ :label-key="labelKey"
158
102
  :checked-icon="checkedIcon"
159
103
  :external-icon="externalIcon"
160
104
  >
161
105
  <template v-for="(_, name) in proxySlots" #[name]="slotData">
162
- <slot :name="(name as keyof DropdownMenuSlots<T>)" v-bind="slotData" />
106
+ <slot :name="name" v-bind="slotData" />
163
107
  </template>
164
108
 
165
109
  <DropdownMenuArrow v-if="!!arrow" v-bind="arrowProps" :class="b24ui.arrow({ class: props.b24ui?.arrow })" />