@fluentui/react-switch 9.0.0-rc.8 → 9.0.1

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.
Files changed (36) hide show
  1. package/CHANGELOG.json +387 -1
  2. package/CHANGELOG.md +152 -37
  3. package/MIGRATION.md +1 -5
  4. package/README.md +20 -14
  5. package/Spec.md +2 -2
  6. package/dist/index.d.ts +19 -18
  7. package/{lib → dist}/tsdoc-metadata.json +0 -0
  8. package/lib/components/Switch/Switch.js.map +1 -1
  9. package/lib/components/Switch/Switch.types.js.map +1 -1
  10. package/lib/components/Switch/renderSwitch.js.map +1 -1
  11. package/lib/components/Switch/useSwitch.js.map +1 -1
  12. package/lib/components/Switch/useSwitchStyles.js +64 -61
  13. package/lib/components/Switch/useSwitchStyles.js.map +1 -1
  14. package/lib-commonjs/components/Switch/Switch.js.map +1 -1
  15. package/lib-commonjs/components/Switch/renderSwitch.js.map +1 -1
  16. package/lib-commonjs/components/Switch/useSwitch.js.map +1 -1
  17. package/lib-commonjs/components/Switch/useSwitchStyles.js +64 -61
  18. package/lib-commonjs/components/Switch/useSwitchStyles.js.map +1 -1
  19. package/lib-commonjs/index.js.map +1 -1
  20. package/package.json +12 -14
  21. package/lib/Switch.d.ts +0 -1
  22. package/lib/components/Switch/Switch.d.ts +0 -6
  23. package/lib/components/Switch/Switch.types.d.ts +0 -65
  24. package/lib/components/Switch/index.d.ts +0 -5
  25. package/lib/components/Switch/renderSwitch.d.ts +0 -5
  26. package/lib/components/Switch/useSwitch.d.ts +0 -12
  27. package/lib/components/Switch/useSwitchStyles.d.ts +0 -11
  28. package/lib/index.d.ts +0 -2
  29. package/lib-commonjs/Switch.d.ts +0 -1
  30. package/lib-commonjs/components/Switch/Switch.d.ts +0 -6
  31. package/lib-commonjs/components/Switch/Switch.types.d.ts +0 -65
  32. package/lib-commonjs/components/Switch/index.d.ts +0 -5
  33. package/lib-commonjs/components/Switch/renderSwitch.d.ts +0 -5
  34. package/lib-commonjs/components/Switch/useSwitch.d.ts +0 -12
  35. package/lib-commonjs/components/Switch/useSwitchStyles.d.ts +0 -11
  36. package/lib-commonjs/index.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,12 +1,127 @@
1
1
  # Change Log - @fluentui/react-switch
2
2
 
