@nuxt/ui 2.10.0 → 2.11.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 (208) hide show
  1. package/README.md +11 -0
  2. package/dist/module.d.mts +387 -104
  3. package/dist/module.d.ts +387 -104
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +16 -7
  6. package/dist/runtime/components/data/Table.vue +3 -3
  7. package/dist/runtime/components/data/Table.vue.d.ts +7 -7
  8. package/dist/runtime/components/elements/Accordion.vue +2 -2
  9. package/dist/runtime/components/elements/Accordion.vue.d.ts +7 -7
  10. package/dist/runtime/components/elements/Alert.vue +13 -12
  11. package/dist/runtime/components/elements/Alert.vue.d.ts +12 -11
  12. package/dist/runtime/components/elements/Avatar.vue +2 -2
  13. package/dist/runtime/components/elements/Avatar.vue.d.ts +11 -10
  14. package/dist/runtime/components/elements/AvatarGroup.d.ts +11 -10
  15. package/dist/runtime/components/elements/AvatarGroup.mjs +2 -2
  16. package/dist/runtime/components/elements/Badge.vue +6 -4
  17. package/dist/runtime/components/elements/Badge.vue.d.ts +11 -11
  18. package/dist/runtime/components/elements/Button.vue +16 -12
  19. package/dist/runtime/components/elements/Button.vue.d.ts +13 -12
  20. package/dist/runtime/components/elements/ButtonGroup.d.ts +12 -11
  21. package/dist/runtime/components/elements/ButtonGroup.mjs +8 -34
  22. package/dist/runtime/components/elements/Chip.vue +85 -0
  23. package/dist/runtime/components/elements/Chip.vue.d.ts +90 -0
  24. package/dist/runtime/components/elements/Dropdown.vue +35 -21
  25. package/dist/runtime/components/elements/Dropdown.vue.d.ts +13 -7
  26. package/dist/runtime/components/elements/Icon.vue +16 -2
  27. package/dist/runtime/components/elements/Icon.vue.d.ts +14 -2
  28. package/dist/runtime/components/elements/Kbd.vue +2 -2
  29. package/dist/runtime/components/elements/Kbd.vue.d.ts +12 -11
  30. package/dist/runtime/components/elements/Link.vue +2 -5
  31. package/dist/runtime/components/elements/Meter.vue +2 -2
  32. package/dist/runtime/components/elements/Meter.vue.d.ts +9 -9
  33. package/dist/runtime/components/elements/MeterGroup.d.ts +10 -10
  34. package/dist/runtime/components/elements/MeterGroup.mjs +8 -21
  35. package/dist/runtime/components/elements/Progress.vue +6 -95
  36. package/dist/runtime/components/elements/Progress.vue.d.ts +123 -1
  37. package/dist/runtime/components/forms/Checkbox.vue +8 -10
  38. package/dist/runtime/components/forms/Checkbox.vue.d.ts +10 -10
  39. package/dist/runtime/components/forms/Form.vue +1 -1
  40. package/dist/runtime/components/forms/FormGroup.vue +9 -5
  41. package/dist/runtime/components/forms/FormGroup.vue.d.ts +21 -11
  42. package/dist/runtime/components/forms/Input.vue +43 -12
  43. package/dist/runtime/components/forms/Input.vue.d.ts +38 -15
  44. package/dist/runtime/components/forms/Radio.vue +18 -12
  45. package/dist/runtime/components/forms/Radio.vue.d.ts +11 -10
  46. package/dist/runtime/components/forms/RadioGroup.vue +3 -3
  47. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +13 -13
  48. package/dist/runtime/components/forms/Range.vue +5 -5
  49. package/dist/runtime/components/forms/Range.vue.d.ts +11 -10
  50. package/dist/runtime/components/forms/Select.vue +12 -9
  51. package/dist/runtime/components/forms/Select.vue.d.ts +15 -14
  52. package/dist/runtime/components/forms/SelectMenu.vue +42 -25
  53. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +28 -19
  54. package/dist/runtime/components/forms/Textarea.vue +36 -6
  55. package/dist/runtime/components/forms/Textarea.vue.d.ts +37 -14
  56. package/dist/runtime/components/forms/Toggle.vue +25 -7
  57. package/dist/runtime/components/forms/Toggle.vue.d.ts +20 -7
  58. package/dist/runtime/components/layout/Card.vue +2 -2
  59. package/dist/runtime/components/layout/Card.vue.d.ts +7 -7
  60. package/dist/runtime/components/layout/Container.vue +2 -2
  61. package/dist/runtime/components/layout/Container.vue.d.ts +7 -7
  62. package/dist/runtime/components/layout/Divider.vue +3 -8
  63. package/dist/runtime/components/layout/Divider.vue.d.ts +9 -9
  64. package/dist/runtime/components/layout/Skeleton.vue +2 -2
  65. package/dist/runtime/components/layout/Skeleton.vue.d.ts +7 -7
  66. package/dist/runtime/components/navigation/Breadcrumb.vue +78 -0
  67. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +50 -0
  68. package/dist/runtime/components/navigation/CommandPalette.vue +50 -37
  69. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +15 -8
  70. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -3
  71. package/dist/runtime/components/navigation/Pagination.vue +7 -7
  72. package/dist/runtime/components/navigation/Pagination.vue.d.ts +11 -11
  73. package/dist/runtime/components/navigation/Tabs.vue +8 -5
  74. package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -10
  75. package/dist/runtime/components/navigation/VerticalNavigation.vue +2 -2
  76. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +7 -7
  77. package/dist/runtime/components/overlays/ContextMenu.vue +4 -3
  78. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +7 -7
  79. package/dist/runtime/components/overlays/Modal.vue +3 -6
  80. package/dist/runtime/components/overlays/Modal.vue.d.ts +7 -7
  81. package/dist/runtime/components/overlays/Notification.vue +30 -31
  82. package/dist/runtime/components/overlays/Notification.vue.d.ts +10 -9
  83. package/dist/runtime/components/overlays/Notifications.vue +18 -16
  84. package/dist/runtime/components/overlays/Notifications.vue.d.ts +7 -7
  85. package/dist/runtime/components/overlays/Popover.vue +14 -4
  86. package/dist/runtime/components/overlays/Popover.vue.d.ts +20 -9
  87. package/dist/runtime/components/overlays/Slideover.vue +6 -6
  88. package/dist/runtime/components/overlays/Slideover.vue.d.ts +7 -7
  89. package/dist/runtime/components/overlays/Tooltip.vue +6 -5
  90. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +7 -7
  91. package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
  92. package/dist/runtime/composables/defineShortcuts.mjs +8 -4
  93. package/dist/runtime/composables/useButtonGroup.d.ts +20 -0
  94. package/dist/runtime/composables/useButtonGroup.mjs +52 -0
  95. package/dist/runtime/composables/useFormGroup.d.ts +2 -0
  96. package/dist/runtime/composables/useFormGroup.mjs +3 -2
  97. package/dist/runtime/composables/useShortcuts.d.ts +2 -2
  98. package/dist/runtime/composables/useUI.d.ts +3 -3
  99. package/dist/runtime/types/alert.d.ts +7 -0
  100. package/dist/runtime/types/avatar.d.ts +3 -1
  101. package/dist/runtime/types/badge.d.ts +5 -4
  102. package/dist/runtime/types/breadcrumb.d.ts +9 -0
  103. package/dist/runtime/types/button.d.ts +5 -4
  104. package/dist/runtime/types/chip.d.ts +11 -0
  105. package/dist/runtime/types/dropdown.d.ts +2 -2
  106. package/dist/runtime/types/form-group.d.ts +5 -0
  107. package/dist/runtime/types/form.d.ts +3 -2
  108. package/dist/runtime/types/index.d.ts +10 -0
  109. package/dist/runtime/types/input.d.ts +8 -0
  110. package/dist/runtime/types/kbd.d.ts +5 -0
  111. package/dist/runtime/types/popper.d.ts +2 -0
  112. package/dist/runtime/types/range.d.ts +5 -0
  113. package/dist/runtime/types/select.d.ts +8 -0
  114. package/dist/runtime/types/textarea.d.ts +8 -0
  115. package/dist/runtime/types/toggle.d.ts +5 -0
  116. package/dist/runtime/types/utils.d.ts +24 -7
  117. package/dist/runtime/ui.config/data/table.d.ts +60 -0
  118. package/dist/runtime/ui.config/data/table.mjs +59 -0
  119. package/dist/runtime/ui.config/elements/accordion.d.ts +21 -0
  120. package/dist/runtime/ui.config/elements/accordion.mjs +20 -0
  121. package/dist/runtime/ui.config/elements/alert.d.ts +41 -0
  122. package/dist/runtime/ui.config/elements/alert.mjs +40 -0
  123. package/dist/runtime/ui.config/elements/avatar.d.ts +60 -0
  124. package/dist/runtime/ui.config/elements/avatar.mjs +59 -0
  125. package/dist/runtime/ui.config/elements/avatarGroup.d.ts +6 -0
  126. package/dist/runtime/ui.config/elements/avatarGroup.mjs +5 -0
  127. package/dist/runtime/ui.config/elements/badge.d.ts +34 -0
  128. package/dist/runtime/ui.config/elements/badge.mjs +33 -0
  129. package/dist/runtime/ui.config/elements/button.d.ts +81 -0
  130. package/dist/runtime/ui.config/elements/button.mjs +80 -0
  131. package/dist/runtime/ui.config/elements/buttonGroup.d.ts +101 -0
  132. package/dist/runtime/ui.config/elements/buttonGroup.mjs +19 -0
  133. package/dist/runtime/ui.config/elements/chip.d.ts +35 -0
  134. package/dist/runtime/ui.config/elements/chip.mjs +34 -0
  135. package/dist/runtime/ui.config/elements/dropdown.d.ts +55 -0
  136. package/dist/runtime/ui.config/elements/dropdown.mjs +53 -0
  137. package/dist/runtime/ui.config/elements/kbd.d.ts +17 -0
  138. package/dist/runtime/ui.config/elements/kbd.mjs +16 -0
  139. package/dist/runtime/ui.config/elements/meter.d.ts +77 -0
  140. package/dist/runtime/ui.config/elements/meter.mjs +76 -0
  141. package/dist/runtime/ui.config/elements/meterGroup.d.ts +52 -0
  142. package/dist/runtime/ui.config/elements/meterGroup.mjs +24 -0
  143. package/dist/runtime/ui.config/elements/progress.d.ts +75 -0
  144. package/dist/runtime/ui.config/elements/progress.mjs +74 -0
  145. package/dist/runtime/ui.config/forms/checkbox.d.ts +19 -0
  146. package/dist/runtime/ui.config/forms/checkbox.mjs +18 -0
  147. package/dist/runtime/ui.config/forms/formGroup.d.ts +25 -0
  148. package/dist/runtime/ui.config/forms/formGroup.mjs +25 -0
  149. package/dist/runtime/ui.config/forms/input.d.ts +107 -0
  150. package/dist/runtime/ui.config/forms/input.mjs +106 -0
  151. package/dist/runtime/ui.config/forms/radio.d.ts +18 -0
  152. package/dist/runtime/ui.config/forms/radio.mjs +17 -0
  153. package/dist/runtime/ui.config/forms/radioGroup.d.ts +8 -0
  154. package/dist/runtime/ui.config/forms/radioGroup.mjs +7 -0
  155. package/dist/runtime/ui.config/forms/range.d.ts +64 -0
  156. package/dist/runtime/ui.config/forms/range.mjs +63 -0
  157. package/dist/runtime/ui.config/forms/select.d.ts +108 -0
  158. package/dist/runtime/ui.config/forms/select.mjs +13 -0
  159. package/dist/runtime/ui.config/forms/selectMenu.d.ts +68 -0
  160. package/dist/runtime/ui.config/forms/selectMenu.mjs +66 -0
  161. package/dist/runtime/ui.config/forms/textarea.d.ts +106 -0
  162. package/dist/runtime/ui.config/forms/textarea.mjs +10 -0
  163. package/dist/runtime/ui.config/forms/toggle.d.ts +61 -0
  164. package/dist/runtime/ui.config/forms/toggle.mjs +60 -0
  165. package/dist/runtime/ui.config/index.d.ts +40 -0
  166. package/dist/runtime/ui.config/index.mjs +40 -0
  167. package/dist/runtime/ui.config/layout/card.d.ts +24 -0
  168. package/dist/runtime/ui.config/layout/card.mjs +23 -0
  169. package/dist/runtime/ui.config/layout/container.d.ts +6 -0
  170. package/dist/runtime/ui.config/layout/container.mjs +5 -0
  171. package/dist/runtime/ui.config/layout/divider.d.ts +35 -0
  172. package/dist/runtime/ui.config/layout/divider.mjs +34 -0
  173. package/dist/runtime/ui.config/layout/skeleton.d.ts +6 -0
  174. package/dist/runtime/ui.config/layout/skeleton.mjs +5 -0
  175. package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +20 -0
  176. package/dist/runtime/ui.config/navigation/breadcrumb.mjs +19 -0
  177. package/dist/runtime/ui.config/navigation/commandPalette.d.ts +72 -0
  178. package/dist/runtime/ui.config/navigation/commandPalette.mjs +71 -0
  179. package/dist/runtime/ui.config/navigation/pagination.d.ts +35 -0
  180. package/dist/runtime/ui.config/navigation/pagination.mjs +34 -0
  181. package/dist/runtime/ui.config/navigation/tabs.d.ts +34 -0
  182. package/dist/runtime/ui.config/navigation/tabs.mjs +33 -0
  183. package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +28 -0
  184. package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +27 -0
  185. package/dist/runtime/ui.config/overlays/contextMenu.d.ts +31 -0
  186. package/dist/runtime/ui.config/overlays/contextMenu.mjs +25 -0
  187. package/dist/runtime/ui.config/overlays/modal.d.ts +36 -0
  188. package/dist/runtime/ui.config/overlays/modal.mjs +37 -0
  189. package/dist/runtime/ui.config/overlays/notification.d.ts +50 -0
  190. package/dist/runtime/ui.config/overlays/notification.mjs +50 -0
  191. package/dist/runtime/ui.config/overlays/notifications.d.ts +7 -0
  192. package/dist/runtime/ui.config/overlays/notifications.mjs +6 -0
  193. package/dist/runtime/ui.config/overlays/popover.d.ts +43 -0
  194. package/dist/runtime/ui.config/overlays/popover.mjs +37 -0
  195. package/dist/runtime/ui.config/overlays/slideover.d.ts +32 -0
  196. package/dist/runtime/ui.config/overlays/slideover.mjs +33 -0
  197. package/dist/runtime/ui.config/overlays/tooltip.d.ts +33 -0
  198. package/dist/runtime/ui.config/overlays/tooltip.mjs +27 -0
  199. package/dist/runtime/ui.config/popper.d.ts +8 -0
  200. package/dist/runtime/ui.config/popper.mjs +8 -0
  201. package/dist/runtime/ui.css +1 -13
  202. package/dist/runtime/utils/index.d.ts +5 -0
  203. package/dist/runtime/utils/index.mjs +7 -3
  204. package/dist/types.d.mts +3 -2
  205. package/dist/types.d.ts +3 -2
  206. package/package.json +32 -21
  207. package/dist/runtime/ui.config.d.ts +0 -1470
  208. package/dist/runtime/ui.config.mjs +0 -1273
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "2.10.0",
3
+ "version": "2.11.1",
4
4
  "configKey": "ui",
