@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
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Radio = exports.radioLookup = void 0;
|
|
4
|
-
const jsx_runtime_1 = require(
|
|
4
|
+
const jsx_runtime_1 = require("@fluentui-react-native/framework-base/jsx-runtime");
|
|
5
5
|
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
6
|
-
const react_native_1 = require(
|
|
7
|
-
const framework_1 = require(
|
|
8
|
-
const text_1 = require(
|
|
9
|
-
const react_native_svg_1 = require(
|
|
10
|
-
const Radio_styling_1 = require(
|
|
11
|
-
const Radio_types_1 = require(
|
|
12
|
-
const useRadio_1 = require(
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
const framework_1 = require("@fluentui-react-native/framework");
|
|
8
|
+
const text_1 = require("@fluentui-react-native/text");
|
|
9
|
+
const react_native_svg_1 = require("react-native-svg");
|
|
10
|
+
const Radio_styling_1 = require("./Radio.styling");
|
|
11
|
+
const Radio_types_1 = require("./Radio.types");
|
|
12
|
+
const useRadio_1 = require("./useRadio");
|
|
13
13
|
/**
|
|
14
14
|
* A function which determines if a set of styles should be applied to the component given the current state and props of the Radio.
|
|
15
15
|
*
|
|
@@ -19,61 +19,37 @@ const useRadio_1 = require('./useRadio');
|
|
|
19
19
|
* @returns Whether the styles that are assigned to the layer should be applied to the Radio
|
|
20
20
|
*/
|
|
21
21
|
const radioLookup = (layer, state, userProps) => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
userProps['labelPosition'] === 'below')
|
|
28
|
-
);
|
|
22
|
+
return (state[layer] ||
|
|
23
|
+
userProps[layer] ||
|
|
24
|
+
(!(react_native_1.Platform.OS === 'win32' || react_native_1.Platform.OS === 'android') &&
|
|
25
|
+
layer === 'labelPositionBelow' &&
|
|
26
|
+
userProps['labelPosition'] === 'below'));
|
|
29
27
|
};
|
|
30
28
|
exports.radioLookup = radioLookup;
|
|
31
29
|
exports.Radio = (0, framework_1.compose)({
|
|
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
|
-
fill: 'currentColor',
|
|
57
|
-
d: 'M9.76497 3.20474C10.0661 3.48915 10.0797 3.96383 9.79526 4.26497L5.54526 8.76497C5.40613 8.91228 5.21332 8.99703 5.01071 8.99993C4.8081 9.00282 4.61295 8.92361 4.46967 8.78033L2.21967 6.53033C1.92678 6.23744 1.92678 5.76257 2.21967 5.46967C2.51256 5.17678 2.98744 5.17678 3.28033 5.46967L4.98463 7.17397L8.70474 3.23503C8.98915 2.9339 9.46383 2.92033 9.76497 3.20474Z',
|
|
58
|
-
});
|
|
59
|
-
return jsx_runtime_1.jsxs(Slots.root, {
|
|
60
|
-
...mergedProps,
|
|
61
|
-
accessible: !disabled,
|
|
62
|
-
focusable: !disabled,
|
|
63
|
-
children: [
|
|
64
|
-
jsx_runtime_1.jsx(Slots.button, {
|
|
65
|
-
accessible: false,
|
|
66
|
-
onPress: onPress,
|
|
67
|
-
onPressIn: onPressIn,
|
|
68
|
-
onPressOut: onPressOut,
|
|
69
|
-
disabled: disabled,
|
|
70
|
-
focusable: false,
|
|
71
|
-
children: jsx_runtime_1.jsx(Slots.checkmark, { viewBox: '0 0 12 12', children: checkmarkPath }, 'checkmark'),
|
|
72
|
-
}),
|
|
73
|
-
labelComponent,
|
|
74
|
-
],
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
},
|
|
30
|
+
displayName: Radio_types_1.radioName,
|
|
31
|
+
...Radio_styling_1.stylingSettings,
|
|
32
|
+
slots: {
|
|
33
|
+
root: react_native_1.Pressable,
|
|
34
|
+
button: react_native_1.Pressable,
|
|
35
|
+
checkmark: react_native_svg_1.Svg,
|
|
36
|
+
labelContent: react_native_1.View,
|
|
37
|
+
label: text_1.TextV1,
|
|
38
|
+
subtext: text_1.TextV1,
|
|
39
|
+
},
|
|
40
|
+
useRender: (userProps, useSlots) => {
|
|
41
|
+
const radio = (0, useRadio_1.useRadio)(userProps);
|
|
42
|
+
const Slots = useSlots(userProps, (layer) => (0, exports.radioLookup)(layer, radio.state, radio.props));
|
|
43
|
+
// now return the handler for finishing render
|
|
44
|
+
return (final) => {
|
|
45
|
+
const { label, subtext, ...mergedProps } = (0, framework_1.mergeProps)(radio.props, final);
|
|
46
|
+
const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
|
|
47
|
+
const labelComponent = (jsx_runtime_1.jsxs(Slots.labelContent, { children: [
|
|
48
|
+
jsx_runtime_1.jsx(Slots.label, { children: label }), !!subtext && jsx_runtime_1.jsx(Slots.subtext, { children: subtext })] }));
|
|
49
|
+
const checkmarkPath = (jsx_runtime_1.jsx(react_native_svg_1.Path, { fill: "currentColor", d: "M9.76497 3.20474C10.0661 3.48915 10.0797 3.96383 9.79526 4.26497L5.54526 8.76497C5.40613 8.91228 5.21332 8.99703 5.01071 8.99993C4.8081 9.00282 4.61295 8.92361 4.46967 8.78033L2.21967 6.53033C1.92678 6.23744 1.92678 5.76257 2.21967 5.46967C2.51256 5.17678 2.98744 5.17678 3.28033 5.46967L4.98463 7.17397L8.70474 3.23503C8.98915 2.9339 9.46383 2.92033 9.76497 3.20474Z" }));
|
|
50
|
+
return (jsx_runtime_1.jsxs(Slots.root, { ...mergedProps, accessible: !disabled, focusable: !disabled, children: [
|
|
51
|
+
jsx_runtime_1.jsx(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false, children: jsx_runtime_1.jsx(Slots.checkmark, { viewBox: "0 0 12 12", children: checkmarkPath }, "checkmark") }), labelComponent] }));
|
|
52
|
+
};
|
|
53
|
+
},
|
|
78
54
|
});
|
|
79
|
-
//# sourceMappingURL=Radio.ios.js.map
|
|
55
|
+
//# sourceMappingURL=Radio.ios.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Radio = exports.radioLookup = void 0;
|
|
4
|
-
const jsx_runtime_1 = require(
|
|
4
|
+
const jsx_runtime_1 = require("@fluentui-react-native/framework-base/jsx-runtime");
|
|
5
5
|
/** @jsxImportSource @fluentui-react-native/framework-base */
|
|
6
|
-
const react_native_1 = require(
|
|
7
|
-
const framework_1 = require(
|
|
8
|
-
const text_1 = require(
|
|
9
|
-
const Radio_styling_1 = require(
|
|
10
|
-
const Radio_types_1 = require(
|
|
11
|
-
const useRadio_1 = require(
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
const framework_1 = require("@fluentui-react-native/framework");
|
|
8
|
+
const text_1 = require("@fluentui-react-native/text");
|
|
9
|
+
const Radio_styling_1 = require("./Radio.styling");
|
|
10
|
+
const Radio_types_1 = require("./Radio.types");
|
|
11
|
+
const useRadio_1 = require("./useRadio");
|
|
12
12
|
/**
|
|
13
13
|
* A function which determines if a set of styles should be applied to the component given the current state and props of the Radio.
|
|
14
14
|
*
|
|
@@ -18,57 +18,37 @@ const useRadio_1 = require('./useRadio');
|
|
|
18
18
|
* @returns Whether the styles that are assigned to the layer should be applied to the Radio
|
|
19
19
|
*/
|
|
20
20
|
const radioLookup = (layer, state, userProps) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
userProps['labelPosition'] === 'below')
|
|
27
|
-
);
|
|
21
|
+
return (state[layer] ||
|
|
22
|
+
userProps[layer] ||
|
|
23
|
+
(!(react_native_1.Platform.OS === 'win32' || react_native_1.Platform.OS === 'android') &&
|
|
24
|
+
layer === 'labelPositionBelow' &&
|
|
25
|
+
userProps['labelPosition'] === 'below'));
|
|
28
26
|
};
|
|
29
27
|
exports.radioLookup = radioLookup;
|
|
30
28
|
exports.Radio = (0, framework_1.compose)({
|
|
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
|
-
return jsx_runtime_1.jsxs(Slots.root, {
|
|
56
|
-
...mergedProps,
|
|
57
|
-
...(isMobile && { accessible: !disabled, focusable: !disabled }),
|
|
58
|
-
children: [
|
|
59
|
-
jsx_runtime_1.jsx(Slots.button, {
|
|
60
|
-
accessible: false,
|
|
61
|
-
onPress: onPress,
|
|
62
|
-
onPressIn: onPressIn,
|
|
63
|
-
onPressOut: onPressOut,
|
|
64
|
-
disabled: disabled,
|
|
65
|
-
focusable: false,
|
|
66
|
-
children: jsx_runtime_1.jsx(Slots.innerCircle, {}),
|
|
67
|
-
}),
|
|
68
|
-
labelComponent,
|
|
69
|
-
],
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
},
|
|
29
|
+
displayName: Radio_types_1.radioName,
|
|
30
|
+
...Radio_styling_1.stylingSettings,
|
|
31
|
+
slots: {
|
|
32
|
+
root: react_native_1.Pressable,
|
|
33
|
+
button: react_native_1.Pressable,
|
|
34
|
+
innerCircle: react_native_1.View,
|
|
35
|
+
labelContent: react_native_1.View,
|
|
36
|
+
label: text_1.TextV1,
|
|
37
|
+
subtext: text_1.TextV1,
|
|
38
|
+
},
|
|
39
|
+
useRender: (userProps, useSlots) => {
|
|
40
|
+
const radio = (0, useRadio_1.useRadio)(userProps);
|
|
41
|
+
const Slots = useSlots(userProps, (layer) => (0, exports.radioLookup)(layer, radio.state, radio.props));
|
|
42
|
+
// now return the handler for finishing render
|
|
43
|
+
return (final) => {
|
|
44
|
+
const { label, subtext, ...mergedProps } = (0, framework_1.mergeProps)(radio.props, final);
|
|
45
|
+
const { onPress, disabled, onPressIn, onPressOut } = mergedProps;
|
|
46
|
+
const isMobile = react_native_1.Platform.OS === 'android' || react_native_1.Platform.OS === 'ios';
|
|
47
|
+
const labelComponent = (jsx_runtime_1.jsxs(Slots.labelContent, { children: [
|
|
48
|
+
jsx_runtime_1.jsx(Slots.label, { children: label }), !!subtext && jsx_runtime_1.jsx(Slots.subtext, { children: subtext })] }));
|
|
49
|
+
return (jsx_runtime_1.jsxs(Slots.root, { ...mergedProps, ...(isMobile && { accessible: !disabled, focusable: !disabled }), children: [
|
|
50
|
+
jsx_runtime_1.jsx(Slots.button, { accessible: false, onPress: onPress, onPressIn: onPressIn, onPressOut: onPressOut, disabled: disabled, focusable: false, children: jsx_runtime_1.jsx(Slots.innerCircle, {}) }), labelComponent] }));
|
|
51
|
+
};
|
|
52
|
+
},
|
|
73
53
|
});
|
|
74
|
-
//# sourceMappingURL=Radio.js.map
|
|
54
|
+
//# 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
|
|
@@ -1,119 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports,
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stylingSettings = exports.radioStates = void 0;
|
|
4
|
-
const framework_1 = require(
|
|
5
|
-
const tokens_1 = require(
|
|
6
|
-
const Radio_types_1 = require(
|
|
7
|
-
const RadioTokens_1 = require(
|
|
4
|
+
const framework_1 = require("@fluentui-react-native/framework");
|
|
5
|
+
const tokens_1 = require("@fluentui-react-native/tokens");
|
|
6
|
+
const Radio_types_1 = require("./Radio.types");
|
|
7
|
+
const RadioTokens_1 = require("./RadioTokens");
|
|
8
8
|
exports.radioStates = ['labelPositionBelow', 'focused', 'hovered', 'pressed', 'selected', 'disabled'];
|
|
9
9
|
exports.stylingSettings = {
|
|
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
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
marginVertical: tokens.labelMarginVertical,
|
|
98
|
-
marginHorizontal: 2,
|
|
99
|
-
color: tokens.color,
|
|
100
|
-
...tokens_1.fontStyles.from(tokens, theme),
|
|
101
|
-
},
|
|
102
|
-
}),
|
|
103
|
-
['variant', 'labelMarginVertical', 'color', ...tokens_1.fontStyles.keys],
|
|
104
|
-
),
|
|
105
|
-
subtext: (0, framework_1.buildProps)(
|
|
106
|
-
(tokens) => ({
|
|
107
|
-
variant: tokens.subtextVariant,
|
|
108
|
-
style: {
|
|
109
|
-
marginTop: tokens.subtextMarginTop,
|
|
110
|
-
marginBottom: tokens.subtextMarginBottom,
|
|
111
|
-
marginHorizontal: 2,
|
|
112
|
-
color: tokens.color,
|
|
113
|
-
},
|
|
114
|
-
}),
|
|
115
|
-
['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant'],
|
|
116
|
-
),
|
|
117
|
-
},
|
|
10
|
+
tokens: [RadioTokens_1.defaultRadioTokens, Radio_types_1.radioName],
|
|
11
|
+
states: exports.radioStates,
|
|
12
|
+
slotProps: {
|
|
13
|
+
root: (0, framework_1.buildProps)((tokens) => ({
|
|
14
|
+
style: {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
alignItems: tokens.alignItems,
|
|
17
|
+
flexDirection: tokens.flexDirection,
|
|
18
|
+
paddingHorizontal: tokens.rootHorizontalPadding,
|
|
19
|
+
paddingVertical: tokens.rootVerticalPadding,
|
|
20
|
+
},
|
|
21
|
+
android_ripple: { color: tokens.rippleColor },
|
|
22
|
+
}), ['flexDirection', 'rootHorizontalPadding', 'rootVerticalPadding', 'rippleColor', 'alignItems']),
|
|
23
|
+
button: (0, framework_1.buildProps)((tokens) => ({
|
|
24
|
+
style: {
|
|
25
|
+
backgroundColor: tokens.radioOuterCircleBackground,
|
|
26
|
+
width: tokens.radioOuterCircleSize,
|
|
27
|
+
height: tokens.radioOuterCircleSize,
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
justifyContent: 'center',
|
|
30
|
+
borderWidth: tokens.radioBorderWidth,
|
|
31
|
+
borderStyle: tokens.radioBorderStyle,
|
|
32
|
+
borderRadius: tokens.radioOuterCircleSize / 2,
|
|
33
|
+
borderColor: tokens.radioBorder,
|
|
34
|
+
marginTop: tokens.marginTop,
|
|
35
|
+
marginRight: tokens.marginRight,
|
|
36
|
+
marginBottom: tokens.marginBottom,
|
|
37
|
+
marginLeft: tokens.marginLeft,
|
|
38
|
+
},
|
|
39
|
+
android_ripple: { color: tokens.rippleColor, radius: tokens.rippleRadius, borderless: true },
|
|
40
|
+
}), [
|
|
41
|
+
'radioOuterCircleBackground',
|
|
42
|
+
'radioBorderWidth',
|
|
43
|
+
'radioBorderStyle',
|
|
44
|
+
'radioOuterCircleSize',
|
|
45
|
+
'rippleColor',
|
|
46
|
+
'rippleRadius',
|
|
47
|
+
'radioBorder',
|
|
48
|
+
'marginTop',
|
|
49
|
+
'marginRight',
|
|
50
|
+
'marginBottom',
|
|
51
|
+
'marginLeft',
|
|
52
|
+
]),
|
|
53
|
+
innerCircle: (0, framework_1.buildProps)((tokens) => ({
|
|
54
|
+
style: {
|
|
55
|
+
opacity: tokens.radioVisibility,
|
|
56
|
+
borderRadius: tokens.radioInnerCircleSize / 2,
|
|
57
|
+
height: tokens.radioInnerCircleSize,
|
|
58
|
+
width: tokens.radioInnerCircleSize,
|
|
59
|
+
backgroundColor: tokens.radioFill,
|
|
60
|
+
},
|
|
61
|
+
}), ['radioInnerCircleSize', 'radioVisibility', 'radioFill']),
|
|
62
|
+
labelContent: (0, framework_1.buildProps)((tokens, theme) => ({
|
|
63
|
+
style: {
|
|
64
|
+
alignItems: tokens.labelAlignItems,
|
|
65
|
+
flexDirection: 'column',
|
|
66
|
+
marginRight: tokens.labelMarginRight,
|
|
67
|
+
marginLeft: tokens.labelMarginLeft,
|
|
68
|
+
padding: tokens.labelPadding,
|
|
69
|
+
paddingRight: 0,
|
|
70
|
+
...tokens_1.borderStyles.from(tokens, theme),
|
|
71
|
+
},
|
|
72
|
+
}), ['labelAlignItems', 'labelMarginRight', 'labelMarginLeft', 'labelPadding', ...tokens_1.borderStyles.keys]),
|
|
73
|
+
checkmark: (0, framework_1.buildProps)((tokens) => ({
|
|
74
|
+
style: {
|
|
75
|
+
opacity: tokens.radioVisibility,
|
|
76
|
+
},
|
|
77
|
+
}), ['radioVisibility']),
|
|
78
|
+
label: (0, framework_1.buildProps)((tokens, theme) => ({
|
|
79
|
+
variant: tokens.variant,
|
|
80
|
+
style: {
|
|
81
|
+
marginVertical: tokens.labelMarginVertical,
|
|
82
|
+
marginHorizontal: 2,
|
|
83
|
+
color: tokens.color,
|
|
84
|
+
...tokens_1.fontStyles.from(tokens, theme),
|
|
85
|
+
},
|
|
86
|
+
}), ['variant', 'labelMarginVertical', 'color', ...tokens_1.fontStyles.keys]),
|
|
87
|
+
subtext: (0, framework_1.buildProps)((tokens) => ({
|
|
88
|
+
variant: tokens.subtextVariant,
|
|
89
|
+
style: {
|
|
90
|
+
marginTop: tokens.subtextMarginTop,
|
|
91
|
+
marginBottom: tokens.subtextMarginBottom,
|
|
92
|
+
marginHorizontal: 2,
|
|
93
|
+
color: tokens.color,
|
|
94
|
+
},
|
|
95
|
+
}), ['subtextMarginTop', 'subtextMarginBottom', 'color', 'subtextVariant']),
|
|
96
|
+
},
|
|
118
97
|
};
|
|
119
|
-
//# sourceMappingURL=Radio.styling.js.map
|
|
98
|
+
//# sourceMappingURL=Radio.styling.js.map
|