vueless 0.0.201 → 0.0.202

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.
Files changed (60) hide show
  1. package/composable.ui/index.js +3 -2
  2. package/package.json +2 -2
  3. package/ui.button-link/composables/attrs.composable.js +64 -130
  4. package/ui.button-link/index.stories.js +2 -4
  5. package/ui.button-link/index.vue +29 -4
  6. package/ui.button-toggle/composables/attrs.composable.js +21 -33
  7. package/ui.button-toggle/configs/default.config.js +2 -2
  8. package/ui.button-toggle/index.vue +8 -2
  9. package/ui.button-toggle-item/composables/attrs.composable.js +50 -40
  10. package/ui.button-toggle-item/configs/default.config.js +1 -1
  11. package/ui.button-toggle-item/index.stories.js +2 -4
  12. package/ui.button-toggle-item/index.vue +11 -3
  13. package/ui.dropdown-badge/composables/attrs.composable.js +45 -45
  14. package/ui.dropdown-badge/configs/default.config.js +3 -3
  15. package/ui.dropdown-badge/index.stories.js +2 -4
  16. package/ui.dropdown-badge/index.vue +8 -2
  17. package/ui.dropdown-button/composables/attrs.composable.js +45 -45
  18. package/ui.dropdown-button/configs/default.config.js +3 -3
  19. package/ui.dropdown-button/index.stories.js +2 -4
  20. package/ui.dropdown-button/index.vue +8 -2
  21. package/ui.dropdown-item/index.vue +7 -1
  22. package/ui.dropdown-link/composables/attrs.composable.js +43 -45
  23. package/ui.dropdown-link/configs/default.config.js +3 -3
  24. package/ui.dropdown-link/index.stories.js +2 -4
  25. package/ui.dropdown-link/index.vue +8 -2
  26. package/ui.dropdown-list/composables/attrs.composable.js +43 -67
  27. package/ui.dropdown-list/configs/default.config.js +2 -2
  28. package/ui.dropdown-list/index.vue +19 -3
  29. package/ui.form-calendar/components/DayView.vue +4 -4
  30. package/ui.form-calendar/composables/attrs.composable.js +5 -4
  31. package/ui.navigation-progress/components/StepperProgress.vue +87 -0
  32. package/ui.navigation-progress/composables/attrs.composable.js +33 -56
  33. package/ui.navigation-progress/configs/default.config.js +34 -1
  34. package/ui.navigation-progress/constants/index.js +5 -0
  35. package/ui.navigation-progress/index.stories.js +3 -0
  36. package/ui.navigation-progress/index.vue +55 -9
  37. package/ui.text-alert/composables/attrs.composable.js +23 -39
  38. package/ui.text-alert/configs/default.config.js +3 -3
  39. package/ui.text-alert/index.vue +19 -8
  40. package/ui.text-badge/composables/attrs.composable.js +25 -36
  41. package/ui.text-badge/index.stories.js +2 -4
  42. package/ui.text-badge/index.vue +22 -2
  43. package/ui.text-block/composables/attrs.composable.js +24 -20
  44. package/ui.text-block/index.vue +1 -1
  45. package/ui.text-empty/composables/attrs.composable.js +17 -27
  46. package/ui.text-empty/configs/default.config.js +1 -1
  47. package/ui.text-empty/index.stories.js +2 -4
  48. package/ui.text-empty/index.vue +1 -1
  49. package/ui.text-header/composables/attrs.composable.js +28 -22
  50. package/ui.text-header/index.stories.js +1 -1
  51. package/ui.text-header/index.vue +1 -1
  52. package/ui.text-money/composables/attrs.composable.js +21 -48
  53. package/ui.text-money/index.stories.js +2 -4
  54. package/web-types.json +181 -97
  55. package/ui.navigation-stepper/Docs.mdx +0 -16
  56. package/ui.navigation-stepper/composables/attrs.composable.js +0 -25
  57. package/ui.navigation-stepper/configs/default.config.js +0 -13
  58. package/ui.navigation-stepper/constants/index.js +0 -5
  59. package/ui.navigation-stepper/index.stories.js +0 -33
  60. package/ui.navigation-stepper/index.vue +0 -126
