@theroutingcompany/components 0.0.51-alpha.0 → 0.0.51-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2062,7 +2062,6 @@ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var ee=ce(q,re,Y,ie,le+"
2062
2062
  border-radius: 4px 0 0 4px;
2063
2063
  margin: 0;
2064
2064
  flex: 1;
2065
- width: 0;
2066
2065
  height: ${p.sizing_600};
2067
2066
  `,MO=O.default.button`
2068
2067
  box-sizing: border-box;
@@ -2076,7 +2075,7 @@ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var ee=ce(q,re,Y,ie,le+"
2076
2075
  height: ${p.sizing_600};
2077
2076
  `,FO=O.default(ye.ChevronLeft)`
2078
2077
  transform: rotate(-90deg);
2079
- `;function mu(e){const{tooltipContent:t}=e,{contains:r}=Dg({sensitivity:"base"}),n=PO({...e,defaultFilter:r}),o=S.useRef(null),a=S.useRef(null),i=S.useRef(null),l=S.useRef(null),{buttonProps:s,inputProps:d,listBoxProps:u,labelProps:f,errorMessageProps:m}=wO({...e,inputRef:a,buttonRef:o,listBoxRef:i,popoverRef:l},n),{buttonProps:h}=Kn(s,o);return Q(Cx,{children:[Q(We,{...f,mb:p.spacing_100,children:[e.label,t?w(Dr,{children:t}):null]}),w(Wd,{height:p.sizing_600,right:w(MO,{...h,ref:o,children:w(FO,{style:{width:18,height:18},"aria-hidden":"true"})}),children:w(OO,{...d,ref:a,isFocused:n.isFocused})}),e.errorMessage?Q(on,{...m,children:[w(ye.Error,{}),e.errorMessage]}):null,n.isOpen?w(pu,{popoverRef:l,triggerRef:a,state:n,isNonModal:!0,placement:"bottom start",children:w(Tx,{...u,listBoxRef:i,state:n})}):null]})}mu.Item=ia,mu.Section=El;const NO=S.default.forwardRef(function(t,r){const{"data-id":n,color:o,children:a,...i}=t;return w(Be,{...i,ref:r,"data-id":n,margin:0,width:"100%",height:"1px",backgroundColor:o??p.color_gray_opacity_12,children:a})});var LO=Ta(bs,Rt,fs,Ye,qe,Pt,ho,Or,Je,sp,hP,bP,gP),zO=new RegExp("^("+LO.propNames.join("|")+")$"),RO=function(t){var r={};for(var n in t)zO.test(n)&&(r[n]=t[n]);return r};const KO=de.keyframes`
2078
+ `;function mu(e){const{tooltipContent:t}=e,{contains:r}=Dg({sensitivity:"base"}),n=PO({...e,defaultFilter:r}),o=S.useRef(null),a=S.useRef(null),i=S.useRef(null),l=S.useRef(null),{buttonProps:s,inputProps:d,listBoxProps:u,labelProps:f,errorMessageProps:m}=wO({...e,inputRef:a,buttonRef:o,listBoxRef:i,popoverRef:l},n),{buttonProps:h}=Kn(s,o);return Q(Cx,{children:[e.label?Q(We,{...f,mb:p.spacing_100,children:[e.label,t?w(Dr,{children:t}):null]}):null,w(Wd,{height:p.sizing_600,right:w(MO,{...h,ref:o,children:w(FO,{style:{width:18,height:18},"aria-hidden":"true"})}),children:w(OO,{...d,ref:a,isFocused:n.isFocused})}),e.errorMessage?Q(on,{...m,children:[w(ye.Error,{}),e.errorMessage]}):null,n.isOpen?w(pu,{popoverRef:l,triggerRef:a,state:n,isNonModal:!0,placement:"bottom start",children:w(Tx,{...u,listBoxRef:i,state:n})}):null]})}mu.Item=ia,mu.Section=El;const NO=S.default.forwardRef(function(t,r){const{"data-id":n,color:o,children:a,...i}=t;return w(Be,{...i,ref:r,"data-id":n,margin:0,width:"100%",height:"1px",backgroundColor:o??p.color_gray_opacity_12,children:a})});var LO=Ta(bs,Rt,fs,Ye,qe,Pt,ho,Or,Je,sp,hP,bP,gP),zO=new RegExp("^("+LO.propNames.join("|")+")$"),RO=function(t){var r={};for(var n in t)zO.test(n)&&(r[n]=t[n]);return r};const KO=de.keyframes`
2080
2079
  from { opacity: 0.5 }
2081
2080
  to { opacity: 1; }
2082
2081
  `,hu=O.default(Be)`
@@ -2369,7 +2368,7 @@ Valid keys: `+JSON.stringify(Object.keys(R),null," "));var ee=ce(q,re,Y,ie,le+"
2369
2368
  `,$N=O.default.span`
2370
2369
  display: none !important;
2371
2370
  position: absolute;
2372
- `,Xw=({children:e,placeholder:t,value:r="",editValue:n,hideIcon:o,p:a="7px 8px",onChange:i=()=>!1,onToggle:l=g=>g,onCancel:s=()=>!1,disabled:d=!1,valid:u=!0,label:f,labelId:m,allowedOutsideClickContainers:h,...b})=>{const g=c.useRef(null),[v,$]=c.useState(!1),[y,_]=c.useState(!1),D=Et(b,Vt.propNames??[]),P=Et(b,$i.propNames??[]),L=c.useCallback(()=>{$(!1),l(!1),_(!1)},[l]),T=c.useCallback(()=>{l(!0),_(!0)},[l]),x=c.useCallback(E=>{if(n&&n===r){L();return}$(!0),(async()=>{try{await i()}catch{throw new Error("failed to handle async inline edit change")}})().then(()=>{L()}).catch(()=>{L()})},[n,i,L,r]);c.useEffect(()=>{const E=()=>{L(),s()};return document.addEventListener("mousedown",V=>qw(V,g,E,h)),()=>document.removeEventListener("mousedown",V=>qw(V,g,E,h))},[h,s,L]),c.useEffect(()=>L,[]);const I=c.useCallback(()=>f&&typeof f=="string"?w(We,{bold:!0,size:"medium",htmlFor:f,color:p.color_gray_52,onClick:()=>!d&&T(),mb:p.spacing_100,children:f}):w(Ir,{children:f}),[d,T,f]);if(y)return Q(Ir,{children:[w(I,{}),w(Wd,{tabIndex:0,ref:g,right:w(gt,{ml:p.spacing_100,children:w(Zw,{onClick:x,disabled:v,children:v?w(ye.Loop,{}):w(ye.Check,{})})}),children:w(gN,{saving:v,children:e})})]});const z={p:a,...D,...P};return m?z.id=m:f!==void 0&&(z.id=f),Q(Ir,{children:[w(I,{}),Q(yN,{onClick:T,...z,"data-id":b["data-id"],disabled:d,children:[`${r}`||w(vN,{children:t}),!o&&!d&&w($N,{valid:u,children:w(ye.Edit,{})})]})]})};Xw.displayName="InlineEdit";const _N=O.default(Mt)`
2371
+ `,Xw=({children:e,placeholder:t,value:r="",editValue:n,hideIcon:o,p:a="7px 8px",onChange:i=()=>!1,onToggle:l=g=>g,onCancel:s=()=>!1,disabled:d=!1,valid:u=!0,label:f,labelId:m,allowedOutsideClickContainers:h,...b})=>{const g=c.useRef(null),[v,$]=c.useState(!1),[y,_]=c.useState(!1),D=Et(b,Vt.propNames??[]),P=Et(b,$i.propNames??[]),L=c.useCallback(()=>{$(!1),l(!1),_(!1)},[l]),T=c.useCallback(()=>{l(!0),_(!0)},[l]),x=c.useCallback(E=>{if(n&&n===r){L();return}$(!0),(async()=>{try{await i()}catch{throw new Error("failed to handle async inline edit change")}})().then(()=>{L()}).catch(()=>{L()})},[n,i,L,r]);c.useEffect(()=>{const E=()=>{L(),s()};return document.addEventListener("mousedown",V=>qw(V,g,E,h)),()=>document.removeEventListener("mousedown",V=>qw(V,g,E,h))},[h,s,L]),c.useEffect(()=>L,[]);const I=c.useCallback(()=>f&&typeof f=="string"?w(We,{bold:!0,size:"medium",htmlFor:f,color:p.color_gray_52,onClick:()=>!d&&T(),mb:p.spacing_100,children:f}):w(Ir,{children:f}),[d,T,f]);if(y)return Q(Ir,{children:[w(I,{}),w(Wd,{tabIndex:0,ref:g,right:w(gt,{ml:p.spacing_100,children:w(Zw,{onClick:x,disabled:v,"aria-label":"save",children:v?w(ye.Loop,{}):w(ye.Check,{})})}),children:w(gN,{saving:v,children:e})})]});const z={p:a,...D,...P};return m?z.id=m:f!==void 0&&(z.id=f),Q(Ir,{children:[w(I,{}),Q(yN,{onClick:T,...z,"data-id":b["data-id"],disabled:d,children:[`${r}`||w(vN,{children:t}),!o&&!d&&w($N,{valid:u,children:w(ye.Edit,{})})]})]})};Xw.displayName="InlineEdit";const _N=O.default(Mt)`
2373
2372
  font-family: ${p.font_family_pingo};
2374
2373
  font-size: 0.875rem;
2375
2374
  font-style: normal;
@@ -2802,7 +2801,7 @@ const theme2 = createTheme({ palette: {
2802
2801
  `,eV=O.default.span`
2803
2802
  display: inline-flex;
2804
2803
  align-items: center;
2805
- `;function tV(e){const t=XK(e),{placeholder:r="Select...",hideLabel:n,showCaret:o=!0}=e,a=S.useRef(null),{labelProps:i,triggerProps:l,valueProps:s,menuProps:d,errorMessageProps:u}=YK(e,t,a),{buttonProps:f}=Kn(l,a),{focusProps:m,isFocusVisible:h}=qr();return Q(nn,{children:[Q(We,{...i,srOnly:n,mb:p.spacing_100,children:[e.label,e.tooltipContent?w(Dr,{icon:e.tooltipIcon,children:e.tooltipContent}):null]}),w(ZK,{state:t,triggerRef:a,label:e.label,name:e.name}),Q(QK,{...me(f,m),paddingSize:"small",ref:a,isOpen:t.isOpen,isFocusVisible:h,children:[w(eV,{...s,children:w(Mt,{children:t.selectedItem?t.selectedItem.rendered:r})}),o?w(JK,{children:w(ye.ArrowDropDown,{})}):null]}),e.errorMessage?Q(on,{...u,children:[w(ye.Error,{}),e.errorMessage]}):null,t.isOpen?w(pu,{state:t,triggerRef:a,children:w(Tx,{...d,state:t})}):null]})}const cS="Switch",[rV,ZB]=Ne(cS),[nV,oV]=rV(cS),aV=c.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:l,value:s="on",onCheckedChange:d,...u}=e,[f,m]=c.useState(null),h=he(t,y=>m(y)),b=c.useRef(!1),g=f?!!f.closest("form"):!0,[v=!1,$]=Le({prop:o,defaultProp:a,onChange:d});return c.createElement(nV,{scope:r,checked:v,disabled:l},c.createElement(se.button,C({type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":dS(v),"data-disabled":l?"":void 0,disabled:l,value:s},u,{ref:h,onClick:J(e.onClick,y=>{$(_=>!_),g&&(b.current=y.isPropagationStopped(),b.current||y.stopPropagation())})})),g&&c.createElement(sV,{control:f,bubbles:!b.current,name:n,value:s,checked:v,required:i,disabled:l,style:{transform:"translateX(-100%)"}}))}),iV="SwitchThumb",lV=c.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=oV(iV,r);return c.createElement(se.span,C({"data-state":dS(o.checked),"data-disabled":o.disabled?"":void 0},n,{ref:t}))}),sV=e=>{const{control:t,checked:r,bubbles:n=!0,...o}=e,a=c.useRef(null),i=cl(r),l=Ci(t);return c.useEffect(()=>{const s=a.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(i!==r&&f){const m=new Event("click",{bubbles:n});f.call(s,r),s.dispatchEvent(m)}},[i,r,n]),c.createElement("input",C({type:"checkbox","aria-hidden":!0,defaultChecked:r},o,{tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function dS(e){return e?"checked":"unchecked"}const cV=aV,dV=lV,uV=O.default(cV)`
2804
+ `;function tV(e){const t=XK(e),{placeholder:r="Select...",hideLabel:n,showCaret:o=!0}=e,a=S.useRef(null),{labelProps:i,triggerProps:l,valueProps:s,menuProps:d,errorMessageProps:u}=YK(e,t,a),{buttonProps:f}=Kn(l,a),{focusProps:m,isFocusVisible:h}=qr();return Q(nn,{children:[e.label?Q(We,{...i,srOnly:n,mb:p.spacing_100,children:[e.label,e.tooltipContent?w(Dr,{icon:e.tooltipIcon,children:e.tooltipContent}):null]}):null,w(ZK,{state:t,triggerRef:a,label:e.label,name:e.name}),Q(QK,{...me(f,m),paddingSize:"small",ref:a,isOpen:t.isOpen,isFocusVisible:h,children:[w(eV,{...s,children:w(Mt,{children:t.selectedItem?t.selectedItem.rendered:r})}),o?w(JK,{children:w(ye.ArrowDropDown,{})}):null]}),e.errorMessage?Q(on,{...u,children:[w(ye.Error,{}),e.errorMessage]}):null,t.isOpen?w(pu,{state:t,triggerRef:a,children:w(Tx,{...d,state:t})}):null]})}const cS="Switch",[rV,ZB]=Ne(cS),[nV,oV]=rV(cS),aV=c.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:l,value:s="on",onCheckedChange:d,...u}=e,[f,m]=c.useState(null),h=he(t,y=>m(y)),b=c.useRef(!1),g=f?!!f.closest("form"):!0,[v=!1,$]=Le({prop:o,defaultProp:a,onChange:d});return c.createElement(nV,{scope:r,checked:v,disabled:l},c.createElement(se.button,C({type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":dS(v),"data-disabled":l?"":void 0,disabled:l,value:s},u,{ref:h,onClick:J(e.onClick,y=>{$(_=>!_),g&&(b.current=y.isPropagationStopped(),b.current||y.stopPropagation())})})),g&&c.createElement(sV,{control:f,bubbles:!b.current,name:n,value:s,checked:v,required:i,disabled:l,style:{transform:"translateX(-100%)"}}))}),iV="SwitchThumb",lV=c.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=oV(iV,r);return c.createElement(se.span,C({"data-state":dS(o.checked),"data-disabled":o.disabled?"":void 0},n,{ref:t}))}),sV=e=>{const{control:t,checked:r,bubbles:n=!0,...o}=e,a=c.useRef(null),i=cl(r),l=Ci(t);return c.useEffect(()=>{const s=a.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(i!==r&&f){const m=new Event("click",{bubbles:n});f.call(s,r),s.dispatchEvent(m)}},[i,r,n]),c.createElement("input",C({type:"checkbox","aria-hidden":!0,defaultChecked:r},o,{tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function dS(e){return e?"checked":"unchecked"}const cV=aV,dV=lV,uV=O.default(cV)`
2806
2805
  all: unset;
2807
2806
  width: 40px;
2808
2807
  height: 24px;