@fluentui/react-switch 0.0.0-nightlya0ab3454ed20211208.1 → 0.0.0-nightlya0aef7969220220228.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 (44) hide show
  1. package/CHANGELOG.json +171 -21
  2. package/CHANGELOG.md +47 -12
  3. package/dist/react-switch.d.ts +59 -47
  4. package/lib/Switch.js.map +1 -1
  5. package/lib/components/Switch/Switch.d.ts +1 -1
  6. package/lib/components/Switch/Switch.js +7 -7
  7. package/lib/components/Switch/Switch.js.map +1 -1
  8. package/lib/components/Switch/Switch.types.d.ts +44 -37
  9. package/lib/components/Switch/Switch.types.js.map +1 -1
  10. package/lib/components/Switch/index.js.map +1 -1
  11. package/lib/components/Switch/renderSwitch.d.ts +2 -2
  12. package/lib/components/Switch/renderSwitch.js +12 -5
  13. package/lib/components/Switch/renderSwitch.js.map +1 -1
  14. package/lib/components/Switch/useSwitch.d.ts +9 -7
  15. package/lib/components/Switch/useSwitch.js +64 -49
  16. package/lib/components/Switch/useSwitch.js.map +1 -1
  17. package/lib/components/Switch/useSwitchStyles.d.ts +6 -3
  18. package/lib/components/Switch/useSwitchStyles.js +150 -282
  19. package/lib/components/Switch/useSwitchStyles.js.map +1 -1
  20. package/lib/index.js.map +1 -1
  21. package/lib-commonjs/Switch.js.map +1 -1
  22. package/lib-commonjs/components/Switch/Switch.d.ts +1 -1
  23. package/lib-commonjs/components/Switch/Switch.js +4 -4
  24. package/lib-commonjs/components/Switch/Switch.js.map +1 -1
  25. package/lib-commonjs/components/Switch/Switch.types.d.ts +44 -37
  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 +2 -2
  29. package/lib-commonjs/components/Switch/renderSwitch.js +14 -8
  30. package/lib-commonjs/components/Switch/renderSwitch.js.map +1 -1
  31. package/lib-commonjs/components/Switch/useSwitch.d.ts +9 -7
  32. package/lib-commonjs/components/Switch/useSwitch.js +67 -50
  33. package/lib-commonjs/components/Switch/useSwitch.js.map +1 -1
  34. package/lib-commonjs/components/Switch/useSwitchStyles.d.ts +6 -3
  35. package/lib-commonjs/components/Switch/useSwitchStyles.js +155 -286
  36. package/lib-commonjs/components/Switch/useSwitchStyles.js.map +1 -1
  37. package/lib-commonjs/index.js.map +1 -1
  38. package/package.json +9 -9
  39. package/lib/components/Switch/useSwitchState.d.ts +0 -2
  40. package/lib/components/Switch/useSwitchState.js +0 -144
  41. package/lib/components/Switch/useSwitchState.js.map +0 -1
  42. package/lib-commonjs/components/Switch/useSwitchState.d.ts +0 -2
  43. package/lib-commonjs/components/Switch/useSwitchState.js +0 -156
  44. package/lib-commonjs/components/Switch/useSwitchState.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,72 +2,222 @@
2
2
  "name": "@fluentui/react-switch",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 08 Dec 2021 04:18:26 GMT",
6
- "tag": "@fluentui/react-switch_v0.0.0-nightlya0ab3454ed20211208.1",
7
- "version": "0.0.0-nightlya0ab3454ed20211208.1",
5
+ "date": "Mon, 28 Feb 2022 04:13:59 GMT",
6
+ "tag": "@fluentui/react-switch_v0.0.0-nightlya0aef7969220220228.1",
7
+ "version": "0.0.0-nightlya0aef7969220220228.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
11
11
  "author": "email not defined",
12
12
  "package": "@fluentui/react-switch",
