vueless 0.0.256 → 0.0.258

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.
@@ -1,4 +1,4 @@
1
- import { computed, toValue } from "vue";
1
+ import { computed, toValue, ref } from "vue";
2
2
 
3
3
  export const POSITION = {
4
4
  left: "left",
@@ -14,10 +14,8 @@ export function useAutoPosition(anchorElement, targetElement, position, preferre
14
14
  const localPosition = computed(() => toValue(position));
15
15
  const localPreferredPosition = computed(() => toValue(preferredPosition));
16
16
 
17
- const preferredOpenDirectionY = computed(() => {
18
- return localPreferredPosition.value?.y || POSITION.bottomi;
19
- });
20
- const preferredOpenDirectionX = computed(() => localPreferredPosition.value?.x || POSITION.left);
17
+ const preferredOpenDirectionY = ref(localPreferredPosition.value?.y || POSITION.bottom);
18
+ const preferredOpenDirectionX = ref(localPreferredPosition.value?.x || POSITION.left);
21
19
 
22
20
  const isTop = computed(() => {
23
21
  if (localPosition.value.y !== POSITION.auto) {
@@ -45,7 +43,7 @@ export function useAutoPosition(anchorElement, targetElement, position, preferre
45
43
 
46
44
  const isRight = computed(() => {
47
45
  if (localPosition.value.x !== POSITION.auto) {
48
- return localPosition.value.y === POSITION.right;
46
+ return localPosition.value.x === POSITION.right;
49
47
  }
50
48
 
51
49
  return preferredOpenDirectionX.value === POSITION.right;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.256",
3
+ "version": "0.0.258",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -4,8 +4,8 @@ export default /*tw*/ {
4
4
  flex items-center justify-center
5
5
  text-base font-medium outline-none
6
6
  border border-solid transition
7
- focus:ring-{color}-700 focus:ring-opacity-20 focus:ring-dynamic focus:ring-offset-dynamic
8
- focus-within:ring-{color}-700 focus-within:ring-opacity-20 focus-within:ring-dynamic focus-within:ring-offset-dynamic
7
+ focus:ring-{color}-700/15 focus:ring-dynamic focus:ring-offset-dynamic
8
+ focus-within:ring-{color}-700/15 focus-within:ring-dynamic focus-within:ring-offset-dynamic
9
9
  disabled:ring-0 disabled:cursor-no-drop
10
10
  `,
11
11
  variants: {
@@ -43,8 +43,8 @@ export default /*tw*/ {
43
43
  `,
44
44
  },
45
45
  color: {
46
- grayscale: "focus:ring-gray-800 focus-within:ring-gray-800 disabled:text-gray-400",
47
- white: "focus:ring-gray-800 focus-within:ring-gray-800 disabled:text-gray-400",
46
+ grayscale: "focus:ring-gray-700/15 focus-within:ring-gray-700/15 disabled:text-gray-400",
47
+ white: "focus:ring-gray-800/15 focus-within:ring-gray-800/15 disabled:text-gray-400",
48
48
  },
49
49
  loading: {
50
50
  true: "pointer-events-none gap-0",
@@ -2,15 +2,15 @@ export default /*tw*/ {
2
2
  wrapper: {
3
3
  base: `
4
4
  w-fit inline-flex rounded transition focus-visible:outline-none
5
- focus-within:ring-dynamic focus-within:ring-offset-4 focus-within:ring-{color}-500 focus-within:ring-opacity-15
5
+ focus-within:ring-dynamic focus-within:ring-offset-4 focus-within:ring-{color}-500/15
6
6
  `,
7
7
  variants: {
8
8
  color: {
9
- grayscale: "focus-within:ring-gray-900/10",
10
- white: "focus-within:ring-white/10",
9
+ grayscale: "focus-within:ring-gray-700/15",
10
+ white: "focus-within:ring-white/15",
11
11
  },
12
12
  disabled: {
13
- true: "pointer-events-none opacity-70",
13
+ true: "pointer-events-none text-gray-400",
14
14
  },
15
15
  block: {
16
16
  true: "w-full",
@@ -4,7 +4,7 @@ export default /*tw*/ {
4
4
  base: `
5
5
  border-gray-300 font-normal
6
6
  hover:text-brand-600 hover:border-brand-600 hover:relative hover:z-10
7
- focus:text-brand-600 focus:border-brand-600 focus:relative focus:z-10 focus:ring-brand-600 focus-within:ring-brand-600
7
+ focus:text-brand-600 focus:border-brand-600 focus:relative focus:z-10 focus:ring-brand-700/15 focus-within:ring-brand-700/15
8
8
  active:text-brand-700 active:border-brand-700 active:relative active:z-10
9
9
  disabled:border-brand-300 disabled:z-0
10
10
  `,
@@ -44,7 +44,7 @@ export default /*tw*/ {
44
44
  timepicker: "mt-2 pl-1 pt-3 text-sm flex items-center justify-between gap-2 border-t border-brand-200",
45
45
  timepickerLabel: "w-full",
46
46
  timepickerInputWrapper: "flex items-center gap-px rounded-dynamic border border-brand-300",
47
- timepickerInput: " w-11 border-none px-2.5 py-1.5 text-center text-sm focus:ring-brand-500",
47
+ timepickerInput: " w-11 border-none px-2.5 py-1.5 text-center text-sm focus:ring-brand-700/15",
48
48
  timepickerLeftInput: "rounded-l-dynamic",
49
49
  timepickerRightInput: " rounded-r-dynamic",
50
50
  timepickerSubmitButton: "{UButton} py-2 border-0",
@@ -23,6 +23,7 @@ export default function useAttrs(props, { checkboxColor, checkboxSize }) {
23
23
  ...props,
24
24
  size: checkboxSize.value,
25
25
  label: Boolean(props.label),
26
+ error: Boolean(props.error),
26
27
  color: getColor(checkboxColor.value),
27
28
  }),
28
29
  checkboxColor.value,
@@ -1,9 +1,12 @@
1
1
  export default /*tw*/ {
2
2
  label: "{ULabel}",
3
- partialIconName: "remove",
4
- selectedIconName: "check",
5
- iconWrapper: {
6
- base: "flex items-center justify-center absolute rounded bg-{color}-500",
3
+ checkbox: {
4
+ base: `
5
+ border rounded bg-white cursor-pointer transition checked:text-{color}-600
6
+ border-gray-300 hover:border-gray-400 focus:border-{color}-500 active:border-{color}-800
7
+ focus:ring-{color}-700/15 focus:ring-dynamic focus:ring-offset-dynamic
8
+ disabled:border-gray-300 disabled:bg-gray-100
9
+ `,
7
10
  variants: {
8
11
  size: {
9
12
  sm: "size-4",
@@ -11,42 +14,35 @@ export default /*tw*/ {
11
14
  lg: "size-6",
12
15
  },
13
16
  color: {
14
- grayscale: "border-gray-900 bg-gray-900",
17
+ grayscale: "focus:ring-gray-700/15 focus:border-gray-500 active:border-gray-800 checked:text-gray-900",
18
+ },
19
+ error: {
20
+ true: "focus:ring-red-700/15 border-red-300 hover:border-red-400 focus:border-red-500 bg-red-50",
15
21
  },
16
22
  },
17
23
  },
18
- icon: "{UIcon}",
19
- checkbox: {
24
+ iconWrapper: {
20
25
  base: `
21
- border border-solid rounded border-gray-300 bg-white hover:transition
22
- hover:border-gray-400
23
- focus:border-{color}-500 focus:ring-dynamic focus:ring-opacity-20 focus-within:ring-offset-dynamic focus:ring-{color}-500
24
- active:border-{color}-500 active:bg-{color}-500
25
- checked:border-{color}-500 checked:bg-{color}-500 checked:text-{color}-500
26
- checked:hover:bg-{color}-500 checked:focus:text-{color}-500 checked:active:text-{color}-500
26
+ flex items-center justify-center absolute rounded cursor-pointer transition
27
+ bg-{color}-600 hover:bg-{color}-700 active:bg-{color}-800
27
28
  `,
28
29
  variants: {
29
30
  size: {
30
- sm: "size-4 text-xs",
31
- md: "size-5 text-sm",
32
- lg: "size-6 text-base",
31
+ sm: "size-4",
32
+ md: "size-5",
33
+ lg: "size-6",
33
34
  },
34
35
  color: {
35
- grayscale: `
36
- focus:border-gray-500 focus:ring-gray-500
37
- checked:border-gray-900 checked:bg-gray-900 checked:text-gray-900
38
- active:border-gray-900 active:bg-gray-900
39
- `,
36
+ grayscale: "border-gray-900 bg-gray-900",
40
37
  },
41
38
  disabled: {
42
- true: `
43
- border-gray-100 bg-gray-100 opacity-50
44
- hover:border-gray-100 hover:bg-gray-100 hover:opacity-50
45
- active:border-gray-100 active:bg-gray-100 active:opacity-50
46
- `,
39
+ true: "border-gray-400 bg-gray-400",
47
40
  },
48
41
  },
49
42
  },
43
+ icon: "{UIcon}",
44
+ partialIconName: "remove",
45
+ selectedIconName: "check",
50
46
  defaultVariants: {
51
47
  color: "brand",
52
48
  size: "md",
@@ -55,9 +51,12 @@ export default /*tw*/ {
55
51
  disabled: false,
56
52
  },
57
53
  safelist: (colors) => [
58
- { pattern: `bg-(${colors})-500`, variants: ["active", "checked", "checked:hover"] },
59
- { pattern: `border-(${colors})-500`, variants: ["focus", "active", "checked"] },
60
- { pattern: `text-(${colors})-500`, variants: ["checked:focus", "checked", "checked:active"] },
61
- { pattern: `ring-(${colors})-500`, variants: ["focus"] },
54
+ { pattern: `text-(${colors})-600` },
55
+ { pattern: `bg-(${colors})-600` },
56
+ { pattern: `bg-(${colors})-700`, variants: ["hover"] },
57
+ { pattern: `bg-(${colors})-800`, variants: ["active"] },
58
+ { pattern: `border-(${colors})-500`, variants: ["focus"] },
59
+ { pattern: `border-(${colors})-800`, variants: ["active"] },
60
+ { pattern: `ring-(${colors})-700`, variants: ["focus"] },
62
61
  ],
63
62
  };
@@ -3,11 +3,12 @@
3
3
  :for="id"
4
4
  :size="checkboxSize"
5
5
  :label="label"
6
- :description="description"
7
6
  :align="labelAlign"
8
7
  :disabled="disabled"
9
- :data-cy="dataCy"
8
+ :error="error"
9
+ :description="description"
10
10
  v-bind="labelAttrs"
11
+ :data-cy="`${dataCy}-label`"
11
12
  >
12
13
  <input
13
14
  :id="id"
@@ -19,6 +20,7 @@
19
20
  :checked="isChecked"
20
21
  :disabled="disabled"
21
22
  v-bind="checkboxAttrs"
23
+ :data-cy="dataCy"
22
24
  @change="onChange"
23
25
  />
24
26
 
@@ -117,6 +119,14 @@ const props = defineProps({
117
119
  default: "",
118
120
  },
119
121
 
122
+ /**
123
+ * Error message.
124
+ */
125
+ error: {
126
+ type: String,
127
+ default: "",
128
+ },
129
+
120
130
  /**
121
131
  * Label placement.
122
132
  * @values left, right
@@ -11,15 +11,15 @@ export default /*tw*/ {
11
11
  },
12
12
  },
13
13
  unselected: "relative flex",
14
- unselectedIcon: "{UIcon} absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",
14
+ unselectedIcon: "{UIcon} absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 rounded-full",
15
15
  unselectedIconName: "close",
16
16
  unselectedRadio: {
17
17
  component: "{URadio}",
18
- radio: "!text-white !border-gray-300 hover:!border-gray-400 focus:!border-gray-400 active:!border-gray-500",
18
+ radio: "checked:text-white !border-gray-400",
19
19
  },
20
20
  radio: {
21
21
  component: "{URadio}",
22
- radio: "bg-{color}-500 border-{color}-500 hover:border-{color}-500",
22
+ radio: "bg-{color}-500 border-{color}-500 hover:border-{color}-500 disabled:border-{color}-400 disabled:bg-{color}-400",
23
23
  },
24
24
  defaultVariants: {
25
25
  size: "md",
@@ -45,5 +45,10 @@ export default /*tw*/ {
45
45
  "rose",
46
46
  ],
47
47
  },
48
- safelist: (colors) => [{ pattern: `bg-(${colors})-500` }],
48
+ safelist: (colors) => [
49
+ { pattern: `bg-(${colors})-500` },
50
+ { pattern: `border-(${colors})-500` },
51
+ { pattern: `bg-(${colors})-400`, variants: ["disabled"] },
52
+ { pattern: `border-(${colors})-400`, variants: ["disabled"] },
53
+ ],
49
54
  };
@@ -3,15 +3,15 @@ export default /*tw*/ {
3
3
  input: "{UInput}",
4
4
  inputFocused: {
5
5
  component: "{UInput}",
6
- block: "ring-dynamic ring-offset-dynamic ring-brand-600/[.15] border-brand-500 hover:border-brand-500",
6
+ block: "ring-dynamic ring-offset-dynamic ring-brand-700/15 border-brand-500 hover:border-brand-500",
7
7
  },
8
8
  calendar: {
9
9
  component: "{UCalendar}",
10
10
  base: "absolute z-40 my-2",
11
11
  variants: {
12
12
  openDirectionX: {
13
- left: "left-0",
14
- right: "right-0",
13
+ left: "right-0",
14
+ right: "left-0",
15
15
  },
16
16
  openDirectionY: {
17
17
  top: "bottom-full mt-0",
@@ -3,11 +3,11 @@ export default /*tw*/ {
3
3
  input: "{UInput}",
4
4
  buttonWrapper: `
5
5
  flex rounded-dynamic max-md:justify-between
6
- focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-brand-700 focus-within:ring-opacity-20
6
+ focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-brand-700/15
7
7
  `,
8
8
  button: "{UButton} shrink-0 grow rounded-none",
9
9
  buttonActive: "",
10
- buttonWrapperActive: "ring-dynamic ring-offset-dynamic ring-brand-700 ring-opacity-20",
10
+ buttonWrapperActive: "ring-dynamic ring-offset-dynamic ring-brand-700/15",
11
11
  shiftRangeButton: `
12
12
  first:rounded-dynamic first:rounded-r-none
13
13
  last:rounded-dynamic last:rounded-l-none
@@ -18,8 +18,8 @@ export default /*tw*/ {
18
18
  base: "absolute z-40 my-2 w-80 overflow-hidden rounded-dynamic border border-brand-300 bg-white p-2 shadow focus:outline-none",
19
19
  variants: {
20
20
  openDirectionX: {
21
- left: "left-0",
22
- right: "right-0",
21
+ left: "right-0",
22
+ right: "left-0",
23
23
  },
24
24
  openDirectionY: {
25
25
  top: "bottom-full mt-0",
@@ -13,7 +13,7 @@ export default /*tw*/ {
13
13
  w-full bg-white !opacity-100 relative flex transition
14
14
  rounded-dynamic border border-solid border-gray-300
15
15
  hover:border-gray-400 hover:focus-within:border-brand-500
16
- focus-within:border-brand-500 focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-brand-600/[.15]
16
+ focus-within:border-brand-500 focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-brand-700/15
17
17
  `,
18
18
  variants: {
19
19
  disabled: {
@@ -26,7 +26,7 @@ export default /*tw*/ {
26
26
  true: `
27
27
  border-red-300
28
28
  hover:border-red-400 hover:focus-within:border-red-500
29
- focus-within:border-red-500 focus-within:ring-red-100
29
+ focus-within:border-red-500 focus-within:ring-red-700/15
30
30
  `,
31
31
  },
32
32
  },
@@ -48,8 +48,8 @@ export default /*tw*/ {
48
48
  },
49
49
  error: {
50
50
  true: `
51
- bg-red-50 hover:border-red-400 focus:border-red-500 focus:ring-red-100
52
- focus-within:border-red-500 focus-within:ring-red-100
51
+ bg-red-50 hover:border-red-400 focus:border-red-500 focus:ring-red-700/15
52
+ focus-within:border-red-500 focus-within:ring-red-700/15
53
53
  `,
54
54
  },
55
55
  },
@@ -9,8 +9,8 @@ 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",
12
+ disabled: {
13
+ true: "cursor-not-allowed",
14
14
  },
15
15
  },
16
16
  compoundVariants: [
@@ -24,6 +24,14 @@ export default /*tw*/ {
24
24
  { align: "right", centred: true, class: "items-center w-auto" },
25
25
  ],
26
26
  },
27
+ content: {
28
+ base: "flex",
29
+ variants: {
30
+ disabled: {
31
+ true: "pointer-events-none",
32
+ },
33
+ },
34
+ },
27
35
  labelWrapper: "",
28
36
  label: {
29
37
  base: "text-gray-900 z-10 block !leading-none w-max",
@@ -44,7 +52,7 @@ export default /*tw*/ {
44
52
  true: "text-red-500",
45
53
  },
46
54
  disabled: {
47
- true: "text-gray-900 opacity-50",
55
+ true: "text-gray-500 pointer-events-none",
48
56
  },
49
57
  },
50
58
  compoundVariants: [
@@ -5,8 +5,10 @@
5
5
  v-bind="wrapperAttrs"
6
6
  @click="onClick"
7
7
  >
8
- <!-- @slot Use it to wrap something into the label. -->
9
- <slot />
8
+ <div v-bind="contentAttrs">
9
+ <!-- @slot Use it to wrap something into the label. -->
10
+ <slot />
11
+ </div>
10
12
 
11
13
  <div v-if="label || error || description" v-bind="labelWrapperAttrs">
12
14
  <label
@@ -165,7 +167,8 @@ const props = defineProps({
165
167
  const labelRef = ref(null);
166
168
  const wrapperRef = ref(null);
167
169
 
168
- const { wrapperAttrs, labelWrapperAttrs, labelAttrs, descriptionAttrs } = useAttrs(props);
170
+ const { wrapperAttrs, contentAttrs, labelWrapperAttrs, labelAttrs, descriptionAttrs } =
171
+ useAttrs(props);
169
172
 
170
173
  const isHorizontalPlacement = computed(
171
174
  () => props.align === PLACEMENT.left || props.align === PLACEMENT.right,
@@ -21,8 +21,10 @@ export default function useAttrs(props, { radioColor, radioSize }) {
21
21
  return setColor(
22
22
  cva(value)({
23
23
  ...props,
24
- color: getColor(radioColor.value),
25
24
  size: radioSize.value,
25
+ label: Boolean(props.label),
26
+ error: Boolean(props.error),
27
+ color: getColor(radioColor.value),
26
28
  }),
27
29
  radioColor.value,
28
30
  );
@@ -2,14 +2,11 @@ export default /*tw*/ {
2
2
  label: "{ULabel}",
3
3
  radio: {
4
4
  base: `
5
- cursor-pointer
6
- transition duration-100 ease-in-out
7
- border border-solid border-{color}-300 text-{color}-500
8
- hover:border-{color}-400
9
- active:border-{color}-500
10
- focus:border-{color}-500 focus:bg-{color}-500
11
- focus:ring-{color}-200 focus:ring-dynamic focus-within:ring-offset-dynamic
12
- disabled:border-{color}-100 disabled:bg-{color}-100
5
+ border cursor-pointer transition checked:text-{color}-600
6
+ border-gray-300 hover:border-gray-400 focus:border-{color}-500 active:border-{color}-800
7
+ focus:ring-{color}-700/15 focus:ring-dynamic focus:ring-offset-dynamic
8
+ disabled:border-gray-300 disabled:text-gray-100
9
+ checked:disabled:border-gray-400 checked:disabled:text-gray-400
13
10
  `,
14
11
  variants: {
15
12
  size: {
@@ -17,35 +14,22 @@ export default /*tw*/ {
17
14
  md: "size-5",
18
15
  lg: "size-6",
19
16
  },
20
- },
21
- compoundVariants: [
22
- {
23
- color: "grayscale",
24
- class: `
25
- border-gray-300 text-gray-900
26
- hover:border-gray-400
27
- active:border-gray-500
28
- focus:border-gray-500 focus:bg-gray-900 focus:ring-gray-200
29
- disabled:border-gray-100 disabled:bg-gray-100
30
- `,
17
+ color: {
18
+ grayscale: "focus:ring-gray-700/15 focus:border-gray-500 active:border-gray-800 checked:text-gray-900",
31
19
  },
32
- ],
20
+ },
33
21
  },
34
22
  defaultVariants: {
35
- size: "md",
36
23
  color: "brand",
37
24
  labelAlign: "right",
38
- disabled: false,
25
+ size: "md",
39
26
  checked: false,
27
+ disabled: false,
40
28
  },
41
29
  safelist: (colors) => [
42
- { pattern: `border-(${colors})-100`, variants: ["disabled"] },
43
- { pattern: `border-(${colors})-300` },
44
- { pattern: `border-(${colors})-400`, variants: ["hover"] },
45
- { pattern: `border-(${colors})-500`, variants: ["focus", "active"] },
46
- { pattern: `text-(${colors})-500` },
47
- { pattern: `ring-(${colors})-200`, variants: ["focus"] },
48
- { pattern: `bg-(${colors})-100`, variants: ["disabled"] },
49
- { pattern: `bg-(${colors})-500`, variants: ["focus"] },
30
+ { pattern: `text-(${colors})-600` },
31
+ { pattern: `border-(${colors})-500`, variants: ["focus"] },
32
+ { pattern: `border-(${colors})-800`, variants: ["active"] },
33
+ { pattern: `ring-(${colors})-700`, variants: ["focus"] },
50
34
  ],
51
35
  };
@@ -4,10 +4,11 @@
4
4
  :label="label"
5
5
  :size="radioSize"
6
6
  :align="labelAlign"
7
+ :error="error"
7
8
  :description="description"
8
9
  :disabled="disabled"
9
- :data-cy="dataCy"
10
10
  v-bind="labelAttrs"
11
+ :data-cy="`${dataCy}-label`"
11
12
  >
12
13
  <input
13
14
  :id="id"
@@ -16,8 +17,8 @@
16
17
  :name="radioName"
17
18
  :value="radioValue"
18
19
  :checked="checked || isChecked"
19
- :data-cy="dataCy"
20
20
  v-bind="radioAttrs"
21
+ :data-cy="dataCy"
21
22
  @change="onChange"
22
23
  />
23
24
 
@@ -73,6 +74,15 @@ const props = defineProps({
73
74
  default: "",
74
75
  },
75
76
 
77
+ /**
78
+ * Label placement.
79
+ * @values left, right
80
+ */
81
+ labelAlign: {
82
+ type: String,
83
+ default: UIService.get(defaultConfig, URadio).default.labelAlign,
84
+ },
85
+
76
86
  /**
77
87
  * Radio description.
78
88
  */
@@ -81,6 +91,14 @@ const props = defineProps({
81
91
  default: "",
82
92
  },
83
93
 
94
+ /**
95
+ * Error message.
96
+ */
97
+ error: {
98
+ type: String,
99
+ default: "",
100
+ },
101
+
84
102
  /**
85
103
  * Radio name.
86
104
  */
@@ -107,15 +125,6 @@ const props = defineProps({
107
125
  default: UIService.get(defaultConfig, URadio).default.color,
108
126
  },
109
127
 
110
- /**
111
- * Label placement.
112
- * @values left, right
113
- */
114
- labelAlign: {
115
- type: String,
116
- default: UIService.get(defaultConfig, URadio).default.labelAlign,
117
- },
118
-
119
128
  /**
120
129
  * Set radio disabled.
121
130
  */
@@ -7,14 +7,14 @@ export default /*tw*/ {
7
7
  py-2 flex flex-row-reverse justify-between w-full min-h-full box-border relative
8
8
  rounded-dynamic border border-gray-300 bg-white
9
9
  hover:border-gray-400 hover:transition hover:focus-within:border-brand-500
10
- focus-within:ring-brand-600/[.15] focus-within:ring-dynamic focus-within:ring-offset-dynamic
10
+ focus-within:ring-brand-700/15 focus-within:ring-dynamic focus-within:ring-offset-dynamic
11
11
  focus-within:border-brand-500 focus-within:outline-none
12
12
  `,
13
13
  variants: {
14
14
  error: {
15
15
  true: `
16
16
  bg-red-50 border-red-300 hover:border-red-300
17
- focus-within:border-red-500 focus-within:ring-red-100
17
+ focus-within:border-red-500 focus-within:ring-red-700/15
18
18
  `,
19
19
  },
20
20
  disabled: {
@@ -3,12 +3,12 @@ export default /*tw*/ {
3
3
  wrapper: {
4
4
  base: `
5
5
  flex items-center p-0.5 relative rounded-3xl cursor-pointer transition
6
- ring-opacity-10 focus-within:ring-dynamic focus-within:ring-offset-dynamic
6
+ focus-within:ring-dynamic focus-within:ring-offset-dynamic
7
7
  `,
8
8
  variants: {
9
9
  checked: {
10
- true: "bg-{color}-500 ring-{color}-700 hover:bg-{color}-600 active:bg-{color}-700",
11
- false: "bg-gray-300 ring-gray-700 hover:bg-gray-400 active:bg-gray-500",
10
+ true: "bg-{color}-600 ring-{color}-700/15 hover:bg-{color}-700 active:bg-{color}-800",
11
+ false: "bg-gray-300 ring-gray-700/15 hover:bg-gray-400 active:bg-gray-500",
12
12
  },
13
13
  size: {
14
14
  sm: "w-6",
@@ -22,7 +22,7 @@ export default /*tw*/ {
22
22
  { toggleLabel: true, size: "lg", class: "w-14" },
23
23
  { disabled: true, checked: true, class: "bg-opacity-50 pointer-events-none" },
24
24
  { disabled: true, checked: false, class: "bg-opacity-50 pointer-events-none" },
25
- { color: "grayscale", checked: true, class: "bg-gray-800 ring-gray-800" },
25
+ { color: "grayscale", checked: true, class: "bg-gray-900 ring-gray-700/15" },
26
26
  ],
27
27
  },
28
28
  input: "absolute size-0 opacity-0",
@@ -49,7 +49,7 @@ export default /*tw*/ {
49
49
  compoundVariants: [
50
50
  { toggleLabel: true, checked: true, class: "w-1/2 left-1" },
51
51
  { toggleLabel: true, checked: false, class: "w-1/2 right-1" },
52
- { toggleLabel: false, checked: true, class: "bg-{color}-500 hover:bg-{color}-600 active:bg-{color}-700" },
52
+ { toggleLabel: false, checked: true, class: "bg-{color}-600 hover:bg-{color}-700 active:bg-{color}-800" },
53
53
  { toggleLabel: false, checked: false, class: "bg-gray-300 hover:bg-gray-400 active:bg-gray-500" },
54
54
  { toggleLabel: false, color: "grayscale", class: "bg-gray-700 hover:bg-gray-800 active:bg-gray-900" },
55
55
  ],
@@ -68,8 +68,8 @@ export default /*tw*/ {
68
68
  },
69
69
  safelist: (colors) => [
70
70
  { pattern: `ring-(${colors})-700` },
71
- { pattern: `bg-(${colors})-500` },
72
- { pattern: `bg-(${colors})-600`, variants: ["hover"] },
73
- { pattern: `bg-(${colors})-700`, variants: ["active"] },
71
+ { pattern: `bg-(${colors})-600` },
72
+ { pattern: `bg-(${colors})-700`, variants: ["hover"] },
73
+ { pattern: `bg-(${colors})-800`, variants: ["active"] },
74
74
  ],
75
75
  };
@@ -6,7 +6,7 @@ export default /*tw*/ {
6
6
  base: `
7
7
  px-3 py-2 rounded-dynamic border border-gray-300 cursor-text bg-white transition
8
8
  hover:border-gray-400 hover:focus-within:border-gray-500
9
- focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-gray-600/[.15]
9
+ focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-gray-700/15
10
10
  focus-within:border-gray-500 focus-within:outline-none
11
11
  `,
12
12
  variants: {
@@ -14,7 +14,7 @@ export default /*tw*/ {
14
14
  true: `
15
15
  bg-red-50 border-red-300
16
16
  hover:border-red-400 hover:focus-within:border-red-500
17
- focus-within:border-red-500 focus-within:ring-red-100
17
+ focus-within:border-red-500 focus-within:ring-red-700/15
18
18
  `,
19
19
  },
20
20
  disabled: {
@@ -8,7 +8,7 @@ export default /*tw*/ {
8
8
  lg: "text-base",
9
9
  },
10
10
  disabled: {
11
- true: "text-gray-500",
11
+ true: "text-gray-500 cursor-not-allowed",
12
12
  },
13
13
  selected: {
14
14
  true: "border-b-2 border-gray-900",
@@ -1,6 +1,6 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
- base: "mb-6 flex space-x-8",
3
+ base: "mb-6 flex gap-8",
4
4
  variants: {
5
5
  underlined: {
6
6
  true: "border-b border-gray-100",
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.256",
4
+ "version": "0.0.258",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",
@@ -1302,6 +1302,15 @@
1302
1302
  },
1303
1303
  "default": "\"\""
1304
1304
  },
1305
+ {
1306
+ "name": "error",
1307
+ "description": "Error message.",
1308
+ "value": {
1309
+ "kind": "expression",
1310
+ "type": "string"
1311
+ },
1312
+ "default": "\"\""
1313
+ },
1305
1314
  {
1306
1315
  "name": "labelAlign",
1307
1316
  "description": "Label placement.",
@@ -6496,6 +6505,15 @@
6496
6505
  },
6497
6506
  "default": "\"\""
6498
6507
  },
6508
+ {
6509
+ "name": "labelAlign",
6510
+ "description": "Label placement.",
6511
+ "value": {
6512
+ "kind": "expression",
6513
+ "type": "'left' | 'right'"
6514
+ },
6515
+ "default": "right"
6516
+ },
6499
6517
  {
6500
6518
  "name": "description",
6501
6519
  "description": "Radio description.",
@@ -6505,6 +6523,15 @@
6505
6523
  },
6506
6524
  "default": "\"\""
6507
6525
  },
6526
+ {
6527
+ "name": "error",
6528
+ "description": "Error message.",
6529
+ "value": {
6530
+ "kind": "expression",
6531
+ "type": "string"
6532
+ },
6533
+ "default": "\"\""
6534
+ },
6508
6535
  {
6509
6536
  "name": "name",
6510
6537
  "description": "Radio name.",
@@ -6532,15 +6559,6 @@
6532
6559
  },
6533
6560
  "default": "brand"
6534
6561
  },
6535
- {
6536
- "name": "labelAlign",
6537
- "description": "Label placement.",
6538
- "value": {
6539
- "kind": "expression",
6540
- "type": "'left' | 'right'"
6541
- },
6542
- "default": "right"
6543
- },
6544
6562
  {
6545
6563
  "name": "disabled",
6546
6564
  "description": "Set radio disabled.",