@nuxt/ui 0.4.1 → 2.8.1
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.
- package/LICENSE.md +9 -0
- package/README.md +63 -50
- package/dist/module.cjs +5 -0
- package/dist/module.d.mts +1234 -0
- package/dist/module.d.ts +1234 -0
- package/dist/module.json +8 -0
- package/dist/module.mjs +407 -0
- package/dist/runtime/app.config.d.ts +1203 -0
- package/dist/runtime/app.config.mjs +1057 -0
- package/dist/runtime/components/data/Table.vue +251 -0
- package/dist/runtime/components/data/Table.vue.d.ts +215 -0
- package/dist/runtime/components/elements/Accordion.vue +138 -0
- package/dist/runtime/components/elements/Accordion.vue.d.ts +80 -0
- package/dist/runtime/components/elements/Alert.vue +120 -0
- package/dist/runtime/components/elements/Alert.vue.d.ts +107 -0
- package/dist/runtime/components/elements/Avatar.vue +149 -0
- package/dist/runtime/components/elements/Avatar.vue.d.ts +115 -0
- package/dist/runtime/components/elements/AvatarGroup.d.ts +37 -0
- package/dist/runtime/components/elements/AvatarGroup.mjs +53 -0
- package/dist/runtime/components/elements/Badge.vue +69 -0
- package/dist/runtime/components/elements/Badge.vue.d.ts +63 -0
- package/dist/runtime/components/elements/Button.vue +182 -0
- package/dist/runtime/components/elements/Button.vue.d.ts +187 -0
- package/dist/runtime/components/elements/ButtonGroup.d.ts +39 -0
- package/dist/runtime/components/elements/ButtonGroup.mjs +70 -0
- package/dist/runtime/components/elements/Dropdown.vue +172 -0
- package/dist/runtime/components/elements/Dropdown.vue.d.ts +96 -0
- package/dist/runtime/components/elements/Icon.vue +15 -0
- package/dist/runtime/components/elements/Icon.vue.d.ts +12 -0
- package/dist/runtime/components/elements/Kbd.vue +55 -0
- package/dist/runtime/components/elements/Kbd.vue.d.ts +42 -0
- package/dist/runtime/components/elements/Link.vue +80 -0
- package/dist/runtime/components/elements/Link.vue.d.ts +9 -0
- package/dist/runtime/components/forms/Checkbox.vue +136 -0
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +129 -0
- package/dist/runtime/components/forms/Form.vue +185 -0
- package/dist/runtime/components/forms/Form.vue.d.ts +50 -0
- package/dist/runtime/components/forms/FormGroup.vue +97 -0
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +98 -0
- package/dist/runtime/components/forms/Input.vue +250 -0
- package/dist/runtime/components/forms/Input.vue.d.ts +214 -0
- package/dist/runtime/components/forms/Radio.vue +122 -0
- package/dist/runtime/components/forms/Radio.vue.d.ts +109 -0
- package/dist/runtime/components/forms/Range.vue +163 -0
- package/dist/runtime/components/forms/Range.vue.d.ts +119 -0
- package/dist/runtime/components/forms/Select.vue +307 -0
- package/dist/runtime/components/forms/Select.vue.d.ts +229 -0
- package/dist/runtime/components/forms/SelectMenu.vue +429 -0
- package/dist/runtime/components/forms/SelectMenu.vue.d.ts +330 -0
- package/dist/runtime/components/forms/Textarea.vue +184 -0
- package/dist/runtime/components/forms/Textarea.vue.d.ts +161 -0
- package/dist/runtime/components/forms/Toggle.vue +113 -0
- package/dist/runtime/components/forms/Toggle.vue.d.ts +83 -0
- package/dist/runtime/components/layout/Card.vue +58 -0
- package/dist/runtime/components/layout/Card.vue.d.ts +31 -0
- package/dist/runtime/components/layout/Container.vue +43 -0
- package/dist/runtime/components/layout/Container.vue.d.ts +31 -0
- package/dist/runtime/components/layout/Skeleton.vue +37 -0
- package/dist/runtime/components/layout/Skeleton.vue.d.ts +22 -0
- package/dist/runtime/components/navigation/CommandPalette.vue +304 -0
- package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +224 -0
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue +152 -0
- package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +63 -0
- package/dist/runtime/components/navigation/Pagination.vue +197 -0
- package/dist/runtime/components/navigation/Pagination.vue.d.ts +125 -0
- package/dist/runtime/components/navigation/Tabs.vue +138 -0
- package/dist/runtime/components/navigation/Tabs.vue.d.ts +69 -0
- package/dist/runtime/components/navigation/VerticalNavigation.vue +79 -0
- package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +37 -0
- package/dist/runtime/components/overlays/ContextMenu.vue +74 -0
- package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +54 -0
- package/dist/runtime/components/overlays/Modal.vue +113 -0
- package/dist/runtime/components/overlays/Modal.vue.d.ts +82 -0
- package/dist/runtime/components/overlays/Notification.vue +197 -0
- package/dist/runtime/components/overlays/Notification.vue.d.ts +126 -0
- package/dist/runtime/components/overlays/Notifications.vue +61 -0
- package/dist/runtime/components/overlays/Notifications.vue.d.ts +41 -0
- package/dist/runtime/components/overlays/Popover.vue +139 -0
- package/dist/runtime/components/overlays/Popover.vue.d.ts +82 -0
- package/dist/runtime/components/overlays/Slideover.vue +103 -0
- package/dist/runtime/components/overlays/Slideover.vue.d.ts +84 -0
- package/dist/runtime/components/overlays/Tooltip.vue +118 -0
- package/dist/runtime/components/overlays/Tooltip.vue.d.ts +82 -0
- package/dist/runtime/composables/defineShortcuts.d.ts +13 -0
- package/dist/runtime/composables/defineShortcuts.mjs +108 -0
- package/dist/runtime/composables/useCopyToClipboard.d.ts +10 -0
- package/dist/runtime/composables/useCopyToClipboard.mjs +26 -0
- package/dist/runtime/composables/useFormGroup.d.ts +6 -0
- package/dist/runtime/composables/useFormGroup.mjs +30 -0
- package/dist/runtime/composables/usePopper.d.ts +232 -0
- package/dist/runtime/composables/usePopper.mjs +78 -0
- package/dist/runtime/composables/useShortcuts.d.ts +12 -0
- package/dist/runtime/composables/useShortcuts.mjs +24 -0
- package/dist/runtime/composables/useTimer.d.ts +8 -0
- package/dist/runtime/composables/useTimer.mjs +51 -0
- package/dist/runtime/composables/useToast.d.ts +18 -0
- package/dist/runtime/composables/useToast.mjs +22 -0
- package/dist/runtime/plugins/colors.d.ts +2 -0
- package/dist/runtime/plugins/colors.mjs +46 -0
- package/dist/runtime/types/accordion.d.ts +9 -0
- package/dist/runtime/types/avatar.d.ts +9 -0
- package/dist/runtime/types/button.d.ts +23 -0
- package/dist/runtime/types/clipboard.d.ts +3 -0
- package/dist/runtime/types/command-palette.d.ts +26 -0
- package/dist/runtime/types/dropdown.d.ts +13 -0
- package/dist/runtime/types/form.d.ts +21 -0
- package/dist/runtime/types/index.d.ts +12 -0
- package/dist/runtime/types/link.d.ts +8 -0
- package/dist/runtime/types/notification.d.ts +22 -0
- package/dist/runtime/types/popper.d.ts +14 -0
- package/dist/runtime/types/tabs.d.ts +6 -0
- package/dist/runtime/types/vertical-navigation.d.ts +11 -0
- package/dist/runtime/ui.css +13 -0
- package/dist/runtime/utils/StateEmitter.d.ts +17 -0
- package/dist/runtime/utils/StateEmitter.mjs +21 -0
- package/dist/runtime/utils/index.d.ts +11 -0
- package/dist/runtime/utils/index.mjs +33 -0
- package/dist/types.d.mts +15 -0
- package/dist/types.d.ts +15 -0
- package/package.json +56 -39
- package/LICENSE +0 -21
- package/dist/assets/styles.css +0 -14
- package/dist/components/NButton.vue +0 -22
- package/dist/components/NCard.vue +0 -5
- package/dist/components/NCheckbox.vue +0 -35
- package/dist/components/NDarkToggle.vue +0 -28
- package/dist/components/NDialog.vue +0 -59
- package/dist/components/NDropdown.vue +0 -31
- package/dist/components/NIcon.vue +0 -9
- package/dist/components/NLink.vue +0 -20
- package/dist/components/NRadio.vue +0 -40
- package/dist/components/NSwitch.vue +0 -37
- package/dist/components/NTextInput.vue +0 -34
- package/dist/components/NTip.vue +0 -16
- package/dist/components/NuxtContentLogo.vue +0 -7
- package/dist/components/NuxtExampleLayout.vue +0 -82
- package/dist/components/NuxtLogo.vue +0 -20
- package/dist/components/nuxt/NDarkToggle.vue +0 -28
- package/dist/nuxt.d.ts +0 -16
- package/dist/nuxt.mjs +0 -36
- package/dist/unocss.d.ts +0 -7
- package/dist/unocss.mjs +0 -127
- package/nuxt.cjs +0 -7
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<HSwitch
|
|
3
|
+
v-model="active"
|
|
4
|
+
:name="name"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:class="switchClass"
|
|
7
|
+
v-bind="attrs"
|
|
8
|
+
>
|
|
9
|
+
<span :class="[active ? ui.container.active : ui.container.inactive, ui.container.base]">
|
|
10
|
+
<span v-if="onIcon" :class="[active ? ui.icon.active : ui.icon.inactive, ui.icon.base]" aria-hidden="true">
|
|
11
|
+
<UIcon :name="onIcon" :class="onIconClass" />
|
|
12
|
+
</span>
|
|
13
|
+
<span v-if="offIcon" :class="[active ? ui.icon.inactive : ui.icon.active, ui.icon.base]" aria-hidden="true">
|
|
14
|
+
<UIcon :name="offIcon" :class="offIconClass" />
|
|
15
|
+
</span>
|
|
16
|
+
</span>
|
|
17
|
+
</HSwitch>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import { computed, defineComponent } from "vue";
|
|
22
|
+
import { Switch as HSwitch } from "@headlessui/vue";
|
|
23
|
+
import { omit } from "lodash-es";
|
|
24
|
+
import { twMerge, twJoin } from "tailwind-merge";
|
|
25
|
+
import UIcon from "../elements/Icon.vue";
|
|
26
|
+
import { defuTwMerge } from "../../utils";
|
|
27
|
+
import { useFormGroup } from "../../composables/useFormGroup";
|
|
28
|
+
import { useAppConfig } from "#imports";
|
|
29
|
+
import appConfig from "#build/app.config";
|
|
30
|
+
export default defineComponent({
|
|
31
|
+
components: {
|
|
32
|
+
HSwitch,
|
|
33
|
+
UIcon
|
|
34
|
+
},
|
|
35
|
+
inheritAttrs: false,
|
|
36
|
+
props: {
|
|
37
|
+
name: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: null
|
|
40
|
+
},
|
|
41
|
+
modelValue: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
disabled: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: false
|
|
48
|
+
},
|
|
49
|
+
onIcon: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: () => appConfig.ui.toggle.default.onIcon
|
|
52
|
+
},
|
|
53
|
+
offIcon: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: () => appConfig.ui.toggle.default.offIcon
|
|
56
|
+
},
|
|
57
|
+
color: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: () => appConfig.ui.toggle.default.color,
|
|
60
|
+
validator(value) {
|
|
61
|
+
return appConfig.ui.colors.includes(value);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
ui: {
|
|
65
|
+
type: Object,
|
|
66
|
+
default: () => ({})
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
emits: ["update:modelValue"],
|
|
70
|
+
setup(props, { emit, attrs }) {
|
|
71
|
+
const appConfig2 = useAppConfig();
|
|
72
|
+
const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.toggle));
|
|
73
|
+
const { emitFormChange, formGroup } = useFormGroup();
|
|
74
|
+
const color = computed(() => formGroup?.error?.value ? "red" : props.color);
|
|
75
|
+
const active = computed({
|
|
76
|
+
get() {
|
|
77
|
+
return props.modelValue;
|
|
78
|
+
},
|
|
79
|
+
set(value) {
|
|
80
|
+
emit("update:modelValue", value);
|
|
81
|
+
emitFormChange();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
const switchClass = computed(() => {
|
|
85
|
+
return twMerge(twJoin(
|
|
86
|
+
ui.value.base,
|
|
87
|
+
ui.value.rounded,
|
|
88
|
+
ui.value.ring.replaceAll("{color}", color.value),
|
|
89
|
+
(active.value ? ui.value.active : ui.value.inactive).replaceAll("{color}", color.value)
|
|
90
|
+
), attrs.class);
|
|
91
|
+
});
|
|
92
|
+
const onIconClass = computed(() => {
|
|
93
|
+
return twJoin(
|
|
94
|
+
ui.value.icon.on.replaceAll("{color}", color.value)
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
const offIconClass = computed(() => {
|
|
98
|
+
return twJoin(
|
|
99
|
+
ui.value.icon.off.replaceAll("{color}", color.value)
|
|
100
|
+
);
|
|
101
|
+
});
|
|
102
|
+
return {
|
|
103
|
+
attrs: omit(attrs, ["class"]),
|
|
104
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
105
|
+
ui,
|
|
106
|
+
active,
|
|
107
|
+
switchClass,
|
|
108
|
+
onIconClass,
|
|
109
|
+
offIconClass
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
</script>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
name: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: null;
|
|
7
|
+
};
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
disabled: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
onIcon: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: () => any;
|
|
19
|
+
};
|
|
20
|
+
offIcon: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: () => any;
|
|
23
|
+
};
|
|
24
|
+
color: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: () => any;
|
|
27
|
+
validator(value: string): any;
|
|
28
|
+
};
|
|
29
|
+
ui: {
|
|
30
|
+
type: PropType<any>;
|
|
31
|
+
default: () => {};
|
|
32
|
+
};
|
|
33
|
+
}, {
|
|
34
|
+
attrs: import("lodash").Omit<{
|
|
35
|
+
[x: string]: unknown;
|
|
36
|
+
}, "class">;
|
|
37
|
+
ui: import("vue").ComputedRef<any>;
|
|
38
|
+
active: import("vue").WritableComputedRef<boolean>;
|
|
39
|
+
switchClass: import("vue").ComputedRef<string>;
|
|
40
|
+
onIconClass: import("vue").ComputedRef<string>;
|
|
41
|
+
offIconClass: import("vue").ComputedRef<string>;
|
|
42
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
43
|
+
name: {
|
|
44
|
+
type: StringConstructor;
|
|
45
|
+
default: null;
|
|
46
|
+
};
|
|
47
|
+
modelValue: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
51
|
+
disabled: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
onIcon: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: () => any;
|
|
58
|
+
};
|
|
59
|
+
offIcon: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: () => any;
|
|
62
|
+
};
|
|
63
|
+
color: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: () => any;
|
|
66
|
+
validator(value: string): any;
|
|
67
|
+
};
|
|
68
|
+
ui: {
|
|
69
|
+
type: PropType<any>;
|
|
70
|
+
default: () => {};
|
|
71
|
+
};
|
|
72
|
+
}>> & {
|
|
73
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
74
|
+
}, {
|
|
75
|
+
color: string;
|
|
76
|
+
ui: any;
|
|
77
|
+
name: string;
|
|
78
|
+
modelValue: boolean;
|
|
79
|
+
disabled: boolean;
|
|
80
|
+
onIcon: string;
|
|
81
|
+
offIcon: string;
|
|
82
|
+
}, {}>;
|
|
83
|
+
export default _default;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="$attrs.onSubmit ? 'form' : as"
|
|
4
|
+
:class="cardClass"
|
|
5
|
+
v-bind="attrs"
|
|
6
|
+
>
|
|
7
|
+
<div v-if="$slots.header" :class="[ui.header.base, ui.header.padding, ui.header.background]">
|
|
8
|
+
<slot name="header" />
|
|
9
|
+
</div>
|
|
10
|
+
<div :class="[ui.body.base, ui.body.padding, ui.body.background]">
|
|
11
|
+
<slot />
|
|
12
|
+
</div>
|
|
13
|
+
<div v-if="$slots.footer" :class="[ui.footer.base, ui.footer.padding, ui.footer.background]">
|
|
14
|
+
<slot name="footer" />
|
|
15
|
+
</div>
|
|
16
|
+
</component>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import { computed, defineComponent } from "vue";
|
|
21
|
+
import { omit } from "lodash-es";
|
|
22
|
+
import { twMerge, twJoin } from "tailwind-merge";
|
|
23
|
+
import { defuTwMerge } from "../../utils";
|
|
24
|
+
import { useAppConfig } from "#imports";
|
|
25
|
+
export default defineComponent({
|
|
26
|
+
inheritAttrs: false,
|
|
27
|
+
props: {
|
|
28
|
+
as: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "div"
|
|
31
|
+
},
|
|
32
|
+
ui: {
|
|
33
|
+
type: Object,
|
|
34
|
+
default: () => ({})
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
setup(props, { attrs }) {
|
|
38
|
+
const appConfig2 = useAppConfig();
|
|
39
|
+
const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.card));
|
|
40
|
+
const cardClass = computed(() => {
|
|
41
|
+
return twMerge(twJoin(
|
|
42
|
+
ui.value.base,
|
|
43
|
+
ui.value.rounded,
|
|
44
|
+
ui.value.divide,
|
|
45
|
+
ui.value.ring,
|
|
46
|
+
ui.value.shadow,
|
|
47
|
+
ui.value.background
|
|
48
|
+
), attrs.class);
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
attrs: omit(attrs, ["class"]),
|
|
52
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
53
|
+
ui,
|
|
54
|
+
cardClass
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
as: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
ui: {
|
|
9
|
+
type: PropType<any>;
|
|
10
|
+
default: () => {};
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
attrs: import("lodash").Omit<{
|
|
14
|
+
[x: string]: unknown;
|
|
15
|
+
}, "class">;
|
|
16
|
+
ui: import("vue").ComputedRef<any>;
|
|
17
|
+
cardClass: import("vue").ComputedRef<string>;
|
|
18
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
as: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
ui: {
|
|
24
|
+
type: PropType<any>;
|
|
25
|
+
default: () => {};
|
|
26
|
+
};
|
|
27
|
+
}>>, {
|
|
28
|
+
ui: any;
|
|
29
|
+
as: string;
|
|
30
|
+
}, {}>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="as" :class="containerClass" v-bind="attrs">
|
|
3
|
+
<slot />
|
|
4
|
+
</component>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { computed, defineComponent } from "vue";
|
|
9
|
+
import { omit } from "lodash-es";
|
|
10
|
+
import { twMerge, twJoin } from "tailwind-merge";
|
|
11
|
+
import { defuTwMerge } from "../../utils";
|
|
12
|
+
import { useAppConfig } from "#imports";
|
|
13
|
+
export default defineComponent({
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
props: {
|
|
16
|
+
as: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "div"
|
|
19
|
+
},
|
|
20
|
+
ui: {
|
|
21
|
+
type: Object,
|
|
22
|
+
default: () => ({})
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
setup(props, { attrs }) {
|
|
26
|
+
const appConfig2 = useAppConfig();
|
|
27
|
+
const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.container));
|
|
28
|
+
const containerClass = computed(() => {
|
|
29
|
+
return twMerge(twJoin(
|
|
30
|
+
ui.value.base,
|
|
31
|
+
ui.value.padding,
|
|
32
|
+
ui.value.constrained
|
|
33
|
+
), attrs.class);
|
|
34
|
+
});
|
|
35
|
+
return {
|
|
36
|
+
attrs: omit(attrs, ["class"]),
|
|
37
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
38
|
+
ui,
|
|
39
|
+
containerClass
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
</script>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
as: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
ui: {
|
|
9
|
+
type: PropType<any>;
|
|
10
|
+
default: () => {};
|
|
11
|
+
};
|
|
12
|
+
}, {
|
|
13
|
+
attrs: import("lodash").Omit<{
|
|
14
|
+
[x: string]: unknown;
|
|
15
|
+
}, "class">;
|
|
16
|
+
ui: import("vue").ComputedRef<any>;
|
|
17
|
+
containerClass: import("vue").ComputedRef<string>;
|
|
18
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
as: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
ui: {
|
|
24
|
+
type: PropType<any>;
|
|
25
|
+
default: () => {};
|
|
26
|
+
};
|
|
27
|
+
}>>, {
|
|
28
|
+
ui: any;
|
|
29
|
+
as: string;
|
|
30
|
+
}, {}>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="skeletonClass" v-bind="attrs" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import { computed, defineComponent } from "vue";
|
|
7
|
+
import { omit } from "lodash-es";
|
|
8
|
+
import { twMerge, twJoin } from "tailwind-merge";
|
|
9
|
+
import { defuTwMerge } from "../../utils";
|
|
10
|
+
import { useAppConfig } from "#imports";
|
|
11
|
+
export default defineComponent({
|
|
12
|
+
inheritAttrs: false,
|
|
13
|
+
props: {
|
|
14
|
+
ui: {
|
|
15
|
+
type: Object,
|
|
16
|
+
default: () => ({})
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(props, { attrs }) {
|
|
20
|
+
const appConfig2 = useAppConfig();
|
|
21
|
+
const ui = computed(() => defuTwMerge({}, props.ui, appConfig2.ui.skeleton));
|
|
22
|
+
const skeletonClass = computed(() => {
|
|
23
|
+
return twMerge(twJoin(
|
|
24
|
+
ui.value.base,
|
|
25
|
+
ui.value.background,
|
|
26
|
+
ui.value.rounded
|
|
27
|
+
), attrs.class);
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
attrs: omit(attrs, ["class"]),
|
|
31
|
+
// eslint-disable-next-line vue/no-dupe-keys
|
|
32
|
+
ui,
|
|
33
|
+
skeletonClass
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="lodash" />
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
ui: {
|
|
5
|
+
type: PropType<any>;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
attrs: import("lodash").Omit<{
|
|
10
|
+
[x: string]: unknown;
|
|
11
|
+
}, "class">;
|
|
12
|
+
ui: import("vue").ComputedRef<any>;
|
|
13
|
+
skeletonClass: import("vue").ComputedRef<string>;
|
|
14
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
|
+
ui: {
|
|
16
|
+
type: PropType<any>;
|
|
17
|
+
default: () => {};
|
|
18
|
+
};
|
|
19
|
+
}>>, {
|
|
20
|
+
ui: any;
|
|
21
|
+
}, {}>;
|
|
22
|
+
export default _default;
|