3
- This log was last generated on Wed, 04 May 2022 13:24:19 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 28 Jun 2022 17:37:52 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.1)
8
+
9
+ Tue, 28 Jun 2022 17:37:52 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0..@fluentui/react-switch_v9.0.1)
11
+
12
+ ### Patches
13
+
14
+ - fix: Use caret dependency range for Griffel ([PR #23754](https://github.com/microsoft/fluentui/pull/23754) by lingfangao@hotmail.com)
15
+ - Bump @fluentui/react-label to v9.0.1 ([PR #23754](https://github.com/microsoft/fluentui/pull/23754) by beachball)
16
+ - Bump @fluentui/react-tabster to v9.0.1 ([PR #23754](https://github.com/microsoft/fluentui/pull/23754) by beachball)
17
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.10 ([PR #23754](https://github.com/microsoft/fluentui/pull/23754) by beachball)
18
+
19
+ ## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0)
20
+
21
+ Tue, 28 Jun 2022 15:14:04 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.14..@fluentui/react-switch_v9.0.0)
23
+
24
+ ### Patches
25
+
26
+ - feat: Initial 9.0.0 release ([PR #23733](https://github.com/microsoft/fluentui/pull/23733) by lingfangao@hotmail.com)
27
+ - Bump @fluentui/react-label to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
28
+ - Bump @fluentui/react-tabster to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
29
+ - Bump @fluentui/react-theme to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
30
+ - Bump @fluentui/react-utilities to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
31
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.9 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
32
+
33
+ ### Changes
34
+
35
+ - Bump Griffel dependencies ([PR #23688](https://github.com/microsoft/fluentui/pull/23688) by lingfangao@hotmail.com)
36
+ - fix: Removing user-select: 'none' from label. ([PR #23590](https://github.com/microsoft/fluentui/pull/23590) by Humberto.Morimoto@microsoft.com)
37
+ - README update. ([PR #23439](https://github.com/microsoft/fluentui/pull/23439) by Humberto.Morimoto@microsoft.com)
38
+ - chore: Update @fluentui/react-icons to latest version ([PR #23459](https://github.com/microsoft/fluentui/pull/23459) by olfedias@microsoft.com)
39
+ - fix: Making thumb be vertically centered in Switch. ([PR #23712](https://github.com/microsoft/fluentui/pull/23712) by Humberto.Morimoto@microsoft.com)
40
+ - README, spec and migration guide cleanup. ([PR #23396](https://github.com/microsoft/fluentui/pull/23396) by Humberto.Morimoto@microsoft.com)
41
+ - Update 9.0.0-rc dependencies to use caret range ([PR #23732](https://github.com/microsoft/fluentui/pull/23732) by lingfangao@hotmail.com)
42
+
43
+ ## [9.0.0-rc.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.14)
44
+
45
+ Thu, 23 Jun 2022 14:25:31 GMT
46
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.13..@fluentui/react-switch_v9.0.0-rc.14)
47
+
48
+ ### Changes
49
+
50
+ - Bump @fluentui/react-label to v9.0.0-rc.6 ([PR #23608](https://github.com/microsoft/fluentui/pull/23608) by beachball)
51
+ - Bump @fluentui/react-tabster to v9.0.0-rc.14 ([PR #23608](https://github.com/microsoft/fluentui/pull/23608) by beachball)
52
+ - Bump @fluentui/react-theme to v9.0.0-rc.10 ([PR #23608](https://github.com/microsoft/fluentui/pull/23608) by beachball)
53
+
54
+ ## [9.0.0-rc.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.13)
55
+
56
+ Tue, 31 May 2022 21:28:47 GMT
57
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.12..@fluentui/react-switch_v9.0.0-rc.13)
58
+
59
+ ### Changes
60
+
61
+ - chore: Update Griffel to latest version ([PR #23275](https://github.com/microsoft/fluentui/pull/23275) by olfedias@microsoft.com)
62
+ - Bump @fluentui/react-label to v9.0.0-rc.5 ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by beachball)
63
+ - Bump @fluentui/react-tabster to v9.0.0-rc.13 ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by beachball)
64
+ - Bump @fluentui/react-utilities to v9.0.0-rc.10 ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by beachball)
65
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.8 ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by beachball)
66
+
67
+ ## [9.0.0-rc.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.12)
68
+
69
+ Thu, 26 May 2022 21:01:30 GMT
70
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.11..@fluentui/react-switch_v9.0.0-rc.12)
71
+
72
+ ### Changes
73
+
74
+ - Bump @fluentui/react-label to v9.0.0-rc.4 ([PR #23267](https://github.com/microsoft/fluentui/pull/23267) by beachball)
75
+ - Bump @fluentui/react-tabster to v9.0.0-rc.12 ([PR #23267](https://github.com/microsoft/fluentui/pull/23267) by beachball)
76
+
77
+ ## [9.0.0-rc.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.11)
78
+
79
+ Mon, 23 May 2022 18:56:51 GMT
80
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.10..@fluentui/react-switch_v9.0.0-rc.11)
81
+
82
+ ### Changes
83
+
84
+ - Bump @fluentui/react-label to v9.0.0-rc.3 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
85
+ - Bump @fluentui/react-tabster to v9.0.0-rc.11 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
86
+ - Bump @fluentui/react-theme to v9.0.0-rc.9 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
87
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.7 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
88
+
89
+ ## [9.0.0-rc.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.10)
90
+
91
+ Mon, 23 May 2022 12:13:46 GMT
92
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.9..@fluentui/react-switch_v9.0.0-rc.10)
93
+
94
+ ### Changes
95
+
96
+ - chore: Update Griffel to latest version ([PR #22894](https://github.com/microsoft/fluentui/pull/22894) by olfedias@microsoft.com)
97
+ - Replace hardcoded padding with spacing tokens ([PR #22982](https://github.com/microsoft/fluentui/pull/22982) by behowell@microsoft.com)
98
+ - Refactor styles to remove usage of flex gap ([PR #22976](https://github.com/microsoft/fluentui/pull/22976) by behowell@microsoft.com)
99
+ - Updated react-label package version to RC. ([PR #22865](https://github.com/microsoft/fluentui/pull/22865) by esteban.230@hotmail.com)
100
+ - feat: ship rolluped only dts ([PR #22874](https://github.com/microsoft/fluentui/pull/22874) by martinhochel@microsoft.com)
101
+ - Removing SwitchCommons type in @fluentui/react-switch. ([PR #22943](https://github.com/microsoft/fluentui/pull/22943) by Humberto.Morimoto@microsoft.com)
102
+ - chore: Update Griffel to latest version ([PR #23029](https://github.com/microsoft/fluentui/pull/23029) by olfedias@microsoft.com)
103
+ - Bump @fluentui/react-label to v9.0.0-rc.2 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
104
+ - Bump @fluentui/react-tabster to v9.0.0-rc.10 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
105
+ - Bump @fluentui/react-theme to v9.0.0-rc.8 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
106
+ - Bump @fluentui/react-utilities to v9.0.0-rc.9 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
107
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.6 ([PR #23030](https://github.com/microsoft/fluentui/pull/23030) by beachball)
108
+
109
+ ## [9.0.0-rc.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.9)
110
+
111
+ Thu, 05 May 2022 18:26:26 GMT
112
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.8..@fluentui/react-switch_v9.0.0-rc.9)
113
+
114
+ ### Changes
115
+
116
+ - Bump @fluentui/react-label to v9.0.0-beta.12 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
117
+ - Bump @fluentui/react-tabster to v9.0.0-rc.9 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
118
+ - Bump @fluentui/react-theme to v9.0.0-rc.7 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
119
+ - Bump @fluentui/react-utilities to v9.0.0-rc.8 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
120
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.5 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
121
+
7
122
  ## [9.0.0-rc.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.8)
8
123
 
9
- Wed, 04 May 2022 13:24:19 GMT
124
+ Wed, 04 May 2022 13:26:51 GMT
10
125
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.7..@fluentui/react-switch_v9.0.0-rc.8)
11
126
 
12
127
  ### Changes
@@ -19,7 +134,7 @@ Wed, 04 May 2022 13:24:19 GMT
19
134
 
20
135
  ## [9.0.0-rc.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.7)
21
136
 
22
- Mon, 25 Apr 2022 09:32:19 GMT
137
+ Mon, 25 Apr 2022 09:32:19 GMT
23
138
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.6..@fluentui/react-switch_v9.0.0-rc.7)
24
139
 
25
140
  ### Changes
@@ -28,7 +143,7 @@ Mon, 25 Apr 2022 09:32:19 GMT
28
143
 
29
144
  ## [9.0.0-rc.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.6)
30
145
 
31
- Tue, 19 Apr 2022 19:16:54 GMT
146
+ Tue, 19 Apr 2022 19:16:54 GMT
32
147
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.5..@fluentui/react-switch_v9.0.0-rc.6)
33
148
 
34
149
  ### Changes
@@ -46,7 +161,7 @@ Tue, 19 Apr 2022 19:16:54 GMT
46
161
 
47
162
  ## [9.0.0-rc.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.5)
48
163
 
49
- Fri, 04 Mar 2022 05:17:30 GMT
164
+ Fri, 04 Mar 2022 05:17:30 GMT
50
165
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.4..@fluentui/react-switch_v9.0.0-rc.5)
51
166
 
52
167
  ### Changes
@@ -60,7 +175,7 @@ Fri, 04 Mar 2022 05:17:30 GMT
60
175
 
61
176
  ## [9.0.0-rc.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.4)
62
177
 
63
- Tue, 01 Mar 2022 02:17:38 GMT
178
+ Tue, 01 Mar 2022 02:17:38 GMT
64
179
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.3..@fluentui/react-switch_v9.0.0-rc.4)
65
180
 
66
181
  ### Changes
@@ -73,7 +188,7 @@ Tue, 01 Mar 2022 02:17:38 GMT
73
188
 
74
189
  ## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.3)
75
190
 
76
- Fri, 18 Feb 2022 13:35:34 GMT
191
+ Fri, 18 Feb 2022 13:35:34 GMT
77
192
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.1..@fluentui/react-switch_v9.0.0-rc.3)
78
193
 
79
194
  ### Changes
@@ -87,7 +202,7 @@ Fri, 18 Feb 2022 13:35:34 GMT
87
202
 
88
203
  ## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.1)
89
204
 
90
- Thu, 10 Feb 2022 08:50:51 GMT
205
+ Thu, 10 Feb 2022 08:50:51 GMT
91
206
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.5..@fluentui/react-switch_v9.0.0-rc.1)
92
207
 
93
208
  ### Changes
@@ -109,7 +224,7 @@ Thu, 10 Feb 2022 08:50:51 GMT
109
224
 
110
225
  ## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.5)
111
226
 
112
- Thu, 25 Nov 2021 08:34:17 GMT
227
+ Thu, 25 Nov 2021 08:34:17 GMT
113
228
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.4..@fluentui/react-switch_v9.0.0-beta.5)
114
229
 
115
230
  ### Changes
@@ -124,7 +239,7 @@ Thu, 25 Nov 2021 08:34:17 GMT
124
239
 
125
240
  ## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.4)
126
241
 
127
- Fri, 12 Nov 2021 13:25:33 GMT
242
+ Fri, 12 Nov 2021 13:25:33 GMT
128
243
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.3..@fluentui/react-switch_v9.0.0-beta.4)
129
244
 
130
245
  ### Changes
@@ -140,7 +255,7 @@ Fri, 12 Nov 2021 13:25:33 GMT
140
255
 
141
256
  ## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.3)
142
257
 
143
- Wed, 27 Oct 2021 12:14:22 GMT
258
+ Wed, 27 Oct 2021 12:14:22 GMT
144
259
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.2..@fluentui/react-switch_v9.0.0-beta.3)
145
260
 
146
261
  ### Changes
@@ -160,7 +275,7 @@ Wed, 27 Oct 2021 12:14:22 GMT
160
275
 
161
276
  ## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.2)
162
277
 
163
- Tue, 12 Oct 2021 19:45:58 GMT
278
+ Tue, 12 Oct 2021 19:45:58 GMT
164
279
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.1..@fluentui/react-switch_v9.0.0-beta.2)
165
280
 
166
281
  ### Changes
@@ -170,7 +285,7 @@ Tue, 12 Oct 2021 19:45:58 GMT
170
285
 
171
286
  ## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.1)
172
287
 
173
- Wed, 06 Oct 2021 10:37:22 GMT
288
+ Wed, 06 Oct 2021 10:37:22 GMT
174
289
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.17..@fluentui/react-switch_v9.0.0-beta.1)
175
290
 
176
291
  ### Changes
@@ -189,7 +304,7 @@ Wed, 06 Oct 2021 10:37:22 GMT
189
304
 
190
305
  ## [9.0.0-alpha.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.17)
191
306
 
192
- Tue, 05 Oct 2021 12:47:58 GMT
307
+ Tue, 05 Oct 2021 12:47:58 GMT
193
308
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.16..@fluentui/react-switch_v9.0.0-alpha.17)
194
309
 
195
310
  ### Changes
@@ -204,7 +319,7 @@ Tue, 05 Oct 2021 12:47:58 GMT
204
319
 
205
320
  ## [9.0.0-alpha.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.16)
206
321
 
207
- Tue, 05 Oct 2021 09:28:07 GMT
322
+ Tue, 05 Oct 2021 09:28:07 GMT
208
323
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.15..@fluentui/react-switch_v9.0.0-alpha.16)
209
324
 
210
325
  ### Changes
@@ -221,7 +336,7 @@ Tue, 05 Oct 2021 09:28:07 GMT
221
336
 
222
337
  ## [9.0.0-alpha.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.15)
223
338
 
224
- Fri, 01 Oct 2021 14:13:08 GMT
339
+ Fri, 01 Oct 2021 14:13:08 GMT
225
340
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.13..@fluentui/react-switch_v9.0.0-alpha.15)
226
341
 
227
342
  ### Changes
@@ -240,7 +355,7 @@ Fri, 01 Oct 2021 14:13:08 GMT
240
355
 
241
356
  ## [9.0.0-alpha.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.13)
242
357
 
243
- Fri, 01 Oct 2021 09:44:56 GMT
358
+ Fri, 01 Oct 2021 09:44:56 GMT
244
359
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.12..@fluentui/react-switch_v9.0.0-alpha.13)
245
360
 
246
361
  ### Changes
@@ -251,7 +366,7 @@ Fri, 01 Oct 2021 09:44:56 GMT
251
366
 
252
367
  ## [9.0.0-alpha.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.12)
253
368
 
254
- Wed, 29 Sep 2021 08:06:11 GMT
369
+ Wed, 29 Sep 2021 08:06:11 GMT
255
370
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.11..@fluentui/react-switch_v9.0.0-alpha.12)
256
371
 
257
372
  ### Changes
@@ -268,7 +383,7 @@ Wed, 29 Sep 2021 08:06:11 GMT
268
383
 
269
384
  ## [9.0.0-alpha.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.11)
270
385
 
271
- Mon, 27 Sep 2021 08:06:00 GMT
386
+ Mon, 27 Sep 2021 08:06:00 GMT
272
387
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.10..@fluentui/react-switch_v9.0.0-alpha.11)
273
388
 
274
389
  ### Changes
@@ -284,7 +399,7 @@ Mon, 27 Sep 2021 08:06:00 GMT
284
399
 
285
400
  ## [9.0.0-alpha.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.10)
286
401
 
287
- Fri, 24 Sep 2021 09:17:17 GMT
402
+ Fri, 24 Sep 2021 09:17:17 GMT
288
403
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.9..@fluentui/react-switch_v9.0.0-alpha.10)
289
404
 
290
405
  ### Changes
@@ -300,7 +415,7 @@ Fri, 24 Sep 2021 09:17:17 GMT
300
415
 
301
416
  ## [9.0.0-alpha.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.9)
302
417
 
303
- Thu, 23 Sep 2021 08:21:34 GMT
418
+ Thu, 23 Sep 2021 08:21:34 GMT
304
419
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.8..@fluentui/react-switch_v9.0.0-alpha.9)
305
420
 
306
421
  ### Changes
@@ -317,7 +432,7 @@ Thu, 23 Sep 2021 08:21:34 GMT
317
432
 
318
433
  ## [9.0.0-alpha.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.8)
319
434
 
320
- Wed, 22 Sep 2021 10:10:07 GMT
435
+ Wed, 22 Sep 2021 10:10:07 GMT
321
436
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.7..@fluentui/react-switch_v9.0.0-alpha.8)
322
437
 
323
438
  ### Changes
@@ -334,7 +449,7 @@ Wed, 22 Sep 2021 10:10:07 GMT
334
449
 
335
450
  ## [9.0.0-alpha.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.7)
336
451
 
337
- Tue, 21 Sep 2021 07:42:34 GMT
452
+ Tue, 21 Sep 2021 07:42:34 GMT
338
453
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.6..@fluentui/react-switch_v9.0.0-alpha.7)
339
454
 
340
455
  ### Changes
@@ -351,7 +466,7 @@ Tue, 21 Sep 2021 07:42:34 GMT
351
466
 
352
467
  ## [9.0.0-alpha.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.6)
353
468
 
354
- Mon, 20 Sep 2021 07:36:26 GMT
469
+ Mon, 20 Sep 2021 07:36:26 GMT
355
470
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.5..@fluentui/react-switch_v9.0.0-alpha.6)
356
471
 
357
472
  ### Changes
@@ -360,7 +475,7 @@ Mon, 20 Sep 2021 07:36:26 GMT
360
475
 
361
476
  ## [9.0.0-alpha.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.5)
362
477
 
363
- Fri, 17 Sep 2021 07:35:26 GMT
478
+ Fri, 17 Sep 2021 07:35:26 GMT
364
479
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.4..@fluentui/react-switch_v9.0.0-alpha.5)
365
480
 
366
481
  ### Changes
@@ -369,7 +484,7 @@ Fri, 17 Sep 2021 07:35:26 GMT
369
484
 
370
485
  ## [9.0.0-alpha.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.4)
371
486
 
372
- Thu, 16 Sep 2021 07:38:39 GMT
487
+ Thu, 16 Sep 2021 07:38:39 GMT
373
488
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.3..@fluentui/react-switch_v9.0.0-alpha.4)
374
489
 
375
490
  ### Changes
@@ -379,7 +494,7 @@ Thu, 16 Sep 2021 07:38:39 GMT
379
494
 
380
495
  ## [9.0.0-alpha.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.3)
381
496
 
382
- Tue, 14 Sep 2021 20:09:02 GMT
497
+ Tue, 14 Sep 2021 20:09:02 GMT
383
498
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.2..@fluentui/react-switch_v9.0.0-alpha.3)
384
499
 
385
500
  ### Changes
@@ -388,7 +503,7 @@ Tue, 14 Sep 2021 20:09:02 GMT
388
503
 
389
504
  ## [9.0.0-alpha.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.2)
390
505
 
391
- Fri, 10 Sep 2021 16:31:53 GMT
506
+ Fri, 10 Sep 2021 16:31:53 GMT
392
507
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.1..@fluentui/react-switch_v9.0.0-alpha.2)
393
508
 
394
509
  ### Changes
@@ -398,7 +513,7 @@ Fri, 10 Sep 2021 16:31:53 GMT
398
513
 
399
514
  ## [9.0.0-alpha.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.1)
400
515
 
401
- Fri, 10 Sep 2021 07:39:51 GMT
516
+ Fri, 10 Sep 2021 07:39:51 GMT
402
517
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.1)
403
518
 
404
519
  ### Changes
@@ -407,7 +522,7 @@ Fri, 10 Sep 2021 07:39:51 GMT
407
522
 
408
523
  ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.0)
409
524
 
410
- Mon, 06 Sep 2021 07:34:53 GMT
525
+ Mon, 06 Sep 2021 07:34:53 GMT
411
526
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.0)
412
527
 
413
528
  ### Changes
@@ -416,7 +531,7 @@ Mon, 06 Sep 2021 07:34:53 GMT
416
531
 
417
532
  ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.0)
418
533
 
419
- Thu, 02 Sep 2021 07:36:46 GMT
534
+ Thu, 02 Sep 2021 07:36:46 GMT
420
535
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.0)
421
536
 
422
537
  ### Patches
@@ -429,7 +544,7 @@ Thu, 02 Sep 2021 07:36:46 GMT
429
544
 
430
545
  ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.0)
431
546
 
432
- Wed, 01 Sep 2021 07:39:56 GMT
547
+ Wed, 01 Sep 2021 07:39:56 GMT
433
548
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.0)
434
549
 
435
550
  ### Changes
@@ -438,7 +553,7 @@ Wed, 01 Sep 2021 07:39:56 GMT
438
553
 
439
554
  ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.0)
440
555
 
441
- Tue, 31 Aug 2021 07:37:47 GMT
556
+ Tue, 31 Aug 2021 07:37:47 GMT
442
557
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.0)
443
558
 
444
559
  ### Changes
@@ -447,7 +562,7 @@ Tue, 31 Aug 2021 07:37:47 GMT
447
562
 
448
563
  ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.0)
449
564
 
450
- Fri, 27 Aug 2021 07:33:32 GMT
565
+ Fri, 27 Aug 2021 07:33:32 GMT
451
566
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.0)
452
567
 
453
568
  ### Changes
@@ -456,7 +571,7 @@ Fri, 27 Aug 2021 07:33:32 GMT
456
571
 
457
572
  ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.0)
458
573
 
459
- Thu, 26 Aug 2021 07:35:43 GMT
574
+ Thu, 26 Aug 2021 07:35:43 GMT
460
575
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.0)
461
576
 
462
577
  ### Changes
@@ -465,7 +580,7 @@ Thu, 26 Aug 2021 07:35:43 GMT
465
580
 
466
581
  ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.0)