13
- "commit": "bb962fc41a7769ab102b88c7cc76973034ede2d1",
13
+ "commit": "357dddd59345f57e77408824366096081c934571",
14
14
  "comment": "Release nightly v9"
15
15
  },
16
+ {
17
+ "author": "Humberto.Morimoto@microsoft.com",
18
+ "package": "@fluentui/react-switch",
19
+ "commit": "72b08d56fa19f3b580da0497758af54a6afcf69b",
20
+ "comment": "Switch: Re-implementing component to make it simpler and making it adhere to latest patterns."
21
+ },
16
22
  {
17
23
  "author": "olfedias@microsoft.com",
18
24
  "package": "@fluentui/react-switch",
19
- "commit": "029a7f2fe40e5abe21d8992ad9d92bf2b04d0e97",
20
- "comment": "update styles to not use CSS shorthands"
25
+ "commit": "084d7408855f3e52b67cbca172da1acef9dcb98f",
26
+ "comment": "fix: Add react-theme as dependency"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-switch",
31
+ "comment": "Bump @fluentui/react-label to v0.0.0-nightlya0aef7969220220228.1",
32
+ "commit": "357dddd59345f57e77408824366096081c934571"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-switch",
37
+ "comment": "Bump @fluentui/react-tabster to v0.0.0-nightlya0aef7969220220228.1",
38
+ "commit": "357dddd59345f57e77408824366096081c934571"
21
39
  },
22
40
  {
23
41
  "author": "beachball",
24
42
  "package": "@fluentui/react-switch",
25
- "comment": "Bump @fluentui/react-make-styles to v0.0.0-nightlya0ab3454ed20211208.1",
26
- "commit": "bb962fc41a7769ab102b88c7cc76973034ede2d1"
43
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightlya0aef7969220220228.1",
44
+ "commit": "357dddd59345f57e77408824366096081c934571"
27
45
  },
28
46
  {
29
47
  "author": "beachball",
30
48
  "package": "@fluentui/react-switch",
31
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlya0ab3454ed20211208.1",
32
- "commit": "bb962fc41a7769ab102b88c7cc76973034ede2d1"
49
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightlya0aef7969220220228.1",
50
+ "commit": "357dddd59345f57e77408824366096081c934571"
33
51
  },
