@toife/vue 3.0.5 → 3.0.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toife/vue",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "A Frontend framework for Vue",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -7,7 +7,6 @@ const visible = ref(false);
7
7
  export const useAction = () => {
8
8
  const open = (props: ActionComposableProps) => {
9
9
  data.value = props;
10
- // Defer showing one frame so Present/transition hooks see a clean open cycle
11
10
  setTimeout(() => {
12
11
  visible.value = true;
13
12
  }, 50);
@@ -6,10 +6,13 @@ $shape-pill: sass.fn-naming-prefix("shape-pill");
6
6
 
7
7
  // Property - layer: avatar
8
8
  $border-radius: sass.fn-naming-var("border-radius");
9
- $avatar-background-color: sass.fn-naming-var("avatar", "background-color");
9
+ $border-width: sass.fn-naming-var("stroke", "width");
10
10
  $width: sass.fn-naming-var("width");
11
11
  $transition-duration: sass.fn-naming-var("motion", "duration");
12
12
 
13
+ $avatar-background-color: sass.fn-naming-var("avatar", "background-color");
14
+ $avatar-border-color: sass.fn-naming-var("avatar", "border-color");
15
+
13
16
  // Avatar default is circle
14
17
  // With props square then is square
15
18
  .#{$avatar} {
@@ -28,8 +31,13 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
28
31
  box-shadow #{$transition-duration} ease,
29
32
  border-radius #{$transition-duration} ease;
30
33
  display: inline-block;
34
+ border: #{$border-width} solid transparent;
31
35
 
32
36
  &.#{$shape-pill} {
33
37
  border-radius: 50%;
34
38
  }
39
+
40
+ &.divider {
41
+ border: #{$border-width} solid rgb(#{$avatar-border-color});
42
+ }
35
43
  }
@@ -3,4 +3,6 @@ export type AvatarProps = {
3
3
  shape?: string;
4
4
  size?: string | number;
5
5
  src?: string;
6
+ role?: string;
7
+ divider?: boolean;
6
8
  };
@@ -11,6 +11,8 @@ import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
11
11
  const props = withDefaults(defineProps<AvatarProps>(), {
12
12
  size: "22px",
13
13
  src: "",
14
+ role: undefined,
15
+ divider: undefined,
14
16
  });
15
17
  const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
16
18
 
@@ -18,7 +20,10 @@ const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
18
20
  // ----------------------------------------------------------------------------
