@fluentui-react-native/radio-group 0.22.0 → 0.22.3

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 (187) hide show
  1. package/CHANGELOG.md +60 -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.d.ts.map +1 -1
  26. package/lib/Radio/useRadio.js +72 -91
  27. package/lib/Radio/useRadio.js.map +1 -1
  28. package/lib/Radio/useRadio.win32.d.ts +1 -1
  29. package/lib/Radio/useRadio.win32.d.ts.map +1 -1
  30. package/lib/Radio/useRadio.win32.js +126 -143
  31. package/lib/Radio/useRadio.win32.js.map +1 -1
  32. package/lib/RadioGroup/RadioGroup.d.ts +2 -7
  33. package/lib/RadioGroup/RadioGroup.js +34 -48
  34. package/lib/RadioGroup/RadioGroup.styling.d.ts +1 -1
  35. package/lib/RadioGroup/RadioGroup.styling.js +42 -51
  36. package/lib/RadioGroup/RadioGroup.types.d.ts +117 -117
  37. package/lib/RadioGroup/RadioGroup.types.js +1 -1
  38. package/lib/RadioGroup/RadioGroupTokens.android.d.ts +1 -1
  39. package/lib/RadioGroup/RadioGroupTokens.android.js +1 -1
  40. package/lib/RadioGroup/RadioGroupTokens.d.ts +1 -1
  41. package/lib/RadioGroup/RadioGroupTokens.ios.d.ts +1 -1
  42. package/lib/RadioGroup/RadioGroupTokens.ios.js +1 -1
  43. package/lib/RadioGroup/RadioGroupTokens.js +12 -12
  44. package/lib/RadioGroup/RadioGroupTokens.js.map +1 -1
  45. package/lib/RadioGroup/RadioGroupTokens.mobile.d.ts +1 -1
  46. package/lib/RadioGroup/RadioGroupTokens.mobile.js +13 -13
  47. package/lib/RadioGroup/RadioGroupTokens.mobile.js.map +1 -1
  48. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +1 -1
  49. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js +56 -98
  50. package/lib/RadioGroup/radioGroupContext.d.ts +1 -1
  51. package/lib/RadioGroup/radioGroupContext.js +15 -19
  52. package/lib/RadioGroup/useRadioGroup.d.ts +1 -1
  53. package/lib/RadioGroup/useRadioGroup.js +63 -93
  54. package/lib/RadioGroup/useRadioGroupContextValue.d.ts +1 -1
  55. package/lib/RadioGroup/useRadioGroupContextValue.js +2 -2
  56. package/lib/index.d.ts +4 -25
  57. package/lib/index.js +1 -1
  58. package/lib/legacy/MacOSRadioButtonNativeComponent.d.ts +6 -6
  59. package/lib/legacy/MacOSRadioButtonNativeComponent.js +1 -1
  60. package/lib/legacy/RadioButton.d.ts +2 -8
  61. package/lib/legacy/RadioButton.d.ts.map +1 -1
  62. package/lib/legacy/RadioButton.js +82 -96
  63. package/lib/legacy/RadioButton.js.map +1 -1
  64. package/lib/legacy/RadioButton.macos.d.ts +2 -8
  65. package/lib/legacy/RadioButton.macos.d.ts.map +1 -1
  66. package/lib/legacy/RadioButton.macos.js +50 -48
  67. package/lib/legacy/RadioButton.macos.js.map +1 -1
  68. package/lib/legacy/RadioButton.settings.d.ts +2 -2
  69. package/lib/legacy/RadioButton.settings.js +81 -81
  70. package/lib/legacy/RadioButton.types.d.ts +45 -45
  71. package/lib/legacy/RadioButton.types.js +1 -1
  72. package/lib/legacy/RadioButton.win32.d.ts +2 -8
  73. package/lib/legacy/RadioButton.win32.d.ts.map +1 -1
  74. package/lib/legacy/RadioButton.win32.js +136 -151
  75. package/lib/legacy/RadioButton.win32.js.map +1 -1
  76. package/lib/legacy/RadioGroup.d.ts +2 -8
  77. package/lib/legacy/RadioGroup.d.ts.map +1 -1
  78. package/lib/legacy/RadioGroup.js +80 -108
  79. package/lib/legacy/RadioGroup.js.map +1 -1
  80. package/lib/legacy/RadioGroup.settings.d.ts +1 -1
  81. package/lib/legacy/RadioGroup.settings.js +21 -21
  82. package/lib/legacy/RadioGroup.types.d.ts +79 -78
  83. package/lib/legacy/RadioGroup.types.js +1 -1
  84. package/lib/legacy/__tests__/RadioButton.test.d.ts +1 -1
  85. package/lib/legacy/__tests__/RadioButton.test.js +8 -8
  86. package/lib/legacy/__tests__/RadioButtonGroup.test.d.ts +1 -1
  87. package/lib/legacy/__tests__/RadioButtonGroup.test.js +18 -34
  88. package/lib-commonjs/Radio/Radio.d.ts +2 -7
  89. package/lib-commonjs/Radio/Radio.ios.d.ts +2 -7
  90. package/lib-commonjs/Radio/Radio.ios.js +40 -64
  91. package/lib-commonjs/Radio/Radio.js +39 -59
  92. package/lib-commonjs/Radio/Radio.styling.d.ts +1 -1
  93. package/lib-commonjs/Radio/Radio.styling.js +94 -115
  94. package/lib-commonjs/Radio/Radio.types.d.ts +170 -176
  95. package/lib-commonjs/Radio/Radio.types.js +3 -3
  96. package/lib-commonjs/Radio/RadioTokens.android.d.ts +1 -1
  97. package/lib-commonjs/Radio/RadioTokens.android.js +45 -45
  98. package/lib-commonjs/Radio/RadioTokens.android.js.map +1 -1
  99. package/lib-commonjs/Radio/RadioTokens.d.ts +1 -1
  100. package/lib-commonjs/Radio/RadioTokens.ios.d.ts +1 -1
  101. package/lib-commonjs/Radio/RadioTokens.ios.js +42 -42
  102. package/lib-commonjs/Radio/RadioTokens.ios.js.map +1 -1
  103. package/lib-commonjs/Radio/RadioTokens.js +79 -79
  104. package/lib-commonjs/Radio/RadioTokens.js.map +1 -1
  105. package/lib-commonjs/Radio/RadioTokens.win32.d.ts +1 -1
  106. package/lib-commonjs/Radio/RadioTokens.win32.js +92 -92
  107. package/lib-commonjs/Radio/RadioTokens.win32.js.map +1 -1
  108. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.d.ts +1 -1
  109. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js +48 -65
  110. package/lib-commonjs/Radio/useRadio.d.ts +1 -1
  111. package/lib-commonjs/Radio/useRadio.d.ts.map +1 -1
  112. package/lib-commonjs/Radio/useRadio.js +107 -143
  113. package/lib-commonjs/Radio/useRadio.js.map +1 -1
  114. package/lib-commonjs/Radio/useRadio.win32.d.ts +1 -1
  115. package/lib-commonjs/Radio/useRadio.win32.d.ts.map +1 -1
  116. package/lib-commonjs/Radio/useRadio.win32.js +162 -196
  117. package/lib-commonjs/Radio/useRadio.win32.js.map +1 -1
  118. package/lib-commonjs/RadioGroup/RadioGroup.d.ts +2 -7
  119. package/lib-commonjs/RadioGroup/RadioGroup.js +45 -65
  120. package/lib-commonjs/RadioGroup/RadioGroup.styling.d.ts +1 -1
  121. package/lib-commonjs/RadioGroup/RadioGroup.styling.js +48 -57
  122. package/lib-commonjs/RadioGroup/RadioGroup.types.d.ts +117 -117
  123. package/lib-commonjs/RadioGroup/RadioGroup.types.js +3 -3
  124. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.d.ts +1 -1
  125. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js +5 -10
  126. package/lib-commonjs/RadioGroup/RadioGroupTokens.d.ts +1 -1
  127. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.d.ts +1 -1
  128. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js +5 -10
  129. package/lib-commonjs/RadioGroup/RadioGroupTokens.js +15 -15
  130. package/lib-commonjs/RadioGroup/RadioGroupTokens.js.map +1 -1
  131. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.d.ts +1 -1
  132. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js +16 -16
  133. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js.map +1 -1
  134. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +1 -1
  135. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js +91 -153
  136. package/lib-commonjs/RadioGroup/radioGroupContext.d.ts +1 -1
  137. package/lib-commonjs/RadioGroup/radioGroupContext.js +47 -68
  138. package/lib-commonjs/RadioGroup/useRadioGroup.d.ts +1 -1
  139. package/lib-commonjs/RadioGroup/useRadioGroup.js +97 -144
  140. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts +1 -1
  141. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js +4 -4
  142. package/lib-commonjs/index.d.ts +4 -25
  143. package/lib-commonjs/index.js +32 -128
  144. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.d.ts +6 -6
  145. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.js +7 -9
  146. package/lib-commonjs/legacy/RadioButton.d.ts +2 -8
  147. package/lib-commonjs/legacy/RadioButton.d.ts.map +1 -1
  148. package/lib-commonjs/legacy/RadioButton.js +123 -162
  149. package/lib-commonjs/legacy/RadioButton.js.map +1 -1
  150. package/lib-commonjs/legacy/RadioButton.macos.d.ts +2 -8
  151. package/lib-commonjs/legacy/RadioButton.macos.d.ts.map +1 -1
  152. package/lib-commonjs/legacy/RadioButton.macos.js +90 -107
  153. package/lib-commonjs/legacy/RadioButton.macos.js.map +1 -1
  154. package/lib-commonjs/legacy/RadioButton.settings.d.ts +2 -2
  155. package/lib-commonjs/legacy/RadioButton.settings.js +84 -84
  156. package/lib-commonjs/legacy/RadioButton.types.d.ts +45 -45
  157. package/lib-commonjs/legacy/RadioButton.types.js +3 -3
  158. package/lib-commonjs/legacy/RadioButton.win32.d.ts +2 -8
  159. package/lib-commonjs/legacy/RadioButton.win32.d.ts.map +1 -1
  160. package/lib-commonjs/legacy/RadioButton.win32.js +177 -217
  161. package/lib-commonjs/legacy/RadioButton.win32.js.map +1 -1
  162. package/lib-commonjs/legacy/RadioGroup.d.ts +2 -8
  163. package/lib-commonjs/legacy/RadioGroup.d.ts.map +1 -1
  164. package/lib-commonjs/legacy/RadioGroup.js +121 -168
  165. package/lib-commonjs/legacy/RadioGroup.js.map +1 -1
  166. package/lib-commonjs/legacy/RadioGroup.settings.d.ts +1 -1
  167. package/lib-commonjs/legacy/RadioGroup.settings.js +24 -24
  168. package/lib-commonjs/legacy/RadioGroup.types.d.ts +79 -78
  169. package/lib-commonjs/legacy/RadioGroup.types.js +3 -3
  170. package/lib-commonjs/legacy/__tests__/RadioButton.test.d.ts +1 -1
  171. package/lib-commonjs/legacy/__tests__/RadioButton.test.js +42 -59
  172. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.d.ts +1 -1
  173. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js +53 -96
  174. package/package.json +35 -34
  175. package/src/Radio/RadioTokens.android.ts +1 -1
  176. package/src/Radio/RadioTokens.ios.ts +1 -1
  177. package/src/Radio/RadioTokens.ts +1 -1
  178. package/src/Radio/RadioTokens.win32.ts +1 -1
  179. package/src/Radio/useRadio.ts +13 -11
  180. package/src/Radio/useRadio.win32.ts +45 -26
  181. package/src/RadioGroup/RadioGroupTokens.mobile.ts +1 -1
  182. package/src/RadioGroup/RadioGroupTokens.ts +1 -1
  183. package/src/legacy/RadioButton.macos.tsx +10 -8
  184. package/src/legacy/RadioButton.tsx +13 -11
  185. package/src/legacy/RadioButton.win32.tsx +46 -30
  186. package/src/legacy/RadioGroup.tsx +4 -8
  187. package/eslint.config.js +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # Change Log - @fluentui-react-native/radio-group
