@nuxt/ui 2.13.0 → 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 (114) hide show
  1. package/README.md +8 -8
  2. package/dist/module.d.mts +61 -2
  3. package/dist/module.d.ts +61 -2
  4. package/dist/module.json +2 -2
  5. package/dist/module.mjs +131 -144
  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 +19 -12
  18. package/dist/runtime/components/elements/Carousel.vue.d.ts +4 -4
  19. package/dist/runtime/components/elements/Chip.vue.d.ts +2 -2
  20. package/dist/runtime/components/elements/Dropdown.vue +3 -1
  21. package/dist/runtime/components/elements/Dropdown.vue.d.ts +3 -3
  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 +1 -1
  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 +1 -1
  28. package/dist/runtime/components/elements/MeterGroup.d.ts +1 -1
  29. package/dist/runtime/components/elements/Progress.vue +4 -1
  30. package/dist/runtime/components/elements/Progress.vue.d.ts +5 -5
  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 +6 -3
  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 +4 -1
  40. package/dist/runtime/components/forms/InputMenu.vue.d.ts +7 -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.d.ts +6 -6
  47. package/dist/runtime/components/forms/SelectMenu.vue +4 -1
  48. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +7 -7
  49. package/dist/runtime/components/forms/Textarea.vue +5 -1
  50. package/dist/runtime/components/forms/Textarea.vue.d.ts +15 -6
  51. package/dist/runtime/components/forms/Toggle.vue +3 -1
  52. package/dist/runtime/components/forms/Toggle.vue.d.ts +4 -4
  53. package/dist/runtime/components/layout/Card.vue +1 -1
  54. package/dist/runtime/components/layout/Card.vue.d.ts +1 -1
  55. package/dist/runtime/components/layout/Container.vue.d.ts +1 -1
  56. package/dist/runtime/components/layout/Divider.vue +8 -1
  57. package/dist/runtime/components/layout/Divider.vue.d.ts +15 -4
  58. package/dist/runtime/components/layout/Skeleton.vue.d.ts +1 -1
  59. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +1 -1
  60. package/dist/runtime/components/navigation/CommandPalette.vue +3 -1
  61. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +2 -2
  62. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +3 -1
  63. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +1 -1
  64. package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +1 -1
  65. package/dist/runtime/components/navigation/Pagination.vue.d.ts +1 -1
  66. package/dist/runtime/components/navigation/Tabs.vue +8 -8
  67. package/dist/runtime/components/navigation/Tabs.vue.d.ts +10 -1
  68. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +1 -1
  69. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +3 -3
  70. package/dist/runtime/components/overlays/Modal.vue +3 -1
  71. package/dist/runtime/components/overlays/Modal.vue.d.ts +5 -5
  72. package/dist/runtime/components/overlays/Modals.client.vue +12 -0
  73. package/dist/runtime/components/overlays/Notification.vue +2 -2
  74. package/dist/runtime/components/overlays/Notification.vue.d.ts +4 -3
  75. package/dist/runtime/components/overlays/Notifications.vue.d.ts +1 -1
  76. package/dist/runtime/components/overlays/Popover.vue +3 -1
  77. package/dist/runtime/components/overlays/Popover.vue.d.ts +3 -3
  78. package/dist/runtime/components/overlays/Slideover.vue +3 -1
  79. package/dist/runtime/components/overlays/Slideover.vue.d.ts +5 -5
  80. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +2 -2
  81. package/dist/runtime/composables/useFormGroup.d.ts +1 -1
  82. package/dist/runtime/composables/useFormGroup.mjs +9 -12
  83. package/dist/runtime/composables/useModal.d.ts +12 -0
  84. package/dist/runtime/composables/useModal.mjs +37 -0
  85. package/dist/runtime/plugins/modals.d.ts +2 -0
  86. package/dist/runtime/plugins/modals.mjs +10 -0
  87. package/dist/runtime/types/component.d.ts +14 -0
  88. package/dist/runtime/types/divider.d.ts +3 -0
  89. package/dist/runtime/types/form.d.ts +2 -1
  90. package/dist/runtime/types/index.d.ts +2 -0
  91. package/dist/runtime/types/modal.d.ts +18 -0
  92. package/dist/runtime/types/progress.d.ts +2 -0
  93. package/dist/runtime/types/range.d.ts +2 -0
  94. package/dist/runtime/types/toggle.d.ts +2 -0
  95. package/dist/runtime/ui.config/data/table.d.ts +7 -0
  96. package/dist/runtime/ui.config/data/table.mjs +10 -3
  97. package/dist/runtime/ui.config/elements/accordion.d.ts +1 -0
  98. package/dist/runtime/ui.config/elements/accordion.mjs +1 -0
  99. package/dist/runtime/ui.config/forms/formGroup.d.ts +1 -0
  100. package/dist/runtime/ui.config/forms/formGroup.mjs +1 -0
  101. package/dist/runtime/ui.config/forms/input.d.ts +11 -0
  102. package/dist/runtime/ui.config/forms/input.mjs +11 -0
  103. package/dist/runtime/ui.config/forms/select.d.ts +11 -0
  104. package/dist/runtime/ui.config/forms/textarea.d.ts +11 -0
  105. package/dist/runtime/ui.config/layout/divider.d.ts +19 -2
  106. package/dist/runtime/ui.config/layout/divider.mjs +20 -3
  107. package/dist/runtime/utils/colors.d.ts +3 -0
  108. package/dist/runtime/utils/colors.mjs +261 -0
  109. package/dist/runtime/utils/index.mjs +9 -0
  110. package/dist/runtime/utils/link.d.ts +24 -11
  111. package/dist/runtime/utils/link.mjs +26 -13
  112. package/package.json +21 -19
  113. package/dist/runtime/utils/uid.d.ts +0 -1
  114. package/dist/runtime/utils/uid.mjs +0 -5
