@trafilea/afrodita-components 7.26.4 → 7.26.5
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/size/selector/SizeSelector.js +1 -1
- package/build/es/components/size/selector/styled.js +1 -1
- package/build/index.d.ts +2 -1
- package/build/lib/components/size/selector/SizeSelector.js +1 -1
- package/build/lib/components/size/selector/styled.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"tslib";import{jsxs as i,jsx as l}from"@emotion/react/jsx-runtime";import{useRef as r}from"react";import{Icon as n}from"../../icons/index.js";import{ComponentSize as o}from"../../../types/enums.js";import t from"../../selector/simple/SelectorSecondary.js";import{Text as a}from"../../text/Text.js";import d from"../guide/SizeFitGuide.js";import{Row as c,ButtonsContainer as s,SizeBadgeWrapper as u,BottomSizeTipRow as m}from"./styled.js";var
|
|
1
|
+
import{__assign as e}from"tslib";import{jsxs as i,jsx as l}from"@emotion/react/jsx-runtime";import{useRef as r}from"react";import{Icon as n}from"../../icons/index.js";import{ComponentSize as o}from"../../../types/enums.js";import t from"../../selector/simple/SelectorSecondary.js";import{Text as a}from"../../text/Text.js";import d from"../guide/SizeFitGuide.js";import{Row as c,ButtonsContainer as s,SizeBadgeWrapper as u,BottomSizeTipRow as m,SizingRecommendationText as v}from"./styled.js";var p=0,f=function(f){var h,g,b=f.label,w=f.sizes,y=f.selectedValue,z=f.onChange,k=f.onClickSizeTip,A=f.inline,S=void 0!==A&&A,x=f.width,j=f.hasSizeGuide,I=void 0!==j&&j,C=f.sizeTipReferences,L=f.hasSizeTipBelowSelector,T=void 0!==L&&L,D=f.optionBadge,R=f.sizingRecommendation,B=r(null);null!==(h=B.current)&&void 0!==h||(B.current="afrodita-size-selector-".concat(++p));var E="".concat(B.current,"-label"),F=I?null==C?void 0:C.find((function(e){return(null==e?void 0:e.size)===(null==y?void 0:y.label)})):null,G=function(e){return"".concat(B.current,"-option-").concat(e.replaceAll(/\s+/g,"-").replaceAll("/","-").toLowerCase())};return i("div",e({css:{display:"flex",flexDirection:S?"row":"column",alignItems:S?"center":"start"}},{children:[i(a,e({variant:"body",weight:"regular",size:"small",css:{alignSelf:S?"start":"inherit",padding:S?"0.75rem 0":"0"},id:E},{children:[b,!S&&l(a,e({variant:"label",weight:"demi",size:"regular"},{children:null==y?void 0:y.description}),void 0)]}),void 0),I&&!T&&!R&&i(c,e({"data-testid":"sizing-tip"},{children:[l(n.Actions.CircleInfo,{width:1.2},void 0),l(a,e({variant:"body",weight:"demi",size:"small",css:{display:"flex"}},{children:"Sizing Tip:"}),void 0),l(a,e({variant:"body",weight:"regular",size:"small"},{children:null==F?void 0:F.tip}),void 0),k&&l(d,{hideIcon:!0,onClick:k,title:null!==(g=null==F?void 0:F.cta)&&void 0!==g?g:"Size and Fit Guide"},void 0)]}),void 0),l(s,e({inline:S,role:"radiogroup","aria-labelledby":E,onKeyDown:function(e){var i;if(["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(e.key)){e.preventDefault();var l=null!==(i=null==w?void 0:w.filter((function(e){return!e.disabled})))&&void 0!==i?i:[];if(l.length){var r=l.findIndex((function(e){return e.label===(null==y?void 0:y.label)})),n=r;"Home"===e.key?n=0:"End"===e.key?n=l.length-1:-1===r?n="ArrowUp"===e.key||"ArrowLeft"===e.key?l.length-1:0:"ArrowRight"===e.key||"ArrowDown"===e.key?n=(n+1)%l.length:"ArrowLeft"!==e.key&&"ArrowUp"!==e.key||(n=(n-1+l.length)%l.length);var o=l[n];o&&o.label!==(null==y?void 0:y.label)&&(z(o),requestAnimationFrame((function(){var e;null===(e=document.getElementById(G(o.label)))||void 0===e||e.focus()})))}}}},{children:null==w?void 0:w.map((function(r){var n=r.label===y.label,a=!r.disabled&&n,d=G(r.label),c=r.description?"".concat(r.label,", ").concat(r.description):r.label,s=(null==D?void 0:D.optionLabel)===r.label,m=l(t,{css:{padding:"0.75rem 1rem 0.625rem",margin:s?0:"0 0.5rem 0.625rem 0",minWidth:"4rem"},size:o.Medium,text:r.label,active:a,disabled:r.disabled,onClick:function(){return z(r)},testId:"size-variant-".concat(r.label.split("/")[0]),width:x,showNoStockStyles:r.noStock,id:d,role:"radio","aria-checked":n,"aria-label":c},r.label);return s?i(u,e({css:{margin:"0 0.5rem 0.625rem 0"}},{children:[D.content,m]}),r.label):m}))}),void 0),I&&T&&!R&&l(m,e({"data-testid":"sizing-tip-below-selector"},{children:l(a,e({variant:"body",weight:"regular",size:"small"},{children:null==F?void 0:F.tip}),void 0)}),void 0),R&&l(v,{dangerouslySetInnerHTML:{__html:R}},void 0)]}),void 0)};export{f as default};
|
|
2
2
|
//# sourceMappingURL=SizeSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__makeTemplateObject as n}from"tslib";import
|
|
1
|
+
import{__makeTemplateObject as n}from"tslib";import a from"@emotion/styled";var i,t,r,e,p,o=a.div(i||(i=n(["\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: ",";\n"],["\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: ",";\n"])),(function(n){return n.inline?"0 0 0 10px":"8px 0 0 0"})),l=a.div(t||(t=n(["\n gap: 5px;\n display: flex;\n margin: 8px 0 0;\n flex-wrap: wrap;\n\n & button {\n font-weight: 600;\n }\n"],["\n gap: 5px;\n display: flex;\n margin: 8px 0 0;\n flex-wrap: wrap;\n\n & button {\n font-weight: 600;\n }\n"]))),f=a.div(r||(r=n(["\n position: relative;\n"],["\n position: relative;\n"]))),x=a.p(e||(e=n(["\n color: var(--neutrals-gray-5503-a-3-a-3-a, #3a3a3a);\n font-family: 'Avenir Next';\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n margin: 0;\n"],["\n color: var(--neutrals-gray-5503-a-3-a-3-a, #3a3a3a);\n font-family: 'Avenir Next';\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n margin: 0;\n"]))),g=a.div(p||(p=n(["\n gap: 5px;\n display: flex;\n margin: 8px 0;\n flex-wrap: wrap;\n\n & button {\n font-weight: 600;\n }\n"],["\n gap: 5px;\n display: flex;\n margin: 8px 0;\n flex-wrap: wrap;\n\n & button {\n font-weight: 600;\n }\n"])));export{g as BottomSizeTipRow,o as ButtonsContainer,l as Row,f as SizeBadgeWrapper,x as SizingRecommendationText};
|
|
2
2
|
//# sourceMappingURL=styled.js.map
|
package/build/index.d.ts
CHANGED
|
@@ -4158,8 +4158,9 @@ interface SizeSelectorProps {
|
|
|
4158
4158
|
sizeTipReferences?: SizeTip[];
|
|
4159
4159
|
hasSizeTipBelowSelector?: boolean;
|
|
4160
4160
|
optionBadge?: SizeOptionBadgeConfig;
|
|
4161
|
+
sizingRecommendation?: string;
|
|
4161
4162
|
}
|
|
4162
|
-
declare const SizeSelector: ({ label, sizes, selectedValue, onChange, onClickSizeTip, inline, width, hasSizeGuide, sizeTipReferences, hasSizeTipBelowSelector, optionBadge, }: SizeSelectorProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
4163
|
+
declare const SizeSelector: ({ label, sizes, selectedValue, onChange, onClickSizeTip, inline, width, hasSizeGuide, sizeTipReferences, hasSizeTipBelowSelector, optionBadge, sizingRecommendation, }: SizeSelectorProps) => _emotion_react_jsx_runtime.JSX.Element;
|
|
4163
4164
|
|
|
4164
4165
|
interface SliderNavigationProps {
|
|
4165
4166
|
children: JSX.Element | JSX.Element[] | StyledComponent<any>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("tslib"),i=require("@emotion/react/jsx-runtime"),
|
|
1
|
+
"use strict";var e=require("tslib"),i=require("@emotion/react/jsx-runtime"),n=require("react"),l=require("../../icons/index.js"),r=require("../../../types/enums.js"),t=require("../../selector/simple/SelectorSecondary.js"),o=require("../../text/Text.js"),a=require("../guide/SizeFitGuide.js"),s=require("./styled.js"),d=0;module.exports=function(c){var u,v,g=c.label,m=c.sizes,h=c.selectedValue,p=c.onChange,b=c.onClickSizeTip,x=c.inline,w=void 0!==x&&x,f=c.width,z=c.hasSizeGuide,y=void 0!==z&&z,_=c.sizeTipReferences,j=c.hasSizeTipBelowSelector,S=void 0!==j&&j,k=c.optionBadge,A=c.sizingRecommendation,T=n.useRef(null);null!==(u=T.current)&&void 0!==u||(T.current="afrodita-size-selector-".concat(++d));var q="".concat(T.current,"-label"),C=y?null==_?void 0:_.find((function(e){return(null==e?void 0:e.size)===(null==h?void 0:h.label)})):null,I=function(e){return"".concat(T.current,"-option-").concat(e.replaceAll(/\s+/g,"-").replaceAll("/","-").toLowerCase())};return i.jsxs("div",e.__assign({css:{display:"flex",flexDirection:w?"row":"column",alignItems:w?"center":"start"}},{children:[i.jsxs(o.Text,e.__assign({variant:"body",weight:"regular",size:"small",css:{alignSelf:w?"start":"inherit",padding:w?"0.75rem 0":"0"},id:q},{children:[g,!w&&i.jsx(o.Text,e.__assign({variant:"label",weight:"demi",size:"regular"},{children:null==h?void 0:h.description}),void 0)]}),void 0),y&&!S&&!A&&i.jsxs(s.Row,e.__assign({"data-testid":"sizing-tip"},{children:[i.jsx(l.Icon.Actions.CircleInfo,{width:1.2},void 0),i.jsx(o.Text,e.__assign({variant:"body",weight:"demi",size:"small",css:{display:"flex"}},{children:"Sizing Tip:"}),void 0),i.jsx(o.Text,e.__assign({variant:"body",weight:"regular",size:"small"},{children:null==C?void 0:C.tip}),void 0),b&&i.jsx(a,{hideIcon:!0,onClick:b,title:null!==(v=null==C?void 0:C.cta)&&void 0!==v?v:"Size and Fit Guide"},void 0)]}),void 0),i.jsx(s.ButtonsContainer,e.__assign({inline:w,role:"radiogroup","aria-labelledby":q,onKeyDown:function(e){var i;if(["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(e.key)){e.preventDefault();var n=null!==(i=null==m?void 0:m.filter((function(e){return!e.disabled})))&&void 0!==i?i:[];if(n.length){var l=n.findIndex((function(e){return e.label===(null==h?void 0:h.label)})),r=l;"Home"===e.key?r=0:"End"===e.key?r=n.length-1:-1===l?r="ArrowUp"===e.key||"ArrowLeft"===e.key?n.length-1:0:"ArrowRight"===e.key||"ArrowDown"===e.key?r=(r+1)%n.length:"ArrowLeft"!==e.key&&"ArrowUp"!==e.key||(r=(r-1+n.length)%n.length);var t=n[r];t&&t.label!==(null==h?void 0:h.label)&&(p(t),requestAnimationFrame((function(){var e;null===(e=document.getElementById(I(t.label)))||void 0===e||e.focus()})))}}}},{children:null==m?void 0:m.map((function(n){var l=n.label===h.label,o=!n.disabled&&l,a=I(n.label),d=n.description?"".concat(n.label,", ").concat(n.description):n.label,c=(null==k?void 0:k.optionLabel)===n.label,u=i.jsx(t,{css:{padding:"0.75rem 1rem 0.625rem",margin:c?0:"0 0.5rem 0.625rem 0",minWidth:"4rem"},size:r.ComponentSize.Medium,text:n.label,active:o,disabled:n.disabled,onClick:function(){return p(n)},testId:"size-variant-".concat(n.label.split("/")[0]),width:f,showNoStockStyles:n.noStock,id:a,role:"radio","aria-checked":l,"aria-label":d},n.label);return c?i.jsxs(s.SizeBadgeWrapper,e.__assign({css:{margin:"0 0.5rem 0.625rem 0"}},{children:[k.content,u]}),n.label):u}))}),void 0),y&&S&&!A&&i.jsx(s.BottomSizeTipRow,e.__assign({"data-testid":"sizing-tip-below-selector"},{children:i.jsx(o.Text,e.__assign({variant:"body",weight:"regular",size:"small"},{children:null==C?void 0:C.tip}),void 0)}),void 0),A&&i.jsx(s.SizingRecommendationText,{dangerouslySetInnerHTML:{__html:A}},void 0)]}),void 0)};
|
|
2
2
|
//# sourceMappingURL=SizeSelector.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib");function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t,a,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("tslib");function e(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var t,a,i,r,p,o=e(require("@emotion/styled")),l=o.default.div(t||(t=n.__makeTemplateObject(["\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: ",";\n"],["\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n margin: ",";\n"])),(function(n){return n.inline?"0 0 0 10px":"8px 0 0 0"})),f=o.default.div(a||(a=n.__makeTemplateObject(["\n gap: 5px;\n display: flex;\n margin: 8px 0 0;\n flex-wrap: wrap;\n\n & button {\n font-weight: 600;\n }\n"],["\n gap: 5px;\n display: flex;\n margin: 8px 0 0;\n flex-wrap: wrap;\n\n & button {\n font-weight: 600;\n }\n"]))),x=o.default.div(i||(i=n.__makeTemplateObject(["\n position: relative;\n"],["\n position: relative;\n"]))),m=o.default.p(r||(r=n.__makeTemplateObject(["\n color: var(--neutrals-gray-5503-a-3-a-3-a, #3a3a3a);\n font-family: 'Avenir Next';\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n margin: 0;\n"],["\n color: var(--neutrals-gray-5503-a-3-a-3-a, #3a3a3a);\n font-family: 'Avenir Next';\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n margin: 0;\n"]))),s=o.default.div(p||(p=n.__makeTemplateObject(["\n gap: 5px;\n display: flex;\n margin: 8px 0;\n flex-wrap: wrap;\n\n & button {\n font-weight: 600;\n }\n"],["\n gap: 5px;\n display: flex;\n margin: 8px 0;\n flex-wrap: wrap;\n\n & button {\n font-weight: 600;\n }\n"])));exports.BottomSizeTipRow=s,exports.ButtonsContainer=l,exports.Row=f,exports.SizeBadgeWrapper=x,exports.SizingRecommendationText=m;
|
|
2
2
|
//# sourceMappingURL=styled.js.map
|
package/package.json
CHANGED