@fluentui/react-radio 0.0.0-nightly-20220503-0421.1 → 0.0.0-nightly-20220506-0417.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. package/CHANGELOG.json +141 -13
  2. package/CHANGELOG.md +51 -18
  3. package/README.md +4 -0
  4. package/dist/index.d.ts +17 -8
  5. package/lib/components/Radio/Radio.types.d.ts +1 -1
  6. package/lib/components/Radio/Radio.types.js.map +1 -1
  7. package/lib/components/Radio/useRadio.js +15 -9
  8. package/lib/components/Radio/useRadio.js.map +1 -1
  9. package/lib/components/RadioGroup/RadioGroup.js +3 -1
  10. package/lib/components/RadioGroup/RadioGroup.js.map +1 -1
  11. package/lib/components/RadioGroup/RadioGroup.types.d.ts +9 -4
  12. package/lib/components/RadioGroup/RadioGroup.types.js.map +1 -1
  13. package/lib/components/RadioGroup/renderRadioGroup.d.ts +2 -2
  14. package/lib/components/RadioGroup/renderRadioGroup.js +2 -2
  15. package/lib/components/RadioGroup/renderRadioGroup.js.map +1 -1
  16. package/lib/components/RadioGroup/useRadioGroup.js +7 -9
  17. package/lib/components/RadioGroup/useRadioGroup.js.map +1 -1
  18. package/lib/contexts/RadioGroupContext.d.ts +3 -4
  19. package/lib/contexts/RadioGroupContext.js +2 -2
  20. package/lib/contexts/RadioGroupContext.js.map +1 -1
  21. package/lib/contexts/index.d.ts +2 -0
  22. package/lib/contexts/index.js +3 -0
  23. package/lib/contexts/index.js.map +1 -0
  24. package/lib/contexts/useRadioGroupContextValues.d.ts +2 -0
  25. package/lib/contexts/useRadioGroupContextValues.js +22 -0
  26. package/lib/contexts/useRadioGroupContextValues.js.map +1 -0
  27. package/lib/index.d.ts +2 -3
  28. package/lib/index.js +1 -1
  29. package/lib/index.js.map +1 -1
  30. package/lib-commonjs/components/Radio/Radio.types.d.ts +1 -1
  31. package/lib-commonjs/components/Radio/useRadio.js +16 -9
  32. package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
  33. package/lib-commonjs/components/RadioGroup/RadioGroup.js +4 -1
  34. package/lib-commonjs/components/RadioGroup/RadioGroup.js.map +1 -1
  35. package/lib-commonjs/components/RadioGroup/RadioGroup.types.d.ts +9 -4
  36. package/lib-commonjs/components/RadioGroup/renderRadioGroup.d.ts +2 -2
  37. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js +2 -2
  38. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -1
  39. package/lib-commonjs/components/RadioGroup/useRadioGroup.js +7 -10
  40. package/lib-commonjs/components/RadioGroup/useRadioGroup.js.map +1 -1
  41. package/lib-commonjs/contexts/RadioGroupContext.d.ts +3 -4
  42. package/lib-commonjs/contexts/RadioGroupContext.js +2 -2
  43. package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
  44. package/lib-commonjs/contexts/index.d.ts +2 -0
  45. package/lib-commonjs/contexts/index.js +12 -0
  46. package/lib-commonjs/contexts/index.js.map +1 -0
  47. package/lib-commonjs/contexts/useRadioGroupContextValues.d.ts +2 -0
  48. package/lib-commonjs/contexts/useRadioGroupContextValues.js +31 -0
  49. package/lib-commonjs/contexts/useRadioGroupContextValues.js.map +1 -0
  50. package/lib-commonjs/index.d.ts +2 -3
  51. package/lib-commonjs/index.js +9 -3
  52. package/lib-commonjs/index.js.map +1 -1
  53. package/package.json +9 -8
package/CHANGELOG.json CHANGED
@@ -2,9 +2,9 @@
2
2
  "name": "@fluentui/react-radio",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 03 May 2022 04:34:45 GMT",
6
- "tag": "@fluentui/react-radio_v0.0.0-nightly-20220503-0421.1",
7
- "version": "0.0.0-nightly-20220503-0421.1",
5
+ "date": "Fri, 06 May 2022 04:27:22 GMT",
6
+ "tag": "@fluentui/react-radio_v0.0.0-nightly-20220506-0417.1",
7
+ "version": "0.0.0-nightly-20220506-0417.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
@@ -13,47 +13,175 @@
13
13
  "commit": "not available",
14
14
  "comment": "Release nightly v9"
15
15
  },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-radio",
