@fluentui-react-native/radio-group 0.22.0 → 0.22.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 (156) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/lib/Radio/Radio.d.ts +2 -7
  3. package/lib/Radio/Radio.ios.d.ts +2 -7
  4. package/lib/Radio/Radio.ios.js +31 -50
  5. package/lib/Radio/Radio.js +31 -46
  6. package/lib/Radio/Radio.styling.d.ts +1 -1
  7. package/lib/Radio/Radio.styling.js +88 -109
  8. package/lib/Radio/Radio.types.d.ts +170 -176
  9. package/lib/Radio/Radio.types.js +1 -1
  10. package/lib/Radio/RadioTokens.android.d.ts +1 -1
  11. package/lib/Radio/RadioTokens.android.js +42 -42
  12. package/lib/Radio/RadioTokens.android.js.map +1 -1
  13. package/lib/Radio/RadioTokens.d.ts +1 -1
  14. package/lib/Radio/RadioTokens.ios.d.ts +1 -1
  15. package/lib/Radio/RadioTokens.ios.js +39 -39
  16. package/lib/Radio/RadioTokens.ios.js.map +1 -1
  17. package/lib/Radio/RadioTokens.js +76 -76
  18. package/lib/Radio/RadioTokens.js.map +1 -1
  19. package/lib/Radio/RadioTokens.win32.d.ts +1 -1
  20. package/lib/Radio/RadioTokens.win32.js +89 -89
  21. package/lib/Radio/RadioTokens.win32.js.map +1 -1
  22. package/lib/Radio/__tests__/RadioExperimental.test.d.ts +1 -1
  23. package/lib/Radio/__tests__/RadioExperimental.test.js +14 -14
  24. package/lib/Radio/useRadio.d.ts +1 -1
  25. package/lib/Radio/useRadio.js +70 -91
  26. package/lib/Radio/useRadio.win32.d.ts +1 -1
  27. package/lib/Radio/useRadio.win32.js +121 -143
  28. package/lib/RadioGroup/RadioGroup.d.ts +2 -7
  29. package/lib/RadioGroup/RadioGroup.js +34 -48
  30. package/lib/RadioGroup/RadioGroup.styling.d.ts +1 -1
  31. package/lib/RadioGroup/RadioGroup.styling.js +42 -51
  32. package/lib/RadioGroup/RadioGroup.types.d.ts +117 -117
  33. package/lib/RadioGroup/RadioGroup.types.js +1 -1
  34. package/lib/RadioGroup/RadioGroupTokens.android.d.ts +1 -1
  35. package/lib/RadioGroup/RadioGroupTokens.android.js +1 -1
  36. package/lib/RadioGroup/RadioGroupTokens.d.ts +1 -1
  37. package/lib/RadioGroup/RadioGroupTokens.ios.d.ts +1 -1
  38. package/lib/RadioGroup/RadioGroupTokens.ios.js +1 -1
  39. package/lib/RadioGroup/RadioGroupTokens.js +12 -12
  40. package/lib/RadioGroup/RadioGroupTokens.js.map +1 -1
  41. package/lib/RadioGroup/RadioGroupTokens.mobile.d.ts +1 -1
  42. package/lib/RadioGroup/RadioGroupTokens.mobile.js +13 -13
  43. package/lib/RadioGroup/RadioGroupTokens.mobile.js.map +1 -1
  44. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +1 -1
  45. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js +56 -98
  46. package/lib/RadioGroup/radioGroupContext.d.ts +1 -1
  47. package/lib/RadioGroup/radioGroupContext.js +15 -19
  48. package/lib/RadioGroup/useRadioGroup.d.ts +1 -1
  49. package/lib/RadioGroup/useRadioGroup.js +63 -93
  50. package/lib/RadioGroup/useRadioGroupContextValue.d.ts +1 -1
  51. package/lib/RadioGroup/useRadioGroupContextValue.js +2 -2
  52. package/lib/index.d.ts +4 -25
  53. package/lib/index.js +1 -1
  54. package/lib/legacy/MacOSRadioButtonNativeComponent.d.ts +6 -6
  55. package/lib/legacy/MacOSRadioButtonNativeComponent.js +1 -1
  56. package/lib/legacy/RadioButton.d.ts +2 -8
  57. package/lib/legacy/RadioButton.js +80 -96
  58. package/lib/legacy/RadioButton.macos.d.ts +2 -8
  59. package/lib/legacy/RadioButton.macos.js +48 -48
  60. package/lib/legacy/RadioButton.settings.d.ts +2 -2
  61. package/lib/legacy/RadioButton.settings.js +81 -81
  62. package/lib/legacy/RadioButton.types.d.ts +45 -45
  63. package/lib/legacy/RadioButton.types.js +1 -1
  64. package/lib/legacy/RadioButton.win32.d.ts +2 -8
  65. package/lib/legacy/RadioButton.win32.js +132 -151
  66. package/lib/legacy/RadioGroup.d.ts +2 -8
  67. package/lib/legacy/RadioGroup.js +84 -108
  68. package/lib/legacy/RadioGroup.settings.d.ts +1 -1
  69. package/lib/legacy/RadioGroup.settings.js +21 -21
  70. package/lib/legacy/RadioGroup.types.d.ts +79 -78
  71. package/lib/legacy/RadioGroup.types.js +1 -1
  72. package/lib/legacy/__tests__/RadioButton.test.d.ts +1 -1
  73. package/lib/legacy/__tests__/RadioButton.test.js +8 -8
  74. package/lib/legacy/__tests__/RadioButtonGroup.test.d.ts +1 -1
  75. package/lib/legacy/__tests__/RadioButtonGroup.test.js +18 -34
  76. package/lib-commonjs/Radio/Radio.d.ts +2 -7
  77. package/lib-commonjs/Radio/Radio.ios.d.ts +2 -7
  78. package/lib-commonjs/Radio/Radio.ios.js +40 -64
  79. package/lib-commonjs/Radio/Radio.js +39 -59
  80. package/lib-commonjs/Radio/Radio.styling.d.ts +1 -1
  81. package/lib-commonjs/Radio/Radio.styling.js +94 -115
  82. package/lib-commonjs/Radio/Radio.types.d.ts +170 -176
  83. package/lib-commonjs/Radio/Radio.types.js +3 -3
  84. package/lib-commonjs/Radio/RadioTokens.android.d.ts +1 -1
  85. package/lib-commonjs/Radio/RadioTokens.android.js +45 -45
  86. package/lib-commonjs/Radio/RadioTokens.android.js.map +1 -1
  87. package/lib-commonjs/Radio/RadioTokens.d.ts +1 -1
  88. package/lib-commonjs/Radio/RadioTokens.ios.d.ts +1 -1
  89. package/lib-commonjs/Radio/RadioTokens.ios.js +42 -42
  90. package/lib-commonjs/Radio/RadioTokens.ios.js.map +1 -1
  91. package/lib-commonjs/Radio/RadioTokens.js +79 -79
  92. package/lib-commonjs/Radio/RadioTokens.js.map +1 -1
  93. package/lib-commonjs/Radio/RadioTokens.win32.d.ts +1 -1
  94. package/lib-commonjs/Radio/RadioTokens.win32.js +92 -92
  95. package/lib-commonjs/Radio/RadioTokens.win32.js.map +1 -1
  96. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.d.ts +1 -1
  97. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js +48 -65
  98. package/lib-commonjs/Radio/useRadio.d.ts +1 -1
  99. package/lib-commonjs/Radio/useRadio.js +105 -143
  100. package/lib-commonjs/Radio/useRadio.win32.d.ts +1 -1
  101. package/lib-commonjs/Radio/useRadio.win32.js +157 -196
  102. package/lib-commonjs/RadioGroup/RadioGroup.d.ts +2 -7
  103. package/lib-commonjs/RadioGroup/RadioGroup.js +45 -65
  104. package/lib-commonjs/RadioGroup/RadioGroup.styling.d.ts +1 -1
  105. package/lib-commonjs/RadioGroup/RadioGroup.styling.js +48 -57
  106. package/lib-commonjs/RadioGroup/RadioGroup.types.d.ts +117 -117
  107. package/lib-commonjs/RadioGroup/RadioGroup.types.js +3 -3
  108. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.d.ts +1 -1
  109. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js +5 -10
  110. package/lib-commonjs/RadioGroup/RadioGroupTokens.d.ts +1 -1
  111. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.d.ts +1 -1
  112. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js +5 -10
  113. package/lib-commonjs/RadioGroup/RadioGroupTokens.js +15 -15
  114. package/lib-commonjs/RadioGroup/RadioGroupTokens.js.map +1 -1
  115. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.d.ts +1 -1
  116. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js +16 -16
  117. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js.map +1 -1
  118. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +1 -1
  119. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js +91 -153
  120. package/lib-commonjs/RadioGroup/radioGroupContext.d.ts +1 -1
  121. package/lib-commonjs/RadioGroup/radioGroupContext.js +47 -68
  122. package/lib-commonjs/RadioGroup/useRadioGroup.d.ts +1 -1
  123. package/lib-commonjs/RadioGroup/useRadioGroup.js +97 -144
  124. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts +1 -1
  125. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js +4 -4
  126. package/lib-commonjs/index.d.ts +4 -25
  127. package/lib-commonjs/index.js +32 -128
  128. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.d.ts +6 -6
  129. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.js +7 -9
  130. package/lib-commonjs/legacy/RadioButton.d.ts +2 -8
  131. package/lib-commonjs/legacy/RadioButton.js +121 -162
  132. package/lib-commonjs/legacy/RadioButton.macos.d.ts +2 -8
  133. package/lib-commonjs/legacy/RadioButton.macos.js +88 -107
  134. package/lib-commonjs/legacy/RadioButton.settings.d.ts +2 -2
  135. package/lib-commonjs/legacy/RadioButton.settings.js +84 -84
  136. package/lib-commonjs/legacy/RadioButton.types.d.ts +45 -45
  137. package/lib-commonjs/legacy/RadioButton.types.js +3 -3
  138. package/lib-commonjs/legacy/RadioButton.win32.d.ts +2 -8
  139. package/lib-commonjs/legacy/RadioButton.win32.js +173 -217
  140. package/lib-commonjs/legacy/RadioGroup.d.ts +2 -8
  141. package/lib-commonjs/legacy/RadioGroup.js +125 -168
  142. package/lib-commonjs/legacy/RadioGroup.settings.d.ts +1 -1
  143. package/lib-commonjs/legacy/RadioGroup.settings.js +24 -24
  144. package/lib-commonjs/legacy/RadioGroup.types.d.ts +79 -78
  145. package/lib-commonjs/legacy/RadioGroup.types.js +3 -3
  146. package/lib-commonjs/legacy/__tests__/RadioButton.test.d.ts +1 -1
  147. package/lib-commonjs/legacy/__tests__/RadioButton.test.js +42 -59
  148. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.d.ts +1 -1
  149. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js +53 -96
  150. package/package.json +27 -26
  151. package/src/Radio/RadioTokens.android.ts +1 -1
  152. package/src/Radio/RadioTokens.ios.ts +1 -1
  153. package/src/Radio/RadioTokens.ts +1 -1
  154. package/src/Radio/RadioTokens.win32.ts +1 -1
  155. package/src/RadioGroup/RadioGroupTokens.mobile.ts +1 -1
  156. package/src/RadioGroup/RadioGroupTokens.ts +1 -1
