@fluentui/react-radio 0.0.0-nightly-20230321-0440.1 → 0.0.0-nightly-20230324-0422.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +94 -19
  3. package/CHANGELOG.md +31 -12
  4. package/lib/Radio.js.map +1 -1
  5. package/lib/RadioGroup.js.map +1 -1
  6. package/lib/RadioGroupField.js.map +1 -1
  7. package/lib/components/Radio/Radio.js.map +1 -1
  8. package/lib/components/Radio/Radio.types.js +1 -1
  9. package/lib/components/Radio/Radio.types.js.map +1 -1
  10. package/lib/components/Radio/index.js.map +1 -1
  11. package/lib/components/Radio/renderRadio.js +1 -9
  12. package/lib/components/Radio/renderRadio.js.map +1 -1
  13. package/lib/components/Radio/useRadio.js +5 -3
  14. package/lib/components/Radio/useRadio.js.map +1 -1
  15. package/lib/components/Radio/useRadioStyles.js.map +1 -1
  16. package/lib/components/RadioGroup/RadioGroup.js.map +1 -1
  17. package/lib/components/RadioGroup/RadioGroup.types.js +1 -1
  18. package/lib/components/RadioGroup/RadioGroup.types.js.map +1 -1
  19. package/lib/components/RadioGroup/index.js.map +1 -1
  20. package/lib/components/RadioGroup/renderRadioGroup.js +1 -3
  21. package/lib/components/RadioGroup/renderRadioGroup.js.map +1 -1
  22. package/lib/components/RadioGroup/useRadioGroup.js +1 -0
  23. package/lib/components/RadioGroup/useRadioGroup.js.map +1 -1
  24. package/lib/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
  25. package/lib/components/RadioGroupField/RadioGroupField.js +1 -2
  26. package/lib/components/RadioGroupField/RadioGroupField.js.map +1 -1
  27. package/lib/components/RadioGroupField/index.js.map +1 -1
  28. package/lib/contexts/RadioGroupContext.js.map +1 -1
  29. package/lib/contexts/index.js.map +1 -1
  30. package/lib/contexts/useRadioGroupContextValues.js.map +1 -1
  31. package/lib/index.js.map +1 -1
  32. package/lib-commonjs/Radio.js +5 -4
  33. package/lib-commonjs/Radio.js.map +1 -1
  34. package/lib-commonjs/RadioGroup.js +5 -4
  35. package/lib-commonjs/RadioGroup.js.map +1 -1
  36. package/lib-commonjs/RadioGroupField.js +5 -4
  37. package/lib-commonjs/RadioGroupField.js.map +1 -1
  38. package/lib-commonjs/components/Radio/Radio.js +19 -20
  39. package/lib-commonjs/components/Radio/Radio.js.map +1 -1
  40. package/lib-commonjs/components/Radio/Radio.types.js +5 -2
  41. package/lib-commonjs/components/Radio/Radio.types.js.map +1 -1
  42. package/lib-commonjs/components/Radio/index.js +9 -8
  43. package/lib-commonjs/components/Radio/index.js.map +1 -1
  44. package/lib-commonjs/components/Radio/renderRadio.js +13 -24
  45. package/lib-commonjs/components/Radio/renderRadio.js.map +1 -1
  46. package/lib-commonjs/components/Radio/useRadio.js +83 -91
  47. package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
  48. package/lib-commonjs/components/Radio/useRadioStyles.js +139 -65
  49. package/lib-commonjs/components/Radio/useRadioStyles.js.map +1 -1
  50. package/lib-commonjs/components/RadioGroup/RadioGroup.js +21 -22
  51. package/lib-commonjs/components/RadioGroup/RadioGroup.js.map +1 -1
  52. package/lib-commonjs/components/RadioGroup/RadioGroup.types.js +5 -2
  53. package/lib-commonjs/components/RadioGroup/RadioGroup.types.js.map +1 -1
  54. package/lib-commonjs/components/RadioGroup/index.js +9 -8
  55. package/lib-commonjs/components/RadioGroup/index.js.map +1 -1
  56. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js +16 -21
  57. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -1
  58. package/lib-commonjs/components/RadioGroup/useRadioGroup.js +40 -50
  59. package/lib-commonjs/components/RadioGroup/useRadioGroup.js.map +1 -1
  60. package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js +32 -23
  61. package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.js.map +1 -1
  62. package/lib-commonjs/components/RadioGroupField/RadioGroupField.js +17 -11
  63. package/lib-commonjs/components/RadioGroupField/RadioGroupField.js.map +1 -1
  64. package/lib-commonjs/components/RadioGroupField/index.js +5 -4
  65. package/lib-commonjs/components/RadioGroupField/index.js.map +1 -1
  66. package/lib-commonjs/contexts/RadioGroupContext.js +17 -11
  67. package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
  68. package/lib-commonjs/contexts/index.js +6 -5
  69. package/lib-commonjs/contexts/index.js.map +1 -1
  70. package/lib-commonjs/contexts/useRadioGroupContextValues.js +20 -25
  71. package/lib-commonjs/contexts/useRadioGroupContextValues.js.map +1 -1
  72. package/lib-commonjs/index.js +31 -99
  73. package/lib-commonjs/index.js.map +1 -1
  74. package/package.json +11 -11
