@fluentui/react-switch 0.0.0-nightlyebf02572f720211207.1 → 0.0.0-nightlyf3017f159620220222.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 (40) hide show
  1. package/CHANGELOG.json +154 -22
  2. package/CHANGELOG.md +44 -12
  3. package/dist/react-switch.d.ts +12 -17
  4. package/lib/Switch.js.map +1 -1
  5. package/lib/components/Switch/Switch.js +6 -6
  6. package/lib/components/Switch/Switch.js.map +1 -1
  7. package/lib/components/Switch/Switch.types.d.ts +10 -9
  8. package/lib/components/Switch/Switch.types.js.map +1 -1
  9. package/lib/components/Switch/index.js.map +1 -1
  10. package/lib/components/Switch/renderSwitch.d.ts +1 -1
  11. package/lib/components/Switch/renderSwitch.js +9 -4
  12. package/lib/components/Switch/renderSwitch.js.map +1 -1
  13. package/lib/components/Switch/useSwitch.d.ts +2 -6
  14. package/lib/components/Switch/useSwitch.js +1 -6
  15. package/lib/components/Switch/useSwitch.js.map +1 -1
  16. package/lib/components/Switch/useSwitchState.js +1 -1
  17. package/lib/components/Switch/useSwitchState.js.map +1 -1
  18. package/lib/components/Switch/useSwitchStyles.d.ts +1 -1
  19. package/lib/components/Switch/useSwitchStyles.js +10 -24
  20. package/lib/components/Switch/useSwitchStyles.js.map +1 -1
  21. package/lib/index.js.map +1 -1
  22. package/lib-commonjs/Switch.js.map +1 -1
  23. package/lib-commonjs/components/Switch/Switch.js +3 -3
  24. package/lib-commonjs/components/Switch/Switch.js.map +1 -1
  25. package/lib-commonjs/components/Switch/Switch.types.d.ts +10 -9
  26. package/lib-commonjs/components/Switch/Switch.types.js.map +1 -1
  27. package/lib-commonjs/components/Switch/index.js.map +1 -1
  28. package/lib-commonjs/components/Switch/renderSwitch.d.ts +1 -1
  29. package/lib-commonjs/components/Switch/renderSwitch.js +11 -7
  30. package/lib-commonjs/components/Switch/renderSwitch.js.map +1 -1
  31. package/lib-commonjs/components/Switch/useSwitch.d.ts +2 -6
  32. package/lib-commonjs/components/Switch/useSwitch.js +4 -9
  33. package/lib-commonjs/components/Switch/useSwitch.js.map +1 -1
  34. package/lib-commonjs/components/Switch/useSwitchState.js +1 -1
  35. package/lib-commonjs/components/Switch/useSwitchState.js.map +1 -1
  36. package/lib-commonjs/components/Switch/useSwitchStyles.d.ts +1 -1
  37. package/lib-commonjs/components/Switch/useSwitchStyles.js +25 -38
  38. package/lib-commonjs/components/Switch/useSwitchStyles.js.map +1 -1
  39. package/lib-commonjs/index.js.map +1 -1
  40. package/package.json +7 -9
package/CHANGELOG.json CHANGED
@@ -2,72 +2,204 @@
2
2
  "name": "@fluentui/react-switch",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 07 Dec 2021 04:14:29 GMT",
6
- "tag": "@fluentui/react-switch_v0.0.0-nightlyebf02572f720211207.1",
7
- "version": "0.0.0-nightlyebf02572f720211207.1",
5
+ "date": "Tue, 22 Feb 2022 04:13:19 GMT",
6
+ "tag": "@fluentui/react-switch_v0.0.0-nightlyf3017f159620220222.1",
7
+ "version": "0.0.0-nightlyf3017f159620220222.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
11
11
  "author": "email not defined",
12
12
  "package": "@fluentui/react-switch",
13
- "commit": "2523b8c9da23ec860780244563814b63ba963043",
13
+ "commit": "abd89ece026acc4dc588f4a78edfb26dc1b57921",
14
14
  "comment": "Release nightly v9"
15
15
  },
16
16
  {
17
- "author": "olfedias@microsoft.com",
17
+ "author": "beachball",
18
18
  "package": "@fluentui/react-switch",
19
- "commit": "029a7f2fe40e5abe21d8992ad9d92bf2b04d0e97",
20
- "comment": "update styles to not use CSS shorthands"
19
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlyf3017f159620220222.1",
20
+ "commit": "abd89ece026acc4dc588f4a78edfb26dc1b57921"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-switch",
25
- "comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlyebf02572f720211207.1",
26
- "commit": "2523b8c9da23ec860780244563814b63ba963043"
25
+ "comment": "Bump @fluentui/react-tabster to v0.0.0-nightlyf3017f159620220222.1",
26
+ "commit": "abd89ece026acc4dc588f4a78edfb26dc1b57921"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-switch",
31
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlyebf02572f720211207.1",
32
- "commit": "2523b8c9da23ec860780244563814b63ba963043"
31
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyf3017f159620220222.1",
32
+ "commit": "abd89ece026acc4dc588f4a78edfb26dc1b57921"
33
33
  },