@@ -1,15 +1,15 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Radio = exports.radioLookup = void 0;
4
- const jsx_runtime_1 = require('@fluentui-react-native/framework-base/jsx-runtime');
4
+ const jsx_runtime_1 = require("@fluentui-react-native/framework-base/jsx-runtime");
5
5
  /** @jsxImportSource @fluentui-react-native/framework-base */
6
- const react_native_1 = require('react-native');
7
- const framework_1 = require('@fluentui-react-native/framework');
8
- const text_1 = require('@fluentui-react-native/text');
9
- const react_native_svg_1 = require('react-native-svg');
10
- const Radio_styling_1 = require('./Radio.styling');
11
- const Radio_types_1 = require('./Radio.types');
12
- const useRadio_1 = require('./useRadio');
6
+ const react_native_1 = require("react-native");
7
+ const framework_1 = require("@fluentui-react-native/framework");
8
+ const text_1 = require("@fluentui-react-native/text");
9
+ const react_native_svg_1 = require("react-native-svg");
10
+ const Radio_styling_1 = require("./Radio.styling");
11
+ const Radio_types_1 = require("./Radio.types");
12
+ const useRadio_1 = require("./useRadio");
13
13
  /**
14
14
  * A function which determines if a set of styles should be applied to the component given the current state and props of the Radio.
15
15
  *
@@ -19,61 +19,37 @@ const useRadio_1 = require('./useRadio');
19
19
  * @returns Whether the styles that are assigned to the layer should be applied to the Radio
20
20
  */
