vueless 0.0.208 → 0.0.210

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.208",
3
+ "version": "0.0.210",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -4,6 +4,7 @@ import URadioGroup from "../ui.form-radio-group";
4
4
  import URadio from "../ui.form-radio";
5
5
  import UAlert from "../ui.text-alert";
6
6
  import URow from "../ui.container-row";
7
+ import UGroup from "../ui.container-group";
7
8
 
8
9
  /**
9
10
  * The `URadioGroup` component. | [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/ui.form-radio-group)
@@ -12,13 +13,6 @@ export default {
12
13
  id: "3160",
13
14
  title: "Form Inputs & Controls / Radio Group",
14
15
  component: URadioGroup,
15
- parameters: {
16
- docs: {
17
- description: {
18
- story: "Another description on the story, overriding the comments",
19
- },
20
- },
21
- },
22
16
  args: {
23
17
  label: "Label",
24
18
  value: "One",
@@ -34,7 +28,7 @@ export default {
34
28
  };
35
29
 
36
30
  const DefaultTemplate = (args) => ({
37
- components: { URadioGroup, URadio, UAlert, URow },
31
+ components: { URadioGroup, URadio, UAlert, URow, UGroup },
38
32
  setup() {
39
33
  return { args };
40
34
  },
@@ -44,7 +38,7 @@ const DefaultTemplate = (args) => ({
44
38
  };
45
39
  },
46
40
  template: `
47
- <URow class="!flex-col">
41
+ <UGroup>
48
42
  <URadioGroup v-bind="args" v-model="value">
49
43
  <template v-for="(radio,index) in args.radios" :key="index">
50
44
  <URadio
@@ -55,14 +49,11 @@ const DefaultTemplate = (args) => ({
55
49
  </URadioGroup>
56
50
 
57
51
  <URow>
58
- <UAlert color="red" v-if=args.isDefaultStory>
59
- <b>NOTE:</b> <p>URadioGroup component have to have unique name attribute</p>
60
- </UAlert>
61
- <UAlert color="blue">
62
- <p>Selected value: {{ value }}</p>
52
+ <UAlert color="green" size="sm">
53
+ <p>Selected value: <b>{{ value }}</b></p>
63
54
  </UAlert>
64
55
  </URow>
65
- </URow>
56
+ </UGroup>
66
57
  `,
67
58
  });
68
59
 
@@ -79,7 +70,7 @@ const OptionsTemplate = (args) => ({
79
70
  template: `
80
71
  <URow class="!flex-col">
81
72
  <URadioGroup v-bind="args" v-model="value" :options="args.radios" />
82
-
73
+
83
74
  <URow>
84
75
  <UAlert color="blue">
85
76
  <p>Selected value: {{ value }}</p>
@@ -102,15 +93,15 @@ const ColorsTemplate = (args, { argTypes } = {}) => ({
102
93
  },
103
94
  template: `
104
95
  <URow class="!flex-col">
105
- <URadioGroup
96
+ <URadioGroup
106
97
  v-bind="args"
107
- v-for="color in colors"
108
- :key="color"
109
- :label="color"
98
+ v-for="color in colors"
99
+ :key="color"
100
+ :label="color"
110
101
  :color="color"
111
- :options="args.radios"
102
+ :options="args.radios"
112
103
  name="color"
113
- v-model="value"
104
+ v-model="value"
114
105
  />
115
106
  </URow>
116
107
  `,
@@ -129,15 +120,15 @@ const SizesTemplate = (args, { argTypes } = {}) => ({
129
120
  },
130
121
  template: `
131
122
  <URow class="!flex-col">
132
- <URadioGroup
123
+ <URadioGroup
133
124
  v-bind="args"
134
- v-for="size in sizes"
135
- :key="size"
136
- :label="size"
125
+ v-for="size in sizes"
126
+ :key="size"
127
+ :label="size"
137
128
  :size="size"
138
- :options="args.radios"
129
+ :options="args.radios"
139
130
  name="size"
140
- v-model="value"
131
+ v-model="value"
141
132
  />
142
133
  </URow>
143
134
  `,
@@ -101,11 +101,11 @@ const props = defineProps({
101
101
  },
102
102
 
103
103
  /**
104
- * Radio group name (sets for each radio).
104
+ * Unique radio group name (sets for each radio).
105
105
  */
