@nuxt/ui 2.11.0 → 2.12.0

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 (159) hide show
  1. package/dist/module.d.mts +294 -48
  2. package/dist/module.d.ts +294 -48
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +6 -4
  5. package/dist/runtime/components/data/Table.vue +29 -21
  6. package/dist/runtime/components/data/Table.vue.d.ts +28 -19
  7. package/dist/runtime/components/elements/Accordion.vue +10 -6
  8. package/dist/runtime/components/elements/Accordion.vue.d.ts +11 -11
  9. package/dist/runtime/components/elements/Alert.vue +12 -6
  10. package/dist/runtime/components/elements/Alert.vue.d.ts +12 -17
  11. package/dist/runtime/components/elements/Avatar.vue +2 -2
  12. package/dist/runtime/components/elements/Avatar.vue.d.ts +7 -7
  13. package/dist/runtime/components/elements/AvatarGroup.d.ts +7 -7
  14. package/dist/runtime/components/elements/AvatarGroup.mjs +2 -2
  15. package/dist/runtime/components/elements/Badge.vue +2 -2
  16. package/dist/runtime/components/elements/Badge.vue.d.ts +7 -7
  17. package/dist/runtime/components/elements/Button.vue +8 -6
  18. package/dist/runtime/components/elements/Button.vue.d.ts +9 -8
  19. package/dist/runtime/components/elements/ButtonGroup.d.ts +7 -7
  20. package/dist/runtime/components/elements/ButtonGroup.mjs +3 -16
  21. package/dist/runtime/components/elements/Chip.vue +2 -2
  22. package/dist/runtime/components/elements/Chip.vue.d.ts +9 -9
  23. package/dist/runtime/components/elements/Dropdown.vue +68 -19
  24. package/dist/runtime/components/elements/Dropdown.vue.d.ts +37 -9
  25. package/dist/runtime/components/elements/Kbd.vue +2 -2
  26. package/dist/runtime/components/elements/Kbd.vue.d.ts +7 -7
  27. package/dist/runtime/components/elements/Link.vue +2 -2
  28. package/dist/runtime/components/elements/Meter.vue +2 -2
  29. package/dist/runtime/components/elements/Meter.vue.d.ts +7 -7
  30. package/dist/runtime/components/elements/MeterGroup.d.ts +9 -9
  31. package/dist/runtime/components/elements/MeterGroup.mjs +8 -21
  32. package/dist/runtime/components/elements/Progress.vue +5 -94
  33. package/dist/runtime/components/elements/Progress.vue.d.ts +123 -1
  34. package/dist/runtime/components/forms/Checkbox.vue +7 -7
  35. package/dist/runtime/components/forms/Checkbox.vue.d.ts +8 -8
  36. package/dist/runtime/components/forms/Form.vue +17 -8
  37. package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
  38. package/dist/runtime/components/forms/FormGroup.vue +2 -2
  39. package/dist/runtime/components/forms/FormGroup.vue.d.ts +7 -7
  40. package/dist/runtime/components/forms/Input.vue +8 -8
  41. package/dist/runtime/components/forms/Input.vue.d.ts +11 -11
  42. package/dist/runtime/components/forms/InputMenu.vue +410 -0
  43. package/dist/runtime/components/forms/InputMenu.vue.d.ts +331 -0
  44. package/dist/runtime/components/forms/Radio.vue +7 -7
  45. package/dist/runtime/components/forms/Radio.vue.d.ts +7 -7
  46. package/dist/runtime/components/forms/RadioGroup.vue +5 -5
  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 +8 -8
  50. package/dist/runtime/components/forms/Select.vue +8 -8
  51. package/dist/runtime/components/forms/Select.vue.d.ts +10 -10
  52. package/dist/runtime/components/forms/SelectMenu.vue +69 -36
  53. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +40 -20
  54. package/dist/runtime/components/forms/Textarea.vue +3 -3
  55. package/dist/runtime/components/forms/Textarea.vue.d.ts +10 -10
  56. package/dist/runtime/components/forms/Toggle.vue +10 -10
  57. package/dist/runtime/components/forms/Toggle.vue.d.ts +16 -15
  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 +7 -7
  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 +9 -6
  67. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +10 -7
  68. package/dist/runtime/components/navigation/CommandPalette.vue +42 -33
  69. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +16 -9
  70. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -3
  71. package/dist/runtime/components/navigation/Pagination.vue +16 -11
  72. package/dist/runtime/components/navigation/Pagination.vue.d.ts +16 -7
  73. package/dist/runtime/components/navigation/Tabs.vue +8 -5
  74. package/dist/runtime/components/navigation/Tabs.vue.d.ts +9 -9
  75. package/dist/runtime/components/navigation/VerticalNavigation.vue +56 -39
  76. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +14 -10
  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 +8 -8
  81. package/dist/runtime/components/overlays/Notification.vue +7 -7
  82. package/dist/runtime/components/overlays/Notification.vue.d.ts +7 -7
  83. package/dist/runtime/components/overlays/Notifications.vue +2 -2
  84. package/dist/runtime/components/overlays/Notifications.vue.d.ts +7 -7
  85. package/dist/runtime/components/overlays/Popover.vue +54 -17
  86. package/dist/runtime/components/overlays/Popover.vue.d.ts +21 -11
  87. package/dist/runtime/components/overlays/Slideover.vue +6 -6
  88. package/dist/runtime/components/overlays/Slideover.vue.d.ts +8 -8
  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/useFormGroup.d.ts +3 -3
  92. package/dist/runtime/composables/useFormGroup.mjs +1 -1
  93. package/dist/runtime/composables/useShortcuts.mjs +3 -1
  94. package/dist/runtime/composables/useUI.d.ts +3 -3
  95. package/dist/runtime/types/alert.d.ts +5 -0
  96. package/dist/runtime/types/breadcrumb.d.ts +3 -0
  97. package/dist/runtime/types/dropdown.d.ts +2 -0
  98. package/dist/runtime/types/form.d.ts +2 -1
  99. package/dist/runtime/types/popper.d.ts +2 -0
  100. package/dist/runtime/types/utils.d.ts +4 -4
  101. package/dist/runtime/types/vertical-navigation.d.ts +1 -0
  102. package/dist/runtime/ui.config/data/table.d.ts +2 -2
  103. package/dist/runtime/ui.config/elements/accordion.d.ts +1 -1
  104. package/dist/runtime/ui.config/elements/alert.d.ts +5 -4
  105. package/dist/runtime/ui.config/elements/alert.mjs +1 -0
  106. package/dist/runtime/ui.config/elements/button.d.ts +4 -0
  107. package/dist/runtime/ui.config/elements/button.mjs +4 -0
  108. package/dist/runtime/ui.config/elements/buttonGroup.d.ts +92 -0
  109. package/dist/runtime/ui.config/elements/buttonGroup.mjs +12 -1
  110. package/dist/runtime/ui.config/elements/dropdown.d.ts +3 -1
  111. package/dist/runtime/ui.config/elements/dropdown.mjs +4 -2
  112. package/dist/runtime/ui.config/elements/meterGroup.d.ts +40 -0
  113. package/dist/runtime/ui.config/elements/meterGroup.mjs +14 -1
  114. package/dist/runtime/ui.config/forms/checkbox.d.ts +3 -0
  115. package/dist/runtime/ui.config/forms/checkbox.mjs +3 -0
  116. package/dist/runtime/ui.config/forms/input.d.ts +2 -0
  117. package/dist/runtime/ui.config/forms/input.mjs +14 -12
  118. package/dist/runtime/ui.config/forms/inputMenu.d.ts +64 -0
  119. package/dist/runtime/ui.config/forms/inputMenu.mjs +62 -0
  120. package/dist/runtime/ui.config/forms/radio.d.ts +3 -0
  121. package/dist/runtime/ui.config/forms/radio.mjs +3 -0
  122. package/dist/runtime/ui.config/forms/select.d.ts +2 -0
  123. package/dist/runtime/ui.config/forms/select.mjs +1 -0
  124. package/dist/runtime/ui.config/forms/selectMenu.d.ts +18 -11
  125. package/dist/runtime/ui.config/forms/selectMenu.mjs +12 -41
  126. package/dist/runtime/ui.config/forms/textarea.d.ts +2 -0
  127. package/dist/runtime/ui.config/forms/textarea.mjs +1 -0
  128. package/dist/runtime/ui.config/index.d.ts +1 -0
  129. package/dist/runtime/ui.config/index.mjs +1 -0
  130. package/dist/runtime/ui.config/layout/card.mjs +1 -1
  131. package/dist/runtime/ui.config/layout/divider.d.ts +6 -1
  132. package/dist/runtime/ui.config/layout/divider.mjs +5 -0
  133. package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +1 -0
  134. package/dist/runtime/ui.config/navigation/breadcrumb.mjs +2 -1
  135. package/dist/runtime/ui.config/navigation/commandPalette.d.ts +5 -1
  136. package/dist/runtime/ui.config/navigation/commandPalette.mjs +5 -1
  137. package/dist/runtime/ui.config/navigation/pagination.d.ts +6 -6
  138. package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +6 -1
  139. package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +5 -0
  140. package/dist/runtime/ui.config/overlays/contextMenu.mjs +1 -1
  141. package/dist/runtime/ui.config/overlays/modal.d.ts +1 -0
  142. package/dist/runtime/ui.config/overlays/modal.mjs +3 -2
  143. package/dist/runtime/ui.config/overlays/notification.d.ts +5 -4
  144. package/dist/runtime/ui.config/overlays/notification.mjs +1 -0
  145. package/dist/runtime/ui.config/overlays/popover.d.ts +1 -0
  146. package/dist/runtime/ui.config/overlays/popover.mjs +2 -1
  147. package/dist/runtime/ui.config/overlays/slideover.d.ts +5 -0
  148. package/dist/runtime/ui.config/overlays/slideover.mjs +5 -0
  149. package/dist/runtime/ui.config/overlays/tooltip.d.ts +1 -0
  150. package/dist/runtime/ui.config/overlays/tooltip.mjs +2 -1
  151. package/dist/runtime/ui.config/{_popperArrow.d.ts → popper.d.ts} +1 -2
  152. package/dist/runtime/ui.config/popper.mjs +9 -0
  153. package/dist/runtime/ui.css +1 -13
  154. package/dist/runtime/utils/index.mjs +11 -3
  155. package/dist/runtime/utils/uid.mjs +2 -1
  156. package/dist/types.d.mts +2 -2
  157. package/dist/types.d.ts +1 -1
  158. package/package.json +29 -28
  159. package/dist/runtime/ui.config/_popperArrow.mjs +0 -8
