@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
@@ -4,7 +4,7 @@
4
4
  v-if="!to"
5
5
  :disabled="disabled"
6
6
  v-bind="$attrs"
7
- :class="inactiveClass"
7
+ :class="active ? activeClass : inactiveClass"
8
8
  >
9
9
  <slot />
10
10
  </component>
@@ -21,7 +21,7 @@
21
21
  :role="disabled ? 'link' : undefined"
22
22
  :rel="rel"
23
23
  :target="target"
24
- :class="resolveLinkClass(route, $route, { isActive, isExactActive })"
24
+ :class="active ? activeClass : resolveLinkClass(route, $route, { isActive, isExactActive })"
25
25
  @click="(e) => !isExternal && navigate(e)"
26
26
  >
27
27
  <slot v-bind="{ isActive: exact ? isExactActive : isActive }" />
@@ -68,9 +68,6 @@ export default defineComponent({
68
68
  },
69
69
  setup(props) {
70
70
  function resolveLinkClass(route, $route, { isActive, isExactActive }) {
71
- if (props.active) {
72
- return props.activeClass;
73
- }
74
71
  if (props.exactQuery && !isEqual(route.query, $route.query)) {
75
72
  return props.inactiveClass;
76
73
  }
@@ -79,11 +79,11 @@ export default defineComponent({
79
79
  },
80
80
  class: {
81
81
  type: [String, Object, Array],
82
- default: void 0
82
+ default: () => ""
83
83
  },
84
84
  ui: {
85
85
  type: Object,
86
- default: void 0
86
+ default: () => ({})
87
87
  }
88
88
  },
89
89
  setup(props) {
@@ -36,11 +36,11 @@ declare const _default: import("vue").DefineComponent<{
36
36
  };
37
37
  class: {
38
38
  type: PropType<any>;
39
- default: undefined;
39
+ default: () => "";
40
40
  };
41
41
  ui: {
42
- type: PropType<Partial<any>>;
43
- default: undefined;
42
+ type: PropType<any>;
43
+ default: () => {};
44
44
  };
45
45
  }, {
46
46
  ui: import("vue").ComputedRef<any>;
@@ -93,20 +93,20 @@ declare const _default: import("vue").DefineComponent<{
93
93
  };
94
94
  class: {
95
95
  type: PropType<any>;
96
- default: undefined;
96
+ default: () => "";
97
97
  };
98
98
  ui: {
99
- type: PropType<Partial<any>>;
100
- default: undefined;
99
+ type: PropType<any>;
100
+ default: () => {};
101
101
  };
102
102
  }>>, {
103
+ size: "sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl";
104
+ ui: any;
105
+ value: number;
103
106
  icon: string;
104
107
  color: any;
105
- ui: Partial<any>;
106
108
  class: any;
107
- value: number;
108
109
  label: string;
109
- size: "sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl";
110
110
  max: number;
111
111
  min: number;
112
112
  indicator: boolean;
@@ -19,15 +19,15 @@ declare const _default: import("vue").DefineComponent<{
19
19
  };
20
20
  icon: {
21
21
  type: StringConstructor;
22
- default: string;
22
+ default: () => any;
23
23
  };
24
24
  class: {
25
25
  type: PropType<any>;
26
- default: undefined;
26
+ default: () => "";
27
27
  };
28
28
  ui: {
29
- type: PropType<Partial<any>>;
30
- default: undefined;
29
+ type: PropType<any>;
30
+ default: () => {};
31
31
  };
32
32
  }, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
33
33
  [key: string]: any;
@@ -51,21 +51,21 @@ declare const _default: import("vue").DefineComponent<{
51
51
  };
52
52
  icon: {
53
53
  type: StringConstructor;
54
- default: string;
54
+ default: () => any;
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: "sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl";
66
+ ui: any;
65
67
  icon: string;
66
- ui: Partial<any>;
67
68
  class: any;
68
- size: "sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl";
69
69
  max: number;
70
70
  min: number;
71
71
  indicator: boolean;
@@ -35,15 +35,15 @@ export default defineComponent({
35
35
  },
36
36
  icon: {
37
37
  type: String,
38
- default: "i-heroicons-minus"
38
+ default: () => meterGroupConfig.default.icon
39
39
  },
40
40
  class: {
41
41
  type: [String, Object, Array],
42
- default: void 0
42
+ default: () => ""
43
43
  },
44
44
  ui: {
45
45
  type: Object,
46
- default: void 0
46
+ default: () => ({})
47
47
  }
48
48
  },
49
49
  setup(props, { slots }) {
@@ -55,20 +55,7 @@ export default defineComponent({
55
55
  const normalizedMin = computed(() => props.min > props.max ? props.max : props.min);
56
56
  const normalizedMax = computed(() => props.max < props.min ? props.min : props.max);
57
57
  const children = computed(() => getSlotsChildren(slots));
58
- const rounded = computed(() => {
59
- const roundedMap = {
60
- "rounded-none": { left: "rounded-s-none", right: "rounded-e-none" },
61
- "rounded-sm": { left: "rounded-s-sm", right: "rounded-e-sm" },
62
- rounded: { left: "rounded-s", right: "rounded-e" },
63
- "rounded-md": { left: "rounded-s-md", right: "rounded-e-md" },
64
- "rounded-lg": { left: "rounded-s-lg", right: "rounded-e-lg" },
65
- "rounded-xl": { left: "rounded-s-xl", right: "rounded-e-xl" },
66
- "rounded-2xl": { left: "rounded-s-2xl", right: "rounded-e-2xl" },
67
- "rounded-3xl": { left: "rounded-s-3xl", right: "rounded-e-3xl" },
68
- "rounded-full": { left: "rounded-s-full", right: "rounded-e-full" }
69
- };
70
- return roundedMap[ui.value.rounded];
71
- });
58
+ const rounded = computed(() => ui.value.orientation[ui.value.rounded]);
72
59
  function clampPercent(value, min, max) {
73
60
  if (min == max) {
74
61
  return value < min ? 0 : 100;
@@ -98,7 +85,7 @@ export default defineComponent({
98
85
  vProps.ui.wrapper = node.props?.ui?.wrapper || "";
99
86
  vProps.ui.wrapper += [
100
87
  node.props?.ui?.wrapper,
101
- props.ui?.meter?.background || ui.value.background,
88
+ ui.value.background,
102
89
  ui.value.transition
103
90
  ].filter(Boolean).join(" ");
104
91
  vProps.ui.meter = node.props?.ui?.meter || {};
@@ -114,8 +101,8 @@ export default defineComponent({
114
101
  labels.value[index] = node.props.label;
115
102
  const clone = cloneVNode(node, vProps);
116
103
  delete clone.children?.label;
117
- delete clone.props.indicator;
118
- delete clone.props.label;
104
+ delete clone.props?.indicator;
105
+ delete clone.props?.label;
119
106
  return clone;
120
107
  }));
121
108
  const baseClass = computed(() => {
@@ -151,7 +138,7 @@ export default defineComponent({
151
138
  } else if (slots.indicator) {
152
139
  vNodeSlots[0] = slots.indicator({ percent: percent.value });
153
140
  }
154
- vNodeSlots[2] = h("ol", { class: "list-disc list-inside" }, labels.value.map((label, key) => {
141
+ vNodeSlots[2] = h("ol", { class: ui.value.list }, labels.value.map((label, key) => {
155
142
  const labelClass = computed(() => {
156
143
  return twJoin(
157
144
  uiMeter.value.label.base,
@@ -34,7 +34,7 @@ export default defineComponent({
34
34
  inheritAttrs: false,
35
35
  props: {
36
36
  value: {
37
- type: [Number, null, void 0],
37
+ type: Number,
38
38
  default: null
39
39
  },
40
40
  max: {
@@ -68,11 +68,11 @@ export default defineComponent({
68
68
  },
69
69
  class: {
70
70
  type: [String, Object, Array],
71
- default: void 0
71
+ default: () => ""
72
72
  },
73
73
  ui: {
74
74
  type: Object,
75
- default: void 0
75
+ default: () => ({})
76
76
  }
77
77
  },
78
78
  setup(props) {
@@ -151,7 +151,7 @@ export default defineComponent({
151
151
  }
152
152
  return classes.join(" ");
153
153
  }
154
- const isIndeterminate = computed(() => [void 0, null].includes(props.value));
154
+ const isIndeterminate = computed(() => props.value === void 0 || props.value === null);
155
155
  const isSteps = computed(() => Array.isArray(props.max));
156
156
  const realMax = computed(() => {
157
157
  if (isIndeterminate.value) {
@@ -166,7 +166,7 @@ export default defineComponent({
166
166
  switch (true) {
167
167
  case props.value < 0:
168
168
  return 0;
169
- case props.value > 100:
169
+ case props.value > realMax.value:
170
170
  return 100;
171
171
  default:
172
172
  return props.value / realMax.value * 100;
@@ -191,94 +191,5 @@ export default defineComponent({
191
191
  </script>
192
192
 
193
193
  <style scoped>
194
- /** These styles are required to animate the bar */
195
- progress:indeterminate {
196
- @apply relative;
197
-
198
- &:after {
199
- @apply content-[''];
200
- @apply absolute inset-0;
201
- @apply bg-current;
202
- }
203
-
204
- &::-webkit-progress-value {
205
- @apply bg-current;
206
- }
207
-
208
- &::-moz-progress-bar {
209
- @apply bg-current;
210
- }
211
-
212
- &.bar-animation-carousel {
213
- &:after {
214
- animation: carousel 2s ease-in-out infinite;
215
- }
216
- &::-webkit-progress-value {
217
- animation: carousel 2s ease-in-out infinite;
218
- }
219
- &::-moz-progress-bar {
220
- animation: carousel 2s ease-in-out infinite;
221
- }
222
- }
223
-
224
- &.bar-animation-carousel-inverse {
225
- &:after {
226
- animation: carousel-inverse 2s ease-in-out infinite;
227
- }
228
- &::-webkit-progress-value {
229
- animation: carousel-inverse 2s ease-in-out infinite;
230
- }
231
- &::-moz-progress-bar {
232
- animation: carousel-inverse 2s ease-in-out infinite;
233
- }
234
- }
235
-
236
- &.bar-animation-swing {
237
- &:after {
238
- animation: swing 3s ease-in-out infinite;
239
- }
240
- &::-webkit-progress-value {
241
- animation: swing 3s ease-in-out infinite;
242
- }
243
- &::-moz-progress-bar {
244
- animation: swing 3s ease-in-out infinite;
245
- }
246
- }
247
-
248
- &.bar-animation-elastic {
249
- &::after {
250
- animation: elastic 3s ease-in-out infinite;
251
- }
252
- &::-webkit-progress-value {
253
- animation: elastic 3s ease-in-out infinite;
254
- }
255
- &::-moz-progress-bar {
256
- animation: elastic 3s ease-in-out infinite;
257
- }
258
- }
259
- }
260
-
261
- @keyframes carousel {
262
- 0%, 100% { width: 50% }
263
- 0% { transform: translateX(-100%) }
264
- 100% { transform: translateX(200%) }
265
- }
266
-
267
- @keyframes carousel-inverse {
268
- 0%, 100% { width: 50% }
269
- 0% { transform: translateX(200%) }
270
- 100% { transform: translateX(-100%) }
271
- }
272
-
273
- @keyframes swing {
274
- 0%, 100% { width: 50% }
275
- 0%, 100% { transform: translateX(-25%) }
276
- 50% { transform: translateX(125%) }
277
- }
278
-
279
- @keyframes elastic {
280
- /* Firefox doesn't do "margin: 0 auto", we have to play with margin-left */
281
- 0%, 100% { width: 50%; margin-left: 25%; }
282
- 50% { width: 90%; margin-left: 5% }
283
- }
194
+ progress:indeterminate{@apply relative}progress:indeterminate:after{@apply content-[""];@apply absolute inset-0;@apply bg-current}progress:indeterminate::-webkit-progress-value{@apply bg-current}progress:indeterminate::-moz-progress-bar{@apply bg-current}progress:indeterminate.bar-animation-carousel:after{animation:carousel 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel::-webkit-progress-value{animation:carousel 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel::-moz-progress-bar{animation:carousel 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel-inverse:after{animation:carousel-inverse 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel-inverse::-webkit-progress-value{animation:carousel-inverse 2s ease-in-out infinite}progress:indeterminate.bar-animation-carousel-inverse::-moz-progress-bar{animation:carousel-inverse 2s ease-in-out infinite}progress:indeterminate.bar-animation-swing:after{animation:swing 3s ease-in-out infinite}progress:indeterminate.bar-animation-swing::-webkit-progress-value{animation:swing 3s ease-in-out infinite}progress:indeterminate.bar-animation-swing::-moz-progress-bar{animation:swing 3s ease-in-out infinite}progress:indeterminate.bar-animation-elastic:after{animation:elastic 3s ease-in-out infinite}progress:indeterminate.bar-animation-elastic::-webkit-progress-value{animation:elastic 3s ease-in-out infinite}progress:indeterminate.bar-animation-elastic::-moz-progress-bar{animation:elastic 3s ease-in-out infinite}@keyframes carousel{0%,to{width:50%}0%{transform:translateX(-100%)}to{transform:translateX(200%)}}@keyframes carousel-inverse{0%,to{width:50%}0%{transform:translateX(200%)}to{transform:translateX(-100%)}}@keyframes swing{0%,to{width:50%}0%,to{transform:translateX(-25%)}50%{transform:translateX(125%)}}@keyframes elastic{0%,to{margin-left:25%;width:50%}50%{margin-left:5%;width:90%}}
284
195
  </style>
@@ -1,2 +1,124 @@
1
- declare const _default: (props: Record<string, any> & {}) => any;
1
+ import type { PropType } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ value: {
4
+ type: NumberConstructor;
5
+ default: null;
6
+ };
7
+ max: {
8
+ type: (NumberConstructor | {
9
+ (arrayLength: number): any[];
10
+ (...items: any[]): any[];
11
+ new (arrayLength: number): any[];
12
+ new (...items: any[]): any[];
13
+ isArray(arg: any): arg is any[];
14
+ readonly prototype: any[];
15
+ from<T>(arrayLike: ArrayLike<T>): T[];
16
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
17
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
18
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
19
+ of<T_4>(...items: T_4[]): T_4[];
20
+ readonly [Symbol.species]: ArrayConstructor;
21
+ })[];
22
+ default: number;
23
+ };
24
+ indicator: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ animation: {
29
+ type: PropType<"carousel" | "carousel-inverse" | "swing" | "elastic">;
30
+ default: () => any;
31
+ validator(value: string): boolean;
32
+ };
33
+ size: {
34
+ type: PropType<"sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl">;
35
+ default: () => any;
36
+ validator(value: string): boolean;
37
+ };
38
+ color: {
39
+ type: StringConstructor;
40
+ default: () => any;
41
+ validator(value: string): any;
42
+ };
43
+ class: {
44
+ type: PropType<any>;
45
+ default: () => "";
46
+ };
47
+ ui: {
48
+ type: PropType<any>;
49
+ default: () => {};
50
+ };
51
+ }, {
52
+ ui: import("vue").ComputedRef<any>;
53
+ attrs: import("vue").ComputedRef<Pick<{
54
+ [x: string]: unknown;
55
+ }, string>>;
56
+ indicatorContainerClass: import("vue").ComputedRef<string>;
57
+ indicatorClass: import("vue").ComputedRef<string>;
58
+ progressClass: import("vue").ComputedRef<string>;
59
+ stepsClass: import("vue").ComputedRef<string>;
60
+ stepClasses: (index: string | number) => string;
61
+ isIndeterminate: import("vue").ComputedRef<boolean>;
62
+ isSteps: import("vue").ComputedRef<boolean>;
63
+ realMax: import("vue").ComputedRef<number | null>;
64
+ percent: import("vue").ComputedRef<number>;
65
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
66
+ value: {
67
+ type: NumberConstructor;
68
+ default: null;
69
+ };
70
+ max: {
71
+ type: (NumberConstructor | {
72
+ (arrayLength: number): any[];
73
+ (...items: any[]): any[];
74
+ new (arrayLength: number): any[];
75
+ new (...items: any[]): any[];
76
+ isArray(arg: any): arg is any[];
77
+ readonly prototype: any[];
78
+ from<T>(arrayLike: ArrayLike<T>): T[];
79
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
80
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
81
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
82
+ of<T_4>(...items: T_4[]): T_4[];
83
+ readonly [Symbol.species]: ArrayConstructor;
84
+ })[];
85
+ default: number;
86
+ };
87
+ indicator: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
91
+ animation: {
92
+ type: PropType<"carousel" | "carousel-inverse" | "swing" | "elastic">;
93
+ default: () => any;
94
+ validator(value: string): boolean;
95
+ };
96
+ size: {
97
+ type: PropType<"sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl">;
98
+ default: () => any;
99
+ validator(value: string): boolean;
100
+ };
101
+ color: {
102
+ type: StringConstructor;
103
+ default: () => any;
104
+ validator(value: string): any;
105
+ };
106
+ class: {
107
+ type: PropType<any>;
108
+ default: () => "";
109
+ };
110
+ ui: {
111
+ type: PropType<any>;
112
+ default: () => {};
113
+ };
114
+ }>>, {
115
+ size: "sm" | "md" | "xs" | "2xs" | "lg" | "xl" | "2xl";
116
+ ui: any;
117
+ value: number;
118
+ color: string;
119
+ class: any;
120
+ max: number | any[];
121
+ indicator: boolean;
122
+ animation: "carousel" | "carousel-inverse" | "swing" | "elastic";
123
+ }, {}>;
2
124
  export default _default;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div :class="ui.wrapper">
3
- <div class="flex items-center h-5">
3
+ <div :class="ui.container">
4
4
  <input
5
5
  :id="inputId"
6
6
  v-model="toggle"
@@ -11,13 +11,12 @@
11
11
  :checked="checked"
12
12
  :indeterminate="indeterminate"
13
13
  type="checkbox"
14
- class="form-checkbox"
15
14
  :class="inputClass"
16
15
  v-bind="attrs"
17
16
  @change="onChange"
18
17
  >
19
18
  </div>
20
- <div v-if="label || $slots.label" class="ms-3 text-sm">
19
+ <div v-if="label || $slots.label" :class="ui.inner">
21
20
  <label :for="inputId" :class="ui.label">
22
21
  <slot name="label">{{ label }}</slot>
23
22
  <span v-if="required" :class="ui.required">*</span>
@@ -35,7 +34,6 @@ import { twMerge, twJoin } from "tailwind-merge";
35
34
  import { useUI } from "../../composables/useUI";
36
35
  import { useFormGroup } from "../../composables/useFormGroup";
37
36
  import { mergeConfig } from "../../utils";
38
- import { uid } from "../../utils/uid";
39
37
  import appConfig from "#build/app.config";
40
38
  import { checkbox } from "#ui/ui.config";
41
39
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.checkbox, checkbox);
@@ -44,8 +42,7 @@ export default defineComponent({
44
42
  props: {
45
43
  id: {
46
44
  type: String,
47
- // A default value is needed here to bind the label
48
- default: () => uid()
45
+ default: () => null
49
46
  },
50
47
  value: {
51
48
  type: [String, Number, Boolean, Object],
@@ -96,11 +93,11 @@ export default defineComponent({
96
93
  },
97
94
  class: {
98
95
  type: [String, Object, Array],
99
- default: void 0
96
+ default: () => ""
100
97
  },
101
98
  ui: {
102
99
  type: Object,
103
- default: void 0
100
+ default: () => ({})
104
101
  }
105
102
  },
106
103
  emits: ["update:modelValue", "change"],
@@ -122,11 +119,12 @@ export default defineComponent({
122
119
  const inputClass = computed(() => {
123
120
  return twMerge(twJoin(
124
121
  ui.value.base,
122
+ ui.value.form,
125
123
  ui.value.rounded,
126
124
  ui.value.background,
127
125
  ui.value.border,
128
- ui.value.ring.replaceAll("{color}", color.value),
129
- ui.value.color.replaceAll("{color}", color.value)
126
+ color.value && ui.value.ring.replaceAll("{color}", color.value),
127
+ color.value && ui.value.color.replaceAll("{color}", color.value)
130
128
  ), props.inputClass);
131
129
  });
132
130
  return {
@@ -2,7 +2,7 @@ import type { PropType } from 'vue';
2
2
  declare const _default: import("vue").DefineComponent<{
3
3
  id: {
4
4
  type: StringConstructor;
5
- default: () => string;
5
+ default: () => null;
6
6
  };
7
7
  value: {
8
8
  type: (ObjectConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[];
@@ -51,11 +51,11 @@ declare const _default: import("vue").DefineComponent<{
51
51
  };
52
52
  class: {
53
53
  type: PropType<any>;
54
- default: undefined;
54
+ default: () => "";
55
55
  };
56
56
  ui: {
57
- type: PropType<Partial<any>>;
58
- default: undefined;
57
+ type: PropType<any>;
58
+ default: () => {};
59
59
  };
60
60
  }, {
61
61
  ui: import("vue").ComputedRef<any>;
@@ -70,7 +70,7 @@ declare const _default: import("vue").DefineComponent<{
70
70
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
71
71
  id: {
72
72
  type: StringConstructor;
73
- default: () => string;
73
+ default: () => null;
74
74
  };
75
75
  value: {
76
76
  type: (ObjectConstructor | BooleanConstructor | NumberConstructor | StringConstructor)[];
@@ -119,22 +119,22 @@ declare const _default: import("vue").DefineComponent<{
119
119
  };
120
120
  class: {
121
121
  type: PropType<any>;
122
- default: undefined;
122
+ default: () => "";
123
123
  };
124
124
  ui: {
125
- type: PropType<Partial<any>>;
126
- default: undefined;
125
+ type: PropType<any>;
126
+ default: () => {};
127
127
  };
128
128
  }>> & {
129
129
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
130
130
  onChange?: ((...args: any[]) => any) | undefined;
131
131
  }, {
132
+ ui: any;
133
+ value: string | number | boolean | Record<string, any>;
132
134
  id: string;
133
135
  color: any;
134
- ui: Partial<any>;
135
136
  name: string;
136
137
  class: any;
137
- value: string | number | boolean | Record<string, any>;
138
138
  label: string;
139
139
  modelValue: boolean | unknown[];
140
140
  indeterminate: boolean;
@@ -201,7 +201,7 @@ async function getValibotError(state, schema) {
201
201
  const result = await schema._parse(state);
202
202
  if (result.issues) {
203
203
  return result.issues.map((issue) => ({
204
- path: issue.path.map((p) => p.key).join("."),
204
+ path: issue.path?.map((p) => p.key).join(".") || "",
205
205
  message: issue.message
206
206
  }));
207
207
  }
@@ -43,7 +43,6 @@ import { useUI } from "../../composables/useUI";
43
43
  import { mergeConfig } from "../../utils";
44
44
  import appConfig from "#build/app.config";
45
45
  import { formGroup } from "#ui/ui.config";
46
- import { uid } from "../../utils/uid";
47
46
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.formGroup, formGroup);
48
47
  export default defineComponent({
49
48
  inheritAttrs: false,
@@ -85,11 +84,15 @@ export default defineComponent({
85
84
  },
86
85
  class: {
87
86
  type: [String, Object, Array],
88
- default: void 0
87
+ default: () => ""
89
88
  },
90
89
  ui: {
91
90
  type: Object,
92
- default: void 0
91
+ default: () => ({})
92
+ },
93
+ eagerValidation: {
94
+ type: Boolean,
95
+ default: false
93
96
  }
94
97
  },
95
98
  setup(props) {
@@ -99,12 +102,13 @@ export default defineComponent({
99
102
  return props.error && typeof props.error === "string" || typeof props.error === "boolean" ? props.error : formErrors?.value?.find((error2) => error2.path === props.name)?.message;
100
103
  });
101
104
  const size = computed(() => ui.value.size[props.size ?? config.default.size]);
102
- const inputId = ref(uid());
105
+ const inputId = ref();
103
106
  provide("form-group", {
104
107
  error,
105
108
  inputId,
106
109
  name: computed(() => props.name),
107
- size: computed(() => props.size)
110
+ size: computed(() => props.size),
111
+ eagerValidation: computed(() => props.eagerValidation)
108
112
  });
109
113
  return {
110
114
  // eslint-disable-next-line vue/no-dupe-keys