vueless 0.0.257 → 0.0.259

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 (32) hide show
  1. package/composable.ui/index.js +1 -1
  2. package/package.json +1 -1
  3. package/ui.button/configs/default.config.js +13 -18
  4. package/ui.button-link/configs/default.config.js +17 -9
  5. package/ui.button-toggle/configs/default.config.js +4 -2
  6. package/ui.button-toggle-item/configs/default.config.js +5 -8
  7. package/ui.button-toggle-item/index.vue +3 -2
  8. package/ui.container-modal/configs/default.config.js +1 -1
  9. package/ui.data-list/configs/default.config.js +1 -1
  10. package/ui.form-calendar/configs/default.config.js +1 -1
  11. package/ui.form-checkbox/composables/attrs.composable.js +1 -0
  12. package/ui.form-checkbox/configs/default.config.js +29 -30
  13. package/ui.form-checkbox/index.vue +12 -2
  14. package/ui.form-color-picker/configs/default.config.js +9 -4
  15. package/ui.form-date-picker/configs/default.config.js +1 -1
  16. package/ui.form-date-picker-range/configs/default.config.js +3 -3
  17. package/ui.form-date-picker-range/index.vue +6 -6
  18. package/ui.form-input/configs/default.config.js +4 -4
  19. package/ui.form-input-search/configs/default.config.js +2 -9
  20. package/ui.form-input-search/index.vue +11 -0
  21. package/ui.form-label/configs/default.config.js +11 -3
  22. package/ui.form-label/index.vue +6 -3
  23. package/ui.form-radio/composables/attrs.composable.js +3 -1
  24. package/ui.form-radio/configs/default.config.js +14 -30
  25. package/ui.form-radio/index.vue +20 -11
  26. package/ui.form-select/configs/default.config.js +2 -2
  27. package/ui.form-switch/configs/default.config.js +10 -10
  28. package/ui.form-textarea/configs/default.config.js +2 -2
  29. package/ui.image-icon/configs/default.config.js +1 -1
  30. package/ui.navigation-tab/configs/default.config.js +1 -1
  31. package/ui.navigation-tabs/configs/default.config.js +1 -1
  32. package/web-types.json +28 -10
