vueless 0.0.375 → 0.0.376

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.375",
3
+ "version": "0.0.376",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -3,18 +3,13 @@
3
3
  <div v-if="loading" v-bind="loaderAttrs">
4
4
  <!-- @slot Use it to add something instead of the default loader. -->
5
5
  <slot>
6
- <div
7
- v-for="ellipse in ELLIPSES_AMOUNT"
8
- :key="ellipse"
9
- v-bind="ellipseAttrs(ellipseClasses)"
10
- />
6
+ <div v-for="ellipse in ELLIPSES_AMOUNT" :key="ellipse" v-bind="ellipseAttrs" />
11
7
  </slot>
12
8
  </div>
13
9
  </Transition>
14
10
  </template>
15
11
 
16
12
  <script setup>
17
- import { computed } from "vue";
18
13
  import { getDefault } from "../utils/utilUI.js";
19
14
 
20
15
  import { ULoader, ELLIPSES_AMOUNT } from "./constants.js";
@@ -52,55 +47,50 @@ const props = defineProps({
52
47
  });
53
48
 
54
49
  const { loaderAttrs, ellipseAttrs, config } = useAttrs(props);
55
-
56
- const ellipseClasses = computed(() => [
57
- "vueless-loader-ellipse",
58
- `vueless-loader-ellipse-${props.size}`,
59
- ]);
60
50
  </script>
61
51
 
62
52
  <style scoped lang="postcss">
63
53
  .vueless-loader-ellipse {
64
54
  &:nth-child(1) {
65
- animation: lds-ellipsis1 0.6s infinite;
55
+ animation: ellipse-1 0.6s infinite;
66
56
  }
67
57
 
68
58
  &:nth-child(4) {
69
- animation: lds-ellipsis3 0.6s infinite;
59
+ animation: ellipse-3 0.6s infinite;
70
60
  }
71
61
 
72
62
  &-sm {
73
63
  &:nth-child(2) {
74
- animation: lds-ellipsis2-sm 0.6s infinite;
64
+ animation: ellipse-2-sm 0.6s infinite;
75
65
  }
76
66
 
77
67
  &:nth-child(3) {
78
- animation: lds-ellipsis2-sm 0.6s infinite;
68
+ animation: ellipse-2-sm 0.6s infinite;
79
69
  }
80
70
  }
81
71
 
82
72
  &-md {
83
73
  &:nth-child(2) {
84
- animation: lds-ellipsis2-md 0.6s infinite;
74
+ animation: ellipse-2-md 0.6s infinite;
85
75
  }
86
76
 
87
77
  &:nth-child(3) {
88
- animation: lds-ellipsis2-md 0.6s infinite;
78
+ animation: ellipse-2-md 0.6s infinite;
89
79
  }
90
80
  }
91
81
 
92
82
  &-lg {
93
83
  &:nth-child(2) {
94
- animation: lds-ellipsis2-lg 0.6s infinite;
84
+ animation: ellipse-2-lg 0.6s infinite;
95
85
  }
96
86
 
97
87
  &:nth-child(3) {
98
- animation: lds-ellipsis2-lg 0.6s infinite;
88
+ animation: ellipse-2-lg 0.6s infinite;
99
89
  }
100
90
  }
101
91
  }
102
92
 
