@fluentui/react-radio 9.0.0-beta.4 → 9.0.0-rc.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. package/CHANGELOG.json +216 -1
  2. package/CHANGELOG.md +64 -10
  3. package/README.md +43 -0
  4. package/dist/{react-radio.d.ts → index.d.ts} +17 -8
  5. package/{lib → dist}/tsdoc-metadata.json +0 -0
  6. package/lib/components/Radio/Radio.types.js.map +1 -1
  7. package/lib/components/Radio/useRadio.js +15 -9
  8. package/lib/components/Radio/useRadio.js.map +1 -1
  9. package/lib/components/Radio/useRadioStyles.js +15 -18
  10. package/lib/components/Radio/useRadioStyles.js.map +1 -1
  11. package/lib/components/RadioGroup/RadioGroup.js +3 -1
  12. package/lib/components/RadioGroup/RadioGroup.js.map +1 -1
  13. package/lib/components/RadioGroup/RadioGroup.types.js.map +1 -1
  14. package/lib/components/RadioGroup/renderRadioGroup.js +2 -2
  15. package/lib/components/RadioGroup/renderRadioGroup.js.map +1 -1
  16. package/lib/components/RadioGroup/useRadioGroup.js +7 -9
  17. package/lib/components/RadioGroup/useRadioGroup.js.map +1 -1
  18. package/lib/contexts/RadioGroupContext.js +2 -2
  19. package/lib/contexts/RadioGroupContext.js.map +1 -1
  20. package/lib/contexts/index.js +3 -0
  21. package/lib/contexts/index.js.map +1 -0
  22. package/lib/contexts/useRadioGroupContextValues.js +22 -0
  23. package/lib/contexts/useRadioGroupContextValues.js.map +1 -0
  24. package/lib/index.js +1 -1
  25. package/lib/index.js.map +1 -1
  26. package/lib-commonjs/components/Radio/useRadio.js +16 -9
  27. package/lib-commonjs/components/Radio/useRadio.js.map +1 -1
  28. package/lib-commonjs/components/Radio/useRadioStyles.js +15 -18
  29. package/lib-commonjs/components/Radio/useRadioStyles.js.map +1 -1
  30. package/lib-commonjs/components/RadioGroup/RadioGroup.js +4 -1
  31. package/lib-commonjs/components/RadioGroup/RadioGroup.js.map +1 -1
  32. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js +2 -2
  33. package/lib-commonjs/components/RadioGroup/renderRadioGroup.js.map +1 -1
  34. package/lib-commonjs/components/RadioGroup/useRadioGroup.js +7 -10
  35. package/lib-commonjs/components/RadioGroup/useRadioGroup.js.map +1 -1
  36. package/lib-commonjs/contexts/RadioGroupContext.js +2 -2
  37. package/lib-commonjs/contexts/RadioGroupContext.js.map +1 -1
  38. package/lib-commonjs/contexts/index.js +12 -0
  39. package/lib-commonjs/contexts/index.js.map +1 -0
  40. package/lib-commonjs/contexts/useRadioGroupContextValues.js +31 -0
  41. package/lib-commonjs/contexts/useRadioGroupContextValues.js.map +1 -0
  42. package/lib-commonjs/index.js +9 -3
  43. package/lib-commonjs/index.js.map +1 -1
  44. package/package.json +12 -10
  45. package/lib/Radio.d.ts +0 -1
  46. package/lib/RadioGroup.d.ts +0 -1
  47. package/lib/components/Radio/Radio.d.ts +0 -6
  48. package/lib/components/Radio/Radio.types.d.ts +0 -69
  49. package/lib/components/Radio/index.d.ts +0 -5
  50. package/lib/components/Radio/renderRadio.d.ts +0 -5
  51. package/lib/components/Radio/useRadio.d.ts +0 -12
  52. package/lib/components/Radio/useRadioStyles.d.ts +0 -11
  53. package/lib/components/RadioGroup/RadioGroup.d.ts +0 -6
  54. package/lib/components/RadioGroup/RadioGroup.types.d.ts +0 -58
  55. package/lib/components/RadioGroup/index.d.ts +0 -5
  56. package/lib/components/RadioGroup/renderRadioGroup.d.ts +0 -5
  57. package/lib/components/RadioGroup/useRadioGroup.d.ts +0 -12
  58. package/lib/components/RadioGroup/useRadioGroupStyles.d.ts +0 -11
  59. package/lib/contexts/RadioGroupContext.d.ts +0 -7
  60. package/lib/index.d.ts +0 -6
  61. package/lib-commonjs/Radio.d.ts +0 -1
  62. package/lib-commonjs/RadioGroup.d.ts +0 -1
  63. package/lib-commonjs/components/Radio/Radio.d.ts +0 -6
  64. package/lib-commonjs/components/Radio/Radio.types.d.ts +0 -69
  65. package/lib-commonjs/components/Radio/index.d.ts +0 -5
  66. package/lib-commonjs/components/Radio/renderRadio.d.ts +0 -5
  67. package/lib-commonjs/components/Radio/useRadio.d.ts +0 -12
  68. package/lib-commonjs/components/Radio/useRadioStyles.d.ts +0 -11
  69. package/lib-commonjs/components/RadioGroup/RadioGroup.d.ts +0 -6
  70. package/lib-commonjs/components/RadioGroup/RadioGroup.types.d.ts +0 -58
  71. package/lib-commonjs/components/RadioGroup/index.d.ts +0 -5
  72. package/lib-commonjs/components/RadioGroup/renderRadioGroup.d.ts +0 -5
  73. package/lib-commonjs/components/RadioGroup/useRadioGroup.d.ts +0 -12
  74. package/lib-commonjs/components/RadioGroup/useRadioGroupStyles.d.ts +0 -11
  75. package/lib-commonjs/contexts/RadioGroupContext.d.ts +0 -7
  76. package/lib-commonjs/index.d.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"sources":["components/RadioGroup/renderRadioGroup.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAA2B;AAClE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA0B,KAA1B,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,mBAAA,CAAA,iBAAA,CAAkB,QAAnB,EAA2B;AAAC,IAAA,KAAK,EAAE,KAAK,CAAC;AAAd,GAA3B,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { RadioGroupContext } from '../../contexts/RadioGroupContext';\nimport { RadioGroupSlots, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Render the final JSX of RadioGroup\n */\nexport const renderRadioGroup_unstable = (state: RadioGroupState) => {\n const { slots, slotProps } = getSlots<RadioGroupSlots>(state);\n\n return (\n <RadioGroupContext.Provider value={state.context}>\n <slots.root {...slotProps.root} />\n </RadioGroupContext.Provider>\n );\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/RadioGroup/renderRadioGroup.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,yBAAyB,GAAG,CAAC,KAAD,EAAyB,aAAzB,KAAmE;AAC1G,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA0B,KAA1B,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,mBAAA,CAAA,iBAAA,CAAkB,QAAnB,EAA2B;AAAC,IAAA,KAAK,EAAE,aAAa,CAAC;AAAtB,GAA3B,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CADF,CADF;AAKD,CARM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","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"],"sourceRoot":"../src/"}
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useRadioGroup_unstable = void 0;
7
7
 
