vueless 0.0.714 → 0.0.715

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 CHANGED
@@ -9,9 +9,7 @@ export default {
9
9
  brand: "grayscale",
10
10
  gray: "cool",
11
11
  darkMode: "auto",
12
- ring: 2,
13
- ringOffsetColorLight: "#ffffff", // white
14
- ringOffsetColorDark: "#111827", // gray-900
12
+ outline: 2,
15
13
  rounding: 8,
16
14
 
17
15
  /**
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 DEFAULT_RING = 2; /* pixels */
21
- export const RING_DECREMENT = 1; /* pixels */
22
- export const RING_INCREMENT = 1; /* pixels */
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
- "ring-w": [{ ring: ["dynamic", "dynamic-sm", "dynamic-lg"] }],
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.714",
3
+ "version": "0.0.715",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -12,15 +12,14 @@ import {
12
12
  DARK_MODE_SELECTOR,
13
13
  TAILWIND_COLORS,
14
14
  DEFAULT_ROUNDING,
15
- DEFAULT_RING,
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
- RING_INCREMENT,
23
- RING_DECREMENT,
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
- ringWidth: {
99
- "dynamic-sm": "var(--vl-ring-sm)",
100
- dynamic: "var(--vl-ring)",
101
- "dynamic-lg": "var(--vl-ring-lg)",
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-ring-sm)": globalSettings.ringSm || Math.max(0, (globalSettings.ring || DEFAULT_RING) - RING_DECREMENT),
111
- "var(--vl-ring)": globalSettings.ring || DEFAULT_RING,
112
- "var(--vl-ring-lg)": globalSettings.ringLg || Math.max(0, (globalSettings.ring || DEFAULT_RING) + RING_INCREMENT),
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 ring width.
99
+ * Default components small size outline width.
100
100
  */
101
- ringSm?: number;
101
+ outlineSm?: number;
102
102
 
103
103
  /**
104
- * Default components ring width.
104
+ * Default components outline width.
105
105
  */
106
- ring?: number;
106
+ outline?: number;
107
107
 
108
108
  /**
109
- * Default components large size ring width.
109
+ * Default components large size outline width.
110
110
  */
111
- ringLg?: number;
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-ring-sm": string;
353
- "--vl-ring": string;
354
- "--vl-ring-lg": string;
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;
@@ -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:ring-dynamic focus-visible:ring-offset-2
7
- focus-visible:ring-{color}-600 dark:focus-visible:ring-{color}-400
8
- disabled:cursor-not-allowed disabled:ring-0 disabled:ring-offset-0
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:ring-gray-900 dark:focus-visible:ring-gray-100",
57
+ class: "focus-visible:outline-gray-900 dark:focus-visible:outline-gray-100",
58
58
  },
59
59
  {
60
60
  color: "grayscale",
@@ -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:ring-dynamic focus-visible:ring-offset-4 focus-visible:ring-{color}-600 focus-visible:outline-0
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:ring-gray-900
31
+ focus-visible:outline-gray-900
32
32
  `,
33
- white: "decoration-white text-white focus-visible:ring-white",
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,6 +1,6 @@
1
1
  export default /*tw*/ {
2
2
  toggleButton: {
3
- base: "{UButton} font-normal focus-visible:ring-offset-0",
3
+ base: "{UButton} font-normal focus-visible:outline-offset-0",
4
4
  defaults: {
5
5
  variant: "thirdary",
6
6
  },
@@ -1,20 +1,20 @@
1
1
  export default /*tw*/ {
2
2
  wrapper: {
3
3
  base: `
4
- relative inline-flex items-center outline-0 rounded
5
- focus-visible:ring-dynamic focus-visible:ring-offset-4 focus-visible:ring-{color}-600
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:ring-gray-900",
10
- white: "focus-visible:ring-white",
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:ring-offset-0 focus-visible:ring-0",
17
+ dropdownLink: "{ULink} focus-visible:outline-none",
18
18
  toggleIcon: {
19
19
  base: "{UIcon} block transition duration-300 group-[]:rotate-180",
20
20
  variants: {
@@ -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: "flex items-center rounded-dynamic border border-brand-300",
67
- timepickerInput: "w-10 border-none px-1.5 py-1.5 text-center text-sm focus:ring-0 focus:placeholder:text-gray-900",
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:ring-{color}-600 focus-visible:ring-dynamic focus-visible:ring-offset-2
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:ring-gray-900 active:bg-gray-200 checked:text-gray-900",
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:ring-red-600",
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: "ring-dynamic ring-offset-2 ring-brand-700/15 border-brand-500 hover:border-brand-500",
7
+ base: "outline outline-dynamic-sm outline-brand-600 border-brand-600 hover:border-brand-600",
8
8
  variants: {
9
9
  error: {
10
- true: "ring-red-700/15 border-red-500 hover:border-red-500",
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: "ring-dynamic ring-brand-600 border-brand-600 hover:border-brand-600",
7
+ base: "outline outline-dynamic-sm outline-brand-600 border-brand-600 hover:border-brand-600",
8
8
  variants: {
9
9
  error: {
10
- true: "!border-red-600 ring-red-600",
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:ring-0 focus-within:border-gray-500 hover:focus-within:border-gray-500",
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}",
@@ -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:ring-dynamic-sm focus-within:ring-brand-600
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:ring-red-600",
11
+ true: "!border-red-600 focus-within:outline-red-600",
12
12
  },
13
13
  disabled: {
14
- true: "!border-gray-300 focus-within:ring-0 bg-gray-100",
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:ring-brand-600 focus-within:ring-dynamic-sm
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:ring-red-600",
12
+ true: "!border-red-600 focus-within:outline-red-600",
13
13
  },
14
14
  disabled: {
15
15
  true: "pointer-events-none bg-gray-100",
@@ -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:ring-{color}-600 focus-visible:ring-dynamic focus-visible:ring-offset-2
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:ring-gray-900
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="isSelectedValueLabelVisible"
637
+ v-if="!multiple && isLocalValue"
643
638
  v-bind="selectedLabelAttrs"
644
639
  @mousedown.prevent="toggle"
645
640
  >
@@ -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:ring-brand-600 focus-within:ring-dynamic-sm
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:ring-red-600",
12
+ true: "!border-red-600 focus-within:outline-red-600",
14
13
  },
15
14
  disabled: {
16
15
  true: `
17
- focus-within:ring-0 bg-gray-100
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,8 @@ export default /*tw*/ {
109
108
  ],
110
109
  },
111
110
  search: {
112
- base: "flex w-0",
113
- variants: {
114
- selected: {
115
- false: "w-full",
116
- },
117
- },
118
- compoundVariants: [{ opened: true, searchable: false, class: "w-0" }],
111
+ base: "flex w-full",
112
+ compoundVariants: [{ multiple: false, selected: true, class: "w-0" }],
119
113
  },
120
114
  searchInput: {
121
115
  base: `
@@ -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-2 ring-{color}-600 outline-0
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: "ring-gray-900",
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:border-brand-600 focus-within:ring-dynamic-sm
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:ring-red-600",
14
+ true: "!border-red-600 focus-within:outline-red-600",
16
15
  },
17
16
  disabled: {
18
- true: "!border-gray-300 focus-within:ring-0 bg-gray-100",
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:border-none focus:outline-none focus:ring-0 disabled:cursor-not-allowed
25
+ focus:ring-0 disabled:cursor-not-allowed
27
26
  `,
28
27
  variants: {
29
28
  size: {
@@ -16,11 +16,11 @@ 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-2 focus-visible:ring-{color}-600",
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:ring-gray-900",
23
- white: " focus-visible:ring-gray-900",
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
- DEFAULT_RING,
16
- DEFAULT_RING_OFFSET_COLOR_LIGHT,
17
- DEFAULT_RING_OFFSET_COLOR_DARK,
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
- ringSm: number;
46
- ring: number;
47
- ringLg: number;
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 { ringSm, ring, ringLg } = getRings(
163
- config.ringSm ?? vuelessConfig.ringSm,
164
- config.ring ?? vuelessConfig.ring,
165
- config.ringLg ?? vuelessConfig.ringLg,
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
- ringSm,
210
- ring,
211
- ringLg,
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 ring = Math.max(0, md ?? DEFAULT_RING);
222
- const ringSm = Math.max(0, ring - RING_DECREMENT);
223
- let ringLg = Math.max(0, ring + RING_INCREMENT);
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 (ring === 0) {
226
- ringLg = 0;
209
+ if (outline === 0) {
210
+ outlineLg = 0;
227
211
  }
228
212
 
229
213
  return {
230
- ring,
231
- ringSm: sm === undefined ? ringSm : Math.max(0, sm),
232
- ringLg: lg === undefined ? ringLg : Math.max(0, lg),
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
- colors,
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-ring-sm": `${ringSm}px`,
289
- "--vl-ring": `${ring}px`,
290
- "--vl-ring-lg": `${ringLg}px`,
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
  };