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

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 (231) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/SPEC.md +1 -1
  3. package/lib/Radio/Radio.d.ts +7 -2
  4. package/lib/Radio/Radio.d.ts.map +1 -1
  5. package/lib/Radio/Radio.ios.d.ts +7 -2
  6. package/lib/Radio/Radio.ios.d.ts.map +1 -1
  7. package/lib/Radio/Radio.ios.js +52 -36
  8. package/lib/Radio/Radio.ios.js.map +1 -1
  9. package/lib/Radio/Radio.js +48 -36
  10. package/lib/Radio/Radio.js.map +1 -1
  11. package/lib/Radio/Radio.styling.d.ts +1 -1
  12. package/lib/Radio/Radio.styling.js +109 -88
  13. package/lib/Radio/Radio.types.d.ts +176 -170
  14. package/lib/Radio/Radio.types.js +1 -1
  15. package/lib/Radio/RadioTokens.android.d.ts +1 -1
  16. package/lib/Radio/RadioTokens.android.js +42 -42
  17. package/lib/Radio/RadioTokens.android.js.map +1 -1
  18. package/lib/Radio/RadioTokens.d.ts +1 -1
  19. package/lib/Radio/RadioTokens.ios.d.ts +1 -1
  20. package/lib/Radio/RadioTokens.ios.js +39 -39
  21. package/lib/Radio/RadioTokens.ios.js.map +1 -1
  22. package/lib/Radio/RadioTokens.js +76 -76
  23. package/lib/Radio/RadioTokens.js.map +1 -1
  24. package/lib/Radio/RadioTokens.win32.d.ts +1 -1
  25. package/lib/Radio/RadioTokens.win32.js +89 -89
  26. package/lib/Radio/RadioTokens.win32.js.map +1 -1
  27. package/lib/Radio/__tests__/RadioExperimental.test.d.ts +1 -1
  28. package/lib/Radio/__tests__/RadioExperimental.test.js +15 -8
  29. package/lib/Radio/__tests__/RadioExperimental.test.js.map +1 -1
  30. package/lib/Radio/useRadio.d.ts +1 -1
  31. package/lib/Radio/useRadio.d.ts.map +1 -1
  32. package/lib/Radio/useRadio.js +91 -70
  33. package/lib/Radio/useRadio.js.map +1 -1
  34. package/lib/Radio/useRadio.win32.d.ts +1 -1
  35. package/lib/Radio/useRadio.win32.d.ts.map +1 -1
  36. package/lib/Radio/useRadio.win32.js +143 -121
  37. package/lib/Radio/useRadio.win32.js.map +1 -1
  38. package/lib/RadioGroup/RadioGroup.d.ts +7 -2
  39. package/lib/RadioGroup/RadioGroup.d.ts.map +1 -1
  40. package/lib/RadioGroup/RadioGroup.js +49 -38
  41. package/lib/RadioGroup/RadioGroup.js.map +1 -1
  42. package/lib/RadioGroup/RadioGroup.styling.d.ts +1 -1
  43. package/lib/RadioGroup/RadioGroup.styling.js +51 -42
  44. package/lib/RadioGroup/RadioGroup.types.d.ts +117 -117
  45. package/lib/RadioGroup/RadioGroup.types.js +1 -1
  46. package/lib/RadioGroup/RadioGroupTokens.android.d.ts +1 -1
  47. package/lib/RadioGroup/RadioGroupTokens.android.js +1 -1
  48. package/lib/RadioGroup/RadioGroupTokens.d.ts +1 -1
  49. package/lib/RadioGroup/RadioGroupTokens.ios.d.ts +1 -1
  50. package/lib/RadioGroup/RadioGroupTokens.ios.js +1 -1
  51. package/lib/RadioGroup/RadioGroupTokens.js +12 -12
  52. package/lib/RadioGroup/RadioGroupTokens.js.map +1 -1
  53. package/lib/RadioGroup/RadioGroupTokens.mobile.d.ts +1 -1
  54. package/lib/RadioGroup/RadioGroupTokens.mobile.js +13 -13
  55. package/lib/RadioGroup/RadioGroupTokens.mobile.js.map +1 -1
  56. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +1 -1
  57. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js +99 -50
  58. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js.map +1 -1
  59. package/lib/RadioGroup/radioGroupContext.d.ts +1 -1
  60. package/lib/RadioGroup/radioGroupContext.js +19 -15
  61. package/lib/RadioGroup/radioGroupContext.js.map +1 -1
  62. package/lib/RadioGroup/useRadioGroup.d.ts +1 -1
  63. package/lib/RadioGroup/useRadioGroup.d.ts.map +1 -1
  64. package/lib/RadioGroup/useRadioGroup.js +93 -63
  65. package/lib/RadioGroup/useRadioGroup.js.map +1 -1
  66. package/lib/RadioGroup/useRadioGroupContextValue.d.ts +2 -3
  67. package/lib/RadioGroup/useRadioGroupContextValue.d.ts.map +1 -1
  68. package/lib/RadioGroup/useRadioGroupContextValue.js +2 -2
  69. package/lib/RadioGroup/useRadioGroupContextValue.js.map +1 -1
  70. package/lib/index.d.ts +25 -4
  71. package/lib/index.js +1 -1
  72. package/lib/legacy/MacOSRadioButtonNativeComponent.d.ts +6 -6
  73. package/lib/legacy/MacOSRadioButtonNativeComponent.js +1 -1
  74. package/lib/legacy/RadioButton.d.ts +8 -2
  75. package/lib/legacy/RadioButton.d.ts.map +1 -1
  76. package/lib/legacy/RadioButton.js +97 -85
  77. package/lib/legacy/RadioButton.js.map +1 -1
  78. package/lib/legacy/RadioButton.macos.d.ts +8 -2
  79. package/lib/legacy/RadioButton.macos.d.ts.map +1 -1
  80. package/lib/legacy/RadioButton.macos.js +49 -50
  81. package/lib/legacy/RadioButton.macos.js.map +1 -1
  82. package/lib/legacy/RadioButton.settings.d.ts +2 -2
  83. package/lib/legacy/RadioButton.settings.js +81 -81
  84. package/lib/legacy/RadioButton.types.d.ts +46 -46
  85. package/lib/legacy/RadioButton.types.d.ts.map +1 -1
  86. package/lib/legacy/RadioButton.types.js +1 -1
  87. package/lib/legacy/RadioButton.win32.d.ts +8 -2
  88. package/lib/legacy/RadioButton.win32.d.ts.map +1 -1
  89. package/lib/legacy/RadioButton.win32.js +152 -137
  90. package/lib/legacy/RadioButton.win32.js.map +1 -1
  91. package/lib/legacy/RadioGroup.d.ts +9 -4
  92. package/lib/legacy/RadioGroup.d.ts.map +1 -1
  93. package/lib/legacy/RadioGroup.js +109 -87
  94. package/lib/legacy/RadioGroup.js.map +1 -1
  95. package/lib/legacy/RadioGroup.settings.d.ts +1 -1
  96. package/lib/legacy/RadioGroup.settings.js +21 -21
  97. package/lib/legacy/RadioGroup.types.d.ts +78 -79
  98. package/lib/legacy/RadioGroup.types.js +1 -1
  99. package/lib/legacy/__tests__/RadioButton.test.d.ts +1 -1
  100. package/lib/legacy/__tests__/RadioButton.test.js +9 -5
  101. package/lib/legacy/__tests__/RadioButton.test.js.map +1 -1
  102. package/lib/legacy/__tests__/RadioButtonGroup.test.d.ts +1 -1
  103. package/lib/legacy/__tests__/RadioButtonGroup.test.js +35 -13
  104. package/lib/legacy/__tests__/RadioButtonGroup.test.js.map +1 -1
  105. package/lib-commonjs/Radio/Radio.d.ts +7 -2
  106. package/lib-commonjs/Radio/Radio.d.ts.map +1 -1
  107. package/lib-commonjs/Radio/Radio.ios.d.ts +7 -2
  108. package/lib-commonjs/Radio/Radio.ios.d.ts.map +1 -1
  109. package/lib-commonjs/Radio/Radio.ios.js +65 -44
  110. package/lib-commonjs/Radio/Radio.ios.js.map +1 -1
  111. package/lib-commonjs/Radio/Radio.js +60 -43
  112. package/lib-commonjs/Radio/Radio.js.map +1 -1
  113. package/lib-commonjs/Radio/Radio.styling.d.ts +1 -1
  114. package/lib-commonjs/Radio/Radio.styling.js +115 -94
  115. package/lib-commonjs/Radio/Radio.styling.js.map +1 -1
  116. package/lib-commonjs/Radio/Radio.types.d.ts +176 -170
  117. package/lib-commonjs/Radio/Radio.types.js +3 -3
  118. package/lib-commonjs/Radio/RadioTokens.android.d.ts +1 -1
  119. package/lib-commonjs/Radio/RadioTokens.android.js +45 -45
  120. package/lib-commonjs/Radio/RadioTokens.android.js.map +1 -1
  121. package/lib-commonjs/Radio/RadioTokens.d.ts +1 -1
  122. package/lib-commonjs/Radio/RadioTokens.ios.d.ts +1 -1
  123. package/lib-commonjs/Radio/RadioTokens.ios.js +42 -42
  124. package/lib-commonjs/Radio/RadioTokens.ios.js.map +1 -1
  125. package/lib-commonjs/Radio/RadioTokens.js +79 -79
  126. package/lib-commonjs/Radio/RadioTokens.js.map +1 -1
  127. package/lib-commonjs/Radio/RadioTokens.win32.d.ts +1 -1
  128. package/lib-commonjs/Radio/RadioTokens.win32.js +92 -92
  129. package/lib-commonjs/Radio/RadioTokens.win32.js.map +1 -1
  130. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.d.ts +1 -1
  131. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js +69 -35
  132. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js.map +1 -1
  133. package/lib-commonjs/Radio/useRadio.d.ts +1 -1
  134. package/lib-commonjs/Radio/useRadio.d.ts.map +1 -1
  135. package/lib-commonjs/Radio/useRadio.js +147 -99
  136. package/lib-commonjs/Radio/useRadio.js.map +1 -1
  137. package/lib-commonjs/Radio/useRadio.win32.d.ts +1 -1
  138. package/lib-commonjs/Radio/useRadio.win32.d.ts.map +1 -1
  139. package/lib-commonjs/Radio/useRadio.win32.js +200 -151
  140. package/lib-commonjs/Radio/useRadio.win32.js.map +1 -1
  141. package/lib-commonjs/RadioGroup/RadioGroup.d.ts +7 -2
  142. package/lib-commonjs/RadioGroup/RadioGroup.d.ts.map +1 -1
  143. package/lib-commonjs/RadioGroup/RadioGroup.js +65 -48
  144. package/lib-commonjs/RadioGroup/RadioGroup.js.map +1 -1
  145. package/lib-commonjs/RadioGroup/RadioGroup.styling.d.ts +1 -1
  146. package/lib-commonjs/RadioGroup/RadioGroup.styling.js +57 -48
  147. package/lib-commonjs/RadioGroup/RadioGroup.styling.js.map +1 -1
  148. package/lib-commonjs/RadioGroup/RadioGroup.types.d.ts +117 -117
  149. package/lib-commonjs/RadioGroup/RadioGroup.types.js +3 -3
  150. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.d.ts +1 -1
  151. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js +10 -5
  152. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js.map +1 -1
  153. package/lib-commonjs/RadioGroup/RadioGroupTokens.d.ts +1 -1
  154. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.d.ts +1 -1
  155. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js +10 -5
  156. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js.map +1 -1
  157. package/lib-commonjs/RadioGroup/RadioGroupTokens.js +15 -15
  158. package/lib-commonjs/RadioGroup/RadioGroupTokens.js.map +1 -1
  159. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.d.ts +1 -1
  160. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js +16 -16
  161. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js.map +1 -1
  162. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +1 -1
  163. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js +157 -78
  164. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js.map +1 -1
  165. package/lib-commonjs/RadioGroup/radioGroupContext.d.ts +1 -1
  166. package/lib-commonjs/RadioGroup/radioGroupContext.js +72 -41
  167. package/lib-commonjs/RadioGroup/radioGroupContext.js.map +1 -1
  168. package/lib-commonjs/RadioGroup/useRadioGroup.d.ts +1 -1
  169. package/lib-commonjs/RadioGroup/useRadioGroup.d.ts.map +1 -1
  170. package/lib-commonjs/RadioGroup/useRadioGroup.js +148 -91
  171. package/lib-commonjs/RadioGroup/useRadioGroup.js.map +1 -1
  172. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts +2 -3
  173. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts.map +1 -1
  174. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js +4 -4
  175. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js.map +1 -1
  176. package/lib-commonjs/index.d.ts +25 -4
  177. package/lib-commonjs/index.js +128 -32
  178. package/lib-commonjs/index.js.map +1 -1
  179. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.d.ts +6 -6
  180. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.js +9 -7
  181. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.js.map +1 -1
  182. package/lib-commonjs/legacy/RadioButton.d.ts +8 -2
  183. package/lib-commonjs/legacy/RadioButton.d.ts.map +1 -1
  184. package/lib-commonjs/legacy/RadioButton.js +167 -120
  185. package/lib-commonjs/legacy/RadioButton.js.map +1 -1
  186. package/lib-commonjs/legacy/RadioButton.macos.d.ts +8 -2
  187. package/lib-commonjs/legacy/RadioButton.macos.d.ts.map +1 -1
  188. package/lib-commonjs/legacy/RadioButton.macos.js +112 -84
  189. package/lib-commonjs/legacy/RadioButton.macos.js.map +1 -1
  190. package/lib-commonjs/legacy/RadioButton.settings.d.ts +2 -2
  191. package/lib-commonjs/legacy/RadioButton.settings.js +84 -84
  192. package/lib-commonjs/legacy/RadioButton.types.d.ts +46 -46
  193. package/lib-commonjs/legacy/RadioButton.types.d.ts.map +1 -1
  194. package/lib-commonjs/legacy/RadioButton.types.js +3 -3
  195. package/lib-commonjs/legacy/RadioButton.win32.d.ts +8 -2
  196. package/lib-commonjs/legacy/RadioButton.win32.d.ts.map +1 -1
  197. package/lib-commonjs/legacy/RadioButton.win32.js +222 -172
  198. package/lib-commonjs/legacy/RadioButton.win32.js.map +1 -1
  199. package/lib-commonjs/legacy/RadioGroup.d.ts +9 -4
  200. package/lib-commonjs/legacy/RadioGroup.d.ts.map +1 -1
  201. package/lib-commonjs/legacy/RadioGroup.js +173 -122
  202. package/lib-commonjs/legacy/RadioGroup.js.map +1 -1
  203. package/lib-commonjs/legacy/RadioGroup.settings.d.ts +1 -1
  204. package/lib-commonjs/legacy/RadioGroup.settings.js +24 -24
  205. package/lib-commonjs/legacy/RadioGroup.types.d.ts +78 -79
  206. package/lib-commonjs/legacy/RadioGroup.types.js +3 -3
  207. package/lib-commonjs/legacy/__tests__/RadioButton.test.d.ts +1 -1
  208. package/lib-commonjs/legacy/__tests__/RadioButton.test.js +63 -32
  209. package/lib-commonjs/legacy/__tests__/RadioButton.test.js.map +1 -1
  210. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.d.ts +1 -1
  211. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js +100 -41
  212. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js.map +1 -1
  213. package/package.json +72 -71
  214. package/src/Radio/Radio.ios.tsx +2 -3
  215. package/src/Radio/Radio.tsx +2 -3
  216. package/src/Radio/__tests__/RadioExperimental.test.tsx +11 -5
  217. package/src/Radio/__tests__/__snapshots__/RadioExperimental.test.tsx.snap +2 -2
  218. package/src/Radio/useRadio.ts +2 -2
  219. package/src/Radio/useRadio.win32.ts +2 -2
  220. package/src/RadioGroup/RadioGroup.tsx +2 -3
  221. package/src/RadioGroup/__tests__/RadioGroupExperimental.test.tsx +53 -47
  222. package/src/RadioGroup/__tests__/__snapshots__/RadioGroupExperimental.test.tsx.snap +12 -12
  223. package/src/legacy/RadioButton.macos.tsx +1 -3
  224. package/src/legacy/RadioButton.tsx +3 -5
  225. package/src/legacy/RadioButton.types.ts +3 -3
  226. package/src/legacy/RadioButton.win32.tsx +3 -5
  227. package/src/legacy/RadioGroup.tsx +1 -3
  228. package/src/legacy/__tests__/RadioButton.test.tsx +6 -3
  229. package/src/legacy/__tests__/RadioButtonGroup.test.tsx +23 -19
  230. package/src/legacy/__tests__/__snapshots__/RadioButton.test.tsx.snap +1 -1
  231. package/src/legacy/__tests__/__snapshots__/RadioButtonGroup.test.tsx.snap +4 -4