8
- const React = /*#__PURE__*/require("react");
9
-
10
8
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
9
  /**
12
10
  * Create the state required to render RadioGroup.
@@ -27,17 +25,16 @@ const useRadioGroup_unstable = (props, ref) => {
27
25
  defaultValue,
28
26
  disabled,
29
27
  layout = 'vertical',
30
- onChange
28
+ onChange,
29
+ required
31
30
  } = props;
32
31
  return {
33
32
  layout,
34
- context: React.useMemo(() => ({
35
- name,
36
- value,
37
- defaultValue,
38
- disabled,
39
- layout
40
- }), [name, layout, value, defaultValue, disabled]),
33
+ name,
34
+ value,
35
+ defaultValue,
36
+ disabled,
37
+ required,
41
38
  components: {
42
39
  root: 'div'
43
40
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["components/RadioGroup/useRadioGroup.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAyB,GAAzB,KAA4E;AAChH,QAAM,aAAa,GAAG,iBAAA,CAAA,KAAA,CAAM,aAAN,CAAtB;AAEA,QAAM;AAAE,IAAA,IAAI,GAAG,aAAT;AAAwB,IAAA,KAAxB;AAA+B,IAAA,YAA/B;AAA6C,IAAA,QAA7C;AAAuD,IAAA,MAAM,GAAG,UAAhE;AAA4E,IAAA;AAA5E,MAAyF,KAA/F;AAEA,SAAO;AACL,IAAA,MADK;AAEL,IAAA,OAAO,EAAE,KAAK,CAAC,OAAN,CACP,OAAO;AACL,MAAA,IADK;AAEL,MAAA,KAFK;AAGL,MAAA,YAHK;AAIL,MAAA,QAJK;AAKL,MAAA;AALK,KAAP,CADO,EAQP,CAAC,IAAD,EAAO,MAAP,EAAe,KAAf,EAAsB,YAAtB,EAAoC,QAApC,CARO,CAFJ;AAYL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KAZP;AAeL,IAAA,IAAI,EAAE;AACJ,MAAA,GADI;AAEJ,MAAA,IAAI,EAAE,YAFF;AAGJ,SAAG,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B,KAA7B;AAAoC;AAAuB,OAAC,UAAD,EAAa,MAAb,CAA3D,CAHC;AAIJ,MAAA,QAAQ,EAAE,iBAAA,CAAA,gBAAA,CAAiB,EAAE,IAAG;AAC9B,YAAI,QAAQ,IAAI,EAAE,CAAC,MAAH,YAAqB,gBAAjC,IAAqD,EAAE,CAAC,MAAH,CAAU,IAAV,KAAmB,OAA5E,EAAqF;AACnF,UAAA,QAAQ,CAAC,EAAD,EAAK;AAAE,YAAA,KAAK,EAAE,EAAE,CAAC,MAAH,CAAU;AAAnB,WAAL,CAAR;AACD;AACF,OAJS;AAJN;AAfD,GAAP;AA0BD,CA/BM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback, useId } from '@fluentui/react-utilities';\nimport { RadioGroupProps, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Create the state required to render RadioGroup.\n *\n * The returned state can be modified with hooks such as useRadioGroupStyles_unstable,\n * before being passed to renderRadioGroup_unstable.\n *\n * @param props - props from this instance of RadioGroup\n * @param ref - reference to root HTMLElement of RadioGroup\n */\nexport const useRadioGroup_unstable = (props: RadioGroupProps, ref: React.Ref<HTMLDivElement>): RadioGroupState => {\n const generatedName = useId('radiogroup-');\n\n const { name = generatedName, value, defaultValue, disabled, layout = 'vertical', onChange } = props;\n\n return {\n layout,\n context: React.useMemo(\n () => ({\n name,\n value,\n defaultValue,\n disabled,\n layout,\n }),\n [name, layout, value, defaultValue, disabled],\n ),\n components: {\n root: 'div',\n },\n root: {\n ref,\n role: 'radiogroup',\n ...getNativeElementProps('div', props, /*excludedPropNames:*/ ['onChange', 'name']),\n onChange: useEventCallback(ev => {\n if (onChange && ev.target instanceof HTMLInputElement && ev.target.type === 'radio') {\n onChange(ev, { value: ev.target.value });\n }\n }),\n },\n };\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/RadioGroup/useRadioGroup.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,sBAAsB,GAAG,CAAC,KAAD,EAAyB,GAAzB,KAA4E;AAChH,QAAM,aAAa,GAAG,iBAAA,CAAA,KAAA,CAAM,aAAN,CAAtB;AAEA,QAAM;AAAE,IAAA,IAAI,GAAG,aAAT;AAAwB,IAAA,KAAxB;AAA+B,IAAA,YAA/B;AAA6C,IAAA,QAA7C;AAAuD,IAAA,MAAM,GAAG,UAAhE;AAA4E,IAAA,QAA5E;AAAsF,IAAA;AAAtF,MAAmG,KAAzG;AAEA,SAAO;AACL,IAAA,MADK;AAEL,IAAA,IAFK;AAGL,IAAA,KAHK;AAIL,IAAA,YAJK;AAKL,IAAA,QALK;AAML,IAAA,QANK;AAOL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE;AADI,KAPP;AAUL,IAAA,IAAI,EAAE;AACJ,MAAA,GADI;AAEJ,MAAA,IAAI,EAAE,YAFF;AAGJ,SAAG,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B,KAA7B;AAAoC;AAAuB,OAAC,UAAD,EAAa,MAAb,CAA3D,CAHC;AAIJ,MAAA,QAAQ,EAAE,iBAAA,CAAA,gBAAA,CAAiB,EAAE,IAAG;AAC9B,YAAI,QAAQ,IAAI,EAAE,CAAC,MAAH,YAAqB,gBAAjC,IAAqD,EAAE,CAAC,MAAH,CAAU,IAAV,KAAmB,OAA5E,EAAqF;AACnF,UAAA,QAAQ,CAAC,EAAD,EAAK;AAAE,YAAA,KAAK,EAAE,EAAE,CAAC,MAAH,CAAU;AAAnB,WAAL,CAAR;AACD;AACF,OAJS;AAJN;AAVD,GAAP;AAqBD,CA1BM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useEventCallback, useId } from '@fluentui/react-utilities';\nimport { RadioGroupProps, RadioGroupState } from './RadioGroup.types';\n\n/**\n * Create the state required to render RadioGroup.\n *\n * The returned state can be modified with hooks such as useRadioGroupStyles_unstable,\n * before being passed to renderRadioGroup_unstable.\n *\n * @param props - props from this instance of RadioGroup\n * @param ref - reference to root HTMLElement of RadioGroup\n */\nexport const useRadioGroup_unstable = (props: RadioGroupProps, ref: React.Ref<HTMLDivElement>): RadioGroupState => {\n const generatedName = useId('radiogroup-');\n\n const { name = generatedName, value, defaultValue, disabled, layout = 'vertical', onChange, required } = props;\n\n return {\n layout,\n name,\n value,\n defaultValue,\n disabled,\n required,\n components: {\n root: 'div',\n },\n root: {\n ref,\n role: 'radiogroup',\n ...getNativeElementProps('div', props, /*excludedPropNames:*/ ['onChange', 'name']),\n onChange: useEventCallback(ev => {\n if (onChange && ev.target instanceof HTMLInputElement && ev.target.type === 'radio') {\n onChange(ev, { value: ev.target.value });\n }\n }),\n },\n };\n};\n"],"sourceRoot":"../src/"}
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.RadioGroupContext = void 0;
7
7
 