34
34
  {
35
35
  "author": "beachball",
36
36
  "package": "@fluentui/react-switch",
37
- "comment": "Bump @fluentui/react-tabster to v0.0.0-nightlyebf02572f720211207.1",
38
- "commit": "2523b8c9da23ec860780244563814b63ba963043"
37
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightlyf3017f159620220222.1",
38
+ "commit": "abd89ece026acc4dc588f4a78edfb26dc1b57921"
39
+ }
40
+ ]
41
+ }
42
+ },
43
+ {
44
+ "date": "Fri, 18 Feb 2022 13:35:34 GMT",
45
+ "tag": "@fluentui/react-switch_v9.0.0-rc.3",
46
+ "version": "9.0.0-rc.3",
47
+ "comments": {
48
+ "prerelease": [
49
+ {
50
+ "author": "mgodbolt@microsoft.com",
51
+ "package": "@fluentui/react-switch",
52
+ "commit": "2c9804dd585c1b485736c34321264dc62abe6fe1",
53
+ "comment": "fix visual display of controlled switches"
54
+ },
55
+ {
56
+ "author": "lingfangao@hotmail.com",
57
+ "package": "@fluentui/react-switch",
58
+ "commit": "1aa9e691fcccd9a64168cea7941c0f1e71fa1d14",
59
+ "comment": "fix: Source maps contain original source code"
39
60
  },
40
61
  {
41
62
  "author": "beachball",
42
63
  "package": "@fluentui/react-switch",
43
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyebf02572f720211207.1",
44
- "commit": "2523b8c9da23ec860780244563814b63ba963043"
64
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.3",
65
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
45
66
  },
46
67
  {
47
68
  "author": "beachball",
48
69
  "package": "@fluentui/react-switch",
49
- "comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightlyebf02572f720211207.1",
50
- "commit": "2523b8c9da23ec860780244563814b63ba963043"
70
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-rc.3",
71
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
51
72
  },
52
73
  {
53
74
  "author": "beachball",
54
75
  "package": "@fluentui/react-switch",
55
- "comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlyebf02572f720211207.1",
56
- "commit": "2523b8c9da23ec860780244563814b63ba963043"
76
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.3",
77
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
57
78
  },
58
79
  {
59
80
  "author": "beachball",
60
81
  "package": "@fluentui/react-switch",
61
- "comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlyebf02572f720211207.1",
62
- "commit": "2523b8c9da23ec860780244563814b63ba963043"
82
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.3",
83
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
63
84
  }
64
- ],
85
+ ]
86
+ }
87
+ },
88
+ {
89
+ "date": "Thu, 10 Feb 2022 08:50:51 GMT",
90
+ "tag": "@fluentui/react-switch_v9.0.0-rc.1",
91
+ "version": "9.0.0-rc.1",
92
+ "comments": {
65
93
  "none": [
94
+ {
95
+ "author": "martinhochel@microsoft.com",
96
+ "package": "@fluentui/react-switch",
97
+ "commit": "8dfa712156b70414205b87b5b6d099367b0c297d",
98
+ "comment": "chore: use storybook runner for all vNext packages"
99
+ },
66
100
  {
67
101
  "author": "andredias@microsoft.com",
68
102
  "package": "@fluentui/react-switch",
69
103
  "commit": "bf950e951b102fd8be046993dbb604073fc4ea9e",
70
104
  "comment": "Migrate package to use solution tsconfigs"
105
+ },
106
+ {
107
+ "author": "martinhochel@microsoft.com",
108
+ "package": "@fluentui/react-switch",
109
+ "commit": "28ceaaa83cd92a0389c466f0b15b283e3d9b08e4",
110
+ "comment": "test(react-switch): update snapshots to match new JSDOM"
111
+ },
112
+ {
113
+ "author": "olfedias@microsoft.com",
114
+ "package": "@fluentui/react-switch",
115
+ "commit": "c061e98be4b4a718c72a144a1f60bb5515824612",
116
+ "comment": "remove inline-style-expand-shorthand from tsconfigs"
117
+ }
118
+ ],
119
+ "prerelease": [
120
+ {
121
+ "author": "olfedias@microsoft.com",
122
+ "package": "@fluentui/react-switch",
123
+ "commit": "1df1d6e85bd3a6ab2a7b13e96a9aac324bb6d00c",
124
+ "comment": "Replace make-styles packages with griffel equivalents."
125
+ },
126
+ {
127
+ "author": "Humberto.Morimoto@microsoft.com",
128
+ "package": "@fluentui/react-switch",
129
+ "commit": "e0b8e1fa6980077e7b311fd1c72c28d3e4305db0",
130
+ "comment": "Updating based on changes to composition types."
131
+ },
132
+ {
133
+ "author": "behowell@microsoft.com",
134
+ "package": "@fluentui/react-switch",
135
+ "commit": "7cc28ed8320b00f42d91c63882f10316db2205c5",
136
+ "comment": "Remove component's shorthandProps array"
137
+ },
138
+ {
139
+ "author": "behowell@microsoft.com",
140
+ "package": "@fluentui/react-switch",
141
+ "commit": "53b01d71e335715fda91b33e3d7bbd9d471d5ed3",
142
+ "comment": "Refactor component Slot typings"
143
+ },
144
+ {
145
+ "author": "mgodbolt@microsoft.com",
146
+ "package": "@fluentui/react-switch",
147
+ "commit": "839ec14849e112b85aa321d034739ec421199141",
148
+ "comment": "remove export of commons types"
149
+ },
150
+ {
151
+ "author": "olfedias@microsoft.com",
152
+ "package": "@fluentui/react-switch",
153
+ "commit": "029a7f2fe40e5abe21d8992ad9d92bf2b04d0e97",
154
+ "comment": "update styles to not use CSS shorthands"
155
+ },
156
+ {
157
+ "author": "Humberto.Morimoto@microsoft.com",
158
+ "package": "@fluentui/react-switch",
159
+ "commit": "b52ebbbf185a2ddc4de814238f9438fd04bfba02",
160
+ "comment": "Replacing use of functions in makeStyles with direct use of tokens."
161
+ },
162
+ {
163
+ "author": "Humberto.Morimoto@microsoft.com",
164
+ "package": "@fluentui/react-switch",
165
+ "commit": "38c8bed2c707014688ae2ae689033fa36ef23075",
166
+ "comment": "Updating packages based on changes to focusIndicator functions to remove functions from makeStyles in @fluentui/react-tabster."
167
+ },
168
+ {
169
+ "author": "behowell@microsoft.com",
170
+ "package": "@fluentui/react-switch",
171
+ "commit": "317209bb5cd57c40f35bc42060acb7e3cce5ec95",
172
+ "comment": "BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet"
173
+ },
174
+ {
175
+ "author": "lingfangao@hotmail.com",
176
+ "package": "@fluentui/react-switch",
177
+ "commit": "c00913d50e2dd15bbfbb0757cefe43b192ff1d7f",
178
+ "comment": "Bump Fluent UI dependencies to 9.0.0-rc"
179
+ },
180
+ {
181
+ "author": "beachball",
182
+ "package": "@fluentui/react-switch",
183
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.1",
184
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
185
+ },
186
+ {
187
+ "author": "beachball",
188
+ "package": "@fluentui/react-switch",
189
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-rc.1",
190
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
191
+ },
192
+ {
193
+ "author": "beachball",
194
+ "package": "@fluentui/react-switch",
195
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.1",
196
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
197
+ },
198
+ {
199
+ "author": "beachball",
200
+ "package": "@fluentui/react-switch",
201
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1",
202
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
71
203
  }
72
204
  ]
73
205
  }
package/CHANGELOG.md CHANGED
@@ -1,25 +1,57 @@
1
1
  # Change Log - @fluentui/react-switch
2
2
 
3
- This log was last generated on Tue, 07 Dec 2021 04:14:29 GMT and should not be manually modified.
3
+ This log was last generated on Tue, 22 Feb 2022 04:13:19 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightlyebf02572f720211207.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v0.0.0-nightlyebf02572f720211207.1)
7
+ ## [0.0.0-nightlyf3017f159620220222.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v0.0.0-nightlyf3017f159620220222.1)
8
8
 
