vueless 0.0.225 → 0.0.226

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.225",
3
+ "version": "0.0.226",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -9,6 +9,9 @@ export default /*tw*/ {
9
9
  right: "flex-row w-fit",
10
10
  left: "flex-row-reverse w-fit",
11
11
  },
12
+ error: {
13
+ true: "text-red-500",
14
+ },
12
15
  },
13
16
  compoundVariants: [
14
17
  { align: "left", size: "sm", class: "gap-2" },
@@ -1,7 +1,8 @@
1
1
  import ULabel from "../ui.form-label";
2
2
  import URow from "../ui.container-row";
3
- import UButton from "../ui.button/index";
4
- import UBadge from "../ui.text-badge";
3
+ import UGroup from "../ui.container-group";
4
+ import UText from "../ui.text-block";
5
+ import UIcon from "../ui.image-icon";
5
6
 
6
7
  import { getArgTypes } from "../service.storybook";
7
8
 
@@ -21,30 +22,35 @@ export default {
21
22
  },
22
23
  };
23
24
 
25
+ const message = "This is plain text";
26
+
24
27
  const DefaultTemplate = (args) => ({
25
- components: { ULabel },
28
+ components: { ULabel, UText },
26
29
  setup() {
27
30
  return { args };
28
31
  },
29
32
  template: `
30
- <ULabel v-bind="args" />
33
+ <ULabel v-bind="args">
34
+ <UText v-bind="args">${message}</UText>
35
+ </ULabel>
31
36
  `,
32
37
  });
33
38
 
34
39
  const SlotTemplate = (args) => ({
35
- components: { ULabel, UBadge },
40
+ components: { ULabel, UText, UIcon },
36
41
  setup() {
37
42
  return { args };
38
43
  },
39
44
  template: `
40
45
  <ULabel v-bind="args">
46
+ <UText v-bind="args">${message}</UText>
41
47
  ${args.slotTemplate}
42
48
  </ULabel>
43
49
  `,
44
50
  });
45
51
 
46
52
  const SizesTemplate = (args, { argTypes } = {}) => ({
47
- components: { ULabel, URow },
53
+ components: { ULabel, URow, UText },
48
54
  setup() {
49
55
  return {
50
56
  args,
@@ -58,30 +64,33 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
58
64
  v-bind="args"
59
65
  :size="size"
60
66
  :key="index"
61
- />
67
+ >
68
+ <UText :size="size">This is <b>"{{ size }}"</b> size.</UText>
69
+ </ULabel>
62
70
  </URow>
63
71
  `,
64
72
  });
65
73
 
66
- const placementTemplate = (args, { argTypes } = {}) => ({
67
- components: { ULabel, URow, UButton },
74
+ const LabelPlacementTemplate = (args, { argTypes } = {}) => ({
75
+ components: { ULabel, UGroup, UText },
68
76
  setup() {
69
77
  return {
70
78
  args,
71
- placements: argTypes.placement.options,
79
+ placements: argTypes.align.options,
72
80
  };
73
81
  },
74
82
  template: `
75
- <URow>
83
+ <UGroup>
76
84
  <ULabel
77
- v-for="(placement, index) in placements"
85
+ v-for="(align, index) in placements"
78
86
  v-bind="args"
79
- :align="placement"
87
+ :align="align"
80
88
  :key="index"
89
+ class="border border-gray-200 rounded p-4"
81
90
  >
82
- <UButton text="Button"/>
91
+ <UText>This is <b>"{{ align }}"</b> label placement.</UText>
83
92
  </ULabel>
84
- </URow>
93
+ </UGroup>
85
94
  `,
86
95
  });
87
96
 
@@ -91,11 +100,11 @@ Default.args = {};
91
100
  export const Sizes = SizesTemplate.bind({});
92
101
  Sizes.args = {};
93
102
 
94
- export const Placement = placementTemplate.bind({});
95
- Placement.args = {};
103
+ export const LabelPlacement = LabelPlacementTemplate.bind({});
104
+ LabelPlacement.args = {};
96
105
 
97
106
  export const Error = DefaultTemplate.bind({});
98
- Error.args = { error: "some error" };
107
+ Error.args = { error: "Error description" };
99
108
 
100
109
  export const Disabled = DefaultTemplate.bind({});
101
110
  Disabled.args = { disabled: true };
@@ -104,7 +113,7 @@ export const slotFooter = SlotTemplate.bind({});
104
113
  slotFooter.args = {
105
114
  slotTemplate: `
106
115
  <template #footer>
107
- <UBadge label="favourite" color="green" size="sm" />
116
+ <UIcon name="star" color="green" />
108
117
  </template>
109
118
  `,
110
119
  };
@@ -5,6 +5,7 @@
5
5
  v-bind="wrapperAttrs"
6
6
  @click="onClick"
7
7
  >
8
+ <!-- @slot Use it to wrap something into the label. -->
8
9
  <slot />
9
10
 
10
11
  <div v-if="label || error || description" v-bind="labelWrapperAttrs">
@@ -25,7 +26,7 @@
25
26
  v-text="description"
26
27
  />
27
28
 
28
- <!-- @slot Use it to add something to the label's footer -->
29
+ <!-- @slot Use it to add something to the label's footer. -->
29
30
  <slot name="footer" />
30
31
  </div>
31
32
  </div>
@@ -40,6 +41,7 @@
40
41
  v-text="label"
41
42
  />
42
43
 
44
+ <!-- @slot Use it to wrap something into the label. -->
43
45
  <slot />
44
46
 
45
47
  <div v-if="error" :data-cy="`${dataCy}-error`" v-bind="descriptionAttrs" v-text="error" />
@@ -51,7 +53,7 @@
51
53
  v-text="description"
52
54
  />
53
55
 
54
- <!-- @slot Use it to add something to the label's footer -->
56
+ <!-- @slot Use it to add something to the label's footer. -->
55
57
  <slot name="footer" />
56
58
  </div>
57
59
  </template>
@@ -86,7 +88,7 @@ const props = defineProps({
86
88
 
87
89
  /**
88
90
  * Set label size.
89
- * @values xs, sm, md, lg, xl
91
+ * @values sm, md, lg
90
92
  */
91
93
  size: {
92
94
  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.225",
4
+ "version": "0.0.226",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -5049,7 +5049,7 @@
5049
5049
  "description": "Set label size.",
5050
5050
  "value": {
5051
5051
  "kind": "expression",
5052
- "type": "'xs' | 'sm' | 'md' | 'lg' | 'xl'"
5052
+ "type": "'sm' | 'md' | 'lg'"
5053
5053
  },
5054
5054
  "default": "md"
5055
5055
  },
@@ -5134,11 +5134,12 @@
5134
5134
  ],
5135
5135
  "slots": [
5136
5136
  {
5137
- "name": "default"
5137
+ "name": "default",
5138
+ "description": "Use it to wrap something into the label."
5138
5139
  },
5139
5140
  {
5140
5141
  "name": "footer",
5141
- "description": "Use it to add something to the label's footer"
5142
+ "description": "Use it to add something to the label's footer."
5142
5143
  }
5143
5144
  ],
5144
5145
  "source": {