vueless 0.0.113 → 0.0.114

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -65,7 +65,7 @@ const props = defineProps({
65
65
 
66
66
  /**
67
67
  * Button size.
68
- * @values sm, md, lg
68
+ * @values xs, sm, md, lg
69
69
  */
70
70
  size: {
71
71
  type: String,
@@ -13,7 +13,13 @@ export function useAttrs(props) {
13
13
  compoundVariants: wrapper.compoundVariants,
14
14
  });
15
15
 
16
- const wrapperClasses = computed(() => cvaWrapper({ noMobile: props.noMobile }));
16
+ const wrapperClasses = computed(() =>
17
+ cvaWrapper({
18
+ gap: props.gap,
19
+ align: props.align,
20
+ noMobile: props.noMobile,
21
+ }),
22
+ );
17
23
 
18
24
  const wrapperAttrs = getAttrs("wrapper", { classes: wrapperClasses });
19
25
 
@@ -1,14 +1,43 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
- base: "flex items-start w-full",
3
+ base: "flex flex-col md:flex-row w-full",
4
4
  variants: {
5
+ gap: {
6
+ none: "space-y-0 md:space-x-0",
7
+ "2xs": "space-y-1 md:space-x-1",
8
+ xs: "space-y-2 md:space-x-2",
9
+ sm: "space-y-3 md:space-x-3",
10
+ md: "space-y-4 md:space-x-4",
11
+ lg: "space-y-5 md:space-x-5",
12
+ xl: "space-y-6 md:space-x-6",
13
+ "2xl": "space-y-8 md:space-x-8",
14
+ },
15
+ align: {
16
+ end: "items-end",
17
+ start: "items-start",
18
+ center: "items-center",
19
+ stretch: "items-stretch",
20
+ baseline: "items-baseline",
21
+ },
5
22
  noMobile: {
6
- true: "flex-row space-x-4",
7
- false: "flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4",
23
+ true: "flex-row space-y-0",
24
+ false: "md:space-y-0",
8
25
  },
9
26
  },
27
+ compoundVariants: [
28
+ { gap: "none", noMobile: true, class: "space-x-0" },
29
+ { gap: "2xs", noMobile: true, class: "space-x-1" },
30
+ { gap: "xs", noMobile: true, class: "space-x-2" },
31
+ { gap: "sm", noMobile: true, class: "space-x-3" },
32
+ { gap: "md", noMobile: true, class: "space-x-4" },
33
+ { gap: "lg", noMobile: true, class: "space-x-5" },
34
+ { gap: "xl", noMobile: true, class: "space-x-6" },
35
+ { gap: "2xl", noMobile: true, class: "space-x-8" },
36
+ ],
10
37
  },
11
38
  defaultVariants: {
39
+ gap: "md",
40
+ align: "start",
12
41
  noMobile: false,
13
42
  },
14
43
  };
@@ -2,6 +2,8 @@ import { getArgTypes } from "../service.storybook";
2
2
 
3
3
  import URow from "../ui.container-row";
4
4
  import UInput from "../ui.form-input";
5
+ import UGroup from "../ui.container-group";
6
+ import UButton from "../ui.button";
5
7
 