9
- Tue, 07 Dec 2021 04:14:29 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.5..@fluentui/react-switch_v0.0.0-nightlyebf02572f720211207.1)
9
+ Tue, 22 Feb 2022 04:13:19 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.3..@fluentui/react-switch_v0.0.0-nightlyf3017f159620220222.1)
11
11
 
12
12
  ### Changes
13
13
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/2523b8c9da23ec860780244563814b63ba963043) by email not defined)
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/abd89ece026acc4dc588f4a78edfb26dc1b57921) by email not defined)
15
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightlyf3017f159620220222.1 ([commit](https://github.com/microsoft/fluentui/commit/abd89ece026acc4dc588f4a78edfb26dc1b57921) by beachball)
16
+ - Bump @fluentui/react-tabster to v0.0.0-nightlyf3017f159620220222.1 ([commit](https://github.com/microsoft/fluentui/commit/abd89ece026acc4dc588f4a78edfb26dc1b57921) by beachball)
17
+ - Bump @fluentui/react-utilities to v0.0.0-nightlyf3017f159620220222.1 ([commit](https://github.com/microsoft/fluentui/commit/abd89ece026acc4dc588f4a78edfb26dc1b57921) by beachball)
18
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightlyf3017f159620220222.1 ([commit](https://github.com/microsoft/fluentui/commit/abd89ece026acc4dc588f4a78edfb26dc1b57921) by beachball)
19
+
20
+ ## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.3)
21
+
22
+ Fri, 18 Feb 2022 13:35:34 GMT
23
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.1..@fluentui/react-switch_v9.0.0-rc.3)
24
+
25
+ ### Changes
26
+
27
+ - fix visual display of controlled switches ([PR #21704](https://github.com/microsoft/fluentui/pull/21704) by mgodbolt@microsoft.com)
28
+ - fix: Source maps contain original source code ([PR #21690](https://github.com/microsoft/fluentui/pull/21690) by lingfangao@hotmail.com)
29
+ - Bump @fluentui/react-shared-contexts to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
30
+ - Bump @fluentui/react-tabster to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
31
+ - Bump @fluentui/react-utilities to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
32
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
33
+
34
+ ## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.1)
35
+
36
+ Thu, 10 Feb 2022 08:50:51 GMT
37
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.5..@fluentui/react-switch_v9.0.0-rc.1)
38
+
39
+ ### Changes
40
+
41
+ - Replace make-styles packages with griffel equivalents. ([PR #21424](https://github.com/microsoft/fluentui/pull/21424) by olfedias@microsoft.com)
42
+ - Updating based on changes to composition types. ([PR #20891](https://github.com/microsoft/fluentui/pull/20891) by Humberto.Morimoto@microsoft.com)
43
+ - Remove component's shorthandProps array ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com)
44
+ - Refactor component Slot typings ([PR #21518](https://github.com/microsoft/fluentui/pull/21518) by behowell@microsoft.com)
45
+ - remove export of commons types ([PR #21660](https://github.com/microsoft/fluentui/pull/21660) by mgodbolt@microsoft.com)
15
46
  - update styles to not use CSS shorthands ([PR #20844](https://github.com/microsoft/fluentui/pull/20844) by olfedias@microsoft.com)
16
- - Bump @fluentui/react-make-styles to v0.0.0-nightlyebf02572f720211207.1 ([commit](https://github.com/microsoft/fluentui/commit/2523b8c9da23ec860780244563814b63ba963043) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightlyebf02572f720211207.1 ([commit](https://github.com/microsoft/fluentui/commit/2523b8c9da23ec860780244563814b63ba963043) by beachball)
18
- - Bump @fluentui/react-tabster to v0.0.0-nightlyebf02572f720211207.1 ([commit](https://github.com/microsoft/fluentui/commit/2523b8c9da23ec860780244563814b63ba963043) by beachball)
19
- - Bump @fluentui/react-utilities to v0.0.0-nightlyebf02572f720211207.1 ([commit](https://github.com/microsoft/fluentui/commit/2523b8c9da23ec860780244563814b63ba963043) by beachball)
20
- - Bump @fluentui/babel-make-styles to v0.0.0-nightlyebf02572f720211207.1 ([commit](https://github.com/microsoft/fluentui/commit/2523b8c9da23ec860780244563814b63ba963043) by beachball)
21
- - Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlyebf02572f720211207.1 ([commit](https://github.com/microsoft/fluentui/commit/2523b8c9da23ec860780244563814b63ba963043) by beachball)
22
- - Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlyebf02572f720211207.1 ([commit](https://github.com/microsoft/fluentui/commit/2523b8c9da23ec860780244563814b63ba963043) by beachball)
47
+ - Replacing use of functions in makeStyles with direct use of tokens. ([PR #21056](https://github.com/microsoft/fluentui/pull/21056) by Humberto.Morimoto@microsoft.com)
48
+ - Updating packages based on changes to focusIndicator functions to remove functions from makeStyles in @fluentui/react-tabster. ([PR #21035](https://github.com/microsoft/fluentui/pull/21035) by Humberto.Morimoto@microsoft.com)
49
+ - BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet ([PR #21365](https://github.com/microsoft/fluentui/pull/21365) by behowell@microsoft.com)
50
+ - Bump Fluent UI dependencies to 9.0.0-rc ([PR #21623](https://github.com/microsoft/fluentui/pull/21623) by lingfangao@hotmail.com)
51
+ - Bump @fluentui/react-shared-contexts to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
52
+ - Bump @fluentui/react-tabster to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
53
+ - Bump @fluentui/react-utilities to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
54
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
23
55
 
24
56
  ## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.5)
25
57
 
@@ -1,13 +1,13 @@
1
1
  import type { ComponentProps } from '@fluentui/react-utilities';
2
2
  import type { ComponentState } from '@fluentui/react-utilities';
3
3
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
- import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
5
4
  import * as React_2 from 'react';
5
+ import type { Slot } from '@fluentui/react-utilities';
6
6
 
7
7
  /**
8
8
  * Render the final JSX of Switch
9
9
  */
10
- export declare const renderSwitch: (state: SwitchState) => JSX.Element;
10
+ export declare const renderSwitch_unstable: (state: SwitchState) => JSX.Element;
11
11
 
12
12
  /**
13
13
  * The Switch control enables users to trigger an option on or off through pressing on the component.
@@ -16,7 +16,7 @@ export declare const Switch: ForwardRefComponent<SwitchProps>;
16
16
 
17
17
  export declare const switchClassName = "fui-Switch";
18
18
 
19
- export declare interface SwitchCommons {
19
+ declare interface SwitchCommons {
20
20
  /**
21
21
  * The starting value for a uncontrolled Switch. If `true` then the Switch will be enabled.
22
22
  * Mutually exclusive with `checked` prop.
@@ -43,39 +43,34 @@ export declare interface SwitchCommons {
43
43
  }) => void;
44
44
  }
45
45
 
46
- export declare interface SwitchProps extends Omit<ComponentProps<SwitchSlots>, 'onChange'>, SwitchCommons {
46
+ export declare interface SwitchProps extends Omit<ComponentProps<Partial<SwitchSlots>>, 'onChange'>, SwitchCommons {
47
47
  }
48
48
 
49
- /**
50
- * Array of all shorthand properties listed in SwitchSlots
51
- */
52
- export declare const switchShorthandProps: (keyof SwitchSlots)[];
53
-
54
49
  export declare type SwitchSlots = {
55
50
  /**
56
51
  * The root of the Switch.
57
52
  */
58
- root: IntrinsicShorthandProps<'div'>;
53
+ root: Slot<'div'>;
59
54
  /**
60
55
  * The bar indicating the status of the Switch.
61
56
  */
62
- track: IntrinsicShorthandProps<'div'>;
57
+ track: NonNullable<Slot<'div'>>;
63
58
  /**
64
59
  * The wrapper around the thumb. It is used as the active area for the thumb to position itself.
65
60
  */
66
- thumbWrapper: IntrinsicShorthandProps<'div'>;
61
+ thumbWrapper: NonNullable<Slot<'div'>>;
67
62
  /**
68
63
  * The circular icon indicating the status of the Switch.
69
64
  */
70
- thumb: IntrinsicShorthandProps<'div'>;
65
+ thumb: NonNullable<Slot<'div'>>;
71
66
  /**
72
67
  * The hidden input that handles the Switch's internal functionality.
73
68
  */
74
- input: IntrinsicShorthandProps<'input'>;
69
+ input: NonNullable<Slot<'input'>>;
75
70
  /**
76
71
  * The area in which the Switch's rail allows for the thumb to be dragged.
77
72
  */
78
- activeRail: IntrinsicShorthandProps<'div'>;
73
+ activeRail: NonNullable<Slot<'div'>>;
79
74
  };
80
75
 
81
76
  export declare interface SwitchState extends ComponentState<SwitchSlots>, SwitchCommons {
@@ -84,11 +79,11 @@ export declare interface SwitchState extends ComponentState<SwitchSlots>, Switch
84
79
  /**
85
80
  * Given user props, returns state and render function for a Switch.
86
81
  */
87
- export declare const useSwitch: (props: SwitchProps, ref: React_2.Ref<HTMLElement>) => SwitchState;
82
+ export declare const useSwitch_unstable: (props: SwitchProps, ref: React_2.Ref<HTMLElement>) => SwitchState;
88
83
 
89
84
  /**
90
85
  * Apply styling to the Switch slots based on the state
91
86
  */
92
- export declare const useSwitchStyles: (state: SwitchState) => SwitchState;
87
+ export declare const useSwitchStyles_unstable: (state: SwitchState) => SwitchState;
93
88
 
94
89
  export { }
package/lib/Switch.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sourceRoot":"","sources":["../src/Switch.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"Switch.js","sourceRoot":"../src/","sources":["Switch.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC","sourcesContent":["export * from './components/Switch/index';\n"]}
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
- import { useSwitch } from './useSwitch';
3
- import { renderSwitch } from './renderSwitch';
4
- import { useSwitchStyles } from './useSwitchStyles';
2
+ import { useSwitch_unstable } from './useSwitch';
3
+ import { renderSwitch_unstable } from './renderSwitch';
4
+ import { useSwitchStyles_unstable } from './useSwitchStyles';
5
5
  /**
6
6
  * The Switch control enables users to trigger an option on or off through pressing on the component.
7
7
  */
8
8
 
9
9
  export const Switch = /*#__PURE__*/React.forwardRef((props, ref) => {
10
- const state = useSwitch(props, ref);
11
- useSwitchStyles(state);
12
- return renderSwitch(state);
10
+ const state = useSwitch_unstable(props, ref);
11
+ useSwitchStyles_unstable(state);
12
+ return renderSwitch_unstable(state);
13
13
  });
14
14
  Switch.displayName = 'Switch';
15
15
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,SAAT,QAA0B,aAA1B;AACA,SAAS,YAAT,QAA6B,gBAA7B;AACA,SAAS,eAAT,QAAgC,mBAAhC;AAIA;;AAEG;;AACH,OAAO,MAAM,MAAM,gBAAqC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtF,QAAM,KAAK,GAAG,SAAS,CAAC,KAAD,EAAQ,GAAR,CAAvB;AAEA,EAAA,eAAe,CAAC,KAAD,CAAf;AAEA,SAAO,YAAY,CAAC,KAAD,CAAnB;AACD,CANuD,CAAjD;AAQP,MAAM,CAAC,WAAP,GAAqB,QAArB","sourceRoot":""}
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 * The Switch control enables users to trigger an option on or off through pressing on 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,32 +1,32 @@
1
1
  import * as React from 'react';
2
- import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
2
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
3
  export declare type SwitchSlots = {
4
4
  /**
5
5
  * The root of the Switch.
6
6
  */
7
- root: IntrinsicShorthandProps<'div'>;
7
+ root: Slot<'div'>;
8
8
  /**
9
9
  * The bar indicating the status of the Switch.
10
10
  */
11
- track: IntrinsicShorthandProps<'div'>;
11
+ track: NonNullable<Slot<'div'>>;
12
12
  /**
13
13
  * The wrapper around the thumb. It is used as the active area for the thumb to position itself.
14
14
  */
15
- thumbWrapper: IntrinsicShorthandProps<'div'>;
15
+ thumbWrapper: NonNullable<Slot<'div'>>;
16
16
  /**
17
17
  * The circular icon indicating the status of the Switch.
18
18
  */
19
- thumb: IntrinsicShorthandProps<'div'>;
19
+ thumb: NonNullable<Slot<'div'>>;
20
20
  /**
21
21
  * The hidden input that handles the Switch's internal functionality.
22
22
  */
23
- input: IntrinsicShorthandProps<'input'>;
23
+ input: NonNullable<Slot<'input'>>;
24
24
  /**
25
25
  * The area in which the Switch's rail allows for the thumb to be dragged.
26
26
  */
27
- activeRail: IntrinsicShorthandProps<'div'>;
27
+ activeRail: NonNullable<Slot<'div'>>;
28
28
  };
29
- export interface SwitchCommons {
29
+ interface SwitchCommons {
30
30
  /**
31
31
  * The starting value for a uncontrolled Switch. If `true` then the Switch will be enabled.
32
32
  * Mutually exclusive with `checked` prop.
@@ -52,7 +52,8 @@ export interface SwitchCommons {
52
52
  checked: boolean;
53
53
  }) => void;
54
54
  }
55
- export interface SwitchProps extends Omit<ComponentProps<SwitchSlots>, 'onChange'>, SwitchCommons {
55
+ export interface SwitchProps extends Omit<ComponentProps<Partial<SwitchSlots>>, 'onChange'>, SwitchCommons {
56
56
  }
57
57
  export interface SwitchState extends ComponentState<SwitchSlots>, SwitchCommons {
58
58
  }
59
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.types.js","sourceRoot":"","sources":["../../../src/components/Switch/Switch.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"Switch.types.js","sourceRoot":"../src/","sources":["components/Switch/Switch.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type SwitchSlots = {\n /**\n * The root of the Switch.\n */\n root: Slot<'div'>;\n\n /**\n * The bar indicating the status of the Switch.\n */\n track: NonNullable<Slot<'div'>>;\n\n /**\n * The wrapper around the thumb. It is used as the active area for the thumb to position itself.\n */\n thumbWrapper: NonNullable<Slot<'div'>>;\n\n /**\n * The circular icon indicating the status of the Switch.\n */\n thumb: NonNullable<Slot<'div'>>;\n\n /**\n * The hidden input that handles the Switch's internal functionality.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * The area in which the Switch's rail allows for the thumb to be dragged.\n */\n activeRail: NonNullable<Slot<'div'>>;\n};\n\ninterface SwitchCommons {\n /**\n * The starting value for a uncontrolled Switch. If `true` then the Switch will be enabled.\n * Mutually exclusive with `checked` prop.\n *\n * @default false\n */\n defaultChecked?: boolean;\n\n /**\n * The current value for a controlled Switch. If `true` then the Switch will be enabled.\n * Mutually exclusive with `defaultChecked` prop.\n */\n checked?: boolean;\n\n /**\n * Whether the Switch should be disabled.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Callback to be called when the `checked` value changes.\n */\n onChange?: (\n ev: React.PointerEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>,\n data: {\n checked: boolean;\n },\n ) => void;\n}\n\nexport interface SwitchProps extends Omit<ComponentProps<Partial<SwitchSlots>>, 'onChange'>, SwitchCommons {}\n\nexport interface SwitchState extends ComponentState<SwitchSlots>, SwitchCommons {}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Switch/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Switch/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './Switch';\nexport * from './Switch.types';\nexport * from './renderSwitch';\nexport * from './useSwitch';\nexport * from './useSwitchStyles';\n"]}
@@ -2,4 +2,4 @@ import type { SwitchState } from './Switch.types';
2
2
  /**
3
3
  * Render the final JSX of Switch
4
4
  */
5
- export declare const renderSwitch: (state: SwitchState) => JSX.Element;
5
+ export declare const renderSwitch_unstable: (state: SwitchState) => JSX.Element;
@@ -1,15 +1,20 @@
1
1
  import * as React from 'react';
2
2
  import { getSlots } from '@fluentui/react-utilities';
3
- import { switchShorthandProps } from './useSwitch';
4
3
  /**
5
4
  * Render the final JSX of Switch
6
5
  */
7
6
 
8
- export const renderSwitch = state => {
7
+ export const renderSwitch_unstable = state => {
9
8
  const {
10
9
  slots,
11
10
  slotProps
12
- } = getSlots(state, switchShorthandProps);
13
- return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.track, Object.assign({}, slotProps.track)), /*#__PURE__*/React.createElement(slots.thumbWrapper, Object.assign({}, slotProps.thumbWrapper), /*#__PURE__*/React.createElement(slots.thumb, Object.assign({}, slotProps.thumb))), /*#__PURE__*/React.createElement(slots.input, Object.assign({}, slotProps.input)), /*#__PURE__*/React.createElement(slots.activeRail, Object.assign({}, slotProps.activeRail)));
11
+ } = getSlots(state);
12
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
13
+ }, /*#__PURE__*/React.createElement(slots.track, { ...slotProps.track
14
+ }), /*#__PURE__*/React.createElement(slots.thumbWrapper, { ...slotProps.thumbWrapper
15
+ }, /*#__PURE__*/React.createElement(slots.thumb, { ...slotProps.thumb
16
+ })), /*#__PURE__*/React.createElement(slots.input, { ...slotProps.input
17
+ }), /*#__PURE__*/React.createElement(slots.activeRail, { ...slotProps.activeRail
18
+ }));
14
19
  };
15
20
  //# sourceMappingURL=renderSwitch.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Switch/renderSwitch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,oBAAT,QAAqC,aAArC;AAGA;;AAEG;;AACH,OAAO,MAAM,YAAY,GAAI,KAAD,IAAuB;AACjD,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAc,KAAd,EAAqB,oBAArB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,KAAf,CAAZ,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,YAAP,EAAmB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,YAAf,CAAnB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,KAAf,CAAZ,CADF,CAFF,eAKE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,KAAf,CAAZ,CALF,eAME,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,UAAf,CAAjB,CANF,CADF;AAUD,CAbM","sourceRoot":""}
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;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,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,YAAP,EAAmB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAnB,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;AAAf,GAAZ,CADF,CAFF,eAKE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,KAAP,EAAY,EAAA,GAAK,SAAS,CAAC;AAAf,GAAZ,CALF,eAME,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAjB,CANF,CADF;AAUD,CAbM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SwitchState, SwitchSlots } from './Switch.types';\n\n/**\n * Render the final JSX of Switch\n */\nexport const renderSwitch_unstable = (state: SwitchState) => {\n const { slots, slotProps } = getSlots<SwitchSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.track {...slotProps.track} />\n <slots.thumbWrapper {...slotProps.thumbWrapper}>\n <slots.thumb {...slotProps.thumb} />\n </slots.thumbWrapper>\n <slots.input {...slotProps.input} />\n <slots.activeRail {...slotProps.activeRail} />\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -1,10 +1,6 @@
1
1
  import * as React from 'react';
2
- import type { SwitchProps, SwitchSlots, SwitchState } from './Switch.types';
3
- /**
4
- * Array of all shorthand properties listed in SwitchSlots
5
- */
6
- export declare const switchShorthandProps: (keyof SwitchSlots)[];
2
+ import type { SwitchProps, SwitchState } from './Switch.types';
7
3
  /**
8
4
  * Given user props, returns state and render function for a Switch.
9
5
  */
10
- export declare const useSwitch: (props: SwitchProps, ref: React.Ref<HTMLElement>) => SwitchState;
6
+ export declare const useSwitch_unstable: (props: SwitchProps, ref: React.Ref<HTMLElement>) => SwitchState;
@@ -1,15 +1,10 @@
1
1
  import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';
2
2
  import { useSwitchState } from './useSwitchState';
3
- /**
4
- * Array of all shorthand properties listed in SwitchSlots
5
- */
6
-
7
- export const switchShorthandProps = ['root', 'track', 'thumbWrapper', 'thumb', 'activeRail', 'input'];
8
3
  /**
9
4
  * Given user props, returns state and render function for a Switch.
10
5
  */
11
6
 
12
- export const useSwitch = (props, ref) => {
7
+ export const useSwitch_unstable = (props, ref) => {
13
8
  const {
14
9
  track,
15
10
  thumbWrapper,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Switch/useSwitch.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,KAAlD,QAA+D,2BAA/D;AACA,SAAS,cAAT,QAA+B,kBAA/B;AAGA;;AAEG;;AACH,OAAO,MAAM,oBAAoB,GAA0B,CACzD,MADyD,EAEzD,OAFyD,EAGzD,cAHyD,EAIzD,OAJyD,EAKzD,YALyD,EAMzD,OANyD,CAApD;AASP;;AAEG;;AACH,OAAO,MAAM,SAAS,GAAG,CAAC,KAAD,EAAqB,GAArB,KAAiE;AACxF,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA,YAAT;AAAuB,IAAA,KAAvB;AAA8B,IAAA,UAA9B;AAA0C,IAAA,KAA1C;AAAiD,IAAA,cAAjD;AAAiE,IAAA,OAAjE;AAA0E,IAAA,QAA1E;AAAoF,IAAA;AAApF,MAAiG,KAAvG;AACA,QAAM,KAAK,GAAgB;AACzB,IAAA,cADyB;AAEzB,IAAA,OAFyB;AAGzB,IAAA,QAHyB;AAIzB,IAAA,QAJyB;AAKzB,IAAA,IAAI,EAAE,qBAAqB,CAAC,MAAD,EAAS;AAClC,MAAA,GADkC;AAElC,SAAG,KAF+B;AAGlC,MAAA,EAAE,EAAE,KAAK,CAAC,SAAD,EAAY,KAAK,CAAC,EAAlB;AAHyB,KAAT,CALF;AAUzB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,KAAK,EAAE,KAFG;AAGV,MAAA,YAAY,EAAE,KAHJ;AAIV,MAAA,KAAK,EAAE,KAJG;AAKV,MAAA,UAAU,EAAE,KALF;AAMV,MAAA,KAAK,EAAE;AANG,KAVa;AAkBzB,IAAA,KAAK,EAAE,gBAAgB,CAAC,KAAD,EAAQ;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAR,CAlBE;AAmBzB,IAAA,YAAY,EAAE,gBAAgB,CAAC,YAAD,EAAe;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAf,CAnBL;AAoBzB,IAAA,KAAK,EAAE,gBAAgB,CAAC,KAAD,EAAQ;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAR,CApBE;AAqBzB,IAAA,UAAU,EAAE,gBAAgB,CAAC,UAAD,EAAa;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAb,CArBH;AAsBzB,IAAA,KAAK,EAAE,gBAAgB,CAAC,KAAD,EAAQ;AAC7B,MAAA,QAAQ,EAAE,IADmB;AAE7B,MAAA,YAAY,EAAE;AACZ,QAAA,IAAI,EAAE;AADM;AAFe,KAAR;AAtBE,GAA3B;AA8BA,EAAA,cAAc,CAAC,KAAD,CAAd;AAEA,SAAO,KAAP;AACD,CAnCM","sourceRoot":""}
1
+ {"version":3,"sources":["components/Switch/useSwitch.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,KAAlD,QAA+D,2BAA/D;AACA,SAAS,cAAT,QAA+B,kBAA/B;AAGA;;AAEG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAAC,KAAD,EAAqB,GAArB,KAAiE;AACjG,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA,YAAT;AAAuB,IAAA,KAAvB;AAA8B,IAAA,UAA9B;AAA0C,IAAA,KAA1C;AAAiD,IAAA,cAAjD;AAAiE,IAAA,OAAjE;AAA0E,IAAA,QAA1E;AAAoF,IAAA;AAApF,MAAiG,KAAvG;AACA,QAAM,KAAK,GAAgB;AACzB,IAAA,cADyB;AAEzB,IAAA,OAFyB;AAGzB,IAAA,QAHyB;AAIzB,IAAA,QAJyB;AAKzB,IAAA,IAAI,EAAE,qBAAqB,CAAC,MAAD,EAAS;AAClC,MAAA,GADkC;AAElC,SAAG,KAF+B;AAGlC,MAAA,EAAE,EAAE,KAAK,CAAC,SAAD,EAAY,KAAK,CAAC,EAAlB;AAHyB,KAAT,CALF;AAUzB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,KAAK,EAAE,KAFG;AAGV,MAAA,YAAY,EAAE,KAHJ;AAIV,MAAA,KAAK,EAAE,KAJG;AAKV,MAAA,UAAU,EAAE,KALF;AAMV,MAAA,KAAK,EAAE;AANG,KAVa;AAkBzB,IAAA,KAAK,EAAE,gBAAgB,CAAC,KAAD,EAAQ;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAR,CAlBE;AAmBzB,IAAA,YAAY,EAAE,gBAAgB,CAAC,YAAD,EAAe;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAf,CAnBL;AAoBzB,IAAA,KAAK,EAAE,gBAAgB,CAAC,KAAD,EAAQ;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAR,CApBE;AAqBzB,IAAA,UAAU,EAAE,gBAAgB,CAAC,UAAD,EAAa;AAAE,MAAA,QAAQ,EAAE;AAAZ,KAAb,CArBH;AAsBzB,IAAA,KAAK,EAAE,gBAAgB,CAAC,KAAD,EAAQ;AAC7B,MAAA,QAAQ,EAAE,IADmB;AAE7B,MAAA,YAAY,EAAE;AACZ,QAAA,IAAI,EAAE;AADM;AAFe,KAAR;AAtBE,GAA3B;AA8BA,EAAA,cAAc,CAAC,KAAD,CAAd;AAEA,SAAO,KAAP;AACD,CAnCM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useSwitchState } from './useSwitchState';\nimport type { SwitchProps, SwitchState } from './Switch.types';\n\n/**\n * Given user props, returns state and render function for a Switch.\n */\nexport const useSwitch_unstable = (props: SwitchProps, ref: React.Ref<HTMLElement>): SwitchState => {\n const { track, thumbWrapper, thumb, activeRail, input, defaultChecked, checked, disabled, onChange } = props;\n const state: SwitchState = {\n defaultChecked,\n checked,\n disabled,\n onChange,\n root: getNativeElementProps('span', {\n ref,\n ...props,\n id: useId('switch-', props.id),\n }),\n components: {\n root: 'div',\n track: 'div',\n thumbWrapper: 'div',\n thumb: 'div',\n activeRail: 'div',\n input: 'input',\n },\n track: resolveShorthand(track, { required: true }),\n thumbWrapper: resolveShorthand(thumbWrapper, { required: true }),\n thumb: resolveShorthand(thumb, { required: true }),\n activeRail: resolveShorthand(activeRail, { required: true }),\n input: resolveShorthand(input, {\n required: true,\n defaultProps: {\n type: 'checkbox',\n },\n }),\n };\n\n useSwitchState(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -38,7 +38,7 @@ export const useSwitchState = state => {
38
38
  setTrue: showThumbAnimation,
39
39
  setFalse: hideThumbAnimation
40
40
  }] = useBoolean(true);
41
- const [renderedPosition, setRenderedPosition] = React.useState(currentValue === true ? 100 : 0);
41
+ const [renderedPosition, setRenderedPosition] = React.useState(undefined);
42
42
  const setChecked = useEventCallback((ev, incomingValue) => {
43
43
  ev.stopPropagation();
44
44
  ev.preventDefault();