vueless 1.4.7-beta.0 → 1.4.7-beta.2
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/cloud_sync.svg +1 -0
- package/icons/storybook/date_range.svg +1 -0
- package/icons/storybook/event.svg +1 -0
- package/icons/storybook/folder.svg +1 -0
- package/icons/storybook/format_quote.svg +1 -0
- package/icons/storybook/local_shipping.svg +1 -0
- package/icons/storybook/location_city.svg +1 -0
- package/icons/storybook/mark_email_unread.svg +1 -0
- package/icons/storybook/notifications.svg +1 -0
- package/icons/storybook/shield.svg +1 -0
- package/icons/storybook/workspace_premium.svg +1 -0
- package/package.json +1 -1
- package/ui.container-col/config.ts +4 -2
- package/ui.container-col/tests/UCol.test.ts +24 -16
- package/ui.container-row/config.ts +4 -2
- package/ui.container-row/tests/URow.test.ts +24 -16
- package/ui.form-checkbox/UCheckbox.vue +0 -5
- package/ui.form-checkbox/storybook/stories.ts +56 -18
- package/ui.form-checkbox/tests/UCheckbox.test.ts +0 -17
- package/ui.form-checkbox-group/storybook/stories.ts +61 -0
- package/ui.form-date-picker/storybook/stories.ts +85 -37
- package/ui.form-date-picker-range/storybook/stories.ts +97 -38
- package/ui.form-input/storybook/stories.ts +75 -37
- package/ui.form-input-file/storybook/stories.ts +44 -5
- package/ui.form-input-number/storybook/stories.ts +66 -28
- package/ui.form-input-password/storybook/stories.ts +94 -50
- package/ui.form-input-search/storybook/stories.ts +40 -4
- package/ui.form-label/ULabel.vue +0 -6
- package/ui.form-label/storybook/stories.ts +46 -24
- package/ui.form-label/tests/ULabel.test.ts +0 -12
- package/ui.form-radio/URadio.vue +0 -5
- package/ui.form-radio/storybook/stories.ts +65 -25
- package/ui.form-radio/tests/URadio.test.ts +0 -17
- package/ui.form-radio-group/storybook/stories.ts +67 -0
- package/ui.form-select/storybook/stories.ts +99 -44
- package/ui.form-switch/storybook/stories.ts +35 -11
- package/ui.form-textarea/storybook/stories.ts +61 -20
- package/ui.text-files/storybook/stories.ts +30 -13
|
@@ -334,54 +334,109 @@ export const IconProps: StoryFn<USelectArgs> = (args) => ({
|
|
|
334
334
|
});
|
|
335
335
|
|
|
336
336
|
export const Slots: StoryFn<USelectArgs> = (args) => ({
|
|
337
|
-
components: { USelect, URow, UIcon, UText },
|
|
338
|
-
setup: () => ({
|
|
337
|
+
components: { USelect, URow, UCol, UIcon, UText, ULink },
|
|
338
|
+
setup: () => ({
|
|
339
|
+
args,
|
|
340
|
+
leftSlotModel: ref("paypal"),
|
|
341
|
+
rightSlotModel: ref("bank"),
|
|
342
|
+
descriptionSlotModel: ref(null),
|
|
343
|
+
errorSlotModel: ref(null),
|
|
344
|
+
}),
|
|
339
345
|
template: `
|
|
340
|
-
<
|
|
341
|
-
<
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
<
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
346
|
+
<UCol gap="3xl">
|
|
347
|
+
<URow block>
|
|
348
|
+
<USelect
|
|
349
|
+
v-model="leftSlotModel"
|
|
350
|
+
label="Select Payment Method"
|
|
351
|
+
:options="[
|
|
352
|
+
{ label: 'Visa', value: 'visa', icon: 'credit_card', details: '•••• 4242' },
|
|
353
|
+
{ label: 'PayPal', value: 'paypal', icon: 'payments', details: 'user@example.com' },
|
|
354
|
+
{ label: 'Bank Transfer', value: 'bank', icon: 'account_balance', details: 'Acct **** 1234' },
|
|
355
|
+
{ label: 'Apple Pay', value: 'apple', icon: 'phone_iphone', details: 'iPhone 15' },
|
|
356
|
+
]"
|
|
357
|
+
>
|
|
358
|
+
<template #left="{ options }">
|
|
359
|
+
<UIcon
|
|
360
|
+
v-if="leftSlotModel"
|
|
361
|
+
:name="options?.icon"
|
|
362
|
+
color="primary"
|
|
363
|
+
size="sm"
|
|
364
|
+
/>
|
|
365
|
+
</template>
|
|
366
|
+
</USelect>
|
|
367
|
+
|
|
368
|
+
<USelect
|
|
369
|
+
v-model="rightSlotModel"
|
|
370
|
+
label="Select Payment Method"
|
|
371
|
+
:options="[
|
|
372
|
+
{ label: 'Visa', value: 'visa', icon: 'credit_card', details: '•••• 4242' },
|
|
373
|
+
{ label: 'PayPal', value: 'paypal', icon: 'payments', details: 'user@example.com' },
|
|
374
|
+
{ label: 'Bank Transfer', value: 'bank', icon: 'account_balance', details: 'Acct **** 1234' },
|
|
375
|
+
{ label: 'Apple Pay', value: 'apple', icon: 'phone_iphone', details: 'iPhone 15' },
|
|
376
|
+
]"
|
|
377
|
+
>
|
|
378
|
+
<template #right="{ options }">
|
|
379
|
+
<UText
|
|
380
|
+
v-if="rightSlotModel"
|
|
381
|
+
size="sm"
|
|
382
|
+
variant="lifted"
|
|
383
|
+
class="text-nowrap"
|
|
384
|
+
>
|
|
385
|
+
{{ options?.details }}
|
|
386
|
+
</UText>
|
|
387
|
+
</template>
|
|
388
|
+
</USelect>
|
|
389
|
+
</URow>
|
|
360
390
|
|
|
361
|
-
<
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
391
|
+
<URow block>
|
|
392
|
+
<USelect
|
|
393
|
+
v-bind="args"
|
|
394
|
+
v-model="descriptionSlotModel"
|
|
395
|
+
label="City"
|
|
396
|
+
:options="args.options"
|
|
397
|
+
>
|
|
398
|
+
<template #description>
|
|
399
|
+
<URow align="center" gap="2xs" class="text-neutral">
|
|
400
|
+
<UIcon name="location_city" size="xs" color="primary" />
|
|
401
|
+
<UText size="sm">
|
|
402
|
+
Only cities we ship to.
|
|
403
|
+
<ULink label="Shipping zones" underlined size="sm" />.
|
|
404
|
+
</UText>
|
|
405
|
+
</URow>
|
|
406
|
+
</template>
|
|
407
|
+
</USelect>
|
|
408
|
+
|
|
409
|
+
<USelect
|
|
410
|
+
v-bind="args"
|
|
411
|
+
v-model="errorSlotModel"
|
|
412
|
+
label="City"
|
|
413
|
+
:options="args.options"
|
|
414
|
+
:error="true"
|
|
415
|
+
>
|
|
416
|
+
<template #error>
|
|
417
|
+
<URow align="center" gap="2xs">
|
|
418
|
+
<UIcon name="error" size="xs" color="error" />
|
|
419
|
+
<UText size="sm" color="error">
|
|
420
|
+
<ul>
|
|
421
|
+
<li>Please select an option from the list</li>
|
|
422
|
+
<li>The current value is not available anymore</li>
|
|
423
|
+
<li>Pick a valid choice to continue</li>
|
|
424
|
+
</ul>
|
|
425
|
+
</UText>
|
|
426
|
+
</URow>
|
|
427
|
+
</template>
|
|
428
|
+
</USelect>
|
|
429
|
+
</URow>
|
|
430
|
+
</UCol>
|
|
383
431
|
`,
|
|
384
432
|
});
|
|
433
|
+
Slots.parameters = {
|
|
434
|
+
docs: {
|
|
435
|
+
story: {
|
|
436
|
+
height: "400px",
|
|
437
|
+
},
|
|
438
|
+
},
|
|
439
|
+
};
|
|
385
440
|
|
|
386
441
|
export const ToggleSlots: StoryFn<USelectArgs> = (args) => ({
|
|
387
442
|
components: { USelect, URow, UIcon },
|
|
@@ -15,6 +15,7 @@ import ULink from "../../ui.button-link/ULink.vue";
|
|
|
15
15
|
|
|
16
16
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
17
17
|
import type { Props } from "../types";
|
|
18
|
+
import { ref } from "vue";
|
|
18
19
|
|
|
19
20
|
interface USwitchArgs extends Props {
|
|
20
21
|
slotTemplate?: string;
|
|
@@ -89,15 +90,38 @@ ToggleIcon.args = { toggleIcon: true };
|
|
|
89
90
|
export const Disabled = DefaultTemplate.bind({});
|
|
90
91
|
Disabled.args = { disabled: true };
|
|
91
92
|
|
|
92
|
-
export const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<
|
|
97
|
-
<
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
93
|
+
export const Slots: StoryFn<USwitchArgs> = (args) => ({
|
|
94
|
+
components: { USwitch, UCol, UText, URow, ULink, UIcon },
|
|
95
|
+
setup: () => ({ args, labelSlotValue: ref(false), descriptionSlotValue: ref(false) }),
|
|
96
|
+
template: `
|
|
97
|
+
<UCol gap="3xl">
|
|
98
|
+
<USwitch
|
|
99
|
+
v-bind="args"
|
|
100
|
+
v-model="labelSlotValue"
|
|
101
|
+
label="Enable Notifications"
|
|
102
|
+
>
|
|
103
|
+
<template #label="{ label }">
|
|
104
|
+
<URow gap="2xs" align="center">
|
|
105
|
+
<UText :label="label" />
|
|
106
|
+
<UIcon name="notifications" size="xs" />
|
|
107
|
+
</URow>
|
|
108
|
+
</template>
|
|
109
|
+
</USwitch>
|
|
110
|
+
|
|
111
|
+
<USwitch
|
|
112
|
+
v-model="descriptionSlotValue"
|
|
113
|
+
label="Auto-save drafts"
|
|
114
|
+
>
|
|
115
|
+
<template #description>
|
|
116
|
+
<URow align="center" gap="2xs" class="text-neutral">
|
|
117
|
+
<UIcon name="cloud_sync" size="xs" class="mt-0.5" color="primary" />
|
|
118
|
+
<UText size="sm">
|
|
119
|
+
Drafts sync across devices.
|
|
120
|
+
<ULink label="Learn more" underlined size="sm" />.
|
|
121
|
+
</UText>
|
|
122
|
+
</URow>
|
|
123
|
+
</template>
|
|
124
|
+
</USwitch>
|
|
125
|
+
</UCol>
|
|
102
126
|
`,
|
|
103
|
-
};
|
|
127
|
+
});
|
|
@@ -12,9 +12,11 @@ import UCol from "../../ui.container-col/UCol.vue";
|
|
|
12
12
|
import URow from "../../ui.container-row/URow.vue";
|
|
13
13
|
import tooltip from "../../v.tooltip/vTooltip";
|
|
14
14
|
import UText from "../../ui.text-block/UText.vue";
|
|
15
|
+
import ULink from "../../ui.button-link/ULink.vue";
|
|
15
16
|
|
|
16
17
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
17
18
|
import type { Props } from "../types";
|
|
19
|
+
import { ref } from "vue";
|
|
18
20
|
|
|
19
21
|
interface UTextareaArgs extends Props {
|
|
20
22
|
slotTemplate?: string;
|
|
@@ -138,27 +140,66 @@ NoAutocomplete.parameters = {
|
|
|
138
140
|
};
|
|
139
141
|
|
|
140
142
|
export const Slots: StoryFn<UTextareaArgs> = (args) => ({
|
|
141
|
-
components: { UTextarea, URow, UIcon, UText },
|
|
143
|
+
components: { UTextarea, URow, UCol, UIcon, UText, ULink },
|
|
142
144
|
directives: { tooltip },
|
|
143
|
-
setup: () => ({
|
|
145
|
+
setup: () => ({
|
|
146
|
+
args,
|
|
147
|
+
descriptionSlotValue: ref(""),
|
|
148
|
+
errorSlotValue: ref(""),
|
|
149
|
+
}),
|
|
144
150
|
template: `
|
|
145
|
-
<
|
|
146
|
-
<
|
|
147
|
-
<
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
151
|
+
<UCol gap="3xl">
|
|
152
|
+
<URow block>
|
|
153
|
+
<UTextarea v-bind="args" v-model="args.modelValue" :max-length="300">
|
|
154
|
+
<template #left>
|
|
155
|
+
<UText :label="args.modelValue?.length + '/300'" variant="lifted" />
|
|
156
|
+
</template>
|
|
157
|
+
</UTextarea>
|
|
158
|
+
|
|
159
|
+
<UTextarea v-bind="args">
|
|
160
|
+
<template #right>
|
|
161
|
+
<UIcon
|
|
162
|
+
name="send"
|
|
163
|
+
color="success"
|
|
164
|
+
v-tooltip="'Send message'"
|
|
165
|
+
interactive
|
|
166
|
+
/>
|
|
167
|
+
</template>
|
|
168
|
+
</UTextarea>
|
|
169
|
+
</URow>
|
|
170
|
+
|
|
171
|
+
<URow block>
|
|
172
|
+
<UTextarea v-model="descriptionSlotValue" label="Feedback">
|
|
173
|
+
<template #description>
|
|
174
|
+
<URow align="center" gap="2xs" class="text-neutral">
|
|
175
|
+
<UIcon name="format_quote" size="xs" class="mt-0.5" color="primary" />
|
|
176
|
+
<UText size="sm">
|
|
177
|
+
Markdown is not supported. See
|
|
178
|
+
<ULink label="content guidelines" underlined size="sm" />.
|
|
179
|
+
</UText>
|
|
180
|
+
</URow>
|
|
181
|
+
</template>
|
|
182
|
+
</UTextarea>
|
|
183
|
+
|
|
184
|
+
<UTextarea
|
|
185
|
+
v-model="errorSlotValue"
|
|
186
|
+
label="Message"
|
|
187
|
+
:error="true"
|
|
188
|
+
>
|
|
189
|
+
<template #error>
|
|
190
|
+
<URow align="center" gap="2xs">
|
|
191
|
+
<UIcon name="error" size="xs" color="error" />
|
|
192
|
+
<UText size="sm" color="error">
|
|
193
|
+
<ul>
|
|
194
|
+
<li>Message is too short (minimum 10 characters)</li>
|
|
195
|
+
<li>Remove disallowed characters from your text</li>
|
|
196
|
+
<li>Try again after fixing the issues above</li>
|
|
197
|
+
</ul>
|
|
198
|
+
</UText>
|
|
199
|
+
</URow>
|
|
200
|
+
</template>
|
|
201
|
+
</UTextarea>
|
|
202
|
+
</URow>
|
|
203
|
+
</UCol>
|
|
163
204
|
`,
|
|
164
205
|
});
|
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
|
|
9
9
|
import UFiles from "../../ui.text-files/UFiles.vue";
|
|
10
10
|
import URow from "../../ui.container-row/URow.vue";
|
|
11
|
+
import UCol from "../../ui.container-col/UCol.vue";
|
|
11
12
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
13
|
+
import UText from "../../ui.text-block/UText.vue";
|
|
14
|
+
import ULink from "../../ui.button-link/ULink.vue";
|
|
12
15
|
|
|
13
16
|
import type { Meta, StoryFn } from "@storybook/vue3-vite";
|
|
14
17
|
import type { Props } from "../types";
|
|
@@ -80,25 +83,39 @@ export const Sizes = EnumTemplate.bind({});
|
|
|
80
83
|
Sizes.args = { enum: "size" };
|
|
81
84
|
|
|
82
85
|
export const Slots: StoryFn<UFilesArgs> = (args) => ({
|
|
83
|
-
components: { UFiles, URow, UIcon },
|
|
86
|
+
components: { UFiles, URow, UCol, UIcon, UText, ULink },
|
|
84
87
|
setup() {
|
|
85
88
|
return { args };
|
|
86
89
|
},
|
|
87
90
|
template: `
|
|
88
|
-
<
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
<UCol gap="3xl">
|
|
92
|
+
<URow block>
|
|
93
|
+
<UFiles v-bind="args">
|
|
94
|
+
<template #before-file="{ index }">
|
|
95
|
+
<UIcon v-if="index === 0" name="info" color="warning" size="xs" />
|
|
96
|
+
<UIcon v-if="index === 1" name="check_circle" color="success" size="xs" />
|
|
97
|
+
</template>
|
|
98
|
+
</UFiles>
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
<UFiles v-bind="args">
|
|
101
|
+
<template #after-file="{ index }">
|
|
102
|
+
<UIcon v-if="index === 0" name="info" color="warning" size="xs" />
|
|
103
|
+
<UIcon v-if="index === 1" name="check_circle" color="success" size="xs" />
|
|
104
|
+
</template>
|
|
105
|
+
</UFiles>
|
|
106
|
+
</URow>
|
|
107
|
+
|
|
108
|
+
<UFiles v-bind="args" label="Documents">
|
|
109
|
+
<template #description>
|
|
110
|
+
<URow align="center" gap="2xs" class="text-neutral">
|
|
111
|
+
<UIcon name="folder" size="xs" class="mt-0.5" color="primary" />
|
|
112
|
+
<UText size="sm">
|
|
113
|
+
Files are read-only here.
|
|
114
|
+
<ULink label="Manage in storage" underlined size="sm" />.
|
|
115
|
+
</UText>
|
|
116
|
+
</URow>
|
|
100
117
|
</template>
|
|
101
118
|
</UFiles>
|
|
102
|
-
</
|
|
119
|
+
</UCol>
|
|
103
120
|
`,
|
|
104
121
|
});
|