@@ -1 +1 @@
1
- {"version":3,"names":["createContext","useContextSelector","RadioGroupContext","undefined","radioGroupContextDefaultValue","RadioGroupProvider","Provider","useRadioGroupContext_unstable","selector","ctx"],"sources":["../../../../../../../../packages/react-components/react-radio/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,kCAAkC;AAIrG;;;AAGA,OAAO,MAAMC,iBAAiB,gBAAoCF,aAAa,CAC7EG,SAAS,CACyB;AAEpC,MAAMC,6BAA6B,GAA2B,EAAE;AAEhE,OAAO,MAAMC,kBAAkB,GAAGH,iBAAiB,CAACI,QAAQ;AAE5D,OAAO,MAAMC,6BAA6B,GAAOC,QAAoD,IACnGP,kBAAkB,CAACC,iBAAiB,EAAE,CAACO,GAAG,GAAGL,6BAA6B,KAAKI,QAAQ,CAACC,GAAG,CAAC,CAAC"}
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 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/react-components/react-radio/src/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC","sourcesContent":["export * from './RadioGroupContext';\nexport * from './useRadioGroupContextValues';\n"]}
1
+ {"version":3,"names":[],"sources":["../../src/contexts/index.ts"],"sourcesContent":["export * from './RadioGroupContext';\nexport * from './useRadioGroupContextValues';\n"],"mappings":"AAAA,cAAc;AACd,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"names":["useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","radioGroup"],"sources":["../../../../../../../../packages/react-components/react-radio/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 };\n\n return { radioGroup };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,0BAA0B,GAAIC,KAAsB,IAA6B;EAC5F,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC,YAAY;IAAEC,QAAQ;IAAEC,MAAM;IAAEC;EAAQ,CAAE,GAAGN,KAAK;EAEvE,MAAMO,UAAU,GAA2B;IACzCN,IAAI;IACJC,KAAK;IACLC,YAAY;IACZC,QAAQ;IACRC,MAAM;IACNC;GACD;EAED,OAAO;IAAEC;EAAU,CAAE;AACvB,CAAC"}
1
+ {"version":3,"names":["useRadioGroupContextValues","state","name","value","defaultValue","disabled","layout","required","radioGroup"],"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 };\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;EACF;EAEA,OAAO;IAAEC;EAAW;AACtB"}
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":["../../../../../../../packages/react-components/react-radio/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,cAAc;AASrB,SAASC,KAAK,EAAEC,eAAe,EAAEC,oBAAoB,EAAEC,uBAAuB,EAAEC,iBAAiB,QAAQ,SAAS;AAElH,SAASC,kBAAkB,EAAEC,0BAA0B,EAAEC,6BAA6B,QAAQ,kBAAkB;AAEhH;AACA,SAASC,eAAe,IAAIC,wBAAwB,EAAEC,yBAAyB,QAAQ,mBAAmB"}
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,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/Radio/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/Radio/index"), exports);
7
+ //# sourceMappingURL=Radio.js.map
8
+
8
9
  //# sourceMappingURL=Radio.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../../../../../../../packages/react-components/react-radio/src/Radio.ts"],"sourcesContent":["export * from './components/Radio/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,8BAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/Radio.js"],"sourcesContent":["export * from './components/Radio/index';\n//# sourceMappingURL=Radio.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,iCAAiC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/RadioGroup/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/RadioGroup/index"), exports);
7
+ //# sourceMappingURL=RadioGroup.js.map
8
+
8
9
  //# sourceMappingURL=RadioGroup.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../../../../../../../packages/react-components/react-radio/src/RadioGroup.ts"],"sourcesContent":["export * from './components/RadioGroup/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,mCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/RadioGroup.js"],"sourcesContent":["export * from './components/RadioGroup/index';\n//# sourceMappingURL=RadioGroup.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,sCAAsC"}
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./components/RadioGroupField/index"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./components/RadioGroupField/index"), exports);
7
+ //# sourceMappingURL=RadioGroupField.js.map
8
+
8
9
  //# sourceMappingURL=RadioGroupField.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../../../../../../../packages/react-components/react-radio/src/RadioGroupField.ts"],"sourcesContent":["export * from './components/RadioGroupField/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,wCAAAC,OAAA"}
