vueless 0.0.707 → 0.0.709
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 +0 -1
- package/constants.js +1 -3
- package/package.json +1 -1
- package/preset-tailwind.js +1 -5
- package/types.ts +0 -6
- package/ui.button/config.ts +1 -1
- package/ui.dropdown-list/config.ts +1 -1
- package/ui.form-checkbox/config.ts +2 -2
- package/ui.form-date-picker/config.ts +1 -1
- package/ui.form-date-picker-range/config.ts +1 -1
- package/ui.form-input/config.ts +1 -1
- package/ui.form-input-file/config.ts +1 -1
- package/ui.form-input-number/UInputNumber.vue +2 -2
- package/ui.form-input-number/config.ts +27 -8
- package/ui.form-radio/config.ts +2 -2
- package/ui.form-select/config.ts +2 -2
- package/ui.form-switch/config.ts +1 -1
- package/ui.form-textarea/config.ts +1 -1
- package/ui.text-badge/config.ts +1 -1
- package/utils/theme.ts +0 -6
package/bin/constants.js
CHANGED
package/constants.js
CHANGED
|
@@ -18,7 +18,6 @@ export const COLOR_MODE_KEY = "vl-color-mode";
|
|
|
18
18
|
export const DEFAULT_BRAND_COLOR = GRAYSCALE_COLOR;
|
|
19
19
|
export const DEFAULT_GRAY_COLOR = COOL_COLOR;
|
|
20
20
|
export const DEFAULT_RING = 2; /* pixels */
|
|
21
|
-
export const DEFAULT_RING_OFFSET = 2; /* pixels */
|
|
22
21
|
export const DEFAULT_RING_OFFSET_COLOR_LIGHT = "#ffffff"; // white
|
|
23
22
|
export const DEFAULT_RING_OFFSET_COLOR_DARK = "#111827"; // gray-900
|
|
24
23
|
export const DEFAULT_ROUNDING = 8; /* pixels */
|
|
@@ -172,8 +171,7 @@ export const TAILWIND_MERGE_EXTENSION = {
|
|
|
172
171
|
spacing: ["safe-top", "safe-bottom", "safe-left", "safe-right"],
|
|
173
172
|
},
|
|
174
173
|
classGroups: {
|
|
175
|
-
"ring-w": [{ ring: ["dynamic"] }],
|
|
176
|
-
"ring-offset-w": [{ "ring-offset": ["dynamic"] }],
|
|
174
|
+
"ring-w": [{ ring: ["dynamic", "dynamic-1"] }],
|
|
177
175
|
"ring-offset-color": [{ "ring-offset": ["color-dynamic"] }],
|
|
178
176
|
"font-size": [{ text: ["2xs"] }],
|
|
179
177
|
rounded: [{ rounded: ["dynamic", "dynamic-sm", "dynamic-lg", "inherit"] }],
|
package/package.json
CHANGED
package/preset-tailwind.js
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
TAILWIND_COLORS,
|
|
14
14
|
DEFAULT_ROUNDING,
|
|
15
15
|
DEFAULT_RING,
|
|
16
|
-
DEFAULT_RING_OFFSET,
|
|
17
16
|
DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
18
17
|
DEFAULT_BRAND_COLOR,
|
|
19
18
|
DEFAULT_GRAY_COLOR,
|
|
@@ -94,9 +93,7 @@ export const vuelessTailwindConfig = {
|
|
|
94
93
|
},
|
|
95
94
|
ringWidth: {
|
|
96
95
|
dynamic: "var(--vl-ring)",
|
|
97
|
-
|
|
98
|
-
ringOffsetWidth: {
|
|
99
|
-
dynamic: "var(--vl-ring-offset)",
|
|
96
|
+
"dynamic-1": "calc(var(--vl-ring) - 1px)",
|
|
100
97
|
},
|
|
101
98
|
ringOffsetColor: {
|
|
102
99
|
dynamic: twColorWithOpacity("--vl-ring-offset-color"),
|
|
@@ -106,7 +103,6 @@ export const vuelessTailwindConfig = {
|
|
|
106
103
|
themeReplacements: {
|
|
107
104
|
/* eslint-disable prettier/prettier */
|
|
108
105
|
"var(--vl-ring)": globalSettings.ring || DEFAULT_RING,
|
|
109
|
-
"var(--vl-ring-offset)": globalSettings.ringOffset || DEFAULT_RING_OFFSET,
|
|
110
106
|
"var(--vl-ring-offset-color)": globalSettings.ringOffsetColorLight || DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
111
107
|
"var(--vl-rounding-sm)": globalSettings.roundingSm || (globalSettings.ring || DEFAULT_ROUNDING) / 2,
|
|
112
108
|
"var(--vl-rounding)": globalSettings.ring || DEFAULT_ROUNDING,
|
package/types.ts
CHANGED
|
@@ -100,11 +100,6 @@ export interface ThemeConfig {
|
|
|
100
100
|
*/
|
|
101
101
|
ring?: number;
|
|
102
102
|
|
|
103
|
-
/**
|
|
104
|
-
* Default components ring offset width.
|
|
105
|
-
*/
|
|
106
|
-
ringOffset?: number;
|
|
107
|
-
|
|
108
103
|
/**
|
|
109
104
|
* Default components ring color for light theme.
|
|
110
105
|
*/
|
|
@@ -345,7 +340,6 @@ export interface TailwindColorShades {
|
|
|
345
340
|
|
|
346
341
|
export interface VuelessCssVariables {
|
|
347
342
|
"--vl-ring": string;
|
|
348
|
-
"--vl-ring-offset": string;
|
|
349
343
|
"--vl-ring-offset-color": string;
|
|
350
344
|
"--vl-rounding-sm": string;
|
|
351
345
|
"--vl-rounding": string;
|
package/ui.button/config.ts
CHANGED
|
@@ -3,7 +3,7 @@ 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:ring-dynamic focus-visible:ring-offset-
|
|
6
|
+
focus-visible:ring-dynamic focus-visible:ring-offset-2
|
|
7
7
|
focus-visible:ring-{color}-600 dark:focus-visible:ring-{color}-400
|
|
8
8
|
disabled:cursor-not-allowed disabled:ring-0 disabled:ring-offset-0
|
|
9
9
|
`,
|
|
@@ -29,7 +29,7 @@ export default /*tw*/ {
|
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
optionActive: "{>option}
|
|
32
|
+
optionActive: "{>option} bg-{color}-600/10 hover:bg-{color}-600/10 text-brand-600",
|
|
33
33
|
optionHighlighted: "bg-{color}-50",
|
|
34
34
|
optionContent: "overflow-visible text-ellipsis",
|
|
35
35
|
groupBase: {
|
|
@@ -5,9 +5,9 @@ export default /*tw*/ {
|
|
|
5
5
|
border border-gray-300 rounded-dynamic-sm bg-white cursor-pointer transition
|
|
6
6
|
hover:border-gray-400
|
|
7
7
|
active:border-{color}-600 active:bg-{color}-200
|
|
8
|
-
focus:ring-0 focus:ring-offset-0
|
|
9
8
|
checked:text-{color}-600
|
|
10
|
-
focus
|
|
9
|
+
focus:ring-0 focus:ring-offset-0
|
|
10
|
+
focus-visible:ring-{color}-600 focus-visible:ring-dynamic focus-visible:ring-offset-2
|
|
11
11
|
disabled:border-gray-300 disabled:bg-gray-100 disabled:cursor-not-allowed
|
|
12
12
|
`,
|
|
13
13
|
variants: {
|
|
@@ -4,7 +4,7 @@ export default /*tw*/ {
|
|
|
4
4
|
datepickerInputActive: {
|
|
5
5
|
base: "{UInput} {>datepickerInput}",
|
|
6
6
|
wrapper: {
|
|
7
|
-
base: "ring-dynamic ring-offset-
|
|
7
|
+
base: "ring-dynamic ring-offset-2 ring-brand-700/15 border-brand-500 hover:border-brand-500",
|
|
8
8
|
variants: {
|
|
9
9
|
error: {
|
|
10
10
|
true: "ring-red-700/15 border-red-500 hover:border-red-500",
|
|
@@ -4,7 +4,7 @@ export default /*tw*/ {
|
|
|
4
4
|
datepickerInputActive: {
|
|
5
5
|
base: "{>datepickerInput}",
|
|
6
6
|
wrapper: {
|
|
7
|
-
base: "ring-dynamic ring-
|
|
7
|
+
base: "ring-dynamic ring-brand-600 border-brand-600 hover:border-brand-600",
|
|
8
8
|
variants: {
|
|
9
9
|
error: {
|
|
10
10
|
true: "!border-red-600 ring-red-600",
|
package/ui.form-input/config.ts
CHANGED
|
@@ -4,7 +4,7 @@ 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:ring-dynamic
|
|
7
|
+
focus-within:ring-dynamic-1 focus-within:ring-brand-600
|
|
8
8
|
`,
|
|
9
9
|
variants: {
|
|
10
10
|
error: {
|
|
@@ -5,7 +5,7 @@ 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:ring-brand-600 focus-within:ring-dynamic
|
|
8
|
+
focus-within:ring-brand-600 focus-within:ring-dynamic-1
|
|
9
9
|
`,
|
|
10
10
|
variants: {
|
|
11
11
|
error: {
|
|
@@ -1,23 +1,42 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
label: {
|
|
3
3
|
base: "{ULabel}",
|
|
4
|
-
content:
|
|
4
|
+
content: {
|
|
5
|
+
base: "items-center",
|
|
6
|
+
variants: {
|
|
7
|
+
size: {
|
|
8
|
+
sm: "gap-3",
|
|
9
|
+
md: "gap-3.5",
|
|
10
|
+
lg: "gap-4",
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
5
14
|
},
|
|
6
15
|
number: "",
|
|
7
|
-
removeButton: "{UButton}",
|
|
8
|
-
removeIcon: "{UIcon}",
|
|
9
16
|
addButton: "{UButton}",
|
|
10
|
-
|
|
17
|
+
removeButton: "{UButton}",
|
|
18
|
+
actionIcon: {
|
|
19
|
+
base: "{UIcon}",
|
|
20
|
+
defaults: {
|
|
21
|
+
size: {
|
|
22
|
+
sm: "xs",
|
|
23
|
+
md: "sm",
|
|
24
|
+
lg: "md",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
addIcon: "{>actionIcon}",
|
|
29
|
+
removeIcon: "{>actionIcon}",
|
|
11
30
|
value: {
|
|
12
31
|
base: "font-bold select-none !leading-none",
|
|
13
32
|
variants: {
|
|
14
33
|
size: {
|
|
15
|
-
sm: "text-
|
|
16
|
-
md: "text-
|
|
17
|
-
lg: "text-
|
|
34
|
+
sm: "text-xs",
|
|
35
|
+
md: "text-sm",
|
|
36
|
+
lg: "text-base",
|
|
18
37
|
},
|
|
19
38
|
disabled: {
|
|
20
|
-
true: "
|
|
39
|
+
true: "pointer-events-none",
|
|
21
40
|
},
|
|
22
41
|
},
|
|
23
42
|
},
|
package/ui.form-radio/config.ts
CHANGED
|
@@ -5,9 +5,9 @@ export default /*tw*/ {
|
|
|
5
5
|
border border-gray-300 bg-white cursor-pointer transition
|
|
6
6
|
hover:border-gray-400
|
|
7
7
|
active:border-{color}-600 active:bg-{color}-200
|
|
8
|
-
focus:ring-0 focus:ring-offset-0
|
|
9
8
|
checked:text-{color}-600
|
|
10
|
-
focus
|
|
9
|
+
focus:ring-0 focus:ring-offset-0
|
|
10
|
+
focus-visible:ring-{color}-600 focus-visible:ring-dynamic focus-visible:ring-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
|
`,
|
package/ui.form-select/config.ts
CHANGED
|
@@ -5,7 +5,7 @@ export default /*tw*/ {
|
|
|
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
7
|
hover:border-gray-400 hover:transition hover:focus-within:border-brand-600
|
|
8
|
-
focus-within:ring-brand-600 focus-within:ring-dynamic
|
|
8
|
+
focus-within:ring-brand-600 focus-within:ring-dynamic-1
|
|
9
9
|
focus-within:border-brand-600 focus-within:outline-none
|
|
10
10
|
`,
|
|
11
11
|
variants: {
|
|
@@ -14,7 +14,7 @@ export default /*tw*/ {
|
|
|
14
14
|
},
|
|
15
15
|
disabled: {
|
|
16
16
|
true: `
|
|
17
|
-
focus-within:ring-0
|
|
17
|
+
focus-within:ring-0 bg-gray-100
|
|
18
18
|
hover:border-gray-300 focus-within:border-gray-300 hover:focus-within:border-gray-300
|
|
19
19
|
`,
|
|
20
20
|
},
|
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:ring-dynamic focus-visible:ring-offset-
|
|
6
|
+
focus-visible:ring-dynamic focus-visible:ring-offset-2 ring-{color}-600 outline-0
|
|
7
7
|
`,
|
|
8
8
|
variants: {
|
|
9
9
|
size: {
|
|
@@ -7,7 +7,7 @@ export default /*tw*/ {
|
|
|
7
7
|
base: `
|
|
8
8
|
flex bg-white transition w-full
|
|
9
9
|
rounded-dynamic border border-gray-300 hover:border-gray-400 hover:focus-within:border-brand-600
|
|
10
|
-
focus-within:border-brand-600 focus-within:ring-dynamic
|
|
10
|
+
focus-within:border-brand-600 focus-within:ring-dynamic-1
|
|
11
11
|
focus-within:ring-brand-600 focus-within:outline-none
|
|
12
12
|
`,
|
|
13
13
|
variants: {
|
package/ui.text-badge/config.ts
CHANGED
|
@@ -16,7 +16,7 @@ export default /*tw*/ {
|
|
|
16
16
|
true: "rounded-full",
|
|
17
17
|
},
|
|
18
18
|
tabindex: {
|
|
19
|
-
true: "cursor-pointer focus-visible:ring-dynamic focus-visible:ring-offset-
|
|
19
|
+
true: "cursor-pointer focus-visible:ring-dynamic focus-visible:ring-offset-2 focus-visible:ring-{color}-600",
|
|
20
20
|
},
|
|
21
21
|
color: {
|
|
22
22
|
grayscale: "focus-visible:ring-gray-900",
|
package/utils/theme.ts
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
GRAYSCALE_COLOR,
|
|
12
12
|
TAILWIND_COLORS,
|
|
13
13
|
DEFAULT_RING,
|
|
14
|
-
DEFAULT_RING_OFFSET,
|
|
15
14
|
DEFAULT_ROUNDING,
|
|
16
15
|
DEFAULT_BRAND_COLOR,
|
|
17
16
|
DEFAULT_GRAY_COLOR,
|
|
@@ -42,7 +41,6 @@ declare interface RootCSSVariableOptions {
|
|
|
42
41
|
brand: string;
|
|
43
42
|
gray: string;
|
|
44
43
|
ring: number;
|
|
45
|
-
ringOffset: number;
|
|
46
44
|
ringOffsetColorDark: string;
|
|
47
45
|
ringOffsetColorLight: string;
|
|
48
46
|
roundingSm: number;
|
|
@@ -158,7 +156,6 @@ export function setTheme(config: Config = {}) {
|
|
|
158
156
|
config.gray ?? getSelectedGrayColor() ?? vuelessConfig.gray ?? DEFAULT_GRAY_COLOR;
|
|
159
157
|
|
|
160
158
|
const ring = config.ring ?? vuelessConfig.ring ?? DEFAULT_RING;
|
|
161
|
-
const ringOffset = config.ringOffset ?? vuelessConfig.ringOffset ?? DEFAULT_RING_OFFSET;
|
|
162
159
|
|
|
163
160
|
const ringOffsetColorDark =
|
|
164
161
|
config.ringOffsetColorDark ??
|
|
@@ -202,7 +199,6 @@ export function setTheme(config: Config = {}) {
|
|
|
202
199
|
brand,
|
|
203
200
|
gray,
|
|
204
201
|
ring,
|
|
205
|
-
ringOffset,
|
|
206
202
|
ringOffsetColorDark,
|
|
207
203
|
ringOffsetColorLight,
|
|
208
204
|
roundingSm,
|
|
@@ -245,7 +241,6 @@ function setRootCSSVariables(options: RootCSSVariableOptions) {
|
|
|
245
241
|
brand,
|
|
246
242
|
gray,
|
|
247
243
|
ring,
|
|
248
|
-
ringOffset,
|
|
249
244
|
ringOffsetColorDark,
|
|
250
245
|
ringOffsetColorLight,
|
|
251
246
|
roundingSm,
|
|
@@ -263,7 +258,6 @@ function setRootCSSVariables(options: RootCSSVariableOptions) {
|
|
|
263
258
|
"--vl-rounding": `${Number(rounding) / PX_IN_REM}rem`,
|
|
264
259
|
"--vl-rounding-lg": `${Number(roundingLg) / PX_IN_REM}rem`,
|
|
265
260
|
"--vl-ring": `${Math.max(0, ring)}px`,
|
|
266
|
-
"--vl-ring-offset": `${Math.max(0, ringOffset)}px`,
|
|
267
261
|
"--vl-ring-offset-color": convertHexInRgb(defaultRingOffsetColor),
|
|
268
262
|
"--vl-color-gray-default": convertHexInRgb(colors[gray]?.[defaultBrandShade]),
|
|
269
263
|
"--vl-color-brand-default": convertHexInRgb(colors[brand]?.[defaultGrayShade]),
|