@nuxt/ui 2.12.3 → 2.14.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 (148) hide show
  1. package/README.md +8 -8
  2. package/dist/module.d.mts +170 -40
  3. package/dist/module.d.ts +170 -40
  4. package/dist/module.json +2 -2
  5. package/dist/module.mjs +136 -146
  6. package/dist/runtime/components/data/Table.vue +16 -4
  7. package/dist/runtime/components/data/Table.vue.d.ts +21 -3
  8. package/dist/runtime/components/elements/Accordion.vue +11 -2
  9. package/dist/runtime/components/elements/Accordion.vue.d.ts +1 -1
  10. package/dist/runtime/components/elements/Alert.vue +2 -2
  11. package/dist/runtime/components/elements/Alert.vue.d.ts +4 -3
  12. package/dist/runtime/components/elements/Avatar.vue.d.ts +1 -1
  13. package/dist/runtime/components/elements/AvatarGroup.d.ts +1 -1
  14. package/dist/runtime/components/elements/Badge.vue.d.ts +2 -2
  15. package/dist/runtime/components/elements/Button.vue.d.ts +63 -37
  16. package/dist/runtime/components/elements/ButtonGroup.d.ts +1 -1
  17. package/dist/runtime/components/elements/Carousel.vue +156 -0
  18. package/dist/runtime/components/elements/Carousel.vue.d.ts +104 -0
  19. package/dist/runtime/components/elements/Chip.vue.d.ts +5 -5
  20. package/dist/runtime/components/elements/Dropdown.vue +5 -3
  21. package/dist/runtime/components/elements/Dropdown.vue.d.ts +7 -7
  22. package/dist/runtime/components/elements/Icon.vue.d.ts +1 -1
  23. package/dist/runtime/components/elements/Kbd.vue.d.ts +1 -1
  24. package/dist/runtime/components/elements/Link.vue +3 -3
  25. package/dist/runtime/components/elements/Link.vue.d.ts +62 -36
  26. package/dist/runtime/components/elements/Meter.vue +4 -0
  27. package/dist/runtime/components/elements/Meter.vue.d.ts +4 -4
  28. package/dist/runtime/components/elements/MeterGroup.d.ts +4 -4
  29. package/dist/runtime/components/elements/Progress.vue +4 -1
  30. package/dist/runtime/components/elements/Progress.vue.d.ts +8 -8
  31. package/dist/runtime/components/forms/Checkbox.vue +1 -6
  32. package/dist/runtime/components/forms/Checkbox.vue.d.ts +6 -15
  33. package/dist/runtime/components/forms/Form.vue +13 -6
  34. package/dist/runtime/components/forms/Form.vue.d.ts +1 -1
  35. package/dist/runtime/components/forms/FormGroup.vue +20 -17
  36. package/dist/runtime/components/forms/FormGroup.vue.d.ts +2 -2
  37. package/dist/runtime/components/forms/Input.vue +1 -0
  38. package/dist/runtime/components/forms/Input.vue.d.ts +6 -6
  39. package/dist/runtime/components/forms/InputMenu.vue +12 -1
  40. package/dist/runtime/components/forms/InputMenu.vue.d.ts +16 -7
  41. package/dist/runtime/components/forms/Radio.vue +5 -11
  42. package/dist/runtime/components/forms/Radio.vue.d.ts +6 -6
  43. package/dist/runtime/components/forms/RadioGroup.vue +1 -0
  44. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +4 -4
  45. package/dist/runtime/components/forms/Range.vue.d.ts +4 -4
  46. package/dist/runtime/components/forms/Select.vue +5 -1
  47. package/dist/runtime/components/forms/Select.vue.d.ts +6 -6
  48. package/dist/runtime/components/forms/SelectMenu.vue +5 -2
  49. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +7 -7
  50. package/dist/runtime/components/forms/Textarea.vue +5 -1
  51. package/dist/runtime/components/forms/Textarea.vue.d.ts +15 -6
  52. package/dist/runtime/components/forms/Toggle.vue +4 -2
  53. package/dist/runtime/components/forms/Toggle.vue.d.ts +6 -6
  54. package/dist/runtime/components/layout/Card.vue +1 -1
  55. package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
  56. package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
  57. package/dist/runtime/components/layout/Divider.vue +8 -1
  58. package/dist/runtime/components/layout/Divider.vue.d.ts +15 -4
  59. package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
  60. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
  61. package/dist/runtime/components/navigation/CommandPalette.vue +3 -1
  62. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +2 -2
  63. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +3 -1
  64. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
  65. package/dist/runtime/components/navigation/HorizontalNavigation.vue +102 -0
  66. package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +44 -0
  67. package/dist/runtime/components/navigation/Pagination.vue.d.ts +3 -3
  68. package/dist/runtime/components/navigation/Tabs.vue +8 -8
  69. package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -1
  70. package/dist/runtime/components/navigation/VerticalNavigation.vue +12 -3
  71. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
  72. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
  73. package/dist/runtime/components/overlays/Modal.vue +9 -3
  74. package/dist/runtime/components/overlays/Modal.vue.d.ts +6 -5
  75. package/dist/runtime/components/overlays/Modals.client.vue +12 -0
  76. package/dist/runtime/components/overlays/Notification.vue +2 -2
  77. package/dist/runtime/components/overlays/Notification.vue.d.ts +4 -3
  78. package/dist/runtime/components/overlays/Notifications.vue.d.ts +1 -1
  79. package/dist/runtime/components/overlays/Popover.vue +5 -3
  80. package/dist/runtime/components/overlays/Popover.vue.d.ts +7 -7
  81. package/dist/runtime/components/overlays/Slideover.vue +9 -3
  82. package/dist/runtime/components/overlays/Slideover.vue.d.ts +6 -5
  83. package/dist/runtime/components/overlays/Tooltip.vue +2 -2
  84. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +6 -6
  85. package/dist/runtime/composables/useCarouselScroll.d.ts +2 -0
  86. package/dist/runtime/composables/useCarouselScroll.mjs +35 -0
  87. package/dist/runtime/composables/useFormGroup.d.ts +1 -1
  88. package/dist/runtime/composables/useFormGroup.mjs +9 -12
  89. package/dist/runtime/composables/useModal.d.ts +12 -0
  90. package/dist/runtime/composables/useModal.mjs +37 -0
  91. package/dist/runtime/composables/usePopper.d.ts +3 -3
  92. package/dist/runtime/plugins/modals.d.ts +2 -0
  93. package/dist/runtime/plugins/modals.mjs +10 -0
  94. package/dist/runtime/types/component.d.ts +14 -0
  95. package/dist/runtime/types/divider.d.ts +3 -0
  96. package/dist/runtime/types/form.d.ts +2 -1
  97. package/dist/runtime/types/horizontal-navigation.d.ts +13 -0
  98. package/dist/runtime/types/index.d.ts +3 -0
  99. package/dist/runtime/types/modal.d.ts +18 -0
  100. package/dist/runtime/types/progress.d.ts +2 -0
  101. package/dist/runtime/types/range.d.ts +2 -0
  102. package/dist/runtime/types/toggle.d.ts +2 -0
  103. package/dist/runtime/types/vertical-navigation.d.ts +2 -1
  104. package/dist/runtime/ui.config/data/table.d.ts +7 -0
  105. package/dist/runtime/ui.config/data/table.mjs +10 -3
  106. package/dist/runtime/ui.config/elements/accordion.d.ts +1 -0
  107. package/dist/runtime/ui.config/elements/accordion.mjs +1 -0
  108. package/dist/runtime/ui.config/elements/carousel.d.ts +27 -0
  109. package/dist/runtime/ui.config/elements/carousel.mjs +26 -0
  110. package/dist/runtime/ui.config/elements/dropdown.d.ts +5 -1
  111. package/dist/runtime/ui.config/elements/dropdown.mjs +8 -4
  112. package/dist/runtime/ui.config/forms/formGroup.d.ts +1 -0
  113. package/dist/runtime/ui.config/forms/formGroup.mjs +1 -0
  114. package/dist/runtime/ui.config/forms/input.d.ts +11 -0
  115. package/dist/runtime/ui.config/forms/input.mjs +11 -0
  116. package/dist/runtime/ui.config/forms/inputMenu.d.ts +1 -1
  117. package/dist/runtime/ui.config/forms/inputMenu.mjs +5 -5
  118. package/dist/runtime/ui.config/forms/select.d.ts +11 -0
  119. package/dist/runtime/ui.config/forms/select.mjs +1 -1
  120. package/dist/runtime/ui.config/forms/selectMenu.d.ts +1 -1
  121. package/dist/runtime/ui.config/forms/textarea.d.ts +11 -0
  122. package/dist/runtime/ui.config/index.d.ts +2 -0
  123. package/dist/runtime/ui.config/index.mjs +2 -0
  124. package/dist/runtime/ui.config/layout/divider.d.ts +19 -2
  125. package/dist/runtime/ui.config/layout/divider.mjs +20 -3
  126. package/dist/runtime/ui.config/navigation/breadcrumb.mjs +4 -4
  127. package/dist/runtime/ui.config/navigation/commandPalette.d.ts +1 -1
  128. package/dist/runtime/ui.config/navigation/commandPalette.mjs +8 -8
  129. package/dist/runtime/ui.config/navigation/horizontalNavigation.d.ts +27 -0
  130. package/dist/runtime/ui.config/navigation/horizontalNavigation.mjs +26 -0
  131. package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +4 -3
  132. package/dist/runtime/ui.config/navigation/verticalNavigation.mjs +8 -7
  133. package/dist/runtime/ui.config/overlays/popover.d.ts +4 -0
  134. package/dist/runtime/ui.config/overlays/popover.mjs +4 -0
  135. package/dist/runtime/ui.config/overlays/slideover.mjs +2 -2
  136. package/dist/runtime/ui.config/overlays/tooltip.d.ts +4 -0
  137. package/dist/runtime/ui.config/overlays/tooltip.mjs +4 -0
  138. package/dist/runtime/ui.css +1 -1
  139. package/dist/runtime/utils/colors.d.ts +3 -0
  140. package/dist/runtime/utils/colors.mjs +261 -0
  141. package/dist/runtime/utils/index.mjs +9 -0
  142. package/dist/runtime/utils/link.d.ts +24 -11
  143. package/dist/runtime/utils/link.mjs +26 -13
  144. package/dist/types.d.mts +1 -1
  145. package/dist/types.d.ts +1 -1
  146. package/package.json +24 -22
  147. package/dist/runtime/utils/uid.d.ts +0 -1
  148. package/dist/runtime/utils/uid.mjs +0 -5
