@fluentui/react-switch 9.0.0-rc.3 → 9.0.0-rc.6
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 +168 -1
- package/CHANGELOG.md +47 -2
- package/MIGRATION.md +89 -22
- package/Spec.md +179 -84
- package/dist/react-switch.d.ts +59 -40
- package/lib/components/Switch/Switch.d.ts +1 -1
- package/lib/components/Switch/Switch.js +1 -1
- package/lib/components/Switch/Switch.js.map +1 -1
- package/lib/components/Switch/Switch.types.d.ts +41 -35
- package/lib/components/Switch/Switch.types.js.map +1 -1
- package/lib/components/Switch/renderSwitch.d.ts +1 -1
- package/lib/components/Switch/renderSwitch.js +8 -6
- package/lib/components/Switch/renderSwitch.js.map +1 -1
- package/lib/components/Switch/useSwitch.d.ts +8 -2
- package/lib/components/Switch/useSwitch.js +63 -43
- package/lib/components/Switch/useSwitch.js.map +1 -1
- package/lib/components/Switch/useSwitchStyles.d.ts +7 -2
- package/lib/components/Switch/useSwitchStyles.js +165 -266
- package/lib/components/Switch/useSwitchStyles.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Switch/Switch.d.ts +1 -1
- package/lib-commonjs/components/Switch/Switch.js +1 -1
- package/lib-commonjs/components/Switch/Switch.js.map +1 -1
- package/lib-commonjs/components/Switch/Switch.types.d.ts +41 -35
- package/lib-commonjs/components/Switch/renderSwitch.d.ts +1 -1
- package/lib-commonjs/components/Switch/renderSwitch.js +8 -6
- package/lib-commonjs/components/Switch/renderSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitch.d.ts +8 -2
- package/lib-commonjs/components/Switch/useSwitch.js +65 -43
- package/lib-commonjs/components/Switch/useSwitch.js.map +1 -1
- package/lib-commonjs/components/Switch/useSwitchStyles.d.ts +7 -2
- package/lib-commonjs/components/Switch/useSwitchStyles.js +167 -268
- package/lib-commonjs/components/Switch/useSwitchStyles.js.map +1 -1
- package/lib-commonjs/index.d.ts +2 -2
- package/lib-commonjs/index.js +39 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +16 -17
- package/lib/components/Switch/useSwitchState.d.ts +0 -2
- package/lib/components/Switch/useSwitchState.js +0 -144
- package/lib/components/Switch/useSwitchState.js.map +0 -1
- package/lib-commonjs/components/Switch/useSwitchState.d.ts +0 -2
- package/lib-commonjs/components/Switch/useSwitchState.js +0 -156
- package/lib-commonjs/components/Switch/useSwitchState.js.map +0 -1
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,174 @@
|
|
2
2
|
"name": "@fluentui/react-switch",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Tue, 19 Apr 2022 19:14:04 GMT",
|
6
|
+
"tag": "@fluentui/react-switch_v9.0.0-rc.6",
|
7
|
+
"version": "9.0.0-rc.6",
|
8
|
+
"comments": {
|
9
|
+
"prerelease": [
|
10
|
+
{
|
11
|
+
"author": "seanmonahan@microsoft.com",
|
12
|
+
"package": "@fluentui/react-switch",
|
13
|
+
"commit": "086a675fd0c648944ff4048450190a0a13467de3",
|
14
|
+
"comment": "Add deprecation messages to react-switch"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "olfedias@microsoft.com",
|
18
|
+
"package": "@fluentui/react-switch",
|
19
|
+
"commit": "e569d6e04d83cbcc6225e61db52ff81d2addd363",
|
20
|
+
"comment": "chore: Update Griffel to latest version"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "seanmonahan@microsoft.com",
|
24
|
+
"package": "@fluentui/react-switch",
|
25
|
+
"commit": "bea6aecfed8612f7b0664ab8bac77c5fccee1efb",
|
26
|
+
"comment": "update react-icons version to ^2.0.166-rc.3 from ^2.0.159-beta.10"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
30
|
+
"package": "@fluentui/react-switch",
|
31
|
+
"commit": "956f5731d132a960d313f3a9e794ce4e1c990e68",
|
32
|
+
"comment": "Removing star exports."
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "email not defined",
|
36
|
+
"package": "@fluentui/react-switch",
|
37
|
+
"commit": "99b11f73ab60b87b45c554403f7abcc21c713454",
|
38
|
+
"comment": "Switch: Updating spec and migration guide to reflect latest state of the component."
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"author": "beachball",
|
42
|
+
"package": "@fluentui/react-switch",
|
43
|
+
"comment": "Bump @fluentui/react-label to v9.0.0-beta.10",
|
44
|
+
"commit": "9c8592decacb9f7b1dc608a03c9f991918806008"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"author": "beachball",
|
48
|
+
"package": "@fluentui/react-switch",
|
49
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-rc.6",
|
50
|
+
"commit": "9c8592decacb9f7b1dc608a03c9f991918806008"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"author": "beachball",
|
54
|
+
"package": "@fluentui/react-switch",
|
55
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.5",
|
56
|
+
"commit": "9c8592decacb9f7b1dc608a03c9f991918806008"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"author": "beachball",
|
60
|
+
"package": "@fluentui/react-switch",
|
61
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.6",
|
62
|
+
"commit": "9c8592decacb9f7b1dc608a03c9f991918806008"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"author": "beachball",
|
66
|
+
"package": "@fluentui/react-switch",
|
67
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.4",
|
68
|
+
"commit": "9c8592decacb9f7b1dc608a03c9f991918806008"
|
69
|
+
}
|
70
|
+
],
|
71
|
+
"none": [
|
72
|
+
{
|
73
|
+
"author": "elcraig@microsoft.com",
|
74
|
+
"package": "@fluentui/react-switch",
|
75
|
+
"commit": "b7f17e976f9e058f39c9fce4f0f9bb6eb4dfa577",
|
76
|
+
"comment": "Update React dev deps and hoist them to the repo root"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"author": "mgodbolt@microsoft.com",
|
80
|
+
"package": "@fluentui/react-switch",
|
81
|
+
"commit": "905e46db07ada986fd7885531f72a71b7bbaabdc",
|
82
|
+
"comment": "create v9 api extractor config and set all v9 packags to use it, suppress forgotten export"
|
83
|
+
}
|
84
|
+
]
|
85
|
+
}
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"date": "Fri, 04 Mar 2022 05:17:30 GMT",
|
89
|
+
"tag": "@fluentui/react-switch_v9.0.0-rc.5",
|
90
|
+
"version": "9.0.0-rc.5",
|
91
|
+
"comments": {
|
92
|
+
"prerelease": [
|
93
|
+
{
|
94
|
+
"author": "dzearing@microsoft.com",
|
95
|
+
"package": "@fluentui/react-switch",
|
96
|
+
"commit": "f2f1c0ea948cc3517eeb442c05433eb0918def29",
|
97
|
+
"comment": "Adding explicit export maps on all consumer packages for FUIR 8 and 9."
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"author": "email not defined",
|
101
|
+
"package": "@fluentui/react-switch",
|
102
|
+
"commit": "852bd412ad6a682db9dfa44b7275f23fcaccb298",
|
103
|
+
"comment": "Updating class names to use slot class names helper type."
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"author": "beachball",
|
107
|
+
"package": "@fluentui/react-switch",
|
108
|
+
"comment": "Bump @fluentui/react-label to v9.0.0-beta.9",
|
109
|
+
"commit": "1494f0b620f6d5aae7f0aef33fc9e8f6eb7f8749"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"author": "beachball",
|
113
|
+
"package": "@fluentui/react-switch",
|
114
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-rc.5",
|
115
|
+
"commit": "1494f0b620f6d5aae7f0aef33fc9e8f6eb7f8749"
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"author": "beachball",
|
119
|
+
"package": "@fluentui/react-switch",
|
120
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.4",
|
121
|
+
"commit": "1494f0b620f6d5aae7f0aef33fc9e8f6eb7f8749"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"author": "beachball",
|
125
|
+
"package": "@fluentui/react-switch",
|
126
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.5",
|
127
|
+
"commit": "1494f0b620f6d5aae7f0aef33fc9e8f6eb7f8749"
|
128
|
+
}
|
129
|
+
]
|
130
|
+
}
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"date": "Tue, 01 Mar 2022 02:17:38 GMT",
|
134
|
+
"tag": "@fluentui/react-switch_v9.0.0-rc.4",
|
135
|
+
"version": "9.0.0-rc.4",
|
136
|
+
"comments": {
|
137
|
+
"prerelease": [
|
138
|
+
{
|
139
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
140
|
+
"package": "@fluentui/react-switch",
|
141
|
+
"commit": "72b08d56fa19f3b580da0497758af54a6afcf69b",
|
142
|
+
"comment": "Switch: Re-implementing component to make it simpler and making it adhere to latest patterns."
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"author": "olfedias@microsoft.com",
|
146
|
+
"package": "@fluentui/react-switch",
|
147
|
+
"commit": "084d7408855f3e52b67cbca172da1acef9dcb98f",
|
148
|
+
"comment": "fix: Add react-theme as dependency"
|
149
|
+
},
|
150
|
+
{
|
151
|
+
"author": "beachball",
|
152
|
+
"package": "@fluentui/react-switch",
|
153
|
+
"comment": "Bump @fluentui/react-label to v9.0.0-beta.8",
|
154
|
+
"commit": "0bc1e755543ed69443d5d03e1976c630583242f7"
|
155
|
+
},
|
156
|
+
{
|
157
|
+
"author": "beachball",
|
158
|
+
"package": "@fluentui/react-switch",
|
159
|
+
"comment": "Bump @fluentui/react-tabster to v9.0.0-rc.4",
|
160
|
+
"commit": "0bc1e755543ed69443d5d03e1976c630583242f7"
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"author": "beachball",
|
164
|
+
"package": "@fluentui/react-switch",
|
165
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.4",
|
166
|
+
"commit": "0bc1e755543ed69443d5d03e1976c630583242f7"
|
167
|
+
}
|
168
|
+
]
|
169
|
+
}
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"date": "Fri, 18 Feb 2022 13:35:34 GMT",
|
6
173
|
"tag": "@fluentui/react-switch_v9.0.0-rc.3",
|
7
174
|
"version": "9.0.0-rc.3",
|
8
175
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,57 @@
|
|
1
1
|
# Change Log - @fluentui/react-switch
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 19 Apr 2022 19:14:04 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.0.0-rc.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.6)
|
8
|
+
|
9
|
+
Tue, 19 Apr 2022 19:14:04 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.5..@fluentui/react-switch_v9.0.0-rc.6)
|
11
|
+
|
12
|
+
### Changes
|
13
|
+
|
14
|
+
- Add deprecation messages to react-switch ([PR #21960](https://github.com/microsoft/fluentui/pull/21960) by seanmonahan@microsoft.com)
|
15
|
+
- chore: Update Griffel to latest version ([PR #21976](https://github.com/microsoft/fluentui/pull/21976) by olfedias@microsoft.com)
|
16
|
+
- update react-icons version to ^2.0.166-rc.3 from ^2.0.159-beta.10 ([PR #22512](https://github.com/microsoft/fluentui/pull/22512) by seanmonahan@microsoft.com)
|
17
|
+
- Removing star exports. ([PR #22139](https://github.com/microsoft/fluentui/pull/22139) by Humberto.Morimoto@microsoft.com)
|
18
|
+
- Switch: Updating spec and migration guide to reflect latest state of the component. ([PR #22011](https://github.com/microsoft/fluentui/pull/22011) by email not defined)
|
19
|
+
- Bump @fluentui/react-label to v9.0.0-beta.10 ([PR #22367](https://github.com/microsoft/fluentui/pull/22367) by beachball)
|
20
|
+
- Bump @fluentui/react-tabster to v9.0.0-rc.6 ([PR #22367](https://github.com/microsoft/fluentui/pull/22367) by beachball)
|
21
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.5 ([PR #22367](https://github.com/microsoft/fluentui/pull/22367) by beachball)
|
22
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.6 ([PR #22367](https://github.com/microsoft/fluentui/pull/22367) by beachball)
|
23
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.4 ([PR #22367](https://github.com/microsoft/fluentui/pull/22367) by beachball)
|
24
|
+
|
25
|
+
## [9.0.0-rc.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.5)
|
26
|
+
|
27
|
+
Fri, 04 Mar 2022 05:17:30 GMT
|
28
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.4..@fluentui/react-switch_v9.0.0-rc.5)
|
29
|
+
|
30
|
+
### Changes
|
31
|
+
|
32
|
+
- Adding explicit export maps on all consumer packages for FUIR 8 and 9. ([PR #21508](https://github.com/microsoft/fluentui/pull/21508) by dzearing@microsoft.com)
|
33
|
+
- Updating class names to use slot class names helper type. ([PR #21933](https://github.com/microsoft/fluentui/pull/21933) by email not defined)
|
34
|
+
- Bump @fluentui/react-label to v9.0.0-beta.9 ([PR #21947](https://github.com/microsoft/fluentui/pull/21947) by beachball)
|
35
|
+
- Bump @fluentui/react-tabster to v9.0.0-rc.5 ([PR #21947](https://github.com/microsoft/fluentui/pull/21947) by beachball)
|
36
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.4 ([PR #21947](https://github.com/microsoft/fluentui/pull/21947) by beachball)
|
37
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.5 ([PR #21947](https://github.com/microsoft/fluentui/pull/21947) by beachball)
|
38
|
+
|
39
|
+
## [9.0.0-rc.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.4)
|
40
|
+
|
41
|
+
Tue, 01 Mar 2022 02:17:38 GMT
|
42
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.3..@fluentui/react-switch_v9.0.0-rc.4)
|
43
|
+
|
44
|
+
### Changes
|
45
|
+
|
46
|
+
- 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)
|
47
|
+
- fix: Add react-theme as dependency ([PR #21825](https://github.com/microsoft/fluentui/pull/21825) by olfedias@microsoft.com)
|
48
|
+
- Bump @fluentui/react-label to v9.0.0-beta.8 ([PR #21884](https://github.com/microsoft/fluentui/pull/21884) by beachball)
|
49
|
+
- Bump @fluentui/react-tabster to v9.0.0-rc.4 ([PR #21884](https://github.com/microsoft/fluentui/pull/21884) by beachball)
|
50
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.4 ([PR #21884](https://github.com/microsoft/fluentui/pull/21884) by beachball)
|
51
|
+
|
7
52
|
## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-switch_v9.0.0-rc.3)
|
8
53
|
|
9
|
-
Fri, 18 Feb 2022 13:
|
54
|
+
Fri, 18 Feb 2022 13:35:34 GMT
|
10
55
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-switch_v9.0.0-rc.1..@fluentui/react-switch_v9.0.0-rc.3)
|
11
56
|
|
12
57
|
### Changes
|
package/MIGRATION.md
CHANGED
@@ -4,25 +4,92 @@
|
|
4
4
|
|
5
5
|
This Migration guide is a work in progress and is not yet ready for use.
|
6
6
|
|
7
|
-
## Migration from v8
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
- `
|
12
|
-
- `
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
- `
|
17
|
-
- `
|
18
|
-
- `
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
- `
|
7
|
+
## Migration from v8's Toggle
|
8
|
+
|
9
|
+
### Props that remain as is
|
10
|
+
|
11
|
+
- `checked`
|
12
|
+
- `defaultChecked`
|
13
|
+
|
14
|
+
### Props that have the same name but have a different implementation
|
15
|
+
|
16
|
+
- `as` - Uses new pattern for `as` introduced in v9
|
17
|
+
- `label` - Now implemented as a v9 slot
|
18
|
+
- `onChange` - Has a slightly different API with our new event data handling pattern
|
19
|
+
|
20
|
+
### Props removed because we can get them from HTML props
|
21
|
+
|
22
|
+
- `ariaLabel` => Getting it as `aria-label` instead
|
23
|
+
- `disabled`
|
24
|
+
- `role`
|
25
|
+
|
26
|
+
### Props no longer supported with an equivalent funtionality in v9's Switch
|
27
|
+
|
28
|
+
- `as`
|
29
|
+
- `componentRef` => Use regular `ref` instead
|
30
|
+
- `inlineLabel` => Use `labelPosition` instead
|
31
|
+
- `styles` => Use new styling system via `tokens` instead
|
32
|
+
|
33
|
+
### Props no longer supported without an equivalent functionality in v9's Switch
|
34
|
+
|
35
|
+
- `offText`
|
36
|
+
- `onText`
|
37
|
+
- `theme`
|
38
|
+
|
39
|
+
## Migration from v0's Checkbox
|
40
|
+
|
41
|
+
### Props that remain as is
|
42
|
+
|
43
|
+
- `checked`
|
44
|
+
- `defaultChecked`
|
45
|
+
- `labelPosition`
|
46
|
+
|
47
|
+
### Props that have the same name but have a different implementation
|
48
|
+
|
49
|
+
- `as` - Uses new pattern for `as` introduced in v9
|
50
|
+
- `indicator` => Now implemented as a v9 slot
|
51
|
+
- `label` - Now implemented as a v9 slot
|
52
|
+
- `onChange` - Has a slightly different API with our new event data handling pattern
|
53
|
+
|
54
|
+
### Props removed because we can get them from HTML props
|
55
|
+
|
56
|
+
- `className`
|
57
|
+
- `disabled`
|
58
|
+
- `onClick`
|
59
|
+
|
60
|
+
### Props no longer supported with an equivalent functionality in v9's Switch
|
61
|
+
|
62
|
+
- `accessibility` => Override accessibility behavior by composing the `Switch` however you want
|
63
|
+
- `styles` => Use new styling system via `tokens` instead
|
64
|
+
- `toggle` => Default behavior for `Switch` in v9
|
65
|
+
- `variables` => Use new styling system via `tokens` instead
|
66
|
+
|
67
|
+
### Props no longer supported without an equivalent functionality in v9's Switch
|
68
|
+
|
69
|
+
- `design`
|
70
|
+
|
71
|
+
## Propery mapping
|
72
|
+
|
73
|
+
| v8 `Toggle` | v0 `Checkbox` | v9 `Switch` |
|
74
|
+
| ---------------- | --------------- | ---------------- |
|
75
|
+
| | `accessibility` | |
|
76
|
+
| `arialabel` | `aria-label` | `aria-label` |
|
77
|
+
| `as` | `as` | `as` |
|
78
|
+
| `checked` | `checked` | `checked` |
|
79
|
+
| `className` | `className` | `className` |
|
80
|
+
| `componentRef` | | `ref` |
|
81
|
+
| `defaultChecked` | | |
|
82
|
+
| | `design` | |
|
83
|
+
| `disabled` | `disabled` | `disabled` |
|
84
|
+
| | `indicator` | `indicator` |
|
85
|
+
| `inlineLabel` | `labelPosition` | `labelPosition` |
|
86
|
+
| `label` | `label` | `label` |
|
87
|
+
| `offText` | | |
|
88
|
+
| `onChange` | `onChange` | `onChange` |
|
89
|
+
| `onClick` | `onClick` | `onClick` |
|
90
|
+
| `onText` | | |
|
91
|
+
| `role` | | `role` |
|
92
|
+
| `styles` | `styles` | |
|
93
|
+
| `theme` | | |
|
94
|
+
| Default behavior | `toggle` | Default behavior |
|
95
|
+
| | `variables` | |
|