@fluentui/react-radio 9.1.9 → 9.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/CHANGELOG.json +90 -6
  2. package/CHANGELOG.md +34 -7
  3. package/dist/index.d.ts +11 -23
  4. package/lib/components/Radio/renderRadio.js +4 -4
  5. package/lib/components/Radio/renderRadio.js.map +1 -1
  6. package/lib/components/Radio/useRadio.js +10 -16
  7. package/lib/components/Radio/useRadio.js.map +1 -1
  8. package/lib/components/RadioGroup/renderRadioGroup.js +5 -5
  9. package/lib/components/RadioGroup/renderRadioGroup.js.map +1 -1
  10. package/lib/contexts/RadioGroupContext.js +11 -3
  11. package/lib/contexts/RadioGroupContext.js.map +1 -1
  12. package/lib/contexts/useRadioGroupContextValues.js +5 -3
  13. package/lib/contexts/useRadioGroupContextValues.js.map +1 -1
  14. package/lib/index.js +1 -3
  15. package/lib/index.js.map +1 -1
  16. package/lib-commonjs/components/Radio/renderRadio.js +4 -5
  17. package/lib-commonjs/components/Radio/renderRadio.js.map +1 -1
  18. package/lib-commonjs/components/Radio/useRadio.js +3 -9
  19. package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
  20. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js +5 -6
  21. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -1
  22. package/lib-commonjs/contexts/RadioGroupContext.js +6 -3
  23. package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
  24. package/lib-commonjs/contexts/useRadioGroupContextValues.js +14 -3
  25. package/lib-commonjs/contexts/useRadioGroupContextValues.js.map +1 -1
  26. package/lib-commonjs/index.js +1 -3
  27. package/lib-commonjs/index.js.map +1 -1
  28. package/package.json +6 -6
  29. package/lib/RadioGroupField.js +0 -2
  30. package/lib/RadioGroupField.js.map +0 -1
  31. package/lib/components/RadioGroupField/RadioGroupField.js +0 -7
  32. package/lib/components/RadioGroupField/RadioGroupField.js.map +0 -1
  33. package/lib/components/RadioGroupField/index.js +0 -2
  34. package/lib/components/RadioGroupField/index.js.map +0 -1
  35. package/lib-commonjs/RadioGroupField.js +0 -9
  36. package/lib-commonjs/RadioGroupField.js.map +0 -1
  37. package/lib-commonjs/components/RadioGroupField/RadioGroupField.js +0 -20
  38. package/lib-commonjs/components/RadioGroupField/RadioGroupField.js.map +0 -1
  39. package/lib-commonjs/components/RadioGroupField/index.js +0 -9
  40. package/lib-commonjs/components/RadioGroupField/index.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,7 +2,91 @@
2
2
  "name": "@fluentui/react-radio",
3
3
  "entries": [
4
4
  {
5
- "date": "Wed, 12 Apr 2023 09:28:16 GMT",
5
+ "date": "Mon, 24 Apr 2023 08:09:15 GMT",
6
+ "tag": "@fluentui/react-radio_v9.1.11",
7
+ "version": "9.1.11",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-radio",
13
+ "commit": "4b4c462351678e8b6f81e3955d6d0a4a25cb212c",
14
+ "comment": "chore: adopt custom JSX pragma"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-radio",
19
+ "comment": "Bump @fluentui/react-field to v9.1.1",
20
+ "commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-radio",
25
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
26
+ "commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-radio",
31
+ "comment": "Bump @fluentui/react-label to v9.1.10",
32
+ "commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Mon, 17 Apr 2023 17:53:54 GMT",
39
+ "tag": "@fluentui/react-radio_v9.1.10",
40
+ "version": "9.1.10",
41
+ "comments": {
42
+ "patch": [
43
+ {
44
+ "author": "behowell@microsoft.com",
45
+ "package": "@fluentui/react-radio",
46
+ "commit": "36f98c3a49334e4ea9b22774691560d11010f2e7",
47
+ "comment": "chore: Update react-field dependency version"
48
+ },
49
+ {
50
+ "author": "behowell@microsoft.com",
51
+ "package": "@fluentui/react-radio",
52
+ "commit": "273116e8efaf4230474a0f214e9adbb5f556e5de",
53
+ "comment": "chore: Remove deprecated RadioGroupField_unstable shim component"
54
+ },
55
+ {
56
+ "author": "behowell@microsoft.com",
57
+ "package": "@fluentui/react-radio",
58
+ "commit": "ae31ec4170f8e86ffa0e94166602a88ca226186d",
59
+ "comment": "chore: Remove the use of ContextSelector in RadioGroupContext"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui/react-radio",
64
+ "comment": "Bump @fluentui/react-field to v9.1.0",
65
+ "commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
66
+ },
67
+ {
68
+ "author": "beachball",
69
+ "package": "@fluentui/react-radio",
70
+ "comment": "Bump @fluentui/react-label to v9.1.9",
71
+ "commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
72
+ },
73
+ {
74
+ "author": "beachball",
75
+ "package": "@fluentui/react-radio",
76
+ "comment": "Bump @fluentui/react-tabster to v9.6.5",
77
+ "commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
78
+ },
79
+ {
80
+ "author": "beachball",
81
+ "package": "@fluentui/react-radio",
82
+ "comment": "Bump @fluentui/react-utilities to v9.8.0",
83
+ "commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
84
+ }
85
+ ]
86
+ }
87
+ },
88
+ {
89
+ "date": "Wed, 12 Apr 2023 09:31:44 GMT",
6
90
  "tag": "@fluentui/react-radio_v9.1.9",
7
91
  "version": "9.1.9",
8
92
  "comments": {
@@ -17,31 +101,31 @@
17
101
  "author": "beachball",
18
102
  "package": "@fluentui/react-radio",
19
103
  "comment": "Bump @fluentui/react-context-selector to v9.1.17",
20
- "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
104
+ "commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
21
105
  },
22
106
  {
23
107
  "author": "beachball",
24
108
  "package": "@fluentui/react-radio",
25
109
  "comment": "Bump @fluentui/react-field to v9.0.0-beta.2",
26
- "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
110
+ "commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
27
111
  },
28
112
  {
29
113
  "author": "beachball",
30
114
  "package": "@fluentui/react-radio",
31
115
  "comment": "Bump @fluentui/react-label to v9.1.8",
32
- "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
116
+ "commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
33
117
  },
34
118
  {
35
119
  "author": "beachball",
36
120
  "package": "@fluentui/react-radio",
37
121
  "comment": "Bump @fluentui/react-tabster to v9.6.4",
38
- "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
122
+ "commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
39
123
  },
40
124
  {
41
125
  "author": "beachball",
42
126
  "package": "@fluentui/react-radio",
43
127
  "comment": "Bump @fluentui/react-utilities to v9.7.4",
44
- "commit": "b48890859f5ce28fe12fd40f6bda26ed486c5e47"
128
+ "commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
45
129
  }
46
130
  ]
47
131
  }
package/CHANGELOG.md CHANGED
@@ -1,22 +1,49 @@
1
1
  # Change Log - @fluentui/react-radio
2
2
 