8
- const React = /*#__PURE__*/require("react");
8
+ const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
9
9
  /**
10
10
  * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
11
11
  */
12
12
 
13
13
 
14
- exports.RadioGroupContext = /*#__PURE__*/React.createContext({});
14
+ exports.RadioGroupContext = /*#__PURE__*/react_context_selector_1.createContext({});
15
15
  //# sourceMappingURL=RadioGroupContext.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;AAKA;;AAEG;;;AACU,OAAA,CAAA,iBAAA,gBAAoB,KAAK,CAAC,aAAN,CAA4C,EAA5C,CAApB","sourcesContent":["import * as React from 'react';\nimport { RadioGroupProps } from '../RadioGroup';\n\nexport type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'layout' | 'value' | 'defaultValue' | 'disabled'>;\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>({});\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["contexts/RadioGroupContext.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,wBAAA,gBAAA,OAAA,CAAA,kCAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,iBAAA,gBAAqD,wBAAA,CAAA,aAAA,CAAc,EAAd,CAArD","sourcesContent":["import { createContext } 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({});\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ const tslib_1 = /*#__PURE__*/require("tslib");
8
+
9
+ tslib_1.__exportStar(require("./RadioGroupContext"), exports);
10
+
11
+ tslib_1.__exportStar(require("./useRadioGroupContextValues"), exports);
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["contexts/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,8BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './RadioGroupContext';\nexport * from './useRadioGroupContextValues';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useRadioGroupContextValues = void 0;
7
+
8
+ const useRadioGroupContextValues = state => {
9
+ const {
10
+ name,
11
+ value,
12
+ defaultValue,
13
+ disabled,
14
+ layout,
15
+ required
16
+ } = state;
17
+ const radioGroup = {
18
+ name,
19
+ value,
20
+ defaultValue,
21
+ disabled,
22
+ layout,
23
+ required
24
+ };
25
+ return {
26
+ radioGroup
27
+ };
28
+ };
29
+
30
+ exports.useRadioGroupContextValues = useRadioGroupContextValues;
31
+ //# sourceMappingURL=useRadioGroupContextValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["contexts/useRadioGroupContextValues.ts"],"names":[],"mappings":";;;;;;;AAEO,MAAM,0BAA0B,GAAI,KAAD,IAAoD;AAC5F,QAAM;AAAE,IAAA,IAAF;AAAQ,IAAA,KAAR;AAAe,IAAA,YAAf;AAA6B,IAAA,QAA7B;AAAuC,IAAA,MAAvC;AAA+C,IAAA;AAA/C,MAA4D,KAAlE;AAEA,QAAM,UAAU,GAA2B;AACzC,IAAA,IADyC;AAEzC,IAAA,KAFyC;AAGzC,IAAA,YAHyC;AAIzC,IAAA,QAJyC;AAKzC,IAAA,MALyC;AAMzC,IAAA;AANyC,GAA3C;AASA,SAAO;AAAE,IAAA;AAAF,GAAP;AACD,CAbM;;AAAM,OAAA,CAAA,0BAAA,GAA0B,0BAA1B","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"],"sourceRoot":"../src/"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.RadioGroupContext = exports.useRadio_unstable = exports.useRadioStyles_unstable = exports.renderRadio_unstable = exports.radioClassNames = exports.radioClassName = exports.Radio = exports.useRadioGroup_unstable = exports.useRadioGroupStyles_unstable = exports.renderRadioGroup_unstable = exports.radioGroupClassNames = exports.radioGroupClassName = exports.RadioGroup = void 0;
6
+ exports.useRadioGroupContextValues = exports.RadioGroupContext = exports.useRadio_unstable = exports.useRadioStyles_unstable = exports.renderRadio_unstable = exports.radioClassNames = exports.radioClassName = exports.Radio = exports.useRadioGroup_unstable = exports.useRadioGroupStyles_unstable = exports.renderRadioGroup_unstable = exports.radioGroupClassNames = exports.radioGroupClassName = exports.RadioGroup = void 0;
7
7
 
8
8
  var RadioGroup_1 = /*#__PURE__*/require("./RadioGroup");
9
9
 
@@ -87,12 +87,18 @@ Object.defineProperty(exports, "useRadio_unstable", {
87
87
  }
88
88
  });