2
2
 
3
+ ## 0.22.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 9cf4444: Migrate from ESLint to oxlint
8
+ - Updated dependencies [9cf4444]
9
+ - @uifabricshared/foundation-composable@0.14.3
10
+ - @uifabricshared/foundation-settings@0.16.3
11
+ - @uifabricshared/foundation-compose@1.16.3
12
+ - @fluentui-react-native/interactive-hooks@0.28.3
13
+ - @fluentui-react-native/use-styling@0.14.3
14
+ - @fluentui-react-native/focus-zone@0.22.3
15
+ - @fluentui-react-native/pressable@0.13.3
16
+ - @fluentui-react-native/theme-tokens@0.28.3
17
+ - @fluentui-react-native/framework@0.15.3
18
+ - @fluentui-react-native/text@0.25.3
19
+ - @fluentui-react-native/adapters@0.14.3
20
+ - @fluentui-react-native/tokens@0.24.3
21
+
22
+ ## 0.22.2
23
+
24
+ ### Patch Changes
25
+
26
+ - 8a7b549: Update to the latest rnx-kit versions, fix some typing issues, and correct the vscode settings
27
+ - Updated dependencies [8a7b549]
28
+ - @uifabricshared/foundation-composable@0.14.2
29
+ - @uifabricshared/foundation-settings@0.16.2
30
+ - @uifabricshared/foundation-compose@1.16.2
31
+ - @fluentui-react-native/interactive-hooks@0.28.2
32
+ - @fluentui-react-native/use-styling@0.14.2
33
+ - @fluentui-react-native/focus-zone@0.22.2
34
+ - @fluentui-react-native/pressable@0.13.2
35
+ - @fluentui-react-native/theme-tokens@0.28.2
36
+ - @fluentui-react-native/framework@0.15.2
37
+ - @fluentui-react-native/text@0.25.2
38
+ - @fluentui-react-native/adapters@0.14.2
39
+ - @fluentui-react-native/tokens@0.24.2
40
+
41
+ ## 0.22.1
42
+
43
+ ### Patch Changes
44
+
45
+ - 0d6e9c1: chore: migrate to `oxfmt`
46
+ - ac6e7af: Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering
47
+ - Updated dependencies [f72b43a]
48
+ - Updated dependencies [0d6e9c1]
49
+ - Updated dependencies [ac6e7af]
50
+ - @fluentui-react-native/focus-zone@0.22.1
51
+ - @uifabricshared/foundation-composable@0.14.1
52
+ - @uifabricshared/foundation-settings@0.16.1
53
+ - @uifabricshared/foundation-compose@1.16.1
54
+ - @fluentui-react-native/interactive-hooks@0.28.1
55
+ - @fluentui-react-native/use-styling@0.14.1
56
+ - @fluentui-react-native/pressable@0.13.1
57
+ - @fluentui-react-native/theme-tokens@0.28.1
58
+ - @fluentui-react-native/framework@0.15.1
59
+ - @fluentui-react-native/text@0.25.1
60
+ - @fluentui-react-native/adapters@0.14.1
61
+ - @fluentui-react-native/tokens@0.24.1
62
+
3
63
  ## 0.22.0
