@fluentui/react-radio 9.0.4 → 9.0.6
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +102 -4
- package/CHANGELOG.md +32 -5
- package/dist/index.d.ts +1 -1
- package/lib/components/Radio/useRadio.js +9 -10
- package/lib/components/Radio/useRadio.js.map +1 -1
- package/lib/components/Radio/useRadioStyles.js +29 -29
- package/lib/components/RadioGroup/RadioGroup.types.js.map +1 -1
- package/lib/contexts/RadioGroupContext.js +3 -3
- package/lib/contexts/RadioGroupContext.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadio.js +7 -9
- package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
- package/lib-commonjs/components/Radio/useRadioStyles.js +29 -29
- package/lib-commonjs/contexts/RadioGroupContext.js +3 -3
- package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
- package/package.json +10 -10
- package/dist/tsdoc-metadata.json +0 -11
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,105 @@
|
|
2
2
|
"name": "@fluentui/react-radio",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Tue, 20 Sep 2022 20:54:08 GMT",
|
6
|
+
"tag": "@fluentui/react-radio_v9.0.6",
|
7
|
+
"version": "9.0.6",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "beachball",
|
12
|
+
"package": "@fluentui/react-radio",
|
13
|
+
"comment": "Bump @fluentui/react-label to v9.0.6",
|
14
|
+
"commit": "9617a5a46ef4c5e310a066a5374ff2ed61db3c66"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-radio",
|
19
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.14",
|
20
|
+
"commit": "9617a5a46ef4c5e310a066a5374ff2ed61db3c66"
|
21
|
+
}
|
22
|
+
]
|
23
|
+
}
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"date": "Thu, 15 Sep 2022 09:49:18 GMT",
|
27
|
+
"tag": "@fluentui/react-radio_v9.0.5",
|
28
|
+
"version": "9.0.5",
|
29
|
+
"comments": {
|
30
|
+
"none": [
|
31
|
+
{
|
32
|
+
"author": "behowell@microsoft.com",
|
33
|
+
"package": "@fluentui/react-radio",
|
34
|
+
"commit": "22de26fac5b939224884052b0bf86cecc5f22fee",
|
35
|
+
"comment": "docs: Clarify the documentation of RadioGroup's required prop"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"author": "martinhochel@microsoft.com",
|
39
|
+
"package": "@fluentui/react-radio",
|
40
|
+
"commit": "e6cf183695d6d67a24e038c49a876224e5ed35e5",
|
41
|
+
"comment": "chore: update package scaffold"
|
42
|
+
}
|
43
|
+
],
|
44
|
+
"patch": [
|
45
|
+
{
|
46
|
+
"author": "behowell@microsoft.com",
|
47
|
+
"package": "@fluentui/react-radio",
|
48
|
+
"commit": "e598325b985cad3e5057f00893e0176416edd292",
|
49
|
+
"comment": "refactor: Replace useMergedEventCallbacks utility with mergeCallbacks"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"author": "lingfangao@hotmail.com",
|
53
|
+
"package": "@fluentui/react-radio",
|
54
|
+
"commit": "a606fbedcf7d618d1a48706a5e15c26c4cd85ba6",
|
55
|
+
"comment": "chore: fix no-context-default-value lint violations for cxe"
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"author": "olfedias@microsoft.com",
|
59
|
+
"package": "@fluentui/react-radio",
|
60
|
+
"commit": "e610024474cfe5d45f61501a8b6a21daf4c794a2",
|
61
|
+
"comment": "chore: Update Griffel to latest version"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"author": "beachball",
|
65
|
+
"package": "@fluentui/react-radio",
|
66
|
+
"comment": "Bump @fluentui/react-context-selector to v9.0.3",
|
67
|
+
"commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
"author": "beachball",
|
71
|
+
"package": "@fluentui/react-radio",
|
72
|
+
"comment": "Bump @fluentui/react-label to v9.0.5",
|
73
|
+
"commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"author": "beachball",
|
77
|
+
"package": "@fluentui/react-radio",
|
78
|
+
"comment": "Bump @fluentui/react-tabster to v9.1.1",
|
79
|
+
"commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"author": "beachball",
|
83
|
+
"package": "@fluentui/react-radio",
|
84
|
+
"comment": "Bump @fluentui/react-theme to v9.1.0",
|
85
|
+
"commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"author": "beachball",
|
89
|
+
"package": "@fluentui/react-radio",
|
90
|
+
"comment": "Bump @fluentui/react-utilities to v9.1.0",
|
91
|
+
"commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"author": "beachball",
|
95
|
+
"package": "@fluentui/react-radio",
|
96
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.13",
|
97
|
+
"commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
|
98
|
+
}
|
99
|
+
]
|
100
|
+
}
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"date": "Wed, 03 Aug 2022 16:03:57 GMT",
|
6
104
|
"tag": "@fluentui/react-radio_v9.0.4",
|
7
105
|
"version": "9.0.4",
|
8
106
|
"comments": {
|
@@ -37,19 +135,19 @@
|
|
37
135
|
"author": "beachball",
|
38
136
|
"package": "@fluentui/react-radio",
|
39
137
|
"comment": "Bump @fluentui/react-label to v9.0.4",
|
40
|
-
"commit": "
|
138
|
+
"commit": "ee4a8be0d0831a6615f878f98db6a97cc61a802d"
|
41
139
|
},
|
42
140
|
{
|
43
141
|
"author": "beachball",
|
44
142
|
"package": "@fluentui/react-radio",
|
45
143
|
"comment": "Bump @fluentui/react-tabster to v9.1.0",
|
46
|
-
"commit": "
|
144
|
+
"commit": "ee4a8be0d0831a6615f878f98db6a97cc61a802d"
|
47
145
|
},
|
48
146
|
{
|
49
147
|
"author": "beachball",
|
50
148
|
"package": "@fluentui/react-radio",
|
51
149
|
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.12",
|
52
|
-
"commit": "
|
150
|
+
"commit": "ee4a8be0d0831a6615f878f98db6a97cc61a802d"
|
53
151
|
}
|
54
152
|
]
|
55
153
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,21 +1,48 @@
|
|
1
1
|
# Change Log - @fluentui/react-radio
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 20 Sep 2022 20:54:08 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.0.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.6)
|
8
|
+
|
9
|
+
Tue, 20 Sep 2022 20:54:08 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.5..@fluentui/react-radio_v9.0.6)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- Bump @fluentui/react-label to v9.0.6 ([PR #24870](https://github.com/microsoft/fluentui/pull/24870) by beachball)
|
15
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.14 ([PR #24870](https://github.com/microsoft/fluentui/pull/24870) by beachball)
|
16
|
+
|
17
|
+
## [9.0.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.5)
|
18
|
+
|
19
|
+
Thu, 15 Sep 2022 09:49:18 GMT
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.4..@fluentui/react-radio_v9.0.5)
|
21
|
+
|
22
|
+
### Patches
|
23
|
+
|
24
|
+
- refactor: Replace useMergedEventCallbacks utility with mergeCallbacks ([PR #24152](https://github.com/microsoft/fluentui/pull/24152) by behowell@microsoft.com)
|
25
|
+
- chore: fix no-context-default-value lint violations for cxe ([PR #24277](https://github.com/microsoft/fluentui/pull/24277) by lingfangao@hotmail.com)
|
26
|
+
- chore: Update Griffel to latest version ([PR #24221](https://github.com/microsoft/fluentui/pull/24221) by olfedias@microsoft.com)
|
27
|
+
- Bump @fluentui/react-context-selector to v9.0.3 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
|
28
|
+
- Bump @fluentui/react-label to v9.0.5 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
|
29
|
+
- Bump @fluentui/react-tabster to v9.1.1 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
|
30
|
+
- Bump @fluentui/react-theme to v9.1.0 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
|
31
|
+
- Bump @fluentui/react-utilities to v9.1.0 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
|
32
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.13 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
|
33
|
+
|
7
34
|
## [9.0.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.4)
|
8
35
|
|
9
|
-
Wed, 03 Aug 2022 16:
|
36
|
+
Wed, 03 Aug 2022 16:03:57 GMT
|
10
37
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.0.3..@fluentui/react-radio_v9.0.4)
|
11
38
|
|
12
39
|
### Patches
|
13
40
|
|
14
41
|
- refactor: use `useFocusWithin` hook for :focus-within styles ([PR #24154](https://github.com/microsoft/fluentui/pull/24154) by lingfangao@hotmail.com)
|
15
42
|
- chore: Bump Griffel dependencies ([PR #24114](https://github.com/microsoft/fluentui/pull/24114) by miroslav.stastny@microsoft.com)
|
16
|
-
- Bump @fluentui/react-label to v9.0.4 ([PR #
|
17
|
-
- Bump @fluentui/react-tabster to v9.1.0 ([PR #
|
18
|
-
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.12 ([PR #
|
43
|
+
- Bump @fluentui/react-label to v9.0.4 ([PR #24131](https://github.com/microsoft/fluentui/pull/24131) by beachball)
|
44
|
+
- Bump @fluentui/react-tabster to v9.1.0 ([PR #24131](https://github.com/microsoft/fluentui/pull/24131) by beachball)
|
45
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.12 ([PR #24131](https://github.com/microsoft/fluentui/pull/24131) by beachball)
|
19
46
|
|
20
47
|
## [9.0.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.0.3)
|
21
48
|
|
package/dist/index.d.ts
CHANGED
@@ -76,7 +76,7 @@ export declare type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlot
|
|
76
76
|
*/
|
77
77
|
disabled?: boolean;
|
78
78
|
/**
|
79
|
-
* Require
|
79
|
+
* Require a selection in this group. Adds the `required` prop to all child Radio items.
|
80
80
|
*/
|
81
81
|
required?: boolean;
|
82
82
|
};
|
@@ -1,9 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { CircleFilled } from '@fluentui/react-icons';
|
3
3
|
import { Label } from '@fluentui/react-label';
|
4
|
-
import { getPartitionedNativeProps, resolveShorthand, useId
|
5
|
-
import {
|
6
|
-
import { useContextSelector } from '@fluentui/react-context-selector';
|
4
|
+
import { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';
|
5
|
+
import { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';
|
7
6
|
import { useFocusWithin } from '@fluentui/react-tabster';
|
8
7
|
/**
|
9
8
|
* Create the state required to render Radio.
|
@@ -16,12 +15,12 @@ import { useFocusWithin } from '@fluentui/react-tabster';
|
|
16
15
|
*/
|
17
16
|
|
18
17
|
export const useRadio_unstable = (props, ref) => {
|
19
|
-
const nameGroup =
|
20
|
-
const value =
|
21
|
-
const defaultValue =
|
22
|
-
const disabledGroup =
|
23
|
-
const layout =
|
24
|
-
const requiredGroup =
|
18
|
+
const nameGroup = useRadioGroupContext_unstable(ctx => ctx.name);
|
19
|
+
const value = useRadioGroupContext_unstable(ctx => ctx.value);
|
20
|
+
const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);
|
21
|
+
const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);
|
22
|
+
const layout = useRadioGroupContext_unstable(ctx => ctx.layout);
|
23
|
+
const requiredGroup = useRadioGroupContext_unstable(ctx => ctx.required);
|
25
24
|
const {
|
26
25
|
name = nameGroup,
|
27
26
|
checked = value !== undefined ? value === props.value : undefined,
|
@@ -57,7 +56,7 @@ export const useRadio_unstable = (props, ref) => {
|
|
57
56
|
...nativeProps.primary
|
58
57
|
}
|
59
58
|
});
|
60
|
-
input.onChange =
|
59
|
+
input.onChange = mergeCallbacks(input.onChange, ev => onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
|
61
60
|
value: ev.currentTarget.value
|
62
61
|
}));
|
63
62
|
const label = resolveShorthand(props.label, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Radio/useRadio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,uBAA7B;AACA,SAAS,KAAT,QAAsB,uBAAtB;AACA,SAAS,yBAAT,EAAoC,
|
1
|
+
{"version":3,"sources":["components/Radio/useRadio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,YAAT,QAA6B,uBAA7B;AACA,SAAS,KAAT,QAAsB,uBAAtB;AACA,SAAS,yBAAT,EAAoC,cAApC,EAAoD,gBAApD,EAAsE,KAAtE,QAAmF,2BAAnF;AACA,SAAS,6BAAT,QAA8C,kCAA9C;AACA,SAAS,cAAT,QAA+B,yBAA/B;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAAoE;EACnG,MAAM,SAAS,GAA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C;IAE1C,YAAY,EAAE;MACZ,GADY;MAEZ,IAAI,EAAE,OAFM;MAGZ,EAAE,EAAE,KAAK,CAAC,QAAD,EAAW,WAAW,CAAC,OAAZ,CAAoB,EAA/B,CAHG;MAIZ,IAJY;MAKZ,OALY;MAMZ,cANY;MAOZ,QAPY;MAQZ,QARY;MASZ,GAAG,WAAW,CAAC;IATH;EAF4B,CAAd,CAA9B;EAeA,KAAK,CAAC,QAAN,GAAiB,cAAc,CAAC,KAAK,CAAC,QAAP,EAAiB,EAAE,IAAI,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAQ,KAAA,CAAR,GAAA,QAAQ,CAAG,EAAH,EAAO;IAAE,KAAK,EAAE,EAAE,CAAC,aAAH,CAAiB;EAA1B,CAAP,CAA/B,CAA/B;EAEA,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAP,EAAc;IAC1C,YAAY,EAAE;MACZ,OAAO,EAAE,KAAK,CAAC,EADH;MAEZ;IAFY;EAD4B,CAAd,CAA9B;EAOA,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,SAAP,EAAkB;IAClD,QAAQ,EAAE,IADwC;IAElD,YAAY,EAAE;MACZ,eAAe,IADH;MAEZ,QAAQ,eAAE,KAAA,CAAA,aAAA,CAAC,YAAD,EAAa,IAAb;IAFE;EAFoC,CAAlB,CAAlC;EAQA,OAAO;IACL,aADK;IAEL,UAAU,EAAE;MACV,IAAI,EAAE,MADI;MAEV,KAAK,EAAE,OAFG;MAGV,KAAK,EAAE,KAHG;MAIV,SAAS,EAAE;IAJD,CAFP;IAQL,IARK;IASL,KATK;IAUL,KAVK;IAWL;EAXK,CAAP;AAaD,CA7EM","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,\n input,\n label,\n indicator,\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -29,37 +29,37 @@ const useRootStyles = /*#__PURE__*/__styles({
|
|
29
29
|
"focusIndicator": {
|
30
30
|
"Brovlpu": "ftqa4ok",
|
31
31
|
"B486eqv": "f2hkw1w",
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
59
|
-
"
|
32
|
+
"Brlowmp": "fck78tx",
|
33
|
+
"Fxwv4m": ["f8gneoz", "f14g6lul"],
|
34
|
+
"Bkrqzay": "f1tc23yq",
|
35
|
+
"Bg2fdrq": ["f14g6lul", "f8gneoz"],
|
36
|
+
"Bhpuztq": "ffjpq3d",
|
37
|
+
"Hxt1dp": "fo0h4cx",
|
38
|
+
"Fwynku": "f1vef9e5",
|
39
|
+
"nwv0sh": "fob2zhe",
|
40
|
+
"sewbek": "ftqc7yw",
|
41
|
+
"Bmcqtu5": ["fbod6wy", "f4eroa4"],
|
42
|
+
"Iuyy0o": "flecwt7",
|
43
|
+
"B1jyaxe": ["f4eroa4", "fbod6wy"],
|
44
|
+
"Gic0m5": "fzb327l",
|
45
|
+
"B8s345i": ["f1s2knrb", "f6wuwpp"],
|
46
|
+
"Btrf9ny": "f1g8ecfq",
|
47
|
+
"Bz0zc98": ["f6wuwpp", "f1s2knrb"],
|
48
|
+
"Bdowj5x": ["f1hnqdjl", "fk9eigt"],
|
49
|
+
"zit2e2": ["fk9eigt", "f1hnqdjl"],
|
50
|
+
"xdtxim": ["f1g8yfuc", "f1kv2i3z"],
|
51
|
+
"mjwzc8": ["f1kv2i3z", "f1g8yfuc"],
|
52
|
+
"Bdlkd80": "ffthsbc",
|
53
|
+
"mrk28m": ["f1nq9gk1", "f1pmlwz5"],
|
54
|
+
"Byzfkqq": "f1naw2e2",
|
55
|
+
"Bnh9nsd": ["f1pmlwz5", "f1nq9gk1"],
|
56
|
+
"r9zwrz": "fmtt8yl",
|
57
|
+
"B4yg94n": "fr8phvc",
|
58
|
+
"glb4xk": ["f5m5r8m", "f1bizo4j"],
|
59
|
+
"mla9w6": ["f1bizo4j", "f5m5r8m"]
|
60
60
|
}
|
61
61
|
}, {
|
62
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1kwiid1{padding-top:var(--spacingVerticalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f5b47ha{padding-bottom:var(--spacingVerticalS);}", ".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;}", ".
|
62
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1kwiid1{padding-top:var(--spacingVerticalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f5b47ha{padding-bottom:var(--spacingVerticalS);}", ".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;}", ".fck78tx.fui-focus-within:focus-within{border-top-color:transparent;}", ".f8gneoz.fui-focus-within:focus-within{border-right-color:transparent;}", ".f14g6lul.fui-focus-within:focus-within{border-left-color:transparent;}", ".f1tc23yq.fui-focus-within:focus-within{border-bottom-color:transparent;}", ".ffjpq3d.fui-focus-within:focus-within::after{content:\"\";}", ".fo0h4cx.fui-focus-within:focus-within::after{position:absolute;}", ".f1vef9e5.fui-focus-within:focus-within::after{pointer-events:none;}", ".fob2zhe.fui-focus-within:focus-within::after{z-index:1;}", ".ftqc7yw.fui-focus-within:focus-within::after{border-top-style:solid;}", ".fbod6wy.fui-focus-within:focus-within::after{border-right-style:solid;}", ".f4eroa4.fui-focus-within:focus-within::after{border-left-style:solid;}", ".flecwt7.fui-focus-within:focus-within::after{border-bottom-style:solid;}", ".fzb327l.fui-focus-within:focus-within::after{border-top-width:2px;}", ".f1s2knrb.fui-focus-within:focus-within::after{border-right-width:2px;}", ".f6wuwpp.fui-focus-within:focus-within::after{border-left-width:2px;}", ".f1g8ecfq.fui-focus-within:focus-within::after{border-bottom-width:2px;}", ".f1hnqdjl.fui-focus-within:focus-within::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".fk9eigt.fui-focus-within:focus-within::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1g8yfuc.fui-focus-within:focus-within::after{border-top-right-radius:var(--borderRadiusMedium);}", ".f1kv2i3z.fui-focus-within:focus-within::after{border-top-left-radius:var(--borderRadiusMedium);}", ".ffthsbc.fui-focus-within:focus-within::after{border-top-color:var(--colorStrokeFocus2);}", ".f1nq9gk1.fui-focus-within:focus-within::after{border-right-color:var(--colorStrokeFocus2);}", ".f1pmlwz5.fui-focus-within:focus-within::after{border-left-color:var(--colorStrokeFocus2);}", ".f1naw2e2.fui-focus-within:focus-within::after{border-bottom-color:var(--colorStrokeFocus2);}", ".fmtt8yl.fui-focus-within:focus-within::after{top:-2px;}", ".fr8phvc.fui-focus-within:focus-within::after{bottom:-2px;}", ".f5m5r8m.fui-focus-within:focus-within::after{left:-2px;}", ".f1bizo4j.fui-focus-within:focus-within::after{right:-2px;}"],
|
63
63
|
"f": [".ftqa4ok:focus{outline-style:none;}"],
|
64
64
|
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
65
65
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RadioGroup.types.js","sourceRoot":"../src/","sources":["components/RadioGroup/RadioGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioGroupSlots = {\n /**\n * The radio group root.\n */\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {\n /**\n * The name of this radio group. This name is applied to all Radio items inside this group.\n *\n * If no name is provided, one will be generated so that all of the Radio items have the same name.\n */\n name?: string;\n\n /**\n * The selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n value?: string;\n\n /**\n * The default selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n defaultValue?: string;\n\n /**\n * Callback when the selected Radio item changes.\n */\n onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;\n\n /**\n * How the radio items are laid out in the group.\n *\n * @default vertical\n */\n layout?: 'vertical' | 'horizontal' | 'horizontal-stacked';\n\n /**\n * Disable all Radio items in this group.\n */\n disabled?: boolean;\n\n /**\n * Require
|
1
|
+
{"version":3,"file":"RadioGroup.types.js","sourceRoot":"../src/","sources":["components/RadioGroup/RadioGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioGroupSlots = {\n /**\n * The radio group root.\n */\n root: NonNullable<Slot<'div'>>;\n};\n\nexport type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {\n /**\n * The name of this radio group. This name is applied to all Radio items inside this group.\n *\n * If no name is provided, one will be generated so that all of the Radio items have the same name.\n */\n name?: string;\n\n /**\n * The selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n value?: string;\n\n /**\n * The default selected Radio item in this group.\n *\n * This should be the `value` prop of one of the Radio items inside this group.\n */\n defaultValue?: string;\n\n /**\n * Callback when the selected Radio item changes.\n */\n onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;\n\n /**\n * How the radio items are laid out in the group.\n *\n * @default vertical\n */\n layout?: 'vertical' | 'horizontal' | 'horizontal-stacked';\n\n /**\n * Disable all Radio items in this group.\n */\n disabled?: boolean;\n\n /**\n * Require a selection in this group. Adds the `required` prop to all child Radio items.\n */\n required?: boolean;\n};\n\n/**\n * Data for the onChange event for RadioGroup.\n */\nexport type RadioGroupOnChangeData = {\n /**\n * The value of the newly selected Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering RadioGroup\n */\nexport type RadioGroupState = ComponentState<RadioGroupSlots> &\n Required<Pick<RadioGroupProps, 'layout'>> &\n Partial<Exclude<RadioGroupProps, 'onChange' | 'layout'>>;\n\nexport type RadioGroupContextValue = Pick<\n RadioGroupProps,\n 'name' | 'value' | 'defaultValue' | 'disabled' | 'layout' | 'required'\n>;\n\nexport type RadioGroupContextValues = {\n radioGroup: RadioGroupContextValue;\n};\n"]}
|
@@ -2,9 +2,9 @@ import { createContext, useContextSelector } from '@fluentui/react-context-selec
|
|
2
2
|
/**
|
3
3
|
* RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
|
4
4
|
*/
|
5
|
-
// eslint-disable-next-line @fluentui/no-context-default-value
|
6
5
|
|
7
|
-
export const RadioGroupContext = /*#__PURE__*/createContext(
|
6
|
+
export const RadioGroupContext = /*#__PURE__*/createContext(undefined);
|
7
|
+
const radioGroupContextDefaultValue = {};
|
8
8
|
export const RadioGroupProvider = RadioGroupContext.Provider;
|
9
|
-
export const useRadioGroupContext_unstable = selector => useContextSelector(RadioGroupContext, selector);
|
9
|
+
export const useRadioGroupContext_unstable = selector => useContextSelector(RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));
|
10
10
|
//# sourceMappingURL=RadioGroupContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,EAAwB,kBAAxB,QAAmE,kCAAnE;AAIA;;AAEG
|
1
|
+
{"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":"AAAA,SAAS,aAAT,EAAwB,kBAAxB,QAAmE,kCAAnE;AAIA;;AAEG;;AACH,OAAO,MAAM,iBAAiB,gBAAoC,aAAa,CAC7E,SAD6E,CAAxE;AAIP,MAAM,6BAA6B,GAA2B,EAA9D;AAEA,OAAO,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,QAA7C;AAEP,OAAO,MAAM,6BAA6B,GAAO,QAAJ,IAC3C,kBAAkB,CAAC,iBAAD,EAAoB,CAAC,GAAG,GAAG,6BAAP,KAAyC,QAAQ,CAAC,GAAD,CAArE,CADb","sourcesContent":["import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { RadioGroupContextValue } from '../RadioGroup';\n\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext: Context<RadioGroupContextValue> = createContext<RadioGroupContextValue | undefined>(\n undefined,\n) as Context<RadioGroupContextValue>;\n\nconst radioGroupContextDefaultValue: RadioGroupContextValue = {};\n\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext_unstable = <T>(selector: ContextSelector<RadioGroupContextValue, T>): T =>\n useContextSelector(RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));\n"],"sourceRoot":"../src/"}
|
@@ -15,8 +15,6 @@ const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
15
15
|
|
16
16
|
const RadioGroupContext_1 = /*#__PURE__*/require("../../contexts/RadioGroupContext");
|
17
17
|
|
18
|
-
const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
|
19
|
-
|
20
18
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
21
19
|
/**
|
22
20
|
* Create the state required to render Radio.
|
@@ -30,12 +28,12 @@ const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
|
30
28
|
|
31
29
|
|
32
30
|
const useRadio_unstable = (props, ref) => {
|
33
|
-
const nameGroup =
|
34
|
-
const value =
|
35
|
-
const defaultValue =
|
36
|
-
const disabledGroup =
|
37
|
-
const layout =
|
38
|
-
const requiredGroup =
|
31
|
+
const nameGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.name);
|
32
|
+
const value = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.value);
|
33
|
+
const defaultValue = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.defaultValue);
|
34
|
+
const disabledGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.disabled);
|
35
|
+
const layout = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.layout);
|
36
|
+
const requiredGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.required);
|
39
37
|
const {
|
40
38
|
name = nameGroup,
|
41
39
|
checked = value !== undefined ? value === props.value : undefined,
|
@@ -71,7 +69,7 @@ const useRadio_unstable = (props, ref) => {
|
|
71
69
|
...nativeProps.primary
|
72
70
|
}
|
73
71
|
});
|
74
|
-
input.onChange = react_utilities_1.
|
72
|
+
input.onChange = react_utilities_1.mergeCallbacks(input.onChange, ev => onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
|
75
73
|
value: ev.currentTarget.value
|
76
74
|
}));
|
77
75
|
const label = react_utilities_1.resolveShorthand(props.label, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Radio/useRadio.tsx"],"names":[],"m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AE,IAAI,QAAQ,KAAA,IAAR,IAAA,QAAQ,KAAA,KAAA,CAAR,GAAQ,KAAA,CAAR,GAAA,QAAQ,CAAG,EAAH,EAAO;IAAE,KAAK,EAAE,EAAE,CAAC,aAAH,CAAiB;EAA1B,CAAP,CAA7C,CAAjB;EAEA,MAAM,KAAK,GAAG,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,KAAvB,EAA8B;IAC1C,YAAY,EAAE;MACZ,OAAO,EAAE,KAAK,CAAC,EADH;MAEZ;IAFY;EAD4B,CAA9B,CAAd;EAOA,MAAM,SAAS,GAAG,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,SAAvB,EAAkC;IAClD,QAAQ,EAAE,IADwC;IAElD,YAAY,EAAE;MACZ,eAAe,IADH;MAEZ,QAAQ,EAAE,KAAA,CAAA,aAAA,CAAC,aAAA,CAAA,YAAD,EAAa,IAAb;IAFE;EAFoC,CAAlC,CAAlB;EAQA,OAAO;IACL,aADK;IAEL,UAAU,EAAE;MACV,IAAI,EAAE,MADI;MAEV,KAAK,EAAE,OAFG;MAGV,KAAK,EAAE,aAAA,CAAA,KAHG;MAIV,SAAS,EAAE;IAJD,CAFP;IAQL,IARK;IASL,KATK;IAUL,KAVK;IAWL;EAXK,CAAP;AAaD,CA7EM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","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,\n input,\n label,\n indicator,\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -39,37 +39,37 @@ const useRootStyles = /*#__PURE__*/react_1.__styles({
|
|
39
39
|
"focusIndicator": {
|
40
40
|
"Brovlpu": "ftqa4ok",
|
41
41
|
"B486eqv": "f2hkw1w",
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"
|
57
|
-
"
|
58
|
-
"
|
59
|
-
"
|
60
|
-
"
|
61
|
-
"
|
62
|
-
"
|
63
|
-
"
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
42
|
+
"Brlowmp": "fck78tx",
|
43
|
+
"Fxwv4m": ["f8gneoz", "f14g6lul"],
|
44
|
+
"Bkrqzay": "f1tc23yq",
|
45
|
+
"Bg2fdrq": ["f14g6lul", "f8gneoz"],
|
46
|
+
"Bhpuztq": "ffjpq3d",
|
47
|
+
"Hxt1dp": "fo0h4cx",
|
48
|
+
"Fwynku": "f1vef9e5",
|
49
|
+
"nwv0sh": "fob2zhe",
|
50
|
+
"sewbek": "ftqc7yw",
|
51
|
+
"Bmcqtu5": ["fbod6wy", "f4eroa4"],
|
52
|
+
"Iuyy0o": "flecwt7",
|
53
|
+
"B1jyaxe": ["f4eroa4", "fbod6wy"],
|
54
|
+
"Gic0m5": "fzb327l",
|
55
|
+
"B8s345i": ["f1s2knrb", "f6wuwpp"],
|
56
|
+
"Btrf9ny": "f1g8ecfq",
|
57
|
+
"Bz0zc98": ["f6wuwpp", "f1s2knrb"],
|
58
|
+
"Bdowj5x": ["f1hnqdjl", "fk9eigt"],
|
59
|
+
"zit2e2": ["fk9eigt", "f1hnqdjl"],
|
60
|
+
"xdtxim": ["f1g8yfuc", "f1kv2i3z"],
|
61
|
+
"mjwzc8": ["f1kv2i3z", "f1g8yfuc"],
|
62
|
+
"Bdlkd80": "ffthsbc",
|
63
|
+
"mrk28m": ["f1nq9gk1", "f1pmlwz5"],
|
64
|
+
"Byzfkqq": "f1naw2e2",
|
65
|
+
"Bnh9nsd": ["f1pmlwz5", "f1nq9gk1"],
|
66
|
+
"r9zwrz": "fmtt8yl",
|
67
|
+
"B4yg94n": "fr8phvc",
|
68
|
+
"glb4xk": ["f5m5r8m", "f1bizo4j"],
|
69
|
+
"mla9w6": ["f1bizo4j", "f5m5r8m"]
|
70
70
|
}
|
71
71
|
}, {
|
72
|
-
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1kwiid1{padding-top:var(--spacingVerticalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f5b47ha{padding-bottom:var(--spacingVerticalS);}", ".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;}", ".
|
72
|
+
"d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f10pi13n{position:relative;}", ".f1kwiid1{padding-top:var(--spacingVerticalS);}", ".f1vdfbxk{padding-right:var(--spacingHorizontalS);}", ".f1f5gg8d{padding-left:var(--spacingHorizontalS);}", ".f5b47ha{padding-bottom:var(--spacingVerticalS);}", ".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;}", ".fck78tx.fui-focus-within:focus-within{border-top-color:transparent;}", ".f8gneoz.fui-focus-within:focus-within{border-right-color:transparent;}", ".f14g6lul.fui-focus-within:focus-within{border-left-color:transparent;}", ".f1tc23yq.fui-focus-within:focus-within{border-bottom-color:transparent;}", ".ffjpq3d.fui-focus-within:focus-within::after{content:\"\";}", ".fo0h4cx.fui-focus-within:focus-within::after{position:absolute;}", ".f1vef9e5.fui-focus-within:focus-within::after{pointer-events:none;}", ".fob2zhe.fui-focus-within:focus-within::after{z-index:1;}", ".ftqc7yw.fui-focus-within:focus-within::after{border-top-style:solid;}", ".fbod6wy.fui-focus-within:focus-within::after{border-right-style:solid;}", ".f4eroa4.fui-focus-within:focus-within::after{border-left-style:solid;}", ".flecwt7.fui-focus-within:focus-within::after{border-bottom-style:solid;}", ".fzb327l.fui-focus-within:focus-within::after{border-top-width:2px;}", ".f1s2knrb.fui-focus-within:focus-within::after{border-right-width:2px;}", ".f6wuwpp.fui-focus-within:focus-within::after{border-left-width:2px;}", ".f1g8ecfq.fui-focus-within:focus-within::after{border-bottom-width:2px;}", ".f1hnqdjl.fui-focus-within:focus-within::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".fk9eigt.fui-focus-within:focus-within::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1g8yfuc.fui-focus-within:focus-within::after{border-top-right-radius:var(--borderRadiusMedium);}", ".f1kv2i3z.fui-focus-within:focus-within::after{border-top-left-radius:var(--borderRadiusMedium);}", ".ffthsbc.fui-focus-within:focus-within::after{border-top-color:var(--colorStrokeFocus2);}", ".f1nq9gk1.fui-focus-within:focus-within::after{border-right-color:var(--colorStrokeFocus2);}", ".f1pmlwz5.fui-focus-within:focus-within::after{border-left-color:var(--colorStrokeFocus2);}", ".f1naw2e2.fui-focus-within:focus-within::after{border-bottom-color:var(--colorStrokeFocus2);}", ".fmtt8yl.fui-focus-within:focus-within::after{top:-2px;}", ".fr8phvc.fui-focus-within:focus-within::after{bottom:-2px;}", ".f5m5r8m.fui-focus-within:focus-within::after{left:-2px;}", ".f1bizo4j.fui-focus-within:focus-within::after{right:-2px;}"],
|
73
73
|
"f": [".ftqa4ok:focus{outline-style:none;}"],
|
74
74
|
"i": [".f2hkw1w:focus-visible{outline-style:none;}"]
|
75
75
|
});
|
@@ -9,13 +9,13 @@ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-s
|
|
9
9
|
/**
|
10
10
|
* RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
|
11
11
|
*/
|
12
|
-
// eslint-disable-next-line @fluentui/no-context-default-value
|
13
12
|
|
14
13
|
|
15
|
-
exports.RadioGroupContext = /*#__PURE__*/react_context_selector_1.createContext(
|
14
|
+
exports.RadioGroupContext = /*#__PURE__*/react_context_selector_1.createContext(undefined);
|
15
|
+
const radioGroupContextDefaultValue = {};
|
16
16
|
exports.RadioGroupProvider = exports.RadioGroupContext.Provider;
|
17
17
|
|
18
|
-
const useRadioGroupContext_unstable = selector => react_context_selector_1.useContextSelector(exports.RadioGroupContext, selector);
|
18
|
+
const useRadioGroupContext_unstable = selector => react_context_selector_1.useContextSelector(exports.RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));
|
19
19
|
|
20
20
|
exports.useRadioGroupContext_unstable = useRadioGroupContext_unstable;
|
21
21
|
//# sourceMappingURL=RadioGroupContext.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;AAIA;;AAEG
|
1
|
+
{"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,iBAAA,gBAAqD,wBAAA,CAAA,aAAA,CAChE,SADgE,CAArD;AAIb,MAAM,6BAA6B,GAA2B,EAA9D;AAEa,OAAA,CAAA,kBAAA,GAAqB,OAAA,CAAA,iBAAA,CAAkB,QAAvC;;AAEN,MAAM,6BAA6B,GAAO,QAAJ,IAC3C,wBAAA,CAAA,kBAAA,CAAmB,OAAA,CAAA,iBAAnB,EAAsC,CAAC,GAAG,GAAG,6BAAP,KAAyC,QAAQ,CAAC,GAAD,CAAvF,CADK;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourcesContent":["import { createContext, useContextSelector, ContextSelector } from '@fluentui/react-context-selector';\nimport type { Context } from '@fluentui/react-context-selector';\nimport type { RadioGroupContextValue } from '../RadioGroup';\n\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext: Context<RadioGroupContextValue> = createContext<RadioGroupContextValue | undefined>(\n undefined,\n) as Context<RadioGroupContextValue>;\n\nconst radioGroupContextDefaultValue: RadioGroupContextValue = {};\n\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n\nexport const useRadioGroupContext_unstable = <T>(selector: ContextSelector<RadioGroupContextValue, T>): T =>\n useContextSelector(RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-radio",
|
3
|
-
"version": "9.0.
|
3
|
+
"version": "9.0.6",
|
4
4
|
"description": "Fluent UI Radio component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -21,23 +21,23 @@
|
|
21
21
|
"start": "yarn storybook",
|
22
22
|
"test": "jest --passWithNoTests",
|
23
23
|
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
24
|
-
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-radio/src && yarn docs",
|
25
|
-
"storybook": "
|
24
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-radio/src && yarn docs",
|
25
|
+
"storybook": "start-storybook",
|
26
26
|
"type-check": "tsc -b tsconfig.json"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
30
|
"@fluentui/react-conformance": "*",
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.14"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
|
-
"@fluentui/react-context-selector": "^9.0.
|
34
|
+
"@fluentui/react-context-selector": "^9.0.3",
|
35
35
|
"@fluentui/react-icons": "^2.0.175",
|
36
|
-
"@fluentui/react-label": "^9.0.
|
37
|
-
"@fluentui/react-tabster": "^9.1.
|
38
|
-
"@fluentui/react-theme": "^9.
|
39
|
-
"@fluentui/react-utilities": "^9.0
|
40
|
-
"@griffel/react": "^1.
|
36
|
+
"@fluentui/react-label": "^9.0.6",
|
37
|
+
"@fluentui/react-tabster": "^9.1.1",
|
38
|
+
"@fluentui/react-theme": "^9.1.0",
|
39
|
+
"@fluentui/react-utilities": "^9.1.0",
|
40
|
+
"@griffel/react": "^1.3.0",
|
41
41
|
"tslib": "^2.1.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
package/dist/tsdoc-metadata.json
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
3
|
-
{
|
4
|
-
"tsdocVersion": "0.12",
|
5
|
-
"toolPackages": [
|
6
|
-
{
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
8
|
-
"packageVersion": "7.18.1"
|
9
|
-
}
|
10
|
-
]
|
11
|
-
}
|