1
+ {"version":3,"sources":["../lib/RadioGroupField.js"],"sourcesContent":["export * from './components/RadioGroupField/index';\n//# sourceMappingURL=RadioGroupField.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,2CAA2C"}
@@ -1,25 +1,24 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "Radio", {
6
+ enumerable: true,
7
+ get: ()=>Radio
5
8
  });
6
- exports.Radio = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const renderRadio_1 = /*#__PURE__*/require("./renderRadio");
9
- const useRadio_1 = /*#__PURE__*/require("./useRadio");
10
- const useRadioStyles_1 = /*#__PURE__*/require("./useRadioStyles");
11
- const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
12
- /**
13
- * Radio component is a wrapper for a radio button with a label.
14
- */
15
- exports.Radio = /*#__PURE__*/React.forwardRef((props, ref) => {
16
- const state = useRadio_1.useRadio_unstable(props, ref);
17
- useRadioStyles_1.useRadioStyles_unstable(state);
18
- const {
19
- useRadioStyles_unstable: useCustomStyles
20
- } = react_shared_contexts_1.useCustomStyleHooks_unstable();
21
- useCustomStyles(state);
22
- return renderRadio_1.renderRadio_unstable(state);
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _renderRadio = require("./renderRadio");
12
+ const _useRadio = require("./useRadio");
13
+ const _useRadioStyles = require("./useRadioStyles");
14
+ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
15
+ const Radio = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
16
+ const state = (0, _useRadio.useRadio_unstable)(props, ref);
17
+ (0, _useRadioStyles.useRadioStyles_unstable)(state);
18
+ const { useRadioStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
19
+ useCustomStyles(state);
20
+ return (0, _renderRadio.renderRadio_unstable)(state);
23
21
  });
24
- exports.Radio.displayName = 'Radio';
22
+ Radio.displayName = 'Radio'; //# sourceMappingURL=Radio.js.map
23
+
25
24
  //# sourceMappingURL=Radio.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","renderRadio_1","useRadio_1","useRadioStyles_1","react_shared_contexts_1","exports","Radio","forwardRef","props","ref","state","useRadio_unstable","useRadioStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderRadio_unstable","displayName"],"sources":["../../../../../../../../../packages/react-components/react-radio/src/components/Radio/Radio.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { RadioProps } from './Radio.types';\nimport { renderRadio_unstable } from './renderRadio';\nimport { useRadio_unstable } from './useRadio';\nimport { useRadioStyles_unstable } from './useRadioStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Radio component is a wrapper for a radio button with a label.\n */\nexport const Radio: ForwardRefComponent<RadioProps> = React.forwardRef((props, ref) => {\n const state = useRadio_unstable(props, ref);\n\n useRadioStyles_unstable(state);\n\n const { useRadioStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderRadio_unstable(state);\n});\n\nRadio.displayName = 'Radio';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AAGA,MAAAC,aAAA,gBAAAD,OAAA;AACA,MAAAE,UAAA,gBAAAF,OAAA;AACA,MAAAG,gBAAA,gBAAAH,OAAA;AACA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;AAGaK,OAAA,CAAAC,KAAK,gBAAoCP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpF,MAAMC,KAAK,GAAGR,UAAA,CAAAS,iBAAiB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAE3CN,gBAAA,CAAAS,uBAAuB,CAACF,KAAK,CAAC;EAE9B,MAAM;IAAEE,uBAAuB,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EACnFD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOT,aAAA,CAAAc,oBAAoB,CAACL,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFL,OAAA,CAAAC,KAAK,CAACU,WAAW,GAAG,OAAO"}
1
+ {"version":3,"sources":["../../../lib/components/Radio/Radio.js"],"sourcesContent":["import * as React from 'react';\nimport { renderRadio_unstable } from './renderRadio';\nimport { useRadio_unstable } from './useRadio';\nimport { useRadioStyles_unstable } from './useRadioStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Radio component is a wrapper for a radio button with a label.\n */\nexport const Radio = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useRadio_unstable(props, ref);\n useRadioStyles_unstable(state);\n const {\n useRadioStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderRadio_unstable(state);\n});\nRadio.displayName = 'Radio';\n//# sourceMappingURL=Radio.js.map"],"names":["Radio","React","forwardRef","props","ref","state","useRadio_unstable","useRadioStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderRadio_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;6BACc;0BACH;gCACM;qCACK;AAItC,MAAMA,QAAQ,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACjE,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvCG,IAAAA,uCAAuB,EAACF;IACxB,MAAM,EACJE,yBAAyBC,gBAAe,EACzC,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,iCAAoB,EAACL;AAC9B;AACAL,MAAMW,WAAW,GAAG,SACpB,iCAAiC"}
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
5
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
7
+ //# sourceMappingURL=Radio.types.js.map
8
+
6
9
  //# sourceMappingURL=Radio.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["../../../../../../../../../packages/react-components/react-radio/src/components/Radio/Radio.types.ts"],"sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type RadioSlots = {\n /**\n * The root element of the Radio.\n *\n * The root slot receives the `className` and `style` specified directly on the `<Radio>`.\n * All other native props will be applied to the primary slot: `input`\n */\n root: NonNullable<Slot<'span'>>;\n\n /**\n * The Radio's label.\n */\n label: Slot<typeof Label>;\n\n /**\n * Hidden input that handles the radio's functionality.\n *\n * This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,\n * except `className` and `style`, which remain on the root slot.\n */\n input: NonNullable<Slot<'input'>>;\n\n /**\n * A circle outline, with a filled circle icon inside when the Radio is checked.\n */\n indicator: NonNullable<Slot<'div'>>;\n};\n\n/**\n * Radio Props\n */\nexport type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'onChange' | 'size'> & {\n /**\n * The value of the RadioGroup when this Radio item is selected.\n */\n value?: string;\n\n /**\n * The position of the label relative to the radio indicator.\n *\n * This defaults to `after` unless the Radio is inside a RadioGroup with `layout=\"horizontalStacked\"`,\n * in which case it defaults to `below`.\n *\n * @defaultvalue after\n */\n labelPosition?: 'after' | 'below';\n\n /**\n * Disable this Radio item.\n */\n disabled?: boolean;\n\n /**\n * Callback when this Radio is selected in its group.\n *\n * **Note:** `onChange` is NOT called when this Radio is deselected.\n * Use RadioGroup's `onChange` event to determine when the selection in the group changes.\n */\n onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;\n};\n\n/**\n * Data for the onChange event for Radio.\n */\nexport type RadioOnChangeData = {\n /**\n * The value prop of this Radio item.\n */\n value: string;\n};\n\n/**\n * State used in rendering Radio\n */\nexport type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;\n"],"mappings":""}
1
+ {"version":3,"sources":["../../../lib/components/Radio/Radio.types.js"],"sourcesContent":["import * as React from 'react';\n//# sourceMappingURL=Radio.types.js.map"],"names":[],"mappings":";;;;;6DAAuB;CACvB,uCAAuC"}
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
5
4
  });