19
21
  const avatarAttrs = computed(() => {
20
22
  const shape = props?.shape || appState?.shape.value || "";
21
- const role = appState?.role.value || "";
23
+ const role = props?.role || appState?.role.value || "";
24
+ const divider = (props?.divider !== undefined ? props.divider : appState?.divider.value) ?? false;
25
+ const size = props.size + (typeof props.size === "number" ? "px" : "");
26
+ const backgroundImage = `url(${props.src})`;
22
27
 
23
28
  return {
24
29
  class: [
@@ -26,10 +31,13 @@ const avatarAttrs = computed(() => {
26
31
  withPrefix(["role", role]),
27
32
  withPrefix(["shape", shape]),
28
33
  withPrefix("avatar"),
34
+ {
35
+ divider: divider,
36
+ },
29
37
  ],
30
38
  style: {
31
- [property("width")]: props.size + (typeof props.size === "number" ? "px" : ""),
32
- backgroundImage: `url(${props.src})`,
39
+ [property("width")]: size,
40
+ backgroundImage: backgroundImage,
33
41
  },
34
42
  };
35
43
  });
@@ -25,6 +25,8 @@ $button-background-color-focus: sass.fn-naming-var("button", "background-color",
25
25
  $button-background-color-active: sass.fn-naming-var("button", "background-color", "active");
26
26
  $button-background-color-disabled: sass.fn-naming-var("button", "background-color", "disabled");
27
27
 
28
+ $button-box-shadow-color-focus: sass.fn-naming-var("button", "box-shadow-color", "focus");
29
+
28
30
  $size-font-size: sass.fn-naming-var("font-size");
29
31
  $size-height: sass.fn-naming-var("height");
30
32
  $size-coefficient-x: sass.fn-naming-var("coefficient-x");
@@ -69,7 +71,7 @@ $size-line-height: sass.fn-naming-var("line-height");
69
71
  background-color: rgb(#{$button-background-color-focus});
70
72
 
71
73
  &.shadow {
72
- box-shadow: 0 0 0 0.25rem rgb(#{$button-border-color}, 0.25);
74
+ box-shadow: 0 0 0 0.25rem rgb(#{$button-box-shadow-color-focus}, 0.25);
73
75
  }
74
76
  }
75
77
 
@@ -7,16 +7,25 @@ $shape-rounded: sass.fn-naming-prefix("shape-rounded");
7
7
  $shape-pill: sass.fn-naming-prefix("shape-pill");
8
8
 
9
9
  // Properties - layer: item
10
- $checkbox-background-color: sass.fn-naming-var("checkbox", "background-color");
11
10
  $checkbox-background-color-hover: sass.fn-naming-var("checkbox", "background-color", "hover");
12
- $checkbox-background-color-inactive: sass.fn-naming-var("checkbox", "background-color", "inactive");
13
- $checkbox-background-color-contrast: sass.fn-naming-var("checkbox", "background-color", "contrast");
11
+ $checkbox-background-color-focus: sass.fn-naming-var("checkbox", "background-color", "focus");
12
+ $checkbox-background-color-unchecked: sass.fn-naming-var(
13
+ "checkbox",
14
+ "background-color",
15
+ "unchecked"
16
+ );
17
+ $checkbox-background-color-checked: sass.fn-naming-var("checkbox", "background-color", "checked");
14
18
  $checkbox-background-color-disabled: sass.fn-naming-var("checkbox", "background-color", "disabled");
15
19
 
16
20
  $checkbox-color: sass.fn-naming-var("checkbox", "color");
17
21
 
18
- $checkbox-border-color: sass.fn-naming-var("checkbox", "border-color");
19
- $checkbox-border-color-inactive: sass.fn-naming-var("checkbox", "border-color", "inactive");
22
+ $checkbox-border-color-hover: sass.fn-naming-var("checkbox", "border-color", "hover");
23
+ $checkbox-border-color-focus: sass.fn-naming-var("checkbox", "border-color", "focus");
24
+ $checkbox-border-color-checked: sass.fn-naming-var("checkbox", "border-color", "checked");
25
+ $checkbox-border-color-unchecked: sass.fn-naming-var("checkbox", "border-color", "unchecked");
26
+ $checkbox-border-color-disabled: sass.fn-naming-var("checkbox", "border-color", "disabled");
27
+
28
+ $checkbox-box-shadow-color-focus: sass.fn-naming-var("checkbox", "box-shadow-color", "focus");
20
29
 
21
30
  $transition-duration: sass.fn-naming-var("motion", "duration");
22
31
  $border-radius: sass.fn-naming-var("border-radius");
@@ -37,7 +46,7 @@ $border-radius: sass.fn-naming-var("border-radius");
37
46
  display: flex;
38
47
  align-items: center;
39
48
  justify-content: center;
40
- border: 1px solid rgb(#{$checkbox-border-color-inactive});
49
+ border: 1px solid rgb(#{$checkbox-color});
41
50
  background-color: transparent;
42
51
  transition:
43
52
  box-shadow #{$transition-duration} ease,
@@ -53,7 +62,7 @@ $border-radius: sass.fn-naming-var("border-radius");
53
62
  content: "";
54
63
  width: 0.2rem;
55
64
  height: 0.5rem;
56
- border: solid rgb(#{$checkbox-background-color-contrast});
65
+ border: solid rgb(#{$checkbox-color});
57
66
  border-width: 0 2px 2px 0;
58
67
  transform: rotate(45deg) scale(0);
59
68
  transform-origin: center;
@@ -77,13 +86,12 @@ $border-radius: sass.fn-naming-var("border-radius");
77
86
  &:not(.on) {
78
87
  .#{$checkbox-icon} {
79
88
  background-color: transparent;
80
- border-color: rgb(#{$checkbox-border-color-inactive});
89
+ border-color: rgb(#{$checkbox-border-color-unchecked});
81
90
  }
82
91
 
83
92
  &:not(.disabled):not(.readonly):hover {
84
93
  .#{$checkbox-icon} {
85
- border-color: rgb(#{$checkbox-border-color});
86
- background-color: rgba(#{$checkbox-background-color-hover}, 0.2);
94
+ border-color: rgb(#{$checkbox-border-color-hover});
87
95
  }
88
96
  }
89
97
  }
@@ -91,8 +99,8 @@ $border-radius: sass.fn-naming-var("border-radius");
91
99
  &.on {
92
100
  &.fill {
93
101
  .#{$checkbox-icon} {
94
- background-color: rgb(#{$checkbox-background-color});
95
- border-color: rgb(#{$checkbox-background-color});
102
+ background-color: rgb(#{$checkbox-background-color-checked});
103
+ border-color: rgb(#{$checkbox-border-color-checked});
96
104
 
97
105
  &::after {
98
106
  transform: rotate(45deg) scale(1);
@@ -102,11 +110,11 @@ $border-radius: sass.fn-naming-var("border-radius");
102
110
 
103
111
  &.outline {
104
112
  .#{$checkbox-icon} {
105
- border-color: rgb(#{$checkbox-background-color});
113
+ border-color: rgb(#{$checkbox-border-color-checked});
106
114
 
107
115
  &::after {
108
116
  transform: rotate(45deg) scale(1);
109
- border-color: rgb(#{$checkbox-background-color});
117
+ border-color: rgb(#{$checkbox-background-color-checked});
110
118
  }
111
119
  }
112
120
  }
@@ -119,7 +127,7 @@ $border-radius: sass.fn-naming-var("border-radius");
119
127
  &.on {
120
128
  .#{$checkbox-icon} {
121
129
  background-color: rgb(#{$checkbox-background-color-disabled});
122
- border-color: rgb(#{$checkbox-background-color-disabled});
130
+ border-color: rgb(#{$checkbox-border-color-disabled});
123
131
  }
124
132
  }
125
133
  }
@@ -131,8 +139,12 @@ $border-radius: sass.fn-naming-var("border-radius");
131
139
  &.focus {
132
140
  &.shadow {
133
141
  .#{$checkbox-icon} {
134
- box-shadow: 0 0 0 0.25rem rgb(#{$checkbox-border-color}, 0.25);
142
+ box-shadow: 0 0 0 0.25rem rgb(#{$checkbox-box-shadow-color-focus}, 0.25);
135
143
  }
136
144
  }
145
+
146
+ .#{$checkbox-icon} {
147
+ border-color: rgb(#{$checkbox-border-color-focus});
148
+ }
137
149
  }
138
150
  }
@@ -32,7 +32,7 @@ const checkboxAttrs = computed(() => {
32
32
  return {
33
33
  class: [
34
34
  withPrefix(["layer", "checkbox"]),
35
- withPrefix(["role", props.modelValue && !props.disabled ? role : baseRole]),
35
+ withPrefix(["role", role]),
36
36
  withPrefix(["shape", shape]),
37
37
  withPrefix("checkbox"),
38
38
  props.variant,
@@ -40,7 +40,7 @@ const checkboxAttrs = computed(() => {
40
40
  on: props.modelValue,
41
41
  disabled: props.disabled,
42
42
  readonly: props.readonly,
43
- shadow,
43
+ shadow: shadow && !props.disabled && isFocused.value,
44
44
  focus: isFocused.value,
45
45
  },
46
46
  ],
@@ -68,6 +68,7 @@ $transition-duration: sass.fn-naming-var("motion", "duration");
68
68
  font-size: #{$size-font-size};
69
69
  line-height: #{$size-line-height};
70
70
  box-sizing: border-box;
71
+ width: 100%;
71
72
  transition:
72
73
  box-shadow #{$transition-duration} ease,
73
74
  border-color #{$transition-duration} ease,
@@ -1,4 +1,5 @@
1
1
  // Type definitions
2
2
  export type GestureIndicatorProps = {
3
3
  placement?: string;
4
+ role?: string;
4
5
  };
@@ -10,13 +10,15 @@ import { type AppProviderState, APP_PROVIDER_STATE_KEY } from "../app";
10
10
  // ----------------------------------------------------------------------------
11
11
  const props = withDefaults(defineProps<GestureIndicatorProps>(), {
12
12
  placement: "bottom",
13
+ role: undefined,
13
14
  });
14
15
  const appState = inject<AppProviderState>(APP_PROVIDER_STATE_KEY);
15
16
 
16
17
  // Computed properties
17
18
  // ----------------------------------------------------------------------------
18
19
  const gestureIndicatorAttrs = computed(() => {
19
- const role = appState?.role.value || "";
20
+ const role = props.role || appState?.role.value || "";
21
+
20
22
  return {
21
23
  class: [
22
24
  withPrefix(["layer", "gesture-indicator"]),
@@ -4,20 +4,22 @@
4
4
  $radio: sass.fn-naming-prefix("radio");
5
5
  $radio-icon: sass.fn-naming-prefix("radio-icon");
6
6
 
7
- // Property name - layer: radio (states align with button + checkbox: inactive + contrast)
8
- $radio-background-color: sass.fn-naming-var("radio", "background-color");
7
+ // Properties - layer: item
9
8
  $radio-background-color-hover: sass.fn-naming-var("radio", "background-color", "hover");
10
9
  $radio-background-color-focus: sass.fn-naming-var("radio", "background-color", "focus");
11
- $radio-background-color-active: sass.fn-naming-var("radio", "background-color", "active");
10
+ $radio-background-color-unchecked: sass.fn-naming-var("radio", "background-color", "unchecked");
11
+ $radio-background-color-checked: sass.fn-naming-var("radio", "background-color", "checked");
12
12
  $radio-background-color-disabled: sass.fn-naming-var("radio", "background-color", "disabled");
13
- $radio-background-color-contrast: sass.fn-naming-var("radio", "background-color", "contrast");
14
13
 
15
- $radio-border-color: sass.fn-naming-var("radio", "border-color");
14
+ $radio-color: sass.fn-naming-var("radio", "color");
15
+
16
16
  $radio-border-color-hover: sass.fn-naming-var("radio", "border-color", "hover");
17
17
  $radio-border-color-focus: sass.fn-naming-var("radio", "border-color", "focus");
18
- $radio-border-color-active: sass.fn-naming-var("radio", "border-color", "active");
18
+ $radio-border-color-checked: sass.fn-naming-var("radio", "border-color", "checked");
19
+ $radio-border-color-unchecked: sass.fn-naming-var("radio", "border-color", "unchecked");
19
20
  $radio-border-color-disabled: sass.fn-naming-var("radio", "border-color", "disabled");
20
- $radio-border-color-inactive: sass.fn-naming-var("radio", "border-color", "inactive");
21
+
22
+ $radio-box-shadow-color-focus: sass.fn-naming-var("radio", "box-shadow-color", "focus");
21
23
 
22
24
  $transition-duration: sass.fn-naming-var("motion", "duration");
23
25
  $border-radius: sass.fn-naming-var("border-radius");
@@ -38,7 +40,7 @@ $border-radius: sass.fn-naming-var("border-radius");
38
40
  display: flex;
39
41
  align-items: center;
40
42
  justify-content: center;
41
- border: 1px solid rgb(#{$radio-border-color-inactive});
43
+ border: 1px solid rgb(#{$radio-color});
42
44
  background-color: transparent;
43
45
  transition:
44
46
  box-shadow #{$transition-duration} ease,
@@ -55,8 +57,9 @@ $border-radius: sass.fn-naming-var("border-radius");
55
57
  width: 0.5rem;
56
58
  height: 0.5rem;
57
59
  border-radius: 50%;
58
- background-color: rgb(#{$radio-background-color-contrast});
60
+ background-color: rgb(#{$radio-color});
59
61
  transform: scale(0);
62
+ transform-origin: center;
60
63
  transition:
61
64
  transform #{$transition-duration} ease,
62
65
  background-color #{$transition-duration} ease,
@@ -68,13 +71,12 @@ $border-radius: sass.fn-naming-var("border-radius");
68
71
  &:not(.on) {
69
72
  .#{$radio-icon} {
70
73
  background-color: transparent;
71
- border-color: rgb(#{$radio-border-color-inactive});
74
+ border-color: rgb(#{$radio-border-color-unchecked});
72
75
  }
73
76
 
74
77
  &:not(.disabled):not(.readonly):hover {
75
78
  .#{$radio-icon} {
76
79
  border-color: rgb(#{$radio-border-color-hover});
77
- background-color: rgba(#{$radio-background-color-hover}, 0.2);
78
80
  }
79
81
  }
80
82
  }
@@ -82,8 +84,8 @@ $border-radius: sass.fn-naming-var("border-radius");
82
84
  &.on {
83
85
  &.fill {
84
86
  .#{$radio-icon} {
85
- background-color: rgb(#{$radio-background-color});
86
- border-color: rgb(#{$radio-background-color});
87
+ background-color: rgb(#{$radio-background-color-checked});
88
+ border-color: rgb(#{$radio-border-color-checked});
87
89
 
88
90
  &::after {
89
91
  transform: scale(1);
@@ -93,12 +95,11 @@ $border-radius: sass.fn-naming-var("border-radius");
93
95
 
94
96
  &.outline {
95
97
  .#{$radio-icon} {
96
- background-color: transparent;
97
- border-color: rgb(#{$radio-background-color});
98
+ border-color: rgb(#{$radio-border-color-checked});
98
99
 
99
100
  &::after {
100
- transform: scale(1.5);
101
- background-color: rgb(#{$radio-background-color});
101
+ transform: scale(1);
102
+ background-color: rgb(#{$radio-background-color-checked});
102
103
  }
103
104
  }
104
105
  }
@@ -123,8 +124,12 @@ $border-radius: sass.fn-naming-var("border-radius");
123
124
  &.focus {
124
125
  &.shadow {
125
126
  .#{$radio-icon} {
126
- box-shadow: 0 0 0 0.25rem rgb(#{$radio-border-color-focus}, 0.25);
127
+ box-shadow: 0 0 0 0.25rem rgb(#{$radio-box-shadow-color-focus}, 0.25);
127
128
  }
128
129
  }
130
+
131
+ .#{$radio-icon} {
132
+ border-color: rgb(#{$radio-border-color-focus});
133
+ }
129
134
  }
130
135
  }
@@ -25,14 +25,6 @@ const isFocused = ref(false);
25
25
 
26
26
  // Computed properties
27
27
  // ----------------------------------------------------------------------------
28
- const role = computed(() => {
29
- return props.role || radioGroupState?.role.value || appState?.role.value || "";
30
- });
31
-
32
- const variant = computed(() => {
33
- return props.variant || radioGroupState?.variant.value || "";
34
- });
35
-
36
28
  const disabled = computed(() => {
37
29
  return props.disabled || (radioGroupState?.disabled.value ?? false);
38
30
  });
@@ -41,29 +33,23 @@ const readonly = computed(() => {
41
33
  return props.readonly || (radioGroupState?.readonly.value ?? false);
42
34
  });
43
35
 
44
- const isChecked = computed(() => {
45
- return radioGroupState?.modelValue.value === props.value;
46
- });
47
-
48
36
  const radioAttrs = computed(() => {
49
- const shadow =
50
- (props?.shadow !== undefined ? props.shadow : radioGroupState?.shadow.value) ?? false;
37
+ const shadow = (props?.shadow !== undefined ? props.shadow : appState?.shadow.value) ?? false;
38
+ const role = props.role || radioGroupState?.role.value || appState?.role.value || "";
39
+ const variant = props.variant || radioGroupState?.variant.value || "";
40
+ const isChecked = radioGroupState?.modelValue.value === props.value;
41
+
51
42
  return {
52
43
  class: [
53
44
  withPrefix(["layer", "radio"]),
54
- withPrefix([
55
- "role",
56
- (isChecked.value && !disabled.value
57
- ? role.value || radioGroupState?.role.value
58
- : appState?.role.value) ?? "",
59
- ]),
45
+ withPrefix(["role", role]),
60
46
  withPrefix("radio"),
61
- variant.value,
47
+ variant,
62
48
  {
63
- on: isChecked.value,
49
+ on: isChecked,
64
50
  disabled: disabled.value,
65
51
  readonly: readonly.value,
66
- shadow,
52
+ shadow: shadow && !props.disabled && isFocused.value,
67
53
  focus: isFocused.value,
68
54
  },
69
55
  ],
@@ -8,13 +8,15 @@ $shape-pill: sass.fn-naming-prefix("shape-pill");
8
8
  $switch-wrapper: sass.fn-naming-prefix("switch-wrapper");
9
9
 
10
10
  // Property name - layer: switch (track + thumb; states like button + inactive)
11
- $switch-background-color: sass.fn-naming-var("switch", "background-color");
12
- $switch-background-color-hover: sass.fn-naming-var("switch", "background-color", "hover");
13
- $switch-background-color-inactive: sass.fn-naming-var("switch", "background-color", "inactive");
11
+ $switch-background-color-off: sass.fn-naming-var("switch", "background-color", "off");
12
+ $switch-background-color-on: sass.fn-naming-var("switch", "background-color", "on");
14
13
  $switch-background-color-disabled: sass.fn-naming-var("switch", "background-color", "disabled");
15
- $switch-background-color-contrast: sass.fn-naming-var("switch", "background-color", "contrast");
16
14
 
17
- $switch-border-color-focus: sass.fn-naming-var("switch", "border-color", "focus");
15
+ $switch-color-on: sass.fn-naming-var("switch", "color", "on");
16
+ $switch-color-off: sass.fn-naming-var("switch", "color", "off");
17
+ $switch-color-disabled: sass.fn-naming-var("switch", "color", "disabled");
18
+
19
+ $switch-box-shadow-color-focus: sass.fn-naming-var("switch", "box-shadow-color", "focus");
18
20
 
19
21
  $transition-duration: sass.fn-naming-var("motion", "duration");
20
22
  $border-radius: sass.fn-naming-var("border-radius");
@@ -31,7 +33,6 @@ $spacing-x: sass.fn-naming-var("spacing", "x");
31
33
  height: 1.5rem;
32
34
  aspect-ratio: 11/6;
33
35
  position: relative;
34
- overflow: hidden;
35
36
  transition:
36
37
  background-color #{$transition-duration} ease,
37
38
  color #{$transition-duration} ease,
@@ -44,7 +45,6 @@ $spacing-x: sass.fn-naming-var("spacing", "x");
44
45
  height: calc(100% - 0.3rem);
45
46
  position: absolute;
46
47
  top: 0;
47
- background-color: rgb(#{$switch-background-color-contrast});
48
48
  border-radius: #{$border-radius};
49
49
  aspect-ratio: 1/1;
50
50
  margin: 0.15rem;
@@ -76,6 +76,10 @@ $spacing-x: sass.fn-naming-var("spacing", "x");
76
76
  background-color: rgb(#{$switch-background-color-disabled});
77
77
  cursor: not-allowed;
78
78
  opacity: 0.3;
79
+
80
+ .#{$switch-icon} {
81
+ background-color: rgb(#{$switch-color-disabled});
82
+ }
79
83
  }
80
84
  }
81
85
 
@@ -89,26 +93,24 @@ $spacing-x: sass.fn-naming-var("spacing", "x");
89
93
 
90
94
  &:not(.on) {
91
95
  .#{$switch} {
92
- background-color: rgb(#{$switch-background-color-inactive});
96
+ background-color: rgb(#{$switch-background-color-off});
93
97
 
94
98
  .#{$switch-icon} {
99
+ background-color: rgb(#{$switch-color-off});
95
100
  left: 0;
96
101
  }
97
-
98
- &:not(.disabled):not(.readonly):hover {
99
- background-color: rgb(#{$switch-background-color-hover});
100
- }
101
102
  }
102
103
  }
103
104
 
104
105
  &.on {
105
106
  .#{$switch} {
106
- background-color: rgb(#{$switch-background-color});
107
+ background-color: rgb(#{$switch-background-color-on});
107
108
 
108
109
  .#{$switch-icon} {
109
110
  right: 0;
110
111
  animation: shrink #{$transition-duration} linear;
111
112
  animation-fill-mode: forwards;
113
+ background-color: rgb(#{$switch-color-on});
112
114
  }
113
115
  }
114
116
  }
@@ -116,7 +118,7 @@ $spacing-x: sass.fn-naming-var("spacing", "x");
116
118
  &.focus {
117
119
  &.shadow {
118
120
  .#{$switch} {
119
- box-shadow: 0 0 0 0.25rem rgb(#{$switch-border-color-focus}, 0.25);
121
+ box-shadow: 0 0 0 0.25rem rgb(#{$switch-box-shadow-color-focus}, 0.25);
120
122
  }
121
123
  }
122
124
  }
@@ -30,7 +30,7 @@ const switchWrapperAttrs = computed(() => {
30
30
  {
31
31
  disabled: props.disabled,
32
32
  readonly: props.readonly,
33
- shadow,
33
+ shadow: shadow && !props.disabled && isFocused.value,
34
34
  focus: isFocused.value,
35
35
  on: props.modelValue,
36
36
  },
@@ -45,7 +45,7 @@ const switchAttrs = computed(() => {
45
45
  return {
46
46
  class: [
47
47
  withPrefix(["layer", "switch"]),
48
- withPrefix(["role", props.modelValue && !props.disabled ? role : baseRole]),
48
+ withPrefix(["role", role]),
49
49
  withPrefix(["shape", shape]),
50
50
  withPrefix("switch"),
51
51
  ],