106
106
  name: {
107
107
  type: String,
108
- default: "",
108
+ required: true,
109
109
  },
110
110
 
111
111
  /**
@@ -59,39 +59,39 @@ export default function useAttrs(props, { isTop, isOpen, selectedLabel: selected
59
59
  }));
60
60
  }
61
61
 
62
- if (key === "caretToggle") {
63
- const caretToggleAttrs = attrs[`${key}Attrs`];
62
+ if (key === "toggle") {
63
+ const toggleAttrs = attrs[`${key}Attrs`];
64
64
 
65
65
  attrs[`${key}Attrs`] = computed(() => ({
66
- ...caretToggleAttrs.value,
67
- class: cx([caretToggleAttrs.value.class, caretClasses.value]),
66
+ ...toggleAttrs.value,
67
+ class: cx([toggleAttrs.value.class, caretClasses.value]),
68
68
  }));
69
69
  }
70
70
 
71
- if (key === "caretClear") {
72
- const caretClearAttrs = attrs[`${key}Attrs`];
71
+ if (key === "clear") {
72
+ const clearAttrs = attrs[`${key}Attrs`];
73
73
 
74
74
  attrs[`${key}Attrs`] = computed(() => ({
75
- ...caretClearAttrs.value,
76
- class: cx([caretClearAttrs.value.class, caretClasses.value]),
75
+ ...clearAttrs.value,
76
+ class: cx([clearAttrs.value.class, caretClasses.value]),
77
77
  }));
78
78
  }
79
79
 
80
- if (key === "beforeCaretSlot") {
81
- const beforeCaretSlotAttrs = attrs[`${key}Attrs`];
80
+ if (key === "beforeCaret") {
81
+ const beforeCaretAttrs = attrs[`${key}Attrs`];
82
82
 
83
83
  attrs[`${key}Attrs`] = computed(() => ({
84
- ...beforeCaretSlotAttrs.value,
85
- class: cx([beforeCaretSlotAttrs.value.class, caretClasses.value]),
84
+ ...beforeCaretAttrs.value,
85
+ class: cx([beforeCaretAttrs.value.class, caretClasses.value]),
86
86
  }));
87
87
  }
88
88
 
89
- if (key === "afterCaretSlot") {
90
- const afterCaretSlotAttrs = attrs[`${key}Attrs`];
89
+ if (key === "afterCaret") {
90
+ const afterCaretAttrs = attrs[`${key}Attrs`];
91
91
 
92
92
  attrs[`${key}Attrs`] = computed(() => ({
93
- ...afterCaretSlotAttrs.value,
94
- class: cx([afterCaretSlotAttrs.value.class, caretClasses.value]),
93
+ ...afterCaretAttrs.value,
94
+ class: cx([afterCaretAttrs.value.class, caretClasses.value]),
95
95
  }));
96
96
  }
97
97
 
@@ -1,5 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  label: "{ULabel} w-full relative",
3
+ labelWrapperTop: "group/top", // applies when an open direction is top
4
+ labelWrapperActive: "group/active",
3
5
  wrapper: {
4
6
  base: `
5
7
  pb-2 pt-2 flex flex-row-reverse justify-between w-full min-h-full box-border relative
@@ -32,6 +34,7 @@ export default /*tw*/ {
32
34
  { labelAlign: "topInside", label: true, size: "lg", class: "pt-7" },
33
35
  ],
34
36
  },
