@nuxt/ui 2.13.0 → 2.14.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 (112) hide show
  1. package/README.md +8 -8
  2. package/dist/module.d.mts +61 -2
  3. package/dist/module.d.ts +61 -2
  4. package/dist/module.json +2 -2
  5. package/dist/module.mjs +27 -23
  6. package/dist/runtime/components/data/Table.vue +16 -4
  7. package/dist/runtime/components/data/Table.vue.d.ts +21 -3
  8. package/dist/runtime/components/elements/Accordion.vue +11 -2
  9. package/dist/runtime/components/elements/Accordion.vue.d.ts +1 -1
  10. package/dist/runtime/components/elements/Alert.vue +2 -2
  11. package/dist/runtime/components/elements/Alert.vue.d.ts +4 -3
  12. package/dist/runtime/components/elements/Avatar.vue.d.ts +1 -1
  13. package/dist/runtime/components/elements/AvatarGroup.d.ts +1 -1
  14. package/dist/runtime/components/elements/Badge.vue.d.ts +2 -2
  15. package/dist/runtime/components/elements/Button.vue.d.ts +62 -36
  16. package/dist/runtime/components/elements/ButtonGroup.d.ts +1 -1
  17. package/dist/runtime/components/elements/Carousel.vue +19 -12
  18. package/dist/runtime/components/elements/Carousel.vue.d.ts +4 -4
  19. package/dist/runtime/components/elements/Chip.vue.d.ts +2 -2
  20. package/dist/runtime/components/elements/Dropdown.vue +3 -1
  21. package/dist/runtime/components/elements/Dropdown.vue.d.ts +3 -3
  22. package/dist/runtime/components/elements/Icon.vue.d.ts +1 -1
  23. package/dist/runtime/components/elements/Kbd.vue.d.ts +1 -1
  24. package/dist/runtime/components/elements/Link.vue +1 -1
  25. package/dist/runtime/components/elements/Link.vue.d.ts +61 -35
  26. package/dist/runtime/components/elements/Meter.vue +4 -0
  27. package/dist/runtime/components/elements/Meter.vue.d.ts +1 -1
  28. package/dist/runtime/components/elements/MeterGroup.d.ts +1 -1
  29. package/dist/runtime/components/elements/Progress.vue +4 -1
  30. package/dist/runtime/components/elements/Progress.vue.d.ts +5 -5
  31. package/dist/runtime/components/forms/Checkbox.vue +1 -6
  32. package/dist/runtime/components/forms/Checkbox.vue.d.ts +5 -14
  33. package/dist/runtime/components/forms/Form.vue +6 -3
  34. package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
  35. package/dist/runtime/components/forms/FormGroup.vue +20 -17
  36. package/dist/runtime/components/forms/FormGroup.vue.d.ts +2 -2
  37. package/dist/runtime/components/forms/Input.vue +1 -0
  38. package/dist/runtime/components/forms/Input.vue.d.ts +5 -5
  39. package/dist/runtime/components/forms/InputMenu.vue +4 -1
  40. package/dist/runtime/components/forms/InputMenu.vue.d.ts +6 -6
  41. package/dist/runtime/components/forms/Radio.vue +5 -11
  42. package/dist/runtime/components/forms/Radio.vue.d.ts +5 -5
  43. package/dist/runtime/components/forms/RadioGroup.vue +1 -0
  44. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +3 -3
  45. package/dist/runtime/components/forms/Range.vue.d.ts +3 -3
  46. package/dist/runtime/components/forms/Select.vue.d.ts +5 -5
  47. package/dist/runtime/components/forms/SelectMenu.vue +4 -1
  48. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +6 -6
  49. package/dist/runtime/components/forms/Textarea.vue +5 -1
  50. package/dist/runtime/components/forms/Textarea.vue.d.ts +14 -5
  51. package/dist/runtime/components/forms/Toggle.vue +3 -1
  52. package/dist/runtime/components/forms/Toggle.vue.d.ts +3 -3
  53. package/dist/runtime/components/layout/Card.vue +1 -1
  54. package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
  55. package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
  56. package/dist/runtime/components/layout/Divider.vue +8 -1
  57. package/dist/runtime/components/layout/Divider.vue.d.ts +15 -4
  58. package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
  59. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
  60. package/dist/runtime/components/navigation/CommandPalette.vue +3 -1
  61. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +2 -2
  62. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +3 -1
  63. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
  64. package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +1 -1
  65. package/dist/runtime/components/navigation/Pagination.vue.d.ts +1 -1
  66. package/dist/runtime/components/navigation/Tabs.vue +8 -8
  67. package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -1
  68. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
  69. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
  70. package/dist/runtime/components/overlays/Modal.vue +3 -1
  71. package/dist/runtime/components/overlays/Modal.vue.d.ts +5 -5
  72. package/dist/runtime/components/overlays/Modals.client.vue +12 -0
  73. package/dist/runtime/components/overlays/Notification.vue +2 -2
  74. package/dist/runtime/components/overlays/Notification.vue.d.ts +4 -3
  75. package/dist/runtime/components/overlays/Notifications.vue.d.ts +1 -1
  76. package/dist/runtime/components/overlays/Popover.vue +3 -1
  77. package/dist/runtime/components/overlays/Popover.vue.d.ts +3 -3
  78. package/dist/runtime/components/overlays/Slideover.vue +3 -1
  79. package/dist/runtime/components/overlays/Slideover.vue.d.ts +5 -5
  80. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +2 -2
  81. package/dist/runtime/composables/useFormGroup.d.ts +1 -1
  82. package/dist/runtime/composables/useFormGroup.mjs +9 -12
  83. package/dist/runtime/composables/useModal.d.ts +12 -0
  84. package/dist/runtime/composables/useModal.mjs +37 -0
  85. package/dist/runtime/plugins/modals.d.ts +2 -0
  86. package/dist/runtime/plugins/modals.mjs +10 -0
  87. package/dist/runtime/types/component.d.ts +14 -0
  88. package/dist/runtime/types/divider.d.ts +3 -0
  89. package/dist/runtime/types/form.d.ts +2 -1
  90. package/dist/runtime/types/index.d.ts +2 -0
  91. package/dist/runtime/types/modal.d.ts +18 -0
  92. package/dist/runtime/types/progress.d.ts +2 -0
  93. package/dist/runtime/types/range.d.ts +2 -0
  94. package/dist/runtime/types/toggle.d.ts +2 -0
  95. package/dist/runtime/ui.config/data/table.d.ts +7 -0
  96. package/dist/runtime/ui.config/data/table.mjs +10 -3
  97. package/dist/runtime/ui.config/elements/accordion.d.ts +1 -0
  98. package/dist/runtime/ui.config/elements/accordion.mjs +1 -0
  99. package/dist/runtime/ui.config/forms/formGroup.d.ts +1 -0
  100. package/dist/runtime/ui.config/forms/formGroup.mjs +1 -0
  101. package/dist/runtime/ui.config/forms/input.d.ts +11 -0
  102. package/dist/runtime/ui.config/forms/input.mjs +11 -0
  103. package/dist/runtime/ui.config/forms/select.d.ts +11 -0
  104. package/dist/runtime/ui.config/forms/textarea.d.ts +11 -0
  105. package/dist/runtime/ui.config/layout/divider.d.ts +19 -2
  106. package/dist/runtime/ui.config/layout/divider.mjs +20 -3
  107. package/dist/runtime/utils/index.mjs +9 -0
  108. package/dist/runtime/utils/link.d.ts +24 -11
  109. package/dist/runtime/utils/link.mjs +26 -13
  110. package/package.json +21 -19
  111. package/dist/runtime/utils/uid.d.ts +0 -1
  112. package/dist/runtime/utils/uid.mjs +0 -5
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![nuxt-ui-social-card](https://repository-images.githubusercontent.com/428329515/43fec891-9030-4601-8233-5d45ba5c6013)](https://ui.nuxt.com)
1
+ [![nuxt-ui.png](https://repository-images.githubusercontent.com/428329515/43fec891-9030-4601-8233-5d45ba5c6013)](https://ui.nuxt.com)
2
2
 
3
3
  # Nuxt UI
4
4
 
@@ -7,9 +7,9 @@
7
7
  [![License][license-src]][license-href]
8
8
  [![Nuxt][nuxt-src]][nuxt-href]
9
9
 
10
- Nuxt UI provides everything related to UI when building Nuxt applications: components, icons, colors, dark mode and also keyboard shortcuts.
10
+ Nuxt UI is a module that provides a set of Vue components and composables built with [Tailwind CSS](https://tailwindcss.com/) and [Headless UI](https://headlessui.dev/) to help you build beautiful and accessible user interfaces.
11
11
 
12
- Is has been developed by [NuxtLabs](https://nuxtlabs.com/) for [Volta](https://volta.net), [Nuxt Studio](https://nuxt.studio/) and the Nuxt community.
12
+ Its goal is to provide everything related to UI when building a Nuxt app. This includes components, icons, colors, dark mode but also keyboard shortcuts.
13
13
 
14
14
  ## Features
15
15
 
@@ -27,14 +27,14 @@ Read more on [ui.nuxt.com](https://ui.nuxt.com)
27
27
  ## Installation
28
28
 
29
29
  ```bash
30
- # Using npm
30
+ # npm
31
31
  npm install @nuxt/ui
32
-
33
- # Using yarn
32
+ # yarn
34
33
  yarn add @nuxt/ui
35
-
36
- # Using pnpm
34
+ # pnpm
37
35
  pnpm add @nuxt/ui
36
+ # bun
37
+ bun add @nuxt/ui
38
38
  ```
39
39
 
40
40
  Then, register the module in your `nuxt.config.ts`:
package/dist/module.d.mts CHANGED
@@ -39,6 +39,9 @@ declare const _default$H: {
39
39
  label: string;
40
40
  icon: string;
41
41
  };
42
+ progress: {
43
+ wrapper: string;
44
+ };
42
45
  default: {
43
46
  sortAscIcon: string;
44
47
  sortDescIcon: string;
@@ -50,6 +53,10 @@ declare const _default$H: {
50
53
  variant: "ghost";
51
54
  class: string;
52
55
  };
56
+ progress: {
57
+ color: "primary";
58
+ animation: "carousel";
59
+ };
53
60
  loadingState: {
54
61
  icon: string;
55
62
  label: string;
@@ -439,6 +446,7 @@ declare const _default$A: {
439
446
 
440
447
  declare const _default$z: {
441
448
  wrapper: string;
449
+ container: string;
442
450
  item: {
443
451
  base: string;
444
452
  size: string;
@@ -753,6 +761,17 @@ declare const _default$s: {
753
761
  form: string;
754
762
  rounded: string;
755
763
  placeholder: string;
764
+ file: {
765
+ base: string;
766
+ padding: {
767
+ '2xs': string;
768
+ xs: string;
769
+ sm: string;
770
+ md: string;
771
+ lg: string;
772
+ xl: string;
773
+ };
774
+ };
756
775
  size: {
757
776
  '2xs': string;
758
777
  xs: string;
@@ -920,6 +939,7 @@ declare const _default$r: {
920
939
 
921
940
  declare const _default$q: {
922
941
  wrapper: string;
942
+ inner: string;
923
943
  label: {
924
944
  wrapper: string;
925
945
  base: string;
@@ -954,6 +974,17 @@ declare const _default$p: {
954
974
  base: string;
955
975
  rounded: string;
956
976
  placeholder: string;
977
+ file: {
978
+ base: string;
979
+ padding: {
980
+ '2xs': string;
981
+ xs: string;
982
+ sm: string;
983
+ md: string;
984
+ lg: string;
985
+ xl: string;
986
+ };
987
+ };
957
988
  size: {
958
989
  '2xs': string;
959
990
  xs: string;
@@ -1062,6 +1093,17 @@ declare const _default$o: {
1062
1093
  wrapper: string;
1063
1094
  base: string;
1064
1095
  rounded: string;
1096
+ file: {
1097
+ base: string;
1098
+ padding: {
1099
+ '2xs': string;
1100
+ xs: string;
1101
+ sm: string;
1102
+ md: string;
1103
+ lg: string;
1104
+ xl: string;
1105
+ };
1106
+ };
1065
1107
  size: {
1066
1108
  '2xs': string;
1067
1109
  xs: string;
@@ -1449,8 +1491,22 @@ declare const _default$e: {
1449
1491
  horizontal: string;
1450
1492
  vertical: string;
1451
1493
  size: {
1452
- horizontal: string;
1453
- vertical: string;
1494
+ horizontal: {
1495
+ '2xs': string;
1496
+ xs: string;
1497
+ sm: string;
1498
+ md: string;
1499
+ lg: string;
1500
+ xl: string;
1501
+ };
1502
+ vertical: {
1503
+ '2xs': string;
1504
+ xs: string;
1505
+ sm: string;
1506
+ md: string;
1507
+ lg: string;
1508
+ xl: string;
1509
+ };
1454
1510
  };
1455
1511
  type: {
1456
1512
  solid: string;
@@ -1466,6 +1522,9 @@ declare const _default$e: {
1466
1522
  size: "2xs";
1467
1523
  };
1468
1524
  label: string;
1525
+ default: {
1526
+ size: "2xs";
1527
+ };
1469
1528
  };
1470
1529
 
1471
1530
  declare const _default$d: {
package/dist/module.d.ts CHANGED
@@ -39,6 +39,9 @@ declare const _default$H: {
39
39
  label: string;
40
40
  icon: string;
41
41
  };
42
+ progress: {
43
+ wrapper: string;
44
+ };
42
45
  default: {
43
46
  sortAscIcon: string;
44
47
  sortDescIcon: string;
@@ -50,6 +53,10 @@ declare const _default$H: {
50
53
  variant: "ghost";
51
54
  class: string;
52
55
  };
56
+ progress: {
57
+ color: "primary";
58
+ animation: "carousel";
59
+ };
53
60
  loadingState: {
54
61
  icon: string;
55
62
  label: string;
@@ -439,6 +446,7 @@ declare const _default$A: {
439
446
 
440
447
  declare const _default$z: {
441
448
  wrapper: string;
449
+ container: string;
442
450
  item: {
443
451
  base: string;
444
452
  size: string;
@@ -753,6 +761,17 @@ declare const _default$s: {
753
761
  form: string;
754
762
  rounded: string;
755
763
  placeholder: string;
764
+ file: {
765
+ base: string;
766
+ padding: {
767
+ '2xs': string;
768
+ xs: string;
769
+ sm: string;
770
+ md: string;
771
+ lg: string;
772
+ xl: string;
773
+ };
774
+ };
756
775
  size: {
757
776
  '2xs': string;
758
777
  xs: string;
@@ -920,6 +939,7 @@ declare const _default$r: {
920
939
 
921
940
  declare const _default$q: {
922
941
  wrapper: string;
942
+ inner: string;
923
943
  label: {
924
944
  wrapper: string;
925
945
  base: string;
@@ -954,6 +974,17 @@ declare const _default$p: {
954
974
  base: string;
955
975
  rounded: string;
956
976
  placeholder: string;
977
+ file: {
978
+ base: string;
979
+ padding: {
980
+ '2xs': string;
981
+ xs: string;
982
+ sm: string;
983
+ md: string;
984
+ lg: string;
985
+ xl: string;
986
+ };
987
+ };
957
988
  size: {
958
989
  '2xs': string;
959
990
  xs: string;
@@ -1062,6 +1093,17 @@ declare const _default$o: {
1062
1093
  wrapper: string;
1063
1094
  base: string;
1064
1095
  rounded: string;
1096
+ file: {
1097
+ base: string;
1098
+ padding: {
1099
+ '2xs': string;
1100
+ xs: string;
1101
+ sm: string;
1102
+ md: string;
1103
+ lg: string;
1104
+ xl: string;
1105
+ };
1106
+ };
1065
1107
  size: {
1066
1108
  '2xs': string;
1067
1109
  xs: string;
@@ -1449,8 +1491,22 @@ declare const _default$e: {
1449
1491
  horizontal: string;
1450
1492
  vertical: string;
1451
1493
  size: {
1452
- horizontal: string;
1453
- vertical: string;
1494
+ horizontal: {
1495
+ '2xs': string;
1496
+ xs: string;
1497
+ sm: string;
1498
+ md: string;
1499
+ lg: string;
1500
+ xl: string;
1501
+ };
1502
+ vertical: {
1503
+ '2xs': string;
1504
+ xs: string;
1505
+ sm: string;
1506
+ md: string;
1507
+ lg: string;
1508
+ xl: string;
1509
+ };
1454
1510
  };
1455
1511
  type: {
1456
1512
  solid: string;
@@ -1466,6 +1522,9 @@ declare const _default$e: {
1466
1522
  size: "2xs";
1467
1523
  };
1468
1524
  label: string;
1525
+ default: {
1526
+ size: "2xs";
1527
+ };
1469
1528
  };
1470
1529
 
1471
1530
  declare const _default$d: {
package/dist/module.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "2.13.0",
3
+ "version": "2.14.1",
4
4
  "configKey": "ui",
5
5
  "compatibility": {
6
- "nuxt": "^3.0.0-rc.8"
6
+ "nuxt": "^3.10.0"
7
7
  }
8
8
  }
package/dist/module.mjs CHANGED
@@ -1,5 +1,5 @@
1
+ import { createRequire } from 'node:module';
1
2
  import { addTemplate, useNuxt, defineNuxtModule, createResolver, installModule, addPlugin, addComponentsDir, addImportsDir } from '@nuxt/kit';
2
- 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';
@@ -14,7 +14,24 @@ const __filename = __cjs_url__.fileURLToPath(import.meta.url);
14
14
  const __dirname = __cjs_path__.dirname(__filename);
15
15
  const require = __cjs_mod__.createRequire(import.meta.url);
16
16
  const name = "@nuxt/ui";
17
- const version = "2.13.0";
17
+ const version = "2.14.1";
18
+
19
+ function createTemplates(nuxt = useNuxt()) {
20
+ const template = addTemplate({
21
+ filename: "ui.colors.mjs",
22
+ getContents: () => `export default ${JSON.stringify(nuxt.options.appConfig.ui.colors)};`,
23
+ write: true
24
+ });
25
+ const typesTemplate = addTemplate({
26
+ filename: "ui.colors.d.ts",
27
+ getContents: () => `declare module '#ui-colors' { const defaultExport: ${JSON.stringify(nuxt.options.appConfig.ui.colors)}; export default defaultExport; }`,
28
+ write: true
29
+ });
30
+ nuxt.options.alias["#ui-colors"] = template.dst;
31
+ nuxt.hook("prepare:types", (opts) => {
32
+ opts.references.push({ path: typesTemplate.dst });
33
+ });
34
+ }
18
35
 
19
36
  function omit(object, keysToOmit) {
20
37
  const result = { ...object };
@@ -284,24 +301,9 @@ const customSafelistExtractor = (prefix, content, colors, safelistColors) => {
284
301
  return classes;
285
302
  };
286
303
 
287
- function createTemplates(nuxt = useNuxt()) {
288
- const template = addTemplate({
289
- filename: "ui.colors.mjs",
290
- getContents: () => `export default ${JSON.stringify(nuxt.options.appConfig.ui.colors)};`,
291
- write: true
292
- });
293
- const typesTemplate = addTemplate({
294
- filename: "ui.colors.d.ts",
295
- getContents: () => `declare module '#ui-colors' { const defaultExport: ${JSON.stringify(nuxt.options.appConfig.ui.colors)}; export default defaultExport; }`,
296
- write: true
297
- });
298
- nuxt.options.alias["#ui-colors"] = template.dst;
299
- nuxt.hook("prepare:types", (opts) => {
300
- opts.references.push({ path: typesTemplate.dst });
301
- });
302
- }
303
-
304
304
  const defaultExtractor = defaultExtractor$1({ tailwindConfig: { separator: ":" } });
305
+ const _require = createRequire(import.meta.url);
306
+ const defaultColors = _require("tailwindcss/colors.js");
305
307
  delete defaultColors.lightBlue;
306
308
  delete defaultColors.warmGray;
307
309
  delete defaultColors.trueGray;
@@ -313,7 +315,7 @@ const module = defineNuxtModule({
313
315
  version,
314
316
  configKey: "ui",
315
317
  compatibility: {
316
- nuxt: "^3.0.0-rc.8"
318
+ nuxt: "^3.10.0"
317
319
  }
318
320
  },
319
321
  defaults: {
@@ -378,8 +380,6 @@ const module = defineNuxtModule({
378
380
  };
379
381
  tailwindConfig.safelist = tailwindConfig.safelist || [];
380
382
  tailwindConfig.safelist.push(...generateSafelist(options.safelistColors || [], colors));
381
- tailwindConfig.plugins = tailwindConfig.plugins || [];
382
- tailwindConfig.plugins.push(iconsPlugin(Array.isArray(options.icons) ? { collections: getIconCollections(options.icons) } : typeof options.icons === "object" ? options.icons : {}));
383
383
  });
384
384
  createTemplates(nuxt);
385
385
  await installModule("nuxt-icon");
@@ -393,7 +393,8 @@ const module = defineNuxtModule({
393
393
  require("@tailwindcss/aspect-ratio"),
394
394
  require("@tailwindcss/typography"),
395
395
  require("@tailwindcss/container-queries"),
396
- require("@headlessui/tailwindcss")
396
+ require("@headlessui/tailwindcss"),
397
+ iconsPlugin(Array.isArray(options.icons) || options.icons === "all" ? { collections: getIconCollections(options.icons) } : typeof options.icons === "object" ? options.icons : {})
397
398
  ],
398
399
  content: {
399
400
  files: [
@@ -420,6 +421,9 @@ const module = defineNuxtModule({
420
421
  addPlugin({
421
422
  src: resolve(runtimeDir, "plugins", "colors")
422
423
  });
424
+ addPlugin({
425
+ src: resolve(runtimeDir, "plugins", "modals")
426
+ });
423
427
  addComponentsDir({
424
428
  path: resolve(runtimeDir, "components", "elements"),
425
429
  prefix: options.prefix,
@@ -4,7 +4,7 @@
4
4
  <thead :class="ui.thead">
5
5
  <tr :class="ui.tr.base">
6
6
  <th v-if="modelValue" scope="col" :class="ui.checkbox.padding">
7
- <UCheckbox :checked="indeterminate || selected.length === rows.length" :indeterminate="indeterminate" aria-label="Select all" @change="onChange" />
7
+ <UCheckbox :model-value="indeterminate || selected.length === rows.length" :indeterminate="indeterminate" aria-label="Select all" @change="onChange" />
8
8
  </th>
9
9
 
10
10
  <th v-for="(column, index) in columns" :key="index" scope="col" :class="[ui.th.base, ui.th.padding, ui.th.color, ui.th.font, ui.th.size, column.class]">
@@ -20,9 +20,15 @@
20
20
  </slot>
21
21
  </th>
22
22
  </tr>
23
+
24
+ <tr v-if="loading && progress">
25
+ <td :colspan="0" :class="ui.progress.wrapper">
26
+ <UProgress v-bind="{ ...(ui.default.progress || {}), ...progress }" size="2xs" />
27
+ </td>
28
+ </tr>
23
29
  </thead>
24
30
  <tbody :class="ui.tbody">
25
- <tr v-if="loadingState && loading">
31
+ <tr v-if="loadingState && loading && !rows.length">
26
32
  <td :colspan="columns.length + (modelValue ? 1 : 0)">
27
33
  <slot name="loading-state">
28
34
  <div :class="ui.loadingState.wrapper">
@@ -71,8 +77,9 @@ import { computed, defineComponent, toRaw, toRef } from "vue";
71
77
  import { upperFirst } from "scule";
72
78
  import { defu } from "defu";
73
79
  import { useVModel } from "@vueuse/core";
74
- import UButton from "../elements/Button.vue";
75
80
  import UIcon from "../elements/Icon.vue";
81
+ import UButton from "../elements/Button.vue";
82
+ import UProgress from "../elements/Progress.vue";
76
83
  import UCheckbox from "../forms/Checkbox.vue";
77
84
  import { useUI } from "../../composables/useUI";
78
85
  import { mergeConfig, get } from "../../utils";
@@ -94,8 +101,9 @@ function defaultSort(a, b, direction) {
94
101
  }
95
102
  export default defineComponent({
96
103
  components: {
97
- UButton,
98
104
  UIcon,
105
+ UButton,
106
+ UProgress,
99
107
  UCheckbox
100
108
  },
101
109
  inheritAttrs: false,
@@ -152,6 +160,10 @@ export default defineComponent({
152
160
  type: Object,
153
161
  default: () => config.default.emptyState
154
162
  },
163
+ progress: {
164
+ type: Object,
165
+ default: () => config.default.progress
166
+ },
155
167
  class: {
156
168
  type: [String, Object, Array],
157
169
  default: () => ""
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Button } from '../../types';
2
+ import type { Button, ProgressAnimation } from '../../types';
3
3
  declare function defaultComparator<T>(a: T, z: T): boolean;
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  modelValue: {
@@ -72,6 +72,13 @@ declare const _default: import("vue").DefineComponent<{
72
72
  }>;
73
73
  default: () => any;
74
74
  };
75
+ progress: {
76
+ type: PropType<{
77
+ color: any;
78
+ animation: ProgressAnimation;
79
+ }>;
80
+ default: () => any;
81
+ };
75
82
  class: {
76
83
  type: PropType<any>;
77
84
  default: () => string;
@@ -112,7 +119,7 @@ declare const _default: import("vue").DefineComponent<{
112
119
  onSelect: (row: any) => void;
113
120
  onChange: (event: any) => void;
114
121
  getRowData: (row: Object, rowKey: string | string[], defaultValue?: any) => any;
115
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:sort")[], "update:modelValue" | "update:sort", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
122
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:sort")[], "update:modelValue" | "update:sort", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
116
123
  modelValue: {
117
124
  type: ArrayConstructor;
118
125
  default: null;
@@ -183,6 +190,13 @@ declare const _default: import("vue").DefineComponent<{
183
190
  }>;
184
191
  default: () => any;
185
192
  };
193
+ progress: {
194
+ type: PropType<{
195
+ color: any;
196
+ animation: ProgressAnimation;
197
+ }>;
198
+ default: () => any;
199
+ };
186
200
  class: {
187
201
  type: PropType<any>;
188
202
  default: () => string;
@@ -199,7 +213,12 @@ declare const _default: import("vue").DefineComponent<{
199
213
  column: string;
200
214
  direction: 'asc' | 'desc';
201
215
  };
216
+ progress: {
217
+ color: any;
218
+ animation: ProgressAnimation;
219
+ };
202
220
  ui: any;
221
+ class: any;
203
222
  columns: {
204
223
  [key: string]: any;
205
224
  key: string;
@@ -208,7 +227,6 @@ declare const _default: import("vue").DefineComponent<{
208
227
  direction?: "asc" | "desc" | undefined;
209
228
  class?: string | undefined;
210
229
  }[];
211
- class: any;
212
230
  modelValue: unknown[];
213
231
  by: string | Function;
214
232
  rows: {
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <div :class="ui.wrapper">
3
- <HDisclosure v-for="(item, index) in items" v-slot="{ open, close }" :key="index" :default-open="defaultOpen || item.defaultOpen">
3
+ <HDisclosure
4
+ v-for="(item, index) in items"
5
+ v-slot="{ open, close }"
6
+ :key="index"
7
+ as="div"
8
+ :class="ui.container"
9
+ :default-open="defaultOpen || item.defaultOpen"
10
+ >
4
11
  <HDisclosureButton
5
12
  :ref="() => buttonRefs[index] = { open, close }"
6
13
  as="template"
@@ -46,13 +53,14 @@
46
53
 
47
54
  <script>
48
55
  import { ref, computed, toRef, defineComponent } from "vue";
49
- import { Disclosure as HDisclosure, DisclosureButton as HDisclosureButton, DisclosurePanel as HDisclosurePanel } from "@headlessui/vue";
56
+ import { Disclosure as HDisclosure, DisclosureButton as HDisclosureButton, DisclosurePanel as HDisclosurePanel, provideUseId } from "@headlessui/vue";
50
57
  import UIcon from "../elements/Icon.vue";
51
58
  import UButton from "../elements/Button.vue";
52
59
  import { useUI } from "../../composables/useUI";
53
60
  import { mergeConfig, omit } from "../../utils";
54
61
  import appConfig from "#build/app.config";
55
62
  import { accordion, button } from "#ui/ui.config";
63
+ import { useId } from "#imports";
56
64
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.accordion, accordion);
57
65
  const configButton = mergeConfig(appConfig.ui.strategy, appConfig.ui.button, button);
58
66
  export default defineComponent({
@@ -129,6 +137,7 @@ export default defineComponent({
129
137
  el.style.height = "0";
130
138
  el.addEventListener("transitionend", done, { once: true });
131
139
  }
140
+ provideUseId(() => useId());
132
141
  return {
133
142
  // eslint-disable-next-line vue/no-dupe-keys
134
143
  ui,
@@ -46,7 +46,7 @@ declare const _default: import("vue").DefineComponent<{
46
46
  onBeforeLeave: (_el: Element) => void;
47
47
  onAfterEnter: (_el: Element) => void;
48
48
  onLeave: (_el: Element, done: () => void) => void;
49
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
49
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
50
50
  items: {
51
51
  type: PropType<AccordionItem[]>;
52
52
  default: () => never[];
@@ -5,7 +5,7 @@
5
5
  <UAvatar v-if="avatar" v-bind="{ size: ui.avatar.size, ...avatar }" :class="ui.avatar.base" />
6
6
 
7
7
  <div :class="ui.inner">
8
- <p :class="ui.title">
8
+ <p v-if="(title || $slots.title)" :class="ui.title">
9
9
  <slot name="title" :title="title">
10
10
  {{ title }}
11
11
  </slot>
@@ -52,7 +52,7 @@ export default defineComponent({
52
52
  props: {
53
53
  title: {
54
54
  type: String,
55
- required: true
55
+ default: null
56
56
  },
57
57
  description: {
58
58
  type: String,
@@ -3,7 +3,7 @@ import type { Avatar, Button, AlertVariant, AlertAction } from '../../types';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  title: {
5
5
  type: StringConstructor;
6
- required: true;
6
+ default: null;
7
7
  };
8
8
  description: {
9
9
  type: StringConstructor;
@@ -51,10 +51,10 @@ declare const _default: import("vue").DefineComponent<{
51
51
  alertClass: import("vue").ComputedRef<string>;
52
52
  onAction: (action: AlertAction) => void;
53
53
  twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
54
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
54
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
55
55
  title: {
56
56
  type: StringConstructor;
57
- required: true;
57
+ default: null;
58
58
  };
59
59
  description: {
60
60
  type: StringConstructor;
@@ -98,6 +98,7 @@ declare const _default: import("vue").DefineComponent<{
98
98
  onClose?: ((...args: any[]) => any) | undefined;
99
99
  }, {
100
100
  ui: any;
101
+ title: string;
101
102
  description: string;
102
103
  icon: string;
103
104
  avatar: Avatar;
@@ -61,7 +61,7 @@ declare const _default: import("vue").DefineComponent<{
61
61
  placeholder: import("vue").ComputedRef<string>;
62
62
  error: import("vue").Ref<boolean>;
63
63
  onError: () => void;
64
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
64
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
65
65
  src: {
66
66
  type: (BooleanConstructor | StringConstructor)[];
67
67
  default: null;
@@ -20,7 +20,7 @@ declare const _default: import("vue").DefineComponent<{
20
20
  };
21
21
  }, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
22
22
  [key: string]: any;
23
- }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
23
+ }>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
24
  size: {
25
25
  type: PropType<AvatarSize>;
26
26
  default: null;
@@ -33,7 +33,7 @@ declare const _default: import("vue").DefineComponent<{
33
33
  [x: string]: unknown;
34
34
  }, string>>;
35
35
  badgeClass: import("vue").ComputedRef<string>;
36
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
37
37
  size: {
38
38
  type: PropType<BadgeSize>;
39
39
  default: () => any;
@@ -66,7 +66,7 @@ declare const _default: import("vue").DefineComponent<{
66
66
  ui: any;
67
67
  color: any;
68
68
  class: any;
69
- label: string | number;
70
69
  variant: BadgeVariant;
70
+ label: string | number;
71
71
  }, {}>;
72
72
  export default _default;