@theroutingcompany/components 0.0.75 → 0.0.76-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.
|
@@ -2733,7 +2733,7 @@ const theme2 = createTheme({ palette: {
|
|
|
2733
2733
|
&::-webkit-search-results-decoration {
|
|
2734
2734
|
-webkit-appearance: none;
|
|
2735
2735
|
}
|
|
2736
|
-
`,kD=c.forwardRef((e,t)=>{const{label:r,size:n="small",placeholder:o="Search",height:a=od.small,disabled:i,readOnly:l,required:s,hideLabel:u,onChange:d,onClear:f,onSubmit:m,...
|
|
2736
|
+
`,kD=c.forwardRef((e,t)=>{const{label:r,size:n="small",placeholder:o="Search",height:a=od.small,disabled:i,readOnly:l,required:s,hideLabel:u,onChange:d,onClear:f,onSubmit:m,value:b,...h}=e,g={label:r,placeholder:o,onClear:f,onSubmit:m,onChange:d,value:b,isDisabled:i,isReadOnly:l,isRequired:s},y=mV(g),$=Dt(t),{labelProps:v,inputProps:x,clearButtonProps:E}=pV(g,y,$);return J(sn,{children:[D(Re,{...v,srOnly:u,mb:u?p.spacing_100:void 0,children:r}),J(bV,{children:[D(Hw,{}),D(gV,{height:a,...x,ref:$,placeholder:o,paddingSize:n,...h}),y.value!==""&&D(hV,{...E,children:D(Ww,{})})]})]})});kD.displayName="Search";function vV(e,t,r){let{keyboardDelegate:n,isDisabled:o}=e,a=pl({usage:"search",sensitivity:"base"}),i=c.useMemo(()=>n||new Ol(t.collection,t.disabledKeys,null,a),[n,t.collection,t.disabledKeys,a]),{menuTriggerProps:l,menuProps:s}=Nl({isDisabled:o,type:"listbox"},t,r),u=v=>{switch(v.key){case"ArrowLeft":{v.preventDefault();let x=t.selectedKey!=null?i.getKeyAbove(t.selectedKey):i.getFirstKey();x&&t.setSelectedKey(x);break}case"ArrowRight":{v.preventDefault();let x=t.selectedKey!=null?i.getKeyBelow(t.selectedKey):i.getFirstKey();x&&t.setSelectedKey(x);break}}},{typeSelectProps:d}=hd({keyboardDelegate:i,selectionManager:t.selectionManager,onTypeSelect(v){t.setSelectedKey(v)}}),{labelProps:f,fieldProps:m,descriptionProps:b,errorMessageProps:h}=ra({...e,labelElementType:"span"});d.onKeyDown=d.onKeyDownCapture,delete d.onKeyDownCapture;let g=wt(e,{labelable:!0}),y=pe(d,l,m),$=at();return{labelProps:{...f,onClick:()=>{e.isDisabled||(r.current.focus(),Lc("keyboard"))}},triggerProps:pe(g,{...y,isDisabled:o,onKeyDown:Zt(y.onKeyDown,u,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[$,y["aria-labelledby"],y["aria-label"]&&!y["aria-labelledby"]?y.id:null].filter(Boolean).join(" "),onFocus(v){t.isFocused||(e.onFocus&&e.onFocus(v),e.onFocusChange&&e.onFocusChange(!0),t.setFocused(!0))},onBlur(v){t.isOpen||(e.onBlur&&e.onBlur(v),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))}}),valueProps:{id:$},menuProps:{...s,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,disallowEmptySelection:!0,onBlur:v=>{v.currentTarget.contains(v.relatedTarget)||(e.onBlur&&e.onBlur(v),e.onFocusChange&&e.onFocusChange(!1),t.setFocused(!1))},"aria-labelledby":[m["aria-labelledby"],y["aria-label"]&&!m["aria-labelledby"]?y.id:null].filter(Boolean).join(" ")},descriptionProps:b,errorMessageProps:h}}function yV(e,t,r){let{autoComplete:n,name:o,isDisabled:a}=e,i=qb(),{visuallyHiddenProps:l}=eh();var s;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:(s=t.selectedKey)!==null&&s!==void 0?s:"",onChange:u=>t.setSelectedKey(u.target.value)}}}function $V(e){let{state:t,triggerRef:r,label:n,name:o,isDisabled:a}=e,{containerProps:i,inputProps:l,selectProps:s}=yV(e,t,r);var u;return t.collection.size<=300?S.default.createElement("div",i,S.default.createElement("input",l),S.default.createElement("label",null,n,S.default.createElement("select",s,S.default.createElement("option",null),[...t.collection.getKeys()].map(d=>{let f=t.collection.getItem(d);if(f.type==="item")return S.default.createElement("option",{key:f.key,value:f.key},f.textValue)})))):o?S.default.createElement("input",{type:"hidden",autoComplete:s.autoComplete,name:o,disabled:a,value:(u=t.selectedKey)!==null&&u!==void 0?u:""}):null}function _V(e){let t=Ll(e),r=Qx({...e,onSelectionChange:a=>{e.onSelectionChange!=null&&e.onSelectionChange(a),t.close()}}),[n,o]=c.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 xV=L.default.span`
|
|
2737
2737
|
${({lineHeight:e,fontSize:t})=>ad({lineHeight:e,fontSize:t})}
|
|
2738
2738
|
`,Uf=L.default.span`
|
|
2739
2739
|
${({lineHeight:e,fontSize:t})=>c1({lineHeight:e,fontSize:t})}
|