37
+ wrapperActive: "z-[inherit]", // applies when select active
35
38
  innerWrapper: {
36
39
  base: "flex px-4 min-h-full w-full overflow-hidden justify-between",
37
40
  variants: {
@@ -40,11 +43,35 @@ export default /*tw*/ {
40
43
  },
41
44
  },
42
45
  },
43
- wrapperActive: "z-[inherit]", // applies when select active
44
- labelWrapperTop: "group/top", // applies when an open direction is top
45
- labelWrapperActive: "group/active",
46
- leftIconSlot: "pr-3 flex items-center",
47
- rightIconSlot: "pl-3 flex items-center",
46
+ selectedLabels: "flex flex-col col-span-2",
47
+ selectedLabel: {
48
+ base: `
49
+ font-normal leading-none text-gray-900 relative truncate
50
+ inline-flex items-center whitespace-nowrap mb-0 w-full
51
+ `,
52
+ variants: {
53
+ size: {
54
+ sm: "text-sm min-h-4",
55
+ md: "text-base min-h-5",
56
+ lg: "text-lg min-h-6",
57
+ },
58
+ disabled: {
59
+ true: "bg-gray-100",
60
+ },
61
+ multiple: {
62
+ true: "py-2 last:mb-2.5 flex justify-between border-b border-gray-100",
63
+ },
64
+ },
65
+ compoundVariants: [
66
+ { size: "sm", multiple: true, class: "text-sm" },
67
+ { size: "md", multiple: true, class: "text-base" },
68
+ { size: "lg", multiple: true, class: "text-lg" },
69
+ ],
70
+ },
71
+ leftIcon: "pr-3 flex items-center",
72
+ rightIcon: "pl-3 flex items-center",
73
+ beforeCaret: "",
74
+ afterCaret: "mr-3",
48
75
  caret: {
49
76
  base: "flex items-center mt-0",
50
77
  compoundVariants: [
@@ -53,19 +80,17 @@ export default /*tw*/ {
53
80
  { labelAlign: "topInside", size: "lg", label: true, class: "-mt-4" },
54
81
  ],
55
82
  },
56
- beforeCaretSlot: "",
57
- afterCaretSlot: "mr-3",
58
- caretToggle: "mr-3",
83
+ toggle: "mr-3",
59
84
  toggleIcon: "{UIcon} transform transition duration-300 group-[]/active:rotate-180",
60
85
  toggleIconName: "expand_more",
86
+ clear: "",
61
87
  clearIcon: "{UIcon}",
62
88
  clearIconName: "close_small",
63
- removeItemIcon: "{UIcon}",
64
- removeItemIconName: "close_small",
65
- caretRemoveItem: "flex items-center",
66
- caretClear: "",
67
- caretClearText: {
68
- // TODO: caretClearMultiple is better
89
+ clearMultiple: "flex items-center",
90
+ clearMultipleIcon: "{UIcon}",
91
+ clearMultipleIconName: "close_small",
92
+ clearMultipleTextAll: {
93
+ // TODO: clearMultiple is better
69
94
  base: "cursor-pointer flex items-center text-sm font-normal text-gray-400 hover:text-gray-500 transition",
70
95
  compoundVariants: [
71
96
  { size: "sm", class: "text-sm" },
@@ -88,31 +113,6 @@ export default /*tw*/ {
88
113
  },
89
114
  },
90
115
  },
91
- selectedLabels: "flex flex-col col-span-2",
92
- selectedLabel: {
93
- base: `
94
- font-normal leading-none text-gray-900 relative truncate
95
- inline-flex items-center whitespace-nowrap mb-0 w-full
96
- `,
97
- variants: {
98
- size: {
99
- sm: "text-sm min-h-4",
100
- md: "text-base min-h-5",
101
- lg: "text-lg min-h-6",
102
- },
103
- disabled: {
104
- true: "bg-gray-100",
105
- },
106
- multiple: {
107
- true: "py-2 last:mb-2.5 flex justify-between border-b border-gray-100",
108
- },
109
- },
110
- compoundVariants: [
111
- { size: "sm", multiple: true, class: "text-sm" },
112
- { size: "md", multiple: true, class: "text-base" },
113
- { size: "lg", multiple: true, class: "text-lg" },
114
- ],
115
- },
116
116
  dropdownList: "{UDropdownList} group-[]/top:bottom-full group-[]/top:top-auto top-full",
117
117
  i18n: {
118
118
  listIsEmpty: "List is empty.",
@@ -26,7 +26,7 @@
26
26
  >
27
27
  <div
28
28
  v-if="hasSlotContent($slots['after-caret']) && !(multiple && localValue.length)"
29
- v-bind="afterCaretSlotAttrs"
29
+ v-bind="afterCaretAttrs"
30
30
  >
31
31
  <!--
32
32
  @slot Use it to add something after caret.
@@ -37,7 +37,7 @@
37
37
 
38
38
  <div
39
39
  v-show="!multiple || (!isLocalValue && multiple)"
40
- v-bind="caretToggleAttrs"
40
+ v-bind="toggleAttrs"
41
41
  @mousedown.prevent.stop="toggle"
42
42
  >
43
43
  <UIcon
@@ -52,7 +52,7 @@
52
52
 
53
53
  <div
54
54
  v-if="hasSlotContent($slots['before-caret']) && !(multiple && localValue.length)"
55
- v-bind="beforeCaretSlotAttrs"
55
+ v-bind="beforeCaretAttrs"
56
56
  >
57
57
  <!--
58
58
  @slot Use it to add something before caret.
@@ -61,7 +61,7 @@
61
61
  <slot :scope-props="props" name="before-caret" />
62
62
  </div>
63
63
 
64
- <div v-if="isLocalValue && !noClear && !disabled && !multiple" v-bind="caretClearAttrs">
64
+ <div v-if="isLocalValue && !noClear && !disabled && !multiple" v-bind="clearAttrs">
65
65
  <UIcon
66
66
  internal
67
67
  interactive
@@ -77,7 +77,7 @@
77
77
  <span
78
78
  v-if="hasSlotContent($slots['icon-left']) || iconLeft"
79
79
  ref="leftSlotWrapperRef"
80
- v-bind="leftIconSlotAttrs"
80
+ v-bind="leftIconAttrs"
81
81
  >
82
82
  <!--
83
83
  @slot Use it to add icon before option.
@@ -117,7 +117,7 @@
117
117
 
118
118
  <div
119
119
  v-if="!disabled"
120
- v-bind="caretRemoveItemAttrs"
120
+ v-bind="clearMultipleAttrs"
121
121
  @mousedown.prevent.capture
122
122
  @click.prevent.capture
123
123
  >
@@ -126,8 +126,8 @@
126
126
  interactive
127
127
  color="gray"
128
128
  :size="iconSize"
129
- :name="config.removeItemIconName"
130
- v-bind="removeItemIconAttrs"
129
+ :name="config.clearMultipleIconName"
130
+ v-bind="clearMultipleIconAttrs"
131
131
  @mousedown="removeElement(item)"
132
132
  />
133
133
  </div>
@@ -180,7 +180,7 @@
180
180
 
181
181
  <div
182
182
  v-if="isLocalValue && !noClear && !disabled && multiple"
183
- v-bind="caretClearTextAttrs"
183
+ v-bind="clearMultipleTextAllAttrs"
184
184
  @mousedown.prevent.capture="removeElement(localValue)"
185
185
  @click.prevent.capture
186
186
  v-text="currentLocale.clear"
@@ -189,7 +189,7 @@
189
189
  <!-- @slot Use it to add something after input. -->
190
190
  <slot name="right" />
191
191
 
192
- <span v-if="hasSlotContent($slots['icon-right']) || iconRight" v-bind="rightIconSlotAttrs">
192
+ <span v-if="hasSlotContent($slots['icon-right']) || iconRight" v-bind="rightIconAttrs">
193
193
  <!--
194
194
  @slot Use it to add icon after option.
195
195
  @binding {string} icon-name
@@ -564,14 +564,14 @@ const {
564
564
  labelAttrs,
565
565
  wrapperAttrs,
566
566
  innerWrapperAttrs,
567
- leftIconSlotAttrs,
568
- rightIconSlotAttrs,
569
- beforeCaretSlotAttrs,
570
- afterCaretSlotAttrs,
571
- caretToggleAttrs,
572
- caretClearAttrs,
573
- caretClearTextAttrs,
574
- caretRemoveItemAttrs,
567
+ leftIconAttrs,
568
+ rightIconAttrs,
569
+ beforeCaretAttrs,
570
+ afterCaretAttrs,
571
+ toggleAttrs,
572
+ clearAttrs,
573
+ clearMultipleTextAllAttrs,
574
+ clearMultipleAttrs,
575
575
  searchAttrs,
576
576
  searchInputAttrs,
577
577
  selectedLabelsAttrs,
@@ -579,7 +579,7 @@ const {
579
579
  dropdownListAttrs,
580
580
  toggleIconAttrs,
581
581
  clearIconAttrs,
582
- removeItemIconAttrs,
582
+ clearMultipleIconAttrs,
583
583
  } = useAttrs(props, { isTop, isOpen, selectedLabel });
584
584
 
585
585
  const i18nGlobal = tm(USelect);
@@ -4,49 +4,46 @@ import { cva, cx } from "../../service.ui";
4
4
  import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
- export function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
9
- const { loader, ellipse } = config.value;
10
-
11
- const cvaLoader = cva({
12
- base: loader.base,
13
- variants: loader.variants,
14
- compoundVariants: loader.compoundVariants,
15
- });
16
-
17
- const cvaEllipse = cva({
18
- base: ellipse.base,
19
- variants: ellipse.variants,
20
- compoundVariants: ellipse.compoundVariants,
21
- });
22
-
23
- const loaderClasses = computed(() =>
24
- cvaLoader({
25
- size: props.size,
26
- }),
7
+ export default function useAttrs(props) {
8
+ const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
27
11
  );
12
+ const attrs = {};
28
13
 
29
- const ellipseClasses = computed(() =>
30
- setColor(
31
- cvaEllipse({
32
- size: props.size,
33
- color: getColor(props.color),
34
- }),
35
- props.color,
36
- ),
37
- );
14
+ for (const key in defaultConfig) {
15
+ if (isSystemKey(key)) continue;
16
+
17
+ const classes = computed(() => {
18
+ const value = config.value[key];
19
+
20
+ if (value.variants || value.compoundVariants) {
21
+ return setColor(
22
+ cva(value)({
23
+ ...props,
24
+ color: getColor(props.color),
25
+ }),
26
+ props.color,
27
+ );
28
+ }
29
+
30
+ return "";
31
+ });
32
+
33
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
38
34
 
39
- const loaderAttrs = getAttrs("loader", { classes: loaderClasses });
40
- const ellipseRaw = getAttrs("ellipse", { classes: ellipseClasses });
35
+ if (key === "ellipse") {
36
+ const ellipseAttrs = attrs[`${key}Attrs`];
41
37
 
42
- const ellipseAttrs = computed(() => (classes) => ({
43
- ...ellipseRaw.value,
44
- class: cx([ellipseRaw.value.class, classes]),
45
- }));
38
+ attrs[`${key}Attrs`] = computed(() => (classes) => ({
39
+ ...ellipseAttrs,
40
+ class: cx([ellipseAttrs.value.class, classes]),
41
+ }));
42
+ }
43
+ }
46
44
 
47
45
  return {
48
- loaderAttrs,
49
- ellipseAttrs,
46
+ ...attrs,
50
47
  config,
51
48
  };
52
49
  }
@@ -16,7 +16,7 @@ import UIService from "../service.ui";
16
16
 
17
17
  import { ULoader } from "./constants";
18
18
  import defaultConfig from "./configs/default.config";
19
- import { useAttrs } from "./composables/attrs.composable";
19
+ import useAttrs from "./composables/attrs.composable";
20
20
 
21
21
  /* Should be a string for correct web-types gen */
22
22
  defineOptions({ name: "ULoader", inheritAttrs: false });
@@ -4,29 +4,37 @@ import { cva } from "../../service.ui";
4
4
 
5
5
  import defaultConfig from "../configs/default.config";
6
6
 
7
- export function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
9
- const { wrapper } = config.value;
10
-
11
- const cvaWrapper = cva({
12
- base: wrapper.base,
13
- variants: wrapper.variants,
14
- compoundVariants: wrapper.compoundVariants,
15
- });
16
-
17
- const wrapperClasses = computed(() =>
18
- setColor(
19
- cvaWrapper({
20
- color: getColor(props.color),
21
- }),
22
- props.color,
23
- ),
7
+ export default function useAttrs(props) {
8
+ const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
24
11
  );
12
+ const attrs = {};
25
13
 
26
- const wrapperAttrs = getAttrs("wrapper", { classes: wrapperClasses, isComponent: true });
14
+ for (const key in defaultConfig) {
15
+ if (isSystemKey(key)) continue;
16
+
17
+ const classes = computed(() => {
18
+ const value = config.value[key];
19
+
20
+ if (value.variants || value.compoundVariants) {
21
+ return setColor(
22
+ cva(value)({
23
+ ...props,
24
+ color: getColor(props.color),
25
+ }),
26
+ props.color,
27
+ );
28
+ }
29
+
30
+ return "";
31
+ });
32
+
33
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
34
+ }
27
35
 
28
36
  return {
29
- wrapperAttrs,
37
+ ...attrs,
30
38
  config,
31
39
  };
32
40
  }
@@ -14,6 +14,7 @@ export default /*tw*/ {
14
14
  },
15
15
  },
16
16
  },
17
+ loader: "{ULoader}",
17
18
  transition: {
18
19
  enterFromClass: "scale-110 transform",
19
20
  leaveActiveClass: "scale-110 transform",
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <Transition v-bind="config.transition">
3
3
  <div v-if="showLoader" v-bind="wrapperAttrs">
4
- <ULoader :loading="showLoader" size="lg" :color="color === 'white' ? 'grayscale' : 'white'" />
4
+ <ULoader
5
+ :loading="showLoader"
6
+ size="lg"
7
+ :color="color === 'white' ? 'grayscale' : 'white'"
8
+ v-bind="loaderAttrs"
9
+ />
5
10
  </div>
6
11
  </Transition>
7
12
  </template>
@@ -14,7 +19,7 @@ import ULoader from "../ui.loader";
14
19
 
15
20
  import { ULoaderRendering } from "./constants";
16
21
  import defaultConfig from "./configs/default.config";
17
- import { useAttrs } from "./composables/attrs.composable";
22
+ import useAttrs from "./composables/attrs.composable";
18
23
  import { useLoaderRendering } from "./composables/useLoaderRendering";
19
24
 
20
25
  /* Should be a string for correct web-types gen */
@@ -39,7 +44,7 @@ const props = defineProps({
39
44
  },
40
45
  });
41
46
 
42
- const { wrapperAttrs, config } = useAttrs(props);
47
+ const { wrapperAttrs, loaderAttrs, config } = useAttrs(props);
43
48
  const { isLoading, loaderRenderingOn, loaderRenderingOff } = useLoaderRendering();
44
49
 
45
50
  onMounted(() => {
@@ -4,28 +4,37 @@ import { cva } from "../../service.ui";
4
4
  import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
- export function useAttrs(props) {
8
- const { config, getAttrs, getColor, 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
- color: getColor(props.color),
21
- }),
22
- props.color,
23
- ),
7
+ export default function useAttrs(props) {
8
+ const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
24
11
  );
12
+ const attrs = {};
25
13
 
26
- const progressAttrs = getAttrs("progress", { classes: progressClasses.value });
14
+ for (const key in defaultConfig) {
15
+ if (isSystemKey(key)) continue;
16
+
17
+ const classes = computed(() => {
18
+ const value = config.value[key];
19
+
20
+ if (value.variants || value.compoundVariants) {
21
+ return setColor(
22
+ cva(value)({
23
+ ...props,
24
+ color: getColor(props.color),
25
+ }),
26
+ props.color,
27
+ );
28
+ }
29
+
30
+ return "";
31
+ });
32
+
33
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
34
+ }
27
35
 
28
36
  return {
29
- progressAttrs,
37
+ ...attrs,
38
+ config,
30
39
  };
31
40
  }
@@ -13,7 +13,7 @@ import { useLoaderTop } from "./composables/useLoaderTop";
13
13
 
14
14
  import { ULoaderTop, MAXIMUM, SPEED } from "./constants";
15
15
  import defaultConfig from "./configs/default.config";
16
- import { useAttrs } from "./composables/attrs.composable";
16
+ import useAttrs from "./composables/attrs.composable";
17
17
 
18
18
  /* Should be a string for correct web-types gen */
19
19
  defineOptions({ name: "ULoaderTop", inheritAttrs: false });
@@ -4,29 +4,37 @@ import { cva } from "../../service.ui";
4
4
  import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
- export function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor } = useUI(defaultConfig, () => props.config);
9
- const { wrapper } = config.value;
10
-
11
- const cvaWrapper = cva({
12
- base: wrapper.base,
13
- variants: wrapper.variants,
14
- compoundVariants: wrapper.compoundVariants,
15
- });
16
-
17
- const wrapperClasses = computed(() =>
18
- setColor(
19
- cvaWrapper({
20
- size: props.size,
21
- color: getColor(props.color),
22
- }),
23
- props.color,
24
- ),
7
+ export default function useAttrs(props) {
8
+ const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
25
11
  );
12
+ const attrs = {};
26
13
 
27
- const wrapperAttrs = getAttrs("wrapper", { classes: wrapperClasses });
14
+ for (const key in defaultConfig) {
15
+ if (isSystemKey(key)) continue;
16
+
17
+ const classes = computed(() => {
18
+ const value = config.value[key];
19
+
20
+ if (value.variants || value.compoundVariants) {
21
+ return setColor(
22
+ cva(value)({
23
+ ...props,
24
+ color: getColor(props.color),
25
+ }),
26
+ props.color,
27
+ );
28
+ }
29
+
30
+ return "";
31
+ });
32
+
33
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
34
+ }
28
35
 
29
36
  return {
30
- wrapperAttrs,
37
+ ...attrs,
38
+ config,
31
39
  };
32
40
  }
@@ -7,7 +7,7 @@ import UIService from "../service.ui";
7
7
 
8
8
  import { UDot } from "./constants";
9
9
  import defaultConfig from "./configs/default.config";
10
- import { useAttrs } from "./composables/attrs.composable";
10
+ import useAttrs from "./composables/attrs.composable";
11
11
 
12
12
  /* Should be a string for correct web-types gen */
13
13
  defineOptions({ name: "UDot", inheritAttrs: false });
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.208",
4
+ "version": "0.0.210",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -6332,12 +6332,12 @@
6332
6332
  },
6333
6333
  {
6334
6334
  "name": "name",
6335
- "description": "Radio group name (sets for each radio).",
6335
+ "required": true,
6336
+ "description": "Unique radio group name (sets for each radio).",
6336
6337
  "value": {
6337
6338
  "kind": "expression",
6338
6339
  "type": "string"
6339
- },
6340
- "default": "\"\""
6340
+ }
6341
6341
  },
6342
6342
  {
6343
6343
  "name": "disabled",