@@ -1,14 +1,15 @@
1
1
  <template>
2
- <HPopover ref="popover" v-slot="{ open: headlessOpen, close }" :class="ui.wrapper" v-bind="attrs" @mouseleave="onMouseLeave">
2
+ <!-- eslint-disable-next-line vue/no-template-shadow -->
3
+ <HPopover ref="popover" v-slot="{ open, close }" :class="ui.wrapper" v-bind="attrs" @mouseleave="onMouseLeave">
3
4
  <HPopoverButton
4
5
  ref="trigger"
5
6
  as="div"
6
7
  :disabled="disabled"
7
- class="inline-flex w-full"
8
+ :class="ui.trigger"
8
9
  role="button"
9
10
  @mouseover="onMouseOver"
10
11
  >
11
- <slot :open="(open !== undefined) ? open : headlessOpen" :close="close">
12
+ <slot :open="open" :close="close">
12
13
  <button :disabled="disabled">
13
14
  Open
14
15
  </button>
@@ -16,15 +17,16 @@
16
17
  </HPopoverButton>
17
18
 
18
19
  <Transition v-if="overlay" appear v-bind="ui.overlay.transition">
19
- <div v-if="(open !== undefined) ? open : headlessOpen" :class="[ui.overlay.base, ui.overlay.background]" @click="$emit('update:open')" />
20
+ <div v-if="open" :class="[ui.overlay.base, ui.overlay.background]" />
20
21
  </Transition>
