@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,9 @@
1
- /// <reference types="lodash" />
2
1
  import type { PropType } from 'vue';
3
2
  declare const _default: import("vue").DefineComponent<{
3
+ id: {
4
+ type: StringConstructor;
5
+ default: null;
6
+ };
4
7
  name: {
5
8
  type: StringConstructor;
6
9
  default: null;
@@ -22,24 +25,34 @@ declare const _default: import("vue").DefineComponent<{
22
25
  default: () => any;
23
26
  };
24
27
  color: {
25
- type: StringConstructor;
28
+ type: PropType<any>;
26
29
  default: () => any;
27
30
  validator(value: string): any;
28
31
  };
29
- ui: {
32
+ class: {
30
33
  type: PropType<any>;
31
- default: () => {};
34
+ default: undefined;
35
+ };
36
+ ui: {
37
+ type: PropType<Partial<any>>;
38
+ default: undefined;
32
39
  };
33
40
  }, {
34
- attrs: import("lodash").Omit<{
35
- [x: string]: unknown;
36
- }, "class">;
37
41
  ui: import("vue").ComputedRef<any>;
42
+ attrs: import("vue").ComputedRef<Pick<{
43
+ [x: string]: unknown;
44
+ }, string>>;
45
+ name: import("vue").ComputedRef<string | undefined>;
46
+ inputId: import("vue").Ref<string | undefined>;
38
47
  active: import("vue").WritableComputedRef<boolean>;
39
48
  switchClass: import("vue").ComputedRef<string>;
40
49
  onIconClass: import("vue").ComputedRef<string>;
41
50
  offIconClass: import("vue").ComputedRef<string>;
42
51
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
52
+ id: {
53
+ type: StringConstructor;
54
+ default: null;
55
+ };
43
56
  name: {
44
57
  type: StringConstructor;
45
58
  default: null;
@@ -61,20 +74,26 @@ declare const _default: import("vue").DefineComponent<{
61
74
  default: () => any;
62
75
  };
63
76
  color: {
64
- type: StringConstructor;
77
+ type: PropType<any>;
65
78
  default: () => any;
66
79
  validator(value: string): any;
67
80
  };
68
- ui: {
81
+ class: {
69
82
  type: PropType<any>;
70
- default: () => {};
83
+ default: undefined;
84
+ };
85
+ ui: {
86
+ type: PropType<Partial<any>>;
87
+ default: undefined;
71
88
  };
72
89
  }>> & {
73
90
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
74
91
  }, {
75
- color: string;
76
- ui: any;
92
+ id: string;
93
+ color: any;
94
+ ui: Partial<any>;
77
95
  name: string;
96
+ class: any;
78
97
  modelValue: boolean;
79
98
  disabled: boolean;
80
99
  onIcon: string;
@@ -17,11 +17,13 @@
17
17
  </template>
18
18
 
19
19
  <script>
20
- import { computed, defineComponent } from "vue";
21
- import { omit } from "lodash-es";
20
+ import { computed, toRef, defineComponent } from "vue";
22
21
  import { twMerge, twJoin } from "tailwind-merge";
23
- import { defuTwMerge } from "../../utils";
24
- import { useAppConfig } from "#imports";
22
+ import { useUI } from "../../composables/useUI";
23
+ import { mergeConfig } from "../../utils";
24
+ import appConfig from "#build/app.config";
25
+ import { card } from "#ui/ui.config";
26
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.card, card);
25
27
  export default defineComponent({
26
28
  inheritAttrs: false,
27
29
  props: {
@@ -29,14 +31,17 @@ export default defineComponent({
29
31
  type: String,
30
32
  default: "div"
31
33
  },
34
+ class: {
35
+ type: [String, Object, Array],
36
+ default: void 0
37
+ },
32
38
  ui: {
33
39
  type: Object,
34
- default: () => ({})
40
+ default: void 0
35
41
  }
36
42
  },
37
- setup(props, { attrs }) {
38
- const appConfig2 = useAppConfig();
39
- const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.card));
43
+ setup(props) {
44
+ const { ui, attrs } = useUI("card", toRef(props, "ui"), config);
40
45
  const cardClass = computed(() => {
41
46
  return twMerge(twJoin(
42
47
  ui.value.base,
@@ -45,12 +50,12 @@ export default defineComponent({
45
50
  ui.value.ring,
46
51
  ui.value.shadow,
47
52
  ui.value.background
48
- ), attrs.class);
53
+ ), props.class);
49
54
  });
50
55
  return {
51
- attrs: omit(attrs, ["class"]),
52
56
  // eslint-disable-next-line vue/no-dupe-keys
53
57
  ui,
58
+ attrs,
54
59
  cardClass
55
60
  };
56
61
  }
@@ -1,31 +1,39 @@
1
- /// <reference types="lodash" />
2
1
  import type { PropType } from 'vue';
3
2
  declare const _default: import("vue").DefineComponent<{
4
3
  as: {
5
4
  type: StringConstructor;
6
5
  default: string;
7
6
  };
8
- ui: {
7
+ class: {
9
8
  type: PropType<any>;
10
- default: () => {};
9
+ default: undefined;
10
+ };
11
+ ui: {
12
+ type: PropType<Partial<any>>;
13
+ default: undefined;
11
14
  };
12
15
  }, {
13
- attrs: import("lodash").Omit<{
14
- [x: string]: unknown;
15
- }, "class">;
16
16
  ui: import("vue").ComputedRef<any>;
17
+ attrs: import("vue").ComputedRef<Pick<{
18
+ [x: string]: unknown;
19
+ }, string>>;
17
20
  cardClass: import("vue").ComputedRef<string>;
18
21
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
19
22
  as: {
20
23
  type: StringConstructor;
21
24
  default: string;
22
25
  };
23
- ui: {
26
+ class: {
24
27
  type: PropType<any>;
25
- default: () => {};
28
+ default: undefined;
29
+ };
30
+ ui: {
31
+ type: PropType<Partial<any>>;
32
+ default: undefined;
26
33
  };
27
34
  }>>, {
28
- ui: any;
35
+ ui: Partial<any>;
36
+ class: any;
29
37
  as: string;
30
38
  }, {}>;
31
39
  export default _default;
@@ -5,11 +5,13 @@
5
5
  </template>
6
6
 
7
7
  <script>
8
- import { computed, defineComponent } from "vue";
9
- import { omit } from "lodash-es";
8
+ import { computed, toRef, defineComponent } from "vue";
10
9
  import { twMerge, twJoin } from "tailwind-merge";
11
- import { defuTwMerge } from "../../utils";
12
- import { useAppConfig } from "#imports";
10
+ import { useUI } from "../../composables/useUI";
11
+ import { mergeConfig } from "../../utils";
12
+ import appConfig from "#build/app.config";
13
+ import { container } from "#ui/ui.config";
14
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.container, container);
13
15
  export default defineComponent({
14
16
  inheritAttrs: false,
15
17
  props: {
@@ -17,25 +19,28 @@ export default defineComponent({
17
19
  type: String,
18
20
  default: "div"
19
21
  },
22
+ class: {
23
+ type: [String, Object, Array],
24
+ default: void 0
25
+ },
20
26
  ui: {
21
27
  type: Object,
22
- default: () => ({})
28
+ default: void 0
23
29
  }
24
30
  },
25
- setup(props, { attrs }) {
26
- const appConfig2 = useAppConfig();
27
- const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.container));
31
+ setup(props) {
32
+ const { ui, attrs } = useUI("container", toRef(props, "ui"), config);
28
33
  const containerClass = computed(() => {
29
34
  return twMerge(twJoin(
30
35
  ui.value.base,
31
36
  ui.value.padding,
32
37
  ui.value.constrained
33
- ), attrs.class);
38
+ ), props.class);
34
39
  });
35
40
  return {
36
- attrs: omit(attrs, ["class"]),
37
41
  // eslint-disable-next-line vue/no-dupe-keys
38
42
  ui,
43
+ attrs,
39
44
  containerClass
40
45
  };
41
46
  }
@@ -1,31 +1,39 @@
1
- /// <reference types="lodash" />
2
1
  import type { PropType } from 'vue';
3
2
  declare const _default: import("vue").DefineComponent<{
4
3
  as: {
5
4
  type: StringConstructor;
6
5
  default: string;
7
6
  };
8
- ui: {
7
+ class: {
9
8
  type: PropType<any>;
10
- default: () => {};
9
+ default: undefined;
10
+ };
11
+ ui: {
12
+ type: PropType<Partial<any>>;
13
+ default: undefined;
11
14
  };
12
15
  }, {
13
- attrs: import("lodash").Omit<{
14
- [x: string]: unknown;
15
- }, "class">;
16
16
  ui: import("vue").ComputedRef<any>;
17
+ attrs: import("vue").ComputedRef<Pick<{
18
+ [x: string]: unknown;
19
+ }, string>>;
17
20
  containerClass: import("vue").ComputedRef<string>;
18
21
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
19
22
  as: {
20
23
  type: StringConstructor;
21
24
  default: string;
22
25
  };
23
- ui: {
26
+ class: {
24
27
  type: PropType<any>;
25
- default: () => {};
28
+ default: undefined;
29
+ };
30
+ ui: {
31
+ type: PropType<Partial<any>>;
32
+ default: undefined;
26
33
  };
27
34
  }>>, {
28
- ui: any;
35
+ ui: Partial<any>;
36
+ class: any;
29
37
  as: string;
30
38
  }, {}>;
31
39
  export default _default;
@@ -0,0 +1,107 @@
1
+ <template>
2
+ <div :class="wrapperClass" v-bind="attrs">
3
+ <div :class="borderClass" />
4
+
5
+ <template v-if="label || icon || avatar || $slots.default">
6
+ <div :class="containerClass">
7
+ <slot>
8
+ <span v-if="label" :class="ui.label">
9
+ {{ label }}
10
+ </span>
11
+ <UIcon v-else-if="icon" :name="icon" :class="ui.icon.base" />
12
+ <UAvatar v-else-if="avatar" v-bind="{ size: ui.avatar.size, ...avatar }" :class="ui.avatar.base" />
13
+ </slot>
14
+ </div>
15
+
16
+ <div :class="borderClass" />
17
+ </template>
18
+ </div>
19
+ </template>
20
+
21
+ <script>
22
+ import { toRef, computed, defineComponent } from "vue";
23
+ import { twMerge, twJoin } from "tailwind-merge";
24
+ import UIcon from "../elements/Icon.vue";
25
+ import UAvatar from "../elements/Avatar.vue";
26
+ import { useUI } from "../../composables/useUI";
27
+ import { mergeConfig } from "../../utils";
28
+ import appConfig from "#build/app.config";
29
+ import { divider } from "#ui/ui.config";
30
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.divider, divider);
31
+ export default defineComponent({
32
+ components: {
33
+ UIcon,
34
+ UAvatar
35
+ },
36
+ inheritAttrs: false,
37
+ props: {
38
+ label: {
39
+ type: String,
40
+ default: null
41
+ },
42
+ icon: {
43
+ type: String,
44
+ default: null
45
+ },
46
+ avatar: {
47
+ type: Object,
48
+ default: null
49
+ },
50
+ orientation: {
51
+ type: String,
52
+ default: "horizontal",
53
+ validator: (value) => ["horizontal", "vertical"].includes(value)
54
+ },
55
+ type: {
56
+ type: String,
57
+ default: "solid",
58
+ validator: (value) => ["solid", "dotted", "dashed"].includes(value)
59
+ },
60
+ class: {
61
+ type: [String, Object, Array],
62
+ default: void 0
63
+ },
64
+ ui: {
65
+ type: Object,
66
+ default: void 0
67
+ }
68
+ },
69
+ setup(props) {
70
+ const { ui, attrs } = useUI("divider", toRef(props, "ui"), config);
71
+ const isHorizontal = computed(() => props.orientation === "horizontal");
72
+ const wrapperClass = computed(() => {
73
+ return twMerge(twJoin(
74
+ ui.value.wrapper.base,
75
+ isHorizontal.value ? ui.value.wrapper.horizontal : ui.value.wrapper.vertical
76
+ ), props.class);
77
+ });
78
+ const containerClass = computed(() => {
79
+ return twJoin(
80
+ ui.value.container.base,
81
+ isHorizontal.value ? ui.value.container.horizontal : ui.value.container.vertical
82
+ );
83
+ });
84
+ const borderClass = computed(() => {
85
+ const typeClass = {
86
+ solid: "border-solid",
87
+ dotted: "border-dotted",
88
+ dashed: "border-dashed"
89
+ }[props.type];
90
+ return twJoin(
91
+ ui.value.border.base,
92
+ isHorizontal.value ? ui.value.border.horizontal : ui.value.border.vertical,
93
+ isHorizontal.value ? ui.value.border.size.horizontal : ui.value.border.size.vertical,
94
+ typeClass
95
+ );
96
+ });
97
+ return {
98
+ // eslint-disable-next-line vue/no-dupe-keys
99
+ ui,
100
+ attrs,
101
+ wrapperClass,
102
+ containerClass,
103
+ borderClass
104
+ };
105
+ }
106
+ });
107
+ </script>
@@ -0,0 +1,82 @@
1
+ import type { PropType } from 'vue';
2
+ import type { Avatar } from '../../types';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ label: {
5
+ type: StringConstructor;
6
+ default: null;
7
+ };
8
+ icon: {
9
+ type: StringConstructor;
10
+ default: null;
11
+ };
12
+ avatar: {
13
+ type: PropType<Avatar>;
14
+ default: null;
15
+ };
16
+ orientation: {
17
+ type: PropType<"horizontal" | "vertical">;
18
+ default: string;
19
+ validator: (value: string) => boolean;
20
+ };
21
+ type: {
22
+ type: PropType<"solid" | "dotted" | "dashed">;
23
+ default: string;
24
+ validator: (value: string) => boolean;
25
+ };
26
+ class: {
27
+ type: PropType<any>;
28
+ default: undefined;
29
+ };
30
+ ui: {
31
+ type: PropType<Partial<any>>;
32
+ default: undefined;
33
+ };
34
+ }, {
35
+ ui: import("vue").ComputedRef<any>;
36
+ attrs: import("vue").ComputedRef<Pick<{
37
+ [x: string]: unknown;
38
+ }, string>>;
39
+ wrapperClass: import("vue").ComputedRef<string>;
40
+ containerClass: import("vue").ComputedRef<string>;
41
+ 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<{
43
+ label: {
44
+ type: StringConstructor;
45
+ default: null;
46
+ };
47
+ icon: {
48
+ type: StringConstructor;
49
+ default: null;
50
+ };
51
+ avatar: {
52
+ type: PropType<Avatar>;
53
+ default: null;
54
+ };
55
+ orientation: {
56
+ type: PropType<"horizontal" | "vertical">;
57
+ default: string;
58
+ validator: (value: string) => boolean;
59
+ };
60
+ type: {
61
+ type: PropType<"solid" | "dotted" | "dashed">;
62
+ default: string;
63
+ validator: (value: string) => boolean;
64
+ };
65
+ class: {
66
+ type: PropType<any>;
67
+ default: undefined;
68
+ };
69
+ ui: {
70
+ type: PropType<Partial<any>>;
71
+ default: undefined;
72
+ };
73
+ }>>, {
74
+ icon: string;
75
+ avatar: Avatar;
76
+ ui: Partial<any>;
77
+ class: any;
78
+ label: string;
79
+ type: "solid" | "dotted" | "dashed";
80
+ orientation: "horizontal" | "vertical";
81
+ }, {}>;
82
+ export default _default;
@@ -3,33 +3,38 @@
3
3
  </template>
4
4
 
5
5
  <script>
6
- import { computed, defineComponent } from "vue";
7
- import { omit } from "lodash-es";
6
+ import { computed, toRef, defineComponent } from "vue";
8
7
  import { twMerge, twJoin } from "tailwind-merge";
9
- import { defuTwMerge } from "../../utils";
10
- import { useAppConfig } from "#imports";
8
+ import { useUI } from "../../composables/useUI";
9
+ import { mergeConfig } from "../../utils";
10
+ import appConfig from "#build/app.config";
11
+ import { skeleton } from "#ui/ui.config";
12
+ const config = mergeConfig(appConfig.ui.strategy, appConfig.ui.skeleton, skeleton);
11
13
  export default defineComponent({
12
14
  inheritAttrs: false,
13
15
  props: {
16
+ class: {
17
+ type: [String, Object, Array],
18
+ default: void 0
19
+ },
14
20
  ui: {
15
21
  type: Object,
16
- default: () => ({})
22
+ default: void 0
17
23
  }
18
24
  },
19
- setup(props, { attrs }) {
20
- const appConfig2 = useAppConfig();
21
- const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.skeleton));
25
+ setup(props) {
26
+ const { ui, attrs } = useUI("skeleton", toRef(props, "ui"), config);
22
27
  const skeletonClass = computed(() => {
23
28
  return twMerge(twJoin(
24
29
  ui.value.base,
25
30
  ui.value.background,
26
31
  ui.value.rounded
27
- ), attrs.class);
32
+ ), props.class);
28
33
  });
29
34
  return {
30
- attrs: omit(attrs, ["class"]),
31
35
  // eslint-disable-next-line vue/no-dupe-keys
32
36
  ui,
37
+ attrs,
33
38
  skeletonClass
34
39
  };
35
40
  }
@@ -1,22 +1,30 @@
1
- /// <reference types="lodash" />
2
1
  import type { PropType } from 'vue';
3
2
  declare const _default: import("vue").DefineComponent<{
4
- ui: {
3
+ class: {
5
4
  type: PropType<any>;
6
- default: () => {};
5
+ default: undefined;
6
+ };
7
+ ui: {
8
+ type: PropType<Partial<any>>;
9
+ default: undefined;
7
10
  };
8
11
  }, {
9
- attrs: import("lodash").Omit<{
10
- [x: string]: unknown;
11
- }, "class">;
12
12
  ui: import("vue").ComputedRef<any>;
13
+ attrs: import("vue").ComputedRef<Pick<{
14
+ [x: string]: unknown;
15
+ }, string>>;
13
16
  skeletonClass: import("vue").ComputedRef<string>;
14
17
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
15
- ui: {
18
+ class: {
16
19
  type: PropType<any>;
17
- default: () => {};
20
+ default: undefined;
21
+ };
22
+ ui: {
23
+ type: PropType<Partial<any>>;
24
+ default: undefined;
18
25
  };
19
26
  }>>, {
20
- ui: any;
27
+ ui: Partial<any>;
28
+ class: any;
21
29
  }, {}>;
22
30
  export default _default;