@trafilea/afrodita-components 6.54.5 → 6.54.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/build/index.d.ts +12 -10
- package/build/index.esm.js +6 -6
- package/build/index.js +6 -6
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -114,19 +114,19 @@ interface PriceLabelProps {
|
|
|
114
114
|
}
|
|
115
115
|
declare const PriceLabel: react__default.FC<PriceLabelProps>;
|
|
116
116
|
|
|
117
|
-
declare type Props$
|
|
117
|
+
declare type Props$3 = PriceLabelProps & {
|
|
118
118
|
savingsDisplay?: boolean;
|
|
119
119
|
pricePerItem?: string;
|
|
120
120
|
hasRoundedSavings?: boolean;
|
|
121
121
|
};
|
|
122
|
-
declare const PriceLabelV2: react__default.FC<Props$
|
|
122
|
+
declare const PriceLabelV2: react__default.FC<Props$3>;
|
|
123
123
|
|
|
124
|
-
declare type Props$
|
|
124
|
+
declare type Props$2 = PriceLabelProps & {
|
|
125
125
|
savingsDisplay?: boolean;
|
|
126
126
|
itemsQuantity?: number;
|
|
127
127
|
packUnitPrice?: string;
|
|
128
128
|
};
|
|
129
|
-
declare const PriceLabelV3: react__default.FC<Props$
|
|
129
|
+
declare const PriceLabelV3: react__default.FC<Props$2>;
|
|
130
130
|
|
|
131
131
|
interface PriceLabelV5Props {
|
|
132
132
|
finalPrice: string | number;
|
|
@@ -225,8 +225,8 @@ declare type ToggleProps = {
|
|
|
225
225
|
|
|
226
226
|
declare const ToggleComponent: FC<ToggleProps>;
|
|
227
227
|
|
|
228
|
-
declare type Props = Omit<IconProps$1, 'name'>;
|
|
229
|
-
declare type IconComponent = react__default.FC<Props>;
|
|
228
|
+
declare type Props$1 = Omit<IconProps$1, 'name'>;
|
|
229
|
+
declare type IconComponent = react__default.FC<Props$1>;
|
|
230
230
|
|
|
231
231
|
declare const Add: IconComponent;
|
|
232
232
|
|
|
@@ -4465,10 +4465,12 @@ declare const buildImageUrl: BuildImageUrl;
|
|
|
4465
4465
|
*/
|
|
4466
4466
|
declare const decimalFormat: (number: number) => string;
|
|
4467
4467
|
|
|
4468
|
-
|
|
4469
|
-
locale?: string
|
|
4470
|
-
currency?: string
|
|
4471
|
-
|
|
4468
|
+
interface Props {
|
|
4469
|
+
locale?: string;
|
|
4470
|
+
currency?: string;
|
|
4471
|
+
decimals?: number;
|
|
4472
|
+
}
|
|
4473
|
+
declare const formatPrice: (value: number, { locale, currency, decimals }?: Props) => string;
|
|
4472
4474
|
|
|
4473
4475
|
declare const getSrcSet: (imgLink: string, ...breakpoints: number[]) => string;
|
|
4474
4476
|
|
package/build/index.esm.js
CHANGED
|
@@ -3115,15 +3115,15 @@ var localeOverrideByCurrency = {
|
|
|
3115
3115
|
};
|
|
3116
3116
|
var formatPrice = function (value, _a) {
|
|
3117
3117
|
var _b, _c;
|
|
3118
|
-
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f;
|
|
3119
|
-
var
|
|
3118
|
+
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f, _g = _d.decimals, decimals = _g === void 0 ? 3 : _g;
|
|
3119
|
+
var _h = value.toFixed(decimals).split('.'), integer = _h[0], fraction = _h[1];
|
|
3120
3120
|
// this prevents `Intl.NumberFormat` from rounding the number
|
|
3121
|
-
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0,
|
|
3121
|
+
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, decimals - 1)) !== null && _b !== void 0 ? _b : 0));
|
|
3122
3122
|
var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
|
|
3123
3123
|
var result = new Intl.NumberFormat(overridedLocale, {
|
|
3124
3124
|
style: 'currency',
|
|
3125
3125
|
currency: currency,
|
|
3126
|
-
maximumFractionDigits:
|
|
3126
|
+
maximumFractionDigits: decimals,
|
|
3127
3127
|
}).format(valueToFormat);
|
|
3128
3128
|
if (currency === 'SGD') {
|
|
3129
3129
|
// intlFormat does not support singapure currency
|
|
@@ -22205,10 +22205,10 @@ var ProductGalleryMobileV5 = function (_a) {
|
|
|
22205
22205
|
if (thumbnailRef.current)
|
|
22206
22206
|
setNav2(thumbnailRef.current);
|
|
22207
22207
|
}, []);
|
|
22208
|
-
return (jsx$1(Container$4, __assign$1({ "data-testid": "product-gallery-mobile" }, { children: jsxs$1(SliderContainer, __assign$1({ "data-testid": productImageDataTestId, ref: sliderWrapper }, { children: [jsx$1(Slider$1, __assign$1({}, SETTINGS, {
|
|
22208
|
+
return (jsx$1(Container$4, __assign$1({ "data-testid": "product-gallery-mobile" }, { children: jsxs$1(SliderContainer, __assign$1({ "data-testid": productImageDataTestId, ref: sliderWrapper }, { children: [jsx$1(Slider$1, __assign$1({}, SETTINGS, { nextArrow: jsx$1(NavButtonContainer, { children: jsx$1(Button, { children: jsx$1(Icon.Arrows.ChevronRight, { height: "21px", width: "21px", fill: colors.shades[700].color }, void 0) }, void 0) }, void 0), prevArrow: jsx$1(NavButtonContainer, { children: jsx$1(Button, { children: jsx$1(Icon.Arrows.ChevronLeft, { height: "21px", width: "21px", fill: colors.shades[700].color }, void 0) }, void 0) }, void 0), asNavFor: nav2, ref: function (slider) { return (slick.current = slider); } }, { children: images.map(function (_a) {
|
|
22209
22209
|
var url = _a.url, key = _a.key, alt = _a.alt;
|
|
22210
22210
|
return (jsxs$1("div", { children: [jsx$1(StyledImage, { alt: alt, src: url, objectFit: "cover", width: theme.component.gallery.mainImgWidth, height: theme.component.gallery.mainImgHeight, loading: "eager", isRatioSquare: isRatioSquare }, void 0), jsx$1(TopTagContainer, __assign$1({ "data-testid": "topTag" }, { children: topTag }), void 0), jsx$1(BottomTagContainer, __assign$1({ "data-testid": "bottomTag" }, { children: bottomTag }), void 0)] }, key));
|
|
22211
|
-
}) }), void 0), jsx$1(SliderThumbnail, __assign$1({ asNavFor: nav1, ref: function (slider) { return (thumbnailRef.current = slider); } }, (thumbnailSettings || THUMBNAIL_SETTINGS), {
|
|
22211
|
+
}) }), void 0), jsx$1(SliderThumbnail, __assign$1({ asNavFor: nav1, ref: function (slider) { return (thumbnailRef.current = slider); } }, (thumbnailSettings || THUMBNAIL_SETTINGS), { children: images.map(function (_a) {
|
|
22212
22212
|
var url = _a.url, key = _a.key, alt = _a.alt;
|
|
22213
22213
|
return (jsx$1(SlideItem, __assign$1({ paddingRight: imagesSliderConfig === null || imagesSliderConfig === void 0 ? void 0 : imagesSliderConfig.spacesBetweenImages }, { children: jsx$1(ThumbnailImage, __assign$1({ alt: "".concat(alt, "-thumbnail"), src: url }, imagesSliderConfig, { loading: "eager", isRatioSquare: isRatioSquare }), void 0) }), key));
|
|
22214
22214
|
}) }), void 0)] }), void 0) }), void 0));
|
package/build/index.js
CHANGED
|
@@ -3141,15 +3141,15 @@ var localeOverrideByCurrency = {
|
|
|
3141
3141
|
};
|
|
3142
3142
|
var formatPrice = function (value, _a) {
|
|
3143
3143
|
var _b, _c;
|
|
3144
|
-
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f;
|
|
3145
|
-
var
|
|
3144
|
+
var _d = _a === void 0 ? {} : _a, _e = _d.locale, locale = _e === void 0 ? 'en-US' : _e, _f = _d.currency, currency = _f === void 0 ? 'USD' : _f, _g = _d.decimals, decimals = _g === void 0 ? 3 : _g;
|
|
3145
|
+
var _h = value.toFixed(decimals).split('.'), integer = _h[0], fraction = _h[1];
|
|
3146
3146
|
// this prevents `Intl.NumberFormat` from rounding the number
|
|
3147
|
-
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0,
|
|
3147
|
+
var valueToFormat = parseFloat("".concat(integer, ".").concat((_b = fraction === null || fraction === void 0 ? void 0 : fraction.slice(0, decimals - 1)) !== null && _b !== void 0 ? _b : 0));
|
|
3148
3148
|
var overridedLocale = (_c = localeOverrideByCurrency[currency]) !== null && _c !== void 0 ? _c : locale;
|
|
3149
3149
|
var result = new Intl.NumberFormat(overridedLocale, {
|
|
3150
3150
|
style: 'currency',
|
|
3151
3151
|
currency: currency,
|
|
3152
|
-
maximumFractionDigits:
|
|
3152
|
+
maximumFractionDigits: decimals,
|
|
3153
3153
|
}).format(valueToFormat);
|
|
3154
3154
|
if (currency === 'SGD') {
|
|
3155
3155
|
// intlFormat does not support singapure currency
|
|
@@ -22231,10 +22231,10 @@ var ProductGalleryMobileV5 = function (_a) {
|
|
|
22231
22231
|
if (thumbnailRef.current)
|
|
22232
22232
|
setNav2(thumbnailRef.current);
|
|
22233
22233
|
}, []);
|
|
22234
|
-
return (jsxRuntime.jsx(Container$4, __assign$1({ "data-testid": "product-gallery-mobile" }, { children: jsxRuntime.jsxs(SliderContainer, __assign$1({ "data-testid": productImageDataTestId, ref: sliderWrapper }, { children: [jsxRuntime.jsx(Slider$1, __assign$1({}, SETTINGS, {
|
|
22234
|
+
return (jsxRuntime.jsx(Container$4, __assign$1({ "data-testid": "product-gallery-mobile" }, { children: jsxRuntime.jsxs(SliderContainer, __assign$1({ "data-testid": productImageDataTestId, ref: sliderWrapper }, { children: [jsxRuntime.jsx(Slider$1, __assign$1({}, SETTINGS, { nextArrow: jsxRuntime.jsx(NavButtonContainer, { children: jsxRuntime.jsx(Button, { children: jsxRuntime.jsx(Icon.Arrows.ChevronRight, { height: "21px", width: "21px", fill: colors.shades[700].color }, void 0) }, void 0) }, void 0), prevArrow: jsxRuntime.jsx(NavButtonContainer, { children: jsxRuntime.jsx(Button, { children: jsxRuntime.jsx(Icon.Arrows.ChevronLeft, { height: "21px", width: "21px", fill: colors.shades[700].color }, void 0) }, void 0) }, void 0), asNavFor: nav2, ref: function (slider) { return (slick.current = slider); } }, { children: images.map(function (_a) {
|
|
22235
22235
|
var url = _a.url, key = _a.key, alt = _a.alt;
|
|
22236
22236
|
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(StyledImage, { alt: alt, src: url, objectFit: "cover", width: theme.component.gallery.mainImgWidth, height: theme.component.gallery.mainImgHeight, loading: "eager", isRatioSquare: isRatioSquare }, void 0), jsxRuntime.jsx(TopTagContainer, __assign$1({ "data-testid": "topTag" }, { children: topTag }), void 0), jsxRuntime.jsx(BottomTagContainer, __assign$1({ "data-testid": "bottomTag" }, { children: bottomTag }), void 0)] }, key));
|
|
22237
|
-
}) }), void 0), jsxRuntime.jsx(SliderThumbnail, __assign$1({ asNavFor: nav1, ref: function (slider) { return (thumbnailRef.current = slider); } }, (thumbnailSettings || THUMBNAIL_SETTINGS), {
|
|
22237
|
+
}) }), void 0), jsxRuntime.jsx(SliderThumbnail, __assign$1({ asNavFor: nav1, ref: function (slider) { return (thumbnailRef.current = slider); } }, (thumbnailSettings || THUMBNAIL_SETTINGS), { children: images.map(function (_a) {
|
|
22238
22238
|
var url = _a.url, key = _a.key, alt = _a.alt;
|
|
22239
22239
|
return (jsxRuntime.jsx(SlideItem, __assign$1({ paddingRight: imagesSliderConfig === null || imagesSliderConfig === void 0 ? void 0 : imagesSliderConfig.spacesBetweenImages }, { children: jsxRuntime.jsx(ThumbnailImage, __assign$1({ alt: "".concat(alt, "-thumbnail"), src: url }, imagesSliderConfig, { loading: "eager", isRatioSquare: isRatioSquare }), void 0) }), key));
|
|
22240
22240
|
}) }), void 0)] }), void 0) }), void 0));
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Trafilea's Design System",
|
|
4
4
|
"author": "Trafilea",
|
|
5
5
|
"repository": "https://github.com/trafilea/afrodita-components",
|
|
6
|
-
"version": "6.54.
|
|
6
|
+
"version": "6.54.7",
|
|
7
7
|
"private": false,
|
|
8
8
|
"main": "build/index.js",
|
|
9
9
|
"style": "build/index.css",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"rollup-plugin-dts": "^3.0.2",
|
|
110
110
|
"rollup-plugin-import-css": "^3.0.2",
|
|
111
111
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
112
|
-
"rollup-plugin-typescript2": "
|
|
112
|
+
"rollup-plugin-typescript2": "0.31.0",
|
|
113
113
|
"tslib": "^2.2.0",
|
|
114
114
|
"webpack": "^5.68.0"
|
|
115
115
|
},
|