21
22
 
22
- <div v-if="(open !== undefined) ? open : headlessOpen" ref="container" :class="[ui.container, ui.width]" :style="containerStyle" @mouseover="onMouseOver">
23
+ <div v-if="open" ref="container" :class="[ui.container, ui.width]" :style="containerStyle" @mouseover="onMouseOver">
23
24
  <Transition appear v-bind="ui.transition">
24
25
  <div>
25
- <div v-if="popper.arrow" data-popper-arrow :class="['invisible before:visible before:block before:rotate-45 before:z-[-1]', Object.values(ui.arrow)]" />
26
+ <div v-if="popper.arrow" data-popper-arrow :class="Object.values(ui.arrow)" />
27
+
26
28
  <HPopoverPanel :class="[ui.base, ui.background, ui.ring, ui.rounded, ui.shadow]" static>
27
- <slot name="panel" :open="(open !== undefined) ? open : headlessOpen" :close="close" />
29
+ <slot name="panel" :open="open" :close="close" />
28
30
  </HPopoverPanel>
29
31
  </div>
30
32
  </Transition>
@@ -33,7 +35,7 @@
33
35
  </template>
34
36
 
35
37
  <script>
36
- import { computed, ref, toRef, onMounted, defineComponent } from "vue";
38
+ import { computed, ref, toRef, onMounted, defineComponent, watch } from "vue";
37
39
  import { defu } from "defu";
