vueless 0.0.265 → 0.0.266

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.
@@ -198,7 +198,6 @@ function mergeConfigs({
198
198
  safelistColors,
199
199
  defaultVariants,
200
200
  compoundVariants,
201
- iconNameCapitalize,
202
201
  iconName,
203
202
  } = SYSTEM_CONFIG_KEY;
204
203
 
@@ -235,7 +234,7 @@ function mergeConfigs({
235
234
 
236
235
  const isObject = isObjectComposedConfig || isObjectGlobalConfig || isObjectPropsConfig;
237
236
  const isEmpty = composedConfig[key] === null;
238
- const isIconName = key.includes(iconName) || key.includes(iconNameCapitalize);
237
+ const isIconName = key.toLowerCase().includes(iconName.toLowerCase());
239
238
  const isI18n = key === i18n;
240
239
 
241
240
  if (key === "variants" && !isVariants) {
@@ -403,8 +402,8 @@ function isSystemKey(key) {
403
402
 
404
403
  return (
405
404
  isExactKey ||
406
- key.includes(SYSTEM_CONFIG_KEY.iconName) ||
407
- key.includes(SYSTEM_CONFIG_KEY.iconNameCapitalize)
405
+ key.toLowerCase().includes(SYSTEM_CONFIG_KEY.iconName.toLowerCase()) ||
406
+ key.toLowerCase().includes(SYSTEM_CONFIG_KEY.transition.toLowerCase())
408
407
  );
409
408
  }
410
409
 
@@ -60,7 +60,7 @@ export const SYSTEM_CONFIG_KEY = {
60
60
  safelist: "safelist",
61
61
  component: "component",
62
62
  safelistColors: "safelistColors",
63
- iconNameCapitalize: "IconName",
63
+ transition: "transition",
64
64
  iconName: "iconName",
65
65
  ...CVA_CONFIG_KEY,
66
66
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.265",
3
+ "version": "0.0.266",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -228,6 +228,10 @@ export default class UIService {
228
228
  @returns { String }
229
229
  */
230
230
  setColor(classes, color) {
231
+ if (typeof classes !== "string") {
232
+ return "";
233
+ }
234
+
231
235
  return classes?.replaceAll("{color}", color);
232
236
  }
233
237
 
@@ -4,7 +4,7 @@ import { computed } from "vue";
4
4
  import { cva, cx } from "../../service.ui";
5
5
 
6
6
  export default function useAttrs(props) {
7
- const { config, getAttrs, hasSlotContent, isSystemKey } = useUI(
7
+ const { config, getAttrs, hasSlotContent, isSystemKey, isCVA } = useUI(
8
8
  defaultConfig,
9
9
  () => props.config,
10
10
  );
@@ -14,15 +14,15 @@ export default function useAttrs(props) {
14
14
  if (isSystemKey(key)) continue;
15
15
 
16
16
  const classes = computed(() => {
17
- const value = config.value[key];
17
+ let value = config.value[key];
18
18
 
19
- if (value.variants || value.compoundVariants) {
20
- return cva(value)({
19
+ if (isCVA(value)) {
20
+ value = cva(value)({
21
21
  ...props,
22
22
  });
23
23
  }
24
24
 
25
- return "";
25
+ return value;
26
26
  });
27
27
 
28
28
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -7,7 +7,7 @@ export default function useAttrs(
7
7
  props,
8
8
  { tableRows, isShownActionsHeader, isHeaderSticky, isFooterSticky },
9
9
  ) {
10
- const { config, getAttrs, hasSlotContent, isSystemKey } = useUI(
10
+ const { config, getAttrs, hasSlotContent, isSystemKey, isCVA } = useUI(
11
11
  defaultConfig,
12
12
  () => props.config,
13
13
  );
@@ -31,16 +31,16 @@ export default function useAttrs(
31
31
  if (isSystemKey(key)) continue;
32
32
 
33
33
  const classes = computed(() => {
34
- const value = config.value[key];
34
+ let value = config.value[key];
35
35
 
36
- if (value.variants || value.compoundVariants) {
37
- return cva(value)({
36
+ if (isCVA(value)) {
37
+ value = cva(value)({
38
38
  ...props,
39
39
  compact: Boolean(props.compact),
40
40
  });
41
41
  }
42
42
 
43
- return "";
43
+ return value;
44
44
  });
45
45
 
46
46
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,19 +15,16 @@ export default function useAttrs(props) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
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
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ color: getColor(props.color),
24
+ });
28
25
  }
29
26
 
30
- return "";
27
+ return setColor(value, props.color);
31
28
  });
32
29
 
33
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -36,5 +33,6 @@ export default function useAttrs(props) {
36
33
  return {
37
34
  ...attrs,
38
35
  config,
36
+ hasSlotContent,
39
37
  };
40
38
  }
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,19 +15,16 @@ export default function useAttrs(props) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
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
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ color: getColor(props.color),
24
+ });
28
25
  }
29
26
 
30
- return "";
27
+ return setColor(value, props.color);
31
28
  });
32
29
 
33
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -36,5 +33,6 @@ export default function useAttrs(props) {
36
33
  return {
37
34
  ...attrs,
38
35
  config,
36
+ hasSlotContent,
39
37
  };
40
38
  }
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,19 +15,16 @@ export default function useAttrs(props) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
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
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ color: getColor(props.color),
24
+ });
28
25
  }
29
26
 
30
- return "";
27
+ return setColor(value, props.color);
31
28
  });
32
29
 
33
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -45,5 +42,6 @@ export default function useAttrs(props) {
45
42
  return {
46
43
  ...attrs,
47
44
  config,
45
+ hasSlotContent,
48
46
  };
49
47
  }
@@ -5,7 +5,7 @@ import { cva } from "../../service.ui";
5
5
  import defaultConfig from "../configs/default.config";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,19 +15,16 @@ export default function useAttrs(props) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
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
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ color: getColor(props.color),
24
+ });
28
25
  }
