vueless 0.0.714 → 0.0.716
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/bin/constants.js +1 -3
- package/constants.js +4 -7
- package/package.json +1 -1
- package/preset-tailwind.js +10 -15
- package/types.ts +9 -20
- package/ui.button/config.ts +4 -4
- package/ui.button-link/config.ts +3 -3
- package/ui.button-toggle-item/config.ts +1 -1
- package/ui.dropdown-link/config.ts +5 -5
- package/ui.dropdown-list/config.ts +11 -3
- package/ui.form-calendar/config.ts +6 -2
- package/ui.form-checkbox/config.ts +3 -3
- package/ui.form-date-picker/config.ts +2 -2
- package/ui.form-date-picker-range/config.ts +3 -3
- package/ui.form-input/config.ts +3 -3
- package/ui.form-input-file/config.ts +2 -2
- package/ui.form-radio/config.ts +2 -2
- package/ui.form-select/USelect.vue +2 -7
- package/ui.form-select/config.ts +9 -12
- package/ui.form-switch/config.ts +2 -2
- package/ui.form-textarea/config.ts +5 -6
- package/ui.text-badge/config.ts +3 -3
- package/utils/theme.ts +26 -55
package/bin/constants.js
CHANGED
package/constants.js
CHANGED
|
@@ -17,11 +17,9 @@ export const COLOR_MODE_KEY = "vl-color-mode";
|
|
|
17
17
|
/* Vueless defaults */
|
|
18
18
|
export const DEFAULT_BRAND_COLOR = GRAYSCALE_COLOR;
|
|
19
19
|
export const DEFAULT_GRAY_COLOR = COOL_COLOR;
|
|
20
|
-
export const
|
|
21
|
-
export const
|
|
22
|
-
export const
|
|
23
|
-
export const DEFAULT_RING_OFFSET_COLOR_LIGHT = "#ffffff"; // white
|
|
24
|
-
export const DEFAULT_RING_OFFSET_COLOR_DARK = "#111827"; // gray-900
|
|
20
|
+
export const DEFAULT_OUTLINE = 2; /* pixels */
|
|
21
|
+
export const OUTLINE_DECREMENT = 1; /* pixels */
|
|
22
|
+
export const OUTLINE_INCREMENT = 1; /* pixels */
|
|
25
23
|
export const DEFAULT_ROUNDING = 8; /* pixels */
|
|
26
24
|
export const ROUNDING_DECREMENT = 4; /* pixels */
|
|
27
25
|
export const ROUNDING_INCREMENT = 6; /* pixels */
|
|
@@ -173,8 +171,7 @@ export const TAILWIND_MERGE_EXTENSION = {
|
|
|
173
171
|
spacing: ["safe-top", "safe-bottom", "safe-left", "safe-right"],
|
|
174
172
|
},
|
|
175
173
|
classGroups: {
|
|
176
|
-
"
|
|
177
|
-
"ring-offset-color": [{ "ring-offset": ["color-dynamic"] }],
|
|
174
|
+
"outline-w": [{ outline: ["dynamic", "dynamic-sm", "dynamic-lg"] }],
|
|
178
175
|
"font-size": [{ text: ["2xs"] }],
|
|
179
176
|
rounded: [{ rounded: ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
|
|
180
177
|
"rounded-s": [{ "rounded-s": ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
|
package/package.json
CHANGED
package/preset-tailwind.js
CHANGED
|
@@ -12,15 +12,14 @@ import {
|
|
|
12
12
|
DARK_MODE_SELECTOR,
|
|
13
13
|
TAILWIND_COLORS,
|
|
14
14
|
DEFAULT_ROUNDING,
|
|
15
|
-
|
|
16
|
-
DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
15
|
+
DEFAULT_OUTLINE,
|
|
17
16
|
DEFAULT_BRAND_COLOR,
|
|
18
17
|
DEFAULT_GRAY_COLOR,
|
|
19
18
|
GRAYSCALE_COLOR,
|
|
20
19
|
ROUNDING_DECREMENT,
|
|
21
20
|
ROUNDING_INCREMENT,
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
OUTLINE_INCREMENT,
|
|
22
|
+
OUTLINE_DECREMENT,
|
|
24
23
|
} from "./constants.js";
|
|
25
24
|
|
|
26
25
|
const globalSettings = process.env.VUELESS_GLOBAL_SETTINGS || {};
|
|
@@ -95,22 +94,18 @@ export const vuelessTailwindConfig = {
|
|
|
95
94
|
dynamic: "var(--vl-rounding)",
|
|
96
95
|
"dynamic-lg": "var(--vl-rounding-lg)",
|
|
97
96
|
},
|
|
98
|
-
|
|
99
|
-
"dynamic-sm": "var(--vl-
|
|
100
|
-
dynamic: "var(--vl-
|
|
101
|
-
"dynamic-lg": "var(--vl-
|
|
102
|
-
},
|
|
103
|
-
ringOffsetColor: {
|
|
104
|
-
dynamic: twColorWithOpacity("--vl-ring-offset-color"),
|
|
97
|
+
outlineWidth: {
|
|
98
|
+
"dynamic-sm": "var(--vl-outline-sm)",
|
|
99
|
+
dynamic: "var(--vl-outline)",
|
|
100
|
+
"dynamic-lg": "var(--vl-outline-lg)",
|
|
105
101
|
},
|
|
106
102
|
},
|
|
107
103
|
configViewer: {
|
|
108
104
|
themeReplacements: {
|
|
109
105
|
/* eslint-disable prettier/prettier, vue/max-len */
|
|
110
|
-
"var(--vl-
|
|
111
|
-
"var(--vl-
|
|
112
|
-
"var(--vl-
|
|
113
|
-
"var(--vl-ring-offset-color)": globalSettings.ringOffsetColorLight || DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
106
|
+
"var(--vl-outline-sm)": globalSettings.ringSm || Math.max(0, (globalSettings.ring || DEFAULT_OUTLINE) - OUTLINE_DECREMENT),
|
|
107
|
+
"var(--vl-outline)": globalSettings.ring || DEFAULT_OUTLINE,
|
|
108
|
+
"var(--vl-outline-lg)": globalSettings.ringLg || Math.max(0, (globalSettings.ring || DEFAULT_OUTLINE) + OUTLINE_INCREMENT),
|
|
114
109
|
"var(--vl-rounding-sm)": globalSettings.roundingSm || Math.max(0, (globalSettings.rounding || DEFAULT_ROUNDING) - ROUNDING_DECREMENT),
|
|
115
110
|
"var(--vl-rounding)": globalSettings.ring || DEFAULT_ROUNDING,
|
|
116
111
|
"var(--vl-rounding-lg)": globalSettings.roundingLg || Math.max(0, (globalSettings.rounding || DEFAULT_ROUNDING) - ROUNDING_INCREMENT),
|
package/types.ts
CHANGED
|
@@ -96,29 +96,19 @@ export interface ThemeConfig {
|
|
|
96
96
|
roundingLg?: number;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
* Default components small size
|
|
99
|
+
* Default components small size outline width.
|
|
100
100
|
*/
|
|
101
|
-
|
|
101
|
+
outlineSm?: number;
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
|
-
* Default components
|
|
104
|
+
* Default components outline width.
|
|
105
105
|
*/
|
|
106
|
-
|
|
106
|
+
outline?: number;
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
* Default components large size
|
|
109
|
+
* Default components large size outline width.
|
|
110
110
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Default components ring color for light theme.
|
|
115
|
-
*/
|
|
116
|
-
ringOffsetColorLight?: string;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Default components ring color for dark theme.
|
|
120
|
-
*/
|
|
121
|
-
ringOffsetColorDark?: string;
|
|
111
|
+
outlineLg?: number;
|
|
122
112
|
|
|
123
113
|
/**
|
|
124
114
|
* Default color mode.
|
|
@@ -349,10 +339,9 @@ export interface TailwindColorShades {
|
|
|
349
339
|
}
|
|
350
340
|
|
|
351
341
|
export interface VuelessCssVariables {
|
|
352
|
-
"--vl-
|
|
353
|
-
"--vl-
|
|
354
|
-
"--vl-
|
|
355
|
-
"--vl-ring-offset-color": string;
|
|
342
|
+
"--vl-outline-sm": string;
|
|
343
|
+
"--vl-outline": string;
|
|
344
|
+
"--vl-outline-lg": string;
|
|
356
345
|
"--vl-rounding-sm": string;
|
|
357
346
|
"--vl-rounding": string;
|
|
358
347
|
"--vl-rounding-lg": string;
|
package/ui.button/config.ts
CHANGED
|
@@ -3,9 +3,9 @@ export default /*tw*/ {
|
|
|
3
3
|
base: `
|
|
4
4
|
flex items-center justify-center font-medium !leading-snug whitespace-nowrap
|
|
5
5
|
border border-transparent outline-none transition cursor-pointer
|
|
6
|
-
focus-visible:
|
|
7
|
-
focus-visible:
|
|
8
|
-
disabled:cursor-not-allowed disabled:
|
|
6
|
+
focus-visible:outline-dynamic focus-visible:outline-offset-2
|
|
7
|
+
focus-visible:outline-{color}-600 dark:focus-visible:outline-{color}-400
|
|
8
|
+
disabled:cursor-not-allowed disabled:outline-0 disabled:outline-offset-0
|
|
9
9
|
`,
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
@@ -54,7 +54,7 @@ export default /*tw*/ {
|
|
|
54
54
|
compoundVariants: [
|
|
55
55
|
{
|
|
56
56
|
color: ["grayscale", "white"],
|
|
57
|
-
class: "focus-visible:
|
|
57
|
+
class: "focus-visible:outline-gray-900 dark:focus-visible:outline-gray-100",
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
color: "grayscale",
|
package/ui.button-link/config.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default /*tw*/ {
|
|
|
5
5
|
text-{color}-600 decoration-{color}-600 underline-offset-4
|
|
6
6
|
hover:text-{color}-700 hover:decoration-{color}-700
|
|
7
7
|
active:text-{color}-800 active:decoration-{color}-800
|
|
8
|
-
focus-visible:
|
|
8
|
+
focus-visible:outline-dynamic focus-visible:outline-offset-4 focus-visible:outline-{color}-600
|
|
9
9
|
`,
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
@@ -28,9 +28,9 @@ export default /*tw*/ {
|
|
|
28
28
|
text-gray-900 decoration-gray-900
|
|
29
29
|
hover:text-gray-800 hover:decoration-gray-800
|
|
30
30
|
active:text-gray-700 active:decoration-gray-700
|
|
31
|
-
focus-visible:
|
|
31
|
+
focus-visible:outline-gray-900
|
|
32
32
|
`,
|
|
33
|
-
white: "decoration-white text-white focus-visible:
|
|
33
|
+
white: "decoration-white text-white focus-visible:outline-white",
|
|
34
34
|
},
|
|
35
35
|
defaultSlot: {
|
|
36
36
|
true: "flex items-center no-underline hover:no-underline",
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
wrapper: {
|
|
3
3
|
base: `
|
|
4
|
-
relative inline-flex items-center
|
|
5
|
-
focus-visible:
|
|
4
|
+
relative inline-flex items-center rounded
|
|
5
|
+
focus-visible:outline focus-visible:outline-dynamic focus-visible:outline-offset-4 focus-visible:outline-{color}-600
|
|
6
6
|
`,
|
|
7
7
|
variants: {
|
|
8
8
|
color: {
|
|
9
|
-
grayscale: "focus-visible:
|
|
10
|
-
white: "focus-visible:
|
|
9
|
+
grayscale: "focus-visible:outline-gray-900",
|
|
10
|
+
white: "focus-visible:outline-white",
|
|
11
11
|
},
|
|
12
12
|
opened: {
|
|
13
13
|
true: "group",
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
-
dropdownLink: "{ULink} focus-visible:
|
|
17
|
+
dropdownLink: "{ULink} focus-visible:outline-none",
|
|
18
18
|
toggleIcon: {
|
|
19
19
|
base: "{UIcon} block transition duration-300 group-[]:rotate-180",
|
|
20
20
|
variants: {
|
|
@@ -16,8 +16,8 @@ export default /*tw*/ {
|
|
|
16
16
|
`,
|
|
17
17
|
variants: {
|
|
18
18
|
color: {
|
|
19
|
-
grayscale: "hover:bg-gray-
|
|
20
|
-
white: "hover:bg-gray-
|
|
19
|
+
grayscale: "hover:bg-gray-900/5 active:bg-gray-900/10",
|
|
20
|
+
white: "hover:bg-gray-900/5 active:bg-gray-900/10",
|
|
21
21
|
},
|
|
22
22
|
size: {
|
|
23
23
|
sm: "text-xs",
|
|
@@ -29,7 +29,15 @@ export default /*tw*/ {
|
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
optionActive:
|
|
32
|
+
optionActive: {
|
|
33
|
+
base: "{>option} bg-{color}-600/10 hover:bg-{color}-600/10 text-{color}-600",
|
|
34
|
+
variants: {
|
|
35
|
+
color: {
|
|
36
|
+
grayscale: "bg-gray-900/10 hover:bg-gray-900/10 text-gray-900",
|
|
37
|
+
white: "bg-gray-900/10 hover:bg-gray-900/10 text-gray-900",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
33
41
|
optionHighlighted: "bg-{color}-50",
|
|
34
42
|
optionContent: "overflow-visible text-ellipsis",
|
|
35
43
|
groupBase: {
|
|
@@ -63,8 +63,12 @@ export default /*tw*/ {
|
|
|
63
63
|
activeYear: "{>year} {>activeDate}",
|
|
64
64
|
timepicker: "mt-2 pl-1 pt-3 text-sm flex items-stretch justify-between gap-2 border-t border-gray-200",
|
|
65
65
|
timepickerLabel: "w-full self-center",
|
|
66
|
-
timepickerInputWrapper:
|
|
67
|
-
|
|
66
|
+
timepickerInputWrapper: `
|
|
67
|
+
flex items-center rounded-dynamic border border-gray-300
|
|
68
|
+
hover:focus-within:border-brand-600 focus-within:border-brand-600
|
|
69
|
+
focus-within:outline focus-within:outline-dynamic-sm focus-within:outline-brand-600
|
|
70
|
+
`,
|
|
71
|
+
timepickerInput: "w-10 border-none px-1.5 py-1.5 text-center text-sm focus:ring-0",
|
|
68
72
|
timepickerInputHours: "{>timepickerInput} rounded-l-dynamic",
|
|
69
73
|
timepickerInputMinutes: "{>timepickerInput}",
|
|
70
74
|
timepickerInputSeconds: "{>timepickerInput} rounded-r-dynamic",
|
|
@@ -7,7 +7,7 @@ export default /*tw*/ {
|
|
|
7
7
|
active:border-{color}-600 active:bg-{color}-200
|
|
8
8
|
checked:text-{color}-600
|
|
9
9
|
focus:ring-0 focus:ring-offset-0
|
|
10
|
-
focus-visible:
|
|
10
|
+
focus-visible:outline-{color}-600 focus-visible:outline-dynamic focus-visible:outline-offset-2
|
|
11
11
|
disabled:border-gray-300 disabled:bg-gray-100 disabled:cursor-not-allowed
|
|
12
12
|
`,
|
|
13
13
|
variants: {
|
|
@@ -17,10 +17,10 @@ export default /*tw*/ {
|
|
|
17
17
|
lg: "size-6",
|
|
18
18
|
},
|
|
19
19
|
color: {
|
|
20
|
-
grayscale: "focus-visible:
|
|
20
|
+
grayscale: "focus-visible:outline-gray-900 active:bg-gray-200 checked:text-gray-900",
|
|
21
21
|
},
|
|
22
22
|
error: {
|
|
23
|
-
true: "!border-red-600 focus:
|
|
23
|
+
true: "!border-red-600 focus:outline-red-600",
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
},
|
|
@@ -4,10 +4,10 @@ export default /*tw*/ {
|
|
|
4
4
|
datepickerInputActive: {
|
|
5
5
|
base: "{UInput} {>datepickerInput}",
|
|
6
6
|
wrapper: {
|
|
7
|
-
base: "
|
|
7
|
+
base: "outline outline-dynamic-sm outline-brand-600 border-brand-600 hover:border-brand-600",
|
|
8
8
|
variants: {
|
|
9
9
|
error: {
|
|
10
|
-
true: "
|
|
10
|
+
true: "outline-red-600 border-red-600 hover:border-red-600",
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
},
|
|
@@ -4,10 +4,10 @@ export default /*tw*/ {
|
|
|
4
4
|
datepickerInputActive: {
|
|
5
5
|
base: "{>datepickerInput}",
|
|
6
6
|
wrapper: {
|
|
7
|
-
base: "
|
|
7
|
+
base: "outline outline-dynamic-sm outline-brand-600 border-brand-600 hover:border-brand-600",
|
|
8
8
|
variants: {
|
|
9
9
|
error: {
|
|
10
|
-
true: "
|
|
10
|
+
true: "border-red-600 hover:border-red-600 outline-red-600",
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
},
|
|
@@ -87,7 +87,7 @@ export default /*tw*/ {
|
|
|
87
87
|
wrapper: "w-full transition",
|
|
88
88
|
description: "hidden",
|
|
89
89
|
},
|
|
90
|
-
wrapper: "focus-within:z-10 focus-within:
|
|
90
|
+
wrapper: "focus-within:z-10 focus-within:outline-0 focus-within:border-gray-500 hover:focus-within:border-gray-500",
|
|
91
91
|
},
|
|
92
92
|
rangeInputFirst: {
|
|
93
93
|
base: "{UInput} {>rangeInput}",
|
package/ui.form-input/config.ts
CHANGED
|
@@ -4,14 +4,14 @@ export default /*tw*/ {
|
|
|
4
4
|
base: `
|
|
5
5
|
border rounded-dynamic border-gray-300 relative flex w-full bg-white transition
|
|
6
6
|
hover:border-gray-400 hover:focus-within:border-brand-600 focus-within:border-brand-600
|
|
7
|
-
focus-within:
|
|
7
|
+
focus-within:outline focus-within:outline-dynamic-sm focus-within:outline-brand-600
|
|
8
8
|
`,
|
|
9
9
|
variants: {
|
|
10
10
|
error: {
|
|
11
|
-
true: "!border-red-600 focus-within:
|
|
11
|
+
true: "!border-red-600 focus-within:outline-red-600",
|
|
12
12
|
},
|
|
13
13
|
disabled: {
|
|
14
|
-
true: "!border-gray-300 focus-within:
|
|
14
|
+
true: "!border-gray-300 focus-within:outline-0 bg-gray-100",
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
},
|
|
@@ -5,11 +5,11 @@ export default /*tw*/ {
|
|
|
5
5
|
p-3 size-auto w-full bg-white transition
|
|
6
6
|
rounded-dynamic border border-solid border-gray-300
|
|
7
7
|
hover:border-gray-400 hover:focus-within:border-brand-600 focus-within:border-brand-600
|
|
8
|
-
focus-within:
|
|
8
|
+
focus-within:outline focus-within:outline-dynamic-sm focus-within:outline-brand-600
|
|
9
9
|
`,
|
|
10
10
|
variants: {
|
|
11
11
|
error: {
|
|
12
|
-
true: "!border-red-600 focus-within:
|
|
12
|
+
true: "!border-red-600 focus-within:outline-red-600",
|
|
13
13
|
},
|
|
14
14
|
disabled: {
|
|
15
15
|
true: "pointer-events-none bg-gray-100",
|
package/ui.form-radio/config.ts
CHANGED
|
@@ -7,7 +7,7 @@ export default /*tw*/ {
|
|
|
7
7
|
active:border-{color}-600 active:bg-{color}-200
|
|
8
8
|
checked:text-{color}-600
|
|
9
9
|
focus:ring-0 focus:ring-offset-0
|
|
10
|
-
focus-visible:
|
|
10
|
+
focus-visible:outline-{color}-600 focus-visible:outline-dynamic focus-visible:outline-offset-2
|
|
11
11
|
disabled:border-gray-300 disabled:bg-gray-100 disabled:cursor-not-allowed
|
|
12
12
|
disabled:checked:bg-gray-400 disabled:checked:border-transparent
|
|
13
13
|
`,
|
|
@@ -19,7 +19,7 @@ export default /*tw*/ {
|
|
|
19
19
|
},
|
|
20
20
|
color: {
|
|
21
21
|
grayscale: `
|
|
22
|
-
focus-visible:
|
|
22
|
+
focus-visible:outline-gray-900
|
|
23
23
|
checked:text-gray-900 checked:hover:text-gray-800 checked:active:text-gray-700
|
|
24
24
|
`,
|
|
25
25
|
},
|
|
@@ -130,10 +130,6 @@ const dropdownValue = computed({
|
|
|
130
130
|
},
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
const isSelectedValueLabelVisible = computed(() => {
|
|
134
|
-
return !props.multiple && isLocalValue.value && (!isOpen.value || !props.searchable);
|
|
135
|
-
});
|
|
136
|
-
|
|
137
133
|
const filteredOptions = computed(() => {
|
|
138
134
|
const normalizedSearch = search.value.toLowerCase().trim() || "";
|
|
139
135
|
|
|
@@ -617,7 +613,6 @@ const {
|
|
|
617
613
|
|
|
618
614
|
<div v-bind="searchAttrs">
|
|
619
615
|
<input
|
|
620
|
-
v-show="searchable || !localValue || multiple || !isOpen"
|
|
621
616
|
:id="elementId"
|
|
622
617
|
ref="searchInputRef"
|
|
623
618
|
v-model="search"
|
|
@@ -625,7 +620,7 @@ const {
|
|
|
625
620
|
autocomplete="off"
|
|
626
621
|
:spellcheck="false"
|
|
627
622
|
:placeholder="inputPlaceholder"
|
|
628
|
-
:disabled="disabled"
|
|
623
|
+
:disabled="disabled || !searchable"
|
|
629
624
|
:aria-controls="'listbox-' + elementId"
|
|
630
625
|
v-bind="searchInputAttrs"
|
|
631
626
|
:data-test="getDataTest('search')"
|
|
@@ -639,7 +634,7 @@ const {
|
|
|
639
634
|
</div>
|
|
640
635
|
|
|
641
636
|
<span
|
|
642
|
-
v-if="
|
|
637
|
+
v-if="!multiple && isLocalValue && ((searchable && !isOpen) || !searchable)"
|
|
643
638
|
v-bind="selectedLabelAttrs"
|
|
644
639
|
@mousedown.prevent="toggle"
|
|
645
640
|
>
|
package/ui.form-select/config.ts
CHANGED
|
@@ -4,17 +4,16 @@ export default /*tw*/ {
|
|
|
4
4
|
base: `
|
|
5
5
|
flex flex-row-reverse justify-between w-full min-h-full box-border relative
|
|
6
6
|
rounded-dynamic border border-gray-300 bg-white
|
|
7
|
-
hover:border-gray-400 hover:transition hover:focus-within:border-brand-600
|
|
8
|
-
focus-within:
|
|
9
|
-
focus-within:border-brand-600 focus-within:outline-none
|
|
7
|
+
hover:border-gray-400 hover:transition hover:focus-within:border-brand-600 focus-within:border-brand-600
|
|
8
|
+
focus-within:outline focus-within:outline-dynamic-sm focus-within:outline-brand-600
|
|
10
9
|
`,
|
|
11
10
|
variants: {
|
|
12
11
|
error: {
|
|
13
|
-
true: "!border-red-600 focus-within:
|
|
12
|
+
true: "!border-red-600 focus-within:outline-red-600",
|
|
14
13
|
},
|
|
15
14
|
disabled: {
|
|
16
15
|
true: `
|
|
17
|
-
focus-within:
|
|
16
|
+
focus-within:outline-0 bg-gray-100
|
|
18
17
|
hover:border-gray-300 focus-within:border-gray-300 hover:focus-within:border-gray-300
|
|
19
18
|
`,
|
|
20
19
|
},
|
|
@@ -109,13 +108,11 @@ export default /*tw*/ {
|
|
|
109
108
|
],
|
|
110
109
|
},
|
|
111
110
|
search: {
|
|
112
|
-
base: "flex w-
|
|
113
|
-
|
|
114
|
-
selected:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
},
|
|
118
|
-
compoundVariants: [{ opened: true, searchable: false, class: "w-0" }],
|
|
111
|
+
base: "flex w-full",
|
|
112
|
+
compoundVariants: [
|
|
113
|
+
{ multiple: false, selected: true, opened: false, class: "w-0" },
|
|
114
|
+
{ multiple: false, selected: true, searchable: false, class: "w-0" },
|
|
115
|
+
],
|
|
119
116
|
},
|
|
120
117
|
searchInput: {
|
|
121
118
|
base: `
|
package/ui.form-switch/config.ts
CHANGED
|
@@ -3,7 +3,7 @@ export default /*tw*/ {
|
|
|
3
3
|
wrapper: {
|
|
4
4
|
base: `
|
|
5
5
|
flex items-center p-0.5 relative rounded-full cursor-pointer transition
|
|
6
|
-
focus-visible:
|
|
6
|
+
focus-visible:outline focus-visible:outline-dynamic focus-visible:outline-offset-2 focus-visible:outline-{color}-600
|
|
7
7
|
`,
|
|
8
8
|
variants: {
|
|
9
9
|
size: {
|
|
@@ -12,7 +12,7 @@ export default /*tw*/ {
|
|
|
12
12
|
lg: "w-10",
|
|
13
13
|
},
|
|
14
14
|
color: {
|
|
15
|
-
grayscale: "
|
|
15
|
+
grayscale: "outline-gray-900",
|
|
16
16
|
},
|
|
17
17
|
checked: {
|
|
18
18
|
true: "bg-{color}-600 hover:bg-{color}-700 active:bg-{color}-800",
|
|
@@ -6,16 +6,15 @@ export default /*tw*/ {
|
|
|
6
6
|
wrapper: {
|
|
7
7
|
base: `
|
|
8
8
|
flex bg-white transition w-full
|
|
9
|
-
rounded-dynamic border border-gray-300 hover:border-gray-400 hover:focus-within:border-brand-600
|
|
10
|
-
focus-within:
|
|
11
|
-
focus-within:ring-brand-600 focus-within:outline-none
|
|
9
|
+
rounded-dynamic border border-gray-300 hover:border-gray-400 hover:focus-within:border-brand-600 focus-within:border-brand-600
|
|
10
|
+
focus-within:outline focus-within:outline-dynamic-sm focus-within:outline-brand-600
|
|
12
11
|
`,
|
|
13
12
|
variants: {
|
|
14
13
|
error: {
|
|
15
|
-
true: "!border-red-600 focus-within:
|
|
14
|
+
true: "!border-red-600 focus-within:outline-red-600",
|
|
16
15
|
},
|
|
17
16
|
disabled: {
|
|
18
|
-
true: "!border-gray-300 focus-within:
|
|
17
|
+
true: "!border-gray-300 focus-within:outline-0 bg-gray-100",
|
|
19
18
|
},
|
|
20
19
|
},
|
|
21
20
|
},
|
|
@@ -23,7 +22,7 @@ export default /*tw*/ {
|
|
|
23
22
|
base: `
|
|
24
23
|
px-3 pt-2 pb-1.5 block w-full bg-transparent border-none font-normal text-gray-900
|
|
25
24
|
placeholder:text-gray-400 placeholder:font-normal placeholder:leading-none
|
|
26
|
-
focus:
|
|
25
|
+
focus:ring-0 disabled:cursor-not-allowed
|
|
27
26
|
`,
|
|
28
27
|
variants: {
|
|
29
28
|
size: {
|
package/ui.text-badge/config.ts
CHANGED
|
@@ -16,11 +16,11 @@ export default /*tw*/ {
|
|
|
16
16
|
true: "rounded-full",
|
|
17
17
|
},
|
|
18
18
|
tabindex: {
|
|
19
|
-
true: "cursor-pointer focus-visible:
|
|
19
|
+
true: "cursor-pointer focus-visible:outline-dynamic focus-visible:outline-offset-2 focus-visible:outline-{color}-600",
|
|
20
20
|
},
|
|
21
21
|
color: {
|
|
22
|
-
grayscale: "focus-visible:
|
|
23
|
-
white: " focus-visible:
|
|
22
|
+
grayscale: "focus-visible:outline-gray-900",
|
|
23
|
+
white: " focus-visible:outline-gray-900",
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
26
|
compoundVariants: [
|
package/utils/theme.ts
CHANGED
|
@@ -12,11 +12,9 @@ import {
|
|
|
12
12
|
TAILWIND_COLORS,
|
|
13
13
|
DEFAULT_BRAND_COLOR,
|
|
14
14
|
DEFAULT_GRAY_COLOR,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
RING_DECREMENT,
|
|
19
|
-
RING_INCREMENT,
|
|
15
|
+
DEFAULT_OUTLINE,
|
|
16
|
+
OUTLINE_DECREMENT,
|
|
17
|
+
OUTLINE_INCREMENT,
|
|
20
18
|
DEFAULT_ROUNDING,
|
|
21
19
|
ROUNDING_DECREMENT,
|
|
22
20
|
ROUNDING_INCREMENT,
|
|
@@ -42,11 +40,9 @@ declare interface RootCSSVariableOptions {
|
|
|
42
40
|
colors: Colors;
|
|
43
41
|
brand: string;
|
|
44
42
|
gray: string;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
ringOffsetColorDark: string;
|
|
49
|
-
ringOffsetColorLight: string;
|
|
43
|
+
outlineSm: number;
|
|
44
|
+
outline: number;
|
|
45
|
+
outlineLg: number;
|
|
50
46
|
roundingSm: number;
|
|
51
47
|
rounding: number;
|
|
52
48
|
roundingLg: number;
|
|
@@ -159,22 +155,12 @@ export function setTheme(config: Config = {}) {
|
|
|
159
155
|
let gray: GrayColors =
|
|
160
156
|
config.gray ?? getSelectedGrayColor() ?? vuelessConfig.gray ?? DEFAULT_GRAY_COLOR;
|
|
161
157
|
|
|
162
|
-
const {
|
|
163
|
-
config.
|
|
164
|
-
config.
|
|
165
|
-
config.
|
|
158
|
+
const { outlineSm, outline, outlineLg } = getRings(
|
|
159
|
+
config.outlineSm ?? vuelessConfig.outlineSm,
|
|
160
|
+
config.outline ?? vuelessConfig.outline,
|
|
161
|
+
config.outlineLg ?? vuelessConfig.outlineLg,
|
|
166
162
|
);
|
|
167
163
|
|
|
168
|
-
const ringOffsetColorDark =
|
|
169
|
-
config.ringOffsetColorDark ??
|
|
170
|
-
vuelessConfig.ringOffsetColorDark ??
|
|
171
|
-
DEFAULT_RING_OFFSET_COLOR_DARK;
|
|
172
|
-
|
|
173
|
-
const ringOffsetColorLight =
|
|
174
|
-
config.ringOffsetColorLight ??
|
|
175
|
-
vuelessConfig.ringOffsetColorLight ??
|
|
176
|
-
DEFAULT_RING_OFFSET_COLOR_LIGHT;
|
|
177
|
-
|
|
178
164
|
const colors: Colors = merge(
|
|
179
165
|
TAILWIND_COLORS as Colors,
|
|
180
166
|
tailwindConfig?.theme?.extend?.colors || {},
|
|
@@ -206,11 +192,9 @@ export function setTheme(config: Config = {}) {
|
|
|
206
192
|
colors,
|
|
207
193
|
brand,
|
|
208
194
|
gray,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
ringOffsetColorDark,
|
|
213
|
-
ringOffsetColorLight,
|
|
195
|
+
outlineSm,
|
|
196
|
+
outline,
|
|
197
|
+
outlineLg,
|
|
214
198
|
roundingSm,
|
|
215
199
|
rounding,
|
|
216
200
|
roundingLg,
|
|
@@ -218,18 +202,18 @@ export function setTheme(config: Config = {}) {
|
|
|
218
202
|
}
|
|
219
203
|
|
|
220
204
|
function getRings(sm?: number, md?: number, lg?: number) {
|
|
221
|
-
const
|
|
222
|
-
const
|
|
223
|
-
let
|
|
205
|
+
const outline = Math.max(0, md ?? DEFAULT_OUTLINE);
|
|
206
|
+
const outlineSm = Math.max(0, outline - OUTLINE_DECREMENT);
|
|
207
|
+
let outlineLg = Math.max(0, outline + OUTLINE_INCREMENT);
|
|
224
208
|
|
|
225
|
-
if (
|
|
226
|
-
|
|
209
|
+
if (outline === 0) {
|
|
210
|
+
outlineLg = 0;
|
|
227
211
|
}
|
|
228
212
|
|
|
229
213
|
return {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
214
|
+
outline,
|
|
215
|
+
outlineSm: sm === undefined ? outlineSm : Math.max(0, sm),
|
|
216
|
+
outlineLg: lg === undefined ? outlineLg : Math.max(0, lg),
|
|
233
217
|
};
|
|
234
218
|
}
|
|
235
219
|
|
|
@@ -262,22 +246,10 @@ function setRootCSSVariables(options: RootCSSVariableOptions) {
|
|
|
262
246
|
options.brand = options.gray;
|
|
263
247
|
}
|
|
264
248
|
|
|
265
|
-
const {
|
|
266
|
-
|
|
267
|
-
brand,
|
|
268
|
-
gray,
|
|
269
|
-
ringSm,
|
|
270
|
-
ring,
|
|
271
|
-
ringLg,
|
|
272
|
-
ringOffsetColorDark,
|
|
273
|
-
ringOffsetColorLight,
|
|
274
|
-
roundingSm,
|
|
275
|
-
rounding,
|
|
276
|
-
roundingLg,
|
|
277
|
-
} = options;
|
|
249
|
+
const { colors, brand, gray, outlineSm, outline, outlineLg, roundingSm, rounding, roundingLg } =
|
|
250
|
+
options;
|
|
278
251
|
|
|
279
252
|
const isDarkMode = isCSR && document.documentElement.classList.contains(DARK_MODE_SELECTOR);
|
|
280
|
-
const defaultRingOffsetColor = isDarkMode ? ringOffsetColorDark : ringOffsetColorLight;
|
|
281
253
|
const defaultBrandShade = isDarkMode ? 400 : 600;
|
|
282
254
|
const defaultGrayShade = isDarkMode ? 400 : 600;
|
|
283
255
|
|
|
@@ -285,10 +257,9 @@ function setRootCSSVariables(options: RootCSSVariableOptions) {
|
|
|
285
257
|
"--vl-rounding-sm": `${Number(roundingSm) / PX_IN_REM}rem`,
|
|
286
258
|
"--vl-rounding": `${Number(rounding) / PX_IN_REM}rem`,
|
|
287
259
|
"--vl-rounding-lg": `${Number(roundingLg) / PX_IN_REM}rem`,
|
|
288
|
-
"--vl-
|
|
289
|
-
"--vl-
|
|
290
|
-
"--vl-
|
|
291
|
-
"--vl-ring-offset-color": convertHexInRgb(defaultRingOffsetColor),
|
|
260
|
+
"--vl-outline-sm": `${outlineSm}px`,
|
|
261
|
+
"--vl-outline": `${outline}px`,
|
|
262
|
+
"--vl-outline-lg": `${outlineLg}px`,
|
|
292
263
|
"--vl-color-gray-default": convertHexInRgb(colors[gray]?.[defaultBrandShade]),
|
|
293
264
|
"--vl-color-brand-default": convertHexInRgb(colors[brand]?.[defaultGrayShade]),
|
|
294
265
|
};
|