@@ -4,49 +4,38 @@ 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, hasSlotContent, getColor, setColor } = useUI(
7
+ export default function useAttrs(props) {
8
+ const { config, getAttrs, hasSlotContent, getColor, setColor, isSystemKey } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
12
- const { wrapper, body } = config.value;
13
-
14
- const cvaWrapper = cva({
15
- base: wrapper.base,
16
- variants: wrapper.variants,
17
- compoundVariants: wrapper.compoundVariants,
18
- });
19
-
20
- const cvaBody = cva({
21
- base: body.base,
22
- variants: body.variants,
23
- compoundVariants: body.compoundVariants,
24
- });
25
-
26
- const wrapperClasses = computed(() =>
27
- setColor(
28
- cvaWrapper({
29
- variant: props.variant,
30
- size: props.size,
31
- color: getColor(props.color),
32
- weight: props.weight,
33
- }),
34
- props.color,
35
- ),
36
- );
12
+ const attrs = {};
37
13
 
38
- const bodyClasses = computed(() =>
39
- cvaBody({
40
- size: props.size,
41
- }),
42
- );
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
+ });
43
32
 
44
- const wrapperAttrs = getAttrs("wrapper", { classes: wrapperClasses });
45
- const bodyAttrs = getAttrs("body", { classes: bodyClasses });
33
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
34
+ }
46
35
 
47
36
  return {
48
- bodyAttrs,
49
- wrapperAttrs,
37
+ ...attrs,
38
+ config,
50
39
  hasSlotContent,
51
40
  };
52
41
  }
@@ -1,4 +1,4 @@
1
- import { getArgTypes, getSlotNames } from "../service.storybook";
1
+ import { getArgTypes, getSlotNames, allSlotsFragment } from "../service.storybook";
2
2
 
3
3
  import UBadge from "../ui.text-badge";
4
4
  import UIcon from "../ui.image-icon";
@@ -29,9 +29,7 @@ const DefaultTemplate = (args) => ({
29
29
  },
30
30
  template: `
31
31
  <UBadge v-bind="args">
32
- <template v-for="(slot, index) of slots" :key="index" v-slot:[slot]>
33
- <template v-if="args[slot]">{{ args[slot] }}</template>
34
- </template>
32
+ ${allSlotsFragment}
35
33
  </UBadge>
36
34
  `,
37
35
  });
@@ -32,7 +32,7 @@ import { ref } from "vue";
32
32
  import UIService from "../service.ui";
33
33
 
34
34
  import { UBadge } from "./constants";
35
- import { useAttrs } from "./composables/attrs.composable";
35
+ import useAttrs from "./composables/attrs.composable";
36
36
  import defaultConfig from "./configs/default.config";
37
37
 
38
38
  /* Should be a string for correct web-types gen */
@@ -101,7 +101,27 @@ const props = defineProps({
101
101
  },
102
102
  });
103
103
 
104
- const emit = defineEmits(["focus", "keydown", "blur", "click"]);
104
+ const emit = defineEmits([
105
+ /**
106
+ * Triggers when the badge is focused.
107
+ */
108
+ "focus",
109
+
110
+ /**
111
+ * Triggers when the badge is pressed.
112
+ */
113
+ "keydown",
114
+
115
+ /**
116
+ * Triggers when the badge loses focus.
117
+ */
118
+ "blur",
119
+
120
+ /**
121
+ * Triggers when the badge is clicked.
122
+ */
123
+ "click",
124
+ ]);
105
125
 
106
126
  const { bodyAttrs, wrapperAttrs, hasSlotContent } = useAttrs(props);
107
127
 
@@ -4,30 +4,34 @@ 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, hasSlotContent } = 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
- cvaWrapper({
19
- align: props.align,
20
- size: props.size,
21
- line: props.line,
22
- }),
7
+ export default function useAttrs(props) {
8
+ const { config, getAttrs, hasSlotContent, isSystemKey } = useUI(
9
+ defaultConfig,
10
+ () => props.config,
23
11
  );
12
+ const attrs = {};
24
13
 
25
- const wrapperAttrs = getAttrs("wrapper", { classes: wrapperClasses });
26
- const htmlAttrs = getAttrs("html");
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 cva(value)({
22
+ ...props,
23
+ });
24
+ }
25
+
26
+ return "";
27
+ });
28
+
29
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
30
+ }
27
31
 