103
- @keyframes lds-ellipsis1 {
93
+ @keyframes ellipse-1 {
104
94
  0% {
105
95
  transform: scale(0);
106
96
  }
@@ -109,7 +99,7 @@ const ellipseClasses = computed(() => [
109
99
  }
110
100
  }
111
101
 
112
- @keyframes lds-ellipsis3 {
102
+ @keyframes ellipse-3 {
113
103
  0% {
114
104
  transform: scale(1);
115
105
  }
@@ -118,7 +108,7 @@ const ellipseClasses = computed(() => [
118
108
  }
119
109
  }
120
110
 
121
- @keyframes lds-ellipsis2-sm {
111
+ @keyframes ellipse-2-sm {
122
112
  0% {
123
113
  transform: translate(0, 0);
124
114
  }
@@ -128,7 +118,7 @@ const ellipseClasses = computed(() => [
128
118
  }
129
119
  }
130
120
 
131
- @keyframes lds-ellipsis2-md {
121
+ @keyframes ellipse-2-md {
132
122
  0% {
133
123
  transform: translate(0, 0);
134
124
  }
@@ -138,7 +128,7 @@ const ellipseClasses = computed(() => [
138
128
  }
139
129
  }
140
130
 
141
- @keyframes lds-ellipsis2-lg {
131
+ @keyframes ellipse-2-lg {
142
132
  0% {
143
133
  transform: translate(0, 0);
144
134
  }
@@ -1,47 +1,20 @@
1
+ import { computed } from "vue";
1
2
  import useUI from "../composables/useUI.js";
2
- import { cva, cx } from "../utils/utilUI.js";
3
3
 
4
4
  import defaultConfig from "./config.js";
5
- import { computed } from "vue";
6
5
 
7
6
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
- defaultConfig,
10
- () => props.config,
11
- );
12
- const attrs = {};
13
-
14
- for (const key in defaultConfig) {
15
- if (isSystemKey(key)) continue;
16
-
17
- const classes = computed(() => {
18
- let value = config.value[key];
19
-
20
- if (isCVA(value)) {
21
- value = cva(value)({
22
- ...props,
23
- color: getColor(props.color),
24
- });
25
- }
26
-
27
- return setColor(value, props.color);
28
- });
29
-
30
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
31
-
32
- if (key === "ellipse") {
33
- const ellipseAttrs = attrs[`${key}Attrs`];
7
+ const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
34
8
 
35
- attrs[`${key}Attrs`] = computed(() => (classes) => ({
36
- ...ellipseAttrs,
37
- class: cx([ellipseAttrs.value.class, classes]),
38
- }));
39
- }
40
- }
9
+ const keysAttrs = getKeysAttrs({}, [], {
10
+ ellipse: {
11
+ extend: computed(() => ["vueless-loader-ellipse", `vueless-loader-ellipse-${props.size}`]),
12
+ },
13
+ });
41
14
 
42
15
  return {
43
- ...attrs,
44
16
  config,
17
+ ...keysAttrs,
45
18
  hasSlotContent,
46
19
  };
47
20
  }
@@ -1,38 +1,15 @@
1
- import { computed } from "vue";
2
1
  import useUI from "../composables/useUI.js";
3
- import { cva } from "../utils/utilUI.js";
4
2
 
5
3
  import defaultConfig from "./config.js";
6
4
 
7
5
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
- defaultConfig,
10
- () => props.config,
11
- );
12
- const attrs = {};
6
+ const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
13
7
 
14
- for (const key in defaultConfig) {
15
- if (isSystemKey(key)) continue;
16
-
17
- const classes = computed(() => {
18
- let value = config.value[key];
19
-
20
- if (isCVA(value)) {
21
- value = cva(value)({
22
- ...props,
23
- color: getColor(props.color),
24
- });
25
- }
26
-
27
- return setColor(value, props.color);
28
- });
29
-
30
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
31
- }
8
+ const keysAttrs = getKeysAttrs();
32
9
 
33
10
  return {
34
- ...attrs,
35
11
  config,
12
+ ...keysAttrs,
36
13
  hasSlotContent,
37
14
  };
38
15
  }
@@ -1,38 +1,15 @@
1
1
  import useUI from "../composables/useUI.js";
2
- import { cva } from "../utils/utilUI.js";
3
2
 
4
3
  import defaultConfig from "./config.js";
5
- import { computed } from "vue";
6
4
 
7
5
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
- defaultConfig,
10
- () => props.config,
11
- );
12
- const attrs = {};
6
+ const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
13
7
 
14
- for (const key in defaultConfig) {
15
- if (isSystemKey(key)) continue;
16
-
17
- const classes = computed(() => {
18
- let value = config.value[key];
19
-
20
- if (isCVA(value)) {
21
- value = cva(value)({
22
- ...props,
23
- color: getColor(props.color),
24
- });
25
- }
26
-
27
- return setColor(value, props.color);
28
- });
29
-
30
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
31
- }
8
+ const keysAttrs = getKeysAttrs();
32
9
 
33
10
  return {
34
- ...attrs,
35
11
  config,
12
+ ...keysAttrs,
36
13
  hasSlotContent,
37
14
  };
38
15
  }
@@ -1,60 +1,41 @@
1
+ import { computed } from "vue";
1
2
  import useUI from "../composables/useUI.js";
2
3
 
3
4
  import defaultConfig from "./config.js";
4
- import { cva, cx } from "../utils/utilUI.js";
5
- import { computed } from "vue";
6
5
 
7
6
  export default function useAttrs(props) {
8
- const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
7
+ const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI(
9
8
  defaultConfig,
10
9
  () => props.config,
11
10
  );
12
11
 
13
- const paginationButtonClasses = computed(() =>
14
- cva(config.value.paginationButton)({
15
- ...props,
16
- }),
17
- );
18
-
19
- const attrs = {};
20
-
21
- for (const key in defaultConfig) {
22
- if (isSystemKey(key)) continue;
23
-
24
- const classes = computed(() => {
25
- let value = config.value[key];
26
-
27
- if (isCVA(value)) {
28
- value = cva(value)({
29
- ...props,
30
- });
31
- }
32
-
33
- return value;
34
- });
35
-
36
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
37
-
38
- if (
39
- key === "firstButton" ||
40
- key === "lastButton" ||
41
- key === "prevButton" ||
42
- key === "nextButton" ||
43
- key === "activeButton" ||
44
- key === "inactiveButton"
45
- ) {
46
- const keyAttrs = attrs[`${key}Attrs`];
47
-
48
- attrs[`${key}Attrs`] = computed(() => ({
49
- ...keyAttrs.value,
50
- class: cx([paginationButtonClasses.value, keyAttrs.value.class]),
51
- }));
52
- }
53
- }
12
+ const extendingKeys = ["paginationButton"];
13
+ const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
14
+
15
+ const keysAttrs = getKeysAttrs({}, extendingKeys, {
16
+ firstButton: {
17
+ base: computed(() => [extendingKeysClasses.paginationButton.value]),
18
+ },
19
+ lastButton: {
20
+ base: computed(() => [extendingKeysClasses.paginationButton.value]),
21
+ },
22
+ prevButton: {
23
+ base: computed(() => [extendingKeysClasses.paginationButton.value]),
24
+ },
25
+ nextButton: {
26
+ base: computed(() => [extendingKeysClasses.paginationButton.value]),
27
+ },
28
+ activeButton: {
29
+ base: computed(() => [extendingKeysClasses.paginationButton.value]),
30
+ },
31
+ inactiveButton: {
32
+ base: computed(() => [extendingKeysClasses.paginationButton.value]),
33
+ },
34
+ });
54
35
 
55
36
  return {
56
- ...attrs,
57
37
  config,
38
+ ...keysAttrs,
58
39
  hasSlotContent,
59
40
  };
60
41
  }
@@ -16,7 +16,7 @@
16
16
  <progress v-bind="progressAttrs" :max="realMax" :value="value" />
17
17
  </template>
18
18
 
19
- <div v-if="isSteps" v-bind="stepAttrs(!value && config.stepFirst)">
19
+ <div v-if="isSteps" v-bind="stepAttrs">
20
20
  <template v-for="(step, index) in max" :key="index">
21
21
  <!--
22
22
  @slot Use it to add something instead of the progress step label.
@@ -133,8 +133,7 @@ const props = defineProps({
133
133
  },
134
134
  });
135
135
 
136
- const { progressAttrs, wrapperAttrs, indicatorAttrs, stepAttrs, stepperAttrs, config } =
137
- useAttrs(props);
136
+ const { progressAttrs, wrapperAttrs, indicatorAttrs, stepAttrs, stepperAttrs } = useAttrs(props);
138
137
 
139
138
  const isSteps = computed(() => Array.isArray(props.max));
140
139
 
@@ -1,48 +1,26 @@
1
+ import { computed } from "vue";
1
2
  import useUI from "../composables/useUI.js";
2
- import { cva, cx } from "../utils/utilUI.js";
3
3
 
4
4
  import defaultConfig from "./config.js";
5
- import { computed } from "vue";
6
5
 
7
6
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
7
+ const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI(
9
8
  defaultConfig,
10
9
  () => props.config,
11
10
  );
12
11
 
13
- const attrs = {};
14
-
15
- for (const key in defaultConfig) {
16
- if (isSystemKey(key)) continue;
17
-
18
- const classes = computed(() => {
19
- let value = config.value[key];
20
-
21
- if (isCVA(value)) {
22
- value = cva(value)({
23
- ...props,
24
- color: getColor(props.color),
25
- });
26
- }
27
-
28
- return setColor(value, props.color);
29
- });
30
-
31
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
32
-
33
- if (key === "step") {
34
- const stepAttrs = attrs[`${key}Attrs`];
12
+ const extendingKeys = ["stepFirst"];
13
+ const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
35
14
 
36
- attrs[`${key}Attrs`] = computed(() => (classes) => ({
37
- ...stepAttrs,
38
- class: cx([stepAttrs.value.class, classes]),
39
- }));
40
- }
41
- }
15
+ const keysAttrs = getKeysAttrs({}, extendingKeys, {
16
+ step: {
17
+ base: computed(() => [!props.value && extendingKeysClasses.stepFirst.value]),
18
+ },
19
+ });
42
20
 
43
21
  return {
44
- ...attrs,
45
22
  config,
23
+ ...keysAttrs,
46
24
  hasSlotContent,
47
25
  };
48
26
  }
@@ -36,7 +36,7 @@ const props = defineProps({
36
36
  * Tab value.
37
37
  */
38
38
  value: {
39
- type: String,
39
+ type: [String, Number],
40
40
  default: "",
41
41
  },
42
42
 
@@ -10,11 +10,9 @@ export default /*tw*/ {
10
10
  disabled: {
11
11
  true: "text-gray-400 cursor-not-allowed",
12
12
  },
13
- selected: {
14
- true: "border-b-2 text-brand-700 border-brand-700",
15
- },
16
13
  },
17
14
  },
15
+ tabActive: "border-b-2 text-brand-700 border-brand-700",
18
16
  defaults: {
19
17
  size: "md",
20
18
  disabled: false,
@@ -1,39 +1,30 @@
1
1
  import useUI from "../composables/useUI.js";
2
- import { cva } from "../utils/utilUI.js";
3
2
 
4
3
  import defaultConfig from "./config.js";
5
4
  import { computed } from "vue";
6
5
 
7
6
  export default function useAttrs(props, { selected, size }) {
8
- const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
7
+ const { config, getKeysAttrs, hasSlotContent, getExtendingKeysClasses } = useUI(
9
8
  defaultConfig,
10
9
  () => props.config,
11
10
  );
12
- const attrs = {};
13
11
 
14
- for (const key in defaultConfig) {
15
- if (isSystemKey(key)) continue;
12
+ const mutatedProps = computed(() => ({
13
+ size: size.value,
14
+ }));
16
15
 
17
- const classes = computed(() => {
18
- let value = config.value[key];
16
+ const extendingKeys = ["tabActive"];
17
+ const extendingKeysClasses = getExtendingKeysClasses(extendingKeys);
19
18
 
20
- if (isCVA(value)) {
21
- value = cva(value)({
22
- ...props,
23
- size: size.value,
24
- selected: selected.value,
25
- });
26
- }
27
-
28
- return value;
29
- });
30
-
31
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
32
- }
19
+ const keysAttrs = getKeysAttrs(mutatedProps, extendingKeys, {
20
+ tab: {
21
+ extend: computed(() => [selected.value && extendingKeysClasses.tabActive.value]),
22
+ },
23
+ });
33
24
 
34
25
  return {
35
- ...attrs,
36
26
  config,
27
+ ...keysAttrs,
37
28
  hasSlotContent,
38
29
  };
39
30
  }
@@ -1,37 +1,15 @@
1
1
  import useUI from "../composables/useUI.js";
2
- import { cva } from "../utils/utilUI.js";
3
2
 
4
3
  import defaultConfig from "./config.js";
5
- import { computed } from "vue";
6
4
 
7
5
  export default function useAttrs(props) {
8
- const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
9
- defaultConfig,
10
- () => props.config,
11
- );
12
- const attrs = {};
6
+ const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
13
7
 
14
- for (const key in defaultConfig) {
15
- if (isSystemKey(key)) continue;
16
-
17
- const classes = computed(() => {
18
- let value = config.value[key];
19
-
20
- if (isCVA(value)) {
21
- value = cva(value)({
22
- ...props,
23
- });
24
- }
25
-
26
- return value;
27
- });
28
-
29
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
30
- }
8
+ const keysAttrs = getKeysAttrs();
31
9
 
32
10
  return {
33
- ...attrs,
34
11
  config,
12
+ ...keysAttrs,
35
13
  hasSlotContent,
36
14
  };
37
15
  }
@@ -1,38 +1,15 @@
1
1
  import useUI from "../composables/useUI.js";
2
- import { cva } from "../utils/utilUI.js";
3
2
 
4
3
  import defaultConfig from "./config.js";
5
- import { computed } from "vue";
6
4
 
7
5
  export default function useAttrs(props) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
- defaultConfig,
10
- () => props.config,
11
- );
12
- const attrs = {};
6
+ const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
13
7
 
14
- for (const key in defaultConfig) {
15
- if (isSystemKey(key)) continue;
16
-
17
- const classes = computed(() => {
18
- let value = config.value[key];
19
-
20
- if (isCVA(value)) {
21
- value = cva(value)({
22
- ...props,
23
- color: getColor(props.color),
24
- });
25
- }
26
-
27
- return setColor(value, props.color);
28
- });
29
-
30
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
31
- }
8
+ const keysAttrs = getKeysAttrs();
32
9
 
33
10
  return {
34
- ...attrs,
35
11
  config,
12
+ ...keysAttrs,
36
13
  hasSlotContent,
37
14
  };
38
15
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.375",
4
+ "version": "0.0.376",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -8006,7 +8006,7 @@
8006
8006
  "description": "Tab value.",
8007
8007
  "value": {
8008
8008
  "kind": "expression",
8009
- "type": "string"
8009
+ "type": "string|number"
8010
8010
  },
8011
8011
  "default": "\"\""
8012
8012
  },