@trafilea/afrodita-components 6.3.0 → 6.4.0
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 +12 -4
- package/build/index.esm.js +31 -20
- package/build/index.esm.js.map +1 -1
- package/build/index.js +31 -20
- package/build/index.js.map +1 -1
- package/build/theme/revel.theme.d.ts +1 -1
- package/build/theme/revel.theme.js +8 -4
- package/build/theme/shapermint.theme.d.ts +1 -1
- package/build/theme/shapermint.theme.js +8 -4
- package/build/theme/thespadr.theme.d.ts +1 -1
- package/build/theme/thespadr.theme.js +8 -5
- package/build/theme/truekind.theme.d.ts +1 -1
- package/build/theme/truekind.theme.js +8 -4
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -1219,7 +1219,7 @@ declare type Theme = {
|
|
|
1219
1219
|
};
|
|
1220
1220
|
declare type ThemeBreakpoints = {
|
|
1221
1221
|
mobile: number;
|
|
1222
|
-
tablet
|
|
1222
|
+
tablet: number;
|
|
1223
1223
|
desktop: number;
|
|
1224
1224
|
};
|
|
1225
1225
|
declare type ThemeBasicPallete = {
|
|
@@ -1943,7 +1943,14 @@ declare type ThemeAssets = {
|
|
|
1943
1943
|
};
|
|
1944
1944
|
};
|
|
1945
1945
|
[key: string]: any;
|
|
1946
|
-
};
|
|
1946
|
+
};
|
|
1947
|
+
declare const Viewports: {
|
|
1948
|
+
readonly mobile: "mobile";
|
|
1949
|
+
readonly tablet: "tablet";
|
|
1950
|
+
readonly desktop: "desktop";
|
|
1951
|
+
readonly desktopLarge: "desktopLarge";
|
|
1952
|
+
};
|
|
1953
|
+
declare type Viewport = typeof Viewports[keyof typeof Viewports];
|
|
1947
1954
|
|
|
1948
1955
|
declare type ThemeProviderProps = {
|
|
1949
1956
|
isSameOriginIcons?: boolean;
|
|
@@ -3338,8 +3345,9 @@ declare const Spinner: React.FC<SpinnerProps>;
|
|
|
3338
3345
|
|
|
3339
3346
|
declare const useOnClickOutside: <T extends HTMLElement = HTMLElement>(ref: RefObject<T>, handler: (event: Event) => void) => void;
|
|
3340
3347
|
|
|
3341
|
-
declare type
|
|
3342
|
-
|
|
3348
|
+
declare type UseWindowDimensions = (breakpoints?: ThemeBreakpoints, options?: {
|
|
3349
|
+
shouldListenChanges?: boolean;
|
|
3350
|
+
}) => {
|
|
3343
3351
|
viewport: Viewport;
|
|
3344
3352
|
isMobile: boolean;
|
|
3345
3353
|
isTablet: boolean;
|
package/build/index.esm.js
CHANGED
|
@@ -3107,6 +3107,20 @@ var formatPrice = function (value, _a) {
|
|
|
3107
3107
|
}).format(valueToFormat);
|
|
3108
3108
|
};
|
|
3109
3109
|
|
|
3110
|
+
var Viewports = {
|
|
3111
|
+
mobile: 'mobile',
|
|
3112
|
+
tablet: 'tablet',
|
|
3113
|
+
desktop: 'desktop',
|
|
3114
|
+
desktopLarge: 'desktopLarge',
|
|
3115
|
+
};
|
|
3116
|
+
|
|
3117
|
+
//ANNOTATION: Those values are up to.
|
|
3118
|
+
var DEFAULT_BREAKPOINTS = {
|
|
3119
|
+
mobile: 640,
|
|
3120
|
+
tablet: 1024,
|
|
3121
|
+
desktop: 1280,
|
|
3122
|
+
};
|
|
3123
|
+
|
|
3110
3124
|
var Container$17 = newStyled.div(templateObject_1$1O || (templateObject_1$1O = __makeTemplateObject(["\n @keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n }\n\n display: inline-block;\n height: ", ";\n width: ", ";\n position: relative;\n overflow: hidden;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n\n ::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(\n 90deg,\n ", ",\n ", ",\n ", "\n );\n animation: shimmer 2s infinite;\n content: '';\n box-sizing: border-box;\n }\n"], ["\n @keyframes shimmer {\n 100% {\n transform: translateX(100%);\n }\n }\n\n display: inline-block;\n height: ", ";\n width: ", ";\n position: relative;\n overflow: hidden;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: border-box;\n\n ::after {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transform: translateX(-100%);\n background-image: linear-gradient(\n 90deg,\n ", ",\n ", ",\n ", "\n );\n animation: shimmer 2s infinite;\n content: '';\n box-sizing: border-box;\n }\n"])), function (_a) {
|
|
3111
3125
|
var height = _a.height;
|
|
3112
3126
|
return (height ? height : '1.5em');
|
|
@@ -5216,12 +5230,6 @@ var DiscountTag = function (_a) {
|
|
|
5216
5230
|
};
|
|
5217
5231
|
var templateObject_1$1A, templateObject_2$10;
|
|
5218
5232
|
|
|
5219
|
-
//TODO Move this to types with ThemeBreakpoints
|
|
5220
|
-
var Viewports = {
|
|
5221
|
-
mobile: 'mobile',
|
|
5222
|
-
tablet: 'tablet',
|
|
5223
|
-
desktop: 'desktop',
|
|
5224
|
-
};
|
|
5225
5233
|
function getWindowDimensions() {
|
|
5226
5234
|
if (typeof window === 'undefined')
|
|
5227
5235
|
return { width: 0, height: 0 };
|
|
@@ -5234,19 +5242,22 @@ function getWindowDimensions() {
|
|
|
5234
5242
|
var getViewport = function (breakpoints, width) {
|
|
5235
5243
|
if (width <= breakpoints.mobile)
|
|
5236
5244
|
return Viewports.mobile;
|
|
5237
|
-
if (
|
|
5245
|
+
if (width <= breakpoints.tablet)
|
|
5238
5246
|
return Viewports.tablet;
|
|
5239
|
-
|
|
5240
|
-
|
|
5247
|
+
if (width <= breakpoints.desktop)
|
|
5248
|
+
return Viewports.desktop;
|
|
5249
|
+
return Viewports.desktopLarge;
|
|
5241
5250
|
};
|
|
5242
|
-
var useWindowDimensions = function (breakpoints,
|
|
5243
|
-
|
|
5251
|
+
var useWindowDimensions = function (breakpoints, _a) {
|
|
5252
|
+
if (breakpoints === void 0) { breakpoints = DEFAULT_BREAKPOINTS; }
|
|
5253
|
+
var _b = _a === void 0 ? {} : _a, shouldListenChanges = _b.shouldListenChanges;
|
|
5254
|
+
var _c = useState(function () {
|
|
5244
5255
|
var dimension = getWindowDimensions();
|
|
5245
5256
|
return {
|
|
5246
5257
|
windowDimensions: dimension,
|
|
5247
5258
|
viewport: getViewport(breakpoints, dimension.width),
|
|
5248
5259
|
};
|
|
5249
|
-
}), state =
|
|
5260
|
+
}), state = _c[0], setState = _c[1];
|
|
5250
5261
|
useEffect(function () {
|
|
5251
5262
|
function handleResize() {
|
|
5252
5263
|
var newDimension = getWindowDimensions();
|
|
@@ -5268,7 +5279,7 @@ var useWindowDimensions = function (breakpoints, shouldListenChanges) {
|
|
|
5268
5279
|
}, [shouldListenChanges]);
|
|
5269
5280
|
var isMobile = state.viewport === Viewports.mobile;
|
|
5270
5281
|
var isTablet = state.viewport === Viewports.tablet;
|
|
5271
|
-
var isDesktop = state.viewport === Viewports.desktop;
|
|
5282
|
+
var isDesktop = state.viewport === Viewports.desktop || state.viewport === Viewports.desktopLarge;
|
|
5272
5283
|
return __assign$1(__assign$1({}, state), { isMobile: isMobile, isTablet: isTablet, isDesktop: isDesktop });
|
|
5273
5284
|
};
|
|
5274
5285
|
|
|
@@ -5352,7 +5363,7 @@ function getTestId() {
|
|
|
5352
5363
|
var PriceLabel = function (_a) {
|
|
5353
5364
|
var finalPrice = _a.finalPrice, originalPrice = _a.originalPrice, discount = _a.discount, color = _a.color, testId = _a.testId, _b = _a.finalPriceStyled, finalPriceStyled = _b === void 0 ? false : _b, finalPriceStyle = _a.finalPriceStyle, _c = _a.originalPriceStyled, originalPriceStyled = _c === void 0 ? false : _c, _d = _a.originalPriceUnderlined, originalPriceUnderlined = _d === void 0 ? true : _d, _e = _a.size, size = _e === void 0 ? ComponentSize.Medium : _e, _f = _a.clubStyle, clubStyle = _f === void 0 ? false : _f, rest = __rest(_a, ["finalPrice", "originalPrice", "discount", "color", "testId", "finalPriceStyled", "finalPriceStyle", "originalPriceStyled", "originalPriceUnderlined", "size", "clubStyle"]);
|
|
5354
5365
|
var theme = useTheme();
|
|
5355
|
-
var isMobile = useWindowDimensions(
|
|
5366
|
+
var isMobile = useWindowDimensions().isMobile;
|
|
5356
5367
|
var priceCommonProps = {
|
|
5357
5368
|
size: finalPriceStyled ? ComponentSize.Small : size,
|
|
5358
5369
|
color: color || theme.colors.pallete.secondary.color,
|
|
@@ -5898,7 +5909,7 @@ var DesktopDollarPart = newStyled(DollarPart)(templateObject_7$e || (templateObj
|
|
|
5898
5909
|
var DesktopClubMembersText = newStyled(ClubMembersText)(templateObject_8$a || (templateObject_8$a = __makeTemplateObject(["\n font-size: 13px;\n"], ["\n font-size: 13px;\n"])));
|
|
5899
5910
|
var ClubPriceLabel = function (_a) {
|
|
5900
5911
|
var clubPrice = _a.clubPrice;
|
|
5901
|
-
var isMobile = useWindowDimensions(
|
|
5912
|
+
var isMobile = useWindowDimensions().isMobile;
|
|
5902
5913
|
return (jsx$1(Fragment$2, { children: isMobile ? (jsxs$1(MobileContainer, { children: [jsx$1(MobileDollarPart, { children: clubPrice }, void 0), jsx$1(MobileClubMembersText, { children: "FOR CLUB MEMBERS" }, void 0)] }, void 0)) : (jsxs$1(Container$S, { children: [jsx$1(DesktopDollarPart, { children: clubPrice }, void 0), jsx$1(DesktopClubMembersText, { children: "FOR CLUB MEMBERS" }, void 0)] }, void 0)) }, void 0));
|
|
5903
5914
|
};
|
|
5904
5915
|
var templateObject_1$1h, templateObject_2$T, templateObject_3$I, templateObject_4$x, templateObject_5$m, templateObject_6$k, templateObject_7$e, templateObject_8$a;
|
|
@@ -6095,7 +6106,7 @@ var ProductItemMobile = function (_a) {
|
|
|
6095
6106
|
} : _g, _h = _a.clubPrice, clubPrice = _h === void 0 ? '' : _h, _j = _a.showClubPriceLabel, showClubPriceLabel = _j === void 0 ? false : _j, isRatingLoading = _a.isRatingLoading;
|
|
6096
6107
|
var theme = useTheme();
|
|
6097
6108
|
var styles = getStylesBySize$9(size);
|
|
6098
|
-
var isMobile = useWindowDimensions(
|
|
6109
|
+
var isMobile = useWindowDimensions().isMobile;
|
|
6099
6110
|
var space = useMemo(function () {
|
|
6100
6111
|
var _a;
|
|
6101
6112
|
return (_a = {},
|
|
@@ -6194,7 +6205,7 @@ var ProductItemTK = function (_a) {
|
|
|
6194
6205
|
} : _h, _j = _a.clubPrice, clubPrice = _j === void 0 ? '' : _j, _k = _a.showClubPriceLabel, showClubPriceLabel = _k === void 0 ? false : _k;
|
|
6195
6206
|
var theme = useTheme();
|
|
6196
6207
|
var styles = getStylesBySize$8(size);
|
|
6197
|
-
var isMobile = useWindowDimensions(
|
|
6208
|
+
var isMobile = useWindowDimensions().isMobile;
|
|
6198
6209
|
var space = useMemo(function () {
|
|
6199
6210
|
var _a;
|
|
6200
6211
|
return (_a = {},
|
|
@@ -13080,7 +13091,7 @@ var IconWrapper = newStyled.div(function (props) { return ({
|
|
|
13080
13091
|
var IconsWithTitle = function (_a) {
|
|
13081
13092
|
var _b;
|
|
13082
13093
|
var iconName = _a.iconName, iconTitle = _a.iconTitle, _c = _a.iconFolder, iconFolder = _c === void 0 ? 'MyAccount' : _c, _d = _a.withWrapper, withWrapper = _d === void 0 ? true : _d, backgroundColor = _a.backgroundColor, iconColor = _a.iconColor, _e = _a.iconSizeDesktop, iconSizeDesktop = _e === void 0 ? 4 : _e, _f = _a.iconSizeMobile, iconSizeMobile = _f === void 0 ? 3 : _f, _g = _a.iconTitlePosition, iconTitlePosition = _g === void 0 ? 'bottom' : _g, _h = _a.iconTitleStyle, iconTitleStyle = _h === void 0 ? '' : _h, _j = _a.iconStyle, iconStyle = _j === void 0 ? '' : _j, _k = _a.isTitleInnerHtml, isTitleInnerHtml = _k === void 0 ? false : _k;
|
|
13083
|
-
var isMobile = useWindowDimensions(
|
|
13094
|
+
var isMobile = useWindowDimensions().isMobile;
|
|
13084
13095
|
// @ts-ignore
|
|
13085
13096
|
var IconComponent = (_b = Icon[iconFolder][iconName]) !== null && _b !== void 0 ? _b : (function () { return 'Not found'; });
|
|
13086
13097
|
if (IconComponent == null) {
|
|
@@ -13115,7 +13126,7 @@ var StyledTitle = newStyled.div(templateObject_3$s || (templateObject_3$s = __ma
|
|
|
13115
13126
|
});
|
|
13116
13127
|
var ImageCardWithDescription = function (_a) {
|
|
13117
13128
|
var image = _a.image, title = _a.title, description = _a.description, _b = _a.titlePosition, titlePosition = _b === void 0 ? 'left' : _b;
|
|
13118
|
-
var isMobile = useWindowDimensions(
|
|
13129
|
+
var isMobile = useWindowDimensions().isMobile;
|
|
13119
13130
|
return (jsxs$1(Container$B, __assign$1({ "data-testid": "Container", isMobile: isMobile }, { children: [jsx$1(ImageContainer$2, __assign$1({ "data-testid": "ImageContainer", isMobile: isMobile }, { children: jsx$1(Image$3, { src: image, borderRadius: "40px", alt: "before", height: "100%", width: "100%" }, void 0) }), void 0), jsx$1(StyledTitle, __assign$1({ titlePosition: titlePosition, "data-testid": "StyledTitle" }, { children: isMobile ? (jsx$1(Text$8, __assign$1({ variant: "link", weight: "demi" }, { children: title }), void 0)) : (jsx$1(Text$8, __assign$1({ variant: "heading6", weight: "demi" }, { children: title }), void 0)) }), void 0), jsx$1(Text$8, __assign$1({ variant: "link", weight: "regular" }, { children: description }), void 0)] }), void 0));
|
|
13120
13131
|
};
|
|
13121
13132
|
var templateObject_1$P, templateObject_2$y, templateObject_3$s;
|
|
@@ -18985,7 +18996,7 @@ var TextContainer = newStyled.div(templateObject_4$4 || (templateObject_4$4 = __
|
|
|
18985
18996
|
var TextWithImage = function (_a) {
|
|
18986
18997
|
var _b, _c, _d, _e;
|
|
18987
18998
|
var title = _a.title, text = _a.text, children = _a.children, buttomText = _a.buttomText, backgroundColor = _a.backgroundColor, imageLeftSide = _a.imageLeftSide, titleStyle = _a.titleStyle, textStyle = _a.textStyle, _f = _a.buttonWideOnMobile, buttonWideOnMobile = _f === void 0 ? false : _f, props = __rest(_a, ["title", "text", "children", "buttomText", "backgroundColor", "imageLeftSide", "titleStyle", "textStyle", "buttonWideOnMobile"]);
|
|
18988
|
-
var isMobile = useWindowDimensions(
|
|
18999
|
+
var isMobile = useWindowDimensions().isMobile;
|
|
18989
19000
|
var ImageTitle = function () { return (jsx(Fragment, { children: !isMobile ? (jsx(Text$8, __assign$1({ variant: "heading2", weight: "bold", style: titleStyle
|
|
18990
19001
|
? titleStyle
|
|
18991
19002
|
: {
|