21
21
  const radioLookup = (layer, state, userProps) => {
22
- return (
23
- state[layer] ||
24
- userProps[layer] ||
25
- (!(react_native_1.Platform.OS === 'win32' || react_native_1.Platform.OS === 'android') &&
26
- layer === 'labelPositionBelow' &&
27
- userProps['labelPosition'] === 'below')
28
- );
22
+ return (state[layer] ||
23
+ userProps[layer] ||
24
+ (!(react_native_1.Platform.OS === 'win32' || react_native_1.Platform.OS === 'android') &&
25
+ layer === 'labelPositionBelow' &&
26
+ userProps['labelPosition'] === 'below'));
29
27
  };
30
28
  exports.radioLookup = radioLookup;
31
29
  exports.Radio = (0, framework_1.compose)({
32
- displayName: Radio_types_1.radioName,
33
- ...Radio_styling_1.stylingSettings,
34
- slots: {
35
- root: react_native_1.Pressable,
36
- button: react_native_1.Pressable,
37
- checkmark: react_native_svg_1.Svg,
38
- labelContent: react_native_1.View,
39
- label: text_1.TextV1,
40
- subtext: text_1.TextV1,
41
- },
42
- useRender: (userProps, useSlots) => {
43
- const radio = (0, useRadio_1.useRadio)(userProps);
44
- const Slots = useSlots(userProps, (layer) => (0, exports.radioLookup)(layer, radio.state, radio.props));
45
- // now return the handler for finishing render
46
- return (final) => {
47
- const { label, subtext, ...mergedProps } = (0, framework_1.mergeProps)(radio.props, final);
48
- const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
49
- const labelComponent = jsx_runtime_1.jsxs(Slots.labelContent, {
50
- children: [
51
- jsx_runtime_1.jsx(Slots.label, { children: label }),
52
- !!subtext && jsx_runtime_1.jsx(Slots.subtext, { children: subtext }),
53
- ],
54
- });
55
- const checkmarkPath = jsx_runtime_1.jsx(react_native_svg_1.Path, {
56
- fill: 'currentColor',
57
- d: 'M9.76497 3.20474C10.0661 3.48915 10.0797 3.96383 9.79526 4.26497L5.54526 8.76497C5.40613 8.91228 5.21332 8.99703 5.01071 8.99993C4.8081 9.00282 4.61295 8.92361 4.46967 8.78033L2.21967 6.53033C1.92678 6.23744 1.92678 5.76257 2.21967 5.46967C2.51256 5.17678 2.98744 5.17678 3.28033 5.46967L4.98463 7.17397L8.70474 3.23503C8.98915 2.9339 9.46383 2.92033 9.76497 3.20474Z',
58
- });
59
- return jsx_runtime_1.jsxs(Slots.root, {
60
- ...mergedProps,
61
- accessible: !disabled,
62
- focusable: !disabled,
63
- children: [
64
- jsx_runtime_1.jsx(Slots.button, {
65
- accessible: false,
66
- onPress: onPress,
67
- onPressIn: onPressIn,
68
- onPressOut: onPressOut,
69
- disabled: disabled,
70
- focusable: false,
71
- children: jsx_runtime_1.jsx(Slots.checkmark, { viewBox: '0 0 12 12', children: checkmarkPath }, 'checkmark'),
72
- }),
73
- labelComponent,
74
- ],
75
- });
76
- };
77
- },
30
+ displayName: Radio_types_1.radioName,
31
+ ...Radio_styling_1.stylingSettings,
32
+ slots: {
33
+ root: react_native_1.Pressable,
34
+ button: react_native_1.Pressable,
35
+ checkmark: react_native_svg_1.Svg,
36
+ labelContent: react_native_1.View,
37
+ label: text_1.TextV1,
38
+ subtext: text_1.TextV1,
39
+ },
40
+ useRender: (userProps, useSlots) => {
41
+ const radio = (0, useRadio_1.useRadio)(userProps);
42
+ const Slots = useSlots(userProps, (layer) => (0, exports.radioLookup)(layer, radio.state, radio.props));
43
+ // now return the handler for finishing render
44
+ return (final) => {
45
+ const { label, subtext, ...mergedProps } = (0, framework_1.mergeProps)(radio.props, final);
46
+ const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
47
+ const labelComponent = (jsx_runtime_1.jsxs(Slots.labelContent, { children: [
48
+ jsx_runtime_1.jsx(Slots.label, { children: label }), !!subtext && jsx_runtime_1.jsx(Slots.subtext, { children: subtext })] }));
49
+ const checkmarkPath = (jsx_runtime_1.jsx(react_native_svg_1.Path, { fill: "currentColor", d: "M9.76497 3.20474C10.0661 3.48915 10.0797 3.96383 9.79526 4.26497L5.54526 8.76497C5.40613 8.91228 5.21332 8.99703 5.01071 8.99993C4.8081 9.00282 4.61295 8.92361 4.46967 8.78033L2.21967 6.53033C1.92678 6.23744 1.92678 5.76257 2.21967 5.46967C2.51256 5.17678 2.98744 5.17678 3.28033 5.46967L4.98463 7.17397L8.70474 3.23503C8.98915 2.9339 9.46383 2.92033 9.76497 3.20474Z" }));
50
+ return (jsx_runtime_1.jsxs(Slots.root, { ...mergedProps, accessible: !disabled, focusable: !disabled, children: [
51
+ jsx_runtime_1.jsx(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false, children: jsx_runtime_1.jsx(Slots.checkmark, { viewBox: "0 0 12 12", children: checkmarkPath }, "checkmark") }), labelComponent] }));
52
+ };
53
+ },
78
54
  });
