@fluentui-react-native/radio-group 0.22.1 → 0.22.4

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 (191) hide show
  1. package/.cache/tsconfig.tsbuildinfo +1 -0
  2. package/CHANGELOG.md +67 -0
  3. package/jest.config.cjs +1 -0
  4. package/lib/Radio/Radio.d.ts.map +1 -1
  5. package/lib/Radio/Radio.ios.d.ts.map +1 -1
  6. package/lib/Radio/Radio.ios.js +2 -4
  7. package/lib/Radio/Radio.ios.js.map +1 -1
  8. package/lib/Radio/Radio.js +2 -4
  9. package/lib/Radio/Radio.js.map +1 -1
  10. package/lib/Radio/__tests__/RadioExperimental.test.js.map +1 -1
  11. package/lib/Radio/useRadio.d.ts.map +1 -1
  12. package/lib/Radio/useRadio.js +13 -11
  13. package/lib/Radio/useRadio.js.map +1 -1
  14. package/lib/Radio/useRadio.win32.d.ts.map +1 -1
  15. package/lib/Radio/useRadio.win32.js +37 -33
  16. package/lib/Radio/useRadio.win32.js.map +1 -1
  17. package/lib/RadioGroup/RadioGroup.d.ts.map +1 -1
  18. package/lib/RadioGroup/RadioGroup.js +1 -2
  19. package/lib/RadioGroup/RadioGroup.js.map +1 -1
  20. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js +6 -18
  21. package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js.map +1 -1
  22. package/lib/RadioGroup/radioGroupContext.js +6 -6
  23. package/lib/RadioGroup/radioGroupContext.js.map +1 -1
  24. package/lib/RadioGroup/useRadioGroup.d.ts.map +1 -1
  25. package/lib/RadioGroup/useRadioGroup.js.map +1 -1
  26. package/lib/RadioGroup/useRadioGroupContextValue.d.ts +2 -1
  27. package/lib/RadioGroup/useRadioGroupContextValue.d.ts.map +1 -1
  28. package/lib/RadioGroup/useRadioGroupContextValue.js.map +1 -1
  29. package/lib/legacy/MacOSRadioButtonNativeComponent.d.ts.map +1 -1
  30. package/lib/legacy/RadioButton.d.ts.map +1 -1
  31. package/lib/legacy/RadioButton.js +14 -13
  32. package/lib/legacy/RadioButton.js.map +1 -1
  33. package/lib/legacy/RadioButton.macos.d.ts.map +1 -1
  34. package/lib/legacy/RadioButton.macos.js +10 -8
  35. package/lib/legacy/RadioButton.macos.js.map +1 -1
  36. package/lib/legacy/RadioButton.win32.d.ts.map +1 -1
  37. package/lib/legacy/RadioButton.win32.js +41 -39
  38. package/lib/legacy/RadioButton.win32.js.map +1 -1
  39. package/lib/legacy/RadioGroup.d.ts.map +1 -1
  40. package/lib/legacy/RadioGroup.js +7 -13
  41. package/lib/legacy/RadioGroup.js.map +1 -1
  42. package/lib/legacy/__tests__/RadioButton.test.js.map +1 -1
  43. package/lib/legacy/__tests__/RadioButtonGroup.test.js +2 -6
  44. package/lib/legacy/__tests__/RadioButtonGroup.test.js.map +1 -1
  45. package/package.json +33 -38
  46. package/src/Radio/useRadio.ts +13 -11
  47. package/src/Radio/useRadio.win32.ts +52 -32
  48. package/src/legacy/RadioButton.macos.tsx +10 -8
  49. package/src/legacy/RadioButton.tsx +13 -11
  50. package/src/legacy/RadioButton.win32.tsx +53 -36
  51. package/src/legacy/RadioGroup.tsx +4 -8
  52. package/tsconfig.json +53 -3
  53. package/babel.config.js +0 -1
  54. package/eslint.config.js +0 -3
  55. package/jest.config.js +0 -2
  56. package/lib-commonjs/Radio/Radio.d.ts +0 -13
  57. package/lib-commonjs/Radio/Radio.d.ts.map +0 -1
  58. package/lib-commonjs/Radio/Radio.ios.d.ts +0 -13
  59. package/lib-commonjs/Radio/Radio.ios.d.ts.map +0 -1
  60. package/lib-commonjs/Radio/Radio.ios.js +0 -55
  61. package/lib-commonjs/Radio/Radio.ios.js.map +0 -1
  62. package/lib-commonjs/Radio/Radio.js +0 -54
  63. package/lib-commonjs/Radio/Radio.js.map +0 -1
  64. package/lib-commonjs/Radio/Radio.styling.d.ts +0 -5
  65. package/lib-commonjs/Radio/Radio.styling.d.ts.map +0 -1
  66. package/lib-commonjs/Radio/Radio.styling.js +0 -98
  67. package/lib-commonjs/Radio/Radio.styling.js.map +0 -1
  68. package/lib-commonjs/Radio/Radio.types.d.ts +0 -186
  69. package/lib-commonjs/Radio/Radio.types.d.ts.map +0 -1
  70. package/lib-commonjs/Radio/Radio.types.js +0 -5
  71. package/lib-commonjs/Radio/Radio.types.js.map +0 -1
  72. package/lib-commonjs/Radio/RadioTokens.android.d.ts +0 -5
  73. package/lib-commonjs/Radio/RadioTokens.android.d.ts.map +0 -1
  74. package/lib-commonjs/Radio/RadioTokens.android.js +0 -53
  75. package/lib-commonjs/Radio/RadioTokens.android.js.map +0 -1
  76. package/lib-commonjs/Radio/RadioTokens.d.ts +0 -5
  77. package/lib-commonjs/Radio/RadioTokens.d.ts.map +0 -1
  78. package/lib-commonjs/Radio/RadioTokens.ios.d.ts +0 -5
  79. package/lib-commonjs/Radio/RadioTokens.ios.d.ts.map +0 -1
  80. package/lib-commonjs/Radio/RadioTokens.ios.js +0 -51
  81. package/lib-commonjs/Radio/RadioTokens.ios.js.map +0 -1
  82. package/lib-commonjs/Radio/RadioTokens.js +0 -88
  83. package/lib-commonjs/Radio/RadioTokens.js.map +0 -1
  84. package/lib-commonjs/Radio/RadioTokens.win32.d.ts +0 -5
  85. package/lib-commonjs/Radio/RadioTokens.win32.d.ts.map +0 -1
  86. package/lib-commonjs/Radio/RadioTokens.win32.js +0 -102
  87. package/lib-commonjs/Radio/RadioTokens.win32.js.map +0 -1
  88. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.d.ts +0 -2
  89. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.d.ts.map +0 -1
  90. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js +0 -56
  91. package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js.map +0 -1
  92. package/lib-commonjs/Radio/useRadio.d.ts +0 -3
  93. package/lib-commonjs/Radio/useRadio.d.ts.map +0 -1
  94. package/lib-commonjs/Radio/useRadio.js +0 -119
  95. package/lib-commonjs/Radio/useRadio.js.map +0 -1
  96. package/lib-commonjs/Radio/useRadio.win32.d.ts +0 -3
  97. package/lib-commonjs/Radio/useRadio.win32.d.ts.map +0 -1
  98. package/lib-commonjs/Radio/useRadio.win32.js +0 -175
  99. package/lib-commonjs/Radio/useRadio.win32.js.map +0 -1
  100. package/lib-commonjs/RadioGroup/RadioGroup.d.ts +0 -12
  101. package/lib-commonjs/RadioGroup/RadioGroup.d.ts.map +0 -1
  102. package/lib-commonjs/RadioGroup/RadioGroup.js +0 -59
  103. package/lib-commonjs/RadioGroup/RadioGroup.js.map +0 -1
  104. package/lib-commonjs/RadioGroup/RadioGroup.styling.d.ts +0 -5
  105. package/lib-commonjs/RadioGroup/RadioGroup.styling.d.ts.map +0 -1
  106. package/lib-commonjs/RadioGroup/RadioGroup.styling.js +0 -52
  107. package/lib-commonjs/RadioGroup/RadioGroup.styling.js.map +0 -1
  108. package/lib-commonjs/RadioGroup/RadioGroup.types.d.ts +0 -134
  109. package/lib-commonjs/RadioGroup/RadioGroup.types.d.ts.map +0 -1
  110. package/lib-commonjs/RadioGroup/RadioGroup.types.js +0 -5
  111. package/lib-commonjs/RadioGroup/RadioGroup.types.js.map +0 -1
  112. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.d.ts +0 -3
  113. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.d.ts.map +0 -1
  114. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js +0 -6
  115. package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js.map +0 -1
  116. package/lib-commonjs/RadioGroup/RadioGroupTokens.d.ts +0 -5
  117. package/lib-commonjs/RadioGroup/RadioGroupTokens.d.ts.map +0 -1
  118. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.d.ts +0 -2
  119. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.d.ts.map +0 -1
  120. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js +0 -6
  121. package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js.map +0 -1
  122. package/lib-commonjs/RadioGroup/RadioGroupTokens.js +0 -19
  123. package/lib-commonjs/RadioGroup/RadioGroupTokens.js.map +0 -1
  124. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.d.ts +0 -5
  125. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.d.ts.map +0 -1
  126. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js +0 -20
  127. package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js.map +0 -1
  128. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +0 -2
  129. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts.map +0 -1
  130. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js +0 -104
  131. package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js.map +0 -1
  132. package/lib-commonjs/RadioGroup/radioGroupContext.d.ts +0 -10
  133. package/lib-commonjs/RadioGroup/radioGroupContext.d.ts.map +0 -1
  134. package/lib-commonjs/RadioGroup/radioGroupContext.js +0 -59
  135. package/lib-commonjs/RadioGroup/radioGroupContext.js.map +0 -1
  136. package/lib-commonjs/RadioGroup/useRadioGroup.d.ts +0 -3
  137. package/lib-commonjs/RadioGroup/useRadioGroup.d.ts.map +0 -1
  138. package/lib-commonjs/RadioGroup/useRadioGroup.js +0 -108
  139. package/lib-commonjs/RadioGroup/useRadioGroup.js.map +0 -1
  140. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts +0 -3
  141. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts.map +0 -1
  142. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js +0 -8
  143. package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js.map +0 -1
  144. package/lib-commonjs/index.d.ts +0 -18
  145. package/lib-commonjs/index.d.ts.map +0 -1
  146. package/lib-commonjs/index.js +0 -32
  147. package/lib-commonjs/index.js.map +0 -1
  148. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.d.ts +0 -17
  149. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.d.ts.map +0 -1
  150. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.js +0 -13
  151. package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.js.map +0 -1
  152. package/lib-commonjs/legacy/RadioButton.d.ts +0 -4
  153. package/lib-commonjs/legacy/RadioButton.d.ts.map +0 -1
  154. package/lib-commonjs/legacy/RadioButton.js +0 -133
  155. package/lib-commonjs/legacy/RadioButton.js.map +0 -1
  156. package/lib-commonjs/legacy/RadioButton.macos.d.ts +0 -4
  157. package/lib-commonjs/legacy/RadioButton.macos.d.ts.map +0 -1
  158. package/lib-commonjs/legacy/RadioButton.macos.js +0 -104
  159. package/lib-commonjs/legacy/RadioButton.macos.js.map +0 -1
  160. package/lib-commonjs/legacy/RadioButton.settings.d.ts +0 -5
  161. package/lib-commonjs/legacy/RadioButton.settings.d.ts.map +0 -1
  162. package/lib-commonjs/legacy/RadioButton.settings.js +0 -98
  163. package/lib-commonjs/legacy/RadioButton.settings.js.map +0 -1
  164. package/lib-commonjs/legacy/RadioButton.types.d.ts +0 -62
  165. package/lib-commonjs/legacy/RadioButton.types.d.ts.map +0 -1
  166. package/lib-commonjs/legacy/RadioButton.types.js +0 -5
  167. package/lib-commonjs/legacy/RadioButton.types.js.map +0 -1
  168. package/lib-commonjs/legacy/RadioButton.win32.d.ts +0 -4
  169. package/lib-commonjs/legacy/RadioButton.win32.d.ts.map +0 -1
  170. package/lib-commonjs/legacy/RadioButton.win32.js +0 -188
  171. package/lib-commonjs/legacy/RadioButton.win32.js.map +0 -1
  172. package/lib-commonjs/legacy/RadioGroup.d.ts +0 -7
  173. package/lib-commonjs/legacy/RadioGroup.d.ts.map +0 -1
  174. package/lib-commonjs/legacy/RadioGroup.js +0 -139
  175. package/lib-commonjs/legacy/RadioGroup.js.map +0 -1
  176. package/lib-commonjs/legacy/RadioGroup.settings.d.ts +0 -4
  177. package/lib-commonjs/legacy/RadioGroup.settings.d.ts.map +0 -1
  178. package/lib-commonjs/legacy/RadioGroup.settings.js +0 -28
  179. package/lib-commonjs/legacy/RadioGroup.settings.js.map +0 -1
  180. package/lib-commonjs/legacy/RadioGroup.types.d.ts +0 -96
  181. package/lib-commonjs/legacy/RadioGroup.types.d.ts.map +0 -1
  182. package/lib-commonjs/legacy/RadioGroup.types.js +0 -5
  183. package/lib-commonjs/legacy/RadioGroup.types.js.map +0 -1
  184. package/lib-commonjs/legacy/__tests__/RadioButton.test.d.ts +0 -2
  185. package/lib-commonjs/legacy/__tests__/RadioButton.test.d.ts.map +0 -1
  186. package/lib-commonjs/legacy/__tests__/RadioButton.test.js +0 -49
  187. package/lib-commonjs/legacy/__tests__/RadioButton.test.js.map +0 -1
  188. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.d.ts +0 -2
  189. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.d.ts.map +0 -1
  190. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js +0 -61
  191. package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js.map +0 -1
