krl-alfred 2.20.6 → 2.20.7
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/CouponCode/CouponCode.js +1 -1
- package/dist/components/CouponCode/CouponCode.styled.d.ts +3 -1
- package/dist/components/CouponCode/CouponCode.styled.js +5 -3
- package/dist/components/CouponCode/props.d.ts +1 -0
- package/dist/components/Input/Input.js +65 -25
- package/dist/components/ProductCardCheckbox/ProductCardCheckbox.styled.js +1 -1
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.js +1 -0
- package/dist/components/ProductCardHorizontalSm/ProductCardHorizontalSm.styled.js +1 -1
- package/dist/components/ProductCardHorizontalSm/props.d.ts +2 -1
- package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.d.ts +4 -0
- package/dist/components/ProductCardHorizontalSm/stories/ProductCardHorizontalSm.stories.js +4 -0
- package/dist/components/ShoppingCartProduct/ShoppingCartProduct.styled.js +1 -1
- package/package.json +1 -1
|
@@ -42,6 +42,6 @@ var CouponCode = function (_a) {
|
|
|
42
42
|
setIsExpanded(expanded);
|
|
43
43
|
}, [expanded]);
|
|
44
44
|
var toggleExpand = function () { return setIsExpanded(function (prevState) { return !prevState; }); };
|
|
45
|
-
return ((0, jsx_runtime_1.jsxs)(CouponCode_styled_1.CouponCodeStyled, __assign({ "$expanded": isExpanded }, other, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ onClick: toggleExpand, className: "header" }, { children: [(0, jsx_runtime_1.jsx)("strong", __assign({ className: "title" }, { children: title })), (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "ArrowSmallDown" })] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "body" }, { children: [(0, jsx_runtime_1.jsx)(Input_1.default, { disabled: isInputDisabled, name: name, onChange: onChange, hasError: hasError,
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(CouponCode_styled_1.CouponCodeStyled, __assign({ "$expanded": isExpanded, "$hasError": hasError }, other, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ onClick: toggleExpand, className: "header" }, { children: [(0, jsx_runtime_1.jsx)("strong", __assign({ className: "title" }, { children: title })), (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "ArrowSmallDown" })] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "body" }, { children: [(0, jsx_runtime_1.jsxs)(CouponCode_styled_1.CouponCodeFields, __assign({ "$hasError": hasError }, { children: [(0, jsx_runtime_1.jsx)(Input_1.default, { disabled: isInputDisabled, name: name, onChange: onChange, hasError: hasError, value: value, autoFocus: autoFocus, label: "", width: "auto", placeholder: placeholder, hasCopyButton: false }), (0, jsx_runtime_1.jsx)(Button_1.default, __assign({ width: buttonWidth, isLoading: isButtonLoading, disabled: buttonDisabled, size: "big", variant: buttonVariant }, { children: buttonText }))] })), hasError && errorMessage && ((0, jsx_runtime_1.jsxs)(CouponCode_styled_1.CouponCodeError, { children: [(0, jsx_runtime_1.jsx)(Icon_1.default, { name: "SwitchPassive" }), (0, jsx_runtime_1.jsx)("p", { children: errorMessage })] }))] }))] })));
|
|
46
46
|
};
|
|
47
47
|
exports.default = CouponCode;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CouponCodeStyledProps } from "./props";
|
|
3
|
-
export declare const CouponCodeStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
3
|
+
export declare const CouponCodeStyled: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof CouponCodeStyledProps> & CouponCodeStyledProps, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof CouponCodeStyledProps> & CouponCodeStyledProps, never>>> & string;
|
|
4
|
+
export declare const CouponCodeFields: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$hasError"> & Pick<CouponCodeStyledProps, "$hasError">, never> & Partial<Pick<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$hasError"> & Pick<CouponCodeStyledProps, "$hasError">, never>>> & string;
|
|
5
|
+
export declare const CouponCodeError: 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;
|
|
@@ -7,7 +7,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
7
7
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
8
|
};
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.CouponCodeStyled = void 0;
|
|
10
|
+
exports.CouponCodeError = exports.CouponCodeFields = exports.CouponCodeStyled = void 0;
|
|
11
11
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
12
|
-
exports.CouponCodeStyled = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border-radius: 0.5rem;\n background-color: var(--dark-opacity-3);\n .header{\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n padding: 1rem;\n height: 1.5rem;\n box-sizing: content-box;\n .title{\n font:var(--body-bold-14-17);\n display: block;\n }\n svg{\n transition: all .2s ease;\n transform: ", ";\n color: var(--primary);\n }\n }\n .body{\n padding: ", " ;\n transition: all .2s ease;\n position: relative;\n overflow: hidden;\n display:
|
|
13
|
-
|
|
12
|
+
exports.CouponCodeStyled = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n padding: 0;\n border-radius: 0.5rem;\n background-color: var(--dark-opacity-3);\n .header{\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n padding: 1rem;\n height: 1.5rem;\n box-sizing: content-box;\n .title{\n font:var(--body-bold-14-17);\n display: block;\n }\n svg{\n transition: all .2s ease;\n transform: ", ";\n color: var(--primary);\n }\n }\n .body{\n padding: ", " ;\n transition: all .2s ease;\n position: relative;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n max-height: ", ";\n }\n"], ["\n padding: 0;\n border-radius: 0.5rem;\n background-color: var(--dark-opacity-3);\n .header{\n display: flex;\n align-items: center;\n justify-content: space-between;\n cursor: pointer;\n padding: 1rem;\n height: 1.5rem;\n box-sizing: content-box;\n .title{\n font:var(--body-bold-14-17);\n display: block;\n }\n svg{\n transition: all .2s ease;\n transform: ", ";\n color: var(--primary);\n }\n }\n .body{\n padding: ", " ;\n transition: all .2s ease;\n position: relative;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n max-height: ", ";\n }\n"])), function (props) { return props.$expanded ? 'rotate(180deg)' : 'none'; }, function (props) { return props.$expanded ? '0 1rem 1rem 1rem' : '0 1rem 0 1rem'; }, function (props) { return props.$expanded ? (props.$hasError ? '140px' : '96px') : '0'; });
|
|
13
|
+
exports.CouponCodeFields = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n align-items: flex-start;\n justify-content: space-between;\n grid-template-columns: 1fr auto;\n\n button {\n margin-left: 1rem;\n }\n"], ["\n display: grid;\n align-items: flex-start;\n justify-content: space-between;\n grid-template-columns: 1fr auto;\n\n button {\n margin-left: 1rem;\n }\n"])));
|
|
14
|
+
exports.CouponCodeError = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 8px;\n color: var(--red);\n\n svg {\n margin-right: 8px;\n }\n\n p {\n margin: 0;\n font: var(--caption-semi-bold-11-13);\n }\n"], ["\n display: flex;\n align-items: center;\n margin-top: 8px;\n color: var(--red);\n\n svg {\n margin-right: 8px;\n }\n\n p {\n margin: 0;\n font: var(--caption-semi-bold-11-13);\n }\n"])));
|
|
15
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -61,6 +61,9 @@ var Input = function (_a) {
|
|
|
61
61
|
return new Date(value);
|
|
62
62
|
}), startDate = _11[0], setStartDate = _11[1];
|
|
63
63
|
var inputRef = (0, react_1.useRef)(null);
|
|
64
|
+
var datePickerRef = (0, react_1.useRef)(null);
|
|
65
|
+
var dateInputRef = (0, react_1.useRef)(null);
|
|
66
|
+
var dateBlurTimeoutRef = (0, react_1.useRef)([]);
|
|
64
67
|
var t = (0, react_i18next_1.useTranslation)().t;
|
|
65
68
|
var language = i18n_1.default.language;
|
|
66
69
|
(0, react_1.useEffect)(function () {
|
|
@@ -103,26 +106,62 @@ var Input = function (_a) {
|
|
|
103
106
|
setAlert(true);
|
|
104
107
|
inputRef.current.blur();
|
|
105
108
|
};
|
|
106
|
-
var
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
var mergeInputRefs = function () {
|
|
110
|
+
var refs = [];
|
|
111
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
112
|
+
refs[_i] = arguments[_i];
|
|
113
|
+
}
|
|
114
|
+
return function (node) {
|
|
115
|
+
refs.forEach(function (ref) {
|
|
116
|
+
if (!ref)
|
|
117
|
+
return;
|
|
118
|
+
if (typeof ref === "function") {
|
|
119
|
+
ref(node);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
ref.current = node;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
var clearScheduledDateBlur = function () {
|
|
128
|
+
dateBlurTimeoutRef.current.forEach(function (timeoutId) { return window.clearTimeout(timeoutId); });
|
|
129
|
+
dateBlurTimeoutRef.current = [];
|
|
130
|
+
};
|
|
131
|
+
var blurDateInputAfterSelect = (0, react_1.useCallback)(function () {
|
|
132
|
+
if (inline)
|
|
133
|
+
return;
|
|
134
|
+
clearScheduledDateBlur();
|
|
135
|
+
var blur = function () {
|
|
136
|
+
var _a, _b, _c, _d, _e, _f;
|
|
137
|
+
(_b = (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.setBlur) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
138
|
+
(_c = dateInputRef.current) === null || _c === void 0 ? void 0 : _c.blur();
|
|
139
|
+
(_f = (_e = (_d = datePickerRef.current) === null || _d === void 0 ? void 0 : _d.input) === null || _e === void 0 ? void 0 : _e.blur) === null || _f === void 0 ? void 0 : _f.call(_e);
|
|
140
|
+
};
|
|
141
|
+
[0, 10, 50].forEach(function (delay) {
|
|
142
|
+
var timeoutId = window.setTimeout(blur, delay);
|
|
143
|
+
dateBlurTimeoutRef.current.push(timeoutId);
|
|
144
|
+
});
|
|
145
|
+
}, [inline]);
|
|
146
|
+
(0, react_1.useEffect)(function () { return function () { return clearScheduledDateBlur(); }; }, []);
|
|
147
|
+
var CustomDateInput = (0, react_1.useMemo)(function () {
|
|
148
|
+
return (0, react_1.forwardRef)(function (props, ref) {
|
|
149
|
+
var displayValue = '';
|
|
150
|
+
if (props.value && format) {
|
|
151
|
+
try {
|
|
152
|
+
var date = (0, date_fns_1.parse)(props.value, "yyyy-MM-dd", new Date());
|
|
153
|
+
displayValue = (0, date_fns_1.format)(date, format);
|
|
154
|
+
}
|
|
155
|
+
catch (_a) {
|
|
156
|
+
displayValue = inputValue || '';
|
|
157
|
+
}
|
|
115
158
|
}
|
|
116
|
-
|
|
117
|
-
// Parse edilemezse inputValue'yu kullan
|
|
159
|
+
else {
|
|
118
160
|
displayValue = inputValue || '';
|
|
119
161
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
return ((0, jsx_runtime_1.jsx)(Input_styled_1.InputStyled, __assign({ ref: ref, "$hasError": hasError, "$hasIcon": (isClearable && inputValue) || ["password", "date"].includes(type) || hasCopyButton || infoText, "$isCalendarOpen": isCalendarOpen }, props, { value: displayValue })));
|
|
125
|
-
});
|
|
162
|
+
return ((0, jsx_runtime_1.jsx)(Input_styled_1.InputStyled, __assign({ ref: mergeInputRefs(ref, dateInputRef), "$hasError": hasError, "$hasIcon": (isClearable && inputValue) || ["password", "date"].includes(type) || hasCopyButton || infoText, "$isCalendarOpen": isCalendarOpen }, props, { value: displayValue })));
|
|
163
|
+
});
|
|
164
|
+
}, [format, hasCopyButton, hasError, infoText, inputValue, isCalendarOpen, isClearable, type]);
|
|
126
165
|
var handleClearValue = function () {
|
|
127
166
|
setInputValue(null);
|
|
128
167
|
inputRef.current.value = null;
|
|
@@ -132,7 +171,7 @@ var Input = function (_a) {
|
|
|
132
171
|
onClear();
|
|
133
172
|
};
|
|
134
173
|
return (0, jsx_runtime_1.jsxs)(Input_styled_1.Container, __assign({ "$width": width }, { children: [label && ((0, jsx_runtime_1.jsxs)("div", __assign({ className: (0, classnames_1.default)("top", (_b = {}, _b["justify-between"] = customLinkText, _b)) }, { children: [(0, jsx_runtime_1.jsx)("label", __assign({ htmlFor: id }, { children: label })), customLinkText && (0, jsx_runtime_1.jsx)(TextLink_1.default, __assign({}, (customLinkHref && { href: customLinkHref }), { onClick: onCustomLinkClick }, { children: customLinkText }))] }))), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "input" }, { children: [hasNumericFormat ? ((0, jsx_runtime_1.jsx)(react_number_format_1.NumericFormat, __assign({ "$hasError": hasError, disabled: disabled, onChange: onChange, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: inputValue, maxLength: maxLength }, other, { customInput: Input_styled_1.InputStyled, id: id }))) : ((mask && format) ? ((0, jsx_runtime_1.jsx)(react_number_format_1.PatternFormat, __assign({ "$hasError": hasError, disabled: disabled, onChange: onChange, name: name, placeholder: placeholder, readOnly: readOnly, autoFocus: autoFocus, value: inputValue, maxLength: maxLength }, other, { format: format, mask: mask, customInput: Input_styled_1.InputStyled, id: id })))
|
|
135
|
-
: type === 'date' ? ((0, jsx_runtime_1.jsx)(Input_styled_1.DatePickerWrapperStyled, __assign({ "$inline": inline }, { children: (0, jsx_runtime_1.jsx)(react_datepicker_1.default, { placeholderText: placeholder, disabled: disabled, name: name, readOnly: readOnly, autoFocus: autoFocus, onChange: function (date
|
|
174
|
+
: type === 'date' ? ((0, jsx_runtime_1.jsx)(Input_styled_1.DatePickerWrapperStyled, __assign({ "$inline": inline }, { children: (0, jsx_runtime_1.jsx)(react_datepicker_1.default, { placeholderText: placeholder, disabled: disabled, name: name, readOnly: readOnly, autoFocus: autoFocus, onChange: function (date) {
|
|
136
175
|
if (date) {
|
|
137
176
|
setStartDate(date);
|
|
138
177
|
// DatePicker'dan gelen Date objesini format'a göre formatla
|
|
@@ -145,23 +184,24 @@ var Input = function (_a) {
|
|
|
145
184
|
setInputValue(null);
|
|
146
185
|
onChange(null);
|
|
147
186
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}, 10);
|
|
152
|
-
}, selected: startDate, ref: inputRef, dateFormat: "yyyy-MM-dd", locale: language === "tr" ? locale_1.tr : locale_1.enGB, customInput: (0, jsx_runtime_1.jsx)(CustomDateInput, {}),
|
|
187
|
+
}, onSelect: function () {
|
|
188
|
+
blurDateInputAfterSelect();
|
|
189
|
+
}, selected: startDate, ref: datePickerRef, dateFormat: "yyyy-MM-dd", locale: language === "tr" ? locale_1.tr : locale_1.enGB, customInput: (0, jsx_runtime_1.jsx)(CustomDateInput, {}),
|
|
153
190
|
//customInput={<InputStyled $hasError={hasError} id={id}/>}
|
|
154
191
|
inline: inline, minDate: minDate, maxDate: maxDate, filterDate: filterDate, onCalendarOpen: function () {
|
|
155
192
|
setIsCalendarOpen(true);
|
|
156
193
|
if (onCalendarOpen) {
|
|
157
194
|
onCalendarOpen();
|
|
158
195
|
}
|
|
159
|
-
}, onCalendarClose: function () {
|
|
196
|
+
}, onCalendarClose: function () {
|
|
197
|
+
setIsCalendarOpen(false);
|
|
198
|
+
blurDateInputAfterSelect();
|
|
199
|
+
}, onBlur: function () { return setIsCalendarOpen(false); }, renderCustomHeader: function (_a) {
|
|
160
200
|
var monthDate = _a.monthDate, customHeaderCount = _a.customHeaderCount, decreaseMonth = _a.decreaseMonth, increaseMonth = _a.increaseMonth, decreaseYear = _a.decreaseYear, increaseYear = _a.increaseYear, prevMonthButtonDisabled = _a.prevMonthButtonDisabled, nextMonthButtonDisabled = _a.nextMonthButtonDisabled, prevYearButtonDisabled = _a.prevYearButtonDisabled, nextYearButtonDisabled = _a.nextYearButtonDisabled;
|
|
161
201
|
return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: "headerTopContent" }, { children: [(0, jsx_runtime_1.jsxs)("div", __assign({ className: "leftButtons" }, { children: [(0, jsx_runtime_1.jsx)("button", __assign({ "aria-label": "Previous Year", className: "react-datepicker__navigation react-datepicker__navigation--previous", onClick: decreaseYear, type: "button", disabled: prevYearButtonDisabled }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "CalenderArrowleftsmall" }) })), (0, jsx_runtime_1.jsx)("button", __assign({ "aria-label": "Previous Month", className: "react-datepicker__navigation react-datepicker__navigation--previous", onClick: decreaseMonth, type: "button", disabled: prevMonthButtonDisabled }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "ArrowSmallLeft" }) }))] })), (0, jsx_runtime_1.jsxs)("span", __assign({ className: "react-datepicker__current-month" }, { children: [monthDate.toLocaleString(language === "tr" ? "tr-TR" : "en-GB", { month: "long" }), ", ", monthDate.toLocaleString(language === "tr" ? "tr-TR" : "en-GB", { year: "numeric" })] })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: "rightButtons" }, { children: [(0, jsx_runtime_1.jsx)("button", __assign({ "aria-label": "Next Month", className: "react-datepicker__navigation react-datepicker__navigation--next", onClick: increaseMonth, type: "button", disabled: nextMonthButtonDisabled }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "ArrowSmallRight" }) })), (0, jsx_runtime_1.jsx)("button", __assign({ "aria-label": "Next Year", className: "react-datepicker__navigation react-datepicker__navigation--next", onClick: increaseYear, type: "button", disabled: nextYearButtonDisabled }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { name: "Calenderarrowrightsmall" }) }))] }))] })));
|
|
162
202
|
} }) }))) : ((0, jsx_runtime_1.jsx)(Input_styled_1.InputStyled, __assign({ ref: inputRef, type: inputType, "$hasError": hasError, disabled: disabled, onChange: function (e) {
|
|
163
203
|
onChange(e);
|
|
164
204
|
setInputValue(e.currentTarget.value);
|
|
165
|
-
}, 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 && (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 })] }))] }));
|
|
205
|
+
}, 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 })] }))] }));
|
|
166
206
|
};
|
|
167
207
|
exports.default = Input;
|
|
@@ -12,7 +12,7 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
12
12
|
var devices_1 = require("../../constants/devices");
|
|
13
13
|
exports.BadgeWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n margin: 0 auto 1rem 0;\n grid-column-start: 1;\n grid-column-end: 4;\n width: 100%;\n text-align: right;\n height: 17px;\n\n > * {\n vertical-align: super;\n display: inline-block;\n }\n"], ["\n margin: 0 auto 1rem 0;\n grid-column-start: 1;\n grid-column-end: 4;\n width: 100%;\n text-align: right;\n height: 17px;\n\n > * {\n vertical-align: super;\n display: inline-block;\n }\n"])));
|
|
14
14
|
exports.ProductCardCheckboxContent = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 64px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n ", "\n\n > label > div {\n margin-right: 24px;\n\n @media only screen and ", " {\n margin-right: 8px;\n width: 16px;\n height: 16px;\n }\n }\n"], ["\n height: 64px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n ", "\n\n > label > div {\n margin-right: 24px;\n\n @media only screen and ", " {\n margin-right: 8px;\n width: 16px;\n height: 16px;\n }\n }\n"])), function (props) { return props.$hidden && "display: none;"; }, devices_1.devices.md);
|
|
15
|
-
exports.ProductCardImg = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 64px;\n height: 64px;\n border: 1px solid var(--dark-opacity-5);\n border-radius: 0.5rem;\n position: relative;\n margin-right: 16px;\n overflow: hidden;\n box-sizing: border-box;\n\n > * {\n display: block;\n position: absolute;\n inset: 0;\n width: 100
|
|
15
|
+
exports.ProductCardImg = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 64px;\n height: 64px;\n border: 1px solid var(--dark-opacity-5);\n border-radius: 0.5rem;\n position: relative;\n margin-right: 16px;\n overflow: hidden;\n box-sizing: border-box;\n\n > * {\n display: block;\n position: absolute;\n inset: 0.375rem;\n width: calc(100% - 0.75rem);\n height: calc(100% - 0.75rem);\n object-fit: cover;\n object-position: center center;\n border-radius: 0.5rem;\n }\n"], ["\n width: 64px;\n height: 64px;\n border: 1px solid var(--dark-opacity-5);\n border-radius: 0.5rem;\n position: relative;\n margin-right: 16px;\n overflow: hidden;\n box-sizing: border-box;\n\n > * {\n display: block;\n position: absolute;\n inset: 0.375rem;\n width: calc(100% - 0.75rem);\n height: calc(100% - 0.75rem);\n object-fit: cover;\n object-position: center center;\n border-radius: 0.5rem;\n }\n"])));
|
|
16
16
|
exports.ProductCardText = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"], ["\n display: flex;\n align-items: center;\n justify-content: space-between;\n"])));
|
|
17
17
|
exports.ProductCardTitle = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n min-height: 64px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n text-align: start;\n font: ", ";\n\n @media only screen and ", " {\n font: var(--body-semi-bold-14-17);\n }\n"], ["\n min-height: 64px;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n text-align: start;\n font: ", ";\n\n @media only screen and ", " {\n font: var(--body-semi-bold-14-17);\n }\n"])), function (props) { return props.$size === "small" ? "var(--body-semi-bold-14-17)" : "var(--title-semi-bold-16-19)"; }, devices_1.devices.md);
|
|
18
18
|
exports.TooltipWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n user-select: initial !important;\n pointer-events: initial !important;\n padding-left: 1rem;\n"], ["\n user-select: initial !important;\n pointer-events: initial !important;\n padding-left: 1rem;\n"])));
|
|
@@ -37,6 +37,7 @@ var ImageContent = (0, react_1.memo)(function (_a) {
|
|
|
37
37
|
prev.imageHeight === next.imageHeight &&
|
|
38
38
|
prev.imageWidth === next.imageWidth &&
|
|
39
39
|
prev.hasImageBorder === next.hasImageBorder &&
|
|
40
|
+
prev.hasImageRounded === next.hasImageRounded &&
|
|
40
41
|
prev.imageComponent === next.imageComponent;
|
|
41
42
|
});
|
|
42
43
|
var ProductCardHorizontalSm = function (_a) {
|
|
@@ -24,7 +24,7 @@ exports.ProductCardHorizontalSmStyled = styled_components_1.default.div(template
|
|
|
24
24
|
"\n @media ((hover: hover) and (pointer: fine)) {\n cursor: pointer;\n &:hover {\n ".concat(exports.Border, " {\n border-color: var(--primary);\n border-width: 2px;\n }\n }\n }\n ");
|
|
25
25
|
}, exports.Title, exports.Title);
|
|
26
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"])));
|
|
27
|
-
exports.ImgWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border: ", ";\n border-radius:
|
|
27
|
+
exports.ImgWrapper = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border: ", ";\n border-radius: ", ";\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: ", ";\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.$hasImageRounded ? "0.5rem" : "0"); }, function (props) { return (props.$imageWidth ? props.$imageWidth : "71px"); }, function (props) { return (props.$imageHeight ? props.$imageHeight : "50px"); }, function (props) { return (props.$hasImageRounded ? "0.5rem" : "0"); });
|
|
28
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"); });
|
|
29
29
|
exports.PriceContent = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
30
30
|
return (props === null || props === void 0 ? void 0 : props.$infoPosition) === "left"
|
|
@@ -13,6 +13,8 @@ export interface ProductCardHorizontalSm {
|
|
|
13
13
|
/** Örn. `import Image from "next/image"` → `imageComponent={Image}` */
|
|
14
14
|
imageComponent?: React.ElementType | null;
|
|
15
15
|
hasImageBorder?: boolean;
|
|
16
|
+
/** Görsele 0.5rem border-radius uygular */
|
|
17
|
+
hasImageRounded?: boolean;
|
|
16
18
|
imageWidth?: string;
|
|
17
19
|
imageHeight?: string;
|
|
18
20
|
infoPosition?: 'left' | 'right';
|
|
@@ -31,7 +33,6 @@ export interface ProductCardHorizontalSm {
|
|
|
31
33
|
isDisabled?: boolean;
|
|
32
34
|
imageInnerWidth?: number;
|
|
33
35
|
imageInnerHeight?: number;
|
|
34
|
-
hasImageRounded?: boolean;
|
|
35
36
|
}
|
|
36
37
|
export interface ProductCardHorizontalSmStyledProps {
|
|
37
38
|
$hasPeriod?: boolean;
|
|
@@ -36,6 +36,10 @@ exports.default = {
|
|
|
36
36
|
description: "Next.js Image — verilmezse native `img` kullanılır",
|
|
37
37
|
},
|
|
38
38
|
hasImageBorder: { control: "boolean" },
|
|
39
|
+
hasImageRounded: {
|
|
40
|
+
control: "boolean",
|
|
41
|
+
description: "Görsele 0.5rem border-radius uygular",
|
|
42
|
+
},
|
|
39
43
|
imageWidth: { control: "text" },
|
|
40
44
|
imageHeight: { control: "text" },
|
|
41
45
|
imageInnerWidth: { control: "number" },
|
|
@@ -16,7 +16,7 @@ var svgToBase64_1 = __importDefault(require("../../utils/svgToBase64"));
|
|
|
16
16
|
exports.ProductCardLink = styled_components_1.default.a(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n text-decoration: none;\n color: inherit;\n"], ["\n text-decoration: none;\n color: inherit;\n"])));
|
|
17
17
|
exports.ProductTitle = styled_components_1.default.strong(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: block;\n color: var(--dark);\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n height: 19px;\n word-break: break-word;\n margin-bottom: 0.5rem;\n font: var(--title-semi-bold-16-19);\n transition: all .2s ease;\n"], ["\n display: block;\n color: var(--dark);\n display: -webkit-box;\n -webkit-line-clamp: 1;\n -webkit-box-orient: vertical;\n overflow: hidden;\n height: 19px;\n word-break: break-word;\n margin-bottom: 0.5rem;\n font: var(--title-semi-bold-16-19);\n transition: all .2s ease;\n"])));
|
|
18
18
|
exports.ProductText = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n padding-right: 0.5rem;\n\n a:hover ", " {\n color: var(--primary-hover);\n }\n"], ["\n padding-right: 0.5rem;\n\n a:hover ", " {\n color: var(--primary-hover);\n }\n"])), exports.ProductTitle);
|
|
19
|
-
exports.ProductImage = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 96px;\n height: 96px;\n border: 1px solid var(--dark-opacity-5);\n border-radius: 0.5rem;\n position: relative;\n margin-right: 1rem;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n background: white;\n\n &:hover ~ ", " ", " {\n color: var(--primary-hover);\n }\n img{\n width: calc(100% -
|
|
19
|
+
exports.ProductImage = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n width: 96px;\n height: 96px;\n border: 1px solid var(--dark-opacity-5);\n border-radius: 0.5rem;\n position: relative;\n margin-right: 1rem;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n background: white;\n\n &:hover ~ ", " ", " {\n color: var(--primary-hover);\n }\n img{\n width: calc(100% - 1rem);\n height: calc(100% - 1rem);\n object-fit: cover;\n border-radius: 0.5rem;\n display: block;\n margin: 0 auto;\n }\n"], ["\n width: 96px;\n height: 96px;\n border: 1px solid var(--dark-opacity-5);\n border-radius: 0.5rem;\n position: relative;\n margin-right: 1rem;\n overflow: hidden;\n display: flex;\n align-items: center;\n justify-content: center;\n background: white;\n\n &:hover ~ ", " ", " {\n color: var(--primary-hover);\n }\n img{\n width: calc(100% - 1rem);\n height: calc(100% - 1rem);\n object-fit: cover;\n border-radius: 0.5rem;\n display: block;\n margin: 0 auto;\n }\n"])), exports.ProductText, exports.ProductTitle);
|
|
20
20
|
exports.ProductInner = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: auto 1fr auto;\n align-items: center;\n position: relative;\n z-index: 5;\n"], ["\n display: grid;\n grid-template-columns: auto 1fr auto;\n align-items: center;\n position: relative;\n z-index: 5;\n"])));
|
|
21
21
|
exports.ProductPriceContent = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: grid;\n align-items: ", ";\n justify-content: flex-start;\n grid-template-columns: ", ";\n"], ["\n display: grid;\n align-items: ", ";\n justify-content: flex-start;\n grid-template-columns: ", ";\n"])), function (props) { return props.$discountRate ? 'center' : 'end'; }, function (props) { return props.$discountRate ? 'auto 1fr' : '1fr'; });
|
|
22
22
|
exports.ProductDiscountRate = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n margin-right: 0.5rem;\n width: 48px;\n height: 36px;\n border-radius: 0.5rem;\n background-color: var(--primary-opacity-10);\n color: var(--primary);\n display: flex;\n align-items: center;\n justify-content: center;\n font: var(--body-extra-bold-13-16);\n"], ["\n margin-right: 0.5rem;\n width: 48px;\n height: 36px;\n border-radius: 0.5rem;\n background-color: var(--primary-opacity-10);\n color: var(--primary);\n display: flex;\n align-items: center;\n justify-content: center;\n font: var(--body-extra-bold-13-16);\n"])));
|