79
- //# sourceMappingURL=Radio.ios.js.map
55
+ //# sourceMappingURL=Radio.ios.js.map
@@ -1,14 +1,14 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Radio = exports.radioLookup = void 0;
4
- const jsx_runtime_1 = require('@fluentui-react-native/framework-base/jsx-runtime');
4
+ const jsx_runtime_1 = require("@fluentui-react-native/framework-base/jsx-runtime");
5
5
  /** @jsxImportSource @fluentui-react-native/framework-base */
6
- const react_native_1 = require('react-native');
7
- const framework_1 = require('@fluentui-react-native/framework');
8
- const text_1 = require('@fluentui-react-native/text');
9
- const Radio_styling_1 = require('./Radio.styling');
10
- const Radio_types_1 = require('./Radio.types');
11
- const useRadio_1 = require('./useRadio');
6
+ const react_native_1 = require("react-native");
7
+ const framework_1 = require("@fluentui-react-native/framework");
8
+ const text_1 = require("@fluentui-react-native/text");
9
+ const Radio_styling_1 = require("./Radio.styling");
10
+ const Radio_types_1 = require("./Radio.types");
11
+ const useRadio_1 = require("./useRadio");
12
12
  /**
13
13
  * A function which determines if a set of styles should be applied to the component given the current state and props of the Radio.
14
14
  *
@@ -18,57 +18,37 @@ const useRadio_1 = require('./useRadio');
18
18
  * @returns Whether the styles that are assigned to the layer should be applied to the Radio
19
19
  */
