@trafilea/afrodita-components 7.24.1 → 7.24.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/es/components/color/ColorRadioGroup.js +1 -1
- package/build/es/components/color/MultiColorPicker.js +1 -1
- package/build/es/components/color/SingleColorPicker.js +1 -1
- package/build/es/components/pricing/discount/DiscountTag.js +1 -1
- package/build/es/components/pricing/price/PriceLabel.js +1 -1
- package/build/es/components/pricing/priceLabelV2/PriceLabelV2.js +1 -1
- package/build/es/components/pricing/priceLabelV6/PriceLabelV6.js +1 -1
- package/build/es/components/pricing/priceLabelV6/PriceLabelV6Components.js +1 -1
- package/build/es/components/pricing/priceLabelV6/PriceLabelV6Tooltip.js +1 -1
- package/build/es/components/pricing/priceLabelV6/utils/priceLabelAria.js +2 -0
- package/build/es/components/pricing/priceLabelV6/utils/priceLabelAria.js.map +1 -0
- package/build/es/components/quantityPicker/QuantityPicker.js +1 -1
- package/build/es/components/rating/Rating.js +1 -1
- package/build/es/components/rating/starList/StarList.js +1 -1
- package/build/es/components/selector/simple/SelectorSecondary.js +1 -1
- package/build/es/components/selector/simple/SimpleSelector.js +1 -1
- package/build/es/components/shared/button/BaseButton.js +1 -1
- package/build/es/components/size/selector/SizeSelector.js +1 -1
- package/build/index.d.ts +15 -2
- package/build/lib/components/color/ColorRadioGroup.js +1 -1
- package/build/lib/components/color/MultiColorPicker.js +1 -1
- package/build/lib/components/color/SingleColorPicker.js +1 -1
- package/build/lib/components/pricing/discount/DiscountTag.js +1 -1
- package/build/lib/components/pricing/price/PriceLabel.js +1 -1
- package/build/lib/components/pricing/priceLabelV2/PriceLabelV2.js +1 -1
- package/build/lib/components/pricing/priceLabelV6/PriceLabelV6.js +1 -1
- package/build/lib/components/pricing/priceLabelV6/PriceLabelV6Components.js +1 -1
- package/build/lib/components/pricing/priceLabelV6/PriceLabelV6Tooltip.js +1 -1
- package/build/lib/components/pricing/priceLabelV6/utils/priceLabelAria.js +2 -0
- package/build/lib/components/pricing/priceLabelV6/utils/priceLabelAria.js.map +1 -0
- package/build/lib/components/quantityPicker/QuantityPicker.js +1 -1
- package/build/lib/components/rating/Rating.js +1 -1
- package/build/lib/components/rating/starList/StarList.js +1 -1
- package/build/lib/components/selector/simple/SelectorSecondary.js +1 -1
- package/build/lib/components/selector/simple/SimpleSelector.js +1 -1
- package/build/lib/components/shared/button/BaseButton.js +1 -1
- package/build/lib/components/size/selector/SizeSelector.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n,__assign as e}from"tslib";import{
|
|
1
|
+
import{__makeTemplateObject as n,__assign as e}from"tslib";import{jsx as r,jsxs as i}from"react/jsx-runtime";import a from"@emotion/styled";import{RadioGroup as l}from"@headlessui/react";import{Text as t}from"../text/Text.js";var o,s,d,m,p,c=a(l)(o||(o=n(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"]))),f=a(l.Label)(s||(s=n(["\n font-size: 0.88rem;\n"],["\n font-size: 0.88rem;\n"]))),u=a(l.Option)(d||(d=n(["\n margin-right: 8px;\n\n svg {\n cursor: pointer;\n }\n"],["\n margin-right: 8px;\n\n svg {\n cursor: pointer;\n }\n"]))),v=a.span(m||(m=n(["\n font-weight: 600;\n"],["\n font-weight: 600;\n"]))),g=a.div(p||(p=n(["\n display: flex;\n margin-top: 0.63rem;\n flex-wrap: wrap;\n"],["\n display: flex;\n margin-top: 0.63rem;\n flex-wrap: wrap;\n"]))),h=Object.assign((function(n){var i=n.value,a=n.onChange,l=n.children,t=n.className;return r(c,e({value:i,onChange:a,className:t},{children:l}),void 0)}),{Label:function(n){var a=n.label,l=n.values;return r(f,{children:i(t,e({variant:"body",weight:"regular",size:"small",asSpan:!0},{children:[a," ",r(v,{children:l},void 0)]}),void 0)},void 0)},Option:function(n){var i=n.value,a=n.children,l=n.disabled,t=n["aria-label"];return r(u,e({value:i,disabled:l,"aria-label":t},{children:a}),void 0)},OptionsContainer:g});export{h as default};
|
|
2
2
|
//# sourceMappingURL=ColorRadioGroup.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as r,useEffect as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as r,useEffect as l}from"react";import n from"./ColorRadioGroup.js";import{ColorSelector as a}from"./selector/ColorSelector.js";import{OutOfStock as i}from"./selector/OutOfStock.js";import{PatternSelector as c}from"./selector/PatternSelector.js";var u=function(o,r){return null==r||0===r.length?t(i,{title:"out of stock color"},void 0):r.map((function(r){return t(n.Option,e({value:r,"aria-label":r.label},{children:r.meta.color?t(a,{color:r.meta.color,selected:o.has(r),testId:"".concat(r.label,"-selector")},void 0):r.meta.pattern?t(c,{url:r.meta.pattern.url,selected:o.has(r)},void 0):null}),r.label)}))},s=function(a){var i=a.options,c=void 0===i?[]:i,s=a.label,m=a.selectedValue,d=a.onChange,f=function(e,o){return o&&e.includes(o)?[o]:o&&e.length>0?[e[0]]:void 0}(c,m),p=r(new Set(f)),v=p[0],h=p[1];l((function(){d(v)}),[d,v]);var b=Array.from(v).map((function(e){return e.label})).join(" | ");return o(n,e({value:v,onChange:function(e){h((function(o){var t=new Set(o);return o.has(e)?t.delete(e):t.add(e),t}))}},{children:[t(n.Label,{label:s,values:b},void 0),t(n.OptionsContainer,{children:u(v,c)},void 0)]}),void 0)};export{s as default};
|
|
2
2
|
//# sourceMappingURL=MultiColorPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as e,jsx as t}from"@emotion/react/jsx-runtime";import
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as e,jsx as t}from"@emotion/react/jsx-runtime";import l from"./ColorRadioGroup.js";import{ColorSelector as r}from"./selector/ColorSelector.js";import{OutOfStock as n}from"./selector/OutOfStock.js";import{PatternSelector as i}from"./selector/PatternSelector.js";var a=function(e,a,s,c){return void 0===a&&(a=!1),0===(null==e?void 0:e.length)?t(n,{title:"out of stock color"},void 0):null==e?void 0:e.map((function(e){var n;return t(l.Option,o({value:e,"aria-label":null!==(n=null==c?void 0:c[e.label])&&void 0!==n?n:e.label},{children:function(o){var l=o.checked;return e.meta.color?t(r,{color:e.meta.color,selected:l,testId:"".concat(e.label.split(" ").join("-").toLowerCase(),"-selector"),noStock:e.noStock,showCross:a,dimension:s},void 0):e.meta.pattern?t(i,{url:e.meta.pattern.url,selected:l,noStock:e.noStock,dimension:s},void 0):null}}),e.label)}))},s=function(r){var n,i=r.options,s=r.selectedValue,c=r.label,d=r.onChange,m=r.inline,u=void 0!==m&&m,v=r.showCross,p=void 0!==v&&v,f=r.dimension,b=r.translatedLabels,h=s?null!==(n=null==b?void 0:b[s.label])&&void 0!==n?n:s.label:void 0;return e(l,o({value:s,onChange:d,css:{flexDirection:u?"row":"column",alignItems:u?"center":"start"}},{children:[t(l.Label,{label:c,values:h&&!u?h:void 0},void 0),t(l.OptionsContainer,o({css:{marginTop:u?"0":"0.5rem",marginLeft:u?"1.5rem":"0"},"data-testid":"radio-group-options-container"},{children:a(i,p,f,b)}),void 0)]}),void 0)};export{s as default,a as renderOptions};
|
|
2
2
|
//# sourceMappingURL=SingleColorPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsxs as r,jsx as i,Fragment as
|
|
1
|
+
import{__assign as o}from"tslib";import{jsxs as r,jsx as i,Fragment as t}from"react/jsx-runtime";import{useTheme as n}from"../../../core/theme/Theme.js";import{ComponentSize as e}from"../../../types/enums.js";import{Container as s,IconContainer as c,H3 as a}from"./styled.js";var d=function(o){var r=o.discount,n=o.offText,e=o.savings,s=o.showSavings,c=void 0!==s&&s,a=o.showOnlySavings;if(void 0!==a&&a&&e)return i(t,{children:e},void 0);var d="".concat(r,"% ").concat(n),l=c&&e?" - ".concat(e):"";return i(t,{children:"".concat(d).concat(l).trim()},void 0)},l=function(t){var l=t.discount,v=t.offText,f=t.savings,m=t.showSavings,h=void 0!==m&&m,u=t.showOnlySavings,g=void 0!==u&&u,b=t.disabled,p=t.backgroundColor,w=void 0===p?"#fff":p,y=t.borderColor,x=void 0===y?"transparent":y,S=t.textColor,C=void 0===S?"#fff":S,j=t.size,T=void 0===j?e.Medium:j,z=t.style,O=t.bordersRounded,k=void 0!==O&&O,R=t.icon,L=t.ariaLabel,M=n(),q="".concat(l,"% ").concat(v).trim(),A=h&&f?", ".concat(f):"",B=null!=L?L:g&&f?f:"".concat(q).concat(A).trim();return r(s,o({backgroundColor:b?M.colors.shades[50].color:w,borderColor:b?M.colors.shades[50].color:x,size:T,"data-testid":"discount-container",style:z,bordersRounded:k,"aria-label":B},{children:[R&&i(c,{children:R},void 0),i(a,o({textColor:b?M.colors.shades[250].color:C,size:T,style:o(o({},z),{whiteSpace:"nowrap"}),theme:M},{children:i(d,{discount:l,offText:v,savings:f,showSavings:h,showOnlySavings:g},void 0)}),void 0)]}),void 0)};export{l as DiscountTag,d as SavingsText};
|
|
2
2
|
//# sourceMappingURL=DiscountTag.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as i,__assign as e}from"tslib";import{jsxs as l,jsx as r}from"react/jsx-runtime";import{useTheme as
|
|
1
|
+
import{__rest as i,__assign as e}from"tslib";import{jsxs as l,jsx as r}from"react/jsx-runtime";import{useTheme as n}from"../../../core/theme/Theme.js";import{useWindowDimensions as o}from"../../../hooks/WindowDimensions.js";import{ComponentSize as a}from"../../../types/enums.js";import{DiscountTag as c}from"../discount/DiscountTag.js";import{Container as t,TagContainer as d,PriceContainer as p,Price as m}from"../styles.js";var v=function(i,e){var l,r,n,o,c,t,d,p;switch(i){case a.Large:return{finalPricefontSize:(null===(l=null==e?void 0:e.component.pricing.priceLabel.price.largeFontSize)||void 0===l?void 0:l.large)||"20px",finalPricefontSizeSmall:(null===(r=null==e?void 0:e.component.pricing.priceLabel.price.smallFontSize)||void 0===r?void 0:r.large)||"14px",margin:"0 0 0 0.75rem",lineHeight:"2rem"};case a.Medium:return{fontSize:(null===(n=null==e?void 0:e.component.pricing.priceLabel.price.defaultFontSize)||void 0===n?void 0:n.medium)||"1.125rem",finalPricefontSize:(null===(o=null==e?void 0:e.component.pricing.priceLabel.price.largeFontSize)||void 0===o?void 0:o.medium)||"20px",finalPricefontSizeSmall:(null===(c=null==e?void 0:e.component.pricing.priceLabel.price.smallFontSize)||void 0===c?void 0:c.medium)||"14px",margin:"0 0 0 0.5rem",lineHeight:"1.25rem"};case a.Small:return{fontSize:(null===(t=null==e?void 0:e.component.pricing.priceLabel.price.defaultFontSize)||void 0===t?void 0:t.small)||"14px",finalPricefontSize:(null===(d=null==e?void 0:e.component.pricing.priceLabel.price.largeFontSize)||void 0===d?void 0:d.small)||"20px",finalPricefontSizeSmall:(null===(p=null==e?void 0:e.component.pricing.priceLabel.price.smallFontSize)||void 0===p?void 0:p.small)||"14px",margin:"0 0 0 0.5rem",lineHeight:"1.25rem"}}},s=function(i,e,l,r){var n,o,a;return l?null===(n=v(i,e))||void 0===n?void 0:n.finalPricefontSize:r?null===(o=v(i,e))||void 0===o?void 0:o.finalPricefontSizeSmall:null===(a=v(i,e))||void 0===a?void 0:a.fontSize};function u(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];return i.filter(Boolean).join("-")}var f=function(v){var s=v.finalPrice,f=v.originalPrice,g=v.discount,S=v.color,P=v.originalPriceColor,z=v.testId,b=v.finalPriceStyled,h=void 0!==b&&b,L=v.finalPriceStyle,y=v.originalPriceStyled,x=void 0!==y&&y,F=v.originalPriceUnderlined,j=void 0===F||F,w=v.finalPriceAriaLabel,A=v.originalPriceAriaLabel,D=v.discountAriaLabel,T=v.size,C=void 0===T?a.Medium:T,H=v.clubStyle,M=void 0!==H&&H,E=v.invertDirection,I=void 0!==E&&E,U=v.isPrincingStyleTestEnabled,k=void 0!==U&&U,B=i(v,["finalPrice","originalPrice","discount","color","originalPriceColor","testId","finalPriceStyled","finalPriceStyle","originalPriceStyled","originalPriceUnderlined","finalPriceAriaLabel","originalPriceAriaLabel","discountAriaLabel","size","clubStyle","invertDirection","isPrincingStyleTestEnabled"]),O=n(),W=o().isMobile,X="".concat(s),q=null==f?"":"".concat(f),G=null!=w?w:f?"Sale price ".concat(X):"Price ".concat(X),J=null!=A?A:"Original price ".concat(q),K={size:h?a.Small:C,color:S||O.colors.pallete.secondary.color,weight:700},N=function(){var i=W?a.Small:a.XSmall,l=x?C:a.Small;return r(m,e({size:M?i:l,color:P||O.component.pricing.priceLabel.price.originalPriceColor,underlined:j,"data-testid":u(z,"original-product-price"),"data-nosnippet":!0,"aria-label":J,theme:O},{children:f}),void 0)};return l(t,e({},B,{id:"priceLabel"},{children:[l(p,k?e({flexDirection:"column",gap:"0.25rem"},{children:[!!f&&r(N,{},void 0),r(m,e({"data-testid":u(z,"final-product-price")},K,{style:L,size:C,weight:400,"aria-label":G},{children:s}),void 0)]}):e({flexDirection:I?"row-reverse":"row"},M?{children:[!!f&&r(N,{},void 0),r(m,e({"data-testid":u(z,"final-product-price")},K,{style:L,size:C,"aria-label":G},{children:s}),void 0)]}:{children:[r(m,e({"data-testid":u(z,"final-product-price")},K,{style:L,size:C,"aria-label":G},{children:s}),void 0),!!f&&r(N,{},void 0)]}),void 0),g&&r(d,e({size:C},{children:r(c,e({},g,{size:C,ariaLabel:D}),void 0)}),void 0)]}),void 0)};export{f as PriceLabel,s as getFontSize,v as getStylesBySize,u as getTestId};
|
|
2
2
|
//# sourceMappingURL=PriceLabel.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as i,__assign as o}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useTheme as
|
|
1
|
+
import{__rest as i,__assign as o}from"tslib";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useTheme as l}from"../../../core/theme/Theme.js";import"react";import{useWindowDimensions as a}from"../../../hooks/WindowDimensions.js";import{getCurrencySymbol as t}from"../../../utils/getCurrencySymbol/getCurrencySimbol.js";import{ComponentSize as n}from"../../../types/enums.js";import{ClubOfferTag as s}from"../clubOffer/ClubOfferTag.js";import{DiscountTag as c}from"../discount/DiscountTag.js";import{getTestId as d}from"../price/PriceLabel.js";import{getPriceLabelAriaTexts as p}from"../priceLabelV6/utils/priceLabelAria.js";import{VerticalContainer as u,PriceDiscountRow as m,HorizontalVariantContainer as f,HorizontalVariantRow as v,Container as b,FinalPriceStyledContainer as y,Price as P,TagContainer as h}from"../styles.js";import{PriceLabelTooltip as g}from"./PriceLabelTooltip.js";var S=function(i){var l,a=i.testId,t=i.priceCommonProps,s=i.size,c=i.currencySymbol,p=i.finalPriceArray,u=i.productFinalPrice,m=i.showDecimals,f=i.pricePerItem,v=i.theme,b=i.isHorizontalLayout,h=void 0!==b&&b,g=i.isVerticalLayout,S=void 0!==g&&g,L=i.ariaLabel,z=h?o(o({},t),{size:n.Small,style:{fontSize:"14px"}}):t,x=S?o(o({},t),{size:n.Small,style:{fontSize:"16px"}}):t,D=h?z:S?x:t;return e(y,o({"data-testid":d(a,"final-product-price"),"aria-label":L},{children:[r(P,o({margin:!0,finalPriceStyledSmall:!h&&!S},D,{size:h||S?n.Small:s,"aria-hidden":"true"},{children:c}),void 0),r(P,o({finalPriceStyled:!h&&!S},D,{size:h||S?n.Small:s,"aria-hidden":"true"},{children:p[0]?p[0]:null===(l="".concat(u))||void 0===l?void 0:l.split(c)[1]}),void 0),m&&e(P,o({finalPriceStyledSmall:!h&&!S,style:h?{fontSize:"14px"}:S?{fontSize:"16px"}:{marginTop:"-6px"}},D,{size:h||S?n.Small:s,"aria-hidden":"true"},{children:[(h||S)&&".",p[1]?p[1]:"00"]}),void 0),f&&r(P,o({size:n.Small,color:v.colors.pallete.secondary.color,"aria-hidden":"true"},{children:"/each"}),void 0)]}),void 0)},L=function(i){var e=i.isDiscount,l=i.discount,a=i.bordersRounded,t=i.savingsDisplay,s=i.currencySymbol,d=i.savetoString,p=i.isHorizontalLayout,u=void 0!==p&&p,m=i.ariaLabel;return e?r(h,o({size:n.Small},{children:l&&r(c,o({},l,{size:n.Medium,style:o({letterSpacing:"-0.05rem"},u&&{fontSize:"12px"}),bordersRounded:a,savings:t?"Save ".concat(s).concat(d):void 0,ariaLabel:m}),void 0)}),void 0):null},z=function(i){var e=i.isClubOffer,l=i.clubOffer;return e?r(h,o({size:n.Medium},{children:l&&r(s,o({},l,{size:n.Small,style:{borderRadius:"8px",width:"107px",height:"28px",alignItems:"center",padding:"3px 8px 3px 8px",fontSize:"14px",lineHeight:"22px"}}),void 0)}),void 0):null},x=function(s){var c=s.finalPrice,y=s.originalPrice,h=s.discount,x=s.clubOffer,D=s.color,I=s.testId,O=s.originalPriceStyled,A=void 0!==O&&O,C=s.originalPriceUnderlined,j=void 0===C||C,H=s.size,w=void 0===H?n.Small:H,R=s.bordersRounded,T=void 0!==R&&R,V=s.savingsDisplay,M=void 0===V||V,F=s.pricePerItem,N=s.hasRoundedSavings,U=void 0===N||N,k=s.showDecimals,W=void 0===k||k,$=s.tooltipText,q=s.tooltipIcon,B=s.tooltipPosition,E=s.hasVerticalLayout,G=void 0!==E&&E,J=s.hasHorizontalLayout,K=void 0!==J&&J,Q=s.isMobile,X=void 0!==Q&&Q,Y=s.finalPriceAriaLabel,Z=s.originalPriceAriaLabel,_=s.discountAriaLabel,ii=i(s,["finalPrice","originalPrice","discount","clubOffer","color","testId","originalPriceStyled","originalPriceUnderlined","size","bordersRounded","savingsDisplay","pricePerItem","hasRoundedSavings","showDecimals","tooltipText","tooltipIcon","tooltipPosition","hasVerticalLayout","hasHorizontalLayout","isMobile","finalPriceAriaLabel","originalPriceAriaLabel","discountAriaLabel"]),oi=l(),ei=a().isMobile,ri=F||c,li=y!==ri,ai=y&&li,ti=!(!h||!li),ni=!(!x||!li),si="$";"string"==typeof ri&&(si=t(ri));var ci,di,pi="string"==typeof ri&&ri.includes(".")&&ri.includes(si)?ri.split(si)[1].split("."):["",""],ui={size:n.Small,color:ni?"var(--colors-pallete-wine-color)":D||oi.colors.pallete.secondary.color,weight:700};"string"==typeof y&&"string"==typeof ri?(ci=Number(y.replace(si,"")),di=Number(ri.replace(si,""))):(ci="number"==typeof y?y:0,di="number"==typeof ri?ri:0);var mi=ci-di;if(U){var fi=Number((mi-Math.floor(mi)).toFixed(2));fi>=.01&&fi<.5?mi=Math.floor(mi)+0:fi>=.51&&fi<1&&(mi=Math.floor(mi)+.5)}var vi=mi.toFixed(2),bi=p({productFinalPrice:ri,originalPrice:y,currencySymbol:si,isOriginalPrice:!!ai,finalPriceAriaLabel:Y,originalPriceAriaLabel:Z}),yi=bi.computedFinalPriceLabel,Pi=bi.computedOriginalPriceLabel,hi=function(){return r(P,o({size:A?w:n.Small,color:oi.component.pricing.priceLabel.price.originalPriceColor||oi.colors.shades[300].color,margin:!G,underlined:j,"data-testid":d(I,"original-product-price"),"data-nosnippet":!0,style:K?{fontSize:"12px"}:void 0,"aria-label":Pi},{children:y}),void 0)};return G?e(u,o({},ii,{id:"priceLabelV2"},{children:[$&&r(g,{tooltipText:$,tooltipIcon:q,tooltipPosition:B,isMobile:null!=X?X:ei},void 0),ai&&r(hi,{},void 0),e(m,{children:[r(L,{isDiscount:ti,discount:h,bordersRounded:T,savingsDisplay:M,currencySymbol:si,savetoString:vi,isHorizontalLayout:K,ariaLabel:_},void 0),r(z,{isClubOffer:ni,clubOffer:x},void 0),r(S,{testId:I,priceCommonProps:ui,size:w,currencySymbol:si,finalPriceArray:pi,productFinalPrice:ri,showDecimals:W,pricePerItem:F,theme:oi,isHorizontalLayout:K,isVerticalLayout:G,ariaLabel:yi},void 0)]},void 0)]}),void 0):K?r(f,o({},ii,{id:"priceLabelV2"},{children:e(v,{children:[$&&r(g,{tooltipText:$,tooltipIcon:q,tooltipPosition:B},void 0),r(S,{testId:I,priceCommonProps:ui,size:w,currencySymbol:si,finalPriceArray:pi,productFinalPrice:ri,showDecimals:W,pricePerItem:F,theme:oi,isHorizontalLayout:K,isVerticalLayout:G,ariaLabel:yi},void 0),ai&&r(hi,{},void 0),r(L,{isDiscount:ti,discount:h,bordersRounded:T,savingsDisplay:M,currencySymbol:si,savetoString:vi,isHorizontalLayout:K,ariaLabel:_},void 0),r(z,{isClubOffer:ni,clubOffer:x},void 0)]},void 0)}),void 0):e(b,o({},ii,{id:"priceLabelV2"},{children:[$&&r(g,{tooltipText:$,tooltipIcon:q,tooltipPosition:B},void 0),ai&&r(hi,{},void 0),r(S,{testId:I,priceCommonProps:ui,size:w,currencySymbol:si,finalPriceArray:pi,productFinalPrice:ri,showDecimals:W,pricePerItem:F,theme:oi,isHorizontalLayout:K,isVerticalLayout:G,ariaLabel:yi},void 0),r(L,{isDiscount:ti,discount:h,bordersRounded:T,savingsDisplay:M,currencySymbol:si,savetoString:vi,isHorizontalLayout:K,ariaLabel:_},void 0),r(z,{isClubOffer:ni,clubOffer:x},void 0)]}),void 0)};export{x as PriceLabelV2};
|
|
2
2
|
//# sourceMappingURL=PriceLabelV2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as i,__assign as o}from"tslib";import{jsx as
|
|
1
|
+
import{__rest as i,__assign as o}from"tslib";import{jsx as r,jsxs as e}from"react/jsx-runtime";import{useTheme as l}from"../../../core/theme/Theme.js";import"react";import{useWindowDimensions as t}from"../../../hooks/WindowDimensions.js";import{ComponentSize as a}from"../../../types/enums.js";import{HorizontalVariantContainer as n,HorizontalVariantRow as s,Container as c}from"../styles.js";import{PriceSection as d,OriginalPriceSection as m,TooltipSection as p,TagsSection as u}from"./PriceLabelV6Components.js";import{extractCurrencySymbol as b,splitPriceIntoParts as P,calculateSavings as v}from"./utils/priceParsing.js";import{getPriceLabelAriaTexts as y}from"./utils/priceLabelAria.js";import{applyRoundedSavings as f,formatSavingsToString as g}from"./utils/savingsRounding.js";var L=function(L){var h=L.finalPrice,z=L.originalPrice,S=L.discount,I=L.clubOffer,A=L.color,D=L.testId,j=L.originalPriceStyled,w=void 0!==j&&j,H=L.originalPriceUnderlined,O=void 0===H||H,R=L.size,x=void 0===R?a.Small:R,C=L.bordersRounded,M=void 0!==C&&C,T=L.savingsDisplay,F=void 0===T||T,U=L.pricePerItem,V=L.hasRoundedSavings,k=void 0===V||V,W=L.showDecimals,q=void 0===W||W,B=L.tooltipText,E=L.tooltipIcon,G=L.tooltipPosition,J=L.hasHorizontalLayout,K=void 0!==J&&J,N=L.isMobile,Q=void 0!==N&&N,X=L.finalPriceAriaLabel,Y=L.originalPriceAriaLabel,Z=L.discountAriaLabel,$=i(L,["finalPrice","originalPrice","discount","clubOffer","color","testId","originalPriceStyled","originalPriceUnderlined","size","bordersRounded","savingsDisplay","pricePerItem","hasRoundedSavings","showDecimals","tooltipText","tooltipIcon","tooltipPosition","hasHorizontalLayout","isMobile","finalPriceAriaLabel","originalPriceAriaLabel","discountAriaLabel"]),_=l(),ii=t().isMobile,oi=U||h,ri=z!==oi,ei=z&&ri,li=!(!S||!ri),ti=!(!I||!ri),ai=b(oi),ni=P("string"==typeof oi?oi:"",ai),si={size:a.Small,color:ti?"var(--colors-pallete-wine-color)":A||_.colors.pallete.secondary.color,weight:700},ci=v(z||0,oi,ai),di=f(ci,k),mi=g(di),pi=y({productFinalPrice:oi,originalPrice:z,currencySymbol:ai,isOriginalPrice:!!ei,finalPriceAriaLabel:X,originalPriceAriaLabel:Y}),ui=pi.computedFinalPriceLabel,bi=pi.computedOriginalPriceLabel;return K?r(n,o({},$,{id:"priceLabelV6"},{children:e(s,o({"data-testid":"horizontal-variant-row"},{children:[r(d,{testId:D,priceCommonProps:si,size:x,currencySymbol:ai,finalPriceArray:ni,productFinalPrice:oi,showDecimals:q,pricePerItem:U,theme:_,isHorizontalLayout:K,ariaLabel:ui},void 0),ei&&r(m,{originalPrice:z,originalPriceStyled:w,originalPriceUnderlined:O,size:x,testId:D,theme:_,hasHorizontalLayout:K,ariaLabel:bi},void 0),r(p,{tooltipText:B,tooltipIcon:E,tooltipPosition:G,isMobile:null!=Q?Q:ii},void 0),r(u,{isDiscount:li,discount:S,bordersRounded:M,savingsDisplay:F,currencySymbol:ai,savetoString:mi,isHorizontalLayout:K,isClubOffer:ti,clubOffer:I,discountAriaLabel:Z},void 0)]}),void 0)}),void 0):e(c,o({},$,{id:"priceLabelV6"},{children:[ei&&r(m,{originalPrice:z,originalPriceStyled:w,originalPriceUnderlined:O,size:x,testId:D,theme:_,hasHorizontalLayout:K,ariaLabel:bi},void 0),r(p,{tooltipText:B,tooltipIcon:E,tooltipPosition:G,isMobile:null!=Q?Q:ii},void 0),r(d,{testId:D,priceCommonProps:si,size:x,currencySymbol:ai,finalPriceArray:ni,productFinalPrice:oi,showDecimals:q,pricePerItem:U,theme:_,isHorizontalLayout:K,ariaLabel:ui},void 0),r(u,{isDiscount:li,discount:S,bordersRounded:M,savingsDisplay:F,currencySymbol:ai,savetoString:mi,isHorizontalLayout:K,isClubOffer:ti,clubOffer:I,discountAriaLabel:Z},void 0)]}),void 0)};export{L as PriceLabelV6};
|
|
2
2
|
//# sourceMappingURL=PriceLabelV6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsx as e,jsxs as
|
|
1
|
+
import{__assign as i}from"tslib";import{jsx as e,jsxs as r,Fragment as o}from"react/jsx-runtime";import{ComponentSize as t}from"../../../types/enums.js";import{ClubOfferTag as l}from"../clubOffer/ClubOfferTag.js";import{DiscountTag as a}from"../discount/DiscountTag.js";import{getTestId as n}from"../price/PriceLabel.js";import{Price as d,FinalPriceStyledContainer as s,TagContainer as c}from"../styles.js";import{TooltipWrapper as p}from"./PriceLabelV6.styled.js";import{PriceLabelV6Tooltip as m}from"./PriceLabelV6Tooltip.js";import{createStopPropagationHandlers as u}from"./utils/eventHandlers.js";var f=function(r){var o=r.originalPrice,l=r.originalPriceStyled,a=r.originalPriceUnderlined,s=r.size,c=r.testId,p=r.theme,m=r.hasHorizontalLayout,u=r.ariaLabel;return e(d,i({size:l?s:t.Small,color:p.component.pricing.priceLabel.price.originalPriceColor||p.colors.shades[300].color,margin:!0,underlined:a,"data-testid":n(c,"original-product-price"),"data-nosnippet":!0,style:m?{fontSize:"12px"}:void 0,"aria-label":u},{children:o}),void 0)},v=function(o){var l=o.testId,a=o.priceCommonProps,c=o.size,p=o.currencySymbol,m=o.finalPriceArray,u=o.productFinalPrice,f=o.showDecimals,v=o.pricePerItem,h=o.theme,S=o.isHorizontalLayout,b=void 0!==S&&S,y=o.ariaLabel,g=b?i(i({},a),{size:t.Small,style:{fontSize:"14px"}}):a;return r(s,i({"data-testid":n(l,"final-product-price"),"aria-label":y},{children:[e(d,i({margin:!0,finalPriceStyledSmall:!b},g,{size:b?t.Small:c,"aria-hidden":"true"},{children:p}),void 0),e(d,i({finalPriceStyled:!b},g,{size:b?t.Small:c,"aria-hidden":"true"},{children:m[0]||("string"==typeof u&&u.includes(p)?"".concat(u).split(p)[1]:"".concat(u))}),void 0),f&&r(d,i({finalPriceStyledSmall:!b,style:b?{fontSize:"14px"}:{marginTop:"-6px"}},g,{size:b?t.Small:c,"aria-hidden":"true"},{children:[b&&".",m[1]?m[1]:"00"]}),void 0),v&&e(d,i({size:t.Small,color:h.colors.pallete.secondary.color,"aria-hidden":"true"},{children:"/each"}),void 0)]}),void 0)},h=function(n){var d=n.isDiscount,s=n.discount,p=n.bordersRounded,m=n.savingsDisplay,u=n.currencySymbol,f=n.savetoString,v=n.isHorizontalLayout,h=void 0!==v&&v,S=n.isClubOffer,b=n.clubOffer,y=n.discountAriaLabel;return r(o,{children:[d&&e(c,i({size:t.Small},{children:s&&e(a,i({},s,{size:t.Medium,style:i({letterSpacing:"-0.05rem"},h&&{fontSize:"12px"}),bordersRounded:p,savings:m?"Save ".concat(u).concat(f):void 0,ariaLabel:y}),void 0)}),void 0),S&&e(c,i({size:t.Medium},{children:b&&e(l,i({},b,{size:t.Small,style:{borderRadius:"8px",width:"107px",height:"28px",alignItems:"center",padding:"3px 8px 3px 8px",fontSize:"14px",lineHeight:"22px"}}),void 0)}),void 0)]},void 0)},S=function(r){var o=r.tooltipText,t=r.tooltipIcon,l=r.tooltipPosition,a=r.isMobile;if(!o)return null;var n=u();return e(p,i({"data-testid":"PriceLabelV6-TooltipWrapper"},n,{children:e(m,{tooltipText:o,tooltipIcon:t,tooltipPosition:l,isMobile:a},void 0)}),void 0)};export{f as OriginalPriceSection,v as PriceSection,h as TagsSection,S as TooltipSection};
|
|
2
2
|
//# sourceMappingURL=PriceLabelV6Components.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import"../../../core/theme/Theme.js";import"react";import{ComponentPosition as i}from"../../../types/enums.js";import"../clubOffer/ClubOfferTag.js";import"../discount/styled.js";import{TooltipContainer as e}from"../styles.js";import{
|
|
1
|
+
import{__assign as o}from"tslib";import{jsx as t}from"react/jsx-runtime";import"../../../core/theme/Theme.js";import"react";import{ComponentPosition as i}from"../../../types/enums.js";import"../clubOffer/ClubOfferTag.js";import"../discount/styled.js";import{TooltipContainer as e}from"../styles.js";import{createStopPropagationHandlers as r}from"./utils/eventHandlers.js";import{Tooltip as l}from"../../tooltip/Tooltip.js";import"../../atoms/PriceLabel/PriceLabel.js";import"../../atoms/ClubPriceMemberLabel/ClubPriceMemberLabel.styled.js";import"../../atoms/HorizontalDivider/HorizontalDivider.js";import{Icon as s}from"../../atoms/Icon/Icon.js";import"../../atoms/Image/styled.js";import"../../atoms/PriceLabelV2/PriceLabelV2.js";import"../../atoms/Toggle/toggle.styled.js";var m=function(m){var n=m.tooltipText,a=m.tooltipIcon,p=m.tooltipPosition,c=m.isMobile,d=m.borderColor,b=void 0===d?"#EAEAEA":d,j=r();return t(e,o({"data-testid":"tooltip-container"},j,{children:t("div",o({},j,{children:t(l,o({showCloseIcon:!0,withArrow:!0,content:{text:n},position:null!=p?p:i.BottomRight,closeBtnSize:.7,borderColor:b,"data-testid":"tooltip"},{children:t(s,{name:null!=a?a:"actions/circle_info",fill:"#8C8383",width:.8,height:.8,testId:"tooltip-icon",showTooltipTitle:c},void 0)}),void 0)}),void 0)}),void 0)};export{m as PriceLabelV6Tooltip};
|
|
2
2
|
//# sourceMappingURL=PriceLabelV6Tooltip.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var c=function(c){var i=c.productFinalPrice,r=c.originalPrice,a=c.currencySymbol,e=c.isOriginalPrice,n=c.finalPriceAriaLabel,l=c.originalPriceAriaLabel,o="number"==typeof i?"".concat(a).concat(i):"".concat(i),t="number"==typeof r?"".concat(a).concat(r):"".concat(r),u=null==r?"":t;return{finalPriceText:o,originalPriceText:u,computedFinalPriceLabel:null!=n?n:e?"Sale price ".concat(o):"Price ".concat(o),computedOriginalPriceLabel:null!=l?l:"Original price ".concat(u)}};export{c as getPriceLabelAriaTexts};
|
|
2
|
+
//# sourceMappingURL=priceLabelAria.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priceLabelAria.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__assign as r}from"tslib";import{jsxs as e,jsx as n}from"react/jsx-runtime";import{useState as o,useEffect as t,useCallback as i}from"react";import{useTheme as a}from"../../core/theme/Theme.js";import{Container as c,IncreaseDecrease as u,NumberContainer as l}from"./styled.js";var d=function(d){var s=d.initialValue,b=void 0===s?0:s,f=d.maxValue,m=void 0===f?99:f,v=d.value,y=d.testId,h=void 0===y?"quantity-picker":y,p=d.onChange,k=d.isOutlined,q=void 0!==k&&k,x=d.increaseIcon,C=d.decreaseIcon,I=d.increaseAriaLabel,R=d.decreaseAriaLabel,D=d.quantityAriaLabel,O=a(),j=o(null!=v?v:b),A=j[0],L=j[1],M="".concat(h,"-value"),P=(null!=v?v:A)>=m,w=function(r,e){"Enter"!==r.key&&" "!==r.key||(r.preventDefault(),e())};t((function(){p&&p(A)}),[p,A]);var K=i((function(r){return Math.max(Math.min(r,m),b)}),[m,b]);return t((function(){L((function(r){return null==v?r:K(v)}))}),[v,K]),e(c,r({borderColor:O.colors.shades[200].color,color:O.colors.shades[700].color,"data-testid":h,borderRadius:O.component.qtyPicker.borderRadius,isOutlined:q},{children:[n(u,r({"data-testid":"".concat(h,"-minus"),onClick:function(){return L((function(r){return K(r-1)}))},isOutlined:q,borderColor:O.colors.shades[200].color,borderRadius:O.component.qtyPicker.borderRadius,role:"button",tabIndex:0,onKeyDown:function(r){return w(r,(function(){return L((function(r){return K(r-1)}))}))},"aria-label":null!=R?R:"Decrease quantity","aria-controls":M,"aria-describedby":M},{children:q?C:"-"}),void 0),n(l,r({id:M,"aria-live":"polite","aria-atomic":"true","aria-label":null!=D?D:"Current quantity"},{children:A}),void 0),n(u,r({isMaxSelected:P,"data-testid":"".concat(h,"-plus"),onClick:function(){return L((function(r){return K(r+1)}))},isOutlined:q,borderColor:O.colors.shades[200].color,borderRadius:O.component.qtyPicker.borderRadius,isIncrease:!0,role:"button",tabIndex:P?-1:0,onKeyDown:function(r){return w(r,(function(){return L((function(r){return K(r+1)}))}))},"aria-label":null!=I?I:"Increase quantity","aria-controls":M,"aria-describedby":M,"aria-disabled":P},{children:q?x:"+"}),void 0)]}),void 0)};export{d as QuantityPicker};
|
|
2
2
|
//# sourceMappingURL=QuantityPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as t,jsx as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useTheme as r}from"../../core/theme/Theme.js";import{ComponentSize as i}from"../../types/enums.js";import{STARTS_NUMBER as a}from"./constants.js";import{StarList as n}from"./starList/StarList.js";import{Container as s,RatingLabel as l,CustomLabel as c}from"./styles.js";var d=function(d){var m=d.size,v=void 0===m?i.Medium:m,u=d.reviews,f=d.reviewsText,h=d.rating,p=d.showRatingText,w=void 0!==p&&p,b=d.wrapWithParenthesis,j=void 0!==b&&b,C=d.underline,g=void 0!==C&&C,x=d.reviewsContainerId,L=d.additionalContent;var y,z=r(),T=null!=u;if(T){var I=1===u?"review":"reviews";y="".concat(u," ").concat(I)}var P=y||f,R=P?", ".concat(P):"",S="".concat(h," out of ").concat(a," stars").concat(R),W=[T?"".concat(u):"",null!=f?f:""].filter(Boolean).join(" ");return t(s,e({as:x?"a":"div"},x?{href:x}:{},{"data-testid":"Container",onClick:function(e){var t;e.cancelable&&e.preventDefault(),x&&(null===(t=document.querySelector(x))||void 0===t||t.scrollIntoView({behavior:"smooth"}))},"aria-label":S},{children:[w&&o(l,e({color:z.colors.shades[700].color,"data-testid":"RatingLabel"},{children:h}),void 0),o(n,{rating:h,size:v,starsNumber:a,fill:z.component.stars.element.color},void 0),(u||f)&&o(c,e({theme:z,size:v,wrapWithParenthesis:j,underline:g,"data-testid":"CustomLabel"},{children:W}),void 0),L]}),void 0)};export{d as Rating};
|
|
2
2
|
//# sourceMappingURL=Rating.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as t,
|
|
1
|
+
import{__makeTemplateObject as t,__assign as r}from"tslib";import{jsx as i}from"react/jsx-runtime";import e from"@emotion/styled";import{useTheme as n}from"../../../core/theme/Theme.js";import{ComponentSize as o}from"../../../types/enums.js";import{Icon as m}from"../../icons/index.js";import{Container as a}from"./styles.js";var s,l=e.div(s||(s=t(["\n display: flex;\n margin-right: ",";\n"],["\n display: flex;\n margin-right: ",";\n"])),(function(t){return t.marginRight})),d=function(t){var e=t.rating,s=t.starsNumber,d=t.fill,h=t.size,f=void 0===h?o.Medium:h,p=n(),c={fill:d,width:p.component.stars.element[f].width,height:p.component.stars.element[f].height};return i(a,r({"aria-hidden":"true",role:"presentation"},{children:Array.from({length:s},(function(t,n){return i(l,r({"data-testid":"star-container",marginRight:p.component.stars.element[f].marginRight},{children:n<Math.floor(e)?i(m.PDP.Star,r({},c),void 0):n===Math.floor(e)&&e%1!=0?i(m.PDP.StarHalf,r({},c),void 0):i(m.PDP.StarEmpty,r({},c),void 0)}),"star-container-".concat(n))}))}),void 0)};export{d as StarList};
|
|
2
2
|
//# sourceMappingURL=StarList.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as
|
|
1
|
+
import{__rest as o,__assign as e}from"tslib";import{jsx as t}from"@emotion/react/jsx-runtime";import{useTheme as r}from"../../../core/theme/Theme.js";import c from"./SimpleSelector.js";var n=function(n){var l=n.text,d=n.size,s=n.disabled,a=n.active,i=n.className,m=n.testId,b=n.width,p=n.onClick,h=n.showNoStockStyles,k=n.id,u=o(n,["text","size","disabled","active","className","testId","width","onClick","showNoStockStyles","id"]),f=r(),g=a?{background:f.component.selector.hover.background,color:f.component.selector.hover.color,border:f.component.selector.hover.border,fontWeight:f.component.selector.hover.fontWeight}:{background:"".concat(f.component.selector.default.background," !important"),color:"".concat(f.component.selector.default.color," !important"),border:"".concat(f.component.selector.default.border," !important"),fontWeight:f.component.selector.default.fontWeight};return h&&(g={background:f.component.selector.noStock.background,color:f.component.selector.noStock.color,border:f.component.selector.noStock.border,fontWeight:f.component.selector.noStock.fontWeight}),t(c,e({text:l,size:d,onClick:p,className:i,disabled:s,testId:m,width:b},u,{css:e(e({},g),{whiteSpace:"nowrap","&:hover":{background:h?"":f.component.selector.hover.background,color:h?"":f.component.selector.hover.color},"&:disabled":{border:f.component.selector.disabled.border,background:f.colors.background.disabled,color:f.colors.text.disabled}}),id:k}),void 0)};export{n as default};
|
|
2
2
|
//# sourceMappingURL=SelectorSecondary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsx as o}from"@emotion/react/jsx-runtime";import{useTheme as t}from"../../../core/theme/Theme.js";import{ComponentSize as i}from"../../../types/enums.js";import r from"../../shared/button/BaseButton.js";var
|
|
1
|
+
import{__assign as e}from"tslib";import{jsx as o}from"@emotion/react/jsx-runtime";import{useTheme as t}from"../../../core/theme/Theme.js";import{ComponentSize as i}from"../../../types/enums.js";import r from"../../shared/button/BaseButton.js";var a=function(a){var d=a.text,s=a.className,n=a.disabled,l=void 0!==n&&n,c=a.size,m=void 0===c?i.Medium:c,b=a.active,u=void 0!==b&&b,p=a.testId,h=void 0===p?"base-button":p,f=a.width,v=void 0===f?"":f,g=a.onClick,z=a.id,x=a.role,y=a.tabIndex,W=a["aria-label"],j=a["aria-checked"],k=a["aria-controls"],w=a["aria-describedby"],I=a["aria-labelledby"],R=t(),S=function(e,o){switch(e){case i.Medium:return{padding:o.component.selector.size.medium.padding,borderRadius:o.component.selector.size.medium.borderRadius};case i.Small:return{padding:o.component.selector.size.small.padding,borderRadius:o.component.selector.size.small.borderRadius}}}(m,R),B=u?{fontWeight:R.component.selector.hover.fontWeight}:{fontWeight:R.component.selector.default.fontWeight};return o(r,e({onClick:g,disabled:l,className:s,type:"button",testId:h,role:x,tabIndex:y,"aria-label":W,"aria-checked":j,"aria-controls":k,"aria-describedby":w,"aria-labelledby":I,css:e(e(e({},S),B),{width:v,boxSizing:"border-box",fontSize:R.component.selector.fontSize,"&:hover":{fontWeight:R.component.selector.hover.fontWeight},"&:disabled":{color:R.colors.shades[250].color,cursor:"not-allowed"}}),id:z},{children:d}),void 0)};export{a as default};
|
|
2
2
|
//# sourceMappingURL=SimpleSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as a}from"@emotion/react/jsx-runtime";var r=function(r){var i=r.children,t=r.renderLeading,n=r.renderTrailing,d=r.disabled,o=r.type,l=void 0===o?"button":o,s=r.onClick,c=r.className,b=r.inline,m=r.uppercase,p=void 0===m||m,u=r.testId,x=void 0===u?"base-button":u,f=r.id,y=r.role,v=r.tabIndex,g=r["aria-label"],h=r["aria-checked"],k=r["aria-controls"],I=r["aria-describedby"],C=r["aria-labelledby"];return a("button",e({onClick:s,disabled:d,className:c,type:l,"data-testid":x,css:{display:b?"inline-flex":"flex",justifyContent:"center",alignItems:"center",padding:"0.75rem 2rem",textDecoration:"none",textTransform:p?"uppercase":"unset",boxSizing:"border-box",cursor:"pointer"},id:f,role:y,tabIndex:v,"aria-label":g,"aria-checked":h,"aria-controls":k,"aria-describedby":I,"aria-labelledby":C},{children:[t,i,n]}),void 0)};export{r as default};
|
|
2
2
|
//# sourceMappingURL=BaseButton.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as i}from"tslib";import{jsxs as e,jsx as l}from"@emotion/react/jsx-runtime";import{Icon as t}from"../../icons/index.js";import{ComponentSize as o}from"../../../types/enums.js";import
|
|
1
|
+
import{__assign as i}from"tslib";import{jsxs as e,jsx as l}from"@emotion/react/jsx-runtime";import{useRef as r}from"react";import{Icon as t}from"../../icons/index.js";import{ComponentSize as o}from"../../../types/enums.js";import n from"../../selector/simple/SelectorSecondary.js";import{Text as a}from"../../text/Text.js";import d from"../guide/SizeFitGuide.js";import{Row as s,ButtonsContainer as c,BottomSizeTipRow as m}from"./styled.js";var u=0,v=function(v){var p,h,b=v.label,f=v.sizes,g=v.selectedValue,z=v.onChange,w=v.onClickSizeTip,S=v.inline,y=void 0!==S&&S,x=v.width,j=v.hasSizeGuide,k=void 0!==j&&j,C=v.sizeTipReferences,T=v.hasSizeTipBelowSelector,I=void 0!==T&&T,A=r(null);null!==(p=A.current)&&void 0!==p||(A.current="afrodita-size-selector-".concat(++u));var G="".concat(A.current,"-label"),F=k?null==C?void 0:C.find((function(i){return(null==i?void 0:i.size)===(null==g?void 0:g.label)})):null;return e("div",i({css:{display:"flex",flexDirection:y?"row":"column",alignItems:y?"center":"start"}},{children:[e(a,i({variant:"body",weight:"regular",size:"small",css:{alignSelf:y?"start":"inherit",padding:y?"0.75rem 0":"0"},id:G},{children:[b,!y&&l(a,i({variant:"label",weight:"demi",size:"regular"},{children:null==g?void 0:g.description}),void 0)]}),void 0),k&&!I&&e(s,i({"data-testid":"sizing-tip"},{children:[l(t.Actions.CircleInfo,{width:1.2},void 0),l(a,i({variant:"body",weight:"demi",size:"small",css:{display:"flex"}},{children:"Sizing Tip:"}),void 0),l(a,i({variant:"body",weight:"regular",size:"small"},{children:null==F?void 0:F.tip}),void 0),w&&l(d,{hideIcon:!0,onClick:w,title:null!==(h=null==F?void 0:F.cta)&&void 0!==h?h:"Size and Fit Guide"},void 0)]}),void 0),l(c,i({inline:y,role:"radiogroup","aria-labelledby":G},{children:null==f?void 0:f.map((function(i){var e,r=i.label===g.label,t=!i.disabled&&r,a=(e=i.label,"".concat(A.current,"-option-").concat(e.replaceAll(/\s+/g,"-").replaceAll("/","-").toLowerCase())),d=i.description?"".concat(i.label,", ").concat(i.description):i.label;return l(n,{css:{padding:"0.75rem 1rem 0.625rem",margin:"0 0.5rem 0.625rem 0",minWidth:"4rem"},size:o.Medium,text:i.label,active:t,disabled:i.disabled,onClick:function(){return z(i)},testId:"size-variant-".concat(i.label.split("/")[0]),width:x,showNoStockStyles:i.noStock,id:a,role:"radio","aria-checked":r,"aria-label":d},i.label)}))}),void 0),k&&I&&l(m,i({"data-testid":"sizing-tip-below-selector"},{children:l(a,i({variant:"body",weight:"regular",size:"small"},{children:null==F?void 0:F.tip}),void 0)}),void 0)]}),void 0)};export{v as default};
|
|
2
2
|
//# sourceMappingURL=SizeSelector.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -1414,8 +1414,9 @@ interface DiscountTagProps$1 {
|
|
|
1414
1414
|
style?: react__default.CSSProperties;
|
|
1415
1415
|
bordersRounded?: boolean;
|
|
1416
1416
|
icon?: ReactNode;
|
|
1417
|
+
ariaLabel?: string;
|
|
1417
1418
|
}
|
|
1418
|
-
declare const DiscountTag: ({ discount, offText, savings, showSavings, showOnlySavings, disabled, backgroundColor, borderColor, textColor, size, style, bordersRounded, icon, }: DiscountTagProps$1) => JSX.Element;
|
|
1419
|
+
declare const DiscountTag: ({ discount, offText, savings, showSavings, showOnlySavings, disabled, backgroundColor, borderColor, textColor, size, style, bordersRounded, icon, ariaLabel, }: DiscountTagProps$1) => JSX.Element;
|
|
1419
1420
|
|
|
1420
1421
|
interface ProductTagProps {
|
|
1421
1422
|
text: string;
|
|
@@ -1455,6 +1456,9 @@ interface PriceLabelProps {
|
|
|
1455
1456
|
finalPriceStyle?: react__default.CSSProperties;
|
|
1456
1457
|
originalPriceStyled?: boolean;
|
|
1457
1458
|
originalPriceUnderlined?: boolean;
|
|
1459
|
+
finalPriceAriaLabel?: string;
|
|
1460
|
+
originalPriceAriaLabel?: string;
|
|
1461
|
+
discountAriaLabel?: string;
|
|
1458
1462
|
testId?: string;
|
|
1459
1463
|
clubStyle?: boolean;
|
|
1460
1464
|
bordersRounded?: boolean;
|
|
@@ -3775,8 +3779,11 @@ declare type QuantityPickerProps = {
|
|
|
3775
3779
|
isOutlined?: boolean;
|
|
3776
3780
|
increaseIcon?: React.ReactNode;
|
|
3777
3781
|
decreaseIcon?: React.ReactNode;
|
|
3782
|
+
increaseAriaLabel?: string;
|
|
3783
|
+
decreaseAriaLabel?: string;
|
|
3784
|
+
quantityAriaLabel?: string;
|
|
3778
3785
|
} & (QuantityPickerPropsControlled | QuantityPickerPropsUncontrolled);
|
|
3779
|
-
declare const QuantityPicker: ({ initialValue, maxValue, value, testId, onChange, isOutlined, increaseIcon, decreaseIcon, }: QuantityPickerProps) => JSX.Element;
|
|
3786
|
+
declare const QuantityPicker: ({ initialValue, maxValue, value, testId, onChange, isOutlined, increaseIcon, decreaseIcon, increaseAriaLabel, decreaseAriaLabel, quantityAriaLabel, }: QuantityPickerProps) => JSX.Element;
|
|
3780
3787
|
|
|
3781
3788
|
interface RadioProps$1 {
|
|
3782
3789
|
name: string;
|
|
@@ -4151,7 +4158,13 @@ interface BaseButtonProps {
|
|
|
4151
4158
|
uppercase?: boolean;
|
|
4152
4159
|
testId?: string;
|
|
4153
4160
|
id?: string;
|
|
4161
|
+
role?: react__default.AriaRole;
|
|
4162
|
+
tabIndex?: number;
|
|
4163
|
+
'aria-label'?: string;
|
|
4164
|
+
'aria-checked'?: boolean;
|
|
4165
|
+
'aria-controls'?: string;
|
|
4154
4166
|
'aria-describedby'?: string;
|
|
4167
|
+
'aria-labelledby'?: string;
|
|
4155
4168
|
}
|
|
4156
4169
|
|
|
4157
4170
|
declare type BaseProps = Pick<BaseButtonProps, 'disabled' | 'type' | 'onClick' | 'testId'>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),a=require("@emotion/styled"),
|
|
1
|
+
"use strict";var e=require("tslib"),n=require("react/jsx-runtime"),a=require("@emotion/styled"),i=require("@headlessui/react"),r=require("../text/Text.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l,s,o,d,u,c=t(a),p=c.default(i.RadioGroup)(l||(l=e.__makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"],["\n display: flex;\n flex-direction: column;\n"]))),m=c.default(i.RadioGroup.Label)(s||(s=e.__makeTemplateObject(["\n font-size: 0.88rem;\n"],["\n font-size: 0.88rem;\n"]))),f=c.default(i.RadioGroup.Option)(o||(o=e.__makeTemplateObject(["\n margin-right: 8px;\n\n svg {\n cursor: pointer;\n }\n"],["\n margin-right: 8px;\n\n svg {\n cursor: pointer;\n }\n"]))),x=c.default.span(d||(d=e.__makeTemplateObject(["\n font-weight: 600;\n"],["\n font-weight: 600;\n"]))),v=c.default.div(u||(u=e.__makeTemplateObject(["\n display: flex;\n margin-top: 0.63rem;\n flex-wrap: wrap;\n"],["\n display: flex;\n margin-top: 0.63rem;\n flex-wrap: wrap;\n"]))),g=Object.assign((function(a){var i=a.value,r=a.onChange,t=a.children,l=a.className;return n.jsx(p,e.__assign({value:i,onChange:r,className:l},{children:t}),void 0)}),{Label:function(a){var i=a.label,t=a.values;return n.jsx(m,{children:n.jsxs(r.Text,e.__assign({variant:"body",weight:"regular",size:"small",asSpan:!0},{children:[i," ",n.jsx(x,{children:t},void 0)]}),void 0)},void 0)},Option:function(a){var i=a.value,r=a.children,t=a.disabled,l=a["aria-label"];return n.jsx(f,e.__assign({value:i,disabled:t,"aria-label":l},{children:r}),void 0)},OptionsContainer:v});module.exports=g;
|
|
2
2
|
//# sourceMappingURL=ColorRadioGroup.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),o=require("./
|
|
1
|
+
"use strict";var e=require("tslib"),t=require("react/jsx-runtime"),r=require("react"),o=require("./ColorRadioGroup.js"),l=require("./selector/ColorSelector.js"),n=require("./selector/OutOfStock.js"),a=require("./selector/PatternSelector.js"),i=function(r,i){return null==i||0===i.length?t.jsx(n.OutOfStock,{title:"out of stock color"},void 0):i.map((function(n){return t.jsx(o.Option,e.__assign({value:n,"aria-label":n.label},{children:n.meta.color?t.jsx(l.ColorSelector,{color:n.meta.color,selected:r.has(n),testId:"".concat(n.label,"-selector")},void 0):n.meta.pattern?t.jsx(a.PatternSelector,{url:n.meta.pattern.url,selected:r.has(n)},void 0):null}),n.label)}))};module.exports=function(l){var n=l.options,a=void 0===n?[]:n,s=l.label,u=l.selectedValue,c=l.onChange,d=function(e,t){return t&&e.includes(t)?[t]:t&&e.length>0?[e[0]]:void 0}(a,u),v=r.useState(new Set(d)),f=v[0],j=v[1];r.useEffect((function(){c(f)}),[c,f]);var h=Array.from(f).map((function(e){return e.label})).join(" | ");return t.jsxs(o,e.__assign({value:f,onChange:function(e){j((function(t){var r=new Set(t);return t.has(e)?r.delete(e):r.add(e),r}))}},{children:[t.jsx(o.Label,{label:s,values:h},void 0),t.jsx(o.OptionsContainer,{children:i(f,a)},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=MultiColorPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("@emotion/react/jsx-runtime"),t=require("./ColorRadioGroup.js"),r=require("./selector/ColorSelector.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),o=require("@emotion/react/jsx-runtime"),t=require("./ColorRadioGroup.js"),r=require("./selector/ColorSelector.js"),l=require("./selector/OutOfStock.js"),n=require("./selector/PatternSelector.js"),i=function(i,s,a,c){return void 0===s&&(s=!1),0===(null==i?void 0:i.length)?o.jsx(l.OutOfStock,{title:"out of stock color"},void 0):null==i?void 0:i.map((function(l){var i;return o.jsx(t.Option,e.__assign({value:l,"aria-label":null!==(i=null==c?void 0:c[l.label])&&void 0!==i?i:l.label},{children:function(e){var t=e.checked;return l.meta.color?o.jsx(r.ColorSelector,{color:l.meta.color,selected:t,testId:"".concat(l.label.split(" ").join("-").toLowerCase(),"-selector"),noStock:l.noStock,showCross:s,dimension:a},void 0):l.meta.pattern?o.jsx(n.PatternSelector,{url:l.meta.pattern.url,selected:t,noStock:l.noStock,dimension:a},void 0):null}}),l.label)}))};exports.default=function(r){var l,n=r.options,s=r.selectedValue,a=r.label,c=r.onChange,u=r.inline,d=void 0!==u&&u,v=r.showCross,m=void 0!==v&&v,p=r.dimension,j=r.translatedLabels,b=s?null!==(l=null==j?void 0:j[s.label])&&void 0!==l?l:s.label:void 0;return o.jsxs(t,e.__assign({value:s,onChange:c,css:{flexDirection:d?"row":"column",alignItems:d?"center":"start"}},{children:[o.jsx(t.Label,{label:a,values:b&&!d?b:void 0},void 0),o.jsx(t.OptionsContainer,e.__assign({css:{marginTop:d?"0":"0.5rem",marginLeft:d?"1.5rem":"0"},"data-testid":"radio-group-options-container"},{children:i(n,m,p,j)}),void 0)]}),void 0)},exports.renderOptions=i;
|
|
2
2
|
//# sourceMappingURL=SingleColorPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),e=require("react/jsx-runtime"),s=require("../../../core/theme/Theme.js"),r=require("../../../types/enums.js"),i=require("./styled.js"),n=function(o){var s=o.discount,r=o.offText,i=o.savings,n=o.showSavings,t=void 0!==n&&n,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("tslib"),e=require("react/jsx-runtime"),s=require("../../../core/theme/Theme.js"),r=require("../../../types/enums.js"),i=require("./styled.js"),n=function(o){var s=o.discount,r=o.offText,i=o.savings,n=o.showSavings,t=void 0!==n&&n,a=o.showOnlySavings;if(void 0!==a&&a&&i)return e.jsx(e.Fragment,{children:i},void 0);var c="".concat(s,"% ").concat(r),d=t&&i?" - ".concat(i):"";return e.jsx(e.Fragment,{children:"".concat(c).concat(d).trim()},void 0)};exports.DiscountTag=function(t){var a=t.discount,c=t.offText,d=t.savings,l=t.showSavings,v=void 0!==l&&l,u=t.showOnlySavings,g=void 0!==u&&u,h=t.disabled,f=t.backgroundColor,x=void 0===f?"#fff":f,m=t.borderColor,b=void 0===m?"transparent":m,j=t.textColor,_=void 0===j?"#fff":j,p=t.size,y=void 0===p?r.ComponentSize.Medium:p,C=t.style,S=t.bordersRounded,w=void 0!==S&&S,T=t.icon,q=t.ariaLabel,z=s.useTheme(),O="".concat(a,"% ").concat(c).trim(),k=v&&d?", ".concat(d):"",F=null!=q?q:g&&d?d:"".concat(O).concat(k).trim();return e.jsxs(i.Container,o.__assign({backgroundColor:h?z.colors.shades[50].color:x,borderColor:h?z.colors.shades[50].color:b,size:y,"data-testid":"discount-container",style:C,bordersRounded:w,"aria-label":F},{children:[T&&e.jsx(i.IconContainer,{children:T},void 0),e.jsx(i.H3,o.__assign({textColor:h?z.colors.shades[250].color:_,size:y,style:o.__assign(o.__assign({},C),{whiteSpace:"nowrap"}),theme:z},{children:e.jsx(n,{discount:a,offText:c,savings:d,showSavings:v,showOnlySavings:g},void 0)}),void 0)]}),void 0)},exports.SavingsText=n;
|
|
2
2
|
//# sourceMappingURL=DiscountTag.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("../../../core/theme/Theme.js"),r=require("../../../hooks/WindowDimensions.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),n=require("../../../core/theme/Theme.js"),r=require("../../../hooks/WindowDimensions.js"),l=require("../../../types/enums.js"),o=require("../discount/DiscountTag.js"),a=require("../styles.js"),t=function(i,e){var n,r,o,a,t,c,s,d;switch(i){case l.ComponentSize.Large:return{finalPricefontSize:(null===(n=null==e?void 0:e.component.pricing.priceLabel.price.largeFontSize)||void 0===n?void 0:n.large)||"20px",finalPricefontSizeSmall:(null===(r=null==e?void 0:e.component.pricing.priceLabel.price.smallFontSize)||void 0===r?void 0:r.large)||"14px",margin:"0 0 0 0.75rem",lineHeight:"2rem"};case l.ComponentSize.Medium:return{fontSize:(null===(o=null==e?void 0:e.component.pricing.priceLabel.price.defaultFontSize)||void 0===o?void 0:o.medium)||"1.125rem",finalPricefontSize:(null===(a=null==e?void 0:e.component.pricing.priceLabel.price.largeFontSize)||void 0===a?void 0:a.medium)||"20px",finalPricefontSizeSmall:(null===(t=null==e?void 0:e.component.pricing.priceLabel.price.smallFontSize)||void 0===t?void 0:t.medium)||"14px",margin:"0 0 0 0.5rem",lineHeight:"1.25rem"};case l.ComponentSize.Small:return{fontSize:(null===(c=null==e?void 0:e.component.pricing.priceLabel.price.defaultFontSize)||void 0===c?void 0:c.small)||"14px",finalPricefontSize:(null===(s=null==e?void 0:e.component.pricing.priceLabel.price.largeFontSize)||void 0===s?void 0:s.small)||"20px",finalPricefontSizeSmall:(null===(d=null==e?void 0:e.component.pricing.priceLabel.price.smallFontSize)||void 0===d?void 0:d.small)||"14px",margin:"0 0 0 0.5rem",lineHeight:"1.25rem"}}};function c(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];return i.filter(Boolean).join("-")}exports.PriceLabel=function(t){var s=t.finalPrice,d=t.originalPrice,p=t.discount,u=t.color,v=t.originalPriceColor,m=t.testId,g=t.finalPriceStyled,S=void 0!==g&&g,f=t.finalPriceStyle,P=t.originalPriceStyled,z=void 0!==P&&P,b=t.originalPriceUnderlined,x=void 0===b||b,_=t.finalPriceAriaLabel,h=t.originalPriceAriaLabel,j=t.discountAriaLabel,y=t.size,L=void 0===y?l.ComponentSize.Medium:y,C=t.clubStyle,w=void 0!==C&&C,D=t.invertDirection,F=void 0!==D&&D,T=t.isPrincingStyleTestEnabled,q=void 0!==T&&T,A=i.__rest(t,["finalPrice","originalPrice","discount","color","originalPriceColor","testId","finalPriceStyled","finalPriceStyle","originalPriceStyled","originalPriceUnderlined","finalPriceAriaLabel","originalPriceAriaLabel","discountAriaLabel","size","clubStyle","invertDirection","isPrincingStyleTestEnabled"]),M=n.useTheme(),H=r.useWindowDimensions().isMobile,I="".concat(s),B=null==d?"":"".concat(d),E=null!=_?_:d?"Sale price ".concat(I):"Price ".concat(I),O=null!=h?h:"Original price ".concat(B),U={size:S?l.ComponentSize.Small:L,color:u||M.colors.pallete.secondary.color,weight:700},W=function(){var n=H?l.ComponentSize.Small:l.ComponentSize.XSmall,r=z?L:l.ComponentSize.Small,o=w?n:r;return e.jsx(a.Price,i.__assign({size:o,color:v||M.component.pricing.priceLabel.price.originalPriceColor,underlined:x,"data-testid":c(m,"original-product-price"),"data-nosnippet":!0,"aria-label":O,theme:M},{children:d}),void 0)};return e.jsxs(a.Container,i.__assign({},A,{id:"priceLabel"},{children:[q?e.jsxs(a.PriceContainer,i.__assign({flexDirection:"column",gap:"0.25rem"},{children:[!!d&&e.jsx(W,{},void 0),e.jsx(a.Price,i.__assign({"data-testid":c(m,"final-product-price")},U,{style:f,size:L,weight:400,"aria-label":E},{children:s}),void 0)]}),void 0):w?e.jsxs(a.PriceContainer,i.__assign({flexDirection:F?"row-reverse":"row"},{children:[!!d&&e.jsx(W,{},void 0),e.jsx(a.Price,i.__assign({"data-testid":c(m,"final-product-price")},U,{style:f,size:L,"aria-label":E},{children:s}),void 0)]}),void 0):e.jsxs(a.PriceContainer,i.__assign({flexDirection:F?"row-reverse":"row"},{children:[e.jsx(a.Price,i.__assign({"data-testid":c(m,"final-product-price")},U,{style:f,size:L,"aria-label":E},{children:s}),void 0),!!d&&e.jsx(W,{},void 0)]}),void 0),p&&e.jsx(a.TagContainer,i.__assign({size:L},{children:e.jsx(o.DiscountTag,i.__assign({},p,{size:L,ariaLabel:j}),void 0)}),void 0)]}),void 0)},exports.getFontSize=function(i,e,n,r){var l,o,a;return n?null===(l=t(i,e))||void 0===l?void 0:l.finalPricefontSize:r?null===(o=t(i,e))||void 0===o?void 0:o.finalPricefontSizeSmall:null===(a=t(i,e))||void 0===a?void 0:a.fontSize},exports.getStylesBySize=t,exports.getTestId=c;
|
|
2
2
|
//# sourceMappingURL=PriceLabel.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),o=require("../../../core/theme/Theme.js");require("react");var r=require("../../../hooks/WindowDimensions.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),o=require("../../../core/theme/Theme.js");require("react");var r=require("../../../hooks/WindowDimensions.js"),a=require("../../../utils/getCurrencySymbol/getCurrencySimbol.js"),s=require("../../../types/enums.js"),t=require("../clubOffer/ClubOfferTag.js"),n=require("../discount/DiscountTag.js"),l=require("../price/PriceLabel.js"),c=require("../priceLabelV6/utils/priceLabelAria.js"),d=require("../styles.js"),u=require("./PriceLabelTooltip.js"),p=function(o){var r,a=o.testId,t=o.priceCommonProps,n=o.size,c=o.currencySymbol,u=o.finalPriceArray,p=o.productFinalPrice,m=o.showDecimals,b=o.pricePerItem,v=o.theme,y=o.isHorizontalLayout,g=void 0!==y&&y,f=o.isVerticalLayout,P=void 0!==f&&f,S=o.ariaLabel,x=g?i.__assign(i.__assign({},t),{size:s.ComponentSize.Small,style:{fontSize:"14px"}}):t,z=P?i.__assign(i.__assign({},t),{size:s.ComponentSize.Small,style:{fontSize:"16px"}}):t,L=g?x:P?z:t;return e.jsxs(d.FinalPriceStyledContainer,i.__assign({"data-testid":l.getTestId(a,"final-product-price"),"aria-label":S},{children:[e.jsx(d.Price,i.__assign({margin:!0,finalPriceStyledSmall:!g&&!P},L,{size:g||P?s.ComponentSize.Small:n,"aria-hidden":"true"},{children:c}),void 0),e.jsx(d.Price,i.__assign({finalPriceStyled:!g&&!P},L,{size:g||P?s.ComponentSize.Small:n,"aria-hidden":"true"},{children:u[0]?u[0]:null===(r="".concat(p))||void 0===r?void 0:r.split(c)[1]}),void 0),m&&e.jsxs(d.Price,i.__assign({finalPriceStyledSmall:!g&&!P,style:g?{fontSize:"14px"}:P?{fontSize:"16px"}:{marginTop:"-6px"}},L,{size:g||P?s.ComponentSize.Small:n,"aria-hidden":"true"},{children:[(g||P)&&".",u[1]?u[1]:"00"]}),void 0),b&&e.jsx(d.Price,i.__assign({size:s.ComponentSize.Small,color:v.colors.pallete.secondary.color,"aria-hidden":"true"},{children:"/each"}),void 0)]}),void 0)},m=function(o){var r=o.isDiscount,a=o.discount,t=o.bordersRounded,l=o.savingsDisplay,c=o.currencySymbol,u=o.savetoString,p=o.isHorizontalLayout,m=void 0!==p&&p,b=o.ariaLabel;return r?e.jsx(d.TagContainer,i.__assign({size:s.ComponentSize.Small},{children:a&&e.jsx(n.DiscountTag,i.__assign({},a,{size:s.ComponentSize.Medium,style:i.__assign({letterSpacing:"-0.05rem"},m&&{fontSize:"12px"}),bordersRounded:t,savings:l?"Save ".concat(c).concat(u):void 0,ariaLabel:b}),void 0)}),void 0):null},b=function(o){var r=o.isClubOffer,a=o.clubOffer;return r?e.jsx(d.TagContainer,i.__assign({size:s.ComponentSize.Medium},{children:a&&e.jsx(t.ClubOfferTag,i.__assign({},a,{size:s.ComponentSize.Small,style:{borderRadius:"8px",width:"107px",height:"28px",alignItems:"center",padding:"3px 8px 3px 8px",fontSize:"14px",lineHeight:"22px"}}),void 0)}),void 0):null};exports.PriceLabelV2=function(t){var n=t.finalPrice,v=t.originalPrice,y=t.discount,g=t.clubOffer,f=t.color,P=t.testId,S=t.originalPriceStyled,x=void 0!==S&&S,z=t.originalPriceUnderlined,L=void 0===z||z,h=t.size,j=void 0===h?s.ComponentSize.Small:h,_=t.bordersRounded,C=void 0!==_&&_,D=t.savingsDisplay,T=void 0===D||D,I=t.pricePerItem,O=t.hasRoundedSavings,A=void 0===O||O,V=t.showDecimals,q=void 0===V||V,w=t.tooltipText,H=t.tooltipIcon,R=t.tooltipPosition,M=t.hasVerticalLayout,F=void 0!==M&&M,N=t.hasHorizontalLayout,U=void 0!==N&&N,W=t.isMobile,k=void 0!==W&&W,$=t.finalPriceAriaLabel,B=t.originalPriceAriaLabel,E=t.discountAriaLabel,G=i.__rest(t,["finalPrice","originalPrice","discount","clubOffer","color","testId","originalPriceStyled","originalPriceUnderlined","size","bordersRounded","savingsDisplay","pricePerItem","hasRoundedSavings","showDecimals","tooltipText","tooltipIcon","tooltipPosition","hasVerticalLayout","hasHorizontalLayout","isMobile","finalPriceAriaLabel","originalPriceAriaLabel","discountAriaLabel"]),J=o.useTheme(),K=r.useWindowDimensions().isMobile,Q=I||n,X=v!==Q,Y=v&&X,Z=!(!y||!X),ii=!(!g||!X),ei="$";"string"==typeof Q&&(ei=a.getCurrencySymbol(Q));var oi,ri,ai="string"==typeof Q&&Q.includes(".")&&Q.includes(ei)?Q.split(ei)[1].split("."):["",""],si={size:s.ComponentSize.Small,color:ii?"var(--colors-pallete-wine-color)":f||J.colors.pallete.secondary.color,weight:700};"string"==typeof v&&"string"==typeof Q?(oi=Number(v.replace(ei,"")),ri=Number(Q.replace(ei,""))):(oi="number"==typeof v?v:0,ri="number"==typeof Q?Q:0);var ti=oi-ri;if(A){var ni=Number((ti-Math.floor(ti)).toFixed(2));ni>=.01&&ni<.5?ti=Math.floor(ti)+0:ni>=.51&&ni<1&&(ti=Math.floor(ti)+.5)}var li=ti.toFixed(2),ci=c.getPriceLabelAriaTexts({productFinalPrice:Q,originalPrice:v,currencySymbol:ei,isOriginalPrice:!!Y,finalPriceAriaLabel:$,originalPriceAriaLabel:B}),di=ci.computedFinalPriceLabel,ui=ci.computedOriginalPriceLabel,pi=function(){return e.jsx(d.Price,i.__assign({size:x?j:s.ComponentSize.Small,color:J.component.pricing.priceLabel.price.originalPriceColor||J.colors.shades[300].color,margin:!F,underlined:L,"data-testid":l.getTestId(P,"original-product-price"),"data-nosnippet":!0,style:U?{fontSize:"12px"}:void 0,"aria-label":ui},{children:v}),void 0)};return F?e.jsxs(d.VerticalContainer,i.__assign({},G,{id:"priceLabelV2"},{children:[w&&e.jsx(u.PriceLabelTooltip,{tooltipText:w,tooltipIcon:H,tooltipPosition:R,isMobile:null!=k?k:K},void 0),Y&&e.jsx(pi,{},void 0),e.jsxs(d.PriceDiscountRow,{children:[e.jsx(m,{isDiscount:Z,discount:y,bordersRounded:C,savingsDisplay:T,currencySymbol:ei,savetoString:li,isHorizontalLayout:U,ariaLabel:E},void 0),e.jsx(b,{isClubOffer:ii,clubOffer:g},void 0),e.jsx(p,{testId:P,priceCommonProps:si,size:j,currencySymbol:ei,finalPriceArray:ai,productFinalPrice:Q,showDecimals:q,pricePerItem:I,theme:J,isHorizontalLayout:U,isVerticalLayout:F,ariaLabel:di},void 0)]},void 0)]}),void 0):U?e.jsx(d.HorizontalVariantContainer,i.__assign({},G,{id:"priceLabelV2"},{children:e.jsxs(d.HorizontalVariantRow,{children:[w&&e.jsx(u.PriceLabelTooltip,{tooltipText:w,tooltipIcon:H,tooltipPosition:R},void 0),e.jsx(p,{testId:P,priceCommonProps:si,size:j,currencySymbol:ei,finalPriceArray:ai,productFinalPrice:Q,showDecimals:q,pricePerItem:I,theme:J,isHorizontalLayout:U,isVerticalLayout:F,ariaLabel:di},void 0),Y&&e.jsx(pi,{},void 0),e.jsx(m,{isDiscount:Z,discount:y,bordersRounded:C,savingsDisplay:T,currencySymbol:ei,savetoString:li,isHorizontalLayout:U,ariaLabel:E},void 0),e.jsx(b,{isClubOffer:ii,clubOffer:g},void 0)]},void 0)}),void 0):e.jsxs(d.Container,i.__assign({},G,{id:"priceLabelV2"},{children:[w&&e.jsx(u.PriceLabelTooltip,{tooltipText:w,tooltipIcon:H,tooltipPosition:R},void 0),Y&&e.jsx(pi,{},void 0),e.jsx(p,{testId:P,priceCommonProps:si,size:j,currencySymbol:ei,finalPriceArray:ai,productFinalPrice:Q,showDecimals:q,pricePerItem:I,theme:J,isHorizontalLayout:U,isVerticalLayout:F,ariaLabel:di},void 0),e.jsx(m,{isDiscount:Z,discount:y,bordersRounded:C,savingsDisplay:T,currencySymbol:ei,savetoString:li,isHorizontalLayout:U,ariaLabel:E},void 0),e.jsx(b,{isClubOffer:ii,clubOffer:g},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=PriceLabelV2.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),o=require("../../../core/theme/Theme.js");require("react");var r=require("../../../hooks/WindowDimensions.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var i=require("tslib"),e=require("react/jsx-runtime"),o=require("../../../core/theme/Theme.js");require("react");var r=require("../../../hooks/WindowDimensions.js"),a=require("../../../types/enums.js"),t=require("../styles.js"),l=require("./PriceLabelV6Components.js"),n=require("./utils/priceParsing.js"),s=require("./utils/priceLabelAria.js"),c=require("./utils/savingsRounding.js");exports.PriceLabelV6=function(d){var u=d.finalPrice,P=d.originalPrice,p=d.discount,b=d.clubOffer,g=d.color,v=d.testId,m=d.originalPriceStyled,y=void 0!==m&&m,L=d.originalPriceUnderlined,S=void 0===L||L,f=d.size,h=void 0===f?a.ComponentSize.Small:f,j=d.bordersRounded,x=void 0!==j&&j,z=d.savingsDisplay,I=void 0===z||z,A=d.pricePerItem,D=d.hasRoundedSavings,T=void 0===D||D,q=d.showDecimals,O=void 0===q||q,w=d.tooltipText,C=d.tooltipIcon,H=d.tooltipPosition,_=d.hasHorizontalLayout,R=void 0!==_&&_,M=d.isMobile,V=void 0!==M&&M,F=d.finalPriceAriaLabel,U=d.originalPriceAriaLabel,W=d.discountAriaLabel,k=i.__rest(d,["finalPrice","originalPrice","discount","clubOffer","color","testId","originalPriceStyled","originalPriceUnderlined","size","bordersRounded","savingsDisplay","pricePerItem","hasRoundedSavings","showDecimals","tooltipText","tooltipIcon","tooltipPosition","hasHorizontalLayout","isMobile","finalPriceAriaLabel","originalPriceAriaLabel","discountAriaLabel"]),B=o.useTheme(),E=r.useWindowDimensions().isMobile,G=A||u,J=P!==G,K=P&&J,N=!(!p||!J),Q=!(!b||!J),X=n.extractCurrencySymbol(G),Y=n.splitPriceIntoParts("string"==typeof G?G:"",X),Z={size:a.ComponentSize.Small,color:Q?"var(--colors-pallete-wine-color)":g||B.colors.pallete.secondary.color,weight:700},$=n.calculateSavings(P||0,G,X),ii=c.applyRoundedSavings($,T),ei=c.formatSavingsToString(ii),oi=s.getPriceLabelAriaTexts({productFinalPrice:G,originalPrice:P,currencySymbol:X,isOriginalPrice:!!K,finalPriceAriaLabel:F,originalPriceAriaLabel:U}),ri=oi.computedFinalPriceLabel,ai=oi.computedOriginalPriceLabel;return R?e.jsx(t.HorizontalVariantContainer,i.__assign({},k,{id:"priceLabelV6"},{children:e.jsxs(t.HorizontalVariantRow,i.__assign({"data-testid":"horizontal-variant-row"},{children:[e.jsx(l.PriceSection,{testId:v,priceCommonProps:Z,size:h,currencySymbol:X,finalPriceArray:Y,productFinalPrice:G,showDecimals:O,pricePerItem:A,theme:B,isHorizontalLayout:R,ariaLabel:ri},void 0),K&&e.jsx(l.OriginalPriceSection,{originalPrice:P,originalPriceStyled:y,originalPriceUnderlined:S,size:h,testId:v,theme:B,hasHorizontalLayout:R,ariaLabel:ai},void 0),e.jsx(l.TooltipSection,{tooltipText:w,tooltipIcon:C,tooltipPosition:H,isMobile:null!=V?V:E},void 0),e.jsx(l.TagsSection,{isDiscount:N,discount:p,bordersRounded:x,savingsDisplay:I,currencySymbol:X,savetoString:ei,isHorizontalLayout:R,isClubOffer:Q,clubOffer:b,discountAriaLabel:W},void 0)]}),void 0)}),void 0):e.jsxs(t.Container,i.__assign({},k,{id:"priceLabelV6"},{children:[K&&e.jsx(l.OriginalPriceSection,{originalPrice:P,originalPriceStyled:y,originalPriceUnderlined:S,size:h,testId:v,theme:B,hasHorizontalLayout:R,ariaLabel:ai},void 0),e.jsx(l.TooltipSection,{tooltipText:w,tooltipIcon:C,tooltipPosition:H,isMobile:null!=V?V:E},void 0),e.jsx(l.PriceSection,{testId:v,priceCommonProps:Z,size:h,currencySymbol:X,finalPriceArray:Y,productFinalPrice:G,showDecimals:O,pricePerItem:A,theme:B,isHorizontalLayout:R,ariaLabel:ri},void 0),e.jsx(l.TagsSection,{isDiscount:N,discount:p,bordersRounded:x,savingsDisplay:I,currencySymbol:X,savetoString:ei,isHorizontalLayout:R,isClubOffer:Q,clubOffer:b,discountAriaLabel:W},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=PriceLabelV6.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime"),r=require("../../../types/enums.js"),o=require("../clubOffer/ClubOfferTag.js"),n=require("../discount/DiscountTag.js"),t=require("../price/PriceLabel.js"),s=require("../styles.js"),a=require("./PriceLabelV6.styled.js"),l=require("./PriceLabelV6Tooltip.js"),c=require("./utils/eventHandlers.js");exports.OriginalPriceSection=function(o){var n=o.originalPrice,a=o.originalPriceStyled,l=o.originalPriceUnderlined,c=o.size,d=o.testId,p=o.theme,u=o.hasHorizontalLayout,g=o.ariaLabel;return i.jsx(s.Price,e.__assign({size:a?c:r.ComponentSize.Small,color:p.component.pricing.priceLabel.price.originalPriceColor||p.colors.shades[300].color,margin:!0,underlined:l,"data-testid":t.getTestId(d,"original-product-price"),"data-nosnippet":!0,style:u?{fontSize:"12px"}:void 0,"aria-label":g},{children:n}),void 0)},exports.PriceSection=function(o){var n=o.testId,a=o.priceCommonProps,l=o.size,c=o.currencySymbol,d=o.finalPriceArray,p=o.productFinalPrice,u=o.showDecimals,g=o.pricePerItem,S=o.theme,m=o.isHorizontalLayout,x=void 0!==m&&m,z=o.ariaLabel,_=x?e.__assign(e.__assign({},a),{size:r.ComponentSize.Small,style:{fontSize:"14px"}}):a;return i.jsxs(s.FinalPriceStyledContainer,e.__assign({"data-testid":t.getTestId(n,"final-product-price"),"aria-label":z},{children:[i.jsx(s.Price,e.__assign({margin:!0,finalPriceStyledSmall:!x},_,{size:x?r.ComponentSize.Small:l,"aria-hidden":"true"},{children:c}),void 0),i.jsx(s.Price,e.__assign({finalPriceStyled:!x},_,{size:x?r.ComponentSize.Small:l,"aria-hidden":"true"},{children:d[0]||("string"==typeof p&&p.includes(c)?"".concat(p).split(c)[1]:"".concat(p))}),void 0),u&&i.jsxs(s.Price,e.__assign({finalPriceStyledSmall:!x,style:x?{fontSize:"14px"}:{marginTop:"-6px"}},_,{size:x?r.ComponentSize.Small:l,"aria-hidden":"true"},{children:[x&&".",d[1]?d[1]:"00"]}),void 0),g&&i.jsx(s.Price,e.__assign({size:r.ComponentSize.Small,color:S.colors.pallete.secondary.color,"aria-hidden":"true"},{children:"/each"}),void 0)]}),void 0)},exports.TagsSection=function(t){var a=t.isDiscount,l=t.discount,c=t.bordersRounded,d=t.savingsDisplay,p=t.currencySymbol,u=t.savetoString,g=t.isHorizontalLayout,S=void 0!==g&&g,m=t.isClubOffer,x=t.clubOffer,z=t.discountAriaLabel;return i.jsxs(i.Fragment,{children:[a&&i.jsx(s.TagContainer,e.__assign({size:r.ComponentSize.Small},{children:l&&i.jsx(n.DiscountTag,e.__assign({},l,{size:r.ComponentSize.Medium,style:e.__assign({letterSpacing:"-0.05rem"},S&&{fontSize:"12px"}),bordersRounded:c,savings:d?"Save ".concat(p).concat(u):void 0,ariaLabel:z}),void 0)}),void 0),m&&i.jsx(s.TagContainer,e.__assign({size:r.ComponentSize.Medium},{children:x&&i.jsx(o.ClubOfferTag,e.__assign({},x,{size:r.ComponentSize.Small,style:{borderRadius:"8px",width:"107px",height:"28px",alignItems:"center",padding:"3px 8px 3px 8px",fontSize:"14px",lineHeight:"22px"}}),void 0)}),void 0)]},void 0)},exports.TooltipSection=function(r){var o=r.tooltipText,n=r.tooltipIcon,t=r.tooltipPosition,s=r.isMobile;if(!o)return null;var d=c.createStopPropagationHandlers();return i.jsx(a.TooltipWrapper,e.__assign({"data-testid":"PriceLabelV6-TooltipWrapper"},d,{children:i.jsx(l.PriceLabelV6Tooltip,{tooltipText:o,tooltipIcon:n,tooltipPosition:t,isMobile:s},void 0)}),void 0)};
|
|
2
2
|
//# sourceMappingURL=PriceLabelV6Components.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime");require("../../../core/theme/Theme.js"),require("react");var o=require("../../../types/enums.js");require("../clubOffer/ClubOfferTag.js"),require("../discount/styled.js");var r=require("../styles.js"),t=require("../../tooltip/Tooltip.js");require("../../atoms/PriceLabel/PriceLabel.js"),require("../../atoms/ClubPriceMemberLabel/ClubPriceMemberLabel.styled.js"),require("../../atoms/HorizontalDivider/HorizontalDivider.js");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),i=require("react/jsx-runtime");require("../../../core/theme/Theme.js"),require("react");var o=require("../../../types/enums.js");require("../clubOffer/ClubOfferTag.js"),require("../discount/styled.js");var r=require("../styles.js"),t=require("./utils/eventHandlers.js"),s=require("../../tooltip/Tooltip.js");require("../../atoms/PriceLabel/PriceLabel.js"),require("../../atoms/ClubPriceMemberLabel/ClubPriceMemberLabel.styled.js"),require("../../atoms/HorizontalDivider/HorizontalDivider.js");var l=require("../../atoms/Icon/Icon.js");require("../../atoms/Image/styled.js"),require("../../atoms/PriceLabelV2/PriceLabelV2.js"),require("../../atoms/Toggle/toggle.styled.js");exports.PriceLabelV6Tooltip=function(a){var n=a.tooltipText,u=a.tooltipIcon,c=a.tooltipPosition,d=a.isMobile,j=a.borderColor,p=void 0===j?"#EAEAEA":j,b=t.createStopPropagationHandlers();return i.jsx(r.TooltipContainer,e.__assign({"data-testid":"tooltip-container"},b,{children:i.jsx("div",e.__assign({},b,{children:i.jsx(s.Tooltip,e.__assign({showCloseIcon:!0,withArrow:!0,content:{text:n},position:null!=c?c:o.ComponentPosition.BottomRight,closeBtnSize:.7,borderColor:p,"data-testid":"tooltip"},{children:i.jsx(l.Icon,{name:null!=u?u:"actions/circle_info",fill:"#8C8383",width:.8,height:.8,testId:"tooltip-icon",showTooltipTitle:d},void 0)}),void 0)}),void 0)}),void 0)};
|
|
2
2
|
//# sourceMappingURL=PriceLabelV6Tooltip.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.getPriceLabelAriaTexts=function(e){var c=e.productFinalPrice,i=e.originalPrice,r=e.currencySymbol,a=e.isOriginalPrice,n=e.finalPriceAriaLabel,t=e.originalPriceAriaLabel,l="number"==typeof c?"".concat(r).concat(c):"".concat(c),o="number"==typeof i?"".concat(r).concat(i):"".concat(i),u=null==i?"":o;return{finalPriceText:l,originalPriceText:u,computedFinalPriceLabel:null!=n?n:a?"Sale price ".concat(l):"Price ".concat(l),computedOriginalPriceLabel:null!=t?t:"Original price ".concat(u)}};
|
|
2
|
+
//# sourceMappingURL=priceLabelAria.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priceLabelAria.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),r=require("react/jsx-runtime"),n=require("react"),i=require("../../core/theme/Theme.js"),t=require("./styled.js");exports.QuantityPicker=function(a){var o=a.initialValue,u=void 0===o?0:o,s=a.maxValue,c=void 0===s?99:s,l=a.value,d=a.testId,b=void 0===d?"quantity-picker":d,f=a.onChange,y=a.isOutlined,v=void 0!==y&&y,h=a.increaseIcon,m=a.decreaseIcon,q=a.increaseAriaLabel,x=a.decreaseAriaLabel,k=a.quantityAriaLabel,p=i.useTheme(),C=n.useState(null!=l?l:u),_=C[0],I=C[1],j="".concat(b,"-value"),D=(null!=l?l:_)>=c,R=function(e,r){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),r())};n.useEffect((function(){f&&f(_)}),[f,_]);var g=n.useCallback((function(e){return Math.max(Math.min(e,c),u)}),[c,u]);return n.useEffect((function(){I((function(e){return null==l?e:g(l)}))}),[l,g]),r.jsxs(t.Container,e.__assign({borderColor:p.colors.shades[200].color,color:p.colors.shades[700].color,"data-testid":b,borderRadius:p.component.qtyPicker.borderRadius,isOutlined:v},{children:[r.jsx(t.IncreaseDecrease,e.__assign({"data-testid":"".concat(b,"-minus"),onClick:function(){return I((function(e){return g(e-1)}))},isOutlined:v,borderColor:p.colors.shades[200].color,borderRadius:p.component.qtyPicker.borderRadius,role:"button",tabIndex:0,onKeyDown:function(e){return R(e,(function(){return I((function(e){return g(e-1)}))}))},"aria-label":null!=x?x:"Decrease quantity","aria-controls":j,"aria-describedby":j},{children:v?m:"-"}),void 0),r.jsx(t.NumberContainer,e.__assign({id:j,"aria-live":"polite","aria-atomic":"true","aria-label":null!=k?k:"Current quantity"},{children:_}),void 0),r.jsx(t.IncreaseDecrease,e.__assign({isMaxSelected:D,"data-testid":"".concat(b,"-plus"),onClick:function(){return I((function(e){return g(e+1)}))},isOutlined:v,borderColor:p.colors.shades[200].color,borderRadius:p.component.qtyPicker.borderRadius,isIncrease:!0,role:"button",tabIndex:D?-1:0,onKeyDown:function(e){return R(e,(function(){return I((function(e){return g(e+1)}))}))},"aria-label":null!=q?q:"Increase quantity","aria-controls":j,"aria-describedby":j,"aria-disabled":D},{children:v?h:"+"}),void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=QuantityPicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),i=require("../../core/theme/Theme.js"),r=require("../../types/enums.js"),s=require("./constants.js"),a=require("./starList/StarList.js"),n=require("./styles.js");exports.Rating=function(o){var l=o.size,c=void 0===l?r.ComponentSize.Medium:l,d=o.reviews,u=o.reviewsText,v=o.rating,h=o.showRatingText,m=void 0!==h&&h,j=o.wrapWithParenthesis,b=void 0!==j&&j,_=o.underline,f=void 0!==_&&_,g=o.reviewsContainerId,p=o.additionalContent;var w,x=i.useTheme(),q=null!=d;if(q){var C=1===d?"review":"reviews";w="".concat(d," ").concat(C)}var R=w||u,S=R?", ".concat(R):"",T="".concat(v," out of ").concat(s.STARTS_NUMBER," stars").concat(S),L=[q?"".concat(d):"",null!=u?u:""].filter(Boolean).join(" "),y=g?{href:g}:{};return t.jsxs(n.Container,e.__assign({as:g?"a":"div"},y,{"data-testid":"Container",onClick:function(e){var t;e.cancelable&&e.preventDefault(),g&&(null===(t=document.querySelector(g))||void 0===t||t.scrollIntoView({behavior:"smooth"}))},"aria-label":T},{children:[m&&t.jsx(n.RatingLabel,e.__assign({color:x.colors.shades[700].color,"data-testid":"RatingLabel"},{children:v}),void 0),t.jsx(a.StarList,{rating:v,size:c,starsNumber:s.STARTS_NUMBER,fill:x.component.stars.element.color},void 0),(d||u)&&t.jsx(n.CustomLabel,e.__assign({theme:x,size:c,wrapWithParenthesis:b,underline:f,"data-testid":"CustomLabel"},{children:L}),void 0),p]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=Rating.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("@emotion/styled"),n=require("../../../core/theme/Theme.js"),i=require("../../../types/enums.js"),s=require("../../icons/index.js"),a=require("./styles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("react/jsx-runtime"),r=require("@emotion/styled"),n=require("../../../core/theme/Theme.js"),i=require("../../../types/enums.js"),s=require("../../icons/index.js"),a=require("./styles.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l,u=o(r).default.div(l||(l=e.__makeTemplateObject(["\n display: flex;\n margin-right: ",";\n"],["\n display: flex;\n margin-right: ",";\n"])),(function(e){return e.marginRight}));exports.StarList=function(r){var o=r.rating,l=r.starsNumber,d=r.fill,m=r.size,c=void 0===m?i.ComponentSize.Medium:m,h=n.useTheme(),g={fill:d,width:h.component.stars.element[c].width,height:h.component.stars.element[c].height};return t.jsx(a.Container,e.__assign({"aria-hidden":"true",role:"presentation"},{children:Array.from({length:l},(function(r,n){return t.jsx(u,e.__assign({"data-testid":"star-container",marginRight:h.component.stars.element[c].marginRight},{children:n<Math.floor(o)?t.jsx(s.Icon.PDP.Star,e.__assign({},g),void 0):n===Math.floor(o)&&o%1!=0?t.jsx(s.Icon.PDP.StarHalf,e.__assign({},g),void 0):t.jsx(s.Icon.PDP.StarEmpty,e.__assign({},g),void 0)}),"star-container-".concat(n))}))}),void 0)};
|
|
2
2
|
//# sourceMappingURL=StarList.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var o=require("tslib"),e=require("@emotion/react/jsx-runtime"),t=require("../../../core/theme/Theme.js"),r=require("./SimpleSelector.js");module.exports=function(c){var n=c.text,s=c.size,l=c.disabled,d=c.active,
|
|
1
|
+
"use strict";var o=require("tslib"),e=require("@emotion/react/jsx-runtime"),t=require("../../../core/theme/Theme.js"),r=require("./SimpleSelector.js");module.exports=function(c){var n=c.text,s=c.size,l=c.disabled,d=c.active,i=c.className,a=c.testId,m=c.width,b=c.onClick,u=c.showNoStockStyles,h=c.id,p=o.__rest(c,["text","size","disabled","active","className","testId","width","onClick","showNoStockStyles","id"]),g=t.useTheme(),k=d?{background:g.component.selector.hover.background,color:g.component.selector.hover.color,border:g.component.selector.hover.border,fontWeight:g.component.selector.hover.fontWeight}:{background:"".concat(g.component.selector.default.background," !important"),color:"".concat(g.component.selector.default.color," !important"),border:"".concat(g.component.selector.default.border," !important"),fontWeight:g.component.selector.default.fontWeight};return u&&(k={background:g.component.selector.noStock.background,color:g.component.selector.noStock.color,border:g.component.selector.noStock.border,fontWeight:g.component.selector.noStock.fontWeight}),e.jsx(r,o.__assign({text:n,size:s,onClick:b,className:i,disabled:l,testId:a,width:m},p,{css:o.__assign(o.__assign({},k),{whiteSpace:"nowrap","&:hover":{background:u?"":g.component.selector.hover.background,color:u?"":g.component.selector.hover.color},"&:disabled":{border:g.component.selector.disabled.border,background:g.colors.background.disabled,color:g.colors.text.disabled}}),id:h}),void 0)};
|
|
2
2
|
//# sourceMappingURL=SelectorSecondary.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),o=require("@emotion/react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("tslib"),o=require("@emotion/react/jsx-runtime"),i=require("../../../core/theme/Theme.js"),t=require("../../../types/enums.js"),r=require("../../shared/button/BaseButton.js");module.exports=function(s){var n=s.text,a=s.className,d=s.disabled,l=void 0!==d&&d,c=s.size,m=void 0===c?t.ComponentSize.Medium:c,u=s.active,b=void 0!==u&&u,h=s.testId,p=void 0===h?"base-button":h,g=s.width,v=void 0===g?"":g,f=s.onClick,z=s.id,x=s.role,_=s.tabIndex,S=s["aria-label"],y=s["aria-checked"],W=s["aria-controls"],j=s["aria-describedby"],q=s["aria-labelledby"],C=i.useTheme(),k=function(e,o){switch(e){case t.ComponentSize.Medium:return{padding:o.component.selector.size.medium.padding,borderRadius:o.component.selector.size.medium.borderRadius};case t.ComponentSize.Small:return{padding:o.component.selector.size.small.padding,borderRadius:o.component.selector.size.small.borderRadius}}}(m,C),w=b?{fontWeight:C.component.selector.hover.fontWeight}:{fontWeight:C.component.selector.default.fontWeight};return o.jsx(r,e.__assign({onClick:f,disabled:l,className:a,type:"button",testId:p,role:x,tabIndex:_,"aria-label":S,"aria-checked":y,"aria-controls":W,"aria-describedby":j,"aria-labelledby":q,css:e.__assign(e.__assign(e.__assign({},k),w),{width:v,boxSizing:"border-box",fontSize:C.component.selector.fontSize,"&:hover":{fontWeight:C.component.selector.hover.fontWeight},"&:disabled":{color:C.colors.shades[250].color,cursor:"not-allowed"}}),id:z},{children:n}),void 0)};
|
|
2
2
|
//# sourceMappingURL=SimpleSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),
|
|
1
|
+
"use strict";var e=require("tslib"),r=require("@emotion/react/jsx-runtime");module.exports=function(a){var i=a.children,t=a.renderLeading,n=a.renderTrailing,d=a.disabled,s=a.type,l=void 0===s?"button":s,o=a.onClick,c=a.className,b=a.inline,u=a.uppercase,x=void 0===u||u,p=a.testId,m=void 0===p?"base-button":p,y=a.id,g=a.role,v=a.tabIndex,f=a["aria-label"],h=a["aria-checked"],k=a["aria-controls"],I=a["aria-describedby"],j=a["aria-labelledby"];return r.jsxs("button",e.__assign({onClick:o,disabled:d,className:c,type:l,"data-testid":m,css:{display:b?"inline-flex":"flex",justifyContent:"center",alignItems:"center",padding:"0.75rem 2rem",textDecoration:"none",textTransform:x?"uppercase":"unset",boxSizing:"border-box",cursor:"pointer"},id:y,role:g,tabIndex:v,"aria-label":f,"aria-checked":h,"aria-controls":k,"aria-describedby":I,"aria-labelledby":j},{children:[t,i,n]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=BaseButton.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var e=require("tslib"),i=require("@emotion/react/jsx-runtime"),l=require("react"),n=require("../../icons/index.js"),r=require("../../../types/enums.js"),s=require("../../selector/simple/SelectorSecondary.js"),t=require("../../text/Text.js"),a=require("../guide/SizeFitGuide.js"),o=require("./styled.js"),d=0;module.exports=function(c){var u,v,g=c.label,m=c.sizes,p=c.selectedValue,x=c.onChange,h=c.onClickSizeTip,b=c.inline,z=void 0!==b&&b,j=c.width,_=c.hasSizeGuide,w=void 0!==_&&_,S=c.sizeTipReferences,f=c.hasSizeTipBelowSelector,y=void 0!==f&&f,T=l.useRef(null);null!==(u=T.current)&&void 0!==u||(T.current="afrodita-size-selector-".concat(++d));var q="".concat(T.current,"-label"),C=w?null==S?void 0:S.find((function(e){return(null==e?void 0:e.size)===(null==p?void 0:p.label)})):null;return i.jsxs("div",e.__assign({css:{display:"flex",flexDirection:z?"row":"column",alignItems:z?"center":"start"}},{children:[i.jsxs(t.Text,e.__assign({variant:"body",weight:"regular",size:"small",css:{alignSelf:z?"start":"inherit",padding:z?"0.75rem 0":"0"},id:q},{children:[g,!z&&i.jsx(t.Text,e.__assign({variant:"label",weight:"demi",size:"regular"},{children:null==p?void 0:p.description}),void 0)]}),void 0),w&&!y&&i.jsxs(o.Row,e.__assign({"data-testid":"sizing-tip"},{children:[i.jsx(n.Icon.Actions.CircleInfo,{width:1.2},void 0),i.jsx(t.Text,e.__assign({variant:"body",weight:"demi",size:"small",css:{display:"flex"}},{children:"Sizing Tip:"}),void 0),i.jsx(t.Text,e.__assign({variant:"body",weight:"regular",size:"small"},{children:null==C?void 0:C.tip}),void 0),h&&i.jsx(a,{hideIcon:!0,onClick:h,title:null!==(v=null==C?void 0:C.cta)&&void 0!==v?v:"Size and Fit Guide"},void 0)]}),void 0),i.jsx(o.ButtonsContainer,e.__assign({inline:z,role:"radiogroup","aria-labelledby":q},{children:null==m?void 0:m.map((function(e){var l,n=e.label===p.label,t=!e.disabled&&n,a=(l=e.label,"".concat(T.current,"-option-").concat(l.replaceAll(/\s+/g,"-").replaceAll("/","-").toLowerCase())),o=e.description?"".concat(e.label,", ").concat(e.description):e.label;return i.jsx(s,{css:{padding:"0.75rem 1rem 0.625rem",margin:"0 0.5rem 0.625rem 0",minWidth:"4rem"},size:r.ComponentSize.Medium,text:e.label,active:t,disabled:e.disabled,onClick:function(){return x(e)},testId:"size-variant-".concat(e.label.split("/")[0]),width:j,showNoStockStyles:e.noStock,id:a,role:"radio","aria-checked":n,"aria-label":o},e.label)}))}),void 0),w&&y&&i.jsx(o.BottomSizeTipRow,e.__assign({"data-testid":"sizing-tip-below-selector"},{children:i.jsx(t.Text,e.__assign({variant:"body",weight:"regular",size:"small"},{children:null==C?void 0:C.tip}),void 0)}),void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=SizeSelector.js.map
|
package/package.json
CHANGED