34
52
  {
35
53
  "author": "beachball",
36
54
  "package": "@fluentui/react-switch",
37
- "comment": "Bump @fluentui/react-tabster to v0.0.0-nightlya0ab3454ed20211208.1",
38
- "commit": "bb962fc41a7769ab102b88c7cc76973034ede2d1"
55
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightlya0aef7969220220228.1",
56
+ "commit": "357dddd59345f57e77408824366096081c934571"
57
+ }
58
+ ]
59
+ }
60
+ },
61
+ {
62
+ "date": "Fri, 18 Feb 2022 13:35:34 GMT",
63
+ "tag": "@fluentui/react-switch_v9.0.0-rc.3",
64
+ "version": "9.0.0-rc.3",
65
+ "comments": {
66
+ "prerelease": [
67
+ {
68
+ "author": "mgodbolt@microsoft.com",
69
+ "package": "@fluentui/react-switch",
70
+ "commit": "2c9804dd585c1b485736c34321264dc62abe6fe1",
71
+ "comment": "fix visual display of controlled switches"
72
+ },
73
+ {
74
+ "author": "lingfangao@hotmail.com",
75
+ "package": "@fluentui/react-switch",
76
+ "commit": "1aa9e691fcccd9a64168cea7941c0f1e71fa1d14",
77
+ "comment": "fix: Source maps contain original source code"
39
78
  },
40
79
  {
41
80
  "author": "beachball",
42
81
  "package": "@fluentui/react-switch",
43
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightlya0ab3454ed20211208.1",
44
- "commit": "bb962fc41a7769ab102b88c7cc76973034ede2d1"
82
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.3",
83
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
45
84
  },
46
85
  {
47
86
  "author": "beachball",
48
87
  "package": "@fluentui/react-switch",
49
- "comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightlya0ab3454ed20211208.1",
50
- "commit": "bb962fc41a7769ab102b88c7cc76973034ede2d1"
88
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-rc.3",
89
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
51
90
  },
52
91
  {
53
92
  "author": "beachball",
54
93
  "package": "@fluentui/react-switch",
55
- "comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlya0ab3454ed20211208.1",
56
- "commit": "bb962fc41a7769ab102b88c7cc76973034ede2d1"
94
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.3",
95
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
57
96
  },
58
97
  {
59
98
  "author": "beachball",
60
99
  "package": "@fluentui/react-switch",
61
- "comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlya0ab3454ed20211208.1",
62
- "commit": "bb962fc41a7769ab102b88c7cc76973034ede2d1"
100
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.3",
101
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
63
102
  }
64
- ],
103
+ ]
104
+ }
105
+ },
106
+ {
107
+ "date": "Thu, 10 Feb 2022 08:50:51 GMT",
108
+ "tag": "@fluentui/react-switch_v9.0.0-rc.1",
109
+ "version": "9.0.0-rc.1",
110
+ "comments": {
65
111
  "none": [
112
+ {
113
+ "author": "martinhochel@microsoft.com",
114
+ "package": "@fluentui/react-switch",
115
+ "commit": "8dfa712156b70414205b87b5b6d099367b0c297d",
116
+ "comment": "chore: use storybook runner for all vNext packages"
117
+ },
66
118
  {
67
119
  "author": "andredias@microsoft.com",
68
120
  "package": "@fluentui/react-switch",
69
121
  "commit": "bf950e951b102fd8be046993dbb604073fc4ea9e",
70
122
  "comment": "Migrate package to use solution tsconfigs"
123
+ },
124
+ {
125
+ "author": "martinhochel@microsoft.com",
126
+ "package": "@fluentui/react-switch",
127
+ "commit": "28ceaaa83cd92a0389c466f0b15b283e3d9b08e4",
128
+ "comment": "test(react-switch): update snapshots to match new JSDOM"
129
+ },
130
+ {
131
+ "author": "olfedias@microsoft.com",
132
+ "package": "@fluentui/react-switch",
133
+ "commit": "c061e98be4b4a718c72a144a1f60bb5515824612",
134
+ "comment": "remove inline-style-expand-shorthand from tsconfigs"
135
+ }
136
+ ],
137
+ "prerelease": [
138
+ {
139
+ "author": "olfedias@microsoft.com",
140
+ "package": "@fluentui/react-switch",
141
+ "commit": "1df1d6e85bd3a6ab2a7b13e96a9aac324bb6d00c",
142
+ "comment": "Replace make-styles packages with griffel equivalents."
143
+ },
144
+ {
145
+ "author": "Humberto.Morimoto@microsoft.com",
146
+ "package": "@fluentui/react-switch",
147
+ "commit": "e0b8e1fa6980077e7b311fd1c72c28d3e4305db0",
148
+ "comment": "Updating based on changes to composition types."
149
+ },
150
+ {
151
+ "author": "behowell@microsoft.com",
152
+ "package": "@fluentui/react-switch",
153
+ "commit": "7cc28ed8320b00f42d91c63882f10316db2205c5",
154
+ "comment": "Remove component's shorthandProps array"
155
+ },
156
+ {
157
+ "author": "behowell@microsoft.com",
158
+ "package": "@fluentui/react-switch",
159
+ "commit": "53b01d71e335715fda91b33e3d7bbd9d471d5ed3",
160
+ "comment": "Refactor component Slot typings"
161
+ },
162
+ {
163
+ "author": "mgodbolt@microsoft.com",
164
+ "package": "@fluentui/react-switch",
165
+ "commit": "839ec14849e112b85aa321d034739ec421199141",
166
+ "comment": "remove export of commons types"
167
+ },
168
+ {
169
+ "author": "olfedias@microsoft.com",
170
+ "package": "@fluentui/react-switch",
171
+ "commit": "029a7f2fe40e5abe21d8992ad9d92bf2b04d0e97",
172
+ "comment": "update styles to not use CSS shorthands"
173
+ },
174
+ {
175
+ "author": "Humberto.Morimoto@microsoft.com",
176
+ "package": "@fluentui/react-switch",
177
+ "commit": "b52ebbbf185a2ddc4de814238f9438fd04bfba02",
178
+ "comment": "Replacing use of functions in makeStyles with direct use of tokens."
179
+ },
180
+ {
181
+ "author": "Humberto.Morimoto@microsoft.com",
182
+ "package": "@fluentui/react-switch",
183
+ "commit": "38c8bed2c707014688ae2ae689033fa36ef23075",
184
+ "comment": "Updating packages based on changes to focusIndicator functions to remove functions from makeStyles in @fluentui/react-tabster."
185
+ },
186
+ {
187
+ "author": "behowell@microsoft.com",
188
+ "package": "@fluentui/react-switch",
189
+ "commit": "317209bb5cd57c40f35bc42060acb7e3cce5ec95",
190
+ "comment": "BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet"
191
+ },
192
+ {
193
+ "author": "lingfangao@hotmail.com",
194
+ "package": "@fluentui/react-switch",
195
+ "commit": "c00913d50e2dd15bbfbb0757cefe43b192ff1d7f",
196
+ "comment": "Bump Fluent UI dependencies to 9.0.0-rc"
197
+ },
198
+ {
199
+ "author": "beachball",
200
+ "package": "@fluentui/react-switch",
201
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.1",
202
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
203
+ },
204
+ {
205
+ "author": "beachball",
206
+ "package": "@fluentui/react-switch",
207
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-rc.1",
208
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
209
+ },
210
+ {
211
+ "author": "beachball",
212
+ "package": "@fluentui/react-switch",
213
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.1",
214
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
215
+ },
216
+ {
217
+ "author": "beachball",
218
+ "package": "@fluentui/react-switch",
219
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1",
220
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
71
221
  }
72
222
  ]
73
223
  }
package/CHANGELOG.md CHANGED
@@ -1,25 +1,60 @@
1
1
  # Change Log - @fluentui/react-switch
2
2
 
3
- This log was last generated on Wed, 08 Dec 2021 04:18:26 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 28 Feb 2022 04:13:59 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightlya0ab3454ed20211208.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v0.0.0-nightlya0ab3454ed20211208.1)
7
+ ## [0.0.0-nightlya0aef7969220220228.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v0.0.0-nightlya0aef7969220220228.1)
8
8
 
