@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
@@ -1,4 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
+ import type { TextareaSize, TextareaVariant } from '../../types';
2
3
  declare const _default: import("vue").DefineComponent<{
3
4
  modelValue: {
4
5
  type: (NumberConstructor | StringConstructor)[];
@@ -49,7 +50,7 @@ declare const _default: import("vue").DefineComponent<{
49
50
  default: boolean;
50
51
  };
51
52
  size: {
52
- type: PropType<string | number | symbol>;
53
+ type: PropType<TextareaSize>;
53
54
  default: null;
54
55
  validator(value: string): boolean;
55
56
  };
@@ -59,7 +60,7 @@ declare const _default: import("vue").DefineComponent<{
59
60
  validator(value: string): boolean;
60
61
  };
61
62
  variant: {
62
- type: PropType<any>;
63
+ type: PropType<TextareaVariant>;
63
64
  default: () => any;
64
65
  validator(value: string): boolean;
65
66
  };
@@ -69,11 +70,19 @@ declare const _default: import("vue").DefineComponent<{
69
70
  };
70
71
  class: {
71
72
  type: PropType<any>;
72
- default: undefined;
73
+ default: () => "";
73
74
  };
74
75
  ui: {
75
- type: PropType<Partial<any>>;
76
- default: undefined;
76
+ type: PropType<any>;
77
+ default: () => {};
78
+ };
79
+ modelModifiers: {
80
+ type: PropType<{
81
+ trim?: boolean | undefined;
82
+ lazy?: boolean | undefined;
83
+ number?: boolean | undefined;
84
+ }>;
85
+ default: () => {};
77
86
  };
78
87
  }, {
79
88
  ui: import("vue").ComputedRef<any>;
@@ -84,7 +93,8 @@ declare const _default: import("vue").DefineComponent<{
84
93
  inputId: import("vue").Ref<string | undefined>;
85
94
  textarea: import("vue").Ref<HTMLTextAreaElement | null>;
86
95
  textareaClass: import("vue").ComputedRef<string>;
87
- onInput: (event: InputEvent) => void;
96
+ onInput: (event: Event) => void;
97
+ onChange: (event: Event) => void;
88
98
  onBlur: (event: FocusEvent) => void;
89
99
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("blur" | "update:modelValue")[], "blur" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
90
100
  modelValue: {
@@ -136,7 +146,7 @@ declare const _default: import("vue").DefineComponent<{
136
146
  default: boolean;
137
147
  };
138
148
  size: {
139
- type: PropType<string | number | symbol>;
149
+ type: PropType<TextareaSize>;
140
150
  default: null;
141
151
  validator(value: string): boolean;
142
152
  };
@@ -146,7 +156,7 @@ declare const _default: import("vue").DefineComponent<{
146
156
  validator(value: string): boolean;
147
157
  };
148
158
  variant: {
149
- type: PropType<any>;
159
+ type: PropType<TextareaVariant>;
150
160
  default: () => any;
151
161
  validator(value: string): boolean;
152
162
  };
@@ -156,32 +166,45 @@ declare const _default: import("vue").DefineComponent<{
156
166
  };
157
167
  class: {
158
168
  type: PropType<any>;
159
- default: undefined;
169
+ default: () => "";
160
170
  };
161
171
  ui: {
162
- type: PropType<Partial<any>>;
163
- default: undefined;
172
+ type: PropType<any>;
173
+ default: () => {};
174
+ };
175
+ modelModifiers: {
176
+ type: PropType<{
177
+ trim?: boolean | undefined;
178
+ lazy?: boolean | undefined;
179
+ number?: boolean | undefined;
180
+ }>;
181
+ default: () => {};
164
182
  };
165
183
  }>> & {
166
184
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
167
185
  onBlur?: ((...args: any[]) => any) | undefined;
168
186
  }, {
169
187
  resize: boolean;
188
+ size: TextareaSize;
189
+ ui: any;
170
190
  id: string;
171
191
  color: any;
172
- ui: Partial<any>;
173
192
  name: string;
174
193
  class: any;
175
194
  modelValue: string | number;
176
195
  rows: number;
177
196
  disabled: boolean;
178
- variant: any;
197
+ variant: TextareaVariant;
179
198
  required: boolean;
180
- size: string | number | symbol;
181
199
  placeholder: string;
182
200
  padded: boolean;
183
201
  autofocus: boolean;
184
202
  autofocusDelay: number;
203
+ modelModifiers: {
204
+ trim?: boolean | undefined;
205
+ lazy?: boolean | undefined;
206
+ number?: boolean | undefined;
207
+ };
185
208
  autoresize: boolean;
186
209
  textareaClass: string;
187
210
  }, {}>;
@@ -7,7 +7,7 @@
7
7
  :class="switchClass"
8
8
  v-bind="attrs"
9
9
  >
10
- <span :class="[active ? ui.container.active : ui.container.inactive, ui.container.base]">
10
+ <span :class="containerClass">
11
11
  <span v-if="onIcon" :class="[active ? ui.icon.active : ui.icon.inactive, ui.icon.base]" aria-hidden="true">
12
12
  <UIcon :name="onIcon" :class="onIconClass" />
13
13
  </span>
@@ -67,13 +67,20 @@ export default defineComponent({
67
67
  return appConfig.ui.colors.includes(value);
68
68
  }
69
69
  },
70
+ size: {
71
+ type: String,
72
+ default: config.default.size,
73
+ validator(value) {
74
+ return Object.keys(config.size).includes(value);
75
+ }
76
+ },
70
77
  class: {
71
78
  type: [String, Object, Array],
72
- default: void 0
79
+ default: () => ""
73
80
  },
74
81
  ui: {
75
82
  type: Object,
76
- default: void 0
83
+ default: () => ({})
77
84
  }
78
85
  },
79
86
  emits: ["update:modelValue"],
@@ -92,19 +99,29 @@ export default defineComponent({
92
99
  const switchClass = computed(() => {
93
100
  return twMerge(twJoin(
94
101
  ui.value.base,
102
+ ui.value.size[props.size],
95
103
  ui.value.rounded,
96
- ui.value.ring.replaceAll("{color}", color.value),
97
- (active.value ? ui.value.active : ui.value.inactive).replaceAll("{color}", color.value)
104
+ color.value && ui.value.ring.replaceAll("{color}", color.value),
105
+ color.value && (active.value ? ui.value.active : ui.value.inactive).replaceAll("{color}", color.value)
98
106
  ), props.class);
99
107
  });
108
+ const containerClass = computed(() => {
109
+ return twJoin(
110
+ ui.value.container.base,
111
+ ui.value.container.size[props.size],
112
+ active.value ? ui.value.container.active[props.size] : ui.value.container.inactive
113
+ );
114
+ });
100
115
  const onIconClass = computed(() => {
101
116
  return twJoin(
102
- ui.value.icon.on.replaceAll("{color}", color.value)
117
+ ui.value.icon.size[props.size],
118
+ color.value && ui.value.icon.on.replaceAll("{color}", color.value)
103
119
  );
104
120
  });
105
121
  const offIconClass = computed(() => {
106
122
  return twJoin(
107
- ui.value.icon.off.replaceAll("{color}", color.value)
123
+ ui.value.icon.size[props.size],
124
+ color.value && ui.value.icon.off.replaceAll("{color}", color.value)
108
125
  );
109
126
  });
110
127
  return {
@@ -116,6 +133,7 @@ export default defineComponent({
116
133
  inputId,
117
134
  active,
118
135
  switchClass,
136
+ containerClass,
119
137
  onIconClass,
120
138
  offIconClass
121
139
  };
@@ -1,4 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
+ import type { ToggleSize } from '../../types';
2
3
  declare const _default: import("vue").DefineComponent<{
3
4
  id: {
4
5
  type: StringConstructor;
@@ -29,13 +30,18 @@ declare const _default: import("vue").DefineComponent<{
29
30
  default: () => any;
30
31
  validator(value: string): any;
31
32
  };
33
+ size: {
34
+ type: PropType<ToggleSize>;
35
+ default: any;
36
+ validator(value: string): boolean;
37
+ };
32
38
  class: {
33
39
  type: PropType<any>;
34
- default: undefined;
40
+ default: () => "";
35
41
  };
36
42
  ui: {
37
- type: PropType<Partial<any>>;
38
- default: undefined;
43
+ type: PropType<any>;
44
+ default: () => {};
39
45
  };
40
46
  }, {
41
47
  ui: import("vue").ComputedRef<any>;
@@ -46,6 +52,7 @@ declare const _default: import("vue").DefineComponent<{
46
52
  inputId: import("vue").Ref<string | undefined>;
47
53
  active: import("vue").WritableComputedRef<boolean>;
48
54
  switchClass: import("vue").ComputedRef<string>;
55
+ containerClass: import("vue").ComputedRef<string>;
49
56
  onIconClass: import("vue").ComputedRef<string>;
50
57
  offIconClass: import("vue").ComputedRef<string>;
51
58
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
@@ -78,20 +85,26 @@ declare const _default: import("vue").DefineComponent<{
78
85
  default: () => any;
79
86
  validator(value: string): any;
80
87
  };
88
+ size: {
89
+ type: PropType<ToggleSize>;
90
+ default: any;
91
+ validator(value: string): boolean;
92
+ };
81
93
  class: {
82
94
  type: PropType<any>;
83
- default: undefined;
95
+ default: () => "";
84
96
  };
85
97
  ui: {
86
- type: PropType<Partial<any>>;
87
- default: undefined;
98
+ type: PropType<any>;
99
+ default: () => {};
88
100
  };
89
101
  }>> & {
90
102
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
91
103
  }, {
104
+ size: ToggleSize;
105
+ ui: any;
92
106
  id: string;
93
107
  color: any;
94
- ui: Partial<any>;
95
108
  name: string;
96
109
  class: any;
97
110
  modelValue: boolean;
@@ -33,11 +33,11 @@ export default defineComponent({
33
33
  },
34
34
  class: {
35
35
  type: [String, Object, Array],
36
- default: void 0
36
+ default: () => ""
37
37
  },
38
38
  ui: {
39
39
  type: Object,
40
- default: void 0
40
+ default: () => ({})
41
41
  }
42
42
  },
43
43
  setup(props) {
@@ -6,11 +6,11 @@ declare const _default: import("vue").DefineComponent<{
6
6
  };
7
7
  class: {
8
8
  type: PropType<any>;
9
- default: undefined;
9
+ default: () => string;
10
10
  };
11
11
  ui: {
12
- type: PropType<Partial<any>>;
13
- default: undefined;
12
+ type: PropType<any>;
13
+ default: () => {};
14
14
  };
15
15
  }, {
16
16
  ui: import("vue").ComputedRef<any>;
@@ -25,14 +25,14 @@ declare const _default: import("vue").DefineComponent<{
25
25
  };
26
26
  class: {
27
27
  type: PropType<any>;
28
- default: undefined;
28
+ default: () => string;
29
29
  };
30
30
  ui: {
31
- type: PropType<Partial<any>>;
32
- default: undefined;
31
+ type: PropType<any>;
32
+ default: () => {};
33
33
  };
34
34
  }>>, {
35
- ui: Partial<any>;
35
+ ui: any;
36
36
  class: any;
37
37
  as: string;
38
38
  }, {}>;
@@ -21,11 +21,11 @@ export default defineComponent({
21
21
  },
22
22
  class: {
23
23
  type: [String, Object, Array],
24
- default: void 0
24
+ default: () => ""
25
25
  },
26
26
  ui: {
27
27
  type: Object,
28
- default: void 0
28
+ default: () => ({})
29
29
  }
30
30
  },
31
31
  setup(props) {
@@ -6,11 +6,11 @@ declare const _default: import("vue").DefineComponent<{
6
6
  };
7
7
  class: {
8
8
  type: PropType<any>;
9
- default: undefined;
9
+ default: () => string;
10
10
  };
11
11
  ui: {
12
- type: PropType<Partial<any>>;
13
- default: undefined;
12
+ type: PropType<any>;
13
+ default: () => {};
14
14
  };
15
15
  }, {
16
16
  ui: import("vue").ComputedRef<any>;
@@ -25,14 +25,14 @@ declare const _default: import("vue").DefineComponent<{
25
25
  };
26
26
  class: {
27
27
  type: PropType<any>;
28
- default: undefined;
28
+ default: () => string;
29
29
  };
30
30
  ui: {
31
- type: PropType<Partial<any>>;
32
- default: undefined;
31
+ type: PropType<any>;
32
+ default: () => {};
33
33
  };
34
34
  }>>, {
35
- ui: Partial<any>;
35
+ ui: any;
36
36
  class: any;
37
37
  as: string;
38
38
  }, {}>;
@@ -59,11 +59,11 @@ export default defineComponent({
59
59
  },
60
60
  class: {
61
61
  type: [String, Object, Array],
62
- default: void 0
62
+ default: () => ""
63
63
  },
64
64
  ui: {
65
65
  type: Object,
66
- default: void 0
66
+ default: () => ({})
67
67
  }
68
68
  },
69
69
  setup(props) {
@@ -82,16 +82,11 @@ export default defineComponent({
82
82
  );
83
83
  });
84
84
  const borderClass = computed(() => {
85
- const typeClass = {
86
- solid: "border-solid",
87
- dotted: "border-dotted",
88
- dashed: "border-dashed"
89
- }[props.type];
90
85
  return twJoin(
91
86
  ui.value.border.base,
92
87
  isHorizontal.value ? ui.value.border.horizontal : ui.value.border.vertical,
93
88
  isHorizontal.value ? ui.value.border.size.horizontal : ui.value.border.size.vertical,
94
- typeClass
89
+ ui.value.border.type[props.type]
95
90
  );
96
91
  });
97
92
  return {
@@ -25,11 +25,11 @@ declare const _default: import("vue").DefineComponent<{
25
25
  };
26
26
  class: {
27
27
  type: PropType<any>;
28
- default: undefined;
28
+ default: () => string;
29
29
  };
30
30
  ui: {
31
- type: PropType<Partial<any>>;
32
- default: undefined;
31
+ type: PropType<any>;
32
+ default: () => {};
33
33
  };
34
34
  }, {
35
35
  ui: import("vue").ComputedRef<any>;
@@ -64,19 +64,19 @@ declare const _default: import("vue").DefineComponent<{
64
64
  };
65
65
  class: {
66
66
  type: PropType<any>;
67
- default: undefined;
67
+ default: () => string;
68
68
  };
69
69
  ui: {
70
- type: PropType<Partial<any>>;
71
- default: undefined;
70
+ type: PropType<any>;
71
+ default: () => {};
72
72
  };
73
73
  }>>, {
74
+ orientation: "horizontal" | "vertical";
75
+ ui: any;
74
76
  icon: string;
75
77
  avatar: Avatar;
76
- ui: Partial<any>;
78
+ type: "solid" | "dotted" | "dashed";
77
79
  class: any;
78
80
  label: string;
79
- type: "solid" | "dotted" | "dashed";
80
- orientation: "horizontal" | "vertical";
81
81
  }, {}>;
82
82
  export default _default;
@@ -15,11 +15,11 @@ export default defineComponent({
15
15
  props: {
16
16
  class: {
17
17
  type: [String, Object, Array],
18
- default: void 0
18
+ default: () => ""
19
19
  },
20
20
  ui: {
21
21
  type: Object,
22
- default: void 0
22
+ default: () => ({})
23
23
  }
24
24
  },
25
25
  setup(props) {
@@ -2,11 +2,11 @@ import type { PropType } from 'vue';
2
2
  declare const _default: import("vue").DefineComponent<{
3
3
  class: {
4
4
  type: PropType<any>;
5
- default: undefined;
5
+ default: () => string;
6
6
  };
7
7
  ui: {
8
- type: PropType<Partial<any>>;
9
- default: undefined;
8
+ type: PropType<any>;
9
+ default: () => {};
10
10
  };
11
11
  }, {
12
12
  ui: import("vue").ComputedRef<any>;
@@ -17,14 +17,14 @@ declare const _default: import("vue").DefineComponent<{
17
17
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  class: {
19
19
  type: PropType<any>;
20
- default: undefined;
20
+ default: () => string;
21
21
  };
22
22
  ui: {
23
- type: PropType<Partial<any>>;
24
- default: undefined;
23
+ type: PropType<any>;
24
+ default: () => {};
25
25
  };
26
26
  }>>, {
27
- ui: Partial<any>;
27
+ ui: any;
28
28
  class: any;
29
29
  }, {}>;
30
30
  export default _default;
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <nav aria-label="Breadcrumb" :class="ui.wrapper" v-bind="attrs">
3
+ <ol :class="ui.ol">
4
+ <li v-for="(link, index) in links" :key="index" :class="ui.li">
5
+ <ULink
6
+ as="span"
7
+ :class="[ui.base, index === links.length - 1 ? ui.active : !!link.to ? ui.inactive : '']"
8
+ v-bind="omit(link, ['label', 'icon', 'iconClass'])"
9
+ :aria-current="index === links.length - 1 ? 'page' : undefined"
10
+ >
11
+ <slot name="icon" :link="link" :index="index" :is-active="index === links.length - 1">
12
+ <UIcon
13
+ v-if="link.icon"
14
+ :name="link.icon"
15
+ :class="[ui.icon.base, index === links.length - 1 ? ui.icon.active : !!link.to ? ui.icon.inactive : '', link.iconClass]"
16
+ />
17
+ </slot>
18
+
19
+ <slot :link="link" :index="index" :is-active="index === links.length - 1">
20
+ {{ link.label }}
21
+ </slot>
22
+ </ULink>
23
+
24
+ <slot v-if="index < links.length - 1" name="divider">
25
+ <template v-if="divider">
26
+ <UIcon v-if="divider.startsWith('i-')" :name="divider" :class="ui.divider.base" role="presentation" />
27
+ <span v-else role="presentation">{{ divider }}</span>
28
+ </template>
29
+ </slot>
30
+ </li>
31
+ </ol>
32
+ </nav>
33
+ </template>
34
+
35
+ <script>
36
+ import { defineComponent, toRef } from "vue";
37
+ import UIcon from "../elements/Icon.vue";
38
+ import ULink from "../elements/Link.vue";
39
+ import { useUI } from "../../composables/useUI";
40
+ import { mergeConfig, omit } from "../../utils";
41
+ import appConfig from "#build/app.config";
42
+ import { breadcrumb } from "#ui/ui.config";
43
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.breadcrumb, breadcrumb);
44
+ export default defineComponent({
45
+ components: {
46
+ UIcon,
47
+ ULink
48
+ },
49
+ inheritAttrs: false,
50
+ props: {
51
+ links: {
52
+ type: Array,
53
+ default: () => []
54
+ },
55
+ divider: {
56
+ type: String,
57
+ default: () => config.default.divider
58
+ },
59
+ class: {
60
+ type: [String, Object, Array],
61
+ default: () => ""
62
+ },
63
+ ui: {
64
+ type: Object,
65
+ default: () => ({})
66
+ }
67
+ },
68
+ setup(props) {
69
+ const { ui, attrs } = useUI("breadcrumb", toRef(props, "ui"), config, toRef(props, "class"));
70
+ return {
71
+ // eslint-disable-next-line vue/no-dupe-keys
72
+ ui,
73
+ attrs,
74
+ omit
75
+ };
76
+ }
77
+ });
78
+ </script>
@@ -0,0 +1,50 @@
1
+ import type { PropType } from 'vue';
2
+ import { omit } from '../../utils';
3
+ import type { BreadcrumbLink } from '../../types';
4
+ declare const _default: import("vue").DefineComponent<{
5
+ links: {
6
+ type: PropType<BreadcrumbLink[]>;
7
+ default: () => never[];
8
+ };
9
+ divider: {
10
+ type: StringConstructor;
11
+ default: () => any;
12
+ };
13
+ class: {
14
+ type: PropType<any>;
15
+ default: () => string;
16
+ };
17
+ ui: {
18
+ type: PropType<any>;
19
+ default: () => {};
20
+ };
21
+ }, {
22
+ ui: import("vue").ComputedRef<any>;
23
+ attrs: import("vue").ComputedRef<Pick<{
24
+ [x: string]: unknown;
25
+ }, string>>;
26
+ omit: typeof omit;
27
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
28
+ links: {
29
+ type: PropType<BreadcrumbLink[]>;
30
+ default: () => never[];
31
+ };
32
+ divider: {
33
+ type: StringConstructor;
34
+ default: () => any;
35
+ };
36
+ class: {
37
+ type: PropType<any>;
38
+ default: () => string;
39
+ };
40
+ ui: {
41
+ type: PropType<any>;
42
+ default: () => {};
43
+ };
44
+ }>>, {
45
+ ui: any;
46
+ class: any;
47
+ divider: string;
48
+ links: BreadcrumbLink[];
49
+ }, {}>;
50
+ export default _default;