@fluentui/react-radio 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230322-0439.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.
- package/.swcrc +2 -11
- package/CHANGELOG.json +94 -19
- package/CHANGELOG.md +31 -12
- package/lib/Radio.js +1 -1
- package/lib/RadioGroup.js +1 -1
- package/lib/RadioGroupField.js +1 -1
- package/lib/components/Radio/Radio.js +6 -6
- package/lib/components/Radio/Radio.types.js +1 -1
- package/lib/components/Radio/index.js +5 -5
- package/lib/components/Radio/renderRadio.js +2 -2
- package/lib/components/Radio/useRadio.js +20 -18
- package/lib/components/Radio/useRadio.js.map +1 -1
- package/lib/components/Radio/useRadioStyles.js +10 -10
- package/lib/components/RadioGroup/RadioGroup.js +7 -7
- package/lib/components/RadioGroup/RadioGroup.types.js +1 -1
- package/lib/components/RadioGroup/index.js +5 -5
- package/lib/components/RadioGroup/renderRadioGroup.js +3 -3
- package/lib/components/RadioGroup/useRadioGroup.js +9 -9
- package/lib/components/RadioGroup/useRadioGroupStyles.js +3 -3
- package/lib/components/RadioGroupField/RadioGroupField.js +2 -2
- package/lib/components/RadioGroupField/index.js +1 -1
- package/lib/contexts/RadioGroupContext.js +1 -1
- package/lib/contexts/index.js +2 -2
- package/lib/index.js +4 -4
- package/lib-commonjs/Radio.js.map +1 -1
- package/lib-commonjs/RadioGroup.js.map +1 -1
- package/lib-commonjs/RadioGroupField.js.map +1 -1
- package/lib-commonjs/components/Radio/Radio.js +1 -1
- package/lib-commonjs/components/Radio/Radio.js.map +1 -1
- package/lib-commonjs/components/Radio/Radio.types.js.map +1 -1
- package/lib-commonjs/components/Radio/index.js.map +1 -1
- package/lib-commonjs/components/Radio/renderRadio.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadio.js +15 -13
- package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadioStyles.js +9 -9
- package/lib-commonjs/components/Radio/useRadioStyles.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/RadioGroup.js +1 -1
- package/lib-commonjs/components/RadioGroup/RadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/RadioGroup.types.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/index.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/useRadioGroup.js +9 -9
- package/lib-commonjs/components/RadioGroup/useRadioGroup.js.map +1 -1
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js +2 -2
- package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
- package/lib-commonjs/components/RadioGroupField/RadioGroupField.js.map +1 -1
- package/lib-commonjs/components/RadioGroupField/index.js.map +1 -1
- package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +11 -10
package/.swcrc
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/swcrc",
|
|
3
|
-
"env": {
|
|
4
|
-
"targets": {
|
|
5
|
-
"chrome": "84",
|
|
6
|
-
"edge": "84",
|
|
7
|
-
"firefox": "75",
|
|
8
|
-
"opera": "73",
|
|
9
|
-
"safari": "14.1"
|
|
10
|
-
},
|
|
11
|
-
"bugfixes": true
|
|
12
|
-
},
|
|
13
3
|
"exclude": [
|
|
14
4
|
"/testing",
|
|
15
5
|
"/**/*.cy.ts",
|
|
@@ -32,7 +22,8 @@
|
|
|
32
22
|
"runtime": "classic",
|
|
33
23
|
"useSpread": true
|
|
34
24
|
}
|
|
35
|
-
}
|
|
25
|
+
},
|
|
26
|
+
"target": "es2019"
|
|
36
27
|
},
|
|
37
28
|
"minify": false,
|
|
38
29
|
"sourceMaps": true
|
package/CHANGELOG.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@fluentui/react-radio",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"tag": "@fluentui/react-radio_v0.0.0-nightly-
|
|
7
|
-
"version": "0.0.0-nightly-
|
|
5
|
+
"date": "Wed, 22 Mar 2023 04:46:49 GMT",
|
|
6
|
+
"tag": "@fluentui/react-radio_v0.0.0-nightly-20230322-0439.1",
|
|
7
|
+
"version": "0.0.0-nightly-20230322-0439.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
|
@@ -16,50 +16,125 @@
|
|
|
16
16
|
{
|
|
17
17
|
"author": "beachball",
|
|
18
18
|
"package": "@fluentui/react-radio",
|
|
19
|
-
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-
|
|
20
|
-
"commit": "
|
|
19
|
+
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230322-0439.1",
|
|
20
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"author": "beachball",
|
|
24
24
|
"package": "@fluentui/react-radio",
|
|
25
|
-
"comment": "Bump @fluentui/react-field to v0.0.0-nightly-
|
|
26
|
-
"commit": "
|
|
25
|
+
"comment": "Bump @fluentui/react-field to v0.0.0-nightly-20230322-0439.1",
|
|
26
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"author": "beachball",
|
|
30
30
|
"package": "@fluentui/react-radio",
|
|
31
|
-
"comment": "Bump @fluentui/react-label to v0.0.0-nightly-
|
|
32
|
-
"commit": "
|
|
31
|
+
"comment": "Bump @fluentui/react-label to v0.0.0-nightly-20230322-0439.1",
|
|
32
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"author": "beachball",
|
|
36
36
|
"package": "@fluentui/react-radio",
|
|
37
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
38
|
-
"commit": "
|
|
37
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230322-0439.1",
|
|
38
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"author": "beachball",
|
|
42
42
|
"package": "@fluentui/react-radio",
|
|
43
|
-
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-
|
|
44
|
-
"commit": "
|
|
43
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230322-0439.1",
|
|
44
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"author": "beachball",
|
|
48
48
|
"package": "@fluentui/react-radio",
|
|
49
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
50
|
-
"commit": "
|
|
49
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230322-0439.1",
|
|
50
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"author": "beachball",
|
|
54
54
|
"package": "@fluentui/react-radio",
|
|
55
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
56
|
-
"commit": "
|
|
55
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230322-0439.1",
|
|
56
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"author": "beachball",
|
|
60
60
|
"package": "@fluentui/react-radio",
|
|
61
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
62
|
-
"commit": "
|
|
61
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230322-0439.1",
|
|
62
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"date": "Tue, 21 Mar 2023 21:23:48 GMT",
|
|
69
|
+
"tag": "@fluentui/react-radio_v9.1.5",
|
|
70
|
+
"version": "9.1.5",
|
|
71
|
+
"comments": {
|
|
72
|
+
"patch": [
|
|
73
|
+
{
|
|
74
|
+
"author": "makotom@microsoft.com",
|
|
75
|
+
"package": "@fluentui/react-radio",
|
|
76
|
+
"commit": "7fde5c94869ff9841b142b7ff1d0a3df0ab58f74",
|
|
77
|
+
"comment": "chore: Bumping version of @fluentui/react-icons to ^2.0.196."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "tristan.watanabe@gmail.com",
|
|
81
|
+
"package": "@fluentui/react-radio",
|
|
82
|
+
"commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
|
|
83
|
+
"comment": "fix: add node field to package.json exports map."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "tristan.watanabe@gmail.com",
|
|
87
|
+
"package": "@fluentui/react-radio",
|
|
88
|
+
"commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
|
|
89
|
+
"comment": "chore: migrate to swc transpilation approach."
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"author": "beachball",
|
|
93
|
+
"package": "@fluentui/react-radio",
|
|
94
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.15",
|
|
95
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-radio",
|
|
100
|
+
"comment": "Bump @fluentui/react-field to v9.0.0-alpha.27",
|
|
101
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"author": "beachball",
|
|
105
|
+
"package": "@fluentui/react-radio",
|
|
106
|
+
"comment": "Bump @fluentui/react-label to v9.1.5",
|
|
107
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"author": "beachball",
|
|
111
|
+
"package": "@fluentui/react-radio",
|
|
112
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.3.2",
|
|
113
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"author": "beachball",
|
|
117
|
+
"package": "@fluentui/react-radio",
|
|
118
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.1",
|
|
119
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"author": "beachball",
|
|
123
|
+
"package": "@fluentui/react-radio",
|
|
124
|
+
"comment": "Bump @fluentui/react-theme to v9.1.7",
|
|
125
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"author": "beachball",
|
|
129
|
+
"package": "@fluentui/react-radio",
|
|
130
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.2",
|
|
131
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"author": "beachball",
|
|
135
|
+
"package": "@fluentui/react-radio",
|
|
136
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
|
|
137
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
63
138
|
}
|
|
64
139
|
]
|
|
65
140
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,44 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-radio
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 22 Mar 2023 04:46:49 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20230322-0439.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v0.0.0-nightly-20230322-0439.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.
|
|
9
|
+
Wed, 22 Mar 2023 04:46:49 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.5..@fluentui/react-radio_v0.0.0-nightly-20230322-0439.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
-
- Bump @fluentui/react-context-selector to v0.0.0-nightly-
|
|
16
|
-
- Bump @fluentui/react-field to v0.0.0-nightly-
|
|
17
|
-
- Bump @fluentui/react-label to v0.0.0-nightly-
|
|
18
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
19
|
-
- Bump @fluentui/react-tabster to v0.0.0-nightly-
|
|
20
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
21
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
22
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
15
|
+
- Bump @fluentui/react-context-selector to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
16
|
+
- Bump @fluentui/react-field to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
17
|
+
- Bump @fluentui/react-label to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
18
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
19
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
20
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
21
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
22
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
23
|
+
|
|
24
|
+
## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.5)
|
|
25
|
+
|
|
26
|
+
Tue, 21 Mar 2023 21:23:48 GMT
|
|
27
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.4..@fluentui/react-radio_v9.1.5)
|
|
28
|
+
|
|
29
|
+
### Patches
|
|
30
|
+
|
|
31
|
+
- chore: Bumping version of @fluentui/react-icons to ^2.0.196. ([PR #27100](https://github.com/microsoft/fluentui/pull/27100) by makotom@microsoft.com)
|
|
32
|
+
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
|
|
33
|
+
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
|
|
34
|
+
- Bump @fluentui/react-context-selector to v9.1.15 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
35
|
+
- Bump @fluentui/react-field to v9.0.0-alpha.27 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
36
|
+
- Bump @fluentui/react-label to v9.1.5 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
37
|
+
- Bump @fluentui/react-shared-contexts to v9.3.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
38
|
+
- Bump @fluentui/react-tabster to v9.6.1 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
39
|
+
- Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
40
|
+
- Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
41
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
23
42
|
|
|
24
43
|
## [9.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.4)
|
|
25
44
|
|
package/lib/Radio.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './components/Radio/index';
|
|
2
2
|
//# sourceMappingURL=Radio.js.map
|
package/lib/RadioGroup.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './components/RadioGroup/index';
|
|
2
2
|
//# sourceMappingURL=RadioGroup.js.map
|
package/lib/RadioGroupField.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './components/RadioGroupField/index';
|
|
2
2
|
//# sourceMappingURL=RadioGroupField.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { renderRadio_unstable } from
|
|
3
|
-
import { useRadio_unstable } from
|
|
4
|
-
import { useRadioStyles_unstable } from
|
|
5
|
-
import { useCustomStyleHooks_unstable } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { renderRadio_unstable } from './renderRadio';
|
|
3
|
+
import { useRadio_unstable } from './useRadio';
|
|
4
|
+
import { useRadioStyles_unstable } from './useRadioStyles';
|
|
5
|
+
import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* Radio component is a wrapper for a radio button with a label.
|
|
8
8
|
*/
|
|
@@ -15,5 +15,5 @@ export const Radio = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
15
15
|
useCustomStyles(state);
|
|
16
16
|
return renderRadio_unstable(state);
|
|
17
17
|
});
|
|
18
|
-
Radio.displayName =
|
|
18
|
+
Radio.displayName = 'Radio';
|
|
19
19
|
//# sourceMappingURL=Radio.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
//# sourceMappingURL=Radio.types.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './Radio';
|
|
2
|
+
export * from './Radio.types';
|
|
3
|
+
export * from './renderRadio';
|
|
4
|
+
export * from './useRadio';
|
|
5
|
+
export * from './useRadioStyles';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { CircleFilled } from
|
|
3
|
-
import { Label } from
|
|
4
|
-
import { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from
|
|
5
|
-
import { useRadioGroupContext_unstable } from
|
|
6
|
-
import { useFocusWithin } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CircleFilled } from '@fluentui/react-icons';
|
|
3
|
+
import { Label } from '@fluentui/react-label';
|
|
4
|
+
import { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';
|
|
5
|
+
import { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';
|
|
6
|
+
import { useFocusWithin } from '@fluentui/react-tabster';
|
|
7
7
|
/**
|
|
8
8
|
* Create the state required to render Radio.
|
|
9
9
|
*
|
|
@@ -24,15 +24,15 @@ export const useRadio_unstable = (props, ref) => {
|
|
|
24
24
|
name = nameGroup,
|
|
25
25
|
checked = value !== undefined ? value === props.value : undefined,
|
|
26
26
|
defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,
|
|
27
|
-
labelPosition = layout ===
|
|
27
|
+
labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',
|
|
28
28
|
disabled = disabledGroup,
|
|
29
29
|
required = requiredGroup,
|
|
30
30
|
onChange
|
|
31
31
|
} = props;
|
|
32
32
|
const nativeProps = getPartitionedNativeProps({
|
|
33
33
|
props,
|
|
34
|
-
primarySlotTagName:
|
|
35
|
-
excludedPropNames: [
|
|
34
|
+
primarySlotTagName: 'input',
|
|
35
|
+
excludedPropNames: ['checked', 'defaultChecked', 'onChange']
|
|
36
36
|
});
|
|
37
37
|
const root = resolveShorthand(props.root, {
|
|
38
38
|
required: true,
|
|
@@ -45,8 +45,8 @@ export const useRadio_unstable = (props, ref) => {
|
|
|
45
45
|
required: true,
|
|
46
46
|
defaultProps: {
|
|
47
47
|
ref,
|
|
48
|
-
type:
|
|
49
|
-
id: useId(
|
|
48
|
+
type: 'radio',
|
|
49
|
+
id: useId('radio-', nativeProps.primary.id),
|
|
50
50
|
name,
|
|
51
51
|
checked,
|
|
52
52
|
defaultChecked,
|
|
@@ -55,9 +55,11 @@ export const useRadio_unstable = (props, ref) => {
|
|
|
55
55
|
...nativeProps.primary
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
-
input.onChange = mergeCallbacks(input.onChange, ev =>
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
input.onChange = mergeCallbacks(input.onChange, ev => {
|
|
59
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
|
|
60
|
+
value: ev.currentTarget.value
|
|
61
|
+
});
|
|
62
|
+
});
|
|
61
63
|
const label = resolveShorthand(props.label, {
|
|
62
64
|
defaultProps: {
|
|
63
65
|
htmlFor: input.id,
|
|
@@ -67,17 +69,17 @@ export const useRadio_unstable = (props, ref) => {
|
|
|
67
69
|
const indicator = resolveShorthand(props.indicator, {
|
|
68
70
|
required: true,
|
|
69
71
|
defaultProps: {
|
|
70
|
-
|
|
72
|
+
'aria-hidden': true,
|
|
71
73
|
children: /*#__PURE__*/React.createElement(CircleFilled, null)
|
|
72
74
|
}
|
|
73
75
|
});
|
|
74
76
|
return {
|
|
75
77
|
labelPosition,
|
|
76
78
|
components: {
|
|
77
|
-
root:
|
|
78
|
-
input:
|
|
79
|
+
root: 'span',
|
|
80
|
+
input: 'input',
|
|
79
81
|
label: Label,
|
|
80
|
-
indicator:
|
|
82
|
+
indicator: 'div'
|
|
81
83
|
},
|
|
82
84
|
root,
|
|
83
85
|
input,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","CircleFilled","Label","getPartitionedNativeProps","mergeCallbacks","resolveShorthand","useId","useRadioGroupContext_unstable","useFocusWithin","useRadio_unstable","props","ref","nameGroup","ctx","name","value","defaultValue","disabledGroup","disabled","layout","requiredGroup","required","checked","undefined","defaultChecked","labelPosition","onChange","nativeProps","primarySlotTagName","excludedPropNames","root","defaultProps","input","type","id","primary","ev","currentTarget","label","htmlFor","indicator","children","createElement","components"],"sources":["../../../src/components/Radio/useRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\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 = useRadioGroupContext_unstable(ctx => ctx.name);\n const value = useRadioGroupContext_unstable(ctx => ctx.value);\n const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);\n const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);\n const layout = useRadioGroupContext_unstable(ctx => ctx.layout);\n const requiredGroup = useRadioGroupContext_unstable(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 === 'horizontal-stacked' ? '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: {\n ref: useFocusWithin<HTMLSpanElement>(),\n ...nativeProps.root,\n },\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 = mergeCallbacks(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 lab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cxB,yBAAA,CAA0B;IAC5CO,KAAA;IACAkB,kBAAA,EAAoB;IACpBC,iBAAA,EAAmB,CAAC,WAAW,kBAAkB;EACnD;EAEA,MAAMC,IAAA,GAAOzB,gBAAA,CAAiBK,KAAA,CAAMoB,IAAI,EAAE;IACxCT,QAAA,EAAU,IAAI;IACdU,YAAA,EAAc;MACZpB,GAAA,EAAKH,cAAA;MACL,GAAGmB,WAAA,CAAYG;IACjB;EACF;EAEA,MAAME,KAAA,GAAQ3B,gBAAA,CAAiBK,KAAA,CAAMsB,KAAK,EAAE;IAC1CX,QAAA,EAAU,IAAI;IACdU,YAAA,EAAc;MACZpB,GAAA;MACAsB,IAAA,EAAM;MACNC,EAAA,EAAI5B,KAAA,CAAM,UAAUqB,WAAA,CAAYQ,OAAO,CAACD,EAAE;MAC1CpB,IAAA;MACAQ,OAAA;MACAE,cAAA;MACAN,QAAA;MACAG,QAAA;MACA,GAAGM,WAAA,CAAYQ;IACjB;EACF;EAEAH,KAAA,CAAMN,QAAQ,GAAGtB,cAAA,CAAe4B,KAAA,CAAMN,QAAQ,EAAEU,EAAA,
|
|
1
|
+
{"version":3,"names":["React","CircleFilled","Label","getPartitionedNativeProps","mergeCallbacks","resolveShorthand","useId","useRadioGroupContext_unstable","useFocusWithin","useRadio_unstable","props","ref","nameGroup","ctx","name","value","defaultValue","disabledGroup","disabled","layout","requiredGroup","required","checked","undefined","defaultChecked","labelPosition","onChange","nativeProps","primarySlotTagName","excludedPropNames","root","defaultProps","input","type","id","primary","ev","currentTarget","label","htmlFor","indicator","children","createElement","components"],"sources":["../../../src/components/Radio/useRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\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 = useRadioGroupContext_unstable(ctx => ctx.name);\n const value = useRadioGroupContext_unstable(ctx => ctx.value);\n const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);\n const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);\n const layout = useRadioGroupContext_unstable(ctx => ctx.layout);\n const requiredGroup = useRadioGroupContext_unstable(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 === 'horizontal-stacked' ? '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: {\n ref: useFocusWithin<HTMLSpanElement>(),\n ...nativeProps.root,\n },\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 = mergeCallbacks(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,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AAA;IACAE,KAAA;IACAM,KAAA;IACAE;EACF;AACF"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { createFocusOutlineStyle } from
|
|
2
|
-
import { tokens } from
|
|
3
|
-
import { __resetStyles, __styles, mergeClasses, shorthands } from
|
|
1
|
+
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
|
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
|
3
|
+
import { __resetStyles, __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
4
4
|
export const radioClassNames = {
|
|
5
|
-
root:
|
|
6
|
-
indicator:
|
|
7
|
-
input:
|
|
8
|
-
label:
|
|
5
|
+
root: 'fui-Radio',
|
|
6
|
+
indicator: 'fui-Radio__indicator',
|
|
7
|
+
input: 'fui-Radio__input',
|
|
8
|
+
label: 'fui-Radio__label'
|
|
9
9
|
};
|
|
10
10
|
// The indicator size is used by the indicator and label styles
|
|
11
|
-
const indicatorSize =
|
|
11
|
+
const indicatorSize = '16px';
|
|
12
12
|
const useRootBaseClassName = /*#__PURE__*/__resetStyles("r18vxbm9", "r1631i6s", [".r18vxbm9{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}", ".r18vxbm9:focus{outline-style:none;}", ".r18vxbm9:focus-visible{outline-style:none;}", ".r18vxbm9[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}", ".r18vxbm9[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;left:-2px;right:-2px;}", ".r1631i6s{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}", ".r1631i6s:focus{outline-style:none;}", ".r1631i6s:focus-visible{outline-style:none;}", ".r1631i6s[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}", ".r1631i6s[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}"]);
|
|
13
13
|
const useRootStyles = /*#__PURE__*/__styles({
|
|
14
14
|
vertical: {
|
|
@@ -58,10 +58,10 @@ export const useRadioStyles_unstable = state => {
|
|
|
58
58
|
} = state;
|
|
59
59
|
const rootBaseClassName = useRootBaseClassName();
|
|
60
60
|
const rootStyles = useRootStyles();
|
|
61
|
-
state.root.className = mergeClasses(radioClassNames.root, rootBaseClassName, labelPosition ===
|
|
61
|
+
state.root.className = mergeClasses(radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);
|
|
62
62
|
const inputBaseClassName = useInputBaseClassName();
|
|
63
63
|
const inputStyles = useInputStyles();
|
|
64
|
-
state.input.className = mergeClasses(radioClassNames.input, inputBaseClassName, labelPosition ===
|
|
64
|
+
state.input.className = mergeClasses(radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.input.className);
|
|
65
65
|
const indicatorBaseClassName = useIndicatorBaseClassName();
|
|
66
66
|
state.indicator.className = mergeClasses(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);
|
|
67
67
|
const labelStyles = useLabelStyles();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { renderRadioGroup_unstable } from
|
|
3
|
-
import { useRadioGroup_unstable } from
|
|
4
|
-
import { useRadioGroupStyles_unstable } from
|
|
5
|
-
import { useRadioGroupContextValues } from
|
|
6
|
-
import { useCustomStyleHooks_unstable } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { renderRadioGroup_unstable } from './renderRadioGroup';
|
|
3
|
+
import { useRadioGroup_unstable } from './useRadioGroup';
|
|
4
|
+
import { useRadioGroupStyles_unstable } from './useRadioGroupStyles';
|
|
5
|
+
import { useRadioGroupContextValues } from '../../contexts/useRadioGroupContextValues';
|
|
6
|
+
import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
|
7
7
|
/**
|
|
8
8
|
* A RadioGroup component presents a set of options where only one option can be selected.
|
|
9
9
|
*/
|
|
@@ -17,5 +17,5 @@ export const RadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
17
17
|
useCustomStyles(state);
|
|
18
18
|
return renderRadioGroup_unstable(state, contextValues);
|
|
19
19
|
});
|
|
20
|
-
RadioGroup.displayName =
|
|
20
|
+
RadioGroup.displayName = 'RadioGroup';
|
|
21
21
|
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import * as React from
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
//# sourceMappingURL=RadioGroup.types.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './RadioGroup';
|
|
2
|
+
export * from './RadioGroup.types';
|
|
3
|
+
export * from './renderRadioGroup';
|
|
4
|
+
export * from './useRadioGroup';
|
|
5
|
+
export * from './useRadioGroupStyles';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { getSlots } from
|
|
3
|
-
import { RadioGroupContext } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
|
3
|
+
import { RadioGroupContext } from '../../contexts/RadioGroupContext';
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of RadioGroup
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { getNativeElementProps, isHTMLElement, useEventCallback, useId } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getNativeElementProps, isHTMLElement, useEventCallback, useId } from '@fluentui/react-utilities';
|
|
3
3
|
/**
|
|
4
4
|
* Create the state required to render RadioGroup.
|
|
5
5
|
*
|
|
@@ -10,13 +10,13 @@ import { getNativeElementProps, isHTMLElement, useEventCallback, useId } from "@
|
|
|
10
10
|
* @param ref - reference to root HTMLElement of RadioGroup
|
|
11
11
|
*/
|
|
12
12
|
export const useRadioGroup_unstable = (props, ref) => {
|
|
13
|
-
const generatedName = useId(
|
|
13
|
+
const generatedName = useId('radiogroup-');
|
|
14
14
|
const {
|
|
15
15
|
name = generatedName,
|
|
16
16
|
value,
|
|
17
17
|
defaultValue,
|
|
18
18
|
disabled,
|
|
19
|
-
layout =
|
|
19
|
+
layout = 'vertical',
|
|
20
20
|
onChange,
|
|
21
21
|
required
|
|
22
22
|
} = props;
|
|
@@ -28,16 +28,16 @@ export const useRadioGroup_unstable = (props, ref) => {
|
|
|
28
28
|
disabled,
|
|
29
29
|
required,
|
|
30
30
|
components: {
|
|
31
|
-
root:
|
|
31
|
+
root: 'div'
|
|
32
32
|
},
|
|
33
33
|
root: {
|
|
34
34
|
ref,
|
|
35
|
-
role:
|
|
36
|
-
...getNativeElementProps(
|
|
35
|
+
role: 'radiogroup',
|
|
36
|
+
...getNativeElementProps('div', props, /*excludedPropNames:*/['onChange', 'name']),
|
|
37
37
|
onChange: useEventCallback(ev => {
|
|
38
38
|
if (onChange && isHTMLElement(ev.target, {
|
|
39
|
-
constructorName:
|
|
40
|
-
}) && ev.target.type ===
|
|
39
|
+
constructorName: 'HTMLInputElement'
|
|
40
|
+
}) && ev.target.type === 'radio') {
|
|
41
41
|
onChange(ev, {
|
|
42
42
|
value: ev.target.value
|
|
43
43
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { __styles, mergeClasses } from
|
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
|
2
2
|
export const radioGroupClassNames = {
|
|
3
|
-
root:
|
|
3
|
+
root: 'fui-RadioGroup'
|
|
4
4
|
};
|
|
5
5
|
const useStyles = /*#__PURE__*/__styles({
|
|
6
6
|
root: {
|
|
@@ -18,6 +18,6 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
18
18
|
*/
|
|
19
19
|
export const useRadioGroupStyles_unstable = state => {
|
|
20
20
|
const styles = useStyles();
|
|
21
|
-
state.root.className = mergeClasses(radioGroupClassNames.root, styles.root, state.layout ===
|
|
21
|
+
state.root.className = mergeClasses(radioGroupClassNames.root, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=useRadioGroupStyles.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* eslint-disable deprecation/deprecation */import { getDeprecatedFieldClassNames, makeDeprecatedField } from
|
|
2
|
-
import { RadioGroup, radioGroupClassNames } from
|
|
1
|
+
/* eslint-disable deprecation/deprecation */import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
|
|
2
|
+
import { RadioGroup, radioGroupClassNames } from '../../RadioGroup';
|
|
3
3
|
/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
|
|
4
4
|
export const radioGroupFieldClassNames = /*#__PURE__*/getDeprecatedFieldClassNames(radioGroupClassNames.root);
|
|
5
5
|
/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './RadioGroupField';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext, useContextSelector } from
|
|
1
|
+
import { createContext, useContextSelector } from '@fluentui/react-context-selector';
|
|
2
2
|
/**
|
|
3
3
|
* RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
|
|
4
4
|
*/
|
package/lib/contexts/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './RadioGroupContext';
|
|
2
|
+
export * from './useRadioGroupContextValues';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { RadioGroup, radioGroupClassNames, renderRadioGroup_unstable, useRadioGroupStyles_unstable, useRadioGroup_unstable } from
|
|
2
|
-
export { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from
|
|
3
|
-
export { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable } from
|
|
1
|
+
export { RadioGroup, radioGroupClassNames, renderRadioGroup_unstable, useRadioGroupStyles_unstable, useRadioGroup_unstable } from './RadioGroup';
|
|
2
|
+
export { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';
|
|
3
|
+
export { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable } from './contexts/index';
|
|
4
4
|
// eslint-disable-next-line deprecation/deprecation
|
|
5
|
-
export { RadioGroupField as RadioGroupField_unstable, radioGroupFieldClassNames } from
|
|
5
|
+
export { RadioGroupField as RadioGroupField_unstable, radioGroupFieldClassNames } from './RadioGroupField';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/Radio.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../lib/Radio.js"],"sourcesContent":["export * from './components/Radio/index';\n//# sourceMappingURL=Radio.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/RadioGroup.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../lib/RadioGroup.js"],"sourcesContent":["export * from './components/RadioGroup/index';\n//# sourceMappingURL=RadioGroup.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/RadioGroupField.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../lib/RadioGroupField.js"],"sourcesContent":["export * from './components/RadioGroupField/index';\n//# sourceMappingURL=RadioGroupField.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,2CAA2C"}
|
|
@@ -19,6 +19,6 @@ const Radio = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
19
19
|
useCustomStyles(state);
|
|
20
20
|
return (0, _renderRadio.renderRadio_unstable)(state);
|
|
21
21
|
});
|
|
22
|
-
Radio.displayName =
|
|
22
|
+
Radio.displayName = 'Radio'; //# sourceMappingURL=Radio.js.map
|
|
23
23
|
|
|
24
24
|
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Radio/Radio.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Radio/Radio.js"],"sourcesContent":["import * as React from 'react';\nimport { renderRadio_unstable } from './renderRadio';\nimport { useRadio_unstable } from './useRadio';\nimport { useRadioStyles_unstable } from './useRadioStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Radio component is a wrapper for a radio button with a label.\n */\nexport const Radio = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useRadio_unstable(props, ref);\n useRadioStyles_unstable(state);\n const {\n useRadioStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderRadio_unstable(state);\n});\nRadio.displayName = 'Radio';\n//# sourceMappingURL=Radio.js.map"],"names":["Radio","React","forwardRef","props","ref","state","useRadio_unstable","useRadioStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderRadio_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;6BACc;0BACH;gCACM;qCACK;AAItC,MAAMA,QAAQ,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACjE,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvCG,IAAAA,uCAAuB,EAACF;IACxB,MAAM,EACJE,yBAAyBC,gBAAe,EACzC,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,iCAAoB,EAACL;AAC9B;AACAL,MAAMW,WAAW,GAAG,SACpB,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Radio/Radio.types.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Radio/Radio.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=Radio.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,uCAAuC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Radio/index.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Radio/index.js"],"sourcesContent":["export * from './Radio';\nexport * from './Radio.types';\nexport * from './renderRadio';\nexport * from './useRadio';\nexport * from './useRadioStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Radio/renderRadio.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Radio/renderRadio.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Radio\n */\nexport const renderRadio_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(slots.input, slotProps.input), /*#__PURE__*/React.createElement(slots.indicator, slotProps.indicator), slots.label && /*#__PURE__*/React.createElement(slots.label, slotProps.label));\n};\n//# sourceMappingURL=renderRadio.js.map"],"names":["renderRadio_unstable","state","slots","slotProps","getSlots","React","createElement","root","input","indicator","label"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,uBAAuBC,CAAAA,QAAS;IAC3C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAE,WAAW,GAAEF,OAAMC,aAAa,CAACJ,MAAMM,KAAK,EAAEL,UAAUK,KAAK,GAAG,WAAW,GAAEH,OAAMC,aAAa,CAACJ,MAAMO,SAAS,EAAEN,UAAUM,SAAS,GAAGP,MAAMQ,KAAK,IAAI,WAAW,GAAEL,OAAMC,aAAa,CAACJ,MAAMQ,KAAK,EAAEP,UAAUO,KAAK;AAC1R,GACA,uCAAuC"}
|
|
@@ -20,14 +20,14 @@ const useRadio_unstable = (props, ref)=>{
|
|
|
20
20
|
const disabledGroup = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.disabled);
|
|
21
21
|
const layout = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.layout);
|
|
22
22
|
const requiredGroup = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.required);
|
|
23
|
-
const { name =nameGroup , checked =value !== undefined ? value === props.value : undefined , defaultChecked =defaultValue !== undefined ? defaultValue === props.value : undefined , labelPosition =layout ===
|
|
23
|
+
const { name =nameGroup , checked =value !== undefined ? value === props.value : undefined , defaultChecked =defaultValue !== undefined ? defaultValue === props.value : undefined , labelPosition =layout === 'horizontal-stacked' ? 'below' : 'after' , disabled =disabledGroup , required =requiredGroup , onChange } = props;
|
|
24
24
|
const nativeProps = (0, _reactUtilities.getPartitionedNativeProps)({
|
|
25
25
|
props,
|
|
26
|
-
primarySlotTagName:
|
|
26
|
+
primarySlotTagName: 'input',
|
|
27
27
|
excludedPropNames: [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
'checked',
|
|
29
|
+
'defaultChecked',
|
|
30
|
+
'onChange'
|
|
31
31
|
]
|
|
32
32
|
});
|
|
33
33
|
const root = (0, _reactUtilities.resolveShorthand)(props.root, {
|
|
@@ -41,8 +41,8 @@ const useRadio_unstable = (props, ref)=>{
|
|
|
41
41
|
required: true,
|
|
42
42
|
defaultProps: {
|
|
43
43
|
ref,
|
|
44
|
-
type:
|
|
45
|
-
id: (0, _reactUtilities.useId)(
|
|
44
|
+
type: 'radio',
|
|
45
|
+
id: (0, _reactUtilities.useId)('radio-', nativeProps.primary.id),
|
|
46
46
|
name,
|
|
47
47
|
checked,
|
|
48
48
|
defaultChecked,
|
|
@@ -51,9 +51,11 @@ const useRadio_unstable = (props, ref)=>{
|
|
|
51
51
|
...nativeProps.primary
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
|
-
input.onChange = (0, _reactUtilities.mergeCallbacks)(input.onChange, (ev)=>
|
|
54
|
+
input.onChange = (0, _reactUtilities.mergeCallbacks)(input.onChange, (ev)=>{
|
|
55
|
+
return onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
|
|
55
56
|
value: ev.currentTarget.value
|
|
56
|
-
})
|
|
57
|
+
});
|
|
58
|
+
});
|
|
57
59
|
const label = (0, _reactUtilities.resolveShorthand)(props.label, {
|
|
58
60
|
defaultProps: {
|
|
59
61
|
htmlFor: input.id,
|
|
@@ -63,17 +65,17 @@ const useRadio_unstable = (props, ref)=>{
|
|
|
63
65
|
const indicator = (0, _reactUtilities.resolveShorthand)(props.indicator, {
|
|
64
66
|
required: true,
|
|
65
67
|
defaultProps: {
|
|
66
|
-
|
|
68
|
+
'aria-hidden': true,
|
|
67
69
|
children: /*#__PURE__*/ _react.createElement(_reactIcons.CircleFilled, null)
|
|
68
70
|
}
|
|
69
71
|
});
|
|
70
72
|
return {
|
|
71
73
|
labelPosition,
|
|
72
74
|
components: {
|
|
73
|
-
root:
|
|
74
|
-
input:
|
|
75
|
+
root: 'span',
|
|
76
|
+
input: 'input',
|
|
75
77
|
label: _reactLabel.Label,
|
|
76
|
-
indicator:
|
|
78
|
+
indicator: 'div'
|
|
77
79
|
},
|
|
78
80
|
root,
|
|
79
81
|
input,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Radio/useRadio.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Radio/useRadio.js"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\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, ref) => {\n const nameGroup = useRadioGroupContext_unstable(ctx => ctx.name);\n const value = useRadioGroupContext_unstable(ctx => ctx.value);\n const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);\n const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);\n const layout = useRadioGroupContext_unstable(ctx => ctx.layout);\n const requiredGroup = useRadioGroupContext_unstable(ctx => ctx.required);\n const {\n name = nameGroup,\n checked = value !== undefined ? value === props.value : undefined,\n defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,\n labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = disabledGroup,\n required = requiredGroup,\n onChange\n } = props;\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange']\n });\n const root = resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n ref: useFocusWithin(),\n ...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 input.onChange = mergeCallbacks(input.onChange, ev => {\n return onChange === null || onChange === void 0 ? void 0 : onChange(ev, {\n value: ev.currentTarget.value\n });\n });\n const label = resolveShorthand(props.label, {\n defaultProps: {\n htmlFor: input.id,\n disabled\n }\n });\n const indicator = resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: /*#__PURE__*/React.createElement(CircleFilled, null)\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//# sourceMappingURL=useRadio.js.map"],"names":["useRadio_unstable","props","ref","nameGroup","useRadioGroupContext_unstable","ctx","name","value","defaultValue","disabledGroup","disabled","layout","requiredGroup","required","checked","undefined","defaultChecked","labelPosition","onChange","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","root","resolveShorthand","defaultProps","useFocusWithin","input","type","id","useId","primary","mergeCallbacks","ev","currentTarget","label","htmlFor","indicator","children","React","createElement","CircleFilled","components","Label"],"mappings":";;;;+BAeaA;;aAAAA;;;6DAfU;4BACM;4BACP;gCAC6D;mCACrC;8BACf;AAUxB,MAAMA,oBAAoB,CAACC,OAAOC,MAAQ;IAC/C,MAAMC,YAAYC,IAAAA,gDAA6B,EAACC,CAAAA,MAAOA,IAAIC,IAAI;IAC/D,MAAMC,QAAQH,IAAAA,gDAA6B,EAACC,CAAAA,MAAOA,IAAIE,KAAK;IAC5D,MAAMC,eAAeJ,IAAAA,gDAA6B,EAACC,CAAAA,MAAOA,IAAIG,YAAY;IAC1E,MAAMC,gBAAgBL,IAAAA,gDAA6B,EAACC,CAAAA,MAAOA,IAAIK,QAAQ;IACvE,MAAMC,SAASP,IAAAA,gDAA6B,EAACC,CAAAA,MAAOA,IAAIM,MAAM;IAC9D,MAAMC,gBAAgBR,IAAAA,gDAA6B,EAACC,CAAAA,MAAOA,IAAIQ,QAAQ;IACvE,MAAM,EACJP,MAAOH,UAAS,EAChBW,SAAUP,UAAUQ,YAAYR,UAAUN,MAAMM,KAAK,GAAGQ,SAAS,CAAA,EACjEC,gBAAiBR,iBAAiBO,YAAYP,iBAAiBP,MAAMM,KAAK,GAAGQ,SAAS,CAAA,EACtFE,eAAgBN,WAAW,uBAAuB,UAAU,OAAO,CAAA,EACnED,UAAWD,cAAa,EACxBI,UAAWD,cAAa,EACxBM,SAAQ,EACT,GAAGjB;IACJ,MAAMkB,cAAcC,IAAAA,yCAAyB,EAAC;QAC5CnB;QACAoB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAW;YAAkB;SAAW;IAC9D;IACA,MAAMC,OAAOC,IAAAA,gCAAgB,EAACvB,MAAMsB,IAAI,EAAE;QACxCV,UAAU,IAAI;QACdY,cAAc;YACZvB,KAAKwB,IAAAA,4BAAc;YACnB,GAAGP,YAAYI,IAAI;QACrB;IACF;IACA,MAAMI,QAAQH,IAAAA,gCAAgB,EAACvB,MAAM0B,KAAK,EAAE;QAC1Cd,UAAU,IAAI;QACdY,cAAc;YACZvB;YACA0B,MAAM;YACNC,IAAIC,IAAAA,qBAAK,EAAC,UAAUX,YAAYY,OAAO,CAACF,EAAE;YAC1CvB;YACAQ;YACAE;YACAN;YACAG;YACA,GAAGM,YAAYY,OAAO;QACxB;IACF;IACAJ,MAAMT,QAAQ,GAAGc,IAAAA,8BAAc,EAACL,MAAMT,QAAQ,EAAEe,CAAAA,KAAM;QACpD,OAAOf,aAAa,IAAI,IAAIA,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASe,IAAI;YACtE1B,OAAO0B,GAAGC,aAAa,CAAC3B,KAAK;QAC/B,EAAE;IACJ;IACA,MAAM4B,QAAQX,IAAAA,gCAAgB,EAACvB,MAAMkC,KAAK,EAAE;QAC1CV,cAAc;YACZW,SAAST,MAAME,EAAE;YACjBnB;QACF;IACF;IACA,MAAM2B,YAAYb,IAAAA,gCAAgB,EAACvB,MAAMoC,SAAS,EAAE;QAClDxB,UAAU,IAAI;QACdY,cAAc;YACZ,eAAe,IAAI;YACnBa,UAAU,WAAW,GAAEC,OAAMC,aAAa,CAACC,wBAAY,EAAE,IAAI;QAC/D;IACF;IACA,OAAO;QACLxB;QACAyB,YAAY;YACVnB,MAAM;YACNI,OAAO;YACPQ,OAAOQ,iBAAK;YACZN,WAAW;QACb;QACAd;QACAI;QACAQ;QACAE;IACF;AACF,GACA,oCAAoC"}
|
|
@@ -14,24 +14,24 @@ _export(exports, {
|
|
|
14
14
|
});
|
|
15
15
|
const _react = require("@griffel/react");
|
|
16
16
|
const radioClassNames = {
|
|
17
|
-
root:
|
|
18
|
-
indicator:
|
|
19
|
-
input:
|
|
20
|
-
label:
|
|
17
|
+
root: 'fui-Radio',
|
|
18
|
+
indicator: 'fui-Radio__indicator',
|
|
19
|
+
input: 'fui-Radio__input',
|
|
20
|
+
label: 'fui-Radio__label'
|
|
21
21
|
};
|
|
22
22
|
// The indicator size is used by the indicator and label styles
|
|
23
|
-
const indicatorSize =
|
|
23
|
+
const indicatorSize = '16px';
|
|
24
24
|
const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r18vxbm9", "r1631i6s", [
|
|
25
25
|
".r18vxbm9{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}",
|
|
26
26
|
".r18vxbm9:focus{outline-style:none;}",
|
|
27
27
|
".r18vxbm9:focus-visible{outline-style:none;}",
|
|
28
28
|
".r18vxbm9[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}",
|
|
29
|
-
|
|
29
|
+
".r18vxbm9[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;left:-2px;right:-2px;}",
|
|
30
30
|
".r1631i6s{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}",
|
|
31
31
|
".r1631i6s:focus{outline-style:none;}",
|
|
32
32
|
".r1631i6s:focus-visible{outline-style:none;}",
|
|
33
33
|
".r1631i6s[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}",
|
|
34
|
-
|
|
34
|
+
".r1631i6s[data-fui-focus-within]:focus-within::after{content:\"\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}"
|
|
35
35
|
]);
|
|
36
36
|
const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
37
37
|
vertical: {
|
|
@@ -138,10 +138,10 @@ const useRadioStyles_unstable = (state)=>{
|
|
|
138
138
|
const { labelPosition } = state;
|
|
139
139
|
const rootBaseClassName = useRootBaseClassName();
|
|
140
140
|
const rootStyles = useRootStyles();
|
|
141
|
-
state.root.className = (0, _react.mergeClasses)(radioClassNames.root, rootBaseClassName, labelPosition ===
|
|
141
|
+
state.root.className = (0, _react.mergeClasses)(radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);
|
|
142
142
|
const inputBaseClassName = useInputBaseClassName();
|
|
143
143
|
const inputStyles = useInputStyles();
|
|
144
|
-
state.input.className = (0, _react.mergeClasses)(radioClassNames.input, inputBaseClassName, labelPosition ===
|
|
144
|
+
state.input.className = (0, _react.mergeClasses)(radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.input.className);
|
|
145
145
|
const indicatorBaseClassName = useIndicatorBaseClassName();
|
|
146
146
|
state.indicator.className = (0, _react.mergeClasses)(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);
|
|
147
147
|
const labelStyles = useLabelStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Radio/useRadioStyles.js"],"sourcesContent":["import { createFocusOutlineStyle } from \"@fluentui/react-tabster\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { __resetStyles, __styles, mergeClasses, shorthands } from \"@griffel/react\";\nexport const radioClassNames = {\n root: \"fui-Radio\",\n indicator: \"fui-Radio__indicator\",\n input: \"fui-Radio__input\",\n label: \"fui-Radio__label\"\n};\n// The indicator size is used by the indicator and label styles\nconst indicatorSize = \"16px\";\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r18vxbm9\", \"r1631i6s\", [\".r18vxbm9{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}\", \".r18vxbm9:focus{outline-style:none;}\", \".r18vxbm9:focus-visible{outline-style:none;}\", \".r18vxbm9[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}\", \".r18vxbm9[data-fui-focus-within]:focus-within::after{content:\\\"\\\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;left:-2px;right:-2px;}\", \".r1631i6s{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}\", \".r1631i6s:focus{outline-style:none;}\", \".r1631i6s:focus-visible{outline-style:none;}\", \".r1631i6s[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}\", \".r1631i6s[data-fui-focus-within]:focus-within::after{content:\\\"\\\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}\"]);\nconst useRootStyles = /*#__PURE__*/__styles({\n vertical: {\n Beiy3e4: \"f1vx9l62\",\n Bt984gj: \"f122n59\"\n }\n}, {\n d: [\".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\", \".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}\"]\n});\nconst useInputBaseClassName = /*#__PURE__*/__resetStyles(\"r9gx1vl\", \"r1uk1i2c\", [\".r9gx1vl{position:absolute;left:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}\", \".r9gx1vl:enabled{cursor:pointer;}\", \".r9gx1vl:enabled~.fui-Radio__label{cursor:pointer;}\", \".r9gx1vl:not(:checked)~.fui-Radio__indicator>*{opacity:0;}\", \".r9gx1vl:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}\", \".r9gx1vl:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}\", \".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}\", \".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}\", \".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}\", \".r9gx1vl:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r9gx1vl:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}\", \".r9gx1vl:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}\", \".r9gx1vl:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}\", \".r9gx1vl:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}\", \".r9gx1vl:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}\", \".r1uk1i2c{position:absolute;right:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}\", \".r1uk1i2c:enabled{cursor:pointer;}\", \".r1uk1i2c:enabled~.fui-Radio__label{cursor:pointer;}\", \".r1uk1i2c:not(:checked)~.fui-Radio__indicator>*{opacity:0;}\", \".r1uk1i2c:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}\", \".r1uk1i2c:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}\", \".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}\", \".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}\", \".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}\", \".r1uk1i2c:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r1uk1i2c:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}\", \".r1uk1i2c:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}\", \".r1uk1i2c:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}\", \".r1uk1i2c:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}\", \".r1uk1i2c:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}\"]);\nconst useInputStyles = /*#__PURE__*/__styles({\n below: {\n a9b677: \"fly5x3f\",\n Bqenvij: \"f1je6zif\"\n }\n}, {\n d: [\".fly5x3f{width:100%;}\", \".f1je6zif{height:calc(16px + 2 * var(--spacingVerticalS));}\"]\n});\nconst useIndicatorBaseClassName = /*#__PURE__*/__resetStyles(\"rid4516\", null, [\".rid4516{width:16px;height:16px;font-size:12px;box-sizing:border-box;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;overflow:hidden;border:var(--strokeWidthThin) solid;border-radius:var(--borderRadiusCircular);margin:var(--spacingVerticalS) var(--spacingHorizontalS);fill:currentColor;pointer-events:none;}\"]);\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = /*#__PURE__*/__styles({\n base: {\n qb2dma: \"f7nlbp4\",\n z8tnut: \"f1kwiid1\",\n z189sj: [\"f1vdfbxk\", \"f1f5gg8d\"],\n Byoj8tv: \"f5b47ha\",\n uwmqm3: [\"f1f5gg8d\", \"f1vdfbxk\"]\n },\n after: {\n uwmqm3: [\"fruq291\", \"f7x41pl\"],\n B6of3ja: \"fjzwpt6\",\n jrapky: \"fh6j2fo\"\n },\n below: {\n z8tnut: \"f1ywm7hm\",\n fsow6f: \"f17mccla\"\n }\n}, {\n d: [\".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}\", \".f1kwiid1{padding-top:var(--spacingVerticalS);}\", \".f1vdfbxk{padding-right:var(--spacingHorizontalS);}\", \".f1f5gg8d{padding-left:var(--spacingHorizontalS);}\", \".f5b47ha{padding-bottom:var(--spacingVerticalS);}\", \".fruq291{padding-left:var(--spacingHorizontalXS);}\", \".f7x41pl{padding-right:var(--spacingHorizontalXS);}\", \".fjzwpt6{margin-top:calc((16px - var(--lineHeightBase300)) / 2);}\", \".fh6j2fo{margin-bottom:calc((16px - var(--lineHeightBase300)) / 2);}\", \".f1ywm7hm{padding-top:var(--spacingVerticalXS);}\", \".f17mccla{text-align:center;}\"]\n});\n/**\n * Apply styling to the Radio slots based on the state\n */\nexport const useRadioStyles_unstable = state => {\n const {\n labelPosition\n } = state;\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(radioClassNames.root, rootBaseClassName, labelPosition === \"below\" && rootStyles.vertical, state.root.className);\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(radioClassNames.input, inputBaseClassName, labelPosition === \"below\" && inputStyles.below, state.input.className);\n const indicatorBaseClassName = useIndicatorBaseClassName();\n state.indicator.className = mergeClasses(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);\n }\n};\n//# sourceMappingURL=useRadioStyles.js.map"],"names":["radioClassNames","useRadioStyles_unstable","root","indicator","input","label","indicatorSize","useRootBaseClassName","__resetStyles","useRootStyles","__styles","vertical","Beiy3e4","Bt984gj","d","useInputBaseClassName","useInputStyles","below","a9b677","Bqenvij","useIndicatorBaseClassName","useLabelStyles","base","qb2dma","z8tnut","z189sj","Byoj8tv","uwmqm3","after","B6of3ja","jrapky","fsow6f","state","labelPosition","rootBaseClassName","rootStyles","className","merg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js"],"sourcesContent":["import { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { __resetStyles, __styles, mergeClasses, shorthands } from '@griffel/react';\nexport const radioClassNames = {\n root: 'fui-Radio',\n indicator: 'fui-Radio__indicator',\n input: 'fui-Radio__input',\n label: 'fui-Radio__label'\n};\n// The indicator size is used by the indicator and label styles\nconst indicatorSize = '16px';\nconst useRootBaseClassName = /*#__PURE__*/__resetStyles(\"r18vxbm9\", \"r1631i6s\", [\".r18vxbm9{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}\", \".r18vxbm9:focus{outline-style:none;}\", \".r18vxbm9:focus-visible{outline-style:none;}\", \".r18vxbm9[data-fui-focus-within]:focus-within{border-top-color:transparent;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}\", \".r18vxbm9[data-fui-focus-within]:focus-within::after{content:\\\"\\\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-right-style:solid;border-bottom-style:solid;border-left-style:solid;border-top-width:2px;border-right-width:2px;border-bottom-width:2px;border-left-width:2px;border-bottom-right-radius:var(--borderRadiusMedium);border-bottom-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;left:-2px;right:-2px;}\", \".r1631i6s{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;}\", \".r1631i6s:focus{outline-style:none;}\", \".r1631i6s:focus-visible{outline-style:none;}\", \".r1631i6s[data-fui-focus-within]:focus-within{border-top-color:transparent;border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;}\", \".r1631i6s[data-fui-focus-within]:focus-within::after{content:\\\"\\\";position:absolute;pointer-events:none;z-index:1;border-top-style:solid;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;border-top-width:2px;border-left-width:2px;border-bottom-width:2px;border-right-width:2px;border-bottom-left-radius:var(--borderRadiusMedium);border-bottom-right-radius:var(--borderRadiusMedium);border-top-left-radius:var(--borderRadiusMedium);border-top-right-radius:var(--borderRadiusMedium);border-top-color:var(--colorStrokeFocus2);border-left-color:var(--colorStrokeFocus2);border-bottom-color:var(--colorStrokeFocus2);border-right-color:var(--colorStrokeFocus2);top:-2px;bottom:-2px;right:-2px;left:-2px;}\"]);\nconst useRootStyles = /*#__PURE__*/__styles({\n vertical: {\n Beiy3e4: \"f1vx9l62\",\n Bt984gj: \"f122n59\"\n }\n}, {\n d: [\".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\", \".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}\"]\n});\nconst useInputBaseClassName = /*#__PURE__*/__resetStyles(\"r9gx1vl\", \"r1uk1i2c\", [\".r9gx1vl{position:absolute;left:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}\", \".r9gx1vl:enabled{cursor:pointer;}\", \".r9gx1vl:enabled~.fui-Radio__label{cursor:pointer;}\", \".r9gx1vl:not(:checked)~.fui-Radio__indicator>*{opacity:0;}\", \".r9gx1vl:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}\", \".r9gx1vl:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}\", \".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}\", \".r9gx1vl:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}\", \".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r9gx1vl:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}\", \".r9gx1vl:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r9gx1vl:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}\", \".r9gx1vl:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}\", \".r9gx1vl:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}\", \".r9gx1vl:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}\", \".r9gx1vl:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}\", \".r1uk1i2c{position:absolute;right:0;top:0;width:calc(16px + 2 * var(--spacingHorizontalS));height:100%;box-sizing:border-box;margin:0;opacity:0;}\", \".r1uk1i2c:enabled{cursor:pointer;}\", \".r1uk1i2c:enabled~.fui-Radio__label{cursor:pointer;}\", \".r1uk1i2c:not(:checked)~.fui-Radio__indicator>*{opacity:0;}\", \".r1uk1i2c:enabled:not(:checked)~.fui-Radio__label{color:var(--colorNeutralForeground3);}\", \".r1uk1i2c:enabled:not(:checked)~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessible);}\", \".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__label{color:var(--colorNeutralForeground2);}\", \".r1uk1i2c:enabled:not(:checked):hover~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessibleHover);}\", \".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r1uk1i2c:enabled:not(:checked):hover:active~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeAccessiblePressed);}\", \".r1uk1i2c:enabled:checked~.fui-Radio__label{color:var(--colorNeutralForeground1);}\", \".r1uk1i2c:enabled:checked~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStroke);color:var(--colorCompoundBrandForeground1);}\", \".r1uk1i2c:enabled:checked:hover~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokeHover);color:var(--colorCompoundBrandForeground1Hover);}\", \".r1uk1i2c:enabled:checked:hover:active~.fui-Radio__indicator{border-color:var(--colorCompoundBrandStrokePressed);color:var(--colorCompoundBrandForeground1Pressed);}\", \".r1uk1i2c:disabled~.fui-Radio__label{color:var(--colorNeutralForegroundDisabled);cursor:default;}\", \".r1uk1i2c:disabled~.fui-Radio__indicator{border-color:var(--colorNeutralStrokeDisabled);color:var(--colorNeutralForegroundDisabled);}\"]);\nconst useInputStyles = /*#__PURE__*/__styles({\n below: {\n a9b677: \"fly5x3f\",\n Bqenvij: \"f1je6zif\"\n }\n}, {\n d: [\".fly5x3f{width:100%;}\", \".f1je6zif{height:calc(16px + 2 * var(--spacingVerticalS));}\"]\n});\nconst useIndicatorBaseClassName = /*#__PURE__*/__resetStyles(\"rid4516\", null, [\".rid4516{width:16px;height:16px;font-size:12px;box-sizing:border-box;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;overflow:hidden;border:var(--strokeWidthThin) solid;border-radius:var(--borderRadiusCircular);margin:var(--spacingVerticalS) var(--spacingHorizontalS);fill:currentColor;pointer-events:none;}\"]);\n// Can't use makeResetStyles here because Label is a component that may itself use makeResetStyles.\nconst useLabelStyles = /*#__PURE__*/__styles({\n base: {\n qb2dma: \"f7nlbp4\",\n z8tnut: \"f1kwiid1\",\n z189sj: [\"f1vdfbxk\", \"f1f5gg8d\"],\n Byoj8tv: \"f5b47ha\",\n uwmqm3: [\"f1f5gg8d\", \"f1vdfbxk\"]\n },\n after: {\n uwmqm3: [\"fruq291\", \"f7x41pl\"],\n B6of3ja: \"fjzwpt6\",\n jrapky: \"fh6j2fo\"\n },\n below: {\n z8tnut: \"f1ywm7hm\",\n fsow6f: \"f17mccla\"\n }\n}, {\n d: [\".f7nlbp4{-webkit-align-self:center;-ms-flex-item-align:center;align-self:center;}\", \".f1kwiid1{padding-top:var(--spacingVerticalS);}\", \".f1vdfbxk{padding-right:var(--spacingHorizontalS);}\", \".f1f5gg8d{padding-left:var(--spacingHorizontalS);}\", \".f5b47ha{padding-bottom:var(--spacingVerticalS);}\", \".fruq291{padding-left:var(--spacingHorizontalXS);}\", \".f7x41pl{padding-right:var(--spacingHorizontalXS);}\", \".fjzwpt6{margin-top:calc((16px - var(--lineHeightBase300)) / 2);}\", \".fh6j2fo{margin-bottom:calc((16px - var(--lineHeightBase300)) / 2);}\", \".f1ywm7hm{padding-top:var(--spacingVerticalXS);}\", \".f17mccla{text-align:center;}\"]\n});\n/**\n * Apply styling to the Radio slots based on the state\n */\nexport const useRadioStyles_unstable = state => {\n const {\n labelPosition\n } = state;\n const rootBaseClassName = useRootBaseClassName();\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(radioClassNames.root, rootBaseClassName, labelPosition === 'below' && rootStyles.vertical, state.root.className);\n const inputBaseClassName = useInputBaseClassName();\n const inputStyles = useInputStyles();\n state.input.className = mergeClasses(radioClassNames.input, inputBaseClassName, labelPosition === 'below' && inputStyles.below, state.input.className);\n const indicatorBaseClassName = useIndicatorBaseClassName();\n state.indicator.className = mergeClasses(radioClassNames.indicator, indicatorBaseClassName, state.indicator.className);\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(radioClassNames.label, labelStyles.base, labelStyles[labelPosition], state.label.className);\n }\n};\n//# sourceMappingURL=useRadioStyles.js.map"],"names":["radioClassNames","useRadioStyles_unstable","root","indicator","input","label","indicatorSize","useRootBaseClassName","__resetStyles","useRootStyles","__styles","vertical","Beiy3e4","Bt984gj","d","useInputBaseClassName","useInputStyles","below","a9b677","Bqenvij","useIndicatorBaseClassName","useLabelStyles","base","qb2dma","z8tnut","z189sj","Byoj8tv","uwmqm3","after","B6of3ja","jrapky","fsow6f","state","labelPosition","rootBaseClassName","rootStyles","className","mergeClasses","inputBaseClassName","inputStyles","indicatorBaseClassName","labelStyles"],"mappings":";;;;;;;;;;;IAGaA,eAAe,MAAfA;IAmDAC,uBAAuB,MAAvBA;;uBApDqD;AAC3D,MAAMD,kBAAkB;IAC7BE,MAAM;IACNC,WAAW;IACXC,OAAO;IACPC,OAAO;AACT;AACA,+DAA+D;AAC/D,MAAMC,gBAAgB;AACtB,MAAMC,uBAAuB,WAAW,GAAEC,IAAAA,uBAAa,EAAC,YAAY,YAAY;IAAC;IAAuI;IAAwC;IAAgD;IAA6K;IAAutB;IAAuI;IAAwC;IAAgD;IAA6K;CAAstB;AACtxE,MAAMC,gBAAgB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC1CC,UAAU;QACRC,SAAS;QACTC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAA6F;KAA0G;AAC7M;AACA,MAAMC,wBAAwB,WAAW,GAAEP,IAAAA,uBAAa,EAAC,WAAW,YAAY;IAAC;IAAmJ;IAAqC;IAAuD;IAA8D;IAA2F;IAA2G;IAAiG;IAAsH;IAAwG;IAA+H;IAAqF;IAA4I;IAA4J;IAAuK;IAAoG;IAAwI;IAAqJ;IAAsC;IAAwD;IAA+D;IAA4F;IAA4G;IAAkG;IAAuH;IAAyG;IAAgI;IAAsF;IAA6I;IAA6J;IAAwK;IAAqG;CAAwI;AACn+G,MAAMQ,iBAAiB,WAAW,GAAEN,IAAAA,kBAAQ,EAAC;IAC3CO,OAAO;QACLC,QAAQ;QACRC,SAAS;IACX;AACF,GAAG;IACDL,GAAG;QAAC;QAAyB;KAA8D;AAC7F;AACA,MAAMM,4BAA4B,WAAW,GAAEZ,IAAAA,uBAAa,EAAC,WAAW,IAAI,EAAE;IAAC;CAAwkB;AACvpB,mGAAmG;AACnG,MAAMa,iBAA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c,EAAED,MAAM3B,KAAK,CAAC+B,SAAS;IACjI,CAAC;AACH,GACA,0CAA0C"}
|
|
@@ -21,6 +21,6 @@ const RadioGroup = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
21
21
|
useCustomStyles(state);
|
|
22
22
|
return (0, _renderRadioGroup.renderRadioGroup_unstable)(state, contextValues);
|
|
23
23
|
});
|
|
24
|
-
RadioGroup.displayName =
|
|
24
|
+
RadioGroup.displayName = 'RadioGroup'; //# sourceMappingURL=RadioGroup.js.map
|
|
25
25
|
|
|
26
26
|
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/RadioGroup/RadioGroup.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/RadioGroup/RadioGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { renderRadioGroup_unstable } from './renderRadioGroup';\nimport { useRadioGroup_unstable } from './useRadioGroup';\nimport { useRadioGroupStyles_unstable } from './useRadioGroupStyles';\nimport { useRadioGroupContextValues } from '../../contexts/useRadioGroupContextValues';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * A RadioGroup component presents a set of options where only one option can be selected.\n */\nexport const RadioGroup = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useRadioGroup_unstable(props, ref);\n const contextValues = useRadioGroupContextValues(state);\n useRadioGroupStyles_unstable(state);\n const {\n useRadioGroupStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderRadioGroup_unstable(state, contextValues);\n});\nRadioGroup.displayName = 'RadioGroup';\n//# sourceMappingURL=RadioGroup.js.map"],"names":["RadioGroup","React","forwardRef","props","ref","state","useRadioGroup_unstable","contextValues","useRadioGroupContextValues","useRadioGroupStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderRadioGroup_unstable","displayName"],"mappings":";;;;+BASaA;;aAAAA;;;6DATU;kCACmB;+BACH;qCACM;4CACF;qCACE;AAItC,MAAMA,aAAa,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACtE,MAAMC,QAAQC,IAAAA,qCAAsB,EAACH,OAAOC;IAC5C,MAAMG,gBAAgBC,IAAAA,sDAA0B,EAACH;IACjDI,IAAAA,iDAA4B,EAACJ;IAC7B,MAAM,EACJI,8BAA8BC,gBAAe,EAC9C,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBL;IAChB,OAAOO,IAAAA,2CAAyB,EAACP,OAAOE;AAC1C;AACAP,WAAWa,WAAW,GAAG,cACzB,sCAAsC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/RadioGroup/RadioGroup.types.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/RadioGroup/RadioGroup.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=RadioGroup.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,4CAA4C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/RadioGroup/index.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/RadioGroup/index.js"],"sourcesContent":["export * from './RadioGroup';\nexport * from './RadioGroup.types';\nexport * from './renderRadioGroup';\nexport * from './useRadioGroup';\nexport * from './useRadioGroupStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/RadioGroup/renderRadioGroup.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/RadioGroup/renderRadioGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state, contextValues) => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {\n value: contextValues.radioGroup\n }, /*#__PURE__*/React.createElement(slots.root, slotProps.root));\n};\n//# sourceMappingURL=renderRadioGroup.js.map"],"names":["renderRadioGroup_unstable","state","contextValues","slots","slotProps","getSlots","React","createElement","RadioGroupContext","Provider","value","radioGroup","root"],"mappings":";;;;+BAMaA;;aAAAA;;;6DANU;gCACE;mCACS;AAI3B,MAAMA,4BAA4B,CAACC,OAAOC,gBAAkB;IACjE,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACJ;IACb,OAAO,WAAW,GAAEK,OAAMC,aAAa,CAACC,oCAAiB,CAACC,QAAQ,EAAE;QAClEC,OAAOR,cAAcS,UAAU;IACjC,GAAG,WAAW,GAAEL,OAAMC,aAAa,CAACJ,MAAMS,IAAI,EAAER,UAAUQ,IAAI;AAChE,GACA,4CAA4C"}
|
|
@@ -10,8 +10,8 @@ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildc
|
|
|
10
10
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
11
|
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
12
|
const useRadioGroup_unstable = (props, ref)=>{
|
|
13
|
-
const generatedName = (0, _reactUtilities.useId)(
|
|
14
|
-
const { name =generatedName , value , defaultValue , disabled , layout =
|
|
13
|
+
const generatedName = (0, _reactUtilities.useId)('radiogroup-');
|
|
14
|
+
const { name =generatedName , value , defaultValue , disabled , layout ='vertical' , onChange , required } = props;
|
|
15
15
|
return {
|
|
16
16
|
layout,
|
|
17
17
|
name,
|
|
@@ -20,19 +20,19 @@ const useRadioGroup_unstable = (props, ref)=>{
|
|
|
20
20
|
disabled,
|
|
21
21
|
required,
|
|
22
22
|
components: {
|
|
23
|
-
root:
|
|
23
|
+
root: 'div'
|
|
24
24
|
},
|
|
25
25
|
root: {
|
|
26
26
|
ref,
|
|
27
|
-
role:
|
|
28
|
-
...(0, _reactUtilities.getNativeElementProps)(
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
role: 'radiogroup',
|
|
28
|
+
...(0, _reactUtilities.getNativeElementProps)('div', props, /*excludedPropNames:*/ [
|
|
29
|
+
'onChange',
|
|
30
|
+
'name'
|
|
31
31
|
]),
|
|
32
32
|
onChange: (0, _reactUtilities.useEventCallback)((ev)=>{
|
|
33
33
|
if (onChange && (0, _reactUtilities.isHTMLElement)(ev.target, {
|
|
34
|
-
constructorName:
|
|
35
|
-
}) && ev.target.type ===
|
|
34
|
+
constructorName: 'HTMLInputElement'
|
|
35
|
+
}) && ev.target.type === 'radio') {
|
|
36
36
|
onChange(ev, {
|
|
37
37
|
value: ev.target.value
|
|
38
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/RadioGroup/useRadioGroup.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/RadioGroup/useRadioGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, isHTMLElement, useEventCallback, useId } from '@fluentui/react-utilities';\n/**\n * Create the state required to render RadioGroup.\n *\n * The returned state can be modified with hooks such as useRadioGroupStyles_unstable,\n * before being passed to renderRadioGroup_unstable.\n *\n * @param props - props from this instance of RadioGroup\n * @param ref - reference to root HTMLElement of RadioGroup\n */\nexport const useRadioGroup_unstable = (props, ref) => {\n const generatedName = useId('radiogroup-');\n const {\n name = generatedName,\n value,\n defaultValue,\n disabled,\n layout = 'vertical',\n onChange,\n required\n } = props;\n return {\n layout,\n name,\n value,\n defaultValue,\n disabled,\n required,\n components: {\n root: 'div'\n },\n root: {\n ref,\n role: 'radiogroup',\n ...getNativeElementProps('div', props, /*excludedPropNames:*/['onChange', 'name']),\n onChange: useEventCallback(ev => {\n if (onChange && isHTMLElement(ev.target, {\n constructorName: 'HTMLInputElement'\n }) && ev.target.type === 'radio') {\n onChange(ev, {\n value: ev.target.value\n });\n }\n })\n }\n };\n};\n//# sourceMappingURL=useRadioGroup.js.map"],"names":["useRadioGroup_unstable","props","ref","generatedName","useId","name","value","defaultValue","disabled","layout","onChange","required","components","root","role","getNativeElementProps","useEventCallback","ev","isHTMLElement","target","constructorName","type"],"mappings":";;;;+BAWaA;;aAAAA;;;6DAXU;gCACuD;AAUvE,MAAMA,yBAAyB,CAACC,OAAOC,MAAQ;IACpD,MAAMC,gBAAgBC,IAAAA,qBAAK,EAAC;IAC5B,MAAM,EACJC,MAAOF,cAAa,EACpBG,MAAK,EACLC,aAAY,EACZC,SAAQ,EACRC,QAAS,WAAU,EACnBC,SAAQ,EACRC,SAAQ,EACT,GAAGV;IACJ,OAAO;QACLQ;QACAJ;QACAC;QACAC;QACAC;QACAG;QACAC,YAAY;YACVC,MAAM;QACR;QACAA,MAAM;YACJX;YACAY,MAAM;YACN,GAAGC,IAAAA,qCAAqB,EAAC,OAAOd,OAAO,oBAAoB,GAAE;gBAAC;gBAAY;aAAO,CAAC;YAClFS,UAAUM,IAAAA,gCAAgB,EAACC,CAAAA,KAAM;gBAC/B,IAAIP,YAAYQ,IAAAA,6BAAa,EAACD,GAAGE,MAAM,EAAE;oBACvCC,iBAAiB;gBACnB,MAAMH,GAAGE,MAAM,CAACE,IAAI,KAAK,SAAS;oBAChCX,SAASO,IAAI;wBACXX,OAAOW,GAAGE,MAAM,CAACb,KAAK;oBACxB;gBACF,CAAC;YACH;QACF;IACF;AACF,GACA,yCAAyC"}
|
|
@@ -14,7 +14,7 @@ _export(exports, {
|
|
|
14
14
|
});
|
|
15
15
|
const _react = require("@griffel/react");
|
|
16
16
|
const radioGroupClassNames = {
|
|
17
|
-
root:
|
|
17
|
+
root: 'fui-RadioGroup'
|
|
18
18
|
};
|
|
19
19
|
const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
20
20
|
root: {
|
|
@@ -33,7 +33,7 @@ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
|
33
33
|
});
|
|
34
34
|
const useRadioGroupStyles_unstable = (state)=>{
|
|
35
35
|
const styles = useStyles();
|
|
36
|
-
state.root.className = (0, _react.mergeClasses)(radioGroupClassNames.root, styles.root, state.layout ===
|
|
36
|
+
state.root.className = (0, _react.mergeClasses)(radioGroupClassNames.root, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);
|
|
37
37
|
}; //# sourceMappingURL=useRadioGroupStyles.js.map
|
|
38
38
|
|
|
39
39
|
//# sourceMappingURL=useRadioGroupStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/RadioGroup/useRadioGroupStyles.js"],"sourcesContent":["import { __styles, mergeClasses } from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/RadioGroup/useRadioGroupStyles.js"],"sourcesContent":["import { __styles, mergeClasses } from '@griffel/react';\nexport const radioGroupClassNames = {\n root: 'fui-RadioGroup'\n};\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f22iagw\",\n Bt984gj: \"f6jr5hl\"\n },\n vertical: {\n Beiy3e4: \"f1vx9l62\"\n }\n}, {\n d: [\".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f6jr5hl{-webkit-align-items:flex-start;-webkit-box-align:flex-start;-ms-flex-align:flex-start;align-items:flex-start;}\", \".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\"]\n});\n/**\n * Apply styling to the RadioGroup slots based on the state\n */\nexport const useRadioGroupStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(radioGroupClassNames.root, styles.root, state.layout === 'vertical' && styles.vertical, state.root.className);\n};\n//# sourceMappingURL=useRadioGroupStyles.js.map"],"names":["radioGroupClassNames","useRadioGroupStyles_unstable","root","useStyles","__styles","mc9l5x","Bt984gj","vertical","Beiy3e4","d","state","styles","className","mergeClasses","layout"],"mappings":";;;;;;;;;;;IACaA,oBAAoB,MAApBA;IAiBAC,4BAA4B,MAA5BA;;uBAlB0B;AAChC,MAAMD,uBAAuB;IAClCE,MAAM;AACR;AACA,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCF,MAAM;QACJG,QAAQ;QACRC,SAAS;IACX;IACAC,UAAU;QACRC,SAAS;IACX;AACF,GAAG;IACDC,GAAG;QAAC;QAAwF;QAA2H;KAA4F;AACrT;AAIO,MAAMR,+BAA+BS,CAAAA,QAAS;IACnD,MAAMC,SAASR;IACfO,MAAMR,IAAI,CAACU,SAAS,GAAGC,IAAAA,mBAAY,EAACb,qBAAqBE,IAAI,EAAES,OAAOT,IAAI,EAAEQ,MAAMI,MAAM,KAAK,cAAcH,OAAOJ,QAAQ,EAAEG,MAAMR,IAAI,CAACU,SAAS;AAClJ,GACA,+CAA+C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/RadioGroupField/RadioGroupField.js"],"sourcesContent":["/* eslint-disable deprecation/deprecation */import { getDeprecatedFieldClassNames, makeDeprecatedField } from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/RadioGroupField/RadioGroupField.js"],"sourcesContent":["/* eslint-disable deprecation/deprecation */import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport { RadioGroup, radioGroupClassNames } from '../../RadioGroup';\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const radioGroupFieldClassNames = /*#__PURE__*/getDeprecatedFieldClassNames(radioGroupClassNames.root);\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const RadioGroupField = /*#__PURE__*/makeDeprecatedField(RadioGroup);\n//# sourceMappingURL=RadioGroupField.js.map"],"names":["radioGroupFieldClassNames","RadioGroupField","getDeprecatedFieldClassNames","radioGroupClassNames","root","makeDeprecatedField","RadioGroup"],"mappings":"AAAA,0CAA0C;;;;;;;;;;;IAG7BA,yBAAyB,MAAzBA;IAEAC,eAAe,MAAfA;;4BALiG;4BAC7D;AAE1C,MAAMD,4BAA4B,WAAW,GAAEE,IAAAA,wCAA4B,EAACC,gCAAoB,CAACC,IAAI;AAErG,MAAMH,kBAAkB,WAAW,GAAEI,IAAAA,+BAAmB,EAACC,sBAAU,GAC1E,2CAA2C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/RadioGroupField/index.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/RadioGroupField/index.js"],"sourcesContent":["export * from './RadioGroupField';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../lib/contexts/RadioGroupContext.js"],"sourcesContent":["import { createContext, useContextSelector } from
|
|
1
|
+
{"version":3,"sources":["../../lib/contexts/RadioGroupContext.js"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext = /*#__PURE__*/createContext(undefined);\nconst radioGroupContextDefaultValue = {};\nexport const RadioGroupProvider = RadioGroupContext.Provider;\nexport const useRadioGroupContext_unstable = selector => useContextSelector(RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));\n//# sourceMappingURL=RadioGroupContext.js.map"],"names":["RadioGroupContext","RadioGroupProvider","useRadioGroupContext_unstable","createContext","undefined","radioGroupContextDefaultValue","Provider","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IAIaA,iBAAiB,MAAjBA;IAEAC,kBAAkB,MAAlBA;IACAC,6BAA6B,MAA7BA;;sCAPqC;AAI3C,MAAMF,oBAAoB,WAAW,GAAEG,IAAAA,mCAAa,EAACC;AAC5D,MAAMC,gCAAgC,CAAC;AAChC,MAAMJ,qBAAqBD,kBAAkBM,QAAQ;AACrD,MAAMJ,gCAAgCK,CAAAA,WAAYC,IAAAA,wCAAkB,EAACR,mBAAmB,CAACS,MAAMJ,6BAA6B,GAAKE,SAASE,OACjJ,6CAA6C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../lib/contexts/index.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../../lib/contexts/index.js"],"sourcesContent":["export * from './RadioGroupContext';\nexport * from './useRadioGroupContextValues';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;CACd,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { RadioGroup, radioGroupClassNames, renderRadioGroup_unstable, useRadioGroupStyles_unstable, useRadioGroup_unstable } from
|
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { RadioGroup, radioGroupClassNames, renderRadioGroup_unstable, useRadioGroupStyles_unstable, useRadioGroup_unstable } from './RadioGroup';\nexport { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';\nexport { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable } from './contexts/index';\n// eslint-disable-next-line deprecation/deprecation\nexport { RadioGroupField as RadioGroupField_unstable, radioGroupFieldClassNames } from './RadioGroupField';\n//# sourceMappingURL=index.js.map"],"names":["RadioGroup","radioGroupClassNames","renderRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroup_unstable","Radio","radioClassNames","renderRadio_unstable","useRadioStyles_unstable","useRadio_unstable","RadioGroupProvider","useRadioGroupContextValues","useRadioGroupContext_unstable","RadioGroupField_unstable","RadioGroupField","radioGroupFieldClassNames"],"mappings":";;;;;;;;;;;IAASA,UAAU,MAAVA,sBAAU;IAAEC,oBAAoB,MAApBA,gCAAoB;IAAEC,yBAAyB,MAAzBA,qCAAyB;IAAEC,4BAA4B,MAA5BA,wCAA4B;IAAEC,sBAAsB,MAAtBA,kCAAsB;IACjHC,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IACxFC,kBAAkB,MAAlBA,yBAAkB;IAAEC,0BAA0B,MAA1BA,iCAA0B;IAAEC,6BAA6B,MAA7BA,oCAA6B;IAE1DC,wBAAwB,MAA3CC,gCAAe;IAA8BC,yBAAyB,MAAzBA,0CAAyB;;4BAJmD;uBACzB;uBACX;iCAEP;CACvF,iCAAiC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-radio",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20230322-0439.1",
|
|
4
4
|
"description": "Fluent UI Radio component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
|
29
29
|
"@fluentui/react-conformance": "*",
|
|
30
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
|
30
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230322-0439.1",
|
|
31
31
|
"@fluentui/scripts-api-extractor": "*",
|
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@fluentui/react-context-selector": "0.0.0-nightly-
|
|
36
|
-
"@fluentui/react-field": "0.0.0-nightly-
|
|
37
|
-
"@fluentui/react-icons": "^2.0.
|
|
38
|
-
"@fluentui/react-label": "0.0.0-nightly-
|
|
39
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
|
40
|
-
"@fluentui/react-tabster": "0.0.0-nightly-
|
|
41
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
|
42
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
|
35
|
+
"@fluentui/react-context-selector": "0.0.0-nightly-20230322-0439.1",
|
|
36
|
+
"@fluentui/react-field": "0.0.0-nightly-20230322-0439.1",
|
|
37
|
+
"@fluentui/react-icons": "^2.0.196",
|
|
38
|
+
"@fluentui/react-label": "0.0.0-nightly-20230322-0439.1",
|
|
39
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20230322-0439.1",
|
|
40
|
+
"@fluentui/react-tabster": "0.0.0-nightly-20230322-0439.1",
|
|
41
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230322-0439.1",
|
|
42
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230322-0439.1",
|
|
43
43
|
"@griffel/react": "^1.5.2",
|
|
44
44
|
"@swc/helpers": "^0.4.14"
|
|
45
45
|
},
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
"exports": {
|
|
55
55
|
".": {
|
|
56
56
|
"types": "./dist/index.d.ts",
|
|
57
|
+
"node": "./lib-commonjs/index.js",
|
|
57
58
|
"import": "./lib/index.js",
|
|
58
59
|
"require": "./lib-commonjs/index.js"
|
|
59
60
|
},
|