19
+ "comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20220506-0417.1",
20
+ "commit": "1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-radio",
25
+ "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20220506-0417.1",
26
+ "commit": "1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-radio",
31
+ "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20220506-0417.1",
32
+ "commit": "1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-radio",
37
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220506-0417.1",
38
+ "commit": "1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-radio",
43
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220506-0417.1",
44
+ "commit": "1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-radio",
49
+ "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20220506-0417.1",
50
+ "commit": "1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Thu, 05 May 2022 18:26:25 GMT",
57
+ "tag": "@fluentui/react-radio_v9.0.0-rc.2",
58
+ "version": "9.0.0-rc.2",
59
+ "comments": {
60
+ "none": [
61
+ {
62
+ "author": "tristan.watanabe@gmail.com",
63
+ "package": "@fluentui/react-radio",
64
+ "commit": "ad3dfcc6d85a8dba3c183612fe552280cd33c20e",
65
+ "comment": "react-radio: Move to new common folder."
66
+ }
67
+ ],
68
+ "prerelease": [
69
+ {
70
+ "author": "seanmonahan@microsoft.com",
71
+ "package": "@fluentui/react-radio",
72
+ "commit": "f628da463f8a12f39e32785e086ef7a2687275f6",
73
+ "comment": "update README"
74
+ },
75
+ {
76
+ "author": "beachball",
77
+ "package": "@fluentui/react-radio",
78
+ "comment": "Bump @fluentui/react-context-selector to v9.0.0-rc.8",
79
+ "commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
80
+ },
81
+ {
82
+ "author": "beachball",
83
+ "package": "@fluentui/react-radio",
84
+ "comment": "Bump @fluentui/react-label to v9.0.0-beta.12",
85
+ "commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
86
+ },
87
+ {
88
+ "author": "beachball",
89
+ "package": "@fluentui/react-radio",
90
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-rc.9",
91
+ "commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
92
+ },
93
+ {
94
+ "author": "beachball",
95
+ "package": "@fluentui/react-radio",
96
+ "comment": "Bump @fluentui/react-theme to v9.0.0-rc.7",
97
+ "commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
98
+ },
99
+ {
100
+ "author": "beachball",
101
+ "package": "@fluentui/react-radio",
102
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.8",
103
+ "commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
104
+ },
105
+ {
106
+ "author": "beachball",
107
+ "package": "@fluentui/react-radio",
108
+ "comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.5",
109
+ "commit": "c5abb9c480ac94d12aa644d68d30773d77f2a159"
110
+ }
111
+ ]
112
+ }
113
+ },
114
+ {
115
+ "date": "Wed, 04 May 2022 13:26:48 GMT",
116
+ "tag": "@fluentui/react-radio_v9.0.0-beta.5",
117
+ "version": "9.0.0-beta.5",
118
+ "comments": {
119
+ "prerelease": [
120
+ {
121
+ "author": "seanmonahan@microsoft.com",
122
+ "package": "@fluentui/react-radio",
123
+ "commit": "9132814df4b6d40d1f5d93d8324d756c1284b294",
124
+ "comment": "react-radio: update context usage"
125
+ },
16
126
  {
17
127
  "author": "seanmonahan@microsoft.com",
18
128
  "package": "@fluentui/react-radio",
19
129
  "commit": "8d990349b5af2d61057cccda2357412d2f5ab9b9",
20
130
  "comment": "add bundle size fixtures"
21
131
  },
132
+ {
133
+ "author": "seanmonahan@microsoft.com",
134
+ "package": "@fluentui/react-radio",
135
+ "commit": "6a017c3b1f2a282fa86c28b675e5ed34a1bb2aee",
136
+ "comment": "react-radio: add required prop to RadioGroup"
137
+ },
138
+ {
139
+ "author": "seanmonahan@microsoft.com",
140
+ "package": "@fluentui/react-radio",
141
+ "commit": "4bc1c43194cb9f44c5ad40ae43ab26556778157e",
142
+ "comment": "react-radio: remove required indicator from label"
143
+ },
22
144
  {
23
145
  "author": "seanmonahan@microsoft.com",
24
146
  "package": "@fluentui/react-radio",
25
147
  "commit": "5f27c51743f22f08741a75c2c10032a02afdf6fb",
26
148
  "comment": "write readme"
27
149
  },
150
+ {
151
+ "author": "miroslav.stastny@microsoft.com",
152
+ "package": "@fluentui/react-radio",
153
+ "commit": "3be7a89d9e9323780bba5b24d3bcc4342e1f1ec7",
154
+ "comment": "Allow data argument on onChange"
155
+ },
28
156
  {
29
157
  "author": "beachball",
30
158
  "package": "@fluentui/react-radio",
31
- "comment": "Bump @fluentui/react-label to v0.0.0-nightly-20220503-0421.1",
32
- "commit": "0a280b0835179cafee6022280911ba42ab7baeac"
159
+ "comment": "Bump @fluentui/react-context-selector to v9.0.0-rc.7",
160
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
33
161
  },
34
162
  {
35
163
  "author": "beachball",
36
164
  "package": "@fluentui/react-radio",
37
- "comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20220503-0421.1",
38
- "commit": "0a280b0835179cafee6022280911ba42ab7baeac"
165
+ "comment": "Bump @fluentui/react-label to v9.0.0-beta.11",
166
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
39
167
  },
40
168
  {
41
169
  "author": "beachball",
42
170
  "package": "@fluentui/react-radio",
43
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220503-0421.1",
44
- "commit": "0a280b0835179cafee6022280911ba42ab7baeac"
171
+ "comment": "Bump @fluentui/react-tabster to v9.0.0-rc.8",
172
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
45
173
  },
46
174
  {
47
175
  "author": "beachball",
48
176
  "package": "@fluentui/react-radio",
49
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220503-0421.1",
50
- "commit": "0a280b0835179cafee6022280911ba42ab7baeac"
177
+ "comment": "Bump @fluentui/react-theme to v9.0.0-rc.6",
178
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
51
179
  },
52
180
  {
53
181
  "author": "beachball",
54
182
  "package": "@fluentui/react-radio",
55
- "comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20220503-0421.1",
56
- "commit": "0a280b0835179cafee6022280911ba42ab7baeac"
183
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.7",
184
+ "commit": "65f94192ed3b2cde7e52b9c7e12d6f38b81965dd"
57
185
  }
58
186
  ]
59
187
  }
package/CHANGELOG.md CHANGED
@@ -1,28 +1,61 @@
1
1
  # Change Log - @fluentui/react-radio
2
2
 
3
- This log was last generated on Tue, 03 May 2022 04:34:45 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 06 May 2022 04:27:22 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20220503-0421.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v0.0.0-nightly-20220503-0421.1)
7
+ ## [0.0.0-nightly-20220506-0417.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v0.0.0-nightly-20220506-0417.1)
8
8
 