9
- Wed, 08 Dec 2021 04:18:26 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.5..@fluentui/react-switch_v0.0.0-nightlya0ab3454ed20211208.1)
9
+ Mon, 28 Feb 2022 04:13:59 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.3..@fluentui/react-switch_v0.0.0-nightlya0aef7969220220228.1)
11
11
 
12
12
  ### Changes
13
13
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/bb962fc41a7769ab102b88c7cc76973034ede2d1) by email not defined)
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/357dddd59345f57e77408824366096081c934571) by email not defined)
15
+ - Switch: Re-implementing component to make it simpler and making it adhere to latest patterns. ([PR #21849](https://github.com/microsoft/fluentui/pull/21849) by Humberto.Morimoto@microsoft.com)
16
+ - fix: Add react-theme as dependency ([PR #21825](https://github.com/microsoft/fluentui/pull/21825) by olfedias@microsoft.com)
17
+ - Bump @fluentui/react-label to v0.0.0-nightlya0aef7969220220228.1 ([commit](https://github.com/microsoft/fluentui/commit/357dddd59345f57e77408824366096081c934571) by beachball)
18
+ - Bump @fluentui/react-tabster to v0.0.0-nightlya0aef7969220220228.1 ([commit](https://github.com/microsoft/fluentui/commit/357dddd59345f57e77408824366096081c934571) by beachball)
19
+ - Bump @fluentui/react-theme to v0.0.0-nightlya0aef7969220220228.1 ([commit](https://github.com/microsoft/fluentui/commit/357dddd59345f57e77408824366096081c934571) by beachball)
20
+ - Bump @fluentui/react-utilities to v0.0.0-nightlya0aef7969220220228.1 ([commit](https://github.com/microsoft/fluentui/commit/357dddd59345f57e77408824366096081c934571) by beachball)
21
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightlya0aef7969220220228.1 ([commit](https://github.com/microsoft/fluentui/commit/357dddd59345f57e77408824366096081c934571) by beachball)
22
+
23
+ ## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.3)
24
+
25
+ Fri, 18 Feb 2022 13:35:34 GMT
26
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.1..@fluentui/react-switch_v9.0.0-rc.3)
27
+
28
+ ### Changes
29
+
30
+ - fix visual display of controlled switches ([PR #21704](https://github.com/microsoft/fluentui/pull/21704) by mgodbolt@microsoft.com)
31
+ - fix: Source maps contain original source code ([PR #21690](https://github.com/microsoft/fluentui/pull/21690) by lingfangao@hotmail.com)
32
+ - Bump @fluentui/react-shared-contexts to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
33
+ - Bump @fluentui/react-tabster to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
34
+ - Bump @fluentui/react-utilities to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
35
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
36
+
37
+ ## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.1)
38
+
39
+ Thu, 10 Feb 2022 08:50:51 GMT
40
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.5..@fluentui/react-switch_v9.0.0-rc.1)
41
+
42
+ ### Changes
43
+
44
+ - Replace make-styles packages with griffel equivalents. ([PR #21424](https://github.com/microsoft/fluentui/pull/21424) by olfedias@microsoft.com)
45
+ - Updating based on changes to composition types. ([PR #20891](https://github.com/microsoft/fluentui/pull/20891) by Humberto.Morimoto@microsoft.com)
46
+ - Remove component's shorthandProps array ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com)
47
+ - Refactor component Slot typings ([PR #21518](https://github.com/microsoft/fluentui/pull/21518) by behowell@microsoft.com)
48
+ - remove export of commons types ([PR #21660](https://github.com/microsoft/fluentui/pull/21660) by mgodbolt@microsoft.com)
15
49
  - 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-nightlya0ab3454ed20211208.1 ([commit](https://github.com/microsoft/fluentui/commit/bb962fc41a7769ab102b88c7cc76973034ede2d1) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightlya0ab3454ed20211208.1 ([commit](https://github.com/microsoft/fluentui/commit/bb962fc41a7769ab102b88c7cc76973034ede2d1) by beachball)
18
- - Bump @fluentui/react-tabster to v0.0.0-nightlya0ab3454ed20211208.1 ([commit](https://github.com/microsoft/fluentui/commit/bb962fc41a7769ab102b88c7cc76973034ede2d1) by beachball)
19
- - Bump @fluentui/react-utilities to v0.0.0-nightlya0ab3454ed20211208.1 ([commit](https://github.com/microsoft/fluentui/commit/bb962fc41a7769ab102b88c7cc76973034ede2d1) by beachball)
20
- - Bump @fluentui/babel-make-styles to v0.0.0-nightlya0ab3454ed20211208.1 ([commit](https://github.com/microsoft/fluentui/commit/bb962fc41a7769ab102b88c7cc76973034ede2d1) by beachball)
21
- - Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightlya0ab3454ed20211208.1 ([commit](https://github.com/microsoft/fluentui/commit/bb962fc41a7769ab102b88c7cc76973034ede2d1) by beachball)
22
- - Bump @fluentui/react-conformance-make-styles to v0.0.0-nightlya0ab3454ed20211208.1 ([commit](https://github.com/microsoft/fluentui/commit/bb962fc41a7769ab102b88c7cc76973034ede2d1) by beachball)
50
+ - 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)
51
+ - 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)
52
+ - 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)
53
+ - Bump Fluent UI dependencies to 9.0.0-rc ([PR #21623](https://github.com/microsoft/fluentui/pull/21623) by lingfangao@hotmail.com)
54
+ - Bump @fluentui/react-shared-contexts to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
55
+ - Bump @fluentui/react-tabster to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
56
+ - Bump @fluentui/react-utilities to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
57
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
23
58
 
24
59
  ## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.5)
25
60
 
@@ -1,94 +1,106 @@
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';
4
+ import { Label } from '@fluentui/react-label';
5
5
  import * as React_2 from 'react';
6
+ import type { Slot } from '@fluentui/react-utilities';
6
7
 
7
8
  /**
8
- * Render the final JSX of Switch
9
+ * Render a Switch component by passing the state defined props to the appropriate slots.
9
10
  */
10
- export declare const renderSwitch: (state: SwitchState) => JSX.Element;
11
+ export declare const renderSwitch_unstable: (state: SwitchState) => JSX.Element;
11
12
 
12
13
  /**
13
- * The Switch control enables users to trigger an option on or off through pressing on the component.
14
+ * Switches enable users to trigger an option on or off through pressing the component.
14
15
  */
15
16
  export declare const Switch: ForwardRefComponent<SwitchProps>;
16
17
 
17
- export declare const switchClassName = "fui-Switch";
18
+ export declare const switchClassName: string;
18
19
 
19
- export declare interface SwitchCommons {
20
+ export declare const switchClassNames: {
21
+ [SlotName in keyof SwitchSlots]-?: string;
22
+ };
23
+
24
+ declare type SwitchCommons = {
20
25
  /**
21
- * The starting value for a uncontrolled Switch. If `true` then the Switch will be enabled.
22
- * Mutually exclusive with `checked` prop.
23
- *
26
+ * Defines the controlled checked state of the Switch.
27
+ * If passed, Switch ignores the `defaultChecked` property.
28
+ * 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
29
+ * correct value based on handling `onChange` events and re-rendering.
24
30
  * @default false
25
31
  */
26
- defaultChecked?: boolean;
27
- /**
28
- * The current value for a controlled Switch. If `true` then the Switch will be enabled.
29
- * Mutually exclusive with `defaultChecked` prop.
30
- */
31
32
  checked?: boolean;
32
33
  /**
33
- * Whether the Switch should be disabled.
34
+ * The position of the label relative to the Switch.
34
35
  *
35
- * @default false
36
- */
37
- disabled?: boolean;
38
- /**
39
- * Callback to be called when the `checked` value changes.
36
+ * @default after
40
37
  */
41
- onChange?: (ev: React_2.PointerEvent<HTMLDivElement> | React_2.KeyboardEvent<HTMLDivElement>, data: {
42
- checked: boolean;
43
- }) => void;
44
- }
38
+ labelPosition: 'above' | 'after' | 'before';
39
+ };
45
40
 
46
- export declare interface SwitchProps extends Omit<ComponentProps<SwitchSlots>, 'onChange'>, SwitchCommons {
47
- }
41
+ export declare type SwitchOnChangeData = {
42
+ checked: boolean;
43
+ };
48
44
 
49
45
  /**
50
- * Array of all shorthand properties listed in SwitchSlots
46
+ * Switch Props
51
47
  */
52
- export declare const switchShorthandProps: (keyof SwitchSlots)[];
53
-
54
- export declare type SwitchSlots = {
48
+ export declare type SwitchProps = Omit<ComponentProps<Partial<SwitchSlots>, 'input'>, 'onChange'> & Partial<SwitchCommons> & {
55
49
  /**
56
- * The root of the Switch.
50
+ * Defines whether the Switch is initially in a checked state or not when rendered.
51
+ * @default false
57
52
  */
58
- root: IntrinsicShorthandProps<'div'>;
53
+ defaultChecked?: boolean;
59
54
  /**
60
- * The bar indicating the status of the Switch.
55
+ * Callback to be called when the checked state value changes.
61
56
  */
62
- track: IntrinsicShorthandProps<'div'>;
57
+ onChange?: (ev: React_2.ChangeEvent<HTMLInputElement>, data: SwitchOnChangeData) => void;
58
+ };
59
+
60
+ export declare type SwitchSlots = {
63
61
  /**
64
- * The wrapper around the thumb. It is used as the active area for the thumb to position itself.
62
+ * The root element of the Switch.
63
+ *
64
+ * The root slot receives the `className` and `style` specified directly on the `<Switch>` tag.
65
+ * All other native props will be applied to the primary slot: `input`.
65
66
  */
66
- thumbWrapper: IntrinsicShorthandProps<'div'>;
67
+ root: NonNullable<Slot<'div'>>;
67
68
  /**
68
- * The circular icon indicating the status of the Switch.
69
+ * The track and the thumb sliding over it indicating the on and off status of the Switch.
69
70
  */
70
- thumb: IntrinsicShorthandProps<'div'>;
71
+ indicator: NonNullable<Slot<'div'>>;
71
72
  /**
72
- * The hidden input that handles the Switch's internal functionality.
73
+ * Hidden input that handles the Switch's functionality.
74
+ *
75
+ * This is the PRIMARY slot: all native properties specified directly on the `<Switch>` tag will be applied to this
76
+ * slot, except `className` and `style`, which remain on the root slot.
73
77
  */
74
- input: IntrinsicShorthandProps<'input'>;
78
+ input: NonNullable<Slot<'input'>>;
75
79
  /**
76
- * The area in which the Switch's rail allows for the thumb to be dragged.
80
+ * The Switch's label.
77
81
  */
78
- activeRail: IntrinsicShorthandProps<'div'>;
82
+ label?: Slot<typeof Label>;
79
83
  };
80
84
 
81
- export declare interface SwitchState extends ComponentState<SwitchSlots>, SwitchCommons {
82
- }
85
+ /**
86
+ * State used in rendering Switch
87
+ */
88
+ export declare type SwitchState = ComponentState<SwitchSlots> & SwitchCommons;
83
89
 
84
90
  /**
85
- * Given user props, returns state and render function for a Switch.
91
+ * Create the state required to render Switch.
92
+ *
93
+ * The returned state can be modified with hooks such as useSwitchStyles_unstable,
94
+ * before being passed to renderSwitch_unstable.
95
+ *
96
+ * @param props - props from this instance of Switch
97
+ * @param ref - reference to `<input>` element of Switch
86
98
  */
87
- export declare const useSwitch: (props: SwitchProps, ref: React_2.Ref<HTMLElement>) => SwitchState;
99
+ export declare const useSwitch_unstable: (props: SwitchProps, ref: React_2.Ref<HTMLInputElement>) => SwitchState;
88
100
 
89
101
  /**
90
102
  * Apply styling to the Switch slots based on the state
91
103
  */
92
- export declare const useSwitchStyles: (state: SwitchState) => SwitchState;
104
+ export declare const useSwitchStyles_unstable: (state: SwitchState) => SwitchState;
93
105
 
94
106
  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,6 +1,6 @@
1
1
  import type { SwitchProps } from './Switch.types';
2
2
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
- * The Switch control enables users to trigger an option on or off through pressing on the component.
4
+ * Switches enable users to trigger an option on or off through pressing the component.
5
5
  */
6
6
  export declare const Switch: ForwardRefComponent<SwitchProps>;
@@ -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
- * The Switch control enables users to trigger an option on or off through pressing on the component.
6
+ * Switches enable users to trigger an option on or off through pressing 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 * 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,58 +1,65 @@
1
1
  import * as React from 'react';
2
- import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
2
+ import { Label } from '@fluentui/react-label';
3
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
4
  export declare type SwitchSlots = {
4
5
  /**
5
- * The root of the Switch.
6
- */
7
- root: IntrinsicShorthandProps<'div'>;
8
- /**
9
- * The bar indicating the status of the Switch.
10
- */
11
- track: IntrinsicShorthandProps<'div'>;
12
- /**
13
- * The wrapper around the thumb. It is used as the active area for the thumb to position itself.
6
+ * The root element of the Switch.
7
+ *
8
+ * The root slot receives the `className` and `style` specified directly on the `<Switch>` tag.
9
+ * All other native props will be applied to the primary slot: `input`.
14
10
  */
15
- thumbWrapper: IntrinsicShorthandProps<'div'>;
11
+ root: NonNullable<Slot<'div'>>;
16
12
  /**
17
- * The circular icon indicating the status of the Switch.
13
+ * The track and the thumb sliding over it indicating the on and off status of the Switch.
18
14
  */
19
- thumb: IntrinsicShorthandProps<'div'>;
15
+ indicator: NonNullable<Slot<'div'>>;
20
16
  /**
21
- * The hidden input that handles the Switch's internal functionality.
17
+ * Hidden input that handles the Switch's functionality.
18
+ *
19
+ * This is the PRIMARY slot: all native properties specified directly on the `<Switch>` tag will be applied to this
20
+ * slot, except `className` and `style`, which remain on the root slot.
22
21
  */
23
- input: IntrinsicShorthandProps<'input'>;
22
+ input: NonNullable<Slot<'input'>>;
24
23
  /**
25
- * The area in which the Switch's rail allows for the thumb to be dragged.
24
+ * The Switch's label.
26
25
  */
27
- activeRail: IntrinsicShorthandProps<'div'>;
26
+ label?: Slot<typeof Label>;
28
27
  };
29
- export interface SwitchCommons {
28
+ declare type SwitchCommons = {
30
29
  /**
31
- * The starting value for a uncontrolled Switch. If `true` then the Switch will be enabled.
32
- * Mutually exclusive with `checked` prop.
33
- *
30
+ * Defines the controlled checked state of the Switch.
31
+ * If passed, Switch ignores the `defaultChecked` property.
32
+ * 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
33
+ * correct value based on handling `onChange` events and re-rendering.
34
34
  * @default false
35
35
  */
36
- defaultChecked?: boolean;
37
- /**
38
- * The current value for a controlled Switch. If `true` then the Switch will be enabled.
39
- * Mutually exclusive with `defaultChecked` prop.
40
- */
41
36
  checked?: boolean;
42
37
  /**
43
- * Whether the Switch should be disabled.
38
+ * The position of the label relative to the Switch.
44
39
  *
40
+ * @default after
41
+ */
42
+ labelPosition: 'above' | 'after' | 'before';
43
+ };
44
+ export declare type SwitchOnChangeData = {
45
+ checked: boolean;
46
+ };
47
+ /**
48
+ * Switch Props
49
+ */
50
+ export declare type SwitchProps = Omit<ComponentProps<Partial<SwitchSlots>, 'input'>, 'onChange'> & Partial<SwitchCommons> & {
51
+ /**
52
+ * Defines whether the Switch is initially in a checked state or not when rendered.
45
53
  * @default false
46
54
  */
47
- disabled?: boolean;
55
+ defaultChecked?: boolean;
48
56
  /**
49
- * Callback to be called when the `checked` value changes.
57
+ * Callback to be called when the checked state value changes.
50
58
  */
51
- onChange?: (ev: React.PointerEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>, data: {
52
- checked: boolean;
53
- }) => void;
54
- }
55
- export interface SwitchProps extends Omit<ComponentProps<SwitchSlots>, 'onChange'>, SwitchCommons {
56
- }
57
- export interface SwitchState extends ComponentState<SwitchSlots>, SwitchCommons {
58
- }
59
+ onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: SwitchOnChangeData) => void;
60
+ };
61
+ /**
62
+ * State used in rendering Switch
63
+ */
64
+ export declare type SwitchState = ComponentState<SwitchSlots> & SwitchCommons;
65
+ 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 { 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"]}