@theroutingcompany/components 0.0.117-alpha.2 → 0.0.117-alpha.3

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.
@@ -1662,7 +1662,7 @@ Valid keys: `+JSON.stringify(Object.keys(N),null," "));var le=_e(ae,se,H,X,Z+".
1662
1662
  width: 18px;
1663
1663
  height: 18px;
1664
1664
  margin-left: 8px;
1665
- `;function R$(e){const t=S.useRef(null),{listBoxRef:n=t,state:r}=e,{listBoxProps:o}=uy({...e,disallowEmptySelection:!0},r,n);return E(bd,{...o,ref:n,children:[...r.collection].map(a=>E(oA,{item:a,state:r},a.key))})}function rA(e){const t=S.useRef(null),{listBoxRef:n=t,state:r}=e,{listBoxProps:o}=uy({...e,disallowEmptySelection:!0},r,n);return E(bd,{...o,ref:n,children:[...r.collection].map(a=>E(aA,{item:a,state:r,isSelectableAll:!0},a.key))})}const $d=S.createContext(null);$d.displayName="OptionContext";function oA({item:e,state:t}){const n=S.useRef(null),{optionProps:r,labelProps:o,descriptionProps:a,isSelected:i,isFocused:l,isDisabled:s}=dy({key:e.key},t,n);return E(Dl,{...r,ref:n,isFocused:l,isSelected:i,isDisabled:s,children:E(vd,{children:Q($d.Provider,{value:{labelProps:o,descriptionProps:a},children:[E(tt,{as:"span",children:e.rendered}),E(yd,{children:i?E(De.Check,{"aria-hidden":"true",style:{width:18,height:18}}):null})]})})})}function aA({item:e,state:t}){var l;const n=S.useRef(null),r=dy({key:e.key},t,n),o=((l=e==null?void 0:e.value)==null?void 0:l.name)||"",a=e["aria-label"],i=a||o||"";return Q(Dl,{...r.optionProps,ref:n,isFocused:r.isFocused,isSelected:r.isSelected,"aria-label":i,children:[E(rd,{isDisabled:r.isDisabled,isSelected:r.isSelected,"aria-label":i}),E(vd,{children:Q($d.Provider,{value:{labelProps:r.labelProps,descriptionProps:r.labelProps},children:[E(tt,{as:"span",children:e.rendered}),E(yd,{children:r.isSelected?E(De.Check,{"aria-hidden":"true",style:{width:18,height:18}}):null})]})})]})}L.default.div`
1665
+ `;function R$(e){const t=S.useRef(null),{listBoxRef:n=t,state:r}=e,{listBoxProps:o}=uy({...e,disallowEmptySelection:!0},r,n);return E(bd,{...o,ref:n,children:[...r.collection].map(a=>E(oA,{item:a,state:r},a.key))})}function rA(e){const t=S.useRef(null),{listBoxRef:n=t,state:r}=e,{listBoxProps:o}=uy({...e,disallowEmptySelection:!0},r,n);return E(bd,{...o,ref:n,children:[...r.collection].map(a=>E(aA,{item:a,state:r,isSelectableAll:!0},a.key))})}const $d=S.createContext(null);$d.displayName="OptionContext";function oA({item:e,state:t}){const n=S.useRef(null),{optionProps:r,labelProps:o,descriptionProps:a,isSelected:i,isFocused:l,isDisabled:s}=dy({key:e.key},t,n);return E(Dl,{...r,ref:n,isFocused:l,isSelected:i,isDisabled:s,children:E(vd,{children:Q($d.Provider,{value:{labelProps:o,descriptionProps:a},children:[E(tt,{as:"span",overflowY:"hidden",children:e.rendered}),E(yd,{children:i?E(De.Check,{"aria-hidden":"true",style:{width:18,height:18}}):null})]})})})}function aA({item:e,state:t}){var l;const n=S.useRef(null),r=dy({key:e.key},t,n),o=((l=e==null?void 0:e.value)==null?void 0:l.name)||"",a=e["aria-label"],i=a||o||"";return Q(Dl,{...r.optionProps,ref:n,isFocused:r.isFocused,isSelected:r.isSelected,"aria-label":i,children:[E(rd,{isDisabled:r.isDisabled,isSelected:r.isSelected,"aria-label":i}),E(vd,{children:Q($d.Provider,{value:{labelProps:r.labelProps,descriptionProps:r.labelProps},children:[E(tt,{as:"span",children:e.rendered}),E(yd,{children:r.isSelected?E(De.Check,{"aria-hidden":"true",style:{width:18,height:18}}):null})]})})]})}L.default.div`
1666
1666
  font-weight: normal;
1667
1667
  font-size: 12px;
1668
1668
  `;const K$=L.default.div`
@@ -2161,7 +2161,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2161
2161
  &:focus-within {
2162
2162
  border-color: ${p.color_deprecated_fill_inverse_enabled};
2163
2163
  }
2164
- `;function cF({label:e,labelId:t="time-input-label",inputId:n="time-input",hideLabel:r,boldLabel:o=!0,interval:a=5,hourCycle:i="",defaultValue:l,onChange:s,placeholder:u="Enter a time",isInvalid:d,isDisabled:f,earliestScrollOption:g=new Sn(0,0),latestScrollOption:m=new Sn(23,59),...h}){const{locale:b}=at(),v=i===""?rF(b):i,[_,y]=c.useState(h.hideIcon),w=c.useMemo(()=>iF(a,g,m,v!=="24"),[g,v,a,m]),D=zl(l,h.value),T=v==="24"?ya(D):va(D),[P,M]=c.useState(T),$=c.createRef(),A=c.useRef(null),z=c.createRef(),x=ua({}),K=gc(h.value);c.useEffect(()=>{if(!h.value||(K==null?void 0:K.compare(h.value))!==0&&!x.isOpen){const B=zl(null,h.value),N=v==="24"?ya(B):va(B);M(N)}},[h.value,K,v,x.isOpen]);const O=c.useCallback(B=>{var J;const N=z.current,V=(J=N==null?void 0:N.getElementsByClassName(`${B}`))==null?void 0:J[0];if(N&&V){const U=N.getBoundingClientRect().top+N.scrollTop,X=V.getBoundingClientRect().top+N.scrollTop-U+N.scrollTop;N.scrollTo({top:X,behavior:"smooth"})}},[z]),I=c.useCallback(B=>{var J;const N=z.current,V=(J=N==null?void 0:N.getElementsByClassName(`${B}`))==null?void 0:J[0];if(N&&V){const U=N.getBoundingClientRect().top+N.scrollTop,X=V.getBoundingClientRect().top+N.scrollTop-U+N.scrollTop;N.scrollTop=X}},[z]),j=gc(x.isOpen);c.useEffect(()=>{if(!j&&x.isOpen){const B=Xx(a,v,h.value,w[0]?Ud(w[0],v):void 0);I(B)}},[P,x.isOpen,j,l,h.value,I,a,v,h,w]);const{overlayProps:C}=id({type:"dialog"},x,$);c.useEffect(()=>{const B=()=>{$.current&&$.current.offsetWidth<100?_||y(!0):_&&y(!1)};return window.addEventListener("resize",B),B(),()=>window.removeEventListener("resize",B)},[$,_]);const q=c.useCallback(B=>{if(B){const N=v=="24"?ya(B):va(B),V=Ud(N,v);s==null||s(V),M(N)}x.close()},[s,v,x]),G=c.useCallback(B=>{M(B.target.value),O(B.target.value),x.isOpen||x.open()},[x,O]);return oi(()=>{document.activeElement===$.current&&x.close()}),Q(Et,{children:[e?Q(Re,{id:t,htmlFor:n,srOnly:r,mb:p.spacing_150,bold:o,children:[e,h.tooltipContent?E(Qe,{icon:h.tooltipIcon,children:h.tooltipContent}):null]}):null,Q(me,{width:"100%",position:"relative",children:[E(Nt,{type:"text",autoComplete:"off",placeholder:u,id:n,value:P,fontSize:p.font_size_175,lineHeight:p.font_size_200,height:p.font_size_400,"data-state":d?"invalid":void 0,disabled:f,ref:$,onFocus:B=>{x.isOpen||x.open()},onBlur:B=>{z.current&&B.relatedTarget&&z.current.contains(B.relatedTarget)||q(P)},onKeyDown:B=>{B.key==="Enter"&&x.isOpen&&B.preventDefault();let N=w.findIndex(V=>V===P);N===-1&&(N=w.findIndex(V=>{if(B.key==="ArrowDown")return V===Xx(a,v,h.value,w[0]?Ud(w[0],v):void 0);if(B.key==="ArrowUp")return V===nF(h,a,v)})),B.key==="ArrowDown"&&w[N+1]&&(x.isOpen||x.open(),M(w[N+1]??P),O(w[N+1]??"")),B.key==="ArrowUp"&&w[N-1]&&(x.isOpen||x.open(),M(w[N-1]??P),O(w[N-1]??""))},onKeyUp:B=>{B.key==="Enter"&&q(P)},onMouseUp:B=>{B.preventDefault()},onChange:G,...gs(h)}),_?null:E(De.AccessTime,{"aria-hidden":"true",style:{position:"absolute",pointerEvents:"none",width:"1.1rem",height:"1.1rem",top:".45rem",right:".5rem"}})]}),h.errorMessage?E(St,{children:h.errorMessage}):null,x.isOpen?E(Gr,{state:x,targetRef:$,isTargetWidth:!0,popoverRef:A,...C,placement:"bottom start",isNonModal:!0,children:E(bd,{ref:z,onMouseDown:B=>B.preventDefault(),children:w.map((B,N)=>E(Dl,{value:B,isFocused:B===P,className:B||"",onClick:()=>{q(B)},children:E(tt,{as:"span",children:B})},N))})}):null]})}const ew=e=>{if(!e)return;let t=e.year,n=e.month;const r=1;return n===1?(n=12,t-=1):n-=1,new Ae(t,n,r)},tw=e=>{if(!e)return;let t=e.year,n=e.month;const r=1;return n===12?(n=1,t+=1):n+=1,new Ae(t,n,r)},Wd=["january","february","march","april","may","june","july","august","september","october","november","december"];function Rl(e){return e&&e.getFullYear()===new Date().getFullYear()?new Intl.DateTimeFormat("en-US",{weekday:"long",month:"long",day:"numeric"}).format(e):new Intl.DateTimeFormat("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}).format(e)}function uF({label:e,labelId:t="date-input-label",inputId:n="date-input",timeZone:r=Intl.DateTimeFormat().resolvedOptions().timeZone,hideLabel:o,boldLabel:a=!0,onChange:i,isInvalid:l,isDisabled:s,placeholder:u="Enter a date",isDateUnavailable:d,...f}){const[g,m]=c.useState(!!f.hideIcon),h=c.createRef(),b=c.createRef(),v=c.createRef(),_=c.useRef(null),y=ua({}),w=f.defaultValue?Rl(new Date(f.defaultValue.year,f.defaultValue.month-1,f.defaultValue.day)):void 0,D=f.value?Rl(new Date(f.value.year,f.value.month-1,f.value.day)):"",[T,P]=c.useState(w??D),[M,$]=c.useState(f.value??f.defaultValue),[A,z]=c.useState(M),{overlayProps:x}=id({type:"dialog"},y,h),K=gc(f.value);c.useEffect(()=>{f.value&&(K==null?void 0:K.compare(f.value))!==0&&!y.isOpen&&($(f.value),z(f.value),P(Rl(new Date(f.value.year,f.value.month-1,f.value.day))))},[f.value,K,y.isOpen]);const O=c.useCallback(C=>{const q=C??A;q&&($(q),z(q),P(Rl(new Date(q.year,q.month-1,q.day))),i==null||i(q),y.close())},[i,A,y]),I=c.useCallback(C=>{const q=Wd.findIndex(G=>G.startsWith(C.toLowerCase()));if(q>=0)return Wd[q]},[]);c.useEffect(()=>{const C=()=>{!f.hideIcon&&h.current&&h.current.offsetWidth<=155?g||m(!0):f.hideIcon||g&&m(!1)};return window.addEventListener("resize",C),C(),()=>window.removeEventListener("resize",C)},[h,g,f.hideIcon]);const j=c.useCallback(C=>{P(C.target.value),y.isOpen||y.open();const G=C.target.value.replace(",","").split(" ");let B,N,V;for(const U of G){if(U.match(/[a-zA-Z]+/)){const H=I(U);H&&(B=H)}if(U.match(/^[0-9]+$/)){if(U.length===1||U.length===2){const H=parseInt(U,10);H>=1&&H<=31&&(N=H)}if(U.length===4){const H=parseInt(U,10);H>=1e3&&H<=9999&&(V=H)}}}const J=new Ae(V??new Date().getFullYear(),Wd.findIndex(U=>U===B)+1,N??1);$(J),z(J)},[I,y]);return oi(()=>{document.activeElement===v.current&&y.close()}),Q(Et,{ref:h,children:[e?Q(Re,{id:t,htmlFor:n,srOnly:o,mb:p.spacing_150,bold:a,children:[e,f.tooltipContent?E(Qe,{icon:f.tooltipIcon,children:f.tooltipContent}):null]}):null,Q(me,{width:"100%",position:"relative",children:[E(Nt,{type:"text",autoComplete:"off",placeholder:u,id:n,value:T,fontSize:p.font_size_175,lineHeight:p.font_size_200,height:p.font_size_400,"data-state":l?"invalid":void 0,disabled:s,ref:v,onFocus:C=>{C.target.select(),y.isOpen||y.open()},onBlur:C=>{b.current&&C.relatedTarget&&b.current.contains(C.relatedTarget)||O()},onKeyDown:C=>{C.key==="Enter"&&y.isOpen&&C.preventDefault(),y.isOpen||y.open()},onKeyUp:C=>{C.key==="Enter"&&O()},onMouseUp:C=>{C.preventDefault()},onChange:j,...gs(f)}),g?null:E(De.CalendarToday,{"aria-hidden":"true",style:{position:"absolute",pointerEvents:"none",width:".875rem",height:".875rem",top:".5rem",right:"10px"}})]}),f.errorMessage?E(St,{children:f.errorMessage}):null,y.isOpen?E(Gr,{state:y,targetRef:h,popoverRef:_,...x,placement:"bottom start",isNonModal:!0,children:E(Ru,{ref:b,value:M,focusedValue:A,onChange:C=>{const q=new Ae(C.year,C.month,C.day);O(q)},onPrev:()=>{const C=ew(A);C&&z(C)},onNext:()=>{const C=tw(A);C&&z(C)},timeZone:r,isDateUnavailable:d})}):null]})}const dF=L.default(tt)`
2164
+ `;function cF({label:e,labelId:t="time-input-label",inputId:n="time-input",hideLabel:r,boldLabel:o=!0,interval:a=5,hourCycle:i="",defaultValue:l,onChange:s,placeholder:u="Enter a time",isInvalid:d,isDisabled:f,earliestScrollOption:g=new Sn(0,0),latestScrollOption:m=new Sn(23,59),...h}){const{locale:b}=at(),v=i===""?rF(b):i,[_,y]=c.useState(h.hideIcon),w=c.useMemo(()=>iF(a,g,m,v!=="24"),[g,v,a,m]),D=zl(l,h.value),T=v==="24"?ya(D):va(D),[P,M]=c.useState(T),$=c.createRef(),A=c.useRef(null),z=c.createRef(),x=ua({}),K=gc(h.value);c.useEffect(()=>{if(h.value&&(K==null?void 0:K.compare(h.value))!==0&&!x.isOpen){const B=zl(null,h.value),N=v==="24"?ya(B):va(B);M(N)}},[h.value,K,v,x.isOpen]);const O=c.useCallback(B=>{var J;const N=z.current,V=(J=N==null?void 0:N.getElementsByClassName(`${B}`))==null?void 0:J[0];if(N&&V){const U=N.getBoundingClientRect().top+N.scrollTop,X=V.getBoundingClientRect().top+N.scrollTop-U+N.scrollTop;N.scrollTo({top:X,behavior:"smooth"})}},[z]),I=c.useCallback(B=>{var J;const N=z.current,V=(J=N==null?void 0:N.getElementsByClassName(`${B}`))==null?void 0:J[0];if(N&&V){const U=N.getBoundingClientRect().top+N.scrollTop,X=V.getBoundingClientRect().top+N.scrollTop-U+N.scrollTop;N.scrollTop=X}},[z]),j=gc(x.isOpen);c.useEffect(()=>{if(!j&&x.isOpen){const B=Xx(a,v,h.value,w[0]?Ud(w[0],v):void 0);I(B)}},[P,x.isOpen,j,l,h.value,I,a,v,h,w]);const{overlayProps:C}=id({type:"dialog"},x,$);c.useEffect(()=>{const B=()=>{$.current&&$.current.offsetWidth<100?_||y(!0):_&&y(!1)};return window.addEventListener("resize",B),B(),()=>window.removeEventListener("resize",B)},[$,_]);const q=c.useCallback(B=>{if(B){const N=v=="24"?ya(B):va(B),V=Ud(N,v);s==null||s(V),M(N)}x.close()},[s,v,x]),G=c.useCallback(B=>{M(B.target.value),O(B.target.value),x.isOpen||x.open()},[x,O]);return oi(()=>{document.activeElement===$.current&&x.close()}),Q(Et,{children:[e?Q(Re,{id:t,htmlFor:n,srOnly:r,mb:p.spacing_150,bold:o,children:[e,h.tooltipContent?E(Qe,{icon:h.tooltipIcon,children:h.tooltipContent}):null]}):null,Q(me,{width:"100%",position:"relative",children:[E(Nt,{type:"text",autoComplete:"off",placeholder:u,id:n,value:P,fontSize:p.font_size_175,lineHeight:p.font_size_200,height:p.font_size_400,"data-state":d?"invalid":void 0,disabled:f,ref:$,onFocus:B=>{x.isOpen||x.open()},onBlur:B=>{z.current&&B.relatedTarget&&z.current.contains(B.relatedTarget)||q(P)},onKeyDown:B=>{B.key==="Enter"&&x.isOpen&&B.preventDefault();let N=w.findIndex(V=>V===P);N===-1&&(N=w.findIndex(V=>{if(B.key==="ArrowDown")return V===Xx(a,v,h.value,w[0]?Ud(w[0],v):void 0);if(B.key==="ArrowUp")return V===nF(h,a,v)})),B.key==="ArrowDown"&&w[N+1]&&(x.isOpen||x.open(),M(w[N+1]??P),O(w[N+1]??"")),B.key==="ArrowUp"&&w[N-1]&&(x.isOpen||x.open(),M(w[N-1]??P),O(w[N-1]??""))},onKeyUp:B=>{B.key==="Enter"&&q(P)},onMouseUp:B=>{B.preventDefault()},onChange:G,...gs(h)}),_?null:E(De.AccessTime,{"aria-hidden":"true",style:{position:"absolute",pointerEvents:"none",width:"1.1rem",height:"1.1rem",top:".45rem",right:".5rem"}})]}),h.errorMessage?E(St,{children:h.errorMessage}):null,x.isOpen?E(Gr,{state:x,targetRef:$,isTargetWidth:!0,popoverRef:A,...C,placement:"bottom start",isNonModal:!0,children:E(bd,{ref:z,onMouseDown:B=>B.preventDefault(),children:w.map((B,N)=>E(Dl,{value:B,isFocused:B===P,className:B||"",onClick:()=>{q(B)},children:E(tt,{as:"span",children:B})},N))})}):null]})}const ew=e=>{if(!e)return;let t=e.year,n=e.month;const r=1;return n===1?(n=12,t-=1):n-=1,new Ae(t,n,r)},tw=e=>{if(!e)return;let t=e.year,n=e.month;const r=1;return n===12?(n=1,t+=1):n+=1,new Ae(t,n,r)},Wd=["january","february","march","april","may","june","july","august","september","october","november","december"];function Rl(e){return e&&e.getFullYear()===new Date().getFullYear()?new Intl.DateTimeFormat("en-US",{weekday:"long",month:"long",day:"numeric"}).format(e):new Intl.DateTimeFormat("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}).format(e)}function uF({label:e,labelId:t="date-input-label",inputId:n="date-input",timeZone:r=Intl.DateTimeFormat().resolvedOptions().timeZone,hideLabel:o,boldLabel:a=!0,onChange:i,isInvalid:l,isDisabled:s,placeholder:u="Enter a date",isDateUnavailable:d,...f}){const[g,m]=c.useState(!!f.hideIcon),h=c.createRef(),b=c.createRef(),v=c.createRef(),_=c.useRef(null),y=ua({}),w=f.defaultValue?Rl(new Date(f.defaultValue.year,f.defaultValue.month-1,f.defaultValue.day)):void 0,D=f.value?Rl(new Date(f.value.year,f.value.month-1,f.value.day)):"",[T,P]=c.useState(w??D),[M,$]=c.useState(f.value??f.defaultValue),[A,z]=c.useState(M),{overlayProps:x}=id({type:"dialog"},y,h),K=gc(f.value);c.useEffect(()=>{f.value&&(K==null?void 0:K.compare(f.value))!==0&&!y.isOpen&&($(f.value),z(f.value),P(Rl(new Date(f.value.year,f.value.month-1,f.value.day))))},[f.value,K,y.isOpen]);const O=c.useCallback(C=>{const q=C??A;q&&($(q),z(q),P(Rl(new Date(q.year,q.month-1,q.day))),i==null||i(q),y.close())},[i,A,y]),I=c.useCallback(C=>{const q=Wd.findIndex(G=>G.startsWith(C.toLowerCase()));if(q>=0)return Wd[q]},[]);c.useEffect(()=>{const C=()=>{!f.hideIcon&&h.current&&h.current.offsetWidth<=155?g||m(!0):f.hideIcon||g&&m(!1)};return window.addEventListener("resize",C),C(),()=>window.removeEventListener("resize",C)},[h,g,f.hideIcon]);const j=c.useCallback(C=>{P(C.target.value),y.isOpen||y.open();const G=C.target.value.replace(",","").split(" ");let B,N,V;for(const U of G){if(U.match(/[a-zA-Z]+/)){const H=I(U);H&&(B=H)}if(U.match(/^[0-9]+$/)){if(U.length===1||U.length===2){const H=parseInt(U,10);H>=1&&H<=31&&(N=H)}if(U.length===4){const H=parseInt(U,10);H>=1e3&&H<=9999&&(V=H)}}}const J=new Ae(V??new Date().getFullYear(),Wd.findIndex(U=>U===B)+1,N??1);$(J),z(J)},[I,y]);return oi(()=>{document.activeElement===v.current&&y.close()}),Q(Et,{ref:h,children:[e?Q(Re,{id:t,htmlFor:n,srOnly:o,mb:p.spacing_150,bold:a,children:[e,f.tooltipContent?E(Qe,{icon:f.tooltipIcon,children:f.tooltipContent}):null]}):null,Q(me,{width:"100%",position:"relative",children:[E(Nt,{type:"text",autoComplete:"off",placeholder:u,id:n,value:T,fontSize:p.font_size_175,lineHeight:p.font_size_200,height:p.font_size_400,"data-state":l?"invalid":void 0,disabled:s,ref:v,onFocus:C=>{C.target.select(),y.isOpen||y.open()},onBlur:C=>{b.current&&C.relatedTarget&&b.current.contains(C.relatedTarget)||O()},onKeyDown:C=>{C.key==="Enter"&&y.isOpen&&C.preventDefault(),y.isOpen||y.open()},onKeyUp:C=>{C.key==="Enter"&&O()},onMouseUp:C=>{C.preventDefault()},onChange:j,...gs(f)}),g?null:E(De.CalendarToday,{"aria-hidden":"true",style:{position:"absolute",pointerEvents:"none",width:".875rem",height:".875rem",top:".5rem",right:"10px"}})]}),f.errorMessage?E(St,{children:f.errorMessage}):null,y.isOpen?E(Gr,{state:y,targetRef:h,popoverRef:_,...x,placement:"bottom start",isNonModal:!0,children:E(Ru,{ref:b,value:M,focusedValue:A,onChange:C=>{const q=new Ae(C.year,C.month,C.day);O(q)},onPrev:()=>{const C=ew(A);C&&z(C)},onNext:()=>{const C=tw(A);C&&z(C)},timeZone:r,isDateUnavailable:d})}):null]})}const dF=L.default(tt)`
2165
2165
  font-family: ${p.font_family_pingo};
2166
2166
  font-size: 0.875rem;
2167
2167
  font-style: normal;