@fluentui/react-switch 9.75.0-experimental.css-modules.20261031-810ab07afb.0 → 9.75.1-experimental.positioning-engine.20261103-19efe125d1.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 CHANGED
@@ -1,23 +1,23 @@
1
1
  # Change Log - @fluentui/react-switch
2
2
 
3
- <!-- This log was last generated on Sat, 31 Oct 2026 11:08:56 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Tue, 03 Nov 2026 14:18:11 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
7
+ ## [9.75.1-experimental.positioning-engine.20261103-19efe125d1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.75.1-experimental.positioning-engine.20261103-19efe125d1.0)
8
8
 
9
- Sat, 31 Oct 2026 11:08:56 GMT
9
+ Tue, 03 Nov 2026 14:18:11 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([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.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
- - Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
- - Bump @fluentui/react-label to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
- - Bump @fluentui/react-tabster to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
- - Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
- - Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
13
+ - Release 9.75.1-experimental.positioning-engine.20261103-19efe125d1 ([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.1-experimental.positioning-engine.20261103-19efe125d1.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+ - Bump @fluentui/react-label to v9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
+ - Bump @fluentui/react-theme to v9.75.1-experimental.positioning-engine.20261103-19efe125d1.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
+ - Bump @fluentui/react-utilities to v9.75.1-experimental.positioning-engine.20261103-19efe125d1.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
@@ -36,11 +36,3 @@ See [SPEC.md](./Spec.md).
36
36
  ### Migration Guide
37
37
 
38
38
  If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating to the latest Switch implementation.
39
-
40
- ## Opt-in CSS Modules styles
41
-
42
- CSS Modules alternatives are available for `Switch`. The default exports and component imports continue to use Griffel.
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. All component rules are in `@layer fluentui` and use the theme custom properties supplied by `FluentProvider`.
45
-
46
- For composed labels, also select the CSS Modules alternative for `@fluentui/react-label`. Mixing its default unlayered Griffel styles with these layered alternatives can override label typography.
package/package.json CHANGED
@@ -1,30 +1,27 @@
1
1
  {
2
2
  "name": "@fluentui/react-switch",
3
- "version": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
3
+ "version": "9.75.1-experimental.positioning-engine.20261103-19efe125d1.0",
4
4
  "description": "Fluent UI React Switch component.",
5
5
  "main": "lib-commonjs/index.cjs",
6
6
  "module": "lib/index.js",
7
7
  "typings": "./dist/index.d.ts",
8
- "sideEffects": [
9
- "**/*.css"
10
- ],
8
+ "sideEffects": false,
11
9
  "repository": {
12
10
  "type": "git",
13
11
  "url": "https://github.com/microsoft/fluentui"
14
12
  },
15
13
  "license": "MIT",
16
14
  "dependencies": {
17
- "@fluentui/react-field": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
15
+ "@fluentui/react-field": "9.75.1-experimental.positioning-engine.20261103-19efe125d1.0",
18
16
  "@fluentui/react-icons": "^2.0.245",
19
- "@fluentui/react-jsx-runtime": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
20
- "@fluentui/react-label": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
21
- "@fluentui/react-shared-contexts": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
22
- "@fluentui/react-tabster": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
23
- "@fluentui/react-theme": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
24
- "@fluentui/react-utilities": "9.75.0-experimental.css-modules.20261031-810ab07afb.0",
17
+ "@fluentui/react-jsx-runtime": "9.75.1-experimental.positioning-engine.20261103-19efe125d1.0",
18
+ "@fluentui/react-label": "9.75.1-experimental.positioning-engine.20261103-19efe125d1.0",
19
+ "@fluentui/react-shared-contexts": "9.75.1-experimental.positioning-engine.20261103-19efe125d1.0",
20
+ "@fluentui/react-tabster": "9.75.1-experimental.positioning-engine.20261103-19efe125d1.0",
21
+ "@fluentui/react-theme": "9.75.1-experimental.positioning-engine.20261103-19efe125d1.0",
22
+ "@fluentui/react-utilities": "9.75.1-experimental.positioning-engine.20261103-19efe125d1.0",
25
23
  "@griffel/react": "^1.5.32",
26
- "@swc/helpers": "^0.5.1",
27
- "clsx": "^2.1.1"
24
+ "@swc/helpers": "^0.5.1"
28
25
  },
29
26
  "peerDependencies": {
30
27
  "@types/react": ">=16.14.0 <20.0.0",
@@ -1,290 +0,0 @@
1
- @layer fluentui {
2
- .root:focus {
3
- outline-style: none;
4
- }
5
-
6
- .root:focus-visible {
7
- outline-style: none;
8
- }
9
-
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
-
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
-
30
- .root {
31
- align-items: flex-start;
32
- box-sizing: border-box;
33
- display: inline-flex;
34
- position: relative;
35
- }
36
-
37
- .above {
38
- flex-direction: column;
39
- }
40
-
41
- .indicator > * {
42
- transition-duration: var(--durationNormal);
43
- transition-timing-function: var(--curveEasyEase);
44
- transition-property: transform;
45
- }
46
-
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
-
64
- :where(.withLabel.above) > .indicator {
65
- margin-top: 0;
66
- }
67
-
68
- :where(.small) > .indicator {
69
- font-size: var(--fontSizeBase300);
70
- height: var(--spacingHorizontalL);
71
- width: var(--spacingHorizontalXXXL);
72
- }
73
-
74
- .input:checked ~ :global(.fui-Switch__indicator) > * {
75
- transform: translateX(var(--spacingHorizontalXL));
76
- }
77
-
78
- .input:checked ~ :global(.fui-Switch__indicator) > *:where(:dir(rtl)) {
79
- transform: translateX(calc(var(--spacingHorizontalXL) * -1));
80
- }
81
-
82
- .input:disabled ~ :global(.fui-Switch__indicator),
83
- .input[aria-disabled='true'] ~ :global(.fui-Switch__indicator) {
84
- color: var(--colorNeutralForegroundDisabled);
85
- }
86
-
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
-
93
- .input:disabled,
94
- .input[aria-disabled='true'] {
95
- cursor: default;
96
- }
97
-
98
- .input:enabled:not(:checked):not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
99
- color: var(--colorNeutralStrokeAccessible);
100
- border-color: var(--colorNeutralStrokeAccessible);
101
- }
102
-
103
- .input:enabled:not(:checked):not([aria-disabled='true']) ~ :global(.fui-Switch__label) {
104
- color: var(--colorNeutralForeground1);
105
- }
106
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
154
- :where(.withLabel.before) > .input {
155
- inset-inline-end: 0;
156
- top: 0;
157
- }
158
-
159
- :where(.withLabel.after) > .input {
160
- inset-inline-start: 0;
161
- top: 0;
162
- }
163
-
164
- :where(.withLabel.above) > .input {
165
- bottom: 0;
166
- height: calc(var(--spacingHorizontalXL) + var(--spacingVerticalS));
167
- width: 100%;
168
- }
169
-
170
- :where(.small) > .input:checked ~ :global(.fui-Switch__indicator) > * {
171
- transform: translateX(var(--spacingHorizontalL));
172
- }
173
-
174
- :where(.small) > .input:checked ~ :global(.fui-Switch__indicator) > *:where(:dir(rtl)) {
175
- transform: translateX(calc(var(--spacingHorizontalL) * -1));
176
- }
177
-
178
- :where(.small) > .input {
179
- width: calc(var(--spacingHorizontalXXXL) + 2 * var(--spacingHorizontalS));
180
- }
181
-
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
-
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
-
196
- :where(.above) > .label {
197
- padding-top: var(--spacingVerticalXS);
198
- padding-bottom: var(--spacingVerticalXS);
199
- width: 100%;
200
- }
201
-
202
- :where(.after) > .label {
203
- padding-inline-start: var(--spacingHorizontalXS);
204
- }
205
-
206
- :where(.before) > .label {
207
- padding-inline-end: var(--spacingHorizontalXS);
208
- }
209
-
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;
216
- }
217
- }
218
-
219
- @media screen and (prefers-reduced-motion: reduce) {
220
- .indicator {
221
- transition-duration: 0.01ms;
222
- }
223
- }
224
-
225
- @media (forced-colors: active) {
226
- .indicator > i {
227
- forced-color-adjust: none;
228
- }
229
- }
230
-
231
- @media (forced-colors: active) {
232
- .indicator {
233
- color: CanvasText;
234
- }
235
- }
236
-
237
- @media screen and (prefers-reduced-motion: reduce) {
238
- .indicator > * {
239
- transition-duration: 0.01ms;
240
- }
241
- }
242
-
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;
248
- }
249
- }
250
-
251
- @media (forced-colors: active) {
252
- .input:disabled ~ :global(.fui-Switch__label),
253
- .input[aria-disabled='true'] ~ :global(.fui-Switch__label) {
254
- color: GrayText;
255
- }
256
- }
257
-
258
- @media (forced-colors: active) {
259
- .input:hover {
260
- color: CanvasText;
261
- }
262
- }
263
-
264
- @media (forced-colors: active) {
265
- .input:hover:active {
266
- color: CanvasText;
267
- }
268
- }
269
-
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;
274
- }
275
- }
276
-
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;
281
- }
282
- }
283
-
284
- @media (forced-colors: active) {
285
- .input:enabled:checked:not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
286
- background-color: Highlight;
287
- color: Canvas;
288
- }
289
- }
290
- }
@@ -1,18 +0,0 @@
1
- import { clsx } from "clsx";
2
- import styles from "./Switch.module.css";
3
- export const switchClassNames = {
4
- root: 'fui-Switch',
5
- indicator: 'fui-Switch__indicator',
6
- input: 'fui-Switch__input',
7
- label: 'fui-Switch__label'
8
- };
9
- /** @deprecated Use `switchClassNames.root` instead. */ export const switchClassName = switchClassNames.root;
10
- export const useSwitchStyles_unstable = (state)=>{
11
- state.root.className = clsx(switchClassNames.root, styles.root, styles[state.labelPosition], styles[state.size], state.label && styles.withLabel, state.root.className);
12
- state.indicator.className = clsx(switchClassNames.indicator, styles.indicator, state.indicator.className);
13
- state.input.className = clsx(switchClassNames.input, styles.input, state.input.className);
14
- if (state.label) {
15
- state.label.className = clsx(switchClassNames.label, styles.label, state.label.className);
16
- }
17
- return state;
18
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Switch/useSwitchStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SwitchState, SwitchSlots } from './Switch.types';\nimport styles from './Switch.module.css';\n\nexport const switchClassNames: SlotClassNames<SwitchSlots> = {\n root: 'fui-Switch',\n indicator: 'fui-Switch__indicator',\n input: 'fui-Switch__input',\n label: 'fui-Switch__label',\n};\n\n/** @deprecated Use `switchClassNames.root` instead. */\nexport const switchClassName = switchClassNames.root;\n\nexport const useSwitchStyles_unstable = (state: SwitchState): SwitchState => {\n state.root.className = clsx(\n switchClassNames.root,\n styles.root,\n styles[state.labelPosition],\n styles[state.size],\n state.label && styles.withLabel,\n state.root.className,\n );\n state.indicator.className = clsx(switchClassNames.indicator, styles.indicator, state.indicator.className);\n state.input.className = clsx(switchClassNames.input, styles.input, state.input.className);\n if (state.label) {\n state.label.className = clsx(switchClassNames.label, styles.label, state.label.className);\n }\n return state;\n};\n"],"names":["clsx","styles","switchClassNames","root","indicator","input","label","switchClassName","useSwitchStyles_unstable","state","className","labelPosition","size","withLabel"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,sBAAsB;AAEzC,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,qDAAqD,GACrD,OAAO,MAAMC,kBAAkBL,iBAAiBC,IAAI,CAAC;AAErD,OAAO,MAAMK,2BAA2B,CAACC;IACvCA,MAAMN,IAAI,CAACO,SAAS,GAAGV,KACrBE,iBAAiBC,IAAI,EACrBF,OAAOE,IAAI,EACXF,MAAM,CAACQ,MAAME,aAAa,CAAC,EAC3BV,MAAM,CAACQ,MAAMG,IAAI,CAAC,EAClBH,MAAMH,KAAK,IAAIL,OAAOY,SAAS,EAC/BJ,MAAMN,IAAI,CAACO,SAAS;IAEtBD,MAAML,SAAS,CAACM,SAAS,GAAGV,KAAKE,iBAAiBE,SAAS,EAAEH,OAAOG,SAAS,EAAEK,MAAML,SAAS,CAACM,SAAS;IACxGD,MAAMJ,KAAK,CAACK,SAAS,GAAGV,KAAKE,iBAAiBG,KAAK,EAAEJ,OAAOI,KAAK,EAAEI,MAAMJ,KAAK,CAACK,SAAS;IACxF,IAAID,MAAMH,KAAK,EAAE;QACfG,MAAMH,KAAK,CAACI,SAAS,GAAGV,KAAKE,iBAAiBI,KAAK,EAAEL,OAAOK,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IAC1F;IACA,OAAOD;AACT,EAAE"}
@@ -1,18 +0,0 @@
1
- import { clsx } from "clsx";
2
- import styles from "./Switch.module.css";
3
- export const switchClassNames = {
4
- root: 'fui-Switch',
5
- indicator: 'fui-Switch__indicator',
6
- input: 'fui-Switch__input',
7
- label: 'fui-Switch__label'
8
- };
9
- /** @deprecated Use `switchClassNames.root` instead. */ export const switchClassName = switchClassNames.root;
10
- export const useSwitchStyles_unstable = (state)=>{
11
- state.root.className = clsx(switchClassNames.root, styles.root, styles[state.labelPosition], styles[state.size], state.label && styles.withLabel, state.root.className);
12
- state.indicator.className = clsx(switchClassNames.indicator, styles.indicator, state.indicator.className);
13
- state.input.className = clsx(switchClassNames.input, styles.input, state.input.className);
14
- if (state.label) {
15
- state.label.className = clsx(switchClassNames.label, styles.label, state.label.className);
16
- }
17
- return state;
18
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Switch/useSwitchStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SwitchState, SwitchSlots } from './Switch.types';\nimport styles from './Switch.module.css';\n\nexport const switchClassNames: SlotClassNames<SwitchSlots> = {\n root: 'fui-Switch',\n indicator: 'fui-Switch__indicator',\n input: 'fui-Switch__input',\n label: 'fui-Switch__label',\n};\n\n/** @deprecated Use `switchClassNames.root` instead. */\nexport const switchClassName = switchClassNames.root;\n\nexport const useSwitchStyles_unstable = (state: SwitchState): SwitchState => {\n state.root.className = clsx(\n switchClassNames.root,\n styles.root,\n styles[state.labelPosition],\n styles[state.size],\n state.label && styles.withLabel,\n state.root.className,\n );\n state.indicator.className = clsx(switchClassNames.indicator, styles.indicator, state.indicator.className);\n state.input.className = clsx(switchClassNames.input, styles.input, state.input.className);\n if (state.label) {\n state.label.className = clsx(switchClassNames.label, styles.label, state.label.className);\n }\n return state;\n};\n"],"names":["clsx","styles","switchClassNames","root","indicator","input","label","switchClassName","useSwitchStyles_unstable","state","className","labelPosition","size","withLabel"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,sBAAsB;AAEzC,OAAO,MAAMC,mBAAgD;IAC3DC,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,qDAAqD,GACrD,OAAO,MAAMC,kBAAkBL,iBAAiBC,IAAI,CAAC;AAErD,OAAO,MAAMK,2BAA2B,CAACC;IACvCA,MAAMN,IAAI,CAACO,SAAS,GAAGV,KACrBE,iBAAiBC,IAAI,EACrBF,OAAOE,IAAI,EACXF,MAAM,CAACQ,MAAME,aAAa,CAAC,EAC3BV,MAAM,CAACQ,MAAMG,IAAI,CAAC,EAClBH,MAAMH,KAAK,IAAIL,OAAOY,SAAS,EAC/BJ,MAAMN,IAAI,CAACO,SAAS;IAEtBD,MAAML,SAAS,CAACM,SAAS,GAAGV,KAAKE,iBAAiBE,SAAS,EAAEH,OAAOG,SAAS,EAAEK,MAAML,SAAS,CAACM,SAAS;IACxGD,MAAMJ,KAAK,CAACK,SAAS,GAAGV,KAAKE,iBAAiBG,KAAK,EAAEJ,OAAOI,KAAK,EAAEI,MAAMJ,KAAK,CAACK,SAAS;IACxF,IAAID,MAAMH,KAAK,EAAE;QACfG,MAAMH,KAAK,CAACI,SAAS,GAAGV,KAAKE,iBAAiBI,KAAK,EAAEL,OAAOK,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IAC1F;IACA,OAAOD;AACT,EAAE"}
@@ -1,290 +0,0 @@
1
- @layer fluentui {
2
- .root:focus {
3
- outline-style: none;
4
- }
5
-
6
- .root:focus-visible {
7
- outline-style: none;
8
- }
9
-
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
-
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
-
30
- .root {
31
- align-items: flex-start;
32
- box-sizing: border-box;
33
- display: inline-flex;
34
- position: relative;
35
- }
36
-
37
- .above {
38
- flex-direction: column;
39
- }
40
-
41
- .indicator > * {
42
- transition-duration: var(--durationNormal);
43
- transition-timing-function: var(--curveEasyEase);
44
- transition-property: transform;
45
- }
46
-
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
-
64
- :where(.withLabel.above) > .indicator {
65
- margin-top: 0;
66
- }
67
-
68
- :where(.small) > .indicator {
69
- font-size: var(--fontSizeBase300);
70
- height: var(--spacingHorizontalL);
71
- width: var(--spacingHorizontalXXXL);
72
- }
73
-
74
- .input:checked ~ :global(.fui-Switch__indicator) > * {
75
- transform: translateX(var(--spacingHorizontalXL));
76
- }
77
-
78
- .input:checked ~ :global(.fui-Switch__indicator) > *:where(:dir(rtl)) {
79
- transform: translateX(calc(var(--spacingHorizontalXL) * -1));
80
- }
81
-
82
- .input:disabled ~ :global(.fui-Switch__indicator),
83
- .input[aria-disabled='true'] ~ :global(.fui-Switch__indicator) {
84
- color: var(--colorNeutralForegroundDisabled);
85
- }
86
-
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
-
93
- .input:disabled,
94
- .input[aria-disabled='true'] {
95
- cursor: default;
96
- }
97
-
98
- .input:enabled:not(:checked):not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
99
- color: var(--colorNeutralStrokeAccessible);
100
- border-color: var(--colorNeutralStrokeAccessible);
101
- }
102
-
103
- .input:enabled:not(:checked):not([aria-disabled='true']) ~ :global(.fui-Switch__label) {
104
- color: var(--colorNeutralForeground1);
105
- }
106
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
154
- :where(.withLabel.before) > .input {
155
- inset-inline-end: 0;
156
- top: 0;
157
- }
158
-
159
- :where(.withLabel.after) > .input {
160
- inset-inline-start: 0;
161
- top: 0;
162
- }
163
-
164
- :where(.withLabel.above) > .input {
165
- bottom: 0;
166
- height: calc(var(--spacingHorizontalXL) + var(--spacingVerticalS));
167
- width: 100%;
168
- }
169
-
170
- :where(.small) > .input:checked ~ :global(.fui-Switch__indicator) > * {
171
- transform: translateX(var(--spacingHorizontalL));
172
- }
173
-
174
- :where(.small) > .input:checked ~ :global(.fui-Switch__indicator) > *:where(:dir(rtl)) {
175
- transform: translateX(calc(var(--spacingHorizontalL) * -1));
176
- }
177
-
178
- :where(.small) > .input {
179
- width: calc(var(--spacingHorizontalXXXL) + 2 * var(--spacingHorizontalS));
180
- }
181
-
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
-
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
-
196
- :where(.above) > .label {
197
- padding-top: var(--spacingVerticalXS);
198
- padding-bottom: var(--spacingVerticalXS);
199
- width: 100%;
200
- }
201
-
202
- :where(.after) > .label {
203
- padding-inline-start: var(--spacingHorizontalXS);
204
- }
205
-
206
- :where(.before) > .label {
207
- padding-inline-end: var(--spacingHorizontalXS);
208
- }
209
-
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;
216
- }
217
- }
218
-
219
- @media screen and (prefers-reduced-motion: reduce) {
220
- .indicator {
221
- transition-duration: 0.01ms;
222
- }
223
- }
224
-
225
- @media (forced-colors: active) {
226
- .indicator > i {
227
- forced-color-adjust: none;
228
- }
229
- }
230
-
231
- @media (forced-colors: active) {
232
- .indicator {
233
- color: CanvasText;
234
- }
235
- }
236
-
237
- @media screen and (prefers-reduced-motion: reduce) {
238
- .indicator > * {
239
- transition-duration: 0.01ms;
240
- }
241
- }
242
-
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;
248
- }
249
- }
250
-
251
- @media (forced-colors: active) {
252
- .input:disabled ~ :global(.fui-Switch__label),
253
- .input[aria-disabled='true'] ~ :global(.fui-Switch__label) {
254
- color: GrayText;
255
- }
256
- }
257
-
258
- @media (forced-colors: active) {
259
- .input:hover {
260
- color: CanvasText;
261
- }
262
- }
263
-
264
- @media (forced-colors: active) {
265
- .input:hover:active {
266
- color: CanvasText;
267
- }
268
- }
269
-
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;
274
- }
275
- }
276
-
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;
281
- }
282
- }
283
-
284
- @media (forced-colors: active) {
285
- .input:enabled:checked:not([aria-disabled='true']) ~ :global(.fui-Switch__indicator) {
286
- background-color: Highlight;
287
- color: Canvas;
288
- }
289
- }
290
- }
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get switchClassName () {
13
- return switchClassName;
14
- },
15
- get switchClassNames () {
16
- return switchClassNames;
17
- },
18
- get useSwitchStyles_unstable () {
19
- return useSwitchStyles_unstable;
20
- }
21
- });
22
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
23
- const _clsx = require("clsx");
24
- const _Switchmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Switch.module.css"));
25
- const switchClassNames = {
26
- root: 'fui-Switch',
27
- indicator: 'fui-Switch__indicator',
28
- input: 'fui-Switch__input',
29
- label: 'fui-Switch__label'
30
- };
31
- const switchClassName = switchClassNames.root;
32
- const useSwitchStyles_unstable = (state)=>{
33
- state.root.className = (0, _clsx.clsx)(switchClassNames.root, _Switchmodulecss.default.root, _Switchmodulecss.default[state.labelPosition], _Switchmodulecss.default[state.size], state.label && _Switchmodulecss.default.withLabel, state.root.className);
34
- state.indicator.className = (0, _clsx.clsx)(switchClassNames.indicator, _Switchmodulecss.default.indicator, state.indicator.className);
35
- state.input.className = (0, _clsx.clsx)(switchClassNames.input, _Switchmodulecss.default.input, state.input.className);
36
- if (state.label) {
37
- state.label.className = (0, _clsx.clsx)(switchClassNames.label, _Switchmodulecss.default.label, state.label.className);
38
- }
39
- return state;
40
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Switch/useSwitchStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SwitchState, SwitchSlots } from './Switch.types';\nimport styles from './Switch.module.css';\n\nexport const switchClassNames: SlotClassNames<SwitchSlots> = {\n root: 'fui-Switch',\n indicator: 'fui-Switch__indicator',\n input: 'fui-Switch__input',\n label: 'fui-Switch__label',\n};\n\n/** @deprecated Use `switchClassNames.root` instead. */\nexport const switchClassName = switchClassNames.root;\n\nexport const useSwitchStyles_unstable = (state: SwitchState): SwitchState => {\n state.root.className = clsx(\n switchClassNames.root,\n styles.root,\n styles[state.labelPosition],\n styles[state.size],\n state.label && styles.withLabel,\n state.root.className,\n );\n state.indicator.className = clsx(switchClassNames.indicator, styles.indicator, state.indicator.className);\n state.input.className = clsx(switchClassNames.input, styles.input, state.input.className);\n if (state.label) {\n state.label.className = clsx(switchClassNames.label, styles.label, state.label.className);\n }\n return state;\n};\n"],"names":["clsx","styles","switchClassNames","root","indicator","input","label","switchClassName","useSwitchStyles_unstable","state","className","labelPosition","size","withLabel"],"mappings":";;;;;;;;;;;QAaaO;;;QARAL;;;QAUAM;;;;;sBAfQ,OAAO;0EAGT,sBAAsB;AAElC,yBAAsD;IAC3DL,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,OAAO;AACT,EAAE;AAGK,wBAAwBJ,iBAAiBC,IAAI,CAAC;AAE9C,iCAAiC,CAACM;IACvCA,MAAMN,IAAI,CAACO,SAAS,OAAGV,UAAAA,EACrBE,iBAAiBC,IAAI,EACrBF,wBAAAA,CAAOE,IAAI,EACXF,wBAAM,CAACQ,MAAME,aAAa,CAAC,EAC3BV,wBAAM,CAACQ,MAAMG,IAAI,CAAC,EAClBH,MAAMH,KAAK,IAAIL,wBAAAA,CAAOY,SAAS,EAC/BJ,MAAMN,IAAI,CAACO,SAAS;IAEtBD,MAAML,SAAS,CAACM,SAAS,OAAGV,UAAAA,EAAKE,iBAAiBE,SAAS,EAAEH,wBAAAA,CAAOG,SAAS,EAAEK,MAAML,SAAS,CAACM,SAAS;IACxGD,MAAMJ,KAAK,CAACK,SAAS,OAAGV,UAAAA,EAAKE,iBAAiBG,KAAK,EAAEJ,wBAAAA,CAAOI,KAAK,EAAEI,MAAMJ,KAAK,CAACK,SAAS;IACxF,IAAID,MAAMH,KAAK,EAAE;QACfG,MAAMH,KAAK,CAACI,SAAS,OAAGV,UAAAA,EAAKE,iBAAiBI,KAAK,EAAEL,wBAAAA,CAAOK,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IAC1F;IACA,OAAOD;AACT,EAAE"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get switchClassName () {
13
- return switchClassName;
14
- },
15
- get switchClassNames () {
16
- return switchClassNames;
17
- },
18
- get useSwitchStyles_unstable () {
19
- return useSwitchStyles_unstable;
20
- }
21
- });
22
- const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
23
- const _clsx = require("clsx");
24
- const _Switchmodulecss = /*#__PURE__*/ _interop_require_default._(require("./Switch.module.css"));
25
- const switchClassNames = {
26
- root: 'fui-Switch',
27
- indicator: 'fui-Switch__indicator',
28
- input: 'fui-Switch__input',
29
- label: 'fui-Switch__label'
30
- };
31
- const switchClassName = switchClassNames.root;
32
- const useSwitchStyles_unstable = (state)=>{
33
- state.root.className = (0, _clsx.clsx)(switchClassNames.root, _Switchmodulecss.default.root, _Switchmodulecss.default[state.labelPosition], _Switchmodulecss.default[state.size], state.label && _Switchmodulecss.default.withLabel, state.root.className);
34
- state.indicator.className = (0, _clsx.clsx)(switchClassNames.indicator, _Switchmodulecss.default.indicator, state.indicator.className);
35
- state.input.className = (0, _clsx.clsx)(switchClassNames.input, _Switchmodulecss.default.input, state.input.className);
36
- if (state.label) {
37
- state.label.className = (0, _clsx.clsx)(switchClassNames.label, _Switchmodulecss.default.label, state.label.className);
38
- }
39
- return state;
40
- };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/Switch/useSwitchStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SwitchState, SwitchSlots } from './Switch.types';\nimport styles from './Switch.module.css';\n\nexport const switchClassNames: SlotClassNames<SwitchSlots> = {\n root: 'fui-Switch',\n indicator: 'fui-Switch__indicator',\n input: 'fui-Switch__input',\n label: 'fui-Switch__label',\n};\n\n/** @deprecated Use `switchClassNames.root` instead. */\nexport const switchClassName = switchClassNames.root;\n\nexport const useSwitchStyles_unstable = (state: SwitchState): SwitchState => {\n state.root.className = clsx(\n switchClassNames.root,\n styles.root,\n styles[state.labelPosition],\n styles[state.size],\n state.label && styles.withLabel,\n state.root.className,\n );\n state.indicator.className = clsx(switchClassNames.indicator, styles.indicator, state.indicator.className);\n state.input.className = clsx(switchClassNames.input, styles.input, state.input.className);\n if (state.label) {\n state.label.className = clsx(switchClassNames.label, styles.label, state.label.className);\n }\n return state;\n};\n"],"names":["clsx","styles","switchClassNames","root","indicator","input","label","switchClassName","useSwitchStyles_unstable","state","className","labelPosition","size","withLabel"],"mappings":";;;;;;;;;;;QAaaO;;;QARAL;;;QAUAM;;;;;sBAfQ,OAAO;0EAGT,sBAAsB;AAElC,yBAAsD;IAC3DL,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,OAAO;AACT,EAAE;AAGK,wBAAwBJ,iBAAiBC,IAAI,CAAC;AAE9C,iCAAiC,CAACM;IACvCA,MAAMN,IAAI,CAACO,SAAS,OAAGV,UAAAA,EACrBE,iBAAiBC,IAAI,EACrBF,wBAAAA,CAAOE,IAAI,EACXF,wBAAM,CAACQ,MAAME,aAAa,CAAC,EAC3BV,wBAAM,CAACQ,MAAMG,IAAI,CAAC,EAClBH,MAAMH,KAAK,IAAIL,wBAAAA,CAAOY,SAAS,EAC/BJ,MAAMN,IAAI,CAACO,SAAS;IAEtBD,MAAML,SAAS,CAACM,SAAS,OAAGV,UAAAA,EAAKE,iBAAiBE,SAAS,EAAEH,wBAAAA,CAAOG,SAAS,EAAEK,MAAML,SAAS,CAACM,SAAS;IACxGD,MAAMJ,KAAK,CAACK,SAAS,OAAGV,UAAAA,EAAKE,iBAAiBG,KAAK,EAAEJ,wBAAAA,CAAOI,KAAK,EAAEI,MAAMJ,KAAK,CAACK,SAAS;IACxF,IAAID,MAAMH,KAAK,EAAE;QACfG,MAAMH,KAAK,CAACI,SAAS,OAAGV,UAAAA,EAAKE,iBAAiBI,KAAK,EAAEL,wBAAAA,CAAOK,KAAK,EAAEG,MAAMH,KAAK,CAACI,SAAS;IAC1F;IACA,OAAOD;AACT,EAAE"}