89
89
 
90
- var RadioGroupContext_1 = /*#__PURE__*/require("./contexts/RadioGroupContext");
90
+ var index_1 = /*#__PURE__*/require("./contexts/index");
91
91
 
92
92
  Object.defineProperty(exports, "RadioGroupContext", {
93
93
  enumerable: true,
94
94
  get: function () {
95
- return RadioGroupContext_1.RadioGroupContext;
95
+ return index_1.RadioGroupContext;
96
+ }
97
+ });
98
+ Object.defineProperty(exports, "useRadioGroupContextValues", {
99
+ enumerable: true,
100
+ get: function () {
101
+ return index_1.useRadioGroupContextValues;
96
102
  }
97
103
  });
98
104
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,UAAA;AAAU;AAAV,CAAA;AACA;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,mBAAA;AAAmB;AAAnB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,yBAAA;AAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,8BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,4BAAA;AAA4B;AAA5B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;;AAGF,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,OAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,KAAA;AAAK;AAAL,CAAA;AACA;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,cAAA;AAAc;AAAd,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA;;AAGF,IAAA,mBAAA,gBAAA,OAAA,CAAA,8BAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,mBAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA","sourcesContent":["export {\n RadioGroup,\n /* eslint-disable-next-line deprecation/deprecation */\n radioGroupClassName,\n radioGroupClassNames,\n renderRadioGroup_unstable,\n useRadioGroupStyles_unstable,\n useRadioGroup_unstable,\n} from './RadioGroup';\nexport type { RadioGroupOnChangeData, RadioGroupProps, RadioGroupSlots, RadioGroupState } from './RadioGroup';\nexport {\n Radio,\n /* eslint-disable-next-line deprecation/deprecation */\n radioClassName,\n radioClassNames,\n renderRadio_unstable,\n useRadioStyles_unstable,\n useRadio_unstable,\n} from './Radio';\nexport type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';\nexport { RadioGroupContext } from './contexts/RadioGroupContext';\nexport type { RadioGroupContextValue } from './contexts/RadioGroupContext';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,YAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,UAAA;AAAU;AAAV,CAAA;AACA;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,qBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,mBAAA;AAAmB;AAAnB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,2BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,yBAAA;AAAyB;AAAzB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,8BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,4BAAA;AAA4B;AAA5B,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,wBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,YAAA,CAAA,sBAAA;AAAsB;AAAtB,CAAA;;AAUF,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,OAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,KAAA;AAAK;AAAL,CAAA;AACA;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,cAAA;AAAc;AAAd,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA;;AAGF,IAAA,OAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA;AAAmB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,0BAAA;AAA0B;AAA1B,CAAA","sourcesContent":["export {\n RadioGroup,\n /* eslint-disable-next-line deprecation/deprecation */\n radioGroupClassName,\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 {\n Radio,\n /* eslint-disable-next-line deprecation/deprecation */\n radioClassName,\n radioClassNames,\n renderRadio_unstable,\n useRadioStyles_unstable,\n useRadio_unstable,\n} from './Radio';\nexport type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';\nexport { RadioGroupContext, useRadioGroupContextValues } from './contexts/index';\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-radio",
3
- "version": "9.0.0-beta.4",
3
+ "version": "9.0.0-rc.3",
4
4
  "description": "Fluent UI Radio component",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