467
582
 
468
- Fri, 20 Aug 2021 07:37:28 GMT
583
+ Fri, 20 Aug 2021 07:37:28 GMT
469
584
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.0)
470
585
 
471
586
  ### Changes
@@ -474,7 +589,7 @@ Fri, 20 Aug 2021 07:37:28 GMT
474
589
 
475
590
  ## [9.0.0-alpha.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-alpha.0)
476
591
 
477
- Thu, 19 Aug 2021 07:41:35 GMT
592
+ Thu, 19 Aug 2021 07:41:35 GMT
478
593
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.0..@fluentui/react-switch_v9.0.0-alpha.0)
479
594
 
480
595
  ### Changes
package/MIGRATION.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # Switch Migration
2
2
 
3
- ## STATUS: WIP 🚧
4
-
5
- This Migration guide is a work in progress and is not yet ready for use.
6
-
7
3
  ## Migration from v8's Toggle
8
4
 
9
5
  ### Props that remain as is
@@ -68,7 +64,7 @@ This Migration guide is a work in progress and is not yet ready for use.
68
64
 
69
65
  - `design`
70
66
 
71
- ## Propery mapping
67
+ ## Property mapping
72
68
 
73
69
  | v8 `Toggle` | v0 `Checkbox` | v9 `Switch` |
