vueless 1.2.10-beta.0 → 1.2.10-beta.10
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/composables/useRequestQueue.ts +47 -0
- package/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/icons/storybook/arrow_forward_ios.svg +1 -0
- package/index.d.ts +4 -1
- package/index.ts +4 -1
- package/package.json +2 -2
- package/types.ts +2 -0
- package/ui.button/UButton.vue +2 -6
- package/ui.button/config.ts +5 -0
- package/ui.button/tests/UButton.test.ts +1 -1
- package/ui.container-drawer/UDrawer.vue +365 -0
- package/ui.container-drawer/config.ts +128 -0
- package/ui.container-drawer/constants.ts +5 -0
- package/ui.container-drawer/storybook/docs.mdx +16 -0
- package/ui.container-drawer/storybook/stories.ts +255 -0
- package/ui.container-drawer/tests/UDrawer.test.ts +680 -0
- package/ui.container-drawer/types.ts +67 -0
- package/ui.container-modal/storybook/stories.ts +4 -1
- package/ui.container-modal-confirm/storybook/stories.ts +29 -24
- package/ui.form-calendar/UCalendarMonthView.vue +4 -4
- package/ui.form-calendar/tests/UCalendar.test.ts +8 -8
- package/ui.form-calendar/tests/UCalendarMonthView.test.ts +1 -1
- package/ui.form-calendar/utilCalendar.ts +2 -2
- package/ui.form-date-picker-range/UDatePickerRangeInputs.vue +20 -19
- package/ui.loader-overlay/useLoaderOverlay.ts +4 -4
- package/ui.loader-progress/ULoaderProgress.vue +41 -46
- package/ui.loader-progress/storybook/docs.mdx +24 -13
- package/ui.loader-progress/storybook/stories.ts +0 -9
- package/ui.loader-progress/types.ts +2 -2
- package/ui.loader-progress/useLoaderProgress.ts +36 -26
- package/ui.loader-progress/utilLoaderProgress.ts +12 -18
- package/ui.navigation-tabs/UTabs.vue +0 -1
- package/utils/requestQueue.ts +21 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
export default /*tw*/ {
|
|
2
|
+
wrapper: "fixed inset-0 z-50 outline-hidden",
|
|
3
|
+
wrapperTransitionTop: {
|
|
4
|
+
enterActiveClass: "ease-out duration-300",
|
|
5
|
+
leaveActiveClass: "ease-in duration-200",
|
|
6
|
+
enterFromClass: "opacity-0 -translate-y-full",
|
|
7
|
+
enterToClass: "opacity-100 translate-y-0",
|
|
8
|
+
leaveFromClass: "opacity-100 translate-y-0",
|
|
9
|
+
leaveToClass: "opacity-0 -translate-y-full",
|
|
10
|
+
},
|
|
11
|
+
wrapperTransitionBottom: {
|
|
12
|
+
enterActiveClass: "ease-out duration-300",
|
|
13
|
+
leaveActiveClass: "ease-in duration-200",
|
|
14
|
+
enterFromClass: "opacity-0 translate-y-full",
|
|
15
|
+
enterToClass: "opacity-100 translate-y-0",
|
|
16
|
+
leaveFromClass: "opacity-100 translate-y-0",
|
|
17
|
+
leaveToClass: "opacity-0 translate-y-full",
|
|
18
|
+
},
|
|
19
|
+
wrapperTransitionLeft: {
|
|
20
|
+
enterActiveClass: "ease-out duration-300",
|
|
21
|
+
leaveActiveClass: "ease-in duration-200",
|
|
22
|
+
enterFromClass: "opacity-0 -translate-x-full",
|
|
23
|
+
enterToClass: "opacity-100 translate-x-0",
|
|
24
|
+
leaveFromClass: "opacity-100 translate-x-0",
|
|
25
|
+
leaveToClass: "opacity-0 -translate-x-full",
|
|
26
|
+
},
|
|
27
|
+
wrapperTransitionRight: {
|
|
28
|
+
enterActiveClass: "ease-out duration-300",
|
|
29
|
+
leaveActiveClass: "ease-in duration-200",
|
|
30
|
+
enterFromClass: "opacity-0 translate-x-full",
|
|
31
|
+
enterToClass: "opacity-100 translate-x-0",
|
|
32
|
+
leaveFromClass: "opacity-100 translate-x-0",
|
|
33
|
+
leaveToClass: "opacity-0 translate-x-full",
|
|
34
|
+
},
|
|
35
|
+
overlay: "fixed inset-0 z-40 bg-inverted/15 dark:bg-lifted/75 backdrop-blur-md",
|
|
36
|
+
overlayTransition: {
|
|
37
|
+
enterActiveClass: "ease-out duration-300",
|
|
38
|
+
enterFromClass: "opacity-0",
|
|
39
|
+
enterToClass: "opacity-100",
|
|
40
|
+
leaveActiveClass: "ease-in duration-200",
|
|
41
|
+
leaveFromClass: "opacity-100",
|
|
42
|
+
leaveToClass: "opacity-0",
|
|
43
|
+
},
|
|
44
|
+
innerWrapper: {
|
|
45
|
+
base: "h-full relative", // add overflow-y
|
|
46
|
+
variants: {
|
|
47
|
+
inset: {
|
|
48
|
+
true: "m-4 h-[calc(100%-2rem)]",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
header: {
|
|
53
|
+
base: "flex justify-between p-6",
|
|
54
|
+
compoundVariants: [
|
|
55
|
+
{ handle: true, position: "left", class: "pr-0" },
|
|
56
|
+
{ handle: true, position: "right", class: "pl-0" },
|
|
57
|
+
{ handle: true, position: "bottom", class: "pt-0" },
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
beforeTitle: "flex items-center gap-3",
|
|
61
|
+
titleFallback: "flex flex-col",
|
|
62
|
+
title: "{UHeader}",
|
|
63
|
+
description: "mt-1.5 text-medium font-normal text-lifted",
|
|
64
|
+
body: {
|
|
65
|
+
base: "px-6 pb-6 text-medium",
|
|
66
|
+
compoundVariants: [
|
|
67
|
+
{ handle: true, position: "left", class: "pr-0" },
|
|
68
|
+
{ handle: true, position: "right", class: "pl-0" },
|
|
69
|
+
{ handle: true, position: "top", class: "pb-0" },
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
footer: {
|
|
73
|
+
base: "flex justify-between p-6 max-md:flex-col max-md:gap-4 border-t border-muted",
|
|
74
|
+
compoundVariants: [
|
|
75
|
+
{ handle: true, position: "left", class: "pr-0" },
|
|
76
|
+
{ handle: true, position: "right", class: "pl-0" },
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
footerLeft: "flex flex-col md:flex-row gap-4 w-full",
|
|
80
|
+
footerRight: "flex flex-col md:flex-row gap-4 w-full justify-end",
|
|
81
|
+
drawerWrapper: {
|
|
82
|
+
base: "flex border absolute select-none cursor-grab active:cursor-grabbing overflow-x-hidden overflow-y-auto",
|
|
83
|
+
variants: {
|
|
84
|
+
variant: {
|
|
85
|
+
solid: "bg-default border-transparent",
|
|
86
|
+
outlined: "bg-default border-muted",
|
|
87
|
+
subtle: "bg-muted border-default/50",
|
|
88
|
+
soft: "bg-muted border-transparent",
|
|
89
|
+
},
|
|
90
|
+
position: {
|
|
91
|
+
top: "top-0 flex-col rounded-b-large w-full h-auto",
|
|
92
|
+
bottom: "bottom-0 flex-col-reverse rounded-t-large w-full h-auto",
|
|
93
|
+
left: "left-0 flex-row rounded-r-large w-max h-full",
|
|
94
|
+
right: "right-0 flex-row-reverse rounded-l-large w-max h-full",
|
|
95
|
+
},
|
|
96
|
+
inset: {
|
|
97
|
+
true: "rounded-large",
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
drawer: "",
|
|
102
|
+
handleWrapper: {
|
|
103
|
+
base: "flex items-center justify-center bg-inherit",
|
|
104
|
+
variants: {
|
|
105
|
+
position: {
|
|
106
|
+
top: "w-full h-11",
|
|
107
|
+
bottom: "w-full h-11",
|
|
108
|
+
left: "w-11 h-auto",
|
|
109
|
+
right: "w-11 h-auto",
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
handle: {
|
|
114
|
+
base: "rounded-large cursor-pointer bg-lifted hover:bg-accented transition",
|
|
115
|
+
compoundVariants: [
|
|
116
|
+
{ position: ["top", "bottom"], class: "w-11 h-1.5" },
|
|
117
|
+
{ position: ["left", "right"], class: "w-1.5 h-11" },
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
defaults: {
|
|
121
|
+
variant: "solid",
|
|
122
|
+
position: "left",
|
|
123
|
+
inset: false,
|
|
124
|
+
handle: true,
|
|
125
|
+
closeOnEsc: true,
|
|
126
|
+
closeOnOverlay: true,
|
|
127
|
+
},
|
|
128
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/addon-docs/blocks";
|
|
2
|
+
import { getSource } from "../../utils/storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./stories";
|
|
5
|
+
import defaultConfig from "../config?raw"
|
|
6
|
+
|
|
7
|
+
<Meta of={stories} />
|
|
8
|
+
<Title of={stories} />
|
|
9
|
+
<Subtitle of={stories} />
|
|
10
|
+
<Description of={stories} />
|
|
11
|
+
<Primary of={stories} />
|
|
12
|
+
<Controls of={stories.Default} />
|
|
13
|
+
<Stories of={stories} />
|
|
14
|
+
|
|
15
|
+
## Default config
|
|
16
|
+
<Source code={getSource(defaultConfig)} language="jsx" dark />
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getArgs,
|
|
3
|
+
getArgTypes,
|
|
4
|
+
getSlotNames,
|
|
5
|
+
getSlotsFragment,
|
|
6
|
+
getDocsDescription,
|
|
7
|
+
} from "../../utils/storybook";
|
|
8
|
+
|
|
9
|
+
import UDrawer from "../../ui.container-drawer/UDrawer.vue";
|
|
10
|
+
import UButton from "../../ui.button/UButton.vue";
|
|
11
|
+
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
12
|
+
import URow from "../../ui.container-row/URow.vue";
|
|
13
|
+
import UCol from "../../ui.container-col/UCol.vue";
|
|
14
|
+
import UHeader from "../../ui.text-header/UHeader.vue";
|
|
15
|
+
import USkeleton from "../../ui.skeleton/USkeleton.vue";
|
|
16
|
+
import USkeletonText from "../../ui.skeleton-text/USkeletonText.vue";
|
|
17
|
+
import USkeletonInput from "../../ui.skeleton-input/USkeletonInput.vue";
|
|
18
|
+
|
|
19
|
+
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
20
|
+
import type { Props } from "../types";
|
|
21
|
+
import type { UnknownObject } from "../../types";
|
|
22
|
+
|
|
23
|
+
interface UDrawerArgs extends Props {
|
|
24
|
+
slotTemplate?: string;
|
|
25
|
+
enum: "variant" | "position";
|
|
26
|
+
modelValues?: UnknownObject;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
id: "5000",
|
|
31
|
+
title: "Containers / Drawer",
|
|
32
|
+
component: UDrawer,
|
|
33
|
+
args: {
|
|
34
|
+
title: "Sign Up",
|
|
35
|
+
modelValue: false,
|
|
36
|
+
},
|
|
37
|
+
argTypes: {
|
|
38
|
+
...getArgTypes(UDrawer.__name),
|
|
39
|
+
},
|
|
40
|
+
parameters: {
|
|
41
|
+
docs: {
|
|
42
|
+
...getDocsDescription(UDrawer.__name),
|
|
43
|
+
story: {
|
|
44
|
+
height: "550px",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
} as Meta;
|
|
49
|
+
|
|
50
|
+
const defaultTemplate = `
|
|
51
|
+
<UCol
|
|
52
|
+
justify="between"
|
|
53
|
+
align="stretch"
|
|
54
|
+
class="h-full min-w-96"
|
|
55
|
+
gap="xl"
|
|
56
|
+
>
|
|
57
|
+
<USkeletonText />
|
|
58
|
+
|
|
59
|
+
<URow
|
|
60
|
+
align="center"
|
|
61
|
+
justify="between"
|
|
62
|
+
gap="sm"
|
|
63
|
+
>
|
|
64
|
+
<USkeleton class="h-12" />
|
|
65
|
+
<USkeleton class="h-12" />
|
|
66
|
+
</URow>
|
|
67
|
+
|
|
68
|
+
<UCol gap="sm" block>
|
|
69
|
+
<USkeletonInput label label-align="top" />
|
|
70
|
+
<USkeletonInput label label-align="top" />
|
|
71
|
+
</UCol>
|
|
72
|
+
</UCol>
|
|
73
|
+
`;
|
|
74
|
+
|
|
75
|
+
const DefaultTemplate: StoryFn<UDrawerArgs> = (args: UDrawerArgs) => ({
|
|
76
|
+
components: {
|
|
77
|
+
UDrawer,
|
|
78
|
+
URow,
|
|
79
|
+
UCol,
|
|
80
|
+
UButton,
|
|
81
|
+
UIcon,
|
|
82
|
+
UHeader,
|
|
83
|
+
USkeleton,
|
|
84
|
+
USkeletonText,
|
|
85
|
+
USkeletonInput,
|
|
86
|
+
},
|
|
87
|
+
setup() {
|
|
88
|
+
function onClick() {
|
|
89
|
+
args.modelValue = true;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const slots = getSlotNames(UDrawer.__name);
|
|
93
|
+
|
|
94
|
+
return { args, slots, onClick };
|
|
95
|
+
},
|
|
96
|
+
template: `
|
|
97
|
+
<UCol>
|
|
98
|
+
<UDrawer v-bind="args" v-model="args.modelValue">
|
|
99
|
+
${args.slotTemplate || getSlotsFragment(defaultTemplate)}
|
|
100
|
+
</UDrawer>
|
|
101
|
+
|
|
102
|
+
<UButton label="Show drawer" @click="onClick" />
|
|
103
|
+
</UCol>
|
|
104
|
+
`,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const EnumTemplate: StoryFn<UDrawerArgs> = (args: UDrawerArgs, { argTypes }) => ({
|
|
108
|
+
components: {
|
|
109
|
+
UDrawer,
|
|
110
|
+
UButton,
|
|
111
|
+
URow,
|
|
112
|
+
UCol,
|
|
113
|
+
USkeleton,
|
|
114
|
+
USkeletonText,
|
|
115
|
+
USkeletonInput,
|
|
116
|
+
},
|
|
117
|
+
setup: () => ({ args, argTypes, getArgs }),
|
|
118
|
+
template: `
|
|
119
|
+
<URow>
|
|
120
|
+
<UButton
|
|
121
|
+
v-for="option in argTypes?.[args.enum]?.options"
|
|
122
|
+
:key="option"
|
|
123
|
+
:label="option"
|
|
124
|
+
@click="args.modelValues[option] = !args.modelValues[option]"
|
|
125
|
+
/>
|
|
126
|
+
|
|
127
|
+
<UDrawer
|
|
128
|
+
v-for="option in argTypes?.[args.enum]?.options"
|
|
129
|
+
:key="option"
|
|
130
|
+
v-bind="getArgs(args, option)"
|
|
131
|
+
v-model="args.modelValues[option]"
|
|
132
|
+
>
|
|
133
|
+
${defaultTemplate}
|
|
134
|
+
</UDrawer>
|
|
135
|
+
</URow>
|
|
136
|
+
`,
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
export const Default = DefaultTemplate.bind({});
|
|
140
|
+
Default.args = {};
|
|
141
|
+
|
|
142
|
+
export const Description = DefaultTemplate.bind({});
|
|
143
|
+
Description.args = {
|
|
144
|
+
description: "Enter your email below to get started and create your account.",
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const NoHandle = DefaultTemplate.bind({});
|
|
148
|
+
NoHandle.args = { handle: false };
|
|
149
|
+
|
|
150
|
+
export const Inset = DefaultTemplate.bind({});
|
|
151
|
+
Inset.args = { inset: true };
|
|
152
|
+
|
|
153
|
+
export const NoCloseOnEscAndOverlay = DefaultTemplate.bind({});
|
|
154
|
+
NoCloseOnEscAndOverlay.args = {
|
|
155
|
+
closeOnEsc: false,
|
|
156
|
+
closeOnOverlay: false,
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export const Position = EnumTemplate.bind({});
|
|
160
|
+
Position.args = { enum: "position", modelValues: {} };
|
|
161
|
+
|
|
162
|
+
export const Variant = EnumTemplate.bind({});
|
|
163
|
+
Variant.args = { enum: "variant", modelValues: {} };
|
|
164
|
+
|
|
165
|
+
export const BeforeTitleSlot = DefaultTemplate.bind({});
|
|
166
|
+
BeforeTitleSlot.args = {
|
|
167
|
+
slotTemplate: `
|
|
168
|
+
<template #before-title>
|
|
169
|
+
<UIcon name="account_circle" size="sm" color="primary" />
|
|
170
|
+
</template>
|
|
171
|
+
<template #default>
|
|
172
|
+
${defaultTemplate}
|
|
173
|
+
</template>
|
|
174
|
+
`,
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const TitleSlot = DefaultTemplate.bind({});
|
|
178
|
+
TitleSlot.args = {
|
|
179
|
+
slotTemplate: `
|
|
180
|
+
<template #title="{ title }">
|
|
181
|
+
<UHeader :label="title" color="primary" />
|
|
182
|
+
</template>
|
|
183
|
+
<template #default>
|
|
184
|
+
${defaultTemplate}
|
|
185
|
+
</template>
|
|
186
|
+
`,
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
export const AfterTitleSlot = DefaultTemplate.bind({});
|
|
190
|
+
AfterTitleSlot.args = {
|
|
191
|
+
slotTemplate: `
|
|
192
|
+
<template #after-title>
|
|
193
|
+
<UIcon name="verified" size="sm" color="primary" />
|
|
194
|
+
</template>
|
|
195
|
+
<template #default>
|
|
196
|
+
${defaultTemplate}
|
|
197
|
+
</template>
|
|
198
|
+
`,
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export const ActionsSlot = DefaultTemplate.bind({});
|
|
202
|
+
ActionsSlot.args = {
|
|
203
|
+
slotTemplate: `
|
|
204
|
+
<template #actions="{ close }">
|
|
205
|
+
<UButton
|
|
206
|
+
label="Close"
|
|
207
|
+
size="sm"
|
|
208
|
+
color="grayscale"
|
|
209
|
+
variant="subtle"
|
|
210
|
+
@click="close"
|
|
211
|
+
/>
|
|
212
|
+
</template>
|
|
213
|
+
<template #default>
|
|
214
|
+
${defaultTemplate}
|
|
215
|
+
</template>
|
|
216
|
+
`,
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export const HandleSlot = DefaultTemplate.bind({});
|
|
220
|
+
HandleSlot.args = {
|
|
221
|
+
slotTemplate: `
|
|
222
|
+
<template #default>
|
|
223
|
+
${defaultTemplate}
|
|
224
|
+
</template>
|
|
225
|
+
<template #handle>
|
|
226
|
+
<UIcon name="arrow_forward_ios" size="sm" color="neutral" />
|
|
227
|
+
</template>
|
|
228
|
+
`,
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
export const FooterLeftSlot = DefaultTemplate.bind({});
|
|
232
|
+
FooterLeftSlot.args = {
|
|
233
|
+
slotTemplate: `
|
|
234
|
+
<template #default>
|
|
235
|
+
${defaultTemplate}
|
|
236
|
+
</template>
|
|
237
|
+
|
|
238
|
+
<template #footer-left>
|
|
239
|
+
<UButton label="Back" variant="subtle" color="neutral" />
|
|
240
|
+
</template>
|
|
241
|
+
`,
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export const FooterRightSlot = DefaultTemplate.bind({});
|
|
245
|
+
FooterRightSlot.args = {
|
|
246
|
+
slotTemplate: `
|
|
247
|
+
<template #default>
|
|
248
|
+
${defaultTemplate}
|
|
249
|
+
</template>
|
|
250
|
+
|
|
251
|
+
<template #footer-right>
|
|
252
|
+
<UButton label="Submit" variant="subtle" />
|
|
253
|
+
</template>
|
|
254
|
+
`,
|
|
255
|
+
};
|