9
- Tue, 03 May 2022 04:34:45 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.4..@fluentui/react-radio_v0.0.0-nightly-20220503-0421.1)
9
+ Fri, 06 May 2022 04:27:22 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-rc.2..@fluentui/react-radio_v0.0.0-nightly-20220506-0417.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by email not defined)
15
+ - Bump @fluentui/react-context-selector to v0.0.0-nightly-20220506-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559) by beachball)
16
+ - Bump @fluentui/react-label to v0.0.0-nightly-20220506-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559) by beachball)
17
+ - Bump @fluentui/react-tabster to v0.0.0-nightly-20220506-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559) by beachball)
18
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20220506-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559) by beachball)
19
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20220506-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559) by beachball)
20
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20220506-0417.1 ([commit](https://github.com/microsoft/fluentui/commit/1dbdfe3544ed01dff3baaf5d6b96d3cc8ec5e559) by beachball)
21
+
22
+ ## [9.0.0-rc.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-rc.2)
23
+
24
+ Thu, 05 May 2022 18:26:25 GMT
25
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.5..@fluentui/react-radio_v9.0.0-rc.2)
26
+
27
+ ### Changes
28
+
29
+ - update README ([PR #22819](https://github.com/microsoft/fluentui/pull/22819) by seanmonahan@microsoft.com)
30
+ - Bump @fluentui/react-context-selector to v9.0.0-rc.8 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
31
+ - Bump @fluentui/react-label to v9.0.0-beta.12 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
32
+ - Bump @fluentui/react-tabster to v9.0.0-rc.9 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
33
+ - Bump @fluentui/react-theme to v9.0.0-rc.7 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
34
+ - Bump @fluentui/react-utilities to v9.0.0-rc.8 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
35
+ - Bump @fluentui/react-conformance-griffel to v9.0.0-beta.5 ([PR #22857](https://github.com/microsoft/fluentui/pull/22857) by beachball)
36
+
37
+ ## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.5)
38
+
39
+ Wed, 04 May 2022 13:26:48 GMT
40
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.4..@fluentui/react-radio_v9.0.0-beta.5)
41
+
42
+ ### Changes
43
+
44
+ - react-radio: update context usage ([PR #22803](https://github.com/microsoft/fluentui/pull/22803) by seanmonahan@microsoft.com)
15
45
  - add bundle size fixtures ([PR #22675](https://github.com/microsoft/fluentui/pull/22675) by seanmonahan@microsoft.com)
46
+ - react-radio: add required prop to RadioGroup ([PR #22809](https://github.com/microsoft/fluentui/pull/22809) by seanmonahan@microsoft.com)
47
+ - react-radio: remove required indicator from label ([PR #22782](https://github.com/microsoft/fluentui/pull/22782) by seanmonahan@microsoft.com)
16
48
  - write readme ([PR #22676](https://github.com/microsoft/fluentui/pull/22676) by seanmonahan@microsoft.com)
17
- - Bump @fluentui/react-label to v0.0.0-nightly-20220503-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/0a280b0835179cafee6022280911ba42ab7baeac) by beachball)
18
- - Bump @fluentui/react-tabster to v0.0.0-nightly-20220503-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/0a280b0835179cafee6022280911ba42ab7baeac) by beachball)
19
- - Bump @fluentui/react-theme to v0.0.0-nightly-20220503-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/0a280b0835179cafee6022280911ba42ab7baeac) by beachball)
20
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20220503-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/0a280b0835179cafee6022280911ba42ab7baeac) by beachball)
21
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20220503-0421.1 ([commit](https://github.com/microsoft/fluentui/commit/0a280b0835179cafee6022280911ba42ab7baeac) by beachball)
49
+ - Allow data argument on onChange ([PR #22753](https://github.com/microsoft/fluentui/pull/22753) by miroslav.stastny@microsoft.com)
50
+ - Bump @fluentui/react-context-selector to v9.0.0-rc.7 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
51
+ - Bump @fluentui/react-label to v9.0.0-beta.11 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
52
+ - Bump @fluentui/react-tabster to v9.0.0-rc.8 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
53
+ - Bump @fluentui/react-theme to v9.0.0-rc.6 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
54
+ - Bump @fluentui/react-utilities to v9.0.0-rc.7 ([PR #22786](https://github.com/microsoft/fluentui/pull/22786) by beachball)
22
55
 
23
56
  ## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.4)
24
57
 
25
- Mon, 25 Apr 2022 09:32:19 GMT
58
+ Mon, 25 Apr 2022 09:32:19 GMT
26
59
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.3..@fluentui/react-radio_v9.0.0-beta.4)
27
60
 
28
61
  ### Changes
@@ -31,7 +64,7 @@ Mon, 25 Apr 2022 09:32:19 GMT
31
64
 
32
65
  ## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.3)
33
66
 
34
- Tue, 19 Apr 2022 19:16:50 GMT
67
+ Tue, 19 Apr 2022 19:16:50 GMT
35
68
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.2..@fluentui/react-radio_v9.0.0-beta.3)
36
69
 
37
70
  ### Changes
@@ -50,7 +83,7 @@ Tue, 19 Apr 2022 19:16:50 GMT
50
83
 
51
84
  ## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.2)
52
85
 
53
- Fri, 04 Mar 2022 05:17:40 GMT
86
+ Fri, 04 Mar 2022 05:17:40 GMT
54
87
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.1..@fluentui/react-radio_v9.0.0-beta.2)
55
88
 
56
89
  ### Changes
@@ -64,7 +97,7 @@ Fri, 04 Mar 2022 05:17:40 GMT
64
97
 
65
98
  ## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.1)
66
99
 
67
- Tue, 01 Mar 2022 02:17:40 GMT
100
+ Tue, 01 Mar 2022 02:17:40 GMT
68
101
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.1..@fluentui/react-radio_v9.0.0-beta.1)
69
102
 
70
103
  ### Changes
@@ -75,7 +108,7 @@ Tue, 01 Mar 2022 02:17:40 GMT
75
108
 
76
109
  ## [9.0.0-beta.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.1)
77
110
 
78
- Fri, 18 Feb 2022 13:35:38 GMT
111
+ Fri, 18 Feb 2022 13:35:38 GMT
79
112
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.0..@fluentui/react-radio_v9.0.0-beta.1)
80
113
 
81
114
  ### Changes
@@ -87,7 +120,7 @@ Fri, 18 Feb 2022 13:35:38 GMT
87
120
 
88
121
  ## [9.0.0-beta.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.0)
89
122
 
90
- Thu, 10 Feb 2022 08:52:26 GMT
123
+ Thu, 10 Feb 2022 08:52:26 GMT
91
124
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.0..@fluentui/react-radio_v9.0.0-beta.0)
92
125
 
93
126
  ### Changes
@@ -99,7 +132,7 @@ Thu, 10 Feb 2022 08:52:26 GMT
99
132
 
100
133
  ## [9.0.0-beta.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.0)
101
134
 
102
- Thu, 25 Nov 2021 08:34:17 GMT
135
+ Thu, 25 Nov 2021 08:34:17 GMT
103
136
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.0..@fluentui/react-radio_v9.0.0-beta.0)
104
137
 
105
138
  ### Changes
@@ -112,7 +145,7 @@ Thu, 25 Nov 2021 08:34:17 GMT
112
145
 
113
146
  ## [9.0.0-beta.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.0)
114
147
 
115
- Fri, 12 Nov 2021 13:25:34 GMT
148
+ Fri, 12 Nov 2021 13:25:34 GMT
116
149
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.0..@fluentui/react-radio_v9.0.0-beta.0)
117
150
 
118
151
  ### Changes
@@ -125,7 +158,7 @@ Fri, 12 Nov 2021 13:25:34 GMT
125
158
 
126
159
  ## [9.0.0-beta.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.0-beta.0)
127
160
 
128
- Wed, 27 Oct 2021 12:14:24 GMT
161
+ Wed, 27 Oct 2021 12:14:24 GMT
129
162
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.0-beta.0..@fluentui/react-radio_v9.0.0-beta.0)
130
163
 
131
164
  ### Changes
package/README.md CHANGED
@@ -11,6 +11,10 @@ A Radio allows a user to select a single value from two or more options. All Rad
11
11
  Import `Radio` and `RadioGroup`:
12
12
 
13
13
  ```js
14
+ // From @fluentui/react-components
15
+ import { Radio, RadioGroup } from '@fluentui/react-components';
16
+
17
+ // Directly from @fluentui/react-radio
14
18
  import { Radio, RadioGroup } from '@fluentui/react-radio';
15
19
  ```
16
20
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import type { ComponentProps } from '@fluentui/react-utilities';
2
2
  import type { ComponentState } from '@fluentui/react-utilities';
3
+ import type { Context } from '@fluentui/react-context-selector';
3
4
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
5
  import { Label } from '@fluentui/react-label';
5
6
  import * as React_2 from 'react';
@@ -33,9 +34,13 @@ export declare const radioGroupClassNames: SlotClassNames<RadioGroupSlots>;
33
34
  /**
34
35
  * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
35
36
  */
36
- export declare const RadioGroupContext: React_2.Context<RadioGroupContextValue>;
37
+ export declare const RadioGroupContext: Context<RadioGroupContextValue>;
37
38
 
38
- export declare type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'layout' | 'value' | 'defaultValue' | 'disabled'>;
39
+ export declare type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'>;
40
+
41
+ export declare type RadioGroupContextValues = {
42
+ radioGroup: RadioGroupContextValue;
43
+ };
39
44
 
40
45
  /**
41
46
  * Data for the onChange event for RadioGroup.
@@ -73,13 +78,17 @@ export declare type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlot
73
78
  /**
74
79
  * How the radio items are laid out in the group.
75
80
  *
76
- * @defaultvalue vertical
81
+ * @default vertical
77
82
  */
78
83
  layout?: 'vertical' | 'horizontal' | 'horizontalStacked';
79
84
  /**
80
85
  * Disable all Radio items in this group.
81
86
  */
82
87
  disabled?: boolean;
88
+ /**
89
+ * Require all Radio items in this group.
90
+ */
91
+ required?: boolean;
83
92
  };
84
93
 
85
94
  export declare type RadioGroupSlots = {
@@ -92,9 +101,7 @@ export declare type RadioGroupSlots = {
92
101
  /**
93
102
  * State used in rendering RadioGroup
94
103
  */
95
- export declare type RadioGroupState = ComponentState<RadioGroupSlots> & Required<Pick<RadioGroupProps, 'layout'>> & {
96
- context: RadioGroupContextValue;
97
- };
104
+ export declare type RadioGroupState = ComponentState<RadioGroupSlots> & Required<Pick<RadioGroupProps, 'layout'>> & Partial<Exclude<RadioGroupProps, 'onChange' | 'layout'>>;
98
105
 
99
106
  /**
100
107
  * Data for the onChange event for Radio.
@@ -109,7 +116,7 @@ export declare type RadioOnChangeData = {
109
116
  /**
110
117
  * Radio Props
111
118
  */
112
- export declare type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'size'> & {
119
+ export declare type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'onChange' | 'size'> & {
113
120
  /**
114
121
  * The value of the RadioGroup when this Radio item is selected.
115
122
  */
@@ -174,7 +181,7 @@ export declare const renderRadio_unstable: (state: RadioState) => JSX.Element;
174
181
  /**
175
182
  * Render the final JSX of RadioGroup
176
183
  */
177
- export declare const renderRadioGroup_unstable: (state: RadioGroupState) => JSX.Element;
184
+ export declare const renderRadioGroup_unstable: (state: RadioGroupState, contextValues: RadioGroupContextValues) => JSX.Element;
178
185
 
179
186
  /**
180
187
  * Create the state required to render Radio.
@@ -198,6 +205,8 @@ export declare const useRadio_unstable: (props: RadioProps, ref: React_2.Ref<HTM
198
205
  */
199
206
  export declare const useRadioGroup_unstable: (props: RadioGroupProps, ref: React_2.Ref<HTMLDivElement>) => RadioGroupState;
200
207
 
208
+ export declare const useRadioGroupContextValues: (state: RadioGroupState) => RadioGroupContextValues;
209
+
201
210
  /**
202
211
  * Apply styling to the RadioGroup slots based on the state
203
212
  */
@@ -28,7 +28,7 @@ export declare type RadioSlots = {
28
28
  /**
29
29
  * Radio Props
30
30
  */
31
- export declare type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'size'> & {
31
+ export declare type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'onChange' | 'size'> & {
32
32
  /**
33
33
  * The value of the RadioGroup when this Radio item is selected.
34
34
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.types.js","sourceRoot":"../src/","sources":["components/Radio/Radio.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 RadioSlots = {\n /**\n * The root element of the Radio.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Radio>`.\n * All other native props will be applied to the primary slot: `input`\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Radio's label.\n */\n label: Slot<typeof Label>;\n\n /**\n * Hidden input that handles the radio's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * A circle outline, with a filled circle icon inside when the Radio is checked.\n */\n indicator: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Radio Props\n */\nexport type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'size'> & {\n /**\n * The value of the RadioGroup when this Radio item is selected.\n */\n value?: string;\n\n /**\n * The position of the label relative to the radio indicator.\n *\n * This defaults to `after` unless the Radio is inside a RadioGroup with `layout=\"horizontalStacked\"`,\n * in which case it defaults to `below`.\n *\n * @defaultvalue after\n */\n labelPosition?: 'after' | 'below';\n\n /**\n * Disable this Radio item.\n */\n disabled?: boolean;\n\n /**\n * Callback when this Radio is selected in its group.\n *\n * **Note:** `onChange` is NOT called when this Radio is deselected.\n * Use RadioGroup's `onChange` event to determine when the selection in the group changes.\n */\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;\n};\n\n/**\n * Data for the onChange event for Radio.\n */\nexport type RadioOnChangeData = {\n /**\n * The value prop of this Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering Radio\n */\nexport type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;\n"]}
1
+ {"version":3,"file":"Radio.types.js","sourceRoot":"../src/","sources":["components/Radio/Radio.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 RadioSlots = {\n /**\n * The root element of the Radio.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Radio>`.\n * All other native props will be applied to the primary slot: `input`\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Radio's label.\n */\n label: Slot<typeof Label>;\n\n /**\n * Hidden input that handles the radio's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * A circle outline, with a filled circle icon inside when the Radio is checked.\n */\n indicator: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Radio Props\n */\nexport type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'onChange' | 'size'> & {\n /**\n * The value of the RadioGroup when this Radio item is selected.\n */\n value?: string;\n\n /**\n * The position of the label relative to the radio indicator.\n *\n * This defaults to `after` unless the Radio is inside a RadioGroup with `layout=\"horizontalStacked\"`,\n * in which case it defaults to `below`.\n *\n * @defaultvalue after\n */\n labelPosition?: 'after' | 'below';\n\n /**\n * Disable this Radio item.\n */\n disabled?: boolean;\n\n /**\n * Callback when this Radio is selected in its group.\n *\n * **Note:** `onChange` is NOT called when this Radio is deselected.\n * Use RadioGroup's `onChange` event to determine when the selection in the group changes.\n */\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;\n};\n\n/**\n * Data for the onChange event for Radio.\n */\nexport type RadioOnChangeData = {\n /**\n * The value prop of this Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering Radio\n */\nexport type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;\n"]}
@@ -3,6 +3,7 @@ import { CircleFilled } from '@fluentui/react-icons';
3
3
  import { Label } from '@fluentui/react-label';
4
4
  import { getPartitionedNativeProps, resolveShorthand, useId, useMergedEventCallbacks } from '@fluentui/react-utilities';
5
5
  import { RadioGroupContext } from '../../contexts/RadioGroupContext';
6
+ import { useContextSelector } from '@fluentui/react-context-selector';
6
7
  /**
7
8
  * Create the state required to render Radio.
8
9
  *
@@ -14,14 +15,19 @@ import { RadioGroupContext } from '../../contexts/RadioGroupContext';
14
15
  */
15
16
 
16
17
  export const useRadio_unstable = (props, ref) => {
17
- const group = React.useContext(RadioGroupContext);
18
+ const nameGroup = useContextSelector(RadioGroupContext, ctx => ctx.name);
19
+ const value = useContextSelector(RadioGroupContext, ctx => ctx.value);
20
+ const defaultValue = useContextSelector(RadioGroupContext, ctx => ctx.defaultValue);
21
+ const disabledGroup = useContextSelector(RadioGroupContext, ctx => ctx.disabled);
22
+ const layout = useContextSelector(RadioGroupContext, ctx => ctx.layout);
23
+ const requiredGroup = useContextSelector(RadioGroupContext, ctx => ctx.required);
18
24
  const {
19
- name = group.name,
20
- checked = group.value !== undefined ? group.value === props.value : undefined,
21
- defaultChecked = group.defaultValue !== undefined ? group.defaultValue === props.value : undefined,
22
- labelPosition = group.layout === 'horizontalStacked' ? 'below' : 'after',
23
- disabled = group.disabled,
24
- required,
25
+ name = nameGroup,
26
+ checked = value !== undefined ? value === props.value : undefined,
27
+ defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,
28
+ labelPosition = layout === 'horizontalStacked' ? 'below' : 'after',
29
+ disabled = disabledGroup,
30
+ required = requiredGroup,
25
31
  onChange
26
32
  } = props;
27
33
  const nativeProps = getPartitionedNativeProps({
@@ -43,6 +49,7 @@ export const useRadio_unstable = (props, ref) => {
43
49
  checked,
44
50
  defaultChecked,
45
51
  disabled,
52
+ required,
46
53
  ...nativeProps.primary
47
54
  }
48
55
  });
@@ -52,8 +59,7 @@ export const useRadio_unstable = (props, ref) => {
52
59
  const label = resolveShorthand(props.label, {
53
60
  defaultProps: {
54
61
  htmlFor: input.id,
55
- disabled,
56
- required
62
+ disabled
57
63
  }
58
64
  });
59
65
  const indicator = resolveShorthand(props.indicator, {
@@ -1 +1 @@
1
- {"version":3,"sources":["components/Radio/useRadio.tsx"],"names":[],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, resolveShorthand, useId, useMergedEventCallbacks } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport type { RadioProps, RadioState } from './Radio.types';\n\n/**\n * Create the state required to render Radio.\n *\n * The returned state can be modified with hooks such as useRadioStyles_unstable,\n * before being passed to renderRadio_unstable.\n *\n * @param props - props from this instance of Radio\n * @param ref - reference to `<input>` element of Radio\n */\nexport const useRadio_unstable = (props: RadioProps, ref: React.Ref<HTMLInputElement>): RadioState => {\n const group = React.useContext(RadioGroupContext);\n\n const {\n name = group.name,\n checked = group.value !== undefined ? group.value === props.value : undefined,\n defaultChecked = group.defaultValue !== undefined ? group.defaultValue === props.value : undefined,\n labelPosition = group.layout === 'horizontalStacked' ? 'below' : 'after',\n disabled = group.disabled,\n required,\n onChange,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange'],\n });\n\n const root = resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n });\n\n const input = resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n ref,\n type: 'radio',\n id: useId('radio-', nativeProps.primary.id),\n name,\n checked,\n defaultChecked,\n disabled,\n ...nativeProps.primary,\n },\n });\n\n input.onChange = useMergedEventCallbacks(input.onChange, ev => onChange?.(ev, { value: ev.currentTarget.value }));\n\n const label = resolveShorthand(props.label, {\n defaultProps: {\n htmlFor: input.id,\n disabled,\n required,\n },\n });\n\n const indicator = resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: <CircleFilled />,\n },\n });\n\n return {\n labelPosition,\n components: {\n root: 'span',\n input: 'input',\n label: Label,\n indicator: 'div',\n },\n root,\n input,\n label,\n indicator,\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/Radio/useRadio.tsx"],"names":[],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, resolveShorthand, useId, useMergedEventCallbacks } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { useContextSelector } from '@fluentui/react-context-selector';\nimport type { RadioProps, RadioState } from './Radio.types';\n\n/**\n * Create the state required to render Radio.\n *\n * The returned state can be modified with hooks such as useRadioStyles_unstable,\n * before being passed to renderRadio_unstable.\n *\n * @param props - props from this instance of Radio\n * @param ref - reference to `<input>` element of Radio\n */\nexport const useRadio_unstable = (props: RadioProps, ref: React.Ref<HTMLInputElement>): RadioState => {\n const nameGroup = useContextSelector(RadioGroupContext, ctx => ctx.name);\n const value = useContextSelector(RadioGroupContext, ctx => ctx.value);\n const defaultValue = useContextSelector(RadioGroupContext, ctx => ctx.defaultValue);\n const disabledGroup = useContextSelector(RadioGroupContext, ctx => ctx.disabled);\n const layout = useContextSelector(RadioGroupContext, ctx => ctx.layout);\n const requiredGroup = useContextSelector(RadioGroupContext, ctx => ctx.required);\n\n const {\n name = nameGroup,\n checked = value !== undefined ? value === props.value : undefined,\n defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,\n labelPosition = layout === 'horizontalStacked' ? 'below' : 'after',\n disabled = disabledGroup,\n required = requiredGroup,\n onChange,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange'],\n });\n\n const root = resolveShorthand(props.root, {\n required: true,\n defaultProps: nativeProps.root,\n });\n\n const input = resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n ref,\n type: 'radio',\n id: useId('radio-', nativeProps.primary.id),\n name,\n checked,\n defaultChecked,\n disabled,\n required,\n ...nativeProps.primary,\n },\n });\n\n input.onChange = useMergedEventCallbacks(input.onChange, ev => onChange?.(ev, { value: ev.currentTarget.value }));\n\n const label = resolveShorthand(props.label, {\n defaultProps: {\n htmlFor: input.id,\n disabled,\n },\n });\n\n const indicator = resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: <CircleFilled />,\n },\n });\n\n return {\n labelPosition,\n components: {\n root: 'span',\n input: 'input',\n label: Label,\n indicator: 'div',\n },\n root,\n input,\n label,\n indicator,\n };\n};\n"],"sourceRoot":"../src/"}
@@ -2,14 +2,16 @@ import * as React from 'react';
2
2
  import { renderRadioGroup_unstable } from './renderRadioGroup';
3
3
  import { useRadioGroup_unstable } from './useRadioGroup';
4
4
  import { useRadioGroupStyles_unstable } from './useRadioGroupStyles';
5
+ import { useRadioGroupContextValues } from '../../contexts/useRadioGroupContextValues';
5
6
  /**
6
7
  * A RadioGroup component presents a set of options where only one option can be selected.
7
8
  */
8
9
 
9
10
  export const RadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
10
11
  const state = useRadioGroup_unstable(props, ref);
12
+ const contextValues = useRadioGroupContextValues(state);
11
13
  useRadioGroupStyles_unstable(state);
12
- return renderRadioGroup_unstable(state);
14
+ return renderRadioGroup_unstable(state, contextValues);
13
15
  });
14
16
  RadioGroup.displayName = 'RadioGroup';
15
17
  //# sourceMappingURL=RadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AAEA;;AAEG;;AACH,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,sBAAsB,CAAC,KAAD,EAAQ,GAAR,CAApC;AAEA,EAAA,4BAA4B,CAAC,KAAD,CAA5B;AACA,SAAO,yBAAyB,CAAC,KAAD,CAAhC;AACD,CAL+D,CAAzD;AAOP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroupProps } from './RadioGroup.types';\nimport { renderRadioGroup_unstable } from './renderRadioGroup';\nimport { useRadioGroup_unstable } from './useRadioGroup';\nimport { useRadioGroupStyles_unstable } from './useRadioGroupStyles';\n\n/**\n * A RadioGroup component presents a set of options where only one option can be selected.\n */\nexport const RadioGroup: ForwardRefComponent<RadioGroupProps> = React.forwardRef((props, ref) => {\n const state = useRadioGroup_unstable(props, ref);\n\n useRadioGroupStyles_unstable(state);\n return renderRadioGroup_unstable(state);\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,SAAS,yBAAT,QAA0C,oBAA1C;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,4BAAT,QAA6C,uBAA7C;AACA,SAAS,0BAAT,QAA2C,2CAA3C;AAEA;;AAEG;;AACH,OAAO,MAAM,UAAU,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AAC9F,QAAM,KAAK,GAAG,sBAAsB,CAAC,KAAD,EAAQ,GAAR,CAApC;AACA,QAAM,aAAa,GAAG,0BAA0B,CAAC,KAAD,CAAhD;AAEA,EAAA,4BAA4B,CAAC,KAAD,CAA5B;AACA,SAAO,yBAAyB,CAAC,KAAD,EAAQ,aAAR,CAAhC;AACD,CAN+D,CAAzD;AAQP,UAAU,CAAC,WAAX,GAAyB,YAAzB","sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroupProps } from './RadioGroup.types';\nimport { renderRadioGroup_unstable } from './renderRadioGroup';\nimport { useRadioGroup_unstable } from './useRadioGroup';\nimport { useRadioGroupStyles_unstable } from './useRadioGroupStyles';\nimport { useRadioGroupContextValues } from '../../contexts/useRadioGroupContextValues';\n\n/**\n * A RadioGroup component presents a set of options where only one option can be selected.\n */\nexport const RadioGroup: ForwardRefComponent<RadioGroupProps> = React.forwardRef((props, ref) => {\n const state = useRadioGroup_unstable(props, ref);\n const contextValues = useRadioGroupContextValues(state);\n\n useRadioGroupStyles_unstable(state);\n return renderRadioGroup_unstable(state, contextValues);\n});\n\nRadioGroup.displayName = 'RadioGroup';\n"],"sourceRoot":"../src/"}
@@ -1,6 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
- import { RadioGroupContextValue } from '../../contexts/RadioGroupContext';
4
3
  export declare type RadioGroupSlots = {
5
4
  /**
6
5
  * The radio group root.
@@ -33,13 +32,17 @@ export declare type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlot
33
32
  /**
34
33
  * How the radio items are laid out in the group.
35
34
  *
36
- * @defaultvalue vertical
35
+ * @default vertical
37
36
  */
38
37
  layout?: 'vertical' | 'horizontal' | 'horizontalStacked';
39
38
  /**
40
39
  * Disable all Radio items in this group.
41
40
  */
42
41
  disabled?: boolean;
42
+ /**
43
+ * Require all Radio items in this group.
44
+ */
45
+ required?: boolean;
43
46
  };
44
47
  /**
45
48
  * Data for the onChange event for RadioGroup.
@@ -53,6 +56,8 @@ export declare type RadioGroupOnChangeData = {
53
56
  /**
54
57
  * State used in rendering RadioGroup
55
58
  */
56
- export declare type RadioGroupState = ComponentState<RadioGroupSlots> & Required<Pick<RadioGroupProps, 'layout'>> & {
57
- context: RadioGroupContextValue;
59
+ export declare type RadioGroupState = ComponentState<RadioGroupSlots> & Required<Pick<RadioGroupProps, 'layout'>> & Partial<Exclude<RadioGroupProps, 'onChange' | 'layout'>>;
60
+ export declare type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'>;
61
+ export declare type RadioGroupContextValues = {
62
+ radioGroup: RadioGroupContextValue;
58
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RadioGroup.types.js","sourceRoot":"../src/","sources":["components/RadioGroup/RadioGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { RadioGroupContextValue } from '../../contexts/RadioGroupContext';\n\nexport type RadioGroupSlots = {\n /**\n * The radio group root.\n */\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {\n /**\n * The name of this radio group. This name is applied to all Radio items inside this group.\n *\n * If no name is provided, one will be generated so that all of the Radio items have the same name.\n */\n name?: string;\n\n /**\n * The selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n value?: string;\n\n /**\n * The default selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n defaultValue?: string;\n\n /**\n * Callback when the selected Radio item changes.\n */\n onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;\n\n /**\n * How the radio items are laid out in the group.\n *\n * @defaultvalue vertical\n */\n layout?: 'vertical' | 'horizontal' | 'horizontalStacked';\n\n /**\n * Disable all Radio items in this group.\n */\n disabled?: boolean;\n};\n\n/**\n * Data for the onChange event for RadioGroup.\n */\nexport type RadioGroupOnChangeData = {\n /**\n * The value of the newly selected Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering RadioGroup\n */\nexport type RadioGroupState = ComponentState<RadioGroupSlots> &\n Required<Pick<RadioGroupProps, 'layout'>> & {\n context: RadioGroupContextValue;\n };\n"]}
1
+ {"version":3,"file":"RadioGroup.types.js","sourceRoot":"../src/","sources":["components/RadioGroup/RadioGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioGroupSlots = {\n /**\n * The radio group root.\n */\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {\n /**\n * The name of this radio group. This name is applied to all Radio items inside this group.\n *\n * If no name is provided, one will be generated so that all of the Radio items have the same name.\n */\n name?: string;\n\n /**\n * The selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n value?: string;\n\n /**\n * The default selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n defaultValue?: string;\n\n /**\n * Callback when the selected Radio item changes.\n */\n onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;\n\n /**\n * How the radio items are laid out in the group.\n *\n * @default vertical\n */\n layout?: 'vertical' | 'horizontal' | 'horizontalStacked';\n\n /**\n * Disable all Radio items in this group.\n */\n disabled?: boolean;\n\n /**\n * Require all Radio items in this group.\n */\n required?: boolean;\n};\n\n/**\n * Data for the onChange event for RadioGroup.\n */\nexport type RadioGroupOnChangeData = {\n /**\n * The value of the newly selected Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering RadioGroup\n */\nexport type RadioGroupState = ComponentState<RadioGroupSlots> &\n Required<Pick<RadioGroupProps, 'layout'>> &\n Partial<Exclude<RadioGroupProps, 'onChange' | 'layout'>>;\n\nexport type RadioGroupContextValue = Pick<\n RadioGroupProps,\n 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'\n>;\n\nexport type RadioGroupContextValues = {\n radioGroup: RadioGroupContextValue;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { RadioGroupState } from './RadioGroup.types';
1
+ import { RadioGroupContextValues, RadioGroupState } from './RadioGroup.types';
2
2
  /**
3
3
  * Render the final JSX of RadioGroup
4
4
  */
5
- export declare const renderRadioGroup_unstable: (state: RadioGroupState) => JSX.Element;
5
+ export declare const renderRadioGroup_unstable: (state: RadioGroupState, contextValues: RadioGroupContextValues) => JSX.Element;