3
- This log was last generated on Wed, 12 Apr 2023 09:28:16 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 24 Apr 2023 08:09:15 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.1.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.11)
8
+
9
+ Mon, 24 Apr 2023 08:09:15 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.10..@fluentui/react-radio_v9.1.11)
11
+
12
+ ### Patches
13
+
14
+ - chore: adopt custom JSX pragma ([PR #27618](https://github.com/microsoft/fluentui/pull/27618) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-field to v9.1.1 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
17
+ - Bump @fluentui/react-label to v9.1.10 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
18
+
19
+ ## [9.1.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.10)
20
+
21
+ Mon, 17 Apr 2023 17:53:54 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.9..@fluentui/react-radio_v9.1.10)
23
+
24
+ ### Patches
25
+
26
+ - chore: Update react-field dependency version ([PR #27493](https://github.com/microsoft/fluentui/pull/27493) by behowell@microsoft.com)
27
+ - chore: Remove deprecated RadioGroupField_unstable shim component ([PR #27492](https://github.com/microsoft/fluentui/pull/27492) by behowell@microsoft.com)
28
+ - chore: Remove the use of ContextSelector in RadioGroupContext ([PR #27476](https://github.com/microsoft/fluentui/pull/27476) by behowell@microsoft.com)
29
+ - Bump @fluentui/react-field to v9.1.0 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
30
+ - Bump @fluentui/react-label to v9.1.9 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
31
+ - Bump @fluentui/react-tabster to v9.6.5 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
32
+ - Bump @fluentui/react-utilities to v9.8.0 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
33
+
7
34
  ## [9.1.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.9)
8
35
 
9
- Wed, 12 Apr 2023 09:28:16 GMT
36
+ Wed, 12 Apr 2023 09:31:44 GMT
10
37
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-radio_v9.1.8..@fluentui/react-radio_v9.1.9)
11
38
 
12
39
  ### Patches
13
40
 
14
41
  - fix: Have RadioGroup forward aria-describedby to each of the Radio items inside ([PR #27456](https://github.com/microsoft/fluentui/pull/27456) by behowell@microsoft.com)
15
- - Bump @fluentui/react-context-selector to v9.1.17 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
16
- - Bump @fluentui/react-field to v9.0.0-beta.2 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
17
- - Bump @fluentui/react-label to v9.1.8 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
18
- - Bump @fluentui/react-tabster to v9.6.4 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
19
- - Bump @fluentui/react-utilities to v9.7.4 ([commit](https://github.com/microsoft/fluentui/commit/b48890859f5ce28fe12fd40f6bda26ed486c5e47) by beachball)
42
+ - Bump @fluentui/react-context-selector to v9.1.17 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
43
+ - Bump @fluentui/react-field to v9.0.0-beta.2 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
44
+ - Bump @fluentui/react-label to v9.1.8 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
45
+ - Bump @fluentui/react-tabster to v9.6.4 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
46
+ - Bump @fluentui/react-utilities to v9.7.4 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
20
47
 
21
48
  ## [9.1.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-radio_v9.1.8)
22
49
 
package/dist/index.d.ts CHANGED
@@ -2,13 +2,8 @@
2
2
 
3
3
  import type { ComponentProps } from '@fluentui/react-utilities';
4
4
  import type { ComponentState } from '@fluentui/react-utilities';
5
- import { ContextSelector } from '@fluentui/react-context-selector';
6
- import { DeprecatedFieldProps } from '@fluentui/react-field';
7
- import { FC } from 'react';
8
5
  import type { ForwardRefComponent } from '@fluentui/react-utilities';
9
6
  import { Label } from '@fluentui/react-label';
10
- import { Provider } from 'react';
11
- import { ProviderProps } from 'react';
12
7
  import * as React_2 from 'react';
13
8
  import type { Slot } from '@fluentui/react-utilities';
14
9
  import type { SlotClassNames } from '@fluentui/react-utilities';
@@ -33,22 +28,6 @@ export declare type RadioGroupContextValues = {
33
28
  radioGroup: RadioGroupContextValue;
34
29
  };
35
30
 
36
- /** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
37
- export declare const RadioGroupField_unstable: ForwardRefComponent<RadioGroupFieldProps_unstable>;
38
-
39
- /** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
40
- export declare const radioGroupFieldClassNames: {
41
- control: string;
42
- root: string;
43
- label: string;
44
- validationMessage: string;
45
- validationMessageIcon: string;
46
- hint: string;
47
- };
48
-
49
- /** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
50
- export declare type RadioGroupFieldProps_unstable = DeprecatedFieldProps<RadioGroupProps>;
51
-
52
31
  /**
53
32
  * Data for the onChange event for RadioGroup.
54
33
  */
@@ -98,7 +77,7 @@ export declare type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlot
98
77
  required?: boolean;
99
78
  };
100
79
 
101
- export declare const RadioGroupProvider: Provider<RadioGroupContextValue> & FC<ProviderProps<RadioGroupContextValue>>;
80
+ export declare const RadioGroupProvider: React_2.Provider<RadioGroupContextValue | undefined>;
102
81
 
103
82
  export declare type RadioGroupSlots = {
104
83
  /**
@@ -214,7 +193,16 @@ export declare const useRadio_unstable: (props: RadioProps, ref: React_2.Ref<HTM
214
193
  */
215
194
  export declare const useRadioGroup_unstable: (props: RadioGroupProps, ref: React_2.Ref<HTMLDivElement>) => RadioGroupState;
216
195
 
217
- export declare const useRadioGroupContext_unstable: <T>(selector: ContextSelector<RadioGroupContextValue, T>) => T;
196
+ /**
197
+ * @deprecated Use useRadioGroupContextValue_unstable instead.
198
+ * RadioGroupContext is no longer a selector context, and no longer benefits from having a selector.
199
+ */
200
+ export declare const useRadioGroupContext_unstable: <T>(selector: (ctx: RadioGroupContextValue) => T) => T;
201
+
202
+ /**
203
+ * Get the value of the RadioGroupContext.
204
+ */
205
+ export declare const useRadioGroupContextValue_unstable: () => RadioGroupContextValue;
218
206
 
219
207
  export declare const useRadioGroupContextValues: (state: RadioGroupState) => RadioGroupContextValues;
220
208
 
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { getSlots } from '@fluentui/react-utilities';
1
+ /** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
2
+ import { getSlotsNext } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Render the final JSX of Radio
5
5
  */
@@ -7,7 +7,7 @@ export const renderRadio_unstable = state => {
7
7
  const {
8
8
  slots,
9
9
  slotProps
10
- } = getSlots(state);
11
- 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));
10
+ } = getSlotsNext(state);
11
+ return /*#__PURE__*/createElement(slots.root, slotProps.root, /*#__PURE__*/createElement(slots.input, slotProps.input), /*#__PURE__*/createElement(slots.indicator, slotProps.indicator), slots.label && /*#__PURE__*/createElement(slots.label, slotProps.label));
12
12
  };
13
13
  //# sourceMappingURL=renderRadio.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","renderRadio_unstable","state","slots","slotProps","createElement","root","input","indicator","label"],"sources":["../../../src/components/Radio/renderRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { RadioSlots, RadioState } from './Radio.types';\n\n/**\n * Render the final JSX of Radio\n */\nexport const renderRadio_unstable = (state: RadioState) => {\n const { slots, slotProps } = getSlots<RadioSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n <slots.indicator {...slotProps.indicator} />\n {slots.label && <slots.label {...slotProps.label} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAGzB;;;AAGA,OAAO,MAAMC,oBAAA,GAAwBC,KAAA,IAAsB;EACzD,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,QAAA,CAAqBE,KAAA;EAElD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,eAC5BP,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMI,KAAK,EAAKH,SAAA,CAAUG,KAAK,gBAChCR,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMK,SAAS,EAAKJ,SAAA,CAAUI,SAAS,GACvCL,KAAA,CAAMM,KAAK,iBAAIV,KAAA,CAAAM,aAAA,CAACF,KAAA,CAAMM,KAAK,EAAKL,SAAA,CAAUK,KAAK;AAGtD"}
1
+ {"version":3,"names":["createElement","getSlotsNext","renderRadio_unstable","state","slots","slotProps","root","input","indicator","label"],"sources":["../../../src/components/Radio/renderRadio.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport type { RadioSlots, RadioState } from './Radio.types';\n\n/**\n * Render the final JSX of Radio\n */\nexport const renderRadio_unstable = (state: RadioState) => {\n const { slots, slotProps } = getSlotsNext<RadioSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.input {...slotProps.input} />\n <slots.indicator {...slotProps.indicator} />\n {slots.label && <slots.label {...slotProps.label} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAG7B;;;AAGA,OAAO,MAAMC,oBAAA,GAAwBC,KAAA,IAAsB;EACzD,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,YAAA,CAAyBE,KAAA;EAEtD,oBACEH,aAdJ,CAcKI,KAAA,CAAME,IAAI,EAAKD,SAAA,CAAUC,IAAI,eAC5BN,aAfN,CAeOI,KAAA,CAAMG,KAAK,EAAKF,SAAA,CAAUE,KAAK,gBAChCP,aAhBN,CAgBOI,KAAA,CAAMI,SAAS,EAAKH,SAAA,CAAUG,SAAS,GACvCJ,KAAA,CAAMK,KAAK,iBAAIT,aAjBtB,CAiBuBI,KAAA,CAAMK,KAAK,EAAKJ,SAAA,CAAUI,KAAK;AAGtD"}
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { CircleFilled } from '@fluentui/react-icons';
3
3
  import { Label } from '@fluentui/react-label';
4
4
  import { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';
5
- import { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';
5
+ import { useRadioGroupContextValue_unstable } from '../../contexts/RadioGroupContext';
6
6
  import { useFocusWithin } from '@fluentui/react-tabster';
7
7
  /**
8
8
  * Create the state required to render Radio.
@@ -14,21 +14,15 @@ import { useFocusWithin } from '@fluentui/react-tabster';
14
14
  * @param ref - reference to `<input>` element of Radio
15
15
  */
16
16
  export const useRadio_unstable = (props, ref) => {
17
- const nameGroup = useRadioGroupContext_unstable(ctx => ctx.name);
18
- const value = useRadioGroupContext_unstable(ctx => ctx.value);
19
- const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);
20
- const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);
21
- const layout = useRadioGroupContext_unstable(ctx => ctx.layout);
22
- const requiredGroup = useRadioGroupContext_unstable(ctx => ctx.required);
23
- const describedByGroup = useRadioGroupContext_unstable(ctx => ctx['aria-describedby']);
17
+ const group = useRadioGroupContextValue_unstable();
24
18
  const {
25
- name = nameGroup,
26
- checked = value !== undefined ? value === props.value : undefined,
27
- defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,
28
- labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',
29
- disabled = disabledGroup,
30
- required = requiredGroup,
31
- 'aria-describedby': ariaDescribedBy = describedByGroup,
19
+ name = group.name,
20
+ checked = group.value !== undefined ? group.value === props.value : undefined,
21
+ defaultChecked = group.defaultValue !== undefined ? group.defaultValue === props.value : undefined,
22
+ labelPosition = group.layout === 'horizontal-stacked' ? 'below' : 'after',
23
+ disabled = group.disabled,
24
+ required = group.required,
25
+ 'aria-describedby': ariaDescribedBy = group['aria-describedby'],
32
26
  onChange
33
27
  } = props;
34
28
  const nativeProps = getPartitionedNativeProps({
@@ -66,7 +60,7 @@ export const useRadio_unstable = (props, ref) => {
66
60
  const label = resolveShorthand(props.label, {
67
61
  defaultProps: {
68
62
  htmlFor: input.id,
69
- disabled
63
+ disabled: input.disabled
70
64
  }
71
65
  });
72
66
  const indicator = resolveShorthand(props.indicator, {
@@ -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","describedByGroup","checked","undefined","defaultChecked","labelPosition","ariaDescribedBy","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 const describedByGroup = useRadioGroupContext_unstable(ctx => ctx['aria-describedby']);\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 'aria-describedby': ariaDescribedBy = describedByGroup,\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 'aria-describedby': ariaDescribedBy,\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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,YAAY,QAAQ;AAC7B,SAASC,KAAK,QAAQ;AACtB,SAASC,yBAAyB,EAAEC,cAAc,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ;AACnF,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,cAAc,QAAQ;AAG/B;;;;;;;;;AASA,OAAO,MAAMC,iBAAA,GAAoBA,CAACC,KAAA,EAAmBC,GAAA,KAAiD;EACpG,MAAMC,SAAA,GAAYL,6BAAA,CAA8BM,GAAA,IAAOA,GAAA,CAAIC,IAAI;EAC/D,MAAMC,KAAA,GAAQR,6BAAA,CAA8BM,GAAA,IAAOA,GAAA,CAAIE,KAAK;EAC5D,MAAMC,YAAA,GAAeT,6BAAA,CAA8BM,GAAA,IAAOA,GAAA,CAAIG,YAAY;EAC1E,MAAMC,aAAA,GAAgBV,6BAAA,CAA8BM,GAAA,IAAOA,GAAA,CAAIK,QAAQ;EACvE,MAAMC,MAAA,GAASZ,6BAAA,CAA8BM,GAAA,IAAOA,GAAA,CAAIM,MAAM;EAC9D,MAAMC,aAAA,GAAgBb,6BAAA,CAA8BM,GAAA,IAAOA,GAAA,CAAIQ,QAAQ;EACvE,MAAMC,gBAAA,GAAmBf,6BAAA,CAA8BM,GAAA,IAAOA,GAAG,CAAC,mBAAmB;EAErF,MAAM;IACJC,IAAA,GAAOF,SAAA;IACPW,OAAA,GAAUR,KAAA,KAAUS,SAAA,GAAYT,KAAA,KAAUL,KAAA,CAAMK,KAAK,GAAGS,SAAS;IACjEC,cAAA,GAAiBT,YAAA,KAAiBQ,SAAA,GAAYR,YAAA,KAAiBN,KAAA,CAAMK,KAAK,GAAGS,SAAS;IACtFE,aAAA,GAAgBP,MAAA,KAAW,uBAAuB,UAAU,OAAO;IACnED,QAAA,GAAWD,aAAA;IACXI,QAAA,GAAWD,aAAA;IACX,oBAAoBO,eAAA,GAAkBL,gBAAgB;IACtDM;EAAQ,CACT,GAAGlB,KAAA;EAEJ,MAAMmB,WAAA,GAAc1B,yBAAA,CAA0B;IAC5CO,KAAA;IACAoB,kBAAA,EAAoB;IACpBC,iBAAA,EAAmB,CAAC,WAAW,kBAAkB;EACnD;EAEA,MAAMC,IAAA,GAAO3B,gBAAA,CAAiBK,KAAA,CAAMsB,IAAI,EAAE;IACxCX,QAAA,EAAU,IAAI;IACdY,YAAA,EAAc;MACZtB,GAAA,EAAKH,cAAA;MACL,GAAGqB,WAAA,CAAYG;IACjB;EACF;EAEA,MAAME,KAAA,GAAQ7B,gBAAA,CAAiBK,KAAA,CAAMwB,KAAK,EAAE;IAC1Cb,QAAA,EAAU,IAAI;IACdY,YAAA,EAAc;MACZtB,GAAA;MACAwB,IAAA,EAAM;MACNC,EAAA,EAAI9B,KAAA,CAAM,UAAUuB,WAAA,CAAYQ,OAAO,CAACD,EAAE;MAC1CtB,IAAA;MACAS,OAAA;MACAE,cAAA;MACAP,QAAA;MACAG,QAAA;MACA,oBAAoBM,eAAA;MACpB,GAAGE,WAAA,CAAYQ;IACjB;EACF;EAEAH,KAAA,CAAMN,QAAQ,GAAGxB,cAAA,CAAe8B,KAAA,CAAMN,QAAQ,EAAEU,EAAA;IAAM,OAAAV,QAAA,aAAAA,QAAA,uBAAAA,QAAA,CAAWU,EAAA,EAAI;MAAEvB,KAAA,EAAOuB,EAAA,CAAGC,aAAa,CAACxB;IAAM;;EAErG,MAAMyB,KAAA,GAAQnC,gBAAA,CAAiBK,KAAA,CAAM8B,KAAK,EAAE;IAC1CP,YAAA,EAAc;MACZQ,OAAA,EAASP,KAAA,CAAME,EAAE;MACjBlB;IACF;EACF;EAEA,MAAMwB,SAAA,GAAYrC,gBAAA,CAAiBK,KAAA,CAAMgC,SAAS,EAAE;IAClDrB,QAAA,EAAU,IAAI;IACdY,YAAA,EAAc;MACZ,eAAe,IAAI;MACnBU,QAAA,eAAU3C,KAAA,CAAA4C,aAAA,CAAC3C,YAAA;IACb;EACF;EAEA,OAAO;IACLyB,aAAA;IACAmB,UAAA,EAAY;MACVb,IAAA,EAAM;MACNE,KAAA,EAAO;MACPM,KAAA,EAAOtC,KAAA;MACPwC,SAAA,EAAW;IACb;IACAV,IAAA;IACAE,KAAA;IACAM,KAAA;IACAE;EACF;AACF"}
1
+ {"version":3,"names":["React","CircleFilled","Label","getPartitionedNativeProps","mergeCallbacks","resolveShorthand","useId","useRadioGroupContextValue_unstable","useFocusWithin","useRadio_unstable","props","ref","group","name","checked","value","undefined","defaultChecked","defaultValue","labelPosition","layout","disabled","required","ariaDescribedBy","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 { useRadioGroupContextValue_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 group = useRadioGroupContextValue_unstable();\n\n const {\n name = group.name,\n checked = group.value !== undefined ? group.value === props.value : undefined,\n defaultChecked = group.defaultValue !== undefined ? group.defaultValue === props.value : undefined,\n labelPosition = group.layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = group.disabled,\n required = group.required,\n 'aria-describedby': ariaDescribedBy = group['aria-describedby'],\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 'aria-describedby': ariaDescribedBy,\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: input.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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,YAAY,QAAQ;AAC7B,SAASC,KAAK,QAAQ;AACtB,SAASC,yBAAyB,EAAEC,cAAc,EAAEC,gBAAgB,EAAEC,KAAK,QAAQ;AACnF,SAASC,kCAAkC,QAAQ;AACnD,SAASC,cAAc,QAAQ;AAG/B;;;;;;;;;AASA,OAAO,MAAMC,iBAAA,GAAoBA,CAACC,KAAA,EAAmBC,GAAA,KAAiD;EACpG,MAAMC,KAAA,GAAQL,kCAAA;EAEd,MAAM;IACJM,IAAA,GAAOD,KAAA,CAAMC,IAAI;IACjBC,OAAA,GAAUF,KAAA,CAAMG,KAAK,KAAKC,SAAA,GAAYJ,KAAA,CAAMG,KAAK,KAAKL,KAAA,CAAMK,KAAK,GAAGC,SAAS;IAC7EC,cAAA,GAAiBL,KAAA,CAAMM,YAAY,KAAKF,SAAA,GAAYJ,KAAA,CAAMM,YAAY,KAAKR,KAAA,CAAMK,KAAK,GAAGC,SAAS;IAClGG,aAAA,GAAgBP,KAAA,CAAMQ,MAAM,KAAK,uBAAuB,UAAU,OAAO;IACzEC,QAAA,GAAWT,KAAA,CAAMS,QAAQ;IACzBC,QAAA,GAAWV,KAAA,CAAMU,QAAQ;IACzB,oBAAoBC,eAAA,GAAkBX,KAAK,CAAC,mBAAmB;IAC/DY;EAAQ,CACT,GAAGd,KAAA;EAEJ,MAAMe,WAAA,GAActB,yBAAA,CAA0B;IAC5CO,KAAA;IACAgB,kBAAA,EAAoB;IACpBC,iBAAA,EAAmB,CAAC,WAAW,kBAAkB;EACnD;EAEA,MAAMC,IAAA,GAAOvB,gBAAA,CAAiBK,KAAA,CAAMkB,IAAI,EAAE;IACxCN,QAAA,EAAU,IAAI;IACdO,YAAA,EAAc;MACZlB,GAAA,EAAKH,cAAA;MACL,GAAGiB,WAAA,CAAYG;IACjB;EACF;EAEA,MAAME,KAAA,GAAQzB,gBAAA,CAAiBK,KAAA,CAAMoB,KAAK,EAAE;IAC1CR,QAAA,EAAU,IAAI;IACdO,YAAA,EAAc;MACZlB,GAAA;MACAoB,IAAA,EAAM;MACNC,EAAA,EAAI1B,KAAA,CAAM,UAAUmB,WAAA,CAAYQ,OAAO,CAACD,EAAE;MAC1CnB,IAAA;MACAC,OAAA;MACAG,cAAA;MACAI,QAAA;MACAC,QAAA;MACA,oBAAoBC,eAAA;MACpB,GAAGE,WAAA,CAAYQ;IACjB;EACF;EAEAH,KAAA,CAAMN,QAAQ,GAAGpB,cAAA,CAAe0B,KAAA,CAAMN,QAAQ,EAAEU,EAAA;IAAM,OAAAV,QAAA,aAAAA,QAAA,uBAAAA,QAAA,CAAWU,EAAA,EAAI;MAAEnB,KAAA,EAAOmB,EAAA,CAAGC,aAAa,CAACpB;IAAM;;EAErG,MAAMqB,KAAA,GAAQ/B,gBAAA,CAAiBK,KAAA,CAAM0B,KAAK,EAAE;IAC1CP,YAAA,EAAc;MACZQ,OAAA,EAASP,KAAA,CAAME,EAAE;MACjBX,QAAA,EAAUS,KAAA,CAAMT;IAClB;EACF;EAEA,MAAMiB,SAAA,GAAYjC,gBAAA,CAAiBK,KAAA,CAAM4B,SAAS,EAAE;IAClDhB,QAAA,EAAU,IAAI;IACdO,YAAA,EAAc;MACZ,eAAe,IAAI;MACnBU,QAAA,eAAUvC,KAAA,CAAAwC,aAAA,CAACvC,YAAA;IACb;EACF;EAEA,OAAO;IACLkB,aAAA;IACAsB,UAAA,EAAY;MACVb,IAAA,EAAM;MACNE,KAAA,EAAO;MACPM,KAAA,EAAOlC,KAAA;MACPoC,SAAA,EAAW;IACb;IACAV,IAAA;IACAE,KAAA;IACAM,KAAA;IACAE;EACF;AACF"}
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { getSlots } from '@fluentui/react-utilities';
1
+ /** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
2
+ import { getSlotsNext } from '@fluentui/react-utilities';
3
3
  import { RadioGroupContext } from '../../contexts/RadioGroupContext';
4
4
  /**
5
5
  * Render the final JSX of RadioGroup
@@ -8,9 +8,9 @@ export const renderRadioGroup_unstable = (state, contextValues) => {
8
8
  const {
9
9
  slots,
10
10
  slotProps
11
- } = getSlots(state);
12
- return /*#__PURE__*/React.createElement(RadioGroupContext.Provider, {
11
+ } = getSlotsNext(state);
12
+ return /*#__PURE__*/createElement(RadioGroupContext.Provider, {
13
13
  value: contextValues.radioGroup
14
- }, /*#__PURE__*/React.createElement(slots.root, slotProps.root));
14
+ }, /*#__PURE__*/createElement(slots.root, slotProps.root));
15
15
  };
16
16
  //# sourceMappingURL=renderRadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","getSlots","RadioGroupContext","renderRadioGroup_unstable","state","contextValues","slots","slotProps","createElement","Provider","value","radioGroup","root"],"sources":["../../../src/components/RadioGroup/renderRadioGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { RadioGroupContextValues, RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state: RadioGroupState, contextValues: RadioGroupContextValues) => {\n const { slots, slotProps } = getSlots<RadioGroupSlots>(state);\n\n return (\n <RadioGroupContext.Provider value={contextValues.radioGroup}>\n <slots.root {...slotProps.root} />\n </RadioGroupContext.Provider>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AACzB,SAASC,iBAAiB,QAAQ;AAGlC;;;AAGA,OAAO,MAAMC,yBAAA,GAA4BA,CAACC,KAAA,EAAwBC,aAAA,KAA2C;EAC3G,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGN,QAAA,CAA0BG,KAAA;EAEvD,oBACEJ,KAAA,CAAAQ,aAAA,CAACN,iBAAA,CAAkBO,QAAQ;IAACC,KAAA,EAAOL,aAAA,CAAcM;kBAC/CX,KAAA,CAAAQ,aAAA,CAACF,KAAA,CAAMM,IAAI,EAAKL,SAAA,CAAUK,IAAI;AAGpC"}
1
+ {"version":3,"names":["createElement","getSlotsNext","RadioGroupContext","renderRadioGroup_unstable","state","contextValues","slots","slotProps","Provider","value","radioGroup","root"],"sources":["../../../src/components/RadioGroup/renderRadioGroup.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { RadioGroupContextValues, RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state: RadioGroupState, contextValues: RadioGroupContextValues) => {\n const { slots, slotProps } = getSlotsNext<RadioGroupSlots>(state);\n\n return (\n <RadioGroupContext.Provider value={contextValues.radioGroup}>\n <slots.root {...slotProps.root} />\n </RadioGroupContext.Provider>\n );\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAC7B,SAASC,iBAAiB,QAAQ;AAGlC;;;AAGA,OAAO,MAAMC,yBAAA,GAA4BA,CAACC,KAAA,EAAwBC,aAAA,KAA2C;EAC3G,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGN,YAAA,CAA8BG,KAAA;EAE3D,oBACEJ,aAfJ,CAeKE,iBAAA,CAAkBM,QAAQ;IAACC,KAAA,EAAOJ,aAAA,CAAcK;kBAC/CV,aAhBN,CAgBOM,KAAA,CAAMK,IAAI,EAAKJ,SAAA,CAAUI,IAAI;AAGpC"}
@@ -1,9 +1,17 @@
1
- import { createContext, useContextSelector } from '@fluentui/react-context-selector';
1
+ import * as React from 'react';
2
2
  /**
3
3
  * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
4
4
  */
5
- export const RadioGroupContext = /*#__PURE__*/createContext(undefined);
5
+ export const RadioGroupContext = /*#__PURE__*/React.createContext(undefined);
6
6
  const radioGroupContextDefaultValue = {};
7
7
  export const RadioGroupProvider = RadioGroupContext.Provider;
8
- export const useRadioGroupContext_unstable = selector => useContextSelector(RadioGroupContext, (ctx = radioGroupContextDefaultValue) => selector(ctx));
8
+ /**
9
+ * Get the value of the RadioGroupContext.
10
+ */
11
+ export const useRadioGroupContextValue_unstable = () => React.useContext(RadioGroupContext) || radioGroupContextDefaultValue;
12
+ /**
13
+ * @deprecated Use useRadioGroupContextValue_unstable instead.
14
+ * RadioGroupContext is no longer a selector context, and no longer benefits from having a selector.
15
+ */
16
+ export const useRadioGroupContext_unstable = selector => selector(useRadioGroupContextValue_unstable());
9
17
  //# sourceMappingURL=RadioGroupContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContextSelector","RadioGroupContext","undefined","radioGroupContextDefaultValue","RadioGroupProvider","Provider","useRadioGroupContext_unstable","selector","ctx"],"sources":["../../src/contexts/RadioGroupContext.ts"],"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"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAyB;AAInE;;;AAGA,OAAO,MAAMC,iBAAA,gBAAqDF,aAAA,CAChEG,SAAA;AAGF,MAAMC,6BAAA,GAAwD,CAAC;AAE/D,OAAO,MAAMC,kBAAA,GAAqBH,iBAAA,CAAkBI,QAAQ;AAE5D,OAAO,MAAMC,6BAAA,GAAoCC,QAAA,IAC/CP,kBAAA,CAAmBC,iBAAA,EAAmB,CAACO,GAAA,GAAML,6BAA6B,KAAKI,QAAA,CAASC,GAAA"}
1
+ {"version":3,"names":["React","RadioGroupContext","createContext","undefined","radioGroupContextDefaultValue","RadioGroupProvider","Provider","useRadioGroupContextValue_unstable","useContext","useRadioGroupContext_unstable","selector"],"sources":["../../src/contexts/RadioGroupContext.ts"],"sourcesContent":["import * as React from 'react';\n\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 = React.createContext<RadioGroupContextValue | undefined>(undefined);\n\nconst radioGroupContextDefaultValue: RadioGroupContextValue = {};\n\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n\n/**\n * Get the value of the RadioGroupContext.\n */\nexport const useRadioGroupContextValue_unstable = () =>\n React.useContext(RadioGroupContext) || radioGroupContextDefaultValue;\n\n/**\n * @deprecated Use useRadioGroupContextValue_unstable instead.\n * RadioGroupContext is no longer a selector context, and no longer benefits from having a selector.\n */\nexport const useRadioGroupContext_unstable = <T>(selector: (ctx: RadioGroupContextValue) => T): T =>\n selector(useRadioGroupContextValue_unstable());\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAIvB;;;AAGA,OAAO,MAAMC,iBAAA,gBAAoBD,KAAA,CAAME,aAAa,CAAqCC,SAAA;AAEzF,MAAMC,6BAAA,GAAwD,CAAC;AAE/D,OAAO,MAAMC,kBAAA,GAAqBJ,iBAAA,CAAkBK,QAAQ;AAE5D;;;AAGA,OAAO,MAAMC,kCAAA,GAAqCA,CAAA,KAChDP,KAAA,CAAMQ,UAAU,CAACP,iBAAA,KAAsBG,6BAAA;AAEzC;;;;AAIA,OAAO,MAAMK,6BAAA,GAAoCC,QAAA,IAC/CA,QAAA,CAASH,kCAAA"}
@@ -1,3 +1,4 @@
1
+ import * as React from 'react';
1
2
  export const useRadioGroupContextValues = state => {
2
3
  const {
3
4
  name,
@@ -7,15 +8,16 @@ export const useRadioGroupContextValues = state => {
7
8
  layout,
8
9
  required
9
10
  } = state;
10
- const radioGroup = {
11
+ const ariaDescribedBy = state.root['aria-describedby'];
12
+ const radioGroup = React.useMemo(() => ({
11
13
  name,
12
14
  value,
13
15
  defaultValue,
14
16
  disabled,
15
17
  layout,
16
18
  required,
17
- 'aria-describedby': state.root['aria-describedby']
18
- };
19
+ 'aria-describedby': ariaDescribedBy
20
+ }), [name, value, defaultValue, disabled, layout, required, ariaDescribedBy]);
19
21
  return {
20
22
  radioGroup
21
23
  };
@@ -1 +1 @@
1
- {"version":3,"names":["useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","radioGroup","root"],"sources":["../../src/contexts/useRadioGroupContextValues.ts"],"sourcesContent":["import type { RadioGroupContextValue, RadioGroupContextValues, RadioGroupState } from '../RadioGroup';\n\nexport const useRadioGroupContextValues = (state: RadioGroupState): RadioGroupContextValues => {\n const { name, value, defaultValue, disabled, layout, required } = state;\n\n const radioGroup: RadioGroupContextValue = {\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required,\n 'aria-describedby': state.root['aria-describedby'],\n };\n\n return { radioGroup };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,0BAAA,GAA8BC,KAAA,IAAoD;EAC7F,MAAM;IAAEC,IAAA;IAAMC,KAAA;IAAOC,YAAA;IAAcC,QAAA;IAAUC,MAAA;IAAQC;EAAQ,CAAE,GAAGN,KAAA;EAElE,MAAMO,UAAA,GAAqC;IACzCN,IAAA;IACAC,KAAA;IACAC,YAAA;IACAC,QAAA;IACAC,MAAA;IACAC,QAAA;IACA,oBAAoBN,KAAA,CAAMQ,IAAI,CAAC;EACjC;EAEA,OAAO;IAAED;EAAW;AACtB"}
1
+ {"version":3,"names":["React","useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","ariaDescribedBy","root","radioGroup","useMemo"],"sources":["../../src/contexts/useRadioGroupContextValues.ts"],"sourcesContent":["import * as React from 'react';\n\nimport type { RadioGroupContextValue, RadioGroupContextValues, RadioGroupState } from '../RadioGroup';\n\nexport const useRadioGroupContextValues = (state: RadioGroupState): RadioGroupContextValues => {\n const { name, value, defaultValue, disabled, layout, required } = state;\n const ariaDescribedBy = state.root['aria-describedby'];\n\n const radioGroup = React.useMemo<RadioGroupContextValue>(\n () => ({\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required,\n 'aria-describedby': ariaDescribedBy,\n }),\n [name, value, defaultValue, disabled, layout, required, ariaDescribedBy],\n );\n\n return { radioGroup };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AAIvB,OAAO,MAAMC,0BAAA,GAA8BC,KAAA,IAAoD;EAC7F,MAAM;IAAEC,IAAA;IAAMC,KAAA;IAAOC,YAAA;IAAcC,QAAA;IAAUC,MAAA;IAAQC;EAAQ,CAAE,GAAGN,KAAA;EAClE,MAAMO,eAAA,GAAkBP,KAAA,CAAMQ,IAAI,CAAC,mBAAmB;EAEtD,MAAMC,UAAA,GAAaX,KAAA,CAAMY,OAAO,CAC9B,OAAO;IACLT,IAAA;IACAC,KAAA;IACAC,YAAA;IACAC,QAAA;IACAC,MAAA;IACAC,QAAA;IACA,oBAAoBC;EACtB,IACA,CAACN,IAAA,EAAMC,KAAA,EAAOC,YAAA,EAAcC,QAAA,EAAUC,MAAA,EAAQC,QAAA,EAAUC,eAAA,CAAgB;EAG1E,OAAO;IAAEE;EAAW;AACtB"}
package/lib/index.js CHANGED
@@ -1,6 +1,4 @@
1
1
  export { RadioGroup, radioGroupClassNames, renderRadioGroup_unstable, useRadioGroupStyles_unstable, useRadioGroup_unstable } from './RadioGroup';
2
2
  export { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';
3
- export { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable } from './contexts/index';
4
- // eslint-disable-next-line deprecation/deprecation
5
- export { RadioGroupField as RadioGroupField_unstable, radioGroupFieldClassNames } from './RadioGroupField';
3
+ export { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable, useRadioGroupContextValue_unstable } from './contexts/index';
6
4
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["RadioGroup","radioGroupClassNames","renderRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroup_unstable","Radio","radioClassNames","renderRadio_unstable","useRadioStyles_unstable","useRadio_unstable","RadioGroupProvider","useRadioGroupContextValues","useRadioGroupContext_unstable","RadioGroupField","RadioGroupField_unstable","radioGroupFieldClassNames"],"sources":["../src/index.ts"],"sourcesContent":["export {\n RadioGroup,\n radioGroupClassNames,\n renderRadioGroup_unstable,\n useRadioGroupStyles_unstable,\n useRadioGroup_unstable,\n} from './RadioGroup';\nexport type {\n RadioGroupContextValue,\n RadioGroupContextValues,\n RadioGroupOnChangeData,\n RadioGroupProps,\n RadioGroupSlots,\n RadioGroupState,\n} from './RadioGroup';\nexport { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';\nexport type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';\nexport { RadioGroupProvider, useRadioGroupContextValues, useRadioGroupContext_unstable } from './contexts/index';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { RadioGroupField as RadioGroupField_unstable, radioGroupFieldClassNames } from './RadioGroupField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { RadioGroupFieldProps as RadioGroupFieldProps_unstable } from './RadioGroupField';\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB;AASP,SAASC,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ;AAEzG,SAASC,kBAAkB,EAAEC,0BAA0B,EAAEC,6BAA6B,QAAQ;AAE9F;AACA,SAASC,eAAA,IAAmBC,wBAAwB,EAAEC,yBAAyB,QAAQ"}
1
+ {"version":3,"names":["RadioGroup","radioGroupClassNames","renderRadioGroup_unstable","useRadioGroupStyles_unstable","useRadioGroup_unstable","Radio","radioClassNames","renderRadio_unstable","useRadioStyles_unstable","useRadio_unstable","RadioGroupProvider","useRadioGroupContextValues","useRadioGroupContext_unstable","useRadioGroupContextValue_unstable"],"sources":["../src/index.ts"],"sourcesContent":["export {\n RadioGroup,\n radioGroupClassNames,\n renderRadioGroup_unstable,\n useRadioGroupStyles_unstable,\n useRadioGroup_unstable,\n} from './RadioGroup';\nexport type {\n RadioGroupContextValue,\n RadioGroupContextValues,\n RadioGroupOnChangeData,\n RadioGroupProps,\n RadioGroupSlots,\n RadioGroupState,\n} from './RadioGroup';\nexport { Radio, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable } from './Radio';\nexport type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';\nexport {\n RadioGroupProvider,\n useRadioGroupContextValues,\n useRadioGroupContext_unstable, // eslint-disable-line deprecation/deprecation\n useRadioGroupContextValue_unstable,\n} from './contexts/index';\n"],"mappings":"AAAA,SACEA,UAAU,EACVC,oBAAoB,EACpBC,yBAAyB,EACzBC,4BAA4B,EAC5BC,sBAAsB,QACjB;AASP,SAASC,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ;AAEzG,SACEC,kBAAkB,EAClBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,kCAAkC,QAC7B"}
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ /** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "renderRadio_unstable", {
6
6
  enumerable: true,
7
7
  get: ()=>renderRadio_unstable
8
8
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
11
10
  const _reactUtilities = require("@fluentui/react-utilities");
12
11
  const renderRadio_unstable = (state)=>{
13
- const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
14
- 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));
12
+ const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
13
+ return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.input, slotProps.input), /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.indicator, slotProps.indicator), slots.label && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.label, slotProps.label));
15
14
  }; //# sourceMappingURL=renderRadio.js.map
16
15
 
17
16
  //# sourceMappingURL=renderRadio.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"sources":["../../../lib/components/Radio/renderRadio.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } 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 } = getSlotsNext(state);\n return /*#__PURE__*/createElement(slots.root, slotProps.root, /*#__PURE__*/createElement(slots.input, slotProps.input), /*#__PURE__*/createElement(slots.indicator, slotProps.indicator), slots.label && /*#__PURE__*/createElement(slots.label, slotProps.label));\n};\n//# sourceMappingURL=renderRadio.js.map"],"names":["renderRadio_unstable","state","slots","slotProps","getSlotsNext","createElement","root","input","indicator","label"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAKrCA;;aAAAA;;iCALqE;gCACrD;AAItB,MAAMA,uBAAuBC,CAAAA,QAAS;IAC3C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,4BAAY,EAACH;IACjB,OAAO,WAAW,GAAEI,IAAAA,8BAAa,EAACH,MAAMI,IAAI,EAAEH,UAAUG,IAAI,EAAE,WAAW,GAAED,IAAAA,8BAAa,EAACH,MAAMK,KAAK,EAAEJ,UAAUI,KAAK,GAAG,WAAW,GAAEF,IAAAA,8BAAa,EAACH,MAAMM,SAAS,EAAEL,UAAUK,SAAS,GAAGN,MAAMO,KAAK,IAAI,WAAW,GAAEJ,IAAAA,8BAAa,EAACH,MAAMO,KAAK,EAAEN,UAAUM,KAAK;AAClQ,GACA,uCAAuC"}
@@ -14,14 +14,8 @@ const _reactUtilities = require("@fluentui/react-utilities");
14
14
  const _radioGroupContext = require("../../contexts/RadioGroupContext");
15
15
  const _reactTabster = require("@fluentui/react-tabster");
16
16
  const useRadio_unstable = (props, ref)=>{
17
- const nameGroup = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.name);
18
- const value = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.value);
19
- const defaultValue = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.defaultValue);
20
- const disabledGroup = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.disabled);
21
- const layout = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.layout);
22
- const requiredGroup = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx.required);
23
- const describedByGroup = (0, _radioGroupContext.useRadioGroupContext_unstable)((ctx)=>ctx['aria-describedby']);
24
- 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 , 'aria-describedby': ariaDescribedBy = describedByGroup , onChange } = props;
17
+ const group = (0, _radioGroupContext.useRadioGroupContextValue_unstable)();
18
+ const { name =group.name , checked =group.value !== undefined ? group.value === props.value : undefined , defaultChecked =group.defaultValue !== undefined ? group.defaultValue === props.value : undefined , labelPosition =group.layout === 'horizontal-stacked' ? 'below' : 'after' , disabled =group.disabled , required =group.required , 'aria-describedby': ariaDescribedBy = group['aria-describedby'] , onChange } = props;
25
19
  const nativeProps = (0, _reactUtilities.getPartitionedNativeProps)({
26
20
  props,
27
21
  primarySlotTagName: 'input',
@@ -61,7 +55,7 @@ const useRadio_unstable = (props, ref)=>{
61
55
  const label = (0, _reactUtilities.resolveShorthand)(props.label, {
62
56
  defaultProps: {
63
57
  htmlFor: input.id,
64
- disabled
58
+ disabled: input.disabled
65
59
  }
66
60
  });
67
61
  const indicator = (0, _reactUtilities.resolveShorthand)(props.indicator, {
@@ -1 +1 @@
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 describedByGroup = useRadioGroupContext_unstable(ctx => ctx['aria-describedby']);\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 'aria-describedby': ariaDescribedBy = describedByGroup,\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 'aria-describedby': ariaDescribedBy,\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","describedByGroup","checked","undefined","defaultChecked","labelPosition","ariaDescribedBy","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,MAAMC,mBAAmBV,IAAAA,gDAA6B,EAACC,CAAAA,MAAOA,GAAG,CAAC,mBAAmB;IACrF,MAAM,EACJC,MAAOH,UAAS,EAChBY,SAAUR,UAAUS,YAAYT,UAAUN,MAAMM,KAAK,GAAGS,SAAS,CAAA,EACjEC,gBAAiBT,iBAAiBQ,YAAYR,iBAAiBP,MAAMM,KAAK,GAAGS,SAAS,CAAA,EACtFE,eAAgBP,WAAW,uBAAuB,UAAU,OAAO,CAAA,EACnED,UAAWD,cAAa,EACxBI,UAAWD,cAAa,EACxB,oBAAoBO,kBAAkBL,gBAAgB,CAAA,EACtDM,SAAQ,EACT,GAAGnB;IACJ,MAAMoB,cAAcC,IAAAA,yCAAyB,EAAC;QAC5CrB;QACAsB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAW;YAAkB;SAAW;IAC9D;IACA,MAAMC,OAAOC,IAAAA,gCAAgB,EAACzB,MAAMwB,IAAI,EAAE;QACxCZ,UAAU,IAAI;QACdc,cAAc;YACZzB,KAAK0B,IAAAA,4BAAc;YACnB,GAAGP,YAAYI,IAAI;QACrB;IACF;IACA,MAAMI,QAAQH,IAAAA,gCAAgB,EAACzB,MAAM4B,KAAK,EAAE;QAC1ChB,UAAU,IAAI;QACdc,cAAc;YACZzB;YACA4B,MAAM;YACNC,IAAIC,IAAAA,qBAAK,EAAC,UAAUX,YAAYY,OAAO,CAACF,EAAE;YAC1CzB;YACAS;YACAE;YACAP;YACAG;YACA,oBAAoBM;YACpB,GAAGE,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;YACtE5B,OAAO4B,GAAGC,aAAa,CAAC7B,KAAK;QAC/B,EAAE;IACJ;IACA,MAAM8B,QAAQX,IAAAA,gCAAgB,EAACzB,MAAMoC,KAAK,EAAE;QAC1CV,cAAc;YACZW,SAAST,MAAME,EAAE;YACjBrB;QACF;IACF;IACA,MAAM6B,YAAYb,IAAAA,gCAAgB,EAACzB,MAAMsC,SAAS,EAAE;QAClD1B,UAAU,IAAI;QACdc,cAAc;YACZ,eAAe,IAAI;YACnBa,UAAU,WAAW,GAAEC,OAAMC,aAAa,CAACC,wBAAY,EAAE,IAAI;QAC/D;IACF;IACA,OAAO;QACLzB;QACA0B,YAAY;YACVnB,MAAM;YACNI,OAAO;YACPQ,OAAOQ,iBAAK;YACZN,WAAW;QACb;QACAd;QACAI;QACAQ;QACAE;IACF;AACF,GACA,oCAAoC"}
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 { useRadioGroupContextValue_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 group = useRadioGroupContextValue_unstable();\n const {\n name = group.name,\n checked = group.value !== undefined ? group.value === props.value : undefined,\n defaultChecked = group.defaultValue !== undefined ? group.defaultValue === props.value : undefined,\n labelPosition = group.layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = group.disabled,\n required = group.required,\n 'aria-describedby': ariaDescribedBy = group['aria-describedby'],\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 'aria-describedby': ariaDescribedBy,\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: input.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","group","useRadioGroupContextValue_unstable","name","checked","value","undefined","defaultChecked","defaultValue","labelPosition","layout","disabled","required","ariaDescribedBy","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;mCAChC;8BACpB;AAUxB,MAAMA,oBAAoB,CAACC,OAAOC,MAAQ;IAC/C,MAAMC,QAAQC,IAAAA,qDAAkC;IAChD,MAAM,EACJC,MAAOF,MAAME,IAAI,CAAA,EACjBC,SAAUH,MAAMI,KAAK,KAAKC,YAAYL,MAAMI,KAAK,KAAKN,MAAMM,KAAK,GAAGC,SAAS,CAAA,EAC7EC,gBAAiBN,MAAMO,YAAY,KAAKF,YAAYL,MAAMO,YAAY,KAAKT,MAAMM,KAAK,GAAGC,SAAS,CAAA,EAClGG,eAAgBR,MAAMS,MAAM,KAAK,uBAAuB,UAAU,OAAO,CAAA,EACzEC,UAAWV,MAAMU,QAAQ,CAAA,EACzBC,UAAWX,MAAMW,QAAQ,CAAA,EACzB,oBAAoBC,kBAAkBZ,KAAK,CAAC,mBAAmB,CAAA,EAC/Da,SAAQ,EACT,GAAGf;IACJ,MAAMgB,cAAcC,IAAAA,yCAAyB,EAAC;QAC5CjB;QACAkB,oBAAoB;QACpBC,mBAAmB;YAAC;YAAW;YAAkB;SAAW;IAC9D;IACA,MAAMC,OAAOC,IAAAA,gCAAgB,EAACrB,MAAMoB,IAAI,EAAE;QACxCP,UAAU,IAAI;QACdS,cAAc;YACZrB,KAAKsB,IAAAA,4BAAc;YACnB,GAAGP,YAAYI,IAAI;QACrB;IACF;IACA,MAAMI,QAAQH,IAAAA,gCAAgB,EAACrB,MAAMwB,KAAK,EAAE;QAC1CX,UAAU,IAAI;QACdS,cAAc;YACZrB;YACAwB,MAAM;YACNC,IAAIC,IAAAA,qBAAK,EAAC,UAAUX,YAAYY,OAAO,CAACF,EAAE;YAC1CtB;YACAC;YACAG;YACAI;YACAC;YACA,oBAAoBC;YACpB,GAAGE,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;YACtExB,OAAOwB,GAAGC,aAAa,CAACzB,KAAK;QAC/B,EAAE;IACJ;IACA,MAAM0B,QAAQX,IAAAA,gCAAgB,EAACrB,MAAMgC,KAAK,EAAE;QAC1CV,cAAc;YACZW,SAAST,MAAME,EAAE;YACjBd,UAAUY,MAAMZ,QAAQ;QAC1B;IACF;IACA,MAAMsB,YAAYb,IAAAA,gCAAgB,EAACrB,MAAMkC,SAAS,EAAE;QAClDrB,UAAU,IAAI;QACdS,cAAc;YACZ,eAAe,IAAI;YACnBa,UAAU,WAAW,GAAEC,OAAMC,aAAa,CAACC,wBAAY,EAAE,IAAI;QAC/D;IACF;IACA,OAAO;QACL5B;QACA6B,YAAY;YACVnB,MAAM;YACNI,OAAO;YACPQ,OAAOQ,iBAAK;YACZN,WAAW;QACb;QACAd;QACAI;QACAQ;QACAE;IACF;AACF,GACA,oCAAoC"}
@@ -1,4 +1,4 @@
1
- "use strict";
1
+ /** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
@@ -6,15 +6,14 @@ Object.defineProperty(exports, "renderRadioGroup_unstable", {
6
6
  enumerable: true,
7
7
  get: ()=>renderRadioGroup_unstable
8
8
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
+ const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
11
10
  const _reactUtilities = require("@fluentui/react-utilities");
12
11
  const _radioGroupContext = require("../../contexts/RadioGroupContext");
13
12
  const renderRadioGroup_unstable = (state, contextValues)=>{
14
- const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
15
- return /*#__PURE__*/ _react.createElement(_radioGroupContext.RadioGroupContext.Provider, {
13
+ const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
14
+ return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_radioGroupContext.RadioGroupContext.Provider, {
16
15
  value: contextValues.radioGroup
17
- }, /*#__PURE__*/ _react.createElement(slots.root, slotProps.root));
16
+ }, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root));
18
17
  }; //# sourceMappingURL=renderRadioGroup.js.map
19
18
 
20
19
  //# sourceMappingURL=renderRadioGroup.js.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"sources":["../../../lib/components/RadioGroup/renderRadioGroup.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } 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 } = getSlotsNext(state);\n return /*#__PURE__*/createElement(RadioGroupContext.Provider, {\n value: contextValues.radioGroup\n }, /*#__PURE__*/createElement(slots.root, slotProps.root));\n};\n//# sourceMappingURL=renderRadioGroup.js.map"],"names":["renderRadioGroup_unstable","state","contextValues","slots","slotProps","getSlotsNext","createElement","RadioGroupContext","Provider","value","radioGroup","root"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAMrCA;;aAAAA;;iCANqE;gCACrD;mCACK;AAI3B,MAAMA,4BAA4B,CAACC,OAAOC,gBAAkB;IACjE,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,4BAAY,EAACJ;IACjB,OAAO,WAAW,GAAEK,IAAAA,8BAAa,EAACC,oCAAiB,CAACC,QAAQ,EAAE;QAC5DC,OAAOP,cAAcQ,UAAU;IACjC,GAAG,WAAW,GAAEJ,IAAAA,8BAAa,EAACH,MAAMQ,IAAI,EAAEP,UAAUO,IAAI;AAC1D,GACA,4CAA4C"}
@@ -11,12 +11,15 @@ function _export(target, all) {
11
11
  _export(exports, {
12
12
  RadioGroupContext: ()=>RadioGroupContext,
13
13
  RadioGroupProvider: ()=>RadioGroupProvider,
14
+ useRadioGroupContextValue_unstable: ()=>useRadioGroupContextValue_unstable,
14
15
  useRadioGroupContext_unstable: ()=>useRadioGroupContext_unstable
15
16
  });
16
- const _reactContextSelector = require("@fluentui/react-context-selector");
17
- const RadioGroupContext = /*#__PURE__*/ (0, _reactContextSelector.createContext)(undefined);
17
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
18
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
19
+ const RadioGroupContext = /*#__PURE__*/ _react.createContext(undefined);
18
20
  const radioGroupContextDefaultValue = {};
19
21
  const RadioGroupProvider = RadioGroupContext.Provider;
20
- const useRadioGroupContext_unstable = (selector)=>(0, _reactContextSelector.useContextSelector)(RadioGroupContext, (ctx = radioGroupContextDefaultValue)=>selector(ctx)); //# sourceMappingURL=RadioGroupContext.js.map
22
+ const useRadioGroupContextValue_unstable = ()=>_react.useContext(RadioGroupContext) || radioGroupContextDefaultValue;
23
+ const useRadioGroupContext_unstable = (selector)=>selector(useRadioGroupContextValue_unstable()); //# sourceMappingURL=RadioGroupContext.js.map
21
24
 
22
25
  //# sourceMappingURL=RadioGroupContext.js.map
@@ -1 +1 @@
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
+ {"version":3,"sources":["../../lib/contexts/RadioGroupContext.js"],"sourcesContent":["import * as React from 'react';\n/**\n * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.\n */\nexport const RadioGroupContext = /*#__PURE__*/React.createContext(undefined);\nconst radioGroupContextDefaultValue = {};\nexport const RadioGroupProvider = RadioGroupContext.Provider;\n/**\n * Get the value of the RadioGroupContext.\n */\nexport const useRadioGroupContextValue_unstable = () => React.useContext(RadioGroupContext) || radioGroupContextDefaultValue;\n/**\n * @deprecated Use useRadioGroupContextValue_unstable instead.\n * RadioGroupContext is no longer a selector context, and no longer benefits from having a selector.\n */\nexport const useRadioGroupContext_unstable = selector => selector(useRadioGroupContextValue_unstable());\n//# sourceMappingURL=RadioGroupContext.js.map"],"names":["RadioGroupContext","RadioGroupProvider","useRadioGroupContextValue_unstable","useRadioGroupContext_unstable","React","createContext","undefined","radioGroupContextDefaultValue","Provider","useContext","selector"],"mappings":";;;;;;;;;;;IAIaA,iBAAiB,MAAjBA;IAEAC,kBAAkB,MAAlBA;IAIAC,kCAAkC,MAAlCA;IAKAC,6BAA6B,MAA7BA;;;6DAfU;AAIhB,MAAMH,oBAAoB,WAAW,GAAEI,OAAMC,aAAa,CAACC;AAClE,MAAMC,gCAAgC,CAAC;AAChC,MAAMN,qBAAqBD,kBAAkBQ,QAAQ;AAIrD,MAAMN,qCAAqC,IAAME,OAAMK,UAAU,CAACT,sBAAsBO;AAKxF,MAAMJ,gCAAgCO,CAAAA,WAAYA,SAASR,uCAClE,6CAA6C"}
@@ -6,17 +6,28 @@ Object.defineProperty(exports, "useRadioGroupContextValues", {
6
6
  enumerable: true,
7
7
  get: ()=>useRadioGroupContextValues
8
8
  });
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
9
11
  const useRadioGroupContextValues = (state)=>{
10
12
  const { name , value , defaultValue , disabled , layout , required } = state;
11
- const radioGroup = {
13
+ const ariaDescribedBy = state.root['aria-describedby'];
14
+ const radioGroup = _react.useMemo(()=>({
15
+ name,
16
+ value,
17
+ defaultValue,
18
+ disabled,
19
+ layout,
20
+ required,
21
+ 'aria-describedby': ariaDescribedBy
22
+ }), [
12
23
  name,
13
24
  value,
14
25
  defaultValue,
15
26
  disabled,
16
27
  layout,
17
28
  required,
18
- 'aria-describedby': state.root['aria-describedby']
19
- };
29
+ ariaDescribedBy
30
+ ]);
20
31
  return {
21
32
  radioGroup
22
33
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../lib/contexts/useRadioGroupContextValues.js"],"sourcesContent":["export const useRadioGroupContextValues = state => {\n const {\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required\n } = state;\n const radioGroup = {\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required,\n 'aria-describedby': state.root['aria-describedby']\n };\n return {\n radioGroup\n };\n};\n//# sourceMappingURL=useRadioGroupContextValues.js.map"],"names":["useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","radioGroup","root"],"mappings":";;;;+BAAaA;;aAAAA;;AAAN,MAAMA,6BAA6BC,CAAAA,QAAS;IACjD,MAAM,EACJC,KAAI,EACJC,MAAK,EACLC,aAAY,EACZC,SAAQ,EACRC,OAAM,EACNC,SAAQ,EACT,GAAGN;IACJ,MAAMO,aAAa;QACjBN;QACAC;QACAC;QACAC;QACAC;QACAC;QACA,oBAAoBN,MAAMQ,IAAI,CAAC,mBAAmB;IACpD;IACA,OAAO;QACLD;IACF;AACF,GACA,sDAAsD"}
1
+ {"version":3,"sources":["../../lib/contexts/useRadioGroupContextValues.js"],"sourcesContent":["import * as React from 'react';\nexport const useRadioGroupContextValues = state => {\n const {\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required\n } = state;\n const ariaDescribedBy = state.root['aria-describedby'];\n const radioGroup = React.useMemo(() => ({\n name,\n value,\n defaultValue,\n disabled,\n layout,\n required,\n 'aria-describedby': ariaDescribedBy\n }), [name, value, defaultValue, disabled, layout, required, ariaDescribedBy]);\n return {\n radioGroup\n };\n};\n//# sourceMappingURL=useRadioGroupContextValues.js.map"],"names":["useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","ariaDescribedBy","root","radioGroup","React","useMemo"],"mappings":";;;;+BACaA;;aAAAA;;;6DADU;AAChB,MAAMA,6BAA6BC,CAAAA,QAAS;IACjD,MAAM,EACJC,KAAI,EACJC,MAAK,EACLC,aAAY,EACZC,SAAQ,EACRC,OAAM,EACNC,SAAQ,EACT,GAAGN;IACJ,MAAMO,kBAAkBP,MAAMQ,IAAI,CAAC,mBAAmB;IACtD,MAAMC,aAAaC,OAAMC,OAAO,CAAC,IAAO,CAAA;YACtCV;YACAC;YACAC;YACAC;YACAC;YACAC;YACA,oBAAoBC;QACtB,CAAA,GAAI;QAACN;QAAMC;QAAOC;QAAcC;QAAUC;QAAQC;QAAUC;KAAgB;IAC5E,OAAO;QACLE;IACF;AACF,GACA,sDAAsD"}
@@ -22,13 +22,11 @@ _export(exports, {
22
22
  RadioGroupProvider: ()=>_index.RadioGroupProvider,
23
23
  useRadioGroupContextValues: ()=>_index.useRadioGroupContextValues,
24
24
  useRadioGroupContext_unstable: ()=>_index.useRadioGroupContext_unstable,
25
- RadioGroupField_unstable: ()=>_radioGroupField.RadioGroupField,
26
- radioGroupFieldClassNames: ()=>_radioGroupField.radioGroupFieldClassNames
25
+ useRadioGroupContextValue_unstable: ()=>_index.useRadioGroupContextValue_unstable
27
26
  });
28
27
  const _radioGroup = require("./RadioGroup");
29
28
  const _radio = require("./Radio");
30
29
  const _index = require("./contexts/index");
31
- const _radioGroupField = require("./RadioGroupField");
32
30
  //# sourceMappingURL=index.js.map
33
31
 
34
32
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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"}
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, useRadioGroupContextValue_unstable } from './contexts/index';\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","useRadioGroupContextValue_unstable"],"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;IAAEC,kCAAkC,MAAlCA,yCAAkC;;4BAFQ;uBACzB;uBACyB;CAClI,iCAAiC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-radio",
3
- "version": "9.1.9",
3
+ "version": "9.1.11",
4
4
  "description": "Fluent UI Radio component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -32,14 +32,14 @@
32
32
  "@fluentui/scripts-tasks": "*"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-context-selector": "^9.1.17",
36
- "@fluentui/react-field": "9.0.0-beta.2",
35
+ "@fluentui/react-field": "^9.1.1",
37
36
  "@fluentui/react-icons": "^2.0.196",
38
- "@fluentui/react-label": "^9.1.8",
37
+ "@fluentui/react-jsx-runtime": "9.0.0-alpha.2",
38
+ "@fluentui/react-label": "^9.1.10",
39
39
  "@fluentui/react-shared-contexts": "^9.3.3",
40
- "@fluentui/react-tabster": "^9.6.4",
40
+ "@fluentui/react-tabster": "^9.6.5",
41
41
  "@fluentui/react-theme": "^9.1.7",
42
- "@fluentui/react-utilities": "^9.7.4",
42
+ "@fluentui/react-utilities": "^9.8.0",
43
43
  "@griffel/react": "^1.5.2",
44
44
  "@swc/helpers": "^0.4.14"
45
45
  },
@@ -1,2 +0,0 @@
1
- export * from './components/RadioGroupField/index';
2
- //# sourceMappingURL=RadioGroupField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../src/RadioGroupField.ts"],"sourcesContent":["export * from './components/RadioGroupField/index';\n"],"mappings":"AAAA,cAAc"}
@@ -1,7 +0,0 @@
1
- /* eslint-disable deprecation/deprecation */import { getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';
2
- import { RadioGroup, radioGroupClassNames } from '../../RadioGroup';
3
- /** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
4
- export const radioGroupFieldClassNames = /*#__PURE__*/getDeprecatedFieldClassNames(radioGroupClassNames.root);
5
- /** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */
6
- export const RadioGroupField = /*#__PURE__*/makeDeprecatedField(RadioGroup);
7
- //# sourceMappingURL=RadioGroupField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["getDeprecatedFieldClassNames","makeDeprecatedField","RadioGroup","radioGroupClassNames","radioGroupFieldClassNames","root","RadioGroupField"],"sources":["../../../src/components/RadioGroupField/RadioGroupField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport { DeprecatedFieldProps, getDeprecatedFieldClassNames, makeDeprecatedField } from '@fluentui/react-field';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { RadioGroup, radioGroupClassNames, RadioGroupProps } from '../../RadioGroup';\n\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport type RadioGroupFieldProps = DeprecatedFieldProps<RadioGroupProps>;\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const radioGroupFieldClassNames = getDeprecatedFieldClassNames(radioGroupClassNames.root);\n/** @deprecated Use Field with RadioGroup: `<Field><RadioGroup /></Field>` */\nexport const RadioGroupField: ForwardRefComponent<RadioGroupFieldProps> = makeDeprecatedField(RadioGroup);\n"],"mappings":"AAAA,4CACA,SAA+BA,4BAA4B,EAAEC,mBAAmB,QAAQ;AAExF,SAASC,UAAU,EAAEC,oBAAoB,QAAyB;AAIlE;AACA,OAAO,MAAMC,yBAAA,gBAA4BJ,4BAAA,CAA6BG,oBAAA,CAAqBE,IAAI;AAC/F;AACA,OAAO,MAAMC,eAAA,gBAA6DL,mBAAA,CAAoBC,UAAA"}
@@ -1,2 +0,0 @@
1
- export * from './RadioGroupField';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["../../../src/components/RadioGroupField/index.ts"],"sourcesContent":["export * from './RadioGroupField';\n"],"mappings":"AAAA,cAAc"}
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./components/RadioGroupField/index"), exports);
7
- //# sourceMappingURL=RadioGroupField.js.map
8
-
9
- //# sourceMappingURL=RadioGroupField.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../lib/RadioGroupField.js"],"sourcesContent":["export * from './components/RadioGroupField/index';\n//# sourceMappingURL=RadioGroupField.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,2CAA2C"}
@@ -1,20 +0,0 @@
1
- /* eslint-disable deprecation/deprecation */ "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: all[name]
9
- });
10
- }
11
- _export(exports, {
12
- radioGroupFieldClassNames: ()=>radioGroupFieldClassNames,
13
- RadioGroupField: ()=>RadioGroupField
14
- });
15
- const _reactField = require("@fluentui/react-field");
16
- const _radioGroup = require("../../RadioGroup");
17
- const radioGroupFieldClassNames = /*#__PURE__*/ (0, _reactField.getDeprecatedFieldClassNames)(_radioGroup.radioGroupClassNames.root);
18
- const RadioGroupField = /*#__PURE__*/ (0, _reactField.makeDeprecatedField)(_radioGroup.RadioGroup); //# sourceMappingURL=RadioGroupField.js.map
19
-
20
- //# sourceMappingURL=RadioGroupField.js.map
@@ -1 +0,0 @@
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,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./RadioGroupField"), exports);
7
- //# sourceMappingURL=index.js.map
8
-
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../lib/components/RadioGroupField/index.js"],"sourcesContent":["export * from './RadioGroupField';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,iCAAiC"}