vueless 0.0.114 → 0.0.116
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/assets/icons/image.svg +1 -0
- package/package.json +1 -1
- package/ui.container-accordion/Docs.mdx +16 -0
- package/ui.container-group/composables/attrs.composable.js +6 -1
- package/ui.container-group/configs/default.config.js +19 -5
- package/ui.container-group/index.stories.js +9 -10
- package/ui.container-group/index.vue +15 -6
- package/ui.container-groups/composables/attrs.composable.js +19 -2
- package/ui.container-groups/configs/default.config.js +24 -1
- package/ui.container-groups/constants/index.js +5 -0
- package/ui.container-groups/index.stories.js +13 -13
- package/ui.container-groups/index.vue +24 -2
- package/ui.container-row/index.stories.js +10 -9
- package/ui.container-row/index.vue +3 -3
- package/ui.data-list/Docs.mdx +16 -0
- package/ui.form-checkbox/index.stories.js +2 -2
- package/ui.form-color-picker/Docs.mdx +16 -0
- package/ui.form-date-picker-range/Docs.mdx +16 -0
- package/ui.form-input/index.stories.js +1 -1
- package/ui.form-input-file/Docs.mdx +16 -0
- package/ui.form-input-money/index.stories.js +1 -1
- package/ui.form-input-number/index.stories.js +1 -1
- package/ui.form-input-rating/Docs.mdx +16 -0
- package/ui.form-input-search/Docs.mdx +16 -0
- package/ui.form-switch/Docs.mdx +16 -0
- package/ui.form-textarea/index.stories.js +1 -1
- package/ui.image-avatar/Docs.mdx +16 -0
- package/ui.image-avatar/composables/attrs.composable.js +2 -0
- package/ui.image-avatar/configs/default.config.js +19 -12
- package/ui.image-avatar/index.stories.js +82 -42
- package/ui.image-avatar/index.vue +53 -39
- package/ui.image-icon/index.vue +6 -9
- package/ui.image-logo/Docs.mdx +16 -0
- package/ui.loader/Docs.mdx +16 -0
- package/ui.loader-top/configs/default.config.js +5 -1
- package/ui.loader-top/index.vue +1 -1
- package/ui.navigation-pagination/Docs.mdx +16 -0
- package/ui.navigation-progress/Docs.mdx +16 -0
- package/ui.navigation-progress/configs/default.config.js +7 -7
- package/ui.navigation-progress/index.vue +17 -0
- package/ui.navigation-stepper/Docs.mdx +16 -0
- package/ui.navigation-tab/Docs.mdx +16 -0
- package/ui.navigation-tabs/Docs.mdx +16 -0
- package/ui.other-dot/Docs.mdx +16 -0
- package/ui.text-alert/Docs.mdx +16 -0
- package/ui.text-block/Docs.mdx +16 -0
- package/ui.text-file/Docs.mdx +16 -0
- package/ui.text-files/Docs.mdx +16 -0
- package/web-types.json +82 -33
- package/ui.image-avatar/default-avatar.png +0 -0
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
avatar: {
|
|
3
3
|
base: `
|
|
4
|
-
flex
|
|
5
|
-
bg-contain bg-center bg-no-repeat
|
|
4
|
+
flex items-center justify-center shrink-0
|
|
5
|
+
bg-{color}-100 bg-contain bg-center bg-no-repeat
|
|
6
|
+
text-{color}-600
|
|
7
|
+
`,
|
|
6
8
|
variants: {
|
|
7
9
|
bordered: {
|
|
8
10
|
true: "border border-{color}-200",
|
|
9
11
|
},
|
|
10
12
|
size: {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
"3xs": "size-4 text-2xs",
|
|
14
|
+
"2xs": "size-5 text-2xs",
|
|
15
|
+
xs: "size-6 text-xs",
|
|
16
|
+
sm: "size-8 text-sm",
|
|
17
|
+
md: "size-10 text-lg",
|
|
18
|
+
lg: "size-12 text-2xl",
|
|
19
|
+
xl: "size-14 text-3xl",
|
|
20
|
+
"2xl": "size-16 text-4xl",
|
|
21
|
+
"3xl": "size-20 text-5xl",
|
|
18
22
|
},
|
|
19
23
|
rounded: {
|
|
24
|
+
none: "rounded-none",
|
|
20
25
|
sm: "rounded",
|
|
21
|
-
md: "rounded-
|
|
22
|
-
lg: "rounded-
|
|
26
|
+
md: "rounded-md",
|
|
27
|
+
lg: "rounded-lg",
|
|
23
28
|
full: "rounded-full",
|
|
24
29
|
},
|
|
25
30
|
color: {
|
|
@@ -28,10 +33,12 @@ export default /*tw*/ {
|
|
|
28
33
|
},
|
|
29
34
|
},
|
|
30
35
|
},
|
|
36
|
+
icon: "",
|
|
31
37
|
defaultVariants: {
|
|
32
38
|
color: "grayscale",
|
|
33
|
-
size: "md",
|
|
34
39
|
rounded: "md",
|
|
40
|
+
size: "md",
|
|
41
|
+
icon: "image",
|
|
35
42
|
bordered: false,
|
|
36
43
|
},
|
|
37
44
|
safelist: (colors) => [
|
|
@@ -2,6 +2,7 @@ import { getArgTypes } from "../service.storybook";
|
|
|
2
2
|
|
|
3
3
|
import UAvatar from "../ui.image-avatar";
|
|
4
4
|
import URow from "../ui.container-row";
|
|
5
|
+
import UGroup from "../ui.container-group";
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
id: "6030",
|
|
@@ -23,7 +24,7 @@ const DefaultTemplate = (args) => ({
|
|
|
23
24
|
});
|
|
24
25
|
|
|
25
26
|
const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
26
|
-
components: {
|
|
27
|
+
components: { UGroup, URow, UAvatar },
|
|
27
28
|
setup() {
|
|
28
29
|
return {
|
|
29
30
|
args,
|
|
@@ -31,19 +32,31 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
|
|
|
31
32
|
};
|
|
32
33
|
},
|
|
33
34
|
template: `
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
<UGroup gap="xl">
|
|
36
|
+
<URow>
|
|
37
|
+
<UAvatar
|
|
38
|
+
v-for="(size, index) in sizes"
|
|
39
|
+
:key="index"
|
|
40
|
+
v-bind="args"
|
|
41
|
+
:size="size"
|
|
42
|
+
:label="size"
|
|
43
|
+
/>
|
|
44
|
+
</URow>
|
|
45
|
+
<URow>
|
|
46
|
+
<UAvatar
|
|
47
|
+
v-for="(size, index) in sizes"
|
|
48
|
+
:key="index"
|
|
49
|
+
v-bind="args"
|
|
50
|
+
:size="size"
|
|
51
|
+
:label="''"
|
|
52
|
+
/>
|
|
53
|
+
</URow>
|
|
54
|
+
</UGroup>
|
|
42
55
|
`,
|
|
43
56
|
});
|
|
44
57
|
|
|
45
58
|
const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
46
|
-
components: {
|
|
59
|
+
components: { UGroup, URow, UAvatar },
|
|
47
60
|
setup() {
|
|
48
61
|
return {
|
|
49
62
|
args,
|
|
@@ -51,22 +64,31 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
|
|
|
51
64
|
};
|
|
52
65
|
},
|
|
53
66
|
template: `
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
<UGroup gap="xl">
|
|
68
|
+
<URow>
|
|
69
|
+
<UAvatar
|
|
70
|
+
v-for="(color, index) in colors"
|
|
71
|
+
v-bind="args"
|
|
72
|
+
:color="color"
|
|
73
|
+
:key="index"
|
|
74
|
+
:label="color"
|
|
75
|
+
/>
|
|
76
|
+
</URow>
|
|
77
|
+
<URow>
|
|
78
|
+
<UAvatar
|
|
79
|
+
v-for="(color, index) in colors"
|
|
80
|
+
:key="index"
|
|
81
|
+
v-bind="args"
|
|
82
|
+
:color="color"
|
|
83
|
+
:label="''"
|
|
84
|
+
/>
|
|
85
|
+
</URow>
|
|
86
|
+
</UGroup>
|
|
62
87
|
`,
|
|
63
|
-
created() {
|
|
64
|
-
this.mxArgTypes = argTypes;
|
|
65
|
-
},
|
|
66
88
|
});
|
|
67
89
|
|
|
68
90
|
const RoundedTemplate = (args, { argTypes } = {}) => ({
|
|
69
|
-
components: { UAvatar, URow },
|
|
91
|
+
components: { UGroup, UAvatar, URow },
|
|
70
92
|
setup() {
|
|
71
93
|
return {
|
|
72
94
|
args,
|
|
@@ -74,34 +96,52 @@ const RoundedTemplate = (args, { argTypes } = {}) => ({
|
|
|
74
96
|
};
|
|
75
97
|
},
|
|
76
98
|
template: `
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
99
|
+
<UGroup>
|
|
100
|
+
<URow>
|
|
101
|
+
<UAvatar
|
|
102
|
+
v-for="(rounded, index) in roundedValues"
|
|
103
|
+
:key="index"
|
|
104
|
+
v-bind="args"
|
|
105
|
+
:rounded="rounded"
|
|
106
|
+
:label="rounded"
|
|
107
|
+
/>
|
|
108
|
+
</URow>
|
|
109
|
+
</UGroup>
|
|
85
110
|
`,
|
|
86
111
|
});
|
|
87
112
|
|
|
88
113
|
export const Default = DefaultTemplate.bind({});
|
|
89
|
-
Default.args = {};
|
|
114
|
+
Default.args = { size: "3xl" };
|
|
115
|
+
|
|
116
|
+
export const src = DefaultTemplate.bind({});
|
|
117
|
+
src.args = {
|
|
118
|
+
src: "https://avatars.githubusercontent.com/u/16276298?v=4",
|
|
119
|
+
size: "3xl",
|
|
120
|
+
};
|
|
90
121
|
|
|
122
|
+
export const label = DefaultTemplate.bind({});
|
|
123
|
+
label.args = { label: "Name Surname", size: "3xl" };
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Hold cursor above an avatar to see value.
|
|
127
|
+
*/
|
|
91
128
|
export const sizes = SizesTemplate.bind({});
|
|
92
129
|
sizes.args = {};
|
|
93
130
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Hold cursor above an avatar to see value.
|
|
133
|
+
*/
|
|
97
134
|
export const rounded = RoundedTemplate.bind({});
|
|
98
|
-
rounded.args = {
|
|
99
|
-
|
|
100
|
-
export const bordered = ColorsTemplate.bind({});
|
|
101
|
-
bordered.args = { userName: "Name", bordered: true };
|
|
135
|
+
rounded.args = { label: "John Doe", color: "orange" };
|
|
102
136
|
|
|
103
|
-
|
|
104
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Hold cursor above an avatar to see value.
|
|
139
|
+
*/
|
|
140
|
+
export const colors = ColorsTemplate.bind({});
|
|
141
|
+
colors.args = {};
|
|
105
142
|
|
|
106
|
-
|
|
107
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Hold cursor above an avatar to see value.
|
|
145
|
+
*/
|
|
146
|
+
export const bordered = ColorsTemplate.bind({});
|
|
147
|
+
bordered.args = { bordered: true };
|
|
@@ -1,19 +1,28 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
3
|
:title="label"
|
|
4
|
-
:style="
|
|
4
|
+
:style="backgroundImage"
|
|
5
5
|
:data-cy="dataCy"
|
|
6
6
|
v-bind="avatarAttrs"
|
|
7
7
|
@click="onClick"
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
>
|
|
9
|
+
<template v-if="!backgroundImage">
|
|
10
|
+
<template v-if="labelFirstLetters">{{ labelFirstLetters }}</template>
|
|
11
|
+
<UIcon
|
|
12
|
+
v-else
|
|
13
|
+
:name="icon"
|
|
14
|
+
:color="color === 'white' ? 'grayscale' : color"
|
|
15
|
+
:size="size"
|
|
16
|
+
v-bind="iconAttrs"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
</div>
|
|
10
20
|
</template>
|
|
11
21
|
|
|
12
22
|
<script setup>
|
|
13
23
|
import { computed } from "vue";
|
|
14
24
|
|
|
15
|
-
import
|
|
16
|
-
|
|
25
|
+
import UIcon from "../ui.image-icon";
|
|
17
26
|
import UIService from "../service.ui";
|
|
18
27
|
|
|
19
28
|
import { UAvatar } from "./constants/index";
|
|
@@ -21,14 +30,11 @@ import defaultConfig from "./configs/default.config";
|
|
|
21
30
|
import { useAttrs } from "./composables/attrs.composable";
|
|
22
31
|
|
|
23
32
|
/* Should be a string for correct web-types gen */
|
|
24
|
-
defineOptions({
|
|
25
|
-
name: "UAvatar",
|
|
26
|
-
inheritAttrs: false,
|
|
27
|
-
});
|
|
33
|
+
defineOptions({ name: "UAvatar", inheritAttrs: false });
|
|
28
34
|
|
|
29
35
|
const props = defineProps({
|
|
30
36
|
/**
|
|
31
|
-
*
|
|
37
|
+
* Avatar image source.
|
|
32
38
|
*/
|
|
33
39
|
src: {
|
|
34
40
|
type: String,
|
|
@@ -36,33 +42,42 @@ const props = defineProps({
|
|
|
36
42
|
},
|
|
37
43
|
|
|
38
44
|
/**
|
|
39
|
-
*
|
|
40
|
-
* @values xs, sm, md, lg, xl, 2xl
|
|
45
|
+
* Avatar label (user name, nickname, etc.).
|
|
41
46
|
*/
|
|
42
|
-
|
|
47
|
+
label: {
|
|
43
48
|
type: String,
|
|
44
|
-
default:
|
|
49
|
+
default: "",
|
|
45
50
|
},
|
|
46
51
|
|
|
47
52
|
/**
|
|
48
|
-
*
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
* Avatar icon placeholder.
|
|
54
|
+
*/
|
|
55
|
+
icon: {
|
|
51
56
|
type: String,
|
|
52
|
-
default: UIService.get(defaultConfig, UAvatar).default.
|
|
57
|
+
default: UIService.get(defaultConfig, UAvatar).default.icon,
|
|
53
58
|
},
|
|
54
59
|
|
|
55
60
|
/**
|
|
56
|
-
* Avatar
|
|
61
|
+
* Avatar size.
|
|
62
|
+
* @values 3xs, 2xs, xs, sm, md, lg, xl, 2xl, 3xl
|
|
57
63
|
*/
|
|
58
|
-
|
|
64
|
+
size: {
|
|
59
65
|
type: String,
|
|
60
|
-
default:
|
|
66
|
+
default: UIService.get(defaultConfig, UAvatar).default.size,
|
|
61
67
|
},
|
|
62
68
|
|
|
63
69
|
/**
|
|
64
|
-
*
|
|
65
|
-
* @values
|
|
70
|
+
* Avatar color.
|
|
71
|
+
* @values brand, grayscale, gray, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, white
|
|
72
|
+
*/
|
|
73
|
+
color: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: UIService.get(defaultConfig, UAvatar).default.color,
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Avatar corner rounding.
|
|
80
|
+
* @values none, sm, md, lg, full
|
|
66
81
|
*/
|
|
67
82
|
rounded: {
|
|
68
83
|
type: String,
|
|
@@ -70,7 +85,7 @@ const props = defineProps({
|
|
|
70
85
|
},
|
|
71
86
|
|
|
72
87
|
/**
|
|
73
|
-
*
|
|
88
|
+
* Add border to the avatar.
|
|
74
89
|
*/
|
|
75
90
|
bordered: {
|
|
76
91
|
type: Boolean,
|
|
@@ -78,7 +93,15 @@ const props = defineProps({
|
|
|
78
93
|
},
|
|
79
94
|
|
|
80
95
|
/**
|
|
81
|
-
*
|
|
96
|
+
* Component ui config object.
|
|
97
|
+
*/
|
|
98
|
+
config: {
|
|
99
|
+
type: Object,
|
|
100
|
+
default: () => ({}),
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Data-cy attribute for automated testing.
|
|
82
105
|
*/
|
|
83
106
|
dataCy: {
|
|
84
107
|
type: String,
|
|
@@ -97,23 +120,14 @@ const labelFirstLetters = computed(() => {
|
|
|
97
120
|
return firstWordLetter + secondWordLetter;
|
|
98
121
|
});
|
|
99
122
|
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (props.src) {
|
|
104
|
-
src = props.src.includes("http") ? props.src : import.meta.env.BASE_URL + props.path;
|
|
105
|
-
} else if (!props.label && !props.src) {
|
|
106
|
-
src = defaultAvatar;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return src;
|
|
110
|
-
});
|
|
123
|
+
const backgroundImage = computed(() => {
|
|
124
|
+
const baseUrl = import.meta.env.BASE_URL;
|
|
125
|
+
const src = props.src && props.src.includes("http") ? props.src : baseUrl + props.src;
|
|
111
126
|
|
|
112
|
-
|
|
113
|
-
return `background-image: url(${imgSrc.value});`;
|
|
127
|
+
return props.src ? `background-image: url(${src});` : "";
|
|
114
128
|
});
|
|
115
129
|
|
|
116
|
-
const { avatarAttrs } = useAttrs(props);
|
|
130
|
+
const { avatarAttrs, iconAttrs } = useAttrs(props);
|
|
117
131
|
|
|
118
132
|
function onClick(event) {
|
|
119
133
|
emit("click", event);
|
package/ui.image-icon/index.vue
CHANGED
|
@@ -137,23 +137,20 @@ const emit = defineEmits(["click", "focus", "blur"]);
|
|
|
137
137
|
const { config, wrapperAttrs, containerAttrs, iconAttrs } = useAttrs(props);
|
|
138
138
|
|
|
139
139
|
const generatedIcons = computed(() => {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
eager: true,
|
|
145
|
-
query: "?component",
|
|
146
|
-
}),
|
|
140
|
+
return (
|
|
141
|
+
Object.entries(
|
|
142
|
+
import.meta.glob(`../assets/icons/**/*.svg`, { eager: true, query: "?component" }),
|
|
143
|
+
) || []
|
|
147
144
|
);
|
|
148
145
|
});
|
|
149
146
|
|
|
150
147
|
const dynamicComponent = computed(() => {
|
|
151
148
|
const FILL_SUFFIX = "-fill";
|
|
152
149
|
|
|
153
|
-
const
|
|
150
|
+
const isDefaultIcon = Boolean(generatedIcons.value.find(([path]) => path.includes(props.name)));
|
|
154
151
|
const userLibrary = config.value.defaultVariants.library;
|
|
155
152
|
|
|
156
|
-
const library = props.internal &&
|
|
153
|
+
const library = props.internal && isDefaultIcon ? "vueless" : userLibrary;
|
|
157
154
|
const weight = config.value.defaultVariants.weight;
|
|
158
155
|
const style = config.value.defaultVariants.style;
|
|
159
156
|
const isFill = props.name.endsWith(FILL_SUFFIX);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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 />
|
|
@@ -5,11 +5,15 @@ export default /*tw*/ {
|
|
|
5
5
|
error: {
|
|
6
6
|
true: "bg-red-500",
|
|
7
7
|
},
|
|
8
|
+
color: {
|
|
9
|
+
white: "bg-white",
|
|
10
|
+
grayscale: "bg-gray-900",
|
|
11
|
+
},
|
|
8
12
|
},
|
|
9
13
|
},
|
|
10
14
|
progressMobile: "mt-safe-top mx-3 rounded max-w-[calc(100%-1.5rem)]",
|
|
11
15
|
defaultVariants: {
|
|
12
|
-
color: "
|
|
16
|
+
color: "brand",
|
|
13
17
|
},
|
|
14
18
|
safelist: (colors) => [{ pattern: `bg-(${colors})-500` }],
|
|
15
19
|
};
|
package/ui.loader-top/index.vue
CHANGED
|
@@ -29,7 +29,7 @@ const props = defineProps({
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* The color of the loader stripe.
|
|
32
|
-
* @values gray, red, orange, yellow, green, blue, violet, fuchsia
|
|
32
|
+
* @values brand, grayscale, gray, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, white
|
|
33
33
|
*/
|
|
34
34
|
color: {
|
|
35
35
|
type: String,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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 />
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
progress: {
|
|
3
3
|
base: `
|
|
4
|
-
block appearance-none border-none overflow-hidden w-full
|
|
5
|
-
[&::-webkit-progress-bar]:w-full h-2 rounded-full [&::-webkit-progress-bar]:rounded-full
|
|
6
|
-
[&::-webkit-progress-bar]:bg-{color}-200 [@supports(selector(&::-moz-progress-bar))]:bg-{color}-200
|
|
7
|
-
[&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:transition-all
|
|
4
|
+
block appearance-none border-none overflow-hidden w-full
|
|
5
|
+
[&::-webkit-progress-bar]:w-full h-2 rounded-full [&::-webkit-progress-bar]:rounded-full
|
|
6
|
+
[&::-webkit-progress-bar]:bg-{color}-200 [@supports(selector(&::-moz-progress-bar))]:bg-{color}-200
|
|
7
|
+
[&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:transition-all
|
|
8
8
|
[&::-webkit-progress-value]:ease-in-out [&::-moz-progress-bar]:rounded-full text-{color}-500
|
|
9
|
-
[&::-webkit-progress-value]:bg-current [&::-moz-progress-bar]:bg-current indeterminate:relative
|
|
10
|
-
indeterminate:after:rounded-full [&:indeterminate::-webkit-progress-value]:rounded-full
|
|
9
|
+
[&::-webkit-progress-value]:bg-current [&::-moz-progress-bar]:bg-current indeterminate:relative
|
|
10
|
+
indeterminate:after:rounded-full [&:indeterminate::-webkit-progress-value]:rounded-full
|
|
11
11
|
[&:indeterminate::-moz-progress-bar]:rounded-full
|
|
12
12
|
`,
|
|
13
13
|
variants: {
|
|
@@ -27,7 +27,7 @@ export default /*tw*/ {
|
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
defaultVariants: {
|
|
30
|
-
color: "
|
|
30
|
+
color: "brand",
|
|
31
31
|
size: "md",
|
|
32
32
|
},
|
|
33
33
|
safelist: (colors) => [{ pattern: `bg-(${colors})-200` }, { pattern: `text-(${colors})-500` }],
|
|
@@ -13,19 +13,36 @@ import { useAttrs } from "./composables/attrs.composable";
|
|
|
13
13
|
defineOptions({ name: "UProgress", inheritAttrs: false });
|
|
14
14
|
|
|
15
15
|
const props = defineProps({
|
|
16
|
+
/**
|
|
17
|
+
* Progress value (current step).
|
|
18
|
+
*/
|
|
16
19
|
value: {
|
|
17
20
|
type: Number,
|
|
18
21
|
required: true,
|
|
19
22
|
default: 0,
|
|
20
23
|
},
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Progress max amount of steps.
|
|
27
|
+
*/
|
|
21
28
|
max: {
|
|
22
29
|
type: Number,
|
|
23
30
|
default: 100,
|
|
24
31
|
},
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Progress size.
|
|
35
|
+
* @values 2xs, xs, sm, md, lg, xl, 2xl
|
|
36
|
+
*/
|
|
25
37
|
size: {
|
|
26
38
|
type: String,
|
|
27
39
|
default: UIService.get(defaultConfig, UProgress).default.size,
|
|
28
40
|
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Progress color.
|
|
44
|
+
* @values brand, grayscale, gray, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, white
|
|
45
|
+
*/
|
|
29
46
|
color: {
|
|
30
47
|
type: String,
|
|
31
48
|
default: UIService.get(defaultConfig, UProgress).default.color,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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,16 @@
|
|
|
1
|
+
import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source } from "@storybook/blocks";
|
|
2
|
+
import { getSource } from "../service.storybook";
|
|
3
|
+
|
|
4
|
+
import * as stories from "./index.stories";
|
|
5
|
+
import defaultConfig from "./configs/default.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 />
|