6
8
  export default {
7
9
  id: "5020",
@@ -13,24 +15,67 @@ export default {
13
15
  };
14
16
 
15
17
  const DefaultTemplate = (args) => ({
16
- components: { URow, UInput },
18
+ components: { URow, UInput, UButton },
17
19
  setup() {
18
20
  return { args };
19
21
  },
20
22
  template: `
21
23
  <URow v-bind="args">
22
- ${args.slotTemplate}
24
+ ${
25
+ args.slotTemplate ||
26
+ `
27
+ <UInput label="Name" />
28
+ <UButton label="Submit" size="xs" block />
29
+ `
30
+ }
23
31
  </URow>
24
32
  `,
25
33
  });
26
34
 
27
- export const Default = DefaultTemplate.bind({});
28
- Default.args = {
29
- slotTemplate: `
30
- <UInput label="Name" />
31
- <UInput label="Lastname" />
35
+ const GapTemplate = (args, { argTypes } = {}) => ({
36
+ components: { UGroup, URow, UInput },
37
+ setup() {
38
+ return {
39
+ args,
40
+ gaps: argTypes.gap.options,
41
+ };
42
+ },
43
+ template: `
44
+ <UGroup size="lg">
45
+ <URow v-for="(gap, index) in gaps" :key="index" v-bind="args" :gap="gap" align="center">
46
+ <UInput :label="gap" />
47
+ <UInput :label="gap" />
48
+ </URow>
49
+ </UGroup>
32
50
  `,
33
- };
51
+ });
52
+
53
+ const AlignTemplate = (args, { argTypes } = {}) => ({
54
+ components: { UGroup, URow, UInput, UButton },
55
+ setup() {
56
+ return {
57
+ args,
58
+ aligns: argTypes.align.options,
59
+ };
60
+ },
61
+ template: `
62
+ <UGroup size="lg">
63
+ <URow v-for="(align, index) in aligns" :key="index" v-bind="args" :align="align">
64
+ <UButton :label="align" size="xs" block />
65
+ <UInput label="Name" />
66
+ </URow>
67
+ </UGroup>
68
+ `,
69
+ });
70
+
71
+ export const Default = DefaultTemplate.bind({});
72
+ Default.args = {};
73
+
74
+ export const Gap = GapTemplate.bind({});
75
+ Gap.args = {};
76
+
77
+ export const Align = AlignTemplate.bind({});
78
+ Align.args = {};
34
79
 
35
80
  export const noMobile = DefaultTemplate.bind({});
36
81
  noMobile.args = {
@@ -53,8 +98,8 @@ nestedRows.args = {
53
98
  `,
54
99
  };
55
100
 
56
- export const textBlocks = DefaultTemplate.bind({});
57
- textBlocks.args = {
101
+ export const textBlocksExample = DefaultTemplate.bind({});
102
+ textBlocksExample.args = {
58
103
  slotTemplate: `
59
104
  <p>
60
105
  Lorem ipsum dolor sit amet, consectetur adipiscing elit,
@@ -16,6 +16,24 @@ import { useAttrs } from "./composables/attrs.composable";
16
16
  defineOptions({ name: "URow", inheritAttrs: false });
17
17
 
18
18
  const props = defineProps({
19
+ /**
20
+ * Row spacing between nested elements.
21
+ * @values none, 2xs, xs, sm, md, lg, xl, 2xl
22
+ */
23
+ gap: {
24
+ type: String,
25
+ default: UIService.get(defaultConfig, URow).default.gap,
26
+ },
27
+
28
+ /**
29
+ * Row nested elements vertical align (align-items).
30
+ * @values start, end, center, stretch, baseline
31
+ */
32
+ align: {
33
+ type: String,
34
+ default: UIService.get(defaultConfig, URow).default.align,
35
+ },
36
+
19
37
  /**
20
38
  * Disables mobile adaptivity.
21
39
  */
@@ -3,7 +3,7 @@ import { getArgTypes, getSlotNames } from "../service.storybook";
3
3
  import UCalendar from "../ui.form-calendar";
4
4
 
5
5
  export default {
6
- id: "3171",
6
+ id: "3165",
7
7
  title: "Form Inputs & Controls / Calendar",
8
8
  component: UCalendar,
9
9
  args: {
@@ -1,15 +1,17 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
- base: "rounded-full bg-{color}-500 mr-1",
3
+ base: "rounded-full bg-{color}-500",
4
4
  variants: {
5
5
  color: {
6
6
  white: "bg-white",
7
7
  grayscale: "bg-gray-900",
8
8
  },
9
9
  size: {
10
+ xs: "size-0.5",
10
11
  sm: "size-1",
11
12
  md: "size-1.5",
12
13
  lg: "size-2",
14
+ xl: "size-2.5",
13
15
  },
14
16
  },
15
17
  },
@@ -1,5 +1,7 @@
1
1
  import UDot from "../ui.other-dot";
2
2
  import URow from "../ui.container-row";
3
+ import UGroup from "../ui.container-group";
4
+ import UBadge from "../ui.text-badge";
3
5
 
4
6
  import { getArgTypes } from "../service.storybook";
5
7
 
@@ -23,7 +25,7 @@ const DefaultTemplate = (args) => ({
23
25
  });
24
26
 
25
27
  const ColorsTemplate = (args, { argTypes } = {}) => ({
26
- components: { UDot, URow },
28
+ components: { UGroup, URow, UDot, UBadge },
27
29
  setup() {
28
30
  return {
29
31
  args,
@@ -31,19 +33,17 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
31
33
  };
32
34
  },
33
35
  template: `
34
- <URow>
35
- <UDot
36
- v-for="(color, index) in colors"
37
- v-bind="args"
38
- :color="color"
39
- :key="index"
40
- />
41
- </URow>
36
+ <UGroup>
37
+ <URow v-for="(color, index) in colors" :key="index" gap="none" align="center">
38
+ <UDot v-bind="args" :color="color"/>
39
+ <UBadge :label="color" :color="color" variant="thirdary" />
40
+ </URow>
41
+ </UGroup>
42
42
  `,
43
43
  });
44
44
 
45
45
  const SizesTemplate = (args, { argTypes } = {}) => ({
46
- components: { UDot, URow },
46
+ components: { UGroup, URow, UDot, UBadge },
47
47
  setup() {
48
48
  return {
49
49
  args,
@@ -51,20 +51,13 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
51
51
  };
52
52
  },
53
53
  template: `
54
- <URow>
55
- <UDot
56
- v-for="(size, index) in sizes"
57
- v-bind="args"
58
- :size="size"
59
- :key="index"
60
- />
61
- </URow>
54
+ <UGroup>
55
+ <URow v-for="(size, index) in sizes" :key="index" gap="none" align="center">
56
+ <UDot v-bind="args" :size="size"/>
57
+ <UBadge :label="size" variant="thirdary" />
58
+ </URow>
59
+ </UGroup>
62
60
  `,
63
- methods: {
64
- getText(value) {
65
- return `Tag ${value}`;
66
- },
67
- },
68
61
  });
69
62
 
70
63
  export const Default = DefaultTemplate.bind({});
@@ -24,7 +24,7 @@ const props = defineProps({
24
24
 
25
25
  /**
26
26
  * Dot size.
27
- * @values sm, md, lg
27
+ * @values xs, sm, md, lg, xl
28
28
  */
29
29
  size: {
30
30
  type: String,
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.113",
4
+ "version": "0.0.114",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -559,7 +559,7 @@
559
559
  "description": "Button size.",
560
560
  "value": {
561
561
  "kind": "expression",
562
- "type": "'sm' | 'md' | 'lg'"
562
+ "type": "'xs' | 'sm' | 'md' | 'lg'"
563
563
  },
564
564
  "default": "md"
565
565
  },
@@ -1962,7 +1962,7 @@
1962
1962
  "description": "Dot size.",
1963
1963
  "value": {
1964
1964
  "kind": "expression",
1965
- "type": "'sm' | 'md' | 'lg'"
1965
+ "type": "'xs' | 'sm' | 'md' | 'lg' | 'xl'"
1966
1966
  },
1967
1967
  "default": "md"
1968
1968
  },
@@ -5807,6 +5807,24 @@
5807
5807
  "name": "URow",
5808
5808
  "description": "",
5809
5809
  "attributes": [
5810
+ {
5811
+ "name": "gap",
5812
+ "description": "Row spacing between nested elements.",
5813
+ "value": {
5814
+ "kind": "expression",
5815
+ "type": "'none' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'"
5816
+ },
5817
+ "default": "md"
5818
+ },
5819
+ {
5820
+ "name": "align",
5821
+ "description": "Row nested elements vertical align (align-items).",
5822
+ "value": {
5823
+ "kind": "expression",
5824
+ "type": "'start' | 'end' | 'center' | 'stretch' | 'baseline'"
5825
+ },
5826
+ "default": "start"
5827
+ },
5810
5828
  {
5811
5829
  "name": "noMobile",
5812
5830
  "description": "Disables mobile adaptivity.",