6
- const tslib_1 = /*#__PURE__*/require("tslib");
7
- tslib_1.__exportStar(require("./Radio"), exports);
8
- tslib_1.__exportStar(require("./Radio.types"), exports);
9
- tslib_1.__exportStar(require("./renderRadio"), exports);
10
- tslib_1.__exportStar(require("./useRadio"), exports);
11
- tslib_1.__exportStar(require("./useRadioStyles"), exports);
5
+ const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./Radio"), exports);
7
+ _exportStar(require("./Radio.types"), exports);
8
+ _exportStar(require("./renderRadio"), exports);
9
+ _exportStar(require("./useRadio"), exports);
10
+ _exportStar(require("./useRadioStyles"), exports);
11
+ //# sourceMappingURL=index.js.map
12
+
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../../../../../../../../../packages/react-components/react-radio/src/components/Radio/index.ts"],"sourcesContent":["export * from './Radio';\nexport * from './Radio.types';\nexport * from './renderRadio';\nexport * from './useRadio';\nexport * from './useRadioStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,aAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,gBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Radio/index.js"],"sourcesContent":["export * from './Radio';\nexport * from './Radio.types';\nexport * from './renderRadio';\nexport * from './useRadio';\nexport * from './useRadioStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
@@ -1,28 +1,17 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderRadio_unstable", {
6
+ enumerable: true,
7
+ get: ()=>renderRadio_unstable
5
8
  });