@@ -7,7 +7,7 @@ declare const _default: import("vue").DefineComponent<{
7
7
  };
8
8
  title: {
9
9
  type: StringConstructor;
10
- required: true;
10
+ default: null;
11
11
  };
12
12
  description: {
13
13
  type: StringConstructor;
@@ -66,14 +66,14 @@ declare const _default: import("vue").DefineComponent<{
66
66
  onClose: () => void;
67
67
  onAction: (action: NotificationAction) => void;
68
68
  twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
69
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
69
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "close"[], "close", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
70
70
  id: {
71
71
  type: (NumberConstructor | StringConstructor)[];
72
72
  required: true;
73
73
  };
74
74
  title: {
75
75
  type: StringConstructor;
76
- required: true;
76
+ default: null;
77
77
  };
78
78
  description: {
79
79
  type: StringConstructor;
@@ -120,6 +120,7 @@ declare const _default: import("vue").DefineComponent<{
120
120
  onClose?: ((...args: any[]) => any) | undefined;
121
121
  }, {
122
122
  ui: any;
123
+ title: string;
123
124
  description: string;
124
125
  icon: string;
125
126
  avatar: Avatar;
@@ -33,7 +33,7 @@ declare const _default: import("vue").DefineComponent<{
33
33
  };
34
34
  notifications: any;
35
35
  wrapperClass: import("vue").ComputedRef<string>;
36
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
36
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
37
37
  class: {
38
38
  type: PropType<any>;
39
39
  default: () => string;
@@ -37,12 +37,13 @@
37
37
  <script>
38
38
  import { computed, ref, toRef, onMounted, defineComponent, watch } from "vue";
39
39
  import { defu } from "defu";
40
- import { Popover as HPopover, PopoverButton as HPopoverButton, PopoverPanel as HPopoverPanel } from "@headlessui/vue";
40
+ import { Popover as HPopover, PopoverButton as HPopoverButton, PopoverPanel as HPopoverPanel, provideUseId } from "@headlessui/vue";
41
41
  import { useUI } from "../../composables/useUI";
42
42
  import { usePopper } from "../../composables/usePopper";
43
43
  import { mergeConfig } from "../../utils";
44
44
  import appConfig from "#build/app.config";
45
45
  import { popover } from "#ui/ui.config";
46
+ import { useId } from "#imports";
46
47
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.popover, popover);
47
48
  export default defineComponent({
48
49
  components: {
@@ -67,11 +68,11 @@ export default defineComponent({
67
68
  },
68
69
  openDelay: {
69
70
  type: Number,
70
- default: 0
71
+ default: () => config.default.openDelay
71
72
  },
72
73
  closeDelay: {
73
74
  type: Number,
74
- default: 0
75
+ default: () => config.default.closeDelay
75
76
  },
76
77
  overlay: {
77
78
  type: Boolean,
@@ -184,6 +185,7 @@ export default defineComponent({
184
185
  return;
185
186
  emit("update:open", newValue === 0);
186
187
  });
188
+ provideUseId(() => useId());
187
189
  return {
188
190
  // eslint-disable-next-line vue/no-dupe-keys
189
191
  ui,
@@ -16,11 +16,11 @@ declare const _default: import("vue").DefineComponent<{
16
16
  };
17
17
  openDelay: {
18
18
  type: NumberConstructor;
19
- default: number;
19
+ default: () => any;
20
20
  };
21
21
  closeDelay: {
22
22
  type: NumberConstructor;
23
- default: number;
23
+ default: () => any;
24
24
  };
25
25
  overlay: {
26
26
  type: BooleanConstructor;
@@ -70,7 +70,7 @@ declare const _default: import("vue").DefineComponent<{
70
70
  }>;
71
71
  onMouseOver: () => void;
72
72
  onMouseLeave: () => void;
73
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
73
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:open"[], "update:open", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
74
74
  mode: {
75
75
  type: PropType<"click" | "hover">;
76
76
  default: string;
@@ -86,11 +86,11 @@ declare const _default: import("vue").DefineComponent<{
86
86
  };
87
87
  openDelay: {
88
88
  type: NumberConstructor;
89
- default: number;
89
+ default: () => any;
90
90
  };
91
91
  closeDelay: {
92
92
  type: NumberConstructor;
93
- default: number;
93
+ default: () => any;
94
94
  };
95
95
  overlay: {
96
96
  type: BooleanConstructor;
@@ -112,13 +112,13 @@ declare const _default: import("vue").DefineComponent<{
112
112
  "onUpdate:open"?: ((...args: any[]) => any) | undefined;
113
113
  }, {
114
114
  ui: any;
115
- popper: PopperOptions;
115
+ overlay: boolean;
116
116
  class: any;
117
+ popper: PopperOptions;
117
118
  disabled: boolean;
118
119
  open: boolean;
119
120
  mode: "click" | "hover";
120
121
  openDelay: number;
121
122
  closeDelay: number;
122
- overlay: boolean;
123
123
  }, {}>;
124
124
  export default _default;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <TransitionRoot as="template" :appear="appear" :show="isOpen">
3
- <HDialog :class="[ui.wrapper, { 'justify-end': side === 'right' }]" v-bind="attrs" @close="(e) => !preventClose && close(e)">
3
+ <HDialog :class="[ui.wrapper, { 'justify-end': side === 'right' }]" v-bind="attrs" @close="close">
4
4
  <TransitionChild v-if="overlay" as="template" :appear="appear" v-bind="ui.overlay.transition">
5
5
  <div :class="[ui.overlay.base, ui.overlay.background]" />
6
6
  </TransitionChild>
@@ -16,11 +16,12 @@
16
16
 
17
17
  <script>
18
18
  import { computed, toRef, defineComponent } from "vue";
19
- import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild } from "@headlessui/vue";
19
+ import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild, provideUseId } from "@headlessui/vue";
20
20
  import { useUI } from "../../composables/useUI";
21
21
  import { mergeConfig } from "../../utils";
22
22
  import appConfig from "#build/app.config";
23
23
  import { slideover } from "#ui/ui.config";
24
+ import { useId } from "#imports";
24
25
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.slideover, slideover);
25
26
  export default defineComponent({
26
27
  components: {
@@ -65,7 +66,7 @@ export default defineComponent({
65
66
  default: () => ({})
66
67
  }
67
68
  },
68
- emits: ["update:modelValue", "close"],
69
+ emits: ["update:modelValue", "close", "close-prevented"],
69
70
  setup(props, { emit }) {
70
71
  const { ui, attrs } = useUI("slideover", toRef(props, "ui"), config, toRef(props, "class"));
71
72
  const isOpen = computed({
@@ -89,9 +90,14 @@ export default defineComponent({
89
90
  };
90
91
  });
91
92
  function close(value) {
93
+ if (props.preventClose) {
94
+ emit("close-prevented");
95
+ return;
96
+ }
92
97
  isOpen.value = value;
93
98
  emit("close");
94
99
  }
100
+ provideUseId(() => useId());
95
101
  return {
96
102
  // eslint-disable-next-line vue/no-dupe-keys
97
103
  ui,
@@ -41,7 +41,7 @@ declare const _default: import("vue").DefineComponent<{
41
41
  isOpen: WritableComputedRef<boolean>;
42
42
  transitionClass: import("vue").ComputedRef<any>;
43
43
  close: (value: boolean) => void;
44
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:modelValue")[], "close" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
44
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:modelValue" | "close-prevented")[], "close" | "update:modelValue" | "close-prevented", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
45
45
  modelValue: {
46
46
  type: PropType<boolean>;
47
47
  default: boolean;
@@ -76,16 +76,17 @@ declare const _default: import("vue").DefineComponent<{
76
76
  default: () => {};
77
77
  };
78
78
  }>> & {
79
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
80
79
  onClose?: ((...args: any[]) => any) | undefined;
80
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
81
+ "onClose-prevented"?: ((...args: any[]) => any) | undefined;
81
82
  }, {
82
83
  ui: any;
83
- transition: boolean;
84
- class: any;
85
- modelValue: boolean;
86
84
  appear: boolean;
87
85
  overlay: boolean;
86
+ transition: boolean;
88
87
  preventClose: boolean;
88
+ class: any;
89
+ modelValue: boolean;
89
90
  side: "right" | "left";
90
91
  }, {}>;
91
92
  export default _default;
@@ -58,11 +58,11 @@ export default defineComponent({
58
58
  },
59
59
  openDelay: {
60
60
  type: Number,
61
- default: 0
61
+ default: () => config.default.openDelay
62
62
  },
63
63
  closeDelay: {
64
64
  type: Number,
65
- default: 0
65
+ default: () => config.default.closeDelay
66
66
  },
67
67
  popper: {
68
68
  type: Object,
@@ -15,11 +15,11 @@ declare const _default: import("vue").DefineComponent<{
15
15
  };
16
16
  openDelay: {
17
17
  type: NumberConstructor;
18
- default: number;
18
+ default: () => any;
19
19
  };
20
20
  closeDelay: {
21
21
  type: NumberConstructor;
22
- default: number;
22
+ default: () => any;
23
23
  };
24
24
  popper: {
25
25
  type: PropType<PopperOptions>;
@@ -44,7 +44,7 @@ declare const _default: import("vue").DefineComponent<{
44
44
  open: import("vue").Ref<boolean>;
45
45
  onMouseOver: () => void;
46
46
  onMouseLeave: () => void;
47
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
47
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
48
48
  text: {
49
49
  type: StringConstructor;
50
50
  default: null;
@@ -59,11 +59,11 @@ declare const _default: import("vue").DefineComponent<{
59
59
  };
60
60
  openDelay: {
61
61
  type: NumberConstructor;
62
- default: number;
62
+ default: () => any;
63
63
  };
64
64
  closeDelay: {
65
65
  type: NumberConstructor;
66
- default: number;
66
+ default: () => any;
67
67
  };
68
68
  popper: {
69
69
  type: PropType<PopperOptions>;
@@ -79,8 +79,8 @@ declare const _default: import("vue").DefineComponent<{
79
79
  };
80
80
  }>>, {
81
81
  ui: any;
82
- popper: PopperOptions;
83
82
  class: any;
83
+ popper: PopperOptions;
84
84
  text: string;
85
85
  openDelay: number;
86
86
  closeDelay: number;
@@ -0,0 +1,2 @@
1
+ import { type Ref } from 'vue';
2
+ export declare const useCarouselScroll: (el: Ref<HTMLElement>) => void;
@@ -0,0 +1,35 @@
1
+ import { ref, onMounted, onUnmounted } from "vue";
2
+ export const useCarouselScroll = (el) => {
3
+ const x = ref(0);
4
+ function onMouseDown(e) {
5
+ el.value.style.scrollSnapType = "none";
6
+ el.value.style.scrollBehavior = "auto";
7
+ x.value = e.pageX;
8
+ window.addEventListener("mousemove", onMouseMove);
9
+ window.addEventListener("mouseup", onMouseUp);
10
+ }
11
+ function onMouseUp() {
12
+ el.value.style.removeProperty("scroll-behavior");
13
+ el.value.style.removeProperty("scroll-snap-type");
14
+ window.removeEventListener("mousemove", onMouseMove);
15
+ window.removeEventListener("mouseup", onMouseUp);
16
+ }
17
+ function onMouseMove(e) {
18
+ e.preventDefault();
19
+ const delta = e.pageX - x.value;
20
+ x.value = e.pageX;
21
+ el.value.scrollBy(-delta, 0);
22
+ }
23
+ onMounted(() => {
24
+ if (!el.value) {
25
+ return;
26
+ }
27
+ el.value.addEventListener("mousedown", onMouseDown);
28
+ });
29
+ onUnmounted(() => {
30
+ if (!el.value) {
31
+ return;
32
+ }
33
+ el.value.removeEventListener("mousedown", onMouseDown);
34
+ });
35
+ };
@@ -7,7 +7,7 @@ type InputProps = {
7
7
  legend?: string | null;
8
8
  };
9
9
  export declare const useFormGroup: (inputProps?: InputProps, config?: any) => {
10
- inputId: import("vue").Ref<string | undefined>;
10
+ inputId: import("vue").ComputedRef<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>;
@@ -1,20 +1,17 @@
1
- import { inject, ref, computed, onMounted } from "vue";
1
+ import { inject, ref, computed } from "vue";
2
2
  import { useDebounceFn } from "@vueuse/core";
3
- import { uid } from "../utils/uid.mjs";
4
3
  export const useFormGroup = (inputProps, config) => {
5
4
  const formBus = inject("form-events", void 0);
6
5
  const formGroup = inject("form-group", void 0);
7
6
  const formInputs = inject("form-inputs", void 0);
8
- const inputId = ref(inputProps?.id);
9
- onMounted(() => {
10
- inputId.value = inputProps?.legend === null || inputProps.legend ? void 0 : inputProps?.id ?? uid();
11
- if (formGroup) {
12
- formGroup.inputId.value = inputId.value;
13
- if (formInputs) {
14
- formInputs.value[formGroup.name.value] = inputId;
15
- }
7
+ if (formGroup) {
8
+ if (inputProps?.id) {
9
+ formGroup.inputId.value = inputProps?.id;
16
10
  }
17
- });
11
+ if (formInputs) {
12
+ formInputs.value[formGroup.name.value] = formGroup.inputId.value;
13
+ }
14
+ }
18
15
  const blurred = ref(false);
19
16
  function emitFormEvent(type, path) {
20
17
  if (formBus) {
@@ -34,7 +31,7 @@ export const useFormGroup = (inputProps, config) => {
34
31
  }
35
32
  }, 300);
36
33
  return {
37
- inputId,
34
+ inputId: computed(() => inputProps?.id ?? formGroup?.inputId.value),
38
35
  name: computed(() => inputProps?.name ?? formGroup?.name.value),
39
36
  size: computed(() => {
40
37
  const formGroupSize = config.size[formGroup?.size.value] ? formGroup?.size.value : null;
@@ -0,0 +1,12 @@
1
+ import type { ShallowRef, Component, InjectionKey } from 'vue';
2
+ import type { ComponentProps } from '../types/component';
3
+ import type { Modal, ModalState } from '../types/modal';
4
+ export declare const modalInjectionKey: InjectionKey<ShallowRef<ModalState>>;
5
+ declare function _useModal(): {
6
+ isOpen: import("vue").Ref<boolean>;
7
+ open: <T extends Component>(component: T, props?: (Modal & ComponentProps<T>) | undefined) => void;
8
+ close: () => void;
9
+ patch: <T_1 extends Component = {}>(props: Partial<Modal & ComponentProps<T_1>>) => void;
10
+ };
11
+ export declare const useModal: typeof _useModal;
12
+ export {};
@@ -0,0 +1,37 @@
1
+ import { ref, inject } from "vue";
2
+ import { createSharedComposable } from "@vueuse/core";
3
+ export const modalInjectionKey = Symbol("nuxt-ui.modal");
4
+ function _useModal() {
5
+ const modalState = inject(modalInjectionKey);
6
+ const isOpen = ref(false);
7
+ function open(component, props) {
8
+ modalState.value = {
9
+ component,
10
+ props: props ?? {}
11
+ };
12
+ isOpen.value = true;
13
+ }
14
+ function close() {
15
+ isOpen.value = false;
16
+ modalState.value = {
17
+ component: "div",
18
+ props: {}
19
+ };
20
+ }
21
+ function patch(props) {
22
+ modalState.value = {
23
+ ...modalState.value,
24
+ props: {
25
+ ...modalState.value.props,
26
+ ...props
27
+ }
28
+ };
29
+ }
30
+ return {
31
+ isOpen,
32
+ open,
33
+ close,
34
+ patch
35
+ };
36
+ }
37
+ export const useModal = createSharedComposable(_useModal);
@@ -153,15 +153,15 @@ export declare function usePopper({ locked, overflowPadding, offsetDistance, off
153
153
  };
154
154
  } | undefined;
155
155
  offset?: {
156
- "bottom-end"?: {
156
+ auto?: {
157
157
  y: number;
158
158
  x: number;
159
159
  } | undefined;
160
- "bottom-start"?: {
160
+ "bottom-end"?: {
161
161
  y: number;
162
162
  x: number;
163
163
  } | undefined;
164
- auto?: {
164
+ "bottom-start"?: {
165
165
  y: number;
166
166
  x: number;
167
167
  } | undefined;
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { defineNuxtPlugin } from "#imports";
2
+ import { shallowRef } from "vue";
3
+ import { modalInjectionKey } from "../composables/useModal.mjs";
4
+ export default defineNuxtPlugin((nuxtApp) => {
5
+ const modalState = shallowRef({
6
+ component: "div",
7
+ props: {}
8
+ });
9
+ nuxtApp.vueApp.provide(modalInjectionKey, modalState);
10
+ });
@@ -0,0 +1,14 @@
1
+ export type ComponentProps<T> =
2
+ T extends new () => { $props: infer P } ? NonNullable<P> :
3
+ T extends (props: infer P, ...args: any) => any ? P :
4
+ {}
5
+
6
+ export type ComponentSlots<T> =
7
+ T extends new () => { $slots: infer S } ? NonNullable<S> :
8
+ T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any }, ...args: any) => any ? NonNullable<S> :
9
+ {}
10
+
11
+ export type ComponentEmit<T> =
12
+ T extends new () => { $emit: infer E } ? NonNullable<E> :
13
+ T extends (props: any, ctx: { slots: any; attrs: any; emit: infer E }, ...args: any) => any ? NonNullable<E> :
14
+ {}
@@ -0,0 +1,3 @@
1
+ import { divider } from '#ui/ui.config'
2
+
3
+ export type DividerSize = keyof typeof divider.border.size.horizontal | keyof typeof divider.border.size.vertical
@@ -10,7 +10,8 @@ export interface FormErrorWithId extends FormError {
10
10
  }
11
11
 
12
12
  export interface Form<T> {
13
- validate(path?: string, opts?: { silent?: boolean }): Promise<T>
13
+ validate(path?: string | string[], opts?: { silent?: true }): Promise<T | false>;
14
+ validate(path?: string | string[], opts?: { silent?: false }): Promise<T>;
14
15
  clear(path?: string): void
15
16
  errors: Ref<FormError[]>
16
17
  setErrors(errs: FormError[], path?: string): void
@@ -0,0 +1,13 @@
1
+ import type { Link } from './link'
2
+ import type { Avatar } from './avatar'
3
+ import type { Badge } from './badge'
4
+
5
+ export interface HorizontalNavigationLink extends Link {
6
+ label: string
7
+ labelClass?: string
8
+ icon?: string
9
+ iconClass?: string
10
+ avatar?: Avatar
11
+ click?: Function
12
+ badge?: string | number | Badge
13
+ }
@@ -7,13 +7,16 @@ export * from './button'
7
7
  export * from './chip'
8
8
  export * from './clipboard'
9
9
  export * from './command-palette'
10
+ export * from './divider'
10
11
  export * from './dropdown'
11
12
  export * from './form-group'
12
13
  export * from './form'
14
+ export * from './horizontal-navigation'
13
15
  export * from './input'
14
16
  export * from './kbd'
15
17
  export * from './link'
16
18
  export * from './meter'
19
+ export * from './modal'
17
20
  export * from './notification'
18
21
  export * from './popper'
19
22
  export * from './progress'
@@ -0,0 +1,18 @@
1
+ import type { Component } from 'vue'
2
+
3
+ export interface Modal {
4
+ appear?: boolean
5
+ overlay?: boolean
6
+ transition?: boolean
7
+ preventClose?: boolean
8
+ fullscreen?: boolean
9
+ class?: string | Object | string[]
10
+ ui?: any
11
+ onClose?: () => void
12
+ onClosePrevented?: () => void
13
+ }
14
+
15
+ export interface ModalState {
16
+ component: Component | string
17
+ props: Modal
18
+ }
@@ -1,4 +1,6 @@
1
1
  import { progress } from '../ui.config'
2
+ import colors from '#ui-colors'
2
3
 
3
4
  export type ProgressSize = keyof typeof progress.progress.size
4
5
  export type ProgressAnimation = keyof typeof progress.animation
6
+ export type ProgressColor = typeof colors[number]
@@ -1,5 +1,7 @@
1
1
  import { range } from '../ui.config'
2
2
  import type { ExtractDeepKey } from '.'
3
3
  import type { AppConfig } from 'nuxt/schema'
4
+ import colors from '#ui-colors'
4
5
 
5
6
  export type RangeSize = keyof typeof range.size | ExtractDeepKey<AppConfig, ['ui', 'range', 'size']>
7
+ export type RangeColor = typeof colors[number]
@@ -1,5 +1,7 @@
1
1
  import { toggle } from '../ui.config'
2
2
  import type { ExtractDeepKey } from '.'
3
3
  import type { AppConfig } from 'nuxt/schema'
4
+ import colors from '#ui-colors'
4
5
 
5
6
  export type ToggleSize = keyof typeof toggle.size | ExtractDeepKey<AppConfig, ['ui', 'toggle', 'size']>
7
+ export type ToggleColor = typeof colors[number]
@@ -1,5 +1,6 @@
1
1
  import type { Link } from './link'
2
2
  import type { Avatar } from './avatar'
3
+ import type { Badge } from './badge'
3
4
 
4
5
  export interface VerticalNavigationLink extends Link {
5
6
  label: string
@@ -8,5 +9,5 @@ export interface VerticalNavigationLink extends Link {
8
9
  iconClass?: string
9
10
  avatar?: Avatar
10
11
  click?: Function
11
- badge?: string | number
12
+ badge?: string | number | Badge
12
13
  }
@@ -36,6 +36,9 @@ declare const _default: {
36
36
  label: string;
37
37
  icon: string;
38
38
  };
39
+ progress: {
40
+ wrapper: string;
41
+ };
39
42
  default: {
40
43
  sortAscIcon: string;
41
44
  sortDescIcon: string;
@@ -47,6 +50,10 @@ declare const _default: {
47
50
  variant: "ghost";
48
51
  class: string;
49
52
  };
53
+ progress: {
54
+ color: "primary";
55
+ animation: "carousel";
56
+ };
50
57
  loadingState: {
51
58
  icon: string;
52
59
  label: string;
@@ -2,7 +2,7 @@ export default {
2
2
  wrapper: "relative overflow-x-auto",
3
3
  base: "min-w-full table-fixed",
4
4
  divide: "divide-y divide-gray-300 dark:divide-gray-700",
5
- thead: "",
5
+ thead: "relative",
6
6
  tbody: "divide-y divide-gray-200 dark:divide-gray-800",
7
7
  tr: {
8
8
  base: "",
@@ -11,14 +11,14 @@ export default {
11
11
  },
12
12
  th: {
13
13
  base: "text-left rtl:text-right",
14
- padding: "px-3 py-3.5",
14
+ padding: "px-4 py-3.5",
15
15
  color: "text-gray-900 dark:text-white",
16
16
  font: "font-semibold",
17
17
  size: "text-sm"
18
18
  },
19
19
  td: {
20
20
  base: "whitespace-nowrap",
21
- padding: "px-3 py-4",
21
+ padding: "px-4 py-4",
22
22
  color: "text-gray-500 dark:text-gray-400",
23
23
  font: "",
24
24
  size: "text-sm"
@@ -36,6 +36,9 @@ export default {
36
36
  label: "text-sm text-center text-gray-900 dark:text-white",
37
37
  icon: "w-6 h-6 mx-auto text-gray-400 dark:text-gray-500 mb-4"
38
38
  },
39
+ progress: {
40
+ wrapper: "absolute inset-x-0 -bottom-[0.5px] p-0"
41
+ },
39
42
  default: {
40
43
  sortAscIcon: "i-heroicons-bars-arrow-up-20-solid",
41
44
  sortDescIcon: "i-heroicons-bars-arrow-down-20-solid",
@@ -47,6 +50,10 @@ export default {
47
50
  variant: "ghost",
48
51
  class: "-m-1.5"
49
52
  },
53
+ progress: {
54
+ color: "primary",
55
+ animation: "carousel"
56
+ },
50
57
  loadingState: {
51
58
  icon: "i-heroicons-arrow-path-20-solid",
52
59
  label: "Loading..."
@@ -1,5 +1,6 @@
1
1
  declare const _default: {
2
2
  wrapper: string;
3
+ container: string;
3
4
  item: {
4
5
  base: string;
5
6
  size: string;
@@ -1,5 +1,6 @@
1
1
  export default {
2
2
  wrapper: "w-full flex flex-col",
3
+ container: "w-full flex flex-col",
3
4
  item: {
4
5
  base: "",
5
6
  size: "text-sm",