38
40
  import { Popover as HPopover, PopoverButton as HPopoverButton, PopoverPanel as HPopoverPanel } from "@headlessui/vue";
39
41
  import { useUI } from "../../composables/useUI";
@@ -81,15 +83,15 @@ export default defineComponent({
81
83
  },
82
84
  class: {
83
85
  type: [String, Object, Array],
84
- default: void 0
86
+ default: () => ""
85
87
  },
86
88
  ui: {
87
89
  type: Object,
88
- default: void 0
90
+ default: () => ({})
89
91
  }
90
92
  },
91
93
  emits: ["update:open"],
92
- setup(props) {
94
+ setup(props, { emit }) {
93
95
  const { ui, attrs } = useUI("popover", toRef(props, "ui"), config, toRef(props, "class"));
94
96
  const popper = computed(() => defu(props.mode === "hover" ? { offsetDistance: 0 } : {}, props.popper, ui.value.popper));
95
97
  const [trigger, container] = usePopper(popper.value);
@@ -104,16 +106,35 @@ export default defineComponent({
104
106
  }
105
107
  const popoverProvidesSymbols = Object.getOwnPropertySymbols(popoverProvides);
106
108
  popoverApi.value = popoverProvidesSymbols.length && popoverProvides[popoverProvidesSymbols[0]];
109
+ if (props.open) {
110
+ popoverApi.value?.togglePopover();
111
+ }
107
112
  });
108
113
  const containerStyle = computed(() => {
114
+ if (props.mode !== "hover") {
115
+ return {};
116
+ }
109
117
  const offsetDistance = props.popper?.offsetDistance || ui.value.popper?.offsetDistance || 8;
118
+ const placement = popper.value.placement?.split("-")[0];
110
119
  const padding = `${offsetDistance}px`;
111
- return props.mode === "hover" ? {
112
- paddingTop: padding,
113
- paddingBottom: padding,
114
- paddingLeft: padding,
115
- paddingRight: padding
116
- } : {};
120
+ if (placement === "top" || placement === "bottom") {
121
+ return {
122
+ paddingTop: padding,
123
+ paddingBottom: padding
124
+ };
125
+ } else if (placement === "left" || placement === "right") {
126
+ return {
127
+ paddingLeft: padding,
128
+ paddingRight: padding
129
+ };
130
+ } else {
131
+ return {
132
+ paddingTop: padding,
133
+ paddingBottom: padding,
134
+ paddingLeft: padding,
135
+ paddingRight: padding
136
+ };
137
+ }
117
138
  });
118
139
  function onMouseOver() {
119
140
  if (props.mode !== "hover" || !popoverApi.value) {
@@ -147,6 +168,22 @@ export default defineComponent({
147
168
  closeTimeout = null;
148
169
  }, props.closeDelay);
149
170
  }
171
+ watch(() => props.open, (newValue, oldValue) => {
172
+ if (!popoverApi.value)
173
+ return;
174
+ if (oldValue === void 0 || newValue === oldValue)
175
+ return;
176
+ if (newValue) {
177
+ popoverApi.value.popoverState = 0;
178
+ } else {
179
+ popoverApi.value.closePopover();
180
+ }
181
+ });
182
+ watch(() => popoverApi.value?.popoverState, (newValue, oldValue) => {
183
+ if (oldValue === void 0 || newValue === oldValue)
184
+ return;
185
+ emit("update:open", newValue === 0);
186
+ });
150
187
  return {
151
188
  // eslint-disable-next-line vue/no-dupe-keys
152
189
  ui,
@@ -32,31 +32,41 @@ declare const _default: import("vue").DefineComponent<{
32
32
  };
33
33
  class: {
34
34
  type: PropType<any>;
35
- default: undefined;
35
+ default: () => string;
36
36
  };
37
37
  ui: {
38
- type: PropType<Partial<any>>;
39
- default: undefined;
38
+ type: PropType<any>;
39
+ default: () => {};
40
40
  };
41
41
  }, {
42
42
  ui: import("vue").ComputedRef<any>;
43
43
  attrs: import("vue").ComputedRef<Pick<{
44
44
  [x: string]: unknown;
45
45
  }, string>>;
46
- popover: any;
46
+ popover: import("vue").Ref<any>;
47
47
  popper: import("vue").ComputedRef<PopperOptions>;
48
48
  trigger: import("vue").Ref<import("@vueuse/core").MaybeElement>;
49
49
  container: import("vue").Ref<import("@vueuse/core").MaybeElement>;
50
50
  containerStyle: import("vue").ComputedRef<{
51
+ paddingTop?: undefined;
52
+ paddingBottom?: undefined;
53
+ paddingLeft?: undefined;
54
+ paddingRight?: undefined;
55
+ } | {
51
56
  paddingTop: string;
52
57
  paddingBottom: string;
58
+ paddingLeft?: undefined;
59
+ paddingRight?: undefined;
60
+ } | {
53
61
  paddingLeft: string;
54
62
  paddingRight: string;
55
- } | {
56
63
  paddingTop?: undefined;
57
64
  paddingBottom?: undefined;
58
- paddingLeft?: undefined;
59
- paddingRight?: undefined;
65
+ } | {
66
+ paddingTop: string;
67
+ paddingBottom: string;
68
+ paddingLeft: string;
69
+ paddingRight: string;
60
70
  }>;
61
71
  onMouseOver: () => void;
62
72
  onMouseLeave: () => void;
@@ -92,16 +102,16 @@ declare const _default: import("vue").DefineComponent<{
92
102
  };
93
103
  class: {
94
104
  type: PropType<any>;
95
- default: undefined;
105
+ default: () => string;
96
106
  };
97
107
  ui: {
98
- type: PropType<Partial<any>>;
99
- default: undefined;
108
+ type: PropType<any>;
109
+ default: () => {};
100
110
  };
101
111
  }>> & {
102
112
  "onUpdate:open"?: ((...args: any[]) => any) | undefined;
103
113
  }, {
104
- ui: Partial<any>;
114
+ ui: any;
105
115
  popper: PopperOptions;
106
116
  class: any;
107
117
  disabled: boolean;
@@ -58,11 +58,11 @@ export default defineComponent({
58
58
  },
59
59
  class: {
60
60
  type: [String, Object, Array],
61
- default: void 0
61
+ default: () => ""
62
62
  },
63
63
  ui: {
64
64
  type: Object,
65
- default: void 0
65
+ default: () => ({})
66
66
  }
67
67
  },
68
68
  emits: ["update:modelValue", "close"],
@@ -82,10 +82,10 @@ export default defineComponent({
82
82
  }
83
83
  return {
84
84
  ...ui.value.transition,
85
- enterFrom: props.side === "left" ? "-translate-x-full" : "translate-x-full",
86
- enterTo: "translate-x-0",
87
- leaveFrom: "translate-x-0",
88
- leaveTo: props.side === "left" ? "-translate-x-full" : "translate-x-full"
85
+ enterFrom: props.side === "left" ? ui.value.translate.left : ui.value.translate.right,
86
+ enterTo: ui.value.translate.base,
87
+ leaveFrom: ui.value.translate.base,
88
+ leaveTo: props.side === "left" ? ui.value.translate.left : ui.value.translate.right
89
89
  };
90
90
  });
91
91
  function close(value) {
@@ -27,11 +27,11 @@ declare const _default: import("vue").DefineComponent<{
27
27
  };
28
28
  class: {
29
29
  type: PropType<any>;
30
- default: undefined;
30
+ default: () => string;
31
31
  };
32
32
  ui: {
33
- type: PropType<Partial<any>>;
34
- default: undefined;
33
+ type: PropType<any>;
34
+ default: () => {};
35
35
  };
36
36
  }, {
37
37
  ui: import("vue").ComputedRef<any>;
@@ -69,22 +69,22 @@ declare const _default: import("vue").DefineComponent<{
69
69
  };
70
70
  class: {
71
71
  type: PropType<any>;
72
- default: undefined;
72
+ default: () => string;
73
73
  };
74
74
  ui: {
75
- type: PropType<Partial<any>>;
76
- default: undefined;
75
+ type: PropType<any>;
76
+ default: () => {};
77
77
  };
78
78
  }>> & {
79
79
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
80
80
  onClose?: ((...args: any[]) => any) | undefined;
81
81
  }, {
82
- ui: Partial<any>;
82
+ ui: any;
83
+ transition: boolean;
83
84
  class: any;
84
85
  modelValue: boolean;
85
86
  appear: boolean;
86
87
  overlay: boolean;
87
- transition: boolean;
88
88
  preventClose: boolean;
89
89
  side: "right" | "left";
90
90
  }, {}>;
@@ -7,15 +7,16 @@
7
7
  <div v-if="open && !prevent" ref="container" :class="[ui.container, ui.width]">
8
8
  <Transition appear v-bind="ui.transition">
9
9
  <div>
10
- <div v-if="popper.arrow" data-popper-arrow :class="['invisible before:visible before:block before:rotate-45 before:z-[-1]', Object.values(ui.arrow)]" />
10
+ <div v-if="popper.arrow" data-popper-arrow :class="Object.values(ui.arrow)" />
11
11
 
12
12
  <div :class="[ui.base, ui.background, ui.color, ui.rounded, ui.shadow, ui.ring]">
13
13
  <slot name="text">
14
14
  {{ text }}
15
15
  </slot>
16
-
16
+
17
17
  <span v-if="shortcuts?.length" :class="ui.shortcuts">
18
- <span class="mx-1 text-gray-700 dark:text-gray-200">&middot;</span>
18
+ <span :class="ui.middot">&middot;</span>
19
+
19
20
  <UKbd v-for="shortcut of shortcuts" :key="shortcut" size="xs">
20
21
  {{ shortcut }}
21
22
  </Ukbd>
@@ -69,11 +70,11 @@ export default defineComponent({
69
70
  },
70
71
  class: {
71
72
  type: [String, Object, Array],
72
- default: void 0
73
+ default: () => ""
73
74
  },
74
75
  ui: {
75
76
  type: Object,
76
- default: void 0
77
+ default: () => ({})
77
78
  }
78
79
  },
79
80
  setup(props) {
@@ -27,11 +27,11 @@ declare const _default: import("vue").DefineComponent<{
27
27
  };
28
28
  class: {
29
29
  type: PropType<any>;
30
- default: undefined;
30
+ default: () => string;
31
31
  };
32
32
  ui: {
33
- type: PropType<Partial<any>>;
34
- default: undefined;
33
+ type: PropType<any>;
34
+ default: () => {};
35
35
  };
36
36
  }, {
37
37
  ui: import("vue").ComputedRef<any>;
@@ -71,14 +71,14 @@ declare const _default: import("vue").DefineComponent<{
71
71
  };
72
72
  class: {
73
73
  type: PropType<any>;
74
- default: undefined;
74
+ default: () => string;
75
75
  };
76
76
  ui: {
77
- type: PropType<Partial<any>>;
78
- default: undefined;
77
+ type: PropType<any>;
78
+ default: () => {};
79
79
  };
80
80
  }>>, {
81
- ui: Partial<any>;
81
+ ui: any;
82
82
  popper: PopperOptions;
83
83
  class: any;
84
84
  text: string;
@@ -1,13 +1,13 @@
1
1
  type InputProps = {
2
- id?: string | null;
2
+ id?: string;
3
3
  size?: string | number | symbol;
4
4
  color?: string;
5
5
  name?: string;
6
- isFieldset?: boolean;
7
6
  eagerValidation?: boolean;
7
+ legend?: string | null;
8
8
  };
9
9
  export declare const useFormGroup: (inputProps?: InputProps, config?: any) => {
10
- inputId: import("vue").Ref<string | null | undefined>;
10
+ inputId: import("vue").Ref<string | undefined>;
11
11
  name: import("vue").ComputedRef<string | undefined>;
12
12
  size: import("vue").ComputedRef<any>;
13
13
  color: import("vue").ComputedRef<string | undefined>;
@@ -7,7 +7,7 @@ export const useFormGroup = (inputProps, config) => {
7
7
  const formInputs = inject("form-inputs", void 0);
8
8
  const inputId = ref(inputProps?.id);
9
9
  onMounted(() => {
10
- inputId.value = inputProps?.isFieldset ? null : inputProps?.id ?? uid();
10
+ inputId.value = inputProps?.legend === null || inputProps.legend ? void 0 : inputProps?.id ?? uid();
11
11
  if (formGroup) {
12
12
  formGroup.inputId.value = inputId.value;
13
13
  if (formInputs) {
@@ -5,7 +5,9 @@ export const _useShortcuts = () => {
5
5
  const metaSymbol = ref(" ");
6
6
  const activeElement = useActiveElement();
7
7
  const usingInput = computed(() => {
8
- const usingInput2 = !!(activeElement.value?.tagName === "INPUT" || activeElement.value?.tagName === "TEXTAREA" || activeElement.value?.contentEditable === "true");
8
+ const tagName = activeElement.value?.tagName;
9
+ const contentEditable = activeElement.value?.contentEditable;
10
+ const usingInput2 = !!(tagName === "INPUT" || tagName === "TEXTAREA" || contentEditable === "true" || contentEditable === "plaintext-only");
9
11
  if (usingInput2) {
10
12
  return activeElement.value?.name || true;
11
13
  }
@@ -1,8 +1,8 @@
1
1
  import type { Ref } from 'vue';
2
2
  import type { Strategy } from '../types';
3
- export declare const useUI: <T>(key: any, $ui: Ref<Partial<T & {
4
- strategy: Strategy;
5
- }> | undefined>, $config?: T | Ref<T> | undefined, $wrapperClass?: Ref<string>, withAppConfig?: boolean) => {
3
+ export declare const useUI: <T>(key: any, $ui?: Ref<(Partial<T> & {
4
+ strategy?: Strategy | undefined;
5
+ }) | undefined> | undefined, $config?: T | Ref<T> | undefined, $wrapperClass?: Ref<string>, withAppConfig?: boolean) => {
6
6
  ui: import("vue").ComputedRef<T>;
7
7
  attrs: import("vue").ComputedRef<Pick<{
8
8
  [x: string]: unknown;
@@ -1,7 +1,12 @@
1
1
  import { alert } from '../ui.config'
2
2
  import type { NestedKeyOf, ExtractDeepKey, ExtractDeepObject } from '.'
3
+ import type { Button } from './button'
3
4
  import colors from '#ui-colors'
4
5
  import type { AppConfig } from 'nuxt/schema'
5
6
 
6
7
  export type AlertColor = keyof typeof alert.color | ExtractDeepKey<AppConfig, ['ui', 'alert', 'color']> | typeof colors[number]
7
8
  export type AlertVariant = keyof typeof alert.variant | ExtractDeepKey<AppConfig, ['ui', 'alert', 'variant']> | NestedKeyOf<typeof alert.color> | NestedKeyOf<ExtractDeepObject<AppConfig, ['ui', 'alert', 'color']>>
9
+
10
+ export interface AlertAction extends Button {
11
+ click?: Function
12
+ }
@@ -2,6 +2,9 @@ import type { Link } from './link'
2
2
 
3
3
  export interface BreadcrumbLink extends Link {
4
4
  label: string
5
+ labelClass?: string
5
6
  icon?: string
6
7
  iconClass?: string
8
+ // FIXME: This is a workaround for `link.to` not being resolved although it extends `NuxtLinkProps`
9
+ [key: string]: any
7
10
  }
@@ -3,11 +3,13 @@ import type { Avatar } from './avatar'
3
3
 
4
4
  export interface DropdownItem extends NuxtLinkProps {
5
5
  label: string
6
+ labelClass?: string
6
7
  slot?: string
7
8
  icon?: string
8
9
  iconClass?: string
9
10
  avatar?: Avatar
10
11
  shortcuts?: string[]
11
12
  disabled?: boolean
13
+ class?: string
12
14
  click?: Function
13
15
  }
@@ -15,6 +15,7 @@ export interface Form<T> {
15
15
  errors: Ref<FormError[]>
16
16
  setErrors(errs: FormError[], path?: string): void
17
17
  getErrors(path?: string): FormError[]
18
+ submit(): Promise<void>
18
19
  }
19
20
 
20
21
  export type FormSubmitEvent<T> = SubmitEvent & { data: T }
@@ -31,6 +32,6 @@ export interface InjectedFormGroupValue {
31
32
  inputId: Ref<string | undefined>
32
33
  name: Ref<string>
33
34
  size: Ref<string | number | symbol>
34
- error: Ref<string | boolean>
35
+ error: Ref<string | boolean | undefined>
35
36
  eagerValidation: Ref<boolean>
36
37
  }
@@ -1,6 +1,8 @@
1
1
  import type { Placement, PositioningStrategy } from '@popperjs/core'
2
2
 
3
3
  export interface PopperOptions {
4
+ // Workaround for weak types: https://mariusschulz.com/blog/weak-type-detection-in-typescript#workarounds-for-weak-types
5
+ [key: string]: unknown
4
6
  locked?: boolean
5
7
  overflowPadding?: number
6
8
  offsetDistance?: number
@@ -1,7 +1,7 @@
1
1
  export type Strategy = 'merge' | 'override'
2
2
 
3
- export type NestedKeyOf<ObjectType extends object> = {
4
- [Key in keyof ObjectType]: ObjectType[Key] extends object
3
+ export type NestedKeyOf<ObjectType extends Record<string, any>> = {
4
+ [Key in keyof ObjectType]: ObjectType[Key] extends Record<string, any>
5
5
  ? NestedKeyOf<ObjectType[Key]>
6
6
  : Key
7
7
  }[keyof ObjectType]
@@ -20,9 +20,9 @@ type DeepKey<T, Keys extends string[]> =
20
20
  : T
21
21
 
22
22
  export type ExtractDeepKey<T, Path extends string[]> = DeepKey<T, Path> extends infer Result
23
- ? Result extends object ? keyof Result : never
23
+ ? Result extends Record<string, any> ? keyof Result : never
24
24
  : never
25
25
 
26
26
  export type ExtractDeepObject<T, Path extends string[]> = DeepKey<T, Path> extends infer Result
27
- ? Result extends object ? Result : never
27
+ ? Result extends Record<string, any> ? Result : never
28
28
  : never
@@ -3,6 +3,7 @@ import type { Avatar } from './avatar'
3
3
 
4
4
  export interface VerticalNavigationLink extends Link {
5
5
  label: string
6
+ labelClass?: string
6
7
  icon?: string
7
8
  iconClass?: string
8
9
  avatar?: Avatar
@@ -43,8 +43,8 @@ declare const _default: {
43
43
  icon: string;
44
44
  trailing: boolean;
45
45
  square: boolean;
46
- color: string;
47
- variant: string;
46
+ color: "gray";
47
+ variant: "ghost";
48
48
  class: string;
49
49
  };
50
50
  loadingState: {
@@ -15,7 +15,7 @@ declare const _default: {
15
15
  openIcon: string;
16
16
  closeIcon: string;
17
17
  class: string;
18
- variant: string;
18
+ variant: "soft";
19
19
  };
20
20
  };
21
21
  export default _default;
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
2
  wrapper: string;
3
+ inner: string;
3
4
  title: string;
4
5
  description: string;
5
6
  actions: string;
@@ -12,7 +13,7 @@ declare const _default: {
12
13
  };
13
14
  avatar: {
14
15
  base: string;
15
- size: string;
16
+ size: "md";
16
17
  };
17
18
  color: {
18
19
  white: {
@@ -31,9 +32,9 @@ declare const _default: {
31
32
  icon: null;
32
33
  closeButton: null;
33
34
  actionButton: {
34
- size: string;
35
- color: string;
36
- variant: string;
35
+ size: "xs";
36
+ color: "primary";
37
+ variant: "link";
37
38
  };
38
39
  };
39
40
  };
@@ -1,5 +1,6 @@
1
1
  export default {
2
2
  wrapper: "w-full relative overflow-hidden",
3
+ inner: "w-0 flex-1",
3
4
  title: "text-sm font-medium",
4
5
  description: "mt-1 text-sm leading-4 opacity-90",
5
6
  actions: "flex items-center gap-2 mt-3 flex-shrink-0",
@@ -2,6 +2,9 @@ declare const _default: {
2
2
  base: string;
3
3
  font: string;
4
4
  rounded: string;
5
+ truncate: string;
6
+ block: string;
7
+ inline: string;
5
8
  size: {
6
9
  '2xs': string;
7
10
  xs: string;
@@ -58,6 +61,7 @@ declare const _default: {
58
61
  };
59
62
  icon: {
60
63
  base: string;
64
+ loading: string;
61
65
  size: {
62
66
  '2xs': string;
63
67
  xs: string;
@@ -2,6 +2,9 @@ export default {
2
2
  base: "focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-75 flex-shrink-0",
3
3
  font: "font-medium",
4
4
  rounded: "rounded-md",
5
+ truncate: "text-left break-all line-clamp-1",
6
+ block: "w-full flex justify-center items-center",
7
+ inline: "inline-flex items-center",
5
8
  size: {
6
9
  "2xs": "text-xs",
7
10
  xs: "text-xs",
@@ -58,6 +61,7 @@ export default {
58
61
  },
59
62
  icon: {
60
63
  base: "flex-shrink-0",
64
+ loading: "animate-spin",
61
65
  size: {
62
66
  "2xs": "h-4 w-4",
63
67
  xs: "h-4 w-4",