4
64
 
5
65
  ### Minor Changes
@@ -9,10 +9,5 @@ import type { RadioProps } from './Radio.types';
9
9
  * @returns Whether the styles that are assigned to the layer should be applied to the Radio
10
10
  */
11
11
  export declare const radioLookup: (layer: string, state: PressableState, userProps: RadioProps) => boolean;
12
- export declare const Radio: import('@fluentui-react-native/framework').ComposableComponent<
13
- RadioProps,
14
- import('./Radio.types').RadioSlotProps,
15
- import('./Radio.types').RadioTokens,
16
- import('@fluentui-react-native/framework-base').ObjectBase
17
- >;
18
- //# sourceMappingURL=Radio.d.ts.map
12
+ export declare const Radio: import("@fluentui-react-native/framework").ComposableComponent<RadioProps, import("./Radio.types").RadioSlotProps, import("./Radio.types").RadioTokens, import("@fluentui-react-native/framework-base").ObjectBase>;
13
+ //# sourceMappingURL=Radio.d.ts.map
@@ -9,10 +9,5 @@ import type { RadioProps } from './Radio.types';
9
9
  * @returns Whether the styles that are assigned to the layer should be applied to the Radio
10
10
  */
11
11
  export declare const radioLookup: (layer: string, state: PressableState, userProps: RadioProps) => boolean;
