windly-ui 1.0.2 → 1.0.3
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/{ui-library/dist → dist}/module.json +2 -2
- package/dist/module.mjs +26 -0
- package/dist/runtime/components/Accordion.d.vue.ts +39 -0
- package/dist/runtime/components/Accordion.vue +92 -0
- package/dist/runtime/components/Accordion.vue.d.ts +39 -0
- package/dist/runtime/components/Avatar.d.vue.ts +141 -0
- package/dist/runtime/components/Avatar.vue +72 -0
- package/dist/runtime/components/Avatar.vue.d.ts +141 -0
- package/dist/runtime/components/Badge.d.vue.ts +133 -0
- package/dist/runtime/components/Badge.vue +99 -0
- package/dist/runtime/components/Badge.vue.d.ts +133 -0
- package/dist/runtime/components/Breadcrumbs.d.vue.ts +83 -0
- package/dist/runtime/components/Breadcrumbs.vue +116 -0
- package/dist/runtime/components/Breadcrumbs.vue.d.ts +83 -0
- package/dist/runtime/components/Button.d.vue.ts +199 -0
- package/dist/runtime/components/Button.vue +125 -0
- package/dist/runtime/components/Button.vue.d.ts +199 -0
- package/dist/runtime/components/Card.d.vue.ts +83 -0
- package/dist/runtime/components/Card.vue +71 -0
- package/dist/runtime/components/Card.vue.d.ts +83 -0
- package/dist/runtime/components/Checkbox.d.vue.ts +190 -0
- package/dist/runtime/components/Checkbox.vue +125 -0
- package/dist/runtime/components/Checkbox.vue.d.ts +190 -0
- package/dist/runtime/components/CodeBlock.d.vue.ts +16 -0
- package/dist/runtime/components/CodeBlock.vue +75 -0
- package/dist/runtime/components/CodeBlock.vue.d.ts +16 -0
- package/dist/runtime/components/ColorPicker.d.vue.ts +91 -0
- package/dist/runtime/components/ColorPicker.vue +244 -0
- package/dist/runtime/components/ColorPicker.vue.d.ts +91 -0
- package/dist/runtime/components/Date.d.vue.ts +137 -0
- package/dist/runtime/components/Date.vue +201 -0
- package/dist/runtime/components/Date.vue.d.ts +137 -0
- package/dist/runtime/components/Dialog.d.vue.ts +103 -0
- package/dist/runtime/components/Dialog.vue +152 -0
- package/dist/runtime/components/Dialog.vue.d.ts +103 -0
- package/dist/runtime/components/Divider.d.vue.ts +51 -0
- package/dist/runtime/components/Divider.vue +52 -0
- package/dist/runtime/components/Divider.vue.d.ts +51 -0
- package/dist/runtime/components/Drawer.d.vue.ts +30 -0
- package/dist/runtime/components/Drawer.vue +43 -0
- package/dist/runtime/components/Drawer.vue.d.ts +30 -0
- package/dist/runtime/components/Dropdown.d.vue.ts +34 -0
- package/dist/runtime/components/Dropdown.vue +127 -0
- package/dist/runtime/components/Dropdown.vue.d.ts +34 -0
- package/dist/runtime/components/FileUploader.d.vue.ts +58 -0
- package/dist/runtime/components/FileUploader.vue +202 -0
- package/dist/runtime/components/FileUploader.vue.d.ts +58 -0
- package/dist/runtime/components/Icon.d.vue.ts +41 -0
- package/dist/runtime/components/Icon.vue +66 -0
- package/dist/runtime/components/Icon.vue.d.ts +41 -0
- package/dist/runtime/components/Image.d.vue.ts +77 -0
- package/dist/runtime/components/Image.vue +61 -0
- package/dist/runtime/components/Image.vue.d.ts +77 -0
- package/dist/runtime/components/Input.d.vue.ts +66 -0
- package/dist/runtime/components/Input.vue +233 -0
- package/dist/runtime/components/Input.vue.d.ts +66 -0
- package/dist/runtime/components/Radio.d.vue.ts +41 -0
- package/dist/runtime/components/Radio.vue +222 -0
- package/dist/runtime/components/Radio.vue.d.ts +41 -0
- package/dist/runtime/components/ScrollArea.d.vue.ts +79 -0
- package/dist/runtime/components/ScrollArea.vue +36 -0
- package/dist/runtime/components/ScrollArea.vue.d.ts +79 -0
- package/dist/runtime/components/Select.d.vue.ts +43 -0
- package/dist/runtime/components/Select.vue +200 -0
- package/dist/runtime/components/Select.vue.d.ts +43 -0
- package/dist/runtime/components/Stepper.d.vue.ts +46 -0
- package/dist/runtime/components/Stepper.vue +218 -0
- package/dist/runtime/components/Stepper.vue.d.ts +46 -0
- package/dist/runtime/components/TabPanel.d.vue.ts +17 -0
- package/dist/runtime/components/TabPanel.vue +21 -0
- package/dist/runtime/components/TabPanel.vue.d.ts +17 -0
- package/dist/runtime/components/Table.d.vue.ts +40 -0
- package/dist/runtime/components/Table.vue +92 -0
- package/dist/runtime/components/Table.vue.d.ts +40 -0
- package/dist/runtime/components/Tabs.d.vue.ts +20 -0
- package/dist/runtime/components/Tabs.vue +62 -0
- package/dist/runtime/components/Tabs.vue.d.ts +20 -0
- package/dist/runtime/components/Textarea.d.vue.ts +208 -0
- package/dist/runtime/components/Textarea.vue +185 -0
- package/dist/runtime/components/Textarea.vue.d.ts +208 -0
- package/dist/runtime/components/Toggle.d.vue.ts +36 -0
- package/dist/runtime/components/Toggle.vue +173 -0
- package/dist/runtime/components/Toggle.vue.d.ts +36 -0
- package/dist/runtime/components/Tooltip.d.vue.ts +63 -0
- package/dist/runtime/components/Tooltip.vue +144 -0
- package/dist/runtime/components/Tooltip.vue.d.ts +63 -0
- package/dist/runtime/components/uiProps.d.ts +38 -0
- package/dist/runtime/components/uiProps.js +11 -0
- package/dist/runtime/components/useUiClasses.d.ts +43 -0
- package/dist/runtime/components/useUiClasses.js +124 -0
- package/dist/runtime/composables/plugin.d.ts +2 -0
- package/dist/runtime/composables/plugin.js +3 -0
- package/dist/runtime/tailwind-color.d.ts +2 -0
- package/dist/runtime/tailwind-color.js +5859 -0
- package/package.json +12 -46
- package/LICENSE +0 -21
- package/README.md +0 -232
- package/ui-library/dist/module.mjs +0 -22
- /package/{ui-library/dist → dist}/module.d.mts +0 -0
- /package/{ui-library/dist → dist}/types.d.mts +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineOptions({
|
|
3
|
+
inheritAttrs: false
|
|
4
|
+
});
|
|
5
|
+
import { computed } from "vue";
|
|
6
|
+
import { useUiClasses } from "./useUiClasses";
|
|
7
|
+
import { uiProps } from "./uiProps";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
label: { type: String, default: null },
|
|
10
|
+
to: { type: [String, Object], default: null },
|
|
11
|
+
outline: { type: Boolean, default: false },
|
|
12
|
+
flat: { type: Boolean, default: false },
|
|
13
|
+
unelevated: { type: Boolean, default: false },
|
|
14
|
+
dense: { type: Boolean, default: false },
|
|
15
|
+
stacked: { type: Boolean, default: false },
|
|
16
|
+
gradient: { type: Boolean, default: false },
|
|
17
|
+
color2: { type: String, default: "" },
|
|
18
|
+
icon: { type: String, default: null },
|
|
19
|
+
iconColor: { type: String, default: null },
|
|
20
|
+
iconPosition: { type: String, default: "start" },
|
|
21
|
+
...uiProps
|
|
22
|
+
});
|
|
23
|
+
const {
|
|
24
|
+
// props
|
|
25
|
+
contentClass,
|
|
26
|
+
contentStyle,
|
|
27
|
+
textColor,
|
|
28
|
+
disable,
|
|
29
|
+
loading,
|
|
30
|
+
color,
|
|
31
|
+
rounded,
|
|
32
|
+
size,
|
|
33
|
+
iconSize,
|
|
34
|
+
// class maps
|
|
35
|
+
roundedClass,
|
|
36
|
+
sizeClass,
|
|
37
|
+
iconSizeClasses,
|
|
38
|
+
// computed
|
|
39
|
+
colorClass,
|
|
40
|
+
computedContentClass,
|
|
41
|
+
isColorDark,
|
|
42
|
+
isHex,
|
|
43
|
+
isTailwindColor,
|
|
44
|
+
shadeTailwind,
|
|
45
|
+
shadeHex
|
|
46
|
+
} = useUiClasses(props);
|
|
47
|
+
const paddingClass = {
|
|
48
|
+
default: {
|
|
49
|
+
sm: "py-1 px-3 min-h-8 h-auto w-auto" + (props.label ? " min-w-16" : ""),
|
|
50
|
+
md: "py-2 px-6 min-h-10 h-auto w-auto" + (props.label ? " min-w-28" : ""),
|
|
51
|
+
lg: "py-3 px-8 min-h-12 h-auto w-auto" + (props.label ? " min-w-36" : "")
|
|
52
|
+
},
|
|
53
|
+
dense: {
|
|
54
|
+
sm: "py-0.5 px-2 min-h-6 h-auto w-auto" + (props.label ? " min-w-16" : ""),
|
|
55
|
+
md: "py-1 px-4 min-h-8 h-auto w-auto" + (props.label ? " min-w-24" : ""),
|
|
56
|
+
lg: "py-1.5 px-6 min-h-10 h-auto w-auto" + (props.label ? " min-w-32" : "")
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const computedClass = computed(() => {
|
|
60
|
+
let cls = `transition-all duration-300 text-nowrap ${roundedClass[rounded.value]} ${sizeClass[size.value]}`;
|
|
61
|
+
if (props.outline)
|
|
62
|
+
cls += ` border bg-white border-${colorClass.value} text-${colorClass.value} hover:bg-${colorClass.value} hover:text-white`;
|
|
63
|
+
if (props.flat)
|
|
64
|
+
cls += ` bg-transparent text-${colorClass.value} hover:bg-${colorClass.value} hover:bg-opacity-10 shadow-none`;
|
|
65
|
+
cls += props.dense ? ` ${paddingClass.dense[size.value]}` : ` ${paddingClass.default[size.value]}`;
|
|
66
|
+
cls += props.unelevated ? " no-shadow" : " shadow-md";
|
|
67
|
+
cls += props.stacked ? " flex flex-col items-center justify-center gap-2" : " flex items-center justify-center gap-2";
|
|
68
|
+
cls += disable.value ? " opacity-50 cursor-not-allowed" : " cursor-pointer";
|
|
69
|
+
cls += loading.value ? " opacity-75 cursor-progress" : "";
|
|
70
|
+
cls += props.gradient ? ` bg-gradient-to-br from-${color.value} to-${computedColor2.value} hover:bg-gradient-to-tl text-${computedTextColor.value}` : !props.flat && !props.outline ? ` bg-${color.value} hover:bg-${computedColor2.value} text-${computedTextColor.value}` : "";
|
|
71
|
+
return cls;
|
|
72
|
+
});
|
|
73
|
+
const computedIconClass = computed(() => {
|
|
74
|
+
return `material-icons ${iconSizeClasses[props.iconPosition === "start" ? "lg" : "md"]} ${props.iconColor ? `text-${props.iconColor}` : ""}`;
|
|
75
|
+
});
|
|
76
|
+
const computedProps = computed(() => ({
|
|
77
|
+
class: computedClass.value,
|
|
78
|
+
disabled: disable.value || loading.value
|
|
79
|
+
}));
|
|
80
|
+
const computedTextColor = computed(() => {
|
|
81
|
+
if (textColor.value) {
|
|
82
|
+
return textColor.value;
|
|
83
|
+
}
|
|
84
|
+
if (props.outline || props.flat) {
|
|
85
|
+
return color.value;
|
|
86
|
+
}
|
|
87
|
+
const darkBg = isColorDark(color.value);
|
|
88
|
+
return darkBg ? "white" : "gray-900";
|
|
89
|
+
});
|
|
90
|
+
const computedColor2 = computed(() => {
|
|
91
|
+
if (props.color2) return props.color2;
|
|
92
|
+
if (isTailwindColor(color.value)) {
|
|
93
|
+
return shadeTailwind(color.value, 100);
|
|
94
|
+
}
|
|
95
|
+
if (isHex(color.value)) {
|
|
96
|
+
return shadeHex(color.value, -20);
|
|
97
|
+
}
|
|
98
|
+
return color.value;
|
|
99
|
+
});
|
|
100
|
+
function onClick() {
|
|
101
|
+
if (!loading.value && !disable.value && !props.to) {
|
|
102
|
+
emit("click");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const emit = defineEmits(["click"]);
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<template>
|
|
109
|
+
<!-- Router Link if "to" prop is provided -->
|
|
110
|
+
<router-link v-if="to" v-bind="computedProps" :to="to">
|
|
111
|
+
<!-- Icon (start position) -->
|
|
112
|
+
<i v-if="icon && iconPosition === 'start'" :class="computedIconClass">{{ icon }}</i>
|
|
113
|
+
<!-- Label -->
|
|
114
|
+
<span v-if="label" class="label">{{ label }}</span>
|
|
115
|
+
<!-- Icon (end position) -->
|
|
116
|
+
<i v-if="icon && iconPosition === 'end'" :class="computedIconClass">{{ icon }}</i>
|
|
117
|
+
</router-link>
|
|
118
|
+
|
|
119
|
+
<!-- Normal button if no "to" prop -->
|
|
120
|
+
<button v-else v-bind="computedProps" @click="onClick">
|
|
121
|
+
<i v-if="icon && iconPosition === 'start'" :class="computedIconClass">{{ icon }}</i>
|
|
122
|
+
<span v-if="label" class="label">{{ label }}</span>
|
|
123
|
+
<i v-if="icon && iconPosition === 'end'" :class="computedIconClass">{{ icon }}</i>
|
|
124
|
+
</button>
|
|
125
|
+
</template>
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
2
|
+
contentClass: {
|
|
3
|
+
readonly type: StringConstructor;
|
|
4
|
+
readonly default: "";
|
|
5
|
+
};
|
|
6
|
+
contentStyle: {
|
|
7
|
+
readonly type: StringConstructor;
|
|
8
|
+
readonly default: "";
|
|
9
|
+
};
|
|
10
|
+
textColor: {
|
|
11
|
+
readonly type: StringConstructor;
|
|
12
|
+
readonly default: "";
|
|
13
|
+
};
|
|
14
|
+
disable: {
|
|
15
|
+
readonly type: BooleanConstructor;
|
|
16
|
+
readonly default: false;
|
|
17
|
+
};
|
|
18
|
+
loading: {
|
|
19
|
+
readonly type: BooleanConstructor;
|
|
20
|
+
readonly default: false;
|
|
21
|
+
};
|
|
22
|
+
color: {
|
|
23
|
+
readonly type: StringConstructor;
|
|
24
|
+
readonly default: "blue-900";
|
|
25
|
+
};
|
|
26
|
+
rounded: {
|
|
27
|
+
readonly type: StringConstructor;
|
|
28
|
+
readonly default: "md";
|
|
29
|
+
};
|
|
30
|
+
size: {
|
|
31
|
+
readonly type: StringConstructor;
|
|
32
|
+
readonly default: "md";
|
|
33
|
+
};
|
|
34
|
+
iconSize: {
|
|
35
|
+
readonly type: StringConstructor;
|
|
36
|
+
readonly default: "lg";
|
|
37
|
+
};
|
|
38
|
+
label: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: null;
|
|
41
|
+
};
|
|
42
|
+
to: {
|
|
43
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
44
|
+
default: null;
|
|
45
|
+
};
|
|
46
|
+
outline: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
flat: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
unelevated: {
|
|
55
|
+
type: BooleanConstructor;
|
|
56
|
+
default: boolean;
|
|
57
|
+
};
|
|
58
|
+
dense: {
|
|
59
|
+
type: BooleanConstructor;
|
|
60
|
+
default: boolean;
|
|
61
|
+
};
|
|
62
|
+
stacked: {
|
|
63
|
+
type: BooleanConstructor;
|
|
64
|
+
default: boolean;
|
|
65
|
+
};
|
|
66
|
+
gradient: {
|
|
67
|
+
type: BooleanConstructor;
|
|
68
|
+
default: boolean;
|
|
69
|
+
};
|
|
70
|
+
color2: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
icon: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: null;
|
|
77
|
+
};
|
|
78
|
+
iconColor: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
default: null;
|
|
81
|
+
};
|
|
82
|
+
iconPosition: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
default: string;
|
|
85
|
+
};
|
|
86
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
87
|
+
click: (...args: any[]) => void;
|
|
88
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
89
|
+
contentClass: {
|
|
90
|
+
readonly type: StringConstructor;
|
|
91
|
+
readonly default: "";
|
|
92
|
+
};
|
|
93
|
+
contentStyle: {
|
|
94
|
+
readonly type: StringConstructor;
|
|
95
|
+
readonly default: "";
|
|
96
|
+
};
|
|
97
|
+
textColor: {
|
|
98
|
+
readonly type: StringConstructor;
|
|
99
|
+
readonly default: "";
|
|
100
|
+
};
|
|
101
|
+
disable: {
|
|
102
|
+
readonly type: BooleanConstructor;
|
|
103
|
+
readonly default: false;
|
|
104
|
+
};
|
|
105
|
+
loading: {
|
|
106
|
+
readonly type: BooleanConstructor;
|
|
107
|
+
readonly default: false;
|
|
108
|
+
};
|
|
109
|
+
color: {
|
|
110
|
+
readonly type: StringConstructor;
|
|
111
|
+
readonly default: "blue-900";
|
|
112
|
+
};
|
|
113
|
+
rounded: {
|
|
114
|
+
readonly type: StringConstructor;
|
|
115
|
+
readonly default: "md";
|
|
116
|
+
};
|
|
117
|
+
size: {
|
|
118
|
+
readonly type: StringConstructor;
|
|
119
|
+
readonly default: "md";
|
|
120
|
+
};
|
|
121
|
+
iconSize: {
|
|
122
|
+
readonly type: StringConstructor;
|
|
123
|
+
readonly default: "lg";
|
|
124
|
+
};
|
|
125
|
+
label: {
|
|
126
|
+
type: StringConstructor;
|
|
127
|
+
default: null;
|
|
128
|
+
};
|
|
129
|
+
to: {
|
|
130
|
+
type: (StringConstructor | ObjectConstructor)[];
|
|
131
|
+
default: null;
|
|
132
|
+
};
|
|
133
|
+
outline: {
|
|
134
|
+
type: BooleanConstructor;
|
|
135
|
+
default: boolean;
|
|
136
|
+
};
|
|
137
|
+
flat: {
|
|
138
|
+
type: BooleanConstructor;
|
|
139
|
+
default: boolean;
|
|
140
|
+
};
|
|
141
|
+
unelevated: {
|
|
142
|
+
type: BooleanConstructor;
|
|
143
|
+
default: boolean;
|
|
144
|
+
};
|
|
145
|
+
dense: {
|
|
146
|
+
type: BooleanConstructor;
|
|
147
|
+
default: boolean;
|
|
148
|
+
};
|
|
149
|
+
stacked: {
|
|
150
|
+
type: BooleanConstructor;
|
|
151
|
+
default: boolean;
|
|
152
|
+
};
|
|
153
|
+
gradient: {
|
|
154
|
+
type: BooleanConstructor;
|
|
155
|
+
default: boolean;
|
|
156
|
+
};
|
|
157
|
+
color2: {
|
|
158
|
+
type: StringConstructor;
|
|
159
|
+
default: string;
|
|
160
|
+
};
|
|
161
|
+
icon: {
|
|
162
|
+
type: StringConstructor;
|
|
163
|
+
default: null;
|
|
164
|
+
};
|
|
165
|
+
iconColor: {
|
|
166
|
+
type: StringConstructor;
|
|
167
|
+
default: null;
|
|
168
|
+
};
|
|
169
|
+
iconPosition: {
|
|
170
|
+
type: StringConstructor;
|
|
171
|
+
default: string;
|
|
172
|
+
};
|
|
173
|
+
}>> & Readonly<{
|
|
174
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
175
|
+
}>, {
|
|
176
|
+
dense: boolean;
|
|
177
|
+
label: string;
|
|
178
|
+
contentClass: string;
|
|
179
|
+
contentStyle: string;
|
|
180
|
+
textColor: string;
|
|
181
|
+
disable: boolean;
|
|
182
|
+
loading: boolean;
|
|
183
|
+
color: string;
|
|
184
|
+
rounded: string;
|
|
185
|
+
size: string;
|
|
186
|
+
iconSize: string;
|
|
187
|
+
icon: string;
|
|
188
|
+
to: string | Record<string, any>;
|
|
189
|
+
outline: boolean;
|
|
190
|
+
flat: boolean;
|
|
191
|
+
unelevated: boolean;
|
|
192
|
+
stacked: boolean;
|
|
193
|
+
gradient: boolean;
|
|
194
|
+
color2: string;
|
|
195
|
+
iconColor: string;
|
|
196
|
+
iconPosition: string;
|
|
197
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
198
|
+
declare const _default: typeof __VLS_export;
|
|
199
|
+
export default _default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
header?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
default?: (props: typeof __VLS_3) => any;
|
|
6
|
+
} & {
|
|
7
|
+
footer?: (props: typeof __VLS_5) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
flat: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
square: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
dense: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
bordered: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
color: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
borderColor: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
width: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
39
|
+
flat: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
square: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
dense: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
51
|
+
bordered: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
color: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
borderColor: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
width: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
}>> & Readonly<{}>, {
|
|
68
|
+
dense: boolean;
|
|
69
|
+
color: string;
|
|
70
|
+
borderColor: string;
|
|
71
|
+
flat: boolean;
|
|
72
|
+
square: boolean;
|
|
73
|
+
bordered: boolean;
|
|
74
|
+
width: string;
|
|
75
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
76
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
77
|
+
declare const _default: typeof __VLS_export;
|
|
78
|
+
export default _default;
|
|
79
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
80
|
+
new (): {
|
|
81
|
+
$slots: S;
|
|
82
|
+
};
|
|
83
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineOptions({
|
|
3
|
+
inheritAttrs: false
|
|
4
|
+
});
|
|
5
|
+
import { computed } from "vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
flat: { type: Boolean, default: false },
|
|
8
|
+
square: { type: Boolean, default: false },
|
|
9
|
+
dense: { type: Boolean, default: false },
|
|
10
|
+
bordered: { type: Boolean, default: true },
|
|
11
|
+
color: { type: String, default: "white" },
|
|
12
|
+
borderColor: { type: String, default: "gray-200" },
|
|
13
|
+
width: { type: String, default: "100%" }
|
|
14
|
+
});
|
|
15
|
+
const isHex = (val) => val.startsWith("#");
|
|
16
|
+
const cardStyle = computed(() => {
|
|
17
|
+
const style = {
|
|
18
|
+
width: props.width,
|
|
19
|
+
maxWidth: "80vw"
|
|
20
|
+
};
|
|
21
|
+
if (isHex(props.color)) {
|
|
22
|
+
style.backgroundColor = props.color;
|
|
23
|
+
}
|
|
24
|
+
if (props.bordered && isHex(props.borderColor)) {
|
|
25
|
+
style.borderColor = props.borderColor;
|
|
26
|
+
}
|
|
27
|
+
return style;
|
|
28
|
+
});
|
|
29
|
+
const cardClass = computed(() => [
|
|
30
|
+
"transition-shadow duration-300",
|
|
31
|
+
props.flat ? "shadow-none" : "shadow-md",
|
|
32
|
+
props.square ? "rounded-none" : "rounded-md",
|
|
33
|
+
props.bordered ? "border" : "",
|
|
34
|
+
!isHex(props.borderColor) && props.bordered ? `border-${props.borderColor}` : "",
|
|
35
|
+
!isHex(props.color) ? `bg-${props.color}` : ""
|
|
36
|
+
]);
|
|
37
|
+
const sectionPadding = computed(
|
|
38
|
+
() => props.dense ? "p-0" : "p-4"
|
|
39
|
+
);
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<template>
|
|
43
|
+
<div
|
|
44
|
+
:class="cardClass"
|
|
45
|
+
:style="cardStyle"
|
|
46
|
+
v-bind="$attrs"
|
|
47
|
+
>
|
|
48
|
+
<!-- Header -->
|
|
49
|
+
<div
|
|
50
|
+
v-if="$slots.header"
|
|
51
|
+
:class="sectionPadding"
|
|
52
|
+
class="border-b border-gray-200"
|
|
53
|
+
>
|
|
54
|
+
<slot name="header" />
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<!-- Content -->
|
|
58
|
+
<div :class="sectionPadding">
|
|
59
|
+
<slot />
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<!-- Footer -->
|
|
63
|
+
<div
|
|
64
|
+
v-if="$slots.footer"
|
|
65
|
+
:class="sectionPadding"
|
|
66
|
+
class="border-t border-gray-200"
|
|
67
|
+
>
|
|
68
|
+
<slot name="footer" />
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
header?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
default?: (props: typeof __VLS_3) => any;
|
|
6
|
+
} & {
|
|
7
|
+
footer?: (props: typeof __VLS_5) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
|
+
flat: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
square: {
|
|
15
|
+
type: BooleanConstructor;
|
|
16
|
+
default: boolean;
|
|
17
|
+
};
|
|
18
|
+
dense: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
bordered: {
|
|
23
|
+
type: BooleanConstructor;
|
|
24
|
+
default: boolean;
|
|
25
|
+
};
|
|
26
|
+
color: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
borderColor: {
|
|
31
|
+
type: StringConstructor;
|
|
32
|
+
default: string;
|
|
33
|
+
};
|
|
34
|
+
width: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
default: string;
|
|
37
|
+
};
|
|
38
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
39
|
+
flat: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
|
+
square: {
|
|
44
|
+
type: BooleanConstructor;
|
|
45
|
+
default: boolean;
|
|
46
|
+
};
|
|
47
|
+
dense: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
51
|
+
bordered: {
|
|
52
|
+
type: BooleanConstructor;
|
|
53
|
+
default: boolean;
|
|
54
|
+
};
|
|
55
|
+
color: {
|
|
56
|
+
type: StringConstructor;
|
|
57
|
+
default: string;
|
|
58
|
+
};
|
|
59
|
+
borderColor: {
|
|
60
|
+
type: StringConstructor;
|
|
61
|
+
default: string;
|
|
62
|
+
};
|
|
63
|
+
width: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
}>> & Readonly<{}>, {
|
|
68
|
+
dense: boolean;
|
|
69
|
+
color: string;
|
|
70
|
+
borderColor: string;
|
|
71
|
+
flat: boolean;
|
|
72
|
+
square: boolean;
|
|
73
|
+
bordered: boolean;
|
|
74
|
+
width: string;
|
|
75
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
76
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
77
|
+
declare const _default: typeof __VLS_export;
|
|
78
|
+
export default _default;
|
|
79
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
80
|
+
new (): {
|
|
81
|
+
$slots: S;
|
|
82
|
+
};
|
|
83
|
+
};
|