29
26
 
30
- return "";
27
+ return setColor(value, props.color);
31
28
  });
32
29
 
33
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -36,5 +33,6 @@ export default function useAttrs(props) {
36
33
  return {
37
34
  ...attrs,
38
35
  config,
36
+ hasSlotContent,
39
37
  };
40
38
  }
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,19 +15,16 @@ export default function useAttrs(props) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
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
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ color: getColor(props.color),
24
+ });
28
25
  }
29
26
 
30
- return "";
27
+ return setColor(value, props.color);
31
28
  });
32
29
 
33
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -36,5 +33,6 @@ export default function useAttrs(props) {
36
33
  return {
37
34
  ...attrs,
38
35
  config,
36
+ hasSlotContent,
39
37
  };
40
38
  }
@@ -5,22 +5,25 @@ import { cva, cx } from "../../service.ui";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
8
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
11
+ );
9
12
  const attrs = {};
10
13
 
11
14
  for (const key in defaultConfig) {
12
15
  if (isSystemKey(key)) continue;
13
16
 
14
17
  const classes = computed(() => {
15
- const value = config.value[key];
18
+ let value = config.value[key];
16
19
 
17
- if (value.variants || value.compoundVariants) {
18
- return cva(value)({
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
19
22
  ...props,
20
23
  });
21
24
  }
22
25
 
23
- return "";
26
+ return value;
24
27
  });
25
28
 
26
29
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -51,5 +54,6 @@ export default function useAttrs(props) {
51
54
  return {
52
55
  ...attrs,
53
56
  config,
57
+ hasSlotContent,
54
58
  };
55
59
  }
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -16,19 +16,16 @@ export default function useAttrs(props) {
16
16
  if (isSystemKey(key)) continue;
17
17
 
18
18
  const classes = computed(() => {
19
- const value = config.value[key];
20
-
21
- if (value.variants || value.compoundVariants) {
22
- return setColor(
23
- cva(value)({
24
- ...props,
25
- color: getColor(props.color),
26
- }),
27
- props.color,
28
- );
19
+ let value = config.value[key];
20
+
21
+ if (isCVA(value)) {
22
+ value = cva(value)({
23
+ ...props,
24
+ color: getColor(props.color),
25
+ });
29
26
  }
30
27
 
31
- return "";
28
+ return setColor(value, props.color);
32
29
  });
33
30
 
34
31
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -46,5 +43,6 @@ export default function useAttrs(props) {
46
43
  return {
47
44
  ...attrs,
48
45
  config,
46
+ hasSlotContent,
49
47
  };
50
48
  }
@@ -51,19 +51,16 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
51
51
  return { args, updateProgress, options: argTypes[args.enum].options };
52
52
  },
53
53
  template: `
54
- <UCol align="start">
55
- <UCol>
56
- <UProgress
57
- v-for="(option, index) in options"
58
- :key="index"
59
- v-bind="args"
60
- :[args.enum]="option"
61
- :value="args.progress"
62
- />
63
- </UCol>
64
-
65
- <UButton label="Next →" size="sm" variant="thirdary" filled @click="updateProgress" />
66
- </UCol>
54
+ <UCol>
55
+ <UProgress
56
+ v-for="(option, index) in options"
57
+ :key="index"
58
+ v-bind="args"
59
+ :[args.enum]="option"
60
+ :value="args.progress"
61
+ />
62
+ <UButton label="Next →" size="sm" variant="thirdary" filled @click="updateProgress" />
63
+ </UCol>
67
64
  `,
68
65
  });