- "typings": "lib/index.d.ts",
7
+ "typings": "dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
@@ -13,6 +13,7 @@
13
13
  "license": "MIT",
14
14
  "scripts": {
15
15
  "build": "just-scripts build",
16
+ "bundle-size": "bundle-size measure",
16
17
  "clean": "just-scripts clean",
17
18
  "code-style": "just-scripts code-style",
18
19
  "just": "just-scripts",
@@ -20,22 +21,23 @@
20
21
  "start": "yarn storybook",
21
22
  "test": "jest --passWithNoTests",
22
23
  "docs": "api-extractor run --config=config/api-extractor.local.json --local",
23
- "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-radio/src && yarn docs",
24
- "storybook": "node ../../scripts/storybook/runner",
24
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-radio/src && yarn docs",
25
+ "storybook": "node ../../../scripts/storybook/runner",
25
26
  "type-check": "tsc -b tsconfig.json"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@fluentui/eslint-plugin": "*",
29
30
  "@fluentui/react-conformance": "*",
30
- "@fluentui/react-conformance-griffel": "9.0.0-beta.4"
31
+ "@fluentui/react-conformance-griffel": "9.0.0-beta.6"
31
32
  },
32
33
  "dependencies": {
34
+ "@fluentui/react-context-selector": "9.0.0-rc.9",
33
35
  "@fluentui/react-icons": "^2.0.166-rc.3",
34
- "@fluentui/react-label": "9.0.0-beta.10",
35
- "@fluentui/react-tabster": "9.0.0-rc.7",
36
- "@fluentui/react-theme": "9.0.0-rc.5",
37
- "@fluentui/react-utilities": "9.0.0-rc.6",
38
- "@griffel/react": "1.0.3",
36
+ "@fluentui/react-label": "9.0.0-rc.2",
37
+ "@fluentui/react-tabster": "9.0.0-rc.10",
38
+ "@fluentui/react-theme": "9.0.0-rc.8",
39
+ "@fluentui/react-utilities": "9.0.0-rc.9",
40
+ "@griffel/react": "1.0.5",
39
41
  "tslib": "^2.1.0"
40
42
  },
