@nuxt/ui 2.8.1 → 2.10.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 (120) hide show
  1. package/README.md +1 -0
  2. package/dist/module.d.mts +1411 -1092
  3. package/dist/module.d.ts +1411 -1092
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +55 -11
  6. package/dist/runtime/components/data/Table.vue +47 -32
  7. package/dist/runtime/components/data/Table.vue.d.ts +22 -14
  8. package/dist/runtime/components/elements/Accordion.vue +33 -28
  9. package/dist/runtime/components/elements/Accordion.vue.d.ts +25 -18
  10. package/dist/runtime/components/elements/Alert.vue +22 -18
  11. package/dist/runtime/components/elements/Alert.vue.d.ts +26 -19
  12. package/dist/runtime/components/elements/Avatar.vue +22 -16
  13. package/dist/runtime/components/elements/Avatar.vue.d.ts +28 -19
  14. package/dist/runtime/components/elements/AvatarGroup.d.ts +17 -8
  15. package/dist/runtime/components/elements/AvatarGroup.mjs +18 -13
  16. package/dist/runtime/components/elements/Badge.vue +21 -17
  17. package/dist/runtime/components/elements/Badge.vue.d.ts +28 -19
  18. package/dist/runtime/components/elements/Button.vue +22 -18
  19. package/dist/runtime/components/elements/Button.vue.d.ts +28 -19
  20. package/dist/runtime/components/elements/ButtonGroup.d.ts +17 -8
  21. package/dist/runtime/components/elements/ButtonGroup.mjs +22 -15
  22. package/dist/runtime/components/elements/Dropdown.vue +45 -37
  23. package/dist/runtime/components/elements/Dropdown.vue.d.ts +22 -17
  24. package/dist/runtime/components/elements/Kbd.vue +16 -12
  25. package/dist/runtime/components/elements/Kbd.vue.d.ts +20 -12
  26. package/dist/runtime/components/elements/Link.vue +18 -5
  27. package/dist/runtime/components/elements/Meter.vue +166 -0
  28. package/dist/runtime/components/elements/Meter.vue.d.ts +123 -0
  29. package/dist/runtime/components/elements/MeterGroup.d.ts +78 -0
  30. package/dist/runtime/components/elements/MeterGroup.mjs +172 -0
  31. package/dist/runtime/components/elements/Progress.vue +284 -0
  32. package/dist/runtime/components/elements/Progress.vue.d.ts +2 -0
  33. package/dist/runtime/components/forms/Checkbox.vue +27 -17
  34. package/dist/runtime/components/forms/Checkbox.vue.d.ts +33 -15
  35. package/dist/runtime/components/forms/Form.vue +34 -9
  36. package/dist/runtime/components/forms/Form.vue.d.ts +2 -1
  37. package/dist/runtime/components/forms/FormGroup.vue +51 -27
  38. package/dist/runtime/components/forms/FormGroup.vue.d.ts +23 -15
  39. package/dist/runtime/components/forms/Input.vue +41 -29
  40. package/dist/runtime/components/forms/Input.vue.d.ts +51 -24
  41. package/dist/runtime/components/forms/Radio.vue +32 -21
  42. package/dist/runtime/components/forms/Radio.vue.d.ts +36 -18
  43. package/dist/runtime/components/forms/RadioGroup.vue +136 -0
  44. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +118 -0
  45. package/dist/runtime/components/forms/Range.vue +26 -16
  46. package/dist/runtime/components/forms/Range.vue.d.ts +37 -18
  47. package/dist/runtime/components/forms/Select.vue +34 -26
  48. package/dist/runtime/components/forms/Select.vue.d.ts +42 -24
  49. package/dist/runtime/components/forms/SelectMenu.vue +104 -89
  50. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +53 -33
  51. package/dist/runtime/components/forms/Textarea.vue +43 -31
  52. package/dist/runtime/components/forms/Textarea.vue.d.ts +50 -23
  53. package/dist/runtime/components/forms/Toggle.vue +26 -15
  54. package/dist/runtime/components/forms/Toggle.vue.d.ts +31 -12
  55. package/dist/runtime/components/layout/Card.vue +15 -10
  56. package/dist/runtime/components/layout/Card.vue.d.ts +17 -9
  57. package/dist/runtime/components/layout/Container.vue +15 -10
  58. package/dist/runtime/components/layout/Container.vue.d.ts +17 -9
  59. package/dist/runtime/components/layout/Divider.vue +107 -0
  60. package/dist/runtime/components/layout/Divider.vue.d.ts +82 -0
  61. package/dist/runtime/components/layout/Skeleton.vue +15 -10
  62. package/dist/runtime/components/layout/Skeleton.vue.d.ts +17 -9
  63. package/dist/runtime/components/navigation/CommandPalette.vue +57 -38
  64. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +24 -23
  65. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +1 -1
  66. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +3 -4
  67. package/dist/runtime/components/navigation/Pagination.vue +129 -64
  68. package/dist/runtime/components/navigation/Pagination.vue.d.ts +70 -25
  69. package/dist/runtime/components/navigation/Tabs.vue +17 -14
  70. package/dist/runtime/components/navigation/Tabs.vue.d.ts +18 -11
  71. package/dist/runtime/components/navigation/VerticalNavigation.vue +15 -13
  72. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +20 -16
  73. package/dist/runtime/components/overlays/ContextMenu.vue +21 -11
  74. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +20 -11
  75. package/dist/runtime/components/overlays/Modal.vue +16 -14
  76. package/dist/runtime/components/overlays/Modal.vue.d.ts +18 -11
  77. package/dist/runtime/components/overlays/Notification.vue +25 -15
  78. package/dist/runtime/components/overlays/Notification.vue.d.ts +25 -19
  79. package/dist/runtime/components/overlays/Notifications.vue +19 -13
  80. package/dist/runtime/components/overlays/Notifications.vue.d.ts +22 -14
  81. package/dist/runtime/components/overlays/Popover.vue +39 -22
  82. package/dist/runtime/components/overlays/Popover.vue.d.ts +32 -11
  83. package/dist/runtime/components/overlays/Slideover.vue +15 -13
  84. package/dist/runtime/components/overlays/Slideover.vue.d.ts +18 -11
  85. package/dist/runtime/components/overlays/Tooltip.vue +31 -23
  86. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +19 -11
  87. package/dist/runtime/composables/useFormGroup.d.ts +12 -2
  88. package/dist/runtime/composables/useFormGroup.mjs +21 -4
  89. package/dist/runtime/composables/usePopper.d.ts +3 -3
  90. package/dist/runtime/composables/usePopper.mjs +47 -31
  91. package/dist/runtime/composables/useToast.d.ts +3 -3
  92. package/dist/runtime/composables/useUI.d.ts +10 -0
  93. package/dist/runtime/composables/useUI.mjs +24 -0
  94. package/dist/runtime/types/avatar.d.ts +10 -4
  95. package/dist/runtime/types/badge.d.ts +14 -0
  96. package/dist/runtime/types/button.d.ts +10 -3
  97. package/dist/runtime/types/command-palette.d.ts +3 -1
  98. package/dist/runtime/types/form.d.ts +18 -4
  99. package/dist/runtime/types/index.d.ts +4 -0
  100. package/dist/runtime/types/link.d.ts +1 -0
  101. package/dist/runtime/types/meter.d.ts +5 -0
  102. package/dist/runtime/types/notification.d.ts +5 -3
  103. package/dist/runtime/types/popper.d.ts +1 -0
  104. package/dist/runtime/types/progress.d.ts +4 -0
  105. package/dist/runtime/types/tabs.d.ts +1 -0
  106. package/dist/runtime/types/utils.d.ts +11 -0
  107. package/dist/runtime/ui.config.d.ts +1470 -0
  108. package/dist/runtime/{app.config.mjs → ui.config.mjs} +313 -97
  109. package/dist/runtime/utils/index.d.ts +5 -11
  110. package/dist/runtime/utils/index.mjs +21 -9
  111. package/dist/runtime/utils/lodash.d.ts +2 -0
  112. package/dist/runtime/utils/lodash.mjs +23 -0
  113. package/dist/runtime/utils/uid.d.ts +1 -0
  114. package/dist/runtime/utils/uid.mjs +4 -0
  115. package/dist/types.d.mts +1 -1
  116. package/dist/types.d.ts +1 -1
  117. package/package.json +27 -29
  118. package/dist/runtime/app.config.d.ts +0 -1203
  119. package/dist/runtime/utils/StateEmitter.d.ts +0 -17
  120. package/dist/runtime/utils/StateEmitter.mjs +0 -21