6
- exports.renderRadio_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
- /**
10
- * Render the final JSX of Radio
11
- */
12
- const renderRadio_unstable = state => {
13
- const {
14
- slots,
15
- slotProps
16
- } = react_utilities_1.getSlots(state);
17
- return React.createElement(slots.root, {
18
- ...slotProps.root
19
- }, React.createElement(slots.input, {
20
- ...slotProps.input
21
- }), React.createElement(slots.indicator, {
22
- ...slotProps.indicator
23
- }), slots.label && React.createElement(slots.label, {
24
- ...slotProps.label
25
- }));
26
- };
27
- exports.renderRadio_unstable = renderRadio_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactUtilities = require("@fluentui/react-utilities");
12
+ 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));
15
+ }; //# sourceMappingURL=renderRadio.js.map
16
+
28
17
  //# sourceMappingURL=renderRadio.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_utilities_1","renderRadio_unstable","state","slots","slotProps","getSlots","createElement","root","input","indicator","label","exports"],"sources":["../../../../../../../../../packages/react-components/react-radio/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,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,oBAAoB,GAAIC,KAAiB,IAAI;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAaH,KAAK,CAAC;EAExD,OACEJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC5BT,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACK,KAAK;IAAA,GAAKJ,SAAS,CAACI;EAAK,EAAI,EACpCV,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACM,SAAS;IAAA,GAAKL,SAAS,CAACK;EAAS,EAAI,EAC3CN,KAAK,CAACO,KAAK,IAAIZ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACO,KAAK;IAAA,GAAKN,SAAS,CAACM;EAAK,EAAI,CACzC;AAEjB,CAAC;AAVYC,OAAA,CAAAV,oBAAoB,GAAAA,oBAAA"}
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,95 +1,87 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useRadio_unstable", {
6
+ enumerable: true,
7
+ get: ()=>useRadio_unstable
5
8
  });
