vueless 0.0.200 → 0.0.202
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/composable.ui/index.js +3 -2
- package/package.json +2 -2
- package/service.storybook/index.js +1 -1
- package/ui.button/composables/attrs.composable.js +6 -2
- package/ui.button/configs/default.config.js +14 -2
- package/ui.button/index.stories.js +27 -3
- package/ui.button/index.vue +70 -27
- package/ui.button-link/composables/attrs.composable.js +64 -130
- package/ui.button-link/index.stories.js +2 -4
- package/ui.button-link/index.vue +29 -4
- package/ui.button-toggle/composables/attrs.composable.js +21 -33
- package/ui.button-toggle/configs/default.config.js +2 -2
- package/ui.button-toggle/index.vue +8 -2
- package/ui.button-toggle-item/composables/attrs.composable.js +50 -40
- package/ui.button-toggle-item/configs/default.config.js +1 -1
- package/ui.button-toggle-item/index.stories.js +2 -4
- package/ui.button-toggle-item/index.vue +11 -3
- package/ui.dropdown-badge/composables/attrs.composable.js +45 -45
- package/ui.dropdown-badge/configs/default.config.js +3 -3
- package/ui.dropdown-badge/index.stories.js +2 -4
- package/ui.dropdown-badge/index.vue +8 -2
- package/ui.dropdown-button/composables/attrs.composable.js +45 -45
- package/ui.dropdown-button/configs/default.config.js +3 -3
- package/ui.dropdown-button/index.stories.js +2 -4
- package/ui.dropdown-button/index.vue +8 -2
- package/ui.dropdown-item/index.vue +7 -1
- package/ui.dropdown-link/composables/attrs.composable.js +43 -45
- package/ui.dropdown-link/configs/default.config.js +3 -3
- package/ui.dropdown-link/index.stories.js +2 -4
- package/ui.dropdown-link/index.vue +8 -2
- package/ui.dropdown-list/composables/attrs.composable.js +43 -67
- package/ui.dropdown-list/configs/default.config.js +2 -2
- package/ui.dropdown-list/index.vue +19 -3
- package/ui.form-calendar/components/DayView.vue +4 -4
- package/ui.form-calendar/composables/attrs.composable.js +5 -4
- package/ui.form-input/composables/attrs.composable.js +31 -48
- package/ui.form-input/configs/default.config.js +3 -3
- package/ui.form-input/index.stories.js +32 -9
- package/ui.form-input/index.vue +92 -41
- package/ui.navigation-progress/components/StepperProgress.vue +87 -0
- package/ui.navigation-progress/composables/attrs.composable.js +33 -56
- package/ui.navigation-progress/configs/default.config.js +34 -1
- package/ui.navigation-progress/constants/index.js +5 -0
- package/ui.navigation-progress/index.stories.js +3 -0
- package/ui.navigation-progress/index.vue +55 -9
- package/ui.text-alert/composables/attrs.composable.js +23 -39
- package/ui.text-alert/configs/default.config.js +3 -3
- package/ui.text-alert/index.vue +19 -8
- package/ui.text-badge/composables/attrs.composable.js +25 -36
- package/ui.text-badge/index.stories.js +2 -4
- package/ui.text-badge/index.vue +22 -2
- package/ui.text-block/composables/attrs.composable.js +24 -20
- package/ui.text-block/index.vue +1 -1
- package/ui.text-empty/composables/attrs.composable.js +17 -27
- package/ui.text-empty/configs/default.config.js +1 -1
- package/ui.text-empty/index.stories.js +2 -4
- package/ui.text-empty/index.vue +1 -1
- package/ui.text-header/composables/attrs.composable.js +28 -22
- package/ui.text-header/index.stories.js +1 -1
- package/ui.text-header/index.vue +1 -1
- package/ui.text-money/composables/attrs.composable.js +21 -48
- package/ui.text-money/index.stories.js +2 -4
- package/web-types.json +326 -145
- package/ui.navigation-stepper/Docs.mdx +0 -16
- package/ui.navigation-stepper/composables/attrs.composable.js +0 -25
- package/ui.navigation-stepper/configs/default.config.js +0 -13
- package/ui.navigation-stepper/constants/index.js +0 -5
- package/ui.navigation-stepper/index.stories.js +0 -33
- package/ui.navigation-stepper/index.vue +0 -126
|
@@ -1,16 +0,0 @@
|
|
|
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,25 +0,0 @@
|
|
|
1
|
-
import useUI from "../../composable.ui";
|
|
2
|
-
|
|
3
|
-
import defaultConfig from "../configs/default.config";
|
|
4
|
-
|
|
5
|
-
export function useAttrs(props) {
|
|
6
|
-
const { getAttrs } = useUI(defaultConfig, () => props.config);
|
|
7
|
-
|
|
8
|
-
const wrapperAttrs = getAttrs("wrapper");
|
|
9
|
-
const stepperAttrs = getAttrs("stepper");
|
|
10
|
-
const titleAttrs = getAttrs("title", { isComponent: true });
|
|
11
|
-
const ringAttrs = getAttrs("ring");
|
|
12
|
-
const countAttrs = getAttrs("count");
|
|
13
|
-
const gradientAttrs = getAttrs("gradient");
|
|
14
|
-
const svgAttrs = getAttrs("svg");
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
wrapperAttrs,
|
|
18
|
-
titleAttrs,
|
|
19
|
-
stepperAttrs,
|
|
20
|
-
ringAttrs,
|
|
21
|
-
countAttrs,
|
|
22
|
-
gradientAttrs,
|
|
23
|
-
svgAttrs,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default /*tw*/ {
|
|
2
|
-
wrapper: "flex items-center justify-between",
|
|
3
|
-
stepper: "h-12 w-12",
|
|
4
|
-
ring: "stroke-current text-gray-100",
|
|
5
|
-
count: "text-xl font-bold text-gray-900 translate-y-2 transform",
|
|
6
|
-
title: "",
|
|
7
|
-
gradient: "",
|
|
8
|
-
svg: "",
|
|
9
|
-
defaultVariants: {
|
|
10
|
-
step: 1,
|
|
11
|
-
color: "brand",
|
|
12
|
-
},
|
|
13
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getArgTypes } from "../service.storybook";
|
|
2
|
-
|
|
3
|
-
import UStepper from "../ui.navigation-stepper";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The `UStepper` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.navigation-stepper)
|
|
7
|
-
*/
|
|
8
|
-
export default {
|
|
9
|
-
id: "8030",
|
|
10
|
-
title: "Navigation / Stepper",
|
|
11
|
-
component: UStepper,
|
|
12
|
-
args: {
|
|
13
|
-
title: "Title",
|
|
14
|
-
step: 1,
|
|
15
|
-
totalSteps: 10,
|
|
16
|
-
},
|
|
17
|
-
argTypes: {
|
|
18
|
-
...getArgTypes(UStepper.name),
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const DefaultTemplate = (args) => ({
|
|
23
|
-
components: { UStepper },
|
|
24
|
-
setup() {
|
|
25
|
-
return { args };
|
|
26
|
-
},
|
|
27
|
-
template: `
|
|
28
|
-
<UStepper v-bind="args" />
|
|
29
|
-
`,
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export const Default = DefaultTemplate.bind({});
|
|
33
|
-
Default.args = {};
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :data-cy="dataCy" v-bind="wrapperAttrs">
|
|
3
|
-
<UHeader :label="title" size="xs" v-bind="titleAttrs" />
|
|
4
|
-
|
|
5
|
-
<div v-bind="stepperAttrs">
|
|
6
|
-
<svg width="100%" height="100%" viewBox="0 0 40 40" v-bind="svgAttrs">
|
|
7
|
-
<defs>
|
|
8
|
-
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="0%" v-bind="gradientAttrs">
|
|
9
|
-
<stop offset="0%" :stop-color="setStepperColor" />
|
|
10
|
-
<stop offset="100%" :stop-color="setStepperColor" />
|
|
11
|
-
</linearGradient>
|
|
12
|
-
</defs>
|
|
13
|
-
|
|
14
|
-
<circle
|
|
15
|
-
cx="20"
|
|
16
|
-
cy="20"
|
|
17
|
-
r="15.91549430918954"
|
|
18
|
-
fill="transparent"
|
|
19
|
-
stroke-width="4"
|
|
20
|
-
v-bind="ringAttrs"
|
|
21
|
-
></circle>
|
|
22
|
-
|
|
23
|
-
<circle
|
|
24
|
-
cx="20"
|
|
25
|
-
cy="20"
|
|
26
|
-
r="15.91549430918954"
|
|
27
|
-
fill="transparent"
|
|
28
|
-
stroke="url(#gradient)"
|
|
29
|
-
stroke-width="4"
|
|
30
|
-
:stroke-dasharray="fillPercentage"
|
|
31
|
-
stroke-dashoffset="0"
|
|
32
|
-
></circle>
|
|
33
|
-
<g v-bind="countAttrs">
|
|
34
|
-
<text y="45%" transform="translate(0, 2)">
|
|
35
|
-
<tspan x="50%" text-anchor="middle">{{ step }}</tspan>
|
|
36
|
-
</text>
|
|
37
|
-
</g>
|
|
38
|
-
</svg>
|
|
39
|
-
</div>
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<script setup>
|
|
44
|
-
import { computed } from "vue";
|
|
45
|
-
import colors from "tailwindcss/colors";
|
|
46
|
-
|
|
47
|
-
import UHeader from "../ui.text-header";
|
|
48
|
-
import UIService from "../service.ui";
|
|
49
|
-
import { GRAY_COLORS } from "../preset.tailwind/constants";
|
|
50
|
-
|
|
51
|
-
import { UStepper } from "./constants/index";
|
|
52
|
-
import defaultConfig from "./configs/default.config";
|
|
53
|
-
import { useAttrs } from "./composables/attrs.composable";
|
|
54
|
-
|
|
55
|
-
/* Should be a string for correct web-types gen */
|
|
56
|
-
defineOptions({ name: "UStepper", inheritAttrs: false });
|
|
57
|
-
|
|
58
|
-
const props = defineProps({
|
|
59
|
-
/**
|
|
60
|
-
* Set component title.
|
|
61
|
-
*/
|
|
62
|
-
title: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: "",
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Set step number.
|
|
69
|
-
*/
|
|
70
|
-
step: {
|
|
71
|
-
type: Number,
|
|
72
|
-
default: UIService.get(defaultConfig, UStepper).default.step,
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Icon color.
|
|
77
|
-
* @values brand, grayscale, gray, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, white
|
|
78
|
-
*/
|
|
79
|
-
color: {
|
|
80
|
-
type: String,
|
|
81
|
-
default: UIService.get(defaultConfig, UStepper).default.color,
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Set total number of steps.
|
|
86
|
-
*/
|
|
87
|
-
totalSteps: {
|
|
88
|
-
type: Number,
|
|
89
|
-
default: null,
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Component ui config object.
|
|
94
|
-
*/
|
|
95
|
-
config: {
|
|
96
|
-
type: Object,
|
|
97
|
-
default: () => ({}),
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Sets data-cy attribute for automated testing.
|
|
102
|
-
*/
|
|
103
|
-
dataCy: {
|
|
104
|
-
type: String,
|
|
105
|
-
default: "",
|
|
106
|
-
},
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
const { wrapperAttrs, titleAttrs, stepperAttrs, ringAttrs, countAttrs, gradientAttrs, svgAttrs } =
|
|
110
|
-
useAttrs(props);
|
|
111
|
-
|
|
112
|
-
const setStepperColor = computed(() => {
|
|
113
|
-
return colors[props.color]
|
|
114
|
-
? colors[props.color][500]
|
|
115
|
-
: GRAY_COLORS.includes(props.color)
|
|
116
|
-
? colors[props.color][900]
|
|
117
|
-
: colors.zinc[900];
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
const fillPercentage = computed(() => {
|
|
121
|
-
const maxCountPercent = 100;
|
|
122
|
-
const activePercent = (props.step / props.totalSteps) * maxCountPercent;
|
|
123
|
-
|
|
124
|
-
return `${activePercent} ${maxCountPercent}`;
|
|
125
|
-
});
|
|
126
|
-
</script>
|