krl-alfred 2.24.2 → 2.24.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +6 -13
- package/dist/components/Checkbox/Checkbox.styled.js +2 -17
- package/dist/components/Checkbox/Checkbox.test.js +28 -3
- package/dist/components/Checkbox/CheckboxIndicator.d.ts +10 -0
- package/dist/components/Checkbox/CheckboxIndicator.js +30 -0
- package/dist/components/Checkbox/props.d.ts +0 -3
- package/dist/components/Modal/Modal.js +11 -20
- package/dist/components/Modal/Modal.test.d.ts +1 -0
- package/dist/components/Modal/Modal.test.js +62 -0
- package/dist/components/Modal/core/bodyScrollLock.d.ts +4 -0
- package/dist/components/Modal/core/bodyScrollLock.js +30 -0
- package/dist/components/Modal/stories/Modal.stories.d.ts +17 -0
- package/dist/components/Modal/stories/Modal.stories.js +14 -1
- package/dist/components/RadioButton/RadioButton.test.d.ts +1 -0
- package/dist/components/RadioButton/RadioButton.test.js +97 -0
- package/dist/components/RadioButton/RadioIndicator.d.ts +10 -0
- package/dist/components/RadioButton/RadioIndicator.js +36 -0
- package/dist/components/RadioButton/RadioIndicator.styled.d.ts +2 -0
- package/dist/components/RadioButton/RadioIndicator.styled.js +11 -0
- package/dist/components/RadioButton/layouts/basic/Basic.d.ts +1 -1
- package/dist/components/RadioButton/layouts/basic/Basic.js +6 -4
- package/dist/components/RadioButton/layouts/basic/Basic.styled.js +3 -5
- package/dist/components/RadioButton/layouts/boxed/Boxed.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxed/Boxed.js +3 -4
- package/dist/components/RadioButton/layouts/boxed/Boxed.styled.js +3 -5
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.js +6 -4
- package/dist/components/RadioButton/layouts/boxedMd/BoxedMd.styled.js +3 -5
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.js +6 -4
- package/dist/components/RadioButton/layouts/boxedSm/BoxedSm.styled.js +3 -5
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.d.ts +1 -1
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.js +3 -3
- package/dist/components/RadioButton/layouts/boxedWithIcon/BoxedWithIcon.styled.js +3 -5
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.js +3 -4
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.styled.d.ts +0 -1
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.styled.js +28 -24
- package/dist/components/RadioButton/props.d.ts +0 -1
- package/dist/components/ShoppingCartProduct/ShoppingCartProduct.js +3 -1
- package/dist/components/ShoppingCartProduct/ShoppingCartProduct.test.d.ts +1 -0
- package/dist/components/ShoppingCartProduct/ShoppingCartProduct.test.js +112 -0
- package/dist/style/style.min.css +1 -1
- package/dist/style/style.min.css.map +1 -1
- package/dist/utils/getRootCssVariable.d.ts +0 -1
- package/dist/utils/getRootCssVariable.js +1 -2
- package/package.json +1 -1
|
@@ -10,14 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
13
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
18
|
var props_1 = require("./../../props");
|
|
16
|
-
var getRootCssVariable_1 = require("../../../../utils/getRootCssVariable");
|
|
17
19
|
var Basic_styled_1 = require("./Basic.styled");
|
|
18
20
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
21
|
+
var RadioIndicator_1 = __importDefault(require("../../RadioIndicator"));
|
|
19
22
|
var Basic = function (_a) {
|
|
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;
|
|
23
|
+
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, color = _a.color;
|
|
21
24
|
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
22
25
|
isCheckable: isCheckable,
|
|
23
26
|
readOnly: readOnly,
|
|
@@ -34,11 +37,10 @@ var Basic = function (_a) {
|
|
|
34
37
|
$isWrapText: isWrapText,
|
|
35
38
|
$readOnly: readOnly,
|
|
36
39
|
$isCheckable: isCheckable,
|
|
37
|
-
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
38
40
|
$alignment: alignment,
|
|
39
41
|
$textSize: textSize,
|
|
40
42
|
$verticalAlign: verticalAlign,
|
|
41
43
|
};
|
|
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 })))] })))] })));
|
|
44
|
+
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, { children: (0, jsx_runtime_1.jsx)(RadioIndicator_1.default, { disabled: disabled, valid: valid, color: color }) }))), (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 })))] })))] })));
|
|
43
45
|
};
|
|
44
46
|
exports.default = Basic;
|
|
@@ -8,12 +8,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.BasicStyled = exports.DescriptionText = exports.LabelText = exports.LabelsWrapper = exports.Indicator = void 0;
|
|
11
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
|
-
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
12
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
16
|
-
|
|
13
|
+
var RadioIndicator_styled_1 = require("../../RadioIndicator.styled");
|
|
14
|
+
exports.Indicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 0 0 auto;\n ", "\n display: block;\n position: relative;\n margin: ", " ", " 0 0;\n width: ", ";\n height: ", ";\n"], ["\n flex: 0 0 auto;\n ", "\n display: block;\n position: relative;\n margin: ", " ", " 0 0;\n width: ", ";\n height: ", ";\n"])), RadioIndicator_styled_1.radioIndicatorIconStyles, function (props) { return props.$alignment === "vertical" ? "0.5rem" : props.$verticalAlign === "flex-start" ? "1px" : 0; }, function (props) { return props.$labelOffset; }, function (props) {
|
|
17
15
|
switch (props.$size) {
|
|
18
16
|
case 'xsmall':
|
|
19
17
|
return "16px";
|
|
@@ -50,5 +48,5 @@ exports.LabelText = styled_components_1.default.label(templateObject_3 || (templ
|
|
|
50
48
|
}
|
|
51
49
|
});
|
|
52
50
|
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"])));
|
|
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
|
|
51
|
+
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 ", "\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 ", "\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, RadioIndicator_styled_1.radioIndicatorCheckedStyles);
|
|
54
52
|
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, isCheckable, }: 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, color, }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default Boxed;
|
|
@@ -16,12 +16,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
18
|
var props_1 = require("./../../props");
|
|
19
|
-
var
|
|
19
|
+
var RadioIndicator_1 = __importDefault(require("../../RadioIndicator"));
|
|
20
20
|
var Boxed_styled_1 = require("./Boxed.styled");
|
|
21
21
|
var Badges_1 = __importDefault(require("../../../Badges"));
|
|
22
22
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
23
23
|
var Boxed = function (_a) {
|
|
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;
|
|
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, color = _a.color;
|
|
25
25
|
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
26
26
|
isCheckable: isCheckable,
|
|
27
27
|
readOnly: readOnly,
|
|
@@ -36,9 +36,8 @@ var Boxed = function (_a) {
|
|
|
36
36
|
$labelOffset: labelOffset,
|
|
37
37
|
$readOnly: readOnly,
|
|
38
38
|
$isCheckable: isCheckable,
|
|
39
|
-
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
40
39
|
$textSize: textSize,
|
|
41
40
|
};
|
|
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 }) }))] })));
|
|
41
|
+
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, { children: (0, jsx_runtime_1.jsx)(RadioIndicator_1.default, { disabled: disabled, valid: valid, color: color }) }))), (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 }) }))] })));
|
|
43
42
|
};
|
|
44
43
|
exports.default = Boxed;
|
|
@@ -8,13 +8,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.BoxedStyled = exports.BoxedBadgesWrapper = exports.ImageLabel = exports.DescriptionText = exports.LabelSm = exports.LabelText = exports.LabelsWrapper = exports.Indicator = void 0;
|
|
11
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
|
-
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
12
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
16
13
|
var devices_1 = require("../../../../constants/devices");
|
|
17
|
-
|
|
14
|
+
var RadioIndicator_styled_1 = require("../../RadioIndicator.styled");
|
|
15
|
+
exports.Indicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n display: block;\n position: absolute;\n left: 12px;\n top: 12px;\n margin: ", ";\n width: ", ";\n height: ", ";\n"], ["\n ", "\n display: block;\n position: absolute;\n left: 12px;\n top: 12px;\n margin: ", ";\n width: ", ";\n height: ", ";\n"])), RadioIndicator_styled_1.radioIndicatorIconStyles, function (props) { return (props.$size === "small" ? "0 8px 0 0" : "0 16px 0 0"); }, function (props) {
|
|
18
16
|
switch (props.$size) {
|
|
19
17
|
case 'small':
|
|
20
18
|
return "16px";
|
|
@@ -39,5 +37,5 @@ exports.LabelSm = styled_components_1.default.span(templateObject_4 || (template
|
|
|
39
37
|
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);
|
|
40
38
|
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"])));
|
|
41
39
|
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);
|
|
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
|
|
40
|
+
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 ", "\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 ", "\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, RadioIndicator_styled_1.radioIndicatorCheckedStyles, 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 "); });
|
|
43
41
|
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, isCheckable, }: 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, color, }: RadioButtonProps) => import("react").JSX.Element;
|
|
4
4
|
export default BoxedMd;
|
|
@@ -10,14 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
13
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
18
|
var props_1 = require("./../../props");
|
|
16
|
-
var
|
|
19
|
+
var RadioIndicator_1 = __importDefault(require("../../RadioIndicator"));
|
|
17
20
|
var BoxedMd_styled_1 = require("./BoxedMd.styled");
|
|
18
21
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
19
22
|
var BoxedMd = function (_a) {
|
|
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;
|
|
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, 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, color = _a.color;
|
|
21
24
|
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
22
25
|
isCheckable: isCheckable,
|
|
23
26
|
readOnly: readOnly,
|
|
@@ -32,10 +35,9 @@ var BoxedMd = function (_a) {
|
|
|
32
35
|
$labelOffset: labelOffset,
|
|
33
36
|
$readOnly: readOnly,
|
|
34
37
|
$isCheckable: isCheckable,
|
|
35
|
-
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
36
38
|
$textSize: textSize,
|
|
37
39
|
$showIndicator: showIndicator,
|
|
38
40
|
};
|
|
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 }))) })))] })));
|
|
41
|
+
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, { children: (0, jsx_runtime_1.jsx)(RadioIndicator_1.default, { disabled: disabled, valid: valid, color: color }) }))), (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 }))) })))] })));
|
|
40
42
|
};
|
|
41
43
|
exports.default = BoxedMd;
|
|
@@ -8,12 +8,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.BoxedMdStyled = exports.LabelText = exports.LabelsWrapper = exports.Indicator = void 0;
|
|
11
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
|
-
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
12
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
16
|
-
|
|
13
|
+
var RadioIndicator_styled_1 = require("../../RadioIndicator.styled");
|
|
14
|
+
exports.Indicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\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 ", "\n display: block;\n position: absolute;\n left: 1.5rem;\n top: 50%;\n transform: translateY(-50%);\n margin: ", ";\n width: ", ";\n height: ", ";\n"])), RadioIndicator_styled_1.radioIndicatorIconStyles, function (props) { return (props.$size === "small" ? "0 8px 0 0" : "0 16px 0 0"); }, function (props) {
|
|
17
15
|
switch (props.$size) {
|
|
18
16
|
case 'small':
|
|
19
17
|
return "16px";
|
|
@@ -43,5 +41,5 @@ exports.LabelText = styled_components_1.default.label(templateObject_3 || (templ
|
|
|
43
41
|
return "var(--body-semi-bold-14-17)";
|
|
44
42
|
}
|
|
45
43
|
});
|
|
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
|
|
44
|
+
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 ", "\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 ", "\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, RadioIndicator_styled_1.radioIndicatorCheckedStyles, function (props) { return (0, radioInteraction_1.canInteractWithRadio)(props) && " , &:hover"; }, exports.LabelsWrapper, exports.LabelsWrapper);
|
|
47
45
|
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, isCheckable, }: 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, color, }: RadioButtonProps) => import("react").JSX.Element;
|
|
4
4
|
export default BoxedSm;
|
|
@@ -10,14 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
13
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
15
18
|
var props_1 = require("./../../props");
|
|
16
|
-
var
|
|
19
|
+
var RadioIndicator_1 = __importDefault(require("../../RadioIndicator"));
|
|
17
20
|
var BoxedSm_styled_1 = require("./BoxedSm.styled");
|
|
18
21
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
19
22
|
var BoxedSm = function (_a) {
|
|
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;
|
|
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, 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, color = _a.color;
|
|
21
24
|
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
22
25
|
isCheckable: isCheckable,
|
|
23
26
|
readOnly: readOnly,
|
|
@@ -32,10 +35,9 @@ var BoxedSm = function (_a) {
|
|
|
32
35
|
$labelOffset: labelOffset,
|
|
33
36
|
$readOnly: readOnly,
|
|
34
37
|
$isCheckable: isCheckable,
|
|
35
|
-
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
36
38
|
$textSize: textSize,
|
|
37
39
|
$showIndicator: showIndicator,
|
|
38
40
|
};
|
|
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 }))) })))] })));
|
|
41
|
+
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, { children: (0, jsx_runtime_1.jsx)(RadioIndicator_1.default, { disabled: disabled, valid: valid, color: color }) }))), (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 }))) })))] })));
|
|
40
42
|
};
|
|
41
43
|
exports.default = BoxedSm;
|
|
@@ -8,12 +8,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.BoxedSmStyled = exports.LabelText = exports.LabelsWrapper = exports.Indicator = void 0;
|
|
11
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
|
-
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
12
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
16
|
-
|
|
13
|
+
var RadioIndicator_styled_1 = require("../../RadioIndicator.styled");
|
|
14
|
+
exports.Indicator = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n display: block;\n position: absolute;\n left: 1rem;\n top: 50%;\n transform: translateY(-50%);\n margin: ", ";\n width: ", ";\n height: ", ";\n"], ["\n ", "\n display: block;\n position: absolute;\n left: 1rem;\n top: 50%;\n transform: translateY(-50%);\n margin: ", ";\n width: ", ";\n height: ", ";\n"])), RadioIndicator_styled_1.radioIndicatorIconStyles, function (props) { return (props.$size === "small" ? "0 8px 0 0" : "0 16px 0 0"); }, function (props) {
|
|
17
15
|
switch (props.$size) {
|
|
18
16
|
case 'small':
|
|
19
17
|
return "16px";
|
|
@@ -43,5 +41,5 @@ exports.LabelText = styled_components_1.default.label(templateObject_3 || (templ
|
|
|
43
41
|
return "var(--body-semi-bold-14-17)";
|
|
44
42
|
}
|
|
45
43
|
});
|
|
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
|
|
44
|
+
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 ", "\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 ", "\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, RadioIndicator_styled_1.radioIndicatorCheckedStyles, function (props) { return (0, radioInteraction_1.canInteractWithRadio)(props) && " , &:hover"; }, exports.LabelsWrapper, exports.LabelsWrapper);
|
|
47
45
|
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, isCheckable, }: 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, color, }: RadioButtonProps) => React.JSX.Element;
|
|
4
4
|
export default BoxedWithIcon;
|
|
@@ -16,18 +16,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
18
|
var props_1 = require("../../props");
|
|
19
|
-
var
|
|
19
|
+
var RadioIndicator_1 = __importDefault(require("../../RadioIndicator"));
|
|
20
20
|
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
21
21
|
var BoxedWithIcon_styled_1 = require("./BoxedWithIcon.styled");
|
|
22
22
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
23
23
|
var BoxedWithIcon = function (_a) {
|
|
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;
|
|
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, color = _a.color;
|
|
25
25
|
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
26
26
|
isCheckable: isCheckable,
|
|
27
27
|
readOnly: readOnly,
|
|
28
28
|
onChange: onChange,
|
|
29
29
|
onClick: onClick,
|
|
30
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
|
|
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 }, { 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, __assign({ "$disabled": disabled, "$valid": valid }, { children: (0, jsx_runtime_1.jsx)(RadioIndicator_1.default, { disabled: disabled, valid: valid, color: color }) }))] }), 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 })] }))] })] })));
|
|
32
32
|
};
|
|
33
33
|
exports.default = BoxedWithIcon;
|
|
@@ -8,17 +8,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.BoxedWithIconStyled = exports.Content = exports.Separator = exports.Indicator = exports.Label = exports.IconWrapper = exports.Header = exports.ContentWrapper = void 0;
|
|
11
|
-
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
13
|
-
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
14
|
-
var svgToBase64_1 = __importDefault(require("../../../../utils/svgToBase64"));
|
|
15
12
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
13
|
+
var RadioIndicator_styled_1 = require("../../RadioIndicator.styled");
|
|
16
14
|
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"])));
|
|
17
15
|
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"])));
|
|
18
16
|
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
17
|
exports.Label = styled_components_1.default.span(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 1;\n font: var(--body-semi-bold-14-17);\n color: var(--dark-opacity-75);\n cursor: inherit;\n margin: 0;\n min-width: 0;\n"], ["\n flex: 1;\n font: var(--body-semi-bold-14-17);\n color: var(--dark-opacity-75);\n cursor: inherit;\n margin: 0;\n min-width: 0;\n"])));
|
|
20
|
-
exports.Indicator = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex-shrink: 0;\n
|
|
18
|
+
exports.Indicator = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n flex-shrink: 0;\n ", "\n width: 20px;\n height: 20px;\n display: block;\n position: absolute;\n right: 1rem;\n top: 1rem;\n"], ["\n flex-shrink: 0;\n ", "\n width: 20px;\n height: 20px;\n display: block;\n position: absolute;\n right: 1rem;\n top: 1rem;\n"])), RadioIndicator_styled_1.radioIndicatorIconStyles);
|
|
21
19
|
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"])));
|
|
22
20
|
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"])));
|
|
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: var(--theme-bg-color);\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
|
|
21
|
+
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: var(--theme-bg-color);\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 ", "\n }\n }\n"], ["\n display: block;\n position: relative;\n border-radius: 0.5rem;\n border: 1px solid ", ";\n background-color: var(--theme-bg-color);\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 ", "\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, RadioIndicator_styled_1.radioIndicatorCheckedStyles);
|
|
24
22
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
|
|
@@ -15,13 +15,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
-
var
|
|
18
|
+
var RadioIndicator_1 = __importDefault(require("../../RadioIndicator"));
|
|
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
22
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
23
23
|
var Horizontal = function (props) {
|
|
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;
|
|
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, color = props.color;
|
|
25
25
|
var inputInteraction = (0, radioInteraction_1.getRadioInputInteractionProps)({
|
|
26
26
|
isCheckable: isCheckable,
|
|
27
27
|
readOnly: readOnly,
|
|
@@ -37,7 +37,6 @@ var Horizontal = function (props) {
|
|
|
37
37
|
$disabled: disabled,
|
|
38
38
|
$valid: valid,
|
|
39
39
|
$hasError: hasError,
|
|
40
|
-
$color: (0, getRootCssVariable_1.getRadioPrimaryColor)(),
|
|
41
40
|
$labelOffset: labelOffset,
|
|
42
41
|
$titleBadgeBelow: titleBadgeBelow,
|
|
43
42
|
$titleBadgeTopRight: titleBadgeTopRight,
|
|
@@ -47,6 +46,6 @@ var Horizontal = function (props) {
|
|
|
47
46
|
};
|
|
48
47
|
var titleBadgeElement = ((0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: titleBadgeLayout, title: titleBadgeText }));
|
|
49
48
|
var titleBadge = hasTitleBadge && !titleBadgeTopRight && ((0, jsx_runtime_1.jsx)(Horizontal_styled_1.BadgesWrapper, __assign({}, styledProps, { children: titleBadgeElement })));
|
|
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 })] })))] }));
|
|
49
|
+
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, { children: (0, jsx_runtime_1.jsx)(RadioIndicator_1.default, { disabled: disabled, valid: valid, hasError: hasError, color: color, checkedGlyphWhenDisabled: true }) }))), (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 })] })))] }));
|
|
51
50
|
};
|
|
52
51
|
exports.default = Horizontal;
|
|
@@ -3,17 +3,35 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
3
3
|
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
4
|
return cooked;
|
|
5
5
|
};
|
|
6
|
-
var
|
|
7
|
-
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
8
28
|
};
|
|
9
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
30
|
exports.HorizontalBoxStyled = exports.ContentArea = exports.TotalLabel = exports.TotalPrice = exports.Price = exports.RightContent = exports.HorizontalRoot = exports.ErrorMessage = exports.Description = exports.TitleBadgeTopRight = exports.BadgesWrapper = exports.TitleLabel = exports.LabelWrapper = exports.LabelContent = exports.Indicator = exports.LeftContent = exports.Inner = exports.HorizontalLabel = void 0;
|
|
11
|
-
var
|
|
12
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
31
|
+
var styled_components_1 = __importStar(require("styled-components"));
|
|
13
32
|
var devices_1 = require("../../../../constants/devices");
|
|
14
|
-
var svgToBase64_1 = __importDefault(require("./../../../../utils/svgToBase64"));
|
|
15
|
-
var Icon_1 = __importDefault(require("../../../Icon/Icon"));
|
|
16
33
|
var radioInteraction_1 = require("../../utils/radioInteraction");
|
|
34
|
+
var RadioIndicator_styled_1 = require("../../RadioIndicator.styled");
|
|
17
35
|
var getIndicatorSize = function (size) {
|
|
18
36
|
switch (size) {
|
|
19
37
|
case 'medium':
|
|
@@ -25,21 +43,7 @@ var getIndicatorSize = function (size) {
|
|
|
25
43
|
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); });
|
|
26
44
|
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);
|
|
27
45
|
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"])));
|
|
28
|
-
exports.Indicator = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 0 0 auto;\n
|
|
29
|
-
if (props.$disabled) {
|
|
30
|
-
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#C2C3CE", name: "RadioButtonElementChecked" }));
|
|
31
|
-
}
|
|
32
|
-
if (props.$hasError) {
|
|
33
|
-
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#FF1F1F", name: "RadioButtonElementInvalid" }));
|
|
34
|
-
}
|
|
35
|
-
if (props.checked) {
|
|
36
|
-
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: props.$color || "#9763F6", name: "RadioButtonElementChecked" }));
|
|
37
|
-
}
|
|
38
|
-
if (props.$valid) {
|
|
39
|
-
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#9763F6", name: "RadioButtonElementUnchecked" }));
|
|
40
|
-
}
|
|
41
|
-
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#FF1F1F", name: "RadioButtonElementInvalid" }));
|
|
42
|
-
}, function (props) { return props.$labelOffset || "0.5rem"; }, function (props) { return getIndicatorSize(props.$size); }, function (props) { return getIndicatorSize(props.$size); });
|
|
46
|
+
exports.Indicator = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex: 0 0 auto;\n ", "\n ", "\n display: block;\n position: relative;\n margin: 0 ", " 0 0;\n width: ", ";\n height: ", ";\n"], ["\n flex: 0 0 auto;\n ", "\n ", "\n display: block;\n position: relative;\n margin: 0 ", " 0 0;\n width: ", ";\n height: ", ";\n"])), RadioIndicator_styled_1.radioIndicatorIconStyles, function (props) { return props.checked && !props.$disabled && !props.$hasError && RadioIndicator_styled_1.radioIndicatorCheckedStyles; }, function (props) { return props.$labelOffset || "0.5rem"; }, function (props) { return getIndicatorSize(props.$size); }, function (props) { return getIndicatorSize(props.$size); });
|
|
43
47
|
exports.LabelContent = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: grid;\n align-items: center;\n justify-content: flex-start;\n"], ["\n display: grid;\n align-items: center;\n justify-content: flex-start;\n"])));
|
|
44
48
|
exports.LabelWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n align-items: ", ";\n justify-content: flex-start;\n flex-direction: ", ";\n font: var(--body-semi-bold-14-17);\n row-gap: ", ";\n\n @media only screen and ", " {\n ", "\n }\n"], ["\n display: flex;\n align-items: ", ";\n justify-content: flex-start;\n flex-direction: ", ";\n font: var(--body-semi-bold-14-17);\n row-gap: ", ";\n\n @media only screen and ", " {\n ", "\n }\n"])), function (props) { return (props.$titleBadgeBelow ? "flex-start" : "center"); }, function (props) { return (props.$titleBadgeBelow ? "column" : "row"); }, function (props) { return (props.$titleBadgeBelow ? "0.25rem" : "0"); }, devices_1.devices.sm, function (props) { return !props.$titleBadgeBelow && "display: block;"; });
|
|
45
49
|
exports.TitleLabel = styled_components_1.default.span(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: wrap;\n min-width: 0;\n\n img,\n svg {\n flex-shrink: 0;\n display: block;\n }\n"], ["\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: wrap;\n min-width: 0;\n\n img,\n svg {\n flex-shrink: 0;\n display: block;\n }\n"])));
|
|
@@ -53,7 +57,7 @@ exports.Price = styled_components_1.default.strong(templateObject_14 || (templat
|
|
|
53
57
|
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"])));
|
|
54
58
|
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);
|
|
55
59
|
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);
|
|
56
|
-
exports.HorizontalBoxStyled = styled_components_1.default.div(
|
|
60
|
+
exports.HorizontalBoxStyled = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n display: block;\n position: relative;\n flex: none !important;\n border-radius: 0.5rem;\n background-color: var(--theme-bg-color);\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: var(--theme-bg-color);\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) {
|
|
57
61
|
if (props.$disabled)
|
|
58
62
|
return '1px solid var(--grey-10)';
|
|
59
63
|
if (props.$hasError)
|
|
@@ -61,5 +65,5 @@ exports.HorizontalBoxStyled = styled_components_1.default.div(templateObject_18
|
|
|
61
65
|
if (props.checked)
|
|
62
66
|
return '2px solid var(--primary)';
|
|
63
67
|
return '1px solid var(--dark-opacity-10)';
|
|
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
|
|
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;
|
|
68
|
+
}, 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 && (0, styled_components_1.css)(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n &:checked ~ ", " {\n ", "\n }\n "], ["\n &:checked ~ ", " {\n ", "\n }\n "])), exports.Indicator, RadioIndicator_styled_1.radioIndicatorCheckedStyles); }, function (props) { return props.$disabled ? "\n pointer-events: none;\n user-select:none;\n " : ""; });
|
|
69
|
+
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, templateObject_19;
|