@faststore/ui 1.3.19 → 1.3.20
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/CHANGELOG.md +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/molecules/Banner/Banner.d.ts +13 -0
- package/dist/molecules/Banner/BannerContent.d.ts +10 -0
- package/dist/molecules/Banner/BannerImage.d.ts +10 -0
- package/dist/molecules/Banner/BannerLink.d.ts +10 -0
- package/dist/molecules/Banner/index.d.ts +8 -0
- package/dist/molecules/Banner/stories/Banner.stories.d.ts +4 -0
- package/dist/ui.cjs.development.js +12 -0
- package/dist/ui.cjs.development.js.map +1 -1
- package/dist/ui.cjs.production.min.js +1 -1
- package/dist/ui.cjs.production.min.js.map +1 -1
- package/dist/ui.esm.js +12 -1
- package/dist/ui.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +3 -0
- package/src/molecules/Banner/Banner.test.tsx +63 -0
- package/src/molecules/Banner/Banner.tsx +26 -0
- package/src/molecules/Banner/BannerContent.tsx +31 -0
- package/src/molecules/Banner/BannerImage.tsx +29 -0
- package/src/molecules/Banner/BannerLink.tsx +29 -0
- package/src/molecules/Banner/index.ts +11 -0
- package/src/molecules/Banner/stories/Banner.mdx +63 -0
- package/src/molecules/Banner/stories/Banner.stories.tsx +66 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),r=e(t),a=require("@reach/popover"),n=e(a),o=require("react-swipeable"),s=require("react-dom"),i=require("tabbable");const l=t.forwardRef((function({children:e,testId:t="store-button",...a},n){return r.createElement("button",Object.assign({ref:n,"data-store-button":!0,"data-testid":t},a),e)})),d=t.forwardRef((function({variant:e,testId:t="store-input",...a},n){return r.createElement("input",Object.assign({ref:n,"data-store-input":!0,"data-testid":t},{"data-error":"error"===e||void 0,"data-success":"success"===e||void 0},a))})),c=t.forwardRef((function({component:e,testId:t="store-icon",...a},n){return r.createElement("span",Object.assign({ref:n,"data-store-icon":!0,"data-testid":t},a),e)})),u=t.forwardRef((function({as:e="span",testId:t="store-price",value:a,formatter:n=(e=>e),variant:o="selling",...s},i){const l=n(a,o);return r.createElement(e,Object.assign({ref:i,"data-store-price":!0,"data-testid":t,"data-variant":o},s),l)})),f=t.forwardRef((function({variant:e,testId:t="store-textarea",...a},n){return r.createElement("textarea",Object.assign({ref:n,"data-store-textarea":!0,"data-testid":t},{"data-success":"success"===e||void 0,"data-error":"error"===e||void 0},a))})),m=t.forwardRef((function({testId:e="store-checkbox",...t},a){return r.createElement("input",Object.assign({ref:a,"data-store-checkbox":!0,"data-testid":e,type:"checkbox"},t))})),p=t.forwardRef((function({testId:e="store-overlay",...t},a){return r.createElement("div",Object.assign({role:"presentation","data-store-overlay":!0,"data-testid":e,ref:a},t))})),b=t.forwardRef((function({children:e,testId:t="store-select",...a},n){return r.createElement("select",Object.assign({ref:n,"data-store-select":!0,"data-testid":t},a),e)})),g=t.forwardRef((function({testId:e="store-radio",...t},a){return r.createElement("input",Object.assign({ref:a,"data-store-radio":!0,"data-testid":e,type:"radio"},t))})),h=t.forwardRef((function({testId:e="store-badge",children:t},a){return r.createElement("div",{ref:a,"data-testid":e,"data-store-badge":!0},t)})),E=t.forwardRef((function({testId:e="store-list",variant:t="unordered",as:a,...n},o){const s={"data-testid":e,"data-store-list":!0,["data-"+t]:!0},i=null!=a?a:(e=>{switch(e){case"description":return"dl";case"unordered":return"ul";case"ordered":return"ol";default:return"ul"}})(t);return r.createElement(i,Object.assign({ref:o},s,n))})),v=t.forwardRef((function({testId:e="store-skeleton",...t},a){return r.createElement("div",Object.assign({ref:a,"data-store-skeleton":!0,"data-testid":e},t))})),x=t.forwardRef((function({testId:e="store-spinner",...t},a){return r.createElement("span",Object.assign({ref:a,"data-store-spinner":!0,"data-testid":e},t))})),w=t.forwardRef((function({testId:e="store-label",children:t,...a},n){return r.createElement("label",Object.assign({ref:n,"data-store-label":!0,"data-testid":e},a),t)})),I=(e,t)=>t?"Current page":"Go to page "+(e+1),y=t.forwardRef((function({totalQuantity:e,activeBullet:a,onClick:n,testId:o="store-bullets",ariaLabelGenerator:s=I,ariaControlsGenerator:i,...d},c){const u=t.useMemo(()=>Array(e).fill(0),[e]);return r.createElement("div",Object.assign({ref:c,"data-store-bullets":!0,"data-testid":o,role:"tablist"},d),u.map((e,t)=>{const d=a===t;return r.createElement(l,{"data-bullet-item":!0,role:"tab",tabIndex:-1,key:t,testId:o+"-item",onClick:e=>n(e,t),"aria-label":s(t,d),"aria-controls":null==i?void 0:i(t),"aria-selected":d})}))})),P=t.forwardRef((function({testId:e="store-form",children:t,...a},n){return r.createElement("form",Object.assign({ref:n,"data-store-form":!0,"data-testid":e},a),t)})),R=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("circle",{cx:"11",cy:"11",r:"8"}),r.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),O=t.forwardRef((function({onSubmit:e,icon:a,"aria-label":n="search",testId:o="store-search-input",...s},i){const u=t.useRef(null);return r.createElement(P,{ref:i,"data-store-search-input":!0,"data-testid":o,onSubmit:t=>{var r;t.preventDefault(),""!==(null==(r=u.current)?void 0:r.value)&&e(u.current.value)}},r.createElement(d,Object.assign({ref:u,"aria-label":n},s)),r.createElement(l,{type:"submit","aria-label":"button-"+n},r.createElement(c,{component:null!=a?a:r.createElement(R,null)})))})),k=({size:e={width:25,height:25},viewBox:t="0 0 16 16",color:a="currentColor"})=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:t,width:e.width,height:e.height},r.createElement("path",{d:"M11 1L4 8L11 15",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round",stroke:a,fill:"none"})),j=({size:e={width:25,height:25},viewBox:t="0 0 16 16",color:a="currentColor"})=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:t,width:e.width,height:e.height},r.createElement("path",{d:"M5 15L12 8L5 1",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round",stroke:a,fill:"none"}));function S(e,t){switch(t.type){case"NEXT_PAGE":{const t=e.infinite?e.totalPages+1:e.totalPages,r=(e.currentPage+1)%t,a=r%t*e.itemsPerPage;return{...e,sliding:!0,slideDirection:"next",currentItem:a,currentPage:r}}case"PREVIOUS_PAGE":{const t=e.infinite?e.totalPages+1:e.totalPages,r=e.infinite&&0===e.currentPage?-1:((e,t)=>(t-(t-e+1)%t)%t)(e.currentPage,e.totalPages);return{...e,sliding:!0,slideDirection:"previous",currentItem:r%t*e.itemsPerPage,currentPage:r}}case"GO_TO_PAGE":return t.payload.pageIndex===e.currentPage?e:{...e,sliding:t.payload.shouldSlide,slideDirection:t.payload.pageIndex>e.currentPage?"next":"previous",currentItem:t.payload.pageIndex%e.totalPages*e.itemsPerPage,currentPage:t.payload.pageIndex};case"STOP_SLIDE":return{...e,sliding:!1};default:return e}}const C=(e,t)=>{"next"===e&&t({type:"NEXT_PAGE"}),"previous"===e&&t({type:"PREVIOUS_PAGE"}),"number"==typeof e&&t({type:"GO_TO_PAGE",payload:{pageIndex:e,shouldSlide:!0}})};function A({totalItems:e,itemsPerPage:r=1,infiniteMode:a=!1,...n}){const[s,i]=t.useReducer(S,void 0,()=>((e,t,r)=>({currentItem:0,currentPage:0,sliding:!1,slideDirection:"next",totalItems:e,itemsPerPage:t,totalPages:Math.ceil(e/t),infinite:r}))(e,r,a));return{handlers:o.useSwipeable({onSwipedRight:()=>C("previous",i),onSwipedLeft:()=>C("next",i),preventDefaultTouchmoveEvent:!0,trackMouse:!0,...n}),slide:C,sliderState:s,sliderDispatch:i}}const D=t.forwardRef((function({icon:e,testId:t="store-icon-button",...a},n){return r.createElement(l,Object.assign({ref:n,"data-store-icon-button":!0,testId:t},a),r.createElement(c,{component:e}))})),L=({beforeElementRef:e,trapFocusRef:t,afterElementRef:a,testId:n="store-modal-content",children:o,...s})=>r.createElement(r.Fragment,null,r.createElement("div",{ref:e,"data-testid":"beforeElement",tabIndex:0,"aria-hidden":"true"}),r.createElement("div",Object.assign({"data-store-modal-content":!0},s,{"data-testid":n,ref:t,"aria-modal":"true",role:"dialog",tabIndex:-1}),o),r.createElement("div",{ref:a,"data-testid":"afterElement",tabIndex:0,"aria-hidden":"true"})),T=({children:e,...a})=>{const n=t.useRef(null),o=t.useRef(null),s=t.useRef(null);return(({trapFocusRef:e,beforeElementRef:r,afterElementRef:a})=>{const n=t.useRef(),o=t.useRef(document.hasFocus()?document.activeElement:null);t.useEffect(()=>{const e=o.current;return()=>{null==e||e.focus()}},[o]),t.useEffect(()=>{if(!e.current)return;n.current||(n.current=i.tabbable(e.current));const[t]=n.current;t?t.focus():e.current.focus()},[e]),t.useEffect(()=>{if(!e.current||!r.current||!a.current)return;const t=r.current,o=a.current,s=e.current,l=r=>{var a,l;document.hasFocus()&&(n.current=i.tabbable(e.current),n.current.length||s.focus(),r.target===t&&(null==(a=n.current[n.current.length-1])||a.focus()),r.target===o&&(null==(l=n.current[0])||l.focus()))};return null==t||t.addEventListener("focusin",l),null==o||o.addEventListener("focusin",l),()=>{null==t||t.removeEventListener("focusin",l),null==o||o.removeEventListener("focusin",l)}},[n,a,r,e])})({beforeElementRef:o,trapFocusRef:n,afterElementRef:s}),r.createElement(L,Object.assign({},a,{trapFocusRef:n,beforeElementRef:o,afterElementRef:s,onClick:e=>{e.stopPropagation()}}),e)},M=t.forwardRef((function({testId:e="store-payment-methods",title:t,"aria-label":a="Payment Methods",children:n,...o},s){return r.createElement("div",Object.assign({ref:s,"data-store-payment-methods":!0,"data-testid":e},o),!!t&&r.createElement("div",{id:"payment-methods"},t),r.createElement("div",{"data-payment-methods-flags":!0,"aria-labelledby":t?"payment-methods":void 0,"aria-label":t?void 0:a},n))})),B=t.createContext(void 0),G=t.forwardRef((function({testId:e="store-accordion",indices:a,onChange:n,children:o,...s},i){const l=r.Children.map(o,(e,r)=>{var a;return t.cloneElement(e,{index:null!=(a=e.props.index)?a:r})}),d={indices:new Set(a),onChange:n,numberOfItems:l.length};return r.createElement(B.Provider,{value:d},r.createElement("div",Object.assign({ref:i,"data-store-accordion":!0,"data-testid":e,role:"region"},s),l))}));function _(){const e=t.useContext(B);if(void 0===e)throw new Error("Do not use Accordion components outside the Accordion context.");return e}const N=t.createContext(void 0),F=t.forwardRef((function({testId:e="store-accordion-item",children:t,index:a=0,...n},o){return r.createElement(N.Provider,{value:{index:a,panel:"panel--"+a,button:"button--"+a}},r.createElement("div",Object.assign({ref:o,"data-store-accordion-item":!0,"data-testid":e},n),t))}));function q(){const e=t.useContext(N);if(void 0===e)throw new Error("Do not use AccordionItem components outside the AccordionItem context.");return e}const V=t.forwardRef((function({testId:e="store-accordion-button",children:t,...a},n){const{indices:o,onChange:s,numberOfItems:i}=_(),{index:d,panel:c,button:u}=q();return r.createElement(l,Object.assign({ref:n,id:u,"aria-expanded":o.has(d),"aria-controls":c,"data-store-accordion-button":!0,"data-testid":e,onKeyDown:e=>{var t,r;if(["ArrowDown","ArrowUp"].includes(e.key))switch(e.key){case"ArrowDown":e.preventDefault(),null==(t=(()=>{const e=Number(d)+1===i?0:Number(d)+1;return document.getElementById("button--"+e)})())||t.focus();break;case"ArrowUp":e.preventDefault(),null==(r=(()=>{const e=Number(d)-1<0?i-1:Number(d)-1;return document.getElementById("button--"+e)})())||r.focus()}},onClick:()=>{s(d)}},a),t)})),$=t.forwardRef((function({testId:e="store-accordion-panel",children:t,...a},n){const{indices:o}=_(),{index:s,button:i,panel:l}=q();return r.createElement("div",Object.assign({ref:n,id:l,"aria-labelledby":i,role:"region","data-store-accordion-panel":!0,"data-testid":e,hidden:!o.has(s)},a),t)})),U=t.forwardRef((function({testId:e="store-table",children:t,...a},n){return r.createElement("table",Object.assign({ref:n,"data-store-table":!0,"data-testid":e},a),t)})),X=t.forwardRef((function({testId:e="store-table-row",children:t,...a},n){return r.createElement("tr",Object.assign({ref:n,"data-store-table-row":!0,"data-testid":e},a),t)})),K=t.forwardRef((function({testId:e="store-table-cell",children:t,variant:a="data",scope:n,...o},s){return r.createElement("header"===a?"th":"td",Object.assign({ref:s,"data-store-table-cell":a,"data-testid":e,scope:n},o),t)})),W=t.forwardRef((function({children:e,testId:t="store-table-body",...a},n){return r.createElement("tbody",Object.assign({ref:n,"data-testid":t,"data-store-table-body":!0},a),e)})),z=t.forwardRef((function({children:e,testId:t="store-table-head",...a},n){return r.createElement("thead",Object.assign({ref:n,"data-testid":t,"data-store-table-head":!0},a),e)})),H=t.forwardRef((function({children:e,testId:t="store-table-footer",...a},n){return r.createElement("tfoot",Object.assign({ref:n,"data-testid":t,"data-store-table-footer":!0},a),e)})),Q=t.forwardRef((function({testId:e="store-alert",children:t,...a},n){return r.createElement("div",Object.assign({ref:n,role:"alert","data-store-alert":!0,"data-testid":e},a),t)}));exports.Accordion=G,exports.AccordionButton=V,exports.AccordionItem=F,exports.AccordionPanel=$,exports.Alert=Q,exports.Badge=h,exports.Bullets=y,exports.Button=l,exports.Carousel=function({infiniteMode:e=!0,controls:a="complete",testId:n="store-carousel",transition:o={duration:400,property:"transform"},children:s,id:i="store-carousel",...l}){var d,c;const u=r.Children.toArray(s),f=u.length,m=e?f+2:f,p=`${o.property} ${o.duration}ms ${null!=(d=o.timing)?d:""} ${null!=(c=o.delay)?c:""}`,b="complete"===a||"navigationArrows"===a,g="complete"===a||"paginationBullets"===a,h=t.useMemo(()=>((e,t)=>{const r={},a=100/t;for(let n=0;n<t;++n)r[e?n-1:n]=-a*n;return r})(e,m),[m,e]),{handlers:E,slide:v,sliderState:x,sliderDispatch:w}=A({totalItems:f,itemsPerPage:1,infiniteMode:e,...l}),{isItemVisible:I,shouldRenderItem:P}=function({currentSlide:e,itemsPerPage:r,totalItems:a}){const n=t.useRef(new Set);t.useEffect(()=>{for(let t=0;t<r;t++)n.current.add(e+t)},[e,r]);const o=t=>function({itemsPerPage:e,currentSlide:t,slideIdx:r,totalItems:a}){return t<0||t>=a||r>=t&&r<t+e}({slideIdx:t,currentSlide:e,itemsPerPage:r,totalItems:a});return{shouldRenderItem:e=>n.current.has(e)||o(e),isItemVisible:o}}({itemsPerPage:x.itemsPerPage,currentSlide:x.currentItem,totalItems:f}),R=e&&s?u.slice(0,1):[],O=(e&&s?u.slice(f-1):[]).concat(null!=s?s:[],R),S=()=>{x.sliding||!e&&0===x.currentPage||v("previous",w)},C=()=>{x.sliding||!e&&x.currentPage===f-1||v("next",w)};return r.createElement("section",{id:i,"data-store-carousel":!0,"data-testid":n,"aria-label":"carousel","aria-roledescription":"carousel"},r.createElement("div",Object.assign({"data-carousel-track-container":!0,style:{overflow:"hidden",width:"100%"}},E),r.createElement("div",{"data-carousel-track":!0,style:{display:"flex",transition:x.sliding?p:void 0,width:100*m+"%",transform:`translate3d(${h[x.currentPage]}%, 0, 0)`},onTransitionEnd:()=>{w({type:"STOP_SLIDE"}),x.currentItem>=f&&w({type:"GO_TO_PAGE",payload:{pageIndex:0,shouldSlide:!1}}),x.currentItem<0&&w({type:"GO_TO_PAGE",payload:{pageIndex:x.totalPages-1,shouldSlide:!1}})},"aria-live":"polite"},O.map((t,a)=>r.createElement("div",{role:"tabpanel","aria-roledescription":"slide",key:a,id:"carousel-item-"+a,"data-carousel-item":!0,style:{width:"100%"},"data-visible":I(a-Number(e))||void 0},P(a-Number(e))?t:null)))),b&&r.createElement("div",{"data-carousel-controls":!0},r.createElement(D,{"data-arrow":"left","aria-controls":i,"aria-label":"previous",onClick:S,icon:r.createElement(k,null)}),r.createElement(D,{"data-arrow":"right","aria-controls":i,"aria-label":"next",onClick:C,icon:r.createElement(j,null)})),g&&r.createElement("div",{"data-carousel-bullets":!0},r.createElement(y,{tabIndex:0,totalQuantity:f,activeBullet:x.currentPage,onClick:(e,t)=>{x.sliding||v(t,w)},ariaControlsGenerator:e=>"carousel-item-"+e,onKeyDown:e=>{switch(e.key){case"ArrowLeft":S();break;case"ArrowRight":C();break;case"Home":v(0,w);break;case"End":v(f-1,w)}},onFocus:e=>{e.currentTarget.focus()}})))},exports.Checkbox=m,exports.Form=P,exports.Icon=c,exports.IconButton=D,exports.Input=d,exports.Label=w,exports.List=E,exports.Modal=({isOpen:e,children:t,onDismiss:a,testId:n="store-modal",...o})=>e?s.createPortal(r.createElement(p,{"data-modal-overlay":!0,onClick:e=>{e.defaultPrevented||(e.stopPropagation(),null==a||a(e))},onKeyDown:e=>{"Escape"!==e.key||e.defaultPrevented||(e.stopPropagation(),null==a||a(e))}},r.createElement(T,Object.assign({},o,{testId:n}),t)),document.body):null,exports.Overlay=p,exports.PaymentMethods=M,exports.Popover=({targetRef:e,testId:t="store-popover",children:o,...s})=>r.createElement(n,Object.assign({"data-store-popover":!0,"data-testid":t,position:a.positionDefault,targetRef:e},s),o),exports.Price=u,exports.Radio=g,exports.SearchInput=O,exports.Select=b,exports.Skeleton=v,exports.Slider=({min:e,max:a,onChange:n,testId:o="store-slider",getAriaValueText:s,className:i})=>{const[l,d]=t.useState(e),[c,u]=t.useState(a),f=t.useRef(e),m=t.useRef(a),p=t.useRef(null),b=t.useCallback(t=>Math.round((t-e)/(a-e)*100),[e,a]);return t.useEffect(()=>{const e=b(l),t=b(m.current);p.current&&(p.current.style.left=e+"%",p.current.style.width=t-e+"%")},[l,b]),t.useEffect(()=>{const e=b(f.current),t=b(c);p.current&&(p.current.style.width=t-e+"%")},[c,b]),t.useEffect(()=>{null==n||n({min:l,max:c})},[l,c,n]),r.createElement("div",{"data-store-slider":!0,"data-testid":o,className:i},r.createElement("div",{ref:p,"data-store-slider-range":!0}),r.createElement("input",{type:"range",min:e,max:a,value:l,onChange:e=>{const t=Math.min(Number(e.target.value),c-1);d(t),f.current=t},"data-store-slider-thumb":"left","aria-valuemin":e,"aria-valuemax":a,"aria-valuenow":l,"aria-label":String(l),"aria-labelledby":s?s(l,"min"):void 0}),r.createElement("input",{type:"range",min:e,max:a,value:c,onChange:e=>{const t=Math.max(Number(e.target.value),l+1);u(t),m.current=t},"data-store-slider-thumb":"right","aria-valuemin":e,"aria-valuemax":a,"aria-valuenow":c,"aria-label":String(c),"aria-labelledby":s?s(c,"max"):void 0}))},exports.Spinner=x,exports.Table=U,exports.TableBody=W,exports.TableCell=K,exports.TableFooter=H,exports.TableHead=z,exports.TableRow=X,exports.TextArea=f,exports.useSlider=A;
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),r=e(t),a=require("@reach/popover"),n=e(a),o=require("react-swipeable"),s=require("react-dom"),i=require("tabbable");const l=t.forwardRef((function({children:e,testId:t="store-button",...a},n){return r.createElement("button",Object.assign({ref:n,"data-store-button":!0,"data-testid":t},a),e)})),d=t.forwardRef((function({variant:e,testId:t="store-input",...a},n){return r.createElement("input",Object.assign({ref:n,"data-store-input":!0,"data-testid":t},{"data-error":"error"===e||void 0,"data-success":"success"===e||void 0},a))})),c=t.forwardRef((function({component:e,testId:t="store-icon",...a},n){return r.createElement("span",Object.assign({ref:n,"data-store-icon":!0,"data-testid":t},a),e)})),u=t.forwardRef((function({as:e="span",testId:t="store-price",value:a,formatter:n=(e=>e),variant:o="selling",...s},i){const l=n(a,o);return r.createElement(e,Object.assign({ref:i,"data-store-price":!0,"data-testid":t,"data-variant":o},s),l)})),f=t.forwardRef((function({variant:e,testId:t="store-textarea",...a},n){return r.createElement("textarea",Object.assign({ref:n,"data-store-textarea":!0,"data-testid":t},{"data-success":"success"===e||void 0,"data-error":"error"===e||void 0},a))})),m=t.forwardRef((function({testId:e="store-checkbox",...t},a){return r.createElement("input",Object.assign({ref:a,"data-store-checkbox":!0,"data-testid":e,type:"checkbox"},t))})),p=t.forwardRef((function({testId:e="store-overlay",...t},a){return r.createElement("div",Object.assign({role:"presentation","data-store-overlay":!0,"data-testid":e,ref:a},t))})),b=t.forwardRef((function({children:e,testId:t="store-select",...a},n){return r.createElement("select",Object.assign({ref:n,"data-store-select":!0,"data-testid":t},a),e)})),g=t.forwardRef((function({testId:e="store-radio",...t},a){return r.createElement("input",Object.assign({ref:a,"data-store-radio":!0,"data-testid":e,type:"radio"},t))})),h=t.forwardRef((function({testId:e="store-badge",children:t},a){return r.createElement("div",{ref:a,"data-testid":e,"data-store-badge":!0},t)})),v=t.forwardRef((function({testId:e="store-list",variant:t="unordered",as:a,...n},o){const s={"data-testid":e,"data-store-list":!0,["data-"+t]:!0},i=null!=a?a:(e=>{switch(e){case"description":return"dl";case"unordered":return"ul";case"ordered":return"ol";default:return"ul"}})(t);return r.createElement(i,Object.assign({ref:o},s,n))})),E=t.forwardRef((function({testId:e="store-skeleton",...t},a){return r.createElement("div",Object.assign({ref:a,"data-store-skeleton":!0,"data-testid":e},t))})),x=t.forwardRef((function({testId:e="store-spinner",...t},a){return r.createElement("span",Object.assign({ref:a,"data-store-spinner":!0,"data-testid":e},t))})),w=t.forwardRef((function({testId:e="store-label",children:t,...a},n){return r.createElement("label",Object.assign({ref:n,"data-store-label":!0,"data-testid":e},a),t)})),I=(e,t)=>t?"Current page":"Go to page "+(e+1),y=t.forwardRef((function({totalQuantity:e,activeBullet:a,onClick:n,testId:o="store-bullets",ariaLabelGenerator:s=I,ariaControlsGenerator:i,...d},c){const u=t.useMemo(()=>Array(e).fill(0),[e]);return r.createElement("div",Object.assign({ref:c,"data-store-bullets":!0,"data-testid":o,role:"tablist"},d),u.map((e,t)=>{const d=a===t;return r.createElement(l,{"data-bullet-item":!0,role:"tab",tabIndex:-1,key:t,testId:o+"-item",onClick:e=>n(e,t),"aria-label":s(t,d),"aria-controls":null==i?void 0:i(t),"aria-selected":d})}))})),P=t.forwardRef((function({testId:e="store-form",children:t,...a},n){return r.createElement("form",Object.assign({ref:n,"data-store-form":!0,"data-testid":e},a),t)})),R=()=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("circle",{cx:"11",cy:"11",r:"8"}),r.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})),O=t.forwardRef((function({onSubmit:e,icon:a,"aria-label":n="search",testId:o="store-search-input",...s},i){const u=t.useRef(null);return r.createElement(P,{ref:i,"data-store-search-input":!0,"data-testid":o,onSubmit:t=>{var r;t.preventDefault(),""!==(null==(r=u.current)?void 0:r.value)&&e(u.current.value)}},r.createElement(d,Object.assign({ref:u,"aria-label":n},s)),r.createElement(l,{type:"submit","aria-label":"button-"+n},r.createElement(c,{component:null!=a?a:r.createElement(R,null)})))})),k=({size:e={width:25,height:25},viewBox:t="0 0 16 16",color:a="currentColor"})=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:t,width:e.width,height:e.height},r.createElement("path",{d:"M11 1L4 8L11 15",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round",stroke:a,fill:"none"})),j=({size:e={width:25,height:25},viewBox:t="0 0 16 16",color:a="currentColor"})=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:t,width:e.width,height:e.height},r.createElement("path",{d:"M5 15L12 8L5 1",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round",stroke:a,fill:"none"}));function S(e,t){switch(t.type){case"NEXT_PAGE":{const t=e.infinite?e.totalPages+1:e.totalPages,r=(e.currentPage+1)%t,a=r%t*e.itemsPerPage;return{...e,sliding:!0,slideDirection:"next",currentItem:a,currentPage:r}}case"PREVIOUS_PAGE":{const t=e.infinite?e.totalPages+1:e.totalPages,r=e.infinite&&0===e.currentPage?-1:((e,t)=>(t-(t-e+1)%t)%t)(e.currentPage,e.totalPages);return{...e,sliding:!0,slideDirection:"previous",currentItem:r%t*e.itemsPerPage,currentPage:r}}case"GO_TO_PAGE":return t.payload.pageIndex===e.currentPage?e:{...e,sliding:t.payload.shouldSlide,slideDirection:t.payload.pageIndex>e.currentPage?"next":"previous",currentItem:t.payload.pageIndex%e.totalPages*e.itemsPerPage,currentPage:t.payload.pageIndex};case"STOP_SLIDE":return{...e,sliding:!1};default:return e}}const C=(e,t)=>{"next"===e&&t({type:"NEXT_PAGE"}),"previous"===e&&t({type:"PREVIOUS_PAGE"}),"number"==typeof e&&t({type:"GO_TO_PAGE",payload:{pageIndex:e,shouldSlide:!0}})};function A({totalItems:e,itemsPerPage:r=1,infiniteMode:a=!1,...n}){const[s,i]=t.useReducer(S,void 0,()=>((e,t,r)=>({currentItem:0,currentPage:0,sliding:!1,slideDirection:"next",totalItems:e,itemsPerPage:t,totalPages:Math.ceil(e/t),infinite:r}))(e,r,a));return{handlers:o.useSwipeable({onSwipedRight:()=>C("previous",i),onSwipedLeft:()=>C("next",i),preventDefaultTouchmoveEvent:!0,trackMouse:!0,...n}),slide:C,sliderState:s,sliderDispatch:i}}const D=t.forwardRef((function({icon:e,testId:t="store-icon-button",...a},n){return r.createElement(l,Object.assign({ref:n,"data-store-icon-button":!0,testId:t},a),r.createElement(c,{component:e}))})),L=({beforeElementRef:e,trapFocusRef:t,afterElementRef:a,testId:n="store-modal-content",children:o,...s})=>r.createElement(r.Fragment,null,r.createElement("div",{ref:e,"data-testid":"beforeElement",tabIndex:0,"aria-hidden":"true"}),r.createElement("div",Object.assign({"data-store-modal-content":!0},s,{"data-testid":n,ref:t,"aria-modal":"true",role:"dialog",tabIndex:-1}),o),r.createElement("div",{ref:a,"data-testid":"afterElement",tabIndex:0,"aria-hidden":"true"})),T=({children:e,...a})=>{const n=t.useRef(null),o=t.useRef(null),s=t.useRef(null);return(({trapFocusRef:e,beforeElementRef:r,afterElementRef:a})=>{const n=t.useRef(),o=t.useRef(document.hasFocus()?document.activeElement:null);t.useEffect(()=>{const e=o.current;return()=>{null==e||e.focus()}},[o]),t.useEffect(()=>{if(!e.current)return;n.current||(n.current=i.tabbable(e.current));const[t]=n.current;t?t.focus():e.current.focus()},[e]),t.useEffect(()=>{if(!e.current||!r.current||!a.current)return;const t=r.current,o=a.current,s=e.current,l=r=>{var a,l;document.hasFocus()&&(n.current=i.tabbable(e.current),n.current.length||s.focus(),r.target===t&&(null==(a=n.current[n.current.length-1])||a.focus()),r.target===o&&(null==(l=n.current[0])||l.focus()))};return null==t||t.addEventListener("focusin",l),null==o||o.addEventListener("focusin",l),()=>{null==t||t.removeEventListener("focusin",l),null==o||o.removeEventListener("focusin",l)}},[n,a,r,e])})({beforeElementRef:o,trapFocusRef:n,afterElementRef:s}),r.createElement(L,Object.assign({},a,{trapFocusRef:n,beforeElementRef:o,afterElementRef:s,onClick:e=>{e.stopPropagation()}}),e)},M=t.forwardRef((function({testId:e="store-payment-methods",title:t,"aria-label":a="Payment Methods",children:n,...o},s){return r.createElement("div",Object.assign({ref:s,"data-store-payment-methods":!0,"data-testid":e},o),!!t&&r.createElement("div",{id:"payment-methods"},t),r.createElement("div",{"data-payment-methods-flags":!0,"aria-labelledby":t?"payment-methods":void 0,"aria-label":t?void 0:a},n))})),B=t.createContext(void 0),G=t.forwardRef((function({testId:e="store-accordion",indices:a,onChange:n,children:o,...s},i){const l=r.Children.map(o,(e,r)=>{var a;return t.cloneElement(e,{index:null!=(a=e.props.index)?a:r})}),d={indices:new Set(a),onChange:n,numberOfItems:l.length};return r.createElement(B.Provider,{value:d},r.createElement("div",Object.assign({ref:i,"data-store-accordion":!0,"data-testid":e,role:"region"},s),l))}));function _(){const e=t.useContext(B);if(void 0===e)throw new Error("Do not use Accordion components outside the Accordion context.");return e}const N=t.createContext(void 0),F=t.forwardRef((function({testId:e="store-accordion-item",children:t,index:a=0,...n},o){return r.createElement(N.Provider,{value:{index:a,panel:"panel--"+a,button:"button--"+a}},r.createElement("div",Object.assign({ref:o,"data-store-accordion-item":!0,"data-testid":e},n),t))}));function q(){const e=t.useContext(N);if(void 0===e)throw new Error("Do not use AccordionItem components outside the AccordionItem context.");return e}const V=t.forwardRef((function({testId:e="store-accordion-button",children:t,...a},n){const{indices:o,onChange:s,numberOfItems:i}=_(),{index:d,panel:c,button:u}=q();return r.createElement(l,Object.assign({ref:n,id:u,"aria-expanded":o.has(d),"aria-controls":c,"data-store-accordion-button":!0,"data-testid":e,onKeyDown:e=>{var t,r;if(["ArrowDown","ArrowUp"].includes(e.key))switch(e.key){case"ArrowDown":e.preventDefault(),null==(t=(()=>{const e=Number(d)+1===i?0:Number(d)+1;return document.getElementById("button--"+e)})())||t.focus();break;case"ArrowUp":e.preventDefault(),null==(r=(()=>{const e=Number(d)-1<0?i-1:Number(d)-1;return document.getElementById("button--"+e)})())||r.focus()}},onClick:()=>{s(d)}},a),t)})),$=t.forwardRef((function({testId:e="store-accordion-panel",children:t,...a},n){const{indices:o}=_(),{index:s,button:i,panel:l}=q();return r.createElement("div",Object.assign({ref:n,id:l,"aria-labelledby":i,role:"region","data-store-accordion-panel":!0,"data-testid":e,hidden:!o.has(s)},a),t)})),U=t.forwardRef((function({testId:e="store-table",children:t,...a},n){return r.createElement("table",Object.assign({ref:n,"data-store-table":!0,"data-testid":e},a),t)})),X=t.forwardRef((function({testId:e="store-table-row",children:t,...a},n){return r.createElement("tr",Object.assign({ref:n,"data-store-table-row":!0,"data-testid":e},a),t)})),K=t.forwardRef((function({testId:e="store-table-cell",children:t,variant:a="data",scope:n,...o},s){return r.createElement("header"===a?"th":"td",Object.assign({ref:s,"data-store-table-cell":a,"data-testid":e,scope:n},o),t)})),W=t.forwardRef((function({children:e,testId:t="store-table-body",...a},n){return r.createElement("tbody",Object.assign({ref:n,"data-testid":t,"data-store-table-body":!0},a),e)})),z=t.forwardRef((function({children:e,testId:t="store-table-head",...a},n){return r.createElement("thead",Object.assign({ref:n,"data-testid":t,"data-store-table-head":!0},a),e)})),H=t.forwardRef((function({children:e,testId:t="store-table-footer",...a},n){return r.createElement("tfoot",Object.assign({ref:n,"data-testid":t,"data-store-table-footer":!0},a),e)})),Q=t.forwardRef((function({testId:e="store-alert",children:t,...a},n){return r.createElement("div",Object.assign({ref:n,role:"alert","data-store-alert":!0,"data-testid":e},a),t)}));exports.Accordion=G,exports.AccordionButton=V,exports.AccordionItem=F,exports.AccordionPanel=$,exports.Alert=Q,exports.Badge=h,exports.Banner=({testId:e="store-banner",children:t,variant:a="vertical"})=>r.createElement("article",{"data-store-banner":a,"data-testid":e},t),exports.Bullets=y,exports.Button=l,exports.Carousel=function({infiniteMode:e=!0,controls:a="complete",testId:n="store-carousel",transition:o={duration:400,property:"transform"},children:s,id:i="store-carousel",...l}){var d,c;const u=r.Children.toArray(s),f=u.length,m=e?f+2:f,p=`${o.property} ${o.duration}ms ${null!=(d=o.timing)?d:""} ${null!=(c=o.delay)?c:""}`,b="complete"===a||"navigationArrows"===a,g="complete"===a||"paginationBullets"===a,h=t.useMemo(()=>((e,t)=>{const r={},a=100/t;for(let n=0;n<t;++n)r[e?n-1:n]=-a*n;return r})(e,m),[m,e]),{handlers:v,slide:E,sliderState:x,sliderDispatch:w}=A({totalItems:f,itemsPerPage:1,infiniteMode:e,...l}),{isItemVisible:I,shouldRenderItem:P}=function({currentSlide:e,itemsPerPage:r,totalItems:a}){const n=t.useRef(new Set);t.useEffect(()=>{for(let t=0;t<r;t++)n.current.add(e+t)},[e,r]);const o=t=>function({itemsPerPage:e,currentSlide:t,slideIdx:r,totalItems:a}){return t<0||t>=a||r>=t&&r<t+e}({slideIdx:t,currentSlide:e,itemsPerPage:r,totalItems:a});return{shouldRenderItem:e=>n.current.has(e)||o(e),isItemVisible:o}}({itemsPerPage:x.itemsPerPage,currentSlide:x.currentItem,totalItems:f}),R=e&&s?u.slice(0,1):[],O=(e&&s?u.slice(f-1):[]).concat(null!=s?s:[],R),S=()=>{x.sliding||!e&&0===x.currentPage||E("previous",w)},C=()=>{x.sliding||!e&&x.currentPage===f-1||E("next",w)};return r.createElement("section",{id:i,"data-store-carousel":!0,"data-testid":n,"aria-label":"carousel","aria-roledescription":"carousel"},r.createElement("div",Object.assign({"data-carousel-track-container":!0,style:{overflow:"hidden",width:"100%"}},v),r.createElement("div",{"data-carousel-track":!0,style:{display:"flex",transition:x.sliding?p:void 0,width:100*m+"%",transform:`translate3d(${h[x.currentPage]}%, 0, 0)`},onTransitionEnd:()=>{w({type:"STOP_SLIDE"}),x.currentItem>=f&&w({type:"GO_TO_PAGE",payload:{pageIndex:0,shouldSlide:!1}}),x.currentItem<0&&w({type:"GO_TO_PAGE",payload:{pageIndex:x.totalPages-1,shouldSlide:!1}})},"aria-live":"polite"},O.map((t,a)=>r.createElement("div",{role:"tabpanel","aria-roledescription":"slide",key:a,id:"carousel-item-"+a,"data-carousel-item":!0,style:{width:"100%"},"data-visible":I(a-Number(e))||void 0},P(a-Number(e))?t:null)))),b&&r.createElement("div",{"data-carousel-controls":!0},r.createElement(D,{"data-arrow":"left","aria-controls":i,"aria-label":"previous",onClick:S,icon:r.createElement(k,null)}),r.createElement(D,{"data-arrow":"right","aria-controls":i,"aria-label":"next",onClick:C,icon:r.createElement(j,null)})),g&&r.createElement("div",{"data-carousel-bullets":!0},r.createElement(y,{tabIndex:0,totalQuantity:f,activeBullet:x.currentPage,onClick:(e,t)=>{x.sliding||E(t,w)},ariaControlsGenerator:e=>"carousel-item-"+e,onKeyDown:e=>{switch(e.key){case"ArrowLeft":S();break;case"ArrowRight":C();break;case"Home":E(0,w);break;case"End":E(f-1,w)}},onFocus:e=>{e.currentTarget.focus()}})))},exports.Checkbox=m,exports.Form=P,exports.Icon=c,exports.IconButton=D,exports.Input=d,exports.Label=w,exports.List=v,exports.Modal=({isOpen:e,children:t,onDismiss:a,testId:n="store-modal",...o})=>e?s.createPortal(r.createElement(p,{"data-modal-overlay":!0,onClick:e=>{e.defaultPrevented||(e.stopPropagation(),null==a||a(e))},onKeyDown:e=>{"Escape"!==e.key||e.defaultPrevented||(e.stopPropagation(),null==a||a(e))}},r.createElement(T,Object.assign({},o,{testId:n}),t)),document.body):null,exports.Overlay=p,exports.PaymentMethods=M,exports.Popover=({targetRef:e,testId:t="store-popover",children:o,...s})=>r.createElement(n,Object.assign({"data-store-popover":!0,"data-testid":t,position:a.positionDefault,targetRef:e},s),o),exports.Price=u,exports.Radio=g,exports.SearchInput=O,exports.Select=b,exports.Skeleton=E,exports.Slider=({min:e,max:a,onChange:n,testId:o="store-slider",getAriaValueText:s,className:i})=>{const[l,d]=t.useState(e),[c,u]=t.useState(a),f=t.useRef(e),m=t.useRef(a),p=t.useRef(null),b=t.useCallback(t=>Math.round((t-e)/(a-e)*100),[e,a]);return t.useEffect(()=>{const e=b(l),t=b(m.current);p.current&&(p.current.style.left=e+"%",p.current.style.width=t-e+"%")},[l,b]),t.useEffect(()=>{const e=b(f.current),t=b(c);p.current&&(p.current.style.width=t-e+"%")},[c,b]),t.useEffect(()=>{null==n||n({min:l,max:c})},[l,c,n]),r.createElement("div",{"data-store-slider":!0,"data-testid":o,className:i},r.createElement("div",{ref:p,"data-store-slider-range":!0}),r.createElement("input",{type:"range",min:e,max:a,value:l,onChange:e=>{const t=Math.min(Number(e.target.value),c-1);d(t),f.current=t},"data-store-slider-thumb":"left","aria-valuemin":e,"aria-valuemax":a,"aria-valuenow":l,"aria-label":String(l),"aria-labelledby":s?s(l,"min"):void 0}),r.createElement("input",{type:"range",min:e,max:a,value:c,onChange:e=>{const t=Math.max(Number(e.target.value),l+1);u(t),m.current=t},"data-store-slider-thumb":"right","aria-valuemin":e,"aria-valuemax":a,"aria-valuenow":c,"aria-label":String(c),"aria-labelledby":s?s(c,"max"):void 0}))},exports.Spinner=x,exports.Table=U,exports.TableBody=W,exports.TableCell=K,exports.TableFooter=H,exports.TableHead=z,exports.TableRow=X,exports.TextArea=f,exports.useSlider=A;
|
|
2
2
|
//# sourceMappingURL=ui.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.cjs.production.min.js","sources":["../src/atoms/Button/Button.tsx","../src/atoms/Input/Input.tsx","../src/atoms/Icon/Icon.tsx","../src/atoms/Price/Price.tsx","../src/atoms/TextArea/TextArea.tsx","../src/atoms/Checkbox/Checkbox.tsx","../src/atoms/Overlay/Overlay.tsx","../src/atoms/Select/Select.tsx","../src/atoms/Radio/Radio.tsx","../src/atoms/Badge/Badge.tsx","../src/atoms/List/List.tsx","../src/atoms/Skeleton/Skeleton.tsx","../src/atoms/Spinner/Spinner.tsx","../src/atoms/Label/Label.tsx","../src/molecules/Bullets/Bullets.tsx","../src/molecules/Form/Form.tsx","../src/molecules/SearchInput/SearchInput.tsx","../src/molecules/Carousel/Arrows.tsx","../src/hooks/useSlider/useSlider.ts","../src/molecules/IconButton/IconButton.tsx","../src/molecules/Modal/ModalContent.tsx","../src/molecules/Modal/useTrapFocus.ts","../src/molecules/PaymentMethods/PaymentMethods.tsx","../src/molecules/Accordion/Accordion.tsx","../src/molecules/Accordion/AccordionItem.tsx","../src/molecules/Accordion/AccordionButton.tsx","../src/molecules/Accordion/AccordionPanel.tsx","../src/molecules/Table/Table.tsx","../src/molecules/Table/TableRow.tsx","../src/molecules/Table/TableCell.tsx","../src/molecules/Table/TableBody.tsx","../src/molecules/Table/TableHead.tsx","../src/molecules/Table/TableFooter.tsx","../src/molecules/Alert/Alert.tsx","../src/molecules/Carousel/Carousel.tsx","../src/molecules/Carousel/hooks/useSlideVisibility.ts","../src/molecules/Modal/Modal.tsx","../src/atoms/Popover/Popover.tsx","../src/atoms/Slider/Slider.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface ButtonProps<T = HTMLButtonElement>\n extends ButtonHTMLAttributes<T> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { children, testId = 'store-button', ...otherProps },\n ref\n) {\n return (\n <button ref={ref} data-store-button data-testid={testId} {...otherProps}>\n {children}\n </button>\n )\n})\n\nexport default Button\n","/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\nimport type { InputHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n /**\n * Current variant of the input.\n */\n variant?: 'success' | 'error'\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { variant, testId = 'store-input', ...otherProps },\n ref\n) {\n const variants = {\n 'data-error': variant === 'error' || undefined,\n 'data-success': variant === 'success' || undefined,\n }\n\n return (\n <input\n ref={ref}\n data-store-input\n data-testid={testId}\n {...variants}\n {...otherProps}\n />\n )\n})\n\nexport default Input\n","import type { HTMLAttributes, ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface IconProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * A React component that will be rendered as an icon.\n */\n component: ReactNode\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Icon = forwardRef<HTMLSpanElement, IconProps>(function Button(\n { component, testId = 'store-icon', ...otherProps }: IconProps,\n ref\n) {\n return (\n <span ref={ref} data-store-icon data-testid={testId} {...otherProps}>\n {component}\n </span>\n )\n})\n\nexport default Icon\n","import type { HTMLAttributes, ElementType, ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport type PriceVariant =\n | 'selling'\n | 'listing'\n | 'spot'\n | 'savings'\n | 'installment'\n\nexport type PriceFormatter = (price: number, variant: PriceVariant) => ReactNode\n\nexport interface PriceProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {\n /**\n * Set the HTML element tag of this component.\n */\n as?: ElementType\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * The raw price value.\n */\n value: number\n /**\n * Formatter function that transforms the raw price value and render the result.\n */\n formatter?: PriceFormatter\n /**\n * The current use case variant for prices.\n */\n variant?: PriceVariant\n}\n\nexport const Price = forwardRef<Omit<HTMLSpanElement, 'children'>, PriceProps>(\n function Price(\n {\n as: Component = 'span',\n testId = 'store-price',\n value,\n formatter = (price) => price,\n variant = 'selling',\n ...otherProps\n },\n ref\n ) {\n const formattedPrice = formatter(value, variant)\n\n return (\n <Component\n ref={ref}\n data-store-price\n data-testid={testId}\n data-variant={variant}\n {...otherProps}\n >\n {formattedPrice}\n </Component>\n )\n }\n)\n\nexport default Price\n","import type { TextareaHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TextAreaProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'children'> {\n /**\n * Current variant of the input.\n */\n variant?: 'success' | 'error'\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n { variant, testId = 'store-textarea', ...otherProps },\n ref\n ) {\n const variants = {\n 'data-success': variant === 'success' || undefined,\n 'data-error': variant === 'error' || undefined,\n }\n\n return (\n <textarea\n ref={ref}\n data-store-textarea\n data-testid={testId}\n {...variants}\n {...otherProps}\n />\n )\n }\n)\n\nexport default TextArea\n","import React, { forwardRef } from 'react'\nimport type { InputHTMLAttributes } from 'react'\n\nexport interface CheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { testId = 'store-checkbox', ...otherProps }: CheckboxProps,\n ref\n) {\n return (\n <input\n ref={ref}\n data-store-checkbox\n data-testid={testId}\n type=\"checkbox\"\n {...otherProps}\n />\n )\n})\n\nexport default Checkbox\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface Props extends HTMLAttributes<HTMLDivElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Overlay = forwardRef<HTMLDivElement, Props>(function Overlay(\n { testId = 'store-overlay', ...otherProps },\n ref\n) {\n return (\n <div\n role=\"presentation\"\n data-store-overlay\n data-testid={testId}\n ref={ref}\n {...otherProps}\n />\n )\n})\n\nexport default Overlay\n","import type { SelectHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { children, testId = 'store-select', ...otherProps },\n ref\n) {\n return (\n <select ref={ref} data-store-select data-testid={testId} {...otherProps}>\n {children}\n </select>\n )\n})\n\nexport default Select\n","import React, { forwardRef } from 'react'\nimport type { InputHTMLAttributes } from 'react'\n\nexport interface RadioProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n testId?: string\n}\n\nconst Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { testId = 'store-radio', ...otherProps }: RadioProps,\n ref\n) {\n return (\n <input\n ref={ref}\n data-store-radio\n data-testid={testId}\n type=\"radio\"\n {...otherProps}\n />\n )\n})\n\nexport default Radio\n","import type { ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface BadgeProps {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children?: ReactNode\n}\n\nconst Badge = forwardRef<HTMLDivElement, BadgeProps>(function Badge(\n { testId = 'store-badge', children }: BadgeProps,\n ref\n) {\n return (\n <div ref={ref} data-testid={testId} data-store-badge>\n {children}\n </div>\n )\n})\n\nexport default Badge\n","import type {\n ElementType,\n ComponentPropsWithRef,\n ReactElement,\n FC,\n} from 'react'\nimport React, { forwardRef } from 'react'\n\nimport type { PolymorphicComponentPropsWithRef } from '../../typings'\n\nexport type ListVariant = 'description' | 'ordered' | 'unordered'\n\nconst variantToType = (variant: ListVariant) => {\n switch (variant) {\n case 'description':\n return 'dl'\n\n case 'unordered':\n return 'ul'\n\n case 'ordered':\n return 'ol'\n\n default:\n return 'ul'\n }\n}\n\ninterface Props {\n testId?: string\n variant?: ListVariant\n}\n\nexport type ListProps<C extends ElementType> = PolymorphicComponentPropsWithRef<\n C,\n Props\n>\n\ntype ListComponent = <C extends ElementType = 'ul'>(\n props: ListProps<C>\n) => ReactElement | null\n\nconst List: ListComponent = forwardRef(function List<\n C extends ElementType = 'ul'\n>(\n {\n testId = 'store-list',\n variant = 'unordered',\n as,\n ...rawProps\n }: ListProps<C>,\n ref: ComponentPropsWithRef<C>['ref']\n) {\n const dataAttributes = {\n 'data-testid': testId,\n 'data-store-list': true,\n [`data-${variant}`]: true,\n }\n\n const Component = as ?? variantToType(variant)\n\n return <Component ref={ref} {...dataAttributes} {...rawProps} />\n})\n\n/**\n * This is only being exported to make it easier to use in Storybook.\n * **DON'T** import this directly to use this component, use the default export\n * instead.\n */\nexport const StorybookList = List as FC<Props>\n\nexport default List\n","import React, { forwardRef } from 'react'\nimport type { HTMLAttributes } from 'react'\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { testId = 'store-skeleton', ...otherProps },\n ref\n) {\n return (\n <div ref={ref} data-store-skeleton data-testid={testId} {...otherProps} />\n )\n})\n\nexport default Skeleton\n","import React, { forwardRef } from 'react'\n\nexport type SpinnerProps = {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Spinner = forwardRef<HTMLDivElement, SpinnerProps>(function Spinner(\n { children, testId = 'store-spinner', ...otherProps },\n ref\n) {\n return (\n <span ref={ref} data-store-spinner data-testid={testId} {...otherProps} />\n )\n})\n\nexport default Spinner\n","import type { LabelHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(function Label(\n { testId = 'store-label', children, ...otherProps },\n ref\n) {\n return (\n <label ref={ref} data-store-label data-testid={testId} {...otherProps}>\n {children}\n </label>\n )\n})\n\nexport default Label\n","import type { HTMLAttributes, MouseEvent } from 'react'\nimport React, { forwardRef, useMemo } from 'react'\n\nimport Button from '../../atoms/Button'\n\nexport interface BulletsProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'role'> {\n /**\n * Number of bullets that should be rendered.\n */\n totalQuantity: number\n /**\n * The currently active bullet (zero-indexed).\n */\n activeBullet: number\n /**\n * Event handler for clicks on each bullet. The handler will be called with\n * the index of the bullet that received the click.\n */\n onClick: (e: MouseEvent, bulletIdx: number) => void\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n /**\n * Function that should be used to generate the aria-label attribute added\n * to each bullet that is inactive. It receives the bullet index as an\n * argument so that it can be interpolated in the generated string.\n */\n ariaLabelGenerator?: (index: number, isActive: boolean) => string\n /**\n * Function that should be used to generate the aria-controls attribute added\n * to each bullet. It receives the bullet index as argument and should return a string.\n */\n ariaControlsGenerator?: (index: number) => string\n}\n\nconst defaultAriaLabel = (idx: number, isActive: boolean) =>\n isActive ? 'Current page' : `Go to page ${idx + 1}`\n\nconst Bullets = forwardRef<HTMLDivElement, BulletsProps>(function Bullets(\n {\n totalQuantity,\n activeBullet,\n onClick,\n testId = 'store-bullets',\n ariaLabelGenerator = defaultAriaLabel,\n ariaControlsGenerator,\n ...otherProps\n },\n ref\n) {\n const bulletIndexes = useMemo(() => Array(totalQuantity).fill(0), [\n totalQuantity,\n ])\n\n return (\n <div\n ref={ref}\n data-store-bullets\n data-testid={testId}\n role=\"tablist\"\n {...otherProps}\n >\n {bulletIndexes.map((_, idx) => {\n const isActive = activeBullet === idx\n\n return (\n <Button\n data-bullet-item\n role=\"tab\"\n tabIndex={-1}\n key={idx}\n testId={`${testId}-item`}\n onClick={(e) => onClick(e, idx)}\n aria-label={ariaLabelGenerator(idx, isActive)}\n aria-controls={ariaControlsGenerator?.(idx)}\n aria-selected={isActive}\n />\n )\n })}\n </div>\n )\n})\n\nexport default Bullets\n","import type { FormHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface FormProps extends FormHTMLAttributes<HTMLFormElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n}\n\nconst Form = forwardRef<HTMLFormElement, FormProps>(function Form(\n { testId = 'store-form', children, ...otherProps },\n ref\n) {\n return (\n <form ref={ref} data-store-form data-testid={testId} {...otherProps}>\n {children}\n </form>\n )\n})\n\nexport default Form\n","import type {\n AriaAttributes,\n FormEvent,\n InputHTMLAttributes,\n ReactNode,\n} from 'react'\nimport React, { forwardRef, useRef } from 'react'\n\nimport Button from '../../atoms/Button'\nimport Icon from '../../atoms/Icon'\nimport Input from '../../atoms/Input'\nimport Form from '../Form'\n\nconst SearchIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />\n </svg>\n)\n\ntype InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onSubmit'>\n\nexport interface SearchInputProps extends InputProps {\n /**\n * Callback function when submitted.\n */\n onSubmit: (value: string) => void\n /**\n * Custom icon inside the submit button.\n */\n icon?: ReactNode\n /**\n * Custom aria-label for input and button.\n */\n 'aria-label'?: AriaAttributes['aria-label']\n /**\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst SearchInput = forwardRef<HTMLFormElement, SearchInputProps>(\n function SearchInput(\n {\n onSubmit,\n icon,\n 'aria-label': ariaLabel = 'search',\n testId = 'store-search-input',\n ...otherProps\n },\n ref\n ) {\n const valueRef = useRef<HTMLInputElement>(null)\n\n const handleSubmit = (event: FormEvent) => {\n event.preventDefault()\n\n if (valueRef.current?.value !== '') {\n onSubmit(valueRef.current!.value)\n }\n }\n\n return (\n <Form\n ref={ref}\n data-store-search-input\n data-testid={testId}\n onSubmit={handleSubmit}\n >\n <Input ref={valueRef} aria-label={ariaLabel} {...otherProps} />\n <Button type=\"submit\" aria-label={`button-${ariaLabel}`}>\n <Icon component={icon ?? <SearchIcon />} />\n </Button>\n </Form>\n )\n }\n)\n\nexport default SearchInput\n","import React from 'react'\n\ninterface IconProps {\n size?: {\n width: number\n height: number\n }\n viewBox?: string\n color?: string\n}\n\nexport const LeftArrowIcon = ({\n size = { width: 25, height: 25 },\n viewBox = '0 0 16 16',\n color = 'currentColor',\n}: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n viewBox={viewBox}\n width={size.width}\n height={size.height}\n >\n <path\n d=\"M11 1L4 8L11 15\"\n strokeWidth=\"2\"\n strokeMiterlimit=\"10\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n stroke={color}\n fill=\"none\"\n />\n </svg>\n)\n\nexport const RightArrowIcon = ({\n size = { width: 25, height: 25 },\n viewBox = '0 0 16 16',\n color = 'currentColor',\n}: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n viewBox={viewBox}\n width={size.width}\n height={size.height}\n >\n <path\n d=\"M5 15L12 8L5 1\"\n strokeWidth=\"2\"\n strokeMiterlimit=\"10\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n stroke={color}\n fill=\"none\"\n />\n </svg>\n)\n","import type { Dispatch } from 'react'\nimport { useReducer } from 'react'\nimport type { SwipeableProps } from 'react-swipeable'\nimport { useSwipeable } from 'react-swipeable'\n\nexport type SlideDirection = 'next' | 'previous'\n\ninterface NextPageAction {\n type: 'NEXT_PAGE'\n}\n\ninterface PreviousPageAction {\n type: 'PREVIOUS_PAGE'\n}\n\ninterface GoToPageAction {\n type: 'GO_TO_PAGE'\n payload: {\n pageIndex: number\n shouldSlide: boolean\n }\n}\n\ninterface StopSlideAction {\n type: 'STOP_SLIDE'\n}\n\nexport type Action =\n | NextPageAction\n | PreviousPageAction\n | StopSlideAction\n | GoToPageAction\n\nexport type SliderDispatch = Dispatch<Action>\n\nexport interface SliderState {\n /**\n * The `currentItem` in a Slider with multiple items in a single page is\n * always **the one with the lowest index** in the current page.\n */\n currentItem: number\n /** Currently active page */\n currentPage: number\n /**\n * Whether or not the Slider is currently sliding. This is useful to\n * manipulate the `transition` property in a component.\n */\n sliding: boolean\n /** The direction in which the Slider is sliding. */\n slideDirection: SlideDirection\n /** The total number of unique items in the slider. */\n totalItems: number\n /** The number of items in a single page. */\n itemsPerPage: number\n /** The total number of pages in the slider. */\n totalPages: number\n /** Whether or not the slider is infinite. */\n infinite: boolean\n}\n\nexport const nextPage = (current: number, total: number) =>\n (current + 1) % total\n\nexport const previousPage = (current: number, total: number) =>\n (total - ((total - current + 1) % total)) % total\n\nfunction reducer(state: SliderState, action: Action): SliderState {\n switch (action.type) {\n case 'NEXT_PAGE': {\n // If `state.infinite` is true, we need to take into account an extra\n // page in the calculation. This extra page is a clone of the first page.\n const adjustedTotalPages = state.infinite\n ? state.totalPages + 1\n : state.totalPages\n\n const nextPageIndex = nextPage(state.currentPage, adjustedTotalPages)\n\n const nextItemIndex =\n (nextPageIndex % adjustedTotalPages) * state.itemsPerPage\n\n return {\n ...state,\n sliding: true,\n slideDirection: 'next',\n currentItem: nextItemIndex,\n currentPage: nextPageIndex,\n }\n }\n\n case 'PREVIOUS_PAGE': {\n // If `state.infinite` is true, we need to take into account an extra\n // page in the calculation. This extra page is a clone of the first page.\n const adjustedTotalPages = state.infinite\n ? state.totalPages + 1\n : state.totalPages\n\n // If `state.infinite` is true and we're currently on page 0, we need to\n // let the slider go to page -1. This -1 page is a clone of the last page.\n const shouldGoToClone = state.infinite && state.currentPage === 0\n const previousPageIndex = shouldGoToClone\n ? -1\n : previousPage(state.currentPage, state.totalPages)\n\n return {\n ...state,\n sliding: true,\n slideDirection: 'previous',\n currentItem:\n (previousPageIndex % adjustedTotalPages) * state.itemsPerPage,\n currentPage: previousPageIndex,\n }\n }\n\n case 'GO_TO_PAGE': {\n if (action.payload.pageIndex === state.currentPage) {\n return state\n }\n\n return {\n ...state,\n sliding: action.payload.shouldSlide,\n slideDirection:\n action.payload.pageIndex > state.currentPage ? 'next' : 'previous',\n currentItem:\n (action.payload.pageIndex % state.totalPages) * state.itemsPerPage,\n currentPage: action.payload.pageIndex,\n }\n }\n\n case 'STOP_SLIDE':\n return { ...state, sliding: false }\n\n default:\n return state\n }\n}\n\nconst defaultSliderState = (\n totalItems: number,\n itemsPerPage: number,\n infinite: boolean\n): SliderState => ({\n currentItem: 0,\n currentPage: 0,\n sliding: false,\n slideDirection: 'next',\n totalItems,\n itemsPerPage,\n totalPages: Math.ceil(totalItems / itemsPerPage),\n infinite,\n})\n\nconst slide = (page: SlideDirection | number, dispatch: Dispatch<Action>) => {\n if (page === 'next') {\n dispatch({\n type: 'NEXT_PAGE',\n })\n }\n\n if (page === 'previous') {\n dispatch({\n type: 'PREVIOUS_PAGE',\n })\n }\n\n if (typeof page === 'number') {\n dispatch({\n type: 'GO_TO_PAGE',\n payload: {\n pageIndex: page,\n shouldSlide: true,\n },\n })\n }\n}\n\nexport interface UseSliderArgs extends SwipeableProps {\n /** The total number of unique items in the slider. */\n totalItems: number\n /** The number of items in a single slider page. */\n itemsPerPage?: number\n /** Whether or not the slider is infinite. */\n infiniteMode?: boolean\n}\n\nexport default function useSlider({\n totalItems,\n itemsPerPage = 1,\n infiniteMode = false,\n ...swipeableConfigOverrides\n}: UseSliderArgs) {\n const [sliderState, sliderDispatch] = useReducer(reducer, undefined, () =>\n defaultSliderState(totalItems, itemsPerPage, infiniteMode)\n )\n\n const handlers = useSwipeable({\n onSwipedRight: () => slide('previous', sliderDispatch),\n onSwipedLeft: () => slide('next', sliderDispatch),\n preventDefaultTouchmoveEvent: true,\n trackMouse: true,\n ...swipeableConfigOverrides,\n })\n\n return {\n handlers,\n slide,\n sliderState,\n sliderDispatch,\n }\n}\n","import type { ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\n\nimport Button from '../../atoms/Button'\nimport type { ButtonProps } from '../../atoms/Button'\nimport Icon from '../../atoms/Icon'\n\nexport interface Props extends Omit<ButtonProps, 'children'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * A React component that will be rendered as an icon.\n */\n icon: ReactNode\n}\n\nconst IconButton = forwardRef<HTMLButtonElement, Props>(function IconButton(\n { icon, testId = 'store-icon-button', ...buttonProps },\n ref\n) {\n return (\n <Button ref={ref} data-store-icon-button testId={testId} {...buttonProps}>\n <Icon component={icon} />\n </Button>\n )\n})\n\nexport default IconButton\n","/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\nimport type {\n DetailedHTMLProps,\n HTMLAttributes,\n MouseEvent,\n RefObject,\n} from 'react'\nimport React, { useRef } from 'react'\n\nimport useTrapFocus from './useTrapFocus'\n\ninterface ModalContentPureProps\n extends Omit<\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>,\n 'ref'\n > {\n beforeElementRef: RefObject<HTMLDivElement>\n trapFocusRef: RefObject<HTMLDivElement>\n afterElementRef: RefObject<HTMLDivElement>\n testId?: string\n}\n\nconst ModalContentPure = ({\n beforeElementRef,\n trapFocusRef,\n afterElementRef,\n testId = 'store-modal-content',\n children,\n ...otherProps\n}: ModalContentPureProps) => {\n return (\n <>\n <div\n ref={beforeElementRef}\n data-testid=\"beforeElement\"\n tabIndex={0}\n aria-hidden=\"true\"\n />\n <div\n data-store-modal-content\n {...otherProps}\n data-testid={testId}\n ref={trapFocusRef}\n aria-modal=\"true\"\n role=\"dialog\"\n tabIndex={-1}\n >\n {children}\n </div>\n <div\n ref={afterElementRef}\n data-testid=\"afterElement\"\n tabIndex={0}\n aria-hidden=\"true\"\n />\n </>\n )\n}\n\nexport type ModalContentProps = Omit<\n ModalContentPureProps,\n 'trapFocusRef' | 'onClick' | 'beforeElementRef' | 'afterElementRef'\n>\n\nconst ModalContent = ({ children, ...otherProps }: ModalContentProps) => {\n const trapFocusRef = useRef<HTMLDivElement>(null)\n const beforeElementRef = useRef<HTMLDivElement>(null)\n const afterElementRef = useRef<HTMLDivElement>(null)\n\n useTrapFocus({\n beforeElementRef,\n trapFocusRef,\n afterElementRef,\n })\n\n return (\n <ModalContentPure\n {...otherProps}\n trapFocusRef={trapFocusRef}\n beforeElementRef={beforeElementRef}\n afterElementRef={afterElementRef}\n onClick={(event: MouseEvent) => {\n event.stopPropagation()\n }}\n >\n {children}\n </ModalContentPure>\n )\n}\n\nexport default ModalContent\n","import { useEffect, useRef } from 'react'\nimport type { RefObject } from 'react'\nimport type { FocusableElement } from 'tabbable'\nimport { tabbable } from 'tabbable'\n\ninterface TrapFocusParams {\n beforeElementRef: RefObject<HTMLElement>\n trapFocusRef: RefObject<HTMLElement>\n afterElementRef: RefObject<HTMLElement>\n}\n\n/*\n * Element that will maintain the focus inside trapFocusRef, focus the first element,\n * and focus back on the element that was in focus when useTrapFocus was triggered.\n *\n * Inspired by Reakit useTrapFocus https://github.com/reakit/reakit/blob/a211d94da9f3b683182568a56479b91afb1b85ae/packages/reakit/src/Dialog/__utils/useFocusTrap.ts\n */\nconst useTrapFocus = ({\n trapFocusRef,\n beforeElementRef,\n afterElementRef,\n}: TrapFocusParams) => {\n const tabbableNodesRef = useRef<FocusableElement[]>()\n const nodeToRestoreRef = useRef<HTMLElement | null>(\n document.hasFocus() ? (document.activeElement as HTMLElement) : null\n )\n\n // Focus back on the element that was focused when useTrapFocus is triggered.\n useEffect(() => {\n const nodeToRestore = nodeToRestoreRef.current\n\n return () => {\n nodeToRestore?.focus()\n }\n }, [nodeToRestoreRef])\n\n // Set focus on first tabbable element\n useEffect(() => {\n if (!trapFocusRef.current) {\n return\n }\n\n if (!tabbableNodesRef.current) {\n tabbableNodesRef.current = tabbable(trapFocusRef.current)\n }\n\n const [firstTabbable] = tabbableNodesRef.current\n\n if (!firstTabbable) {\n trapFocusRef.current.focus()\n\n return\n }\n\n firstTabbable.focus()\n }, [trapFocusRef])\n\n // Handle loop focus. Set keydown and focusin event listeners\n useEffect(() => {\n if (\n !trapFocusRef.current ||\n !beforeElementRef.current ||\n !afterElementRef.current\n ) {\n return\n }\n\n const beforeElement = beforeElementRef.current\n const afterElement = afterElementRef.current\n const trapFocus = trapFocusRef.current\n\n const handleLoopFocus = (nativeEvent: FocusEvent) => {\n if (!document.hasFocus()) {\n return\n }\n\n tabbableNodesRef.current = tabbable(trapFocusRef.current!)\n\n if (!tabbableNodesRef.current.length) {\n trapFocus.focus()\n }\n\n /*\n * Handle loop focus from beforeElementRef. This node can only be focused if the user press shift tab.\n * It will focus the last element of the trapFocusRef.\n */\n if (nativeEvent.target === beforeElement) {\n tabbableNodesRef.current[tabbableNodesRef.current.length - 1]?.focus()\n }\n\n /*\n * Handle loop focus from afterElementRef. This node can only be focused if the user press tab.\n * It will focus the first element of the trapFocusRef.\n */\n if (nativeEvent.target === afterElement) {\n tabbableNodesRef.current[0]?.focus()\n }\n }\n\n beforeElement?.addEventListener('focusin', handleLoopFocus)\n afterElement?.addEventListener('focusin', handleLoopFocus)\n\n return () => {\n beforeElement?.removeEventListener('focusin', handleLoopFocus)\n afterElement?.removeEventListener('focusin', handleLoopFocus)\n }\n }, [tabbableNodesRef, afterElementRef, beforeElementRef, trapFocusRef])\n}\n\nexport default useTrapFocus\n","import type { ReactNode, AriaAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface PaymentMethodsProps {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n /**\n * Title of the payment methods section (e.g.: \"Payment methods\",\n * \"Accepted Cards\").\n */\n title?: ReactNode\n /**\n * Defines a string value that labels the current element when\n * title is not used.\n */\n 'aria-label'?: AriaAttributes['aria-label']\n /**\n * Children will receive the flags to be displayed in the payment\n * methods section (e.g.:, visa, mastercard, etc).\n */\n children: ReactNode\n}\n\nconst PaymentMethods = forwardRef<HTMLDivElement, PaymentMethodsProps>(\n function PaymentMethods(\n {\n testId = 'store-payment-methods',\n title,\n 'aria-label': ariaLabel = 'Payment Methods',\n children,\n ...otherProps\n },\n ref\n ) {\n return (\n <div\n ref={ref}\n data-store-payment-methods\n data-testid={testId}\n {...otherProps}\n >\n {!!title && <div id=\"payment-methods\">{title}</div>}\n <div\n data-payment-methods-flags\n aria-labelledby={title ? 'payment-methods' : undefined}\n aria-label={title ? undefined : ariaLabel}\n >\n {children}\n </div>\n </div>\n )\n }\n)\n\nexport default PaymentMethods\n","import type { HTMLAttributes, ReactElement } from 'react'\nimport React, {\n useContext,\n cloneElement,\n forwardRef,\n createContext,\n} from 'react'\n\ninterface AccordionContext {\n indices: Set<number>\n onChange: (index: number) => void\n numberOfItems: number\n}\n\nconst AccordionContext = createContext<AccordionContext | undefined>(undefined)\n\nexport interface AccordionProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n /**\n * Indices that indicate which accordion items are opened.\n */\n indices: Iterable<number>\n /**\n * Function that is triggered when an accordion item is opened/closed.\n */\n onChange: (index: number) => void\n}\n\nconst Accordion = forwardRef<HTMLDivElement, AccordionProps>(function Accordion(\n { testId = 'store-accordion', indices, onChange, children, ...otherProps },\n ref\n) {\n const childrenWithIndex = React.Children.map(\n children as ReactElement,\n (child, index) => cloneElement(child, { index: child.props.index ?? index })\n )\n\n const context = {\n indices: new Set(indices),\n onChange,\n numberOfItems: childrenWithIndex.length,\n }\n\n return (\n <AccordionContext.Provider value={context}>\n <div\n ref={ref}\n data-store-accordion\n data-testid={testId}\n role=\"region\"\n {...otherProps}\n >\n {childrenWithIndex}\n </div>\n </AccordionContext.Provider>\n )\n})\n\nexport function useAccordion() {\n const context = useContext(AccordionContext)\n\n if (context === undefined) {\n throw new Error(\n 'Do not use Accordion components outside the Accordion context.'\n )\n }\n\n return context\n}\n\nexport default Accordion\n","import type { HTMLAttributes } from 'react'\nimport React, { useContext, forwardRef, createContext } from 'react'\n\ninterface AccordionItemContext {\n index: number\n panel: string\n button: string\n}\n\nconst AccordionItemContext = createContext<AccordionItemContext | undefined>(\n undefined\n)\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n /**\n * Index of the current accordion item within the accordion.\n */\n index?: number\n}\n\nconst AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(\n function AccordionItem(\n { testId = 'store-accordion-item', children, index = 0, ...otherProps },\n ref\n ) {\n const context = {\n index,\n panel: `panel--${index}`,\n button: `button--${index}`,\n }\n\n return (\n <AccordionItemContext.Provider value={context}>\n <div\n ref={ref}\n data-store-accordion-item\n data-testid={testId}\n {...otherProps}\n >\n {children}\n </div>\n </AccordionItemContext.Provider>\n )\n }\n)\n\nexport function useAccordionItem() {\n const context = useContext(AccordionItemContext)\n\n if (context === undefined) {\n throw new Error(\n 'Do not use AccordionItem components outside the AccordionItem context.'\n )\n }\n\n return context\n}\n\nexport default AccordionItem\n","import type { ButtonHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nimport Button from '../../atoms/Button'\nimport { useAccordion } from './Accordion'\nimport { useAccordionItem } from './AccordionItem'\n\nexport interface AccordionButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst AccordionButton = forwardRef<HTMLButtonElement, AccordionButtonProps>(\n function AccordionButton(\n { testId = 'store-accordion-button', children, ...otherProps },\n ref\n ) {\n const { indices, onChange, numberOfItems } = useAccordion()\n const { index, panel, button } = useAccordionItem()\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n if (!['ArrowDown', 'ArrowUp'].includes(event.key)) {\n return\n }\n\n const getNext = () => {\n const next = Number(index) + 1 === numberOfItems ? 0 : Number(index) + 1\n\n return document.getElementById(`button--${next}`)\n }\n\n const getPrevious = () => {\n const previous =\n Number(index) - 1 < 0 ? numberOfItems - 1 : Number(index) - 1\n\n return document.getElementById(`button--${previous}`)\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n getNext()?.focus()\n break\n\n case 'ArrowUp':\n event.preventDefault()\n getPrevious()?.focus()\n break\n\n default:\n }\n }\n\n return (\n <Button\n ref={ref}\n id={button}\n aria-expanded={indices.has(index)}\n aria-controls={panel}\n data-store-accordion-button\n data-testid={testId}\n onKeyDown={onKeyDown}\n onClick={() => {\n onChange(index)\n }}\n {...otherProps}\n >\n {children}\n </Button>\n )\n }\n)\n\nexport default AccordionButton\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nimport { useAccordion } from './Accordion'\nimport { useAccordionItem } from './AccordionItem'\n\nexport interface AccordionPanelProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst AccordionPanel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel(\n { testId = 'store-accordion-panel', children, ...otherProps },\n ref\n ) {\n const { indices } = useAccordion()\n const { index, button, panel } = useAccordionItem()\n\n return (\n <div\n ref={ref}\n id={panel}\n aria-labelledby={button}\n role=\"region\"\n data-store-accordion-panel\n data-testid={testId}\n hidden={!indices.has(index)}\n {...otherProps}\n >\n {children}\n </div>\n )\n }\n)\n\nexport default AccordionPanel\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableProps extends HTMLAttributes<HTMLTableElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { testId = 'store-table', children, ...otherProps },\n ref\n) {\n return (\n <table ref={ref} data-store-table data-testid={testId} {...otherProps}>\n {children}\n </table>\n )\n})\n\nexport default Table\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n function TableRow(\n { testId = 'store-table-row', children, ...otherProps },\n ref\n ) {\n return (\n <tr ref={ref} data-store-table-row data-testid={testId} {...otherProps}>\n {children}\n </tr>\n )\n }\n)\n\nexport default TableRow\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\ntype TableCellVariant = 'data' | 'header'\n\nexport interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * Specify if this component should be rendered as a header (`<th>`) or as a data cell (`<td>`).\n */\n variant?: TableCellVariant\n /**\n * Defines the cells that the header element (`<th>`) relates to.\n * @see scope https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope\n */\n scope?: 'col' | 'row' | 'rowgroup' | 'colgroup'\n}\n\nconst TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(\n function TableCell(\n {\n testId = 'store-table-cell',\n children,\n variant = 'data',\n scope,\n ...otherProps\n },\n ref\n ) {\n const Cell = variant === 'header' ? 'th' : 'td'\n\n return (\n <Cell\n ref={ref}\n data-store-table-cell={variant}\n data-testid={testId}\n scope={scope}\n {...otherProps}\n >\n {children}\n </Cell>\n )\n }\n)\n\nexport default TableCell\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableBodyProps\n extends HTMLAttributes<HTMLTableSectionElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n function TableBody(\n { children, testId = 'store-table-body', ...otherProps },\n ref\n ) {\n return (\n <tbody\n ref={ref}\n data-testid={testId}\n data-store-table-body\n {...otherProps}\n >\n {children}\n </tbody>\n )\n }\n)\n\nexport default TableBody\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableHeadProps\n extends HTMLAttributes<HTMLTableSectionElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>(\n function TableHead(\n { children, testId = 'store-table-head', ...otherProps },\n ref\n ) {\n return (\n <thead\n ref={ref}\n data-testid={testId}\n data-store-table-head\n {...otherProps}\n >\n {children}\n </thead>\n )\n }\n)\n\nexport default TableHead\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableFooterProps\n extends HTMLAttributes<HTMLTableSectionElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst TableFooter = forwardRef<HTMLTableSectionElement, TableFooterProps>(\n function TableFooter(\n { children, testId = 'store-table-footer', ...otherProps },\n ref\n ) {\n return (\n <tfoot\n ref={ref}\n data-testid={testId}\n data-store-table-footer\n {...otherProps}\n >\n {children}\n </tfoot>\n )\n }\n)\n\nexport default TableFooter\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface AlertProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n}\n\nconst Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { testId = 'store-alert', children, ...otherProps },\n ref\n) {\n return (\n <div\n ref={ref}\n role=\"alert\"\n data-store-alert\n data-testid={testId}\n {...otherProps}\n >\n {children}\n </div>\n )\n})\n\nexport default Alert\n","import type { KeyboardEvent, PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\nimport type { SwipeableProps } from 'react-swipeable'\n\nimport { RightArrowIcon, LeftArrowIcon } from './Arrows'\nimport useSlider from '../../hooks/useSlider/useSlider'\nimport useSlideVisibility from './hooks/useSlideVisibility'\nimport Bullets from '../Bullets'\nimport IconButton from '../IconButton'\n\nconst createTransformValues = (infinite: boolean, totalItems: number) => {\n const transformMap: Record<number, number> = {}\n const slideWidth = 100 / totalItems\n\n for (let idx = 0; idx < totalItems; ++idx) {\n const currIdx = infinite ? idx - 1 : idx\n const transformValue = -(slideWidth * idx)\n\n transformMap[currIdx] = transformValue\n }\n\n return transformMap\n}\n\nexport interface CarouselProps extends SwipeableProps {\n id?: string\n testId?: string\n infiniteMode?: boolean\n controls?: 'complete' | 'navigationArrows' | 'paginationBullets'\n transition?: {\n duration: number\n property: string\n delay?: number\n timing?: string\n }\n}\n\nfunction Carousel({\n infiniteMode = true,\n controls = 'complete',\n testId = 'store-carousel',\n transition = {\n duration: 400,\n property: 'transform',\n },\n children,\n id = 'store-carousel',\n ...swipeableConfigOverrides\n}: PropsWithChildren<CarouselProps>) {\n const childrenArray = React.Children.toArray(children)\n const childrenCount = childrenArray.length\n const numberOfSlides = infiniteMode ? childrenCount + 2 : childrenCount\n const slidingTransition = `${transition.property} ${transition.duration}ms ${\n transition.timing ?? ''\n } ${transition.delay ?? ''}`\n\n const showNavigationArrows =\n controls === 'complete' || controls === 'navigationArrows'\n\n const showPaginationBullets =\n controls === 'complete' || controls === 'paginationBullets'\n\n const transformValues = useMemo(\n () => createTransformValues(infiniteMode, numberOfSlides),\n [numberOfSlides, infiniteMode]\n )\n\n const { handlers, slide, sliderState, sliderDispatch } = useSlider({\n totalItems: childrenCount,\n itemsPerPage: 1,\n infiniteMode,\n ...swipeableConfigOverrides,\n })\n\n const { isItemVisible, shouldRenderItem } = useSlideVisibility({\n itemsPerPage: sliderState.itemsPerPage,\n currentSlide: sliderState.currentItem,\n totalItems: childrenCount,\n })\n\n const postRenderedSlides =\n infiniteMode && children ? childrenArray.slice(0, 1) : []\n\n const preRenderedSlides =\n infiniteMode && children ? childrenArray.slice(childrenCount - 1) : []\n\n const slides = preRenderedSlides.concat(children ?? [], postRenderedSlides)\n\n const slidePrevious = () => {\n if (\n sliderState.sliding ||\n (!infiniteMode && sliderState.currentPage === 0)\n ) {\n return\n }\n\n slide('previous', sliderDispatch)\n }\n\n const slideNext = () => {\n if (\n sliderState.sliding ||\n (!infiniteMode && sliderState.currentPage === childrenCount - 1)\n ) {\n return\n }\n\n slide('next', sliderDispatch)\n }\n\n // accessible behavior for tablist\n const handleBulletsKeyDown = (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowLeft': {\n slidePrevious()\n break\n }\n\n case 'ArrowRight': {\n slideNext()\n break\n }\n\n case 'Home': {\n slide(0, sliderDispatch)\n break\n }\n\n case 'End': {\n slide(childrenCount - 1, sliderDispatch)\n break\n }\n\n default:\n }\n }\n\n return (\n <section\n id={id}\n data-store-carousel\n data-testid={testId}\n aria-label=\"carousel\"\n aria-roledescription=\"carousel\"\n >\n <div\n data-carousel-track-container\n style={{ overflow: 'hidden', width: '100%' }}\n {...handlers}\n >\n <div\n data-carousel-track\n style={{\n display: 'flex',\n transition: sliderState.sliding ? slidingTransition : undefined,\n width: `${numberOfSlides * 100}%`,\n transform: `translate3d(${\n transformValues[sliderState.currentPage]\n }%, 0, 0)`,\n }}\n onTransitionEnd={() => {\n sliderDispatch({\n type: 'STOP_SLIDE',\n })\n\n if (sliderState.currentItem >= childrenCount) {\n sliderDispatch({\n type: 'GO_TO_PAGE',\n payload: {\n pageIndex: 0,\n shouldSlide: false,\n },\n })\n }\n\n if (sliderState.currentItem < 0) {\n sliderDispatch({\n type: 'GO_TO_PAGE',\n payload: {\n pageIndex: sliderState.totalPages - 1,\n shouldSlide: false,\n },\n })\n }\n }}\n aria-live=\"polite\"\n >\n {slides.map((currentSlide, idx) => (\n <div\n role=\"tabpanel\"\n aria-roledescription=\"slide\"\n key={idx}\n id={`carousel-item-${idx}`}\n data-carousel-item\n style={{ width: '100%' }}\n data-visible={\n isItemVisible(idx - Number(infiniteMode)) || undefined\n }\n >\n {shouldRenderItem(idx - Number(infiniteMode))\n ? currentSlide\n : null}\n </div>\n ))}\n </div>\n </div>\n\n {showNavigationArrows && (\n <div data-carousel-controls>\n <IconButton\n data-arrow=\"left\"\n aria-controls={id}\n aria-label=\"previous\"\n onClick={slidePrevious}\n icon={<LeftArrowIcon />}\n />\n <IconButton\n data-arrow=\"right\"\n aria-controls={id}\n aria-label=\"next\"\n onClick={slideNext}\n icon={<RightArrowIcon />}\n />\n </div>\n )}\n\n {showPaginationBullets && (\n <div data-carousel-bullets>\n <Bullets\n tabIndex={0}\n totalQuantity={childrenCount}\n activeBullet={sliderState.currentPage}\n onClick={(_, idx) => {\n if (sliderState.sliding) {\n return\n }\n\n slide(idx, sliderDispatch)\n }}\n ariaControlsGenerator={(idx) => `carousel-item-${idx}`}\n onKeyDown={handleBulletsKeyDown}\n onFocus={(event) => {\n event.currentTarget.focus()\n }}\n />\n </div>\n )}\n </section>\n )\n}\n\nexport default Carousel\n","import { useRef, useEffect } from 'react'\n\nexport interface UseSlideVisibilityArgs {\n currentSlide: number\n itemsPerPage: number\n totalItems: number\n}\n\ninterface IsSlideVisibleArgs {\n itemsPerPage: number\n currentSlide: number\n slideIdx: number\n totalItems: number\n}\n\nfunction isSlideVisible({\n itemsPerPage,\n currentSlide,\n slideIdx,\n totalItems,\n}: IsSlideVisibleArgs) {\n const isClonedSlide = currentSlide < 0 || currentSlide >= totalItems\n const isVisible =\n slideIdx >= currentSlide && slideIdx < currentSlide + itemsPerPage\n\n return isClonedSlide || isVisible\n}\n\nexport default function useSlideVisibility({\n currentSlide,\n itemsPerPage,\n totalItems,\n}: UseSlideVisibilityArgs) {\n /** Keeps track of slides that have been visualized before.\n * We want to keep rendering them because the issue is mostly rendering\n * slides that might never be viewed; On the other hand, hiding slides\n * that were visible causes visual glitches */\n const visitedSlides = useRef<Set<number>>(new Set())\n\n useEffect(() => {\n for (let i = 0; i < itemsPerPage; i++) {\n visitedSlides.current.add(currentSlide + i)\n }\n }, [currentSlide, itemsPerPage])\n\n const isItemVisible = (index: number) =>\n isSlideVisible({\n slideIdx: index,\n currentSlide,\n itemsPerPage,\n totalItems,\n })\n\n const shouldRenderItem = (index: number) => {\n return visitedSlides.current.has(index) || isItemVisible(index)\n }\n\n return { shouldRenderItem, isItemVisible }\n}\n","import type {\n AriaAttributes,\n KeyboardEvent,\n MouseEvent,\n PropsWithChildren,\n} from 'react'\nimport React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport Overlay from '../../atoms/Overlay'\nimport ModalContent from './ModalContent'\nimport type { ModalContentProps } from './ModalContent'\n\nexport interface ModalProps extends ModalContentProps {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n * @see aria-labelledby https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby\n */\n 'aria-labelledby'?: AriaAttributes['aria-label']\n\n /**\n * This function is called whenever the user hits \"Escape\" or clicks outside\n * the dialog.\n */\n onDismiss?: (event: MouseEvent | KeyboardEvent) => void\n /**\n * Controls whether or not the dialog is open.\n */\n isOpen: boolean\n}\n\n/*\n * This component is based on @reach/dialog.\n * https://github.com/reach/reach-ui/blob/main/packages/dialog/src/index.tsx\n * https://reach.tech/dialog\n */\n\nconst Modal = ({\n isOpen,\n children,\n onDismiss,\n testId = 'store-modal',\n ...otherProps\n}: PropsWithChildren<ModalProps>) => {\n const handleBackdropClick = (event: MouseEvent) => {\n if (event.defaultPrevented) {\n return\n }\n\n event.stopPropagation()\n onDismiss?.(event)\n }\n\n const handleBackdropKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented) {\n return\n }\n\n event.stopPropagation()\n onDismiss?.(event)\n }\n\n return isOpen\n ? createPortal(\n <Overlay\n data-modal-overlay\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n >\n <ModalContent {...otherProps} testId={testId}>\n {children}\n </ModalContent>\n </Overlay>,\n document.body\n )\n : null\n}\n\nexport default Modal\n","import type { PopoverProps as ReachPopoverProps } from '@reach/popover'\nimport ReachPopover, { positionDefault } from '@reach/popover'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nexport type PopoverProps = Omit<ReachPopoverProps, 'position' | 'targetRef'> & {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * Ref for the component initial position.\n */\n targetRef: ReachPopoverProps['targetRef']\n children: ReactNode\n}\n\nconst Popover = ({\n targetRef,\n testId = 'store-popover',\n children,\n ...otherProps\n}: PopoverProps) => {\n return (\n <ReachPopover\n data-store-popover\n data-testid={testId}\n position={positionDefault}\n targetRef={targetRef}\n {...otherProps}\n >\n {children}\n </ReachPopover>\n )\n}\n\nexport default Popover\n","/**\n * This code is inspired by the work of [sandra-lewis](https://codesandbox.io/u/sandra-lewis)\n */\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\n\nexport type SliderProps = {\n /**\n * The minimum value of the slider.\n */\n min: number\n /**\n * The maximum value of the slider.\n */\n max: number\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n *\n * @default 'store-slider'\n */\n testId?: string\n /**\n * Callback that fires when the slider value changes.\n */\n onChange?: (value: { min: number; max: number }) => void\n /**\n * A function used to set a human-readable value text based on the slider's current value.\n */\n getAriaValueText?(value: number, thumb?: 'min' | 'max'): string\n /**\n * Returns the value of element's class content attribute.\n */\n className?: string\n}\n\nconst Slider = ({\n min,\n max,\n onChange,\n testId = 'store-slider',\n getAriaValueText,\n className,\n}: SliderProps) => {\n const [minVal, setMinVal] = useState(min)\n const [maxVal, setMaxVal] = useState(max)\n\n const minValRef = useRef(min)\n const maxValRef = useRef(max)\n const range = useRef<HTMLDivElement>(null)\n\n const getPercent = useCallback(\n (value) => Math.round(((value - min) / (max - min)) * 100),\n [min, max]\n )\n\n // width of the range to reduce from the left side\n useEffect(() => {\n const minPercent = getPercent(minVal)\n const maxPercent = getPercent(maxValRef.current)\n\n if (range.current) {\n range.current.style.left = `${minPercent}%`\n range.current.style.width = `${maxPercent - minPercent}%`\n }\n }, [minVal, getPercent])\n\n // width of the range to reduce from the right side\n useEffect(() => {\n const minPercent = getPercent(minValRef.current)\n const maxPercent = getPercent(maxVal)\n\n if (range.current) {\n range.current.style.width = `${maxPercent - minPercent}%`\n }\n }, [maxVal, getPercent])\n\n useEffect(() => {\n onChange?.({ min: minVal, max: maxVal })\n }, [minVal, maxVal, onChange])\n\n return (\n <div data-store-slider data-testid={testId} className={className}>\n <div ref={range} data-store-slider-range />\n <input\n type=\"range\"\n min={min}\n max={max}\n value={minVal}\n onChange={(event) => {\n const value = Math.min(Number(event.target.value), maxVal - 1)\n\n setMinVal(value)\n minValRef.current = value\n }}\n data-store-slider-thumb=\"left\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={minVal}\n aria-label={String(minVal)}\n aria-labelledby={\n getAriaValueText ? getAriaValueText(minVal, 'min') : undefined\n }\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n value={maxVal}\n onChange={(event) => {\n const value = Math.max(Number(event.target.value), minVal + 1)\n\n setMaxVal(value)\n maxValRef.current = value\n }}\n data-store-slider-thumb=\"right\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={maxVal}\n aria-label={String(maxVal)}\n aria-labelledby={\n getAriaValueText ? getAriaValueText(maxVal, 'max') : undefined\n }\n />\n </div>\n )\n}\n\nexport default Slider\n"],"names":["Button","forwardRef","children","testId","otherProps","ref","React","Input","variant","undefined","Icon","component","Price","as","Component","value","formatter","price","formattedPrice","TextArea","Checkbox","type","Overlay","role","Select","Radio","Badge","List","rawProps","dataAttributes","variantToType","Skeleton","Spinner","Label","defaultAriaLabel","idx","isActive","Bullets","totalQuantity","activeBullet","onClick","ariaLabelGenerator","ariaControlsGenerator","bulletIndexes","useMemo","Array","fill","map","_","tabIndex","key","e","Form","SearchIcon","xmlns","width","height","viewBox","stroke","strokeWidth","strokeLinecap","strokeLinejoin","cx","cy","r","x1","y1","x2","y2","SearchInput","onSubmit","icon","ariaLabel","valueRef","useRef","event","preventDefault","current","LeftArrowIcon","size","color","xmlnsXlink","d","strokeMiterlimit","RightArrowIcon","reducer","state","action","adjustedTotalPages","infinite","totalPages","nextPageIndex","currentPage","nextItemIndex","itemsPerPage","sliding","slideDirection","currentItem","previousPageIndex","total","previousPage","payload","pageIndex","shouldSlide","slide","page","dispatch","useSlider","totalItems","infiniteMode","swipeableConfigOverrides","sliderState","sliderDispatch","useReducer","Math","ceil","defaultSliderState","handlers","useSwipeable","onSwipedRight","onSwipedLeft","preventDefaultTouchmoveEvent","trackMouse","IconButton","buttonProps","ModalContentPure","beforeElementRef","trapFocusRef","afterElementRef","ModalContent","tabbableNodesRef","nodeToRestoreRef","document","hasFocus","activeElement","useEffect","nodeToRestore","focus","tabbable","firstTabbable","beforeElement","afterElement","trapFocus","handleLoopFocus","nativeEvent","length","target","addEventListener","removeEventListener","useTrapFocus","stopPropagation","PaymentMethods","title","id","AccordionContext","createContext","Accordion","indices","onChange","childrenWithIndex","Children","child","index","cloneElement","props","context","Set","numberOfItems","Provider","useAccordion","useContext","Error","AccordionItemContext","AccordionItem","panel","button","useAccordionItem","AccordionButton","has","onKeyDown","includes","next","Number","getElementById","getNext","previous","getPrevious","AccordionPanel","hidden","Table","TableRow","TableCell","scope","TableBody","TableHead","TableFooter","Alert","controls","transition","duration","property","childrenArray","toArray","childrenCount","numberOfSlides","slidingTransition","timing","delay","showNavigationArrows","showPaginationBullets","transformValues","transformMap","slideWidth","createTransformValues","isItemVisible","shouldRenderItem","currentSlide","visitedSlides","i","add","slideIdx","isSlideVisible","useSlideVisibility","postRenderedSlides","slice","slides","concat","slidePrevious","slideNext","style","overflow","display","transform","onTransitionEnd","onFocus","currentTarget","isOpen","onDismiss","createPortal","defaultPrevented","body","targetRef","ReachPopover","position","positionDefault","min","max","getAriaValueText","className","minVal","setMinVal","useState","maxVal","setMaxVal","minValRef","maxValRef","range","getPercent","useCallback","round","minPercent","maxPercent","left","String"],"mappings":"qRAWA,MAAMA,EAASC,cAA2C,UACxDC,SAAEA,EAAFC,OAAYA,EAAS,kBAAmBC,GACxCC,UAGEC,wCAAQD,IAAKA,uCAAoCF,GAAYC,GAC1DF,MCFDK,EAAQN,cAAyC,UACrDO,QAAEA,EAAFL,OAAWA,EAAS,iBAAkBC,GACtCC,UAQEC,uCACED,IAAKA,sCAEQF,GATA,cACW,UAAZK,QAAuBC,iBACT,YAAZD,QAAyBC,GASnCL,OChBJM,EAAOT,cAAuC,UAClDU,UAAEA,EAAFR,OAAaA,EAAS,gBAAiBC,GACvCC,UAGEC,sCAAMD,IAAKA,qCAAkCF,GAAYC,GACtDO,MCgBMC,EAAQX,cACnB,UAEIY,GAAIC,EAAY,OADlBX,OAEEA,EAAS,cAFXY,MAGEA,EAHFC,UAIEA,EAAaC,CAAAA,GAAUA,GAJzBT,QAKEA,EAAU,aACPJ,GAELC,SAEMa,EAAiBF,EAAUD,EAAOP,UAGtCF,gBAACQ,iBACCT,IAAKA,sCAEQF,iBACCK,GACVJ,GAEHc,MC3CHC,EAAWlB,cACf,UACEO,QAAEA,EAAFL,OAAWA,EAAS,oBAAqBC,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H,YAAU,WACF6H,EAAaH,EAAWH,EAAUjL,SAClCwL,EAAaJ,EAAWL,GAE1BI,EAAMnL,UACRmL,EAAMnL,QAAQwJ,MAAM9K,MAAW8M,EAAaD,QAE7C,CAACR,EAAQK,IAEZ1H,YAAU,WACRuB,GAAAA,EAAW,CAAEuF,IAAKI,EAAQH,IAAKM,KAC9B,CAACH,EAAQG,EAAQ9F,IAGlBxJ,4DAAoCH,EAAQqP,UAAWA,GACrDlP,uBAAKD,IAAK2P,iCACV1P,yBACEe,KAAK,QACLgO,IAAKA,EACLC,IAAKA,EACLvO,MAAO0O,EACP3F,SAAWnF,UACH5D,EAAQmG,KAAKmI,IAAI/D,OAAO3G,EAAMuE,OAAOnI,OAAQ6O,EAAS,GAE5DF,EAAU3O,GACV+O,EAAUjL,QAAU9D,6BAEE,uBACTsO,kBACAC,kBACAG,eACHc,OAAOd,qBAEjBF,EAAmBA,EAAiBE,EAAQ,YAAShP,IAGzDH,yBACEe,KAAK,QACLgO,IAAKA,EACLC,IAAKA,EACLvO,MAAO6O,EACP9F,SAAWnF,UACH5D,EAAQmG,KAAKoI,IAAIhE,OAAO3G,EAAMuE,OAAOnI,OAAQ0O,EAAS,GAE5DI,EAAU9O,GACVgP,EAAUlL,QAAU9D,6BAEE,wBACTsO,kBACAC,kBACAM,eACHW,OAAOX,qBAEjBL,EAAmBA,EAAiBK,EAAQ,YAASnP"}
|
|
1
|
+
{"version":3,"file":"ui.cjs.production.min.js","sources":["../src/atoms/Button/Button.tsx","../src/atoms/Input/Input.tsx","../src/atoms/Icon/Icon.tsx","../src/atoms/Price/Price.tsx","../src/atoms/TextArea/TextArea.tsx","../src/atoms/Checkbox/Checkbox.tsx","../src/atoms/Overlay/Overlay.tsx","../src/atoms/Select/Select.tsx","../src/atoms/Radio/Radio.tsx","../src/atoms/Badge/Badge.tsx","../src/atoms/List/List.tsx","../src/atoms/Skeleton/Skeleton.tsx","../src/atoms/Spinner/Spinner.tsx","../src/atoms/Label/Label.tsx","../src/molecules/Bullets/Bullets.tsx","../src/molecules/Form/Form.tsx","../src/molecules/SearchInput/SearchInput.tsx","../src/molecules/Carousel/Arrows.tsx","../src/hooks/useSlider/useSlider.ts","../src/molecules/IconButton/IconButton.tsx","../src/molecules/Modal/ModalContent.tsx","../src/molecules/Modal/useTrapFocus.ts","../src/molecules/PaymentMethods/PaymentMethods.tsx","../src/molecules/Accordion/Accordion.tsx","../src/molecules/Accordion/AccordionItem.tsx","../src/molecules/Accordion/AccordionButton.tsx","../src/molecules/Accordion/AccordionPanel.tsx","../src/molecules/Table/Table.tsx","../src/molecules/Table/TableRow.tsx","../src/molecules/Table/TableCell.tsx","../src/molecules/Table/TableBody.tsx","../src/molecules/Table/TableHead.tsx","../src/molecules/Table/TableFooter.tsx","../src/molecules/Alert/Alert.tsx","../src/molecules/Banner/Banner.tsx","../src/molecules/Carousel/Carousel.tsx","../src/molecules/Carousel/hooks/useSlideVisibility.ts","../src/molecules/Modal/Modal.tsx","../src/atoms/Popover/Popover.tsx","../src/atoms/Slider/Slider.tsx"],"sourcesContent":["import type { ButtonHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface ButtonProps<T = HTMLButtonElement>\n extends ButtonHTMLAttributes<T> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { children, testId = 'store-button', ...otherProps },\n ref\n) {\n return (\n <button ref={ref} data-store-button data-testid={testId} {...otherProps}>\n {children}\n </button>\n )\n})\n\nexport default Button\n","/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\nimport type { InputHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface InputProps extends InputHTMLAttributes<HTMLInputElement> {\n /**\n * Current variant of the input.\n */\n variant?: 'success' | 'error'\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Input = forwardRef<HTMLInputElement, InputProps>(function Input(\n { variant, testId = 'store-input', ...otherProps },\n ref\n) {\n const variants = {\n 'data-error': variant === 'error' || undefined,\n 'data-success': variant === 'success' || undefined,\n }\n\n return (\n <input\n ref={ref}\n data-store-input\n data-testid={testId}\n {...variants}\n {...otherProps}\n />\n )\n})\n\nexport default Input\n","import type { HTMLAttributes, ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface IconProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n * A React component that will be rendered as an icon.\n */\n component: ReactNode\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Icon = forwardRef<HTMLSpanElement, IconProps>(function Button(\n { component, testId = 'store-icon', ...otherProps }: IconProps,\n ref\n) {\n return (\n <span ref={ref} data-store-icon data-testid={testId} {...otherProps}>\n {component}\n </span>\n )\n})\n\nexport default Icon\n","import type { HTMLAttributes, ElementType, ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport type PriceVariant =\n | 'selling'\n | 'listing'\n | 'spot'\n | 'savings'\n | 'installment'\n\nexport type PriceFormatter = (price: number, variant: PriceVariant) => ReactNode\n\nexport interface PriceProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {\n /**\n * Set the HTML element tag of this component.\n */\n as?: ElementType\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * The raw price value.\n */\n value: number\n /**\n * Formatter function that transforms the raw price value and render the result.\n */\n formatter?: PriceFormatter\n /**\n * The current use case variant for prices.\n */\n variant?: PriceVariant\n}\n\nexport const Price = forwardRef<Omit<HTMLSpanElement, 'children'>, PriceProps>(\n function Price(\n {\n as: Component = 'span',\n testId = 'store-price',\n value,\n formatter = (price) => price,\n variant = 'selling',\n ...otherProps\n },\n ref\n ) {\n const formattedPrice = formatter(value, variant)\n\n return (\n <Component\n ref={ref}\n data-store-price\n data-testid={testId}\n data-variant={variant}\n {...otherProps}\n >\n {formattedPrice}\n </Component>\n )\n }\n)\n\nexport default Price\n","import type { TextareaHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TextAreaProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'children'> {\n /**\n * Current variant of the input.\n */\n variant?: 'success' | 'error'\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n { variant, testId = 'store-textarea', ...otherProps },\n ref\n ) {\n const variants = {\n 'data-success': variant === 'success' || undefined,\n 'data-error': variant === 'error' || undefined,\n }\n\n return (\n <textarea\n ref={ref}\n data-store-textarea\n data-testid={testId}\n {...variants}\n {...otherProps}\n />\n )\n }\n)\n\nexport default TextArea\n","import React, { forwardRef } from 'react'\nimport type { InputHTMLAttributes } from 'react'\n\nexport interface CheckboxProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(function Checkbox(\n { testId = 'store-checkbox', ...otherProps }: CheckboxProps,\n ref\n) {\n return (\n <input\n ref={ref}\n data-store-checkbox\n data-testid={testId}\n type=\"checkbox\"\n {...otherProps}\n />\n )\n})\n\nexport default Checkbox\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface Props extends HTMLAttributes<HTMLDivElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Overlay = forwardRef<HTMLDivElement, Props>(function Overlay(\n { testId = 'store-overlay', ...otherProps },\n ref\n) {\n return (\n <div\n role=\"presentation\"\n data-store-overlay\n data-testid={testId}\n ref={ref}\n {...otherProps}\n />\n )\n})\n\nexport default Overlay\n","import type { SelectHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(\n { children, testId = 'store-select', ...otherProps },\n ref\n) {\n return (\n <select ref={ref} data-store-select data-testid={testId} {...otherProps}>\n {children}\n </select>\n )\n})\n\nexport default Select\n","import React, { forwardRef } from 'react'\nimport type { InputHTMLAttributes } from 'react'\n\nexport interface RadioProps\n extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> {\n testId?: string\n}\n\nconst Radio = forwardRef<HTMLInputElement, RadioProps>(function Radio(\n { testId = 'store-radio', ...otherProps }: RadioProps,\n ref\n) {\n return (\n <input\n ref={ref}\n data-store-radio\n data-testid={testId}\n type=\"radio\"\n {...otherProps}\n />\n )\n})\n\nexport default Radio\n","import type { ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface BadgeProps {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children?: ReactNode\n}\n\nconst Badge = forwardRef<HTMLDivElement, BadgeProps>(function Badge(\n { testId = 'store-badge', children }: BadgeProps,\n ref\n) {\n return (\n <div ref={ref} data-testid={testId} data-store-badge>\n {children}\n </div>\n )\n})\n\nexport default Badge\n","import type {\n ElementType,\n ComponentPropsWithRef,\n ReactElement,\n FC,\n} from 'react'\nimport React, { forwardRef } from 'react'\n\nimport type { PolymorphicComponentPropsWithRef } from '../../typings'\n\nexport type ListVariant = 'description' | 'ordered' | 'unordered'\n\nconst variantToType = (variant: ListVariant) => {\n switch (variant) {\n case 'description':\n return 'dl'\n\n case 'unordered':\n return 'ul'\n\n case 'ordered':\n return 'ol'\n\n default:\n return 'ul'\n }\n}\n\ninterface Props {\n testId?: string\n variant?: ListVariant\n}\n\nexport type ListProps<C extends ElementType> = PolymorphicComponentPropsWithRef<\n C,\n Props\n>\n\ntype ListComponent = <C extends ElementType = 'ul'>(\n props: ListProps<C>\n) => ReactElement | null\n\nconst List: ListComponent = forwardRef(function List<\n C extends ElementType = 'ul'\n>(\n {\n testId = 'store-list',\n variant = 'unordered',\n as,\n ...rawProps\n }: ListProps<C>,\n ref: ComponentPropsWithRef<C>['ref']\n) {\n const dataAttributes = {\n 'data-testid': testId,\n 'data-store-list': true,\n [`data-${variant}`]: true,\n }\n\n const Component = as ?? variantToType(variant)\n\n return <Component ref={ref} {...dataAttributes} {...rawProps} />\n})\n\n/**\n * This is only being exported to make it easier to use in Storybook.\n * **DON'T** import this directly to use this component, use the default export\n * instead.\n */\nexport const StorybookList = List as FC<Props>\n\nexport default List\n","import React, { forwardRef } from 'react'\nimport type { HTMLAttributes } from 'react'\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { testId = 'store-skeleton', ...otherProps },\n ref\n) {\n return (\n <div ref={ref} data-store-skeleton data-testid={testId} {...otherProps} />\n )\n})\n\nexport default Skeleton\n","import React, { forwardRef } from 'react'\n\nexport type SpinnerProps = {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Spinner = forwardRef<HTMLDivElement, SpinnerProps>(function Spinner(\n { children, testId = 'store-spinner', ...otherProps },\n ref\n) {\n return (\n <span ref={ref} data-store-spinner data-testid={testId} {...otherProps} />\n )\n})\n\nexport default Spinner\n","import type { LabelHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst Label = forwardRef<HTMLLabelElement, LabelProps>(function Label(\n { testId = 'store-label', children, ...otherProps },\n ref\n) {\n return (\n <label ref={ref} data-store-label data-testid={testId} {...otherProps}>\n {children}\n </label>\n )\n})\n\nexport default Label\n","import type { HTMLAttributes, MouseEvent } from 'react'\nimport React, { forwardRef, useMemo } from 'react'\n\nimport Button from '../../atoms/Button'\n\nexport interface BulletsProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'role'> {\n /**\n * Number of bullets that should be rendered.\n */\n totalQuantity: number\n /**\n * The currently active bullet (zero-indexed).\n */\n activeBullet: number\n /**\n * Event handler for clicks on each bullet. The handler will be called with\n * the index of the bullet that received the click.\n */\n onClick: (e: MouseEvent, bulletIdx: number) => void\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n /**\n * Function that should be used to generate the aria-label attribute added\n * to each bullet that is inactive. It receives the bullet index as an\n * argument so that it can be interpolated in the generated string.\n */\n ariaLabelGenerator?: (index: number, isActive: boolean) => string\n /**\n * Function that should be used to generate the aria-controls attribute added\n * to each bullet. It receives the bullet index as argument and should return a string.\n */\n ariaControlsGenerator?: (index: number) => string\n}\n\nconst defaultAriaLabel = (idx: number, isActive: boolean) =>\n isActive ? 'Current page' : `Go to page ${idx + 1}`\n\nconst Bullets = forwardRef<HTMLDivElement, BulletsProps>(function Bullets(\n {\n totalQuantity,\n activeBullet,\n onClick,\n testId = 'store-bullets',\n ariaLabelGenerator = defaultAriaLabel,\n ariaControlsGenerator,\n ...otherProps\n },\n ref\n) {\n const bulletIndexes = useMemo(() => Array(totalQuantity).fill(0), [\n totalQuantity,\n ])\n\n return (\n <div\n ref={ref}\n data-store-bullets\n data-testid={testId}\n role=\"tablist\"\n {...otherProps}\n >\n {bulletIndexes.map((_, idx) => {\n const isActive = activeBullet === idx\n\n return (\n <Button\n data-bullet-item\n role=\"tab\"\n tabIndex={-1}\n key={idx}\n testId={`${testId}-item`}\n onClick={(e) => onClick(e, idx)}\n aria-label={ariaLabelGenerator(idx, isActive)}\n aria-controls={ariaControlsGenerator?.(idx)}\n aria-selected={isActive}\n />\n )\n })}\n </div>\n )\n})\n\nexport default Bullets\n","import type { FormHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface FormProps extends FormHTMLAttributes<HTMLFormElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n}\n\nconst Form = forwardRef<HTMLFormElement, FormProps>(function Form(\n { testId = 'store-form', children, ...otherProps },\n ref\n) {\n return (\n <form ref={ref} data-store-form data-testid={testId} {...otherProps}>\n {children}\n </form>\n )\n})\n\nexport default Form\n","import type {\n AriaAttributes,\n FormEvent,\n InputHTMLAttributes,\n ReactNode,\n} from 'react'\nimport React, { forwardRef, useRef } from 'react'\n\nimport Button from '../../atoms/Button'\nimport Icon from '../../atoms/Icon'\nimport Input from '../../atoms/Input'\nimport Form from '../Form'\n\nconst SearchIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"1em\"\n height=\"1em\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <line x1=\"21\" y1=\"21\" x2=\"16.65\" y2=\"16.65\" />\n </svg>\n)\n\ntype InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onSubmit'>\n\nexport interface SearchInputProps extends InputProps {\n /**\n * Callback function when submitted.\n */\n onSubmit: (value: string) => void\n /**\n * Custom icon inside the submit button.\n */\n icon?: ReactNode\n /**\n * Custom aria-label for input and button.\n */\n 'aria-label'?: AriaAttributes['aria-label']\n /**\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst SearchInput = forwardRef<HTMLFormElement, SearchInputProps>(\n function SearchInput(\n {\n onSubmit,\n icon,\n 'aria-label': ariaLabel = 'search',\n testId = 'store-search-input',\n ...otherProps\n },\n ref\n ) {\n const valueRef = useRef<HTMLInputElement>(null)\n\n const handleSubmit = (event: FormEvent) => {\n event.preventDefault()\n\n if (valueRef.current?.value !== '') {\n onSubmit(valueRef.current!.value)\n }\n }\n\n return (\n <Form\n ref={ref}\n data-store-search-input\n data-testid={testId}\n onSubmit={handleSubmit}\n >\n <Input ref={valueRef} aria-label={ariaLabel} {...otherProps} />\n <Button type=\"submit\" aria-label={`button-${ariaLabel}`}>\n <Icon component={icon ?? <SearchIcon />} />\n </Button>\n </Form>\n )\n }\n)\n\nexport default SearchInput\n","import React from 'react'\n\ninterface IconProps {\n size?: {\n width: number\n height: number\n }\n viewBox?: string\n color?: string\n}\n\nexport const LeftArrowIcon = ({\n size = { width: 25, height: 25 },\n viewBox = '0 0 16 16',\n color = 'currentColor',\n}: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n viewBox={viewBox}\n width={size.width}\n height={size.height}\n >\n <path\n d=\"M11 1L4 8L11 15\"\n strokeWidth=\"2\"\n strokeMiterlimit=\"10\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n stroke={color}\n fill=\"none\"\n />\n </svg>\n)\n\nexport const RightArrowIcon = ({\n size = { width: 25, height: 25 },\n viewBox = '0 0 16 16',\n color = 'currentColor',\n}: IconProps) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n viewBox={viewBox}\n width={size.width}\n height={size.height}\n >\n <path\n d=\"M5 15L12 8L5 1\"\n strokeWidth=\"2\"\n strokeMiterlimit=\"10\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n stroke={color}\n fill=\"none\"\n />\n </svg>\n)\n","import type { Dispatch } from 'react'\nimport { useReducer } from 'react'\nimport type { SwipeableProps } from 'react-swipeable'\nimport { useSwipeable } from 'react-swipeable'\n\nexport type SlideDirection = 'next' | 'previous'\n\ninterface NextPageAction {\n type: 'NEXT_PAGE'\n}\n\ninterface PreviousPageAction {\n type: 'PREVIOUS_PAGE'\n}\n\ninterface GoToPageAction {\n type: 'GO_TO_PAGE'\n payload: {\n pageIndex: number\n shouldSlide: boolean\n }\n}\n\ninterface StopSlideAction {\n type: 'STOP_SLIDE'\n}\n\nexport type Action =\n | NextPageAction\n | PreviousPageAction\n | StopSlideAction\n | GoToPageAction\n\nexport type SliderDispatch = Dispatch<Action>\n\nexport interface SliderState {\n /**\n * The `currentItem` in a Slider with multiple items in a single page is\n * always **the one with the lowest index** in the current page.\n */\n currentItem: number\n /** Currently active page */\n currentPage: number\n /**\n * Whether or not the Slider is currently sliding. This is useful to\n * manipulate the `transition` property in a component.\n */\n sliding: boolean\n /** The direction in which the Slider is sliding. */\n slideDirection: SlideDirection\n /** The total number of unique items in the slider. */\n totalItems: number\n /** The number of items in a single page. */\n itemsPerPage: number\n /** The total number of pages in the slider. */\n totalPages: number\n /** Whether or not the slider is infinite. */\n infinite: boolean\n}\n\nexport const nextPage = (current: number, total: number) =>\n (current + 1) % total\n\nexport const previousPage = (current: number, total: number) =>\n (total - ((total - current + 1) % total)) % total\n\nfunction reducer(state: SliderState, action: Action): SliderState {\n switch (action.type) {\n case 'NEXT_PAGE': {\n // If `state.infinite` is true, we need to take into account an extra\n // page in the calculation. This extra page is a clone of the first page.\n const adjustedTotalPages = state.infinite\n ? state.totalPages + 1\n : state.totalPages\n\n const nextPageIndex = nextPage(state.currentPage, adjustedTotalPages)\n\n const nextItemIndex =\n (nextPageIndex % adjustedTotalPages) * state.itemsPerPage\n\n return {\n ...state,\n sliding: true,\n slideDirection: 'next',\n currentItem: nextItemIndex,\n currentPage: nextPageIndex,\n }\n }\n\n case 'PREVIOUS_PAGE': {\n // If `state.infinite` is true, we need to take into account an extra\n // page in the calculation. This extra page is a clone of the first page.\n const adjustedTotalPages = state.infinite\n ? state.totalPages + 1\n : state.totalPages\n\n // If `state.infinite` is true and we're currently on page 0, we need to\n // let the slider go to page -1. This -1 page is a clone of the last page.\n const shouldGoToClone = state.infinite && state.currentPage === 0\n const previousPageIndex = shouldGoToClone\n ? -1\n : previousPage(state.currentPage, state.totalPages)\n\n return {\n ...state,\n sliding: true,\n slideDirection: 'previous',\n currentItem:\n (previousPageIndex % adjustedTotalPages) * state.itemsPerPage,\n currentPage: previousPageIndex,\n }\n }\n\n case 'GO_TO_PAGE': {\n if (action.payload.pageIndex === state.currentPage) {\n return state\n }\n\n return {\n ...state,\n sliding: action.payload.shouldSlide,\n slideDirection:\n action.payload.pageIndex > state.currentPage ? 'next' : 'previous',\n currentItem:\n (action.payload.pageIndex % state.totalPages) * state.itemsPerPage,\n currentPage: action.payload.pageIndex,\n }\n }\n\n case 'STOP_SLIDE':\n return { ...state, sliding: false }\n\n default:\n return state\n }\n}\n\nconst defaultSliderState = (\n totalItems: number,\n itemsPerPage: number,\n infinite: boolean\n): SliderState => ({\n currentItem: 0,\n currentPage: 0,\n sliding: false,\n slideDirection: 'next',\n totalItems,\n itemsPerPage,\n totalPages: Math.ceil(totalItems / itemsPerPage),\n infinite,\n})\n\nconst slide = (page: SlideDirection | number, dispatch: Dispatch<Action>) => {\n if (page === 'next') {\n dispatch({\n type: 'NEXT_PAGE',\n })\n }\n\n if (page === 'previous') {\n dispatch({\n type: 'PREVIOUS_PAGE',\n })\n }\n\n if (typeof page === 'number') {\n dispatch({\n type: 'GO_TO_PAGE',\n payload: {\n pageIndex: page,\n shouldSlide: true,\n },\n })\n }\n}\n\nexport interface UseSliderArgs extends SwipeableProps {\n /** The total number of unique items in the slider. */\n totalItems: number\n /** The number of items in a single slider page. */\n itemsPerPage?: number\n /** Whether or not the slider is infinite. */\n infiniteMode?: boolean\n}\n\nexport default function useSlider({\n totalItems,\n itemsPerPage = 1,\n infiniteMode = false,\n ...swipeableConfigOverrides\n}: UseSliderArgs) {\n const [sliderState, sliderDispatch] = useReducer(reducer, undefined, () =>\n defaultSliderState(totalItems, itemsPerPage, infiniteMode)\n )\n\n const handlers = useSwipeable({\n onSwipedRight: () => slide('previous', sliderDispatch),\n onSwipedLeft: () => slide('next', sliderDispatch),\n preventDefaultTouchmoveEvent: true,\n trackMouse: true,\n ...swipeableConfigOverrides,\n })\n\n return {\n handlers,\n slide,\n sliderState,\n sliderDispatch,\n }\n}\n","import type { ReactNode } from 'react'\nimport React, { forwardRef } from 'react'\n\nimport Button from '../../atoms/Button'\nimport type { ButtonProps } from '../../atoms/Button'\nimport Icon from '../../atoms/Icon'\n\nexport interface Props extends Omit<ButtonProps, 'children'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * A React component that will be rendered as an icon.\n */\n icon: ReactNode\n}\n\nconst IconButton = forwardRef<HTMLButtonElement, Props>(function IconButton(\n { icon, testId = 'store-icon-button', ...buttonProps },\n ref\n) {\n return (\n <Button ref={ref} data-store-icon-button testId={testId} {...buttonProps}>\n <Icon component={icon} />\n </Button>\n )\n})\n\nexport default IconButton\n","/* eslint-disable jsx-a11y/no-noninteractive-tabindex */\nimport type {\n DetailedHTMLProps,\n HTMLAttributes,\n MouseEvent,\n RefObject,\n} from 'react'\nimport React, { useRef } from 'react'\n\nimport useTrapFocus from './useTrapFocus'\n\ninterface ModalContentPureProps\n extends Omit<\n DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>,\n 'ref'\n > {\n beforeElementRef: RefObject<HTMLDivElement>\n trapFocusRef: RefObject<HTMLDivElement>\n afterElementRef: RefObject<HTMLDivElement>\n testId?: string\n}\n\nconst ModalContentPure = ({\n beforeElementRef,\n trapFocusRef,\n afterElementRef,\n testId = 'store-modal-content',\n children,\n ...otherProps\n}: ModalContentPureProps) => {\n return (\n <>\n <div\n ref={beforeElementRef}\n data-testid=\"beforeElement\"\n tabIndex={0}\n aria-hidden=\"true\"\n />\n <div\n data-store-modal-content\n {...otherProps}\n data-testid={testId}\n ref={trapFocusRef}\n aria-modal=\"true\"\n role=\"dialog\"\n tabIndex={-1}\n >\n {children}\n </div>\n <div\n ref={afterElementRef}\n data-testid=\"afterElement\"\n tabIndex={0}\n aria-hidden=\"true\"\n />\n </>\n )\n}\n\nexport type ModalContentProps = Omit<\n ModalContentPureProps,\n 'trapFocusRef' | 'onClick' | 'beforeElementRef' | 'afterElementRef'\n>\n\nconst ModalContent = ({ children, ...otherProps }: ModalContentProps) => {\n const trapFocusRef = useRef<HTMLDivElement>(null)\n const beforeElementRef = useRef<HTMLDivElement>(null)\n const afterElementRef = useRef<HTMLDivElement>(null)\n\n useTrapFocus({\n beforeElementRef,\n trapFocusRef,\n afterElementRef,\n })\n\n return (\n <ModalContentPure\n {...otherProps}\n trapFocusRef={trapFocusRef}\n beforeElementRef={beforeElementRef}\n afterElementRef={afterElementRef}\n onClick={(event: MouseEvent) => {\n event.stopPropagation()\n }}\n >\n {children}\n </ModalContentPure>\n )\n}\n\nexport default ModalContent\n","import { useEffect, useRef } from 'react'\nimport type { RefObject } from 'react'\nimport type { FocusableElement } from 'tabbable'\nimport { tabbable } from 'tabbable'\n\ninterface TrapFocusParams {\n beforeElementRef: RefObject<HTMLElement>\n trapFocusRef: RefObject<HTMLElement>\n afterElementRef: RefObject<HTMLElement>\n}\n\n/*\n * Element that will maintain the focus inside trapFocusRef, focus the first element,\n * and focus back on the element that was in focus when useTrapFocus was triggered.\n *\n * Inspired by Reakit useTrapFocus https://github.com/reakit/reakit/blob/a211d94da9f3b683182568a56479b91afb1b85ae/packages/reakit/src/Dialog/__utils/useFocusTrap.ts\n */\nconst useTrapFocus = ({\n trapFocusRef,\n beforeElementRef,\n afterElementRef,\n}: TrapFocusParams) => {\n const tabbableNodesRef = useRef<FocusableElement[]>()\n const nodeToRestoreRef = useRef<HTMLElement | null>(\n document.hasFocus() ? (document.activeElement as HTMLElement) : null\n )\n\n // Focus back on the element that was focused when useTrapFocus is triggered.\n useEffect(() => {\n const nodeToRestore = nodeToRestoreRef.current\n\n return () => {\n nodeToRestore?.focus()\n }\n }, [nodeToRestoreRef])\n\n // Set focus on first tabbable element\n useEffect(() => {\n if (!trapFocusRef.current) {\n return\n }\n\n if (!tabbableNodesRef.current) {\n tabbableNodesRef.current = tabbable(trapFocusRef.current)\n }\n\n const [firstTabbable] = tabbableNodesRef.current\n\n if (!firstTabbable) {\n trapFocusRef.current.focus()\n\n return\n }\n\n firstTabbable.focus()\n }, [trapFocusRef])\n\n // Handle loop focus. Set keydown and focusin event listeners\n useEffect(() => {\n if (\n !trapFocusRef.current ||\n !beforeElementRef.current ||\n !afterElementRef.current\n ) {\n return\n }\n\n const beforeElement = beforeElementRef.current\n const afterElement = afterElementRef.current\n const trapFocus = trapFocusRef.current\n\n const handleLoopFocus = (nativeEvent: FocusEvent) => {\n if (!document.hasFocus()) {\n return\n }\n\n tabbableNodesRef.current = tabbable(trapFocusRef.current!)\n\n if (!tabbableNodesRef.current.length) {\n trapFocus.focus()\n }\n\n /*\n * Handle loop focus from beforeElementRef. This node can only be focused if the user press shift tab.\n * It will focus the last element of the trapFocusRef.\n */\n if (nativeEvent.target === beforeElement) {\n tabbableNodesRef.current[tabbableNodesRef.current.length - 1]?.focus()\n }\n\n /*\n * Handle loop focus from afterElementRef. This node can only be focused if the user press tab.\n * It will focus the first element of the trapFocusRef.\n */\n if (nativeEvent.target === afterElement) {\n tabbableNodesRef.current[0]?.focus()\n }\n }\n\n beforeElement?.addEventListener('focusin', handleLoopFocus)\n afterElement?.addEventListener('focusin', handleLoopFocus)\n\n return () => {\n beforeElement?.removeEventListener('focusin', handleLoopFocus)\n afterElement?.removeEventListener('focusin', handleLoopFocus)\n }\n }, [tabbableNodesRef, afterElementRef, beforeElementRef, trapFocusRef])\n}\n\nexport default useTrapFocus\n","import type { ReactNode, AriaAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface PaymentMethodsProps {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n /**\n * Title of the payment methods section (e.g.: \"Payment methods\",\n * \"Accepted Cards\").\n */\n title?: ReactNode\n /**\n * Defines a string value that labels the current element when\n * title is not used.\n */\n 'aria-label'?: AriaAttributes['aria-label']\n /**\n * Children will receive the flags to be displayed in the payment\n * methods section (e.g.:, visa, mastercard, etc).\n */\n children: ReactNode\n}\n\nconst PaymentMethods = forwardRef<HTMLDivElement, PaymentMethodsProps>(\n function PaymentMethods(\n {\n testId = 'store-payment-methods',\n title,\n 'aria-label': ariaLabel = 'Payment Methods',\n children,\n ...otherProps\n },\n ref\n ) {\n return (\n <div\n ref={ref}\n data-store-payment-methods\n data-testid={testId}\n {...otherProps}\n >\n {!!title && <div id=\"payment-methods\">{title}</div>}\n <div\n data-payment-methods-flags\n aria-labelledby={title ? 'payment-methods' : undefined}\n aria-label={title ? undefined : ariaLabel}\n >\n {children}\n </div>\n </div>\n )\n }\n)\n\nexport default PaymentMethods\n","import type { HTMLAttributes, ReactElement } from 'react'\nimport React, {\n useContext,\n cloneElement,\n forwardRef,\n createContext,\n} from 'react'\n\ninterface AccordionContext {\n indices: Set<number>\n onChange: (index: number) => void\n numberOfItems: number\n}\n\nconst AccordionContext = createContext<AccordionContext | undefined>(undefined)\n\nexport interface AccordionProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n /**\n * Indices that indicate which accordion items are opened.\n */\n indices: Iterable<number>\n /**\n * Function that is triggered when an accordion item is opened/closed.\n */\n onChange: (index: number) => void\n}\n\nconst Accordion = forwardRef<HTMLDivElement, AccordionProps>(function Accordion(\n { testId = 'store-accordion', indices, onChange, children, ...otherProps },\n ref\n) {\n const childrenWithIndex = React.Children.map(\n children as ReactElement,\n (child, index) => cloneElement(child, { index: child.props.index ?? index })\n )\n\n const context = {\n indices: new Set(indices),\n onChange,\n numberOfItems: childrenWithIndex.length,\n }\n\n return (\n <AccordionContext.Provider value={context}>\n <div\n ref={ref}\n data-store-accordion\n data-testid={testId}\n role=\"region\"\n {...otherProps}\n >\n {childrenWithIndex}\n </div>\n </AccordionContext.Provider>\n )\n})\n\nexport function useAccordion() {\n const context = useContext(AccordionContext)\n\n if (context === undefined) {\n throw new Error(\n 'Do not use Accordion components outside the Accordion context.'\n )\n }\n\n return context\n}\n\nexport default Accordion\n","import type { HTMLAttributes } from 'react'\nimport React, { useContext, forwardRef, createContext } from 'react'\n\ninterface AccordionItemContext {\n index: number\n panel: string\n button: string\n}\n\nconst AccordionItemContext = createContext<AccordionItemContext | undefined>(\n undefined\n)\n\nexport interface AccordionItemProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n /**\n * Index of the current accordion item within the accordion.\n */\n index?: number\n}\n\nconst AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(\n function AccordionItem(\n { testId = 'store-accordion-item', children, index = 0, ...otherProps },\n ref\n ) {\n const context = {\n index,\n panel: `panel--${index}`,\n button: `button--${index}`,\n }\n\n return (\n <AccordionItemContext.Provider value={context}>\n <div\n ref={ref}\n data-store-accordion-item\n data-testid={testId}\n {...otherProps}\n >\n {children}\n </div>\n </AccordionItemContext.Provider>\n )\n }\n)\n\nexport function useAccordionItem() {\n const context = useContext(AccordionItemContext)\n\n if (context === undefined) {\n throw new Error(\n 'Do not use AccordionItem components outside the AccordionItem context.'\n )\n }\n\n return context\n}\n\nexport default AccordionItem\n","import type { ButtonHTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nimport Button from '../../atoms/Button'\nimport { useAccordion } from './Accordion'\nimport { useAccordionItem } from './AccordionItem'\n\nexport interface AccordionButtonProps\n extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst AccordionButton = forwardRef<HTMLButtonElement, AccordionButtonProps>(\n function AccordionButton(\n { testId = 'store-accordion-button', children, ...otherProps },\n ref\n ) {\n const { indices, onChange, numberOfItems } = useAccordion()\n const { index, panel, button } = useAccordionItem()\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n if (!['ArrowDown', 'ArrowUp'].includes(event.key)) {\n return\n }\n\n const getNext = () => {\n const next = Number(index) + 1 === numberOfItems ? 0 : Number(index) + 1\n\n return document.getElementById(`button--${next}`)\n }\n\n const getPrevious = () => {\n const previous =\n Number(index) - 1 < 0 ? numberOfItems - 1 : Number(index) - 1\n\n return document.getElementById(`button--${previous}`)\n }\n\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault()\n getNext()?.focus()\n break\n\n case 'ArrowUp':\n event.preventDefault()\n getPrevious()?.focus()\n break\n\n default:\n }\n }\n\n return (\n <Button\n ref={ref}\n id={button}\n aria-expanded={indices.has(index)}\n aria-controls={panel}\n data-store-accordion-button\n data-testid={testId}\n onKeyDown={onKeyDown}\n onClick={() => {\n onChange(index)\n }}\n {...otherProps}\n >\n {children}\n </Button>\n )\n }\n)\n\nexport default AccordionButton\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nimport { useAccordion } from './Accordion'\nimport { useAccordionItem } from './AccordionItem'\n\nexport interface AccordionPanelProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n}\n\nconst AccordionPanel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel(\n { testId = 'store-accordion-panel', children, ...otherProps },\n ref\n ) {\n const { indices } = useAccordion()\n const { index, button, panel } = useAccordionItem()\n\n return (\n <div\n ref={ref}\n id={panel}\n aria-labelledby={button}\n role=\"region\"\n data-store-accordion-panel\n data-testid={testId}\n hidden={!indices.has(index)}\n {...otherProps}\n >\n {children}\n </div>\n )\n }\n)\n\nexport default AccordionPanel\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableProps extends HTMLAttributes<HTMLTableElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst Table = forwardRef<HTMLTableElement, TableProps>(function Table(\n { testId = 'store-table', children, ...otherProps },\n ref\n) {\n return (\n <table ref={ref} data-store-table data-testid={testId} {...otherProps}>\n {children}\n </table>\n )\n})\n\nexport default Table\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst TableRow = forwardRef<HTMLTableRowElement, TableRowProps>(\n function TableRow(\n { testId = 'store-table-row', children, ...otherProps },\n ref\n ) {\n return (\n <tr ref={ref} data-store-table-row data-testid={testId} {...otherProps}>\n {children}\n </tr>\n )\n }\n)\n\nexport default TableRow\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\ntype TableCellVariant = 'data' | 'header'\n\nexport interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * Specify if this component should be rendered as a header (`<th>`) or as a data cell (`<td>`).\n */\n variant?: TableCellVariant\n /**\n * Defines the cells that the header element (`<th>`) relates to.\n * @see scope https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope\n */\n scope?: 'col' | 'row' | 'rowgroup' | 'colgroup'\n}\n\nconst TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(\n function TableCell(\n {\n testId = 'store-table-cell',\n children,\n variant = 'data',\n scope,\n ...otherProps\n },\n ref\n ) {\n const Cell = variant === 'header' ? 'th' : 'td'\n\n return (\n <Cell\n ref={ref}\n data-store-table-cell={variant}\n data-testid={testId}\n scope={scope}\n {...otherProps}\n >\n {children}\n </Cell>\n )\n }\n)\n\nexport default TableCell\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableBodyProps\n extends HTMLAttributes<HTMLTableSectionElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>(\n function TableBody(\n { children, testId = 'store-table-body', ...otherProps },\n ref\n ) {\n return (\n <tbody\n ref={ref}\n data-testid={testId}\n data-store-table-body\n {...otherProps}\n >\n {children}\n </tbody>\n )\n }\n)\n\nexport default TableBody\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableHeadProps\n extends HTMLAttributes<HTMLTableSectionElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>(\n function TableHead(\n { children, testId = 'store-table-head', ...otherProps },\n ref\n ) {\n return (\n <thead\n ref={ref}\n data-testid={testId}\n data-store-table-head\n {...otherProps}\n >\n {children}\n </thead>\n )\n }\n)\n\nexport default TableHead\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface TableFooterProps\n extends HTMLAttributes<HTMLTableSectionElement> {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n children: React.ReactNode\n}\n\nconst TableFooter = forwardRef<HTMLTableSectionElement, TableFooterProps>(\n function TableFooter(\n { children, testId = 'store-table-footer', ...otherProps },\n ref\n ) {\n return (\n <tfoot\n ref={ref}\n data-testid={testId}\n data-store-table-footer\n {...otherProps}\n >\n {children}\n </tfoot>\n )\n }\n)\n\nexport default TableFooter\n","import type { HTMLAttributes } from 'react'\nimport React, { forwardRef } from 'react'\n\nexport interface AlertProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n}\n\nconst Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { testId = 'store-alert', children, ...otherProps },\n ref\n) {\n return (\n <div\n ref={ref}\n role=\"alert\"\n data-store-alert\n data-testid={testId}\n {...otherProps}\n >\n {children}\n </div>\n )\n})\n\nexport default Alert\n","import React from 'react'\n\ntype BannerDirectionVariant = 'vertical' | 'horizontal'\nexport interface BannerProps {\n /**\n * ID to find this component in testing tools (e.g.: cypress,\n * testing-library, and jest).\n */\n testId?: string\n children: React.ReactNode\n variant?: BannerDirectionVariant\n}\n\nconst Banner = ({\n testId = 'store-banner',\n children,\n variant = 'vertical',\n}: BannerProps) => {\n return (\n <article data-store-banner={variant} data-testid={testId}>\n {children}\n </article>\n )\n}\n\nexport default Banner\n","import type { KeyboardEvent, PropsWithChildren } from 'react'\nimport React, { useMemo } from 'react'\nimport type { SwipeableProps } from 'react-swipeable'\n\nimport { RightArrowIcon, LeftArrowIcon } from './Arrows'\nimport useSlider from '../../hooks/useSlider/useSlider'\nimport useSlideVisibility from './hooks/useSlideVisibility'\nimport Bullets from '../Bullets'\nimport IconButton from '../IconButton'\n\nconst createTransformValues = (infinite: boolean, totalItems: number) => {\n const transformMap: Record<number, number> = {}\n const slideWidth = 100 / totalItems\n\n for (let idx = 0; idx < totalItems; ++idx) {\n const currIdx = infinite ? idx - 1 : idx\n const transformValue = -(slideWidth * idx)\n\n transformMap[currIdx] = transformValue\n }\n\n return transformMap\n}\n\nexport interface CarouselProps extends SwipeableProps {\n id?: string\n testId?: string\n infiniteMode?: boolean\n controls?: 'complete' | 'navigationArrows' | 'paginationBullets'\n transition?: {\n duration: number\n property: string\n delay?: number\n timing?: string\n }\n}\n\nfunction Carousel({\n infiniteMode = true,\n controls = 'complete',\n testId = 'store-carousel',\n transition = {\n duration: 400,\n property: 'transform',\n },\n children,\n id = 'store-carousel',\n ...swipeableConfigOverrides\n}: PropsWithChildren<CarouselProps>) {\n const childrenArray = React.Children.toArray(children)\n const childrenCount = childrenArray.length\n const numberOfSlides = infiniteMode ? childrenCount + 2 : childrenCount\n const slidingTransition = `${transition.property} ${transition.duration}ms ${\n transition.timing ?? ''\n } ${transition.delay ?? ''}`\n\n const showNavigationArrows =\n controls === 'complete' || controls === 'navigationArrows'\n\n const showPaginationBullets =\n controls === 'complete' || controls === 'paginationBullets'\n\n const transformValues = useMemo(\n () => createTransformValues(infiniteMode, numberOfSlides),\n [numberOfSlides, infiniteMode]\n )\n\n const { handlers, slide, sliderState, sliderDispatch } = useSlider({\n totalItems: childrenCount,\n itemsPerPage: 1,\n infiniteMode,\n ...swipeableConfigOverrides,\n })\n\n const { isItemVisible, shouldRenderItem } = useSlideVisibility({\n itemsPerPage: sliderState.itemsPerPage,\n currentSlide: sliderState.currentItem,\n totalItems: childrenCount,\n })\n\n const postRenderedSlides =\n infiniteMode && children ? childrenArray.slice(0, 1) : []\n\n const preRenderedSlides =\n infiniteMode && children ? childrenArray.slice(childrenCount - 1) : []\n\n const slides = preRenderedSlides.concat(children ?? [], postRenderedSlides)\n\n const slidePrevious = () => {\n if (\n sliderState.sliding ||\n (!infiniteMode && sliderState.currentPage === 0)\n ) {\n return\n }\n\n slide('previous', sliderDispatch)\n }\n\n const slideNext = () => {\n if (\n sliderState.sliding ||\n (!infiniteMode && sliderState.currentPage === childrenCount - 1)\n ) {\n return\n }\n\n slide('next', sliderDispatch)\n }\n\n // accessible behavior for tablist\n const handleBulletsKeyDown = (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowLeft': {\n slidePrevious()\n break\n }\n\n case 'ArrowRight': {\n slideNext()\n break\n }\n\n case 'Home': {\n slide(0, sliderDispatch)\n break\n }\n\n case 'End': {\n slide(childrenCount - 1, sliderDispatch)\n break\n }\n\n default:\n }\n }\n\n return (\n <section\n id={id}\n data-store-carousel\n data-testid={testId}\n aria-label=\"carousel\"\n aria-roledescription=\"carousel\"\n >\n <div\n data-carousel-track-container\n style={{ overflow: 'hidden', width: '100%' }}\n {...handlers}\n >\n <div\n data-carousel-track\n style={{\n display: 'flex',\n transition: sliderState.sliding ? slidingTransition : undefined,\n width: `${numberOfSlides * 100}%`,\n transform: `translate3d(${\n transformValues[sliderState.currentPage]\n }%, 0, 0)`,\n }}\n onTransitionEnd={() => {\n sliderDispatch({\n type: 'STOP_SLIDE',\n })\n\n if (sliderState.currentItem >= childrenCount) {\n sliderDispatch({\n type: 'GO_TO_PAGE',\n payload: {\n pageIndex: 0,\n shouldSlide: false,\n },\n })\n }\n\n if (sliderState.currentItem < 0) {\n sliderDispatch({\n type: 'GO_TO_PAGE',\n payload: {\n pageIndex: sliderState.totalPages - 1,\n shouldSlide: false,\n },\n })\n }\n }}\n aria-live=\"polite\"\n >\n {slides.map((currentSlide, idx) => (\n <div\n role=\"tabpanel\"\n aria-roledescription=\"slide\"\n key={idx}\n id={`carousel-item-${idx}`}\n data-carousel-item\n style={{ width: '100%' }}\n data-visible={\n isItemVisible(idx - Number(infiniteMode)) || undefined\n }\n >\n {shouldRenderItem(idx - Number(infiniteMode))\n ? currentSlide\n : null}\n </div>\n ))}\n </div>\n </div>\n\n {showNavigationArrows && (\n <div data-carousel-controls>\n <IconButton\n data-arrow=\"left\"\n aria-controls={id}\n aria-label=\"previous\"\n onClick={slidePrevious}\n icon={<LeftArrowIcon />}\n />\n <IconButton\n data-arrow=\"right\"\n aria-controls={id}\n aria-label=\"next\"\n onClick={slideNext}\n icon={<RightArrowIcon />}\n />\n </div>\n )}\n\n {showPaginationBullets && (\n <div data-carousel-bullets>\n <Bullets\n tabIndex={0}\n totalQuantity={childrenCount}\n activeBullet={sliderState.currentPage}\n onClick={(_, idx) => {\n if (sliderState.sliding) {\n return\n }\n\n slide(idx, sliderDispatch)\n }}\n ariaControlsGenerator={(idx) => `carousel-item-${idx}`}\n onKeyDown={handleBulletsKeyDown}\n onFocus={(event) => {\n event.currentTarget.focus()\n }}\n />\n </div>\n )}\n </section>\n )\n}\n\nexport default Carousel\n","import { useRef, useEffect } from 'react'\n\nexport interface UseSlideVisibilityArgs {\n currentSlide: number\n itemsPerPage: number\n totalItems: number\n}\n\ninterface IsSlideVisibleArgs {\n itemsPerPage: number\n currentSlide: number\n slideIdx: number\n totalItems: number\n}\n\nfunction isSlideVisible({\n itemsPerPage,\n currentSlide,\n slideIdx,\n totalItems,\n}: IsSlideVisibleArgs) {\n const isClonedSlide = currentSlide < 0 || currentSlide >= totalItems\n const isVisible =\n slideIdx >= currentSlide && slideIdx < currentSlide + itemsPerPage\n\n return isClonedSlide || isVisible\n}\n\nexport default function useSlideVisibility({\n currentSlide,\n itemsPerPage,\n totalItems,\n}: UseSlideVisibilityArgs) {\n /** Keeps track of slides that have been visualized before.\n * We want to keep rendering them because the issue is mostly rendering\n * slides that might never be viewed; On the other hand, hiding slides\n * that were visible causes visual glitches */\n const visitedSlides = useRef<Set<number>>(new Set())\n\n useEffect(() => {\n for (let i = 0; i < itemsPerPage; i++) {\n visitedSlides.current.add(currentSlide + i)\n }\n }, [currentSlide, itemsPerPage])\n\n const isItemVisible = (index: number) =>\n isSlideVisible({\n slideIdx: index,\n currentSlide,\n itemsPerPage,\n totalItems,\n })\n\n const shouldRenderItem = (index: number) => {\n return visitedSlides.current.has(index) || isItemVisible(index)\n }\n\n return { shouldRenderItem, isItemVisible }\n}\n","import type {\n AriaAttributes,\n KeyboardEvent,\n MouseEvent,\n PropsWithChildren,\n} from 'react'\nimport React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport Overlay from '../../atoms/Overlay'\nimport ModalContent from './ModalContent'\nimport type { ModalContentProps } from './ModalContent'\n\nexport interface ModalProps extends ModalContentProps {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * Identifies the element (or elements) that labels the current element.\n * @see aria-labelledby https://www.w3.org/TR/wai-aria-1.1/#aria-labelledby\n */\n 'aria-labelledby'?: AriaAttributes['aria-label']\n\n /**\n * This function is called whenever the user hits \"Escape\" or clicks outside\n * the dialog.\n */\n onDismiss?: (event: MouseEvent | KeyboardEvent) => void\n /**\n * Controls whether or not the dialog is open.\n */\n isOpen: boolean\n}\n\n/*\n * This component is based on @reach/dialog.\n * https://github.com/reach/reach-ui/blob/main/packages/dialog/src/index.tsx\n * https://reach.tech/dialog\n */\n\nconst Modal = ({\n isOpen,\n children,\n onDismiss,\n testId = 'store-modal',\n ...otherProps\n}: PropsWithChildren<ModalProps>) => {\n const handleBackdropClick = (event: MouseEvent) => {\n if (event.defaultPrevented) {\n return\n }\n\n event.stopPropagation()\n onDismiss?.(event)\n }\n\n const handleBackdropKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented) {\n return\n }\n\n event.stopPropagation()\n onDismiss?.(event)\n }\n\n return isOpen\n ? createPortal(\n <Overlay\n data-modal-overlay\n onClick={handleBackdropClick}\n onKeyDown={handleBackdropKeyDown}\n >\n <ModalContent {...otherProps} testId={testId}>\n {children}\n </ModalContent>\n </Overlay>,\n document.body\n )\n : null\n}\n\nexport default Modal\n","import type { PopoverProps as ReachPopoverProps } from '@reach/popover'\nimport ReachPopover, { positionDefault } from '@reach/popover'\nimport type { ReactNode } from 'react'\nimport React from 'react'\n\nexport type PopoverProps = Omit<ReachPopoverProps, 'position' | 'targetRef'> & {\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n */\n testId?: string\n /**\n * Ref for the component initial position.\n */\n targetRef: ReachPopoverProps['targetRef']\n children: ReactNode\n}\n\nconst Popover = ({\n targetRef,\n testId = 'store-popover',\n children,\n ...otherProps\n}: PopoverProps) => {\n return (\n <ReachPopover\n data-store-popover\n data-testid={testId}\n position={positionDefault}\n targetRef={targetRef}\n {...otherProps}\n >\n {children}\n </ReachPopover>\n )\n}\n\nexport default Popover\n","/**\n * This code is inspired by the work of [sandra-lewis](https://codesandbox.io/u/sandra-lewis)\n */\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\n\nexport type SliderProps = {\n /**\n * The minimum value of the slider.\n */\n min: number\n /**\n * The maximum value of the slider.\n */\n max: number\n /**\n * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).\n *\n * @default 'store-slider'\n */\n testId?: string\n /**\n * Callback that fires when the slider value changes.\n */\n onChange?: (value: { min: number; max: number }) => void\n /**\n * A function used to set a human-readable value text based on the slider's current value.\n */\n getAriaValueText?(value: number, thumb?: 'min' | 'max'): string\n /**\n * Returns the value of element's class content attribute.\n */\n className?: string\n}\n\nconst Slider = ({\n min,\n max,\n onChange,\n testId = 'store-slider',\n getAriaValueText,\n className,\n}: SliderProps) => {\n const [minVal, setMinVal] = useState(min)\n const [maxVal, setMaxVal] = useState(max)\n\n const minValRef = useRef(min)\n const maxValRef = useRef(max)\n const range = useRef<HTMLDivElement>(null)\n\n const getPercent = useCallback(\n (value) => Math.round(((value - min) / (max - min)) * 100),\n [min, max]\n )\n\n // width of the range to reduce from the left side\n useEffect(() => {\n const minPercent = getPercent(minVal)\n const maxPercent = getPercent(maxValRef.current)\n\n if (range.current) {\n range.current.style.left = `${minPercent}%`\n range.current.style.width = `${maxPercent - minPercent}%`\n }\n }, [minVal, getPercent])\n\n // width of the range to reduce from the right side\n useEffect(() => {\n const minPercent = getPercent(minValRef.current)\n const maxPercent = getPercent(maxVal)\n\n if (range.current) {\n range.current.style.width = `${maxPercent - minPercent}%`\n }\n }, [maxVal, getPercent])\n\n useEffect(() => {\n onChange?.({ min: minVal, max: maxVal })\n }, [minVal, maxVal, onChange])\n\n return (\n <div data-store-slider data-testid={testId} className={className}>\n <div ref={range} data-store-slider-range />\n <input\n type=\"range\"\n min={min}\n max={max}\n value={minVal}\n onChange={(event) => {\n const value = Math.min(Number(event.target.value), maxVal - 1)\n\n setMinVal(value)\n minValRef.current = value\n }}\n data-store-slider-thumb=\"left\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={minVal}\n aria-label={String(minVal)}\n aria-labelledby={\n getAriaValueText ? getAriaValueText(minVal, 'min') : undefined\n }\n />\n <input\n type=\"range\"\n min={min}\n max={max}\n value={maxVal}\n onChange={(event) => {\n const value = Math.max(Number(event.target.value), minVal + 1)\n\n setMaxVal(value)\n maxValRef.current = value\n }}\n data-store-slider-thumb=\"right\"\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={maxVal}\n aria-label={String(maxVal)}\n aria-labelledby={\n getAriaValueText ? getAriaValueText(maxVal, 'max') : undefined\n }\n />\n </div>\n )\n}\n\nexport default Slider\n"],"names":["Button","forwardRef","children","testId","otherProps","ref","React","Input","variant","undefined","Icon","component","Price","as","Component","value","formatter","price","formattedPrice","TextArea","Checkbox","type","Overlay","role","Select","Radio","Badge","List","rawProps","dataAttributes","variantToType","Skeleton","Spinner","Label","defaultAriaLabel","idx","isActive","Bullets","totalQuantity","activeBullet","onClick","ariaLabelGenerator","ariaControlsGenerator","bulletIndexes","useMemo","Array","fill","map","_","tabIndex","key","e","Form","SearchIcon","xmlns","width","height","viewBox","stroke","strokeWidth","strokeLinecap","strokeLinejoin","cx","cy","r","x1","y1","x2","y2","SearchInput","onSubmit","icon","ariaLabel","valueRef","useRef","event","preventDefault","current","LeftArrowIcon","size","color","xmlnsXlink","d","strokeMiterlimit","RightArrowIcon","reducer","state","action","adjustedTotalPages","infinite","totalPages","nextPageIndex","currentPage","nextItemIndex","itemsPerPage","sliding","slideDirection","currentItem","previousPageIndex","total","previousPage","payload","pageIndex","shouldSlide","slide","page","dispatch","useSlider","totalItems","infiniteMode","swipeableConfigOverrides","sliderState","sliderDispatch","useReducer","Math","ceil","defaultSliderState","handlers","useSwipeable","onSwipedRight","onSwipedLeft","preventDefaultTouchmoveEvent","trackMouse","IconButton","buttonProps","ModalContentPure","beforeElementRef","trapFocusRef","afterElementRef","ModalContent","tabbableNodesRef","nodeToRestoreRef","document","hasFocus","activeElement","useEffect","nodeToRestore","focus","tabbable","firstTabbable","beforeElement","afterElement","trapFocus","handleLoopFocus","nativeEvent","length","target","addEventListener","removeEventListener","useTrapFocus","stopPropagation","PaymentMethods","title","id","AccordionContext","createContext","Accordion","indices","onChange","childrenWithIndex","Children","child","index","cloneElement","props","context","Set","numberOfItems","Provider","useAccordion","useContext","Error","AccordionItemContext","AccordionItem","panel","button","useAccordionItem","AccordionButton","has","onKeyDown","includes","next","Number","getElementById","getNext","previous","getPrevious","AccordionPanel","hidden","Table","TableRow","TableCell","scope","TableBody","TableHead","TableFooter","Alert","controls","transition","duration","property","childrenArray","toArray","childrenCount","numberOfSlides","slidingTransition","timing","delay","showNavigationArrows","showPaginationBullets","transformValues","transformMap","slideWidth","createTransformValues","isItemVisible","shouldRenderItem","currentSlide","visitedSlides","i","add","slideIdx","isSlideVisible","useSlideVisibility","postRenderedSlides","slice","slides","concat","slidePrevious","slideNext","style","overflow","display","transform","onTransitionEnd","onFocus","currentTarget","isOpen","onDismiss","createPortal","defaultPrevented","body","targetRef","ReachPopover","position","positionDefault","min","max","getAriaValueText","className","minVal","setMinVal","useState","maxVal","setMaxVal","minValRef","maxValRef","range","getPercent","useCallback","round","minPercent","maxPercent","left","String"],"mappings":"qRAWA,MAAMA,EAASC,cAA2C,UACxDC,SAAEA,EAAFC,OAAYA,EAAS,kBAAmBC,GACxCC,UAGEC,wCAAQD,IAAKA,uCAAoCF,GAAYC,GAC1DF,MCFDK,EAAQN,cAAyC,UACrDO,QAAEA,EAAFL,OAAWA,EAAS,iBAAkBC,GACtCC,UAQEC,uCACED,IAAKA,sCAEQF,GATA,cACW,UAAZK,QAAuBC,iBACT,YAAZD,QAAyBC,GASnCL,OChBJM,EAAOT,cAAuC,UAClDU,UAAEA,EAAFR,OAAaA,EAAS,gBAAiBC,GACvCC,UAGEC,sCAAMD,IAAKA,qCAAkCF,GAAYC,GACtDO,MCgBMC,EAAQX,cACnB,UAEIY,GAAIC,EAAY,OADlBX,OAEEA,EAAS,cAFXY,MAGEA,EAHFC,UAIEA,EAAaC,CAAAA,GAAUA,GAJzBT,QAKEA,EAAU,aACPJ,GAELC,SAEMa,EAAiBF,EAAUD,EAAOP,UAGtCF,gBAACQ,iBACCT,IAAKA,sCAEQF,iBACCK,GACVJ,GAEHc,MC3CHC,EAAWlB,cACf,UACEO,QAAEA,EAAFL,OAAWA,EAAS,oBAAqBC,GACzCC,UAQEC,0CACED,IAAKA,yCAEQF,GATA,gBACa,YAAZK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AAW8M,EAAaD,QAE7C,CAACX,EAAQQ,IAGZ1H,YAAU,WACF6H,EAAaH,EAAWH,EAAUjL,SAClCwL,EAAaJ,EAAWL,GAE1BI,EAAMnL,UACRmL,EAAMnL,QAAQwJ,MAAM9K,MAAW8M,EAAaD,QAE7C,CAACR,EAAQK,IAEZ1H,YAAU,WACRuB,GAAAA,EAAW,CAAEuF,IAAKI,EAAQH,IAAKM,KAC9B,CAACH,EAAQG,EAAQ9F,IAGlBxJ,4DAAoCH,EAAQqP,UAAWA,GACrDlP,uBAAKD,IAAK2P,iCACV1P,yBACEe,KAAK,QACLgO,IAAKA,EACLC,IAAKA,EACLvO,MAAO0O,EACP3F,SAAWnF,UACH5D,EAAQmG,KAAKmI,IAAI/D,OAAO3G,EAAMuE,OAAOnI,OAAQ6O,EAAS,GAE5DF,EAAU3O,GACV+O,EAAUjL,QAAU9D,6BAEE,uBACTsO,kBACAC,kBACAG,eACHc,OAAOd,qBAEjBF,EAAmBA,EAAiBE,EAAQ,YAAShP,IAGzDH,yBACEe,KAAK,QACLgO,IAAKA,EACLC,IAAKA,EACLvO,MAAO6O,EACP9F,SAAWnF,UACH5D,EAAQmG,KAAKoI,IAAIhE,OAAO3G,EAAMuE,OAAOnI,OAAQ0O,EAAS,GAE5DI,EAAU9O,GACVgP,EAAUlL,QAAU9D,6BAEE,wBACTsO,kBACAC,kBACAM,eACHW,OAAOX,qBAEjBL,EAAmBA,EAAiBK,EAAQ,YAASnP"}
|
package/dist/ui.esm.js
CHANGED
|
@@ -1002,6 +1002,17 @@ const Modal = ({
|
|
|
1002
1002
|
}), children)), document.body) : null;
|
|
1003
1003
|
};
|
|
1004
1004
|
|
|
1005
|
+
const Banner = ({
|
|
1006
|
+
testId = 'store-banner',
|
|
1007
|
+
children,
|
|
1008
|
+
variant = 'vertical'
|
|
1009
|
+
}) => {
|
|
1010
|
+
return React.createElement("article", {
|
|
1011
|
+
"data-store-banner": variant,
|
|
1012
|
+
"data-testid": testId
|
|
1013
|
+
}, children);
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1005
1016
|
const PaymentMethods = /*#__PURE__*/forwardRef(function PaymentMethods({
|
|
1006
1017
|
testId = 'store-payment-methods',
|
|
1007
1018
|
title,
|
|
@@ -1264,5 +1275,5 @@ const Alert = /*#__PURE__*/forwardRef(function Alert({
|
|
|
1264
1275
|
}, otherProps), children);
|
|
1265
1276
|
});
|
|
1266
1277
|
|
|
1267
|
-
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert, Badge, Bullets, Button, Carousel, Checkbox, Form, Icon, IconButton, Input, Label, List, Modal, Overlay, PaymentMethods, Popover, Price, Radio, SearchInput, Select, Skeleton, Slider, Spinner, Table, TableBody, TableCell, TableFooter, TableHead, TableRow, TextArea, useSlider };
|
|
1278
|
+
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert, Badge, Banner, Bullets, Button, Carousel, Checkbox, Form, Icon, IconButton, Input, Label, List, Modal, Overlay, PaymentMethods, Popover, Price, Radio, SearchInput, Select, Skeleton, Slider, Spinner, Table, TableBody, TableCell, TableFooter, TableHead, TableRow, TextArea, useSlider };
|
|
1268
1279
|
//# sourceMappingURL=ui.esm.js.map
|