@@ -1,6 +1,5 @@
1
- /// <reference types="lodash" />
2
1
  import type { PropType } from 'vue';
3
- import type { Button } from '../../types/button';
2
+ import type { Button } from '../../types';
4
3
  declare const _default: import("vue").DefineComponent<{
5
4
  modelValue: {
6
5
  type: NumberConstructor;
@@ -20,48 +19,69 @@ declare const _default: import("vue").DefineComponent<{
20
19
  validate(value: any): boolean;
21
20
  };
22
21
  size: {
23
- type: StringConstructor;
22
+ type: PropType<string | number | symbol>;
24
23
  default: () => any;
25
24
  validator(value: string): boolean;
26
25
  };
27
26
  activeButton: {
28
27
  type: PropType<Button>;
29
- default: () => any;
28
+ default: () => Button;
30
29
  };
31
30
  inactiveButton: {
32
31
  type: PropType<Button>;
33
- default: () => any;
32
+ default: () => Button;
33
+ };
34
+ showFirst: {
35
+ type: BooleanConstructor;
36
+ default: boolean;
37
+ };
38
+ showLast: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ firstButton: {
43
+ type: PropType<Button>;
44
+ default: () => Button;
45
+ };
46
+ lastButton: {
47
+ type: PropType<Button>;
48
+ default: () => Button;
34
49
  };
35
50
  prevButton: {
36
51
  type: PropType<Button>;
37
- default: () => any;
52
+ default: () => Button;
38
53
  };
39
54
  nextButton: {
40
55
  type: PropType<Button>;
41
- default: () => any;
56
+ default: () => Button;
42
57
  };
43
58
  divider: {
44
59
  type: StringConstructor;
45
60
  default: string;
46
61
  };
47
- ui: {
62
+ class: {
48
63
  type: PropType<any>;
49
- default: () => {};
64
+ default: undefined;
65
+ };
66
+ ui: {
67
+ type: PropType<Partial<any>>;
68
+ default: undefined;
50
69
  };
51
70
  }, {
52
- attrs: import("lodash").Omit<{
53
- [x: string]: unknown;
54
- }, "class">;
55
71
  ui: import("vue").ComputedRef<any>;
72
+ attrs: import("vue").ComputedRef<Pick<{
73
+ [x: string]: unknown;
74
+ }, string>>;
56
75
  currentPage: import("vue").WritableComputedRef<number>;
57
76
  pages: import("vue").ComputedRef<number[]>;
58
77
  displayedPages: import("vue").ComputedRef<(string | number)[]>;
59
- canGoPrev: import("vue").ComputedRef<boolean>;
60
- canGoNext: import("vue").ComputedRef<boolean>;
61
- wrapperClass: import("vue").ComputedRef<string>;
78
+ canGoLastOrNext: import("vue").ComputedRef<boolean>;
79
+ canGoFirstOrPrev: import("vue").ComputedRef<boolean>;
62
80
  onClickPrev: () => void;
63
81
  onClickNext: () => void;
64
82
  onClickPage: (page: number | string) => void;
83
+ onClickFirst: () => void;
84
+ onClickLast: () => void;
65
85
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
66
86
  modelValue: {
67
87
  type: NumberConstructor;
@@ -81,45 +101,70 @@ declare const _default: import("vue").DefineComponent<{
81
101
  validate(value: any): boolean;
82
102
  };
83
103
  size: {
84
- type: StringConstructor;
104
+ type: PropType<string | number | symbol>;
85
105
  default: () => any;
86
106
  validator(value: string): boolean;
87
107
  };
88
108
  activeButton: {
89
109
  type: PropType<Button>;
90
- default: () => any;
110
+ default: () => Button;
91
111
  };
92
112
  inactiveButton: {
93
113
  type: PropType<Button>;
94
- default: () => any;
114
+ default: () => Button;
115
+ };
116
+ showFirst: {
117
+ type: BooleanConstructor;
118
+ default: boolean;
119
+ };
120
+ showLast: {
121
+ type: BooleanConstructor;
122
+ default: boolean;
123
+ };
124
+ firstButton: {
125
+ type: PropType<Button>;
126
+ default: () => Button;
127
+ };
128
+ lastButton: {
129
+ type: PropType<Button>;
130
+ default: () => Button;
95
131
  };
96
132
  prevButton: {
97
133
  type: PropType<Button>;
98
- default: () => any;
134
+ default: () => Button;
99
135
  };
100
136
  nextButton: {
101
137
  type: PropType<Button>;
102
- default: () => any;
138
+ default: () => Button;
103
139
  };
104
140
  divider: {
105
141
  type: StringConstructor;
106
142
  default: string;
107
143
  };
108
- ui: {
144
+ class: {
109
145
  type: PropType<any>;
110
- default: () => {};
146
+ default: undefined;
147
+ };
148
+ ui: {
149
+ type: PropType<Partial<any>>;
150
+ default: undefined;
111
151
  };
112
152
  }>> & {
113
153
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
114
154
  }, {
115
- ui: any;
116
- size: string;
155
+ ui: Partial<any>;
156
+ class: any;
157
+ size: string | number | symbol;
117
158
  max: number;
159
+ divider: string;
118
160
  pageCount: number;
119
161
  activeButton: Button;
120
162
  inactiveButton: Button;
163
+ showFirst: boolean;
164
+ showLast: boolean;
165
+ firstButton: Button;
166
+ lastButton: Button;
121
167
  prevButton: Button;
122
168
  nextButton: Button;
123
- divider: string;
124
169
  }, {}>;
125
170
  export default _default;
@@ -3,7 +3,7 @@
3
3
  :vertical="orientation === 'vertical'"
4
4
  :selected-index="selectedIndex"
5
5
  as="div"
6
- :class="wrapperClass"
6
+ :class="ui.wrapper"
7
7
  v-bind="attrs"
8
8
  @change="onChange"
9
9
  >
@@ -26,7 +26,7 @@
26
26
  >
27
27
  <button :class="[ui.list.tab.base, ui.list.tab.background, ui.list.tab.height, ui.list.tab.padding, ui.list.tab.size, ui.list.tab.font, ui.list.tab.rounded, ui.list.tab.shadow, selected ? ui.list.tab.active : ui.list.tab.inactive]">
28
28
  <slot :item="item" :index="index" :selected="selected" :disabled="disabled">
29
- {{ item.label }}
29
+ <span class="truncate">{{ item.label }}</span>
30
30
  </slot>
31
31
  </button>
32
32
  </HTab>
@@ -38,6 +38,7 @@
38
38
  :key="index"
39
39
  v-slot="{ selected }"
40
40
  :class="ui.base"
41
+ tabindex="-1"
41
42
  >
42
43
  <slot :name="item.slot || 'item'" :item="item" :index="index" :selected="selected">
43
44
  {{ item.content }}
@@ -48,13 +49,14 @@
48
49
  </template>
49
50
 
50
51
  <script>
51
- import { ref, computed, watch, onMounted, defineComponent } from "vue";
52
+ import { toRef, ref, watch, onMounted, defineComponent } from "vue";
52
53
  import { TabGroup as HTabGroup, TabList as HTabList, Tab as HTab, TabPanels as HTabPanels, TabPanel as HTabPanel } from "@headlessui/vue";
53
54
  import { useResizeObserver } from "@vueuse/core";
54
- import { omit } from "lodash-es";
55
- import { twMerge } from "tailwind-merge";
56
- import { defuTwMerge } from "../../utils";
57
- import { useAppConfig } from "#imports";
55
+ import { useUI } from "../../composables/useUI";
56
+ import { mergeConfig } from "../../utils";
57
+ import appConfig from "#build/app.config";
58
+ import { tabs } from "#ui/ui.config";
59
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.tabs, tabs);
58
60
  export default defineComponent({
59
61
  components: {
60
62
  HTabGroup,
@@ -82,20 +84,22 @@ export default defineComponent({
82
84
  type: Array,
83
85
  default: () => []
84
86
  },
87
+ class: {
88
+ type: [String, Object, Array],
89
+ default: void 0
90
+ },
85
91
  ui: {
86
92
  type: Object,
87
- default: () => ({})
93
+ default: void 0
88
94
  }
89
95
  },
90
96
  emits: ["update:modelValue", "change"],
91
- setup(props, { attrs, emit }) {
92
- const appConfig2 = useAppConfig();
93
- const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.tabs));
97
+ setup(props, { emit }) {
98
+ const { ui, attrs } = useUI("tabs", toRef(props, "ui"), config, toRef(props, "class"));
94
99
  const listRef = ref();
95
100
  const itemRefs = ref([]);
96
101
  const markerRef = ref();
97
102
  const selectedIndex = ref(props.modelValue || props.defaultIndex);
98
- const wrapperClass = computed(() => twMerge(ui.value.wrapper, attrs.class));
99
103
  function calcMarkerSize(index) {
100
104
  const tab = itemRefs.value[index]?.$el;
101
105
  if (!tab) {
@@ -123,14 +127,13 @@ export default defineComponent({
123
127
  });
124
128
  onMounted(() => calcMarkerSize(selectedIndex.value));
125
129
  return {
126
- attrs: omit(attrs, ["class"]),
127
130
  // eslint-disable-next-line vue/no-dupe-keys
128
131
  ui,
132
+ attrs,
129
133
  listRef,
130
134
  itemRefs,
131
135
  markerRef,
132
136
  selectedIndex,
133
- wrapperClass,
134
137
  onChange
135
138
  };
136
139
  }
@@ -1,6 +1,5 @@
1
- /// <reference types="lodash" />
2
1
  import type { PropType } from 'vue';
3
- import type { TabItem } from '../../types/tabs';
2
+ import type { TabItem } from '../../types';
4
3
  declare const _default: import("vue").DefineComponent<{
5
4
  modelValue: {
6
5
  type: NumberConstructor;
@@ -19,20 +18,23 @@ declare const _default: import("vue").DefineComponent<{
19
18
  type: PropType<TabItem[]>;
20
19
  default: () => never[];
21
20
  };
22
- ui: {
21
+ class: {
23
22
  type: PropType<any>;
24
- default: () => {};
23
+ default: undefined;
24
+ };
25
+ ui: {
26
+ type: PropType<Partial<any>>;
27
+ default: undefined;
25
28
  };
26
29
  }, {
27
- attrs: import("lodash").Omit<{
28
- [x: string]: unknown;
29
- }, "class">;
30
30
  ui: import("vue").ComputedRef<any>;
31
+ attrs: import("vue").ComputedRef<Pick<{
32
+ [x: string]: unknown;
33
+ }, string>>;
31
34
  listRef: import("vue").Ref<HTMLElement | undefined>;
32
35
  itemRefs: import("vue").Ref<HTMLElement[]>;
33
36
  markerRef: import("vue").Ref<HTMLElement | undefined>;
34
37
  selectedIndex: import("vue").Ref<number>;
35
- wrapperClass: import("vue").ComputedRef<string>;
36
38
  onChange: (index: any) => void;
37
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<{
38
40
  modelValue: {
@@ -52,15 +54,20 @@ declare const _default: import("vue").DefineComponent<{
52
54
  type: PropType<TabItem[]>;
53
55
  default: () => never[];
54
56
  };
55
- ui: {
57
+ class: {
56
58
  type: PropType<any>;
57
- default: () => {};
59
+ default: undefined;
60
+ };
61
+ ui: {
62
+ type: PropType<Partial<any>>;
63
+ default: undefined;
58
64
  };
59
65
  }>> & {
60
66
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
61
67
  onChange?: ((...args: any[]) => any) | undefined;
62
68
  }, {
63
- ui: any;
69
+ ui: Partial<any>;
70
+ class: any;
64
71
  modelValue: number;
65
72
  items: TabItem[];
66
73
  orientation: "horizontal" | "vertical";
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <nav :class="wrapperClass" v-bind="attrs">
2
+ <nav :class="ui.wrapper" v-bind="attrs">
3
3
  <ULink
4
4
  v-for="(link, index) of links"
5
5
  v-slot="{ isActive }"
@@ -38,14 +38,15 @@
38
38
  </template>
39
39
 
40
40
  <script>
41
- import { computed, defineComponent } from "vue";
42
- import { omit } from "lodash-es";
43
- import { twMerge } from "tailwind-merge";
41
+ import { toRef, defineComponent } from "vue";
44
42
  import UIcon from "../elements/Icon.vue";
45
43
  import UAvatar from "../elements/Avatar.vue";
46
44
  import ULink from "../elements/Link.vue";
47
- import { defuTwMerge } from "../../utils";
48
- import { useAppConfig } from "#imports";
45
+ import { useUI } from "../../composables/useUI";
46
+ import { mergeConfig, omit } from "../../utils";
47
+ import appConfig from "#build/app.config";
48
+ import { verticalNavigation } from "#ui/ui.config";
49
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.verticalNavigation, verticalNavigation);
49
50
  export default defineComponent({
50
51
  components: {
51
52
  UIcon,
@@ -58,20 +59,21 @@ export default defineComponent({
58
59
  type: Array,
59
60
  default: () => []
60
61
  },
62
+ class: {
63
+ type: [String, Object, Array],
64
+ default: void 0
65
+ },
61
66
  ui: {
62
67
  type: Object,
63
- default: () => ({})
68
+ default: void 0
64
69
  }
65
70
  },
66
- setup(props, { attrs }) {
67
- const appConfig2 = useAppConfig();
68
- const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.verticalNavigation));
69
- const wrapperClass = computed(() => twMerge(ui.value.wrapper, attrs.class));
71
+ setup(props) {
72
+ const { ui, attrs } = useUI("verticalNavigation", toRef(props, "ui"), config, toRef(props, "class"));
70
73
  return {
71
- attrs: omit(attrs, ["class"]),
72
74
  // eslint-disable-next-line vue/no-dupe-keys
73
75
  ui,
74
- wrapperClass,
76
+ attrs,
75
77
  omit
76
78
  };
77
79
  }
@@ -1,37 +1,41 @@
1
- /// <reference types="lodash" />
2
1
  import type { PropType } from 'vue';
3
- import type { VerticalNavigationLink } from '../../types/vertical-navigation';
2
+ import { omit } from '../../utils';
3
+ import type { VerticalNavigationLink } from '../../types';
4
4
  declare const _default: import("vue").DefineComponent<{
5
5
  links: {
6
6
  type: PropType<VerticalNavigationLink[]>;
7
7
  default: () => never[];
8
8
  };
9
- ui: {
9
+ class: {
10
10
  type: PropType<any>;
11
- default: () => {};
11
+ default: undefined;
12
+ };
13
+ ui: {
14
+ type: PropType<Partial<any>>;
15
+ default: undefined;
12
16
  };
13
17
  }, {
14
- attrs: import("lodash").Omit<{
15
- [x: string]: unknown;
16
- }, "class">;
17
18
  ui: import("vue").ComputedRef<any>;
18
- wrapperClass: import("vue").ComputedRef<string>;
19
- omit: {
20
- <T extends object, K extends import("lodash").PropertyName[]>(object: T | null | undefined, ...paths: K): Pick<T, Exclude<keyof T, K[number]>>;
21
- <T_1 extends object, K_1 extends keyof T_1>(object: T_1 | null | undefined, ...paths: import("lodash").Many<K_1>[]): import("lodash").Omit<T_1, K_1>;
22
- <T_2 extends object>(object: T_2 | null | undefined, ...paths: import("lodash").Many<import("lodash").PropertyName>[]): Partial<T_2>;
23
- };
19
+ attrs: import("vue").ComputedRef<Pick<{
20
+ [x: string]: unknown;
21
+ }, string>>;
22
+ omit: typeof omit;
24
23
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
25
24
  links: {
26
25
  type: PropType<VerticalNavigationLink[]>;
27
26
  default: () => never[];
28
27
  };
29
- ui: {
28
+ class: {
30
29
  type: PropType<any>;
31
- default: () => {};
30
+ default: undefined;
31
+ };
32
+ ui: {
33
+ type: PropType<Partial<any>>;
34
+ default: undefined;
32
35
  };
33
36
  }>>, {
34
- ui: any;
37
+ ui: Partial<any>;
38
+ class: any;
35
39
  links: VerticalNavigationLink[];
36
40
  }, {}>;
37
41
  export default _default;
@@ -1,8 +1,11 @@
1
1
  <template>
2
2
  <div v-if="isOpen" ref="container" :class="wrapperClass" v-bind="attrs">
3
3
  <Transition appear v-bind="ui.transition">
4
- <div :class="[ui.base, ui.ring, ui.rounded, ui.shadow, ui.background]">
5
- <slot />
4
+ <div>
5
+ <div v-if="popper.arrow" data-popper-arrow :class="['invisible before:visible before:block before:rotate-45 before:z-[-1]', Object.values(ui.arrow)]" />
6
+ <div :class="[ui.base, ui.ring, ui.rounded, ui.shadow, ui.background]">
7
+ <slot />
8
+ </div>
6
9
  </div>
7
10
  </Transition>
8
11
  </div>
@@ -12,11 +15,13 @@
12
15
  import { computed, toRef, defineComponent } from "vue";
13
16
  import { defu } from "defu";
14
17
  import { onClickOutside } from "@vueuse/core";
15
- import { omit } from "lodash-es";
16
18
  import { twMerge, twJoin } from "tailwind-merge";
19
+ import { useUI } from "../../composables/useUI";
17
20
  import { usePopper } from "../../composables/usePopper";
18
- import { defuTwMerge } from "../../utils";
19
- import { useAppConfig } from "#imports";
21
+ import { mergeConfig } from "../../utils";
22
+ import appConfig from "#build/app.config";
23
+ import { contextMenu } from "#ui/ui.config";
24
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.contextMenu, contextMenu);
20
25
  export default defineComponent({
21
26
  inheritAttrs: false,
22
27
  props: {
@@ -32,15 +37,18 @@ export default defineComponent({
32
37
  type: Object,
33
38
  default: () => ({})
34
39
  },
40
+ class: {
41
+ type: [String, Object, Array],
42
+ default: void 0
43
+ },
35
44
  ui: {
36
45
  type: Object,
37
- default: () => ({})
46
+ default: void 0
38
47
  }
39
48
  },
40
49
  emits: ["update:modelValue", "close"],
41
- setup(props, { attrs, emit }) {
42
- const appConfig2 = useAppConfig();
43
- const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.contextMenu));
50
+ setup(props, { emit }) {
51
+ const { ui, attrs } = useUI("contextMenu", toRef(props, "ui"), config);
44
52
  const popper = computed(() => defu({}, props.popper, ui.value.popper));
45
53
  const isOpen = computed({
46
54
  get() {
@@ -56,17 +64,19 @@ export default defineComponent({
56
64
  return twMerge(twJoin(
57
65
  ui.value.container,
58
66
  ui.value.width
59
- ), attrs.class);
67
+ ), props.class);
60
68
  });
61
69
  onClickOutside(container, () => {
62
70
  isOpen.value = false;
63
71
  });
64
72
  return {
65
- attrs: omit(attrs, ["class"]),
66
73
  // eslint-disable-next-line vue/no-dupe-keys
67
74
  ui,
75
+ attrs,
68
76
  isOpen,
69
77
  wrapperClass,
78
+ // eslint-disable-next-line vue/no-dupe-keys
79
+ popper,
70
80
  container
71
81
  };
72
82
  }
@@ -1,6 +1,5 @@
1
- /// <reference types="lodash" />
2
1
  import type { PropType, Ref } from 'vue';
3
- import type { PopperOptions } from '../../types/popper';
2
+ import type { PopperOptions } from '../../types';
4
3
  declare const _default: import("vue").DefineComponent<{
5
4
  modelValue: {
6
5
  type: BooleanConstructor;
@@ -14,17 +13,22 @@ declare const _default: import("vue").DefineComponent<{
14
13
  type: PropType<PopperOptions>;
15
14
  default: () => {};
16
15
  };
17
- ui: {
16
+ class: {
18
17
  type: PropType<any>;
19
- default: () => {};
18
+ default: undefined;
19
+ };
20
+ ui: {
21
+ type: PropType<Partial<any>>;
22
+ default: undefined;
20
23
  };
21
24
  }, {
22
- attrs: import("lodash").Omit<{
23
- [x: string]: unknown;
24
- }, "class">;
25
25
  ui: import("vue").ComputedRef<any>;
26
+ attrs: import("vue").ComputedRef<Pick<{
27
+ [x: string]: unknown;
28
+ }, string>>;
26
29
  isOpen: import("vue").WritableComputedRef<boolean>;
27
30
  wrapperClass: import("vue").ComputedRef<string>;
31
+ popper: import("vue").ComputedRef<PopperOptions>;
28
32
  container: Ref<import("@vueuse/core").MaybeElement>;
29
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<{
30
34
  modelValue: {
@@ -39,16 +43,21 @@ declare const _default: import("vue").DefineComponent<{
39
43
  type: PropType<PopperOptions>;
40
44
  default: () => {};
41
45
  };
42
- ui: {
46
+ class: {
43
47
  type: PropType<any>;
44
- default: () => {};
48
+ default: undefined;
49
+ };
50
+ ui: {
51
+ type: PropType<Partial<any>>;
52
+ default: undefined;
45
53
  };
46
54
  }>> & {
47
- onClose?: ((...args: any[]) => any) | undefined;
48
55
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
56
+ onClose?: ((...args: any[]) => any) | undefined;
49
57
  }, {
50
- ui: any;
58
+ ui: Partial<any>;
51
59
  popper: PopperOptions;
60
+ class: any;
52
61
  modelValue: boolean;
53
62
  }, {}>;
54
63
  export default _default;
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <TransitionRoot :appear="appear" :show="isOpen" as="template">
3
- <HDialog :class="wrapperClass" v-bind="attrs" @close="(e) => !preventClose && close(e)">
3
+ <HDialog :class="ui.wrapper" v-bind="attrs" @close="(e) => !preventClose && close(e)">
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>
7
7
 
8
8
  <div :class="ui.inner">
9
- <div :class="[ui.container, ui.padding]">
9
+ <div :class="[ui.container, !fullscreen && ui.padding]">
10
10
  <TransitionChild as="template" :appear="appear" v-bind="transitionClass">
11
11
  <HDialogPanel
12
12
  :class="[
@@ -30,12 +30,13 @@
30
30
  </template>
31
31
 
32
32
  <script>
33
- import { computed, defineComponent } from "vue";
34
- import { omit } from "lodash-es";
35
- import { twMerge } from "tailwind-merge";
33
+ import { computed, toRef, defineComponent } from "vue";
36
34
  import { Dialog as HDialog, DialogPanel as HDialogPanel, TransitionRoot, TransitionChild } from "@headlessui/vue";
37
- import { defuTwMerge } from "../../utils";
38
- import { useAppConfig } from "#imports";
35
+ import { useUI } from "../../composables/useUI";
36
+ import { mergeConfig } from "../../utils";
37
+ import appConfig from "#build/app.config";
38
+ import { modal } from "#ui/ui.config";
39
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.modal, modal);
39
40
  export default defineComponent({
40
41
  components: {
41
42
  HDialog,
@@ -69,15 +70,18 @@ export default defineComponent({
69
70
  type: Boolean,
70
71
  default: false
71
72
  },
73
+ class: {
74
+ type: [String, Object, Array],
75
+ default: void 0
76
+ },
72
77
  ui: {
73
78
  type: Object,
74
- default: () => ({})
79
+ default: void 0
75
80
  }
76
81
  },
77
82
  emits: ["update:modelValue", "close"],
78
- setup(props, { attrs, emit }) {
79
- const appConfig2 = useAppConfig();
80
- const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.modal));
83
+ setup(props, { emit }) {
84
+ const { ui, attrs } = useUI("modal", toRef(props, "ui"), config, toRef(props, "class"));
81
85
  const isOpen = computed({
82
86
  get() {
83
87
  return props.modelValue;
@@ -86,7 +90,6 @@ export default defineComponent({
86
90
  emit("update:modelValue", value);
87
91
  }
88
92
  });
89
- const wrapperClass = computed(() => twMerge(ui.value.wrapper, attrs.class));
90
93
  const transitionClass = computed(() => {
91
94
  if (!props.transition) {
92
95
  return {};
@@ -100,11 +103,10 @@ export default defineComponent({
100
103
  emit("close");
101
104
  }
102
105
  return {
103
- attrs: omit(attrs, ["class"]),
104
106
  // eslint-disable-next-line vue/no-dupe-keys
105
107
  ui,
108
+ attrs,
106
109
  isOpen,
107
- wrapperClass,
108
110
  transitionClass,
109
111
  close
110
112
  };