@@ -89,7 +89,7 @@ export default function useUI(defaultConfig = {}, propsConfigGetter = null, topL
89
89
  const isTopLevelClassKey = configKey === (topLevelClassKey || firstClassKey);
90
90
  const attrClass = isTopLevelClassKey && !nestedComponent ? attrs.class : "";
91
91
 
92
- // TODO: remove `getBaseClasses(configKeyValue)` after migration to `setDynamicVars`
92
+ // TODO: remove `getBaseClasses(configKeyValue)` after migration of all composables to the new logic
93
93
  vuelessAttrs.value = {
94
94
  ...commonAttrs,
95
95
  class: cx([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.257",
3
+ "version": "0.0.259",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -4,9 +4,9 @@ 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
9
- disabled:ring-0 disabled:cursor-no-drop
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
+ disabled:ring-0 disabled:cursor-not-allowed
10
10
  `,
11
11
  variants: {
12
12
  size: {
@@ -36,15 +36,15 @@ export default /*tw*/ {
36
36
  thirdary: `
37
37
  border-transparent
38
38
  text-{color}-600
39
- hover:text-{color}-700 hover:bg-{color}-700 hover:bg-opacity-10
40
- focus:text-{color}-700 focus:bg-{color}-700 focus:bg-opacity-10
41
- active:text-{color}-800 active:bg-{color}-800 active:bg-opacity-15
39
+ hover:text-{color}-700 hover:bg-{color}-700/10
40
+ focus:text-{color}-700 focus:bg-{color}-700/10
41
+ active:text-{color}-800 active:bg-{color}-800/15
42
42
  disabled:text-{color}-300
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-700/15 focus-within:ring-gray-700/15 disabled:text-gray-400",
48
48
  },
49
49
  loading: {
50
50
  true: "pointer-events-none gap-0",
@@ -88,9 +88,9 @@ export default /*tw*/ {
88
88
  variant: "thirdary",
89
89
  class: `
90
90
  text-gray-900
91
- hover:text-gray-800 hover:bg-gray-800
92
- focus:text-gray-800 focus:bg-gray-800
93
- active:text-gray-700 active:bg-gray-700
91
+ hover:text-gray-800 hover:bg-gray-800/15
92
+ focus:text-gray-800 focus:bg-gray-800/15
93
+ active:text-gray-700 active:bg-gray-700/20
94
94
  disabled:bg-transparent
95
95
  `,
96
96
  },
@@ -125,13 +125,8 @@ export default /*tw*/ {
125
125
  disabled:bg-transparent
126
126
  `,
127
127
  },
128
- { filled: true, variant: "thirdary", class: "bg-{color}-700 bg-opacity-10" },
129
- {
130
- filled: true,
131
- variant: "thirdary",
132
- color: "grayscale",
133
- class: "bg-gray-800 bg-opacity-10 hover:bg-opacity-15 focus:bg-opacity-15 active:bg-opacity-20",
134
- },
128
+ { filled: true, variant: "thirdary", class: "bg-{color}-700/10" },
129
+ { filled: true, variant: "thirdary", color: "grayscale", class: "bg-gray-900/10" },
135
130
  { filled: true, variant: "thirdary", color: "white", class: "bg-gray-50" },
136
131
  { iconLeft: true, size: "2xs", class: "pl-1" },
137
132
  { iconLeft: true, size: "xs", class: "pl-2" },
@@ -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}-700/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: "focus-within:ring-0 cursor-not-allowed",
14
14
  },
15
15
  block: {
16
16
  true: "w-full",
@@ -23,10 +23,10 @@ export default /*tw*/ {
23
23
  link: {
24
24
  base: `
25
25
  w-full inline-block cursor-pointer !leading-none transition
26
- text-{color}-500 decoration-{color}-500 underline-offset-4
27
- hover:text-opacity-80
28
- active:text-opacity-70
29
- focus:ring-0 focus:ring-offset-0
26
+ text-{color}-600 decoration-{color}-600 underline-offset-4
27
+ hover:text-{color}-700 hover:decoration-{color}-700
28
+ focus:text-{color}-700 focus:decoration-{color}-700 focus:ring-0 focus:ring-offset-0
29
+ active:text-{color}-800 active:decoration-{color}-800
30
30
  `,
31
31
  variants: {
32
32
  size: {
@@ -40,12 +40,20 @@ export default /*tw*/ {
40
40
  false: "no-underline",
41
41
  },
42
42
  color: {
43
- grayscale: "decoration-gray-900 text-gray-900",
43
+ grayscale: `
44
+ text-gray-900 decoration-gray-900
45
+ hover:text-gray-800 hover:decoration-gray-800
46
+ focus:text-gray-800 focus:decoration-gray-800
47
+ active:text-gray-700 active:decoration-gray-700
48
+ `,
44
49
  white: "decoration-white text-white",
45
50
  },
46
51
  dashed: {
47
52
  true: "hover:decoration-dashed decoration-dashed",
48
53
  },
54
+ disabled: {
55
+ true: "text-gray-400 pointer-events-none",
56
+ },
49
57
  },
50
58
  },
51
59
  text: "w-full",
@@ -9,7 +9,7 @@ export default /*tw*/ {
9
9
  },
10
10
  },
11
11
  items: {
12
- base: "flex flex-wrap",
12
+ base: "",
13
13
  variants: {
14
14
  size: {
15
15
  "2xs": "gap-1",
@@ -20,12 +20,14 @@ export default /*tw*/ {
20
20
  xl: "gap-3",
21
21
  },
22
22
  separated: {
23
+ true: "flex flex-wrap",
23
24
  false: `
24
- flex-nowrap -space-x-px gap-0
25
+ flex flex-nowrap -space-x-px gap-0 rounded-dynamic transition w-fit
25
26
  [&>:first-child]:rounded-dynamic [&>:first-child]:rounded-r-none
26
27
  [&>:last-child]:rounded-dynamic [&>:last-child]:rounded-l-none
27
28
  [&>:first-child>*>*]:rounded-dynamic [&>:first-child>*>*]:rounded-r-none
28
29
  [&>:last-child>*>*]:rounded-dynamic [&>:last-child>*>*]:rounded-l-none
30
+ focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-brand-700/15
29
31
  `,
30
32
  },
31
33
  },
@@ -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
  `,
@@ -14,11 +14,8 @@ export default /*tw*/ {
14
14
  },
15
15
  variant: {
16
16
  thirdary: `
17
- !text-gray-900 bg-brand-600
18
- border-transparent bg-opacity-10
19
- hover:border-transparent hover:bg-opacity-15
20
- focus:border-transparent focus:bg-opacity-15
21
- active:border-transparent active:bg-opacity-20
17
+ !text-gray-900 !border-transparent bg-brand-600/10
18
+ hover:bg-brand-600/15 focus:bg-brand-600/15 active:bg-brand-600/20
22
19
  `,
23
20
  },
24
21
  },
@@ -35,12 +32,12 @@ export default /*tw*/ {
35
32
  {
36
33
  selected: true,
37
34
  variant: "secondary",
38
- class: "text-brand-600 border-brand-600 disabled:border-brand-600 bg-brand-600 bg-opacity-10",
35
+ class: "text-brand-600 border-brand-600 disabled:border-brand-600 bg-brand-600/10",
39
36
  },
40
37
  {
41
38
  selected: true,
42
39
  variant: "thirdary",
43
- class: "bg-brand-600 bg-opacity-20 hover:bg-opacity-20 focus:bg-opacity-20",
40
+ class: "!bg-brand-600/20",
44
41
  },
45
42
  ],
46
43
  },
@@ -2,6 +2,7 @@
2
2
  <UButton
3
3
  tabindex="0"
4
4
  :for="id"
5
+ :no-ring="!getToggleSeparated()"
5
6
  color="grayscale"
6
7
  variant="secondary"
7
8
  :label="label"
@@ -157,8 +158,8 @@ onMounted(() => {
157
158
  });
158
159
 
159
160
  function onClickSetValue() {
160
- selectedItem.value = getToggleType() === TYPE_RADIO
161
- ? props.value
161
+ selectedItem.value = getToggleType() === TYPE_RADIO
162
+ ? props.value
162
163
  : selectedValue?.value?.includes(props.value) || selectedItem.value;
163
164
 
164
165
  updateSelectedValue && updateSelectedValue(props.value, !selectedItem.value);
@@ -8,7 +8,7 @@ export default /*tw*/ {
8
8
  leaveFromClass: "opacity-100 translate-y-0 transform sm:scale-100",
9
9
  leaveToClass: "opacity-0 translate-y-4 sm:translate-y-0 transform sm:scale-95",
10
10
  },
11
- overlay: "fixed inset-0 z-40 bg-gray-900 bg-opacity-75",
11
+ overlay: "fixed inset-0 z-40 bg-gray-900/75",
12
12
  overlayTransition: {
13
13
  enterActiveClass: "ease-out duration-300",
14
14
  enterFromClass: "opacity-0",
@@ -2,7 +2,7 @@ export default /*tw*/ {
2
2
  wrapper: "",
3
3
  draggable: "",
4
4
  draggableDrag: "bg-gray-100",
5
- draggableGhost: "bg-opacity-50",
5
+ draggableGhost: "bg-gray-100/50",
6
6
  itemWrapper: "group/item-wrapper",
7
7
  item: `
8
8
  group/item
@@ -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,7 +3,7 @@ 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}",
@@ -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
@@ -37,7 +37,7 @@ export default /*tw*/ {
37
37
  periodsRow: "mb-1 flex min-w-64 gap-1",
38
38
  periodButton: "{UButton} h-[3.125rem] w-full",
39
39
  periodButtonIconName: "apps",
40
- periodButtonActive: "!bg-opacity-20",
40
+ periodButtonActive: "!bg-gray-800/20",
41
41
  rangeSwitchWrapper: "flex items-center justify-between py-2",
42
42
  rangeSwitchButton: "{UButton}",
43
43
  rangeSwitchTitle: "font-medium text-sm",
@@ -856,19 +856,19 @@ function onClickShiftDatesList(action) {
856
856
  }
857
857
 
858
858
  function getPeriodButtonsClasses(periodName) {
859
- return period.value === periodName ? [config.value.periodButtonActive] : [];
859
+ return period.value === periodName ? config.value.periodButtonActive : "";
860
860
  }
861
861
 
862
862
  function getPeriodDateClasses(date) {
863
- return localValue.value.from === date.startRange ? [config.value.periodDateActive] : [];
863
+ return localValue.value.from === date.startRange ? config.value.periodDateActive : "";
864
864
  }
865
865
 
866
866
  function getPeriodDateListClasses() {
867
867
  if (isPeriod.value.ownRange) return [];
868
- if (isPeriod.value.week) return [config.value.periodDateWeekList];
869
- if (isPeriod.value.month) return [config.value.periodDateMonthList];
870
- if (isPeriod.value.quarter) return [config.value.periodDateQuarterList];
871
- if (isPeriod.value.year) return [config.value.periodDateYearList];
868
+ if (isPeriod.value.week) return config.value.periodDateWeekList;
869
+ if (isPeriod.value.month) return config.value.periodDateMonthList;
870
+ if (isPeriod.value.quarter) return config.value.periodDateQuarterList;
871
+ if (isPeriod.value.year) return config.value.periodDateYearList;
872
872
  }
873
873
 
874
874
  function activate() {
@@ -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
  },
@@ -1,13 +1,6 @@
1
1
  export default /*tw*/ {
2
- input: {
3
- component: "{UInput}",
4
- wrapper: "relative flex items-center justify-between w-full rounded-dynamic bg-gray-900 bg-opacity-5",
5
- input: "w-full",
6
- label: "w-full",
7
- rightSlot: "pr-0",
8
- leftSlot: "pl-0",
9
- },
10
- clearIcon: "{UIcon} flex h-full items-center",
2
+ input: "{UInput}",
3
+ clearIcon: "{UIcon}",
11
4
  clearIconName: "close",
12
5
  searchIcon: "{UIcon}",
13
6
  searchIconName: "search",
@@ -64,6 +64,7 @@
64
64
  <UButton
65
65
  v-if="searchButtonLabel"
66
66
  :label="searchButtonLabel"
67
+ :size="buttonSize"
67
68
  no-ring
68
69
  v-bind="buttonAttrs"
69
70
  :data-cy="`${dataCy}-right`"
@@ -237,6 +238,16 @@ const iconSize = computed(() => {
237
238
  return sizes[props.size];
238
239
  });
239
240
 
241
+ const buttonSize = computed(() => {
242
+ const sizes = {
243
+ sm: "xs",
244
+ md: "md",
245
+ lg: "lg",
246
+ };
247
+
248
+ return sizes[props.size];
249
+ });
250
+
240
251
  function onClickClear() {
241
252
  search.value = "";
242
253
  emit("clear");
@@ -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",
@@ -20,9 +20,9 @@ export default /*tw*/ {
20
20
  { toggleLabel: true, size: "sm", class: "w-10" },
21
21
  { toggleLabel: true, size: "md", class: "w-12" },
22
22
  { toggleLabel: true, size: "lg", class: "w-14" },
23
- { disabled: true, checked: true, class: "bg-opacity-50 pointer-events-none" },
24
- { disabled: true, checked: false, class: "bg-opacity-50 pointer-events-none" },
25
- { color: "grayscale", checked: true, class: "bg-gray-800 ring-gray-800" },
23
+ { disabled: true, checked: false, class: "bg-gray-300" },
24
+ { disabled: true, checked: true, class: "bg-gray-400" },
25
+ { color: "grayscale", disabled: false, 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: {
@@ -3,7 +3,7 @@ export default /*tw*/ {
3
3
  base: "",
4
4
  variants: {
5
5
  pill: {
6
- true: "rounded-full bg-{color}-500 bg-opacity-5",
6
+ true: "rounded-full bg-{color}-500/5",
7
7
  },
8
8
  },
9
9
  compoundVariants: [
@@ -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.257",
4
+ "version": "0.0.259",
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.",