12
- export declare const Radio: import('@fluentui-react-native/framework').ComposableComponent<
13
- RadioProps,
14
- import('./Radio.types').RadioSlotProps,
15
- import('./Radio.types').RadioTokens,
16
- import('@fluentui-react-native/framework-base').ObjectBase
17
- >;
18
- //# sourceMappingURL=Radio.ios.d.ts.map
12
+ export declare const Radio: import("@fluentui-react-native/framework").ComposableComponent<RadioProps, import("./Radio.types").RadioSlotProps, import("./Radio.types").RadioTokens, import("@fluentui-react-native/framework-base").ObjectBase>;
13
+ //# sourceMappingURL=Radio.ios.d.ts.map
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from '@fluentui-react-native/framework-base/jsx-runtime';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui-react-native/framework-base/jsx-runtime";
2
2
  /** @jsxImportSource @fluentui-react-native/framework-base */
3
3
  import { Platform, Pressable, View } from 'react-native';
4
4
  import { compose, mergeProps } from '@fluentui-react-native/framework';
@@ -16,55 +16,36 @@ import { useRadio } from './useRadio';
16
16
  * @returns Whether the styles that are assigned to the layer should be applied to the Radio
17
17
  */
18
18
  export const radioLookup = (layer, state, userProps) => {
19
- return (
20
- state[layer] ||
21
- userProps[layer] ||
22
- (!(Platform.OS === 'win32' || Platform.OS === 'android') && layer === 'labelPositionBelow' && userProps['labelPosition'] === 'below')
23
- );
19
+ return (state[layer] ||
20
+ userProps[layer] ||
21
+ (!(Platform.OS === 'win32' || Platform.OS === 'android') &&
22
+ layer === 'labelPositionBelow' &&
23
+ userProps['labelPosition'] === 'below'));
24
24
  };
