@theroutingcompany/components 0.0.31 → 0.0.32-alpha.0
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/README.md +41 -32
- package/dist/trc-components.es.js +2532 -2531
- package/dist/trc-components.es.js.map +1 -1
- package/dist/trc-components.umd.js +8 -7
- package/dist/trc-components.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -5
|
@@ -677,7 +677,7 @@ object-assign
|
|
|
677
677
|
/* border-top-width: 0.5px; */
|
|
678
678
|
margin-top: -1px;
|
|
679
679
|
grid-area: decrement;
|
|
680
|
-
`;function Rv(e,t){var r;if(e.length&&((r=e[0])!=null&&r.value)){const n=e[0].value;return t.indexOf(n)}}const Lc=s.forwardRef((e,t)=>{const{description:r,disabled:n,readOnly:o,required:a,paddingSize:i="small",label:l,errorMessage:c,placeholder:d="Enter number...",showStepper:u=!0,min:f,max:p,height:h,locale:b="en-US",...g}=e,v=It(),y=n??v,$=o,x=a,D=yt(t),k=j6({...g,isDisabled:y,isReadOnly:$,isRequired:x,minValue:f,maxValue:p,placeholder:d,locale:b}),{labelProps:M,groupProps:I,inputProps:_,incrementButtonProps:T,decrementButtonProps:K,descriptionProps:E,errorMessageProps:L}=B6({...g,isDisabled:y,isReadOnly:$,isRequired:x,minValue:f,maxValue:p,placeholder:d,label:l},k,D);let S=null;typeof l=="string"?S=w(Be,{...M,mb:m.
|
|
680
|
+
`;function Rv(e,t){var r;if(e.length&&((r=e[0])!=null&&r.value)){const n=e[0].value;return t.indexOf(n)}}const Lc=s.forwardRef((e,t)=>{const{description:r,disabled:n,readOnly:o,required:a,paddingSize:i="small",label:l,errorMessage:c,placeholder:d="Enter number...",showStepper:u=!0,min:f,max:p,height:h,locale:b="en-US",...g}=e,v=It(),y=n??v,$=o,x=a,D=yt(t),k=j6({...g,isDisabled:y,isReadOnly:$,isRequired:x,minValue:f,maxValue:p,placeholder:d,locale:b}),{labelProps:M,groupProps:I,inputProps:_,incrementButtonProps:T,decrementButtonProps:K,descriptionProps:E,errorMessageProps:L}=B6({...g,isDisabled:y,isReadOnly:$,isRequired:x,minValue:f,maxValue:p,placeholder:d,label:l},k,D);let S=null;typeof l=="string"?S=w(Be,{...M,mb:m.spacing_100,children:l}):s.isValidElement(l)&&(S=s.cloneElement(l,{...M,mb:m.spacing_100}));const O=V=>{const{formatOptions:W}=e;if((W==null?void 0:W.style)==="unit"){const j=Intl.NumberFormat(b,W),R=j.formatToParts(1).filter(G=>G.type==="unit"),F=j.formatToParts(3).filter(G=>G.type==="unit"),N=Rv(R,k.inputValue),q=Rv(F,k.inputValue);let H;if(N&&N>-1?H=N:q&&q>-1&&(H=q),H){const G=V.target.selectionStart;if(G&&G>H){const ie=H-1;V.target.setSelectionRange(ie,ie)}}}};return te(Wr,{children:[S,u?te(U6,{...I,height:typeof h=="string"?h:void 0,children:[w(W6,{height:h,..._,paddingSize:i,ref:D,onClick:O,onFocus:O,required:a}),w(H6,{...T,children:w($e.KeyboardArrowUp,{})}),w(G6,{...K,children:w($e.KeyboardArrowDown,{})})]}):w(Vo,{height:h,ref:D,..._,paddingSize:i,required:a}),c?te(Bi,{...L,children:[w($e.Error,{}),c]}):null,r?w(ji,{...E,children:r}):null]})});Lc.displayName="NumberInput";const Vv=s.forwardRef((e,t)=>{const{errorMessage:r,description:n,disabled:o,readOnly:a,required:i,paddingSize:l="large",label:c,validationState:d,placeholder:u="Enter text...",...f}=e,p=yt(t),h=It(),b=o??h,{labelProps:g,descriptionProps:v,inputProps:y,errorMessageProps:$}=Io({...f,isDisabled:b,isReadOnly:a,isRequired:i,placeholder:u,label:c,inputElementType:"textarea"},p);let x=null;return typeof c=="string"?x=w(Be,{...g,mb:m.spacing_100,children:c}):s.isValidElement(c)&&(x=s.cloneElement(c,{...g,mb:m.spacing_100})),te(Wr,{children:[x,w(Vo,{as:"textarea","data-state":d,paddingSize:l,ref:p,placeholder:"Enter...",...y}),r?te(Bi,{...$,children:[w($e.Error,{}),r]}):null,n?w(ji,{...v,children:n}):null]})});Vv.displayName="TextAreaInput";const Kc=s.forwardRef((e,t)=>{const{focus:r,height:n,inputBorderRadius:o,connectLeft:a=null,connectRight:i=null,errorMessage:l,description:c,disabled:d,readOnly:u,required:f,paddingSize:p,label:h,validationState:b,placeholder:g="Enter text...",className:v,...y}=e,$=yt(t),x=It(),D=d??x,{labelProps:k,descriptionProps:M,inputProps:I,errorMessageProps:_}=Io({...y,isDisabled:D,isReadOnly:u,isRequired:f,placeholder:g,label:h},$);let T=null;return typeof h=="string"?T=w(Be,{...k,mb:m.spacing_100,children:h}):s.isValidElement(h)&&(T=s.cloneElement(h,{...k,mb:m.spacing_100})),s.useEffect(()=>{r&&$.current.focus()},[r,$]),te(Wr,{"data-id":"input-wrapper",children:[T,w(Sc,{left:a,right:i,children:w(Vo,{height:n,"data-id":"input-base",borderRadius:o,"data-state":b,paddingSize:p,ref:$,placeholder:"Enter...",type:"text",...I,required:f,className:v})}),l?te(Bi,{..._,children:[w($e.Error,{}),l]}):null,c?w(ji,{...M,children:c}):null]})});Kc.displayName="TextInput";const Rc=s.createContext({});Rc.displayName="FormControlContext";function Ui(){return s.useContext(Rc)}function Y6({children:e,label:t,errorMessage:r,description:n,tooltipContent:o,tooltipIcon:a,validationState:i,id:l,...c}){const{descriptionProps:d,errorMessageProps:u,fieldProps:f,labelProps:p}=To({errorMessage:r,label:t,description:n,validationState:i,id:l,...c});return w(Rc.Provider,{value:f,children:te(Wr,{children:[te(Be,{...p,display:"flex",children:[t,o?w(gr,{icon:a,children:o}):null]}),e,n?w(ji,{...d,children:n}):null,r?te(Bi,{...u,children:[w($e.Error,{}),r]}):null]})})}const Bv=s.forwardRef((e,t)=>{const{label:r,tooltipContent:n,tooltipIcon:o,...a}=e;return w(Kc,{paddingSize:"small",ref:t,label:te(Be,{children:[r,n?w(gr,{icon:o,children:n}):null]}),...a})});Bv.displayName="TextFormControl";const jv=s.forwardRef((e,t)=>{const{label:r,tooltipContent:n,tooltipIcon:o,...a}=e;return w(Vv,{ref:t,label:te(Be,{children:[r,n?w(gr,{icon:o,children:n}):null]}),...a})});jv.displayName="TextAreaFormControl";const Uv=s.forwardRef((e,t)=>{const{label:r,tooltipContent:n,tooltipIcon:o,...a}=e;return w(Lc,{ref:t,label:te(Be,{children:[r,n?w(gr,{icon:o,children:n}):null]}),...a})});Uv.displayName="NumberFormControl";function Wv(e){const t=It(),r=e??t;return{...Ui(),disabled:r}}const q6=()=>w("svg",{viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:w("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M 11.9577 4.4057 L 5.766 10.5974 L 2.4187 7.2501 L 3.4244 6.2445 L 5.766 8.5861 L 10.952 3.4 L 11.9577 4.4057 Z",fill:"white",stroke:"white",strokeWidth:"0.25"})}),Z6=()=>w("svg",{focusable:"false",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:w("path",{d:"M19 13 H5 v-3 h14 v2 z"})}),Vc=P.span`
|
|
681
681
|
display: grid;
|
|
682
682
|
place-items: center;
|
|
683
683
|
width: 16px;
|
|
@@ -797,7 +797,8 @@ object-assign
|
|
|
797
797
|
border: none;
|
|
798
798
|
padding: 6px 8px;
|
|
799
799
|
outline: none;
|
|
800
|
-
|
|
800
|
+
color: ${m.color_black};
|
|
801
|
+
font-size: ${m.font_size_175};
|
|
801
802
|
border: 1px solid;
|
|
802
803
|
border-right: none;
|
|
803
804
|
border-color: ${e=>e.isFocused?m.color_gray_6:m.color_gray_84};
|
|
@@ -818,7 +819,7 @@ object-assign
|
|
|
818
819
|
height: ${m.sizing_600};
|
|
819
820
|
`,a4=P($e.ChevronLeft)`
|
|
820
821
|
transform: rotate(-90deg);
|
|
821
|
-
`;function Uc(e){const{tooltipContent:t}=e,{contains:r}=ih({sensitivity:"base"}),n=lC({...e,defaultFilter:r}),o=Y.useRef(null),a=Y.useRef(null),i=Y.useRef(null),l=Y.useRef(null),{buttonProps:c,inputProps:d,listBoxProps:u,labelProps:f}=eC({...e,inputRef:a,buttonRef:o,listBoxRef:i,popoverRef:l},n),{buttonProps:p}=yn(c,o);return te(Xv,{children:[te(Be,{...f,mb:m.
|
|
822
|
+
`;function Uc(e){const{tooltipContent:t}=e,{contains:r}=ih({sensitivity:"base"}),n=lC({...e,defaultFilter:r}),o=Y.useRef(null),a=Y.useRef(null),i=Y.useRef(null),l=Y.useRef(null),{buttonProps:c,inputProps:d,listBoxProps:u,labelProps:f}=eC({...e,inputRef:a,buttonRef:o,listBoxRef:i,popoverRef:l},n),{buttonProps:p}=yn(c,o);return te(Xv,{children:[te(Be,{...f,mb:m.spacing_100,children:[e.label,t?w(gr,{children:t}):null]}),w(Sc,{height:m.sizing_600,right:w(o4,{...p,ref:o,children:w(a4,{style:{width:18,height:18},"aria-hidden":"true"})}),children:w(n4,{...d,ref:a,isFocused:n.isFocused})}),n.isOpen?w(jc,{popoverRef:l,triggerRef:a,state:n,isNonModal:!0,placement:"bottom start",children:w(Zv,{...u,listBoxRef:i,state:n})}):null]})}Uc.Item=Co,Uc.Section=Ei;const i4=P(gt)`
|
|
822
823
|
display: flex;
|
|
823
824
|
flex-direction: column;
|
|
824
825
|
|
|
@@ -2223,7 +2224,7 @@ Valid keys: `+JSON.stringify(Object.keys(F),null," "));var Q=se(Z,re,G,ie,le+".
|
|
|
2223
2224
|
`,lN=P.span`
|
|
2224
2225
|
display: none !important;
|
|
2225
2226
|
position: absolute;
|
|
2226
|
-
`,hw=({children:e,placeholder:t,value:r="",editValue:n,hideIcon:o,p:a="7px 8px",onChange:i=()=>!1,onToggle:l=b=>b,onCancel:c=()=>!1,disabled:d=!1,valid:u=!0,label:f,labelId:p,...h})=>{const b=s.useRef(null),[g,v]=s.useState(!1),[y,$]=s.useState(!1),x=lr(h,Rt.propNames??[]),D=lr(h,Gi.propNames??[]),k=s.useCallback(()=>{v(!1),l(!1),$(!1)},[l]),M=s.useCallback(()=>{l(!0),$(!0)},[l]),I=s.useCallback(K=>{if(n&&n===r){k();return}v(!0),(async()=>{try{await i()}catch{throw new Error("failed to handle async inline edit change")}})().then(()=>{k()}).catch(()=>{k()})},[n,i,k,r]);s.useEffect(()=>{const K=()=>{k(),c()};return document.addEventListener("mousedown",E=>pw(E,b,K)),()=>document.removeEventListener("mousedown",E=>pw(E,b,K))},[c,k]),s.useEffect(()=>k,[]);const _=s.useCallback(()=>f&&typeof f=="string"?w(Be,{bold:!0,size:"medium",htmlFor:f,color:m.color_gray_52,onClick:()=>!d&&M(),mb:m.
|
|
2227
|
+
`,hw=({children:e,placeholder:t,value:r="",editValue:n,hideIcon:o,p:a="7px 8px",onChange:i=()=>!1,onToggle:l=b=>b,onCancel:c=()=>!1,disabled:d=!1,valid:u=!0,label:f,labelId:p,...h})=>{const b=s.useRef(null),[g,v]=s.useState(!1),[y,$]=s.useState(!1),x=lr(h,Rt.propNames??[]),D=lr(h,Gi.propNames??[]),k=s.useCallback(()=>{v(!1),l(!1),$(!1)},[l]),M=s.useCallback(()=>{l(!0),$(!0)},[l]),I=s.useCallback(K=>{if(n&&n===r){k();return}v(!0),(async()=>{try{await i()}catch{throw new Error("failed to handle async inline edit change")}})().then(()=>{k()}).catch(()=>{k()})},[n,i,k,r]);s.useEffect(()=>{const K=()=>{k(),c()};return document.addEventListener("mousedown",E=>pw(E,b,K)),()=>document.removeEventListener("mousedown",E=>pw(E,b,K))},[c,k]),s.useEffect(()=>k,[]);const _=s.useCallback(()=>f&&typeof f=="string"?w(Be,{bold:!0,size:"medium",htmlFor:f,color:m.color_gray_52,onClick:()=>!d&&M(),mb:m.spacing_100,children:f}):w(nn,{children:f}),[d,M,f]);if(y)return te(nn,{children:[w(_,{}),w(Sc,{tabIndex:0,ref:b,right:w(Tt,{ml:m.spacing_100,children:w(mw,{onClick:I,disabled:g,children:g?w($e.Loop,{}):w($e.Check,{})})}),children:w(oN,{saving:g,children:e})})]});const T={p:a,...x,...D};return p?T.id=p:f!==void 0&&(T.id=f),te(nn,{children:[w(_,{}),te(iN,{onClick:M,...T,"data-id":h["data-id"],disabled:d,children:[`${r}`||w(aN,{children:t}),!o&&!d&&w(lN,{valid:u,children:w($e.Edit,{})})]})]})};hw.displayName="InlineEdit";const sN=P(At)`
|
|
2227
2228
|
font-family: ${m.font_family_pingo};
|
|
2228
2229
|
font-size: 0.875rem;
|
|
2229
2230
|
font-style: normal;
|
|
@@ -2289,7 +2290,7 @@ Valid keys: `+JSON.stringify(Object.keys(F),null," "));var Q=se(Z,re,G,ie,le+".
|
|
|
2289
2290
|
&:disabled::placeholder {
|
|
2290
2291
|
color: ${m.color_deprecated_fill_primary_disabled};
|
|
2291
2292
|
}
|
|
2292
|
-
`,ru=s.forwardRef((e,t)=>{const{autoFocus:r,className:n,excludeFromTabOrder:o,isClearable:a=!0,isDisabled:i,isSelectableAll:l=!1,label:c,placeholder:d="Select...",tooltipContent:u,tooltipIcon:f}=e,p=yt(t),h=!a,b=fN({...e,disallowEmptySelection:h}),{labelProps:g,triggerProps:v,valueProps:y,menuProps:$}=dN({...e,disallowEmptySelection:h},b,p),{buttonProps:x}=yn({...v,autoFocus:r,excludeFromTabOrder:o,isDisabled:i},p),D=b.selectionManager.isSelectAll,k=!D&&!b.selectionManager.isEmpty,M=l,I=()=>b.selectionManager.toggleSelectAll(),_=T=>{var K;return w("span",{className:"truncate block",children:T.length>1?T.map(E=>E.textValue).join(", "):(K=T[0])==null?void 0:K.textValue})};return te(Wr,{className:Ka("select-wrapper",{"select-wrapper--open":b.isOpen},n),children:[c?te(Be,{...g,mb:m.
|
|
2293
|
+
`,ru=s.forwardRef((e,t)=>{const{autoFocus:r,className:n,excludeFromTabOrder:o,isClearable:a=!0,isDisabled:i,isSelectableAll:l=!1,label:c,placeholder:d="Select...",tooltipContent:u,tooltipIcon:f}=e,p=yt(t),h=!a,b=fN({...e,disallowEmptySelection:h}),{labelProps:g,triggerProps:v,valueProps:y,menuProps:$}=dN({...e,disallowEmptySelection:h},b,p),{buttonProps:x}=yn({...v,autoFocus:r,excludeFromTabOrder:o,isDisabled:i},p),D=b.selectionManager.isSelectAll,k=!D&&!b.selectionManager.isEmpty,M=l,I=()=>b.selectionManager.toggleSelectAll(),_=T=>{var K;return w("span",{className:"truncate block",children:T.length>1?T.map(E=>E.textValue).join(", "):(K=T[0])==null?void 0:K.textValue})};return te(Wr,{className:Ka("select-wrapper",{"select-wrapper--open":b.isOpen},n),children:[c?te(Be,{...g,mb:m.spacing_100,children:[c,u?w(gr,{icon:f,children:u}):null]}):null,w(Zk,{focusRingClass:"select--focused",autoFocus:r,children:te(mN,{...x,paddingSize:"small",type:"button",ref:p,children:[w("span",{...y,children:b.selectedItems?_(b.selectedItems):d}),w(pN,{children:w($e.ArrowDropDown,{})})]})}),b.isOpen?te(jc,{state:b,triggerRef:p,children:[M?te(nn,{children:[l?te(Gr,{type:"button",onClick:I,children:[w(Wi,{checked:k?"indeterminate":D,tabIndex:-1}),"Select all"]}):null,w("div",{className:"select__divider"})]}):null,w(Q6,{...$,state:b})]}):null]})});ru.displayName="MultiSelectComponent";const bw=s.forwardRef(({options:e,...t},r)=>w(ru,{...t,items:e,ref:r,children:t.children?t.children:n=>n.children?w(Ei,{items:n.children,title:n.name,children:o=>w(Co,{textValue:o.textValue,children:o.name})},n.name):w(Co,{textValue:n.textValue,children:n.name})}));bw.displayName="MultiSelect";const nu="nav-menu-portal";var gw=(e=>(e.Up="Up",e.Down="Down",e))(gw||{});const ou=s.createContext({direction:"Down",menuRef:null,open:!1,setOpen:function(){throw new Error("Function not implemented.")}}),hN=P.div`
|
|
2293
2294
|
position: relative;
|
|
2294
2295
|
`,Hn=s.forwardRef((e,t)=>{const[r,n]=s.useState(!1),o=yt(t);return s.useEffect(()=>{const a=document.getElementById(nu);function i(l){const c=l.target;!o.current.contains(c)&&!(a!=null&&a.contains(c))&&n(!1)}return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[o]),w(ou.Provider,{value:{menuRef:o,open:r,setOpen:n,direction:e.direction??"Down"},children:w(hN,{ref:o,role:"menu",children:e.children})})});Hn.displayName="NavigationMenu";const bN=P.button`
|
|
2295
2296
|
cursor: pointer;
|
|
@@ -2597,7 +2598,7 @@ const theme2 = createTheme({ palette: {
|
|
|
2597
2598
|
&::-webkit-search-results-decoration {
|
|
2598
2599
|
-webkit-appearance: none;
|
|
2599
2600
|
}
|
|
2600
|
-
`,ED=s.forwardRef((e,t)=>{const{label:r,size:n="small",placeholder:o="Search",disabled:a,readOnly:i,required:l,hideLabel:c,onChange:d,onClear:u,onSubmit:f,...p}=e,h={label:r,placeholder:o,onClear:u,onSubmit:f,onChange:d,isDisabled:a,isReadOnly:i,isRequired:l},b=CK(h),g=yt(t),{labelProps:v,inputProps:y,clearButtonProps:$}=TK(h,b,g);return te(Wr,{children:[w(Be,{...v,srOnly:c,mb:m.
|
|
2601
|
+
`,ED=s.forwardRef((e,t)=>{const{label:r,size:n="small",placeholder:o="Search",disabled:a,readOnly:i,required:l,hideLabel:c,onChange:d,onClear:u,onSubmit:f,...p}=e,h={label:r,placeholder:o,onClear:u,onSubmit:f,onChange:d,isDisabled:a,isReadOnly:i,isRequired:l},b=CK(h),g=yt(t),{labelProps:v,inputProps:y,clearButtonProps:$}=TK(h,b,g);return te(Wr,{children:[w(Be,{...v,srOnly:c,mb:m.spacing_100,children:r}),te(IK,{children:[w(j5,{}),w(OK,{...y,ref:g,placeholder:o,paddingSize:n,...p}),b.value!==""&&w(AK,{...$,children:w(B5,{})})]})]})});ED.displayName="Search";function MK(e,t,r){let{keyboardDelegate:n,isDisabled:o}=e,a=_i({usage:"search",sensitivity:"base"}),i=s.useMemo(()=>n||new Si(t.collection,t.disabledKeys,null,a),[n,t.collection,t.disabledKeys,a]),{menuTriggerProps:l,menuProps:c}=_c({isDisabled:o,type:"listbox"},t,r),d=$=>{switch($.key){case"ArrowLeft":{$.preventDefault();let x=t.selectedKey!=null?i.getKeyAbove(t.selectedKey):i.getFirstKey();x&&t.setSelectedKey(x);break}case"ArrowRight":{$.preventDefault();let x=t.selectedKey!=null?i.getKeyBelow(t.selectedKey):i.getFirstKey();x&&t.setSelectedKey(x);break}}},{typeSelectProps:u}=vc({keyboardDelegate:i,selectionManager:t.selectionManager,onTypeSelect($){t.setSelectedKey($)}}),{labelProps:f,fieldProps:p,descriptionProps:h,errorMessageProps:b}=To({...e,labelElementType:"span"});u.onKeyDown=u.onKeyDownCapture,delete u.onKeyDownCapture;let g=Ct(e,{labelable:!0}),v=pe(u,l,p),y=tt();return{labelProps:{...f,onClick:()=>{e.isDisabled||(r.current.focus(),Zp("keyboard"))}},triggerProps:pe(g,{...v,isDisabled:o,onKeyDown:cr(v.onKeyDown,d,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[v["aria-labelledby"],v["aria-label"]&&!v["aria-labelledby"]?v.id:null,y].filter(Boolean).join(" "),onFocus($){t.isFocused||(e.onFocus&&e.onFocus($),e.onFocusChange&&e.onFocusChange(!0),t.setFocused(!0))},onBlur($){t.isOpen||(e.onBlur&&e.onBlur($),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))}}),valueProps:{id:y},menuProps:{...c,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,onBlur:$=>{$.currentTarget.contains($.relatedTarget)||(e.onBlur&&e.onBlur($),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))},"aria-labelledby":[p["aria-labelledby"],v["aria-label"]&&!p["aria-labelledby"]?v.id:null].filter(Boolean).join(" ")},descriptionProps:h,errorMessageProps:b}}function NK(e,t,r){let{autoComplete:n,name:o,isDisabled:a}=e,i=Xp(),{visuallyHiddenProps:l}=sh();var c;return{containerProps:{...l,"aria-hidden":!0},inputProps:{type:"text",tabIndex:i==null||t.isFocused||t.isOpen?-1:0,style:{fontSize:16},onFocus:()=>r.current.focus(),disabled:a},selectProps:{tabIndex:-1,autoComplete:n,disabled:a,name:o,size:t.collection.size,value:(c=t.selectedKey)!==null&&c!==void 0?c:"",onChange:d=>t.setSelectedKey(d.target.value)}}}function FK(e){let{state:t,triggerRef:r,label:n,name:o,isDisabled:a}=e,{containerProps:i,inputProps:l,selectProps:c}=NK(e,t,r);var d;return t.collection.size<=300?s.createElement("div",i,s.createElement("input",l),s.createElement("label",null,n,s.createElement("select",c,s.createElement("option",null),[...t.collection.getKeys()].map(u=>{let f=t.collection.getItem(u);if(f.type==="item")return s.createElement("option",{key:f.key,value:f.key},f.textValue)})))):o?s.createElement("input",{type:"hidden",autoComplete:c.autoComplete,name:o,disabled:a,value:(d=t.selectedKey)!==null&&d!==void 0?d:""}):null}function zK(e){let t=wc(e),r=Mg({...e,onSelectionChange:a=>{e.onSelectionChange!=null&&e.onSelectionChange(a),t.close()}}),[n,o]=s.useState(!1);return{...r,...t,open(){r.collection.size!==0&&t.open()},toggle(a){r.collection.size!==0&&t.toggle(a)},isFocused:n,setFocused:o}}const LK=P.span`
|
|
2601
2602
|
color: ${m.color_deprecated_fill_secondary_enabled};
|
|
2602
2603
|
`,KK=P(Zc.primary)`
|
|
2603
2604
|
display: flex;
|
|
@@ -2656,7 +2657,7 @@ const theme2 = createTheme({ palette: {
|
|
|
2656
2657
|
`,RK=P.span`
|
|
2657
2658
|
display: inline-flex;
|
|
2658
2659
|
align-items: center;
|
|
2659
|
-
`;function VK(e){const t=zK(e),{placeholder:r="Select...",hideLabel:n}=e,o=Y.useRef(null),{labelProps:a,triggerProps:i,valueProps:l,menuProps:c}=MK(e,t,o),{buttonProps:d}=yn(i,o),{focusProps:u,isFocusVisible:f}=Nr();return te(Wr,{children:[te(Be,{...a,srOnly:n,mb:m.
|
|
2660
|
+
`;function VK(e){const t=zK(e),{placeholder:r="Select...",hideLabel:n}=e,o=Y.useRef(null),{labelProps:a,triggerProps:i,valueProps:l,menuProps:c}=MK(e,t,o),{buttonProps:d}=yn(i,o),{focusProps:u,isFocusVisible:f}=Nr();return te(Wr,{children:[te(Be,{...a,srOnly:n,mb:m.spacing_100,children:[e.label,e.tooltipContent?w(gr,{icon:e.tooltipIcon,children:e.tooltipContent}):null]}),w(FK,{state:t,triggerRef:o,label:e.label,name:e.name}),te(KK,{...pe(d,u),paddingSize:"small",ref:o,isOpen:t.isOpen,isFocusVisible:f,children:[w(RK,{...l,children:w(At,{children:t.selectedItem?t.selectedItem.rendered:r})}),w(LK,{children:w($e.ArrowDropDown,{})})]}),t.isOpen?w(jc,{state:t,triggerRef:o,placement:"bottom start",children:w(Zv,{...c,state:t})}):null]})}const PD="Switch",[BK,KV]=Me(PD),[jK,UK]=BK(PD),WK=s.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:o,defaultChecked:a,required:i,disabled:l,value:c="on",onCheckedChange:d,...u}=e,[f,p]=s.useState(null),h=me(t,$=>p($)),b=s.useRef(!1),g=f?!!f.closest("form"):!0,[v=!1,y]=Ke({prop:o,defaultProp:a,onChange:d});return s.createElement(jK,{scope:r,checked:v,disabled:l},s.createElement(ce.button,A({type:"button",role:"switch","aria-checked":v,"aria-required":i,"data-state":kD(v),"data-disabled":l?"":void 0,disabled:l,value:c},u,{ref:h,onClick:J(e.onClick,$=>{y(x=>!x),g&&(b.current=$.isPropagationStopped(),b.current||$.stopPropagation())})})),g&&s.createElement(YK,{control:f,bubbles:!b.current,name:n,value:c,checked:v,required:i,disabled:l,style:{transform:"translateX(-100%)"}}))}),HK="SwitchThumb",GK=s.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,o=UK(HK,r);return s.createElement(ce.span,A({"data-state":kD(o.checked),"data-disabled":o.disabled?"":void 0},n,{ref:t}))}),YK=e=>{const{control:t,checked:r,bubbles:n=!0,...o}=e,a=s.useRef(null),i=Vi(r),l=Fi(t);return s.useEffect(()=>{const c=a.current,d=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(d,"checked").set;if(i!==r&&f){const p=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(p)}},[i,r,n]),s.createElement("input",A({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 kD(e){return e?"checked":"unchecked"}const qK=WK,ZK=GK,XK=P(qK)`
|
|
2660
2661
|
all: unset;
|
|
2661
2662
|
width: 40px;
|
|
2662
2663
|
height: 24px;
|