69
66
 
@@ -164,6 +164,6 @@ const progressPercent = computed(() => {
164
164
  });
165
165
 
166
166
  function isActiveStep(index) {
167
- return index === props.value;
167
+ return index === props.value - 1;
168
168
  }
169
169
  </script>
@@ -5,24 +5,27 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props, { selected, size }) {
8
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
8
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
11
+ );
9
12
  const attrs = {};
10
13
 
11
14
  for (const key in defaultConfig) {
12
15
  if (isSystemKey(key)) continue;
13
16
 
14
17
  const classes = computed(() => {
15
- const value = config.value[key];
18
+ let value = config.value[key];
16
19
 
17
- if (value.variants || value.compoundVariants) {
18
- return cva(value)({
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
19
22
  ...props,
20
23
  size: size.value,
21
24
  selected: selected.value,
22
25
  });
23
26
  }
24
27
 
25
- return "";
28
+ return value;
26
29
  });
27
30
 
28
31
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -31,5 +34,6 @@ export default function useAttrs(props, { selected, size }) {
31
34
  return {
32
35
  ...attrs,
33
36
  config,
37
+ hasSlotContent,
34
38
  };
35
39
  }
@@ -5,22 +5,25 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
8
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
11
+ );
9
12
  const attrs = {};
10
13
 
11
14
  for (const key in defaultConfig) {
12
15
  if (isSystemKey(key)) continue;
13
16
 
14
17
  const classes = computed(() => {
15
- const value = config.value[key];
18
+ let value = config.value[key];
16
19
 
17
- if (value.variants || value.compoundVariants) {
18
- return cva(value)({
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
19
22
  ...props,
20
23
  });
21
24
  }
22
25
 
23
- return "";
26
+ return value;
24
27
  });
25
28
 
26
29
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -29,5 +32,6 @@ export default function useAttrs(props) {
29
32
  return {
30
33
  ...attrs,
31
34
  config,
35
+ hasSlotContent,
32
36
  };
33
37
  }
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,19 +15,16 @@ export default function useAttrs(props) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
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
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ color: getColor(props.color),
24
+ });
28
25
  }
29
26
 
30
- return "";
27
+ return setColor(value, props.color);
31
28
  });
32
29
 
33
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -36,5 +33,6 @@ export default function useAttrs(props) {
36
33
  return {
37
34
  ...attrs,
38
35
  config,
36
+ hasSlotContent,
39
37
  };
40
38
  }
@@ -42,7 +42,7 @@ const EnumVariantTemplate = (args, { argTypes } = {}) => ({
42
42
  template: `
43
43
  <UCol>
44
44
  <URow
45
- v-for="(color, index) in colors"
45
+ v-for="(option, index) in options"
46
46
  :key="index"
47
47
  gap="none"
48
48
  align="center"
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.265",
4
+ "version": "0.0.266",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",