25
25
  export const Radio = compose({
26
- displayName: radioName,
27
- ...stylingSettings,
28
- slots: {
29
- root: Pressable,
30
- button: Pressable,
31
- checkmark: Svg,
32
- labelContent: View,
33
- label: Text,
34
- subtext: Text,
35
- },
36
- useRender: (userProps, useSlots) => {
37
- const radio = useRadio(userProps);
38
- const Slots = useSlots(userProps, (layer) => radioLookup(layer, radio.state, radio.props));
39
- // now return the handler for finishing render
40
- return (final) => {
41
- const { label, subtext, ...mergedProps } = mergeProps(radio.props, final);
42
- const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
43
- const labelComponent = _jsxs(Slots.labelContent, {
44
- children: [_jsx(Slots.label, { children: label }), !!subtext && _jsx(Slots.subtext, { children: subtext })],
45
- });
46
- const checkmarkPath = _jsx(Path, {
47
- fill: 'currentColor',
48
- 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',
49
- });
50
- return _jsxs(Slots.root, {
51
- ...mergedProps,
52
- accessible: !disabled,
53
- focusable: !disabled,
54
- children: [
55
- _jsx(Slots.button, {
56
- accessible: false,
57
- onPress: onPress,
58
- onPressIn: onPressIn,
59
- onPressOut: onPressOut,
60
- disabled: disabled,
61
- focusable: false,
62
- children: _jsx(Slots.checkmark, { viewBox: '0 0 12 12', children: checkmarkPath }, 'checkmark'),
63
- }),
64
- labelComponent,
65
- ],
66
- });
67
- };
68
- },
26
+ displayName: radioName,
27
+ ...stylingSettings,
28
+ slots: {
29
+ root: Pressable,
30
+ button: Pressable,
31
+ checkmark: Svg,
32
+ labelContent: View,
33
+ label: Text,
34
+ subtext: Text,
35
+ },
36
+ useRender: (userProps, useSlots) => {
37
+ const radio = useRadio(userProps);
38
+ const Slots = useSlots(userProps, (layer) => radioLookup(layer, radio.state, radio.props));
39
+ // now return the handler for finishing render
40
+ return (final) => {
41
+ const { label, subtext, ...mergedProps } = mergeProps(radio.props, final);
42
+ const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
43
+ const labelComponent = (_jsxs(Slots.labelContent, { children: [
44
+ _jsx(Slots.label, { children: label }), !!subtext && _jsx(Slots.subtext, { children: subtext })] }));
45
+ const checkmarkPath = (_jsx(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" }));
46
+ return (_jsxs(Slots.root, { ...mergedProps, accessible: !disabled, focusable: !disabled, children: [
47
+ _jsx(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false, children: _jsx(Slots.checkmark, { viewBox: "0 0 12 12", children: checkmarkPath }, "checkmark") }), labelComponent] }));
48
+ };
49
+ },
69
50
  });
70
- //# sourceMappingURL=Radio.ios.js.map
51
+ //# sourceMappingURL=Radio.ios.js.map
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from '@fluentui-react-native/framework-base/jsx-runtime';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui-react-native/framework-base/jsx-runtime";
2
2
  /** @jsxImportSource @fluentui-react-native/framework-base */
3
3
  import { Platform, Pressable, View } from 'react-native';
4
4
  import { compose, mergeProps } from '@fluentui-react-native/framework';
@@ -15,51 +15,36 @@ import { useRadio } from './useRadio';
15
15
  * @returns Whether the styles that are assigned to the layer should be applied to the Radio
16
16
  */
17
17
  export const radioLookup = (layer, state, userProps) => {
18
- return (
19
- state[layer] ||
20
- userProps[layer] ||
21
- (!(Platform.OS === 'win32' || Platform.OS === 'android') && layer === 'labelPositionBelow' && userProps['labelPosition'] === 'below')
22
- );
18
+ return (state[layer] ||
19
+ userProps[layer] ||
20
+ (!(Platform.OS === 'win32' || Platform.OS === 'android') &&
21
+ layer === 'labelPositionBelow' &&
22
+ userProps['labelPosition'] === 'below'));
23
23
  };
24
24
  export const Radio = compose({
25
- displayName: radioName,
26
- ...stylingSettings,
27
- slots: {
28
- root: Pressable,
29
- button: Pressable,
30
- innerCircle: View,
31
- labelContent: View,
32
- label: Text,
33
- subtext: Text,
34
- },
35
- useRender: (userProps, useSlots) => {
36
- const radio = useRadio(userProps);
37
- const Slots = useSlots(userProps, (layer) => radioLookup(layer, radio.state, radio.props));
38
- // now return the handler for finishing render
39
- return (final) => {
40
- const { label, subtext, ...mergedProps } = mergeProps(radio.props, final);
41
- const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
42
- const isMobile = Platform.OS === 'android' || Platform.OS === 'ios';
43
- const labelComponent = _jsxs(Slots.labelContent, {
44
- children: [_jsx(Slots.label, { children: label }), !!subtext && _jsx(Slots.subtext, { children: subtext })],
45
- });
46
- return _jsxs(Slots.root, {
47
- ...mergedProps,
48
- ...(isMobile && { accessible: !disabled, focusable: !disabled }),
49
- children: [
50
- _jsx(Slots.button, {
51
- accessible: false,
52
- onPress: onPress,
53
- onPressIn: onPressIn,
54
- onPressOut: onPressOut,
55
- disabled: disabled,
56
- focusable: false,
57
- children: _jsx(Slots.innerCircle, {}),
58
- }),
59
- labelComponent,
60
- ],
61
- });
62
- };
63
- },
25
+ displayName: radioName,
26
+ ...stylingSettings,
27
+ slots: {
28
+ root: Pressable,
29
+ button: Pressable,
30
+ innerCircle: View,
31
+ labelContent: View,
32
+ label: Text,
33
+ subtext: Text,
34
+ },
35
+ useRender: (userProps, useSlots) => {
36
+ const radio = useRadio(userProps);
37
+ const Slots = useSlots(userProps, (layer) => radioLookup(layer, radio.state, radio.props));
38
+ // now return the handler for finishing render
39
+ return (final) => {
40
+ const { label, subtext, ...mergedProps } = mergeProps(radio.props, final);
41
+ const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
42
+ const isMobile = Platform.OS === 'android' || Platform.OS === 'ios';
43
+ const labelComponent = (_jsxs(Slots.labelContent, { children: [
44
+ _jsx(Slots.label, { children: label }), !!subtext && _jsx(Slots.subtext, { children: subtext })] }));
45
+ return (_jsxs(Slots.root, { ...mergedProps, ...(isMobile && { accessible: !disabled, focusable: !disabled }), children: [
46
+ _jsx(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false, children: _jsx(Slots.innerCircle, {}) }), labelComponent] }));
47
+ };
48
+ },
64
49
  });
