krl-alfred 2.20.0 → 2.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Icon/iconList/RadioButtonElementChecked.js +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/Modal/Modal.js +29 -13
- package/dist/components/Modal/props.d.ts +2 -0
- package/dist/components/Modal/props.js +1 -0
- package/dist/components/Modal/stories/Modal.stories.d.ts +1 -1
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.d.ts +1 -1
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.js +3 -2
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.styled.d.ts +1 -1
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.styled.js +5 -2
- package/dist/components/ProductCardHorizontalSm/props.d.ts +5 -3
- package/dist/components/ProductCardHorizontalSm/props.js +1 -0
- package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.d.ts +68 -1
- package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.js +9 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +2 -2
- package/dist/components/RadioGroup/RadioGroup.styled.js +7 -2
- package/dist/components/RadioGroup/props.d.ts +3 -0
- package/dist/components/RadioGroup/props.js +2 -1
- package/dist/components/RadioGroup/stories/RadioGroup.stories.d.ts +41 -1
- package/dist/components/RadioGroup/stories/RadioGroup.stories.js +19 -1
- package/package.json +1 -1
|
@@ -36,5 +36,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
37
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
38
|
var React = __importStar(require("react"));
|
|
39
|
-
var SvgRadioButtonElementChecked = function (props) { return ((0, jsx_runtime_1.jsxs)("svg", __assign({ width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [(0, jsx_runtime_1.jsx)("circle", { cx: 12, cy: 12, r: 12, fill: "
|
|
39
|
+
var SvgRadioButtonElementChecked = function (props) { return ((0, jsx_runtime_1.jsxs)("svg", __assign({ width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [(0, jsx_runtime_1.jsx)("circle", { cx: 12, cy: 12, r: 12, fill: "currentColor" }), (0, jsx_runtime_1.jsx)("circle", { cx: 12, cy: 12, r: 6, fill: "white" })] }))); };
|
|
40
40
|
exports.default = SvgRadioButtonElementChecked;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ModalProps } from "./props";
|
|
3
|
-
declare const Modal: ({ size, showCloseIcon, showSkipButton, skipButtonText, onSkip, showBackIcon, backIconType, hasCloseOnOutsideClick, onClose, onBack, show, showDivider, title, children, modalFooter, showPrimaryButton, showSecondaryButton, onPrimaryAction, onSecondaryAction, buttonsAlignment, buttonsAlignmentOnMobile, primaryButtonText, secondaryButtonText, showHeaderBorder, showFooterBorder, autoHeight, titleAlignment, titleDescription, isPrimaryButtonLoading, primaryButtonIcon, secondaryButtonIcon, isSecondaryButtonLoading, isPrimaryButtonDisabled, isSecondaryButtonDisabled, primaryButtonWidth, secondaryButtonWidth, customContent, showHeader, id, renderInDOM, hasHeaderMinHeight, ...other }: ModalProps) => React.
|
|
3
|
+
declare const Modal: ({ size, showCloseIcon, showSkipButton, skipButtonText, onSkip, showBackIcon, backIconType, hasCloseOnOutsideClick, onClose, onBack, show, showDivider, title, children, modalFooter, showPrimaryButton, showSecondaryButton, onPrimaryAction, onSecondaryAction, buttonsAlignment, buttonsAlignmentOnMobile, primaryButtonText, secondaryButtonText, showHeaderBorder, showFooterBorder, autoHeight, titleAlignment, titleDescription, isPrimaryButtonLoading, primaryButtonIcon, secondaryButtonIcon, isSecondaryButtonLoading, isPrimaryButtonDisabled, isSecondaryButtonDisabled, primaryButtonWidth, secondaryButtonWidth, customContent, showHeader, id, renderInDOM, portalContainer, hasHeaderMinHeight, ...other }: ModalProps) => React.ReactPortal;
|
|
4
4
|
export default Modal;
|
|
@@ -37,21 +37,35 @@ var TextLink_1 = __importDefault(require("../TextLink"));
|
|
|
37
37
|
var useOnClickOutside_1 = __importDefault(require("../../hooks/useOnClickOutside"));
|
|
38
38
|
var react_i18next_1 = require("react-i18next");
|
|
39
39
|
var Modal = function (_a) {
|
|
40
|
-
var _b = _a.size, size = _b === void 0 ? props_1.ModalDefault.size : _b, _c = _a.showCloseIcon, showCloseIcon = _c === void 0 ? props_1.ModalDefault.showCloseIcon : _c, _d = _a.showSkipButton, showSkipButton = _d === void 0 ? props_1.ModalDefault.showSkipButton : _d, _e = _a.skipButtonText, skipButtonText = _e === void 0 ? props_1.ModalDefault.skipButtonText : _e, _f = _a.onSkip, onSkip = _f === void 0 ? props_1.ModalDefault.onSkip : _f, _g = _a.showBackIcon, showBackIcon = _g === void 0 ? props_1.ModalDefault.showBackIcon : _g, _h = _a.backIconType, backIconType = _h === void 0 ? props_1.ModalDefault.backIconType : _h, _j = _a.hasCloseOnOutsideClick, hasCloseOnOutsideClick = _j === void 0 ? props_1.ModalDefault.hasCloseOnOutsideClick : _j, _k = _a.onClose, onClose = _k === void 0 ? props_1.ModalDefault.onClose : _k, _l = _a.onBack, onBack = _l === void 0 ? props_1.ModalDefault.onBack : _l, _m = _a.show, show = _m === void 0 ? props_1.ModalDefault.show : _m, _o = _a.showDivider, showDivider = _o === void 0 ? props_1.ModalDefault.showDivider : _o, _p = _a.title, title = _p === void 0 ? props_1.ModalDefault.title : _p, _q = _a.children, children = _q === void 0 ? props_1.ModalDefault.children : _q, _r = _a.modalFooter, modalFooter = _r === void 0 ? props_1.ModalDefault.modalFooter : _r, _s = _a.showPrimaryButton, showPrimaryButton = _s === void 0 ? props_1.ModalDefault.showPrimaryButton : _s, _t = _a.showSecondaryButton, showSecondaryButton = _t === void 0 ? props_1.ModalDefault.showSecondaryButton : _t, _u = _a.onPrimaryAction, onPrimaryAction = _u === void 0 ? props_1.ModalDefault.onPrimaryAction : _u, _v = _a.onSecondaryAction, onSecondaryAction = _v === void 0 ? props_1.ModalDefault.onSecondaryAction : _v, _w = _a.buttonsAlignment, buttonsAlignment = _w === void 0 ? props_1.ModalDefault.buttonsAlignment : _w, _x = _a.buttonsAlignmentOnMobile, buttonsAlignmentOnMobile = _x === void 0 ? props_1.ModalDefault.buttonsAlignmentOnMobile : _x, _y = _a.primaryButtonText, primaryButtonText = _y === void 0 ? props_1.ModalDefault.primaryButtonText : _y, _z = _a.secondaryButtonText, secondaryButtonText = _z === void 0 ? props_1.ModalDefault.secondaryButtonText : _z, _0 = _a.showHeaderBorder, showHeaderBorder = _0 === void 0 ? props_1.ModalDefault.showHeaderBorder : _0, _1 = _a.showFooterBorder, showFooterBorder = _1 === void 0 ? props_1.ModalDefault.showFooterBorder : _1, _2 = _a.autoHeight, autoHeight = _2 === void 0 ? props_1.ModalDefault.autoHeight : _2, _3 = _a.titleAlignment, titleAlignment = _3 === void 0 ? props_1.ModalDefault.titleAlignment : _3, _4 = _a.titleDescription, titleDescription = _4 === void 0 ? props_1.ModalDefault.titleDescription : _4, _5 = _a.isPrimaryButtonLoading, isPrimaryButtonLoading = _5 === void 0 ? props_1.ModalDefault.isPrimaryButtonLoading : _5, _6 = _a.primaryButtonIcon, primaryButtonIcon = _6 === void 0 ? props_1.ModalDefault.primaryButtonIcon : _6, _7 = _a.secondaryButtonIcon, secondaryButtonIcon = _7 === void 0 ? props_1.ModalDefault.secondaryButtonIcon : _7, _8 = _a.isSecondaryButtonLoading, isSecondaryButtonLoading = _8 === void 0 ? props_1.ModalDefault.isSecondaryButtonLoading : _8, _9 = _a.isPrimaryButtonDisabled, isPrimaryButtonDisabled = _9 === void 0 ? props_1.ModalDefault.isPrimaryButtonDisabled : _9, _10 = _a.isSecondaryButtonDisabled, isSecondaryButtonDisabled = _10 === void 0 ? props_1.ModalDefault.isSecondaryButtonDisabled : _10, _11 = _a.primaryButtonWidth, primaryButtonWidth = _11 === void 0 ? props_1.ModalDefault.primaryButtonWidth : _11, _12 = _a.secondaryButtonWidth, secondaryButtonWidth = _12 === void 0 ? props_1.ModalDefault.secondaryButtonWidth : _12, _13 = _a.customContent, customContent = _13 === void 0 ? props_1.ModalDefault.customContent : _13, _14 = _a.showHeader, showHeader = _14 === void 0 ? props_1.ModalDefault.showHeader : _14, _15 = _a.id, id = _15 === void 0 ? props_1.ModalDefault.id : _15, _16 = _a.renderInDOM, renderInDOM = _16 === void 0 ? props_1.ModalDefault.renderInDOM : _16, _17 = _a.hasHeaderMinHeight, hasHeaderMinHeight =
|
|
41
|
-
var
|
|
40
|
+
var _b = _a.size, size = _b === void 0 ? props_1.ModalDefault.size : _b, _c = _a.showCloseIcon, showCloseIcon = _c === void 0 ? props_1.ModalDefault.showCloseIcon : _c, _d = _a.showSkipButton, showSkipButton = _d === void 0 ? props_1.ModalDefault.showSkipButton : _d, _e = _a.skipButtonText, skipButtonText = _e === void 0 ? props_1.ModalDefault.skipButtonText : _e, _f = _a.onSkip, onSkip = _f === void 0 ? props_1.ModalDefault.onSkip : _f, _g = _a.showBackIcon, showBackIcon = _g === void 0 ? props_1.ModalDefault.showBackIcon : _g, _h = _a.backIconType, backIconType = _h === void 0 ? props_1.ModalDefault.backIconType : _h, _j = _a.hasCloseOnOutsideClick, hasCloseOnOutsideClick = _j === void 0 ? props_1.ModalDefault.hasCloseOnOutsideClick : _j, _k = _a.onClose, onClose = _k === void 0 ? props_1.ModalDefault.onClose : _k, _l = _a.onBack, onBack = _l === void 0 ? props_1.ModalDefault.onBack : _l, _m = _a.show, show = _m === void 0 ? props_1.ModalDefault.show : _m, _o = _a.showDivider, showDivider = _o === void 0 ? props_1.ModalDefault.showDivider : _o, _p = _a.title, title = _p === void 0 ? props_1.ModalDefault.title : _p, _q = _a.children, children = _q === void 0 ? props_1.ModalDefault.children : _q, _r = _a.modalFooter, modalFooter = _r === void 0 ? props_1.ModalDefault.modalFooter : _r, _s = _a.showPrimaryButton, showPrimaryButton = _s === void 0 ? props_1.ModalDefault.showPrimaryButton : _s, _t = _a.showSecondaryButton, showSecondaryButton = _t === void 0 ? props_1.ModalDefault.showSecondaryButton : _t, _u = _a.onPrimaryAction, onPrimaryAction = _u === void 0 ? props_1.ModalDefault.onPrimaryAction : _u, _v = _a.onSecondaryAction, onSecondaryAction = _v === void 0 ? props_1.ModalDefault.onSecondaryAction : _v, _w = _a.buttonsAlignment, buttonsAlignment = _w === void 0 ? props_1.ModalDefault.buttonsAlignment : _w, _x = _a.buttonsAlignmentOnMobile, buttonsAlignmentOnMobile = _x === void 0 ? props_1.ModalDefault.buttonsAlignmentOnMobile : _x, _y = _a.primaryButtonText, primaryButtonText = _y === void 0 ? props_1.ModalDefault.primaryButtonText : _y, _z = _a.secondaryButtonText, secondaryButtonText = _z === void 0 ? props_1.ModalDefault.secondaryButtonText : _z, _0 = _a.showHeaderBorder, showHeaderBorder = _0 === void 0 ? props_1.ModalDefault.showHeaderBorder : _0, _1 = _a.showFooterBorder, showFooterBorder = _1 === void 0 ? props_1.ModalDefault.showFooterBorder : _1, _2 = _a.autoHeight, autoHeight = _2 === void 0 ? props_1.ModalDefault.autoHeight : _2, _3 = _a.titleAlignment, titleAlignment = _3 === void 0 ? props_1.ModalDefault.titleAlignment : _3, _4 = _a.titleDescription, titleDescription = _4 === void 0 ? props_1.ModalDefault.titleDescription : _4, _5 = _a.isPrimaryButtonLoading, isPrimaryButtonLoading = _5 === void 0 ? props_1.ModalDefault.isPrimaryButtonLoading : _5, _6 = _a.primaryButtonIcon, primaryButtonIcon = _6 === void 0 ? props_1.ModalDefault.primaryButtonIcon : _6, _7 = _a.secondaryButtonIcon, secondaryButtonIcon = _7 === void 0 ? props_1.ModalDefault.secondaryButtonIcon : _7, _8 = _a.isSecondaryButtonLoading, isSecondaryButtonLoading = _8 === void 0 ? props_1.ModalDefault.isSecondaryButtonLoading : _8, _9 = _a.isPrimaryButtonDisabled, isPrimaryButtonDisabled = _9 === void 0 ? props_1.ModalDefault.isPrimaryButtonDisabled : _9, _10 = _a.isSecondaryButtonDisabled, isSecondaryButtonDisabled = _10 === void 0 ? props_1.ModalDefault.isSecondaryButtonDisabled : _10, _11 = _a.primaryButtonWidth, primaryButtonWidth = _11 === void 0 ? props_1.ModalDefault.primaryButtonWidth : _11, _12 = _a.secondaryButtonWidth, secondaryButtonWidth = _12 === void 0 ? props_1.ModalDefault.secondaryButtonWidth : _12, _13 = _a.customContent, customContent = _13 === void 0 ? props_1.ModalDefault.customContent : _13, _14 = _a.showHeader, showHeader = _14 === void 0 ? props_1.ModalDefault.showHeader : _14, _15 = _a.id, id = _15 === void 0 ? props_1.ModalDefault.id : _15, _16 = _a.renderInDOM, renderInDOM = _16 === void 0 ? props_1.ModalDefault.renderInDOM : _16, _17 = _a.portalContainer, portalContainer = _17 === void 0 ? props_1.ModalDefault.portalContainer : _17, _18 = _a.hasHeaderMinHeight, hasHeaderMinHeight = _18 === void 0 ? props_1.ModalDefault.hasHeaderMinHeight : _18, other = __rest(_a, ["size", "showCloseIcon", "showSkipButton", "skipButtonText", "onSkip", "showBackIcon", "backIconType", "hasCloseOnOutsideClick", "onClose", "onBack", "show", "showDivider", "title", "children", "modalFooter", "showPrimaryButton", "showSecondaryButton", "onPrimaryAction", "onSecondaryAction", "buttonsAlignment", "buttonsAlignmentOnMobile", "primaryButtonText", "secondaryButtonText", "showHeaderBorder", "showFooterBorder", "autoHeight", "titleAlignment", "titleDescription", "isPrimaryButtonLoading", "primaryButtonIcon", "secondaryButtonIcon", "isSecondaryButtonLoading", "isPrimaryButtonDisabled", "isSecondaryButtonDisabled", "primaryButtonWidth", "secondaryButtonWidth", "customContent", "showHeader", "id", "renderInDOM", "portalContainer", "hasHeaderMinHeight"]);
|
|
41
|
+
var generatedId = (0, react_1.useId)();
|
|
42
42
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
43
|
-
var
|
|
43
|
+
var _19 = (0, react_1.useState)(show), showModal = _19[0], setShowModal = _19[1];
|
|
44
|
+
var _20 = (0, react_1.useState)(null), uniqueId = _20[0], setUniqueId = _20[1];
|
|
45
|
+
var _21 = (0, react_1.useState)(null), defaultPortalContainer = _21[0], setDefaultPortalContainer = _21[1];
|
|
44
46
|
(0, react_1.useEffect)(function () {
|
|
47
|
+
if (!uniqueId) {
|
|
48
|
+
setUniqueId(generatedId);
|
|
49
|
+
}
|
|
50
|
+
}, [uniqueId, generatedId]);
|
|
51
|
+
(0, react_1.useEffect)(function () {
|
|
52
|
+
setDefaultPortalContainer(document.body);
|
|
53
|
+
}, []);
|
|
54
|
+
var resolvedPortalContainer = portalContainer !== null && portalContainer !== void 0 ? portalContainer : defaultPortalContainer;
|
|
55
|
+
(0, react_1.useEffect)(function () {
|
|
56
|
+
if (!uniqueId)
|
|
57
|
+
return;
|
|
45
58
|
setShowModal(show);
|
|
59
|
+
var modalClass = "modalActive_".concat(uniqueId);
|
|
46
60
|
if (!show) {
|
|
47
|
-
|
|
48
|
-
|
|
61
|
+
if (document.body.classList.contains(modalClass)) {
|
|
62
|
+
document.body.classList.remove(modalClass);
|
|
63
|
+
}
|
|
49
64
|
}
|
|
50
|
-
else {
|
|
51
|
-
|
|
52
|
-
document.body.classList.add("modalActive_".concat(uniqueId));
|
|
65
|
+
else if (!document.body.classList.contains(modalClass)) {
|
|
66
|
+
document.body.classList.add(modalClass);
|
|
53
67
|
}
|
|
54
|
-
}, [show]);
|
|
68
|
+
}, [show, uniqueId]);
|
|
55
69
|
var handleClose = function () {
|
|
56
70
|
if (onClose) {
|
|
57
71
|
onClose();
|
|
@@ -71,10 +85,12 @@ var Modal = function (_a) {
|
|
|
71
85
|
var modalRef = (0, react_1.useRef)();
|
|
72
86
|
(0, useOnClickOutside_1.default)(modalRef, onClose, hasCloseOnOutsideClick);
|
|
73
87
|
var modalContent = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Modal_styled_1.OverlayStyled, __assign({ id: "modalBackdrop_".concat(id), "$show": renderInDOM ? showModal : true }, { children: (0, jsx_runtime_1.jsxs)(Modal_styled_1.ModalStyled, __assign({ ref: modalRef, "$size": size, "$autoHeight": autoHeight, "$showHeaderBorder": showHeaderBorder, "$titleAlignment": titleAlignment, "$customContent": customContent, "$showFooterBorder": showFooterBorder, "$buttonsAlignment": buttonsAlignment, "$showSecondaryButton": showSecondaryButton, "$showDivider": showDivider, "$showHeader": showHeader, "$buttonsAlignmentOnMobile": buttonsAlignmentOnMobile, id: id, "$hasHeaderMinHeight": hasHeaderMinHeight }, other, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "header" }, { children: [showBackIcon ? (backIconType === 2 ? ((0, jsx_runtime_1.jsx)("div", __assign({ className: "modalTextLinkWrapper" }, { children: (0, jsx_runtime_1.jsx)(TextLink_1.default, __assign({ onClick: onBack, icon: "ArrowSmallLeft" }, { children: t("back") })) }))) : ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: onBack, className: "icon" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "ArrowLeftBig" }) })))) : (titleAlignment === "center" && (0, jsx_runtime_1.jsx)("div", { className: "empty" })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "title" }, { children: [title && ((0, jsx_runtime_1.jsx)("h5", { children: title })), titleDescription && (0, jsx_runtime_1.jsx)("p", { children: titleDescription })] })), showCloseIcon ? ((0, jsx_runtime_1.jsx)("div", __assign({ onClick: handleClose, className: "icon" }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "Closebig" }) }))) : showSkipButton ? ((0, jsx_runtime_1.jsx)("div", __assign({ className: "modalTextLinkWrapper skipButton" }, { children: (0, jsx_runtime_1.jsx)(TextLink_1.default, __assign({ onClick: handleSkip }, { children: skipButtonText })) }))) : ((0, jsx_runtime_1.jsx)("div", { className: "empty" }))] })), (0, jsx_runtime_1.jsx)("div", __assign({ className: "content" }, { children: (0, jsx_runtime_1.jsx)("div", __assign({ className: "contentInner" }, { children: children })) })), modalFooter ? modalFooter : (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (showPrimaryButton || showSecondaryButton) && (0, jsx_runtime_1.jsxs)("div", __assign({ className: "buttons" }, { children: [showPrimaryButton && ((0, jsx_runtime_1.jsx)(Button_1.default, __assign({ onClick: onPrimaryAction, size: "big", variant: "primary", isLoading: isPrimaryButtonLoading, disabled: isPrimaryButtonDisabled, width: primaryButtonWidth, icon: primaryButtonIcon }, { children: primaryButtonText }))), showSecondaryButton && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [buttonsAlignment === "vertical" && showDivider && ((0, jsx_runtime_1.jsx)(Divider_1.default, { text: t("or") })), (0, jsx_runtime_1.jsx)(Button_1.default, __assign({ onClick: onSecondaryAction, size: "big", variant: "inverted", isLoading: isSecondaryButtonLoading, disabled: isSecondaryButtonDisabled, width: secondaryButtonWidth, icon: secondaryButtonIcon }, { children: secondaryButtonText }))] }))] })) })] })) })) }));
|
|
74
|
-
if (
|
|
75
|
-
return
|
|
88
|
+
if (!resolvedPortalContainer) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
if (!renderInDOM && !showModal) {
|
|
92
|
+
return null;
|
|
76
93
|
}
|
|
77
|
-
return (
|
|
78
|
-
react_dom_1.default.createPortal(modalContent, document.body));
|
|
94
|
+
return react_dom_1.default.createPortal(modalContent, resolvedPortalContainer);
|
|
79
95
|
};
|
|
80
96
|
exports.default = Modal;
|
|
@@ -45,6 +45,8 @@ export interface Modal {
|
|
|
45
45
|
showHeader?: boolean;
|
|
46
46
|
id?: string;
|
|
47
47
|
renderInDOM?: boolean;
|
|
48
|
+
/** Portal hedefi — varsayılan `document.body` */
|
|
49
|
+
portalContainer?: HTMLElement | null;
|
|
48
50
|
showSkipButton?: boolean;
|
|
49
51
|
skipButtonText?: string;
|
|
50
52
|
onSkip?: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ size, showCloseIcon, showSkipButton, skipButtonText, onSkip, showBackIcon, backIconType, hasCloseOnOutsideClick, onClose, onBack, show, showDivider, title, children, modalFooter, showPrimaryButton, showSecondaryButton, onPrimaryAction, onSecondaryAction, buttonsAlignment, buttonsAlignmentOnMobile, primaryButtonText, secondaryButtonText, showHeaderBorder, showFooterBorder, autoHeight, titleAlignment, titleDescription, isPrimaryButtonLoading, primaryButtonIcon, secondaryButtonIcon, isSecondaryButtonLoading, isPrimaryButtonDisabled, isSecondaryButtonDisabled, primaryButtonWidth, secondaryButtonWidth, customContent, showHeader, id, renderInDOM, hasHeaderMinHeight, ...other }: import("../props").Modal) => React.
|
|
4
|
+
component: ({ size, showCloseIcon, showSkipButton, skipButtonText, onSkip, showBackIcon, backIconType, hasCloseOnOutsideClick, onClose, onBack, show, showDivider, title, children, modalFooter, showPrimaryButton, showSecondaryButton, onPrimaryAction, onSecondaryAction, buttonsAlignment, buttonsAlignmentOnMobile, primaryButtonText, secondaryButtonText, showHeaderBorder, showFooterBorder, autoHeight, titleAlignment, titleDescription, isPrimaryButtonLoading, primaryButtonIcon, secondaryButtonIcon, isSecondaryButtonLoading, isPrimaryButtonDisabled, isSecondaryButtonDisabled, primaryButtonWidth, secondaryButtonWidth, customContent, showHeader, id, renderInDOM, portalContainer, hasHeaderMinHeight, ...other }: import("../props").Modal) => React.ReactPortal;
|
|
5
5
|
tags: string[];
|
|
6
6
|
argTypes: {
|
|
7
7
|
showDivider: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare const _default: React.MemoExoticComponent<({ title, description, price, priceSm, slug, period, image, component, imageComponent, hasImageBorder, imageWidth, imageHeight, infoPosition, hasButton, buttonVariant, buttonText, hasBorder, isSelected, hasTitleWrap, hasButtonRemoveMdDown, hasBordeHover, hasTooltip, tooltipSelectorTitle, tooltipDescription, isDisabled, imageInnerWidth, imageInnerHeight, hasImageRounded, }: import("./props").ProductCardHorizontalSm) => React.JSX.Element>;
|
|
2
|
+
declare const _default: React.MemoExoticComponent<({ title, description, price, priceSm, slug, period, image, component, imageComponent, hasImageBorder, imageWidth, imageHeight, infoPosition, hasButton, buttonVariant, buttonText, hasBorder, isSelected, hasTitleWrap, hasButtonRemoveMdDown, hasDescriptionHideMdDown, hasBordeHover, hasTooltip, tooltipSelectorTitle, tooltipDescription, isDisabled, imageInnerWidth, imageInnerHeight, hasImageRounded, }: import("./props").ProductCardHorizontalSm) => React.JSX.Element>;
|
|
3
3
|
export default _default;
|
|
@@ -40,7 +40,8 @@ var ImageContent = (0, react_1.memo)(function (_a) {
|
|
|
40
40
|
prev.imageComponent === next.imageComponent;
|
|
41
41
|
});
|
|
42
42
|
var ProductCardHorizontalSm = function (_a) {
|
|
43
|
-
var _b = _a.title, title = _b === void 0 ? props_1.ProductCardHorizontalSmDefault.title : _b, _c = _a.description, description = _c === void 0 ? props_1.ProductCardHorizontalSmDefault.description : _c, _d = _a.price, price = _d === void 0 ? props_1.ProductCardHorizontalSmDefault.price : _d, _e = _a.priceSm, priceSm = _e === void 0 ? props_1.ProductCardHorizontalSmDefault.priceSm : _e, _f = _a.slug, slug = _f === void 0 ? props_1.ProductCardHorizontalSmDefault.slug : _f, _g = _a.period, period = _g === void 0 ? props_1.ProductCardHorizontalSmDefault.period : _g, _h = _a.image, image = _h === void 0 ? props_1.ProductCardHorizontalSmDefault.image : _h, _j = _a.component, component = _j === void 0 ? props_1.ProductCardHorizontalSmDefault.component : _j, _k = _a.imageComponent, imageComponent = _k === void 0 ? props_1.ProductCardHorizontalSmDefault.imageComponent : _k, _l = _a.hasImageBorder, hasImageBorder = _l === void 0 ? props_1.ProductCardHorizontalSmDefault.hasImageBorder : _l, _m = _a.imageWidth, imageWidth = _m === void 0 ? props_1.ProductCardHorizontalSmDefault.imageWidth : _m, _o = _a.imageHeight, imageHeight = _o === void 0 ? props_1.ProductCardHorizontalSmDefault.imageHeight : _o, _p = _a.infoPosition, infoPosition = _p === void 0 ? props_1.ProductCardHorizontalSmDefault.infoPosition : _p, _q = _a.hasButton, hasButton = _q === void 0 ? props_1.ProductCardHorizontalSmDefault.hasButton : _q, _r = _a.buttonVariant, buttonVariant = _r === void 0 ? props_1.ProductCardHorizontalSmDefault.buttonVariant : _r, _s = _a.buttonText, buttonText = _s === void 0 ? props_1.ProductCardHorizontalSmDefault.buttonText : _s, _t = _a.hasBorder, hasBorder = _t === void 0 ? props_1.ProductCardHorizontalSmDefault.hasBorder : _t, _u = _a.isSelected, isSelected = _u === void 0 ? props_1.ProductCardHorizontalSmDefault.isSelected : _u, _v = _a.hasTitleWrap, hasTitleWrap = _v === void 0 ? props_1.ProductCardHorizontalSmDefault.hasTitleWrap : _v, _w = _a.hasButtonRemoveMdDown, hasButtonRemoveMdDown = _w === void 0 ? props_1.ProductCardHorizontalSmDefault.hasButtonRemoveMdDown : _w, _x = _a.
|
|
44
|
-
|
|
43
|
+
var _b = _a.title, title = _b === void 0 ? props_1.ProductCardHorizontalSmDefault.title : _b, _c = _a.description, description = _c === void 0 ? props_1.ProductCardHorizontalSmDefault.description : _c, _d = _a.price, price = _d === void 0 ? props_1.ProductCardHorizontalSmDefault.price : _d, _e = _a.priceSm, priceSm = _e === void 0 ? props_1.ProductCardHorizontalSmDefault.priceSm : _e, _f = _a.slug, slug = _f === void 0 ? props_1.ProductCardHorizontalSmDefault.slug : _f, _g = _a.period, period = _g === void 0 ? props_1.ProductCardHorizontalSmDefault.period : _g, _h = _a.image, image = _h === void 0 ? props_1.ProductCardHorizontalSmDefault.image : _h, _j = _a.component, component = _j === void 0 ? props_1.ProductCardHorizontalSmDefault.component : _j, _k = _a.imageComponent, imageComponent = _k === void 0 ? props_1.ProductCardHorizontalSmDefault.imageComponent : _k, _l = _a.hasImageBorder, hasImageBorder = _l === void 0 ? props_1.ProductCardHorizontalSmDefault.hasImageBorder : _l, _m = _a.imageWidth, imageWidth = _m === void 0 ? props_1.ProductCardHorizontalSmDefault.imageWidth : _m, _o = _a.imageHeight, imageHeight = _o === void 0 ? props_1.ProductCardHorizontalSmDefault.imageHeight : _o, _p = _a.infoPosition, infoPosition = _p === void 0 ? props_1.ProductCardHorizontalSmDefault.infoPosition : _p, _q = _a.hasButton, hasButton = _q === void 0 ? props_1.ProductCardHorizontalSmDefault.hasButton : _q, _r = _a.buttonVariant, buttonVariant = _r === void 0 ? props_1.ProductCardHorizontalSmDefault.buttonVariant : _r, _s = _a.buttonText, buttonText = _s === void 0 ? props_1.ProductCardHorizontalSmDefault.buttonText : _s, _t = _a.hasBorder, hasBorder = _t === void 0 ? props_1.ProductCardHorizontalSmDefault.hasBorder : _t, _u = _a.isSelected, isSelected = _u === void 0 ? props_1.ProductCardHorizontalSmDefault.isSelected : _u, _v = _a.hasTitleWrap, hasTitleWrap = _v === void 0 ? props_1.ProductCardHorizontalSmDefault.hasTitleWrap : _v, _w = _a.hasButtonRemoveMdDown, hasButtonRemoveMdDown = _w === void 0 ? props_1.ProductCardHorizontalSmDefault.hasButtonRemoveMdDown : _w, _x = _a.hasDescriptionHideMdDown, hasDescriptionHideMdDown = _x === void 0 ? props_1.ProductCardHorizontalSmDefault.hasDescriptionHideMdDown : _x, _y = _a.hasBordeHover, hasBordeHover = _y === void 0 ? props_1.ProductCardHorizontalSmDefault.hasBordeHover : _y, _z = _a.hasTooltip, hasTooltip = _z === void 0 ? props_1.ProductCardHorizontalSmDefault.hasTooltip : _z, _0 = _a.tooltipSelectorTitle, tooltipSelectorTitle = _0 === void 0 ? props_1.ProductCardHorizontalSmDefault.tooltipSelectorTitle : _0, _1 = _a.tooltipDescription, tooltipDescription = _1 === void 0 ? props_1.ProductCardHorizontalSmDefault.tooltipDescription : _1, _2 = _a.isDisabled, isDisabled = _2 === void 0 ? props_1.ProductCardHorizontalSmDefault.isDisabled : _2, _3 = _a.imageInnerWidth, imageInnerWidth = _3 === void 0 ? props_1.ProductCardHorizontalSmDefault.imageInnerWidth : _3, _4 = _a.imageInnerHeight, imageInnerHeight = _4 === void 0 ? props_1.ProductCardHorizontalSmDefault.imageInnerHeight : _4, _5 = _a.hasImageRounded, hasImageRounded = _5 === void 0 ? props_1.ProductCardHorizontalSmDefault.hasImageRounded : _5;
|
|
44
|
+
var hasPeriod = period != null && period !== "";
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.ProductCardHorizontalSmStyled, __assign({ "$hasImageBorder": hasImageBorder, "$imageWidth": imageWidth, "$imageHeight": imageHeight, "$isSelected": isSelected, "$hasBordeHover": hasBordeHover, "$isDisabled": isDisabled }, { children: [(0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Border, { "$isSelected": isSelected, "$hasBordeHover": hasBordeHover, "$hasBorder": hasBorder }), (0, jsx_runtime_1.jsx)(LinkComponent, __assign({ component: component, slug: slug }, { children: (0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.HorizontalSmWrapper, { children: [(0, jsx_runtime_1.jsx)(ImageContent, { image: image, title: title, imageInnerWidth: imageInnerWidth, imageInnerHeight: imageInnerHeight, imageHeight: imageHeight, imageWidth: imageWidth, hasImageBorder: hasImageBorder, hasImageRounded: hasImageRounded, imageComponent: imageComponent }), (0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.TextWrapper, __assign({ "$hasPeriod": hasPeriod }, { children: [(0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Title, __assign({ "$hasTitleWrap": hasTitleWrap }, { children: title })), description && ((0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Description, __assign({ "$hasDescriptionHideMdDown": hasDescriptionHideMdDown }, { children: description }))), infoPosition === "left" && ((0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.PriceContent, __assign({ "$infoPosition": infoPosition }, { children: [(0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.Price, { children: [price, priceSm && (0, jsx_runtime_1.jsx)("small", { children: priceSm })] }), (0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Period, __assign({ "$infoPosition": infoPosition }, { children: period }))] })))] })), (0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.RightContentWrapper, __assign({ "$hasButtonRemoveMdDown": hasButtonRemoveMdDown }, { children: [infoPosition === "right" && ((0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.PriceContent, __assign({ "$infoPosition": infoPosition }, { children: [(0, jsx_runtime_1.jsx)(ProductCardHorizontalSm_styled_1.Period, __assign({ "$infoPosition": infoPosition }, { children: period })), (0, jsx_runtime_1.jsxs)(ProductCardHorizontalSm_styled_1.Price, { children: [price, priceSm && (0, jsx_runtime_1.jsx)("small", { children: priceSm })] })] }))), hasButton && ((0, jsx_runtime_1.jsx)(Button_1.default, __assign({ disabled: isDisabled, variant: buttonVariant, size: "xsmall" }, { children: buttonText }))), hasTooltip && ((0, jsx_runtime_1.jsx)(Tooltip_1.default, __assign({ selectorTitle: tooltipSelectorTitle, popupWidth: "238px", position: "topRight", popupSize: "medium" }, { children: tooltipDescription })))] }))] }) }))] })));
|
|
45
46
|
};
|
|
46
47
|
exports.default = (0, react_1.memo)(ProductCardHorizontalSm);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProductCardHorizontalSmStyledProps } from "./props";
|
|
3
3
|
export declare const Title: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never>>> & string;
|
|
4
|
-
export declare const Description: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>>> & string;
|
|
4
|
+
export declare const Description: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never>>> & string;
|
|
5
5
|
export declare const Border: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never>>> & string;
|
|
6
6
|
export declare const ProductCardHorizontalSmStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof ProductCardHorizontalSmStyledProps> & ProductCardHorizontalSmStyledProps, never>>> & string;
|
|
7
7
|
export declare const HorizontalSmWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|
|
@@ -11,7 +11,10 @@ exports.RightContentWrapper = exports.Period = exports.Price = exports.PriceCont
|
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
12
|
var devices_1 = require("../../constants/devices");
|
|
13
13
|
exports.Title = styled_components_1.default.strong(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--body-semi-bold-14-17);\n transition: color 0.2s ease;\n"], ["\n display: -webkit-box;\n -webkit-line-clamp: ", ";\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--body-semi-bold-14-17);\n transition: color 0.2s ease;\n"])), function (props) { return (props.$hasTitleWrap ? "2" : "1"); });
|
|
14
|
-
exports.Description = styled_components_1.default.p(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0.25rem 0 0;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--caption-medium-12-15);\n color: var(--grey-50);\n"], ["\n margin: 0.25rem 0 0;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--caption-medium-12-15);\n color: var(--grey-50);\n"])))
|
|
14
|
+
exports.Description = styled_components_1.default.p(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0.25rem 0 0;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--caption-medium-12-15);\n color: var(--grey-50);\n\n ", "\n"], ["\n margin: 0.25rem 0 0;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n word-break: break-word;\n font: var(--caption-medium-12-15);\n color: var(--grey-50);\n\n ", "\n"])), function (props) {
|
|
15
|
+
return props.$hasDescriptionHideMdDown &&
|
|
16
|
+
"\n @media only screen and ".concat(devices_1.devices.md, " {\n display: none;\n }\n ");
|
|
17
|
+
});
|
|
15
18
|
exports.Border = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n user-select: none;\n pointer-events: none;\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: 1px solid transparent;\n opacity: ", ";\n transition: border-color 0.2s ease, opacity 0.2s ease;\n border-color: ", ";\n ", "\n"], ["\n user-select: none;\n pointer-events: none;\n position: absolute;\n inset: 0;\n border-radius: inherit;\n border: 1px solid transparent;\n opacity: ", ";\n transition: border-color 0.2s ease, opacity 0.2s ease;\n border-color: ", ";\n ", "\n"])), function (p) { return (p.$hasBorder ? 1 : 0); }, function (p) { return (p.$hasBorder ? "var(--grey-10)" : "transparent"); }, function (p) { return p.$isSelected && "border-color: var(--primary);border-width: 2px;"; });
|
|
16
19
|
exports.ProductCardHorizontalSmStyled = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n color: var(--dark);\n padding: 0 0.5rem;\n border-radius: 0.5rem;\n position: relative;\n transition: color 0.2s ease;\n\n ", "\n\n ", "\n\n a {\n text-decoration: none;\n color: inherit;\n\n @media ((hover: hover) and (pointer: fine)) {\n &:hover {\n ", " {\n color: var(--primary-hover);\n }\n }\n }\n\n &:active {\n ", " {\n color: var(--primary-hover);\n }\n }\n }\n"], ["\n color: var(--dark);\n padding: 0 0.5rem;\n border-radius: 0.5rem;\n position: relative;\n transition: color 0.2s ease;\n\n ", "\n\n ", "\n\n a {\n text-decoration: none;\n color: inherit;\n\n @media ((hover: hover) and (pointer: fine)) {\n &:hover {\n ", " {\n color: var(--primary-hover);\n }\n }\n }\n\n &:active {\n ", " {\n color: var(--primary-hover);\n }\n }\n }\n"])), function (props) {
|
|
17
20
|
return props.$isDisabled &&
|
|
@@ -22,7 +25,7 @@ exports.ProductCardHorizontalSmStyled = styled_components_1.default.div(template
|
|
|
22
25
|
}, exports.Title, exports.Title);
|
|
23
26
|
exports.HorizontalSmWrapper = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n text-decoration: none;\n display: grid;\n grid-template-columns: auto 1fr auto;\n align-items: center;\n min-height: 66px;\n padding-right: 0.5rem;\n"], ["\n text-decoration: none;\n display: grid;\n grid-template-columns: auto 1fr auto;\n align-items: center;\n min-height: 66px;\n padding-right: 0.5rem;\n"])));
|
|
24
27
|
exports.ImgWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border: ", ";\n border-radius: 0.5rem;\n position: relative;\n overflow: hidden;\n width: ", ";\n height: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 1rem;\n background: white;\n transform: translateZ(0);\n\n img {\n vertical-align: middle !important;\n display: block !important;\n object-fit: cover !important;\n border-radius: ", " !important;\n }\n"], ["\n border: ", ";\n border-radius: 0.5rem;\n position: relative;\n overflow: hidden;\n width: ", ";\n height: ", ";\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 1rem;\n background: white;\n transform: translateZ(0);\n\n img {\n vertical-align: middle !important;\n display: block !important;\n object-fit: cover !important;\n border-radius: ", " !important;\n }\n"])), function (props) { return (props.$hasImageBorder ? "1px solid var(--dark-opacity-5)" : "none"); }, function (props) { return (props.$imageWidth ? props.$imageWidth : "71px"); }, function (props) { return (props.$imageHeight ? props.$imageHeight : "50px"); }, function (props) { return (props.$hasImageRounded ? "4px" : "0"); });
|
|
25
|
-
exports.TextWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-right: ", ";\n"], ["\n padding-right: ", ";\n"])), function (props) { return (props.$
|
|
28
|
+
exports.TextWrapper = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n padding-right: ", ";\n"], ["\n padding-right: ", ";\n"])), function (props) { return (props.$hasPeriod ? "1rem" : "0.5rem"); });
|
|
26
29
|
exports.PriceContent = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
27
30
|
return (props === null || props === void 0 ? void 0 : props.$infoPosition) === "left"
|
|
28
31
|
? "\n text-align: start;\n display: flex;\n align-items: flex-end;\n margin-top: 8px;\n "
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { variants } from "../Button/props";
|
|
3
3
|
type VARIANT = typeof variants[number];
|
|
4
4
|
export interface ProductCardHorizontalSm {
|
|
@@ -7,7 +7,7 @@ export interface ProductCardHorizontalSm {
|
|
|
7
7
|
price?: string;
|
|
8
8
|
priceSm?: string;
|
|
9
9
|
slug?: string;
|
|
10
|
-
period?:
|
|
10
|
+
period?: React.ReactNode;
|
|
11
11
|
image?: string;
|
|
12
12
|
component?: React.ElementType | null;
|
|
13
13
|
/** Örn. `import Image from "next/image"` → `imageComponent={Image}` */
|
|
@@ -23,6 +23,7 @@ export interface ProductCardHorizontalSm {
|
|
|
23
23
|
isSelected?: boolean;
|
|
24
24
|
hasTitleWrap?: boolean;
|
|
25
25
|
hasButtonRemoveMdDown?: boolean;
|
|
26
|
+
hasDescriptionHideMdDown?: boolean;
|
|
26
27
|
hasBordeHover?: boolean;
|
|
27
28
|
hasTooltip?: boolean;
|
|
28
29
|
tooltipSelectorTitle?: string;
|
|
@@ -33,7 +34,7 @@ export interface ProductCardHorizontalSm {
|
|
|
33
34
|
hasImageRounded?: boolean;
|
|
34
35
|
}
|
|
35
36
|
export interface ProductCardHorizontalSmStyledProps {
|
|
36
|
-
$
|
|
37
|
+
$hasPeriod?: boolean;
|
|
37
38
|
$hasImageBorder?: boolean;
|
|
38
39
|
$imageWidth?: string;
|
|
39
40
|
$imageHeight?: string;
|
|
@@ -42,6 +43,7 @@ export interface ProductCardHorizontalSmStyledProps {
|
|
|
42
43
|
$isSelected?: boolean;
|
|
43
44
|
$hasTitleWrap?: boolean;
|
|
44
45
|
$hasButtonRemoveMdDown?: boolean;
|
|
46
|
+
$hasDescriptionHideMdDown?: boolean;
|
|
45
47
|
$hasBordeHover?: boolean;
|
|
46
48
|
$isDisabled?: boolean;
|
|
47
49
|
$hasImageRounded?: boolean;
|
package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const _default: {
|
|
|
20
20
|
control: string;
|
|
21
21
|
};
|
|
22
22
|
period: {
|
|
23
|
-
control:
|
|
23
|
+
control: boolean;
|
|
24
24
|
};
|
|
25
25
|
image: {
|
|
26
26
|
control: string;
|
|
@@ -76,6 +76,9 @@ declare const _default: {
|
|
|
76
76
|
hasButtonRemoveMdDown: {
|
|
77
77
|
control: string;
|
|
78
78
|
};
|
|
79
|
+
hasDescriptionHideMdDown: {
|
|
80
|
+
control: string;
|
|
81
|
+
};
|
|
79
82
|
hasTooltip: {
|
|
80
83
|
control: string;
|
|
81
84
|
};
|
|
@@ -154,6 +157,39 @@ export declare const WithDescription: {
|
|
|
154
157
|
isDisabled: boolean;
|
|
155
158
|
};
|
|
156
159
|
};
|
|
160
|
+
export declare const DescriptionHideMdDown: {
|
|
161
|
+
args: {
|
|
162
|
+
description: string;
|
|
163
|
+
hasDescriptionHideMdDown: boolean;
|
|
164
|
+
title: string;
|
|
165
|
+
price: string;
|
|
166
|
+
priceSm: string;
|
|
167
|
+
slug: string;
|
|
168
|
+
period: string;
|
|
169
|
+
image: string;
|
|
170
|
+
component: ({ children }: {
|
|
171
|
+
children: any;
|
|
172
|
+
}) => React.JSX.Element;
|
|
173
|
+
hasImageBorder: boolean;
|
|
174
|
+
imageWidth: string;
|
|
175
|
+
imageHeight: string;
|
|
176
|
+
imageInnerWidth: number;
|
|
177
|
+
imageInnerHeight: number;
|
|
178
|
+
infoPosition: string;
|
|
179
|
+
hasButton: boolean;
|
|
180
|
+
buttonVariant: string;
|
|
181
|
+
buttonText: string;
|
|
182
|
+
hasBorder: boolean;
|
|
183
|
+
hasBordeHover: boolean;
|
|
184
|
+
isSelected: boolean;
|
|
185
|
+
hasTitleWrap: boolean;
|
|
186
|
+
hasButtonRemoveMdDown: boolean;
|
|
187
|
+
hasTooltip: boolean;
|
|
188
|
+
tooltipSelectorTitle: string;
|
|
189
|
+
tooltipDescription: string;
|
|
190
|
+
isDisabled: boolean;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
157
193
|
export declare const WithButton: {
|
|
158
194
|
args: {
|
|
159
195
|
hasButton: boolean;
|
|
@@ -216,6 +252,37 @@ export declare const RightAlignedInfo: {
|
|
|
216
252
|
isDisabled: boolean;
|
|
217
253
|
};
|
|
218
254
|
};
|
|
255
|
+
export declare const CustomPeriod: {
|
|
256
|
+
args: {
|
|
257
|
+
infoPosition: string;
|
|
258
|
+
period: React.JSX.Element;
|
|
259
|
+
title: string;
|
|
260
|
+
price: string;
|
|
261
|
+
priceSm: string;
|
|
262
|
+
slug: string;
|
|
263
|
+
image: string;
|
|
264
|
+
component: ({ children }: {
|
|
265
|
+
children: any;
|
|
266
|
+
}) => React.JSX.Element;
|
|
267
|
+
hasImageBorder: boolean;
|
|
268
|
+
imageWidth: string;
|
|
269
|
+
imageHeight: string;
|
|
270
|
+
imageInnerWidth: number;
|
|
271
|
+
imageInnerHeight: number;
|
|
272
|
+
hasButton: boolean;
|
|
273
|
+
buttonVariant: string;
|
|
274
|
+
buttonText: string;
|
|
275
|
+
hasBorder: boolean;
|
|
276
|
+
hasBordeHover: boolean;
|
|
277
|
+
isSelected: boolean;
|
|
278
|
+
hasTitleWrap: boolean;
|
|
279
|
+
hasButtonRemoveMdDown: boolean;
|
|
280
|
+
hasTooltip: boolean;
|
|
281
|
+
tooltipSelectorTitle: string;
|
|
282
|
+
tooltipDescription: string;
|
|
283
|
+
isDisabled: boolean;
|
|
284
|
+
};
|
|
285
|
+
};
|
|
219
286
|
export declare const WithImageBorder: {
|
|
220
287
|
args: {
|
|
221
288
|
hasImageBorder: 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.WithBorderHover = exports.WithImageRounded = exports.WithoutBorder = exports.WithoutTooltip = exports.Selected = exports.Disabled = exports.WithImageBorder = exports.RightAlignedInfo = exports.WithButton = exports.WithDescription = exports.Default = void 0;
|
|
17
|
+
exports.WithBorderHover = exports.WithImageRounded = exports.WithoutBorder = exports.WithoutTooltip = exports.Selected = exports.Disabled = exports.WithImageBorder = exports.CustomPeriod = exports.RightAlignedInfo = exports.WithButton = exports.DescriptionHideMdDown = exports.WithDescription = exports.Default = void 0;
|
|
18
18
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
var ProductCardHorizontalSm_1 = __importDefault(require("../ProductCardHorizontalSm"));
|
|
20
20
|
var props_1 = require("../../Button/props");
|
|
@@ -28,7 +28,7 @@ exports.default = {
|
|
|
28
28
|
price: { control: "text" },
|
|
29
29
|
priceSm: { control: "text" },
|
|
30
30
|
slug: { control: "text" },
|
|
31
|
-
period: { control:
|
|
31
|
+
period: { control: false },
|
|
32
32
|
image: { control: "text" },
|
|
33
33
|
component: { control: "none" },
|
|
34
34
|
imageComponent: {
|
|
@@ -55,6 +55,7 @@ exports.default = {
|
|
|
55
55
|
isSelected: { control: "boolean" },
|
|
56
56
|
hasTitleWrap: { control: "boolean" },
|
|
57
57
|
hasButtonRemoveMdDown: { control: "boolean" },
|
|
58
|
+
hasDescriptionHideMdDown: { control: "boolean" },
|
|
58
59
|
hasTooltip: { control: "boolean" },
|
|
59
60
|
tooltipSelectorTitle: { control: "text" },
|
|
60
61
|
tooltipDescription: { control: "text" },
|
|
@@ -97,12 +98,18 @@ exports.Default = {
|
|
|
97
98
|
exports.WithDescription = {
|
|
98
99
|
args: __assign(__assign({}, exports.Default.args), { description: "İki ayda bir gönderim" }),
|
|
99
100
|
};
|
|
101
|
+
exports.DescriptionHideMdDown = {
|
|
102
|
+
args: __assign(__assign({}, exports.Default.args), { description: "İki ayda bir gönderim", hasDescriptionHideMdDown: true }),
|
|
103
|
+
};
|
|
100
104
|
exports.WithButton = {
|
|
101
105
|
args: __assign(__assign({}, exports.Default.args), { hasButton: true, buttonText: "Kirala", buttonVariant: "secondary" }),
|
|
102
106
|
};
|
|
103
107
|
exports.RightAlignedInfo = {
|
|
104
108
|
args: __assign(__assign({}, exports.Default.args), { infoPosition: "right" }),
|
|
105
109
|
};
|
|
110
|
+
exports.CustomPeriod = {
|
|
111
|
+
args: __assign(__assign({}, exports.Default.args), { infoPosition: "right", period: ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", __assign({ className: "period-mobile" }, { children: "/ay" })), (0, jsx_runtime_1.jsx)("span", __assign({ className: "period-desktop" }, { children: "/hafta" }))] })) }),
|
|
112
|
+
};
|
|
106
113
|
exports.WithImageBorder = {
|
|
107
114
|
args: __assign(__assign({}, exports.Default.args), { hasImageBorder: true }),
|
|
108
115
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RadioGroupProps } from "./props";
|
|
3
|
-
declare const RadioGroup: ({ options, value, onChange, name, label, disabled, size, textSize, layout, radioLayout, valid, labelOffset, color, verticalAlign, readOnly, gap, isFilled, showIndicator, hasInfo, infoText, infoIcon, gridColumnLength }: RadioGroupProps) => React.JSX.Element;
|
|
3
|
+
declare const RadioGroup: ({ options, value, onChange, name, label, disabled, size, textSize, layout, radioLayout, valid, labelOffset, color, verticalAlign, readOnly, gap, isFilled, showIndicator, hasInfo, infoText, infoIcon, gridColumnLength, isHorizontalOnMobile, }: RadioGroupProps) => React.JSX.Element;
|
|
4
4
|
export default RadioGroup;
|
|
@@ -21,13 +21,13 @@ var RadioGroup_styled_1 = require("./RadioGroup.styled");
|
|
|
21
21
|
var RadioButton_1 = __importDefault(require("../RadioButton"));
|
|
22
22
|
var Icon_1 = __importDefault(require("../Icon/Icon"));
|
|
23
23
|
var RadioGroup = function (_a) {
|
|
24
|
-
var _b = _a.options, options = _b === void 0 ? props_1.RadioGroupDefault.options : _b, _c = _a.value, value = _c === void 0 ? props_1.RadioGroupDefault.value : _c, _d = _a.onChange, onChange = _d === void 0 ? props_1.RadioGroupDefault.onChange : _d, _e = _a.name, name = _e === void 0 ? props_1.RadioGroupDefault.name : _e, _f = _a.label, label = _f === void 0 ? props_1.RadioGroupDefault.label : _f, _g = _a.disabled, disabled = _g === void 0 ? props_1.RadioGroupDefault.disabled : _g, _h = _a.size, size = _h === void 0 ? props_1.RadioGroupDefault.size : _h, _j = _a.textSize, textSize = _j === void 0 ? props_1.RadioGroupDefault.textSize : _j, _k = _a.layout, layout = _k === void 0 ? props_1.RadioGroupDefault.layout : _k, _l = _a.radioLayout, radioLayout = _l === void 0 ? props_1.RadioGroupDefault.radioLayout : _l, _m = _a.valid, valid = _m === void 0 ? props_1.RadioGroupDefault.valid : _m, _o = _a.labelOffset, labelOffset = _o === void 0 ? props_1.RadioGroupDefault.labelOffset : _o, _p = _a.color, color = _p === void 0 ? props_1.RadioGroupDefault.color : _p, _q = _a.verticalAlign, verticalAlign = _q === void 0 ? props_1.RadioGroupDefault.verticalAlign : _q, _r = _a.readOnly, readOnly = _r === void 0 ? props_1.RadioGroupDefault.readOnly : _r, _s = _a.gap, gap = _s === void 0 ? props_1.RadioGroupDefault.gap : _s, _t = _a.isFilled, isFilled = _t === void 0 ? props_1.RadioGroupDefault.isFilled : _t, _u = _a.showIndicator, showIndicator = _u === void 0 ? props_1.RadioGroupDefault.showIndicator : _u, _v = _a.hasInfo, hasInfo = _v === void 0 ? props_1.RadioGroupDefault.hasInfo : _v, _w = _a.infoText, infoText = _w === void 0 ? props_1.RadioGroupDefault.infoText : _w, _x = _a.infoIcon, infoIcon = _x === void 0 ? props_1.RadioGroupDefault.infoIcon : _x, _y = _a.gridColumnLength, gridColumnLength = _y === void 0 ? props_1.RadioGroupDefault.gridColumnLength : _y;
|
|
24
|
+
var _b = _a.options, options = _b === void 0 ? props_1.RadioGroupDefault.options : _b, _c = _a.value, value = _c === void 0 ? props_1.RadioGroupDefault.value : _c, _d = _a.onChange, onChange = _d === void 0 ? props_1.RadioGroupDefault.onChange : _d, _e = _a.name, name = _e === void 0 ? props_1.RadioGroupDefault.name : _e, _f = _a.label, label = _f === void 0 ? props_1.RadioGroupDefault.label : _f, _g = _a.disabled, disabled = _g === void 0 ? props_1.RadioGroupDefault.disabled : _g, _h = _a.size, size = _h === void 0 ? props_1.RadioGroupDefault.size : _h, _j = _a.textSize, textSize = _j === void 0 ? props_1.RadioGroupDefault.textSize : _j, _k = _a.layout, layout = _k === void 0 ? props_1.RadioGroupDefault.layout : _k, _l = _a.radioLayout, radioLayout = _l === void 0 ? props_1.RadioGroupDefault.radioLayout : _l, _m = _a.valid, valid = _m === void 0 ? props_1.RadioGroupDefault.valid : _m, _o = _a.labelOffset, labelOffset = _o === void 0 ? props_1.RadioGroupDefault.labelOffset : _o, _p = _a.color, color = _p === void 0 ? props_1.RadioGroupDefault.color : _p, _q = _a.verticalAlign, verticalAlign = _q === void 0 ? props_1.RadioGroupDefault.verticalAlign : _q, _r = _a.readOnly, readOnly = _r === void 0 ? props_1.RadioGroupDefault.readOnly : _r, _s = _a.gap, gap = _s === void 0 ? props_1.RadioGroupDefault.gap : _s, _t = _a.isFilled, isFilled = _t === void 0 ? props_1.RadioGroupDefault.isFilled : _t, _u = _a.showIndicator, showIndicator = _u === void 0 ? props_1.RadioGroupDefault.showIndicator : _u, _v = _a.hasInfo, hasInfo = _v === void 0 ? props_1.RadioGroupDefault.hasInfo : _v, _w = _a.infoText, infoText = _w === void 0 ? props_1.RadioGroupDefault.infoText : _w, _x = _a.infoIcon, infoIcon = _x === void 0 ? props_1.RadioGroupDefault.infoIcon : _x, _y = _a.gridColumnLength, gridColumnLength = _y === void 0 ? props_1.RadioGroupDefault.gridColumnLength : _y, _z = _a.isHorizontalOnMobile, isHorizontalOnMobile = _z === void 0 ? props_1.RadioGroupDefault.isHorizontalOnMobile : _z;
|
|
25
25
|
var handleRadioChange = function (optionValue) {
|
|
26
26
|
if (!onChange)
|
|
27
27
|
return;
|
|
28
28
|
onChange(optionValue);
|
|
29
29
|
};
|
|
30
|
-
return ((0, jsx_runtime_1.jsxs)(RadioGroup_styled_1.RadioGroupStyled, { children: [label && ((0, jsx_runtime_1.jsx)(RadioGroup_styled_1.GroupLabelWrapper, __assign({ "$emphasizedLabel": hasInfo }, { children: (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.GroupLabel, __assign({ "$emphasizedLabel": hasInfo }, { children: label })) }))), hasInfo && infoText && ((0, jsx_runtime_1.jsxs)(RadioGroup_styled_1.InfoArea, { children: [(0, jsx_runtime_1.jsx)(RadioGroup_styled_1.InfoIconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: (infoIcon || props_1.RadioGroupDefault.infoIcon), width: "24", height: "24", hasWrapper: false }) }), (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.InfoText, { children: infoText })] })), (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.RadioButtonsWrapper, __assign({ "$layout": layout, "$gap": gap, "$isFilled": isFilled, "$gridColumnLength": gridColumnLength }, { children: options.map(function (option, index) {
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(RadioGroup_styled_1.RadioGroupStyled, { children: [label && ((0, jsx_runtime_1.jsx)(RadioGroup_styled_1.GroupLabelWrapper, __assign({ "$emphasizedLabel": hasInfo }, { children: (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.GroupLabel, __assign({ "$emphasizedLabel": hasInfo }, { children: label })) }))), hasInfo && infoText && ((0, jsx_runtime_1.jsxs)(RadioGroup_styled_1.InfoArea, { children: [(0, jsx_runtime_1.jsx)(RadioGroup_styled_1.InfoIconWrapper, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: (infoIcon || props_1.RadioGroupDefault.infoIcon), width: "24", height: "24", hasWrapper: false }) }), (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.InfoText, { children: infoText })] })), (0, jsx_runtime_1.jsx)(RadioGroup_styled_1.RadioButtonsWrapper, __assign({ "$layout": layout, "$gap": gap, "$isFilled": isFilled, "$gridColumnLength": gridColumnLength, "$isHorizontalOnMobile": isHorizontalOnMobile }, { children: options.map(function (option, index) {
|
|
31
31
|
var radioId = option.id || "".concat(name, "_").concat(index);
|
|
32
32
|
var isChecked = value === option.value;
|
|
33
33
|
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, showIndicator: showIndicator, titleBadgePosition: option.titleBadgePosition, hasTitleBadge: option.hasTitleBadge, titleBadgeLayout: option.titleBadgeLayout, titleBadgeText: option.titleBadgeText }, radioId));
|
|
@@ -9,14 +9,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.RadioGroupStyled = exports.RadioButtonsWrapper = exports.InfoText = exports.InfoIconWrapper = exports.InfoArea = exports.GroupLabel = exports.GroupLabelWrapper = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
+
var devices_1 = require("../../constants/devices");
|
|
12
13
|
exports.GroupLabelWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n margin-bottom: ", ";\n"], ["\n display: flex;\n margin-bottom: ", ";\n"])), function (props) { return props.$emphasizedLabel ? "0.5rem" : "1rem"; });
|
|
13
14
|
exports.GroupLabel = styled_components_1.default.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin: 0;\n display: block;\n color: var(--dark-opacity-50);\n font: var(--caption-bold-12-15);\n"], ["\n margin: 0;\n display: block;\n color: var(--dark-opacity-50);\n font: var(--caption-bold-12-15);\n"])));
|
|
14
15
|
exports.InfoArea = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n gap: 0.75rem;\n padding: 0 0;\n margin-bottom: 1rem;\n"], ["\n display: flex;\n align-items: center;\n gap: 0.75rem;\n padding: 0 0;\n margin-bottom: 1rem;\n"])));
|
|
15
16
|
exports.InfoIconWrapper = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n color: var(--dark-opacity-50);\n"], ["\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n color: var(--dark-opacity-50);\n"])));
|
|
16
17
|
exports.InfoText = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin: 0;\n flex: 1;\n font: var(--caption-medium-12-15);\n color: var(--dark-opacity-50);\n"], ["\n margin: 0;\n flex: 1;\n font: var(--caption-medium-12-15);\n color: var(--dark-opacity-50);\n"])));
|
|
17
18
|
exports.RadioButtonsWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n gap: ", ";\n width: 100%;\n\n ", "\n"], ["\n gap: ", ";\n width: 100%;\n\n ", "\n"])), function (props) { return props.$gap || "0.5rem"; }, function (props) { return props.$gridColumnLength
|
|
18
|
-
? "\n display: grid;\n grid-template-columns: repeat(".concat(props.$gridColumnLength, ", minmax(0, 1fr));\n
|
|
19
|
-
|
|
19
|
+
? "\n display: grid;\n grid-template-columns: repeat(".concat(props.$gridColumnLength, ", minmax(0, 1fr));\n ").concat(props.$isHorizontalOnMobile
|
|
20
|
+
? "\n @media only screen and ".concat(devices_1.devices.md, " {\n grid-template-columns: 1fr;\n }\n ")
|
|
21
|
+
: "", "\n ")
|
|
22
|
+
: "\n display: flex;\n ".concat(props.$isHorizontalOnMobile && props.$layout === "horizontal"
|
|
23
|
+
? "\n flex-direction: row;\n flex-wrap: wrap;\n @media only screen and ".concat(devices_1.devices.md, " {\n flex-direction: column;\n flex-wrap: nowrap;\n }\n ")
|
|
24
|
+
: "\n flex-direction: ".concat(props.$layout === "horizontal" ? "row" : "column", ";\n flex-wrap: ").concat(props.$layout === "horizontal" ? "wrap" : "nowrap", ";\n "), "\n ").concat(props.$isFilled
|
|
20
25
|
? "\n > * {\n flex: 1 1 0;\n }\n "
|
|
21
26
|
: "", "\n "); });
|
|
22
27
|
exports.RadioGroupStyled = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
@@ -49,6 +49,8 @@ export interface RadioGroup {
|
|
|
49
49
|
infoIcon?: string;
|
|
50
50
|
/** Satır başına sütun sayısı — verildiğinde flex yerine grid kullanılır */
|
|
51
51
|
gridColumnLength?: number;
|
|
52
|
+
/** Mobilde layout uyarlaması: flex vertical → row; grid → tek sütun (alt alta) */
|
|
53
|
+
isHorizontalOnMobile?: boolean;
|
|
52
54
|
}
|
|
53
55
|
export declare const RadioGroupDefault: RadioGroup;
|
|
54
56
|
export interface RadioGroupStyledProps {
|
|
@@ -57,6 +59,7 @@ export interface RadioGroupStyledProps {
|
|
|
57
59
|
$isFilled?: boolean;
|
|
58
60
|
$emphasizedLabel?: boolean;
|
|
59
61
|
$gridColumnLength?: number;
|
|
62
|
+
$isHorizontalOnMobile?: boolean;
|
|
60
63
|
}
|
|
61
64
|
export type RadioGroupProps = typeof RadioGroupDefault;
|
|
62
65
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ options, value, onChange, name, label, disabled, size, textSize, layout, radioLayout, valid, labelOffset, color, verticalAlign, readOnly, gap, isFilled, showIndicator, hasInfo, infoText, infoIcon, gridColumnLength }: import("../props").RadioGroup) => React.JSX.Element;
|
|
4
|
+
component: ({ options, value, onChange, name, label, disabled, size, textSize, layout, radioLayout, valid, labelOffset, color, verticalAlign, readOnly, gap, isFilled, showIndicator, hasInfo, infoText, infoIcon, gridColumnLength, isHorizontalOnMobile, }: import("../props").RadioGroup) => React.JSX.Element;
|
|
5
5
|
tags: string[];
|
|
6
6
|
argTypes: {
|
|
7
7
|
layout: {
|
|
@@ -49,6 +49,9 @@ declare const _default: {
|
|
|
49
49
|
min: number;
|
|
50
50
|
max: number;
|
|
51
51
|
};
|
|
52
|
+
isHorizontalOnMobile: {
|
|
53
|
+
control: string;
|
|
54
|
+
};
|
|
52
55
|
};
|
|
53
56
|
};
|
|
54
57
|
export default _default;
|
|
@@ -86,6 +89,24 @@ export declare const WithoutIndicator: {
|
|
|
86
89
|
textSize: string;
|
|
87
90
|
};
|
|
88
91
|
};
|
|
92
|
+
export declare const VerticalHorizontalOnMobile: {
|
|
93
|
+
args: {
|
|
94
|
+
layout: string;
|
|
95
|
+
isHorizontalOnMobile: boolean;
|
|
96
|
+
options: {
|
|
97
|
+
label: string;
|
|
98
|
+
value: string;
|
|
99
|
+
}[];
|
|
100
|
+
name: string;
|
|
101
|
+
label: string;
|
|
102
|
+
value: string;
|
|
103
|
+
onChange: (value: any) => void;
|
|
104
|
+
radioLayout: string;
|
|
105
|
+
size: string;
|
|
106
|
+
textSize: string;
|
|
107
|
+
showIndicator: boolean;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
89
110
|
export declare const Horizontal: {
|
|
90
111
|
args: {
|
|
91
112
|
name: string;
|
|
@@ -240,6 +261,25 @@ export declare const GridTwoColumns: {
|
|
|
240
261
|
};
|
|
241
262
|
render: (args: any) => React.JSX.Element;
|
|
242
263
|
};
|
|
264
|
+
export declare const GridStackedOnMobile: {
|
|
265
|
+
args: {
|
|
266
|
+
isHorizontalOnMobile: boolean;
|
|
267
|
+
options: {
|
|
268
|
+
label: string;
|
|
269
|
+
value: string;
|
|
270
|
+
}[];
|
|
271
|
+
name: string;
|
|
272
|
+
label: string;
|
|
273
|
+
value: string;
|
|
274
|
+
onChange: (value: any) => void;
|
|
275
|
+
radioLayout: string;
|
|
276
|
+
size: string;
|
|
277
|
+
gridColumnLength: number;
|
|
278
|
+
gap: string;
|
|
279
|
+
showIndicator: boolean;
|
|
280
|
+
};
|
|
281
|
+
render: (args: any) => React.JSX.Element;
|
|
282
|
+
};
|
|
243
283
|
export declare const ColorPicker: {
|
|
244
284
|
args: {
|
|
245
285
|
name: string;
|
|
@@ -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.WithDescriptions = exports.WithDisabledOptions = exports.ColorPicker = exports.GridTwoColumns = exports.WithInfoArea = exports.BoxedMdWithoutIndicator = exports.BoxedMdFilled = exports.BoxedMdLayout = exports.BoxedSmFilled = exports.BoxedSmLayout = exports.BoxedLayout = exports.Horizontal = exports.WithoutIndicator = exports.Default = void 0;
|
|
17
|
+
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 RadioGroup_1 = __importDefault(require("../RadioGroup"));
|
|
20
20
|
var props_1 = require("../props");
|
|
@@ -36,6 +36,7 @@ exports.default = {
|
|
|
36
36
|
infoText: { control: 'text' },
|
|
37
37
|
infoIcon: { control: 'text' },
|
|
38
38
|
gridColumnLength: { control: 'number', min: 1, max: 6 },
|
|
39
|
+
isHorizontalOnMobile: { control: 'boolean' },
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
exports.Default = {
|
|
@@ -59,6 +60,14 @@ exports.Default = {
|
|
|
59
60
|
exports.WithoutIndicator = {
|
|
60
61
|
args: __assign(__assign({}, exports.Default.args), { showIndicator: false }),
|
|
61
62
|
};
|
|
63
|
+
exports.VerticalHorizontalOnMobile = {
|
|
64
|
+
args: __assign(__assign({}, exports.Default.args), { layout: "vertical", isHorizontalOnMobile: true, options: [
|
|
65
|
+
{ label: "Option 1", value: "option1" },
|
|
66
|
+
{ label: "Option 2", value: "option2" },
|
|
67
|
+
{ label: "Option 3", value: "option3" },
|
|
68
|
+
{ label: "Option 4", value: "option4" },
|
|
69
|
+
] }),
|
|
70
|
+
};
|
|
62
71
|
exports.Horizontal = {
|
|
63
72
|
args: {
|
|
64
73
|
name: "horizontalRadioGroup",
|
|
@@ -204,6 +213,15 @@ exports.GridTwoColumns = {
|
|
|
204
213
|
},
|
|
205
214
|
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)) }))); },
|
|
206
215
|
};
|
|
216
|
+
exports.GridStackedOnMobile = {
|
|
217
|
+
args: __assign(__assign({}, exports.GridTwoColumns.args), { isHorizontalOnMobile: true, options: [
|
|
218
|
+
{ label: "Esnek", value: "flexible" },
|
|
219
|
+
{ label: "Taahhütlü", value: "committed" },
|
|
220
|
+
{ label: "Seçenek 3", value: "option3" },
|
|
221
|
+
{ label: "Seçenek 4", value: "option4" },
|
|
222
|
+
] }),
|
|
223
|
+
render: exports.GridTwoColumns.render,
|
|
224
|
+
};
|
|
207
225
|
exports.ColorPicker = {
|
|
208
226
|
args: {
|
|
209
227
|
name: "colorRadioGroup",
|