6
- exports.useRadio_unstable = void 0;
7
- const React = /*#__PURE__*/require("react");
8
- const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
9
- const react_label_1 = /*#__PURE__*/require("@fluentui/react-label");
10
- const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
- const RadioGroupContext_1 = /*#__PURE__*/require("../../contexts/RadioGroupContext");
12
- const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
13
- /**
14
- * Create the state required to render Radio.
15
- *
16
- * The returned state can be modified with hooks such as useRadioStyles_unstable,
17
- * before being passed to renderRadio_unstable.
18
- *
19
- * @param props - props from this instance of Radio
20
- * @param ref - reference to `<input>` element of Radio
21
- */
22
- const useRadio_unstable = (props, ref) => {
23
- const nameGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.name);
24
- const value = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.value);
25
- const defaultValue = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.defaultValue);
26
- const disabledGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.disabled);
27
- const layout = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.layout);
28
- const requiredGroup = RadioGroupContext_1.useRadioGroupContext_unstable(ctx => ctx.required);
29
- const {
30
- name = nameGroup,
31
- checked = value !== undefined ? value === props.value : undefined,
32
- defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,
33
- labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',
34
- disabled = disabledGroup,
35
- required = requiredGroup,
36
- onChange
37
- } = props;
38
- const nativeProps = react_utilities_1.getPartitionedNativeProps({
39
- props,
40
- primarySlotTagName: 'input',
41
- excludedPropNames: ['checked', 'defaultChecked', 'onChange']
42
- });
43
- const root = react_utilities_1.resolveShorthand(props.root, {
44
- required: true,
45
- defaultProps: {
46
- ref: react_tabster_1.useFocusWithin(),
47
- ...nativeProps.root
48
- }
49
- });
50
- const input = react_utilities_1.resolveShorthand(props.input, {
51
- required: true,
52
- defaultProps: {
53
- ref,
54
- type: 'radio',
55
- id: react_utilities_1.useId('radio-', nativeProps.primary.id),
56
- name,
57
- checked,
58
- defaultChecked,
59
- disabled,
60
- required,
61
- ...nativeProps.primary
62
- }
63
- });
64
- input.onChange = react_utilities_1.mergeCallbacks(input.onChange, ev => onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
65
- value: ev.currentTarget.value
66
- }));
67
- const label = react_utilities_1.resolveShorthand(props.label, {
68
- defaultProps: {
69
- htmlFor: input.id,
70
- disabled
71
- }
72
- });
73
- const indicator = react_utilities_1.resolveShorthand(props.indicator, {
74
- required: true,
75
- defaultProps: {
76
- 'aria-hidden': true,
77
- children: React.createElement(react_icons_1.CircleFilled, null)
78
- }
79
- });
80
- return {
81
- labelPosition,
82
- components: {
83
- root: 'span',
84
- input: 'input',
85
- label: react_label_1.Label,
86
- indicator: 'div'
87
- },
88
- root,
89
- input,
90
- label,
91
- indicator
92
- };
93
- };
94
- exports.useRadio_unstable = useRadio_unstable;
9
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _reactIcons = require("@fluentui/react-icons");
12
+ const _reactLabel = require("@fluentui/react-label");
13
+ const _reactUtilities = require("@fluentui/react-utilities");
14
+ const _radioGroupContext = require("../../contexts/RadioGroupContext");
15
+ const _reactTabster = require("@fluentui/react-tabster");
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 { name =nameGroup , checked =value !== undefined ? value === props.value : undefined , defaultChecked =defaultValue !== undefined ? defaultValue === props.value : undefined , labelPosition =layout === 'horizontal-stacked' ? 'below' : 'after' , disabled =disabledGroup , required =requiredGroup , onChange } = props;
24
+ const nativeProps = (0, _reactUtilities.getPartitionedNativeProps)({
25
+ props,
26
+ primarySlotTagName: 'input',
27
+ excludedPropNames: [
28
+ 'checked',
29
+ 'defaultChecked',
30
+ 'onChange'
31
+ ]
32
+ });
33
+ const root = (0, _reactUtilities.resolveShorthand)(props.root, {
34
+ required: true,
35
+ defaultProps: {
36
+ ref: (0, _reactTabster.useFocusWithin)(),
37
+ ...nativeProps.root
38
+ }
39
+ });
40
+ const input = (0, _reactUtilities.resolveShorthand)(props.input, {
41
+ required: true,
42
+ defaultProps: {
43
+ ref,
44
+ type: 'radio',
45
+ id: (0, _reactUtilities.useId)('radio-', nativeProps.primary.id),
46
+ name,
47
+ checked,
48
+ defaultChecked,
49
+ disabled,
50
+ required,
51
+ ...nativeProps.primary
52
+ }
53
+ });
54
+ input.onChange = (0, _reactUtilities.mergeCallbacks)(input.onChange, (ev)=>{
55
+ return onChange === null || onChange === void 0 ? void 0 : onChange(ev, {
56
+ value: ev.currentTarget.value
57
+ });
58
+ });
59
+ const label = (0, _reactUtilities.resolveShorthand)(props.label, {
60
+ defaultProps: {
61
+ htmlFor: input.id,
62
+ disabled
63
+ }
64
+ });
65
+ const indicator = (0, _reactUtilities.resolveShorthand)(props.indicator, {
66
+ required: true,
67
+ defaultProps: {
68
+ 'aria-hidden': true,
69
+ children: /*#__PURE__*/ _react.createElement(_reactIcons.CircleFilled, null)
70
+ }
71
+ });
72
+ return {
73
+ labelPosition,
74
+ components: {
75
+ root: 'span',
76
+ input: 'input',
77
+ label: _reactLabel.Label,
78
+ indicator: 'div'
79
+ },
80
+ root,
81
+ input,
82
+ label,
83
+ indicator
84
+ };
85
+ }; //# sourceMappingURL=useRadio.js.map
86
+
95
87
  //# sourceMappingURL=useRadio.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","react_icons_1","react_label_1","react_utilities_1","RadioGroupContext_1","react_tabster_1","useRadio_unstable","props","ref","nameGroup","useRadioGroupContext_unstable","ctx","name","value","defaultValue","disabledGroup","disabled","layout","requiredGroup","required","checked","undefined","defaultChecked","labelPosition","onChange","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","root","resolveShorthand","defaultProps","useFocusWithin","input","type","id","useId","primary","mergeCallbacks","ev","currentTarget","label","htmlFor","indicator","children","createElement","CircleFilled","components","Label","exports"],"sources":["../../../../../../../../../packages/react-components/react-radio/src/components/Radio/useRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport type { RadioProps, RadioState } from './Radio.types';\n\n/**\n * Create the state required to render Radio.\n *\n * The returned state can be modified with hooks such as useRadioStyles_unstable,\n * before being passed to renderRadio_unstable.\n *\n * @param props - props from this instance of Radio\n * @param ref - reference to `<input>` element of Radio\n */\nexport const useRadio_unstable = (props: RadioProps, ref: React.Ref<HTMLInputElement>): RadioState => {\n const nameGroup = useRadioGroupContext_unstable(ctx => ctx.name);\n const value = useRadioGroupContext_unstable(ctx => ctx.value);\n const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);\n const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);\n const layout = useRadioGroupContext_unstable(ctx => ctx.layout);\n const requiredGroup = useRadioGroupContext_unstable(ctx => ctx.required);\n\n const {\n name = nameGroup,\n checked = value !== undefined ? value === props.value : undefined,\n defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,\n labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = disabledGroup,\n required = requiredGroup,\n onChange,\n } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange'],\n });\n\n const root = resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n ref: useFocusWithin<HTMLSpanElement>(),\n ...nativeProps.root,\n },\n });\n\n const input = resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n ref,\n type: 'radio',\n id: useId('radio-', nativeProps.primary.id),\n name,\n checked,\n defaultChecked,\n disabled,\n required,\n ...nativeProps.primary,\n },\n });\n\n input.onChange = mergeCallbacks(input.onChange, ev => onChange?.(ev, { value: ev.currentTarget.value }));\n\n const label = resolveShorthand(props.label, {\n defaultProps: {\n htmlFor: input.id,\n disabled,\n },\n });\n\n const indicator = resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: <CircleFilled />,\n },\n });\n\n return {\n labelPosition,\n components: {\n root: 'span',\n input: 'input',\n label: Label,\n indicator: 'div',\n },\n root,\n input,\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B,CAACvB,KAAK,CAACoC,SAAS,EAAE;IAClDxB,QAAQ,EAAE,IAAI;IACdY,YAAY,EAAE;MACZ,aAAa,EAAE,IAAI;MACnBa,QAAQ,EAAE7C,KAAA,CAAA8C,aAAA,CAAC5C,aAAA,CAAA6C,YAAY;;GAE1B,CAAC;EAEF,OAAO;IACLvB,aAAa;IACbwB,UAAU,EAAE;MACVlB,IAAI,EAAE,MAAM;MACZI,KAAK,EAAE,OAAO;MACdQ,KAAK,EAAEvC,aAAA,CAAA8C,KAAK;MACZL,SAAS,EAAE;KACZ;IACDd,IAAI;IACJI,KAAK;IACLQ,KAAK;IACLE;GACD;AACH,CAAC;AA7EYM,OAAA,CAAA3C,iBAAiB,GAAAA,iBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Radio/useRadio.js"],"sourcesContent":["import * as React from 'react';\nimport { CircleFilled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { getPartitionedNativeProps, mergeCallbacks, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { useRadioGroupContext_unstable } from '../../contexts/RadioGroupContext';\nimport { useFocusWithin } from '@fluentui/react-tabster';\n/**\n * Create the state required to render Radio.\n *\n * The returned state can be modified with hooks such as useRadioStyles_unstable,\n * before being passed to renderRadio_unstable.\n *\n * @param props - props from this instance of Radio\n * @param ref - reference to `<input>` element of Radio\n */\nexport const useRadio_unstable = (props, ref) => {\n const nameGroup = useRadioGroupContext_unstable(ctx => ctx.name);\n const value = useRadioGroupContext_unstable(ctx => ctx.value);\n const defaultValue = useRadioGroupContext_unstable(ctx => ctx.defaultValue);\n const disabledGroup = useRadioGroupContext_unstable(ctx => ctx.disabled);\n const layout = useRadioGroupContext_unstable(ctx => ctx.layout);\n const requiredGroup = useRadioGroupContext_unstable(ctx => ctx.required);\n const {\n name = nameGroup,\n checked = value !== undefined ? value === props.value : undefined,\n defaultChecked = defaultValue !== undefined ? defaultValue === props.value : undefined,\n labelPosition = layout === 'horizontal-stacked' ? 'below' : 'after',\n disabled = disabledGroup,\n required = requiredGroup,\n onChange\n } = props;\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['checked', 'defaultChecked', 'onChange']\n });\n const root = resolveShorthand(props.root, {\n required: true,\n defaultProps: {\n ref: useFocusWithin(),\n ...nativeProps.root\n }\n });\n const input = resolveShorthand(props.input, {\n required: true,\n defaultProps: {\n ref,\n type: 'radio',\n id: useId('radio-', nativeProps.primary.id),\n name,\n checked,\n defaultChecked,\n disabled,\n required,\n ...nativeProps.primary\n }\n });\n input.onChange = mergeCallbacks(input.onChange, ev => {\n return onChange === null || onChange === void 0 ? void 0 : onChange(ev, {\n value: ev.currentTarget.value\n });\n });\n const label = resolveShorthand(props.label, {\n defaultProps: {\n htmlFor: input.id,\n disabled\n }\n });\n const indicator = resolveShorthand(props.indicator, {\n required: true,\n defaultProps: {\n 'aria-hidden': true,\n children: /*#__PURE__*/React.createElement(CircleFilled, null)\n }\n });\n return {\n labelPosition,\n components: {\n root: 'span',\n input: 'input',\n label: Label,\n indicator: 'div'\n },\n root,\n input,\n label,\n indicator\n };\n};\n//# sourceMappingURL=useRadio.js.map"],"names":["useRadio_unstable","props","ref","nameGroup","useRadioGroupContext_unstable","ctx","name","value","defaultValue","disabledGroup","disabled","layout","requiredGroup","required","checked","undefined","defaultChecked","labelPosition","onChange","nativeProps","getPartitionedNativeProps","primarySlotTagName","excludedPropNames","root","resolveShorthand","defaultProps","useFocusWithin","input","type","id","useId","primary","mergeCallbacks","ev","currentTarget","label","htmlFor","indicator","children","React","createElement","CircleFilled","components","Label"],"mappings":";;;;+BAeaA;;aAAAA;;;6DAfU;4BACM;4BACP;gCAC6D;mCACrC;8BACf;AAUxB,MAAMA,oBAAoB,CAACC,OAAOC,MAAQ;IAC/C,MAAMC,YAAYC,IAAAA,gDAA6B,EAACC,CAAAA,MAAOA,IAAIC,IAAI;IAC/D,MAAMC,QAAQH,IAAAA,gDAA6B,EAACC,CAAAA,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