65
- //# sourceMappingURL=Radio.js.map
50
+ //# 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
@@ -4,113 +4,92 @@ import { radioName } from './Radio.types';
4
4
  import { defaultRadioTokens } from './RadioTokens';
5
5
  export const radioStates = ['labelPositionBelow', 'focused', 'hovered', 'pressed', 'selected', 'disabled'];
6
6
  export const stylingSettings = {
7
- tokens: [defaultRadioTokens, radioName],
8
- states: radioStates,
9
- slotProps: {
10
- root: buildProps(
11
- (tokens) => ({
12
- style: {
13
- display: 'flex',
14
- alignItems: tokens.alignItems,
15
- flexDirection: tokens.flexDirection,
16
- paddingHorizontal: tokens.rootHorizontalPadding,
17
- paddingVertical: tokens.rootVerticalPadding,
18
- },
19
- android_ripple: { color: tokens.rippleColor },
20
- }),
21
- ['flexDirection', 'rootHorizontalPadding', 'rootVerticalPadding', 'rippleColor', 'alignItems'],
22
- ),
23
- button: buildProps(
24
- (tokens) => ({
25
- style: {
26
- backgroundColor: tokens.radioOuterCircleBackground,
27
- width: tokens.radioOuterCircleSize,
28
- height: tokens.radioOuterCircleSize,
29
- alignItems: 'center',
30
- justifyContent: 'center',
31
- borderWidth: tokens.radioBorderWidth,
32
- borderStyle: tokens.radioBorderStyle,
33
- borderRadius: tokens.radioOuterCircleSize / 2,
34
- borderColor: tokens.radioBorder,
35
- marginTop: tokens.marginTop,
36
- marginRight: tokens.marginRight,
37
- marginBottom: tokens.marginBottom,
38
- marginLeft: tokens.marginLeft,
39
- },
40
- android_ripple: { color: tokens.rippleColor, radius: tokens.rippleRadius, borderless: true },
41
- }),
42
- [
43
- 'radioOuterCircleBackground',
44
- 'radioBorderWidth',
45
- 'radioBorderStyle',
46
- 'radioOuterCircleSize',
47
- 'rippleColor',
48
- 'rippleRadius',
49
- 'radioBorder',
50
- 'marginTop',
51
- 'marginRight',
52
- 'marginBottom',
53
- 'marginLeft',
54
- ],
55
- ),
56
- innerCircle: buildProps(
57
- (tokens) => ({
58
- style: {
59
- opacity: tokens.radioVisibility,
60
- borderRadius: tokens.radioInnerCircleSize / 2,
61
- height: tokens.radioInnerCircleSize,
62
- width: tokens.radioInnerCircleSize,
63
- backgroundColor: tokens.radioFill,
64
- },
65
- }),
66
- ['radioInnerCircleSize', 'radioVisibility', 'radioFill'],
67
- ),
68
- labelContent: buildProps(
69
- (tokens, theme) => ({
70
- style: {
71
- alignItems: tokens.labelAlignItems,
72
- flexDirection: 'column',
73
- marginRight: tokens.labelMarginRight,
74
- marginLeft: tokens.labelMarginLeft,
75
- padding: tokens.labelPadding,
76
- paddingRight: 0,
77
- ...borderStyles.from(tokens, theme),
78
- },
79
- }),
80
- ['labelAlignItems', 'labelMarginRight', 'labelMarginLeft', 'labelPadding', ...borderStyles.keys],
81
- ),
82
- checkmark: buildProps(
83
- (tokens) => ({
84
- style: {
85
- opacity: tokens.radioVisibility,
86
- },
87
- }),
88
- ['radioVisibility'],
89
- ),
90
- label: buildProps(
91
- (tokens, theme) => ({
92
- variant: tokens.variant,
93
- style: {
94
- marginVertical: tokens.labelMarginVertical,
95
- marginHorizontal: 2,
96
- color: tokens.color,
97
- ...fontStyles.from(tokens, theme),
98
- },
99
- }),
100
- ['variant', 'labelMarginVertical', 'color', ...fontStyles.keys],
101
- ),
102
- subtext: buildProps(
103
- (tokens) => ({
104
- variant: tokens.subtextVariant,
105
- style: {
106
- marginTop: tokens.subtextMarginTop,
107
- marginBottom: tokens.subtextMarginBottom,
108
- marginHorizontal: 2,
109
- color: tokens.color,
110
- },
111
- }),
112
- ['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant'],
113
- ),
114
- },
7
+ tokens: [defaultRadioTokens, radioName],
8
+ states: radioStates,
9
+ slotProps: {
10
+ root: buildProps((tokens) => ({
11
+ style: {
12
+ display: 'flex',
13
+ alignItems: tokens.alignItems,
14
+ flexDirection: tokens.flexDirection,
15
+ paddingHorizontal: tokens.rootHorizontalPadding,
16
+ paddingVertical: tokens.rootVerticalPadding,
17
+ },
18
+ android_ripple: { color: tokens.rippleColor },
19
+ }), ['flexDirection', 'rootHorizontalPadding', 'rootVerticalPadding', 'rippleColor', 'alignItems']),
20
+ button: buildProps((tokens) => ({
21
+ style: {
22
+ backgroundColor: tokens.radioOuterCircleBackground,
23
+ width: tokens.radioOuterCircleSize,
24
+ height: tokens.radioOuterCircleSize,
25
+ alignItems: 'center',
26
+ justifyContent: 'center',
27
+ borderWidth: tokens.radioBorderWidth,
28
+ borderStyle: tokens.radioBorderStyle,
29
+ borderRadius: tokens.radioOuterCircleSize / 2,
30
+ borderColor: tokens.radioBorder,
31
+ marginTop: tokens.marginTop,
32
+ marginRight: tokens.marginRight,
33
+ marginBottom: tokens.marginBottom,
34
+ marginLeft: tokens.marginLeft,
35
+ },
36
+ android_ripple: { color: tokens.rippleColor, radius: tokens.rippleRadius, borderless: true },
37
+ }), [
38
+ 'radioOuterCircleBackground',
39
+ 'radioBorderWidth',
40
+ 'radioBorderStyle',
41
+ 'radioOuterCircleSize',
42
+ 'rippleColor',
43
+ 'rippleRadius',
44
+ 'radioBorder',
45
+ 'marginTop',
46
+ 'marginRight',
47
+ 'marginBottom',
48
+ 'marginLeft',
49
+ ]),
50
+ innerCircle: buildProps((tokens) => ({
51
+ style: {
52
+ opacity: tokens.radioVisibility,
53
+ borderRadius: tokens.radioInnerCircleSize / 2,
54
+ height: tokens.radioInnerCircleSize,
55
+ width: tokens.radioInnerCircleSize,
56
+ backgroundColor: tokens.radioFill,
57
+ },
58
+ }), ['radioInnerCircleSize', 'radioVisibility', 'radioFill']),
59
+ labelContent: buildProps((tokens, theme) => ({
60
+ style: {
61
+ alignItems: tokens.labelAlignItems,
62
+ flexDirection: 'column',
63
+ marginRight: tokens.labelMarginRight,
64
+ marginLeft: tokens.labelMarginLeft,
65
+ padding: tokens.labelPadding,
66
+ paddingRight: 0,
67
+ ...borderStyles.from(tokens, theme),
68
+ },
69
+ }), ['labelAlignItems', 'labelMarginRight', 'labelMarginLeft', 'labelPadding', ...borderStyles.keys]),
70
+ checkmark: buildProps((tokens) => ({
71
+ style: {
72
+ opacity: tokens.radioVisibility,
73
+ },
74
+ }), ['radioVisibility']),
75
+ label: buildProps((tokens, theme) => ({
76
+ variant: tokens.variant,
77
+ style: {
78
+ marginVertical: tokens.labelMarginVertical,
79
+ marginHorizontal: 2,
80
+ color: tokens.color,
81
+ ...fontStyles.from(tokens, theme),
82
+ },
83
+ }), ['variant', 'labelMarginVertical', 'color', ...fontStyles.keys]),
84
+ subtext: buildProps((tokens) => ({
85
+ variant: tokens.subtextVariant,
86
+ style: {
87
+ marginTop: tokens.subtextMarginTop,
88
+ marginBottom: tokens.subtextMarginBottom,
89
+ marginHorizontal: 2,
90
+ color: tokens.color,
91
+ },
92
+ }), ['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant']),
93
+ },
115
94
  };
116
- //# sourceMappingURL=Radio.styling.js.map
95
+ //# sourceMappingURL=Radio.styling.js.map