41
43
  "peerDependencies": {
package/lib/Radio.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Radio/index';
@@ -1 +0,0 @@
1
- export * from './components/RadioGroup/index';
@@ -1,6 +0,0 @@
1
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
2
- import type { RadioProps } from './Radio.types';
3
- /**
4
- * Radio component is a wrapper for a radio button with a label.
5
- */
6
- export declare const Radio: ForwardRefComponent<RadioProps>;
@@ -1,69 +0,0 @@
1
- import * as React from 'react';
2
- import { Label } from '@fluentui/react-label';
3
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
4
- export declare type RadioSlots = {
5
- /**
6
- * The root element of the Radio.
7
- *
8
- * The root slot receives the `className` and `style` specified directly on the `<Radio>`.
9
- * All other native props will be applied to the primary slot: `input`
10
- */
11
- root: NonNullable<Slot<'span'>>;
12
- /**
13
- * The Radio's label.
14
- */
15
- label: Slot<typeof Label>;
16
- /**
17
- * Hidden input that handles the radio's functionality.
18
- *
19
- * This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,
20
- * except `className` and `style`, which remain on the root slot.
21
- */
22
- input: NonNullable<Slot<'input'>>;
23
- /**
24
- * A circle outline, with a filled circle icon inside when the Radio is checked.
25
- */
26
- indicator: NonNullable<Slot<'div'>>;
27
- };
28
- /**
29
- * Radio Props
30
- */
31
- export declare type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'size'> & {
32
- /**
33
- * The value of the RadioGroup when this Radio item is selected.
34
- */
35
- value?: string;
36
- /**
37
- * The position of the label relative to the radio indicator.
38
- *
39
- * This defaults to `after` unless the Radio is inside a RadioGroup with `layout="horizontalStacked"`,
40
- * in which case it defaults to `below`.
41
- *
42
- * @defaultvalue after
43
- */
44
- labelPosition?: 'after' | 'below';
45
- /**
46
- * Disable this Radio item.
47
- */
48
- disabled?: boolean;
49
- /**
50
- * Callback when this Radio is selected in its group.
51
- *
52
- * **Note:** `onChange` is NOT called when this Radio is deselected.
53
- * Use RadioGroup's `onChange` event to determine when the selection in the group changes.
54
- */
55
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;
56
- };
57
- /**
58
- * Data for the onChange event for Radio.
59
- */
60
- export declare type RadioOnChangeData = {
61
- /**
62
- * The value prop of this Radio item.
63
- */
64
- value: string;
65
- };
66
- /**
67
- * State used in rendering Radio
68
- */
69
- export declare type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;
@@ -1,5 +0,0 @@
1
- export * from './Radio';
2
- export * from './Radio.types';
3
- export * from './renderRadio';
4
- export * from './useRadio';
5
- export * from './useRadioStyles';
@@ -1,5 +0,0 @@
1
- import type { RadioState } from './Radio.types';
2
- /**
3
- * Render the final JSX of Radio
4
- */
5
- export declare const renderRadio_unstable: (state: RadioState) => JSX.Element;
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import type { RadioProps, RadioState } from './Radio.types';
3
- /**
4
- * Create the state required to render Radio.
5
- *
6
- * The returned state can be modified with hooks such as useRadioStyles_unstable,
7
- * before being passed to renderRadio_unstable.
8
- *
9
- * @param props - props from this instance of Radio
10
- * @param ref - reference to `<input>` element of Radio
11
- */
12
- export declare const useRadio_unstable: (props: RadioProps, ref: React.Ref<HTMLInputElement>) => RadioState;
@@ -1,11 +0,0 @@
1
- import type { RadioSlots, RadioState } from './Radio.types';
2
- import type { SlotClassNames } from '@fluentui/react-utilities';
3
- /**
4
- * @deprecated Use `radioClassNames.root` instead.
5
- */
6
- export declare const radioClassName = "fui-Radio";
7
- export declare const radioClassNames: SlotClassNames<RadioSlots>;
8
- /**
9
- * Apply styling to the Radio slots based on the state
10
- */
11
- export declare const useRadioStyles_unstable: (state: RadioState) => void;
@@ -1,6 +0,0 @@
1
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
2
- import { RadioGroupProps } from './RadioGroup.types';
3
- /**
4
- * A RadioGroup component presents a set of options where only one option can be selected.
5
- */
6
- export declare const RadioGroup: ForwardRefComponent<RadioGroupProps>;
@@ -1,58 +0,0 @@
1
- import * as React from 'react';
2
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
- import { RadioGroupContextValue } from '../../contexts/RadioGroupContext';
4
- export declare type RadioGroupSlots = {
5
- /**
6
- * The radio group root.
7
- */
8
- root: NonNullable<Slot<'div'>>;
9
- };
10
- export declare type RadioGroupProps = Omit<ComponentProps<Partial<RadioGroupSlots>>, 'onChange'> & {
11
- /**
12
- * The name of this radio group. This name is applied to all Radio items inside this group.
13
- *
14
- * If no name is provided, one will be generated so that all of the Radio items have the same name.
15
- */
16
- name?: string;
17
- /**
18
- * The selected Radio item in this group.
19
- *
20
- * This should be the `value` prop of one of the Radio items inside this group.
21
- */
22
- value?: string;
23
- /**
24
- * The default selected Radio item in this group.
25
- *
26
- * This should be the `value` prop of one of the Radio items inside this group.
27
- */
28
- defaultValue?: string;
29
- /**
30
- * Callback when the selected Radio item changes.
31
- */
32
- onChange?: (ev: React.FormEvent<HTMLDivElement>, data: RadioGroupOnChangeData) => void;
33
- /**
34
- * How the radio items are laid out in the group.
35
- *
36
- * @defaultvalue vertical
37
- */
38
- layout?: 'vertical' | 'horizontal' | 'horizontalStacked';
39
- /**
40
- * Disable all Radio items in this group.
41
- */
42
- disabled?: boolean;
43
- };
44
- /**
45
- * Data for the onChange event for RadioGroup.
46
- */
47
- export declare type RadioGroupOnChangeData = {
48
- /**
49
- * The value of the newly selected Radio item.
50
- */
51
- value: string;
52
- };
53
- /**
54
- * State used in rendering RadioGroup
55
- */
56
- export declare type RadioGroupState = ComponentState<RadioGroupSlots> & Required<Pick<RadioGroupProps, 'layout'>> & {
57
- context: RadioGroupContextValue;
58
- };
@@ -1,5 +0,0 @@
1
- export * from './RadioGroup';
2
- export * from './RadioGroup.types';
3
- export * from './renderRadioGroup';
4
- export * from './useRadioGroup';
5
- export * from './useRadioGroupStyles';
@@ -1,5 +0,0 @@
1
- import { RadioGroupState } from './RadioGroup.types';
2
- /**
3
- * Render the final JSX of RadioGroup
4
- */
5
- export declare const renderRadioGroup_unstable: (state: RadioGroupState) => JSX.Element;
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import { RadioGroupProps, RadioGroupState } from './RadioGroup.types';
3
- /**
4
- * Create the state required to render RadioGroup.
5
- *
6
- * The returned state can be modified with hooks such as useRadioGroupStyles_unstable,
7
- * before being passed to renderRadioGroup_unstable.
8
- *
9
- * @param props - props from this instance of RadioGroup
10
- * @param ref - reference to root HTMLElement of RadioGroup
11
- */
12
- export declare const useRadioGroup_unstable: (props: RadioGroupProps, ref: React.Ref<HTMLDivElement>) => RadioGroupState;
@@ -1,11 +0,0 @@
1
- import { RadioGroupSlots, RadioGroupState } from './RadioGroup.types';
2
- import type { SlotClassNames } from '@fluentui/react-utilities';
3
- /**
4
- * @deprecated Use `radioGroupClassNames.root` instead.
5
- */
6
- export declare const radioGroupClassName = "fui-RadioGroup";
7
- export declare const radioGroupClassNames: SlotClassNames<RadioGroupSlots>;
8
- /**
9
- * Apply styling to the RadioGroup slots based on the state
10
- */
11
- export declare const useRadioGroupStyles_unstable: (state: RadioGroupState) => void;
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- import { RadioGroupProps } from '../RadioGroup';
3
- export declare type RadioGroupContextValue = Pick<RadioGroupProps, 'name' | 'layout' | 'value' | 'defaultValue' | 'disabled'>;
4
- /**
5
- * RadioGroupContext is provided by RadioGroup, and is consumed by Radio to determine default values of some props.
6
- */
7
- export declare const RadioGroupContext: React.Context<RadioGroupContextValue>;
package/lib/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export { RadioGroup, radioGroupClassName, radioGroupClassNames, renderRadioGroup_unstable, useRadioGroupStyles_unstable, useRadioGroup_unstable, } from './RadioGroup';
2
- export type { RadioGroupOnChangeData, RadioGroupProps, RadioGroupSlots, RadioGroupState } from './RadioGroup';
3
- export { Radio, radioClassName, radioClassNames, renderRadio_unstable, useRadioStyles_unstable, useRadio_unstable, } from './Radio';
4
- export type { RadioProps, RadioSlots, RadioState, RadioOnChangeData } from './Radio';
5
- export { RadioGroupContext } from './contexts/RadioGroupContext';
6
- export type { RadioGroupContextValue } from './contexts/RadioGroupContext';
@@ -1 +0,0 @@
1
- export * from './components/Radio/index';
@@ -1 +0,0 @@
1
- export * from './components/RadioGroup/index';
@@ -1,6 +0,0 @@
1
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
2
- import type { RadioProps } from './Radio.types';
3
- /**
4
- * Radio component is a wrapper for a radio button with a label.
5
- */
6
- export declare const Radio: ForwardRefComponent<RadioProps>;
@@ -1,69 +0,0 @@
1
- import * as React from 'react';
2
- import { Label } from '@fluentui/react-label';
3
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
4
- export declare type RadioSlots = {
5
- /**
6
- * The root element of the Radio.
7
- *
8
- * The root slot receives the `className` and `style` specified directly on the `<Radio>`.
9
- * All other native props will be applied to the primary slot: `input`
10
- */
11
- root: NonNullable<Slot<'span'>>;
12
- /**
13
- * The Radio's label.
14
- */
15
- label: Slot<typeof Label>;
16
- /**
17
- * Hidden input that handles the radio's functionality.
18
- *
19
- * This is the PRIMARY slot: all native properties specified directly on `<Radio>` will be applied to this slot,
20
- * except `className` and `style`, which remain on the root slot.
21
- */
22
- input: NonNullable<Slot<'input'>>;
23
- /**
24
- * A circle outline, with a filled circle icon inside when the Radio is checked.
25
- */
26
- indicator: NonNullable<Slot<'div'>>;
27
- };
28
- /**
29
- * Radio Props
30
- */
31
- export declare type RadioProps = Omit<ComponentProps<Partial<RadioSlots>, 'input'>, 'size'> & {
32
- /**
33
- * The value of the RadioGroup when this Radio item is selected.
34
- */
35
- value?: string;
36
- /**
37
- * The position of the label relative to the radio indicator.
38
- *
39
- * This defaults to `after` unless the Radio is inside a RadioGroup with `layout="horizontalStacked"`,
40
- * in which case it defaults to `below`.
41
- *
42
- * @defaultvalue after
43
- */
44
- labelPosition?: 'after' | 'below';
45
- /**
46
- * Disable this Radio item.
47
- */
48
- disabled?: boolean;
49
- /**
50
- * Callback when this Radio is selected in its group.
51
- *
52
- * **Note:** `onChange` is NOT called when this Radio is deselected.
53
- * Use RadioGroup's `onChange` event to determine when the selection in the group changes.
54
- */
55
- onChange?: (ev: React.ChangeEvent<HTMLInputElement>, data: RadioOnChangeData) => void;
56
- };
57
- /**
58
- * Data for the onChange event for Radio.
59
- */
60
- export declare type RadioOnChangeData = {
61
- /**
62
- * The value prop of this Radio item.
63
- */
64
- value: string;
65
- };
66
- /**
67
- * State used in rendering Radio
68
- */
69
- export declare type RadioState = ComponentState<RadioSlots> & Required<Pick<RadioProps, 'labelPosition'>>;
@@ -1,5 +0,0 @@
1
- export * from './Radio';
2
- export * from './Radio.types';
3
- export * from './renderRadio';
4
- export * from './useRadio';
5
- export * from './useRadioStyles';
@@ -1,5 +0,0 @@
1
- import type { RadioState } from './Radio.types';
2
- /**
3
- * Render the final JSX of Radio
4
- */
5
- export declare const renderRadio_unstable: (state: RadioState) => JSX.Element;
@@ -1,12 +0,0 @@
1
- import * as React from 'react';
2
- import type { RadioProps, RadioState } from './Radio.types';
3
- /**
4
- * Create the state required to render Radio.
5
- *
6
- * The returned state can be modified with hooks such as useRadioStyles_unstable,
7
- * before being passed to renderRadio_unstable.
8
- *
9
- * @param props - props from this instance of Radio
10
- * @param ref - reference to `<input>` element of Radio
11
- */
12
- export declare const useRadio_unstable: (props: RadioProps, ref: React.Ref<HTMLInputElement>) => RadioState;
@@ -1,11 +0,0 @@
1
- import type { RadioSlots, RadioState } from './Radio.types';
2
- import type { SlotClassNames } from '@fluentui/react-utilities';
3
- /**
4
- * @deprecated Use `radioClassNames.root` instead.
5
- */
6
- export declare const radioClassName = "fui-Radio";
7
- export declare const radioClassNames: SlotClassNames<RadioSlots>;
8
- /**
9
- * Apply styling to the Radio slots based on the state
10
- */
11
- export declare const useRadioStyles_unstable: (state: RadioState) => void;
@@ -1,6 +0,0 @@
1
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
2
- import { RadioGroupProps } from './RadioGroup.types';
3
- /**
4
- * A RadioGroup component presents a set of options where only one option can be selected.
5
- */
6
- export declare const RadioGroup: ForwardRefComponent<RadioGroupProps>;