@trafilea/afrodita-components 6.15.1 → 6.15.2

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 CHANGED
@@ -3125,8 +3125,10 @@ interface SizeFitGuideProps {
3125
3125
  declare const SizeFitGuide: ({ title, fitPercentage, onClick, onClickFitPercentage, hideIcon, }: SizeFitGuideProps) => JSX.Element;
3126
3126
 
3127
3127
  declare type Size = 'S' | 'XS / S' | 'M' | 'M / L' | 'L' | 'XL' | 'XL / 2XL' | '2XL' | '3XL' | '4XL';
3128
- declare type SizeTipReference = {
3129
- [key in Size]?: string;
3128
+ declare type SizeTip = {
3129
+ size: Size;
3130
+ tip: string;
3131
+ cta: string;
3130
3132
  };
3131
3133
  interface SizeSelectorProps {
3132
3134
  label: string;
@@ -3137,7 +3139,7 @@ interface SizeSelectorProps {
3137
3139
  inline?: boolean;
3138
3140
  width?: string;
3139
3141
  hasSizeGuide?: boolean;
3140
- sizeTipReferences?: SizeTipReference;
3142
+ sizeTipReferences?: SizeTip[];
3141
3143
  }
3142
3144
  declare const SizeSelector: ({ label, sizes, selectedValue, onChange, onClickSizeTip, inline, width, hasSizeGuide, sizeTipReferences, }: SizeSelectorProps) => _emotion_react_jsx_runtime.JSX.Element;
3143
3145
 
@@ -19318,11 +19318,12 @@ var templateObject_1$d, templateObject_2$9;
19318
19318
  var SizeSelector = function (_a) {
19319
19319
  var _b;
19320
19320
  var label = _a.label, sizes = _a.sizes, selectedValue = _a.selectedValue, onChange = _a.onChange, onClickSizeTip = _a.onClickSizeTip, _c = _a.inline, inline = _c === void 0 ? false : _c, width = _a.width, _d = _a.hasSizeGuide, hasSizeGuide = _d === void 0 ? false : _d, sizeTipReferences = _a.sizeTipReferences;
19321
+ var activeSizeTip = sizeTipReferences === null || sizeTipReferences === void 0 ? void 0 : sizeTipReferences.find(function (sizeTip) { return (sizeTip === null || sizeTip === void 0 ? void 0 : sizeTip.size) === (selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.label); });
19321
19322
  return (jsxs("div", __assign$1({ css: {
19322
19323
  display: 'flex',
19323
19324
  flexDirection: inline ? 'row' : 'column',
19324
19325
  alignItems: inline ? 'center' : 'start',
19325
- } }, { children: [jsxs(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small", css: { alignSelf: inline ? 'start' : 'inherit', padding: inline ? '0.75rem 0' : '0' } }, { children: [label, !inline && (jsx(Text$7, __assign$1({ variant: "label", weight: "demi", size: "regular" }, { children: selectedValue.description }), void 0))] }), void 0), hasSizeGuide && (jsxs(Row, { children: [jsx(Icon.Actions.CircleInfo, { width: 1.2 }, void 0), jsx(Text$7, __assign$1({ variant: "body", weight: "demi", size: "small", css: { display: 'flex' } }, { children: "Sizing Tip:" }), void 0), jsx(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: (_b = sizeTipReferences === null || sizeTipReferences === void 0 ? void 0 : sizeTipReferences[selectedValue.label]) !== null && _b !== void 0 ? _b : 'Refer to our' }), void 0), onClickSizeTip && (jsx(SizeFitGuide, { title: "Size and Fit Guide", onClick: onClickSizeTip, hideIcon: true }, void 0))] }, void 0)), jsx(ButtonsContainer, __assign$1({ inline: inline }, { children: sizes.map(function (size) {
19326
+ } }, { children: [jsxs(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small", css: { alignSelf: inline ? 'start' : 'inherit', padding: inline ? '0.75rem 0' : '0' } }, { children: [label, !inline && (jsx(Text$7, __assign$1({ variant: "label", weight: "demi", size: "regular" }, { children: selectedValue === null || selectedValue === void 0 ? void 0 : selectedValue.description }), void 0))] }), void 0), hasSizeGuide && (jsxs(Row, __assign$1({ "data-testid": "sizing-tip" }, { children: [jsx(Icon.Actions.CircleInfo, { width: 1.2 }, void 0), jsx(Text$7, __assign$1({ variant: "body", weight: "demi", size: "small", css: { display: 'flex' } }, { children: "Sizing Tip:" }), void 0), jsx(Text$7, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: activeSizeTip === null || activeSizeTip === void 0 ? void 0 : activeSizeTip.tip }), void 0), onClickSizeTip && (jsx(SizeFitGuide, { hideIcon: true, onClick: onClickSizeTip, title: (_b = activeSizeTip === null || activeSizeTip === void 0 ? void 0 : activeSizeTip.cta) !== null && _b !== void 0 ? _b : 'Size and Fit Guide' }, void 0))] }), void 0)), jsx(ButtonsContainer, __assign$1({ inline: inline }, { children: sizes === null || sizes === void 0 ? void 0 : sizes.map(function (size) {
19326
19327
  var active = !size.disabled && size.label === selectedValue.label;
19327
19328
  return (jsx(SelectorSecondary, { css: {
19328
19329
  padding: '0.75rem 1rem 0.625rem',