krl-alfred 2.23.18 → 2.23.19
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/dist/components/RadioButton/layouts/basic/Basic.d.ts +1 -1
- package/dist/components/RadioButton/layouts/basic/Basic.js +10 -2
- package/dist/components/RadioButton/layouts/basic/Basic.styled.js +3 -2
- package/dist/components/RadioButton/layouts/boxed/Boxed.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxed/Boxed.js +10 -2
- package/dist/components/RadioButton/layouts/boxed/Boxed.styled.js +3 -2
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.js +10 -2
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.styled.js +3 -2
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.js +10 -2
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.styled.js +3 -2
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.js +9 -2
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.styled.js +2 -1
- package/dist/components/RadioButton/layouts/color/Color.d.ts +1 -1
- package/dist/components/RadioButton/layouts/color/Color.js +10 -2
- package/dist/components/RadioButton/layouts/color/Color.styled.d.ts +1 -0
- package/dist/components/RadioButton/layouts/color/Color.styled.js +2 -1
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.js +10 -2
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.styled.d.ts +3 -2
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.styled.js +4 -3
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.test.js +17 -0
- package/dist/components/RadioButton/props.d.ts +3 -0
- package/dist/components/RadioButton/props.js +1 -0
- package/dist/components/RadioButton/stories/RadioButton.stories.d.ts +17 -0
- package/dist/components/RadioButton/stories/RadioButton.stories.js +16 -1
- package/dist/components/RadioButton/utils/radioInteraction.d.ts +35 -0
- package/dist/components/RadioButton/utils/radioInteraction.js +57 -0
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.test.js +6 -0
- package/dist/components/RadioGroup/props.d.ts +2 -0
- package/dist/components/RadioGroup/stories/RadioGroup.stories.d.ts +94 -0
- package/dist/components/RadioGroup/stories/RadioGroup.stories.js +7 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const Basic: ({ value, checked, onChange, onClick, name, id, label, disabled, size, description, valid, labelOffset, hasNoneClick, alignment, textSize, verticalAlign, isWrapText, readOnly, showIndicator, }: RadioButtonProps) => React.JSX.Element;
|
|
3
|
+
declare const Basic: ({ value, checked, onChange, onClick, name, id, label, disabled, size, description, valid, labelOffset, hasNoneClick, alignment, textSize, verticalAlign, isWrapText, readOnly, isCheckable, showIndicator, }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default Basic;
|
|
@@ -15,8 +15,15 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
var props_1 = require("./../../props");
|
|
16
16
|
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
17
17
|
var Basic_styled_1 = require("./Basic.styled");
|
|
18
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
18
19
|
var Basic = function (_a) {
|
|
19
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, _b = _a.id, id = _b === void 0 ? props_1.BasicDefault.id : _b, label = _a.label, disabled = _a.disabled, _c = _a.size, size = _c === void 0 ? props_1.BasicDefault.size : _c, description = _a.description, _d = _a.valid, valid = _d === void 0 ? props_1.BasicDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BasicDefault.labelOffset : _e, _f = _a.hasNoneClick, hasNoneClick = _f === void 0 ? props_1.BasicDefault.hasNoneClick : _f, _g = _a.alignment, alignment = _g === void 0 ? props_1.BasicDefault.alignment : _g, _h = _a.textSize, textSize = _h === void 0 ? props_1.BasicDefault.textSize : _h, _j = _a.verticalAlign, verticalAlign = _j === void 0 ? props_1.BasicDefault.verticalAlign : _j, isWrapText = _a.isWrapText, readOnly = _a.readOnly, _k = _a.showIndicator, showIndicator =
|
|
20
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, _b = _a.id, id = _b === void 0 ? props_1.BasicDefault.id : _b, label = _a.label, disabled = _a.disabled, _c = _a.size, size = _c === void 0 ? props_1.BasicDefault.size : _c, description = _a.description, _d = _a.valid, valid = _d === void 0 ? props_1.BasicDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BasicDefault.labelOffset : _e, _f = _a.hasNoneClick, hasNoneClick = _f === void 0 ? props_1.BasicDefault.hasNoneClick : _f, _g = _a.alignment, alignment = _g === void 0 ? props_1.BasicDefault.alignment : _g, _h = _a.textSize, textSize = _h === void 0 ? props_1.BasicDefault.textSize : _h, _j = _a.verticalAlign, verticalAlign = _j === void 0 ? props_1.BasicDefault.verticalAlign : _j, isWrapText = _a.isWrapText, readOnly = _a.readOnly, _k = _a.isCheckable, isCheckable = _k === void 0 ? true : _k, _l = _a.showIndicator, showIndicator = _l === void 0 ? true : _l;
|
|
21
|
+
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
22
|
+
isCheckable: isCheckable,
|
|
23
|
+
readOnly: readOnly,
|
|
24
|
+
onChange: onChange,
|
|
25
|
+
onClick: onClick,
|
|
26
|
+
});
|
|
20
27
|
var styledProps = {
|
|
21
28
|
$disabled: disabled,
|
|
22
29
|
$checked: checked,
|
|
@@ -26,11 +33,12 @@ var Basic = function (_a) {
|
|
|
26
33
|
$hasNoneClick: hasNoneClick,
|
|
27
34
|
$isWrapText: isWrapText,
|
|
28
35
|
$readOnly: readOnly,
|
|
36
|
+
$isCheckable: isCheckable,
|
|
29
37
|
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
30
38
|
$alignment: alignment,
|
|
31
39
|
$textSize: textSize,
|
|
32
40
|
$verticalAlign: verticalAlign,
|
|
33
41
|
};
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)(Basic_styled_1.BasicStyled, __assign({
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(Basic_styled_1.BasicStyled, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked }, inputInteraction)), showIndicator && (0, jsx_runtime_1.jsx)(Basic_styled_1.Indicator, __assign({}, styledProps)), (label || description) && ((0, jsx_runtime_1.jsxs)(Basic_styled_1.LabelsWrapper, __assign({}, styledProps, { children: [label && ((0, jsx_runtime_1.jsx)(Basic_styled_1.LabelText, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: label }))), description && ((0, jsx_runtime_1.jsx)(Basic_styled_1.DescriptionText, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), { children: description })))] })))] })));
|
|
35
43
|
};
|
|
36
44
|
exports.default = Basic;
|
|
@@ -12,6 +12,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
12
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
13
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
14
|
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
15
16
|
exports.Indicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 0 0 auto;\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: relative;\n margin: ", " ", " 0 0;\n width: ", ";\n height: ", ";\n"], ["\n flex: 0 0 auto;\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: relative;\n margin: ", " ", " 0 0;\n width: ", ";\n height: ", ";\n"])), function (props) { return props.$disabled ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#C2C3CE", name: "RadioButtonElementDisabled" })) : (props.$valid ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#9763F6", name: "RadioButtonElementUnchecked" })) : (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#FF1F1F", name: "RadioButtonElementInvalid" }))); }, function (props) { return props.$alignment === "vertical" ? "0.5rem" : props.$verticalAlign === "flex-start" ? "1px" : 0; }, function (props) { return props.$labelOffset; }, function (props) {
|
|
16
17
|
switch (props.$size) {
|
|
17
18
|
case 'xsmall':
|
|
@@ -35,7 +36,7 @@ exports.Indicator = styled_components_1.default.div(templateObject_1 || (templat
|
|
|
35
36
|
return "16px";
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
|
-
exports.LabelsWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n display: grid;\n row-gap: 8px;\n cursor: ", ";\n margin: 0;\n padding: ", ";\n color: ", ";\n ", "\n"], ["\n position: relative;\n display: grid;\n row-gap: 8px;\n cursor: ", ";\n margin: 0;\n padding: ", ";\n color: ", ";\n ", "\n"])), function (props) { return (
|
|
39
|
+
exports.LabelsWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n position: relative;\n display: grid;\n row-gap: 8px;\n cursor: ", ";\n margin: 0;\n padding: ", ";\n color: ", ";\n ", "\n"], ["\n position: relative;\n display: grid;\n row-gap: 8px;\n cursor: ", ";\n margin: 0;\n padding: ", ";\n color: ", ";\n ", "\n"])), function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return props.$verticalAlign === "flex-start" ? "5px 0 0 0" : "0"; }, function (props) { return props.$valid ? 'var(--dark)' : 'var(--red)'; }, function (props) { return !props.$isWrapText && "\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n display: -webkit-inline-box;\n "; });
|
|
39
40
|
exports.LabelText = styled_components_1.default.label(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: block;\n cursor: inherit;\n font: ", ";\n"], ["\n display: block;\n cursor: inherit;\n font: ", ";\n"])), function (props) {
|
|
40
41
|
switch (props.$textSize) {
|
|
41
42
|
case 'small':
|
|
@@ -49,5 +50,5 @@ exports.LabelText = styled_components_1.default.label(templateObject_3 || (templ
|
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
exports.DescriptionText = styled_components_1.default.label(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: block;\n margin: 0;\n cursor: inherit;\n font: var(--body-medium-14-17);\n color: var(--grey-50);\n"], ["\n display: block;\n margin: 0;\n cursor: inherit;\n font: var(--body-medium-14-17);\n color: var(--grey-50);\n"])));
|
|
52
|
-
exports.BasicStyled = styled_components_1.default.label(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items:", ";\n justify-content: ", ";\n cursor:
|
|
53
|
+
exports.BasicStyled = styled_components_1.default.label(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n position: relative;\n display: flex;\n align-items:", ";\n justify-content: ", ";\n cursor: ", ";\n ", "\n ", "\n ", "\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n }\n"], ["\n position: relative;\n display: flex;\n align-items:", ";\n justify-content: ", ";\n cursor: ", ";\n ", "\n ", "\n ", "\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n }\n"])), function (props) { return props.$verticalAlign; }, function (props) { return props.$alignment === "vertical" ? "center" : "flex-start"; }, function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, function (props) { return props.$alignment === "vertical" && "\n flex-direction: column-reverse;\n text-align: center;\n "; }, function (props) { return props.$hasNoneClick && "\n user-select:none;\n pointer-events:none;\n "; }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, exports.Indicator, function (props) { return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "".concat(props.$color), name: "RadioButtonElementChecked" })); });
|
|
53
54
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const Boxed: ({ value, checked, onChange, onClick, name, label, disabled, description, image, hasBadge, badgeText, badgeVariant, labelSm, readOnly, id, size, valid, labelOffset, textSize, showIndicator, }: RadioButtonProps) => React.JSX.Element;
|
|
3
|
+
declare const Boxed: ({ value, checked, onChange, onClick, name, label, disabled, description, image, hasBadge, badgeText, badgeVariant, labelSm, readOnly, id, size, valid, labelOffset, textSize, showIndicator, isCheckable, }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default Boxed;
|
|
@@ -19,8 +19,15 @@ var props_1 = require("./../../props");
|
|
|
19
19
|
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
20
20
|
var Boxed_styled_1 = require("./Boxed.styled");
|
|
21
21
|
var Badges_1 = __importDefault(require("../../../Badges"));
|
|
22
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
22
23
|
var Boxed = function (_a) {
|
|
23
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, hasBadge = _a.hasBadge, badgeText = _a.badgeText, badgeVariant = _a.badgeVariant, labelSm = _a.labelSm, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g;
|
|
24
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, hasBadge = _a.hasBadge, badgeText = _a.badgeText, badgeVariant = _a.badgeVariant, labelSm = _a.labelSm, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g, _h = _a.isCheckable, isCheckable = _h === void 0 ? true : _h;
|
|
25
|
+
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
26
|
+
isCheckable: isCheckable,
|
|
27
|
+
readOnly: readOnly,
|
|
28
|
+
onChange: onChange,
|
|
29
|
+
onClick: onClick,
|
|
30
|
+
});
|
|
24
31
|
var styledProps = {
|
|
25
32
|
$disabled: disabled,
|
|
26
33
|
$checked: checked,
|
|
@@ -28,9 +35,10 @@ var Boxed = function (_a) {
|
|
|
28
35
|
$valid: valid,
|
|
29
36
|
$labelOffset: labelOffset,
|
|
30
37
|
$readOnly: readOnly,
|
|
38
|
+
$isCheckable: isCheckable,
|
|
31
39
|
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
32
40
|
$textSize: textSize,
|
|
33
41
|
};
|
|
34
|
-
return ((0, jsx_runtime_1.jsxs)(Boxed_styled_1.BoxedStyled, __assign({
|
|
42
|
+
return ((0, jsx_runtime_1.jsxs)(Boxed_styled_1.BoxedStyled, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked }, inputInteraction)), showIndicator && (0, jsx_runtime_1.jsx)(Boxed_styled_1.Indicator, __assign({}, styledProps)), (label || description || image) && ((0, jsx_runtime_1.jsxs)(Boxed_styled_1.LabelsWrapper, __assign({}, styledProps, { children: [label && ((0, jsx_runtime_1.jsxs)(Boxed_styled_1.LabelText, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), { children: [label, labelSm && (0, jsx_runtime_1.jsx)(Boxed_styled_1.LabelSm, { children: labelSm })] }))), description && ((0, jsx_runtime_1.jsx)(Boxed_styled_1.DescriptionText, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), { children: description }))), image && ((0, jsx_runtime_1.jsx)(Boxed_styled_1.ImageLabel, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), { children: image })))] }))), hasBadge && ((0, jsx_runtime_1.jsx)(Boxed_styled_1.BoxedBadgesWrapper, { children: (0, jsx_runtime_1.jsx)(Badges_1.default, { title: badgeText, layout: "belt", variant: badgeVariant, hasResponsive: true }) }))] })));
|
|
35
43
|
};
|
|
36
44
|
exports.default = Boxed;
|
|
@@ -12,6 +12,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
12
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
13
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
14
|
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
15
16
|
var devices_1 = require("../../../../constants/devices");
|
|
16
17
|
exports.Indicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: absolute;\n left: 12px;\n top: 12px;\n margin: ", ";\n width: ", ";\n height: ", ";\n"], ["\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: absolute;\n left: 12px;\n top: 12px;\n margin: ", ";\n width: ", ";\n height: ", ";\n"])), function (props) { return props.$disabled ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementDisabled" })) : (props.$valid ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementUnchecked" })) : (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementInvalid" }))); }, function (props) { return (props.$size === "small" ? "0 8px 0 0" : "0 16px 0 0"); }, function (props) {
|
|
17
18
|
switch (props.$size) {
|
|
@@ -32,11 +33,11 @@ exports.Indicator = styled_components_1.default.div(templateObject_1 || (templat
|
|
|
32
33
|
return "16px";
|
|
33
34
|
}
|
|
34
35
|
});
|
|
35
|
-
exports.LabelsWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0;\n display: grid;\n text-align: center;\n\n @media only screen and ", " {\n row-gap: 4px;\n }\n"], ["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0;\n display: grid;\n text-align: center;\n\n @media only screen and ", " {\n row-gap: 4px;\n }\n"])), function (props) { return (
|
|
36
|
+
exports.LabelsWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0;\n display: grid;\n text-align: center;\n\n @media only screen and ", " {\n row-gap: 4px;\n }\n"], ["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0;\n display: grid;\n text-align: center;\n\n @media only screen and ", " {\n row-gap: 4px;\n }\n"])), function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return props.$valid ? 'var(--dark)' : 'var(--red)'; }, devices_1.devices.lg);
|
|
36
37
|
exports.LabelText = styled_components_1.default.label(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: block;\n margin: 0 0 4px 0;\n vertical-align: middle;\n cursor: pointer;\n font:var(--title-bold-16-19);\n\n @media only screen and ", " {\n margin: 0;\n }\n"], ["\n display: block;\n margin: 0 0 4px 0;\n vertical-align: middle;\n cursor: pointer;\n font:var(--title-bold-16-19);\n\n @media only screen and ", " {\n margin: 0;\n }\n"])), devices_1.devices.lg);
|
|
37
38
|
exports.LabelSm = styled_components_1.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font:var(--body-regular-14-17);\n margin-left: 0.25rem;\n"], ["\n font:var(--body-regular-14-17);\n margin-left: 0.25rem;\n"])));
|
|
38
39
|
exports.DescriptionText = styled_components_1.default.label(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: block;\n vertical-align: middle;\n margin: 0;\n cursor: pointer;\n font:var(--body-regular-14-17);\n\n @media only screen and ", " {\n margin: 0 0 0 4px;\n }\n"], ["\n display: block;\n vertical-align: middle;\n margin: 0;\n cursor: pointer;\n font:var(--body-regular-14-17);\n\n @media only screen and ", " {\n margin: 0 0 0 4px;\n }\n"])), devices_1.devices.lg);
|
|
39
40
|
exports.ImageLabel = styled_components_1.default.label(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: block;\n cursor: pointer;\n"], ["\n display: block;\n cursor: pointer;\n"])));
|
|
40
41
|
exports.BoxedBadgesWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: absolute;\n right: -9px;\n top: -8px;\n transform: rotate(90deg);\n\n @media only screen and ", " {\n right: -6px;\n top: -6px;\n }\n"], ["\n position: absolute;\n right: -9px;\n top: -8px;\n transform: rotate(90deg);\n\n @media only screen and ", " {\n right: -6px;\n top: -6px;\n }\n"])), devices_1.devices.lg);
|
|
41
|
-
exports.BoxedStyled = styled_components_1.default.label(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 128px;\n cursor: ", ";\n\n @media only screen and ", " {\n height: 69px;\n }\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n\n ", "\n }\n"], ["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 128px;\n cursor: ", ";\n\n @media only screen and ", " {\n height: 69px;\n }\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n\n ", "\n }\n"])), function (props) { return (props
|
|
42
|
+
exports.BoxedStyled = styled_components_1.default.label(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 128px;\n cursor: ", ";\n ", "\n\n @media only screen and ", " {\n height: 69px;\n }\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n\n ", "\n }\n"], ["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 128px;\n cursor: ", ";\n ", "\n\n @media only screen and ", " {\n height: 69px;\n }\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n\n ", "\n }\n"])), function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, devices_1.devices.lg, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, exports.Indicator, function (props) { return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "".concat(props.$color), name: "RadioButtonElementChecked" })); }, function (props) { return (0, radioInteraction_1.canInteractWithRadio)(props) && " , &:hover"; }, exports.LabelsWrapper, exports.LabelsWrapper, function (props) { return (0, radioInteraction_1.canInteractWithRadio)(props) && " \n &:hover {\n ~ ".concat(exports.LabelsWrapper, " {\n &:before {\n border: 1px solid var(--primary-hover);\n }\n }\n }\n "); });
|
|
42
43
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const BoxedMd: ({ value, checked, onChange, onClick, name, label, disabled, description, image, readOnly, id, size, valid, labelOffset, textSize, showIndicator, }: RadioButtonProps) => import("react").JSX.Element;
|
|
3
|
+
declare const BoxedMd: ({ value, checked, onChange, onClick, name, label, disabled, description, image, readOnly, id, size, valid, labelOffset, textSize, showIndicator, isCheckable, }: RadioButtonProps) => import("react").JSX.Element;
|
|
4
4
|
export default BoxedMd;
|
|
@@ -15,8 +15,15 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
var props_1 = require("./../../props");
|
|
16
16
|
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
17
17
|
var BoxedMd_styled_1 = require("./BoxedMd.styled");
|
|
18
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
18
19
|
var BoxedMd = function (_a) {
|
|
19
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g;
|
|
20
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g, _h = _a.isCheckable, isCheckable = _h === void 0 ? true : _h;
|
|
21
|
+
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
22
|
+
isCheckable: isCheckable,
|
|
23
|
+
readOnly: readOnly,
|
|
24
|
+
onChange: onChange,
|
|
25
|
+
onClick: onClick,
|
|
26
|
+
});
|
|
20
27
|
var styledProps = {
|
|
21
28
|
$disabled: disabled,
|
|
22
29
|
$checked: checked,
|
|
@@ -24,10 +31,11 @@ var BoxedMd = function (_a) {
|
|
|
24
31
|
$valid: valid,
|
|
25
32
|
$labelOffset: labelOffset,
|
|
26
33
|
$readOnly: readOnly,
|
|
34
|
+
$isCheckable: isCheckable,
|
|
27
35
|
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
28
36
|
$textSize: textSize,
|
|
29
37
|
$showIndicator: showIndicator,
|
|
30
38
|
};
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(BoxedMd_styled_1.BoxedMdStyled, __assign({
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(BoxedMd_styled_1.BoxedMdStyled, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked }, inputInteraction)), showIndicator && (0, jsx_runtime_1.jsx)(BoxedMd_styled_1.Indicator, __assign({}, styledProps)), (label || description || image) && ((0, jsx_runtime_1.jsx)(BoxedMd_styled_1.LabelsWrapper, __assign({}, styledProps, { children: label && ((0, jsx_runtime_1.jsx)(BoxedMd_styled_1.LabelText, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: label }))) })))] })));
|
|
32
40
|
};
|
|
33
41
|
exports.default = BoxedMd;
|
|
@@ -12,6 +12,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
12
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
13
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
14
|
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
15
16
|
exports.Indicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: absolute;\n left: 1.5rem;\n top: 50%;\n transform: translateY(-50%);\n margin: ", ";\n width: ", ";\n height: ", ";\n"], ["\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: absolute;\n left: 1.5rem;\n top: 50%;\n transform: translateY(-50%);\n margin: ", ";\n width: ", ";\n height: ", ";\n"])), function (props) { return props.$disabled ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementDisabled" })) : (props.$valid ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementUnchecked" })) : (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementInvalid" }))); }, function (props) { return (props.$size === "small" ? "0 8px 0 0" : "0 16px 0 0"); }, function (props) {
|
|
16
17
|
switch (props.$size) {
|
|
17
18
|
case 'small':
|
|
@@ -31,7 +32,7 @@ exports.Indicator = styled_components_1.default.div(templateObject_1 || (templat
|
|
|
31
32
|
return "16px";
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
|
-
exports.LabelsWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0 0 0 ", ";\n display: grid;\n"], ["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0 0 0 ", ";\n display: grid;\n"])), function (props) { return (
|
|
35
|
+
exports.LabelsWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0 0 0 ", ";\n display: grid;\n"], ["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0 0 0 ", ";\n display: grid;\n"])), function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return props.$valid ? 'var(--dark)' : 'var(--red)'; }, function (props) { return props.$showIndicator ? "2rem" : "0"; });
|
|
35
36
|
exports.LabelText = styled_components_1.default.label(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: block;\n margin: 0;\n vertical-align: middle;\n cursor: pointer;\n font: ", ";\n"], ["\n display: block;\n margin: 0;\n vertical-align: middle;\n cursor: pointer;\n font: ", ";\n"])), function (props) {
|
|
36
37
|
switch (props.$textSize) {
|
|
37
38
|
case 'small':
|
|
@@ -42,5 +43,5 @@ exports.LabelText = styled_components_1.default.label(templateObject_3 || (templ
|
|
|
42
43
|
return "var(--body-semi-bold-14-17)";
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
|
-
exports.BoxedMdStyled = styled_components_1.default.label(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n cursor: ", ";\n padding: 0.5rem 1.5rem;\n min-height: 48px;\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n }\n"], ["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n cursor: ", ";\n padding: 0.5rem 1.5rem;\n min-height: 48px;\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n }\n"])), function (props) { return (props
|
|
46
|
+
exports.BoxedMdStyled = styled_components_1.default.label(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n cursor: ", ";\n ", "\n padding: 0.5rem 1.5rem;\n min-height: 48px;\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n }\n"], ["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n cursor: ", ";\n ", "\n padding: 0.5rem 1.5rem;\n min-height: 48px;\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n }\n"])), function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, exports.Indicator, function (props) { return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "".concat(props.$color), name: "RadioButtonElementChecked" })); }, function (props) { return (0, radioInteraction_1.canInteractWithRadio)(props) && " , &:hover"; }, exports.LabelsWrapper, exports.LabelsWrapper);
|
|
46
47
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const BoxedSm: ({ value, checked, onChange, onClick, name, label, disabled, description, image, readOnly, id, size, valid, labelOffset, textSize, showIndicator, }: RadioButtonProps) => import("react").JSX.Element;
|
|
3
|
+
declare const BoxedSm: ({ value, checked, onChange, onClick, name, label, disabled, description, image, readOnly, id, size, valid, labelOffset, textSize, showIndicator, isCheckable, }: RadioButtonProps) => import("react").JSX.Element;
|
|
4
4
|
export default BoxedSm;
|
|
@@ -15,8 +15,15 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
15
15
|
var props_1 = require("./../../props");
|
|
16
16
|
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
17
17
|
var BoxedSm_styled_1 = require("./BoxedSm.styled");
|
|
18
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
18
19
|
var BoxedSm = function (_a) {
|
|
19
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g;
|
|
20
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, description = _a.description, image = _a.image, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? props_1.BoxedDefault.textSize : _f, _g = _a.showIndicator, showIndicator = _g === void 0 ? true : _g, _h = _a.isCheckable, isCheckable = _h === void 0 ? true : _h;
|
|
21
|
+
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
22
|
+
isCheckable: isCheckable,
|
|
23
|
+
readOnly: readOnly,
|
|
24
|
+
onChange: onChange,
|
|
25
|
+
onClick: onClick,
|
|
26
|
+
});
|
|
20
27
|
var styledProps = {
|
|
21
28
|
$disabled: disabled,
|
|
22
29
|
$checked: checked,
|
|
@@ -24,10 +31,11 @@ var BoxedSm = function (_a) {
|
|
|
24
31
|
$valid: valid,
|
|
25
32
|
$labelOffset: labelOffset,
|
|
26
33
|
$readOnly: readOnly,
|
|
34
|
+
$isCheckable: isCheckable,
|
|
27
35
|
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
28
36
|
$textSize: textSize,
|
|
29
37
|
$showIndicator: showIndicator,
|
|
30
38
|
};
|
|
31
|
-
return ((0, jsx_runtime_1.jsxs)(BoxedSm_styled_1.BoxedSmStyled, __assign({
|
|
39
|
+
return ((0, jsx_runtime_1.jsxs)(BoxedSm_styled_1.BoxedSmStyled, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked }, inputInteraction)), showIndicator && (0, jsx_runtime_1.jsx)(BoxedSm_styled_1.Indicator, __assign({}, styledProps)), (label || description || image) && ((0, jsx_runtime_1.jsx)(BoxedSm_styled_1.LabelsWrapper, __assign({}, styledProps, { children: label && ((0, jsx_runtime_1.jsx)(BoxedSm_styled_1.LabelText, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: label }))) })))] })));
|
|
32
40
|
};
|
|
33
41
|
exports.default = BoxedSm;
|
|
@@ -12,6 +12,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
12
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
13
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
14
|
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
15
16
|
exports.Indicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: absolute;\n left: 1rem;\n top: 50%;\n transform: translateY(-50%);\n margin: ", ";\n width: ", ";\n height: ", ";\n"], ["\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: absolute;\n left: 1rem;\n top: 50%;\n transform: translateY(-50%);\n margin: ", ";\n width: ", ";\n height: ", ";\n"])), function (props) { return props.$disabled ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementDisabled" })) : (props.$valid ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementUnchecked" })) : (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, name: "RadioButtonElementInvalid" }))); }, function (props) { return (props.$size === "small" ? "0 8px 0 0" : "0 16px 0 0"); }, function (props) {
|
|
16
17
|
switch (props.$size) {
|
|
17
18
|
case 'small':
|
|
@@ -31,7 +32,7 @@ exports.Indicator = styled_components_1.default.div(templateObject_1 || (templat
|
|
|
31
32
|
return "16px";
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
|
-
exports.LabelsWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0 0 0 ", ";\n display: grid;\n"], ["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0 0 0 ", ";\n display: grid;\n"])), function (props) { return (
|
|
35
|
+
exports.LabelsWrapper = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0 0 0 ", ";\n display: grid;\n"], ["\n row-gap: 4px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n padding: 0 0 0 ", ";\n display: grid;\n"])), function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return props.$valid ? 'var(--dark)' : 'var(--red)'; }, function (props) { return props.$showIndicator ? "1.5rem" : "0"; });
|
|
35
36
|
exports.LabelText = styled_components_1.default.label(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: block;\n margin: 0;\n vertical-align: middle;\n cursor: pointer;\n font: ", ";\n"], ["\n display: block;\n margin: 0;\n vertical-align: middle;\n cursor: pointer;\n font: ", ";\n"])), function (props) {
|
|
36
37
|
switch (props.$textSize) {
|
|
37
38
|
case 'small':
|
|
@@ -42,5 +43,5 @@ exports.LabelText = styled_components_1.default.label(templateObject_3 || (templ
|
|
|
42
43
|
return "var(--body-semi-bold-14-17)";
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
|
-
exports.BoxedSmStyled = styled_components_1.default.label(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n cursor: ", ";\n padding: calc(0.75rem - 0.5px) 1rem;\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n }\n"], ["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n cursor: ", ";\n padding: calc(0.75rem - 0.5px) 1rem;\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n }\n"])), function (props) { return (props
|
|
46
|
+
exports.BoxedSmStyled = styled_components_1.default.label(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n cursor: ", ";\n ", "\n padding: calc(0.75rem - 0.5px) 1rem;\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n }\n"], ["\n border: 1px solid var(--dark-opacity-10);\n position: relative;\n border-radius: 0.5rem;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n cursor: ", ";\n ", "\n padding: calc(0.75rem - 0.5px) 1rem;\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " {\n background-image:url('", "');\n }\n\n &:checked ", " {\n ~ ", " {\n &:before {\n content: \"\";\n position: absolute;\n inset: -1px;\n border-radius: 0.5rem;\n user-select: none;\n pointer-events: none;\n }\n }\n }\n\n &:checked {\n ~ ", " {\n &:before {\n border: 2px solid var(--primary) !important;\n }\n }\n }\n }\n"])), function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, exports.Indicator, function (props) { return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "".concat(props.$color), name: "RadioButtonElementChecked" })); }, function (props) { return (0, radioInteraction_1.canInteractWithRadio)(props) && " , &:hover"; }, exports.LabelsWrapper, exports.LabelsWrapper);
|
|
46
47
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioButtonProps } from "../../props";
|
|
3
|
-
declare const BoxedWithIcon: ({ value, checked, onChange, onClick, name, label, disabled, readOnly, id, size, valid, labelOffset, textSize, iconName, iconColor, content }: RadioButtonProps) => React.JSX.Element;
|
|
3
|
+
declare const BoxedWithIcon: ({ value, checked, onChange, onClick, name, label, disabled, readOnly, id, size, valid, labelOffset, textSize, iconName, iconColor, content, isCheckable, }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default BoxedWithIcon;
|
|
@@ -19,8 +19,15 @@ var props_1 = require("../../props");
|
|
|
19
19
|
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
20
20
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
21
21
|
var BoxedWithIcon_styled_1 = require("./BoxedWithIcon.styled");
|
|
22
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
22
23
|
var BoxedWithIcon = function (_a) {
|
|
23
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedWithIconDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedWithIconDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedWithIconDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedWithIconDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? "medium" : _f, iconName = _a.iconName, iconColor = _a.iconColor, content = _a.content;
|
|
24
|
-
|
|
24
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BoxedWithIconDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BoxedWithIconDefault.size : _c, _d = _a.valid, valid = _d === void 0 ? props_1.BoxedWithIconDefault.valid : _d, _e = _a.labelOffset, labelOffset = _e === void 0 ? props_1.BoxedWithIconDefault.labelOffset : _e, _f = _a.textSize, textSize = _f === void 0 ? "medium" : _f, iconName = _a.iconName, iconColor = _a.iconColor, content = _a.content, _g = _a.isCheckable, isCheckable = _g === void 0 ? true : _g;
|
|
25
|
+
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
26
|
+
isCheckable: isCheckable,
|
|
27
|
+
readOnly: readOnly,
|
|
28
|
+
onChange: onChange,
|
|
29
|
+
onClick: onClick,
|
|
30
|
+
});
|
|
31
|
+
return ((0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.BoxedWithIconStyled, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), { "$disabled": disabled, "$checked": checked, "$size": size, "$valid": valid, "$readOnly": readOnly, "$isCheckable": isCheckable, "$color": (0, getRootCssVariable_1.getRadioPrimaryColor)() }, { children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked }, inputInteraction)), (0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.ContentWrapper, { children: [(0, jsx_runtime_1.jsxs)(BoxedWithIcon_styled_1.Header, { children: [iconName && ((0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.IconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: iconName, color: iconColor, hasWrapper: false, width: "32", height: "32" }) })), label && (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Label, { children: label }), (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Indicator, { "$disabled": disabled, "$valid": valid })] }), content && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Separator, {}), (0, jsx_runtime_1.jsx)(BoxedWithIcon_styled_1.Content, { children: content })] }))] })] })));
|
|
25
32
|
};
|
|
26
33
|
exports.default = BoxedWithIcon;
|
|
@@ -12,6 +12,7 @@ var jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
12
12
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
13
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
14
|
var svgToBase64_1 = __importDefault(require("../../../../utils/svgToBase64"));
|
|
15
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
15
16
|
exports.ContentWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 1.5rem 1.5rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"], ["\n padding: 1.5rem 1.5rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n"])));
|
|
16
17
|
exports.Header = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-height: 24px;\n"], ["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n min-height: 24px;\n"])));
|
|
17
18
|
exports.IconWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n"], ["\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n"])));
|
|
@@ -19,5 +20,5 @@ exports.Label = styled_components_1.default.span(templateObject_4 || (templateOb
|
|
|
19
20
|
exports.Indicator = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex-shrink: 0;\n background-image: url('", "');\n background-size: 100% 100%;\n width: 20px;\n height: 20px;\n display: block;\n position: absolute;\n right: 1rem;\n top: 1rem;\n"], ["\n flex-shrink: 0;\n background-image: url('", "');\n background-size: 100% 100%;\n width: 20px;\n height: 20px;\n display: block;\n position: absolute;\n right: 1rem;\n top: 1rem;\n"])), function (props) { return props.$disabled ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#C2C3CE", name: "RadioButtonElementDisabled" })) : (props.$valid ? (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#9763F6", name: "RadioButtonElementUnchecked" })) : (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#FF1F1F", name: "RadioButtonElementInvalid" }))); });
|
|
20
21
|
exports.Separator = styled_components_1.default.hr(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n height: 1px;\n background-color: var(--grey-10);\n margin: 0;\n border: none;\n opacity: 1;\n"], ["\n height: 1px;\n background-color: var(--grey-10);\n margin: 0;\n border: none;\n opacity: 1;\n"])));
|
|
21
22
|
exports.Content = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: var(--dark-opacity-50);\n\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n li {\n font: var(--body-regular-14-17);\n color: var(--dark-opacity-70);\n line-height: 1.4;\n }\n"], ["\n color: var(--dark-opacity-50);\n\n ul {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n }\n\n li {\n font: var(--body-regular-14-17);\n color: var(--dark-opacity-70);\n line-height: 1.4;\n }\n"])));
|
|
22
|
-
exports.BoxedWithIconStyled = styled_components_1.default.label(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: block;\n position: relative;\n border-radius: 0.5rem;\n border: 1px solid ", ";\n background-color: white;\n cursor: ", ";\n overflow: hidden;\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked ~ ", " ", " ", " {\n background-image: url('", "');\n }\n }\n"], ["\n display: block;\n position: relative;\n border-radius: 0.5rem;\n border: 1px solid ", ";\n background-color: white;\n cursor: ", ";\n overflow: hidden;\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked ~ ", " ", " ", " {\n background-image: url('", "');\n }\n }\n"])), function (props) { return props.$checked ? "transparent" : "var(--dark-opacity-10)"; }, function (props) { return (props
|
|
23
|
+
exports.BoxedWithIconStyled = styled_components_1.default.label(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: block;\n position: relative;\n border-radius: 0.5rem;\n border: 1px solid ", ";\n background-color: white;\n cursor: ", ";\n ", "\n overflow: hidden;\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " ", " ", " {\n background-image: url('", "');\n }\n }\n"], ["\n display: block;\n position: relative;\n border-radius: 0.5rem;\n border: 1px solid ", ";\n background-color: white;\n cursor: ", ";\n ", "\n overflow: hidden;\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n &:checked ~ ", " ", " ", " {\n background-image: url('", "');\n }\n }\n"])), function (props) { return props.$checked ? "transparent" : "var(--dark-opacity-10)"; }, function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, function (props) { return props.$checked && "\n &:before{\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n user-select: none;\n pointer-events: none;\n border: 2px solid var(--primary);\n }\n "; }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, exports.ContentWrapper, exports.Header, exports.Indicator, function (props) { return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: props.$color || "#9763F6", name: "RadioButtonElementChecked" })); });
|
|
23
24
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioButtonProps } from "./../../props";
|
|
3
|
-
declare const Color: ({ value, checked, onChange, onClick, name, label, disabled, readOnly, id, size, color, }: RadioButtonProps) => React.JSX.Element;
|
|
3
|
+
declare const Color: ({ value, checked, onChange, onClick, name, label, disabled, readOnly, id, size, color, isCheckable, }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default Color;
|
|
@@ -14,14 +14,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
14
14
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
15
|
var props_1 = require("./../../props");
|
|
16
16
|
var Color_styled_1 = require("./Color.styled");
|
|
17
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
17
18
|
var Color = function (_a) {
|
|
18
|
-
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BasicDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BasicDefault.size : _c, color = _a.color;
|
|
19
|
+
var value = _a.value, checked = _a.checked, onChange = _a.onChange, onClick = _a.onClick, name = _a.name, label = _a.label, disabled = _a.disabled, readOnly = _a.readOnly, _b = _a.id, id = _b === void 0 ? props_1.BasicDefault.id : _b, _c = _a.size, size = _c === void 0 ? props_1.BasicDefault.size : _c, color = _a.color, _d = _a.isCheckable, isCheckable = _d === void 0 ? true : _d;
|
|
20
|
+
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
21
|
+
isCheckable: isCheckable,
|
|
22
|
+
readOnly: readOnly,
|
|
23
|
+
onChange: onChange,
|
|
24
|
+
onClick: onClick,
|
|
25
|
+
});
|
|
19
26
|
var styledProps = {
|
|
20
27
|
$disabled: disabled,
|
|
21
28
|
$checked: checked,
|
|
22
29
|
$color: color,
|
|
23
30
|
$size: size,
|
|
31
|
+
$isCheckable: isCheckable,
|
|
24
32
|
};
|
|
25
|
-
return ((0, jsx_runtime_1.jsxs)(Color_styled_1.ColorStyled, __assign({
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(Color_styled_1.ColorStyled, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked }, inputInteraction)), (0, jsx_runtime_1.jsx)(Color_styled_1.ColorIndicator, __assign({}, styledProps)), label && (0, jsx_runtime_1.jsx)(Color_styled_1.ColorLabel, __assign({}, styledProps, { children: label }))] })));
|
|
26
34
|
};
|
|
27
35
|
exports.default = Color;
|
|
@@ -4,6 +4,7 @@ export interface ColorStyledProps {
|
|
|
4
4
|
$checked?: boolean;
|
|
5
5
|
$color?: string;
|
|
6
6
|
$size?: string;
|
|
7
|
+
$isCheckable?: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare const ColorIndicator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
9
10
|
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
@@ -9,7 +9,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ColorStyled = exports.ColorLabel = exports.ColorIndicator = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
12
13
|
exports.ColorIndicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n border-radius: 50%;\n background-color: ", ";\n box-sizing: border-box;\n outline: ", ";\n outline-offset: 2px;\n"], ["\n width: ", ";\n height: ", ";\n border-radius: 50%;\n background-color: ", ";\n box-sizing: border-box;\n outline: ", ";\n outline-offset: 2px;\n"])), function (props) { return props.$size === "medium" ? "40px" : "32px"; }, function (props) { return props.$size === "medium" ? "40px" : "32px"; }, function (props) { return props.$color || "var(--dark)"; }, function (props) { return props.$checked ? "2px solid var(--primary)" : "2px solid transparent"; });
|
|
13
14
|
exports.ColorLabel = styled_components_1.default.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font: var(--caption-medium-12-15);\n color: ", ";\n text-align: center;\n white-space: nowrap;\n"], ["\n font: var(--caption-medium-12-15);\n color: ", ";\n text-align: center;\n white-space: nowrap;\n"])), function (props) { return props.$checked ? "var(--primary)" : "var(--dark-opacity-50)"; });
|
|
14
|
-
exports.ColorStyled = styled_components_1.default.label(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n cursor: ", ";\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n }\n"], ["\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n cursor: ", ";\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n }\n"])), function (props) { return (props
|
|
15
|
+
exports.ColorStyled = styled_components_1.default.label(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n cursor: ", ";\n ", "\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n }\n"], ["\n position: relative;\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n cursor: ", ";\n ", "\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n }\n"])), function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, function (props) { return props.$disabled && "\n opacity: 0.4;\n "; }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); });
|
|
15
16
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -19,8 +19,15 @@ var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
|
19
19
|
var Badges_1 = __importDefault(require("../../../Badges"));
|
|
20
20
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
21
21
|
var Horizontal_styled_1 = require("./Horizontal.styled");
|
|
22
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
22
23
|
var Horizontal = function (props) {
|
|
23
|
-
var label = props.label, title = props.title, description = props.description, id = props.id, checked = props.checked, onChange = props.onChange, onClick = props.onClick, name = props.name, value = props.value, price = props.price, priceDesc = props.priceDesc, hasTitleBadge = props.hasTitleBadge, titleBadgeLayout = props.titleBadgeLayout, titleBadgeText = props.titleBadgeText, _a = props.titleBadgePosition, titleBadgePosition = _a === void 0 ? "inline" : _a, hasPriceBadge = props.hasPriceBadge, priceBadgeLayout = props.priceBadgeLayout, priceBadgeText = props.priceBadgeText, rightContent = props.rightContent, _b = props.innerMinHeight, innerMinHeight = _b === void 0 ? "70" : _b, _c = props.labelOffset, labelOffset = _c === void 0 ? "1rem" : _c, disabled = props.disabled, _d = props.valid, valid = _d === void 0 ? true : _d, _e = props.showIndicator, showIndicator = _e === void 0 ? true : _e, content = props.content, _f = props.size, size = _f === void 0 ? "small" : _f, _g = props.hasError, hasError = _g === void 0 ? false : _g, errorMessage = props.errorMessage;
|
|
24
|
+
var label = props.label, title = props.title, description = props.description, id = props.id, checked = props.checked, onChange = props.onChange, onClick = props.onClick, name = props.name, value = props.value, price = props.price, priceDesc = props.priceDesc, hasTitleBadge = props.hasTitleBadge, titleBadgeLayout = props.titleBadgeLayout, titleBadgeText = props.titleBadgeText, _a = props.titleBadgePosition, titleBadgePosition = _a === void 0 ? "inline" : _a, hasPriceBadge = props.hasPriceBadge, priceBadgeLayout = props.priceBadgeLayout, priceBadgeText = props.priceBadgeText, rightContent = props.rightContent, _b = props.innerMinHeight, innerMinHeight = _b === void 0 ? "70" : _b, _c = props.labelOffset, labelOffset = _c === void 0 ? "1rem" : _c, disabled = props.disabled, _d = props.valid, valid = _d === void 0 ? true : _d, _e = props.showIndicator, showIndicator = _e === void 0 ? true : _e, content = props.content, _f = props.size, size = _f === void 0 ? "small" : _f, _g = props.hasError, hasError = _g === void 0 ? false : _g, errorMessage = props.errorMessage, readOnly = props.readOnly, _h = props.isCheckable, isCheckable = _h === void 0 ? true : _h;
|
|
25
|
+
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
26
|
+
isCheckable: isCheckable,
|
|
27
|
+
readOnly: readOnly,
|
|
28
|
+
onChange: onChange,
|
|
29
|
+
onClick: onClick,
|
|
30
|
+
});
|
|
24
31
|
var titleBadgeBelow = titleBadgePosition === "below";
|
|
25
32
|
var titleBadgeTopRight = titleBadgePosition === "topRight";
|
|
26
33
|
var hasContent = Boolean(content);
|
|
@@ -36,9 +43,10 @@ var Horizontal = function (props) {
|
|
|
36
43
|
$titleBadgeTopRight: titleBadgeTopRight,
|
|
37
44
|
$hasContent: hasContent,
|
|
38
45
|
$size: size,
|
|
46
|
+
$isCheckable: isCheckable,
|
|
39
47
|
};
|
|
40
48
|
var titleBadgeElement = ((0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: titleBadgeLayout, title: titleBadgeText }));
|
|
41
49
|
var titleBadge = hasTitleBadge && !titleBadgeTopRight && ((0, jsx_runtime_1.jsx)(Horizontal_styled_1.BadgesWrapper, __assign({}, styledProps, { children: titleBadgeElement })));
|
|
42
|
-
return ((0, jsx_runtime_1.jsxs)(Horizontal_styled_1.HorizontalRoot, { children: [(0, jsx_runtime_1.jsxs)(Horizontal_styled_1.HorizontalBoxStyled, __assign({}, styledProps, { children: [hasTitleBadge && titleBadgeTopRight && ((0, jsx_runtime_1.jsx)(Horizontal_styled_1.TitleBadgeTopRight, { children: titleBadgeElement })), (0, jsx_runtime_1.jsx)(Horizontal_styled_1.HorizontalLabel, { children: (0, jsx_runtime_1.jsxs)(Horizontal_styled_1.Inner, __assign({ "$innerMinHeight": innerMinHeight }, { children: [(0, jsx_runtime_1.jsxs)(Horizontal_styled_1.LeftContent, { children: [(0, jsx_runtime_1.jsx)("input", { id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked,
|
|
50
|
+
return ((0, jsx_runtime_1.jsxs)(Horizontal_styled_1.HorizontalRoot, { children: [(0, jsx_runtime_1.jsxs)(Horizontal_styled_1.HorizontalBoxStyled, __assign({}, styledProps, { children: [hasTitleBadge && titleBadgeTopRight && ((0, jsx_runtime_1.jsx)(Horizontal_styled_1.TitleBadgeTopRight, { children: titleBadgeElement })), (0, jsx_runtime_1.jsx)(Horizontal_styled_1.HorizontalLabel, __assign({}, (0, radioInteraction_1.getRadioLabelProps)(isCheckable, id), styledProps, { children: (0, jsx_runtime_1.jsxs)(Horizontal_styled_1.Inner, __assign({ "$innerMinHeight": innerMinHeight }, { children: [(0, jsx_runtime_1.jsxs)(Horizontal_styled_1.LeftContent, { children: [(0, jsx_runtime_1.jsx)("input", __assign({ id: id, type: "radio", name: name, value: value, disabled: disabled, checked: checked }, inputInteraction, { "aria-invalid": hasError, "aria-describedby": hasError && errorMessage ? "".concat(id, "-error") : undefined })), showIndicator && (0, jsx_runtime_1.jsx)(Horizontal_styled_1.Indicator, __assign({}, styledProps)), (0, jsx_runtime_1.jsxs)(Horizontal_styled_1.LabelContent, { children: [titleContent && ((0, jsx_runtime_1.jsxs)(Horizontal_styled_1.LabelWrapper, __assign({}, styledProps, { children: [(0, jsx_runtime_1.jsx)(Horizontal_styled_1.TitleLabel, { children: titleContent }), titleBadge] }))), description && (0, jsx_runtime_1.jsx)(Horizontal_styled_1.Description, { children: description })] })] }), (0, jsx_runtime_1.jsx)(Horizontal_styled_1.RightContent, { children: rightContent !== null && rightContent !== void 0 ? rightContent : (hasPriceBadge ? ((0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: priceBadgeLayout, title: priceBadgeText })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Horizontal_styled_1.Price, { children: price }), priceDesc && ((0, jsx_runtime_1.jsxs)(Horizontal_styled_1.TotalPrice, { children: [(0, jsx_runtime_1.jsx)(Horizontal_styled_1.TotalLabel, { children: "Toplam:" }), " ", priceDesc] }))] }))) })] })) })), checked && content && ((0, jsx_runtime_1.jsx)(Horizontal_styled_1.ContentArea, { children: content }))] })), hasError && errorMessage && ((0, jsx_runtime_1.jsxs)(Horizontal_styled_1.ErrorMessage, __assign({ id: id ? "".concat(id, "-error") : undefined }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { name: "SwitchPassive" }), (0, jsx_runtime_1.jsx)("p", { children: errorMessage })] })))] }));
|
|
43
51
|
};
|
|
44
52
|
exports.default = Horizontal;
|
|
@@ -13,10 +13,11 @@ export type HorizontalStyledProps = {
|
|
|
13
13
|
$hasContent?: boolean;
|
|
14
14
|
$size?: IndicatorSize;
|
|
15
15
|
$innerMinHeight?: "70" | "initial";
|
|
16
|
+
$isCheckable?: boolean;
|
|
16
17
|
};
|
|
17
|
-
export declare const HorizontalLabel: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "style"> & {
|
|
18
|
+
export declare const HorizontalLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "style"> & {
|
|
18
19
|
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
19
|
-
}
|
|
20
|
+
}, HorizontalStyledProps>> & string;
|
|
20
21
|
export declare const Inner: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
21
22
|
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
22
23
|
}, Pick<HorizontalStyledProps, "$innerMinHeight">>> & string;
|
|
@@ -13,6 +13,7 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
13
13
|
var devices_1 = require("../../../../constants/devices");
|
|
14
14
|
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
15
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
16
|
+
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
16
17
|
var getIndicatorSize = function (size) {
|
|
17
18
|
switch (size) {
|
|
18
19
|
case 'medium':
|
|
@@ -21,7 +22,7 @@ var getIndicatorSize = function (size) {
|
|
|
21
22
|
return '16px';
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
|
-
exports.HorizontalLabel = styled_components_1.default.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: stretch;\n justify-content: center;\n cursor: inherit;\n"], ["\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: stretch;\n justify-content: center;\n cursor: inherit;\n"])));
|
|
25
|
+
exports.HorizontalLabel = styled_components_1.default.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: stretch;\n justify-content: center;\n cursor: inherit;\n ", "\n"], ["\n display: flex;\n flex-direction: column;\n width: 100%;\n align-items: stretch;\n justify-content: center;\n cursor: inherit;\n ", "\n"])), function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); });
|
|
25
26
|
exports.Inner = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n width: 100%;\n padding: 1rem 1.5rem;\n min-height: ", ";\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n\n @media only screen and ", " {\n padding: 0 1rem;\n }\n"], ["\n width: 100%;\n padding: 1rem 1.5rem;\n min-height: ", ";\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-sizing: border-box;\n\n @media only screen and ", " {\n padding: 0 1rem;\n }\n"])), function (props) { return (props.$innerMinHeight === 'initial' ? 'initial' : '70px'); }, devices_1.devices.sm);
|
|
26
27
|
exports.LeftContent = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n width: auto;\n position: relative;\n"], ["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n width: auto;\n position: relative;\n"])));
|
|
27
28
|
exports.Indicator = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 0 0 auto;\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: relative;\n margin: 0 ", " 0 0;\n width: ", ";\n height: ", ";\n"], ["\n flex: 0 0 auto;\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: relative;\n margin: 0 ", " 0 0;\n width: ", ";\n height: ", ";\n"])), function (props) {
|
|
@@ -52,7 +53,7 @@ exports.Price = styled_components_1.default.strong(templateObject_14 || (templat
|
|
|
52
53
|
exports.TotalPrice = styled_components_1.default.strong(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n display: block;\n color: var(--dark-opacity-50);\n font: var(--caption-semi-bold-12-15);\n"], ["\n display: block;\n color: var(--dark-opacity-50);\n font: var(--caption-semi-bold-12-15);\n"])));
|
|
53
54
|
exports.TotalLabel = styled_components_1.default.span(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n @media only screen and ", " {\n display: none;\n }\n"], ["\n @media only screen and ", " {\n display: none;\n }\n"])), devices_1.devices.sm);
|
|
54
55
|
exports.ContentArea = styled_components_1.default.div(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n width: 100%;\n padding: 0 1.5rem 1.5rem;\n box-sizing: border-box;\n cursor: default;\n\n @media only screen and ", " {\n padding: 0 1rem 1rem;\n }\n"], ["\n width: 100%;\n padding: 0 1.5rem 1.5rem;\n box-sizing: border-box;\n cursor: default;\n\n @media only screen and ", " {\n padding: 0 1rem 1rem;\n }\n"])), devices_1.devices.sm);
|
|
55
|
-
exports.HorizontalBoxStyled = styled_components_1.default.div(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n display: block;\n position: relative;\n flex: none !important;\n border-radius: 0.5rem;\n background-color: white;\n box-sizing: border-box;\n\n &:before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: ", ";\n box-sizing: border-box;\n pointer-events: none;\n z-index: 1;\n }\n\n ", "\n\n ", " {\n cursor: ", ";\n }\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n ", "\n }\n"], ["\n display: block;\n position: relative;\n flex: none !important;\n border-radius: 0.5rem;\n background-color: white;\n box-sizing: border-box;\n\n &:before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: ", ";\n box-sizing: border-box;\n pointer-events: none;\n z-index: 1;\n }\n\n ", "\n\n ", " {\n cursor: ", ";\n }\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n ", "\n }\n"])), function (props) {
|
|
56
|
+
exports.HorizontalBoxStyled = styled_components_1.default.div(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n display: block;\n position: relative;\n flex: none !important;\n border-radius: 0.5rem;\n background-color: white;\n box-sizing: border-box;\n\n &:before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: ", ";\n box-sizing: border-box;\n pointer-events: none;\n z-index: 1;\n }\n\n ", "\n\n ", " {\n cursor: ", ";\n ", "\n }\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n ", "\n\n ", "\n }\n"], ["\n display: block;\n position: relative;\n flex: none !important;\n border-radius: 0.5rem;\n background-color: white;\n box-sizing: border-box;\n\n &:before {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: ", ";\n box-sizing: border-box;\n pointer-events: none;\n z-index: 1;\n }\n\n ", "\n\n ", " {\n cursor: ", ";\n ", "\n }\n\n ", "\n\n input[type=\"radio\"] {\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n ", "\n\n ", "\n\n ", "\n }\n"])), function (props) {
|
|
56
57
|
if (props.$disabled)
|
|
57
58
|
return '1px solid var(--grey-10)';
|
|
58
59
|
if (props.$hasError)
|
|
@@ -60,5 +61,5 @@ exports.HorizontalBoxStyled = styled_components_1.default.div(templateObject_18
|
|
|
60
61
|
if (props.checked)
|
|
61
62
|
return '2px solid var(--primary)';
|
|
62
63
|
return '1px solid var(--dark-opacity-10)';
|
|
63
|
-
}, function (props) { return !props.checked && !props.$disabled && !props.$hasError && "\n @media only screen and ".concat(devices_1.devices.lgUp, " {\n &:hover:before {\n border: 1px solid var(--primary);\n }\n }\n "); }, exports.HorizontalLabel, function (props) { return props
|
|
64
|
+
}, function (props) { return !props.checked && !props.$disabled && !props.$hasError && props.$isCheckable !== false && "\n @media only screen and ".concat(devices_1.devices.lgUp, " {\n &:hover:before {\n border: 1px solid var(--primary);\n }\n }\n "); }, exports.HorizontalLabel, function (props) { return (0, radioInteraction_1.getRadioCursor)(props); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, function (props) { return props.$hasError && !props.$disabled && "\n ".concat(exports.LabelWrapper, ",\n ").concat(exports.TitleLabel, ",\n ").concat(exports.Description, ",\n ").concat(exports.Price, ",\n ").concat(exports.TotalPrice, " {\n color: var(--red);\n }\n\n ").concat(exports.Description, " a {\n color: var(--red);\n }\n "); }, function (props) { return (0, radioInteraction_1.nonCheckableWrapperStyles)(props); }, function (props) { return !props.$disabled && !props.$hasError ? "\n &:checked ~ ".concat(exports.Indicator, " {\n background-image: url('").concat((0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: props.$color || "#9763F6", name: "RadioButtonElementChecked" })), "');\n }\n ") : ""; }, function (props) { return props.$disabled ? "\n pointer-events: none;\n user-select:none;\n " : ""; });
|
|
64
65
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18;
|
|
@@ -64,4 +64,21 @@ describe('RadioButton Horizontal', function () {
|
|
|
64
64
|
renderHorizontal({ label: 'Taksitli Ödeme' });
|
|
65
65
|
expect(react_1.screen.getByText('Taksitli Ödeme')).toBeInTheDocument();
|
|
66
66
|
});
|
|
67
|
+
it('uses default cursor when isCheckable is false', function () {
|
|
68
|
+
var container = renderHorizontal({ isCheckable: false, checked: true }).container;
|
|
69
|
+
expect(container.querySelector('label')).toHaveStyle({ cursor: 'default' });
|
|
70
|
+
});
|
|
71
|
+
it('does not trigger onChange when isCheckable is false', function () {
|
|
72
|
+
var onChange = jest.fn();
|
|
73
|
+
var container = renderHorizontal({
|
|
74
|
+
isCheckable: false,
|
|
75
|
+
checked: false,
|
|
76
|
+
onChange: onChange,
|
|
77
|
+
}).container;
|
|
78
|
+
var label = container.querySelector('label');
|
|
79
|
+
expect(label).not.toHaveAttribute('for');
|
|
80
|
+
react_1.fireEvent.mouseDown(label);
|
|
81
|
+
react_1.fireEvent.click(label);
|
|
82
|
+
expect(onChange).not.toHaveBeenCalled();
|
|
83
|
+
});
|
|
67
84
|
});
|
|
@@ -56,6 +56,8 @@ export interface RadioButton {
|
|
|
56
56
|
showIndicator?: boolean;
|
|
57
57
|
hasError?: boolean;
|
|
58
58
|
errorMessage?: React.ReactNode;
|
|
59
|
+
/** false ise sadece görüntülenir; checked/disabled/error stilleri korunur */
|
|
60
|
+
isCheckable?: boolean;
|
|
59
61
|
}
|
|
60
62
|
export declare const BoxedDefault: RadioButton;
|
|
61
63
|
export declare const BasicDefault: RadioButton;
|
|
@@ -75,6 +77,7 @@ export interface RadioButtonStyledProps {
|
|
|
75
77
|
$alignment?: string;
|
|
76
78
|
$verticalAlign?: string;
|
|
77
79
|
$showIndicator?: boolean;
|
|
80
|
+
$isCheckable?: boolean;
|
|
78
81
|
}
|
|
79
82
|
export type RadioButtonProps = RadioButton;
|
|
80
83
|
export {};
|
|
@@ -60,6 +60,9 @@ declare const _default: {
|
|
|
60
60
|
readOnly: {
|
|
61
61
|
control: string;
|
|
62
62
|
};
|
|
63
|
+
isCheckable: {
|
|
64
|
+
control: string;
|
|
65
|
+
};
|
|
63
66
|
disabled: {
|
|
64
67
|
control: string;
|
|
65
68
|
};
|
|
@@ -397,6 +400,20 @@ export declare const HorizontalWithTitleImage: {
|
|
|
397
400
|
name: string;
|
|
398
401
|
render: () => import("react").JSX.Element;
|
|
399
402
|
};
|
|
403
|
+
export declare const HorizontalNotCheckable: {
|
|
404
|
+
name: string;
|
|
405
|
+
args: {
|
|
406
|
+
label: string;
|
|
407
|
+
description: string;
|
|
408
|
+
valid: boolean;
|
|
409
|
+
layout: string;
|
|
410
|
+
checked: boolean;
|
|
411
|
+
showIndicator: boolean;
|
|
412
|
+
labelOffset: string;
|
|
413
|
+
isCheckable: boolean;
|
|
414
|
+
};
|
|
415
|
+
render: (args: any) => import("react").JSX.Element;
|
|
416
|
+
};
|
|
400
417
|
export declare const HorizontalWithContent: {
|
|
401
418
|
name: string;
|
|
402
419
|
args: {
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.HorizontalChecked = exports.WithoutDescription = exports.BoxedWithBadge = exports.AllLayouts = exports.AllSizes = exports.VerticalAlignment = exports.ReadOnly = exports.Disabled = exports.Invalid = exports.Unchecked = exports.Checked = exports.ColorPicker = exports.HorizontalWithDangerBadge = exports.HorizontalWithRightContent = exports.HorizontalWithContent = exports.HorizontalWithTitleImage = exports.HorizontalDisabled = exports.HorizontalWithError = exports.HorizontalTitleBadgeTopRight = exports.HorizontalTitleBadgeBelowWithDescription = exports.HorizontalTitleBadgeBelow = exports.Horizontal = exports.BoxedMdWithoutIndicator = exports.BoxedMdUnchecked = exports.BoxedMd = exports.BoxedSm = exports.BoxedWithIconGroup = exports.BoxedWithIconUnselected = exports.BoxedWithIcon = exports.Boxed = exports.Basic = exports.Default = void 0;
|
|
17
|
+
exports.HorizontalChecked = exports.WithoutDescription = exports.BoxedWithBadge = exports.AllLayouts = exports.AllSizes = exports.VerticalAlignment = exports.ReadOnly = exports.Disabled = exports.Invalid = exports.Unchecked = exports.Checked = exports.ColorPicker = exports.HorizontalWithDangerBadge = exports.HorizontalWithRightContent = exports.HorizontalWithContent = exports.HorizontalNotCheckable = exports.HorizontalWithTitleImage = exports.HorizontalDisabled = exports.HorizontalWithError = exports.HorizontalTitleBadgeTopRight = exports.HorizontalTitleBadgeBelowWithDescription = exports.HorizontalTitleBadgeBelow = exports.Horizontal = exports.BoxedMdWithoutIndicator = exports.BoxedMdUnchecked = exports.BoxedMd = exports.BoxedSm = exports.BoxedWithIconGroup = exports.BoxedWithIconUnselected = exports.BoxedWithIcon = exports.Boxed = exports.Basic = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var RadioButton_1 = __importDefault(require("../RadioButton"));
|
|
20
20
|
var props_1 = require("../props");
|
|
@@ -46,6 +46,7 @@ exports.default = {
|
|
|
46
46
|
hasError: { control: "boolean" },
|
|
47
47
|
errorMessage: { control: "text" },
|
|
48
48
|
readOnly: { control: "boolean" },
|
|
49
|
+
isCheckable: { control: "boolean" },
|
|
49
50
|
disabled: { control: "boolean" },
|
|
50
51
|
isWrapText: { control: "boolean" },
|
|
51
52
|
hasNoneClick: { control: "boolean" },
|
|
@@ -311,6 +312,20 @@ exports.HorizontalWithTitleImage = {
|
|
|
311
312
|
name: "Horizontal — title (ReactNode + görsel)",
|
|
312
313
|
render: function () { return ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: "720px" } }, { children: (0, jsx_runtime_1.jsx)(RadioButton_1.default, { layout: "horizontal", title: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: "https://kiralarsin.s3.eu-central-1.amazonaws.com/products/4MOMSMAMAROOANAKUC_1.jpg", alt: "", width: 32, height: 32, style: { borderRadius: "0.25rem", objectFit: "cover" } }), (0, jsx_runtime_1.jsx)("span", { children: "Etiyopya torres single" })] })), description: "SKU-001 - \u00C7ekirdek kahve", checked: true, showIndicator: true, labelOffset: "1rem", innerMinHeight: "initial", rightContent: ((0, jsx_runtime_1.jsx)("span", __assign({ style: { color: "var(--grey-50)", font: "var(--body-medium-13-16)" } }, { children: "3 varyasyon" }))) }) }))); },
|
|
313
314
|
};
|
|
315
|
+
exports.HorizontalNotCheckable = {
|
|
316
|
+
name: "Horizontal — not checkable (isCheckable: false)",
|
|
317
|
+
args: {
|
|
318
|
+
label: "Seçili görünüm",
|
|
319
|
+
description: "Sadece görüntüleme — tıklanamaz",
|
|
320
|
+
valid: true,
|
|
321
|
+
layout: "horizontal",
|
|
322
|
+
checked: true,
|
|
323
|
+
showIndicator: true,
|
|
324
|
+
labelOffset: "1rem",
|
|
325
|
+
isCheckable: false,
|
|
326
|
+
},
|
|
327
|
+
render: function (args) { return ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: "720px" } }, { children: (0, jsx_runtime_1.jsx)(RadioButton_1.default, __assign({}, args)) }))); },
|
|
328
|
+
};
|
|
314
329
|
exports.HorizontalWithContent = {
|
|
315
330
|
name: "Horizontal — content (checked)",
|
|
316
331
|
args: {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type RadioInteractionProps = {
|
|
2
|
+
$disabled?: boolean;
|
|
3
|
+
$isCheckable?: boolean;
|
|
4
|
+
};
|
|
5
|
+
type RadioInputInteractionProps = {
|
|
6
|
+
isCheckable?: boolean;
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
onChange?(e: any): void;
|
|
9
|
+
onClick?(): void;
|
|
10
|
+
};
|
|
11
|
+
export declare const getRadioCursor: ({ $disabled, $isCheckable }: RadioInteractionProps) => "default" | "not-allowed" | "pointer";
|
|
12
|
+
export declare const canInteractWithRadio: ({ $readOnly, $isCheckable, }: {
|
|
13
|
+
$readOnly?: boolean;
|
|
14
|
+
$isCheckable?: boolean;
|
|
15
|
+
}) => boolean;
|
|
16
|
+
export declare const getRadioInputInteractionProps: ({ isCheckable, readOnly, onChange, onClick, }: RadioInputInteractionProps) => {
|
|
17
|
+
tabIndex?: number;
|
|
18
|
+
onMouseDown?: (event: {
|
|
19
|
+
preventDefault(): void;
|
|
20
|
+
}) => void;
|
|
21
|
+
readOnly: boolean;
|
|
22
|
+
onChange: (e: any) => void;
|
|
23
|
+
onClick: () => void;
|
|
24
|
+
};
|
|
25
|
+
export declare const getRadioLabelProps: (isCheckable?: boolean, id?: string) => {
|
|
26
|
+
onMouseDown?: (event: {
|
|
27
|
+
preventDefault(): void;
|
|
28
|
+
}) => void;
|
|
29
|
+
onClick?: (event: {
|
|
30
|
+
preventDefault(): void;
|
|
31
|
+
}) => void;
|
|
32
|
+
htmlFor?: string;
|
|
33
|
+
};
|
|
34
|
+
export declare const nonCheckableWrapperStyles: (props: RadioInteractionProps) => "" | "\n pointer-events: none;\n user-select: none;\n ";
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.nonCheckableWrapperStyles = exports.getRadioLabelProps = exports.getRadioInputInteractionProps = exports.canInteractWithRadio = exports.getRadioCursor = void 0;
|
|
15
|
+
var preventInteraction = function (event) {
|
|
16
|
+
event.preventDefault();
|
|
17
|
+
};
|
|
18
|
+
var getRadioCursor = function (_a) {
|
|
19
|
+
var $disabled = _a.$disabled, $isCheckable = _a.$isCheckable;
|
|
20
|
+
if ($disabled)
|
|
21
|
+
return 'not-allowed';
|
|
22
|
+
if ($isCheckable === false)
|
|
23
|
+
return 'default';
|
|
24
|
+
return 'pointer';
|
|
25
|
+
};
|
|
26
|
+
exports.getRadioCursor = getRadioCursor;
|
|
27
|
+
var canInteractWithRadio = function (_a) {
|
|
28
|
+
var $readOnly = _a.$readOnly, $isCheckable = _a.$isCheckable;
|
|
29
|
+
return !($readOnly || $isCheckable === false);
|
|
30
|
+
};
|
|
31
|
+
exports.canInteractWithRadio = canInteractWithRadio;
|
|
32
|
+
var getRadioInputInteractionProps = function (_a) {
|
|
33
|
+
var _b = _a.isCheckable, isCheckable = _b === void 0 ? true : _b, readOnly = _a.readOnly, onChange = _a.onChange, onClick = _a.onClick;
|
|
34
|
+
return (__assign({ readOnly: Boolean(readOnly || !isCheckable), onChange: isCheckable ? onChange : undefined, onClick: isCheckable ? onClick : undefined }, (isCheckable
|
|
35
|
+
? {}
|
|
36
|
+
: {
|
|
37
|
+
tabIndex: -1,
|
|
38
|
+
onMouseDown: preventInteraction,
|
|
39
|
+
})));
|
|
40
|
+
};
|
|
41
|
+
exports.getRadioInputInteractionProps = getRadioInputInteractionProps;
|
|
42
|
+
var getRadioLabelProps = function (isCheckable, id) {
|
|
43
|
+
if (isCheckable === void 0) { isCheckable = true; }
|
|
44
|
+
return (__assign(__assign({}, (isCheckable && id ? { htmlFor: id } : {})), (isCheckable
|
|
45
|
+
? {}
|
|
46
|
+
: {
|
|
47
|
+
onMouseDown: preventInteraction,
|
|
48
|
+
onClick: preventInteraction,
|
|
49
|
+
})));
|
|
50
|
+
};
|
|
51
|
+
exports.getRadioLabelProps = getRadioLabelProps;
|
|
52
|
+
var nonCheckableWrapperStyles = function (props) {
|
|
53
|
+
return props.$isCheckable === false
|
|
54
|
+
? "\n pointer-events: none;\n user-select: none;\n "
|
|
55
|
+
: '';
|
|
56
|
+
};
|
|
57
|
+
exports.nonCheckableWrapperStyles = nonCheckableWrapperStyles;
|
|
@@ -32,7 +32,7 @@ var RadioGroup = function (_a) {
|
|
|
32
32
|
var radioId = option.id || "".concat(name, "_").concat(index);
|
|
33
33
|
var isChecked = value === option.value;
|
|
34
34
|
var optionHasError = (_a = option.hasError) !== null && _a !== void 0 ? _a : hasError;
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)(RadioButton_1.default, { id: radioId, name: name, value: option.value, checked: isChecked, onChange: function (e) { return handleRadioChange(option.value); }, label: option.label, title: option.title, description: option.description, image: option.image, disabled: disabled || option.disabled, alignment: option.alignment, isWrapText: option.isWrapText, size: size, textSize: textSize, layout: radioLayout, valid: valid, labelOffset: labelOffset, color: option.color || color, verticalAlign: verticalAlign, readOnly: readOnly, labelSm: option.labelSm, hasBadge: option.hasBadge, badgeText: option.badgeText, badgeVariant: option.badgeVariant, price: option.price, priceDesc: option.priceDesc, hasTitleBadge: option.hasTitleBadge, titleBadgeLayout: option.titleBadgeLayout, titleBadgeText: option.titleBadgeText, hasPriceBadge: option.hasPriceBadge, priceBadgeLayout: option.priceBadgeLayout, priceBadgeText: option.priceBadgeText, iconName: option.iconName, iconColor: option.iconColor, content: option.content, showIndicator: showIndicator, titleBadgePosition: option.titleBadgePosition, rightContent: option.rightContent, innerMinHeight: option.innerMinHeight, hasError: optionHasError, errorMessage: option.errorMessage }, radioId));
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(RadioButton_1.default, { id: radioId, name: name, value: option.value, checked: isChecked, onChange: function (e) { return handleRadioChange(option.value); }, label: option.label, title: option.title, description: option.description, image: option.image, disabled: disabled || option.disabled, alignment: option.alignment, isWrapText: option.isWrapText, size: size, textSize: textSize, layout: radioLayout, valid: valid, labelOffset: labelOffset, color: option.color || color, verticalAlign: verticalAlign, readOnly: readOnly, labelSm: option.labelSm, hasBadge: option.hasBadge, badgeText: option.badgeText, badgeVariant: option.badgeVariant, price: option.price, priceDesc: option.priceDesc, hasTitleBadge: option.hasTitleBadge, titleBadgeLayout: option.titleBadgeLayout, titleBadgeText: option.titleBadgeText, hasPriceBadge: option.hasPriceBadge, priceBadgeLayout: option.priceBadgeLayout, priceBadgeText: option.priceBadgeText, iconName: option.iconName, iconColor: option.iconColor, content: option.content, showIndicator: showIndicator, titleBadgePosition: option.titleBadgePosition, rightContent: option.rightContent, innerMinHeight: option.innerMinHeight, hasError: optionHasError, errorMessage: option.errorMessage, isCheckable: option.isCheckable }, radioId));
|
|
36
36
|
}) }))] }));
|
|
37
37
|
};
|
|
38
38
|
exports.default = RadioGroup;
|
|
@@ -44,4 +44,10 @@ describe('RadioGroup', function () {
|
|
|
44
44
|
expect(react_1.screen.getByTestId('title-image')).toBeInTheDocument();
|
|
45
45
|
expect(react_1.screen.getByText('Özel başlık')).toBeInTheDocument();
|
|
46
46
|
});
|
|
47
|
+
it('forwards isCheckable from option to RadioButton', function () {
|
|
48
|
+
var container = (0, react_1.render)((0, jsx_runtime_1.jsx)(RadioGroup_1.default, { name: "test-group", radioLayout: "horizontal", value: "a", options: [
|
|
49
|
+
__assign(__assign({}, baseOptions[0]), { isCheckable: false }),
|
|
50
|
+
] })).container;
|
|
51
|
+
expect(container.querySelector('label')).toHaveStyle({ cursor: 'default' });
|
|
52
|
+
});
|
|
47
53
|
});
|
|
@@ -43,6 +43,8 @@ export interface RadioOption {
|
|
|
43
43
|
innerMinHeight?: "70" | "initial";
|
|
44
44
|
hasError?: boolean;
|
|
45
45
|
errorMessage?: React.ReactNode;
|
|
46
|
+
/** false ise sadece görüntülenir; checked/disabled/error stilleri korunur */
|
|
47
|
+
isCheckable?: boolean;
|
|
46
48
|
}
|
|
47
49
|
export interface RadioGroup {
|
|
48
50
|
options?: RadioOption[];
|
|
@@ -430,6 +430,100 @@ export declare const HorizontalInstallmentWithTitleImage: {
|
|
|
430
430
|
};
|
|
431
431
|
render: (args: any) => React.JSX.Element;
|
|
432
432
|
};
|
|
433
|
+
export declare const HorizontalInstallmentNotCheckable: {
|
|
434
|
+
name: string;
|
|
435
|
+
args: {
|
|
436
|
+
options: ({
|
|
437
|
+
label: string;
|
|
438
|
+
value: string;
|
|
439
|
+
description: string;
|
|
440
|
+
price: string;
|
|
441
|
+
priceDesc: string;
|
|
442
|
+
hasTitleBadge: boolean;
|
|
443
|
+
titleBadgeLayout: string;
|
|
444
|
+
titleBadgeText: string;
|
|
445
|
+
hasPriceBadge: boolean;
|
|
446
|
+
priceBadgeLayout: string;
|
|
447
|
+
priceBadgeText: string;
|
|
448
|
+
disabled?: undefined;
|
|
449
|
+
} | {
|
|
450
|
+
label: string;
|
|
451
|
+
value: string;
|
|
452
|
+
description: string;
|
|
453
|
+
price: string;
|
|
454
|
+
priceDesc: string;
|
|
455
|
+
hasTitleBadge: boolean;
|
|
456
|
+
hasPriceBadge: boolean;
|
|
457
|
+
titleBadgeLayout?: undefined;
|
|
458
|
+
titleBadgeText?: undefined;
|
|
459
|
+
priceBadgeLayout?: undefined;
|
|
460
|
+
priceBadgeText?: undefined;
|
|
461
|
+
disabled?: undefined;
|
|
462
|
+
} | {
|
|
463
|
+
label: string;
|
|
464
|
+
value: string;
|
|
465
|
+
description: string;
|
|
466
|
+
price: string;
|
|
467
|
+
priceDesc: string;
|
|
468
|
+
hasTitleBadge: boolean;
|
|
469
|
+
titleBadgeLayout: string;
|
|
470
|
+
titleBadgeText: string;
|
|
471
|
+
hasPriceBadge: boolean;
|
|
472
|
+
priceBadgeLayout: string;
|
|
473
|
+
priceBadgeText: string;
|
|
474
|
+
disabled: boolean;
|
|
475
|
+
} | {
|
|
476
|
+
isCheckable: boolean;
|
|
477
|
+
label: string;
|
|
478
|
+
value: string;
|
|
479
|
+
description: string;
|
|
480
|
+
price: string;
|
|
481
|
+
priceDesc: string;
|
|
482
|
+
hasTitleBadge: boolean;
|
|
483
|
+
titleBadgeLayout: string;
|
|
484
|
+
titleBadgeText: string;
|
|
485
|
+
hasPriceBadge: boolean;
|
|
486
|
+
priceBadgeLayout: string;
|
|
487
|
+
priceBadgeText: string;
|
|
488
|
+
disabled?: undefined;
|
|
489
|
+
} | {
|
|
490
|
+
isCheckable: boolean;
|
|
491
|
+
label: string;
|
|
492
|
+
value: string;
|
|
493
|
+
description: string;
|
|
494
|
+
price: string;
|
|
495
|
+
priceDesc: string;
|
|
496
|
+
hasTitleBadge: boolean;
|
|
497
|
+
hasPriceBadge: boolean;
|
|
498
|
+
titleBadgeLayout?: undefined;
|
|
499
|
+
titleBadgeText?: undefined;
|
|
500
|
+
priceBadgeLayout?: undefined;
|
|
501
|
+
priceBadgeText?: undefined;
|
|
502
|
+
disabled?: undefined;
|
|
503
|
+
} | {
|
|
504
|
+
isCheckable: boolean;
|
|
505
|
+
label: string;
|
|
506
|
+
value: string;
|
|
507
|
+
description: string;
|
|
508
|
+
price: string;
|
|
509
|
+
priceDesc: string;
|
|
510
|
+
hasTitleBadge: boolean;
|
|
511
|
+
titleBadgeLayout: string;
|
|
512
|
+
titleBadgeText: string;
|
|
513
|
+
hasPriceBadge: boolean;
|
|
514
|
+
priceBadgeLayout: string;
|
|
515
|
+
priceBadgeText: string;
|
|
516
|
+
disabled: boolean;
|
|
517
|
+
})[];
|
|
518
|
+
value: string;
|
|
519
|
+
name: string;
|
|
520
|
+
label: string;
|
|
521
|
+
onChange: (value: any) => void;
|
|
522
|
+
layout: string;
|
|
523
|
+
radioLayout: string;
|
|
524
|
+
gap: string;
|
|
525
|
+
};
|
|
526
|
+
};
|
|
433
527
|
export declare const HorizontalInstallmentWithError: {
|
|
434
528
|
name: string;
|
|
435
529
|
args: {
|
|
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.AllRadioLayouts = exports.VariantPricing = exports.HorizontalInstallmentWithError = exports.HorizontalInstallmentWithTitleImage = exports.HorizontalInstallment = exports.BoxedWithIconLayout = exports.WithDescriptions = exports.WithDisabledOptions = exports.ColorPicker = exports.GridStackedOnMobile = exports.GridTwoColumns = exports.WithInfoArea = exports.BoxedMdWithoutIndicator = exports.BoxedMdFilled = exports.BoxedMdLayout = exports.BoxedSmFilled = exports.BoxedSmLayout = exports.BoxedLayout = exports.Horizontal = exports.VerticalHorizontalOnMobile = exports.WithoutIndicator = exports.Default = void 0;
|
|
17
|
+
exports.AllRadioLayouts = exports.VariantPricing = exports.HorizontalInstallmentWithError = exports.HorizontalInstallmentNotCheckable = exports.HorizontalInstallmentWithTitleImage = exports.HorizontalInstallment = exports.BoxedWithIconLayout = exports.WithDescriptions = exports.WithDisabledOptions = exports.ColorPicker = exports.GridStackedOnMobile = exports.GridTwoColumns = exports.WithInfoArea = exports.BoxedMdWithoutIndicator = exports.BoxedMdFilled = exports.BoxedMdLayout = exports.BoxedSmFilled = exports.BoxedSmLayout = exports.BoxedLayout = exports.Horizontal = exports.VerticalHorizontalOnMobile = exports.WithoutIndicator = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var react_1 = __importDefault(require("react"));
|
|
20
20
|
var RadioGroup_1 = __importDefault(require("../RadioGroup"));
|
|
@@ -416,6 +416,12 @@ exports.HorizontalInstallmentWithTitleImage = {
|
|
|
416
416
|
},
|
|
417
417
|
render: function (args) { return ((0, jsx_runtime_1.jsx)("div", __assign({ style: { maxWidth: "720px" } }, { children: (0, jsx_runtime_1.jsx)(RadioGroup_1.default, __assign({}, args)) }))); },
|
|
418
418
|
};
|
|
419
|
+
exports.HorizontalInstallmentNotCheckable = {
|
|
420
|
+
name: "Horizontal — not checkable",
|
|
421
|
+
args: __assign(__assign({}, exports.HorizontalInstallment.args), { options: horizontalOptions.map(function (option, index) {
|
|
422
|
+
return index === 0 ? __assign(__assign({}, option), { isCheckable: false }) : option;
|
|
423
|
+
}), value: "installment" }),
|
|
424
|
+
};
|
|
419
425
|
exports.HorizontalInstallmentWithError = {
|
|
420
426
|
name: "Horizontal — error",
|
|
421
427
|
args: __assign(__assign({}, exports.HorizontalInstallment.args), { name: "horizontalInstallmentErrorRadioGroup", hasError: true, options: horizontalOptions.map(function (option, index) {
|