28
32
  return {
29
- wrapperAttrs,
30
- htmlAttrs,
33
+ ...attrs,
34
+ config,
31
35
  hasSlotContent,
32
36
  };
33
37
  }
@@ -11,7 +11,7 @@ import UIService from "../service.ui";
11
11
 
12
12
  import { UText } from "./constatns";
13
13
  import defaultConfig from "./configs/default.config";
14
- import { useAttrs } from "./composables/attrs.composable";
14
+ import useAttrs from "./composables/attrs.composable";
15
15
 
16
16
  /* Should be a string for correct web-types gen */
17
17
  defineOptions({ name: "UText" });
@@ -4,40 +4,30 @@ 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 } = useUI(defaultConfig, () => props.config);
9
- const { title, description } = config.value;
7
+ export default function useAttrs(props) {
8
+ const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
9
+ const attrs = {};
10
10
 
11
- const cvaTitle = cva({
12
- base: title.base,
13
- variants: title.variants,
14
- compoundVariants: title.compoundVariants,
15
- });
11
+ for (const key in defaultConfig) {
12
+ if (isSystemKey(key)) continue;
16
13
 
17
- const cvaDescription = cva({
18
- base: description.base,
19
- variants: description.variants,
20
- compoundVariants: description.compoundVariants,
21
- });
14
+ const classes = computed(() => {
15
+ const value = config.value[key];
22
16
 
23
- const titleClasses = computed(() => cvaTitle({ size: props.size }));
17
+ if (value.variants || value.compoundVariants) {
18
+ return cva(value)({
19
+ ...props,
20
+ });
21
+ }
24
22
 
25
- const descriptionClasses = computed(() => cvaDescription({ size: props.size }));
23
+ return "";
24
+ });
26
25
 
27
- const wrapperAttrs = getAttrs("wrapper");
28
- const headerAttrs = getAttrs("header");
29
- const iconAttrs = getAttrs("icon", { isComponent: true });
30
- const footerAttrs = getAttrs("footer");
31
- const titleAttrs = getAttrs("title", { classes: titleClasses });
32
- const descriptionAttrs = getAttrs("description", { classes: descriptionClasses });
26
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
27
+ }
33
28
 
34
29
  return {
30
+ ...attrs,
35
31
  config,
36
- titleAttrs,
37
- descriptionAttrs,
38
- wrapperAttrs,
39
- headerAttrs,
40
- footerAttrs,
41
- iconAttrs,
42
32
  };
43
33
  }
@@ -1,7 +1,7 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: "flex flex-col items-center justify-center size-full",
3
3
  header: "mb-4 flex justify-center",
4
- icon: "",
4
+ icon: "{UIcon}",
5
5
  iconName: "emoji_food_beverage",
6
6
  footer: "mt-4 flex justify-center",
7
7
  title: {
@@ -1,4 +1,4 @@
1
- import { getArgTypes, getSlotNames } from "../service.storybook";
1
+ import { getArgTypes, getSlotNames, allSlotsFragment } from "../service.storybook";
2
2
 
3
3
  import UEmpty from "../ui.text-empty";
4
4
  import UButton from "../ui.button";
@@ -30,9 +30,7 @@ const DefaultTemplate = (args) => ({
30
30
  },
31
31
  template: `
32
32
  <UEmpty v-bind="args">
33
- <template v-for="(slot, index) of slots" :key="index" v-slot:[slot]>
34
- <template v-if="args[slot]">{{ args[slot] }}</template>
35
- </template>
33
+ ${allSlotsFragment}
36
34
  </UEmpty>
37
35
  `,
38
36
  });
@@ -39,7 +39,7 @@ import UIService from "../service.ui";
39
39
 
40
40
  import { UEmpty } from "./constants";
41
41
  import defaultConfig from "./configs/default.config";
42
- import { useAttrs } from "./composables/attrs.composable";
42
+ import useAttrs from "./composables/attrs.composable";
43
43
 
44
44
  /* Should be a string for correct web-types gen */
45
45
  defineOptions({ name: "UEmpty", inheritAttrs: false });
@@ -4,31 +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
- weight: props.weight,
22
- underlined: props.underlined,
23
- color: getColor(props.color),
24
- }),
25
- props.color,
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 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
+ }
30
35
 