@@ -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<HorizontalNavigationLink[] | HorizontalNavigationLink[][]>;
29
29
  default: () => never[];
@@ -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;
@@ -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
  }, {}>;
@@ -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;
@@ -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: {
@@ -103,6 +104,7 @@ export default defineComponent({
103
104
  isOpen.value = value;
104
105
  emit("close");
105
106
  }
107
+ provideUseId(() => useId());
106
108
  return {
107
109
  // eslint-disable-next-line vue/no-dupe-keys
108
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-prevented")[], "close" | "update:modelValue" | "close-prevented", 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,17 +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
79
  "onClose-prevented"?: ((...args: any[]) => any) | undefined;
80
80
  }, {
81
81
  ui: any;
82
- transition: boolean;
83
- class: any;
84
- modelValue: boolean;
85
82
  appear: boolean;
86
83
  overlay: boolean;
84
+ transition: boolean;
87
85
  preventClose: boolean;
88
86
  fullscreen: boolean;
87
+ class: any;
88
+ modelValue: boolean;
89
89
  }, {}>;
90
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,
@@ -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: {
@@ -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,
@@ -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;
@@ -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;
@@ -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: {
@@ -96,6 +97,7 @@ export default defineComponent({
96
97
  isOpen.value = value;
97
98
  emit("close");
98
99
  }
100
+ provideUseId(() => useId());
99
101
  return {
100
102
  // eslint-disable-next-line vue/no-dupe-keys
101
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-prevented")[], "close" | "update:modelValue" | "close-prevented", 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,17 +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
81
  "onClose-prevented"?: ((...args: any[]) => any) | undefined;
82
82
  }, {
83
83
  ui: any;
84
- transition: boolean;
85
- class: any;
86
- modelValue: boolean;
87
84
  appear: boolean;
88
85
  overlay: boolean;
86
+ transition: boolean;
89
87
  preventClose: boolean;
88
+ class: any;
89
+ modelValue: boolean;
90
90
  side: "right" | "left";
91
91
  }, {}>;
92
92
  export default _default;
@@ -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;
@@ -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;
@@ -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);
@@ -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
@@ -7,6 +7,7 @@ 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'
@@ -15,6 +16,7 @@ export * from './input'
15
16
  export * from './kbd'
16
17
  export * from './link'
17
18
  export * from './meter'
19
+ export * from './modal'
18
20
  export * from './notification'
19
21
  export * from './popper'
20
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]
@@ -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;