vueless 0.0.792 → 0.0.793
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/package.json +1 -1
- package/ui.form-input-rating/UInputRating.vue +0 -1
- package/ui.text-alert/storybook/stories.ts +81 -110
- package/ui.text-badge/storybook/stories.ts +88 -22
- package/ui.text-block/storybook/stories.ts +34 -8
- package/ui.text-block/types.ts +1 -1
- package/ui.text-empty/storybook/stories.ts +6 -3
- package/ui.text-file/storybook/stories.ts +59 -3
- package/ui.text-files/config.ts +1 -1
- package/ui.text-files/storybook/stories.ts +60 -3
- package/ui.text-header/storybook/stories.ts +21 -6
- package/ui.text-header/types.ts +1 -1
- package/ui.text-money/storybook/stories.ts +45 -10
- package/ui.text-money/types.ts +1 -1
- package/ui.text-notify/UNotify.vue +5 -15
- package/ui.text-notify/config.ts +0 -1
- package/ui.text-notify/storybook/stories.ts +7 -0
- package/ui.text-notify/types.ts +0 -5
- package/ui.text-number/storybook/stories.ts +41 -6
- package/ui.text-number/types.ts +1 -1
package/package.json
CHANGED
|
@@ -10,6 +10,7 @@ import URow from "../../ui.container-row/URow.vue";
|
|
|
10
10
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
11
11
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
12
12
|
import UButton from "../../ui.button/UButton.vue";
|
|
13
|
+
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
13
14
|
|
|
14
15
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
15
16
|
import type { Props } from "../types.ts";
|
|
@@ -24,8 +25,7 @@ export default {
|
|
|
24
25
|
title: "Text & Content / Alert",
|
|
25
26
|
component: UAlert,
|
|
26
27
|
args: {
|
|
27
|
-
title: "
|
|
28
|
-
description: "Default Description",
|
|
28
|
+
title: "Network Error",
|
|
29
29
|
},
|
|
30
30
|
argTypes: {
|
|
31
31
|
...getArgTypes(UAlert.__name),
|
|
@@ -82,79 +82,39 @@ const EnumVariantTemplate: StoryFn<UAlertArgs> = (args: UAlertArgs, { argTypes }
|
|
|
82
82
|
export const Default = DefaultTemplate.bind({});
|
|
83
83
|
Default.args = {};
|
|
84
84
|
|
|
85
|
+
export const Description = DefaultTemplate.bind({});
|
|
86
|
+
Description.args = {
|
|
87
|
+
description:
|
|
88
|
+
"Unable to connect to the server. Please check your internet connection and try again.",
|
|
89
|
+
};
|
|
90
|
+
|
|
85
91
|
export const Variants = EnumVariantTemplate.bind({});
|
|
86
92
|
Variants.args = { enum: "variant" };
|
|
87
93
|
|
|
88
|
-
export const
|
|
89
|
-
|
|
94
|
+
export const Bordered = DefaultTemplate.bind({});
|
|
95
|
+
Bordered.args = {
|
|
96
|
+
title: "Your connection is secure",
|
|
97
|
+
variant: "thirdary",
|
|
98
|
+
bordered: true,
|
|
99
|
+
color: "green",
|
|
100
|
+
};
|
|
101
|
+
Bordered.parameters = {
|
|
102
|
+
docs: {
|
|
103
|
+
description: {
|
|
104
|
+
story: "Add border to the `thirdary` variant.",
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
};
|
|
90
108
|
|
|
91
109
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
92
110
|
Sizes.args = { enum: "size" };
|
|
93
111
|
|
|
94
|
-
export const
|
|
95
|
-
|
|
96
|
-
title: "",
|
|
97
|
-
description: "",
|
|
98
|
-
slotTemplate: `
|
|
99
|
-
<h3 class="text-lg font-medium mb-2">Important Security Update</h3>
|
|
100
|
-
<p class="mb-0.5">
|
|
101
|
-
<b>Your account password will expire in 10 days,</b> please update it to maintain account security.
|
|
102
|
-
</p>
|
|
103
|
-
<a href="https://security.example.com/password-update" target="_blank">Update Password</a>
|
|
104
|
-
`,
|
|
105
|
-
};
|
|
112
|
+
export const Colors = EnumVariantTemplate.bind({});
|
|
113
|
+
Colors.args = { enum: "color" };
|
|
106
114
|
|
|
107
115
|
export const Closable = DefaultTemplate.bind({});
|
|
108
116
|
Closable.args = { closable: true };
|
|
109
117
|
|
|
110
|
-
export const Paragraphs = DefaultTemplate.bind({});
|
|
111
|
-
Paragraphs.args = {
|
|
112
|
-
slotTemplate: `
|
|
113
|
-
<template #default>
|
|
114
|
-
<p>
|
|
115
|
-
Please be aware that the scheduled maintenance will occur this Saturday,
|
|
116
|
-
from 12 AM to 4 AM. During this time, some services may be temporarily
|
|
117
|
-
unavailable.
|
|
118
|
-
</p>
|
|
119
|
-
<p>
|
|
120
|
-
We apologize for any inconvenience this may cause and
|
|
121
|
-
appreciate your understanding. Our team is committed to improving
|
|
122
|
-
the system's performance and reliability.
|
|
123
|
-
</p>
|
|
124
|
-
</template>
|
|
125
|
-
`,
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const List = DefaultTemplate.bind({});
|
|
129
|
-
List.args = {
|
|
130
|
-
slotTemplate: `
|
|
131
|
-
<URow>
|
|
132
|
-
<ul>
|
|
133
|
-
<li>Check your email for verification link.</li>
|
|
134
|
-
<li>Update your password regularly to enhance security.</li>
|
|
135
|
-
<li>Enable two-factor authentication for added protection.</li>
|
|
136
|
-
</ul>
|
|
137
|
-
<ol>
|
|
138
|
-
<li>Sign in to your account using your credentials.</li>
|
|
139
|
-
<li>Navigate to the settings menu to update your profile.</li>
|
|
140
|
-
<li>Review your privacy settings and adjust them as needed.</li>
|
|
141
|
-
</ol>
|
|
142
|
-
</URow>
|
|
143
|
-
`,
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export const SlotTitleAndDescription = DefaultTemplate.bind({});
|
|
147
|
-
SlotTitleAndDescription.args = {
|
|
148
|
-
slotTemplate: `
|
|
149
|
-
<template #title>
|
|
150
|
-
<div class="text-lg font-semibold">This is a custom title for the alert.</div>
|
|
151
|
-
</template>
|
|
152
|
-
<template #description>
|
|
153
|
-
<div class="italic">This is a custom description for the alert.</div>
|
|
154
|
-
</template>
|
|
155
|
-
`,
|
|
156
|
-
};
|
|
157
|
-
|
|
158
118
|
export const SlotClose = DefaultTemplate.bind({});
|
|
159
119
|
SlotClose.args = {
|
|
160
120
|
closable: true,
|
|
@@ -170,50 +130,61 @@ SlotClose.args = {
|
|
|
170
130
|
`,
|
|
171
131
|
};
|
|
172
132
|
|
|
173
|
-
export const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
133
|
+
export const Slots: StoryFn<UAlertArgs> = (args) => ({
|
|
134
|
+
components: { UAlert, UIcon, URow, UCol, UBadge },
|
|
135
|
+
setup() {
|
|
136
|
+
return { args };
|
|
137
|
+
},
|
|
138
|
+
template: `
|
|
139
|
+
<UCol>
|
|
140
|
+
<URow>
|
|
141
|
+
<UAlert v-bind="args">
|
|
142
|
+
<template #title>
|
|
143
|
+
<UBadge
|
|
144
|
+
label="Connection lost"
|
|
145
|
+
size="lg"
|
|
146
|
+
color="red"
|
|
147
|
+
variant="secondary"
|
|
148
|
+
/>
|
|
149
|
+
</template>
|
|
150
|
+
</UAlert>
|
|
151
|
+
|
|
152
|
+
<UAlert v-bind="args">
|
|
153
|
+
<template #description>
|
|
154
|
+
<UBadge
|
|
155
|
+
label="We are trying to reconnect. Please wait a moment or check your network settings."
|
|
156
|
+
color="red"
|
|
157
|
+
variant="thirdary"
|
|
158
|
+
/>
|
|
159
|
+
</template>
|
|
160
|
+
</UAlert>
|
|
161
|
+
</URow>
|
|
162
|
+
|
|
163
|
+
<URow>
|
|
164
|
+
<UAlert v-bind="args">
|
|
165
|
+
<template #top>
|
|
166
|
+
<UIcon name="wifi_off" color="red" />
|
|
167
|
+
</template>
|
|
168
|
+
</UAlert>
|
|
169
|
+
|
|
170
|
+
<UAlert v-bind="args">
|
|
171
|
+
<template #bottom>
|
|
172
|
+
<UIcon name="sync" color="blue" />
|
|
173
|
+
</template>
|
|
174
|
+
</UAlert>
|
|
175
|
+
|
|
176
|
+
<UAlert v-bind="args">
|
|
177
|
+
<template #left>
|
|
178
|
+
<UIcon name="warning" color="yellow" />
|
|
179
|
+
</template>
|
|
180
|
+
</UAlert>
|
|
181
|
+
|
|
182
|
+
<UAlert v-bind="args" label="Delete">
|
|
183
|
+
<template #right>
|
|
184
|
+
<UIcon name="play_arrow" color="green" />
|
|
185
|
+
</template>
|
|
186
|
+
</UAlert>
|
|
187
|
+
</URow>
|
|
188
|
+
</UCol>
|
|
218
189
|
`,
|
|
219
|
-
};
|
|
190
|
+
});
|
|
@@ -9,6 +9,7 @@ import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
|
9
9
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
10
10
|
import URow from "../../ui.container-row/URow.vue";
|
|
11
11
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
12
|
+
import UMoney from "../../ui.text-money/UMoney.vue";
|
|
12
13
|
|
|
13
14
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
14
15
|
import type { Props } from "../types.ts";
|
|
@@ -99,35 +100,100 @@ const EnumVariantTemplate: StoryFn<UBadgeArgs> = (args: UBadgeArgs, { argTypes }
|
|
|
99
100
|
export const Default = DefaultTemplate.bind({});
|
|
100
101
|
Default.args = {};
|
|
101
102
|
|
|
103
|
+
export const Round = DefaultTemplate.bind({});
|
|
104
|
+
Round.args = { round: true };
|
|
105
|
+
|
|
106
|
+
export const Bordered = DefaultTemplate.bind({});
|
|
107
|
+
Bordered.args = {
|
|
108
|
+
variant: "thirdary",
|
|
109
|
+
bordered: true,
|
|
110
|
+
color: "green",
|
|
111
|
+
};
|
|
112
|
+
Bordered.parameters = {
|
|
113
|
+
docs: {
|
|
114
|
+
description: {
|
|
115
|
+
story: "Add border to the `thirdary` variant.",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
|
|
102
120
|
export const Variants = EnumVariantTemplate.bind({});
|
|
103
121
|
Variants.args = { enum: "variant" };
|
|
104
122
|
|
|
105
123
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
106
124
|
Sizes.args = { enum: "size" };
|
|
107
125
|
|
|
108
|
-
export const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
export const LeftIcon = DefaultTemplate.bind({});
|
|
112
|
-
LeftIcon.args = { leftIcon: "star" };
|
|
113
|
-
|
|
114
|
-
export const RightIcon = DefaultTemplate.bind({});
|
|
115
|
-
RightIcon.args = { rightIcon: "star" };
|
|
126
|
+
export const Color = ColorsTemplate.bind({});
|
|
127
|
+
Color.args = {};
|
|
116
128
|
|
|
117
|
-
export const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
129
|
+
export const IconProps: StoryFn<UBadgeArgs> = (args) => ({
|
|
130
|
+
components: { UBadge, URow },
|
|
131
|
+
setup() {
|
|
132
|
+
return { args };
|
|
133
|
+
},
|
|
134
|
+
template: `
|
|
135
|
+
<URow no-mobile>
|
|
136
|
+
<UBadge
|
|
137
|
+
v-bind="args"
|
|
138
|
+
left-icon="mail"
|
|
139
|
+
label="Message"
|
|
140
|
+
/>
|
|
141
|
+
<UBadge
|
|
142
|
+
v-bind="args"
|
|
143
|
+
icon="info"
|
|
144
|
+
label="Info"
|
|
145
|
+
/>
|
|
146
|
+
<UBadge
|
|
147
|
+
v-bind="args"
|
|
148
|
+
right-icon="chat"
|
|
149
|
+
label="Chat"
|
|
150
|
+
/>
|
|
151
|
+
</URow>
|
|
123
152
|
`,
|
|
124
|
-
};
|
|
153
|
+
});
|
|
125
154
|
|
|
126
|
-
export const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
155
|
+
export const Slots: StoryFn<UBadgeArgs> = (args) => ({
|
|
156
|
+
components: { UBadge, UIcon, URow, UMoney },
|
|
157
|
+
setup() {
|
|
158
|
+
return { args };
|
|
159
|
+
},
|
|
160
|
+
template: `
|
|
161
|
+
<URow no-mobile>
|
|
162
|
+
<UBadge v-bind="args" label="Add to favorite">
|
|
163
|
+
<template #left>
|
|
164
|
+
<UIcon
|
|
165
|
+
name="heart_plus"
|
|
166
|
+
size="2xs"
|
|
167
|
+
color="inherit"
|
|
168
|
+
/>
|
|
169
|
+
</template>
|
|
170
|
+
</UBadge>
|
|
171
|
+
|
|
172
|
+
<UBadge v-bind="args" label="shopping_cart">
|
|
173
|
+
<template #default="{ label }">
|
|
174
|
+
<UMoney
|
|
175
|
+
value="20.25"
|
|
176
|
+
size="sm"
|
|
177
|
+
color="inherit"
|
|
178
|
+
symbol="$"
|
|
179
|
+
/>
|
|
180
|
+
<UIcon
|
|
181
|
+
:name="label"
|
|
182
|
+
size="2xs"
|
|
183
|
+
color="inherit"
|
|
184
|
+
/>
|
|
185
|
+
</template>
|
|
186
|
+
</UBadge>
|
|
187
|
+
|
|
188
|
+
<UBadge v-bind="args" label="Delete">
|
|
189
|
+
<template #right>
|
|
190
|
+
<UIcon
|
|
191
|
+
name="delete"
|
|
192
|
+
size="2xs"
|
|
193
|
+
color="inherit"
|
|
194
|
+
/>
|
|
195
|
+
</template>
|
|
196
|
+
</UBadge>
|
|
197
|
+
</URow>
|
|
132
198
|
`,
|
|
133
|
-
};
|
|
199
|
+
});
|
|
@@ -7,13 +7,15 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import UText from "../../ui.text-block/UText.vue";
|
|
9
9
|
import URow from "../../ui.container-row/URow.vue";
|
|
10
|
+
import UCol from "../../ui.container-col/UCol.vue";
|
|
11
|
+
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
10
12
|
|
|
11
13
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
12
14
|
import type { Props } from "../types.ts";
|
|
13
15
|
|
|
14
16
|
interface UTextArgs extends Props {
|
|
15
17
|
slotTemplate?: string;
|
|
16
|
-
enum: "size";
|
|
18
|
+
enum: "size" | "align";
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export default {
|
|
@@ -33,14 +35,13 @@ export default {
|
|
|
33
35
|
|
|
34
36
|
const defaultTemplate = `
|
|
35
37
|
<p>
|
|
36
|
-
<b>To proceed with your registration</b>, please enter your
|
|
37
|
-
|
|
38
|
-
<a href="https://uk.wikipedia.org/wiki/Lorem_ipsum" target="_blank">Wikipedia</a>
|
|
38
|
+
<b>To proceed with your registration</b>, please enter your <u>email address</u> in the field below.
|
|
39
|
+
<i>A verification link</i> will be sent to your inbox shortly.
|
|
39
40
|
</p>
|
|
40
41
|
`;
|
|
41
42
|
|
|
42
43
|
const DefaultTemplate: StoryFn<UTextArgs> = (args: UTextArgs) => ({
|
|
43
|
-
components: { UText, URow },
|
|
44
|
+
components: { UText, URow, UBadge },
|
|
44
45
|
setup() {
|
|
45
46
|
const slots = getSlotNames(UText.__name);
|
|
46
47
|
|
|
@@ -54,7 +55,7 @@ const DefaultTemplate: StoryFn<UTextArgs> = (args: UTextArgs) => ({
|
|
|
54
55
|
});
|
|
55
56
|
|
|
56
57
|
const EnumVariantTemplate: StoryFn<UTextArgs> = (args: UTextArgs, { argTypes }) => ({
|
|
57
|
-
components: { UText,
|
|
58
|
+
components: { UText, UCol },
|
|
58
59
|
setup() {
|
|
59
60
|
return {
|
|
60
61
|
args,
|
|
@@ -62,25 +63,41 @@ const EnumVariantTemplate: StoryFn<UTextArgs> = (args: UTextArgs, { argTypes })
|
|
|
62
63
|
};
|
|
63
64
|
},
|
|
64
65
|
template: `
|
|
65
|
-
<
|
|
66
|
+
<UCol>
|
|
66
67
|
<UText
|
|
67
68
|
v-for="(option, index) in options"
|
|
68
69
|
:key="index"
|
|
69
70
|
v-bind="args"
|
|
70
71
|
:[args.enum]="option"
|
|
72
|
+
class="w-full"
|
|
71
73
|
>
|
|
72
74
|
${args.slotTemplate || defaultTemplate}
|
|
73
75
|
</UText>
|
|
74
|
-
</
|
|
76
|
+
</UCol>
|
|
75
77
|
`,
|
|
76
78
|
});
|
|
77
79
|
|
|
78
80
|
export const Default = DefaultTemplate.bind({});
|
|
79
81
|
Default.args = {};
|
|
80
82
|
|
|
83
|
+
export const Align = EnumVariantTemplate.bind({});
|
|
84
|
+
Align.args = { enum: "align" };
|
|
85
|
+
|
|
81
86
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
82
87
|
Sizes.args = { enum: "size" };
|
|
83
88
|
|
|
89
|
+
export const Line = DefaultTemplate.bind({});
|
|
90
|
+
Line.args = {
|
|
91
|
+
line: true,
|
|
92
|
+
};
|
|
93
|
+
Line.parameters = {
|
|
94
|
+
docs: {
|
|
95
|
+
description: {
|
|
96
|
+
story: "Removes text line height (useful for 1-line text).",
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
|
|
84
101
|
export const Paragraphs = DefaultTemplate.bind({});
|
|
85
102
|
Paragraphs.args = {
|
|
86
103
|
slotTemplate: `
|
|
@@ -125,3 +142,12 @@ List.args = {
|
|
|
125
142
|
</template>
|
|
126
143
|
`,
|
|
127
144
|
};
|
|
145
|
+
|
|
146
|
+
export const SlotDefault = DefaultTemplate.bind({});
|
|
147
|
+
SlotDefault.args = {
|
|
148
|
+
slotTemplate: `
|
|
149
|
+
<UText>To proceed with your registration, please enter your
|
|
150
|
+
<UBadge label="email address" v-bind="args" color="green" /> in the field below.
|
|
151
|
+
A verification link will be sent to your inbox shortly.</UText>
|
|
152
|
+
`,
|
|
153
|
+
};
|
package/ui.text-block/types.ts
CHANGED
|
@@ -9,6 +9,7 @@ import UEmpty from "../../ui.text-empty/UEmpty.vue";
|
|
|
9
9
|
import UButton from "../../ui.button/UButton.vue";
|
|
10
10
|
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
11
11
|
import URow from "../../ui.container-row/URow.vue";
|
|
12
|
+
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
12
13
|
|
|
13
14
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
14
15
|
import type { Props } from "../types.ts";
|
|
@@ -24,7 +25,6 @@ export default {
|
|
|
24
25
|
component: UEmpty,
|
|
25
26
|
args: {
|
|
26
27
|
title: "No contacts",
|
|
27
|
-
description: "There are no contacts in the list.",
|
|
28
28
|
},
|
|
29
29
|
argTypes: {
|
|
30
30
|
...getArgTypes(UEmpty.__name),
|
|
@@ -37,7 +37,7 @@ export default {
|
|
|
37
37
|
} as Meta;
|
|
38
38
|
|
|
39
39
|
const DefaultTemplate: StoryFn<UEmptyArgs> = (args: UEmptyArgs) => ({
|
|
40
|
-
components: { UEmpty, UIcon, UButton },
|
|
40
|
+
components: { UEmpty, UIcon, UButton, UBadge },
|
|
41
41
|
setup() {
|
|
42
42
|
const slots = getSlotNames(UEmpty.__name);
|
|
43
43
|
|
|
@@ -74,6 +74,9 @@ const EnumVariantTemplate: StoryFn<UEmptyArgs> = (args: UEmptyArgs, { argTypes }
|
|
|
74
74
|
export const Default = DefaultTemplate.bind({});
|
|
75
75
|
Default.args = {};
|
|
76
76
|
|
|
77
|
+
export const Description = DefaultTemplate.bind({});
|
|
78
|
+
Description.args = { description: "There are no contacts in the list." };
|
|
79
|
+
|
|
77
80
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
78
81
|
Sizes.args = { enum: "size", title: "" };
|
|
79
82
|
|
|
@@ -94,7 +97,7 @@ export const SlotDefault = DefaultTemplate.bind({});
|
|
|
94
97
|
SlotDefault.args = {
|
|
95
98
|
slotTemplate: `
|
|
96
99
|
<template #default>
|
|
97
|
-
<
|
|
100
|
+
<UBadge label="There are no contacts in the list." />
|
|
98
101
|
</template>
|
|
99
102
|
`,
|
|
100
103
|
};
|
|
@@ -6,12 +6,16 @@ import {
|
|
|
6
6
|
} from "../../utils/storybook.ts";
|
|
7
7
|
|
|
8
8
|
import UFile from "../../ui.text-file/UFile.vue";
|
|
9
|
+
import URow from "../../ui.container-row/URow.vue";
|
|
10
|
+
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
11
|
+
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
9
12
|
|
|
10
13
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
11
14
|
import type { Props } from "../types.ts";
|
|
12
15
|
|
|
13
16
|
interface UFileArgs extends Props {
|
|
14
17
|
slotTemplate?: string;
|
|
18
|
+
enum: "size";
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
export default {
|
|
@@ -19,7 +23,7 @@ export default {
|
|
|
19
23
|
title: "Text & Content / File",
|
|
20
24
|
component: UFile,
|
|
21
25
|
args: {
|
|
22
|
-
label: "
|
|
26
|
+
label: "Invoice_123.pdf",
|
|
23
27
|
url: "https://storybook.js.org/",
|
|
24
28
|
},
|
|
25
29
|
argTypes: {
|
|
@@ -37,14 +41,66 @@ const DefaultTemplate: StoryFn<UFileArgs> = (args: UFileArgs) => ({
|
|
|
37
41
|
setup() {
|
|
38
42
|
const slots = getSlotNames(UFile.__name);
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
function showAlert() {
|
|
45
|
+
return alert("File removed");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return { args, slots, showAlert };
|
|
41
49
|
},
|
|
42
50
|
template: `
|
|
43
|
-
<UFile v-bind="args">
|
|
51
|
+
<UFile v-bind="args" @remove="() => showAlert()">
|
|
44
52
|
${args.slotTemplate || getSlotsFragment("")}
|
|
45
53
|
</UFile>
|
|
46
54
|
`,
|
|
47
55
|
});
|
|
48
56
|
|
|
57
|
+
const EnumVariantTemplate: StoryFn<UFileArgs> = (args: UFileArgs, { argTypes }) => ({
|
|
58
|
+
components: { UFile, URow },
|
|
59
|
+
setup() {
|
|
60
|
+
return { args, options: argTypes?.[args.enum]?.options };
|
|
61
|
+
},
|
|
62
|
+
template: `
|
|
63
|
+
<URow>
|
|
64
|
+
<UFile
|
|
65
|
+
v-for="(option, index) in options"
|
|
66
|
+
:key="index"
|
|
67
|
+
v-bind="args"
|
|
68
|
+
:[args.enum]="option"
|
|
69
|
+
/>
|
|
70
|
+
</URow>
|
|
71
|
+
`,
|
|
72
|
+
});
|
|
73
|
+
|
|
49
74
|
export const Default = DefaultTemplate.bind({});
|
|
50
75
|
Default.args = {};
|
|
76
|
+
|
|
77
|
+
export const ImageURL = DefaultTemplate.bind({});
|
|
78
|
+
ImageURL.args = { imageUrl: "https://picsum.photos/100" };
|
|
79
|
+
|
|
80
|
+
export const Removable = DefaultTemplate.bind({});
|
|
81
|
+
Removable.args = { removable: true };
|
|
82
|
+
|
|
83
|
+
export const Sizes = EnumVariantTemplate.bind({});
|
|
84
|
+
Sizes.args = { enum: "size" };
|
|
85
|
+
|
|
86
|
+
export const Slots: StoryFn<UFileArgs> = (args) => ({
|
|
87
|
+
components: { UFile, URow, UBadge, UIcon },
|
|
88
|
+
setup() {
|
|
89
|
+
return { args };
|
|
90
|
+
},
|
|
91
|
+
template: `
|
|
92
|
+
<URow>
|
|
93
|
+
<UFile v-bind="args">
|
|
94
|
+
<template #left>
|
|
95
|
+
<UIcon name="info" color="orange" size="xs" />
|
|
96
|
+
</template>
|
|
97
|
+
</UFile>
|
|
98
|
+
|
|
99
|
+
<UFile v-bind="args">
|
|
100
|
+
<template #right>
|
|
101
|
+
<UBadge label="File uploaded" color="green" />
|
|
102
|
+
</template>
|
|
103
|
+
</UFile>
|
|
104
|
+
</URow>
|
|
105
|
+
`,
|
|
106
|
+
});
|
package/ui.text-files/config.ts
CHANGED
|
@@ -6,12 +6,15 @@ import {
|
|
|
6
6
|
} from "../../utils/storybook.ts";
|
|
7
7
|
|
|
8
8
|
import UFiles from "../../ui.text-files/UFiles.vue";
|
|
9
|
+
import URow from "../../ui.container-row/URow.vue";
|
|
10
|
+
import UIcon from "../../ui.image-icon/UIcon.vue";
|
|
9
11
|
|
|
10
12
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
11
13
|
import type { Props } from "../types.ts";
|
|
12
14
|
|
|
13
15
|
interface UFilesArgs extends Props {
|
|
14
16
|
slotTemplate?: string;
|
|
17
|
+
enum: "size" | "labelAlign";
|
|
15
18
|
}
|
|
16
19
|
|
|
17
20
|
export default {
|
|
@@ -19,10 +22,12 @@ export default {
|
|
|
19
22
|
title: "Text & Content / Files",
|
|
20
23
|
component: UFiles,
|
|
21
24
|
args: {
|
|
22
|
-
label: "
|
|
25
|
+
label: "Documents",
|
|
23
26
|
fileList: [
|
|
24
|
-
new File(["
|
|
25
|
-
new File(["
|
|
27
|
+
new File(["Company_Report_2025"], "Company_Report_2025.pdf", { type: "application/pdf" }),
|
|
28
|
+
new File(["Employee_Resumes"], "Employee_Resumes.xlsx", {
|
|
29
|
+
type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
30
|
+
}),
|
|
26
31
|
],
|
|
27
32
|
},
|
|
28
33
|
argTypes: {
|
|
@@ -49,5 +54,57 @@ const DefaultTemplate: StoryFn<UFilesArgs> = (args: UFilesArgs) => ({
|
|
|
49
54
|
`,
|
|
50
55
|
});
|
|
51
56
|
|
|
57
|
+
const EnumVariantTemplate: StoryFn<UFilesArgs> = (args: UFilesArgs, { argTypes }) => ({
|
|
58
|
+
components: { UFiles, URow },
|
|
59
|
+
setup() {
|
|
60
|
+
return { args, options: argTypes?.[args.enum]?.options };
|
|
61
|
+
},
|
|
62
|
+
template: `
|
|
63
|
+
<URow>
|
|
64
|
+
<UFiles
|
|
65
|
+
v-for="(option, index) in options"
|
|
66
|
+
:key="index"
|
|
67
|
+
v-bind="args"
|
|
68
|
+
:[args.enum]="option"
|
|
69
|
+
:label="option"
|
|
70
|
+
/>
|
|
71
|
+
</URow>
|
|
72
|
+
`,
|
|
73
|
+
});
|
|
74
|
+
|
|
52
75
|
export const Default = DefaultTemplate.bind({});
|
|
53
76
|
Default.args = {};
|
|
77
|
+
|
|
78
|
+
export const Description = DefaultTemplate.bind({});
|
|
79
|
+
Description.args = {
|
|
80
|
+
description: "These files include important documents like reports and employee data.",
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const Removable = DefaultTemplate.bind({});
|
|
84
|
+
Removable.args = { removable: true };
|
|
85
|
+
|
|
86
|
+
export const Sizes = EnumVariantTemplate.bind({});
|
|
87
|
+
Sizes.args = { enum: "size" };
|
|
88
|
+
|
|
89
|
+
export const LabelPlacement = EnumVariantTemplate.bind({});
|
|
90
|
+
LabelPlacement.args = {
|
|
91
|
+
enum: "labelAlign",
|
|
92
|
+
description: "These files include important documents like reports and employee data.",
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const Slots: StoryFn<UFilesArgs> = (args) => ({
|
|
96
|
+
components: { UFiles, URow, UIcon },
|
|
97
|
+
setup() {
|
|
98
|
+
return { args };
|
|
99
|
+
},
|
|
100
|
+
template: `
|
|
101
|
+
<UFiles v-bind="args">
|
|
102
|
+
<template #left="{ index }">
|
|
103
|
+
<UIcon v-if="index === 0" name="info" color="orange" size="xs" />
|
|
104
|
+
</template>
|
|
105
|
+
<template #right="{ index }">
|
|
106
|
+
<UIcon v-if="index === 1" name="check_circle" color="green" size="xs" />
|
|
107
|
+
</template>
|
|
108
|
+
</UFiles>
|
|
109
|
+
`,
|
|
110
|
+
});
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import UHeader from "../../ui.text-header/UHeader.vue";
|
|
9
9
|
import UCol from "../../ui.container-col/UCol.vue";
|
|
10
|
+
import UBadge from "../../ui.text-badge/UBadge.vue";
|
|
10
11
|
|
|
11
12
|
import type { Meta, StoryFn } from "@storybook/vue3";
|
|
12
13
|
import type { Props } from "../types.ts";
|
|
@@ -21,7 +22,7 @@ export default {
|
|
|
21
22
|
title: "Text & Content / Header",
|
|
22
23
|
component: UHeader,
|
|
23
24
|
args: {
|
|
24
|
-
label: "
|
|
25
|
+
label: "Dashboard",
|
|
25
26
|
},
|
|
26
27
|
argTypes: {
|
|
27
28
|
...getArgTypes(UHeader.__name),
|
|
@@ -34,7 +35,7 @@ export default {
|
|
|
34
35
|
} as Meta;
|
|
35
36
|
|
|
36
37
|
const DefaultTemplate: StoryFn<UHeaderArgs> = (args: UHeaderArgs) => ({
|
|
37
|
-
components: { UHeader },
|
|
38
|
+
components: { UHeader, UBadge },
|
|
38
39
|
setup() {
|
|
39
40
|
const slots = getSlotNames(UHeader.__name);
|
|
40
41
|
|
|
@@ -62,7 +63,7 @@ const EnumVariantTemplate: StoryFn<UHeaderArgs> = (args: UHeaderArgs, { argTypes
|
|
|
62
63
|
:key="index"
|
|
63
64
|
v-bind="args"
|
|
64
65
|
:[args.enum]="option"
|
|
65
|
-
:label="'
|
|
66
|
+
:label="args.label + ' (' + option + ')'"
|
|
66
67
|
/>
|
|
67
68
|
</UCol>
|
|
68
69
|
`,
|
|
@@ -79,10 +80,24 @@ Underlined.args = { enum: "size", underlined: true };
|
|
|
79
80
|
|
|
80
81
|
export const Line = DefaultTemplate.bind({});
|
|
81
82
|
Line.args = {
|
|
82
|
-
size: "
|
|
83
|
-
line:
|
|
84
|
-
label: "
|
|
83
|
+
size: "xl",
|
|
84
|
+
line: true,
|
|
85
|
+
label: "Detailed Analysis of User Engagement Metrics",
|
|
86
|
+
};
|
|
87
|
+
Line.parameters = {
|
|
88
|
+
docs: {
|
|
89
|
+
description: {
|
|
90
|
+
story: "Removes text line height (useful for 1-line text).",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
85
93
|
};
|
|
86
94
|
|
|
87
95
|
export const Colors = EnumVariantTemplate.bind({});
|
|
88
96
|
Colors.args = { enum: "color" };
|
|
97
|
+
|
|
98
|
+
export const SlotDefault = DefaultTemplate.bind({});
|
|
99
|
+
SlotDefault.args = {
|
|
100
|
+
slotTemplate: `
|
|
101
|
+
<UBadge v-bind="args" size="lg" color="green" />
|
|
102
|
+
`,
|
|
103
|
+
};
|
package/ui.text-header/types.ts
CHANGED
|
@@ -19,7 +19,7 @@ import type { Props } from "../types.ts";
|
|
|
19
19
|
|
|
20
20
|
interface UMoneyArgs extends Props {
|
|
21
21
|
slotTemplate?: string;
|
|
22
|
-
enum: "color" | "size" | "sign" | "symbolAlign";
|
|
22
|
+
enum: "color" | "size" | "sign" | "align" | "symbolAlign";
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export default {
|
|
@@ -67,7 +67,7 @@ const EnumVariantTemplate: StoryFn<UMoneyArgs> = (args: UMoneyArgs, { argTypes }
|
|
|
67
67
|
};
|
|
68
68
|
},
|
|
69
69
|
template: `
|
|
70
|
-
<URow>
|
|
70
|
+
<URow :class="{ '!flex-col items-stretch': args.enum === 'align' }">
|
|
71
71
|
<UMoney
|
|
72
72
|
v-for="(option, index) in options"
|
|
73
73
|
:key="index"
|
|
@@ -86,24 +86,59 @@ const EnumVariantTemplate: StoryFn<UMoneyArgs> = (args: UMoneyArgs, { argTypes }
|
|
|
86
86
|
export const Default = DefaultTemplate.bind({});
|
|
87
87
|
Default.args = {};
|
|
88
88
|
|
|
89
|
+
export const Sign = EnumVariantTemplate.bind({});
|
|
90
|
+
Sign.args = { enum: "sign" };
|
|
91
|
+
|
|
92
|
+
export const Align = EnumVariantTemplate.bind({});
|
|
93
|
+
Align.args = { enum: "align" };
|
|
94
|
+
|
|
95
|
+
export const SymbolAlign = EnumVariantTemplate.bind({});
|
|
96
|
+
SymbolAlign.args = { enum: "symbolAlign" };
|
|
97
|
+
|
|
89
98
|
export const Colors = EnumVariantTemplate.bind({});
|
|
90
99
|
Colors.args = { enum: "color" };
|
|
91
100
|
|
|
92
101
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
93
102
|
Sizes.args = { enum: "size" };
|
|
94
103
|
|
|
95
|
-
export const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
export const LimitFractionDigits = DefaultTemplate.bind({});
|
|
105
|
+
LimitFractionDigits.args = {
|
|
106
|
+
minFractionDigits: 4,
|
|
107
|
+
maxFractionDigits: 6,
|
|
108
|
+
};
|
|
109
|
+
LimitFractionDigits.parameters = {
|
|
110
|
+
docs: {
|
|
111
|
+
description: {
|
|
112
|
+
story:
|
|
113
|
+
// eslint-disable-next-line vue/max-len
|
|
114
|
+
"`minFractionDigits` and `maxFractionDigits` props determine the minimum/maximum number of digits to display after the decimal separator.",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export const DecimalSeparator = DefaultTemplate.bind({});
|
|
120
|
+
DecimalSeparator.args = { decimalSeparator: "." };
|
|
121
|
+
DecimalSeparator.parameters = {
|
|
122
|
+
docs: {
|
|
123
|
+
description: {
|
|
124
|
+
story: "A symbol used to separate the integer part from the fractional part of a number.",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
export const ThousandsSeparator = DefaultTemplate.bind({});
|
|
130
|
+
ThousandsSeparator.args = { value: -1400000.24, thousandsSeparator: "-" };
|
|
131
|
+
ThousandsSeparator.parameters = {
|
|
132
|
+
docs: {
|
|
133
|
+
description: {
|
|
134
|
+
story: "A symbol used to separate the thousand parts of a number.",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
};
|
|
100
138
|
|
|
101
139
|
export const Planned = DefaultTemplate.bind({});
|
|
102
140
|
Planned.args = { planned: true };
|
|
103
141
|
|
|
104
|
-
export const MinFractionDigits4 = DefaultTemplate.bind({});
|
|
105
|
-
MinFractionDigits4.args = { minFractionDigits: 4, maxFractionDigits: 4 };
|
|
106
|
-
|
|
107
142
|
export const Slots: StoryFn<UMoneyArgs> = (args) => ({
|
|
108
143
|
components: { UMoney, UIcon, URow },
|
|
109
144
|
setup() {
|
package/ui.text-money/types.ts
CHANGED
|
@@ -187,21 +187,11 @@ const {
|
|
|
187
187
|
/>
|
|
188
188
|
|
|
189
189
|
<div v-bind="contentAttrs">
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
/>
|
|
196
|
-
</template>
|
|
197
|
-
|
|
198
|
-
<template v-else>
|
|
199
|
-
<span v-bind="labelAttrs" v-text="notification.label" />
|
|
200
|
-
<span
|
|
201
|
-
v-bind="descriptionAttrs"
|
|
202
|
-
v-text="getText(notification.description, notification.type)"
|
|
203
|
-
/>
|
|
204
|
-
</template>
|
|
190
|
+
<span v-bind="labelAttrs" v-text="notification.label" />
|
|
191
|
+
<span
|
|
192
|
+
v-bind="descriptionAttrs"
|
|
193
|
+
v-text="getText(notification.description, notification.type)"
|
|
194
|
+
/>
|
|
205
195
|
</div>
|
|
206
196
|
|
|
207
197
|
<UIcon
|
package/ui.text-notify/config.ts
CHANGED
|
@@ -106,6 +106,13 @@ Default.args = {};
|
|
|
106
106
|
|
|
107
107
|
export const Position = DefaultTemplate.bind({});
|
|
108
108
|
Position.args = { xPosition: "right", yPosition: "bottom" };
|
|
109
|
+
Position.parameters = {
|
|
110
|
+
docs: {
|
|
111
|
+
description: {
|
|
112
|
+
story: "Control notify's position in your layout via `xPosition` and `yPosition` props.",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
};
|
|
109
116
|
|
|
110
117
|
export const Types = TypesTemplate.bind({});
|
|
111
118
|
Types.args = {};
|
package/ui.text-notify/types.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { Props } from "../types.ts";
|
|
|
12
12
|
|
|
13
13
|
interface UNumberArgs extends Props {
|
|
14
14
|
slotTemplate?: string;
|
|
15
|
-
enum: "color" | "size" | "sign";
|
|
15
|
+
enum: "color" | "size" | "sign" | "align";
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export default {
|
|
@@ -48,7 +48,7 @@ const EnumVariantTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs, { argTypes
|
|
|
48
48
|
return { args, options: argTypes?.[args.enum]?.options };
|
|
49
49
|
},
|
|
50
50
|
template: `
|
|
51
|
-
<URow>
|
|
51
|
+
<URow :class="{ '!flex-col items-stretch': args.enum === 'align' }">
|
|
52
52
|
<UNumber
|
|
53
53
|
v-for="(option, index) in options"
|
|
54
54
|
:key="index"
|
|
@@ -67,6 +67,12 @@ const EnumVariantTemplate: StoryFn<UNumberArgs> = (args: UNumberArgs, { argTypes
|
|
|
67
67
|
export const Default = DefaultTemplate.bind({});
|
|
68
68
|
Default.args = {};
|
|
69
69
|
|
|
70
|
+
export const Sign = EnumVariantTemplate.bind({});
|
|
71
|
+
Sign.args = { enum: "sign" };
|
|
72
|
+
|
|
73
|
+
export const Align = EnumVariantTemplate.bind({});
|
|
74
|
+
Align.args = { enum: "align" };
|
|
75
|
+
|
|
70
76
|
export const Colors = EnumVariantTemplate.bind({});
|
|
71
77
|
Colors.args = {
|
|
72
78
|
enum: "color",
|
|
@@ -76,11 +82,40 @@ Colors.args = {
|
|
|
76
82
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
77
83
|
Sizes.args = { enum: "size" };
|
|
78
84
|
|
|
79
|
-
export const
|
|
80
|
-
|
|
85
|
+
export const LimitFractionDigits = DefaultTemplate.bind({});
|
|
86
|
+
LimitFractionDigits.args = {
|
|
87
|
+
minFractionDigits: 4,
|
|
88
|
+
maxFractionDigits: 6,
|
|
89
|
+
};
|
|
90
|
+
LimitFractionDigits.parameters = {
|
|
91
|
+
docs: {
|
|
92
|
+
description: {
|
|
93
|
+
story:
|
|
94
|
+
// eslint-disable-next-line vue/max-len
|
|
95
|
+
"`minFractionDigits` and `maxFractionDigits` props determine the minimum/maximum number of digits to display after the decimal separator.",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
};
|
|
81
99
|
|
|
82
|
-
export const
|
|
83
|
-
|
|
100
|
+
export const DecimalSeparator = DefaultTemplate.bind({});
|
|
101
|
+
DecimalSeparator.args = { decimalSeparator: "." };
|
|
102
|
+
DecimalSeparator.parameters = {
|
|
103
|
+
docs: {
|
|
104
|
+
description: {
|
|
105
|
+
story: "A symbol used to separate the integer part from the fractional part of a number.",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const ThousandsSeparator = DefaultTemplate.bind({});
|
|
111
|
+
ThousandsSeparator.args = { value: -1400000.24, thousandsSeparator: "-" };
|
|
112
|
+
ThousandsSeparator.parameters = {
|
|
113
|
+
docs: {
|
|
114
|
+
description: {
|
|
115
|
+
story: "A symbol used to separate the thousand parts of a number.",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
};
|
|
84
119
|
|
|
85
120
|
export const Slots: StoryFn<UNumberArgs> = (args) => ({
|
|
86
121
|
components: { UNumber, UIcon, URow, UBadge },
|