@trafilea/afrodita-components 5.0.0-beta.177 → 5.0.0-beta.179
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 +11 -3
- package/build/index.esm.js +14 -6
- package/build/index.esm.js.map +1 -1
- package/build/index.js +14 -6
- package/build/index.js.map +1 -1
- package/build/theme/revel.theme.d.ts +1 -0
- package/build/theme/revel.theme.js +1 -0
- package/build/theme/shapermint.theme.d.ts +1 -0
- package/build/theme/shapermint.theme.js +1 -0
- package/build/theme/truekind.theme.d.ts +1 -0
- package/build/theme/truekind.theme.js +1 -0
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1120,14 +1120,21 @@ interface TooltipProps {
|
|
|
1120
1120
|
children: React.ReactNode;
|
|
1121
1121
|
position: ComponentPosition;
|
|
1122
1122
|
align?: 'start' | 'center' | 'end';
|
|
1123
|
-
|
|
1123
|
+
content?: {
|
|
1124
|
+
text: string;
|
|
1125
|
+
color?: string;
|
|
1126
|
+
};
|
|
1127
|
+
backgroundColor?: string;
|
|
1128
|
+
maxWidth?: string;
|
|
1124
1129
|
header?: {
|
|
1125
1130
|
title: string;
|
|
1126
|
-
|
|
1131
|
+
titleColor?: string;
|
|
1132
|
+
Icon?: IconType;
|
|
1133
|
+
iconFill?: string;
|
|
1127
1134
|
};
|
|
1128
1135
|
onClick?: () => void;
|
|
1129
1136
|
}
|
|
1130
|
-
declare const Tooltip: ({ children, position,
|
|
1137
|
+
declare const Tooltip: ({ children, position, content, backgroundColor, align, maxWidth, onClick, header, }: TooltipProps) => JSX.Element;
|
|
1131
1138
|
|
|
1132
1139
|
interface AccordionProps {
|
|
1133
1140
|
defaultOpen?: boolean;
|
|
@@ -1209,6 +1216,7 @@ declare type ThemeColors = {
|
|
|
1209
1216
|
50: ThemeBasicPallete;
|
|
1210
1217
|
100: ThemeBasicPallete;
|
|
1211
1218
|
150: ThemeBasicPallete;
|
|
1219
|
+
175: ThemeBasicPallete;
|
|
1212
1220
|
200: ThemeBasicPallete;
|
|
1213
1221
|
250: ThemeBasicPallete;
|
|
1214
1222
|
300: ThemeBasicPallete;
|
package/build/index.esm.js
CHANGED
|
@@ -11616,7 +11616,7 @@ var Wrapper$5 = newStyled.div(templateObject_1$11 || (templateObject_1$11 = __ma
|
|
|
11616
11616
|
return getWrapperFlexDirection(position);
|
|
11617
11617
|
});
|
|
11618
11618
|
var TooltipContainer = newStyled.div(function (_a) {
|
|
11619
|
-
var position = _a.position, childrenWidth = _a.childrenWidth, tooltipHeight = _a.tooltipHeight, align = _a.align;
|
|
11619
|
+
var position = _a.position, childrenWidth = _a.childrenWidth, tooltipHeight = _a.tooltipHeight, align = _a.align, maxWidth = _a.maxWidth;
|
|
11620
11620
|
return ({
|
|
11621
11621
|
position: 'absolute',
|
|
11622
11622
|
display: 'flex',
|
|
@@ -11626,6 +11626,7 @@ var TooltipContainer = newStyled.div(function (_a) {
|
|
|
11626
11626
|
marginRight: getTooltipMargin(position, ComponentPosition.Left, "".concat(childrenWidth, "px")),
|
|
11627
11627
|
marginTop: getTooltipMargin(position, ComponentPosition.Top, "-".concat(tooltipHeight, "px")),
|
|
11628
11628
|
marginBottom: getTooltipMargin(position, ComponentPosition.Bottom, "-".concat(tooltipHeight, "px")),
|
|
11629
|
+
maxWidth: maxWidth ? "".concat(maxWidth) : 'none',
|
|
11629
11630
|
transition: 'opacity 0.2s ease',
|
|
11630
11631
|
userSelect: 'none',
|
|
11631
11632
|
opacity: 0,
|
|
@@ -11635,9 +11636,12 @@ var TooltipContainer = newStyled.div(function (_a) {
|
|
|
11635
11636
|
var getTooltipMargin = function (actual, expected, margin) {
|
|
11636
11637
|
return actual === expected ? margin : '0';
|
|
11637
11638
|
};
|
|
11638
|
-
var ContentWrapper = newStyled.div(templateObject_2$J || (templateObject_2$J = __makeTemplateObject(["\n border: 0.063rem solid ", ";\n padding: 0.563rem 0.75rem;\n border-radius: 0.5rem;\n background-color:
|
|
11639
|
+
var ContentWrapper = newStyled.div(templateObject_2$J || (templateObject_2$J = __makeTemplateObject(["\n border: 0.063rem solid ", ";\n padding: 0.563rem 0.75rem;\n border-radius: 0.5rem;\n background-color: ", ";\n z-index: 999;\n"], ["\n border: 0.063rem solid ", ";\n padding: 0.563rem 0.75rem;\n border-radius: 0.5rem;\n background-color: ", ";\n z-index: 999;\n"])), function (_a) {
|
|
11639
11640
|
var borderColor = _a.borderColor;
|
|
11640
11641
|
return borderColor;
|
|
11642
|
+
}, function (_a) {
|
|
11643
|
+
var backgroundColor = _a.backgroundColor;
|
|
11644
|
+
return backgroundColor;
|
|
11641
11645
|
});
|
|
11642
11646
|
var TooltipArrowContainer = newStyled.div(templateObject_3$A || (templateObject_3$A = __makeTemplateObject(["\n width: 1.25rem;\n height: 0.75rem;\n display: flex;\n transform: rotate(", ");\n padding: ", ";\n margin: ", ";\n"], ["\n width: 1.25rem;\n height: 0.75rem;\n display: flex;\n transform: rotate(", ");\n padding: ", ";\n margin: ", ";\n"])), function (_a) {
|
|
11643
11647
|
var position = _a.position;
|
|
@@ -11662,7 +11666,7 @@ var IconContainer$5 = newStyled.div(templateObject_7$7 || (templateObject_7$7 =
|
|
|
11662
11666
|
var templateObject_1$11, templateObject_2$J, templateObject_3$A, templateObject_4$p, templateObject_5$f, templateObject_6$c, templateObject_7$7;
|
|
11663
11667
|
|
|
11664
11668
|
var Tooltip = function (_a) {
|
|
11665
|
-
var children = _a.children, position = _a.position,
|
|
11669
|
+
var children = _a.children, position = _a.position, content = _a.content, backgroundColor = _a.backgroundColor, _b = _a.align, align = _b === void 0 ? 'center' : _b, maxWidth = _a.maxWidth, onClick = _a.onClick, header = _a.header;
|
|
11666
11670
|
var theme = useTheme();
|
|
11667
11671
|
var _c = useState(0), childrenWidth = _c[0], setChildrenWidth = _c[1];
|
|
11668
11672
|
var childrenRef = createRef();
|
|
@@ -11676,7 +11680,11 @@ var Tooltip = function (_a) {
|
|
|
11676
11680
|
var ref = tooltipRef.current;
|
|
11677
11681
|
setTooltipHeight((ref === null || ref === void 0 ? void 0 : ref.offsetHeight) || 0);
|
|
11678
11682
|
}, [tooltipRef]);
|
|
11679
|
-
return (jsxs$1(Wrapper$5, __assign$1({ position: position, "data-testid": "TooltipWrapper" }, { children: [jsx$1("div", __assign$1({ ref: childrenRef }, { children: children }), void 0), jsxs$1(TooltipContainer, __assign$1({ position: position, align: align, childrenWidth: childrenWidth, tooltipHeight: tooltipHeight, ref: tooltipRef, onClick: onClick, "data-testid": "TooltipContainer", className: "tooltip-container" }, { children: [jsxs$1(ContentWrapper, __assign$1({ borderColor: theme.colors.shades['200'].color }, { children: [header && (jsxs$1(TopSection, __assign$1({ "data-testid": "TooltipHeader" }, { children: [
|
|
11683
|
+
return (jsxs$1(Wrapper$5, __assign$1({ position: position, "data-testid": "TooltipWrapper" }, { children: [jsx$1("div", __assign$1({ ref: childrenRef }, { children: children }), void 0), jsxs$1(TooltipContainer, __assign$1({ position: position, align: align, maxWidth: maxWidth, childrenWidth: childrenWidth, tooltipHeight: tooltipHeight, ref: tooltipRef, onClick: onClick, "data-testid": "TooltipContainer", className: "tooltip-container" }, { children: [jsxs$1(ContentWrapper, __assign$1({ className: "tooltip-wrapper", borderColor: theme.colors.shades['200'].color, backgroundColor: backgroundColor ? backgroundColor : theme.colors.shades.white.color }, { children: [header && (jsxs$1(TopSection, __assign$1({ "data-testid": "TooltipHeader" }, { children: [(header === null || header === void 0 ? void 0 : header.Icon) && (jsx$1(IconContainer$5, { children: React__default.createElement(header.Icon, {
|
|
11684
|
+
fill: (header === null || header === void 0 ? void 0 : header.iconFill)
|
|
11685
|
+
? header === null || header === void 0 ? void 0 : header.iconFill
|
|
11686
|
+
: theme.colors.pallete.secondary.color,
|
|
11687
|
+
}) }, void 0)), jsx$1(Title$6, __assign$1({ color: (header === null || header === void 0 ? void 0 : header.titleColor) ? header === null || header === void 0 ? void 0 : header.titleColor : theme.colors.pallete.secondary.color }, { children: header.title }), void 0)] }), void 0)), content && (content === null || content === void 0 ? void 0 : content.text) && (jsx$1(TooltipText, __assign$1({ color: (content === null || content === void 0 ? void 0 : content.color) ? content === null || content === void 0 ? void 0 : content.color : theme.colors.pallete.secondary.color, "data-testid": "TooltipText" }, { children: content.text }), void 0))] }), void 0), jsx$1(TooltipArrowContainer, __assign$1({ position: position, "data-testid": "TooltipArrow" }, { children: jsx$1(TooltipArrow, { width: 1.25, height: 0.75, fill: theme.colors.shades.white.color, stroke: theme.colors.shades['10'].color }, void 0) }), void 0)] }), void 0)] }), void 0));
|
|
11680
11688
|
};
|
|
11681
11689
|
|
|
11682
11690
|
/* base styles & variants */
|
|
@@ -13544,7 +13552,7 @@ var CartProductItem = {
|
|
|
13544
13552
|
var Container$g = newStyled.div(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n padding: 0.625rem 0;\n border: 0.063rem solid ", ";\n border-radius: 0.5rem;\n display: inline-flex;\n align-items: center;\n justify-content: space-around;\n width: 100%;\n max-width: 3.75rem;\n\n * {\n color: ", ";\n }\n"], ["\n padding: 0.625rem 0;\n border: 0.063rem solid ", ";\n border-radius: 0.5rem;\n display: inline-flex;\n align-items: center;\n justify-content: space-around;\n width: 100%;\n max-width: 3.75rem;\n\n * {\n color: ", ";\n }\n"])), function (props) { return props.borderColor; }, function (props) { return props.color; });
|
|
13545
13553
|
var Item = newStyled.span(templateObject_2$f || (templateObject_2$f = __makeTemplateObject(["\n font-size: 0.875rem;\n line-height: 1.125rem;\n margin: 0;\n padding: 0;\n"], ["\n font-size: 0.875rem;\n line-height: 1.125rem;\n margin: 0;\n padding: 0;\n"])));
|
|
13546
13554
|
var Number$1 = newStyled(Item)(templateObject_3$f || (templateObject_3$f = __makeTemplateObject(["\n width: 1.25rem;\n text-align: center;\n font-weight: 600;\n"], ["\n width: 1.25rem;\n text-align: center;\n font-weight: 600;\n"])));
|
|
13547
|
-
var IncreaseDecrease = newStyled(Item)(templateObject_4$9 || (templateObject_4$9 = __makeTemplateObject(["\n cursor: pointer;\n user-select: none;\n padding: 0 0.313rem;\n font-weight: 400;\n"], ["\n cursor: pointer;\n user-select: none;\n padding: 0 0.313rem;\n font-weight: 400;\n"])));
|
|
13555
|
+
var IncreaseDecrease = newStyled(Item)(templateObject_4$9 || (templateObject_4$9 = __makeTemplateObject(["\n cursor: pointer;\n user-select: none;\n padding: 0 0.313rem;\n font-weight: 400;\n color: ", ";\n"], ["\n cursor: pointer;\n user-select: none;\n padding: 0 0.313rem;\n font-weight: 400;\n color: ", ";\n"])), function (props) { return props.isMaxSelected && 'var(--colors-shades-175-color)'; });
|
|
13548
13556
|
var QuantityPicker = function (_a) {
|
|
13549
13557
|
var _b = _a.initialValue, initialValue = _b === void 0 ? 0 : _b, _c = _a.maxValue, maxValue = _c === void 0 ? 99 : _c, value = _a.value, _d = _a.testId, testId = _d === void 0 ? 'quantity-picker' : _d, onChange = _a.onChange;
|
|
13550
13558
|
var theme = useTheme();
|
|
@@ -13567,7 +13575,7 @@ var QuantityPicker = function (_a) {
|
|
|
13567
13575
|
return clamp(value);
|
|
13568
13576
|
});
|
|
13569
13577
|
}, [value, clamp]);
|
|
13570
|
-
return (jsxs$1(Container$g, __assign$1({ borderColor: theme.colors.shades['200'].color, color: theme.colors.shades['700'].color, "data-testid": testId }, { children: [jsx$1(IncreaseDecrease, __assign$1({ "data-testid": "".concat(testId, "-minus"), onClick: function () { return setInternal(function (value) { return clamp(value - 1); }); } }, { children: "-" }), void 0), jsx$1(Number$1, { children: internal }, void 0), jsx$1(IncreaseDecrease, __assign$1({ "data-testid": "".concat(testId, "-plus"), onClick: function () { return setInternal(function (value) { return clamp(value + 1); }); } }, { children: "+" }), void 0)] }), void 0));
|
|
13578
|
+
return (jsxs$1(Container$g, __assign$1({ borderColor: theme.colors.shades['200'].color, color: theme.colors.shades['700'].color, "data-testid": testId }, { children: [jsx$1(IncreaseDecrease, __assign$1({ "data-testid": "".concat(testId, "-minus"), onClick: function () { return setInternal(function (value) { return clamp(value - 1); }); } }, { children: "-" }), void 0), jsx$1(Number$1, { children: internal }, void 0), jsx$1(IncreaseDecrease, __assign$1({ isMaxSelected: value === maxValue, "data-testid": "".concat(testId, "-plus"), onClick: function () { return setInternal(function (value) { return clamp(value + 1); }); } }, { children: "+" }), void 0)] }), void 0));
|
|
13571
13579
|
};
|
|
13572
13580
|
var templateObject_1$k, templateObject_2$f, templateObject_3$f, templateObject_4$9;
|
|
13573
13581
|
|