@@ -1,188 +0,0 @@
1
- /** @jsxImportSource @fluentui-react-native/framework-base */
2
- 'use strict';
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.RadioButton = void 0;
38
- const jsx_runtime_1 = require("@fluentui-react-native/framework-base/jsx-runtime");
39
- const React = __importStar(require("react"));
40
- const react_native_1 = require("react-native");
41
- const adapters_1 = require("@fluentui-react-native/adapters");
42
- const interactive_hooks_1 = require("@fluentui-react-native/interactive-hooks");
43
- const text_1 = require("@fluentui-react-native/text");
44
- const tokens_1 = require("@fluentui-react-native/tokens");
45
- const foundation_compose_1 = require("@uifabricshared/foundation-compose");
46
- const foundation_settings_1 = require("@uifabricshared/foundation-settings");
47
- const RadioButton_settings_1 = require("./RadioButton.settings");
48
- const RadioButton_types_1 = require("./RadioButton.types");
49
- const RadioGroup_1 = require("./RadioGroup");
50
- var DirectionalArrowKeys;
51
- (function (DirectionalArrowKeys) {
52
- DirectionalArrowKeys["ArrowUp"] = "ArrowUp";
53
- DirectionalArrowKeys["ArrowDown"] = "ArrowDown";
54
- DirectionalArrowKeys["ArrowRight"] = "ArrowRight";
55
- DirectionalArrowKeys["ArrowLeft"] = "ArrowLeft";
56
- })(DirectionalArrowKeys || (DirectionalArrowKeys = {}));
57
- exports.RadioButton = (0, foundation_compose_1.compose)({
58
- displayName: RadioButton_types_1.radioButtonName,
59
- usePrepareProps: (userProps, useStyling) => {
60
- const defaultComponentRef = React.useRef(null);
61
- const { content, buttonKey, disabled, accessibilityLabel, ariaLabel, componentRef = defaultComponentRef, accessibilityPosInSet, ariaPosInSet, accessibilitySetSize, ariaSetSize, ...rest } = userProps;
62
- // Grabs the context information from RadioGroup (currently selected button and client's onChange callback)
63
- const info = React.useContext(RadioGroup_1.RadioGroupContext);
64
- const buttonRef = (0, interactive_hooks_1.useViewCommandFocus)(componentRef);
65
- /* We don't want to call the user's onChange multiple times on the same selection. */
66
- const changeSelection = () => {
67
- if (buttonKey != info.selectedKey) {
68
- info.onChange && info.onChange(buttonKey);
69
- info.updateSelectedButtonRef && componentRef && info.updateSelectedButtonRef(componentRef);
70
- }
71
- };
72
- /* We use the componentRef of the currently selected button to maintain the default tabbable
73
- element in a RadioGroup. Since the componentRef isn't generated until after initial render,
74
- we must update it once here. */
75
- React.useEffect(() => {
76
- if (buttonKey == info.selectedKey) {
77
- info.updateSelectedButtonRef && componentRef && info.updateSelectedButtonRef(componentRef);
78
- }
79
- }, []);
80
- // Explicitly only run on mount and unmount
81
- React.useEffect(() => {
82
- info.addRadioButtonKey(buttonKey);
83
- if (!disabled) {
84
- info.addRadioButtonEnabledKey(buttonKey);
85
- }
86
- return () => {
87
- info.removeRadioButtonKey(buttonKey);
88
- info.removeRadioButtonEnabledKey(buttonKey);
89
- };
90
- }, []);
91
- const isRTL = react_native_1.I18nManager.isRTL;
92
- const onInvoke = React.useCallback((e) => {
93
- if (e.nativeEvent.key in DirectionalArrowKeys) {
94
- const length = info.enabledButtonKeys.length;
95
- const next = e.nativeEvent.key === DirectionalArrowKeys.ArrowDown ||
96
- (isRTL ? e.nativeEvent.key === DirectionalArrowKeys.ArrowLeft : e.nativeEvent.key === DirectionalArrowKeys.ArrowRight);
97
- const currRadioButtonIndex = info.enabledButtonKeys.indexOf(info.selectedKey);
98
- let newCurrRadioButtonIndex;
99
- if (next) {
100
- newCurrRadioButtonIndex = (currRadioButtonIndex + 1) % length;
101
- }
102
- else {
103
- // previous
104
- newCurrRadioButtonIndex = (currRadioButtonIndex - 1 + length) % length;
105
- }
106
- info.onChange && info.onChange(info.enabledButtonKeys[newCurrRadioButtonIndex]);
107
- info.updateInvoked && info.updateInvoked(true);
108
- }
109
- }, [info]);
110
- // Sets the updated selected button ref and focus if this Radio is selected via arrow key.
111
- React.useEffect(() => {
112
- if (info.invoked && buttonKey === info.selectedKey && !disabled) {
113
- info.updateSelectedButtonRef && componentRef && info.updateSelectedButtonRef(componentRef);
114
- componentRef?.current?.focus();
115
- info.updateInvoked && info.updateInvoked(false);
116
- }
117
- }, [info.invoked]);
118
- const keys = ['ArrowDown', 'ArrowRight', 'ArrowUp', 'ArrowLeft'];
119
- // Explicitly override onKeyDown to override the native behavior of moving focus with arrow keys.
120
- const onKeyDownProps = (0, interactive_hooks_1.useKeyDownProps)(onInvoke, ...keys);
121
- // Ensure focus is placed on button after click
122
- const changeSelectionWithFocus = () => {
123
- if (buttonKey != info.selectedKey) {
124
- info.onChange && info.onChange(buttonKey);
125
- info.updateSelectedButtonRef && componentRef && info.updateSelectedButtonRef(componentRef);
126
- info.updateInvoked && info.updateInvoked(true);
127
- }
128
- };
129
- /* RadioButton changes selection when focus is moved between each RadioButton and on a click */
130
- const pressable = (0, interactive_hooks_1.useAsPressable)({
131
- ...rest,
132
- onPress: changeSelectionWithFocus,
133
- onFocus: changeSelection,
134
- });
135
- // Used when creating accessibility properties in mergeSettings below
136
- const onAccessibilityAction = React.useCallback((event) => {
137
- switch (event.nativeEvent.actionName) {
138
- case 'Select':
139
- changeSelection();
140
- break;
141
- }
142
- }, [info, buttonKey]);
143
- const state = {
144
- ...pressable.state,
145
- selected: info.selectedKey === userProps.buttonKey && !disabled,
146
- disabled: disabled || false,
147
- };
148
- // Grab the styling information from the userProps, referencing the state as well as the props.
149
- const styleProps = useStyling(userProps, (override) => state[override] || userProps[override]);
150
- const slotProps = (0, foundation_settings_1.mergeSettings)(styleProps, {
151
- root: {
152
- ...rest,
153
- ref: buttonRef,
154
- ...pressable.props,
155
- accessibilityRole: 'radio',
156
- accessibilityLabel: accessibilityLabel ?? ariaLabel ?? content,
157
- accessibilityState: { disabled: state.disabled, selected: state.selected },
158
- accessibilityActions: [{ name: 'Select', label: RadioButton_settings_1.radioButtonSelectActionLabel }],
159
- accessibilityPosInSet: accessibilityPosInSet ?? ariaPosInSet ?? info.buttonKeys.findIndex((x) => x == buttonKey) + 1,
160
- accessibilitySetSize: accessibilitySetSize ?? ariaSetSize ?? info.buttonKeys.length,
161
- focusable: !state.disabled,
162
- onAccessibilityAction: onAccessibilityAction,
163
- ...onKeyDownProps,
164
- },
165
- content: { children: content },
166
- });
167
- return { slotProps };
168
- },
169
- render: (Slots, _renderData, ...children) => {
170
- return (jsx_runtime_1.jsxs(Slots.root, { children: [
171
- jsx_runtime_1.jsx(Slots.button, { children: jsx_runtime_1.jsx(Slots.innerCircle, {}) }), jsx_runtime_1.jsx(Slots.content, {}), children] }));
172
- },
173
- settings: RadioButton_settings_1.settings,
174
- slots: {
175
- root: react_native_1.View,
176
- button: { slotType: react_native_1.View, filter: adapters_1.filterViewProps },
177
- innerCircle: { slotType: react_native_1.View, filter: adapters_1.filterViewProps },
178
- content: text_1.Text,
179
- },
180
- styles: {
181
- root: [],
182
- button: [tokens_1.borderTokens],
183
- innerCircle: [tokens_1.backgroundColorTokens],
184
- content: [tokens_1.foregroundColorTokens, tokens_1.textTokens, [{ source: 'textBorderColor', lookup: tokens_1.getPaletteFromTheme, target: 'borderColor' }]],
185
- },
186
- });
187
- exports.default = exports.RadioButton;
188
- //# sourceMappingURL=RadioButton.win32.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioButton.win32.js","sourceRoot":"","sources":["../../src/legacy/RadioButton.win32.tsx"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,MAAY,KAAK,kCAAc;AAC/B,+CAAiD;AAEjD,8DAAkE;AAElE,gFAAgH;AAChH,sDAAmD;AACnD,0DAA4I;AAG5I,2EAA6D;AAC7D,6EAAoE;AAEpE,iEAAgF;AAEhF,2DAAsD;AACtD,6CAAiD;AAE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,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,4BAAmB,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;KAClI;CACF,CAAC,CAAC;kBAEY,QAAA,WAAW"}
@@ -1,7 +0,0 @@
1
- /** @jsxImportSource @fluentui-react-native/framework-base */
2
- import * as React from 'react';
3
- import type { IRadioGroupProps, IRadioGroupState, IRadioGroupSlotProps, IRadioGroupContext } from './RadioGroup.types';
4
- export declare const RadioGroupContext: React.Context<IRadioGroupContext>;
5
- export declare const RadioGroup: import("@uifabricshared/foundation-compose").IComposeReturnType<IRadioGroupProps, IRadioGroupSlotProps, import("./RadioGroup.types").IRadioGroupTokens, IRadioGroupState, object>;
6
- export default RadioGroup;
7
- //# sourceMappingURL=RadioGroup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../src/legacy/RadioGroup.tsx"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,KAAK,EAEV,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,iBAAiB,mCAS5B,CAAC;AAEH,eAAO,MAAM,UAAU,mLAuHrB,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -1,139 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.RadioGroup = exports.RadioGroupContext = void 0;
37
- const jsx_runtime_1 = require("@fluentui-react-native/framework-base/jsx-runtime");
38
- /** @jsxImportSource @fluentui-react-native/framework-base */
39
- const React = __importStar(require("react"));
40
- const react_native_1 = require("react-native");
41
- const focus_zone_1 = require("@fluentui-react-native/focus-zone");
42
- const interactive_hooks_1 = require("@fluentui-react-native/interactive-hooks");
43
- const text_1 = require("@fluentui-react-native/text");
44
- const tokens_1 = require("@fluentui-react-native/tokens");
45
- const foundation_compose_1 = require("@uifabricshared/foundation-compose");
46
- const foundation_settings_1 = require("@uifabricshared/foundation-settings");
47
- const RadioGroup_settings_1 = require("./RadioGroup.settings");
48
- const RadioGroup_types_1 = require("./RadioGroup.types");
49
- exports.RadioGroupContext = React.createContext({
50
- selectedKey: null,
51
- onChange: ( /* key: string */ /* key: string */) => {
52
- return;
53
- },
54
- updateSelectedButtonRef: ( /* ref: React.RefObject<any>*/ /* ref: React.RefObject<any>*/) => {
55
- return;
56
- },
57
- buttonKeys: [],
58
- });
59
- exports.RadioGroup = (0, foundation_compose_1.compose)({
60
- displayName: RadioGroup_types_1.radioGroupName,
61
- usePrepareProps: (userProps, useStyling) => {
62
- const { label, ariaLabel, accessibilityLabel, selectedKey, defaultSelectedKey, ...rest } = userProps;
63
- // This hook updates the Selected Button and calls the customer's onClick function. This gets called after a button is pressed.
64
- const data = (0, interactive_hooks_1.useSelectedKey)(selectedKey || defaultSelectedKey || null, userProps.onChange);
65
- const [selectedButtonRef, setSelectedButtonRef] = React.useState(React.useRef(null));
66
- const onSelectButtonRef = React.useCallback((ref) => {
67
- setSelectedButtonRef(ref);
68
- }, [setSelectedButtonRef]);
69
- const [invoked, setInvoked] = React.useState(false);
70
- const onInvoked = React.useCallback((check) => {
71
- setInvoked(check);
72
- }, [setInvoked]);
73
- const [buttonKeys, setButtonKeys] = React.useState([]);
74
- const onAddRadioButtonKey = React.useCallback((buttonKey) => {
75
- buttonKeys.push(buttonKey);
76
- setButtonKeys(buttonKeys);
77
- }, [setButtonKeys]);
78
- const onRemoveRadioButtonKey = React.useCallback((buttonKey) => {
79
- buttonKeys.filter((item) => item !== buttonKey);
80
- setButtonKeys(buttonKeys);
81
- }, [setButtonKeys]);
82
- const [enabledButtonKeys, setEnabledButtonKeys] = React.useState([]);
83
- const onAddRadioButtonEnabledKey = React.useCallback((buttonKey) => {
84
- enabledButtonKeys.push(buttonKey);
85
- setEnabledButtonKeys(enabledButtonKeys);
86
- }, [setEnabledButtonKeys]);
87
- const onRemoveRadioButtonEnabledKey = React.useCallback((buttonKey) => {
88
- enabledButtonKeys.filter((item) => item !== buttonKey);
89
- setEnabledButtonKeys(enabledButtonKeys);
90
- }, [setEnabledButtonKeys]);
91
- const state = {
92
- context: {
93
- selectedKey: selectedKey ?? data.selectedKey,
94
- onChange: data.onKeySelect,
95
- updateSelectedButtonRef: onSelectButtonRef,
96
- invoked: invoked,
97
- updateInvoked: onInvoked,
98
- buttonKeys: buttonKeys,
99
- enabledButtonKeys: enabledButtonKeys,
100
- addRadioButtonKey: onAddRadioButtonKey,
101
- removeRadioButtonKey: onRemoveRadioButtonKey,
102
- addRadioButtonEnabledKey: onAddRadioButtonEnabledKey,
103
- removeRadioButtonEnabledKey: onRemoveRadioButtonEnabledKey,
104
- },
105
- };
106
- const styleProps = useStyling(userProps, (override) => state[override] || userProps[override]);
107
- const slotProps = (0, foundation_settings_1.mergeSettings)(styleProps, {
108
- root: { accessibilityLabel: accessibilityLabel ?? ariaLabel ?? label, accessibilityRole: 'radiogroup', ...rest },
109
- label: { children: label },
110
- container: { isCircularNavigation: true, defaultTabbableElement: selectedButtonRef },
111
- });
112
- return { slotProps, state };
113
- },
114
- render: (Slots, renderData, ...children) => {
115
- if (renderData.state == undefined) {
116
- return null;
117
- }
118
- return (jsx_runtime_1.jsx(exports.RadioGroupContext.Provider
119
- // Passes in the selected key and a hook function to update the newly selected button and call the client's onChange callback
120
- , {
121
- // Passes in the selected key and a hook function to update the newly selected button and call the client's onChange callback
122
- value: renderData.state.context, children: jsx_runtime_1.jsxs(Slots.root, { children: [
123
- jsx_runtime_1.jsx(Slots.label, {}), jsx_runtime_1.jsx(Slots.container, { children: children })
124
- ] }) }));
125
- },
126
- settings: RadioGroup_settings_1.settings,
127
- slots: {
128
- root: react_native_1.View,
129
- label: text_1.Text,
130
- container: focus_zone_1.FocusZone,
131
- },
132
- styles: {
133
- root: [],
134
- label: [tokens_1.foregroundColorTokens, tokens_1.textTokens],
135
- container: [],
136
- },
137
- });
138
- exports.default = exports.RadioGroup;
139
- //# sourceMappingURL=RadioGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioGroup.js","sourceRoot":"","sources":["../../src/legacy/RadioGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA6D;AAC7D,MAAY,KAAK,kCAAc;AAC/B,+CAAoC;AAEpC,kEAA8D;AAC9D,gFAA0E;AAC1E,sDAAmD;AACnD,0DAAkF;AAGlF,2EAA6D;AAC7D,6EAAoE;AAEpE,+DAAiD;AASjD,yDAAoD;AAEvC,QAAA,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAqB;IACvE,W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ClC,GACc,CAC9B,CAAC;IAAA,CACH;IAED,QAAQ,EAAR,8BAAQ;IACR,KAAK,EAAE;QACL,IAAI,EAAE,mBAAI;QACV,KAAK,EAAE,WAAI;QACX,SAAS,EAAE,sBAAS;KACrB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,CAAC,8BAAqB,EAAE,mBAAU,CAAC;QAC1C,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC;kBAEY,QAAA,UAAU"}
@@ -1,4 +0,0 @@
1
- import type { IComposeSettings } from '@uifabricshared/foundation-compose';
2
- import type { IRadioGroupType } from './RadioGroup.types';
3
- export declare const settings: IComposeSettings<IRadioGroupType>;
4
- //# sourceMappingURL=RadioGroup.settings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioGroup.settings.d.ts","sourceRoot":"","sources":["../../src/legacy/RadioGroup.settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAG1D,eAAO,MAAM,QAAQ,EAAE,gBAAgB,CAAC,eAAe,CAsBtD,CAAC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.settings = void 0;
4
- const RadioGroup_types_1 = require("./RadioGroup.types");
5
- exports.settings = [
6
- {
7
- tokens: {
8
- color: 'menuItemText',
9
- },
10
- root: {
11
- accessible: true,
12
- accessibilityRole: 'radio',
13
- style: {
14
- display: 'flex',
15
- alignItems: 'flex-start',
16
- flexDirection: 'column',
17
- },
18
- },
19
- label: {
20
- style: {
21
- fontSize: 16,
22
- fontWeight: '600',
23
- },
24
- },
25
- },
26
- RadioGroup_types_1.radioGroupName,
27
- ];
28
- //# sourceMappingURL=RadioGroup.settings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioGroup.settings.js","sourceRoot":"","sources":["../../src/legacy/RadioGroup.settings.ts"],"names":[],"mappings":";;;AAGA,yDAAoD;AAEvC,QAAA,QAAQ,GAAsC;IACzD;QACE,MAAM,EAAE;YACN,KAAK,EAAE,cAAc;SACtB;QACD,IAAI,EAAE;YACJ,UAAU,EAAE,IAAI;YAChB,iBAAiB,EAAE,OAAO;YAC1B,KAAK,EAAE;gBACL,OAAO,EAAE,MAAM;gBACf,UAAU,EAAE,YAAY;gBACxB,aAAa,EAAE,QAAQ;aACxB;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE;gBACL,QAAQ,EAAE,EAAE;gBACZ,UAAU,EAAE,KAAK;aAClB;SACF;KACF;IACD,iCAAc;CACf,CAAC"}
@@ -1,96 +0,0 @@
1
- import type * as React from 'react';
2
- import type { ViewProps } from 'react-native';
3
- import type { FocusZoneProps } from '@fluentui-react-native/focus-zone';
4
- import type { ITextProps } from '@fluentui-react-native/text';
5
- import type { IForegroundColorTokens, FontTokens } from '@fluentui-react-native/tokens';
6
- import type { IRenderData } from '@uifabricshared/foundation-composable';
7
- export declare const radioGroupName = "RadioGroup";
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;
51
- }
52
- export interface IRadioGroupState {
53
- context: IRadioGroupContext;
54
- }
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;
81
- }>;
82
- export interface IRadioGroupTokens extends IForegroundColorTokens, FontTokens {
83
- }
84
- export interface IRadioGroupSlotProps {
85
- root: React.PropsWithRef<ViewProps>;
86
- label: ITextProps;
87
- container: FocusZoneProps;
88
- }
89
- export type IRadioGroupRenderData = IRenderData<IRadioGroupSlotProps, IRadioGroupState>;
90
- export interface IRadioGroupType {
91
- props: IRadioGroupProps;
92
- tokens: IRadioGroupTokens;
93
- slotProps: IRadioGroupSlotProps;
94
- state: IRadioGroupState;
95
- }
96
- //# sourceMappingURL=RadioGroup.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioGroup.types.d.ts","sourceRoot":"","sources":["../../src/legacy/RadioGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO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C7B;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH,MAAM,WAAW,iBAAkB,SAAQ,sBAAsB,EAAE,UAAU;CAAG;AAEhF,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACpC,KAAK,EAAE,UAAU,CAAC;IAClB,SAAS,EAAE,cAAc,CAAC;CAC3B;AAED,MAAM,MAAM,qBAAqB,GAAG,WAAW,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;AAExF,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,gBAAgB,CAAC;CACzB"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.radioGroupName = void 0;
4
- exports.radioGroupName = 'RadioGroup';
5
- //# sourceMappingURL=RadioGroup.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioGroup.types.js","sourceRoot":"","sources":["../../src/legacy/RadioGroup.types.ts"],"names":[],"mappings":";;;AAQa,QAAA,cAAc,GAAG,YAAY,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=RadioButton.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioButton.test.d.ts","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButton.test.tsx"],"names":[],"mappings":""}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- const jsx_runtime_1 = require("react/jsx-runtime");
37
- const react_1 = require("react");
38
- const renderer = __importStar(require("react-test-renderer"));
39
- const RadioButton_1 = require("../RadioButton");
40
- describe('RadioButton component tests', () => {
41
- it('RadioButton default', () => {
42
- let component;
43
- (0, react_1.act)(() => {
44
- component = renderer.create(jsx_runtime_1.jsx(RadioButton_1.RadioButton, { buttonKey: "key1", content: "Default Button" }));
45
- });
46
- expect(component.toJSON()).toMatchSnapshot();
47
- });
48
- });
49
- //# sourceMappingURL=RadioButton.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioButton.test.js","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButton.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAA4B;AAE5B,MAAY,QAAQ,gDAA4B;AAEhD,gDAA6C;AAE7C,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE,CAAC;IAC5C,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC;QAC9B,IAAI,SAAqC,CAAC;QAC1C,IAAA,WAAG,EAAC,GAAG,EAAE,CAAC;YACR,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAC,yBAAW,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 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=RadioButtonGroup.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioButtonGroup.test.d.ts","sourceRoot":"","sources":["../../../src/legacy/__tests__/RadioButtonGroup.test.tsx"],"names":[],"mappings":""}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- const jsx_runtime_1 = require("react/jsx-runtime");
37
- const react_1 = require("react");
38
- const react_native_1 = require("react-native");
39
- const renderer = __importStar(require("react-test-renderer"));
40
- const __1 = require("../..");
41
- describe('RadioButton component tests', () => {
42
- it('RadioButton default', () => {
43
- let component;
44
- (0, react_1.act)(() => {
45
- component = renderer.create(jsx_runtime_1.jsxs(__1.RadioGroup, { label: "Uncontrolled RadioGroup", defaultSelectedKey: "key2", children: [
46
- jsx_runtime_1.jsx(__1.RadioButton, { buttonKey: "key1", content: "RadioButton1" }), jsx_runtime_1.jsx(__1.RadioButton, { buttonKey: "key2", content: "RadioButton2" })
47
- ] }));
48
- });
49
- expect(component.toJSON()).toMatchSnapshot();
50
- });
51
- it('RadioButton not direct child of radio group', () => {
52
- let component;
53
- (0, react_1.act)(() => {
54
- component = renderer.create(jsx_runtime_1.jsx(__1.RadioGroup, { label: "Uncontrolled RadioGroup", defaultSelectedKey: "key2", children: jsx_runtime_1.jsxs(react_native_1.View, { children: [
55
- jsx_runtime_1.jsx(__1.RadioButton, { buttonKey: "key1", content: "RadioButton1", accessibilityPosInSet: 1, accessibilitySetSize: 2 }), jsx_runtime_1.jsx(__1.RadioButton, { buttonKey: "key2", content: "RadioButton2", accessibilityPosInSet: 2, accessibilitySetSize: 2 })
56
- ] }) }));
57
- });
58
- expect(component.toJSON()).toMatchSnapshot();
59
- });
60
- });
61
- //# sourceMappingURL=RadioButtonGroup.test.js.map