@trafilea/afrodita-components 5.0.0-beta.100 → 5.0.0-beta.102
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 -2
- package/build/index.esm.js +20 -12
- package/build/index.esm.js.map +1 -1
- package/build/index.js +20 -12
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -241,6 +241,8 @@ declare const CircleSolidQuestion: ({ height, width, fill }: IconProps) => JSX.E
|
|
|
241
241
|
|
|
242
242
|
declare const CircleSolidWarning: ({ height, width, fill }: IconProps) => JSX.Element;
|
|
243
243
|
|
|
244
|
+
declare const CircleSolidStyledCheck: ({ height, width, fill }: IconProps) => JSX.Element;
|
|
245
|
+
|
|
244
246
|
declare const Actions_Check: typeof Check;
|
|
245
247
|
declare const Actions_ClearLight: typeof ClearLight;
|
|
246
248
|
declare const Actions_LightExclamation: typeof LightExclamation;
|
|
@@ -279,6 +281,7 @@ declare const Actions_CircleSolidMinus: typeof CircleSolidMinus;
|
|
|
279
281
|
declare const Actions_CircleSolidPlus: typeof CircleSolidPlus;
|
|
280
282
|
declare const Actions_CircleSolidQuestion: typeof CircleSolidQuestion;
|
|
281
283
|
declare const Actions_CircleSolidWarning: typeof CircleSolidWarning;
|
|
284
|
+
declare const Actions_CircleSolidStyledCheck: typeof CircleSolidStyledCheck;
|
|
282
285
|
declare namespace Actions {
|
|
283
286
|
export {
|
|
284
287
|
Actions_Check as Check,
|
|
@@ -320,6 +323,7 @@ declare namespace Actions {
|
|
|
320
323
|
Actions_CircleSolidPlus as CircleSolidPlus,
|
|
321
324
|
Actions_CircleSolidQuestion as CircleSolidQuestion,
|
|
322
325
|
Actions_CircleSolidWarning as CircleSolidWarning,
|
|
326
|
+
Actions_CircleSolidStyledCheck as CircleSolidStyledCheck,
|
|
323
327
|
};
|
|
324
328
|
}
|
|
325
329
|
|
|
@@ -1047,8 +1051,9 @@ interface ProductGalleryProps {
|
|
|
1047
1051
|
previewListDataTestId?: string;
|
|
1048
1052
|
thumbnailPosition?: 'vertical' | 'horizontal';
|
|
1049
1053
|
borderRadiusVariant?: boolean;
|
|
1054
|
+
previewImgBorderColor?: string;
|
|
1050
1055
|
}
|
|
1051
|
-
declare const ProductGallery: ({ images, selectedValue, topTag, bottomTag, productImageDataTestId, previewListDataTestId, thumbnailPosition, borderRadiusVariant, }: ProductGalleryProps) => JSX.Element;
|
|
1056
|
+
declare const ProductGallery: ({ images, selectedValue, topTag, bottomTag, productImageDataTestId, previewListDataTestId, thumbnailPosition, borderRadiusVariant, previewImgBorderColor, }: ProductGalleryProps) => JSX.Element;
|
|
1052
1057
|
|
|
1053
1058
|
interface RatingProps {
|
|
1054
1059
|
rating: number;
|
|
@@ -2095,8 +2100,12 @@ interface SearchBarProps {
|
|
|
2095
2100
|
initialTerm?: string;
|
|
2096
2101
|
shouldClear?: boolean;
|
|
2097
2102
|
isBlogSearchBar?: boolean;
|
|
2103
|
+
ariaLabel?: string;
|
|
2104
|
+
placeholder?: string;
|
|
2105
|
+
id?: string;
|
|
2106
|
+
autoComplete?: string;
|
|
2098
2107
|
}
|
|
2099
|
-
declare const SearchBar: ({ suggestions, resultOptions, onChange, onSearch, onClose, resultsPanelDataTestId, allResults, initialTerm, shouldClear, isBlogSearchBar, }: SearchBarProps) => JSX.Element;
|
|
2108
|
+
declare const SearchBar: ({ suggestions, resultOptions, onChange, onSearch, onClose, resultsPanelDataTestId, allResults, initialTerm, shouldClear, isBlogSearchBar, ariaLabel, placeholder, id, autoComplete, }: SearchBarProps) => JSX.Element;
|
|
2100
2109
|
|
|
2101
2110
|
interface ProductGalleryMobileProps {
|
|
2102
2111
|
images: ImageType[];
|
package/build/index.esm.js
CHANGED
|
@@ -286,6 +286,11 @@ var CircleSolidWarning = function (_a) {
|
|
|
286
286
|
return (jsx$1(IconWrapper$1, __assign$1({ width: width, height: height, viewBoxX: 40, viewBoxY: 40, title: "circle solid warning" }, { children: jsx$1("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20 1C9.50659 1 1 9.50659 1 20C1 30.4934 9.50659 39 20 39C30.4934 39 39 30.4934 39 20C39 9.50659 30.4934 1 20 1ZM21.7209 10.625C21.7293 10.295 21.4986 10 21.1827 10H18.8239C18.508 10 18.2773 10.295 18.2858 10.625L18.2858 10.627L18.7841 22.6135C18.7931 22.9268 19.0249 23.1997 19.3223 23.1997H20.6844C20.9802 23.1997 21.2136 22.9361 21.2225 22.6134L21.7209 10.625ZM22 27.8818C22 26.6127 21.1026 25.7635 20 25.7635C18.8974 25.7635 18 26.6127 18 27.8818C18 29.1509 18.8974 30 20 30C21.1026 30 22 29.1509 22 27.8818Z", fill: fill }, void 0) }), void 0));
|
|
287
287
|
};
|
|
288
288
|
|
|
289
|
+
var CircleSolidStyledCheck = function (_a) {
|
|
290
|
+
var height = _a.height, width = _a.width, fill = _a.fill;
|
|
291
|
+
return (jsxs$1(IconWrapper$1, __assign$1({ width: width, height: height, viewBoxX: 22, viewBoxY: 22, title: "circle solid styled check" }, { children: [jsx$1("circle", { cx: "11", cy: "11.0005", r: "11", fill: fill }, void 0), jsx$1("path", { d: "M5.86719 12.8697C5.86719 12.8697 7.89031 15.1872 8.29423 16.1339H10.0329C10.7617 13.8699 13.5926 8.46654 16.02 6.5725C16.5223 5.91494 15.2596 5.64334 14.2401 6.07897C12.7035 6.73474 9.80578 11.7468 9.26487 12.9519C8.49742 13.1573 7.68712 11.635 7.68712 11.635L5.86719 12.8697Z", fill: "white" }, void 0)] }), void 0));
|
|
292
|
+
};
|
|
293
|
+
|
|
289
294
|
var Actions = /*#__PURE__*/Object.freeze({
|
|
290
295
|
__proto__: null,
|
|
291
296
|
Check: Check$1,
|
|
@@ -324,7 +329,8 @@ var Actions = /*#__PURE__*/Object.freeze({
|
|
|
324
329
|
CircleSolidMinus: CircleSolidMinus,
|
|
325
330
|
CircleSolidPlus: CircleSolidPlus,
|
|
326
331
|
CircleSolidQuestion: CircleSolidQuestion,
|
|
327
|
-
CircleSolidWarning: CircleSolidWarning
|
|
332
|
+
CircleSolidWarning: CircleSolidWarning,
|
|
333
|
+
CircleSolidStyledCheck: CircleSolidStyledCheck
|
|
328
334
|
});
|
|
329
335
|
|
|
330
336
|
var FitPredictor$1 = function (_a) {
|
|
@@ -5249,13 +5255,15 @@ var Image$2 = newStyled.img(templateObject_1$14 || (templateObject_1$14 = __make
|
|
|
5249
5255
|
return borderRadiusVariant &&
|
|
5250
5256
|
"\nborder-radius: 20px;\n";
|
|
5251
5257
|
}, function (_a) {
|
|
5252
|
-
var selected = _a.selected, theme = _a.theme;
|
|
5253
|
-
return selected
|
|
5258
|
+
var selected = _a.selected, theme = _a.theme, previewImgBorderColor = _a.previewImgBorderColor;
|
|
5259
|
+
return selected
|
|
5260
|
+
? "0.1rem solid ".concat(previewImgBorderColor ? previewImgBorderColor : theme.colors.shades['700'].color)
|
|
5261
|
+
: 'inherit';
|
|
5254
5262
|
});
|
|
5255
5263
|
var ImageSmallPreview = function (_a) {
|
|
5256
|
-
var imageUrl = _a.imageUrl, alt = _a.alt, _b = _a.selected, selected = _b === void 0 ? false : _b, className = _a.className, borderRadiusVariant = _a.borderRadiusVariant;
|
|
5264
|
+
var imageUrl = _a.imageUrl, alt = _a.alt, _b = _a.selected, selected = _b === void 0 ? false : _b, className = _a.className, borderRadiusVariant = _a.borderRadiusVariant, previewImgBorderColor = _a.previewImgBorderColor;
|
|
5257
5265
|
var theme = useTheme();
|
|
5258
|
-
return (jsx$1(Image$2, { className: className, src: imageUrl, alt: alt, selected: selected, theme: theme, borderRadiusVariant: borderRadiusVariant }, void 0));
|
|
5266
|
+
return (jsx$1(Image$2, { className: className, src: imageUrl, alt: alt, selected: selected, theme: theme, borderRadiusVariant: borderRadiusVariant, previewImgBorderColor: previewImgBorderColor }, void 0));
|
|
5259
5267
|
};
|
|
5260
5268
|
var templateObject_1$14;
|
|
5261
5269
|
|
|
@@ -9574,12 +9582,12 @@ var Container$I = newStyled.div(templateObject_3$w || (templateObject_3$w = __ma
|
|
|
9574
9582
|
});
|
|
9575
9583
|
var Button$3 = newStyled.button(templateObject_4$l || (templateObject_4$l = __makeTemplateObject(["\n padding: 0;\n border: none;\n text-decoration: none;\n background: transparent;\n outline: none;\n"], ["\n padding: 0;\n border: none;\n text-decoration: none;\n background: transparent;\n outline: none;\n"])));
|
|
9576
9584
|
var ImagePreviewList = function (_a) {
|
|
9577
|
-
var images = _a.images, selectedImage = _a.selectedImage, onClick = _a.onClick, dataTestId = _a.dataTestId, position = _a.position, borderRadiusVariant = _a.borderRadiusVariant;
|
|
9585
|
+
var images = _a.images, selectedImage = _a.selectedImage, onClick = _a.onClick, dataTestId = _a.dataTestId, position = _a.position, borderRadiusVariant = _a.borderRadiusVariant, previewImgBorderColor = _a.previewImgBorderColor;
|
|
9578
9586
|
return (jsx$1(Container$I, __assign$1({ "data-testid": dataTestId, position: position, className: position }, { children: position == 'horizontal' ? (jsx$1("div", __assign$1({ style: { maxWidth: '360px' } }, { children: jsx$1(SliderNavigation, __assign$1({ speed: 200, infinite: false, arrows: {
|
|
9579
9587
|
arrowWidth: 0.75,
|
|
9580
9588
|
arrowHeight: 1.25,
|
|
9581
9589
|
arrowPadding: 1.625,
|
|
9582
|
-
}, adaptiveHeight: true, dots: false, slidesToShow: 4 }, { children: images.map(function (item) { return (jsx$1(Button$3, __assign$1({ onClick: function () { return onClick(item); } }, { children: jsx$1(ImageSmallPreview, { imageUrl: item.imageUrl, alt: item.alt, selected: item.key === selectedImage.key, borderRadiusVariant: borderRadiusVariant }, void 0) }), item.key)); }) }), void 0) }), void 0)) : (images.map(function (item) { return (jsx$1(Button$3, __assign$1({ onClick: function () { return onClick(item); } }, { children: jsx$1(ImageSmallPreview, { imageUrl: item.imageUrl, alt: item.alt, selected: item.key === selectedImage.key, borderRadiusVariant: borderRadiusVariant }, void 0) }), item.key)); })) }), void 0));
|
|
9590
|
+
}, adaptiveHeight: true, dots: false, slidesToShow: 4 }, { children: images.map(function (item) { return (jsx$1(Button$3, __assign$1({ onClick: function () { return onClick(item); } }, { children: jsx$1(ImageSmallPreview, { imageUrl: item.imageUrl, alt: item.alt, selected: item.key === selectedImage.key, borderRadiusVariant: borderRadiusVariant, previewImgBorderColor: previewImgBorderColor }, void 0) }), item.key)); }) }), void 0) }), void 0)) : (images.map(function (item) { return (jsx$1(Button$3, __assign$1({ onClick: function () { return onClick(item); } }, { children: jsx$1(ImageSmallPreview, { imageUrl: item.imageUrl, alt: item.alt, selected: item.key === selectedImage.key, borderRadiusVariant: borderRadiusVariant, previewImgBorderColor: previewImgBorderColor }, void 0) }), item.key)); })) }), void 0));
|
|
9583
9591
|
};
|
|
9584
9592
|
var templateObject_1$12, templateObject_2$H, templateObject_3$w, templateObject_4$l;
|
|
9585
9593
|
|
|
@@ -11185,7 +11193,7 @@ var templateObject_1$11, templateObject_2$G, templateObject_3$v;
|
|
|
11185
11193
|
|
|
11186
11194
|
var Container$G = newStyled.div(templateObject_1$10 || (templateObject_1$10 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: max-content 1fr;\n grid-column-gap: 20px;\n max-height: 45rem;\n width: fit-content;\n"], ["\n display: grid;\n grid-template-columns: max-content 1fr;\n grid-column-gap: 20px;\n max-height: 45rem;\n width: fit-content;\n"])));
|
|
11187
11195
|
var ProductGallery = function (_a) {
|
|
11188
|
-
var images = _a.images, selectedValue = _a.selectedValue, topTag = _a.topTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, previewListDataTestId = _a.previewListDataTestId, thumbnailPosition = _a.thumbnailPosition, _b = _a.borderRadiusVariant, borderRadiusVariant = _b === void 0 ? false : _b;
|
|
11196
|
+
var images = _a.images, selectedValue = _a.selectedValue, topTag = _a.topTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, previewListDataTestId = _a.previewListDataTestId, thumbnailPosition = _a.thumbnailPosition, _b = _a.borderRadiusVariant, borderRadiusVariant = _b === void 0 ? false : _b, previewImgBorderColor = _a.previewImgBorderColor;
|
|
11189
11197
|
var initialValue = selectedValue && images.includes(selectedValue) ? selectedValue : images[0];
|
|
11190
11198
|
var _c = useState(initialValue), selectedImage = _c[0], setSelectedImage = _c[1];
|
|
11191
11199
|
useEffect(function () {
|
|
@@ -11193,7 +11201,7 @@ var ProductGallery = function (_a) {
|
|
|
11193
11201
|
}, [initialValue]);
|
|
11194
11202
|
return (jsxs$1(Container$G, { children: [jsx$1(ImagePreviewList, { images: images, selectedImage: selectedImage, dataTestId: previewListDataTestId, onClick: function (value) {
|
|
11195
11203
|
setSelectedImage(value);
|
|
11196
|
-
}, position: thumbnailPosition, borderRadiusVariant: borderRadiusVariant }, void 0), jsx$1(ImageProductWithTags$1, { image: selectedImage, topTag: topTag, bottomTag: bottomTag, testId: productImageDataTestId, position: thumbnailPosition, borderRadiusVariant: borderRadiusVariant }, void 0)] }, void 0));
|
|
11204
|
+
}, position: thumbnailPosition, borderRadiusVariant: borderRadiusVariant, previewImgBorderColor: previewImgBorderColor }, void 0), jsx$1(ImageProductWithTags$1, { image: selectedImage, topTag: topTag, bottomTag: bottomTag, testId: productImageDataTestId, position: thumbnailPosition, borderRadiusVariant: borderRadiusVariant }, void 0)] }, void 0));
|
|
11197
11205
|
};
|
|
11198
11206
|
var templateObject_1$10;
|
|
11199
11207
|
|
|
@@ -12975,12 +12983,12 @@ var Container$f = newStyled.div({
|
|
|
12975
12983
|
display: 'flex',
|
|
12976
12984
|
});
|
|
12977
12985
|
var SearchBar = function (_a) {
|
|
12978
|
-
var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, onClose = _a.onClose, resultsPanelDataTestId = _a.resultsPanelDataTestId, allResults = _a.allResults, initialTerm = _a.initialTerm, _b = _a.shouldClear, shouldClear = _b === void 0 ? false : _b, _c = _a.isBlogSearchBar, isBlogSearchBar = _c === void 0 ? false : _c;
|
|
12986
|
+
var suggestions = _a.suggestions, resultOptions = _a.resultOptions, onChange = _a.onChange, onSearch = _a.onSearch, onClose = _a.onClose, resultsPanelDataTestId = _a.resultsPanelDataTestId, allResults = _a.allResults, initialTerm = _a.initialTerm, _b = _a.shouldClear, shouldClear = _b === void 0 ? false : _b, _c = _a.isBlogSearchBar, isBlogSearchBar = _c === void 0 ? false : _c, _d = _a.ariaLabel, ariaLabel = _d === void 0 ? 'Search for products' : _d, _e = _a.placeholder, placeholder = _e === void 0 ? 'Search for products' : _e, _f = _a.id, id = _f === void 0 ? 'search' : _f, _g = _a.autoComplete, autoComplete = _g === void 0 ? 'off' : _g;
|
|
12979
12987
|
var theme = useTheme();
|
|
12980
12988
|
if (initialTerm) {
|
|
12981
12989
|
initialState$1.term = initialTerm;
|
|
12982
12990
|
}
|
|
12983
|
-
var
|
|
12991
|
+
var _h = useReducer(reducer, initialState$1), state = _h[0], dispatch = _h[1];
|
|
12984
12992
|
var ref = useRef(null);
|
|
12985
12993
|
var shouldDisplaySuggestion = function () {
|
|
12986
12994
|
return resultOptions.length === 0 && suggestions.length > 0 && !state.term;
|
|
@@ -13006,7 +13014,7 @@ var SearchBar = function (_a) {
|
|
|
13006
13014
|
onClose();
|
|
13007
13015
|
}
|
|
13008
13016
|
};
|
|
13009
|
-
return (jsxs$1("form", __assign$1({ role: "search", onSubmit: function (e) { return e.preventDefault(); }, ref: ref, style: { position: 'relative' } }, { children: [jsxs$1(Container$f, __assign$1({ theme: theme }, { children: [jsx$1(Input, { value: state.term, placeholder:
|
|
13017
|
+
return (jsxs$1("form", __assign$1({ role: "search", onSubmit: function (e) { return e.preventDefault(); }, ref: ref, style: { position: 'relative' } }, { children: [jsxs$1(Container$f, __assign$1({ theme: theme }, { children: [jsx$1(Input, { value: state.term, placeholder: placeholder, onChange: function (e) { return dispatch({ type: 'UPDATE_TERM', payload: { term: e.target.value } }); }, onFocus: function () { return dispatch({ type: 'TOGGLE_PANEL', payload: { open: true } }); }, id: id, autoComplete: autoComplete, theme: theme, "aria-label": ariaLabel, onKeyDown: function (e) {
|
|
13010
13018
|
if (e.key === 'Enter') {
|
|
13011
13019
|
e.preventDefault();
|
|
13012
13020
|
e.stopPropagation();
|