@@ -1,25 +1,25 @@
1
1
  import { radioGroupName } from './RadioGroup.types';
2
2
  export const settings = [
3
- {
4
- tokens: {
5
- color: 'menuItemText',
6
- },
7
- root: {
8
- accessible: true,
9
- accessibilityRole: 'radio',
10
- style: {
11
- display: 'flex',
12
- alignItems: 'flex-start',
13
- flexDirection: 'column',
14
- },
15
- },
16
- label: {
17
- style: {
18
- fontSize: 16,
19
- fontWeight: '600',
20
- },
21
- },
3
+ {
4
+ tokens: {
5
+ color: 'menuItemText',
22
6
  },
23
- radioGroupName,
7
+ root: {
8
+ accessible: true,
9
+ accessibilityRole: 'radio',
10
+ style: {
11
+ display: 'flex',
12
+ alignItems: 'flex-start',
13
+ flexDirection: 'column',
14
+ },
15
+ },
16
+ label: {
17
+ style: {
18
+ fontSize: 16,
19
+ fontWeight: '600',
20
+ },
21
+ },
22
+ },
23
+ radioGroupName,
24
24
  ];
25
- //# sourceMappingURL=RadioGroup.settings.js.map
25
+ //# sourceMappingURL=RadioGroup.settings.js.map
@@ -4,93 +4,92 @@ import type { FocusZoneProps } from '@fluentui-react-native/focus-zone';
4
4
  import type { ITextProps } from '@fluentui-react-native/text';
5
5
  import type { IForegroundColorTokens, FontTokens } from '@fluentui-react-native/tokens';
6
6
  import type { IRenderData } from '@uifabricshared/foundation-composable';
7
- export declare const radioGroupName = "RadioGroup";
7
+ export declare const radioGroupName = 'RadioGroup';
8
8
  export interface IRadioGroupContext {
9
- /**
10
- * The currently selected RadioButton's key
11
- */
12
- selectedKey: string | null;
13
- /**
14
- * Updates the selected button and calls the client’s onChange callback
15
- */
16
- onChange?: (key: string) => void;
17
- /**
18
- * Updates the selected button's ref to set as the default tabbable element
19
- */
20
- updateSelectedButtonRef?: (ref: React.RefObject<any>) => void;
21
- /**
22
- * Array of radio button keys in the group
23
- */
24
- buttonKeys?: string[];
25
- /**
26
- * Populate the buttonKeys array (all RadioButton keys) at mount and un-mount
27
- */
28
- addRadioButtonKey?: (value: string) => void;
29
- removeRadioButtonKey?: (value: string) => void;
30
- /**
31
- * Array of enabled Radio keys in the RadioGroup
32
- * @platform win32
33
- */
34
- enabledButtonKeys?: string[];
35
- /**
36
- * Populate the enabledButtonKeys array (only enabled/valid RadioButton keys) at mount and un-mount
37
- * @platform win32
38
- */
39
- addRadioButtonEnabledKey?: (value: string) => void;
40
- removeRadioButtonEnabledKey?: (value: string) => void;
41
- /**
42
- * Updates invoked to signal that arrow key has been pressed and focus needs to be set
43
- * @platform win32
44
- */
45
- updateInvoked?: (check: boolean) => void;
46
- /**
47
- * Signals whether arrow key has been pressed
48
- * @platform win32
49
- */
50
- invoked?: boolean;
9
+ /**
10
+ * The currently selected RadioButton's key
11
+ */
12
+ selectedKey: string | null;
13
+ /**
14
+ * Updates the selected button and calls the client’s onChange callback
15
+ */
16
+ onChange?: (key: string) => void;
17
+ /**
18
+ * Updates the selected button's ref to set as the default tabbable element
19
+ */
20
+ updateSelectedButtonRef?: (ref: React.RefObject<any>) => void;
21
+ /**
22
+ * Array of radio button keys in the group
23
+ */
24
+ buttonKeys?: string[];
25
+ /**
26
+ * Populate the buttonKeys array (all RadioButton keys) at mount and un-mount
27
+ */
28
+ addRadioButtonKey?: (value: string) => void;
29
+ removeRadioButtonKey?: (value: string) => void;
30
+ /**
31
+ * Array of enabled Radio keys in the RadioGroup
32
+ * @platform win32
33
+ */
34
+ enabledButtonKeys?: string[];
35
+ /**
36
+ * Populate the enabledButtonKeys array (only enabled/valid RadioButton keys) at mount and un-mount
37
+ * @platform win32
38
+ */
39
+ addRadioButtonEnabledKey?: (value: string) => void;
40
+ removeRadioButtonEnabledKey?: (value: string) => void;
41
+ /**
42
+ * Updates invoked to signal that arrow key has been pressed and focus needs to be set
43
+ * @platform win32
44
+ */
45
+ updateInvoked?: (check: boolean) => void;
46
+ /**
47
+ * Signals whether arrow key has been pressed
48
+ * @platform win32
49
+ */
50
+ invoked?: boolean;
51
51
  }
52
52
  export interface IRadioGroupState {
53
- context: IRadioGroupContext;
53
+ context: IRadioGroupContext;
54
54
  }
55
55
  export type IRadioGroupProps = React.PropsWithChildren<{
56
- /**
57
- * Descriptive label for the RadioGroup. This will be displayed as the title of the radio group to the user.
58
- */
59
- label: string;
60
- /**
61
- * The key of the RadioButton that will initially be selected
62
- */
63
- defaultSelectedKey?: string;
64
- /**
65
- * A label for screen readers. If not provided, it will be set to the label of the radio group.
66
- * @deprecated Use accessibilityLabel instead.
67
- */
68
- ariaLabel?: string;
69
- accessibilityLabel?: string;
70
- /**
71
- * The key of the selected option. If you provide this, you must maintain selection state by observing
72
- * onChange events and passing a new value in when changed. This overrides defaultSelectedKey
73
- * and makes the RadioGroup a controlled component.
74
- */
75
- selectedKey?: string;
76
- /**
77
- * Callback for receiving a notification when the choice has been changed
78
- */
79
- onChange?: (key: string) => void;
80
- testID?: string;
56
+ /**
57
+ * Descriptive label for the RadioGroup. This will be displayed as the title of the radio group to the user.
58
+ */
59
+ label: string;
60
+ /**
61
+ * The key of the RadioButton that will initially be selected
62
+ */
63
+ defaultSelectedKey?: string;
64
+ /**
65
+ * A label for screen readers. If not provided, it will be set to the label of the radio group.
66
+ * @deprecated Use accessibilityLabel instead.
67
+ */
68
+ ariaLabel?: string;
69
+ accessibilityLabel?: string;
70
+ /**
71
+ * The key of the selected option. If you provide this, you must maintain selection state by observing
72
+ * onChange events and passing a new value in when changed. This overrides defaultSelectedKey
73
+ * and makes the RadioGroup a controlled component.
74
+ */
75
+ selectedKey?: string;
76
+ /**
77
+ * Callback for receiving a notification when the choice has been changed
78
+ */
79
+ onChange?: (key: string) => void;
80
+ testID?: string;
81
81
  }>;
82
- export interface IRadioGroupTokens extends IForegroundColorTokens, FontTokens {
83
- }
82
+ export interface IRadioGroupTokens extends IForegroundColorTokens, FontTokens {}
84
83
  export interface IRadioGroupSlotProps {
85
- root: React.PropsWithRef<ViewProps>;
86
- label: ITextProps;
87
- container: FocusZoneProps;
84
+ root: React.PropsWithRef<ViewProps>;
85
+ label: ITextProps;
86
+ container: FocusZoneProps;
88
87
  }
89
88
  export type IRadioGroupRenderData = IRenderData<IRadioGroupSlotProps, IRadioGroupState>;
90
89
  export interface IRadioGroupType {
91
- props: IRadioGroupProps;
92
- tokens: IRadioGroupTokens;
93
- slotProps: IRadioGroupSlotProps;
94
- state: IRadioGroupState;
90
+ props: IRadioGroupProps;
91
+ tokens: IRadioGroupTokens;
92
+ slotProps: IRadioGroupSlotProps;
93
+ state: IRadioGroupState;
95
94
  }
96
- //# sourceMappingURL=RadioGroup.types.d.ts.map
95
+ //# sourceMappingURL=RadioGroup.types.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export const radioGroupName = 'RadioGroup';
2
- //# sourceMappingURL=RadioGroup.types.js.map
2
+ //# sourceMappingURL=RadioGroup.types.js.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=RadioButton.test.d.ts.map
2
+ //# sourceMappingURL=RadioButton.test.d.ts.map
@@ -1,10 +1,14 @@
1
- import * as React from 'react';
1
+ import { jsx as _jsx } from 'react/jsx-runtime';
2
+ import { act } from 'react';
2
3
  import * as renderer from 'react-test-renderer';
3
4
  import { RadioButton } from '../RadioButton';
4
5
  describe('RadioButton component tests', () => {
5
- it('RadioButton default', () => {
6
- const tree = renderer.create(React.createElement(RadioButton, { buttonKey: "key1", content: "Default Button" })).toJSON();
7
- expect(tree).toMatchSnapshot();
6
+ it('RadioButton default', () => {
7
+ let component;
8
+ act(() => {
9
+ component = renderer.create(_jsx(RadioButton, { buttonKey: 'key1', content: 'Default Button' }));
8
10
  });
11
+ expect(component.toJSON()).toMatchSnapshot();
12
+ });
9
13
  });
10
- //# sourceMappingURL=RadioButton.test.js.map
14
+ //# sourceMappingURL=RadioButton.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButton.test.js","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButton.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;IAC3C,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE;QAC7B,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,CAAC,oBAAC,WAAW,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QACjG,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"RadioButton.test.js","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButton.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC;IAC5C,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC;QAC9B,IAAI,SAAqC,CAAC;QAC1C,GAAG,CAAC,GAAG,EAAE,CAAC;YACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAC,WAAW,IAAC,SAAS,EAAC,MAAM,EAAC,OAAO,EAAC,gBAAgB,GAAG,CAAC,CAAC;QAAA,CACxF,CAAC,CAAC;QACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;IAAA,CAC/C,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=RadioButtonGroup.test.d.ts.map
2
+ //# sourceMappingURL=RadioButtonGroup.test.d.ts.map
@@ -1,20 +1,42 @@
1
- import * as React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from 'react/jsx-runtime';
2
+ import { act } from 'react';
2
3
  import { View } from 'react-native';
3
4
  import * as renderer from 'react-test-renderer';
4
5
  import { RadioGroup, RadioButton } from '../..';
5
6
  describe('RadioButton component tests', () => {
6
- it('RadioButton default', () => {
7
- const tree = renderer.create(React.createElement(RadioGroup, { label: "Uncontrolled RadioGroup", defaultSelectedKey: "key2" },
8
- React.createElement(RadioButton, { buttonKey: "key1", content: "RadioButton1" }),
9
- React.createElement(RadioButton, { buttonKey: "key2", content: "RadioButton2" })));
10
- expect(tree).toMatchSnapshot();
7
+ it('RadioButton default', () => {
8
+ let component;
9
+ act(() => {
10
+ component = renderer.create(
11
+ _jsxs(RadioGroup, {
12
+ label: 'Uncontrolled RadioGroup',
13
+ defaultSelectedKey: 'key2',
14
+ children: [
15
+ _jsx(RadioButton, { buttonKey: 'key1', content: 'RadioButton1' }),
16
+ _jsx(RadioButton, { buttonKey: 'key2', content: 'RadioButton2' }),
17
+ ],
18
+ }),
19
+ );
11
20
  });
12
- it('RadioButton not direct child of radio group', () => {
13
- const tree = renderer.create(React.createElement(RadioGroup, { label: "Uncontrolled RadioGroup", defaultSelectedKey: "key2" },
14
- React.createElement(View, null,
15
- React.createElement(RadioButton, { buttonKey: "key1", content: "RadioButton1", accessibilityPositionInSet: 1, accessibilitySetSize: 2 }),
16
- React.createElement(RadioButton, { buttonKey: "key2", content: "RadioButton2", accessibilityPositionInSet: 2, accessibilitySetSize: 2 }))));
17
- expect(tree).toMatchSnapshot();
21
+ expect(component.toJSON()).toMatchSnapshot();
22
+ });
23
+ it('RadioButton not direct child of radio group', () => {
24
+ let component;
25
+ act(() => {
26
+ component = renderer.create(
27
+ _jsx(RadioGroup, {
28
+ label: 'Uncontrolled RadioGroup',
29
+ defaultSelectedKey: 'key2',
30
+ children: _jsxs(View, {
31
+ children: [
32
+ _jsx(RadioButton, { buttonKey: 'key1', content: 'RadioButton1', accessibilityPosInSet: 1, accessibilitySetSize: 2 }),
33
+ _jsx(RadioButton, { buttonKey: 'key2', content: 'RadioButton2', accessibilityPosInSet: 2, accessibilitySetSize: 2 }),
34
+ ],
35
+ }),
36
+ }),
37
+ );
18
38
  });
39
+ expect(component.toJSON()).toMatchSnapshot();
40
+ });
19
41
  });
20
- //# sourceMappingURL=RadioButtonGroup.test.js.map
42
+ //# sourceMappingURL=RadioButtonGroup.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RadioButtonGroup.test.js","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButtonGroup.test.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAA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,EAAC,cAAc,EAAC,qBAAqB,EAAE,CAAC,EAAE,oBAAoB,EAAE,CAAC,GAAI;wBACrG,GACI,CACd,CAAC;QAAA,CACH,CAAC,CAAC;QACH,MAAM,CAAC,SAAU,CAAC,MAAM,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC;IAAA,CAC/C,CAAC,CAAC;AAAA,CACJ,CAAC,CAAC"}
@@ -9,5 +9,10 @@ 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<RadioProps, import("./Radio.types").RadioSlotProps, import("./Radio.types").RadioTokens, import("@fluentui-react-native/framework").ObjectBase>;
13
- //# sourceMappingURL=Radio.d.ts.map
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').ObjectBase
17
+ >;
18
+ //# sourceMappingURL=Radio.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../src/Radio/Radio.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAI/E,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3D;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,UAAW,MAAM,SAAS,cAAc,aAAa,UAAU,KAAG,OAQzF,CAAC;AAEF,eAAO,MAAM,KAAK,gNA6ChB,CAAC"}
1
+ {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../src/Radio/Radio.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAI/E,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3D;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,0EAQvB,CAAC;AAEF,eAAO,MAAM,KAAK,gNA6ChB,CAAC"}
@@ -9,5 +9,10 @@ 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<RadioProps, import("./Radio.types").RadioSlotProps, import("./Radio.types").RadioTokens, import("@fluentui-react-native/framework").ObjectBase>;
13
- //# sourceMappingURL=Radio.ios.d.ts.map
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').ObjectBase
17
+ >;
18
+ //# sourceMappingURL=Radio.ios.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.ios.d.ts","sourceRoot":"","sources":["../../src/Radio/Radio.ios.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAK/E,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3D;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,UAAW,MAAM,SAAS,cAAc,aAAa,UAAU,KAAG,OAQzF,CAAC;AAEF,eAAO,MAAM,KAAK,gNAqDhB,CAAC"}
1
+ {"version":3,"file":"Radio.ios.d.ts","sourceRoot":"","sources":["../../src/Radio/Radio.ios.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAK/E,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3D;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,0EAQvB,CAAC;AAEF,eAAO,MAAM,KAAK,gNAqDhB,CAAC"}
@@ -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
- /** @jsxRuntime classic */
5
- /** @jsx withSlots */
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");
4
+ const jsx_runtime_1 = require('@fluentui-react-native/framework-base/jsx-runtime');
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');
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,40 +19,61 @@ 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 (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'));
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
+ );
27
29
  };
28
30
  exports.radioLookup = radioLookup;
29
31
  exports.Radio = (0, framework_1.compose)({
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 = ((0, framework_1.withSlots)(Slots.labelContent, null,
48
- (0, framework_1.withSlots)(Slots.label, null, label),
49
- !!subtext && (0, framework_1.withSlots)(Slots.subtext, null, subtext)));
50
- const checkmarkPath = ((0, framework_1.withSlots)(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" }));
51
- return ((0, framework_1.withSlots)(Slots.root, { ...mergedProps, ...{ accessible: !disabled, focusable: !disabled } },
52
- (0, framework_1.withSlots)(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false },
53
- (0, framework_1.withSlots)(Slots.checkmark, { key: "checkmark", viewBox: "0 0 12 12" }, checkmarkPath)),
54
- labelComponent));
55
- };
56
- },
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
+ },
57
78
  });
58
- //# sourceMappingURL=Radio.ios.js.map
79
+ //# sourceMappingURL=Radio.ios.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Radio.ios.js","sourceRoot":"","sources":["../../src/Radio/Radio.ios.tsx"],"names":[],"mappings":";;;AAAA,0BAA0B;AAC1B,qBAAqB;AACrB,+CAAyD;AAGzD,gEAAkF;AAElF,sDAA6D;AAC7D,uDAA6C;AAE7C,mDAAkD;AAElD,+CAA0C;AAC1C,yCAAsC;AAEtC;;;;;;;GAOG;AACI,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,KAAqB,EAAE,SAAqB,EAAW,EAAE;IAClG,OAAO,CACL,KAAK,CAAC,KAAK,CAAC;QACZ,SAAS,CAAC,KAAK,CAAC;QAChB,CAAC,CAAC,CAAC,uBAAQ,CAAC,EAAE,KAAM,OAAe,IAAI,uBAAQ,CAAC,EAAE,KAAK,SAAS,CAAC;YAC/D,KAAK,KAAK,oBAAoB;YAC9B,SAAS,CAAC,eAAe,CAAC,KAAK,OAAO,CAAC,CAC1C,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB;AAEW,QAAA,KAAK,GAAG,IAAA,mBAAO,EAAY;IACtC,WAAW,EAAE,uBAAS;IACtB,GAAG,+BAAe;IAClB,KAAK,EAAE;QACL,IAAI,EAAE,wBAAS;QACf,MAAM,EAAE,wBAAS;QACjB,SAAS,EAAE,sBAAG;QACd,YAAY,EAAE,mBAAI;QAClB,KAAK,EAAE,aAAI;QACX,OAAO,EAAE,aAAI;KACd;IACD,SAAS,EAAE,CAAC,SAAqB,EAAE,QAA6B,EAAE,EAAE;QAClE,MAAM,KAAK,GAAG,IAAA,mBAAQ,EAAC,SAAS,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,IAAA,mBAAW,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CA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,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC;YAEjE,MAAM,cAAc,GAAG,CACrB,mBAAC,KAAK,CAAC,YAAY;oBACjB,kBAAC,KAAK,CAAC,KAAK,cAAE,KAAK,GAAe,EACjC,CAAC,CAAC,OAAO,IAAI,kBAAC,KAAK,CAAC,OAAO,cAAE,OAAO,GAAiB,IACnC,CACtB,CAAC;YAEF,MAAM,aAAa,GAAG,CACpB,kBAAC,uBAAI,IACH,IAAI,EAAC,cAAc,EACnB,CAAC,EAAC,iXAAiX,GACnX,CACH,CAAC;YAEF,OAAO,CACL,mBAAC,KAAK,CAAC,IAAI,OAAK,WAAW,EAAQ,UAAU,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,QAAQ;oBAC5E,kBAAC,KAAK,CAAC,MAAM,IACX,UAAU,EAAE,KAAK,EACjB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,KAAK,YAEhB,kBAAC,KAAK,CAAC,SAAS,IAAiB,OAAO,EAAC,WAAW,YACjD,aAAa,IADK,WAAW,CAEd,GACL,EACd,cAAc,IACJ,CACd,CAAC;QAAA,CACH,CAAC;IAAA,CACH;CACF,CAAC,CAAC"}
@@ -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
- /** @jsxRuntime classic */
5
- /** @jsx withSlots */
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");
4
+ const jsx_runtime_1 = require('@fluentui-react-native/framework-base/jsx-runtime');
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');
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,40 +18,57 @@ 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 (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'));
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
+ );
26
28
  };
27
29
  exports.radioLookup = radioLookup;
28
30
  exports.Radio = (0, framework_1.compose)({
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 = ((0, framework_1.withSlots)(Slots.labelContent, null,
48
- (0, framework_1.withSlots)(Slots.label, null, label),
49
- !!subtext && (0, framework_1.withSlots)(Slots.subtext, null, subtext)));
50
- return ((0, framework_1.withSlots)(Slots.root, { ...mergedProps, ...(isMobile && { accessible: !disabled, focusable: !disabled }) },
51
- (0, framework_1.withSlots)(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false },
52
- (0, framework_1.withSlots)(Slots.innerCircle, null)),
53
- labelComponent));
54
- };
55
- },
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
+ },
56
73
  });
57
- //# sourceMappingURL=Radio.js.map
74
+ //# sourceMappingURL=Radio.js.map