@theroutingcompany/components 0.0.47 → 0.0.48

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.
@@ -2802,7 +2802,7 @@ const theme2 = createTheme({ palette: {
2802
2802
  `,eV=O.default.span`
2803
2803
  display: inline-flex;
2804
2804
  align-items: center;
2805
- `;function tV(e){const t=XK(e),{placeholder:r="Select...",hideLabel:n}=e,o=S.useRef(null),{labelProps:a,triggerProps:i,valueProps:l,menuProps:s}=YK(e,t,o),{buttonProps:d}=Rn(i,o),{focusProps:u,isFocusVisible:f}=qr();return Q(nn,{children:[Q(We,{...a,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:o,label:e.label,name:e.name}),Q(QK,{...me(d,u),paddingSize:"small",ref:o,isOpen:t.isOpen,isFocusVisible:f,children:[w(eV,{...l,children:w(Mt,{children:t.selectedItem?t.selectedItem.rendered:r})}),w(JK,{children:w(_e.ArrowDropDown,{})})]}),t.isOpen?w(pu,{state:t,triggerRef:o,children:w(Tx,{...s,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=sl(r),l=Ti(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)`
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}=YK(e,t,a),{buttonProps:u}=Rn(l,a),{focusProps:f,isFocusVisible:m}=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(u,f),paddingSize:"small",ref:a,isOpen:t.isOpen,isFocusVisible:m,children:[w(eV,{...s,children:w(Mt,{children:t.selectedItem?t.selectedItem.rendered:r})}),o?w(JK,{children:w(_e.ArrowDropDown,{})}):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=sl(r),l=Ti(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
2806
  all: unset;
2807
2807
  width: 40px;
2808
2808
  height: 24px;