5
5
  "compatibility": {
6
6
  "nuxt": "^3.0.0-rc.8"
package/dist/module.mjs CHANGED
@@ -3,7 +3,6 @@ import defaultColors from 'tailwindcss/colors.js';
3
3
  import { defaultExtractor as defaultExtractor$1 } from 'tailwindcss/lib/lib/defaultExtractor.js';
4
4
  import { iconsPlugin, getIconCollections } from '@egoist/tailwindcss-icons';
5
5
  import { kebabCase, upperFirst, camelCase } from 'scule';
6
- import { dirname } from 'pathe';
7
6
 
8
7
 
9
8
 
@@ -15,7 +14,7 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
15
14
  const __dirname = __cjs_path__.dirname(__filename);
16
15
  const require = __cjs_mod__.createRequire(import.meta.url);
17
16
  const name = "@nuxt/ui";
18
- const version = "2.10.0";
17
+ const version = "2.11.1";
19
18
 
20
19
  function omit(object, keysToOmit) {
21
20
  const result = { ...object };
@@ -221,6 +220,12 @@ const safelistByComponent = {
221
220
  variants: ["dark"]
222
221
  }, {
223
222
  pattern: new RegExp(`text-(${colorsAsRegex2})-500`)
223
+ }],
224
+ chip: (colorsAsRegex2) => [{
225
+ pattern: new RegExp(`bg-(${colorsAsRegex2})-400`),
226
+ variants: ["dark"]
227
+ }, {
228
+ pattern: new RegExp(`bg-(${colorsAsRegex2})-500`)
224
229
  }]
225
230
  };
