@theroutingcompany/components 0.0.118-alpha.0 → 0.0.118

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.
@@ -2163,7 +2163,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2163
2163
  ${()=>yo()}
2164
2164
  `,Hd=R.default(ht).attrs({as:"button"})`
2165
2165
  display: flex;
2166
- background-color: ${p.color_white};
2167
2166
  align-items: center;
2168
2167
  justify-content: space-between;
2169
2168
  padding: 7px 8px;
@@ -2192,12 +2191,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2192
2191
  ${e?`border-color: ${p.color_black};`:""}
2193
2192
  `}
2194
2193
 
2195
- &:disabled {
2196
- border-color: ${p.color_deprecated_outline_secondary_disabled};
2197
- color: ${p.color_deprecated_fill_primary_disabled};
2198
- cursor: not-allowed;
2199
- border-color: revert;
2200
- }
2194
+ ${({disabled:e})=>`
2195
+ background-color: ${e?p.color_deprecated_overlay_secondary_hover:p.color_white};
2196
+ ${e?"cursor: not-allowed;":""}
2197
+ ${e?"--input-border-color: revert;":""}
2198
+ `}
2201
2199
 
2202
2200
  svg {
2203
2201
  width: 16px;
@@ -2207,14 +2205,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
2207
2205
  display: inline-flex;
2208
2206
  align-items: center;
2209
2207
  overflow: hidden;
2210
- `,vF=e=>E(Hr,{textValue:e.name,children:e.name},e.key),aw=e=>{const{boldLabel:t=!0,hideLabel:n,placeholder:r="Select...",showCaret:o=!0,isInvalid:a,children:i=vF,displayValue:l="rendered",isPopoverTargetWidth:s=!0}=e,u=hF({...e,children:i}),d=D.useRef(null),{labelProps:f,triggerProps:g,valueProps:m,menuProps:h,errorMessageProps:b}=pF(e,u,d),{buttonProps:v}=Dr(g,d);return Q(Et,{children:[e.label?Q(Re,{...f,srOnly:n,mb:p.spacing_150,onClick:()=>u.open(),bold:t,children:[e.label,e.tooltipContent?E(Qe,{icon:e.tooltipIcon,children:e.tooltipContent}):null]}):null,E(mF,{state:u,triggerRef:d,label:e.label,name:e.name}),Q(Hd,{...v,ref:d,isOpen:u.isOpen,"data-state":a?"invalid":void 0,children:[E(bF,{...m,children:u.selectedItem?l==="textValue"?E(ow,{children:u.selectedItem.textValue}):E(ow,{children:u.selectedItem.rendered}):E(Wd,{children:r})}),o?E(Dl,{style:{width:"18px",height:"18px"},"aria-hidden":"true"}):null]}),e.errorMessage?E(St,{...b,children:e.errorMessage}):null,u.isOpen?E(Gr,{state:u,targetRef:d,isTargetWidth:s,children:E(z$,{...h,state:u})}):null]})};aw.displayName="SingleSelect";function yF(e,t,n){const{disallowEmptySelection:r,isDisabled:o}=e,a=Ji({usage:"search",sensitivity:"base"}),i=c.useMemo(()=>new yl(t.collection,t.disabledKeys,null,a),[t.collection,t.disabledKeys,a]),{menuTriggerProps:l,menuProps:s}=fd({isDisabled:o,type:"listbox"},t,n),u=_=>{if(t.selectionMode==="single")switch(_.key){case"ArrowLeft":{_.preventDefault();const y=t.selectedKeys.size>0?i.getKeyAbove(t.selectedKeys.values().next().value):i.getFirstKey();y&&t.setSelectedKeys([y]);break}case"ArrowRight":{_.preventDefault();const y=t.selectedKeys.size>0?i.getKeyBelow(t.selectedKeys.values().next().value):i.getFirstKey();y&&t.setSelectedKeys([y]);break}}},{typeSelectProps:d}=sd({keyboardDelegate:i,selectionManager:t.selectionManager,onTypeSelect(_){t.setSelectedKeys([_])}}),{labelProps:f,fieldProps:g,errorMessageProps:m}=rl({...e,labelElementType:"span"});d.onKeyDown=d.onKeyDownCapture,delete d.onKeyDownCapture;const h=$n(e,{labelable:!0}),b=pe(d,l,g),v=ct();return{labelProps:{...f,onClick:()=>{var _;e.isDisabled||((_=n.current)==null||_.focus(),Rc("keyboard"))}},triggerProps:pe(h,{...b,onKeyDown:Ht(b.onKeyDown,u,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[b["aria-labelledby"],b["aria-label"]&&!b["aria-labelledby"]?b.id:null,v].filter(Boolean).join(" "),onFocus(_){t.isFocused||(e.onFocus&&e.onFocus(_),t.setFocused(!0))},onBlur(_){t.isOpen||(e.onBlur&&e.onBlur(_),t.setFocused(!1))}}),valueProps:{id:v},menuProps:{...s,disallowEmptySelection:r,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,onBlur:_=>{_.currentTarget.contains(_.relatedTarget)||(e.onBlur&&e.onBlur(_),t.setFocused(!1))},"aria-labelledby":[g["aria-labelledby"],b["aria-label"]&&!g["aria-labelledby"]?b.id:null].filter(Boolean).join(" ")},errorMessageProps:m}}function $F(e){const{collection:t,disabledKeys:n,selectionManager:r,selectionManager:{setSelectedKeys:o,selectedKeys:a,selectionMode:i}}=C$(e),l=[],s=a.size!==0?Array.from(a).map(u=>{const d=t.getItem(u);return d||l.push(u),d}).filter(X5):null;return l.length&&console.warn(`Select: Keys "${l.join(", ")}" passed to "selectedKeys" are not present in the collection.`),{collection:t,disabledKeys:n,selectionManager:r,selectionMode:i,selectedKeys:a,setSelectedKeys:o.bind(r),selectedItems:s}}function _F(e){const[t,n]=c.useState(!1),r=A$(e),o=$F({...e,onSelectionChange:a=>{e.onSelectionChange!=null&&(a==="all"?e.onSelectionChange(new Set(o.collection.getKeys())):e.onSelectionChange(a)),e.selectionMode==="single"&&r.close()}});return{...o,...r,close(){r.close()},open(){o.collection.size!==0&&r.open()},toggle(a){o.collection.size!==0&&r.toggle(a)},isFocused:t,setFocused:n}}const xF=R.default.span`
2208
+ `,vF=e=>E(Hr,{textValue:e.name,children:e.name},e.key),aw=e=>{const{boldLabel:t=!0,hideLabel:n,placeholder:r="Select...",showCaret:o=!0,isInvalid:a,children:i=vF,displayValue:l="rendered",isPopoverTargetWidth:s=!0}=e,u=hF({...e,children:i}),d=D.useRef(null),{labelProps:f,triggerProps:g,valueProps:m,menuProps:h,errorMessageProps:b}=pF(e,u,d),{buttonProps:v}=Dr(g,d);return Q(Et,{children:[e.label?Q(Re,{...f,srOnly:n,mb:p.spacing_150,onClick:()=>u.open(),bold:t,children:[e.label,e.tooltipContent?E(Qe,{icon:e.tooltipIcon,children:e.tooltipContent}):null]}):null,E(mF,{state:u,triggerRef:d,label:e.label,name:e.name}),Q(Hd,{...v,ref:d,isOpen:u.isOpen,"data-state":a?"invalid":void 0,disabled:e.isDisabled??!1,children:[E(bF,{...m,children:u.selectedItem?l==="textValue"?E(ow,{children:u.selectedItem.textValue}):E(ow,{children:u.selectedItem.rendered}):E(Wd,{children:r})}),o?E(Dl,{style:{width:"18px",height:"18px"},"aria-hidden":"true"}):null]}),e.errorMessage?E(St,{...b,children:e.errorMessage}):null,u.isOpen?E(Gr,{state:u,targetRef:d,isTargetWidth:s,children:E(z$,{...h,state:u})}):null]})};aw.displayName="SingleSelect";function yF(e,t,n){const{disallowEmptySelection:r,isDisabled:o}=e,a=Ji({usage:"search",sensitivity:"base"}),i=c.useMemo(()=>new yl(t.collection,t.disabledKeys,null,a),[t.collection,t.disabledKeys,a]),{menuTriggerProps:l,menuProps:s}=fd({isDisabled:o,type:"listbox"},t,n),u=_=>{if(t.selectionMode==="single")switch(_.key){case"ArrowLeft":{_.preventDefault();const y=t.selectedKeys.size>0?i.getKeyAbove(t.selectedKeys.values().next().value):i.getFirstKey();y&&t.setSelectedKeys([y]);break}case"ArrowRight":{_.preventDefault();const y=t.selectedKeys.size>0?i.getKeyBelow(t.selectedKeys.values().next().value):i.getFirstKey();y&&t.setSelectedKeys([y]);break}}},{typeSelectProps:d}=sd({keyboardDelegate:i,selectionManager:t.selectionManager,onTypeSelect(_){t.setSelectedKeys([_])}}),{labelProps:f,fieldProps:g,errorMessageProps:m}=rl({...e,labelElementType:"span"});d.onKeyDown=d.onKeyDownCapture,delete d.onKeyDownCapture;const h=$n(e,{labelable:!0}),b=pe(d,l,g),v=ct();return{labelProps:{...f,onClick:()=>{var _;e.isDisabled||((_=n.current)==null||_.focus(),Rc("keyboard"))}},triggerProps:pe(h,{...b,onKeyDown:Ht(b.onKeyDown,u,e.onKeyDown),onKeyUp:e.onKeyUp,"aria-labelledby":[b["aria-labelledby"],b["aria-label"]&&!b["aria-labelledby"]?b.id:null,v].filter(Boolean).join(" "),onFocus(_){t.isFocused||(e.onFocus&&e.onFocus(_),t.setFocused(!0))},onBlur(_){t.isOpen||(e.onBlur&&e.onBlur(_),t.setFocused(!1))}}),valueProps:{id:v},menuProps:{...s,disallowEmptySelection:r,autoFocus:t.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,onBlur:_=>{_.currentTarget.contains(_.relatedTarget)||(e.onBlur&&e.onBlur(_),t.setFocused(!1))},"aria-labelledby":[g["aria-labelledby"],b["aria-label"]&&!g["aria-labelledby"]?b.id:null].filter(Boolean).join(" ")},errorMessageProps:m}}function $F(e){const{collection:t,disabledKeys:n,selectionManager:r,selectionManager:{setSelectedKeys:o,selectedKeys:a,selectionMode:i}}=C$(e),l=[],s=a.size!==0?Array.from(a).map(u=>{const d=t.getItem(u);return d||l.push(u),d}).filter(X5):null;return l.length&&console.warn(`Select: Keys "${l.join(", ")}" passed to "selectedKeys" are not present in the collection.`),{collection:t,disabledKeys:n,selectionManager:r,selectionMode:i,selectedKeys:a,setSelectedKeys:o.bind(r),selectedItems:s}}function _F(e){const[t,n]=c.useState(!1),r=A$(e),o=$F({...e,onSelectionChange:a=>{e.onSelectionChange!=null&&(a==="all"?e.onSelectionChange(new Set(o.collection.getKeys())):e.onSelectionChange(a)),e.selectionMode==="single"&&r.close()}});return{...o,...r,close(){r.close()},open(){o.collection.size!==0&&r.open()},toggle(a){o.collection.size!==0&&r.toggle(a)},isFocused:t,setFocused:n}}const xF=R.default.span`
2211
2209
  width: ${p.sizing_500};
2212
2210
  height: ${p.sizing_600};
2213
2211
  display: flex;
2214
2212
  justify-content: center;
2215
2213
  align-items: center;
2216
2214
  color: ${p.color_deprecated_fill_secondary_enabled};
2217
- `,Gd=e=>{const{label:t,boldLabel:n=!0,autoFocus:r,className:o,excludeFromTabOrder:a,isClearable:i=!0,isDisabled:l,isSelectableAll:s=!1,isAllSelectedText:u,placeholder:d="Select...",tooltipContent:f,tooltipIcon:g,errorMessage:m,isInvalid:h=!1}=e,b=D.default.useRef(null),v=!i,_=_F({...e,disallowEmptySelection:v}),{labelProps:y,triggerProps:w,valueProps:S,menuProps:P,errorMessageProps:T}=yF({...e,disallowEmptySelection:v},_,b),{buttonProps:M}=Dr({...w,autoFocus:r,excludeFromTabOrder:a,isDisabled:l},b),$=_.selectionManager.isSelectAll,[A,V]=D.default.useState(!1),x=()=>_.selectionManager.toggleSelectAll(),z=()=>_.selectionManager.setFocusedKey(null),O=(I,B=!1,C)=>E(ht,{children:B&&C?E("span",{children:C}):E("span",{children:I.map(X=>X.textValue).join(", ")})});return Q(Et,{className:rw("select-wrapper",{"select-wrapper--opens":_.isOpen},o),children:[t?Q(Re,{...y,mb:p.spacing_150,onClick:()=>_.open(),bold:n,children:[t,f?E(Qe,{icon:g,children:f}):null]}):null,E(rk,{focusRingClass:"select--focused",autoFocus:r,children:Q(Hd,{...M,ref:b,isOpen:_.isOpen,"data-state":h?"invalid":void 0,children:[E("span",{...S,children:_.selectedItems?O(_.selectedItems,$,u):E(Wd,{children:d})}),E(xF,{children:E(Dl,{style:{width:"18px",height:"18px"},"aria-hidden":"true"})})]})}),m?E(St,{...T,children:m}):null,_.isOpen?Q(Gr,{state:_,targetRef:b,isTargetWidth:!0,children:[s?Q(fn,{children:[Q(Sl,{onMouseOver:()=>{V(!0),z()},onMouseOut:()=>V(!1),isFocused:A,tabIndex:A?0:-1,onClick:x,"aria-label":"Select All",children:[E(nd,{isDisabled:l??!1,isSelected:$,"aria-label":"Select All",onChange:x}),Q(bd,{children:[E(tt,{as:"span",children:u??"All"}),E(vd,{children:$?E(De.Check,{"aria-hidden":"true",style:{width:18,height:18}}):null})]})]}),E(K$,{})]}):null,E(rA,{...P,state:_,isSelectableAll:!0})]}):null]})};Gd.displayName="MultiSelectComponent";const iw=({items:e,...t})=>{const{children:n}=t,r=o=>o.textValue?E(Hr,{textValue:o.textValue,children:o.textValue},o.id):E(Hr,{children:o.name},o.id);if(!e)throw new Error("MultiSelect requires items");return E(Gd,{...t,items:e,children:n||r})};iw.displayName="MultiSelect";const Yd="nav-menu-portal";var lw=(e=>(e.Up="Up",e.Down="Down",e))(lw||{});const qd=D.default.createContext({direction:"Down",menuRef:null,open:!1,setOpen:function(){throw new Error("Function not implemented.")}}),wF=R.default.div`
2215
+ `,Gd=e=>{const{label:t,boldLabel:n=!0,autoFocus:r,className:o,excludeFromTabOrder:a,isClearable:i=!0,isDisabled:l,isSelectableAll:s=!1,isAllSelectedText:u,placeholder:d="Select...",tooltipContent:f,tooltipIcon:g,errorMessage:m,isInvalid:h=!1}=e,b=D.default.useRef(null),v=!i,_=_F({...e,disallowEmptySelection:v}),{labelProps:y,triggerProps:w,valueProps:S,menuProps:P,errorMessageProps:T}=yF({...e,disallowEmptySelection:v},_,b),{buttonProps:M}=Dr({...w,autoFocus:r,excludeFromTabOrder:a,isDisabled:l},b),$=_.selectionManager.isSelectAll,[A,V]=D.default.useState(!1),x=()=>_.selectionManager.toggleSelectAll(),z=()=>_.selectionManager.setFocusedKey(null),O=(I,B=!1,C)=>E(ht,{children:B&&C?E("span",{children:C}):E("span",{children:I.map(X=>X.textValue).join(", ")})});return Q(Et,{className:rw("select-wrapper",{"select-wrapper--opens":_.isOpen},o),children:[t?Q(Re,{...y,mb:p.spacing_150,onClick:()=>_.open(),bold:n,children:[t,f?E(Qe,{icon:g,children:f}):null]}):null,E(rk,{focusRingClass:"select--focused",autoFocus:r,children:Q(Hd,{...M,ref:b,isOpen:_.isOpen,"data-state":h?"invalid":void 0,disabled:l??!1,children:[E("span",{...S,children:_.selectedItems?O(_.selectedItems,$,u):E(Wd,{children:d})}),E(xF,{children:E(Dl,{style:{width:"18px",height:"18px"},"aria-hidden":"true"})})]})}),m?E(St,{...T,children:m}):null,_.isOpen?Q(Gr,{state:_,targetRef:b,isTargetWidth:!0,children:[s?Q(fn,{children:[Q(Sl,{onMouseOver:()=>{V(!0),z()},onMouseOut:()=>V(!1),isFocused:A,tabIndex:A?0:-1,onClick:x,"aria-label":"Select All",children:[E(nd,{isDisabled:l??!1,isSelected:$,"aria-label":"Select All",onChange:x}),Q(bd,{children:[E(tt,{as:"span",children:u??"All"}),E(vd,{children:$?E(De.Check,{"aria-hidden":"true",style:{width:18,height:18}}):null})]})]}),E(K$,{})]}):null,E(rA,{...P,state:_,isSelectableAll:!0})]}):null]})};Gd.displayName="MultiSelectComponent";const iw=({items:e,...t})=>{const{children:n}=t,r=o=>o.textValue?E(Hr,{textValue:o.textValue,children:o.textValue},o.id):E(Hr,{children:o.name},o.id);if(!e)throw new Error("MultiSelect requires items");return E(Gd,{...t,items:e,children:n||r})};iw.displayName="MultiSelect";const Yd="nav-menu-portal";var lw=(e=>(e.Up="Up",e.Down="Down",e))(lw||{});const qd=D.default.createContext({direction:"Down",menuRef:null,open:!1,setOpen:function(){throw new Error("Function not implemented.")}}),wF=R.default.div`
2218
2216
  position: relative;
2219
2217
  `,Zr=c.forwardRef((e,t)=>{const[n,r]=c.useState(!1),o=_n(t);return c.useEffect(()=>{const a=document.getElementById(Yd);function i(l){const s=l.target;o.current&&!o.current.contains(s)&&!(a!=null&&a.contains(s))&&r(!1)}return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[o]),E(qd.Provider,{value:{menuRef:o,open:n,setOpen:r,direction:e.direction??"Down"},children:E(wF,{ref:o,role:"menu",children:e.children})})});Zr.displayName="NavigationMenu";const EF=R.default.button`
2220
2218
  cursor: pointer;