20
20
  const radioLookup = (layer, state, userProps) => {
21
- return (
22
- state[layer] ||
23
- userProps[layer] ||
24
- (!(react_native_1.Platform.OS === 'win32' || react_native_1.Platform.OS === 'android') &&
25
- layer === 'labelPositionBelow' &&
26
- userProps['labelPosition'] === 'below')
27
- );
21
+ return (state[layer] ||
22
+ userProps[layer] ||
23
+ (!(react_native_1.Platform.OS === 'win32' || react_native_1.Platform.OS === 'android') &&
24
+ layer === 'labelPositionBelow' &&
25
+ userProps['labelPosition'] === 'below'));
28
26
  };
29
27
  exports.radioLookup = radioLookup;
30
28
  exports.Radio = (0, framework_1.compose)({
31
- displayName: Radio_types_1.radioName,
32
- ...Radio_styling_1.stylingSettings,
33
- slots: {
34
- root: react_native_1.Pressable,
35
- button: react_native_1.Pressable,
36
- innerCircle: react_native_1.View,
37
- labelContent: react_native_1.View,
38
- label: text_1.TextV1,
39
- subtext: text_1.TextV1,
40
- },
41
- useRender: (userProps, useSlots) => {
42
- const radio = (0, useRadio_1.useRadio)(userProps);
43
- const Slots = useSlots(userProps, (layer) => (0, exports.radioLookup)(layer, radio.state, radio.props));
44
- // now return the handler for finishing render
45
- return (final) => {
46
- const { label, subtext, ...mergedProps } = (0, framework_1.mergeProps)(radio.props, final);
47
- const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
48
- const isMobile = react_native_1.Platform.OS === 'android' || react_native_1.Platform.OS === 'ios';
49
- const labelComponent = jsx_runtime_1.jsxs(Slots.labelContent, {
50
- children: [
51
- jsx_runtime_1.jsx(Slots.label, { children: label }),
52
- !!subtext && jsx_runtime_1.jsx(Slots.subtext, { children: subtext }),
53
- ],
54
- });
55
- return jsx_runtime_1.jsxs(Slots.root, {
56
- ...mergedProps,
57
- ...(isMobile && { accessible: !disabled, focusable: !disabled }),
58
- children: [
59
- jsx_runtime_1.jsx(Slots.button, {
60
- accessible: false,
61
- onPress: onPress,
62
- onPressIn: onPressIn,
63
- onPressOut: onPressOut,
64
- disabled: disabled,
65
- focusable: false,
66
- children: jsx_runtime_1.jsx(Slots.innerCircle, {}),
67
- }),
68
- labelComponent,
69
- ],
70
- });
71
- };
72
- },
29
+ displayName: Radio_types_1.radioName,
30
+ ...Radio_styling_1.stylingSettings,
31
+ slots: {
32
+ root: react_native_1.Pressable,
33
+ button: react_native_1.Pressable,
34
+ innerCircle: react_native_1.View,
35
+ labelContent: react_native_1.View,
36
+ label: text_1.TextV1,
37
+ subtext: text_1.TextV1,
38
+ },
39
+ useRender: (userProps, useSlots) => {
40
+ const radio = (0, useRadio_1.useRadio)(userProps);
41
+ const Slots = useSlots(userProps, (layer) => (0, exports.radioLookup)(layer, radio.state, radio.props));
42
+ // now return the handler for finishing render
43
+ return (final) => {
44
+ const { label, subtext, ...mergedProps } = (0, framework_1.mergeProps)(radio.props, final);
45
+ const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
46
+ const isMobile = react_native_1.Platform.OS === 'android' || react_native_1.Platform.OS === 'ios';
47
+ const labelComponent = (jsx_runtime_1.jsxs(Slots.labelContent, { children: [
48
+ jsx_runtime_1.jsx(Slots.label, { children: label }), !!subtext && jsx_runtime_1.jsx(Slots.subtext, { children: subtext })] }));
49
+ return (jsx_runtime_1.jsxs(Slots.root, { ...mergedProps, ...(isMobile && { accessible: !disabled, focusable: !disabled }), children: [
50
+ jsx_runtime_1.jsx(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false, children: jsx_runtime_1.jsx(Slots.innerCircle, {}) }), labelComponent] }));
51
+ };
52
+ },
73
53
  });
