@trafilea/afrodita-components 6.57.6 → 6.58.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/build/index.d.ts +3 -0
- package/build/index.esm.js +14 -9
- package/build/index.esm.js.map +1 -1
- package/build/index.js +14 -9
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -6057,8 +6057,10 @@ var Container$1q = newStyled.div(templateObject_1$2g || (templateObject_1$2g = _
|
|
|
6057
6057
|
var CustomCheckbox = newStyled.div(CustomCheckboxStyles.baseStyles, function (props) { return [
|
|
6058
6058
|
CustomCheckboxStyles[props.size](props.theme),
|
|
6059
6059
|
CustomCheckboxStyles[props.variant](props.theme, props.isChecked, props.disabled),
|
|
6060
|
-
"\n ".concat(props.
|
|
6061
|
-
props.
|
|
6060
|
+
"\n ".concat(props.backgroundImage
|
|
6061
|
+
? "\n background-image: url(".concat(props.backgroundImage, ");\n background-repeat: no-repeat;\n background-size: cover;\n background-position: center;\n ")
|
|
6062
|
+
: '', "\n ").concat(props.backgroundColor ? "background-color: ".concat(props.backgroundColor, ";") : '', "\n ").concat(props.text === 'White' ||
|
|
6063
|
+
props.text === 'Beige' ||
|
|
6062
6064
|
props.text === 'Latte' ||
|
|
6063
6065
|
props.text === 'Sand'
|
|
6064
6066
|
? "\n svg {\n path {\n fill: var(--colors-shades-black-color);\n }\n }"
|
|
@@ -6069,7 +6071,7 @@ var Input$5 = newStyled.input(templateObject_2$1G || (templateObject_2$1G = __ma
|
|
|
6069
6071
|
return (disabled ? 'not-allowed' : 'pointer');
|
|
6070
6072
|
});
|
|
6071
6073
|
var Checkbox = function (_a) {
|
|
6072
|
-
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c, _d = _a.sizeLabel, sizeLabel = _d === void 0 ? exports.ComponentSize.Medium : _d, colorLabel = _a.colorLabel, text = _a.text, _e = _a.checked, checked = _e === void 0 ? false : _e, id = _a.id, variant = _a.variant, blockUncheck = _a.blockUncheck, backgroundColor = _a.backgroundColor;
|
|
6074
|
+
var _b = _a.disabled, disabled = _b === void 0 ? false : _b, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? exports.ComponentSize.Medium : _c, _d = _a.sizeLabel, sizeLabel = _d === void 0 ? exports.ComponentSize.Medium : _d, colorLabel = _a.colorLabel, text = _a.text, _e = _a.checked, checked = _e === void 0 ? false : _e, id = _a.id, variant = _a.variant, blockUncheck = _a.blockUncheck, backgroundColor = _a.backgroundColor, backgroundImage = _a.backgroundImage;
|
|
6073
6075
|
var theme = useTheme();
|
|
6074
6076
|
var handleChange = function (e) {
|
|
6075
6077
|
if (disabled || (e.target.checked === false && blockUncheck)) {
|
|
@@ -6078,7 +6080,7 @@ var Checkbox = function (_a) {
|
|
|
6078
6080
|
}
|
|
6079
6081
|
onChange(e.target.checked);
|
|
6080
6082
|
};
|
|
6081
|
-
return (jsxRuntime.jsxs(Container$1q, { children: [jsxRuntime.jsx(Input$5, { type: "checkbox", checked: checked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsxRuntime.jsx(CustomCheckbox, __assign$1({ theme: theme, size: size, disabled: disabled, isChecked: checked, "data-testid": "checkbox", variant: variant, backgroundColor: backgroundColor, text: text }, { children: checked && (jsxRuntime.jsx(Icon.Actions.Check, { fill: text === 'White'
|
|
6083
|
+
return (jsxRuntime.jsxs(Container$1q, { children: [jsxRuntime.jsx(Input$5, { type: "checkbox", checked: checked, disabled: disabled, onChange: handleChange, id: id }, void 0), jsxRuntime.jsx(CustomCheckbox, __assign$1({ theme: theme, size: size, disabled: disabled, isChecked: checked, "data-testid": "checkbox", variant: variant, backgroundColor: backgroundColor, backgroundImage: backgroundImage, text: text }, { children: checked && (jsxRuntime.jsx(Icon.Actions.Check, { fill: text === 'White'
|
|
6082
6084
|
? theme.colors.shades['black'].color
|
|
6083
6085
|
: theme.colors.shades['white'].color }, void 0)) }), void 0), jsxRuntime.jsx(Label$6, __assign$1({ "data-testid": "checkbox-text", size: sizeLabel, style: { color: colorLabel ? colorLabel : theme.colors.shades['700'].color }, variant: checked ? 'demi' : 'regular', htmlFor: id, disabled: disabled }, { children: text }), void 0)] }, void 0));
|
|
6084
6086
|
};
|
|
@@ -8653,7 +8655,10 @@ var Filters = function (_a) {
|
|
|
8653
8655
|
});
|
|
8654
8656
|
}, width: "50px", id: "filter[".concat(calculatedSectionIndex, ",").concat(itemIndex, "]") }, item.label));
|
|
8655
8657
|
}), filter.type === 'color' &&
|
|
8656
|
-
filter.items.map(function (item, itemIndex) {
|
|
8658
|
+
filter.items.map(function (item, itemIndex) {
|
|
8659
|
+
var _a;
|
|
8660
|
+
return (jsxRuntime.jsx(FilterCheckboxColor, { onChange: handleCheckboxClick, text: item.label, checked: item.checked, itemIndex: itemIndex, sectionIndex: filters.findIndex(function (filt) { return filt.title === filter.title; }), blockUncheck: item.blockUncheck, color: (_a = item.value) !== null && _a !== void 0 ? _a : '', backgroundImage: item.backgroundImage }, "".concat(item.checked, "-").concat(item.label)));
|
|
8661
|
+
}), !filter.type &&
|
|
8657
8662
|
filter.items.map(function (item, itemIndex) { return (jsxRuntime.jsx(FilterCheckbox, { onChange: handleCheckboxClick, text: item.label === '$75 And Above' ? '+$75' : item.label, checked: item.checked, itemIndex: itemIndex, sectionIndex: filters.findIndex(function (filt) { return filt.title === filter.title; }), blockUncheck: item.blockUncheck }, "".concat(item.checked, "-").concat(item.label))); })] }), void 0) }), filters.findIndex(function (filt) { return filt.title === filter.title; })));
|
|
8658
8663
|
}), isMobile && (jsxRuntime.jsxs(MobileFooter, __assign$1({ "data-testid": "MobileFooter" }, { children: [jsxRuntime.jsxs(MobileClearContainer, __assign$1({ onClick: handleClearAllClick }, { children: [jsxRuntime.jsx(MobileIconsContainer, { children: jsxRuntime.jsx(Icon.Actions.Trash, { fill: theme.colors.shades['700'].color }, void 0) }, void 0), jsxRuntime.jsx(ClearAll, __assign$1({ color: theme.colors.shades['700'].color }, { children: clearAllText }), void 0)] }), void 0), jsxRuntime.jsx(ButtonSecondary, { text: applyText, onClick: mobileApplyButtonClick }, void 0)] }), void 0))] }, void 0));
|
|
8659
8664
|
};
|
|
@@ -8665,11 +8670,11 @@ var FilterCheckbox = function (_a) {
|
|
|
8665
8670
|
return (jsxRuntime.jsx(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: exports.ComponentSize.Small, variant: "secondary", blockUncheck: blockUncheck }, itemIndex));
|
|
8666
8671
|
};
|
|
8667
8672
|
var FilterCheckboxColor = function (_a) {
|
|
8668
|
-
var sectionIndex = _a.sectionIndex, text = _a.text, itemIndex = _a.itemIndex, onChangeProp = _a.onChange, checked = _a.checked, blockUncheck = _a.blockUncheck, color = _a.color;
|
|
8673
|
+
var sectionIndex = _a.sectionIndex, text = _a.text, itemIndex = _a.itemIndex, onChangeProp = _a.onChange, checked = _a.checked, blockUncheck = _a.blockUncheck, color = _a.color, backgroundImage = _a.backgroundImage;
|
|
8669
8674
|
var onChange = React$2.useCallback(function (checked) {
|
|
8670
8675
|
onChangeProp({ sectionIndex: sectionIndex, itemIndex: itemIndex, checked: checked });
|
|
8671
8676
|
}, [onChangeProp, sectionIndex, itemIndex]);
|
|
8672
|
-
return (jsxRuntime.jsx(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: exports.ComponentSize.Medium, variant: "color", blockUncheck: blockUncheck, backgroundColor: color }, itemIndex));
|
|
8677
|
+
return (jsxRuntime.jsx(Checkbox, { onChange: onChange, checked: checked, text: text, id: "filter[".concat(sectionIndex, ",").concat(itemIndex, "]"), size: exports.ComponentSize.Medium, variant: "color", blockUncheck: blockUncheck, backgroundColor: color, backgroundImage: backgroundImage }, itemIndex));
|
|
8673
8678
|
};
|
|
8674
8679
|
|
|
8675
8680
|
var Wrapper$4 = newStyled.div(templateObject_1$1p || (templateObject_1$1p = __makeTemplateObject(["\n padding: 12px 58px;\n display: flex;\n gap: 1.5em;\n @media (max-width: 768px) {\n padding: 0.625rem 1.5rem;\n }\n"], ["\n padding: 12px 58px;\n display: flex;\n gap: 1.5em;\n @media (max-width: 768px) {\n padding: 0.625rem 1.5rem;\n }\n"])));
|
|
@@ -15153,7 +15158,7 @@ var Container$T = newStyled.div(templateObject_6$s || (templateObject_6$s = __ma
|
|
|
15153
15158
|
}, visibleStyle, transformStyle);
|
|
15154
15159
|
var Overlay = newStyled.div(templateObject_7$p || (templateObject_7$p = __makeTemplateObject(["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: opacity 0.3s;\n ", "\n"], ["\n position: fixed;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.75);\n z-index: var(--zIndex-overlay);\n transition: opacity 0.3s;\n ", "\n"])), visibleStyle);
|
|
15155
15160
|
var Modal = function (_a) {
|
|
15156
|
-
var id = _a.id, children = _a.children, _b = _a.dismissable, dismissable = _b === void 0 ? true : _b, _c = _a.maxFullScreen, maxFullScreen = _c === void 0 ? false : _c, padding = _a.padding, onClickOverlayHandler = _a.onClickOverlayHandler, width = _a.width, _d = _a.initialTop, initialTop = _d === void 0 ? '50%' : _d, _e = _a.countryRedirModalWithCoupon, countryRedirModalWithCoupon = _e === void 0 ? false : _e;
|
|
15161
|
+
var id = _a.id, children = _a.children, _b = _a.dismissable, dismissable = _b === void 0 ? true : _b, _c = _a.maxFullScreen, maxFullScreen = _c === void 0 ? false : _c, padding = _a.padding, onClickOverlayHandler = _a.onClickOverlayHandler, width = _a.width, _d = _a.initialTop, initialTop = _d === void 0 ? '50%' : _d, _e = _a.countryRedirModalWithCoupon, countryRedirModalWithCoupon = _e === void 0 ? false : _e, className = _a.className;
|
|
15157
15162
|
var _f = useModal(id), opened = _f.opened, close = _f.close;
|
|
15158
15163
|
var onDismiss = function () {
|
|
15159
15164
|
if (!dismissable) {
|
|
@@ -15161,7 +15166,7 @@ var Modal = function (_a) {
|
|
|
15161
15166
|
}
|
|
15162
15167
|
close();
|
|
15163
15168
|
};
|
|
15164
|
-
return (jsxs(Portal, __assign$1({ id: id }, { children: [jsx(Container$T, __assign$1({ opened: opened, maxFullScreen: maxFullScreen, padding: padding, width: width, initialTop: initialTop, countryRedirModalWithCoupon: countryRedirModalWithCoupon }, { children: children }), void 0), jsx(Overlay, { "data-testid": "modal-overlay", opened: opened, onClick: function () {
|
|
15169
|
+
return (jsxs(Portal, __assign$1({ id: id, className: className }, { children: [jsx(Container$T, __assign$1({ opened: opened, maxFullScreen: maxFullScreen, padding: padding, width: width, initialTop: initialTop, countryRedirModalWithCoupon: countryRedirModalWithCoupon }, { children: children }), void 0), jsx(Overlay, { "data-testid": "modal-overlay", opened: opened, onClick: function () {
|
|
15165
15170
|
onClickOverlayHandler === null || onClickOverlayHandler === void 0 ? void 0 : onClickOverlayHandler();
|
|
15166
15171
|
onDismiss();
|
|
15167
15172
|
} }, void 0)] }), void 0));
|