vueless 1.3.7-beta.3 → 1.3.7-beta.4
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/icons/storybook/help.svg +1 -0
- package/icons/storybook/logout.svg +1 -0
- package/package.json +1 -1
- package/ui.container-collapsible/config.ts +1 -1
- package/ui.container-collapsible/storybook/stories.ts +137 -160
- package/ui.dropdown/storybook/stories.ts +5 -5
- package/ui.dropdown-badge/storybook/stories.ts +13 -40
- package/ui.dropdown-button/storybook/stories.ts +15 -42
- package/ui.dropdown-link/storybook/stories.ts +31 -58
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M483.52-247q16.48 0 28.2-11.72 11.71-11.71 11.71-28.35 0-16.63-11.71-28.19-11.72-11.57-28.32-11.57t-28.19 11.55q-11.6 11.54-11.6 28.33 0 16.52 11.63 28.23Q466.87-247 483.52-247Zm-36.91-146h62.59q0-25.52 6.5-47.02 6.5-21.5 39.78-49.02 30.52-25.05 43.4-50.34 12.88-25.29 12.88-55.69 0-53.69-34.09-86.05t-91.19-32.36q-49.72 0-88.06 25.46-38.33 25.45-55.81 69.45l56.82 21.4q11.24-28.24 32.88-43.62 21.64-15.38 50.21-15.38 31.73 0 51.83 17.58 20.11 17.58 20.11 45.47 0 21.12-12.64 40.38-12.65 19.26-36.45 39.07-29.52 25.52-44.14 51.75-14.62 26.24-14.62 68.92Zm33.42 318.98q-83.46 0-157.54-31.88-74.07-31.88-129.39-87.2-55.32-55.32-87.2-129.36-31.88-74.04-31.88-157.51 0-84.46 31.88-158.54 31.88-74.07 87.16-128.9 55.28-54.84 129.34-86.82 74.06-31.99 157.55-31.99 84.48 0 158.59 31.97 74.1 31.97 128.91 86.77 54.82 54.8 86.79 128.88 31.98 74.08 31.98 158.6 0 83.5-31.99 157.57-31.98 74.07-86.82 129.36-54.83 55.29-128.87 87.17-74.04 31.88-158.51 31.88Zm-.03-68.13q141.04 0 239.45-98.75 98.4-98.76 98.4-239.1 0-141.04-98.4-239.45-98.41-98.4-239.57-98.4-140.16 0-238.95 98.4-98.78 98.41-98.78 239.57 0 140.16 98.75 238.95 98.76 98.78 239.1 98.78ZM480-480Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 -960 960 960"><path d="M182.15-114.02q-27.6 0-47.86-20.27-20.27-20.26-20.27-47.86v-595.7q0-27.7 20.27-48.03 20.26-20.34 47.86-20.34h298.28v68.37H182.15v595.7h298.28v68.13H182.15Zm481.46-182.37-48.74-48.5 100.8-101.04h-357.1v-68.14h355.1l-100.8-101.04 48.74-48.5L846.22-479 663.61-296.39Z"/></svg>
|
package/package.json
CHANGED
|
@@ -12,6 +12,10 @@ import UButton from "../../ui.button/UButton.vue";
|
|
|
12
12
|
import UCard from "../../ui.container-card/UCard.vue";
|
|
13
13
|
import URow from "../../ui.container-row/URow.vue";
|
|
14
14
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
15
|
+
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
16
|
+
import UAvatar from "../../ui.image-avatar/UAvatar.vue";
|
|
17
|
+
import UDivider from "../../ui.container-divider/UDivider.vue";
|
|
18
|
+
import UText from "../../ui.text-block/UText.vue";
|
|
15
19
|
|
|
16
20
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
17
21
|
import type { Props } from "../types";
|
|
@@ -19,15 +23,56 @@ import type { Props } from "../types";
|
|
|
19
23
|
interface UCollapsibleArgs extends Props {
|
|
20
24
|
slotTemplate?: string;
|
|
21
25
|
enum: "yPosition" | "xPosition";
|
|
26
|
+
class?: string;
|
|
27
|
+
label?: string;
|
|
28
|
+
rowClass?: string;
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
const defaultTemplate = `
|
|
25
|
-
<template #default
|
|
26
|
-
<UButton
|
|
32
|
+
<template #default>
|
|
33
|
+
<UButton label="John Doe" variant="outlined" size="sm" />
|
|
27
34
|
</template>
|
|
28
35
|
|
|
29
36
|
<template #content>
|
|
30
|
-
<UCard
|
|
37
|
+
<UCard class="min-w-[280px] !p-2.5">
|
|
38
|
+
<URow align="center" gap="sm" class="mb-2">
|
|
39
|
+
<UAvatar label="John Doe" size="md" />
|
|
40
|
+
<UCol gap="none">
|
|
41
|
+
<UText size="sm">John Doe</UText>
|
|
42
|
+
<UText variant="lifted" size="xs">john.doe@example.com</UText>
|
|
43
|
+
</UCol>
|
|
44
|
+
</URow>
|
|
45
|
+
<UDivider />
|
|
46
|
+
<UCol gap="2xs" class="mt-2">
|
|
47
|
+
<UButton
|
|
48
|
+
label="Settings"
|
|
49
|
+
variant="subtle"
|
|
50
|
+
size="sm"
|
|
51
|
+
left-icon="settings"
|
|
52
|
+
color="neutral"
|
|
53
|
+
block
|
|
54
|
+
class="justify-start"
|
|
55
|
+
/>
|
|
56
|
+
<UButton
|
|
57
|
+
label="Help & Support"
|
|
58
|
+
variant="subtle"
|
|
59
|
+
size="sm"
|
|
60
|
+
left-icon="help"
|
|
61
|
+
color="info"
|
|
62
|
+
block
|
|
63
|
+
class="justify-start"
|
|
64
|
+
/>
|
|
65
|
+
<UButton
|
|
66
|
+
label="Sign Out"
|
|
67
|
+
variant="subtle"
|
|
68
|
+
size="sm"
|
|
69
|
+
left-icon="logout"
|
|
70
|
+
color="error"
|
|
71
|
+
block
|
|
72
|
+
class="justify-start"
|
|
73
|
+
/>
|
|
74
|
+
</UCol>
|
|
75
|
+
</UCard>
|
|
31
76
|
</template>
|
|
32
77
|
`;
|
|
33
78
|
|
|
@@ -52,7 +97,7 @@ export default {
|
|
|
52
97
|
} as Meta;
|
|
53
98
|
|
|
54
99
|
const DefaultTemplate: StoryFn<UCollapsibleArgs> = (args: UCollapsibleArgs) => ({
|
|
55
|
-
components: { UCollapsible, UButton, UCard },
|
|
100
|
+
components: { UCollapsible, UButton, UCard, UIcon, UAvatar, UDivider, UText, UCol, URow },
|
|
56
101
|
setup: () => ({ args, slots: getSlotNames(UCollapsible.__name) }),
|
|
57
102
|
template: `
|
|
58
103
|
<UCollapsible v-bind="args">
|
|
@@ -62,17 +107,65 @@ const DefaultTemplate: StoryFn<UCollapsibleArgs> = (args: UCollapsibleArgs) => (
|
|
|
62
107
|
});
|
|
63
108
|
|
|
64
109
|
const EnumTemplate: StoryFn<UCollapsibleArgs> = (args: UCollapsibleArgs, { argTypes }) => ({
|
|
65
|
-
components: { UCollapsible, UButton, UCard, URow },
|
|
66
|
-
setup: () =>
|
|
110
|
+
components: { UCollapsible, UButton, UCard, UIcon, UAvatar, UDivider, UText, UCol, URow },
|
|
111
|
+
setup: () => {
|
|
112
|
+
const openStates = ref<Record<string, boolean>>({});
|
|
113
|
+
|
|
114
|
+
return { args, argTypes, getArgs, openStates };
|
|
115
|
+
},
|
|
67
116
|
template: `
|
|
68
|
-
<URow>
|
|
117
|
+
<URow :class="args.rowClass">
|
|
69
118
|
<UCollapsible
|
|
70
119
|
v-for="option in argTypes?.[args.enum]?.options"
|
|
71
120
|
v-bind="getArgs(args, option)"
|
|
72
|
-
v-model:open="
|
|
121
|
+
v-model:open="openStates[option]"
|
|
73
122
|
:key="option"
|
|
74
123
|
>
|
|
75
|
-
|
|
124
|
+
<template #default>
|
|
125
|
+
<UButton :label="option" variant="outlined" size="sm" />
|
|
126
|
+
</template>
|
|
127
|
+
|
|
128
|
+
<template #content>
|
|
129
|
+
<UCard class="min-w-[280px] !p-2.5">
|
|
130
|
+
<URow align="center" gap="sm" class="mb-2">
|
|
131
|
+
<UAvatar label="John Doe" size="md" />
|
|
132
|
+
<UCol gap="none">
|
|
133
|
+
<UText size="sm">John Doe</UText>
|
|
134
|
+
<UText variant="lifted" size="xs">john.doe@example.com</UText>
|
|
135
|
+
</UCol>
|
|
136
|
+
</URow>
|
|
137
|
+
<UDivider />
|
|
138
|
+
<UCol gap="2xs" class="mt-2">
|
|
139
|
+
<UButton
|
|
140
|
+
label="Settings"
|
|
141
|
+
variant="subtle"
|
|
142
|
+
size="sm"
|
|
143
|
+
left-icon="settings"
|
|
144
|
+
color="neutral"
|
|
145
|
+
block
|
|
146
|
+
class="justify-start"
|
|
147
|
+
/>
|
|
148
|
+
<UButton
|
|
149
|
+
label="Help & Support"
|
|
150
|
+
variant="subtle"
|
|
151
|
+
size="sm"
|
|
152
|
+
left-icon="help"
|
|
153
|
+
color="info"
|
|
154
|
+
block
|
|
155
|
+
class="justify-start"
|
|
156
|
+
/>
|
|
157
|
+
<UButton
|
|
158
|
+
label="Sign Out"
|
|
159
|
+
variant="subtle"
|
|
160
|
+
size="sm"
|
|
161
|
+
left-icon="logout"
|
|
162
|
+
color="error"
|
|
163
|
+
block
|
|
164
|
+
class="justify-start"
|
|
165
|
+
/>
|
|
166
|
+
</UCol>
|
|
167
|
+
</UCard>
|
|
168
|
+
</template>
|
|
76
169
|
</UCollapsible>
|
|
77
170
|
</URow>
|
|
78
171
|
`,
|
|
@@ -81,14 +174,40 @@ const EnumTemplate: StoryFn<UCollapsibleArgs> = (args: UCollapsibleArgs, { argTy
|
|
|
81
174
|
export const Default = DefaultTemplate.bind({});
|
|
82
175
|
Default.args = {};
|
|
83
176
|
|
|
84
|
-
export const
|
|
85
|
-
|
|
177
|
+
export const Disabled: StoryFn<UCollapsibleArgs> = (args) => ({
|
|
178
|
+
components: { UCollapsible, UButton, UCard, UDivider, UText, UIcon, UCol, URow },
|
|
179
|
+
setup() {
|
|
180
|
+
return { args };
|
|
181
|
+
},
|
|
182
|
+
template: `
|
|
183
|
+
<UCollapsible disabled>
|
|
184
|
+
<UButton label="John Doe" disabled variant="subtle" size="sm" />
|
|
185
|
+
</UCollapsible>
|
|
186
|
+
`,
|
|
187
|
+
});
|
|
188
|
+
Disabled.parameters = {
|
|
189
|
+
docs: {
|
|
190
|
+
story: {
|
|
191
|
+
height: "120px",
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const XPosition = EnumTemplate.bind({});
|
|
197
|
+
XPosition.args = {
|
|
198
|
+
enum: "xPosition",
|
|
199
|
+
label: "{enumValue}",
|
|
200
|
+
rowClass: "w-full justify-center gap-96",
|
|
201
|
+
};
|
|
86
202
|
|
|
87
|
-
export const
|
|
88
|
-
|
|
203
|
+
export const YPosition = EnumTemplate.bind({});
|
|
204
|
+
YPosition.args = { enum: "yPosition", label: "{enumValue}" };
|
|
205
|
+
YPosition.parameters = {
|
|
206
|
+
storyClasses: "h-[500px] flex items-center px-6 pt-8 pb-12",
|
|
207
|
+
};
|
|
89
208
|
|
|
90
209
|
export const NonAbsolute: StoryFn<UCollapsibleArgs> = (args) => ({
|
|
91
|
-
components: { UCollapsible, UButton, UCard, UCol },
|
|
210
|
+
components: { UCollapsible, UButton, UCard, UCol, UDivider, UText },
|
|
92
211
|
setup() {
|
|
93
212
|
return { args };
|
|
94
213
|
},
|
|
@@ -112,150 +231,8 @@ export const NonAbsolute: StoryFn<UCollapsibleArgs> = (args) => ({
|
|
|
112
231
|
`,
|
|
113
232
|
});
|
|
114
233
|
|
|
115
|
-
export const
|
|
116
|
-
|
|
117
|
-
setup() {
|
|
118
|
-
const isOpen = ref(false);
|
|
119
|
-
|
|
120
|
-
function toggle() {
|
|
121
|
-
isOpen.value = !isOpen.value;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return { args, isOpen, toggle };
|
|
125
|
-
},
|
|
126
|
-
template: `
|
|
127
|
-
<UCol gap="md">
|
|
128
|
-
<URow gap="md">
|
|
129
|
-
<UButton label="Toggle Collapsible" @click="toggle" />
|
|
130
|
-
<UButton :label="isOpen ? 'Close' : 'Open'" variant="outlined" @click="isOpen = !isOpen" />
|
|
131
|
-
</URow>
|
|
132
|
-
|
|
133
|
-
<UCollapsible v-model:open="isOpen">
|
|
134
|
-
<template #default="{ opened }">
|
|
135
|
-
<UButton :label="opened ? 'Opened' : 'Closed'" color="secondary" />
|
|
136
|
-
</template>
|
|
137
|
-
<template #content>
|
|
138
|
-
<UCard
|
|
139
|
-
title="Controlled Content"
|
|
140
|
-
description="This collapsible is controlled by v-model. Use the buttons above to toggle it."
|
|
141
|
-
/>
|
|
142
|
-
</template>
|
|
143
|
-
</UCollapsible>
|
|
144
|
-
</UCol>
|
|
145
|
-
`,
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
export const CloseOnOutside: StoryFn<UCollapsibleArgs> = (args) => ({
|
|
149
|
-
components: { UCollapsible, UButton, UCard },
|
|
150
|
-
setup() {
|
|
151
|
-
return { args };
|
|
152
|
-
},
|
|
153
|
-
template: `
|
|
154
|
-
<div class="p-8">
|
|
155
|
-
<p class="mb-4 text-sm text-gray-600">Click outside the collapsible content to close it.</p>
|
|
156
|
-
<UCollapsible close-on-outside>
|
|
157
|
-
<template #default="{ opened }">
|
|
158
|
-
<UButton :label="opened ? 'Close' : 'Open'" />
|
|
159
|
-
</template>
|
|
160
|
-
<template #content>
|
|
161
|
-
<UCard
|
|
162
|
-
title="Click Outside to Close"
|
|
163
|
-
description="This collapsible will close when you click outside of it."
|
|
164
|
-
/>
|
|
165
|
-
</template>
|
|
166
|
-
</UCollapsible>
|
|
167
|
-
</div>
|
|
168
|
-
`,
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
export const CloseOnContent: StoryFn<UCollapsibleArgs> = (args) => ({
|
|
172
|
-
components: { UCollapsible, UButton, UCard },
|
|
173
|
-
setup() {
|
|
174
|
-
return { args };
|
|
175
|
-
},
|
|
176
|
-
template: `
|
|
177
|
-
<div class="p-8">
|
|
178
|
-
<p class="mb-4 text-sm text-gray-600">Click on the content to close the collapsible.</p>
|
|
179
|
-
<UCollapsible close-on-content>
|
|
180
|
-
<template #default="{ opened }">
|
|
181
|
-
<UButton :label="opened ? 'Close' : 'Open'" />
|
|
182
|
-
</template>
|
|
183
|
-
<template #content>
|
|
184
|
-
<UCard
|
|
185
|
-
title="Click Content to Close"
|
|
186
|
-
description="Click anywhere on this card to close the collapsible."
|
|
187
|
-
/>
|
|
188
|
-
</template>
|
|
189
|
-
</UCollapsible>
|
|
190
|
-
</div>
|
|
191
|
-
`,
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
export const Disabled: StoryFn<UCollapsibleArgs> = (args) => ({
|
|
195
|
-
components: { UCollapsible, UButton, UCard },
|
|
196
|
-
setup() {
|
|
197
|
-
return { args };
|
|
198
|
-
},
|
|
199
|
-
template: `
|
|
200
|
-
<UCollapsible disabled>
|
|
201
|
-
<template #default="{ opened }">
|
|
202
|
-
<UButton :label="opened ? 'Close' : 'Open'" disabled />
|
|
203
|
-
</template>
|
|
204
|
-
<template #content>
|
|
205
|
-
<UCard title="Disabled Content" description="This content cannot be shown." />
|
|
206
|
-
</template>
|
|
207
|
-
</UCollapsible>
|
|
208
|
-
`,
|
|
209
|
-
});
|
|
234
|
+
export const NoCloseOnOutside = DefaultTemplate.bind({});
|
|
235
|
+
NoCloseOnOutside.args = { closeOnOutside: false };
|
|
210
236
|
|
|
211
|
-
export const
|
|
212
|
-
|
|
213
|
-
setup() {
|
|
214
|
-
return { args };
|
|
215
|
-
},
|
|
216
|
-
template: `
|
|
217
|
-
<URow gap="xl">
|
|
218
|
-
<UCollapsible>
|
|
219
|
-
<template #default="{ opened }">
|
|
220
|
-
<UButton
|
|
221
|
-
:label="opened ? 'Hide Menu' : 'Show Menu'"
|
|
222
|
-
:left-icon="opened ? 'expand_less' : 'expand_more'"
|
|
223
|
-
/>
|
|
224
|
-
</template>
|
|
225
|
-
<template #content>
|
|
226
|
-
<UCard class="w-64">
|
|
227
|
-
<div class="p-4 space-y-2">
|
|
228
|
-
<div class="hover:bg-gray-100 p-2 rounded cursor-pointer">Menu Item 1</div>
|
|
229
|
-
<div class="hover:bg-gray-100 p-2 rounded cursor-pointer">Menu Item 2</div>
|
|
230
|
-
<div class="hover:bg-gray-100 p-2 rounded cursor-pointer">Menu Item 3</div>
|
|
231
|
-
<div class="hover:bg-gray-100 p-2 rounded cursor-pointer">Menu Item 4</div>
|
|
232
|
-
</div>
|
|
233
|
-
</UCard>
|
|
234
|
-
</template>
|
|
235
|
-
</UCollapsible>
|
|
236
|
-
|
|
237
|
-
<UCollapsible y-position="top">
|
|
238
|
-
<template #default="{ opened }">
|
|
239
|
-
<UButton
|
|
240
|
-
:label="opened ? 'Hide Tooltip' : 'Show Tooltip'"
|
|
241
|
-
variant="outlined"
|
|
242
|
-
/>
|
|
243
|
-
</template>
|
|
244
|
-
<template #content>
|
|
245
|
-
<UCard class="w-48">
|
|
246
|
-
<div class="p-3 text-sm">
|
|
247
|
-
This is a tooltip-like collapsible that appears above the trigger.
|
|
248
|
-
</div>
|
|
249
|
-
</UCard>
|
|
250
|
-
</template>
|
|
251
|
-
</UCollapsible>
|
|
252
|
-
</URow>
|
|
253
|
-
`,
|
|
254
|
-
});
|
|
255
|
-
CustomContent.parameters = {
|
|
256
|
-
docs: {
|
|
257
|
-
story: {
|
|
258
|
-
height: "300px",
|
|
259
|
-
},
|
|
260
|
-
},
|
|
261
|
-
};
|
|
237
|
+
export const CloseOnContent = DefaultTemplate.bind({});
|
|
238
|
+
CloseOnContent.args = { closeOnContent: true };
|
|
@@ -56,7 +56,7 @@ export default {
|
|
|
56
56
|
} as Meta;
|
|
57
57
|
|
|
58
58
|
const defaultTemplate = `
|
|
59
|
-
<UAvatar label="
|
|
59
|
+
<UAvatar label="John Doe" />
|
|
60
60
|
`;
|
|
61
61
|
|
|
62
62
|
const DefaultTemplate: StoryFn<DefaultUDropdownArgs> = (args: DefaultUDropdownArgs) => ({
|
|
@@ -90,7 +90,7 @@ const EnumTemplate: StoryFn<EnumUDropdownArgs> = (args: EnumUDropdownArgs, { arg
|
|
|
90
90
|
:key="option"
|
|
91
91
|
#default="{ opened }"
|
|
92
92
|
>
|
|
93
|
-
<UButton :[args.enum]="option" :label="option" :class="args.buttonClass"
|
|
93
|
+
<UButton :[args.enum]="option" :label="option" :class="args.buttonClass" />
|
|
94
94
|
</UDropdown>
|
|
95
95
|
</URow>
|
|
96
96
|
`,
|
|
@@ -237,7 +237,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownArgs> = (args) => ({
|
|
|
237
237
|
{ label: 'Mike Johnson', value: '3', role: 'Product Manager' },
|
|
238
238
|
]"
|
|
239
239
|
>
|
|
240
|
-
<UAvatar label="
|
|
240
|
+
<UAvatar label="John Doe" />
|
|
241
241
|
<template #before-option="{ option }">
|
|
242
242
|
<UIcon name="person" size="xs" color="neutral" />
|
|
243
243
|
</template>
|
|
@@ -250,7 +250,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownArgs> = (args) => ({
|
|
|
250
250
|
{ label: 'Mike Johnson', value: '3', role: 'Product Manager', status: 'offline', statusColor: 'grayscale' },
|
|
251
251
|
]"
|
|
252
252
|
>
|
|
253
|
-
<UAvatar label="
|
|
253
|
+
<UAvatar label="Jane Smith" />
|
|
254
254
|
<template #option="{ option }">
|
|
255
255
|
<URow align="center" gap="xs" justify="between" class="w-40">
|
|
256
256
|
<UCol gap="none">
|
|
@@ -269,7 +269,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownArgs> = (args) => ({
|
|
|
269
269
|
{ label: 'Mike Johnson', value: '3', verified: false },
|
|
270
270
|
]"
|
|
271
271
|
>
|
|
272
|
-
<UAvatar label="
|
|
272
|
+
<UAvatar label="Mike Johnson" />
|
|
273
273
|
<template #after-option="{ option }">
|
|
274
274
|
<UIcon v-if="option.verified" name="verified" size="xs" color="success" />
|
|
275
275
|
</template>
|
|
@@ -158,6 +158,13 @@ Default.parameters = {
|
|
|
158
158
|
|
|
159
159
|
export const Disabled = DefaultTemplate.bind({});
|
|
160
160
|
Disabled.args = { disabled: true };
|
|
161
|
+
Disabled.parameters = {
|
|
162
|
+
docs: {
|
|
163
|
+
story: {
|
|
164
|
+
height: "120px",
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
};
|
|
161
168
|
|
|
162
169
|
export const Searchable = DefaultTemplate.bind({});
|
|
163
170
|
Searchable.args = { searchable: true };
|
|
@@ -378,7 +385,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownBadgeArgs> = (args) => ({
|
|
|
378
385
|
]"
|
|
379
386
|
>
|
|
380
387
|
<template #before-option="{ option }">
|
|
381
|
-
<UAvatar :src="option.avatar" size="
|
|
388
|
+
<UAvatar :src="option.avatar" size="xs" />
|
|
382
389
|
</template>
|
|
383
390
|
</UDropdownBadge>
|
|
384
391
|
|
|
@@ -421,7 +428,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownBadgeArgs> = (args) => ({
|
|
|
421
428
|
]"
|
|
422
429
|
>
|
|
423
430
|
<template #option="{ option }">
|
|
424
|
-
<URow align="center" gap="xs">
|
|
431
|
+
<URow justify="between" align="center" gap="xs" block>
|
|
425
432
|
<UCol gap="none">
|
|
426
433
|
<UText size="sm">{{ option.label }}</UText>
|
|
427
434
|
<UText variant="lifted" size="xs">{{ option.role }}</UText>
|
|
@@ -440,47 +447,13 @@ export const OptionSlots: StoryFn<DefaultUDropdownBadgeArgs> = (args) => ({
|
|
|
440
447
|
v-model="args.afterOptionModel"
|
|
441
448
|
label="After option slot"
|
|
442
449
|
:options="[
|
|
443
|
-
{
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
role: 'Developer',
|
|
447
|
-
avatar: johnDoe,
|
|
448
|
-
status: 'online',
|
|
449
|
-
statusColor: 'success',
|
|
450
|
-
},
|
|
451
|
-
{
|
|
452
|
-
label: 'Jane Smith',
|
|
453
|
-
value: '2',
|
|
454
|
-
role: 'Designer',
|
|
455
|
-
avatar: emilyDavis,
|
|
456
|
-
status: 'away',
|
|
457
|
-
statusColor: 'warning',
|
|
458
|
-
},
|
|
459
|
-
{
|
|
460
|
-
label: 'Mike Johnson',
|
|
461
|
-
value: '3',
|
|
462
|
-
role: 'Product Manager',
|
|
463
|
-
avatar: alexJohnson,
|
|
464
|
-
status: 'offline',
|
|
465
|
-
statusColor: 'grayscale',
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
label: 'Sarah Wilson',
|
|
469
|
-
value: '4',
|
|
470
|
-
role: 'QA Engineer',
|
|
471
|
-
avatar: patMorgan,
|
|
472
|
-
status: 'online',
|
|
473
|
-
statusColor: 'success',
|
|
474
|
-
},
|
|
450
|
+
{ label: 'John Doe', value: '1', verified: true },
|
|
451
|
+
{ label: 'Jane Smith', value: '2', verified: true },
|
|
452
|
+
{ label: 'Mike Johnson', value: '3', verified: false },
|
|
475
453
|
]"
|
|
476
454
|
>
|
|
477
455
|
<template #after-option="{ option }">
|
|
478
|
-
<
|
|
479
|
-
:label="option.status"
|
|
480
|
-
:color="option.statusColor"
|
|
481
|
-
size="sm"
|
|
482
|
-
variant="subtle"
|
|
483
|
-
/>
|
|
456
|
+
<UIcon v-if="option.verified" name="verified" size="xs" color="success" />
|
|
484
457
|
</template>
|
|
485
458
|
</UDropdownBadge>
|
|
486
459
|
</URow>
|
|
@@ -160,13 +160,20 @@ Default.parameters = {
|
|
|
160
160
|
|
|
161
161
|
export const Disabled = DefaultTemplate.bind({});
|
|
162
162
|
Disabled.args = { disabled: true };
|
|
163
|
+
Disabled.parameters = {
|
|
164
|
+
docs: {
|
|
165
|
+
story: {
|
|
166
|
+
height: "120px",
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
};
|
|
163
170
|
|
|
164
171
|
export const Searchable = DefaultTemplate.bind({});
|
|
165
172
|
Searchable.args = { searchable: true };
|
|
166
173
|
Searchable.parameters = {
|
|
167
174
|
docs: {
|
|
168
175
|
story: {
|
|
169
|
-
height: "
|
|
176
|
+
height: "270px",
|
|
170
177
|
},
|
|
171
178
|
},
|
|
172
179
|
};
|
|
@@ -176,7 +183,7 @@ SearchModelValue.args = { searchable: true, search: "Copy" };
|
|
|
176
183
|
SearchModelValue.parameters = {
|
|
177
184
|
docs: {
|
|
178
185
|
story: {
|
|
179
|
-
height: "
|
|
186
|
+
height: "270px",
|
|
180
187
|
},
|
|
181
188
|
},
|
|
182
189
|
};
|
|
@@ -398,7 +405,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownButtonArgs> = (args) => ({
|
|
|
398
405
|
]"
|
|
399
406
|
>
|
|
400
407
|
<template #before-option="{ option }">
|
|
401
|
-
<UAvatar :src="option.avatar" size="
|
|
408
|
+
<UAvatar :src="option.avatar" size="xs" />
|
|
402
409
|
</template>
|
|
403
410
|
</UDropdownButton>
|
|
404
411
|
|
|
@@ -441,7 +448,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownButtonArgs> = (args) => ({
|
|
|
441
448
|
]"
|
|
442
449
|
>
|
|
443
450
|
<template #option="{ option }">
|
|
444
|
-
<URow align="center" gap="xs">
|
|
451
|
+
<URow justify="between" align="center" gap="xs" block>
|
|
445
452
|
<UCol gap="none">
|
|
446
453
|
<UText size="sm">{{ option.label }}</UText>
|
|
447
454
|
<UText variant="lifted" size="xs">{{ option.role }}</UText>
|
|
@@ -460,47 +467,13 @@ export const OptionSlots: StoryFn<DefaultUDropdownButtonArgs> = (args) => ({
|
|
|
460
467
|
v-model="args.afterOptionModel"
|
|
461
468
|
label="After option slot"
|
|
462
469
|
:options="[
|
|
463
|
-
{
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
role: 'Developer',
|
|
467
|
-
avatar: johnDoe,
|
|
468
|
-
status: 'online',
|
|
469
|
-
statusColor: 'success',
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
label: 'Jane Smith',
|
|
473
|
-
value: '2',
|
|
474
|
-
role: 'Designer',
|
|
475
|
-
avatar: emilyDavis,
|
|
476
|
-
status: 'away',
|
|
477
|
-
statusColor: 'warning',
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
label: 'Mike Johnson',
|
|
481
|
-
value: '3',
|
|
482
|
-
role: 'Product Manager',
|
|
483
|
-
avatar: alexJohnson,
|
|
484
|
-
status: 'offline',
|
|
485
|
-
statusColor: 'grayscale',
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
label: 'Sarah Wilson',
|
|
489
|
-
value: '4',
|
|
490
|
-
role: 'QA Engineer',
|
|
491
|
-
avatar: patMorgan,
|
|
492
|
-
status: 'online',
|
|
493
|
-
statusColor: 'success',
|
|
494
|
-
},
|
|
470
|
+
{ label: 'John Doe', value: '1', verified: true },
|
|
471
|
+
{ label: 'Jane Smith', value: '2', verified: true },
|
|
472
|
+
{ label: 'Mike Johnson', value: '3', verified: false },
|
|
495
473
|
]"
|
|
496
474
|
>
|
|
497
475
|
<template #after-option="{ option }">
|
|
498
|
-
<
|
|
499
|
-
:label="option.status"
|
|
500
|
-
:color="option.statusColor"
|
|
501
|
-
size="sm"
|
|
502
|
-
variant="subtle"
|
|
503
|
-
/>
|
|
476
|
+
<UIcon v-if="option.verified" name="verified" size="xs" color="success" />
|
|
504
477
|
</template>
|
|
505
478
|
</UDropdownButton>
|
|
506
479
|
</URow>
|
|
@@ -98,29 +98,29 @@ const EnumTemplate: StoryFn<EnumUDropdownLinkArgs> = (
|
|
|
98
98
|
const GroupValuesTemplate: StoryFn<DefaultUDropdownLinkArgs> = (
|
|
99
99
|
args: DefaultUDropdownLinkArgs,
|
|
100
100
|
) => ({
|
|
101
|
-
components: { UDropdownLink },
|
|
101
|
+
components: { UDropdownLink, URow },
|
|
102
102
|
setup() {
|
|
103
103
|
return {
|
|
104
104
|
args,
|
|
105
105
|
};
|
|
106
106
|
},
|
|
107
107
|
template: `
|
|
108
|
-
<
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
108
|
+
<URow gap="2xl">
|
|
109
|
+
<UDropdownLink
|
|
110
|
+
v-bind="args"
|
|
111
|
+
v-model="args.modelValue"
|
|
112
|
+
label="Single"
|
|
113
|
+
:config="{ listbox: 'min-w-[200px]' }"
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
<UDropdownLink
|
|
117
|
+
v-bind="args"
|
|
118
|
+
v-model="args.modelValueMultiple"
|
|
119
|
+
label="Multiple"
|
|
120
|
+
multiple
|
|
121
|
+
:config="{ listbox: 'min-w-[200px]' }"
|
|
122
|
+
/>
|
|
123
|
+
</URow>
|
|
124
124
|
`,
|
|
125
125
|
});
|
|
126
126
|
|
|
@@ -136,6 +136,13 @@ Default.parameters = {
|
|
|
136
136
|
|
|
137
137
|
export const Disabled = DefaultTemplate.bind({});
|
|
138
138
|
Disabled.args = { disabled: true };
|
|
139
|
+
Disabled.parameters = {
|
|
140
|
+
docs: {
|
|
141
|
+
story: {
|
|
142
|
+
height: "120px",
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
};
|
|
139
146
|
|
|
140
147
|
export const Searchable = DefaultTemplate.bind({});
|
|
141
148
|
Searchable.args = { searchable: true };
|
|
@@ -176,7 +183,7 @@ export const ListboxXPosition = EnumTemplate.bind({});
|
|
|
176
183
|
ListboxXPosition.args = {
|
|
177
184
|
enum: "xPosition",
|
|
178
185
|
label: "{enumValue}",
|
|
179
|
-
|
|
186
|
+
config: { dropdownLink: "w-40 py-1 px-2.5 border border-dashed border-primary" },
|
|
180
187
|
};
|
|
181
188
|
|
|
182
189
|
export const ListboxYPosition = EnumTemplate.bind({});
|
|
@@ -364,7 +371,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownLinkArgs> = (args) => ({
|
|
|
364
371
|
]"
|
|
365
372
|
>
|
|
366
373
|
<template #before-option="{ option }">
|
|
367
|
-
<UAvatar :src="option.avatar" size="
|
|
374
|
+
<UAvatar :src="option.avatar" size="xs" />
|
|
368
375
|
</template>
|
|
369
376
|
</UDropdownLink>
|
|
370
377
|
|
|
@@ -407,7 +414,7 @@ export const OptionSlots: StoryFn<DefaultUDropdownLinkArgs> = (args) => ({
|
|
|
407
414
|
]"
|
|
408
415
|
>
|
|
409
416
|
<template #option="{ option }">
|
|
410
|
-
<URow align="center" gap="xs">
|
|
417
|
+
<URow justify="between" align="center" gap="xs" block>
|
|
411
418
|
<UCol gap="none">
|
|
412
419
|
<UText size="sm">{{ option.label }}</UText>
|
|
413
420
|
<UText variant="lifted" size="xs">{{ option.role }}</UText>
|
|
@@ -426,47 +433,13 @@ export const OptionSlots: StoryFn<DefaultUDropdownLinkArgs> = (args) => ({
|
|
|
426
433
|
v-model="args.afterOptionModel"
|
|
427
434
|
label="After option slot"
|
|
428
435
|
:options="[
|
|
429
|
-
{
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
role: 'Developer',
|
|
433
|
-
avatar: johnDoe,
|
|
434
|
-
status: 'online',
|
|
435
|
-
statusColor: 'success',
|
|
436
|
-
},
|
|
437
|
-
{
|
|
438
|
-
label: 'Jane Smith',
|
|
439
|
-
value: '2',
|
|
440
|
-
role: 'Designer',
|
|
441
|
-
avatar: emilyDavis,
|
|
442
|
-
status: 'away',
|
|
443
|
-
statusColor: 'warning',
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
label: 'Mike Johnson',
|
|
447
|
-
value: '3',
|
|
448
|
-
role: 'Product Manager',
|
|
449
|
-
avatar: alexJohnson,
|
|
450
|
-
status: 'offline',
|
|
451
|
-
statusColor: 'grayscale',
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
label: 'Sarah Wilson',
|
|
455
|
-
value: '4',
|
|
456
|
-
role: 'QA Engineer',
|
|
457
|
-
avatar: patMorgan,
|
|
458
|
-
status: 'online',
|
|
459
|
-
statusColor: 'success',
|
|
460
|
-
},
|
|
436
|
+
{ label: 'John Doe', value: '1', verified: true },
|
|
437
|
+
{ label: 'Jane Smith', value: '2', verified: true },
|
|
438
|
+
{ label: 'Mike Johnson', value: '3', verified: false },
|
|
461
439
|
]"
|
|
462
440
|
>
|
|
463
441
|
<template #after-option="{ option }">
|
|
464
|
-
<
|
|
465
|
-
:label="option.status"
|
|
466
|
-
:color="option.statusColor"
|
|
467
|
-
size="sm"
|
|
468
|
-
variant="subtle"
|
|
469
|
-
/>
|
|
442
|
+
<UIcon v-if="option.verified" name="verified" size="xs" color="success" />
|
|
470
443
|
</template>
|
|
471
444
|
</UDropdownLink>
|
|
472
445
|
</URow>
|