74
- //# sourceMappingURL=Radio.js.map
54
+ //# sourceMappingURL=Radio.js.map
@@ -2,4 +2,4 @@ import type { UseStylingOptions } from '@fluentui-react-native/framework';
2
2
  import type { RadioTokens, RadioSlotProps, RadioProps } from './Radio.types';
3
3
  export declare const radioStates: (keyof RadioTokens)[];
4
4
  export declare const stylingSettings: UseStylingOptions<RadioProps, RadioSlotProps, RadioTokens>;
5
- //# sourceMappingURL=Radio.styling.d.ts.map
5
+ //# sourceMappingURL=Radio.styling.d.ts.map
@@ -1,119 +1,98 @@
1
- 'use strict';
2
- Object.defineProperty(exports, '__esModule', { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stylingSettings = exports.radioStates = void 0;
4
- const framework_1 = require('@fluentui-react-native/framework');
5
- const tokens_1 = require('@fluentui-react-native/tokens');
6
- const Radio_types_1 = require('./Radio.types');
7
- const RadioTokens_1 = require('./RadioTokens');
4
+ const framework_1 = require("@fluentui-react-native/framework");
5
+ const tokens_1 = require("@fluentui-react-native/tokens");
6
+ const Radio_types_1 = require("./Radio.types");
7
+ const RadioTokens_1 = require("./RadioTokens");
8
8
  exports.radioStates = ['labelPositionBelow', 'focused', 'hovered', 'pressed', 'selected', 'disabled'];
9
9
  exports.stylingSettings = {
10
- tokens: [RadioTokens_1.defaultRadioTokens, Radio_types_1.radioName],
11
- states: exports.radioStates,
12
- slotProps: {
13
- root: (0, framework_1.buildProps)(
14
- (tokens) => ({
15
- style: {
16
- display: 'flex',
17
- alignItems: tokens.alignItems,
18
- flexDirection: tokens.flexDirection,
19
- paddingHorizontal: tokens.rootHorizontalPadding,
20
- paddingVertical: tokens.rootVerticalPadding,
21
- },
22
- android_ripple: { color: tokens.rippleColor },
23
- }),
24
- ['flexDirection', 'rootHorizontalPadding', 'rootVerticalPadding', 'rippleColor', 'alignItems'],
25
- ),
26
- button: (0, framework_1.buildProps)(
27
- (tokens) => ({
28
- style: {
29
- backgroundColor: tokens.radioOuterCircleBackground,
30
- width: tokens.radioOuterCircleSize,
31
- height: tokens.radioOuterCircleSize,
32
- alignItems: 'center',
33
- justifyContent: 'center',
34
- borderWidth: tokens.radioBorderWidth,
35
- borderStyle: tokens.radioBorderStyle,
36
- borderRadius: tokens.radioOuterCircleSize / 2,
37
- borderColor: tokens.radioBorder,
38
- marginTop: tokens.marginTop,
39
- marginRight: tokens.marginRight,
40
- marginBottom: tokens.marginBottom,
41
- marginLeft: tokens.marginLeft,
42
- },
43
- android_ripple: { color: tokens.rippleColor, radius: tokens.rippleRadius, borderless: true },
44
- }),
45
- [
46
- 'radioOuterCircleBackground',
47
- 'radioBorderWidth',
48
- 'radioBorderStyle',
49
- 'radioOuterCircleSize',
50
- 'rippleColor',
51
- 'rippleRadius',
52
- 'radioBorder',
53
- 'marginTop',
54
- 'marginRight',
55
- 'marginBottom',
56
- 'marginLeft',
57
- ],
58
- ),
59
- innerCircle: (0, framework_1.buildProps)(
60
- (tokens) => ({
61
- style: {
62
- opacity: tokens.radioVisibility,
63
- borderRadius: tokens.radioInnerCircleSize / 2,
64
- height: tokens.radioInnerCircleSize,
65
- width: tokens.radioInnerCircleSize,
66
- backgroundColor: tokens.radioFill,
67
- },
68
- }),
69
- ['radioInnerCircleSize', 'radioVisibility', 'radioFill'],
70
- ),
71
- labelContent: (0, framework_1.buildProps)(
72
- (tokens, theme) => ({
73
- style: {
74
- alignItems: tokens.labelAlignItems,
75
- flexDirection: 'column',
76
- marginRight: tokens.labelMarginRight,
77
- marginLeft: tokens.labelMarginLeft,
78
- padding: tokens.labelPadding,
79
- paddingRight: 0,
80
- ...tokens_1.borderStyles.from(tokens, theme),
81
- },
82
- }),
83
- ['labelAlignItems', 'labelMarginRight', 'labelMarginLeft', 'labelPadding', ...tokens_1.borderStyles.keys],
84
- ),
85
- checkmark: (0, framework_1.buildProps)(
86
- (tokens) => ({
87
- style: {
88
- opacity: tokens.radioVisibility,
89
- },
90
- }),
91
- ['radioVisibility'],
92
- ),
93
- label: (0, framework_1.buildProps)(
94
- (tokens, theme) => ({
95
- variant: tokens.variant,
96
- style: {
97
- marginVertical: tokens.labelMarginVertical,
98
- marginHorizontal: 2,
99
- color: tokens.color,
100
- ...tokens_1.fontStyles.from(tokens, theme),
101
- },
102
- }),
103
- ['variant', 'labelMarginVertical', 'color', ...tokens_1.fontStyles.keys],
104
- ),
105
- subtext: (0, framework_1.buildProps)(
106
- (tokens) => ({
107
- variant: tokens.subtextVariant,
108
- style: {
109
- marginTop: tokens.subtextMarginTop,
110
- marginBottom: tokens.subtextMarginBottom,
111
- marginHorizontal: 2,
112
- color: tokens.color,
113
- },
114
- }),
115
- ['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant'],
116
- ),
117
- },
10
+ tokens: [RadioTokens_1.defaultRadioTokens, Radio_types_1.radioName],
11
+ states: exports.radioStates,
12
+ slotProps: {
13
+ root: (0, framework_1.buildProps)((tokens) => ({
14
+ style: {
15
+ display: 'flex',
16
+ alignItems: tokens.alignItems,
17
+ flexDirection: tokens.flexDirection,
18
+ paddingHorizontal: tokens.rootHorizontalPadding,
19
+ paddingVertical: tokens.rootVerticalPadding,
20
+ },
21
+ android_ripple: { color: tokens.rippleColor },
22
+ }), ['flexDirection', 'rootHorizontalPadding', 'rootVerticalPadding', 'rippleColor', 'alignItems']),
23
+ button: (0, framework_1.buildProps)((tokens) => ({
24
+ style: {
25
+ backgroundColor: tokens.radioOuterCircleBackground,
26
+ width: tokens.radioOuterCircleSize,
27
+ height: tokens.radioOuterCircleSize,
28
+ alignItems: 'center',
29
+ justifyContent: 'center',
30
+ borderWidth: tokens.radioBorderWidth,
31
+ borderStyle: tokens.radioBorderStyle,
32
+ borderRadius: tokens.radioOuterCircleSize / 2,
33
+ borderColor: tokens.radioBorder,
34
+ marginTop: tokens.marginTop,
35
+ marginRight: tokens.marginRight,
36
+ marginBottom: tokens.marginBottom,
37
+ marginLeft: tokens.marginLeft,
38
+ },
39
+ android_ripple: { color: tokens.rippleColor, radius: tokens.rippleRadius, borderless: true },
40
+ }), [
41
+ 'radioOuterCircleBackground',
42
+ 'radioBorderWidth',
43
+ 'radioBorderStyle',
44
+ 'radioOuterCircleSize',
45
+ 'rippleColor',
46
+ 'rippleRadius',
47
+ 'radioBorder',
48
+ 'marginTop',
49
+ 'marginRight',
50
+ 'marginBottom',
51
+ 'marginLeft',
52
+ ]),
53
+ innerCircle: (0, framework_1.buildProps)((tokens) => ({
54
+ style: {
55
+ opacity: tokens.radioVisibility,
56
+ borderRadius: tokens.radioInnerCircleSize / 2,
57
+ height: tokens.radioInnerCircleSize,
58
+ width: tokens.radioInnerCircleSize,
59
+ backgroundColor: tokens.radioFill,
60
+ },
61
+ }), ['radioInnerCircleSize', 'radioVisibility', 'radioFill']),
62
+ labelContent: (0, framework_1.buildProps)((tokens, theme) => ({
63
+ style: {
64
+ alignItems: tokens.labelAlignItems,
65
+ flexDirection: 'column',
66
+ marginRight: tokens.labelMarginRight,
67
+ marginLeft: tokens.labelMarginLeft,
68
+ padding: tokens.labelPadding,
69
+ paddingRight: 0,
70
+ ...tokens_1.borderStyles.from(tokens, theme),
71
+ },
72
+ }), ['labelAlignItems', 'labelMarginRight', 'labelMarginLeft', 'labelPadding', ...tokens_1.borderStyles.keys]),
73
+ checkmark: (0, framework_1.buildProps)((tokens) => ({
74
+ style: {
75
+ opacity: tokens.radioVisibility,
76
+ },
77
+ }), ['radioVisibility']),
78
+ label: (0, framework_1.buildProps)((tokens, theme) => ({
79
+ variant: tokens.variant,
80
+ style: {
81
+ marginVertical: tokens.labelMarginVertical,
82
+ marginHorizontal: 2,
83
+ color: tokens.color,
84
+ ...tokens_1.fontStyles.from(tokens, theme),
85
+ },
86
+ }), ['variant', 'labelMarginVertical', 'color', ...tokens_1.fontStyles.keys]),
87
+ subtext: (0, framework_1.buildProps)((tokens) => ({
88
+ variant: tokens.subtextVariant,
89
+ style: {
90
+ marginTop: tokens.subtextMarginTop,
91
+ marginBottom: tokens.subtextMarginBottom,
92
+ marginHorizontal: 2,
93
+ color: tokens.color,
94
+ },
95
+ }), ['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant']),
96
+ },
118
97
  };
119
- //# sourceMappingURL=Radio.styling.js.map
98
+ //# sourceMappingURL=Radio.styling.js.map