vueless 0.0.95 → 0.0.96
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
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import useUI from "../../composable.ui";
|
|
2
|
+
import { cva } from "../../service.ui";
|
|
3
|
+
|
|
4
|
+
import defaultConfig from "../configs/default.config";
|
|
5
|
+
import { computed } from "vue";
|
|
6
|
+
|
|
7
|
+
export function useAttrs(props) {
|
|
8
|
+
const { config, getAttrs, setColor } = useUI(defaultConfig, () => props.config);
|
|
9
|
+
const { progress } = config.value;
|
|
10
|
+
|
|
11
|
+
const cvaProgress = cva({
|
|
12
|
+
base: progress.base,
|
|
13
|
+
variants: progress.variants,
|
|
14
|
+
compoundVariants: progress.compoundVariants,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const progressClasses = computed(() =>
|
|
18
|
+
setColor(
|
|
19
|
+
cvaProgress({
|
|
20
|
+
size: props.size,
|
|
21
|
+
color: props.color,
|
|
22
|
+
}),
|
|
23
|
+
props.color,
|
|
24
|
+
),
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
const progressAttrs = getAttrs("progress", { classes: progressClasses });
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
progressAttrs,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export default /*tw*/ {
|
|
2
|
+
progress: {
|
|
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
|
|
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
|
|
11
|
+
[&:indeterminate::-moz-progress-bar]:rounded-full
|
|
12
|
+
`,
|
|
13
|
+
variants: {
|
|
14
|
+
color: {
|
|
15
|
+
white: "bg-white",
|
|
16
|
+
grayscale: "bg-gray-900",
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
"2xs": "h-px",
|
|
20
|
+
xs: "h-0.5",
|
|
21
|
+
sm: "h-1",
|
|
22
|
+
md: "h-2",
|
|
23
|
+
lg: "h-3",
|
|
24
|
+
xl: "h-4",
|
|
25
|
+
"2xl": "h-5",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
color: "green",
|
|
31
|
+
size: "md",
|
|
32
|
+
},
|
|
33
|
+
safelist: (colors) => [{ pattern: `bg-(${colors})-200` }, { pattern: `text-(${colors})-500` }],
|
|
34
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import UProgress from "./index.vue";
|
|
2
|
+
import UButton from "../ui.button/index.vue";
|
|
3
|
+
|
|
4
|
+
import { getArgTypes } from "../service.storybook";
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
id: "9015",
|
|
8
|
+
title: "Other / Progress",
|
|
9
|
+
component: UProgress,
|
|
10
|
+
argTypes: {
|
|
11
|
+
...getArgTypes(UProgress.name),
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const DefaultTemplate = (args) => ({
|
|
16
|
+
components: { UProgress, UButton },
|
|
17
|
+
setup() {
|
|
18
|
+
return { args };
|
|
19
|
+
},
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
progress: 10,
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
methods: {
|
|
26
|
+
updateProgress() {
|
|
27
|
+
this.progress += 10;
|
|
28
|
+
|
|
29
|
+
if (this.progress > 100) {
|
|
30
|
+
this.progress = 0;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
template: `
|
|
35
|
+
<UProgress :value="progress" />
|
|
36
|
+
|
|
37
|
+
<UButton class="mt-4" @click="updateProgress">Update Progress</UButton>
|
|
38
|
+
`,
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const Default = DefaultTemplate.bind({});
|
|
42
|
+
Default.args = {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<progress v-bind="progressAttrs" :max="max" :value="value" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import UIService from "../service.ui";
|
|
7
|
+
|
|
8
|
+
import { UProgress } from "./constants";
|
|
9
|
+
import defaultConfig from "./configs/default.config";
|
|
10
|
+
import { useAttrs } from "./composables/attrs.composable";
|
|
11
|
+
|
|
12
|
+
/* Should be a string for correct web-types gen */
|
|
13
|
+
defineOptions({ name: "UProgress", inheritAttrs: false });
|
|
14
|
+
|
|
15
|
+
const props = defineProps({
|
|
16
|
+
value: {
|
|
17
|
+
type: Number,
|
|
18
|
+
required: true,
|
|
19
|
+
default: 0,
|
|
20
|
+
},
|
|
21
|
+
max: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 100,
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: UIService.get(defaultConfig, UProgress).default.size,
|
|
28
|
+
},
|
|
29
|
+
color: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: UIService.get(defaultConfig, UProgress).default.color,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const { progressAttrs } = useAttrs(props);
|
|
36
|
+
</script>
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.96",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -5444,6 +5444,49 @@
|
|
|
5444
5444
|
"symbol": "default"
|
|
5445
5445
|
}
|
|
5446
5446
|
},
|
|
5447
|
+
{
|
|
5448
|
+
"name": "UProgress",
|
|
5449
|
+
"description": "",
|
|
5450
|
+
"attributes": [
|
|
5451
|
+
{
|
|
5452
|
+
"name": "value",
|
|
5453
|
+
"required": true,
|
|
5454
|
+
"value": {
|
|
5455
|
+
"kind": "expression",
|
|
5456
|
+
"type": "number"
|
|
5457
|
+
},
|
|
5458
|
+
"default": "0"
|
|
5459
|
+
},
|
|
5460
|
+
{
|
|
5461
|
+
"name": "max",
|
|
5462
|
+
"value": {
|
|
5463
|
+
"kind": "expression",
|
|
5464
|
+
"type": "number"
|
|
5465
|
+
},
|
|
5466
|
+
"default": "100"
|
|
5467
|
+
},
|
|
5468
|
+
{
|
|
5469
|
+
"name": "size",
|
|
5470
|
+
"value": {
|
|
5471
|
+
"kind": "expression",
|
|
5472
|
+
"type": "string"
|
|
5473
|
+
},
|
|
5474
|
+
"default": "md"
|
|
5475
|
+
},
|
|
5476
|
+
{
|
|
5477
|
+
"name": "color",
|
|
5478
|
+
"value": {
|
|
5479
|
+
"kind": "expression",
|
|
5480
|
+
"type": "string"
|
|
5481
|
+
},
|
|
5482
|
+
"default": "green"
|
|
5483
|
+
}
|
|
5484
|
+
],
|
|
5485
|
+
"source": {
|
|
5486
|
+
"module": "vueless/ui.progress/index.vue",
|
|
5487
|
+
"symbol": "default"
|
|
5488
|
+
}
|
|
5489
|
+
},
|
|
5447
5490
|
{
|
|
5448
5491
|
"name": "URadio",
|
|
5449
5492
|
"description": "",
|