@fluentui/react-switch 9.0.0-beta.1 → 9.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +225 -1
- package/CHANGELOG.md +63 -2
- package/Spec.md +4 -4
- package/dist/react-switch.d.ts +2 -0
- package/lib/common/isConformant.js +1 -1
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Switch/Switch.js +2 -2
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Switch/renderSwitch.js +6 -7
- package/lib/components/Switch/renderSwitch.js.map +1 -1
- package/lib/components/Switch/useSwitch.js +22 -21
- package/lib/components/Switch/useSwitch.js.map +1 -1
- package/lib/components/Switch/useSwitchState.js +51 -59
- package/lib/components/Switch/useSwitchState.js.map +1 -1
- package/lib/components/Switch/useSwitchStyles.d.ts +1 -0
- package/lib/components/Switch/useSwitchStyles.js +30 -29
- package/lib/components/Switch/useSwitchStyles.js.map +1 -1
- package/lib-commonjs/Switch.js +1 -1
- package/lib-commonjs/common/isConformant.js +3 -3
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Switch/Switch.js +6 -6
- package/lib-commonjs/components/Switch/Switch.js.map +1 -1
- package/lib-commonjs/components/Switch/index.js +1 -1
- package/lib-commonjs/components/Switch/renderSwitch.js +9 -11
- package/lib-commonjs/components/Switch/renderSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitch.js +23 -23
- package/lib-commonjs/components/Switch/useSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitchState.js +54 -62
- package/lib-commonjs/components/Switch/useSwitchState.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitchStyles.d.ts +1 -0
- package/lib-commonjs/components/Switch/useSwitchStyles.js +33 -32
- package/lib-commonjs/components/Switch/useSwitchStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/package.json +8 -12
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,231 @@
|
|
|
2
2
|
"name": "@fluentui/react-switch",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 25 Nov 2021 08:31:35 GMT",
|
|
6
|
+
"tag": "@fluentui/react-switch_v9.0.0-beta.5",
|
|
7
|
+
"version": "9.0.0-beta.5",
|
|
8
|
+
"comments": {
|
|
9
|
+
"prerelease": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@fluentui/react-switch",
|
|
13
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.4",
|
|
14
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@fluentui/react-switch",
|
|
19
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-beta.4",
|
|
20
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@fluentui/react-switch",
|
|
25
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.5",
|
|
26
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@fluentui/react-switch",
|
|
31
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.4",
|
|
32
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@fluentui/react-switch",
|
|
37
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.4",
|
|
38
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@fluentui/react-switch",
|
|
43
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4",
|
|
44
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"author": "beachball",
|
|
48
|
+
"package": "@fluentui/react-switch",
|
|
49
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4",
|
|
50
|
+
"commit": "281e8820669214c1ffb9bc75e9b719a3b27fa9b6"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"date": "Fri, 12 Nov 2021 13:25:33 GMT",
|
|
57
|
+
"tag": "@fluentui/react-switch_v9.0.0-beta.4",
|
|
58
|
+
"version": "9.0.0-beta.4",
|
|
59
|
+
"comments": {
|
|
60
|
+
"none": [
|
|
61
|
+
{
|
|
62
|
+
"author": "olfedias@microsoft.com",
|
|
63
|
+
"package": "@fluentui/react-switch",
|
|
64
|
+
"commit": "9e6977945782df1cc997c92804a1b214cc4e4f43",
|
|
65
|
+
"comment": "do not use other packages in devDependencies"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "lingfangao@hotmail.com",
|
|
69
|
+
"package": "@fluentui/react-switch",
|
|
70
|
+
"commit": "00f70581480b536e723fb69edf0ae617beac4807",
|
|
71
|
+
"comment": "Remove beta release tag"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"prerelease": [
|
|
75
|
+
{
|
|
76
|
+
"author": "olfedias@microsoft.com",
|
|
77
|
+
"package": "@fluentui/react-switch",
|
|
78
|
+
"commit": "9186578324773f95f4d61be3d70e67752159d843",
|
|
79
|
+
"comment": "export static classes for components"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"author": "beachball",
|
|
83
|
+
"package": "@fluentui/react-switch",
|
|
84
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.3",
|
|
85
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"author": "beachball",
|
|
89
|
+
"package": "@fluentui/react-switch",
|
|
90
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-beta.3",
|
|
91
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"author": "beachball",
|
|
95
|
+
"package": "@fluentui/react-switch",
|
|
96
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.4",
|
|
97
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"author": "beachball",
|
|
101
|
+
"package": "@fluentui/react-switch",
|
|
102
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.3",
|
|
103
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"author": "beachball",
|
|
107
|
+
"package": "@fluentui/react-switch",
|
|
108
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.3",
|
|
109
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"author": "beachball",
|
|
113
|
+
"package": "@fluentui/react-switch",
|
|
114
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3",
|
|
115
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"author": "beachball",
|
|
119
|
+
"package": "@fluentui/react-switch",
|
|
120
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3",
|
|
121
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"date": "Wed, 27 Oct 2021 12:14:22 GMT",
|
|
128
|
+
"tag": "@fluentui/react-switch_v9.0.0-beta.3",
|
|
129
|
+
"version": "9.0.0-beta.3",
|
|
130
|
+
"comments": {
|
|
131
|
+
"prerelease": [
|
|
132
|
+
{
|
|
133
|
+
"author": "czearing@outlook.com",
|
|
134
|
+
"package": "@fluentui/react-switch",
|
|
135
|
+
"commit": "ae512f66872beea9d95a168d759406d42281d835",
|
|
136
|
+
"comment": "Changing the Switch's onKeyDown event to onKeyUp."
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"author": "peter@draxler.ml",
|
|
140
|
+
"package": "@fluentui/react-switch",
|
|
141
|
+
"commit": "f6db7c8d6b7db0902775e7857b62b745be35b59a",
|
|
142
|
+
"comment": "added styling of documentation"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"author": "beachball",
|
|
146
|
+
"package": "@fluentui/react-switch",
|
|
147
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.2",
|
|
148
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"author": "beachball",
|
|
152
|
+
"package": "@fluentui/react-switch",
|
|
153
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-beta.2",
|
|
154
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"author": "beachball",
|
|
158
|
+
"package": "@fluentui/react-switch",
|
|
159
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.3",
|
|
160
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"author": "beachball",
|
|
164
|
+
"package": "@fluentui/react-switch",
|
|
165
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.2",
|
|
166
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"author": "beachball",
|
|
170
|
+
"package": "@fluentui/react-switch",
|
|
171
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.2",
|
|
172
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"author": "beachball",
|
|
176
|
+
"package": "@fluentui/react-switch",
|
|
177
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.2",
|
|
178
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"author": "beachball",
|
|
182
|
+
"package": "@fluentui/react-switch",
|
|
183
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.2",
|
|
184
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"author": "beachball",
|
|
188
|
+
"package": "@fluentui/react-switch",
|
|
189
|
+
"comment": "Bump @fluentui/react-label to v9.0.0-beta.2",
|
|
190
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"author": "beachball",
|
|
194
|
+
"package": "@fluentui/react-switch",
|
|
195
|
+
"comment": "Bump @fluentui/react-provider to v9.0.0-beta.3",
|
|
196
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"author": "beachball",
|
|
200
|
+
"package": "@fluentui/react-switch",
|
|
201
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-beta.2",
|
|
202
|
+
"commit": "0f8f1ae7c2d908e51e29dd342d79e041f86fac08"
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
"date": "Tue, 12 Oct 2021 19:45:58 GMT",
|
|
209
|
+
"tag": "@fluentui/react-switch_v9.0.0-beta.2",
|
|
210
|
+
"version": "9.0.0-beta.2",
|
|
211
|
+
"comments": {
|
|
212
|
+
"prerelease": [
|
|
213
|
+
{
|
|
214
|
+
"author": "beachball",
|
|
215
|
+
"package": "@fluentui/react-switch",
|
|
216
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-beta.2",
|
|
217
|
+
"commit": "bdd19e2bb827fc1d8eb329e6ed48cd0542048358"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"author": "beachball",
|
|
221
|
+
"package": "@fluentui/react-switch",
|
|
222
|
+
"comment": "Bump @fluentui/react-provider to v9.0.0-beta.2",
|
|
223
|
+
"commit": "bdd19e2bb827fc1d8eb329e6ed48cd0542048358"
|
|
224
|
+
}
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"date": "Wed, 06 Oct 2021 10:37:22 GMT",
|
|
6
230
|
"tag": "@fluentui/react-switch_v9.0.0-beta.1",
|
|
7
231
|
"version": "9.0.0-beta.1",
|
|
8
232
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,73 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-switch
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 25 Nov 2021 08:31:35 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.5)
|
|
8
|
+
|
|
9
|
+
Thu, 25 Nov 2021 08:31:35 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.4..@fluentui/react-switch_v9.0.0-beta.5)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
|
15
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
|
16
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.5 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
|
17
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
|
18
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
|
19
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
|
20
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4 ([PR #20609](https://github.com/microsoft/fluentui/pull/20609) by beachball)
|
|
21
|
+
|
|
22
|
+
## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.4)
|
|
23
|
+
|
|
24
|
+
Fri, 12 Nov 2021 13:25:33 GMT
|
|
25
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.3..@fluentui/react-switch_v9.0.0-beta.4)
|
|
26
|
+
|
|
27
|
+
### Changes
|
|
28
|
+
|
|
29
|
+
- export static classes for components ([PR #20456](https://github.com/microsoft/fluentui/pull/20456) by olfedias@microsoft.com)
|
|
30
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
|
31
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
|
32
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.4 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
|
33
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
|
34
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
|
35
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
|
36
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
|
37
|
+
|
|
38
|
+
## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.3)
|
|
39
|
+
|
|
40
|
+
Wed, 27 Oct 2021 12:14:22 GMT
|
|
41
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.2..@fluentui/react-switch_v9.0.0-beta.3)
|
|
42
|
+
|
|
43
|
+
### Changes
|
|
44
|
+
|
|
45
|
+
- Changing the Switch's onKeyDown event to onKeyUp. ([PR #20217](https://github.com/microsoft/fluentui/pull/20217) by czearing@outlook.com)
|
|
46
|
+
- added styling of documentation ([PR #20193](https://github.com/microsoft/fluentui/pull/20193) by peter@draxler.ml)
|
|
47
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
48
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
49
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.3 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
50
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
51
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
52
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
53
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
54
|
+
- Bump @fluentui/react-label to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
55
|
+
- Bump @fluentui/react-provider to v9.0.0-beta.3 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
56
|
+
- Bump @fluentui/react-theme to v9.0.0-beta.2 ([PR #20353](https://github.com/microsoft/fluentui/pull/20353) by beachball)
|
|
57
|
+
|
|
58
|
+
## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.2)
|
|
59
|
+
|
|
60
|
+
Tue, 12 Oct 2021 19:45:58 GMT
|
|
61
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-beta.1..@fluentui/react-switch_v9.0.0-beta.2)
|
|
62
|
+
|
|
63
|
+
### Changes
|
|
64
|
+
|
|
65
|
+
- Bump @fluentui/react-tabster to v9.0.0-beta.2 ([PR #20132](https://github.com/microsoft/fluentui/pull/20132) by beachball)
|
|
66
|
+
- Bump @fluentui/react-provider to v9.0.0-beta.2 ([PR #20132](https://github.com/microsoft/fluentui/pull/20132) by beachball)
|
|
67
|
+
|
|
7
68
|
## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-beta.1)
|
|
8
69
|
|
|
9
|
-
Wed, 06 Oct 2021 10:
|
|
70
|
+
Wed, 06 Oct 2021 10:37:22 GMT
|
|
10
71
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-alpha.17..@fluentui/react-switch_v9.0.0-beta.1)
|
|
11
72
|
|
|
12
73
|
### Changes
|
package/Spec.md
CHANGED
|
@@ -86,10 +86,10 @@ Amongst other major component libraries (`Material UI`, `Ant Design`, `Evergreen
|
|
|
86
86
|
- _**DOM**_
|
|
87
87
|
|
|
88
88
|
```jsx=
|
|
89
|
-
<div className="
|
|
90
|
-
<div className="
|
|
91
|
-
<div className="
|
|
92
|
-
<div className="
|
|
89
|
+
<div className="fui-Switch">
|
|
90
|
+
<div className="fui-Switch-track" />
|
|
91
|
+
<div className="fui-Switch-thumbWrapper">
|
|
92
|
+
<div className="fui-Switch-thumb" />
|
|
93
93
|
</div>
|
|
94
94
|
<input type="checkbox" />
|
|
95
95
|
</div>;
|
package/dist/react-switch.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare const renderSwitch: (state: SwitchState) => JSX.Element;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const Switch: ForwardRefComponent<SwitchProps>;
|
|
16
16
|
|
|
17
|
+
export declare const switchClassName = "fui-Switch";
|
|
18
|
+
|
|
17
19
|
export declare interface SwitchCommons {
|
|
18
20
|
/**
|
|
19
21
|
* The starting value for a uncontrolled Switch. If `true` then the Switch will be enabled.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
|
2
2
|
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
|
3
3
|
export function isConformant(testInfo) {
|
|
4
|
-
|
|
4
|
+
const defaultOptions = {
|
|
5
5
|
asPropHandlesRef: true,
|
|
6
6
|
componentPath: module.parent.filename.replace('.test', ''),
|
|
7
7
|
extraTests: makeStylesTests,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,
|
|
1
|
+
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,QAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,UAAU,EAAE,eAH+C;AAI3D,IAAA,eAAe,EAAE;AAJ0C,GAA7D;AAOA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
|
@@ -6,8 +6,8 @@ import { useSwitchStyles } from './useSwitchStyles';
|
|
|
6
6
|
* The Switch control enables users to trigger an option on or off through pressing on the component.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
export
|
|
10
|
-
|
|
9
|
+
export const Switch = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
|
+
const state = useSwitch(props, ref);
|
|
11
11
|
useSwitchStyles(state);
|
|
12
12
|
return renderSwitch(state);
|
|
13
13
|
});
|
|
@@ -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,
|
|
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,4 +1,3 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import { getSlots } from '@fluentui/react-utilities';
|
|
4
3
|
import { switchShorthandProps } from './useSwitch';
|
|
@@ -6,11 +5,11 @@ import { switchShorthandProps } from './useSwitch';
|
|
|
6
5
|
* Render the final JSX of Switch
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
|
8
|
+
export const renderSwitch = state => {
|
|
9
|
+
const {
|
|
10
|
+
slots,
|
|
11
|
+
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)));
|
|
15
14
|
};
|
|
16
15
|
//# sourceMappingURL=renderSwitch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Switch/renderSwitch.tsx"],"names":[],"mappings":"
|
|
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,35 +1,36 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
1
|
import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';
|
|
3
2
|
import { useSwitchState } from './useSwitchState';
|
|
4
3
|
/**
|
|
5
4
|
* Array of all shorthand properties listed in SwitchSlots
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
|
-
export
|
|
7
|
+
export const switchShorthandProps = ['root', 'track', 'thumbWrapper', 'thumb', 'activeRail', 'input'];
|
|
9
8
|
/**
|
|
10
9
|
* Given user props, returns state and render function for a Switch.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
export const useSwitch = (props, ref) => {
|
|
13
|
+
const {
|
|
14
|
+
track,
|
|
15
|
+
thumbWrapper,
|
|
16
|
+
thumb,
|
|
17
|
+
activeRail,
|
|
18
|
+
input,
|
|
19
|
+
defaultChecked,
|
|
20
|
+
checked,
|
|
21
|
+
disabled,
|
|
22
|
+
onChange
|
|
23
|
+
} = props;
|
|
24
|
+
const state = {
|
|
25
|
+
defaultChecked,
|
|
26
|
+
checked,
|
|
27
|
+
disabled,
|
|
28
|
+
onChange,
|
|
29
|
+
root: getNativeElementProps('span', {
|
|
30
|
+
ref,
|
|
31
|
+
...props,
|
|
31
32
|
id: useId('switch-', props.id)
|
|
32
|
-
})
|
|
33
|
+
}),
|
|
33
34
|
components: {
|
|
34
35
|
root: 'div',
|
|
35
36
|
track: 'div',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Switch/useSwitch.ts"],"names":[],"mappings":"
|
|
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":""}
|