@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
@@ -47,6 +47,13 @@ export default defineComponent({
47
47
  type: Object,
48
48
  default: null
49
49
  },
50
+ size: {
51
+ type: String,
52
+ default: () => config.default.size,
53
+ validator(value) {
54
+ return Object.keys(config.border.size.horizontal).includes(value) || Object.keys(config.border.size.vertical).includes(value);
55
+ }
56
+ },
50
57
  orientation: {
51
58
  type: String,
52
59
  default: "horizontal",
@@ -84,7 +91,7 @@ export default defineComponent({
84
91
  return twJoin(
85
92
  ui.value.border.base,
86
93
  ui.value.border[props.orientation],
87
- ui.value.border.size[props.orientation],
94
+ ui.value.border.size[props.orientation][props.size],
88
95
  ui.value.border.type[props.type]
89
96
  );
90
97
  });
@@ -1,5 +1,5 @@
1
1
  import type { PropType } from 'vue';
2
- import type { Avatar } from '../../types';
2
+ import type { Avatar, DividerSize } from '../../types';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  label: {
5
5
  type: StringConstructor;
@@ -13,6 +13,11 @@ declare const _default: import("vue").DefineComponent<{
13
13
  type: PropType<Avatar>;
14
14
  default: null;
15
15
  };
16
+ size: {
17
+ type: PropType<DividerSize>;
18
+ default: () => any;
19
+ validator(value: string): boolean;
20
+ };
16
21
  orientation: {
17
22
  type: PropType<"horizontal" | "vertical">;
18
23
  default: string;
@@ -25,7 +30,7 @@ declare const _default: import("vue").DefineComponent<{
25
30
  };
26
31
  class: {
27
32
  type: PropType<any>;
28
- default: () => string;
33
+ default: () => "";
29
34
  };
30
35
  ui: {
31
36
  type: PropType<any>;
@@ -39,7 +44,7 @@ declare const _default: import("vue").DefineComponent<{
39
44
  wrapperClass: import("vue").ComputedRef<string>;
40
45
  containerClass: import("vue").ComputedRef<string>;
41
46
  borderClass: import("vue").ComputedRef<string>;
42
- }, 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<{
43
48
  label: {
44
49
  type: StringConstructor;
45
50
  default: null;
@@ -52,6 +57,11 @@ declare const _default: import("vue").DefineComponent<{
52
57
  type: PropType<Avatar>;
53
58
  default: null;
54
59
  };
60
+ size: {
61
+ type: PropType<DividerSize>;
62
+ default: () => any;
63
+ validator(value: string): boolean;
64
+ };
55
65
  orientation: {
56
66
  type: PropType<"horizontal" | "vertical">;
57
67
  default: string;
@@ -64,7 +74,7 @@ declare const _default: import("vue").DefineComponent<{
64
74
  };
65
75
  class: {
66
76
  type: PropType<any>;
67
- default: () => string;
77
+ default: () => "";
68
78
  };
69
79
  ui: {
70
80
  type: PropType<any>;
@@ -72,6 +82,7 @@ declare const _default: import("vue").DefineComponent<{
72
82
  };
73
83
  }>>, {
74
84
  orientation: "horizontal" | "vertical";
85
+ size: DividerSize;
75
86
  ui: any;
76
87
  icon: string;
77
88
  avatar: Avatar;
@@ -14,7 +14,7 @@ declare const _default: import("vue").DefineComponent<{
14
14
  [x: string]: unknown;
15
15
  }, string>>;
16
16
  skeletonClass: import("vue").ComputedRef<string>;
17
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
17
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  class: {
19
19
  type: PropType<any>;
20
20
  default: () => string;
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
26
26
  getULinkProps: (props: any) => {};
27
27
  twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
28
28
  twJoin: typeof twJoin;
29
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
29
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
30
  links: {
31
31
  type: PropType<BreadcrumbLink[]>;
32
32
  default: () => never[];
@@ -63,7 +63,7 @@
63
63
 
64
64
  <script>
65
65
  import { ref, computed, watch, toRef, onMounted, defineComponent } from "vue";
66
- import { Combobox as HCombobox, ComboboxInput as HComboboxInput, ComboboxOptions as HComboboxOptions } from "@headlessui/vue";
66
+ import { Combobox as HCombobox, ComboboxInput as HComboboxInput, ComboboxOptions as HComboboxOptions, provideUseId } from "@headlessui/vue";
67
67
  import { useDebounceFn } from "@vueuse/core";
68
68
  import { useFuse } from "@vueuse/integrations/useFuse";
69
69
  import { twJoin } from "tailwind-merge";
@@ -75,6 +75,7 @@ import { useUI } from "../../composables/useUI";
75
75
  import { mergeConfig } from "../../utils";
76
76
  import appConfig from "#build/app.config";
77
77
  import { commandPalette } from "#ui/ui.config";
78
+ import { useId } from "#imports";
78
79
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.commandPalette, commandPalette);
79
80
  export default defineComponent({
80
81
  components: {
@@ -316,6 +317,7 @@ export default defineComponent({
316
317
  comboboxApi,
317
318
  results
318
319
  });
320
+ provideUseId(() => useId());
319
321
  return {
320
322
  // eslint-disable-next-line vue/no-dupe-keys
321
323
  ui,
@@ -110,7 +110,7 @@ declare const _default: import("vue").DefineComponent<{
110
110
  emptyState: ComputedRef<any>;
111
111
  onSelect: (option: Command | Command[]) => void;
112
112
  onClear: () => void;
113
- }, 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<{
113
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:modelValue")[], "close" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
114
114
  modelValue: {
115
115
  type: (ObjectConstructor | NumberConstructor | StringConstructor | ArrayConstructor)[];
116
116
  default: null;
@@ -200,8 +200,8 @@ declare const _default: import("vue").DefineComponent<{
200
200
  default: () => {};
201
201
  };
202
202
  }>> & {
203
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
204
203
  onClose?: ((...args: any[]) => any) | undefined;
204
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
205
205
  }, {
206
206
  ui: any;
207
207
  icon: string;
@@ -71,10 +71,11 @@
71
71
 
72
72
  <script>
73
73
  import { computed, defineComponent } from "vue";
74
- import { ComboboxOption as HComboboxOption } from "@headlessui/vue";
74
+ import { ComboboxOption as HComboboxOption, provideUseId } from "@headlessui/vue";
75
75
  import UIcon from "../elements/Icon.vue";
76
76
  import UAvatar from "../elements/Avatar.vue";
77
77
  import UKbd from "../elements/Kbd.vue";
78
+ import { useId } from "#imports";
78
79
  export default defineComponent({
79
80
  components: {
80
81
  HComboboxOption,
@@ -137,6 +138,7 @@ export default defineComponent({
137
138
  }
138
139
  return content;
139
140
  }
141
+ provideUseId(() => useId());
140
142
  return {
141
143
  label,
142
144
  highlight
@@ -31,7 +31,7 @@ declare const _default: import("vue").DefineComponent<{
31
31
  indices: number[][];
32
32
  value: string;
33
33
  }) => string;
34
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
34
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
35
35
  group: {
36
36
  type: PropType<Group>;
37
37
  required: true;
@@ -0,0 +1,102 @@
1
+ <template>
2
+ <nav :class="ui.wrapper" v-bind="attrs">
3
+ <ul v-for="(section, sectionIndex) of sections" :key="`section${sectionIndex}`" :class="ui.container">
4
+ <li v-for="(link, index) of section" :key="`section${sectionIndex}-${index}`" :class="ui.inner">
5
+ <ULink
6
+ v-slot="{ isActive }"
7
+ v-bind="getULinkProps(link)"
8
+ :class="[ui.base, ui.before, ui.after]"
9
+ :active-class="ui.active"
10
+ :inactive-class="ui.inactive"
11
+ @click="link.click"
12
+ @keyup.enter="$event.target.blur()"
13
+ >
14
+ <slot name="avatar" :link="link" :is-active="isActive">
15
+ <UAvatar
16
+ v-if="link.avatar"
17
+ v-bind="{ size: ui.avatar.size, ...link.avatar }"
18
+ :class="[ui.avatar.base]"
19
+ />
20
+ </slot>
21
+ <slot name="icon" :link="link" :is-active="isActive">
22
+ <UIcon
23
+ v-if="link.icon"
24
+ :name="link.icon"
25
+ :class="twMerge(twJoin(ui.icon.base, isActive ? ui.icon.active : ui.icon.inactive), link.iconClass)"
26
+ />
27
+ </slot>
28
+ <slot :link="link" :is-active="isActive">
29
+ <span v-if="link.label" :class="twMerge(ui.label, link.labelClass)">
30
+ <span v-if="isActive" class="sr-only">
31
+ Current page:
32
+ </span>
33
+ {{ link.label }}
34
+ </span>
35
+ </slot>
36
+ <slot name="badge" :link="link" :is-active="isActive">
37
+ <UBadge
38
+ v-if="link.badge"
39
+ v-bind="{
40
+ size: ui.badge.size,
41
+ color: ui.badge.color,
42
+ variant: ui.badge.variant,
43
+ ...((typeof link.badge === 'string' || typeof link.badge === 'number') ? { label: link.badge } : link.badge)
44
+ }"
45
+ :class="ui.badge.base"
46
+ />
47
+ </slot>
48
+ </ULink>
49
+ </li>
50
+ </ul>
51
+ </nav>
52
+ </template>
53
+
54
+ <script>
55
+ import { toRef, defineComponent, computed } from "vue";
56
+ import { twMerge, twJoin } from "tailwind-merge";
57
+ import UIcon from "../elements/Icon.vue";
58
+ import UAvatar from "../elements/Avatar.vue";
59
+ import UBadge from "../elements/Badge.vue";
60
+ import ULink from "../elements/Link.vue";
61
+ import { useUI } from "../../composables/useUI";
62
+ import { mergeConfig, getULinkProps } from "../../utils";
63
+ import appConfig from "#build/app.config";
64
+ import { horizontalNavigation } from "#ui/ui.config";
65
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.horizontalNavigation, horizontalNavigation);
66
+ export default defineComponent({
67
+ components: {
68
+ UIcon,
69
+ UAvatar,
70
+ UBadge,
71
+ ULink
72
+ },
73
+ inheritAttrs: false,
74
+ props: {
75
+ links: {
76
+ type: Array,
77
+ default: () => []
78
+ },
79
+ class: {
80
+ type: [String, Object, Array],
81
+ default: () => ""
82
+ },
83
+ ui: {
84
+ type: Object,
85
+ default: () => ({})
86
+ }
87
+ },
88
+ setup(props) {
89
+ const { ui, attrs } = useUI("horizontalNavigation", toRef(props, "ui"), config, toRef(props, "class"));
90
+ const sections = computed(() => Array.isArray(props.links[0]) ? props.links : [props.links]);
91
+ return {
92
+ // eslint-disable-next-line vue/no-dupe-keys
93
+ ui,
94
+ attrs,
95
+ sections,
96
+ getULinkProps,
97
+ twMerge,
98
+ twJoin
99
+ };
100
+ }
101
+ });
102
+ </script>
@@ -0,0 +1,44 @@
1
+ import type { PropType } from 'vue';
2
+ import { twJoin } from 'tailwind-merge';
3
+ import type { HorizontalNavigationLink } from '../../types';
4
+ declare const _default: import("vue").DefineComponent<{
5
+ links: {
6
+ type: PropType<HorizontalNavigationLink[] | HorizontalNavigationLink[][]>;
7
+ default: () => never[];
8
+ };
9
+ class: {
10
+ type: PropType<any>;
11
+ default: () => string;
12
+ };
13
+ ui: {
14
+ type: PropType<any>;
15
+ default: () => {};
16
+ };
17
+ }, {
18
+ ui: import("vue").ComputedRef<any>;
19
+ attrs: import("vue").ComputedRef<Pick<{
20
+ [x: string]: unknown;
21
+ }, string>>;
22
+ sections: import("vue").ComputedRef<HorizontalNavigationLink[][]>;
23
+ getULinkProps: (props: any) => {};
24
+ twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
25
+ twJoin: typeof twJoin;
26
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
27
+ links: {
28
+ type: PropType<HorizontalNavigationLink[] | HorizontalNavigationLink[][]>;
29
+ default: () => never[];
30
+ };
31
+ class: {
32
+ type: PropType<any>;
33
+ default: () => string;
34
+ };
35
+ ui: {
36
+ type: PropType<any>;
37
+ default: () => {};
38
+ };
39
+ }>>, {
40
+ ui: any;
41
+ class: any;
42
+ links: HorizontalNavigationLink[] | HorizontalNavigationLink[][];
43
+ }, {}>;
44
+ export default _default;
@@ -86,7 +86,7 @@ declare const _default: import("vue").DefineComponent<{
86
86
  onClickPage: (page: number | string) => void;
87
87
  onClickFirst: () => void;
88
88
  onClickLast: () => void;
89
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
89
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
90
90
  modelValue: {
91
91
  type: NumberConstructor;
92
92
  required: true;
@@ -165,6 +165,8 @@ declare const _default: import("vue").DefineComponent<{
165
165
  class: any;
166
166
  disabled: boolean;
167
167
  max: number;
168
+ prevButton: Button;
169
+ nextButton: Button;
168
170
  divider: string;
169
171
  pageCount: number;
170
172
  activeButton: Button;
@@ -173,7 +175,5 @@ declare const _default: import("vue").DefineComponent<{
173
175
  showLast: boolean;
174
176
  firstButton: Button;
175
177
  lastButton: Button;
176
- prevButton: Button;
177
- nextButton: Button;
178
178
  }, {}>;
179
179
  export default _default;
@@ -33,13 +33,7 @@
33
33
  </HTabList>
34
34
 
35
35
  <HTabPanels :class="ui.container">
36
- <HTabPanel
37
- v-for="(item, index) of items"
38
- :key="index"
39
- v-slot="{ selected }"
40
- :class="ui.base"
41
- tabindex="-1"
42
- >
36
+ <HTabPanel v-for="(item, index) of items" :key="index" v-slot="{ selected }" :class="ui.base" :unmount="unmount">
43
37
  <slot :name="item.slot || 'item'" :item="item" :index="index" :selected="selected">
44
38
  {{ item.content }}
45
39
  </slot>
@@ -50,12 +44,13 @@
50
44
 
51
45
  <script>
52
46
  import { toRef, ref, watch, onMounted, defineComponent } from "vue";
53
- import { TabGroup as HTabGroup, TabList as HTabList, Tab as HTab, TabPanels as HTabPanels, TabPanel as HTabPanel } from "@headlessui/vue";
47
+ import { TabGroup as HTabGroup, TabList as HTabList, Tab as HTab, TabPanels as HTabPanels, TabPanel as HTabPanel, provideUseId } from "@headlessui/vue";
54
48
  import { useResizeObserver } from "@vueuse/core";
55
49
  import { useUI } from "../../composables/useUI";
56
50
  import { mergeConfig } from "../../utils";
57
51
  import appConfig from "#build/app.config";
58
52
  import { tabs } from "#ui/ui.config";
53
+ import { useId } from "#imports";
59
54
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.tabs, tabs);
60
55
  export default defineComponent({
61
56
  components: {
@@ -84,6 +79,10 @@ export default defineComponent({
84
79
  type: Array,
85
80
  default: () => []
86
81
  },
82
+ unmount: {
83
+ type: Boolean,
84
+ default: false
85
+ },
87
86
  class: {
88
87
  type: [String, Object, Array],
89
88
  default: () => ""
@@ -129,6 +128,7 @@ export default defineComponent({
129
128
  calcMarkerSize(selectedIndex.value);
130
129
  });
131
130
  onMounted(() => calcMarkerSize(selectedIndex.value));
131
+ provideUseId(() => useId());
132
132
  return {
133
133
  // eslint-disable-next-line vue/no-dupe-keys
134
134
  ui,
@@ -18,6 +18,10 @@ declare const _default: import("vue").DefineComponent<{
18
18
  type: PropType<TabItem[]>;
19
19
  default: () => never[];
20
20
  };
21
+ unmount: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
21
25
  class: {
22
26
  type: PropType<any>;
23
27
  default: () => string;
@@ -36,7 +40,7 @@ declare const _default: import("vue").DefineComponent<{
36
40
  markerRef: import("vue").Ref<HTMLElement | undefined>;
37
41
  selectedIndex: import("vue").Ref<number | undefined>;
38
42
  onChange: (index: number) => void;
39
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
43
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
40
44
  modelValue: {
41
45
  type: NumberConstructor;
42
46
  default: undefined;
@@ -54,6 +58,10 @@ declare const _default: import("vue").DefineComponent<{
54
58
  type: PropType<TabItem[]>;
55
59
  default: () => never[];
56
60
  };
61
+ unmount: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ };
57
65
  class: {
58
66
  type: PropType<any>;
59
67
  default: () => string;
@@ -70,6 +78,7 @@ declare const _default: import("vue").DefineComponent<{
70
78
  ui: any;
71
79
  class: any;
72
80
  modelValue: number;
81
+ unmount: boolean;
73
82
  items: TabItem[];
74
83
  defaultIndex: number;
75
84
  }, {}>;
@@ -34,9 +34,16 @@
34
34
  </span>
35
35
  </slot>
36
36
  <slot name="badge" :link="link" :is-active="isActive">
37
- <span v-if="link.badge" :class="[ui.badge.base, isActive ? ui.badge.active : ui.badge.inactive]">
38
- {{ link.badge }}
39
- </span>
37
+ <UBadge
38
+ v-if="link.badge"
39
+ v-bind="{
40
+ size: ui.badge.size,
41
+ color: ui.badge.color,
42
+ variant: ui.badge.variant,
43
+ ...((typeof link.badge === 'string' || typeof link.badge === 'number') ? { label: link.badge } : link.badge)
44
+ }"
45
+ :class="ui.badge.base"
46
+ />
40
47
  </slot>
41
48
  </ULink>
42
49
  </li>
@@ -50,6 +57,7 @@ import { toRef, defineComponent, computed } from "vue";
50
57
  import { twMerge, twJoin } from "tailwind-merge";
51
58
  import UIcon from "../elements/Icon.vue";
52
59
  import UAvatar from "../elements/Avatar.vue";
60
+ import UBadge from "../elements/Badge.vue";
53
61
  import ULink from "../elements/Link.vue";
54
62
  import UDivider from "../layout/Divider.vue";
55
63
  import { useUI } from "../../composables/useUI";
@@ -61,6 +69,7 @@ export default defineComponent({
61
69
  components: {
62
70
  UIcon,
63
71
  UAvatar,
72
+ UBadge,
64
73
  ULink,
65
74
  UDivider
66
75
  },
@@ -23,7 +23,7 @@ declare const _default: import("vue").DefineComponent<{
23
23
  getULinkProps: (props: any) => {};
24
24
  twMerge: (...classLists: import("tailwind-merge").ClassNameValue[]) => string;
25
25
  twJoin: typeof twJoin;
26
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
27
27
  links: {
28
28
  type: PropType<VerticalNavigationLink[] | VerticalNavigationLink[][]>;
29
29
  default: () => never[];
@@ -30,7 +30,7 @@ declare const _default: import("vue").DefineComponent<{
30
30
  wrapperClass: import("vue").ComputedRef<string>;
31
31
  popper: import("vue").ComputedRef<PopperOptions>;
32
32
  container: Ref<import("@vueuse/core").MaybeElement>;
33
- }, 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<{
33
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:modelValue")[], "close" | "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
34
34
  modelValue: {
35
35
  type: BooleanConstructor;
36
36
  default: boolean;
@@ -52,12 +52,12 @@ declare const _default: import("vue").DefineComponent<{
52
52
  default: () => {};
53
53
  };
54
54
  }>> & {
55
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
56
55
  onClose?: ((...args: any[]) => any) | undefined;
56
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
57
57
  }, {
58
58
  ui: any;
59
- popper: PopperOptions;
60
59
  class: any;
60
+ popper: PopperOptions;
61
61
  modelValue: boolean;
62
62
  }, {}>;
63
63
  export default _default;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <TransitionRoot :appear="appear" :show="isOpen" as="template">
3
- <HDialog :class="ui.wrapper" v-bind="attrs" @close="(e) => !preventClose && close(e)">
3
+ <HDialog :class="ui.wrapper" 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>
@@ -28,11 +28,12 @@
28
28
 
29
29
  <script>
30
30
  import { computed, toRef, defineComponent } from "vue";
31
- import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild } from "@headlessui/vue";
31
+ import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild, provideUseId } from "@headlessui/vue";
32
32
  import { useUI } from "../../composables/useUI";
33
33
  import { mergeConfig } from "../../utils";
34
34
  import appConfig from "#build/app.config";
35
35
  import { modal } from "#ui/ui.config";
36
+ import { useId } from "#imports";
36
37
  const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.modal, modal);
37
38
  export default defineComponent({
38
39
  components: {
@@ -76,7 +77,7 @@ export default defineComponent({
76
77
  default: () => ({})
77
78
  }
78
79
  },
79
- emits: ["update:modelValue", "close"],
80
+ emits: ["update:modelValue", "close", "close-prevented"],
80
81
  setup(props, { emit }) {
81
82
  const { ui, attrs } = useUI("modal", toRef(props, "ui"), config, toRef(props, "class"));
82
83
  const isOpen = computed({
@@ -96,9 +97,14 @@ export default defineComponent({
96
97
  };
97
98
  });
98
99
  function close(value) {
100
+ if (props.preventClose) {
101
+ emit("close-prevented");
102
+ return;
103
+ }
99
104
  isOpen.value = value;
100
105
  emit("close");
101
106
  }
107
+ provideUseId(() => useId());
102
108
  return {
103
109
  // eslint-disable-next-line vue/no-dupe-keys
104
110
  ui,
@@ -40,7 +40,7 @@ declare const _default: import("vue").DefineComponent<{
40
40
  isOpen: import("vue").WritableComputedRef<boolean>;
41
41
  transitionClass: import("vue").ComputedRef<any>;
42
42
  close: (value: boolean) => void;
43
- }, 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<{
43
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("close" | "update:modelValue" | "close-prevented")[], "close" | "update:modelValue" | "close-prevented", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
44
44
  modelValue: {
45
45
  type: BooleanConstructor;
46
46
  default: boolean;
@@ -74,16 +74,17 @@ declare const _default: import("vue").DefineComponent<{
74
74
  default: () => {};
75
75
  };
76
76
  }>> & {
77
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
78
77
  onClose?: ((...args: any[]) => any) | undefined;
78
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
79
+ "onClose-prevented"?: ((...args: any[]) => any) | undefined;
79
80
  }, {
80
81
  ui: any;
81
- transition: boolean;
82
- class: any;
83
- modelValue: boolean;
84
82
  appear: boolean;
85
83
  overlay: boolean;
84
+ transition: boolean;
86
85
  preventClose: boolean;
87
86
  fullscreen: boolean;
87
+ class: any;
88
+ modelValue: boolean;
88
89
  }, {}>;
89
90
  export default _default;
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <component :is="modalState.component" v-if="modalState" v-bind="modalState.props" v-model="isOpen" />
3
+ </template>
4
+
5
+ <script lang="ts" setup>
6
+ import { inject } from 'vue'
7
+ import { useModal, modalInjectionKey } from '../../composables/useModal'
8
+
9
+ const modalState = inject(modalInjectionKey)
10
+
11
+ const { isOpen } = useModal()
12
+ </script>
@@ -13,7 +13,7 @@
13
13
  <UAvatar v-if="avatar" v-bind="{ size: ui.avatar.size, ...avatar }" :class="ui.avatar.base" />
14
14
 
15
15
  <div :class="ui.inner">
16
- <p :class="ui.title">
16
+ <p v-if="(title || $slots.title)" :class="ui.title">
17
17
  <slot name="title" :title="title">
18
18
  {{ title }}
19
19
  </slot>
@@ -68,7 +68,7 @@ export default defineComponent({
68
68
  },
69
69
  title: {
70
70
  type: String,
71
- required: true
71
+ default: null
72
72
  },
73
73
  description: {
74
74
  type: String,