vueless 0.0.244 → 0.0.245
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 +2 -2
- package/ui.container-group/configs/default.config.js +15 -1
- package/ui.container-group/index.stories.js +15 -4
- package/ui.container-group/index.vue +14 -2
- package/web-types.json +11 -54
- package/ui.container-groups/Docs.mdx +0 -16
- package/ui.container-groups/composables/attrs.composable.js +0 -33
- package/ui.container-groups/configs/default.config.js +0 -26
- package/ui.container-groups/constants/index.js +0 -5
- package/ui.container-groups/index.stories.js +0 -52
- package/ui.container-groups/index.vue +0 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.245",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Vue Styleless Component Framework.",
|
|
6
6
|
"homepage": "https://vueless.com",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@release-it/bumper": "^6.0.1",
|
|
38
38
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
39
39
|
"@vue/eslint-config-prettier": "^9.0.0",
|
|
40
|
-
"@vueless/plugin-vite": "^0.0.
|
|
40
|
+
"@vueless/plugin-vite": "^0.0.45",
|
|
41
41
|
"@vueless/storybook": "^0.0.34",
|
|
42
42
|
"@vueless/web-types": "^0.0.13",
|
|
43
43
|
"autoprefixer": "^10.4.19",
|
|
@@ -12,8 +12,22 @@ export default /*tw*/ {
|
|
|
12
12
|
headerFallback: "flex items-center",
|
|
13
13
|
title: "{UHeader} pr-2",
|
|
14
14
|
underline: "{UDivider} pt-1.5",
|
|
15
|
+
content: {
|
|
16
|
+
base: "flex flex-col items-stretch",
|
|
17
|
+
variants: {
|
|
18
|
+
gap: {
|
|
19
|
+
none: "gap-0",
|
|
20
|
+
xs: "gap-8",
|
|
21
|
+
sm: "gap-10",
|
|
22
|
+
md: "gap-12",
|
|
23
|
+
lg: "gap-14",
|
|
24
|
+
xl: "gap-16",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
15
28
|
defaultVariants: {
|
|
16
|
-
|
|
29
|
+
gap: "md",
|
|
30
|
+
upperlined: false,
|
|
17
31
|
underlined: false,
|
|
18
32
|
},
|
|
19
33
|
};
|
|
@@ -60,12 +60,23 @@ upperlined.args = { upperlined: false, underlined: true };
|
|
|
60
60
|
export const underlined = DefaultTemplate.bind({});
|
|
61
61
|
underlined.args = { upperlined: true, underlined: false };
|
|
62
62
|
|
|
63
|
+
export const nestedGroups = DefaultTemplate.bind({});
|
|
64
|
+
nestedGroups.args = {
|
|
65
|
+
title: "",
|
|
66
|
+
slotTemplate: `
|
|
67
|
+
<UGroup :upperlined="n !== 1" :title="'Group '+n" v-for="n in 3">
|
|
68
|
+
<UCol>
|
|
69
|
+
<UInput placeholder="input" label="Label" />
|
|
70
|
+
<UInput placeholder="input" label="Label" />
|
|
71
|
+
</UCol>
|
|
72
|
+
</UGroup>
|
|
73
|
+
`,
|
|
74
|
+
};
|
|
75
|
+
|
|
63
76
|
export const slotDefault = DefaultTemplate.bind({});
|
|
64
77
|
slotDefault.args = {
|
|
65
78
|
slotTemplate: `
|
|
66
|
-
<
|
|
67
|
-
<UInput placeholder="placeholder" label="Label" />
|
|
68
|
-
</template>
|
|
79
|
+
<UInput placeholder="placeholder" label="Label" />
|
|
69
80
|
`,
|
|
70
81
|
};
|
|
71
82
|
slotDefault.parameters = {
|
|
@@ -79,10 +90,10 @@ slotDefault.parameters = {
|
|
|
79
90
|
export const slotRight = DefaultTemplate.bind({});
|
|
80
91
|
slotRight.args = {
|
|
81
92
|
slotTemplate: `
|
|
82
|
-
${defaultTemplate}
|
|
83
93
|
<template #right>
|
|
84
94
|
<UButton size="sm" label="Edit"/>
|
|
85
95
|
</template>
|
|
96
|
+
${defaultTemplate}
|
|
86
97
|
`,
|
|
87
98
|
};
|
|
88
99
|
slotRight.parameters = {
|
|
@@ -24,8 +24,10 @@
|
|
|
24
24
|
<UDivider v-if="underlined" size="xl" v-bind="underlineAttrs" />
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
<div v-bind="contentAttrs">
|
|
28
|
+
<!-- @slot Use it to add something inside. -->
|
|
29
|
+
<slot />
|
|
30
|
+
</div>
|
|
29
31
|
</div>
|
|
30
32
|
</template>
|
|
31
33
|
|
|
@@ -50,6 +52,15 @@ const props = defineProps({
|
|
|
50
52
|
default: "",
|
|
51
53
|
},
|
|
52
54
|
|
|
55
|
+
/**
|
|
56
|
+
* The distance between nested elements.
|
|
57
|
+
* @values none, xs, sm, md, lg, xl
|
|
58
|
+
*/
|
|
59
|
+
gap: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: UIService.get(defaultConfig, UGroup).default.gap,
|
|
62
|
+
},
|
|
63
|
+
|
|
53
64
|
/**
|
|
54
65
|
* Show line above the header.
|
|
55
66
|
*/
|
|
@@ -90,5 +101,6 @@ const {
|
|
|
90
101
|
titleAttrs,
|
|
91
102
|
upperlineAttrs,
|
|
92
103
|
underlineAttrs,
|
|
104
|
+
contentAttrs,
|
|
93
105
|
} = useAttrs(props);
|
|
94
106
|
</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.245",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -3645,6 +3645,15 @@
|
|
|
3645
3645
|
},
|
|
3646
3646
|
"default": "\"\""
|
|
3647
3647
|
},
|
|
3648
|
+
{
|
|
3649
|
+
"name": "gap",
|
|
3650
|
+
"description": "The distance between nested elements.",
|
|
3651
|
+
"value": {
|
|
3652
|
+
"kind": "expression",
|
|
3653
|
+
"type": "'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'"
|
|
3654
|
+
},
|
|
3655
|
+
"default": "md"
|
|
3656
|
+
},
|
|
3648
3657
|
{
|
|
3649
3658
|
"name": "upperlined",
|
|
3650
3659
|
"description": "Show line above the header.",
|
|
@@ -3652,7 +3661,7 @@
|
|
|
3652
3661
|
"kind": "expression",
|
|
3653
3662
|
"type": "boolean"
|
|
3654
3663
|
},
|
|
3655
|
-
"default": "
|
|
3664
|
+
"default": "false"
|
|
3656
3665
|
},
|
|
3657
3666
|
{
|
|
3658
3667
|
"name": "underlined",
|
|
@@ -3709,58 +3718,6 @@
|
|
|
3709
3718
|
"symbol": "default"
|
|
3710
3719
|
}
|
|
3711
3720
|
},
|
|
3712
|
-
{
|
|
3713
|
-
"name": "UGroups",
|
|
3714
|
-
"description": "",
|
|
3715
|
-
"attributes": [
|
|
3716
|
-
{
|
|
3717
|
-
"name": "gap",
|
|
3718
|
-
"description": "The distance between nested elements.",
|
|
3719
|
-
"value": {
|
|
3720
|
-
"kind": "expression",
|
|
3721
|
-
"type": "'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'"
|
|
3722
|
-
},
|
|
3723
|
-
"default": "md"
|
|
3724
|
-
},
|
|
3725
|
-
{
|
|
3726
|
-
"name": "align",
|
|
3727
|
-
"description": "Nested items align (flex align-items).",
|
|
3728
|
-
"value": {
|
|
3729
|
-
"kind": "expression",
|
|
3730
|
-
"type": "'start' | 'end' | 'center' | 'stretch' | 'baseline'"
|
|
3731
|
-
},
|
|
3732
|
-
"default": "start"
|
|
3733
|
-
},
|
|
3734
|
-
{
|
|
3735
|
-
"name": "config",
|
|
3736
|
-
"description": "Component ui config object.",
|
|
3737
|
-
"value": {
|
|
3738
|
-
"kind": "expression",
|
|
3739
|
-
"type": "object"
|
|
3740
|
-
},
|
|
3741
|
-
"default": "{}"
|
|
3742
|
-
},
|
|
3743
|
-
{
|
|
3744
|
-
"name": "dataCy",
|
|
3745
|
-
"description": "Data-cy attribute for automated testing.",
|
|
3746
|
-
"value": {
|
|
3747
|
-
"kind": "expression",
|
|
3748
|
-
"type": "string"
|
|
3749
|
-
},
|
|
3750
|
-
"default": "\"\""
|
|
3751
|
-
}
|
|
3752
|
-
],
|
|
3753
|
-
"slots": [
|
|
3754
|
-
{
|
|
3755
|
-
"name": "default",
|
|
3756
|
-
"description": "Use it to add something inside."
|
|
3757
|
-
}
|
|
3758
|
-
],
|
|
3759
|
-
"source": {
|
|
3760
|
-
"module": "./src/ui.container-groups/index.vue",
|
|
3761
|
-
"symbol": "default"
|
|
3762
|
-
}
|
|
3763
|
-
},
|
|
3764
3721
|
{
|
|
3765
3722
|
"name": "UHeader",
|
|
3766
3723
|
"description": "",
|
|
@@ -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,33 +0,0 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
2
|
-
|
|
3
|
-
import { cva } from "../../service.ui";
|
|
4
|
-
import useUI from "../../composable.ui";
|
|
5
|
-
import defaultConfig from "../configs/default.config";
|
|
6
|
-
|
|
7
|
-
export default function useAttrs(props) {
|
|
8
|
-
const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
|
|
9
|
-
const attrs = {};
|
|
10
|
-
|
|
11
|
-
for (const key in defaultConfig) {
|
|
12
|
-
if (isSystemKey(key)) continue;
|
|
13
|
-
|
|
14
|
-
const classes = computed(() => {
|
|
15
|
-
const value = config.value[key];
|
|
16
|
-
|
|
17
|
-
if (value.variants || value.compoundVariants) {
|
|
18
|
-
return cva(value)({
|
|
19
|
-
...props,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return "";
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return {
|
|
30
|
-
...attrs,
|
|
31
|
-
config,
|
|
32
|
-
};
|
|
33
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export default /*tw*/ {
|
|
2
|
-
wrapper: {
|
|
3
|
-
base: "flex flex-col",
|
|
4
|
-
variants: {
|
|
5
|
-
gap: {
|
|
6
|
-
none: "space-y-0",
|
|
7
|
-
xs: "space-y-10",
|
|
8
|
-
sm: "space-y-12",
|
|
9
|
-
md: "space-y-14",
|
|
10
|
-
lg: "space-y-16",
|
|
11
|
-
xl: "space-y-20",
|
|
12
|
-
},
|
|
13
|
-
align: {
|
|
14
|
-
end: "items-end",
|
|
15
|
-
start: "items-start",
|
|
16
|
-
center: "items-center",
|
|
17
|
-
stretch: "items-stretch",
|
|
18
|
-
baseline: "items-baseline",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
gap: "md",
|
|
24
|
-
align: "start",
|
|
25
|
-
},
|
|
26
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { getArgTypes, getSlotNames, getSlotsFragment } from "../service.storybook";
|
|
2
|
-
|
|
3
|
-
import UGroups from "../ui.container-groups";
|
|
4
|
-
import UGroup from "../ui.container-group";
|
|
5
|
-
import UCol from "../ui.container-col";
|
|
6
|
-
import UInput from "../ui.form-input";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The `UGroups` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.container-groups)
|
|
10
|
-
*/
|
|
11
|
-
export default {
|
|
12
|
-
id: "5040",
|
|
13
|
-
title: "Containers / Groups",
|
|
14
|
-
component: UGroups,
|
|
15
|
-
args: {},
|
|
16
|
-
argTypes: {
|
|
17
|
-
...getArgTypes(UGroups.name),
|
|
18
|
-
},
|
|
19
|
-
parameters: {
|
|
20
|
-
docs: {
|
|
21
|
-
story: {
|
|
22
|
-
iframeHeight: 760,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const defaultTemplate = `
|
|
29
|
-
<UGroup :upperlined="n !== 1" :title="'Group '+n" v-for="n in 3">
|
|
30
|
-
<UCol>
|
|
31
|
-
<UInput placeholder="input" label="Label" />
|
|
32
|
-
<UInput placeholder="input" label="Label" />
|
|
33
|
-
</UCol>
|
|
34
|
-
</UGroup>
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
|
-
const DefaultTemplate = (args) => ({
|
|
38
|
-
components: { UGroups, UGroup, UCol, UInput },
|
|
39
|
-
setup() {
|
|
40
|
-
const slots = getSlotNames(UGroups.name);
|
|
41
|
-
|
|
42
|
-
return { args, slots };
|
|
43
|
-
},
|
|
44
|
-
template: `
|
|
45
|
-
<UGroups v-bind="args">
|
|
46
|
-
${args.slotTemplate || getSlotsFragment(defaultTemplate)}
|
|
47
|
-
</UGroups>
|
|
48
|
-
`,
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export const Default = DefaultTemplate.bind({});
|
|
52
|
-
Default.args = {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div :data-cy="dataCy" v-bind="wrapperAttrs">
|
|
3
|
-
<!-- @slot Use it to add something inside. -->
|
|
4
|
-
<slot />
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<script setup>
|
|
9
|
-
import UIService from "../service.ui";
|
|
10
|
-
|
|
11
|
-
import { UGroups } from "./constants";
|
|
12
|
-
import defaultConfig from "./configs/default.config";
|
|
13
|
-
import useAttrs from "./composables/attrs.composable";
|
|
14
|
-
|
|
15
|
-
/* Should be a string for correct web-types gen */
|
|
16
|
-
defineOptions({ name: "UGroups", inheritAttrs: false });
|
|
17
|
-
|
|
18
|
-
const props = defineProps({
|
|
19
|
-
/**
|
|
20
|
-
* The distance between nested elements.
|
|
21
|
-
* @values none, xs, sm, md, lg, xl
|
|
22
|
-
*/
|
|
23
|
-
gap: {
|
|
24
|
-
type: String,
|
|
25
|
-
default: UIService.get(defaultConfig, UGroups).default.gap,
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Nested items align (flex align-items).
|
|
30
|
-
* @values start, end, center, stretch, baseline
|
|
31
|
-
*/
|
|
32
|
-
align: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: UIService.get(defaultConfig, UGroups).default.align,
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Component ui config object.
|
|
39
|
-
*/
|
|
40
|
-
config: {
|
|
41
|
-
type: Object,
|
|
42
|
-
default: () => ({}),
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Data-cy attribute for automated testing.
|
|
47
|
-
*/
|
|
48
|
-
dataCy: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: "",
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const { wrapperAttrs } = useAttrs(props);
|
|
55
|
-
</script>
|