@fluentui/react-switch 9.75.1-experimental.css-modules.20261103-d6c85ee2a9.0 → 9.75.2-experimental.css-modules.20261113-ba13c87438.0
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/CHANGELOG.md +11 -11
- package/README.md +4 -4
- package/lib/components/Switch/Switch.module.css +229 -230
- package/lib/components/Switch/useSwitch.js +6 -5
- package/lib/components/Switch/useSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/Switch.module.css +229 -230
- package/lib-commonjs/components/Switch/useSwitch.cjs +5 -4
- package/lib-commonjs/components/Switch/useSwitch.cjs.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-switch
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 13 Nov 2026 20:37:00 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.75.
|
|
7
|
+
## [9.75.2-experimental.css-modules.20261113-ba13c87438.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.75.2-experimental.css-modules.20261113-ba13c87438.0)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Fri, 13 Nov 2026 20:37:00 GMT
|
|
10
10
|
|
|
11
11
|
### Changes
|
|
12
12
|
|
|
13
|
-
- Release 9.75.
|
|
14
|
-
- Bump @fluentui/react-field to v9.75.
|
|
15
|
-
- Bump @fluentui/react-jsx-runtime to v9.75.
|
|
16
|
-
- Bump @fluentui/react-label to v9.75.
|
|
17
|
-
- Bump @fluentui/react-shared-contexts to v9.75.
|
|
18
|
-
- Bump @fluentui/react-tabster to v9.75.
|
|
19
|
-
- Bump @fluentui/react-theme to v9.75.
|
|
20
|
-
- Bump @fluentui/react-utilities to v9.75.
|
|
13
|
+
- Release 9.75.2-experimental.css-modules.20261113-ba13c87438 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
14
|
+
- Bump @fluentui/react-field to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
15
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-label to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tabster to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-theme to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
- Bump @fluentui/react-utilities to v9.75.2-experimental.css-modules.20261113-ba13c87438.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
21
21
|
|
|
22
22
|
## [9.7.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.7.7)
|
|
23
23
|
|
package/README.md
CHANGED
|
@@ -31,16 +31,16 @@ Alternatively, run Storybook locally with:
|
|
|
31
31
|
|
|
32
32
|
### Specification
|
|
33
33
|
|
|
34
|
-
See [SPEC.md](./Spec.md).
|
|
34
|
+
See [SPEC.md](./docs/Spec.md).
|
|
35
35
|
|
|
36
36
|
### Migration Guide
|
|
37
37
|
|
|
38
|
-
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating to the latest Switch implementation.
|
|
38
|
+
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./docs/MIGRATION.md) for guidance on updating to the latest Switch implementation.
|
|
39
39
|
|
|
40
40
|
## Opt-in CSS Modules styles
|
|
41
41
|
|
|
42
42
|
CSS Modules alternatives are available for `Switch`. The default exports and component imports continue to use Griffel.
|
|
43
43
|
|
|
44
|
-
To opt in, configure your bundler to replace each `use<Component>Styles.styles.js` module with its adjacent `use<Component>Styles.styles.css.js` alternative (or `.styles.ts` with `.styles.css.ts` for source builds). Apply the replacement consistently to client and server bundles. The CSS loader must provide a default class-name map and retain the adjacent `.module.css` asset, including CSS from dependencies.
|
|
44
|
+
To opt in, configure your bundler to replace each `use<Component>Styles.styles.js` module with its adjacent `use<Component>Styles.styles.css.js` alternative (or `.styles.ts` with `.styles.css.ts` for source builds). Apply the replacement consistently to client and server bundles. The CSS loader must provide a default class-name map and retain the adjacent `.module.css` asset, including CSS from dependencies. Component rules are unlayered, like Griffel's, and use the theme custom properties supplied by `FluentProvider`.
|
|
45
45
|
|
|
46
|
-
For composed labels, also select the CSS Modules alternative for `@fluentui/react-label`. Mixing its default
|
|
46
|
+
For composed labels, also select the CSS Modules alternative for `@fluentui/react-label`. Mixing its default Griffel styles with these alternatives makes label typography depend on style insertion order.
|
|
@@ -1,290 +1,289 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/* @griffel-buckets reset: .root, .indicator, .input */
|
|
2
|
+
.root:focus {
|
|
3
|
+
outline-style: none;
|
|
4
|
+
}
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
.root:focus-visible {
|
|
7
|
+
outline-style: none;
|
|
8
|
+
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
.root[data-fui-focus-within]:focus-within::after {
|
|
11
|
+
content: '';
|
|
12
|
+
position: absolute;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
z-index: 1;
|
|
15
|
+
border: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
16
|
+
border-radius: var(--borderRadiusMedium);
|
|
17
|
+
top: calc(var(--strokeWidthThick) * -1);
|
|
18
|
+
inset-inline-end: calc(var(--strokeWidthThick) * -1);
|
|
19
|
+
bottom: calc(var(--strokeWidthThick) * -1);
|
|
20
|
+
inset-inline-start: calc(var(--strokeWidthThick) * -1);
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
.root[data-fui-focus-within]:focus-within {
|
|
24
|
+
border-top-color: transparent;
|
|
25
|
+
border-inline-end-color: transparent;
|
|
26
|
+
border-bottom-color: transparent;
|
|
27
|
+
border-inline-start-color: transparent;
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
.root {
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
position: relative;
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
.above {
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
.indicator > * {
|
|
42
|
+
transition-duration: var(--durationNormal);
|
|
43
|
+
transition-timing-function: var(--curveEasyEase);
|
|
44
|
+
transition-property: transform;
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
.indicator {
|
|
48
|
+
border-radius: var(--borderRadiusCircular);
|
|
49
|
+
border: var(--strokeWidthThin) solid;
|
|
50
|
+
line-height: 0;
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
fill: currentColor;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
font-size: calc(var(--spacingHorizontalXS) * 4.5);
|
|
55
|
+
height: var(--spacingHorizontalXL);
|
|
56
|
+
margin: var(--spacingVerticalS) var(--spacingHorizontalS);
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
transition-duration: var(--durationNormal);
|
|
59
|
+
transition-timing-function: var(--curveEasyEase);
|
|
60
|
+
transition-property: background, border, color;
|
|
61
|
+
width: calc(var(--spacingHorizontalXS) * 10);
|
|
62
|
+
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
:where(.withLabel.above) > .indicator {
|
|
65
|
+
margin-top: 0;
|
|
66
|
+
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
:where(.small) > .indicator {
|
|
69
|
+
font-size: var(--fontSizeBase300);
|
|
70
|
+
height: var(--spacingHorizontalL);
|
|
71
|
+
width: var(--spacingHorizontalXXXL);
|
|
72
|
+
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
.input:checked ~ :global(.fui-Switch__indicator) > * {
|
|
75
|
+
transform: translateX(var(--spacingHorizontalXL));
|
|
76
|
+
}
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
.input:checked ~ :global(.fui-Switch__indicator) > *:where(:dir(rtl)) {
|
|
79
|
+
transform: translateX(calc(var(--spacingHorizontalXL) * -1));
|
|
80
|
+
}
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
.input:disabled ~ :global(.fui-Switch__indicator),
|
|
83
|
+
.input[aria-disabled='true'] ~ :global(.fui-Switch__indicator) {
|
|
84
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
85
|
+
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
.input:disabled ~ :global(.fui-Switch__label),
|
|
88
|
+
.input[aria-disabled='true'] ~ :global(.fui-Switch__label) {
|
|
89
|
+
cursor: default;
|
|
90
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
91
|
+
}
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
.input:disabled,
|
|
94
|
+
.input[aria-disabled='true'] {
|
|
95
|
+
cursor: default;
|
|
96
|
+
}
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
.input:enabled:not(:checked):not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
|
|
99
|
+
color: var(--colorNeutralStrokeAccessible);
|
|
100
|
+
border-color: var(--colorNeutralStrokeAccessible);
|
|
101
|
+
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
.input:enabled:not(:checked):not([aria-disabled='true']) ~ :global(.fui-Switch__label) {
|
|
104
|
+
color: var(--colorNeutralForeground1);
|
|
105
|
+
}
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
.input:enabled:not(:checked):not([aria-disabled='true']):hover ~ :global(.fui-Switch__indicator) {
|
|
108
|
+
color: var(--colorNeutralStrokeAccessibleHover);
|
|
109
|
+
border-color: var(--colorNeutralStrokeAccessibleHover);
|
|
110
|
+
}
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
.input:enabled:not(:checked):not([aria-disabled='true']):hover:active ~ :global(.fui-Switch__indicator) {
|
|
113
|
+
color: var(--colorNeutralStrokeAccessiblePressed);
|
|
114
|
+
border-color: var(--colorNeutralStrokeAccessiblePressed);
|
|
115
|
+
}
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
.input:enabled:checked:not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
|
|
118
|
+
background-color: var(--colorCompoundBrandBackground);
|
|
119
|
+
color: var(--colorNeutralForegroundInverted);
|
|
120
|
+
border-color: var(--colorTransparentStroke);
|
|
121
|
+
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
.input:enabled:checked:not([aria-disabled='true']):hover ~ :global(.fui-Switch__indicator) {
|
|
124
|
+
background-color: var(--colorCompoundBrandBackgroundHover);
|
|
125
|
+
border-color: var(--colorTransparentStrokeInteractive);
|
|
126
|
+
}
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
.input:enabled:checked:not([aria-disabled='true']):hover:active ~ :global(.fui-Switch__indicator) {
|
|
129
|
+
background-color: var(--colorCompoundBrandBackgroundPressed);
|
|
130
|
+
border-color: var(--colorTransparentStrokeInteractive);
|
|
131
|
+
}
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
.input:disabled:not(:checked) ~ :global(.fui-Switch__indicator),
|
|
134
|
+
.input[aria-disabled='true']:not(:checked) ~ :global(.fui-Switch__indicator) {
|
|
135
|
+
border-color: var(--colorNeutralStrokeDisabled);
|
|
136
|
+
}
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
.input:disabled:checked ~ :global(.fui-Switch__indicator),
|
|
139
|
+
.input[aria-disabled='true']:checked ~ :global(.fui-Switch__indicator) {
|
|
140
|
+
background-color: var(--colorNeutralBackgroundDisabled);
|
|
141
|
+
border-color: var(--colorTransparentStrokeDisabled);
|
|
142
|
+
}
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
.input {
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
height: 100%;
|
|
148
|
+
margin: 0;
|
|
149
|
+
opacity: 0;
|
|
150
|
+
position: absolute;
|
|
151
|
+
width: calc(calc(var(--spacingHorizontalXS) * 10) + 2 * var(--spacingHorizontalS));
|
|
152
|
+
}
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
:where(.withLabel.before) > .input {
|
|
155
|
+
inset-inline-end: 0;
|
|
156
|
+
top: 0;
|
|
157
|
+
}
|
|
158
158
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
:where(.withLabel.after) > .input {
|
|
160
|
+
inset-inline-start: 0;
|
|
161
|
+
top: 0;
|
|
162
|
+
}
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
:where(.withLabel.above) > .input {
|
|
165
|
+
bottom: 0;
|
|
166
|
+
height: calc(var(--spacingHorizontalXL) + var(--spacingVerticalS));
|
|
167
|
+
width: 100%;
|
|
168
|
+
}
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
:where(.small) > .input:checked ~ :global(.fui-Switch__indicator) > * {
|
|
171
|
+
transform: translateX(var(--spacingHorizontalL));
|
|
172
|
+
}
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
:where(.small) > .input:checked ~ :global(.fui-Switch__indicator) > *:where(:dir(rtl)) {
|
|
175
|
+
transform: translateX(calc(var(--spacingHorizontalL) * -1));
|
|
176
|
+
}
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
:where(.small) > .input {
|
|
179
|
+
width: calc(var(--spacingHorizontalXXXL) + 2 * var(--spacingHorizontalS));
|
|
180
|
+
}
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
.label {
|
|
183
|
+
cursor: pointer;
|
|
184
|
+
margin-bottom: calc((var(--spacingHorizontalXL) - var(--lineHeightBase300)) / 2);
|
|
185
|
+
margin-top: calc((var(--spacingHorizontalXL) - var(--lineHeightBase300)) / 2);
|
|
186
|
+
padding: var(--spacingVerticalS) var(--spacingHorizontalS);
|
|
187
|
+
}
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
189
|
+
:where(.small) > .label {
|
|
190
|
+
font-size: var(--fontSizeBase200);
|
|
191
|
+
line-height: var(--lineHeightBase200);
|
|
192
|
+
margin-bottom: calc((var(--spacingHorizontalL) - var(--lineHeightBase200)) / 2);
|
|
193
|
+
margin-top: calc((var(--spacingHorizontalL) - var(--lineHeightBase200)) / 2);
|
|
194
|
+
}
|
|
195
195
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
:where(.above) > .label {
|
|
197
|
+
padding-top: var(--spacingVerticalXS);
|
|
198
|
+
padding-bottom: var(--spacingVerticalXS);
|
|
199
|
+
width: 100%;
|
|
200
|
+
}
|
|
201
201
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
:where(.after) > .label {
|
|
203
|
+
padding-inline-start: var(--spacingHorizontalXS);
|
|
204
|
+
}
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
:where(.before) > .label {
|
|
207
|
+
padding-inline-end: var(--spacingHorizontalXS);
|
|
208
|
+
}
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
210
|
+
@media (forced-colors: active) {
|
|
211
|
+
.root[data-fui-focus-within]:focus-within::after {
|
|
212
|
+
border-top-color: Highlight;
|
|
213
|
+
border-inline-end-color: Highlight;
|
|
214
|
+
border-bottom-color: Highlight;
|
|
215
|
+
border-inline-start-color: Highlight;
|
|
217
216
|
}
|
|
217
|
+
}
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
219
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
220
|
+
.indicator {
|
|
221
|
+
transition-duration: 0.01ms;
|
|
223
222
|
}
|
|
223
|
+
}
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
225
|
+
@media (forced-colors: active) {
|
|
226
|
+
.indicator > i {
|
|
227
|
+
forced-color-adjust: none;
|
|
229
228
|
}
|
|
229
|
+
}
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
231
|
+
@media (forced-colors: active) {
|
|
232
|
+
.indicator {
|
|
233
|
+
color: CanvasText;
|
|
235
234
|
}
|
|
235
|
+
}
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
237
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
238
|
+
.indicator > * {
|
|
239
|
+
transition-duration: 0.01ms;
|
|
241
240
|
}
|
|
241
|
+
}
|
|
242
242
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
243
|
+
@media (forced-colors: active) {
|
|
244
|
+
.input:disabled ~ :global(.fui-Switch__indicator),
|
|
245
|
+
.input[aria-disabled='true'] ~ :global(.fui-Switch__indicator) {
|
|
246
|
+
color: GrayText;
|
|
247
|
+
border-color: GrayText;
|
|
249
248
|
}
|
|
249
|
+
}
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
251
|
+
@media (forced-colors: active) {
|
|
252
|
+
.input:disabled ~ :global(.fui-Switch__label),
|
|
253
|
+
.input[aria-disabled='true'] ~ :global(.fui-Switch__label) {
|
|
254
|
+
color: GrayText;
|
|
256
255
|
}
|
|
256
|
+
}
|
|
257
257
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
258
|
+
@media (forced-colors: active) {
|
|
259
|
+
.input:hover {
|
|
260
|
+
color: CanvasText;
|
|
262
261
|
}
|
|
262
|
+
}
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
264
|
+
@media (forced-colors: active) {
|
|
265
|
+
.input:hover:active {
|
|
266
|
+
color: CanvasText;
|
|
268
267
|
}
|
|
268
|
+
}
|
|
269
269
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
270
|
+
@media (forced-colors: active) {
|
|
271
|
+
.input:enabled:checked:not([aria-disabled='true']):hover ~ :global(.fui-Switch__indicator) {
|
|
272
|
+
background-color: Highlight;
|
|
273
|
+
color: Canvas;
|
|
275
274
|
}
|
|
275
|
+
}
|
|
276
276
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
277
|
+
@media (forced-colors: active) {
|
|
278
|
+
.input:enabled:checked:not([aria-disabled='true']):hover:active ~ :global(.fui-Switch__indicator) {
|
|
279
|
+
background-color: Highlight;
|
|
280
|
+
color: Canvas;
|
|
282
281
|
}
|
|
282
|
+
}
|
|
283
283
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
284
|
+
@media (forced-colors: active) {
|
|
285
|
+
.input:enabled:checked:not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
|
|
286
|
+
background-color: Highlight;
|
|
287
|
+
color: Canvas;
|
|
289
288
|
}
|
|
290
289
|
}
|
|
@@ -4,7 +4,7 @@ import { useFieldControlProps_unstable } from "@fluentui/react-field";
|
|
|
4
4
|
import { CircleFilled } from "@fluentui/react-icons";
|
|
5
5
|
import { Label } from "@fluentui/react-label";
|
|
6
6
|
import { useFocusWithin } from "@fluentui/react-tabster";
|
|
7
|
-
import { getPartitionedNativeProps, mergeCallbacks, useId, slot } from "@fluentui/react-utilities";
|
|
7
|
+
import { getPartitionedNativeProps, mergeCallbacks, useId, useMergedRefs, slot } from "@fluentui/react-utilities";
|
|
8
8
|
/**
|
|
9
9
|
* Create the state required to render Switch.
|
|
10
10
|
*
|
|
@@ -17,6 +17,10 @@ import { getPartitionedNativeProps, mergeCallbacks, useId, slot } from "@fluentu
|
|
|
17
17
|
var _baseState_indicator, _children;
|
|
18
18
|
const { size = 'medium', ...baseProps } = props;
|
|
19
19
|
const baseState = useSwitchBase_unstable(baseProps, ref);
|
|
20
|
+
// Focus-within ref drives the styled focus outline; applied here rather than in the base hook
|
|
21
|
+
// so the base hook does not depend on react-tabster (keyborg).
|
|
22
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
23
|
+
baseState.root.ref = useMergedRefs(baseState.root.ref, useFocusWithin());
|
|
20
24
|
(_children = (_baseState_indicator = baseState.indicator).children) !== null && _children !== void 0 ? _children : _baseState_indicator.children = /*#__PURE__*/ React.createElement(CircleFilled, null);
|
|
21
25
|
return {
|
|
22
26
|
...baseState,
|
|
@@ -59,10 +63,7 @@ import { getPartitionedNativeProps, mergeCallbacks, useId, slot } from "@fluentu
|
|
|
59
63
|
});
|
|
60
64
|
const id = useId('switch-', nativeProps.primary.id);
|
|
61
65
|
const root = slot.always(props.root, {
|
|
62
|
-
defaultProps:
|
|
63
|
-
ref: useFocusWithin(),
|
|
64
|
-
...nativeProps.root
|
|
65
|
-
},
|
|
66
|
+
defaultProps: nativeProps.root,
|
|
66
67
|
elementType: 'div'
|
|
67
68
|
});
|
|
68
69
|
const indicator = slot.always(props.indicator, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Switch/useSwitch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport { getPartitionedNativeProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';\nimport type { SwitchProps, SwitchState, SwitchBaseProps, SwitchBaseState } from './Switch.types';\n\n/**\n * Create the state required to render Switch.\n *\n * The returned state can be modified with hooks such as useSwitchStyles_unstable,\n * before being passed to renderSwitch_unstable.\n *\n * @param props - props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitch_unstable = (props: SwitchProps, ref: React.Ref<HTMLInputElement>): SwitchState => {\n const { size = 'medium', ...baseProps } = props;\n\n const baseState = useSwitchBase_unstable(baseProps, ref);\n\n baseState.indicator.children ??= <CircleFilled />;\n\n return {\n ...baseState,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...baseState.components,\n label: Label,\n },\n size,\n label: slot.optional(props.label, {\n defaultProps: { size: 'medium', ...baseState.label },\n elementType: Label,\n }),\n };\n};\n\n/**\n * Base hook for Switch component, manages state and structure common to all variants of Switch\n *\n * @param props - base props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitchBase_unstable = (props: SwitchBaseProps, ref?: React.Ref<HTMLInputElement>): SwitchBaseState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true });\n\n const {\n checked,\n defaultChecked,\n disabled,\n disabledFocusable = false,\n labelPosition = 'after',\n onChange,\n required,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange', 'disabledFocusable'],\n });\n\n const id = useId('switch-', nativeProps.primary.id);\n\n const root = slot.always(props.root, {\n defaultProps:
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Switch/useSwitch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport { getPartitionedNativeProps, mergeCallbacks, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport type { SwitchProps, SwitchState, SwitchBaseProps, SwitchBaseState } from './Switch.types';\n\n/**\n * Create the state required to render Switch.\n *\n * The returned state can be modified with hooks such as useSwitchStyles_unstable,\n * before being passed to renderSwitch_unstable.\n *\n * @param props - props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitch_unstable = (props: SwitchProps, ref: React.Ref<HTMLInputElement>): SwitchState => {\n const { size = 'medium', ...baseProps } = props;\n\n const baseState = useSwitchBase_unstable(baseProps, ref);\n\n // Focus-within ref drives the styled focus outline; applied here rather than in the base hook\n // so the base hook does not depend on react-tabster (keyborg).\n // eslint-disable-next-line react-hooks/immutability\n baseState.root.ref = useMergedRefs(baseState.root.ref, useFocusWithin<HTMLDivElement>());\n\n baseState.indicator.children ??= <CircleFilled />;\n\n return {\n ...baseState,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...baseState.components,\n label: Label,\n },\n size,\n label: slot.optional(props.label, {\n defaultProps: { size: 'medium', ...baseState.label },\n elementType: Label,\n }),\n };\n};\n\n/**\n * Base hook for Switch component, manages state and structure common to all variants of Switch\n *\n * @param props - base props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitchBase_unstable = (props: SwitchBaseProps, ref?: React.Ref<HTMLInputElement>): SwitchBaseState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true });\n\n const {\n checked,\n defaultChecked,\n disabled,\n disabledFocusable = false,\n labelPosition = 'after',\n onChange,\n required,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange', 'disabledFocusable'],\n });\n\n const id = useId('switch-', nativeProps.primary.id);\n\n const root = slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'div',\n });\n const indicator = slot.always(props.indicator, {\n defaultProps: { 'aria-hidden': true },\n elementType: 'div',\n });\n const input = slot.always(props.input, {\n defaultProps: {\n checked,\n defaultChecked,\n id,\n ref,\n role: 'switch',\n type: 'checkbox',\n ...nativeProps.primary,\n disabled: disabled && !disabledFocusable,\n ...(disabledFocusable && { 'aria-disabled': true }),\n },\n elementType: 'input',\n });\n input.onChange = mergeCallbacks(input.onChange, ev => onChange?.(ev, { checked: ev.currentTarget.checked }));\n input.onClick = mergeCallbacks(input.onClick, ev => {\n if (disabledFocusable) {\n ev.preventDefault();\n }\n });\n input.onKeyDown = mergeCallbacks(input.onKeyDown, ev => {\n if (disabledFocusable && (ev.key === ' ' || ev.key === 'Enter')) {\n ev.preventDefault();\n }\n });\n const label = slot.optional(props.label, {\n defaultProps: { disabled: disabled || disabledFocusable, htmlFor: id, required },\n elementType: 'label',\n });\n return {\n disabledFocusable,\n labelPosition,\n components: { root: 'div', indicator: 'div', input: 'input', label: 'label' },\n\n root,\n indicator,\n input,\n label,\n };\n};\n"],"names":["React","useFieldControlProps_unstable","CircleFilled","Label","useFocusWithin","getPartitionedNativeProps","mergeCallbacks","useId","useMergedRefs","slot","useSwitch_unstable","props","ref","baseState","size","baseProps","useSwitchBase_unstable","root","indicator","children","components","label","optional","defaultProps","elementType","supportsLabelFor","supportsRequired","checked","defaultChecked","disabled","disabledFocusable","labelPosition","onChange","required","nativeProps","primarySlotTagName","excludedPropNames","id","primary","always","input","role","type","ev","currentTarget","onClick","preventDefault","onKeyDown","key","htmlFor"],"mappings":"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"}
|
|
@@ -1,290 +1,289 @@
|
|
|
1
|
-
@
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/* @griffel-buckets reset: .root, .indicator, .input */
|
|
2
|
+
.root:focus {
|
|
3
|
+
outline-style: none;
|
|
4
|
+
}
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
.root:focus-visible {
|
|
7
|
+
outline-style: none;
|
|
8
|
+
}
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
.root[data-fui-focus-within]:focus-within::after {
|
|
11
|
+
content: '';
|
|
12
|
+
position: absolute;
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
z-index: 1;
|
|
15
|
+
border: var(--strokeWidthThick) solid var(--colorStrokeFocus2);
|
|
16
|
+
border-radius: var(--borderRadiusMedium);
|
|
17
|
+
top: calc(var(--strokeWidthThick) * -1);
|
|
18
|
+
inset-inline-end: calc(var(--strokeWidthThick) * -1);
|
|
19
|
+
bottom: calc(var(--strokeWidthThick) * -1);
|
|
20
|
+
inset-inline-start: calc(var(--strokeWidthThick) * -1);
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
.root[data-fui-focus-within]:focus-within {
|
|
24
|
+
border-top-color: transparent;
|
|
25
|
+
border-inline-end-color: transparent;
|
|
26
|
+
border-bottom-color: transparent;
|
|
27
|
+
border-inline-start-color: transparent;
|
|
28
|
+
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
.root {
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
position: relative;
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
.above {
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
.indicator > * {
|
|
42
|
+
transition-duration: var(--durationNormal);
|
|
43
|
+
transition-timing-function: var(--curveEasyEase);
|
|
44
|
+
transition-property: transform;
|
|
45
|
+
}
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
.indicator {
|
|
48
|
+
border-radius: var(--borderRadiusCircular);
|
|
49
|
+
border: var(--strokeWidthThin) solid;
|
|
50
|
+
line-height: 0;
|
|
51
|
+
box-sizing: border-box;
|
|
52
|
+
fill: currentColor;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
font-size: calc(var(--spacingHorizontalXS) * 4.5);
|
|
55
|
+
height: var(--spacingHorizontalXL);
|
|
56
|
+
margin: var(--spacingVerticalS) var(--spacingHorizontalS);
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
transition-duration: var(--durationNormal);
|
|
59
|
+
transition-timing-function: var(--curveEasyEase);
|
|
60
|
+
transition-property: background, border, color;
|
|
61
|
+
width: calc(var(--spacingHorizontalXS) * 10);
|
|
62
|
+
}
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
:where(.withLabel.above) > .indicator {
|
|
65
|
+
margin-top: 0;
|
|
66
|
+
}
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
:where(.small) > .indicator {
|
|
69
|
+
font-size: var(--fontSizeBase300);
|
|
70
|
+
height: var(--spacingHorizontalL);
|
|
71
|
+
width: var(--spacingHorizontalXXXL);
|
|
72
|
+
}
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
.input:checked ~ :global(.fui-Switch__indicator) > * {
|
|
75
|
+
transform: translateX(var(--spacingHorizontalXL));
|
|
76
|
+
}
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
.input:checked ~ :global(.fui-Switch__indicator) > *:where(:dir(rtl)) {
|
|
79
|
+
transform: translateX(calc(var(--spacingHorizontalXL) * -1));
|
|
80
|
+
}
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
.input:disabled ~ :global(.fui-Switch__indicator),
|
|
83
|
+
.input[aria-disabled='true'] ~ :global(.fui-Switch__indicator) {
|
|
84
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
85
|
+
}
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
.input:disabled ~ :global(.fui-Switch__label),
|
|
88
|
+
.input[aria-disabled='true'] ~ :global(.fui-Switch__label) {
|
|
89
|
+
cursor: default;
|
|
90
|
+
color: var(--colorNeutralForegroundDisabled);
|
|
91
|
+
}
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
.input:disabled,
|
|
94
|
+
.input[aria-disabled='true'] {
|
|
95
|
+
cursor: default;
|
|
96
|
+
}
|
|
97
97
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
.input:enabled:not(:checked):not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
|
|
99
|
+
color: var(--colorNeutralStrokeAccessible);
|
|
100
|
+
border-color: var(--colorNeutralStrokeAccessible);
|
|
101
|
+
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
.input:enabled:not(:checked):not([aria-disabled='true']) ~ :global(.fui-Switch__label) {
|
|
104
|
+
color: var(--colorNeutralForeground1);
|
|
105
|
+
}
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
.input:enabled:not(:checked):not([aria-disabled='true']):hover ~ :global(.fui-Switch__indicator) {
|
|
108
|
+
color: var(--colorNeutralStrokeAccessibleHover);
|
|
109
|
+
border-color: var(--colorNeutralStrokeAccessibleHover);
|
|
110
|
+
}
|
|
111
111
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
.input:enabled:not(:checked):not([aria-disabled='true']):hover:active ~ :global(.fui-Switch__indicator) {
|
|
113
|
+
color: var(--colorNeutralStrokeAccessiblePressed);
|
|
114
|
+
border-color: var(--colorNeutralStrokeAccessiblePressed);
|
|
115
|
+
}
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
117
|
+
.input:enabled:checked:not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
|
|
118
|
+
background-color: var(--colorCompoundBrandBackground);
|
|
119
|
+
color: var(--colorNeutralForegroundInverted);
|
|
120
|
+
border-color: var(--colorTransparentStroke);
|
|
121
|
+
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
.input:enabled:checked:not([aria-disabled='true']):hover ~ :global(.fui-Switch__indicator) {
|
|
124
|
+
background-color: var(--colorCompoundBrandBackgroundHover);
|
|
125
|
+
border-color: var(--colorTransparentStrokeInteractive);
|
|
126
|
+
}
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
.input:enabled:checked:not([aria-disabled='true']):hover:active ~ :global(.fui-Switch__indicator) {
|
|
129
|
+
background-color: var(--colorCompoundBrandBackgroundPressed);
|
|
130
|
+
border-color: var(--colorTransparentStrokeInteractive);
|
|
131
|
+
}
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
.input:disabled:not(:checked) ~ :global(.fui-Switch__indicator),
|
|
134
|
+
.input[aria-disabled='true']:not(:checked) ~ :global(.fui-Switch__indicator) {
|
|
135
|
+
border-color: var(--colorNeutralStrokeDisabled);
|
|
136
|
+
}
|
|
137
137
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
138
|
+
.input:disabled:checked ~ :global(.fui-Switch__indicator),
|
|
139
|
+
.input[aria-disabled='true']:checked ~ :global(.fui-Switch__indicator) {
|
|
140
|
+
background-color: var(--colorNeutralBackgroundDisabled);
|
|
141
|
+
border-color: var(--colorTransparentStrokeDisabled);
|
|
142
|
+
}
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
.input {
|
|
145
|
+
box-sizing: border-box;
|
|
146
|
+
cursor: pointer;
|
|
147
|
+
height: 100%;
|
|
148
|
+
margin: 0;
|
|
149
|
+
opacity: 0;
|
|
150
|
+
position: absolute;
|
|
151
|
+
width: calc(calc(var(--spacingHorizontalXS) * 10) + 2 * var(--spacingHorizontalS));
|
|
152
|
+
}
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
154
|
+
:where(.withLabel.before) > .input {
|
|
155
|
+
inset-inline-end: 0;
|
|
156
|
+
top: 0;
|
|
157
|
+
}
|
|
158
158
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
159
|
+
:where(.withLabel.after) > .input {
|
|
160
|
+
inset-inline-start: 0;
|
|
161
|
+
top: 0;
|
|
162
|
+
}
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
164
|
+
:where(.withLabel.above) > .input {
|
|
165
|
+
bottom: 0;
|
|
166
|
+
height: calc(var(--spacingHorizontalXL) + var(--spacingVerticalS));
|
|
167
|
+
width: 100%;
|
|
168
|
+
}
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
:where(.small) > .input:checked ~ :global(.fui-Switch__indicator) > * {
|
|
171
|
+
transform: translateX(var(--spacingHorizontalL));
|
|
172
|
+
}
|
|
173
173
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
:where(.small) > .input:checked ~ :global(.fui-Switch__indicator) > *:where(:dir(rtl)) {
|
|
175
|
+
transform: translateX(calc(var(--spacingHorizontalL) * -1));
|
|
176
|
+
}
|
|
177
177
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
:where(.small) > .input {
|
|
179
|
+
width: calc(var(--spacingHorizontalXXXL) + 2 * var(--spacingHorizontalS));
|
|
180
|
+
}
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
182
|
+
.label {
|
|
183
|
+
cursor: pointer;
|
|
184
|
+
margin-bottom: calc((var(--spacingHorizontalXL) - var(--lineHeightBase300)) / 2);
|
|
185
|
+
margin-top: calc((var(--spacingHorizontalXL) - var(--lineHeightBase300)) / 2);
|
|
186
|
+
padding: var(--spacingVerticalS) var(--spacingHorizontalS);
|
|
187
|
+
}
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
189
|
+
:where(.small) > .label {
|
|
190
|
+
font-size: var(--fontSizeBase200);
|
|
191
|
+
line-height: var(--lineHeightBase200);
|
|
192
|
+
margin-bottom: calc((var(--spacingHorizontalL) - var(--lineHeightBase200)) / 2);
|
|
193
|
+
margin-top: calc((var(--spacingHorizontalL) - var(--lineHeightBase200)) / 2);
|
|
194
|
+
}
|
|
195
195
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
:where(.above) > .label {
|
|
197
|
+
padding-top: var(--spacingVerticalXS);
|
|
198
|
+
padding-bottom: var(--spacingVerticalXS);
|
|
199
|
+
width: 100%;
|
|
200
|
+
}
|
|
201
201
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
:where(.after) > .label {
|
|
203
|
+
padding-inline-start: var(--spacingHorizontalXS);
|
|
204
|
+
}
|
|
205
205
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
:where(.before) > .label {
|
|
207
|
+
padding-inline-end: var(--spacingHorizontalXS);
|
|
208
|
+
}
|
|
209
209
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
210
|
+
@media (forced-colors: active) {
|
|
211
|
+
.root[data-fui-focus-within]:focus-within::after {
|
|
212
|
+
border-top-color: Highlight;
|
|
213
|
+
border-inline-end-color: Highlight;
|
|
214
|
+
border-bottom-color: Highlight;
|
|
215
|
+
border-inline-start-color: Highlight;
|
|
217
216
|
}
|
|
217
|
+
}
|
|
218
218
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
219
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
220
|
+
.indicator {
|
|
221
|
+
transition-duration: 0.01ms;
|
|
223
222
|
}
|
|
223
|
+
}
|
|
224
224
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
225
|
+
@media (forced-colors: active) {
|
|
226
|
+
.indicator > i {
|
|
227
|
+
forced-color-adjust: none;
|
|
229
228
|
}
|
|
229
|
+
}
|
|
230
230
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}
|
|
231
|
+
@media (forced-colors: active) {
|
|
232
|
+
.indicator {
|
|
233
|
+
color: CanvasText;
|
|
235
234
|
}
|
|
235
|
+
}
|
|
236
236
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
237
|
+
@media screen and (prefers-reduced-motion: reduce) {
|
|
238
|
+
.indicator > * {
|
|
239
|
+
transition-duration: 0.01ms;
|
|
241
240
|
}
|
|
241
|
+
}
|
|
242
242
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
243
|
+
@media (forced-colors: active) {
|
|
244
|
+
.input:disabled ~ :global(.fui-Switch__indicator),
|
|
245
|
+
.input[aria-disabled='true'] ~ :global(.fui-Switch__indicator) {
|
|
246
|
+
color: GrayText;
|
|
247
|
+
border-color: GrayText;
|
|
249
248
|
}
|
|
249
|
+
}
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
}
|
|
251
|
+
@media (forced-colors: active) {
|
|
252
|
+
.input:disabled ~ :global(.fui-Switch__label),
|
|
253
|
+
.input[aria-disabled='true'] ~ :global(.fui-Switch__label) {
|
|
254
|
+
color: GrayText;
|
|
256
255
|
}
|
|
256
|
+
}
|
|
257
257
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
258
|
+
@media (forced-colors: active) {
|
|
259
|
+
.input:hover {
|
|
260
|
+
color: CanvasText;
|
|
262
261
|
}
|
|
262
|
+
}
|
|
263
263
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
264
|
+
@media (forced-colors: active) {
|
|
265
|
+
.input:hover:active {
|
|
266
|
+
color: CanvasText;
|
|
268
267
|
}
|
|
268
|
+
}
|
|
269
269
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
270
|
+
@media (forced-colors: active) {
|
|
271
|
+
.input:enabled:checked:not([aria-disabled='true']):hover ~ :global(.fui-Switch__indicator) {
|
|
272
|
+
background-color: Highlight;
|
|
273
|
+
color: Canvas;
|
|
275
274
|
}
|
|
275
|
+
}
|
|
276
276
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
277
|
+
@media (forced-colors: active) {
|
|
278
|
+
.input:enabled:checked:not([aria-disabled='true']):hover:active ~ :global(.fui-Switch__indicator) {
|
|
279
|
+
background-color: Highlight;
|
|
280
|
+
color: Canvas;
|
|
282
281
|
}
|
|
282
|
+
}
|
|
283
283
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
284
|
+
@media (forced-colors: active) {
|
|
285
|
+
.input:enabled:checked:not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
|
|
286
|
+
background-color: Highlight;
|
|
287
|
+
color: Canvas;
|
|
289
288
|
}
|
|
290
289
|
}
|
|
@@ -28,6 +28,10 @@ const useSwitch_unstable = (props, ref)=>{
|
|
|
28
28
|
var _baseState_indicator, _children;
|
|
29
29
|
const { size = 'medium', ...baseProps } = props;
|
|
30
30
|
const baseState = useSwitchBase_unstable(baseProps, ref);
|
|
31
|
+
// Focus-within ref drives the styled focus outline; applied here rather than in the base hook
|
|
32
|
+
// so the base hook does not depend on react-tabster (keyborg).
|
|
33
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
34
|
+
baseState.root.ref = (0, _reactutilities.useMergedRefs)(baseState.root.ref, (0, _reacttabster.useFocusWithin)());
|
|
31
35
|
(_children = (_baseState_indicator = baseState.indicator).children) !== null && _children !== void 0 ? _children : _baseState_indicator.children = /*#__PURE__*/ _react.createElement(_reacticons.CircleFilled, null);
|
|
32
36
|
return {
|
|
33
37
|
...baseState,
|
|
@@ -65,10 +69,7 @@ const useSwitchBase_unstable = (props, ref)=>{
|
|
|
65
69
|
});
|
|
66
70
|
const id = (0, _reactutilities.useId)('switch-', nativeProps.primary.id);
|
|
67
71
|
const root = _reactutilities.slot.always(props.root, {
|
|
68
|
-
defaultProps:
|
|
69
|
-
ref: (0, _reacttabster.useFocusWithin)(),
|
|
70
|
-
...nativeProps.root
|
|
71
|
-
},
|
|
72
|
+
defaultProps: nativeProps.root,
|
|
72
73
|
elementType: 'div'
|
|
73
74
|
});
|
|
74
75
|
const indicator = _reactutilities.slot.always(props.indicator, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Switch/useSwitch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport { getPartitionedNativeProps, mergeCallbacks, useId, slot } from '@fluentui/react-utilities';\nimport type { SwitchProps, SwitchState, SwitchBaseProps, SwitchBaseState } from './Switch.types';\n\n/**\n * Create the state required to render Switch.\n *\n * The returned state can be modified with hooks such as useSwitchStyles_unstable,\n * before being passed to renderSwitch_unstable.\n *\n * @param props - props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitch_unstable = (props: SwitchProps, ref: React.Ref<HTMLInputElement>): SwitchState => {\n const { size = 'medium', ...baseProps } = props;\n\n const baseState = useSwitchBase_unstable(baseProps, ref);\n\n baseState.indicator.children ??= <CircleFilled />;\n\n return {\n ...baseState,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...baseState.components,\n label: Label,\n },\n size,\n label: slot.optional(props.label, {\n defaultProps: { size: 'medium', ...baseState.label },\n elementType: Label,\n }),\n };\n};\n\n/**\n * Base hook for Switch component, manages state and structure common to all variants of Switch\n *\n * @param props - base props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitchBase_unstable = (props: SwitchBaseProps, ref?: React.Ref<HTMLInputElement>): SwitchBaseState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true });\n\n const {\n checked,\n defaultChecked,\n disabled,\n disabledFocusable = false,\n labelPosition = 'after',\n onChange,\n required,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange', 'disabledFocusable'],\n });\n\n const id = useId('switch-', nativeProps.primary.id);\n\n const root = slot.always(props.root, {\n defaultProps:
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Switch/useSwitch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport { getPartitionedNativeProps, mergeCallbacks, useId, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport type { SwitchProps, SwitchState, SwitchBaseProps, SwitchBaseState } from './Switch.types';\n\n/**\n * Create the state required to render Switch.\n *\n * The returned state can be modified with hooks such as useSwitchStyles_unstable,\n * before being passed to renderSwitch_unstable.\n *\n * @param props - props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitch_unstable = (props: SwitchProps, ref: React.Ref<HTMLInputElement>): SwitchState => {\n const { size = 'medium', ...baseProps } = props;\n\n const baseState = useSwitchBase_unstable(baseProps, ref);\n\n // Focus-within ref drives the styled focus outline; applied here rather than in the base hook\n // so the base hook does not depend on react-tabster (keyborg).\n // eslint-disable-next-line react-hooks/immutability\n baseState.root.ref = useMergedRefs(baseState.root.ref, useFocusWithin<HTMLDivElement>());\n\n baseState.indicator.children ??= <CircleFilled />;\n\n return {\n ...baseState,\n components: {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ...baseState.components,\n label: Label,\n },\n size,\n label: slot.optional(props.label, {\n defaultProps: { size: 'medium', ...baseState.label },\n elementType: Label,\n }),\n };\n};\n\n/**\n * Base hook for Switch component, manages state and structure common to all variants of Switch\n *\n * @param props - base props from this instance of Switch\n * @param ref - reference to `<input>` element of Switch\n */\nexport const useSwitchBase_unstable = (props: SwitchBaseProps, ref?: React.Ref<HTMLInputElement>): SwitchBaseState => {\n // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props, { supportsLabelFor: true, supportsRequired: true });\n\n const {\n checked,\n defaultChecked,\n disabled,\n disabledFocusable = false,\n labelPosition = 'after',\n onChange,\n required,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange', 'disabledFocusable'],\n });\n\n const id = useId('switch-', nativeProps.primary.id);\n\n const root = slot.always(props.root, {\n defaultProps: nativeProps.root,\n elementType: 'div',\n });\n const indicator = slot.always(props.indicator, {\n defaultProps: { 'aria-hidden': true },\n elementType: 'div',\n });\n const input = slot.always(props.input, {\n defaultProps: {\n checked,\n defaultChecked,\n id,\n ref,\n role: 'switch',\n type: 'checkbox',\n ...nativeProps.primary,\n disabled: disabled && !disabledFocusable,\n ...(disabledFocusable && { 'aria-disabled': true }),\n },\n elementType: 'input',\n });\n input.onChange = mergeCallbacks(input.onChange, ev => onChange?.(ev, { checked: ev.currentTarget.checked }));\n input.onClick = mergeCallbacks(input.onClick, ev => {\n if (disabledFocusable) {\n ev.preventDefault();\n }\n });\n input.onKeyDown = mergeCallbacks(input.onKeyDown, ev => {\n if (disabledFocusable && (ev.key === ' ' || ev.key === 'Enter')) {\n ev.preventDefault();\n }\n });\n const label = slot.optional(props.label, {\n defaultProps: { disabled: disabled || disabledFocusable, htmlFor: id, required },\n elementType: 'label',\n });\n return {\n disabledFocusable,\n labelPosition,\n components: { root: 'div', indicator: 'div', input: 'input', label: 'label' },\n\n root,\n indicator,\n input,\n label,\n };\n};\n"],"names":["React","useFieldControlProps_unstable","CircleFilled","Label","useFocusWithin","getPartitionedNativeProps","mergeCallbacks","useId","useMergedRefs","slot","useSwitch_unstable","props","ref","baseState","size","baseProps","useSwitchBase_unstable","root","indicator","children","components","label","optional","defaultProps","elementType","supportsLabelFor","supportsRequired","checked","defaultChecked","disabled","disabledFocusable","labelPosition","onChange","required","nativeProps","primarySlotTagName","excludedPropNames","id","primary","always","input","role","type","ev","currentTarget","onClick","preventDefault","onKeyDown","key","htmlFor"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-switch",
|
|
3
|
-
"version": "9.75.
|
|
3
|
+
"version": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
4
4
|
"description": "Fluent UI React Switch component.",
|
|
5
5
|
"main": "lib-commonjs/index.cjs",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@fluentui/react-field": "9.75.
|
|
17
|
+
"@fluentui/react-field": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
18
18
|
"@fluentui/react-icons": "^2.0.245",
|
|
19
|
-
"@fluentui/react-jsx-runtime": "9.75.
|
|
20
|
-
"@fluentui/react-label": "9.75.
|
|
21
|
-
"@fluentui/react-shared-contexts": "9.75.
|
|
22
|
-
"@fluentui/react-tabster": "9.75.
|
|
23
|
-
"@fluentui/react-theme": "9.75.
|
|
24
|
-
"@fluentui/react-utilities": "9.75.
|
|
19
|
+
"@fluentui/react-jsx-runtime": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
20
|
+
"@fluentui/react-label": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
21
|
+
"@fluentui/react-shared-contexts": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
22
|
+
"@fluentui/react-tabster": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
23
|
+
"@fluentui/react-theme": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
24
|
+
"@fluentui/react-utilities": "9.75.2-experimental.css-modules.20261113-ba13c87438.0",
|
|
25
25
|
"@griffel/react": "^1.5.32",
|
|
26
26
|
"@swc/helpers": "^0.5.1",
|
|
27
27
|
"clsx": "^2.1.1"
|