226
231
  const safelistComponentAliasesMap = {
@@ -290,7 +295,7 @@ function createTemplates(nuxt = useNuxt()) {
290
295
  getContents: () => `declare module '#ui-colors' { const defaultExport: ${JSON.stringify(nuxt.options.appConfig.ui.colors)}; export default defaultExport; }`,
291
296
  write: true
292
297
  });
293
- nuxt.options.alias["#ui-colors"] = dirname(template.dst);
298
+ nuxt.options.alias["#ui-colors"] = template.dst;
294
299
  nuxt.hook("prepare:types", (opts) => {
295
300
  opts.references.push({ path: typesTemplate.dst });
296
301
  });
@@ -324,11 +329,13 @@ const module = defineNuxtModule({
324
329
  nuxt.options.alias["#ui"] = runtimeDir;
325
330
  nuxt.options.css.push(resolve(runtimeDir, "ui.css"));
326
331
  nuxt.hook("tailwindcss:config", function(tailwindConfig) {
332
+ tailwindConfig.theme = tailwindConfig.theme || {};
333
+ tailwindConfig.theme.extend = tailwindConfig.theme.extend || {};
334
+ tailwindConfig.theme.extend.colors = tailwindConfig.theme.extend.colors || {};
327
335
  const globalColors = {
328
336
  ...tailwindConfig.theme.colors || defaultColors,
329
337
  ...tailwindConfig.theme.extend?.colors
330
338
  };
331
- tailwindConfig.theme.extend.colors = tailwindConfig.theme.extend.colors || {};
332
339
  globalColors.primary = tailwindConfig.theme.extend.colors.primary = {
333
340
  50: "rgb(var(--color-primary-50) / <alpha-value>)",
334
341
  100: "rgb(var(--color-primary-100) / <alpha-value>)",
@@ -367,11 +374,12 @@ const module = defineNuxtModule({
367
374
  strategy: "merge"
368
375
  };
369
376
  tailwindConfig.safelist = tailwindConfig.safelist || [];
370
- tailwindConfig.safelist.push(...generateSafelist(options.safelistColors, colors));
377
+ tailwindConfig.safelist.push(...generateSafelist(options.safelistColors || [], colors));
371
378
  tailwindConfig.plugins = tailwindConfig.plugins || [];
372
- tailwindConfig.plugins.push(iconsPlugin({ collections: getIconCollections(options.icons) }));
379
+ tailwindConfig.plugins.push(iconsPlugin(Array.isArray(options.icons) || options.icons === "all" ? { collections: getIconCollections(options.icons) } : typeof options.icons === "object" ? options.icons : {}));
373
380
  });
374
381
  createTemplates(nuxt);
382
+ await installModule("nuxt-icon");
375
383
  await installModule("@nuxtjs/color-mode", { classSuffix: "" });
376
384
  await installModule("@nuxtjs/tailwindcss", {
377
385
  exposeConfig: true,
@@ -387,7 +395,7 @@ const module = defineNuxtModule({
387
395
  content: {
388
396
  files: [
389
397
  resolve(runtimeDir, "components/**/*.{vue,mjs,ts}"),
390
- resolve(runtimeDir, "*.{mjs,js,ts}")
398
+ resolve(runtimeDir, "ui.config/**/*.{mjs,js,ts}")
391
399
  ],
392
400
  transform: {
393
401
  vue: (content) => {
@@ -398,6 +406,7 @@ const module = defineNuxtModule({
398
406
  vue: (content) => {
399
407
  return [
400
408
  ...defaultExtractor(content),
409
+ // @ts-ignore
401
410
  ...customSafelistExtractor(options.prefix, content, nuxt.options.appConfig.ui.colors, options.safelistColors)
402
411
  ];
403
412
  }
@@ -11,7 +11,7 @@
11
11
  <slot :name="`${column.key}-header`" :column="column" :sort="sort" :on-sort="onSort">
12
12
  <UButton
13
13
  v-if="column.sortable"
14
- v-bind="{ ...ui.default.sortButton, ...sortButton }"
14
+ v-bind="{ ...(ui.default.sortButton || {}), ...sortButton }"
15
15
  :icon="(!sort.column || sort.column !== column.key) ? (sortButton.icon || ui.default.sortButton.icon) : sort.direction === 'asc' ? sortAscIcon : sortDescIcon"
16
16
  :label="column[columnAttribute]"
17
17
  @click="onSort(column)"
@@ -139,11 +139,11 @@ export default defineComponent({
139
139
  },
140
140
  class: {
141
141
  type: [String, Object, Array],
142
- default: void 0
142
+ default: () => ""
143
143
  },
144
144
  ui: {
145
145
  type: Object,
146
- default: void 0
146
+ default: () => ({})
147
147
  }
148
148
  },
149
149
  emits: ["update:modelValue", "update:sort"],
@@ -70,11 +70,11 @@ declare const _default: import("vue").DefineComponent<{
70
70
  };
71
71
  class: {
72
72
  type: PropType<any>;
73
- default: undefined;
73
+ default: () => string;
74
74
  };
75
75
  ui: {
76
- type: PropType<Partial<any>>;
77
- default: undefined;
76
+ type: PropType<any>;
77
+ default: () => {};
78
78
  };
79
79
  }, {
80
80
  ui: import("vue").ComputedRef<any>;
@@ -177,11 +177,11 @@ declare const _default: import("vue").DefineComponent<{
177
177
  };
178
178
  class: {
179
179
  type: PropType<any>;
180
- default: undefined;
180
+ default: () => string;
181
181
  };
182
182
  ui: {
183
- type: PropType<Partial<any>>;
184
- default: undefined;
183
+ type: PropType<any>;
184
+ default: () => {};
185
185
  };
186
186
  }>> & {
187
187
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -191,7 +191,7 @@ declare const _default: import("vue").DefineComponent<{
191
191
  column: string;
192
192
  direction: 'asc' | 'desc';
193
193
  };
194
- ui: Partial<any>;
194
+ ui: any;
195
195
  class: any;
196
196
  modelValue: unknown[];
197
197
  by: string | Function;
@@ -87,11 +87,11 @@ export default defineComponent({
87
87
  },
88
88
  class: {
89
89
  type: [String, Object, Array],
90
- default: void 0
90
+ default: () => ""
91
91
  },
92
92
  ui: {
93
93
  type: Object,
94
- default: void 0
94
+ default: () => ({})
95
95
  }
96
96
  },
97
97
  setup(props) {
@@ -24,11 +24,11 @@ declare const _default: import("vue").DefineComponent<{
24
24
  };
25
25
  class: {
26
26
  type: PropType<any>;
27
- default: undefined;
27
+ default: () => string;
28
28
  };
29
29
  ui: {
30
- type: PropType<Partial<any>>;
31
- default: undefined;
30
+ type: PropType<any>;
31
+ default: () => {};
32
32
  };
33
33
  }, {
34
34
  ui: import("vue").ComputedRef<any>;
@@ -69,14 +69,14 @@ declare const _default: import("vue").DefineComponent<{
69
69
  };
70
70
  class: {
71
71
  type: PropType<any>;
72
- default: undefined;
72
+ default: () => string;
73
73
  };
74
74
  ui: {
75
- type: PropType<Partial<any>>;
76
- default: undefined;
75
+ type: PropType<any>;
76
+ default: () => {};
77
77
  };
78
78
  }>>, {
79
- ui: Partial<any>;
79
+ ui: any;
80
80
  class: any;
81
81
  defaultOpen: boolean;
82
82
  items: AccordionItem[];
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div :class="alertClass" v-bind="attrs">
3
- <div class="flex gap-3" :class="{ 'items-start': (description || $slots.description), 'items-center': !description && !$slots.description }">
3
+ <div class="flex" :class="[ui.gap, { 'items-start': (description || $slots.description), 'items-center': !description && !$slots.description }]">
4
4
  <UIcon v-if="icon" :name="icon" :class="ui.icon.base" />
5
5
  <UAvatar v-if="avatar" v-bind="{ size: ui.avatar.size, ...avatar }" :class="ui.avatar.base" />
6
6
 
7
- <div class="w-0 flex-1">
7
+ <div :class="ui.inner">
8
8
  <p :class="ui.title">
9
9
  <slot name="title" :title="title">
10
10
  {{ title }}
@@ -16,16 +16,16 @@
16
16
  </slot>
17
17
  </p>
18
18
 
19
- <div v-if="(description || $slots.description) && actions.length" class="mt-3 flex items-center gap-2">
20
- <UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...ui.default.actionButton, ...action }" @click.stop="action.click" />
19
+ <div v-if="(description || $slots.description) && actions.length" :class="ui.actions">
20
+ <UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="action.click" />
21
21
  </div>
22
22
  </div>
23
- <div class="flex-shrink-0 flex items-center gap-3">
24
- <div v-if="!description && !$slots.description && actions.length" class="flex items-center gap-2">
25
- <UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...ui.default.actionButton, ...action }" @click.stop="action.click" />
26
- </div>
23
+ <div v-if="closeButton || (!description && !$slots.description && actions.length)" :class="twMerge(ui.actions, 'mt-0')">
24
+ <template v-if="!description && !$slots.description && actions.length">
25
+ <UButton v-for="(action, index) of actions" :key="index" v-bind="{ ...(ui.default.actionButton || {}), ...action }" @click.stop="action.click" />
26
+ </template>
27
27
 
28
- <UButton v-if="closeButton" aria-label="Close" v-bind="{ ...ui.default.closeButton, ...closeButton }" @click.stop="$emit('close')" />
28
+ <UButton v-if="closeButton" aria-label="Close" v-bind="{ ...(ui.default.closeButton || {}), ...closeButton }" @click.stop="$emit('close')" />
29
29
  </div>
30
30
  </div>
31
31
  </div>
@@ -93,11 +93,11 @@ export default defineComponent({
93
93
  },
94
94
  class: {
95
95
  type: [String, Object, Array],
96
- default: void 0
96
+ default: () => ""
97
97
  },
98
98
  ui: {
99
99
  type: Object,
100
- default: void 0
100
+ default: () => ({})
101
101
  }
102
102
  },
103
103
  emits: ["close"],
@@ -117,7 +117,8 @@ export default defineComponent({
117
117
  // eslint-disable-next-line vue/no-dupe-keys
118
118
  ui,
119
119
  attrs,
120
- alertClass
120
+ alertClass,
121
+ twMerge
121
122
  };
122
123
  }
123
124
  });
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Avatar, Button } from '../../types';
2
+ import type { Avatar, Button, AlertVariant } from '../../types';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  title: {
5
5
  type: StringConstructor;
@@ -33,17 +33,17 @@ declare const _default: import("vue").DefineComponent<{
33
33
  validator(value: string): boolean;
34
34
  };
35
35
  variant: {
36
- type: PropType<any>;
36
+ type: PropType<AlertVariant>;
37
37
  default: () => any;
38
38
  validator(value: string): boolean;
39
39
  };
40
40
  class: {
41
41
  type: PropType<any>;
42
- default: undefined;
42
+ default: () => "";
43
43
  };
44
44
  ui: {
45
- type: PropType<Partial<any>>;
46
- default: undefined;
45
+ type: PropType<any>;
46
+ default: () => {};
47
47
  };
48
48
  }, {
49
49
  ui: import("vue").ComputedRef<any>;
@@ -51,6 +51,7 @@ declare const _default: import("vue").DefineComponent<{
51
51
  [x: string]: unknown;
52
52
  }, string>>;
53
53
  alertClass: import("vue").ComputedRef<string>;
54
+ twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
54
55
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
55
56
  title: {
56
57
  type: StringConstructor;
@@ -84,21 +85,22 @@ declare const _default: import("vue").DefineComponent<{
84
85
  validator(value: string): boolean;
85
86
  };
86
87
  variant: {
87
- type: PropType<any>;
88
+ type: PropType<AlertVariant>;
88
89
  default: () => any;
89
90
  validator(value: string): boolean;
90
91
  };
91
92
  class: {
92
93
  type: PropType<any>;
93
- default: undefined;
94
+ default: () => "";
94
95
  };
95
96
  ui: {
96
- type: PropType<Partial<any>>;
97
- default: undefined;
97
+ type: PropType<any>;
98
+ default: () => {};
98
99
  };
99
100
  }>> & {
100
101
  onClose?: ((...args: any[]) => any) | undefined;
101
102
  }, {
103
+ ui: any;
102
104
  description: string;
103
105
  icon: string;
104
106
  avatar: Avatar;
@@ -107,8 +109,7 @@ declare const _default: import("vue").DefineComponent<{
107
109
  click?: Function | undefined;
108
110
  })[];
109
111
  color: any;
110
- ui: Partial<any>;
111
112
  class: any;
112
- variant: any;
113
+ variant: AlertVariant;
113
114
  }, {}>;
114
115
  export default _default;
@@ -81,11 +81,11 @@ export default defineComponent({
81
81
  },
82
82
  class: {
83
83
  type: [String, Object, Array],
84
- default: void 0
84
+ default: () => ""
85
85
  },
86
86
  ui: {
87
87
  type: Object,
88
- default: void 0
88
+ default: () => ({})
89
89
  }
90
90
  },
91
91
  setup(props) {
@@ -1,4 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
+ import type { AvatarSize } from '../../types';
2
3
  declare const _default: import("vue").DefineComponent<{
3
4
  src: {
4
5
  type: (BooleanConstructor | StringConstructor)[];
@@ -17,7 +18,7 @@ declare const _default: import("vue").DefineComponent<{
17
18
  default: () => any;
18
19
  };
19
20
  size: {
20
- type: PropType<"sm" | "3xs" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl" | "3xl">;
21
+ type: PropType<AvatarSize>;
21
22
  default: () => any;
22
23
  validator(value: string): boolean;
23
24
  };
@@ -41,11 +42,11 @@ declare const _default: import("vue").DefineComponent<{
41
42
  };
42
43
  class: {
43
44
  type: PropType<any>;
44
- default: undefined;
45
+ default: () => "";
45
46
  };
46
47
  ui: {
47
- type: PropType<Partial<any>>;
48
- default: undefined;
48
+ type: PropType<any>;
49
+ default: () => {};
49
50
  };
50
51
  }, {
51
52
  ui: import("vue").ComputedRef<any>;
@@ -78,7 +79,7 @@ declare const _default: import("vue").DefineComponent<{
78
79
  default: () => any;
79
80
  };
80
81
  size: {
81
- type: PropType<"sm" | "3xs" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl" | "3xl">;
82
+ type: PropType<AvatarSize>;
82
83
  default: () => any;
83
84
  validator(value: string): boolean;
84
85
  };
@@ -102,20 +103,20 @@ declare const _default: import("vue").DefineComponent<{
102
103
  };
103
104
  class: {
104
105
  type: PropType<any>;
105
- default: undefined;
106
+ default: () => "";
106
107
  };
107
108
  ui: {
108
- type: PropType<Partial<any>>;
109
- default: undefined;
109
+ type: PropType<any>;
110
+ default: () => {};
110
111
  };
111
112
  }>>, {
112
113
  alt: string;
114
+ size: AvatarSize;
115
+ ui: any;
113
116
  icon: string;
114
- ui: Partial<any>;
115
117
  class: any;
116
118
  src: string | boolean;
117
119
  text: string;
118
- size: "sm" | "3xs" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl" | "3xl";
119
120
  chipColor: any;
120
121
  chipPosition: "top-right" | "bottom-right" | "top-left" | "bottom-left";
121
122
  chipText: string | number;
@@ -1,7 +1,8 @@
1
1
  import type { PropType } from 'vue';
2
+ import type { AvatarSize } from '../../types';
2
3
  declare const _default: import("vue").DefineComponent<{
3
4
  size: {
4
- type: PropType<string | number | symbol>;
5
+ type: PropType<AvatarSize>;
5
6
  default: null;
6
7
  validator(value: string): boolean;
7
8
  };
@@ -11,17 +12,17 @@ declare const _default: import("vue").DefineComponent<{
11
12
  };
12
13
  class: {
13
14
  type: PropType<any>;
14
- default: undefined;
15
+ default: () => "";
15
16
  };
16
17
  ui: {
17
- type: PropType<Partial<any>>;
18
- default: undefined;
18
+ type: PropType<any>;
19
+ default: () => {};
19
20
  };
20
21
  }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
21
22
  [key: string]: any;
22
23
  }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
24
  size: {
24
- type: PropType<string | number | symbol>;
25
+ type: PropType<AvatarSize>;
25
26
  default: null;
26
27
  validator(value: string): boolean;
27
28
  };
@@ -31,16 +32,16 @@ declare const _default: import("vue").DefineComponent<{
31
32
  };
32
33
  class: {
33
34
  type: PropType<any>;
34
- default: undefined;
35
+ default: () => "";
35
36
  };
36
37
  ui: {
37
- type: PropType<Partial<any>>;
38
- default: undefined;
38
+ type: PropType<any>;
39
+ default: () => {};
39
40
  };
40
41
  }>>, {
41
- ui: Partial<any>;
42
+ size: AvatarSize;
43
+ ui: any;
42
44
  class: any;
43
- size: string | number | symbol;
44
45
  max: number;
45
46
  }, {}>;
46
47
  export default _default;
@@ -23,11 +23,11 @@ export default defineComponent({
23
23
  },
24
24
  class: {
25
25
  type: [String, Object, Array],
26
- default: void 0
26
+ default: () => ""
27
27
  },
28
28
  ui: {
29
29
  type: Object,
30
- default: void 0
30
+ default: () => ({})
31
31
  }
32
32
  },
33
33
  setup(props, { slots }) {
@@ -9,6 +9,7 @@ import { computed, toRef, defineComponent } from "vue";
9
9
  import { twMerge, twJoin } from "tailwind-merge";
10
10
  import { useUI } from "../../composables/useUI";
11
11
  import { mergeConfig } from "../../utils";
12
+ import { useInjectButtonGroup } from "../../composables/useButtonGroup";
12
13
  import appConfig from "#build/app.config";
13
14
  import { badge } from "#ui/ui.config";
14
15
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.badge, badge);
@@ -45,22 +46,23 @@ export default defineComponent({
45
46
  },
46
47
  class: {
47
48
  type: [String, Object, Array],
48
- default: void 0
49
+ default: () => ""
49
50
  },
50
51
  ui: {
51
52
  type: Object,
52
- default: void 0
53
+ default: () => ({})
53
54
  }
54
55
  },
55
56
  setup(props) {
56
57
  const { ui, attrs } = useUI("badge", toRef(props, "ui"), config);
58
+ const { size, rounded } = useInjectButtonGroup({ ui, props });
57
59
  const badgeClass = computed(() => {
58
60
  const variant = ui.value.color?.[props.color]?.[props.variant] || ui.value.variant[props.variant];
59
61
  return twMerge(twJoin(
60
62
  ui.value.base,
61
63
  ui.value.font,
62
- ui.value.rounded,
63
- ui.value.size[props.size],
64
+ rounded.value,
65
+ ui.value.size[size.value],
64
66
  variant?.replaceAll("{color}", props.color)
65
67
  ), props.class);
66
68
  });
@@ -1,8 +1,8 @@
1
1
  import type { PropType } from 'vue';
2
- import type { BadgeVariant } from '../../types';
2
+ import type { BadgeSize, BadgeVariant } from '../../types';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  size: {
5
- type: PropType<"sm" | "md" | "xs" | "lg">;
5
+ type: PropType<BadgeSize>;
6
6
  default: () => any;
7
7
  validator(value: string): boolean;
8
8
  };
@@ -22,11 +22,11 @@ declare const _default: import("vue").DefineComponent<{
22
22
  };
23
23
  class: {
24
24
  type: PropType<any>;
25
- default: undefined;
25
+ default: () => "";
26
26
  };
27
27
  ui: {
28
- type: PropType<Partial<any>>;
29
- default: undefined;
28
+ type: PropType<any>;
29
+ default: () => {};
30
30
  };
31
31
  }, {
32
32
  attrs: import("vue").ComputedRef<Pick<{
@@ -35,7 +35,7 @@ declare const _default: import("vue").DefineComponent<{
35
35
  badgeClass: import("vue").ComputedRef<string>;
36
36
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
37
37
  size: {
38
- type: PropType<"sm" | "md" | "xs" | "lg">;
38
+ type: PropType<BadgeSize>;
39
39
  default: () => any;
40
40
  validator(value: string): boolean;
41
41
  };
@@ -55,18 +55,18 @@ declare const _default: import("vue").DefineComponent<{
55
55
  };
56
56
  class: {
57
57
  type: PropType<any>;
58
- default: undefined;
58
+ default: () => "";
59
59
  };
60
60
  ui: {
61
- type: PropType<Partial<any>>;
62
- default: undefined;
61
+ type: PropType<any>;
62
+ default: () => {};
63
63
  };
64
64
  }>>, {
65
+ size: BadgeSize;
66
+ ui: any;
65
67
  color: any;
66
- ui: Partial<any>;
67
68
  class: any;
68
69
  label: string | number;
69
70
  variant: BadgeVariant;
70
- size: "sm" | "md" | "xs" | "lg";
71
71
  }, {}>;
72
72
  export default _default;
@@ -5,7 +5,7 @@
5
5
  </slot>
6
6
 
7
7
  <slot>
8
- <span v-if="label" :class="[truncate ? 'text-left break-all line-clamp-1' : '']">
8
+ <span v-if="label" :class="[truncate ? ui.truncate : '']">
9
9
  {{ label }}
10
10
  </span>
11
11
  </slot>
@@ -23,6 +23,7 @@ import UIcon from "../elements/Icon.vue";
23
23
  import ULink from "../elements/Link.vue";
24
24
  import { useUI } from "../../composables/useUI";
25
25
  import { mergeConfig } from "../../utils";
26
+ import { useInjectButtonGroup } from "../../composables/useButtonGroup";
26
27
  import appConfig from "#build/app.config";
27
28
  import { button } from "#ui/ui.config";
28
29
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.button, button);
@@ -115,15 +116,16 @@ export default defineComponent({
115
116
  },
116
117
  class: {
117
118
  type: [String, Object, Array],
118
- default: void 0
119
+ default: () => ""
119
120
  },
120
121
  ui: {
121
122
  type: Object,
122
- default: void 0
123
+ default: () => ({})
123
124
  }
124
125
  },
125
126
  setup(props, { slots }) {
126
127
  const { ui, attrs } = useUI("button", toRef(props, "ui"), config);
128
+ const { size, rounded } = useInjectButtonGroup({ ui, props });
127
129
  const isLeading = computed(() => {
128
130
  return props.icon && props.leading || props.icon && !props.trailing || props.loading && !props.trailing || props.leadingIcon;
129
131
  });
@@ -136,12 +138,12 @@ export default defineComponent({
136
138
  return twMerge(twJoin(
137
139
  ui.value.base,
138
140
  ui.value.font,
139
- ui.value.rounded,
140
- ui.value.size[props.size],
141
- ui.value.gap[props.size],
142
- props.padded && ui.value[isSquare.value ? "square" : "padding"][props.size],
141
+ rounded.value,
142
+ ui.value.size[size.value],
143
+ ui.value.gap[size.value],
144
+ props.padded && ui.value[isSquare.value ? "square" : "padding"][size.value],
143
145
  variant?.replaceAll("{color}", props.color),
144
- props.block ? "w-full flex justify-center items-center" : "inline-flex items-center"
146
+ props.block ? ui.value.block : ui.value.inline
145
147
  ), props.class);
146
148
  });
147
149
  const leadingIconName = computed(() => {
@@ -159,18 +161,20 @@ export default defineComponent({
159
161
  const leadingIconClass = computed(() => {
160
162
  return twJoin(
161
163
  ui.value.icon.base,
162
- ui.value.icon.size[props.size],
163
- props.loading && "animate-spin"
164
+ ui.value.icon.size[size.value],
165
+ props.loading && ui.value.icon.loading
164
166
  );
165
167
  });
166
168
  const trailingIconClass = computed(() => {
167
169
  return twJoin(
168
170
  ui.value.icon.base,
169
- ui.value.icon.size[props.size],
170
- props.loading && !isLeading.value && "animate-spin"
171
+ ui.value.icon.size[size.value],
172
+ props.loading && !isLeading.value && ui.value.icon.loading
171
173
  );
172
174
  });
173
175
  return {
176
+ // eslint-disable-next-line vue/no-dupe-keys
177
+ ui,
174
178
  attrs,
175
179
  isLeading,
176
180
  isTrailing,