74
70
  | ---------------- | --------------- | ---------------- |
package/README.md CHANGED
@@ -1,23 +1,13 @@
1
1
  # @fluentui/react-switch
2
2
 
3
- **React Switch components for [Fluent UI React](https://developer.microsoft.com/en-us/fluentui)**
3
+ **Switch components for [Fluent UI React](https://aka.ms/fluentui-storybook)**
4
4
 
5
- The `Switch` control (formerly `Toggle`) enables users to trigger an option on or off through pressing on the component.
6
-
7
- ## STATUS: WIP 🚧
8
-
9
- These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
5
+ The `Switch` control enables users to trigger an option on or off through interacting with the component.
10
6
 
11
7
  ## Usage
12
8
 
13
9
  To import Switch:
14
10
 
15
- ```js
16
- import { Switch } from '@fluentui/react-switch';
17
- ```
18
-
19
- Once the Switch component graduates to a production release, the component will be available at:
20
-
21
11
  ```js
22
12
  import { Switch } from '@fluentui/react-components';
23
13
  ```
@@ -26,7 +16,23 @@ import { Switch } from '@fluentui/react-components';
26
16
 
27
17
  ```jsx
28
18
  <Switch />
29
- <Switch defaultChecked={true} />
30
- <Switch checked={switchValue} onChange={switchOnChange} />
19
+ <Switch defaultChecked required />
20
+ <Switch checked onChange={onChange} />
31
21
  <Switch disabled />
22
+ <Switch label="Enable dark mode" labelPosition="after" />
32
23
  ```
24
+
25
+ See [Fluent UI Storybook](https://aka.ms/fluentui-storybook) for more detailed usage examples.
26
+
27
+ Alternatively, run Storybook locally with:
28
+
29
+ 1. `yarn start`
30
+ 2. Select `react-switch` from the list.
31
+
32
+ ### Specification
33
+
34
+ See [SPEC.md](./Spec.md).
35
+
36
+ ### Migration Guide
37
+
38
+ If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating to the latest Switch implementation.
package/Spec.md CHANGED
@@ -109,7 +109,7 @@ https://github.com/microsoft/fluentui/blob/master/packages/react-checkbox/src/co
109
109
 
110
110
  ### Switch Props
111
111
 
112
- See [Switch.types.ts](https://github.com/microsoft/fluentui/blob/master/packages/react-switch/src/components/Switch/Switch.types.ts).
112
+ See API at [Switch.types.ts](./src/components/Switch/Switch.types.ts).
113
113
 
114
114
  ## Structure
115
115
 
@@ -165,7 +165,7 @@ _With label after the track thumb indicator:_
165
165
 
166
166
  ## Migration
167
167
 
168
- See [MIGRATION.md](MIGRATION.md).
168
+ See [MIGRATION.md](./MIGRATION.md).
169
169
 
170
170
  ## Behaviors
171
171
 
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="react" />
2
+
1
3
  import type { ComponentProps } from '@fluentui/react-utilities';
2
4
  import type { ComponentState } from '@fluentui/react-utilities';
3
5
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
@@ -23,36 +25,35 @@ export declare const switchClassName: string;
23
25
 
24
26
  export declare const switchClassNames: SlotClassNames<SwitchSlots>;
25
27
 
26
- declare type SwitchCommons = {
28
+ export declare type SwitchOnChangeData = {
29
+ checked: boolean;
30
+ };
31
+
32
+ /**
33
+ * Switch Props
34
+ */
35
+ export declare type SwitchProps = Omit<ComponentProps<Partial<SwitchSlots>, 'input'>, 'checked' | 'defaultChecked' | 'onChange'> & {
27
36
  /**
28
37
  * Defines the controlled checked state of the Switch.
29
38
  * If passed, Switch ignores the `defaultChecked` property.
30
39
  * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the
31
40
  * correct value based on handling `onChange` events and re-rendering.
41
+ *
32
42
  * @default false
33
43
  */
34
44
  checked?: boolean;
35
- /**
36
- * The position of the label relative to the Switch.
37
- *
38
- * @default after
39
- */
40
- labelPosition: 'above' | 'after' | 'before';
41
- };
42
-
43
- export declare type SwitchOnChangeData = {
44
- checked: boolean;
45
- };
46
-
47
- /**
48
- * Switch Props
49
- */
50
- export declare type SwitchProps = Omit<ComponentProps<Partial<SwitchSlots>, 'input'>, 'onChange'> & Partial<SwitchCommons> & {
51
45
  /**
52
46
  * Defines whether the Switch is initially in a checked state or not when rendered.
47
+ *
53
48
  * @default false
54
49
  */
55
50
  defaultChecked?: boolean;
51
+ /**
52
+ * The position of the label relative to the Switch.
53
+ *
54
+ * @default after
55
+ */
56
+ labelPosition?: 'above' | 'after' | 'before';
56
57
  /**
57
58
  * Callback to be called when the checked state value changes.
58
59
  */
@@ -87,7 +88,7 @@ export declare type SwitchSlots = {
87
88
  /**
88
89
  * State used in rendering Switch
89
90
  */
90
- export declare type SwitchState = ComponentState<SwitchSlots> & SwitchCommons;
91
+ export declare type SwitchState = ComponentState<SwitchSlots> & Required<Pick<SwitchProps, 'labelPosition'>>;
91
92
 
92
93
  /**
93
94
  * Create the state required to render Switch.
File without changes
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,aAAnC;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AACA,SAAS,wBAAT,QAAyC,mBAAzC;AAIA;;AAEG;;AACH,OAAO,MAAM,MAAM,gBAAqC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtF,QAAM,KAAK,GAAG,kBAAkB,CAAC,KAAD,EAAQ,GAAR,CAAhC;AAEA,EAAA,wBAAwB,CAAC,KAAD,CAAxB;AAEA,SAAO,qBAAqB,CAAC,KAAD,CAA5B;AACD,CANuD,CAAjD;AAQP,MAAM,CAAC,WAAP,GAAqB,QAArB","sourcesContent":["import * as React from 'react';\nimport { useSwitch_unstable } from './useSwitch';\nimport { renderSwitch_unstable } from './renderSwitch';\nimport { useSwitchStyles_unstable } from './useSwitchStyles';\nimport type { SwitchProps } from './Switch.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Switches enable users to trigger an option on or off through pressing the component.\n */\nexport const Switch: ForwardRefComponent<SwitchProps> = React.forwardRef((props, ref) => {\n const state = useSwitch_unstable(props, ref);\n\n useSwitchStyles_unstable(state);\n\n return renderSwitch_unstable(state);\n});\n\nSwitch.displayName = 'Switch';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,aAAnC;AACA,SAAS,qBAAT,QAAsC,gBAAtC;AACA,SAAS,wBAAT,QAAyC,mBAAzC;AAIA;;AAEG;;AACH,OAAO,MAAM,MAAM,gBAAqC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACtF,MAAM,KAAK,GAAG,kBAAkB,CAAC,KAAD,EAAQ,GAAR,CAAhC;EAEA,wBAAwB,CAAC,KAAD,CAAxB;EAEA,OAAO,qBAAqB,CAAC,KAAD,CAA5B;AACD,CANuD,CAAjD;AAQP,MAAM,CAAC,WAAP,GAAqB,QAArB","sourcesContent":["import * as React from 'react';\nimport { useSwitch_unstable } from './useSwitch';\nimport { renderSwitch_unstable } from './renderSwitch';\nimport { useSwitchStyles_unstable } from './useSwitchStyles';\nimport type { SwitchProps } from './Switch.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Switches enable users to trigger an option on or off through pressing the component.\n */\nexport const Switch: ForwardRefComponent<SwitchProps> = React.forwardRef((props, ref) => {\n const state = useSwitch_unstable(props, ref);\n\n useSwitchStyles_unstable(state);\n\n return renderSwitch_unstable(state);\n});\n\nSwitch.displayName = 'Switch';\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.types.js","sourceRoot":"../src/","sources":["components/Switch/Switch.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type SwitchSlots = {\n /**\n * The root element of the Switch.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Switch>` tag.\n * All other native props will be applied to the primary slot: `input`.\n */\n root: NonNullable<Slot<'div'>>;\n\n /**\n * The track and the thumb sliding over it indicating the on and off status of the Switch.\n */\n indicator: NonNullable<Slot<'div'>>;\n\n /**\n * Hidden input that handles the Switch's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on the `<Switch>` tag will be applied to this\n * slot, except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * The Switch's label.\n */\n label?: Slot<typeof Label>;\n};\n\ntype SwitchCommons = {\n /**\n * Defines the controlled checked state of the Switch.\n * If passed, Switch ignores the `defaultChecked` property.\n * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the\n * correct value based on handling `onChange` events and re-rendering.\n * @default false\n */\n checked?: boolean;\n\n /**\n * The position of the label relative to the Switch.\n *\n * @default after\n */\n labelPosition: 'above' | 'after' | 'before';\n};\n\nexport type SwitchOnChangeData = {\n checked: boolean;\n};\n\n/**\n * Switch Props\n */\nexport type SwitchProps = Omit<ComponentProps<Partial<SwitchSlots>, 'input'>, 'onChange'> &\n Partial<SwitchCommons> & {\n /**\n * Defines whether the Switch is initially in a checked state or not when rendered.\n * @default false\n */\n defaultChecked?: boolean;\n\n /**\n * Callback to be called when the checked state value changes.\n */\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: SwitchOnChangeData) => void;\n };\n\n/**\n * State used in rendering Switch\n */\nexport type SwitchState = ComponentState<SwitchSlots> & SwitchCommons;\n"]}
1
+ {"version":3,"file":"Switch.types.js","sourceRoot":"../src/","sources":["components/Switch/Switch.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type SwitchSlots = {\n /**\n * The root element of the Switch.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Switch>` tag.\n * All other native props will be applied to the primary slot: `input`.\n */\n root: NonNullable<Slot<'div'>>;\n\n /**\n * The track and the thumb sliding over it indicating the on and off status of the Switch.\n */\n indicator: NonNullable<Slot<'div'>>;\n\n /**\n * Hidden input that handles the Switch's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on the `<Switch>` tag will be applied to this\n * slot, except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * The Switch's label.\n */\n label?: Slot<typeof Label>;\n};\n\nexport type SwitchOnChangeData = {\n checked: boolean;\n};\n\n/**\n * Switch Props\n */\nexport type SwitchProps = Omit<\n ComponentProps<Partial<SwitchSlots>, 'input'>,\n 'checked' | 'defaultChecked' | 'onChange'\n> & {\n /**\n * Defines the controlled checked state of the Switch.\n * If passed, Switch ignores the `defaultChecked` property.\n * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the\n * correct value based on handling `onChange` events and re-rendering.\n *\n * @default false\n */\n checked?: boolean;\n\n /**\n * Defines whether the Switch is initially in a checked state or not when rendered.\n *\n * @default false\n */\n defaultChecked?: boolean;\n\n /**\n * The position of the label relative to the Switch.\n *\n * @default after\n */\n labelPosition?: 'above' | 'after' | 'before';\n\n /**\n * Callback to be called when the checked state value changes.\n */\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: SwitchOnChangeData) => void;\n};\n\n/**\n * State used in rendering Switch\n */\nexport type SwitchState = ComponentState<SwitchSlots> & Required<Pick<SwitchProps, 'labelPosition'>>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Switch/renderSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAAuB;AAC1D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAc,KAAd,CAArC;AACA,QAAM;AAAE,IAAA;AAAF,MAAoB,KAA1B;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;AAAf,GAAZ,CADF,EAEG,aAAa,KAAK,OAAlB,IAA6B,KAAK,CAAC,KAAnC,iBAA4C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;AAAf,GAAZ,CAF/C,eAGE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAhB,CAHF,EAIG,aAAa,KAAK,OAAlB,IAA6B,KAAK,CAAC,KAAnC,iBAA4C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;AAAf,GAAZ,CAJ/C,CADF;AAQD,CAZM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SwitchState, SwitchSlots } from './Switch.types';\n\n/**\n * Render a Switch component by passing the state defined props to the appropriate slots.\n */\nexport const renderSwitch_unstable = (state: SwitchState) => {\n const { slots, slotProps } = getSlots<SwitchSlots>(state);\n const { labelPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n {labelPosition !== 'after' && slots.label && <slots.label {...slotProps.label} />}\n <slots.indicator {...slotProps.indicator} />\n {labelPosition === 'after' && slots.label && <slots.label {...slotProps.label} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/Switch/renderSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAAuB;EAC1D,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,QAAQ,CAAc,KAAd,CAArC;EACA,MAAM;IAAE;EAAF,IAAoB,KAA1B;EAEA,oBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;EAAf,CAAZ,CADF,EAEG,aAAa,KAAK,OAAlB,IAA6B,KAAK,CAAC,KAAnC,iBAA4C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;EAAf,CAAZ,CAF/C,eAGE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,EAAA,GAAK,SAAS,CAAC;EAAf,CAAhB,CAHF,EAIG,aAAa,KAAK,OAAlB,IAA6B,KAAK,CAAC,KAAnC,iBAA4C,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;EAAf,CAAZ,CAJ/C,CADF;AAQD,CAZM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SwitchState, SwitchSlots } from './Switch.types';\n\n/**\n * Render a Switch component by passing the state defined props to the appropriate slots.\n */\nexport const renderSwitch_unstable = (state: SwitchState) => {\n const { slots, slotProps } = getSlots<SwitchSlots>(state);\n const { labelPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n {labelPosition !== 'after' && slots.label && <slots.label {...slotProps.label} />}\n <slots.indicator {...slotProps.indicator} />\n {labelPosition === 'after' && slots.label && <slots.label {...slotProps.label} />}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}