@fluentui-react-native/radio-group 0.22.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/lib/Radio/Radio.d.ts +2 -7
- package/lib/Radio/Radio.ios.d.ts +2 -7
- package/lib/Radio/Radio.ios.js +31 -50
- package/lib/Radio/Radio.js +31 -46
- package/lib/Radio/Radio.styling.d.ts +1 -1
- package/lib/Radio/Radio.styling.js +88 -109
- package/lib/Radio/Radio.types.d.ts +170 -176
- package/lib/Radio/Radio.types.js +1 -1
- package/lib/Radio/RadioTokens.android.d.ts +1 -1
- package/lib/Radio/RadioTokens.android.js +42 -42
- package/lib/Radio/RadioTokens.android.js.map +1 -1
- package/lib/Radio/RadioTokens.d.ts +1 -1
- package/lib/Radio/RadioTokens.ios.d.ts +1 -1
- package/lib/Radio/RadioTokens.ios.js +39 -39
- package/lib/Radio/RadioTokens.ios.js.map +1 -1
- package/lib/Radio/RadioTokens.js +76 -76
- package/lib/Radio/RadioTokens.js.map +1 -1
- package/lib/Radio/RadioTokens.win32.d.ts +1 -1
- package/lib/Radio/RadioTokens.win32.js +89 -89
- package/lib/Radio/RadioTokens.win32.js.map +1 -1
- package/lib/Radio/__tests__/RadioExperimental.test.d.ts +1 -1
- package/lib/Radio/__tests__/RadioExperimental.test.js +14 -14
- package/lib/Radio/useRadio.d.ts +1 -1
- package/lib/Radio/useRadio.js +70 -91
- package/lib/Radio/useRadio.win32.d.ts +1 -1
- package/lib/Radio/useRadio.win32.js +121 -143
- package/lib/RadioGroup/RadioGroup.d.ts +2 -7
- package/lib/RadioGroup/RadioGroup.js +34 -48
- package/lib/RadioGroup/RadioGroup.styling.d.ts +1 -1
- package/lib/RadioGroup/RadioGroup.styling.js +42 -51
- package/lib/RadioGroup/RadioGroup.types.d.ts +117 -117
- package/lib/RadioGroup/RadioGroup.types.js +1 -1
- package/lib/RadioGroup/RadioGroupTokens.android.d.ts +1 -1
- package/lib/RadioGroup/RadioGroupTokens.android.js +1 -1
- package/lib/RadioGroup/RadioGroupTokens.d.ts +1 -1
- package/lib/RadioGroup/RadioGroupTokens.ios.d.ts +1 -1
- package/lib/RadioGroup/RadioGroupTokens.ios.js +1 -1
- package/lib/RadioGroup/RadioGroupTokens.js +12 -12
- package/lib/RadioGroup/RadioGroupTokens.js.map +1 -1
- package/lib/RadioGroup/RadioGroupTokens.mobile.d.ts +1 -1
- package/lib/RadioGroup/RadioGroupTokens.mobile.js +13 -13
- package/lib/RadioGroup/RadioGroupTokens.mobile.js.map +1 -1
- package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +1 -1
- package/lib/RadioGroup/__tests__/RadioGroupExperimental.test.js +56 -98
- package/lib/RadioGroup/radioGroupContext.d.ts +1 -1
- package/lib/RadioGroup/radioGroupContext.js +15 -19
- package/lib/RadioGroup/useRadioGroup.d.ts +1 -1
- package/lib/RadioGroup/useRadioGroup.js +63 -93
- package/lib/RadioGroup/useRadioGroupContextValue.d.ts +1 -1
- package/lib/RadioGroup/useRadioGroupContextValue.js +2 -2
- package/lib/index.d.ts +4 -25
- package/lib/index.js +1 -1
- package/lib/legacy/MacOSRadioButtonNativeComponent.d.ts +6 -6
- package/lib/legacy/MacOSRadioButtonNativeComponent.js +1 -1
- package/lib/legacy/RadioButton.d.ts +2 -8
- package/lib/legacy/RadioButton.js +80 -96
- package/lib/legacy/RadioButton.macos.d.ts +2 -8
- package/lib/legacy/RadioButton.macos.js +48 -48
- package/lib/legacy/RadioButton.settings.d.ts +2 -2
- package/lib/legacy/RadioButton.settings.js +81 -81
- package/lib/legacy/RadioButton.types.d.ts +45 -45
- package/lib/legacy/RadioButton.types.js +1 -1
- package/lib/legacy/RadioButton.win32.d.ts +2 -8
- package/lib/legacy/RadioButton.win32.js +132 -151
- package/lib/legacy/RadioGroup.d.ts +2 -8
- package/lib/legacy/RadioGroup.js +84 -108
- package/lib/legacy/RadioGroup.settings.d.ts +1 -1
- package/lib/legacy/RadioGroup.settings.js +21 -21
- package/lib/legacy/RadioGroup.types.d.ts +79 -78
- package/lib/legacy/RadioGroup.types.js +1 -1
- package/lib/legacy/__tests__/RadioButton.test.d.ts +1 -1
- package/lib/legacy/__tests__/RadioButton.test.js +8 -8
- package/lib/legacy/__tests__/RadioButtonGroup.test.d.ts +1 -1
- package/lib/legacy/__tests__/RadioButtonGroup.test.js +18 -34
- package/lib-commonjs/Radio/Radio.d.ts +2 -7
- package/lib-commonjs/Radio/Radio.ios.d.ts +2 -7
- package/lib-commonjs/Radio/Radio.ios.js +40 -64
- package/lib-commonjs/Radio/Radio.js +39 -59
- package/lib-commonjs/Radio/Radio.styling.d.ts +1 -1
- package/lib-commonjs/Radio/Radio.styling.js +94 -115
- package/lib-commonjs/Radio/Radio.types.d.ts +170 -176
- package/lib-commonjs/Radio/Radio.types.js +3 -3
- package/lib-commonjs/Radio/RadioTokens.android.d.ts +1 -1
- package/lib-commonjs/Radio/RadioTokens.android.js +45 -45
- package/lib-commonjs/Radio/RadioTokens.android.js.map +1 -1
- package/lib-commonjs/Radio/RadioTokens.d.ts +1 -1
- package/lib-commonjs/Radio/RadioTokens.ios.d.ts +1 -1
- package/lib-commonjs/Radio/RadioTokens.ios.js +42 -42
- package/lib-commonjs/Radio/RadioTokens.ios.js.map +1 -1
- package/lib-commonjs/Radio/RadioTokens.js +79 -79
- package/lib-commonjs/Radio/RadioTokens.js.map +1 -1
- package/lib-commonjs/Radio/RadioTokens.win32.d.ts +1 -1
- package/lib-commonjs/Radio/RadioTokens.win32.js +92 -92
- package/lib-commonjs/Radio/RadioTokens.win32.js.map +1 -1
- package/lib-commonjs/Radio/__tests__/RadioExperimental.test.d.ts +1 -1
- package/lib-commonjs/Radio/__tests__/RadioExperimental.test.js +48 -65
- package/lib-commonjs/Radio/useRadio.d.ts +1 -1
- package/lib-commonjs/Radio/useRadio.js +105 -143
- package/lib-commonjs/Radio/useRadio.win32.d.ts +1 -1
- package/lib-commonjs/Radio/useRadio.win32.js +157 -196
- package/lib-commonjs/RadioGroup/RadioGroup.d.ts +2 -7
- package/lib-commonjs/RadioGroup/RadioGroup.js +45 -65
- package/lib-commonjs/RadioGroup/RadioGroup.styling.d.ts +1 -1
- package/lib-commonjs/RadioGroup/RadioGroup.styling.js +48 -57
- package/lib-commonjs/RadioGroup/RadioGroup.types.d.ts +117 -117
- package/lib-commonjs/RadioGroup/RadioGroup.types.js +3 -3
- package/lib-commonjs/RadioGroup/RadioGroupTokens.android.d.ts +1 -1
- package/lib-commonjs/RadioGroup/RadioGroupTokens.android.js +5 -10
- package/lib-commonjs/RadioGroup/RadioGroupTokens.d.ts +1 -1
- package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.d.ts +1 -1
- package/lib-commonjs/RadioGroup/RadioGroupTokens.ios.js +5 -10
- package/lib-commonjs/RadioGroup/RadioGroupTokens.js +15 -15
- package/lib-commonjs/RadioGroup/RadioGroupTokens.js.map +1 -1
- package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.d.ts +1 -1
- package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js +16 -16
- package/lib-commonjs/RadioGroup/RadioGroupTokens.mobile.js.map +1 -1
- package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.d.ts +1 -1
- package/lib-commonjs/RadioGroup/__tests__/RadioGroupExperimental.test.js +91 -153
- package/lib-commonjs/RadioGroup/radioGroupContext.d.ts +1 -1
- package/lib-commonjs/RadioGroup/radioGroupContext.js +47 -68
- package/lib-commonjs/RadioGroup/useRadioGroup.d.ts +1 -1
- package/lib-commonjs/RadioGroup/useRadioGroup.js +97 -144
- package/lib-commonjs/RadioGroup/useRadioGroupContextValue.d.ts +1 -1
- package/lib-commonjs/RadioGroup/useRadioGroupContextValue.js +4 -4
- package/lib-commonjs/index.d.ts +4 -25
- package/lib-commonjs/index.js +32 -128
- package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.d.ts +6 -6
- package/lib-commonjs/legacy/MacOSRadioButtonNativeComponent.js +7 -9
- package/lib-commonjs/legacy/RadioButton.d.ts +2 -8
- package/lib-commonjs/legacy/RadioButton.js +121 -162
- package/lib-commonjs/legacy/RadioButton.macos.d.ts +2 -8
- package/lib-commonjs/legacy/RadioButton.macos.js +88 -107
- package/lib-commonjs/legacy/RadioButton.settings.d.ts +2 -2
- package/lib-commonjs/legacy/RadioButton.settings.js +84 -84
- package/lib-commonjs/legacy/RadioButton.types.d.ts +45 -45
- package/lib-commonjs/legacy/RadioButton.types.js +3 -3
- package/lib-commonjs/legacy/RadioButton.win32.d.ts +2 -8
- package/lib-commonjs/legacy/RadioButton.win32.js +173 -217
- package/lib-commonjs/legacy/RadioGroup.d.ts +2 -8
- package/lib-commonjs/legacy/RadioGroup.js +125 -168
- package/lib-commonjs/legacy/RadioGroup.settings.d.ts +1 -1
- package/lib-commonjs/legacy/RadioGroup.settings.js +24 -24
- package/lib-commonjs/legacy/RadioGroup.types.d.ts +79 -78
- package/lib-commonjs/legacy/RadioGroup.types.js +3 -3
- package/lib-commonjs/legacy/__tests__/RadioButton.test.d.ts +1 -1
- package/lib-commonjs/legacy/__tests__/RadioButton.test.js +42 -59
- package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.d.ts +1 -1
- package/lib-commonjs/legacy/__tests__/RadioButtonGroup.test.js +53 -96
- package/package.json +27 -26
- package/src/Radio/RadioTokens.android.ts +1 -1
- package/src/Radio/RadioTokens.ios.ts +1 -1
- package/src/Radio/RadioTokens.ts +1 -1
- package/src/Radio/RadioTokens.win32.ts +1 -1
- package/src/RadioGroup/RadioGroupTokens.mobile.ts +1 -1
- package/src/RadioGroup/RadioGroupTokens.ts +1 -1
|
@@ -3,132 +3,132 @@ import type { IViewProps } from '@fluentui-react-native/adapters';
|
|
|
3
3
|
import type { FocusZoneProps } from '@fluentui-react-native/focus-zone';
|
|
4
4
|
import type { TextProps } from '@fluentui-react-native/text';
|
|
5
5
|
import type { IForegroundColorTokens, FontTokens } from '@fluentui-react-native/tokens';
|
|
6
|
-
export declare const radioGroupName =
|
|
6
|
+
export declare const radioGroupName = "RadioGroup";
|
|
7
7
|
export interface RadioGroupState extends RadioGroupProps {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The currently selected RadioButton's key
|
|
10
|
+
*/
|
|
11
|
+
value: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Updates the selected button and calls the client’s onChange callback
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (value: string) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Updates the selected button's ref to set as the default tabbable element
|
|
18
|
+
*/
|
|
19
|
+
updateSelectedButtonRef?: (ref: React.RefObject<any>) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Updates the group container's defaultTabbableElement
|
|
22
|
+
*/
|
|
23
|
+
selectedButtonRef?: React.MutableRefObject<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Populate the values array (all Radio keys) at mount and un-mount
|
|
26
|
+
*/
|
|
27
|
+
addRadioValue?: (value: string) => void;
|
|
28
|
+
removeRadioValue?: (value: string) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Array of all Radio keys in the RadioGroup
|
|
31
|
+
*/
|
|
32
|
+
values?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* Populate the enabledValues array (only enabled/valid Radio keys) at mount and un-mount
|
|
35
|
+
* @platform win32
|
|
36
|
+
*/
|
|
37
|
+
addRadioEnabledValue?: (value: string) => void;
|
|
38
|
+
removeRadioEnabledValue?: (value: string) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Array of enabled Radio keys in the RadioGroup
|
|
41
|
+
* @platform win32
|
|
42
|
+
*/
|
|
43
|
+
enabledValues?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Updates invoked to signal that arrow key has been pressed and focus needs to be set
|
|
46
|
+
* @platform win32
|
|
47
|
+
*/
|
|
48
|
+
updateInvoked?: (check: boolean) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Signals whether arrow key has been pressed
|
|
51
|
+
* @platform win32
|
|
52
|
+
*/
|
|
53
|
+
invoked?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Signals whether the currently selected radio is disabled. If this is the case, the FocusZone state is set to 'disabled'.
|
|
56
|
+
* @platform win32
|
|
57
|
+
*/
|
|
58
|
+
selectedButtonDisabled?: boolean;
|
|
59
59
|
}
|
|
60
60
|
export interface RadioGroupTokens extends IForegroundColorTokens, FontTokens {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Color of required indicator
|
|
63
|
+
*/
|
|
64
|
+
requiredColor?: ColorValue;
|
|
65
|
+
/**
|
|
66
|
+
* Amount of padding between the end of the label and the start of the required text
|
|
67
|
+
*/
|
|
68
|
+
requiredPadding?: ViewStyle['padding'];
|
|
69
|
+
/**
|
|
70
|
+
* The flex direction of the Radios
|
|
71
|
+
*/
|
|
72
|
+
flexDirection?: ViewStyle['flexDirection'];
|
|
73
|
+
/**
|
|
74
|
+
* States that can be applied to a RadioGroup
|
|
75
|
+
*/
|
|
76
|
+
disabled?: RadioGroupTokens;
|
|
77
|
+
isHorizontal?: RadioGroupTokens;
|
|
78
78
|
}
|
|
79
79
|
export interface RadioGroupProps extends Pick<FocusZoneProps, 'isCircularNavigation' | 'defaultTabbableElement'>, IViewProps {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Descriptive label for the RadioGroup. This will be displayed as the title of the radio group to the user.
|
|
82
|
+
*/
|
|
83
|
+
label?: string;
|
|
84
|
+
/**
|
|
85
|
+
* The key of the RadioButton that will initially be selected.
|
|
86
|
+
*
|
|
87
|
+
* This is mutually-exclusive if radiogroup is disabled or radio button is disabled.
|
|
88
|
+
*/
|
|
89
|
+
defaultValue?: string;
|
|
90
|
+
/**
|
|
91
|
+
* The key of the selected option. If you provide this, you must maintain selection state by observing
|
|
92
|
+
* onChange events and passing a new value in when changed. This overrides defaultSelectedKey
|
|
93
|
+
* and makes the RadioGroup a controlled component.
|
|
94
|
+
*/
|
|
95
|
+
value?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Require a selection in this group. Adds the 'required' prop to all child Radio items.
|
|
98
|
+
*/
|
|
99
|
+
required?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Sets the RadioGroup to disabled if true
|
|
102
|
+
*/
|
|
103
|
+
disabled?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* The position of the label relative to the indicator.
|
|
106
|
+
* 'horizontal' and 'horizontal-stacked' are not supported from Fluent Android and Win32, renders as-is.
|
|
107
|
+
*
|
|
108
|
+
* @default vertical
|
|
109
|
+
*/
|
|
110
|
+
layout?: 'vertical' | 'horizontal' | 'horizontal-stacked';
|
|
111
|
+
/**
|
|
112
|
+
* Callback for receiving a notification when the choice has been changed
|
|
113
|
+
*/
|
|
114
|
+
onChange?: (key: string) => void;
|
|
115
115
|
}
|
|
116
116
|
export interface RadioGroupInfo {
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
props: RadioGroupProps;
|
|
118
|
+
state: RadioGroupState;
|
|
119
119
|
}
|
|
120
120
|
export interface RadioGroupSlotProps {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
121
|
+
root: React.PropsWithRef<IViewProps>;
|
|
122
|
+
label?: IViewProps;
|
|
123
|
+
labelText?: TextProps;
|
|
124
|
+
required?: TextProps;
|
|
125
|
+
options: IViewProps;
|
|
126
|
+
container: FocusZoneProps;
|
|
127
127
|
}
|
|
128
128
|
export interface RadioGroupType {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
props: RadioGroupProps;
|
|
130
|
+
tokens: RadioGroupTokens;
|
|
131
|
+
slotProps: RadioGroupSlotProps;
|
|
132
|
+
state: RadioGroupState;
|
|
133
133
|
}
|
|
134
|
-
//# sourceMappingURL=RadioGroup.types.d.ts.map
|
|
134
|
+
//# 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
|
|
@@ -2,4 +2,4 @@ import type { Theme } from '@fluentui-react-native/framework';
|
|
|
2
2
|
import type { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
3
3
|
import type { RadioGroupTokens } from './RadioGroup.types';
|
|
4
4
|
export declare const defaultRadioGroupTokens: TokenSettings<RadioGroupTokens, Theme>;
|
|
5
|
-
//# sourceMappingURL=RadioGroupTokens.d.ts.map
|
|
5
|
+
//# sourceMappingURL=RadioGroupTokens.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { defaultRadioGroupTokens } from './RadioGroupTokens.mobile';
|
|
2
|
-
//# sourceMappingURL=RadioGroupTokens.ios.d.ts.map
|
|
2
|
+
//# sourceMappingURL=RadioGroupTokens.ios.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { defaultRadioGroupTokens } from './RadioGroupTokens.mobile';
|
|
2
|
-
//# sourceMappingURL=RadioGroupTokens.ios.js.map
|
|
2
|
+
//# sourceMappingURL=RadioGroupTokens.ios.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { globalTokens } from '@fluentui-react-native/theme-tokens';
|
|
2
2
|
export const defaultRadioGroupTokens = (t) => ({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
color: t.colors.menuItemText,
|
|
4
|
+
variant: 'subtitle2Strong',
|
|
5
|
+
requiredColor: t.colors.redForeground3,
|
|
6
|
+
requiredPadding: globalTokens.size40,
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
disabled: {
|
|
9
|
+
color: t.colors.neutralForegroundDisabled,
|
|
10
|
+
},
|
|
11
|
+
isHorizontal: {
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
},
|
|
14
14
|
});
|
|
15
|
-
//# sourceMappingURL=RadioGroupTokens.js.map
|
|
15
|
+
//# sourceMappingURL=RadioGroupTokens.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupTokens.js","sourceRoot":"","sources":["../../src/RadioGroup/RadioGroupTokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,MAAM,CAAC,MAAM,uBAAuB,GAA2C,CAAC,CAAQ,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"RadioGroupTokens.js","sourceRoot":"","sources":["../../src/RadioGroup/RadioGroupTokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,MAAM,CAAC,MAAM,uBAAuB,GAA2C,CAAC,CAAQ,EAAE,EAAE,CAC1F,CAAC;IACC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY;IAC5B,OAAO,EAAE,iBAAiB;IAC1B,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC,cAAc;IACtC,eAAe,EAAE,YAAY,CAAC,MAAM;IACpC,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,yBAAyB;KAC1C;IACD,YAAY,EAAE;QACZ,aAAa,EAAE,KAAK;KACrB;CACF,CAAqB,CAAC"}
|
|
@@ -2,4 +2,4 @@ import type { Theme } from '@fluentui-react-native/framework';
|
|
|
2
2
|
import type { TokenSettings } from '@fluentui-react-native/use-styling';
|
|
3
3
|
import type { RadioGroupTokens } from './RadioGroup.types';
|
|
4
4
|
export declare const defaultRadioGroupTokens: TokenSettings<RadioGroupTokens, Theme>;
|
|
5
|
-
//# sourceMappingURL=RadioGroupTokens.mobile.d.ts.map
|
|
5
|
+
//# sourceMappingURL=RadioGroupTokens.mobile.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { globalTokens } from '@fluentui-react-native/theme-tokens';
|
|
2
2
|
export const defaultRadioGroupTokens = (t) => ({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
// Tokens taken from Android Popover
|
|
4
|
+
color: t.colors.neutralForeground1,
|
|
5
|
+
variant: 'body1Strong',
|
|
6
|
+
requiredColor: globalTokens.color.darkRed.primary,
|
|
7
|
+
requiredPadding: globalTokens.size20,
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
disabled: {
|
|
10
|
+
color: t.colors.neutralForegroundDisabled1,
|
|
11
|
+
},
|
|
12
|
+
isHorizontal: {
|
|
13
|
+
flexDirection: 'row',
|
|
14
|
+
},
|
|
15
15
|
});
|
|
16
|
-
//# sourceMappingURL=RadioGroupTokens.mobile.js.map
|
|
16
|
+
//# sourceMappingURL=RadioGroupTokens.mobile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupTokens.mobile.js","sourceRoot":"","sources":["../../src/RadioGroup/RadioGroupTokens.mobile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,MAAM,CAAC,MAAM,uBAAuB,GAA2C,CAAC,CAAQ,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"RadioGroupTokens.mobile.js","sourceRoot":"","sources":["../../src/RadioGroup/RadioGroupTokens.mobile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAKnE,MAAM,CAAC,MAAM,uBAAuB,GAA2C,CAAC,CAAQ,EAAE,EAAE,CAC1F,CAAC;IACC,oCAAoC;IACpC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,kBAAkB;IAClC,OAAO,EAAE,aAAa;IACtB,aAAa,EAAE,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO;IACjD,eAAe,EAAE,YAAY,CAAC,MAAM;IACpC,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE;QACR,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,0BAA0B;KAC3C;IACD,YAAY,EAAE;QACZ,aAAa,EAAE,KAAK;KACrB;CACF,CAAqB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=RadioGroupExperimental.test.d.ts.map
|
|
2
|
+
//# sourceMappingURL=RadioGroupExperimental.test.d.ts.map
|
|
@@ -1,111 +1,69 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { act } from 'react';
|
|
3
3
|
import * as renderer from 'react-test-renderer';
|
|
4
4
|
import { Radio } from '../../Radio/Radio';
|
|
5
5
|
import { RadioGroup } from '../RadioGroup';
|
|
6
6
|
jest.useFakeTimers();
|
|
7
7
|
describe('RadioGroup component tests', () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
);
|
|
8
|
+
it('RadioGroup default', async () => {
|
|
9
|
+
let component;
|
|
10
|
+
act(() => {
|
|
11
|
+
component = renderer.create(_jsxs(RadioGroup, { label: "Uncontrolled RadioGroup", defaultValue: "key2", children: [
|
|
12
|
+
_jsx(Radio, { value: "key1", label: "RadioButton1" }), _jsx(Radio, { value: "key2", label: "RadioButton2" })
|
|
13
|
+
] }));
|
|
14
|
+
});
|
|
15
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
16
|
+
await act(async () => null);
|
|
18
17
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
defaultValue: 'key2',
|
|
29
|
-
children: [
|
|
30
|
-
_jsx(Radio, { value: 'key1', label: 'Radio1', accessibilityPosInSet: 1, accessibilitySetSize: 2 }),
|
|
31
|
-
_jsx(Radio, { value: 'key2', label: 'Radio2', accessibilityPosInSet: 2, accessibilitySetSize: 2 }),
|
|
32
|
-
],
|
|
33
|
-
}),
|
|
34
|
-
);
|
|
18
|
+
it('Radio not direct child of radio group', async () => {
|
|
19
|
+
let component;
|
|
20
|
+
act(() => {
|
|
21
|
+
component = renderer.create(_jsxs(RadioGroup, { label: "Uncontrolled RadioGroup", defaultValue: "key2", children: [
|
|
22
|
+
_jsx(Radio, { value: "key1", label: "Radio1", accessibilityPosInSet: 1, accessibilitySetSize: 2 }), _jsx(Radio, { value: "key2", label: "Radio2", accessibilityPosInSet: 2, accessibilitySetSize: 2 })
|
|
23
|
+
] }));
|
|
24
|
+
});
|
|
25
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
26
|
+
await act(async () => null);
|
|
35
27
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
label: 'Disabled RadioGroup',
|
|
46
|
-
children: [
|
|
47
|
-
_jsx(Radio, { value: 'key1', label: 'Radio1', accessibilityPosInSet: 1, accessibilitySetSize: 2 }),
|
|
48
|
-
_jsx(Radio, { value: 'key2', label: 'Radio2', accessibilityPosInSet: 2, accessibilitySetSize: 2 }),
|
|
49
|
-
],
|
|
50
|
-
}),
|
|
51
|
-
);
|
|
28
|
+
it('RadioGroup disabled', async () => {
|
|
29
|
+
let component;
|
|
30
|
+
act(() => {
|
|
31
|
+
component = renderer.create(_jsxs(RadioGroup, { disabled: true, label: "Disabled RadioGroup", children: [
|
|
32
|
+
_jsx(Radio, { value: "key1", label: "Radio1", accessibilityPosInSet: 1, accessibilitySetSize: 2 }), _jsx(Radio, { value: "key2", label: "Radio2", accessibilityPosInSet: 2, accessibilitySetSize: 2 })
|
|
33
|
+
] }));
|
|
34
|
+
});
|
|
35
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
36
|
+
await act(async () => null);
|
|
52
37
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
label: 'Required RadioGroup',
|
|
63
|
-
defaultValue: 'key2',
|
|
64
|
-
children: [
|
|
65
|
-
_jsx(Radio, { value: 'key1', label: 'Radio1', accessibilityPosInSet: 1, accessibilitySetSize: 2 }),
|
|
66
|
-
_jsx(Radio, { value: 'key2', label: 'Radio2', accessibilityPosInSet: 2, accessibilitySetSize: 2 }),
|
|
67
|
-
],
|
|
68
|
-
}),
|
|
69
|
-
);
|
|
38
|
+
it('RadioGroup required', async () => {
|
|
39
|
+
let component;
|
|
40
|
+
act(() => {
|
|
41
|
+
component = renderer.create(_jsxs(RadioGroup, { required: true, label: "Required RadioGroup", defaultValue: "key2", children: [
|
|
42
|
+
_jsx(Radio, { value: "key1", label: "Radio1", accessibilityPosInSet: 1, accessibilitySetSize: 2 }), _jsx(Radio, { value: "key2", label: "Radio2", accessibilityPosInSet: 2, accessibilitySetSize: 2 })
|
|
43
|
+
] }));
|
|
44
|
+
});
|
|
45
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
46
|
+
await act(async () => null);
|
|
70
47
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
label: 'Horizontal RadioGroup',
|
|
81
|
-
defaultValue: 'key2',
|
|
82
|
-
children: [
|
|
83
|
-
_jsx(Radio, { value: 'key1', label: 'Radio1', accessibilityPosInSet: 1, accessibilitySetSize: 2 }),
|
|
84
|
-
_jsx(Radio, { value: 'key2', label: 'Radio2', accessibilityPosInSet: 2, accessibilitySetSize: 2 }),
|
|
85
|
-
],
|
|
86
|
-
}),
|
|
87
|
-
);
|
|
48
|
+
it('RadioGroup horizontal', async () => {
|
|
49
|
+
let component;
|
|
50
|
+
act(() => {
|
|
51
|
+
component = renderer.create(_jsxs(RadioGroup, { layout: "horizontal", label: "Horizontal RadioGroup", defaultValue: "key2", children: [
|
|
52
|
+
_jsx(Radio, { value: "key1", label: "Radio1", accessibilityPosInSet: 1, accessibilitySetSize: 2 }), _jsx(Radio, { value: "key2", label: "Radio2", accessibilityPosInSet: 2, accessibilitySetSize: 2 })
|
|
53
|
+
] }));
|
|
54
|
+
});
|
|
55
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
56
|
+
await act(async () => null);
|
|
88
57
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
label: 'Horizontal-Stacked RadioGroup',
|
|
99
|
-
defaultValue: 'key2',
|
|
100
|
-
children: [
|
|
101
|
-
_jsx(Radio, { value: 'key1', label: 'Radio1', accessibilityPosInSet: 1, accessibilitySetSize: 2 }),
|
|
102
|
-
_jsx(Radio, { value: 'key2', label: 'Radio2', accessibilityPosInSet: 2, accessibilitySetSize: 2 }),
|
|
103
|
-
],
|
|
104
|
-
}),
|
|
105
|
-
);
|
|
58
|
+
it('RadioGroup horizontal-stacked', async () => {
|
|
59
|
+
let component;
|
|
60
|
+
act(() => {
|
|
61
|
+
component = renderer.create(_jsxs(RadioGroup, { layout: "horizontal-stacked", label: "Horizontal-Stacked RadioGroup", defaultValue: "key2", children: [
|
|
62
|
+
_jsx(Radio, { value: "key1", label: "Radio1", accessibilityPosInSet: 1, accessibilitySetSize: 2 }), _jsx(Radio, { value: "key2", label: "Radio2", accessibilityPosInSet: 2, accessibilitySetSize: 2 })
|
|
63
|
+
] }));
|
|
64
|
+
});
|
|
65
|
+
expect(component.toJSON()).toMatchSnapshot();
|
|
66
|
+
await act(async () => null);
|
|
106
67
|
});
|
|
107
|
-
expect(component.toJSON()).toMatchSnapshot();
|
|
108
|
-
await act(async () => null);
|
|
109
|
-
});
|
|
110
68
|
});
|
|
111
|
-
//# sourceMappingURL=RadioGroupExperimental.test.js.map
|
|
69
|
+
//# sourceMappingURL=RadioGroupExperimental.test.js.map
|
|
@@ -7,4 +7,4 @@ export type RadioGroupContextValue = RadioGroupState;
|
|
|
7
7
|
export declare const RadioGroupContext: React.Context<RadioGroupState>;
|
|
8
8
|
export declare const RadioGroupProvider: React.Provider<RadioGroupState>;
|
|
9
9
|
export declare const useRadioGroupContext: () => RadioGroupState;
|
|
10
|
-
//# sourceMappingURL=radioGroupContext.d.ts.map
|
|
10
|
+
//# sourceMappingURL=radioGroupContext.d.ts.map
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export const RadioGroupContext = React.createContext({
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/* key: string */ {
|
|
9
|
-
return;
|
|
3
|
+
value: null,
|
|
4
|
+
disabled: false,
|
|
5
|
+
layout: 'vertical',
|
|
6
|
+
onChange: ( /* key: string */ /* key: string */) => {
|
|
7
|
+
return;
|
|
10
8
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/* ref: React.RefObject<any>*/ {
|
|
14
|
-
return;
|
|
9
|
+
updateSelectedButtonRef: ( /* ref: React.RefObject<any>*/ /* ref: React.RefObject<any>*/) => {
|
|
10
|
+
return;
|
|
15
11
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
values: [],
|
|
13
|
+
enabledValues: [],
|
|
14
|
+
invoked: false,
|
|
15
|
+
addRadioValue: ( /* value: string */ /* value: string */) => false,
|
|
16
|
+
removeRadioValue: ( /* value: string */ /* value: string */) => false,
|
|
17
|
+
addRadioEnabledValue: ( /* value: string */ /* value: string */) => false,
|
|
18
|
+
removeRadioEnabledValue: ( /* value: string */ /* value: string */) => false,
|
|
23
19
|
});
|
|
24
20
|
export const RadioGroupProvider = RadioGroupContext.Provider;
|
|
25
21
|
export const useRadioGroupContext = () => React.useContext(RadioGroupContext);
|
|
26
|
-
//# sourceMappingURL=radioGroupContext.js.map
|
|
22
|
+
//# sourceMappingURL=radioGroupContext.js.map
|