31
36
  return {
32
- wrapperAttrs,
37
+ ...attrs,
38
+ config,
33
39
  };
34
40
  }
@@ -105,7 +105,7 @@ Sizes.args = {};
105
105
  export const Underlined = SizesTemplate.bind({});
106
106
  Underlined.args = { underlined: true };
107
107
 
108
- export const Multiline = SizesTemplate.bind({});
108
+ export const Multiline = DefaultTemplate.bind({});
109
109
  Multiline.args = {
110
110
  size: "2xl",
111
111
  multiline: true,
@@ -13,7 +13,7 @@ import UIService from "../service.ui";
13
13
 
14
14
  import { UHeader } 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: "UHeader", inheritAttrs: false });
@@ -5,64 +5,37 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export function useAttrs(props) {
8
- const { config, hasSlotContent, getAttrs, getColor, setColor } = useUI(
8
+ const { config, hasSlotContent, getAttrs, getColor, setColor, isSystemKey } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
12
- const { money, sum, penny } = config.value;
12
+ const attrs = {};
13
13
 
14
- const cvaMoney = cva({
15
- base: money.base,
16
- variants: money.variants,
17
- compoundVariants: money.compoundVariants,
18
- });
14
+ for (const key in defaultConfig) {
15
+ if (isSystemKey(key)) continue;
19
16
 
20
- const cvaSum = cva({
21
- base: sum.base,
22
- variants: sum.variants,
23
- compoundVariants: sum.compoundVariants,
24
- });
17
+ const classes = computed(() => {
18
+ const value = config.value[key];
25
19
 
26
- const cvaPenny = cva({
27
- base: penny.base,
28
- variants: penny.variants,
29
- compoundVariants: penny.compoundVariants,
30
- });
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
+ }
31
29
 
32
- const moneyClasses = computed(() =>
33
- setColor(
34
- cvaMoney({
35
- align: props.align,
36
- color: getColor(props.color),
37
- weight: props.weight,
38
- }),
39
- props.color,
40
- ),
41
- );
42
-
43
- const sumClasses = computed(() =>
44
- cvaSum({
45
- planned: props.planned,
46
- size: props.size,
47
- }),
48
- );
49
-
50
- const pennyClasses = computed(() => cvaPenny({ size: props.size }));
30
+ return "";
31
+ });
51
32
 
52
- const moneyAttrs = getAttrs("money", { classes: moneyClasses });
53
- const slotLeftAttrs = getAttrs("slotLeft");
54
- const slotRightAttrs = getAttrs("slotRight");
55
- const sumAttrs = getAttrs("sum", { classes: sumClasses });
56
- const pennyAttrs = getAttrs("penny", { classes: pennyClasses });
57
- const symbolAttrs = getAttrs("symbol");
33
+ attrs[`${key}Attrs`] = getAttrs(key, { classes });
34
+ }
58
35
 
59
36
  return {
60
- sumAttrs,
61
- pennyAttrs,
62
- moneyAttrs,
63
- slotLeftAttrs,
64
- symbolAttrs,
65
- slotRightAttrs,
37
+ ...attrs,
38
+ config,
66
39
  hasSlotContent,
67
40
  };
68
41
  }
@@ -4,7 +4,7 @@ import URow from "../ui.container-row";
4
4
  import DebitIcon from "../ui.text-money/assets/debit.svg?component";
5
5
  import CreditIcon from "../ui.text-money/assets/credit.svg?component";
6
6
 
7
- import { getArgTypes, getSlotNames } from "../service.storybook";
7
+ import { getArgTypes, getSlotNames, allSlotsFragment } from "../service.storybook";
8
8
 
9
9
  const COMPONENT_CLASSES = "flex justify-center w-1/6";
10
10
 
@@ -35,9 +35,7 @@ const DefaultTemplate = (args) => ({
35
35
  template: `
36
36
  <div class="${COMPONENT_CLASSES}">
37
37
  <UMoney v-bind="args">
38
- <template v-for="(slot) in slots" v-slot:[slot]>
39
- <template v-if="args[slot]">{{ args[slot] }}</template>
40
- </template>
38
+ ${allSlotsFragment}
41
39
  </UMoney>
42
40
  </div>
43
41
  `,