krl-alfred 2.23.16 → 2.23.18
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/Button/Button.js +1 -1
- package/dist/components/Button/Button.styled.d.ts +6 -0
- package/dist/components/Button/Button.styled.js +7 -5
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +11 -1
- package/dist/components/Checkbox/Checkbox.styled.js +10 -4
- package/dist/components/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.test.js +38 -0
- package/dist/components/Checkbox/props.d.ts +8 -0
- package/dist/components/Checkbox/props.js +5 -2
- package/dist/components/Checkbox/stories/Checkbox.stories.d.ts +66 -0
- package/dist/components/Checkbox/stories/Checkbox.stories.js +14 -1
- package/dist/components/Input/Input.js +1 -1
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.js +3 -2
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.styled.js +3 -3
- package/dist/components/RadioButton/layouts/horizontal/Horizontal.test.js +11 -0
- package/dist/components/RadioButton/props.d.ts +4 -3
- package/dist/components/RadioButton/stories/RadioButton.stories.d.ts +4 -0
- package/dist/components/RadioButton/stories/RadioButton.stories.js +5 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.test.js +7 -0
- package/dist/components/RadioGroup/props.d.ts +2 -0
- package/dist/components/RadioGroup/stories/RadioGroup.stories.d.ts +29 -0
- package/dist/components/RadioGroup/stories/RadioGroup.stories.js +28 -1
- package/package.json +1 -1
|
@@ -44,6 +44,6 @@ var Button = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
44
44
|
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
45
45
|
e.currentTarget.blur();
|
|
46
46
|
};
|
|
47
|
-
return ((0, jsx_runtime_1.jsxs)(Button_styled_1.ButtonStyled, __assign({ className: (0, classnames_1.default)({ "loading": isLoading }), onClick: handleClick, disabled: disabled, "$size": size, "$variant": variant, "$width": width, "$icon": icon, "$iconPosition": iconPosition, type: type, ref: ref, "$isLoading": isLoading, "$tooltip": tooltip }, other, { children: [(0, jsx_runtime_1.jsxs)(Children, __assign({ isLoading: isLoading, icon: icon, iconSize: iconSize, iconPosition: iconPosition }, { children: [isLoading && ((0, jsx_runtime_1.jsx)(
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(Button_styled_1.ButtonStyled, __assign({ className: (0, classnames_1.default)({ "loading": isLoading }), onClick: handleClick, disabled: disabled, "$size": size, "$variant": variant, "$width": width, "$icon": icon, "$iconPosition": iconPosition, type: type, ref: ref, "$isLoading": isLoading, "$tooltip": tooltip }, other, { children: [(0, jsx_runtime_1.jsxs)(Children, __assign({ isLoading: isLoading, icon: icon, iconSize: iconSize, iconPosition: iconPosition }, { children: [isLoading && ((0, jsx_runtime_1.jsx)(Button_styled_1.LoadingContent, { children: (0, jsx_runtime_1.jsx)(Loader_1.default, { width: ["small", "xsmall"].includes(size) ? "1rem" : "1.5rem", height: ["small", "xsmall"].includes(size) ? "1rem" : "1.5rem", variant: variant === 'primary' ? 'secondary' : 'primary' }) })), children && (0, jsx_runtime_1.jsx)("span", { children: children })] })), tooltip && (0, jsx_runtime_1.jsx)(Button_styled_1.ButtonTooltip, { children: tooltip })] })));
|
|
48
48
|
});
|
|
49
49
|
exports.default = Button;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ButtonStyledProps } from "./props";
|
|
3
|
+
export declare const LoadingContent: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
4
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
5
|
+
}> & string;
|
|
6
|
+
export declare const ButtonTooltip: import("styled-components/dist/types").IStyledComponentBase<"web", Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
7
|
+
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
8
|
+
}> & string;
|
|
3
9
|
export declare const ButtonStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Merged<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "style"> & {
|
|
4
10
|
style?: import("react").CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars;
|
|
5
11
|
}, ButtonStyledProps>> & string;
|
|
@@ -27,7 +27,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
27
27
|
return result;
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.IconStyled = exports.ButtonStyled = void 0;
|
|
30
|
+
exports.IconStyled = exports.ButtonStyled = exports.ButtonTooltip = exports.LoadingContent = void 0;
|
|
31
31
|
var styled_components_1 = __importStar(require("styled-components"));
|
|
32
32
|
var devices_1 = require("../../constants/devices");
|
|
33
33
|
var primary = (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n background-color: var(--primary-initial);\n color: white;\n border: 1px solid transparent;\n font: ", ";\n \n @media only screen and ", " {\n &:hover {\n background-color: var(--primary-hover);\n }\n }\n \n\n &:active {\n background-color: var(--primary-press);\n @media only screen and ", " {\n background-color: var(--primary-hover);\n }\n }\n\n &:disabled {\n background-color: var(--dark-opacity-5);\n color: var(--dark-opacity-25);\n }\n"], ["\n background-color: var(--primary-initial);\n color: white;\n border: 1px solid transparent;\n font: ", ";\n \n @media only screen and ", " {\n &:hover {\n background-color: var(--primary-hover);\n }\n }\n \n\n &:active {\n background-color: var(--primary-press);\n @media only screen and ", " {\n background-color: var(--primary-hover);\n }\n }\n\n &:disabled {\n background-color: var(--dark-opacity-5);\n color: var(--dark-opacity-25);\n }\n"])), function (props) {
|
|
@@ -100,7 +100,9 @@ var ghost = (0, styled_components_1.css)(templateObject_5 || (templateObject_5 =
|
|
|
100
100
|
return "var(--body-bold-14-17)";
|
|
101
101
|
}
|
|
102
102
|
}, devices_1.devices.mdUp, devices_1.devices.md);
|
|
103
|
-
exports.
|
|
103
|
+
exports.LoadingContent = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n position: absolute;\n background-color: inherit;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 5;\n border-radius: inherit;\n\n svg {\n color: inherit;\n }\n"], ["\n position: absolute;\n background-color: inherit;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 5;\n border-radius: inherit;\n\n svg {\n color: inherit;\n }\n"])));
|
|
104
|
+
exports.ButtonTooltip = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n position: absolute;\n right: 0;\n top: calc(100% + 5px);\n background: white;\n color: var(--dark);\n font: var(--caption-medium-10-12);\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n box-shadow: 0 6px 30px 0 var(--box-shadow-color);\n user-select: none;\n pointer-events: none;\n white-space: nowrap;\n transition: all 0.2s ease;\n opacity: 0;\n transition-delay: 0s;\n"], ["\n position: absolute;\n right: 0;\n top: calc(100% + 5px);\n background: white;\n color: var(--dark);\n font: var(--caption-medium-10-12);\n padding: 0.5rem 1rem;\n border-radius: 0.5rem;\n box-shadow: 0 6px 30px 0 var(--box-shadow-color);\n user-select: none;\n pointer-events: none;\n white-space: nowrap;\n transition: all 0.2s ease;\n opacity: 0;\n transition-delay: 0s;\n"])));
|
|
105
|
+
exports.ButtonStyled = styled_components_1.default.button(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n box-sizing: border-box;\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 0.5rem;\n padding: ", ";\n cursor: pointer;\n transition: all .2s;\n width: ", ";\n outline: none;\n ", "\n height: ", ";\n &:disabled {\n cursor: not-allowed;\n }\n .children{\n margin-right: ", ";\n background-color: transparent;\n border-radius: inherit;\n &:is(.isLoading){\n background-color: inherit;\n }\n &:empty{\n margin-right: 0;\n }\n }\n &:hover {\n ", " {\n opacity: 1;\n transition-delay: 0.5s;\n }\n }\n &:is(.loading) {\n user-select: none;\n pointer-events: none;\n .children{\n > span{\n opacity: 0;\n } \n }\n > *:not(.children){\n opacity: 0;\n }\n }\n"], ["\n box-sizing: border-box;\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 0.5rem;\n padding: ", ";\n cursor: pointer;\n transition: all .2s;\n width: ", ";\n outline: none;\n ", "\n height: ", ";\n &:disabled {\n cursor: not-allowed;\n }\n .children{\n margin-right: ", ";\n background-color: transparent;\n border-radius: inherit;\n &:is(.isLoading){\n background-color: inherit;\n }\n &:empty{\n margin-right: 0;\n }\n }\n &:hover {\n ", " {\n opacity: 1;\n transition-delay: 0.5s;\n }\n }\n &:is(.loading) {\n user-select: none;\n pointer-events: none;\n .children{\n > span{\n opacity: 0;\n } \n }\n > *:not(.children){\n opacity: 0;\n }\n }\n"])), function (props) { return props.$width ? '0' : '0 24px'; }, function (props) { return props.$width; }, function (props) {
|
|
104
106
|
switch (props.$variant) {
|
|
105
107
|
case 'primary':
|
|
106
108
|
return primary;
|
|
@@ -128,6 +130,6 @@ exports.ButtonStyled = styled_components_1.default.button(templateObject_6 || (t
|
|
|
128
130
|
default:
|
|
129
131
|
return "48px";
|
|
130
132
|
}
|
|
131
|
-
}, function (props) { return props.$icon && !props.$isLoading && props.$iconPosition !== 'left' ? "10px" : "0"; });
|
|
132
|
-
exports.IconStyled = styled_components_1.default.div(
|
|
133
|
-
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
|
|
133
|
+
}, function (props) { return props.$icon && !props.$isLoading && props.$iconPosition !== 'left' ? "10px" : "0"; }, exports.ButtonTooltip);
|
|
134
|
+
exports.IconStyled = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-right: ", ";\n svg{\n width: ", ";\n height: ", ";\n transition: all .2s ease;\n }\n"], ["\n display: flex;\n align-items: center;\n margin-right: ", ";\n svg{\n width: ", ";\n height: ", ";\n transition: all .2s ease;\n }\n"])), function (props) { return props.$iconPosition === 'left' && props.$icon ? "10px" : "0"; }, function (props) { return props.$iconSize && props.$iconSize; }, function (props) { return props.$iconSize && props.$iconSize; });
|
|
135
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckboxProps } from "./props";
|
|
3
|
-
declare const Checkbox: ({ value, checked, onChange, name, id, label, disabled, size, valid, labelOffset, textSize, verticalAlign, required, readOnly, }: CheckboxProps) => import("react").JSX.Element;
|
|
3
|
+
declare const Checkbox: ({ value, checked, onChange, name, id, label, disabled, size, valid, labelOffset, textSize, verticalAlign, required, readOnly, isCheckable, variant, }: CheckboxProps) => import("react").JSX.Element;
|
|
4
4
|
export default Checkbox;
|
|
@@ -16,9 +16,16 @@ var props_1 = require("./props");
|
|
|
16
16
|
var Checkbox_styled_1 = require("./Checkbox.styled");
|
|
17
17
|
var react_i18next_1 = require("react-i18next");
|
|
18
18
|
var getRootCssVariable_1 = require("../../utils/getRootCssVariable");
|
|
19
|
+
var getCheckedColor = function (variant) {
|
|
20
|
+
if (variant === "success") {
|
|
21
|
+
return (0, getRootCssVariable_1.getRootCssVariable)("--green", "#0FDF7B");
|
|
22
|
+
}
|
|
23
|
+
return (0, getRootCssVariable_1.getPrimaryColor)();
|
|
24
|
+
};
|
|
19
25
|
var Checkbox = function (_a) {
|
|
20
|
-
var _b = _a.value, value = _b === void 0 ? props_1.CheckboxDefault.value : _b, _c = _a.checked, checked = _c === void 0 ? props_1.CheckboxDefault.checked : _c, _d = _a.onChange, onChange = _d === void 0 ? props_1.CheckboxDefault.onChange : _d, _e = _a.name, name = _e === void 0 ? props_1.CheckboxDefault.name : _e, _f = _a.id, id = _f === void 0 ? props_1.CheckboxDefault.id : _f, _g = _a.label, label = _g === void 0 ? props_1.CheckboxDefault.label : _g, _h = _a.disabled, disabled = _h === void 0 ? props_1.CheckboxDefault.disabled : _h, _j = _a.size, size = _j === void 0 ? props_1.CheckboxDefault.size : _j, _k = _a.valid, valid = _k === void 0 ? props_1.CheckboxDefault.valid : _k, _l = _a.labelOffset, labelOffset = _l === void 0 ? props_1.CheckboxDefault.labelOffset : _l, _m = _a.textSize, textSize = _m === void 0 ? props_1.CheckboxDefault.textSize : _m, _o = _a.verticalAlign, verticalAlign = _o === void 0 ? props_1.CheckboxDefault.verticalAlign : _o, _p = _a.required, required = _p === void 0 ? props_1.CheckboxDefault.required : _p, _q = _a.readOnly, readOnly = _q === void 0 ? props_1.CheckboxDefault.readOnly : _q;
|
|
26
|
+
var _b = _a.value, value = _b === void 0 ? props_1.CheckboxDefault.value : _b, _c = _a.checked, checked = _c === void 0 ? props_1.CheckboxDefault.checked : _c, _d = _a.onChange, onChange = _d === void 0 ? props_1.CheckboxDefault.onChange : _d, _e = _a.name, name = _e === void 0 ? props_1.CheckboxDefault.name : _e, _f = _a.id, id = _f === void 0 ? props_1.CheckboxDefault.id : _f, _g = _a.label, label = _g === void 0 ? props_1.CheckboxDefault.label : _g, _h = _a.disabled, disabled = _h === void 0 ? props_1.CheckboxDefault.disabled : _h, _j = _a.size, size = _j === void 0 ? props_1.CheckboxDefault.size : _j, _k = _a.valid, valid = _k === void 0 ? props_1.CheckboxDefault.valid : _k, _l = _a.labelOffset, labelOffset = _l === void 0 ? props_1.CheckboxDefault.labelOffset : _l, _m = _a.textSize, textSize = _m === void 0 ? props_1.CheckboxDefault.textSize : _m, _o = _a.verticalAlign, verticalAlign = _o === void 0 ? props_1.CheckboxDefault.verticalAlign : _o, _p = _a.required, required = _p === void 0 ? props_1.CheckboxDefault.required : _p, _q = _a.readOnly, readOnly = _q === void 0 ? props_1.CheckboxDefault.readOnly : _q, _r = _a.isCheckable, isCheckable = _r === void 0 ? props_1.CheckboxDefault.isCheckable : _r, _s = _a.variant, variant = _s === void 0 ? props_1.CheckboxDefault.variant : _s;
|
|
21
27
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
28
|
+
var checkedColor = getCheckedColor(variant);
|
|
22
29
|
var styledProps = {
|
|
23
30
|
disabled: disabled,
|
|
24
31
|
checked: checked,
|
|
@@ -26,9 +33,12 @@ var Checkbox = function (_a) {
|
|
|
26
33
|
$valid: valid,
|
|
27
34
|
$labelOffset: labelOffset,
|
|
28
35
|
$color: (0, getRootCssVariable_1.getPrimaryColor)(),
|
|
36
|
+
$checkedColor: checkedColor,
|
|
37
|
+
$variant: variant,
|
|
29
38
|
$textSize: textSize,
|
|
30
39
|
$verticalAlign: verticalAlign,
|
|
31
40
|
$required: required,
|
|
41
|
+
$isCheckable: isCheckable,
|
|
32
42
|
};
|
|
33
43
|
return ((0, jsx_runtime_1.jsxs)(Checkbox_styled_1.CheckboxWrapper, __assign({ htmlFor: id }, styledProps, { children: [(0, jsx_runtime_1.jsx)(Checkbox_styled_1.CheckboxInput, __assign({}, styledProps, { id: id, type: "checkbox", name: name, value: value, disabled: disabled, checked: checked, onChange: onChange, readOnly: readOnly })), (0, jsx_runtime_1.jsx)(Checkbox_styled_1.CheckboxIndicator, __assign({}, styledProps)), label && ((0, jsx_runtime_1.jsx)(Checkbox_styled_1.LabelsWrapper, __assign({}, styledProps, { children: (0, jsx_runtime_1.jsxs)(Checkbox_styled_1.CheckboxLabel, __assign({}, styledProps, { htmlFor: id }, { children: [label, " ", !required && (0, jsx_runtime_1.jsxs)("b", { children: ["(", t("OPTIONAL"), ")"] })] })) })))] })));
|
|
34
44
|
};
|
|
@@ -45,12 +45,18 @@ var getUncheckedBackground = function (props) {
|
|
|
45
45
|
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#FF1F1F", name: "CheckboxElementInvalid" }));
|
|
46
46
|
};
|
|
47
47
|
var getCheckedBackground = function (props) {
|
|
48
|
-
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: props.$color, name: "CheckboxElementChecked" }));
|
|
48
|
+
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: props.$checkedColor || props.$color, name: "CheckboxElementChecked" }));
|
|
49
49
|
};
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
var getCheckboxCursor = function (props) {
|
|
51
|
+
if (props.disabled || props.$isCheckable === false) {
|
|
52
|
+
return 'default';
|
|
53
|
+
}
|
|
54
|
+
return 'pointer';
|
|
55
|
+
};
|
|
56
|
+
exports.CheckboxWrapper = styled_components_1.default.label(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n flex: 1;\n position: relative;\n align-items: ", ";\n justify-content: flex-start;\n display: grid;\n grid-template-columns: auto 1fr;\n cursor: ", ";\n"], ["\n flex: 1;\n position: relative;\n align-items: ", ";\n justify-content: flex-start;\n display: grid;\n grid-template-columns: auto 1fr;\n cursor: ", ";\n"])), function (props) { return props.$verticalAlign; }, function (props) { return getCheckboxCursor(props); });
|
|
57
|
+
exports.CheckboxIndicator = styled_components_1.default.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: relative;\n flex-shrink: 0;\n margin: ", " ", " 0 0;\n width: ", ";\n height: ", ";\n cursor: ", ";\n"], ["\n background-image: url('", "');\n background-size: 100% 100%;\n display: block;\n position: relative;\n flex-shrink: 0;\n margin: ", " ", " 0 0;\n width: ", ";\n height: ", ";\n cursor: ", ";\n"])), function (props) { return getUncheckedBackground(props); }, function (props) { return props.$verticalAlign === "flex-start" ? "1px" : 0; }, function (props) { return props.$labelOffset; }, function (props) { return getIndicatorSize(props.$size); }, function (props) { return getIndicatorSize(props.$size); }, function (props) { return getCheckboxCursor(props); });
|
|
52
58
|
exports.CheckboxInput = styled_components_1.default.input(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked:not(:disabled) + ", " {\n background-image: url('", "');\n }\n"], ["\n height: 0;\n width: 0;\n opacity: 0;\n z-index: -1;\n position: absolute;\n\n &:checked:not(:disabled) + ", " {\n background-image: url('", "');\n }\n"])), exports.CheckboxIndicator, function (props) { return getCheckedBackground(props); });
|
|
53
|
-
exports.LabelsWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n display: grid;\n row-gap: 8px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n\n * {\n ", ";\n }\n"], ["\n position: relative;\n display: grid;\n row-gap: 8px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n\n * {\n ", ";\n }\n"])), function (props) { return props
|
|
59
|
+
exports.LabelsWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: relative;\n display: grid;\n row-gap: 8px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n\n * {\n ", ";\n }\n"], ["\n position: relative;\n display: grid;\n row-gap: 8px;\n cursor: ", ";\n margin: 0;\n color: ", ";\n\n * {\n ", ";\n }\n"])), function (props) { return getCheckboxCursor(props); }, function (props) {
|
|
54
60
|
if (props.disabled)
|
|
55
61
|
return 'var(--dark-opacity-25)';
|
|
56
62
|
return props.$valid ? 'var(--dark)' : 'var(--red)';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
18
|
+
var react_1 = require("@testing-library/react");
|
|
19
|
+
var Checkbox_1 = __importDefault(require("./Checkbox"));
|
|
20
|
+
var props_1 = require("./props");
|
|
21
|
+
var renderCheckbox = function (props) {
|
|
22
|
+
if (props === void 0) { props = {}; }
|
|
23
|
+
return (0, react_1.render)((0, jsx_runtime_1.jsx)(Checkbox_1.default, __assign({}, props_1.CheckboxDefault, { id: "checkbox-test", label: "Se\u00E7enek" }, props)));
|
|
24
|
+
};
|
|
25
|
+
describe('Checkbox', function () {
|
|
26
|
+
it('uses pointer cursor by default', function () {
|
|
27
|
+
var container = renderCheckbox().container;
|
|
28
|
+
expect(container.querySelector('label')).toHaveStyle({ cursor: 'pointer' });
|
|
29
|
+
});
|
|
30
|
+
it('uses default cursor when isCheckable is false', function () {
|
|
31
|
+
var container = renderCheckbox({ isCheckable: false }).container;
|
|
32
|
+
expect(container.querySelector('label')).toHaveStyle({ cursor: 'default' });
|
|
33
|
+
});
|
|
34
|
+
it('renders success variant when checked', function () {
|
|
35
|
+
renderCheckbox({ variant: 'success', checked: true });
|
|
36
|
+
expect(react_1.screen.getByText('Seçenek')).toBeInTheDocument();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export declare const sizes: string[];
|
|
3
3
|
export declare const textSizes: string[];
|
|
4
|
+
export declare const variants: readonly ["default", "success"];
|
|
4
5
|
type SIZES = (typeof sizes)[number];
|
|
5
6
|
type TEXTSIZES = (typeof textSizes)[number];
|
|
7
|
+
type VARIANT = (typeof variants)[number];
|
|
6
8
|
export interface Checkbox {
|
|
7
9
|
disabled?: boolean;
|
|
8
10
|
value?: any;
|
|
@@ -19,6 +21,9 @@ export interface Checkbox {
|
|
|
19
21
|
verticalAlign?: string;
|
|
20
22
|
required?: boolean;
|
|
21
23
|
readOnly?: boolean;
|
|
24
|
+
/** false ise tıklanabilir görünüm (pointer cursor) kapalı kalır */
|
|
25
|
+
isCheckable?: boolean;
|
|
26
|
+
variant?: VARIANT;
|
|
22
27
|
}
|
|
23
28
|
export interface CheckboxStyledProps {
|
|
24
29
|
$labelOffset?: string;
|
|
@@ -35,6 +40,9 @@ export interface CheckboxStyledProps {
|
|
|
35
40
|
$color?: string;
|
|
36
41
|
$verticalAlign?: string;
|
|
37
42
|
$required?: boolean;
|
|
43
|
+
$isCheckable?: boolean;
|
|
44
|
+
$variant?: VARIANT;
|
|
45
|
+
$checkedColor?: string;
|
|
38
46
|
}
|
|
39
47
|
export declare const CheckboxDefault: Checkbox;
|
|
40
48
|
export type CheckboxProps = typeof CheckboxDefault;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CheckboxDefault = exports.textSizes = exports.sizes = void 0;
|
|
3
|
+
exports.CheckboxDefault = exports.variants = exports.textSizes = exports.sizes = void 0;
|
|
4
4
|
exports.sizes = ["small", "medium", "large"];
|
|
5
5
|
exports.textSizes = ["small", "medium", "large", "xlarge"];
|
|
6
|
+
exports.variants = ["default", "success"];
|
|
6
7
|
exports.CheckboxDefault = {
|
|
7
8
|
disabled: false,
|
|
8
9
|
value: undefined,
|
|
@@ -18,5 +19,7 @@ exports.CheckboxDefault = {
|
|
|
18
19
|
labelOffset: "0.5rem",
|
|
19
20
|
color: null,
|
|
20
21
|
verticalAlign: "center",
|
|
21
|
-
required: true
|
|
22
|
+
required: true,
|
|
23
|
+
isCheckable: true,
|
|
24
|
+
variant: "default",
|
|
22
25
|
};
|
|
@@ -30,6 +30,13 @@ declare const _default: {
|
|
|
30
30
|
readOnly: {
|
|
31
31
|
control: string;
|
|
32
32
|
};
|
|
33
|
+
isCheckable: {
|
|
34
|
+
control: string;
|
|
35
|
+
};
|
|
36
|
+
variant: {
|
|
37
|
+
control: string;
|
|
38
|
+
options: readonly ["default", "success"];
|
|
39
|
+
};
|
|
33
40
|
labelOffset: {
|
|
34
41
|
control: string;
|
|
35
42
|
};
|
|
@@ -133,6 +140,65 @@ export declare const DisabledChecked: {
|
|
|
133
140
|
onChange: (e: any) => void;
|
|
134
141
|
};
|
|
135
142
|
};
|
|
143
|
+
export declare const NotCheckable: {
|
|
144
|
+
name: string;
|
|
145
|
+
args: {
|
|
146
|
+
isCheckable: boolean;
|
|
147
|
+
checked: boolean;
|
|
148
|
+
id: string;
|
|
149
|
+
label: string;
|
|
150
|
+
valid: boolean;
|
|
151
|
+
disabled: boolean;
|
|
152
|
+
required: boolean;
|
|
153
|
+
readOnly: boolean;
|
|
154
|
+
size: string;
|
|
155
|
+
textSize: string;
|
|
156
|
+
labelOffset: string;
|
|
157
|
+
verticalAlign: string;
|
|
158
|
+
name: string;
|
|
159
|
+
value: string;
|
|
160
|
+
onChange: (e: any) => void;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
export declare const Success: {
|
|
164
|
+
args: {
|
|
165
|
+
variant: string;
|
|
166
|
+
checked: boolean;
|
|
167
|
+
label: string;
|
|
168
|
+
id: string;
|
|
169
|
+
valid: boolean;
|
|
170
|
+
disabled: boolean;
|
|
171
|
+
required: boolean;
|
|
172
|
+
readOnly: boolean;
|
|
173
|
+
size: string;
|
|
174
|
+
textSize: string;
|
|
175
|
+
labelOffset: string;
|
|
176
|
+
verticalAlign: string;
|
|
177
|
+
name: string;
|
|
178
|
+
value: string;
|
|
179
|
+
onChange: (e: any) => void;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
export declare const SuccessUnchecked: {
|
|
183
|
+
name: string;
|
|
184
|
+
args: {
|
|
185
|
+
variant: string;
|
|
186
|
+
checked: boolean;
|
|
187
|
+
label: string;
|
|
188
|
+
id: string;
|
|
189
|
+
valid: boolean;
|
|
190
|
+
disabled: boolean;
|
|
191
|
+
required: boolean;
|
|
192
|
+
readOnly: boolean;
|
|
193
|
+
size: string;
|
|
194
|
+
textSize: string;
|
|
195
|
+
labelOffset: string;
|
|
196
|
+
verticalAlign: string;
|
|
197
|
+
name: string;
|
|
198
|
+
value: string;
|
|
199
|
+
onChange: (e: any) => void;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
136
202
|
export declare const Invalid: {
|
|
137
203
|
args: {
|
|
138
204
|
valid: boolean;
|
|
@@ -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.Complete = exports.Interactive = exports.AllTextSizes = exports.AllSizes = exports.LongLabel = exports.WithHtmlLabel = exports.WithoutLabel = exports.VerticalAlignStart = exports.CustomLabelOffset = exports.TextSizeXlarge = exports.TextSizeLarge = exports.Large = exports.Medium = exports.Small = exports.ReadOnly = exports.OptionalChecked = exports.Optional = exports.InvalidChecked = exports.Invalid = exports.DisabledChecked = exports.Disabled = exports.Unchecked = exports.Checked = exports.Default = void 0;
|
|
17
|
+
exports.Complete = exports.Interactive = exports.AllTextSizes = exports.AllSizes = exports.LongLabel = exports.WithHtmlLabel = exports.WithoutLabel = exports.VerticalAlignStart = exports.CustomLabelOffset = exports.TextSizeXlarge = exports.TextSizeLarge = exports.Large = exports.Medium = exports.Small = exports.ReadOnly = exports.OptionalChecked = exports.Optional = exports.InvalidChecked = exports.Invalid = exports.SuccessUnchecked = exports.Success = exports.NotCheckable = exports.DisabledChecked = exports.Disabled = exports.Unchecked = exports.Checked = 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 Checkbox_1 = __importDefault(require("../Checkbox"));
|
|
@@ -48,6 +48,8 @@ exports.default = {
|
|
|
48
48
|
valid: { control: "boolean" },
|
|
49
49
|
required: { control: "boolean" },
|
|
50
50
|
readOnly: { control: "boolean" },
|
|
51
|
+
isCheckable: { control: "boolean" },
|
|
52
|
+
variant: { control: "select", options: props_1.variants },
|
|
51
53
|
labelOffset: { control: "text" },
|
|
52
54
|
verticalAlign: {
|
|
53
55
|
control: "select",
|
|
@@ -71,6 +73,17 @@ exports.Disabled = {
|
|
|
71
73
|
exports.DisabledChecked = {
|
|
72
74
|
args: __assign(__assign({}, baseArgs), { disabled: true, checked: true, id: "check_disabled_checked" }),
|
|
73
75
|
};
|
|
76
|
+
exports.NotCheckable = {
|
|
77
|
+
name: "Not checkable (isCheckable: false)",
|
|
78
|
+
args: __assign(__assign({}, baseArgs), { isCheckable: false, checked: true, id: "check_not_checkable" }),
|
|
79
|
+
};
|
|
80
|
+
exports.Success = {
|
|
81
|
+
args: __assign(__assign({}, baseArgs), { variant: "success", checked: true, label: "Onaylandı", id: "check_success" }),
|
|
82
|
+
};
|
|
83
|
+
exports.SuccessUnchecked = {
|
|
84
|
+
name: "Success — unchecked",
|
|
85
|
+
args: __assign(__assign({}, baseArgs), { variant: "success", checked: false, label: "Onay bekliyor", id: "check_success_unchecked" }),
|
|
86
|
+
};
|
|
74
87
|
exports.Invalid = {
|
|
75
88
|
args: __assign(__assign({}, baseArgs), { valid: false, id: "check_invalid" }),
|
|
76
89
|
};
|
|
@@ -203,6 +203,6 @@ var Input = function (_a) {
|
|
|
203
203
|
} }) }))) : ((0, jsx_runtime_1.jsx)(Input_styled_1.InputStyled, __assign({ ref: inputRef, type: inputType, "$hasError": hasError, disabled: disabled, onChange: function (e) {
|
|
204
204
|
onChange(e);
|
|
205
205
|
setInputValue(e.currentTarget.value);
|
|
206
|
-
}, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: inputValue, id: id, maxLength: maxLength, "$hasIcon": (isClearable && inputValue) || ["password", "date"].includes(type) || hasCopyButton || infoText }, other)))), (isClearable && inputValue) ? ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: handleClearValue, className: "removeIcon" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--dark)", name: "Closebig" }) }))) : (type === 'password' ? ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: toggleInputType, className: "inputIcon hasNoBg" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--dark-opacity-50)", name: inputType === 'password' ? 'Show' : 'Hide' }) }))) : (type === 'date' && !inline ? ((0, jsx_runtime_1.jsx)("div", __assign({ className: "inputIcon hasNoBg hasNoCursor" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--grey-50)", name: "Calendar" }) }))) : (hasCopyButton && ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: copyToClipboard, className: "inputIcon" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--primary)", name: 'Copy' }) })))))), infoText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: "inputIcon hasNoBg" }, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.default, __assign({ popupSize: "small", position: "topRight", popupWidth: "160px", popupRight: "-10px", iconWidth: "24px", iconHeight: "24px" }, { children: (0, jsx_runtime_1.jsx)("div", { className: "popupText", dangerouslySetInnerHTML: { __html: infoText } }) })) }))), (0, jsx_runtime_1.jsx)(Input_styled_1.AlertStyled, __assign({ "$visible": alert }, { children: t('copied') }))] })),
|
|
206
|
+
}, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: inputValue, id: id, maxLength: maxLength, "$hasIcon": (isClearable && inputValue) || ["password", "date"].includes(type) || hasCopyButton || infoText }, other)))), (isClearable && inputValue) ? ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: handleClearValue, className: "removeIcon" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--dark)", name: "Closebig" }) }))) : (type === 'password' ? ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: toggleInputType, className: "inputIcon hasNoBg" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--dark-opacity-50)", name: inputType === 'password' ? 'Show' : 'Hide' }) }))) : (type === 'date' && !inline ? ((0, jsx_runtime_1.jsx)("div", __assign({ className: "inputIcon hasNoBg hasNoCursor" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--grey-50)", name: "Calendar" }) }))) : (hasCopyButton && ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: copyToClipboard, className: "inputIcon" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { color: "var(--primary)", name: 'Copy' }) })))))), infoText && ((0, jsx_runtime_1.jsx)("div", __assign({ className: "inputIcon hasNoBg" }, { children: (0, jsx_runtime_1.jsx)(Tooltip_1.default, __assign({ popupSize: "small", position: "topRight", popupWidth: "160px", popupRight: "-10px", iconWidth: "24px", iconHeight: "24px" }, { children: (0, jsx_runtime_1.jsx)("div", { className: "popupText", dangerouslySetInnerHTML: { __html: infoText } }) })) }))), (0, jsx_runtime_1.jsx)(Input_styled_1.AlertStyled, __assign({ "$visible": alert }, { children: t('copied') }))] })), hasError && errorMessage && (0, jsx_runtime_1.jsxs)("div", __assign({ className: "error" }, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { name: "SwitchPassive" }), (0, jsx_runtime_1.jsx)("p", { children: errorMessage })] })), description && (0, jsx_runtime_1.jsx)(Input_styled_1.FieldDescription, { children: description })] }));
|
|
207
207
|
};
|
|
208
208
|
exports.default = Input;
|
|
@@ -20,10 +20,11 @@ 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 Horizontal = function (props) {
|
|
23
|
-
var label = props.label, 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;
|
|
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
24
|
var titleBadgeBelow = titleBadgePosition === "below";
|
|
25
25
|
var titleBadgeTopRight = titleBadgePosition === "topRight";
|
|
26
26
|
var hasContent = Boolean(content);
|
|
27
|
+
var titleContent = title !== null && title !== void 0 ? title : label;
|
|
27
28
|
var styledProps = {
|
|
28
29
|
checked: checked,
|
|
29
30
|
$disabled: disabled,
|
|
@@ -38,6 +39,6 @@ var Horizontal = function (props) {
|
|
|
38
39
|
};
|
|
39
40
|
var titleBadgeElement = ((0, jsx_runtime_1.jsx)(Badges_1.default, { layout: "text", variant: titleBadgeLayout, title: titleBadgeText }));
|
|
40
41
|
var titleBadge = hasTitleBadge && !titleBadgeTopRight && ((0, jsx_runtime_1.jsx)(Horizontal_styled_1.BadgesWrapper, __assign({}, styledProps, { children: titleBadgeElement })));
|
|
41
|
-
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, onChange: onChange, onClick: onClick, "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: [
|
|
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, onChange: onChange, onClick: onClick, "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 })] })))] }));
|
|
42
43
|
};
|
|
43
44
|
exports.default = Horizontal;
|
|
@@ -26,7 +26,7 @@ exports.Inner = styled_components_1.default.div(templateObject_2 || (templateObj
|
|
|
26
26
|
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
27
|
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) {
|
|
28
28
|
if (props.$disabled) {
|
|
29
|
-
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#C2C3CE", name: "
|
|
29
|
+
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#C2C3CE", name: "RadioButtonElementChecked" }));
|
|
30
30
|
}
|
|
31
31
|
if (props.$hasError) {
|
|
32
32
|
return (0, svgToBase64_1.default)((0, jsx_runtime_1.jsx)(Icon_1.default, { hasWrapper: false, color: "#FF1F1F", name: "RadioButtonElementInvalid" }));
|
|
@@ -41,7 +41,7 @@ exports.Indicator = styled_components_1.default.div(templateObject_4 || (templat
|
|
|
41
41
|
}, function (props) { return props.$labelOffset || "0.5rem"; }, function (props) { return getIndicatorSize(props.$size); }, function (props) { return getIndicatorSize(props.$size); });
|
|
42
42
|
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"])));
|
|
43
43
|
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;"; });
|
|
44
|
-
exports.TitleLabel = styled_components_1.default.span(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: block;\n"], ["\n display: block;\n"])));
|
|
44
|
+
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"])));
|
|
45
45
|
exports.BadgesWrapper = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n margin-left: ", ";\n margin-top: ", ";\n"], ["\n display: flex;\n align-items: center;\n justify-content: flex-start;\n margin-left: ", ";\n margin-top: ", ";\n"])), function (props) { return (props.$titleBadgeBelow ? "0" : "1rem"); }, function (props) { return (props.$titleBadgeBelow ? "0.25rem" : "0"); });
|
|
46
46
|
exports.TitleBadgeTopRight = styled_components_1.default.div(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n display: flex;\n align-items: center;\n z-index: 1;\n"], ["\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n display: flex;\n align-items: center;\n z-index: 1;\n"])));
|
|
47
47
|
exports.Description = styled_components_1.default.div(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n color: var(--dark-opacity-50);\n font: var(--caption-medium-12-15);\n margin-top: 0.5rem;\n margin-bottom: 0;\n width: 100%;\n display: block;\n\n p {\n margin: 0;\n }\n\n a {\n color: inherit;\n }\n"], ["\n color: var(--dark-opacity-50);\n font: var(--caption-medium-12-15);\n margin-top: 0.5rem;\n margin-bottom: 0;\n width: 100%;\n display: block;\n\n p {\n margin: 0;\n }\n\n a {\n color: inherit;\n }\n"])));
|
|
@@ -52,7 +52,7 @@ exports.Price = styled_components_1.default.strong(templateObject_14 || (templat
|
|
|
52
52
|
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
53
|
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
54
|
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:
|
|
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
56
|
if (props.$disabled)
|
|
57
57
|
return '1px solid var(--grey-10)';
|
|
58
58
|
if (props.$hasError)
|
|
@@ -53,4 +53,15 @@ describe('RadioButton Horizontal', function () {
|
|
|
53
53
|
var container = renderHorizontal({ innerMinHeight: 'initial' }).container;
|
|
54
54
|
expect(container.querySelector('label > div')).toHaveStyle({ minHeight: 'initial' });
|
|
55
55
|
});
|
|
56
|
+
it('renders title as ReactNode with image', function () {
|
|
57
|
+
renderHorizontal({
|
|
58
|
+
title: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: "/test.png", alt: "\u00DCr\u00FCn", "data-testid": "title-image" }), (0, jsx_runtime_1.jsx)("span", { children: "\u00D6zel ba\u015Fl\u0131k" })] })),
|
|
59
|
+
});
|
|
60
|
+
expect(react_1.screen.getByTestId('title-image')).toBeInTheDocument();
|
|
61
|
+
expect(react_1.screen.getByText('Özel başlık')).toBeInTheDocument();
|
|
62
|
+
});
|
|
63
|
+
it('falls back to label when title is not provided', function () {
|
|
64
|
+
renderHorizontal({ label: 'Taksitli Ödeme' });
|
|
65
|
+
expect(react_1.screen.getByText('Taksitli Ödeme')).toBeInTheDocument();
|
|
66
|
+
});
|
|
56
67
|
});
|
|
@@ -8,7 +8,7 @@ type SIZES = (typeof sizes)[number];
|
|
|
8
8
|
type LAYOUTS = (typeof layouts)[number];
|
|
9
9
|
type ALIGNMENTS = (typeof alignment)[number];
|
|
10
10
|
type TEXTSIZES = (typeof textSizes)[number];
|
|
11
|
-
interface RadioButton {
|
|
11
|
+
export interface RadioButton {
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
value?: any;
|
|
14
14
|
checked?: boolean;
|
|
@@ -20,6 +20,8 @@ interface RadioButton {
|
|
|
20
20
|
labelOffset?: string;
|
|
21
21
|
id?: string;
|
|
22
22
|
label?: React.ReactNode;
|
|
23
|
+
/** Horizontal layout — başlık alanı (ReactNode; görsel vb. destekler). Verilmezse `label` kullanılır */
|
|
24
|
+
title?: React.ReactNode;
|
|
23
25
|
description?: React.ReactNode;
|
|
24
26
|
size?: SIZES;
|
|
25
27
|
textSize?: TEXTSIZES;
|
|
@@ -55,7 +57,6 @@ interface RadioButton {
|
|
|
55
57
|
hasError?: boolean;
|
|
56
58
|
errorMessage?: React.ReactNode;
|
|
57
59
|
}
|
|
58
|
-
declare const RadioButtonDefault: RadioButton;
|
|
59
60
|
export declare const BoxedDefault: RadioButton;
|
|
60
61
|
export declare const BasicDefault: RadioButton;
|
|
61
62
|
export declare const BoxedWithIconDefault: RadioButton;
|
|
@@ -75,5 +76,5 @@ export interface RadioButtonStyledProps {
|
|
|
75
76
|
$verticalAlign?: string;
|
|
76
77
|
$showIndicator?: boolean;
|
|
77
78
|
}
|
|
78
|
-
export type RadioButtonProps =
|
|
79
|
+
export type RadioButtonProps = RadioButton;
|
|
79
80
|
export {};
|
|
@@ -393,6 +393,10 @@ export declare const HorizontalDisabled: {
|
|
|
393
393
|
};
|
|
394
394
|
};
|
|
395
395
|
};
|
|
396
|
+
export declare const HorizontalWithTitleImage: {
|
|
397
|
+
name: string;
|
|
398
|
+
render: () => import("react").JSX.Element;
|
|
399
|
+
};
|
|
396
400
|
export declare const HorizontalWithContent: {
|
|
397
401
|
name: string;
|
|
398
402
|
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.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.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");
|
|
@@ -307,6 +307,10 @@ exports.HorizontalDisabled = {
|
|
|
307
307
|
}
|
|
308
308
|
}
|
|
309
309
|
};
|
|
310
|
+
exports.HorizontalWithTitleImage = {
|
|
311
|
+
name: "Horizontal — title (ReactNode + görsel)",
|
|
312
|
+
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
|
+
};
|
|
310
314
|
exports.HorizontalWithContent = {
|
|
311
315
|
name: "Horizontal — content (checked)",
|
|
312
316
|
args: {
|
|
@@ -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, 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 }, radioId));
|
|
36
36
|
}) }))] }));
|
|
37
37
|
};
|
|
38
38
|
exports.default = RadioGroup;
|
|
@@ -37,4 +37,11 @@ describe('RadioGroup', function () {
|
|
|
37
37
|
] })).container;
|
|
38
38
|
expect(container.querySelector('label > div')).toHaveStyle({ minHeight: 'initial' });
|
|
39
39
|
});
|
|
40
|
+
it('forwards title as ReactNode from option to RadioButton', function () {
|
|
41
|
+
(0, react_1.render)((0, jsx_runtime_1.jsx)(RadioGroup_1.default, { name: "test-group", radioLayout: "horizontal", value: "a", options: [
|
|
42
|
+
__assign(__assign({}, baseOptions[0]), { title: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("img", { src: "/test.png", alt: "\u00DCr\u00FCn", "data-testid": "title-image" }), (0, jsx_runtime_1.jsx)("span", { children: "\u00D6zel ba\u015Fl\u0131k" })] })) }),
|
|
43
|
+
] }));
|
|
44
|
+
expect(react_1.screen.getByTestId('title-image')).toBeInTheDocument();
|
|
45
|
+
expect(react_1.screen.getByText('Özel başlık')).toBeInTheDocument();
|
|
46
|
+
});
|
|
40
47
|
});
|
|
@@ -11,6 +11,8 @@ type RADIOLAYOUTS = (typeof radioLayouts)[number];
|
|
|
11
11
|
type ALIGNMENTS = (typeof alignments)[number];
|
|
12
12
|
export interface RadioOption {
|
|
13
13
|
label?: React.ReactNode;
|
|
14
|
+
/** Horizontal layout — başlık alanı (ReactNode; görsel vb. destekler). Verilmezse `label` kullanılır */
|
|
15
|
+
title?: React.ReactNode;
|
|
14
16
|
value: any;
|
|
15
17
|
disabled?: boolean;
|
|
16
18
|
id?: string;
|
|
@@ -401,6 +401,35 @@ export declare const HorizontalInstallment: {
|
|
|
401
401
|
gap: string;
|
|
402
402
|
};
|
|
403
403
|
};
|
|
404
|
+
export declare const HorizontalInstallmentWithTitleImage: {
|
|
405
|
+
name: string;
|
|
406
|
+
args: {
|
|
407
|
+
name: string;
|
|
408
|
+
options: ({
|
|
409
|
+
title: React.JSX.Element;
|
|
410
|
+
value: string;
|
|
411
|
+
description: string;
|
|
412
|
+
rightContent: React.JSX.Element;
|
|
413
|
+
innerMinHeight: string;
|
|
414
|
+
label?: undefined;
|
|
415
|
+
price?: undefined;
|
|
416
|
+
} | {
|
|
417
|
+
label: string;
|
|
418
|
+
value: string;
|
|
419
|
+
description: string;
|
|
420
|
+
price: string;
|
|
421
|
+
title?: undefined;
|
|
422
|
+
rightContent?: undefined;
|
|
423
|
+
innerMinHeight?: undefined;
|
|
424
|
+
})[];
|
|
425
|
+
value: string;
|
|
426
|
+
onChange: (value: any) => void;
|
|
427
|
+
layout: string;
|
|
428
|
+
radioLayout: string;
|
|
429
|
+
gap: string;
|
|
430
|
+
};
|
|
431
|
+
render: (args: any) => React.JSX.Element;
|
|
432
|
+
};
|
|
404
433
|
export declare const HorizontalInstallmentWithError: {
|
|
405
434
|
name: string;
|
|
406
435
|
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.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.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"));
|
|
@@ -389,6 +389,33 @@ exports.HorizontalInstallment = {
|
|
|
389
389
|
gap: "0.75rem",
|
|
390
390
|
},
|
|
391
391
|
};
|
|
392
|
+
exports.HorizontalInstallmentWithTitleImage = {
|
|
393
|
+
name: "Horizontal — title (ReactNode + görsel)",
|
|
394
|
+
args: {
|
|
395
|
+
name: "horizontalTitleImageRadioGroup",
|
|
396
|
+
options: [
|
|
397
|
+
{
|
|
398
|
+
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" })] })),
|
|
399
|
+
value: "variant1",
|
|
400
|
+
description: "SKU-001 - Çekirdek kahve",
|
|
401
|
+
rightContent: ((0, jsx_runtime_1.jsx)("span", __assign({ style: { color: "var(--grey-50)", font: "var(--body-medium-13-16)" } }, { children: "3 varyasyon" }))),
|
|
402
|
+
innerMinHeight: "initial",
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
label: "Tek Çekim",
|
|
406
|
+
value: "single",
|
|
407
|
+
description: "Tek seferde ödeme yapın",
|
|
408
|
+
price: "12.500 TL",
|
|
409
|
+
},
|
|
410
|
+
],
|
|
411
|
+
value: "variant1",
|
|
412
|
+
onChange: onChange,
|
|
413
|
+
layout: "vertical",
|
|
414
|
+
radioLayout: "horizontal",
|
|
415
|
+
gap: "0.75rem",
|
|
416
|
+
},
|
|
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
|
+
};
|
|
392
419
|
exports.HorizontalInstallmentWithError = {
|
|
393
420
|
name: "Horizontal — error",
|
|
394
421
|
args: __assign(__assign({}, exports.HorizontalInstallment.args), { name: "horizontalInstallmentErrorRadioGroup", hasError: true, options: horizontalOptions.map(function (option, index) {
|