@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Change Log - @fluentui-react-native/radio-group
|
|
2
2
|
|
|
3
|
+
## 0.22.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0d6e9c1: chore: migrate to `oxfmt`
|
|
8
|
+
- ac6e7af: Ensure packages have a default export that references the typescript entrypoint and clean up build dependency ordering
|
|
9
|
+
- Updated dependencies [f72b43a]
|
|
10
|
+
- Updated dependencies [0d6e9c1]
|
|
11
|
+
- Updated dependencies [ac6e7af]
|
|
12
|
+
- @fluentui-react-native/focus-zone@0.22.1
|
|
13
|
+
- @uifabricshared/foundation-composable@0.14.1
|
|
14
|
+
- @uifabricshared/foundation-settings@0.16.1
|
|
15
|
+
- @uifabricshared/foundation-compose@1.16.1
|
|
16
|
+
- @fluentui-react-native/interactive-hooks@0.28.1
|
|
17
|
+
- @fluentui-react-native/use-styling@0.14.1
|
|
18
|
+
- @fluentui-react-native/pressable@0.13.1
|
|
19
|
+
- @fluentui-react-native/theme-tokens@0.28.1
|
|
20
|
+
- @fluentui-react-native/framework@0.15.1
|
|
21
|
+
- @fluentui-react-native/text@0.25.1
|
|
22
|
+
- @fluentui-react-native/adapters@0.14.1
|
|
23
|
+
- @fluentui-react-native/tokens@0.24.1
|
|
24
|
+
|
|
3
25
|
## 0.22.0
|
|
4
26
|
|
|
5
27
|
### Minor Changes
|
package/lib/Radio/Radio.d.ts
CHANGED
|
@@ -9,10 +9,5 @@ import type { RadioProps } from './Radio.types';
|
|
|
9
9
|
* @returns Whether the styles that are assigned to the layer should be applied to the Radio
|
|
10
10
|
*/
|
|
11
11
|
export declare const radioLookup: (layer: string, state: PressableState, userProps: RadioProps) => boolean;
|
|
12
|
-
export declare const Radio: import(
|
|
13
|
-
|
|
14
|
-
import('./Radio.types').RadioSlotProps,
|
|
15
|
-
import('./Radio.types').RadioTokens,
|
|
16
|
-
import('@fluentui-react-native/framework-base').ObjectBase
|
|
17
|
-
>;
|
|
18
|
-
//# sourceMappingURL=Radio.d.ts.map
|
|
12
|
+
export declare const Radio: import("@fluentui-react-native/framework").ComposableComponent<RadioProps, import("./Radio.types").RadioSlotProps, import("./Radio.types").RadioTokens, import("@fluentui-react-native/framework-base").ObjectBase>;
|
|
13
|
+
//# sourceMappingURL=Radio.d.ts.map
|
package/lib/Radio/Radio.ios.d.ts
CHANGED
|
@@ -9,10 +9,5 @@ import type { RadioProps } from './Radio.types';
|
|
|
9
9
|
* @returns Whether the styles that are assigned to the layer should be applied to the Radio
|
|
10
10
|
*/
|
|
11
11
|
export declare const radioLookup: (layer: string, state: PressableState, userProps: RadioProps) => boolean;
|
|
12
|
-
export declare const Radio: import(
|
|
13
|
-
|
|
14
|
-
import('./Radio.types').RadioSlotProps,
|
|
15
|
-
import('./Radio.types').RadioTokens,
|
|
16
|
-
import('@fluentui-react-native/framework-base').ObjectBase
|
|
17
|
-
>;
|
|
18
|
-
//# sourceMappingURL=Radio.ios.d.ts.map
|
|
12
|
+
export declare const Radio: import("@fluentui-react-native/framework").ComposableComponent<RadioProps, import("./Radio.types").RadioSlotProps, import("./Radio.types").RadioTokens, import("@fluentui-react-native/framework-base").ObjectBase>;
|
|
13
|
+
//# sourceMappingURL=Radio.ios.d.ts.map
|
package/lib/Radio/Radio.ios.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui-react-native/framework-base/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
3
3
|
import { Platform, Pressable, View } from 'react-native';
|
|
4
4
|
import { compose, mergeProps } from '@fluentui-react-native/framework';
|
|
@@ -16,55 +16,36 @@ import { useRadio } from './useRadio';
|
|
|
16
16
|
* @returns Whether the styles that are assigned to the layer should be applied to the Radio
|
|
17
17
|
*/
|
|
18
18
|
export const radioLookup = (layer, state, userProps) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
return (state[layer] ||
|
|
20
|
+
userProps[layer] ||
|
|
21
|
+
(!(Platform.OS === 'win32' || Platform.OS === 'android') &&
|
|
22
|
+
layer === 'labelPositionBelow' &&
|
|
23
|
+
userProps['labelPosition'] === 'below'));
|
|
24
24
|
};
|
|
25
25
|
export const Radio = compose({
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return _jsxs(Slots.root, {
|
|
51
|
-
...mergedProps,
|
|
52
|
-
accessible: !disabled,
|
|
53
|
-
focusable: !disabled,
|
|
54
|
-
children: [
|
|
55
|
-
_jsx(Slots.button, {
|
|
56
|
-
accessible: false,
|
|
57
|
-
onPress: onPress,
|
|
58
|
-
onPressIn: onPressIn,
|
|
59
|
-
onPressOut: onPressOut,
|
|
60
|
-
disabled: disabled,
|
|
61
|
-
focusable: false,
|
|
62
|
-
children: _jsx(Slots.checkmark, { viewBox: '0 0 12 12', children: checkmarkPath }, 'checkmark'),
|
|
63
|
-
}),
|
|
64
|
-
labelComponent,
|
|
65
|
-
],
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
},
|
|
26
|
+
displayName: radioName,
|
|
27
|
+
...stylingSettings,
|
|
28
|
+
slots: {
|
|
29
|
+
root: Pressable,
|
|
30
|
+
button: Pressable,
|
|
31
|
+
checkmark: Svg,
|
|
32
|
+
labelContent: View,
|
|
33
|
+
label: Text,
|
|
34
|
+
subtext: Text,
|
|
35
|
+
},
|
|
36
|
+
useRender: (userProps, useSlots) => {
|
|
37
|
+
const radio = useRadio(userProps);
|
|
38
|
+
const Slots = useSlots(userProps, (layer) => radioLookup(layer, radio.state, radio.props));
|
|
39
|
+
// now return the handler for finishing render
|
|
40
|
+
return (final) => {
|
|
41
|
+
const { label, subtext, ...mergedProps } = mergeProps(radio.props, final);
|
|
42
|
+
const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
|
|
43
|
+
const labelComponent = (_jsxs(Slots.labelContent, { children: [
|
|
44
|
+
_jsx(Slots.label, { children: label }), !!subtext && _jsx(Slots.subtext, { children: subtext })] }));
|
|
45
|
+
const checkmarkPath = (_jsx(Path, { fill: "currentColor", d: "M9.76497 3.20474C10.0661 3.48915 10.0797 3.96383 9.79526 4.26497L5.54526 8.76497C5.40613 8.91228 5.21332 8.99703 5.01071 8.99993C4.8081 9.00282 4.61295 8.92361 4.46967 8.78033L2.21967 6.53033C1.92678 6.23744 1.92678 5.76257 2.21967 5.46967C2.51256 5.17678 2.98744 5.17678 3.28033 5.46967L4.98463 7.17397L8.70474 3.23503C8.98915 2.9339 9.46383 2.92033 9.76497 3.20474Z" }));
|
|
46
|
+
return (_jsxs(Slots.root, { ...mergedProps, accessible: !disabled, focusable: !disabled, children: [
|
|
47
|
+
_jsx(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false, children: _jsx(Slots.checkmark, { viewBox: "0 0 12 12", children: checkmarkPath }, "checkmark") }), labelComponent] }));
|
|
48
|
+
};
|
|
49
|
+
},
|
|
69
50
|
});
|
|
70
|
-
//# sourceMappingURL=Radio.ios.js.map
|
|
51
|
+
//# sourceMappingURL=Radio.ios.js.map
|
package/lib/Radio/Radio.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui-react-native/framework-base/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
3
3
|
import { Platform, Pressable, View } from 'react-native';
|
|
4
4
|
import { compose, mergeProps } from '@fluentui-react-native/framework';
|
|
@@ -15,51 +15,36 @@ import { useRadio } from './useRadio';
|
|
|
15
15
|
* @returns Whether the styles that are assigned to the layer should be applied to the Radio
|
|
16
16
|
*/
|
|
17
17
|
export const radioLookup = (layer, state, userProps) => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
return (state[layer] ||
|
|
19
|
+
userProps[layer] ||
|
|
20
|
+
(!(Platform.OS === 'win32' || Platform.OS === 'android') &&
|
|
21
|
+
layer === 'labelPositionBelow' &&
|
|
22
|
+
userProps['labelPosition'] === 'below'));
|
|
23
23
|
};
|
|
24
24
|
export const Radio = compose({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
children: [
|
|
50
|
-
_jsx(Slots.button, {
|
|
51
|
-
accessible: false,
|
|
52
|
-
onPress: onPress,
|
|
53
|
-
onPressIn: onPressIn,
|
|
54
|
-
onPressOut: onPressOut,
|
|
55
|
-
disabled: disabled,
|
|
56
|
-
focusable: false,
|
|
57
|
-
children: _jsx(Slots.innerCircle, {}),
|
|
58
|
-
}),
|
|
59
|
-
labelComponent,
|
|
60
|
-
],
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
},
|
|
25
|
+
displayName: radioName,
|
|
26
|
+
...stylingSettings,
|
|
27
|
+
slots: {
|
|
28
|
+
root: Pressable,
|
|
29
|
+
button: Pressable,
|
|
30
|
+
innerCircle: View,
|
|
31
|
+
labelContent: View,
|
|
32
|
+
label: Text,
|
|
33
|
+
subtext: Text,
|
|
34
|
+
},
|
|
35
|
+
useRender: (userProps, useSlots) => {
|
|
36
|
+
const radio = useRadio(userProps);
|
|
37
|
+
const Slots = useSlots(userProps, (layer) => radioLookup(layer, radio.state, radio.props));
|
|
38
|
+
// now return the handler for finishing render
|
|
39
|
+
return (final) => {
|
|
40
|
+
const { label, subtext, ...mergedProps } = mergeProps(radio.props, final);
|
|
41
|
+
const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
|
|
42
|
+
const isMobile = Platform.OS === 'android' || Platform.OS === 'ios';
|
|
43
|
+
const labelComponent = (_jsxs(Slots.labelContent, { children: [
|
|
44
|
+
_jsx(Slots.label, { children: label }), !!subtext && _jsx(Slots.subtext, { children: subtext })] }));
|
|
45
|
+
return (_jsxs(Slots.root, { ...mergedProps, ...(isMobile && { accessible: !disabled, focusable: !disabled }), children: [
|
|
46
|
+
_jsx(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false, children: _jsx(Slots.innerCircle, {}) }), labelComponent] }));
|
|
47
|
+
};
|
|
48
|
+
},
|
|
64
49
|
});
|
|
65
|
-
//# sourceMappingURL=Radio.js.map
|
|
50
|
+
//# sourceMappingURL=Radio.js.map
|
|
@@ -2,4 +2,4 @@ import type { UseStylingOptions } from '@fluentui-react-native/framework';
|
|
|
2
2
|
import type { RadioTokens, RadioSlotProps, RadioProps } from './Radio.types';
|
|
3
3
|
export declare const radioStates: (keyof RadioTokens)[];
|
|
4
4
|
export declare const stylingSettings: UseStylingOptions<RadioProps, RadioSlotProps, RadioTokens>;
|
|
5
|
-
//# sourceMappingURL=Radio.styling.d.ts.map
|
|
5
|
+
//# sourceMappingURL=Radio.styling.d.ts.map
|
|
@@ -4,113 +4,92 @@ import { radioName } from './Radio.types';
|
|
|
4
4
|
import { defaultRadioTokens } from './RadioTokens';
|
|
5
5
|
export const radioStates = ['labelPositionBelow', 'focused', 'hovered', 'pressed', 'selected', 'disabled'];
|
|
6
6
|
export const stylingSettings = {
|
|
7
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
marginVertical: tokens.labelMarginVertical,
|
|
95
|
-
marginHorizontal: 2,
|
|
96
|
-
color: tokens.color,
|
|
97
|
-
...fontStyles.from(tokens, theme),
|
|
98
|
-
},
|
|
99
|
-
}),
|
|
100
|
-
['variant', 'labelMarginVertical', 'color', ...fontStyles.keys],
|
|
101
|
-
),
|
|
102
|
-
subtext: buildProps(
|
|
103
|
-
(tokens) => ({
|
|
104
|
-
variant: tokens.subtextVariant,
|
|
105
|
-
style: {
|
|
106
|
-
marginTop: tokens.subtextMarginTop,
|
|
107
|
-
marginBottom: tokens.subtextMarginBottom,
|
|
108
|
-
marginHorizontal: 2,
|
|
109
|
-
color: tokens.color,
|
|
110
|
-
},
|
|
111
|
-
}),
|
|
112
|
-
['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant'],
|
|
113
|
-
),
|
|
114
|
-
},
|
|
7
|
+
tokens: [defaultRadioTokens, radioName],
|
|
8
|
+
states: radioStates,
|
|
9
|
+
slotProps: {
|
|
10
|
+
root: buildProps((tokens) => ({
|
|
11
|
+
style: {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
alignItems: tokens.alignItems,
|
|
14
|
+
flexDirection: tokens.flexDirection,
|
|
15
|
+
paddingHorizontal: tokens.rootHorizontalPadding,
|
|
16
|
+
paddingVertical: tokens.rootVerticalPadding,
|
|
17
|
+
},
|
|
18
|
+
android_ripple: { color: tokens.rippleColor },
|
|
19
|
+
}), ['flexDirection', 'rootHorizontalPadding', 'rootVerticalPadding', 'rippleColor', 'alignItems']),
|
|
20
|
+
button: buildProps((tokens) => ({
|
|
21
|
+
style: {
|
|
22
|
+
backgroundColor: tokens.radioOuterCircleBackground,
|
|
23
|
+
width: tokens.radioOuterCircleSize,
|
|
24
|
+
height: tokens.radioOuterCircleSize,
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
borderWidth: tokens.radioBorderWidth,
|
|
28
|
+
borderStyle: tokens.radioBorderStyle,
|
|
29
|
+
borderRadius: tokens.radioOuterCircleSize / 2,
|
|
30
|
+
borderColor: tokens.radioBorder,
|
|
31
|
+
marginTop: tokens.marginTop,
|
|
32
|
+
marginRight: tokens.marginRight,
|
|
33
|
+
marginBottom: tokens.marginBottom,
|
|
34
|
+
marginLeft: tokens.marginLeft,
|
|
35
|
+
},
|
|
36
|
+
android_ripple: { color: tokens.rippleColor, radius: tokens.rippleRadius, borderless: true },
|
|
37
|
+
}), [
|
|
38
|
+
'radioOuterCircleBackground',
|
|
39
|
+
'radioBorderWidth',
|
|
40
|
+
'radioBorderStyle',
|
|
41
|
+
'radioOuterCircleSize',
|
|
42
|
+
'rippleColor',
|
|
43
|
+
'rippleRadius',
|
|
44
|
+
'radioBorder',
|
|
45
|
+
'marginTop',
|
|
46
|
+
'marginRight',
|
|
47
|
+
'marginBottom',
|
|
48
|
+
'marginLeft',
|
|
49
|
+
]),
|
|
50
|
+
innerCircle: buildProps((tokens) => ({
|
|
51
|
+
style: {
|
|
52
|
+
opacity: tokens.radioVisibility,
|
|
53
|
+
borderRadius: tokens.radioInnerCircleSize / 2,
|
|
54
|
+
height: tokens.radioInnerCircleSize,
|
|
55
|
+
width: tokens.radioInnerCircleSize,
|
|
56
|
+
backgroundColor: tokens.radioFill,
|
|
57
|
+
},
|
|
58
|
+
}), ['radioInnerCircleSize', 'radioVisibility', 'radioFill']),
|
|
59
|
+
labelContent: buildProps((tokens, theme) => ({
|
|
60
|
+
style: {
|
|
61
|
+
alignItems: tokens.labelAlignItems,
|
|
62
|
+
flexDirection: 'column',
|
|
63
|
+
marginRight: tokens.labelMarginRight,
|
|
64
|
+
marginLeft: tokens.labelMarginLeft,
|
|
65
|
+
padding: tokens.labelPadding,
|
|
66
|
+
paddingRight: 0,
|
|
67
|
+
...borderStyles.from(tokens, theme),
|
|
68
|
+
},
|
|
69
|
+
}), ['labelAlignItems', 'labelMarginRight', 'labelMarginLeft', 'labelPadding', ...borderStyles.keys]),
|
|
70
|
+
checkmark: buildProps((tokens) => ({
|
|
71
|
+
style: {
|
|
72
|
+
opacity: tokens.radioVisibility,
|
|
73
|
+
},
|
|
74
|
+
}), ['radioVisibility']),
|
|
75
|
+
label: buildProps((tokens, theme) => ({
|
|
76
|
+
variant: tokens.variant,
|
|
77
|
+
style: {
|
|
78
|
+
marginVertical: tokens.labelMarginVertical,
|
|
79
|
+
marginHorizontal: 2,
|
|
80
|
+
color: tokens.color,
|
|
81
|
+
...fontStyles.from(tokens, theme),
|
|
82
|
+
},
|
|
83
|
+
}), ['variant', 'labelMarginVertical', 'color', ...fontStyles.keys]),
|
|
84
|
+
subtext: buildProps((tokens) => ({
|
|
85
|
+
variant: tokens.subtextVariant,
|
|
86
|
+
style: {
|
|
87
|
+
marginTop: tokens.subtextMarginTop,
|
|
88
|
+
marginBottom: tokens.subtextMarginBottom,
|
|
89
|
+
marginHorizontal: 2,
|
|
90
|
+
color: tokens.color,
|
|
91
|
+
},
|
|
92
|
+
}), ['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant']),
|
|
93
|
+
},
|
|
115
94
|
};
|
|
116
|
-
//# sourceMappingURL=Radio.styling.js.map
|
|
95
|
+
//# sourceMappingURL=Radio.styling.js.map
|