@theroutingcompany/components 0.0.152-alpha.2 → 0.0.153-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/dist/trc-components.es.js +36 -21
- package/dist/trc-components.es.js.map +1 -1
- package/dist/trc-components.umd.js +5 -4
- package/dist/trc-components.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +1 -1
- package/types/components/IconButton/IconButton.d.ts +4 -0
- package/types/components/NavigationMenu/NavigationMenu.d.ts +3 -1
|
@@ -1346,7 +1346,8 @@ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var ie=re(oe,X,U,Y,ee+".
|
|
|
1346
1346
|
color: ${f.color_deprecated_fill_inverse_hover};
|
|
1347
1347
|
}
|
|
1348
1348
|
|
|
1349
|
-
&[data-state~='pressed']
|
|
1349
|
+
&[data-state~='pressed'],
|
|
1350
|
+
&[data-active='true'] {
|
|
1350
1351
|
background: ${f.color_deprecated_fill_primary_pressed};
|
|
1351
1352
|
}
|
|
1352
1353
|
|
|
@@ -1406,7 +1407,7 @@ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var ie=re(oe,X,U,Y,ee+".
|
|
|
1406
1407
|
&:disabled {
|
|
1407
1408
|
background: ${f.color_deprecated_fill_inverse_disabled};
|
|
1408
1409
|
}
|
|
1409
|
-
`,LF={primary:RF,secondary:MF,danger:OF,inverse:NF},Zi=y.forwardRef((e,t)=>{const n=er(t),{label:r,size:o="small",variant:i="primary",shape:u="circle",disabled:a,onClick:l,onPress:s,autoFocus:c,children:d,style:p={},...
|
|
1410
|
+
`,LF={primary:RF,secondary:MF,danger:OF,inverse:NF},Zi=y.forwardRef((e,t)=>{const n=er(t),{label:r,size:o="small",variant:i="primary",shape:u="circle",disabled:a,onClick:l,onPress:s,autoFocus:c,children:d,style:p={},as:h,active:v,...g}=e,$=$n(),x=a??$,{buttonProps:E,isPressed:C}=Fr({onPress:s??l,isDisabled:x,autoFocus:c},n),{isFocusVisible:_,focusProps:k}=Ii({autoFocus:c}),S=d3({isFocusVisible:_,isPressed:C}),P=LF[i],B=dy[u],I=cf[o],T=ke(k,g,E,{"data-state":S,"data-active":v?"true":"false"});return m(P,{ref:n,...T,as:h,style:{"--icon-button-size":I,"--icon-button-border-radius":B,...p},children:m(li,{label:r,children:d})})});Zi.displayName="IconButton";const zF=L.default(Rt)`
|
|
1410
1411
|
font-family: ${f.font_family_pingo} !important;
|
|
1411
1412
|
color: ${f.color_black} !important;
|
|
1412
1413
|
font-weight: ${f.font_weight_100};
|
|
@@ -1559,7 +1560,7 @@ Valid keys: `+JSON.stringify(Object.keys(D),null," "));var ie=re(oe,X,U,Y,ee+".
|
|
|
1559
1560
|
line-height: ${f.line_height_deprecated_133};
|
|
1560
1561
|
font-family: ${f.font_family_pingo};
|
|
1561
1562
|
max-width: ${f.sizing_1000};
|
|
1562
|
-
z-index:
|
|
1563
|
+
z-index: 2100;
|
|
1563
1564
|
animation-duration: 400ms;
|
|
1564
1565
|
animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
|
|
1565
1566
|
|
|
@@ -2471,7 +2472,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2471
2472
|
`,Ip=e=>{const{label:t,boldLabel:n=!0,autoFocus:r,className:o,excludeFromTabOrder:i,isClearable:u=!0,isDisabled:a,isSelectableAll:l=!1,autoSelectAll:s=!0,isAllSelectedText:c="All selected",placeholder:d="Select...",tooltipContent:p,tooltipIcon:h,errorMessage:v,isInvalid:g=!1,onFocus:$,onBlur:x,onSelectionChange:E}=e,C=b.default.useRef(null),_=!u,k=b.default.useRef(!1),S=b.default.useCallback(w=>{if(e.onSelectionChange){const F=s?!1:k.current;e.onSelectionChange(w,F)}},[e,s]),P=Hz({...e,disallowEmptySelection:_,onSelectionChange:S}),{labelProps:B,triggerProps:I,valueProps:T,menuProps:O,errorMessageProps:H}=jz({...e,disallowEmptySelection:_},P,C),{buttonProps:V}=Fr({...I,autoFocus:r,excludeFromTabOrder:i,isDisabled:a,onFocus:$,onBlur:x},C),[R,N]=b.default.useState(!1);b.default.useEffect(()=>{k.current=R},[R]);const W=s?P.selectionManager.isSelectAll:R,[G,z]=b.default.useState(!1),K=b.default.useCallback(()=>{const w=P.selectionManager.isSelectAll;!s&&!W&&w?(N(!0),E&&E(P.selectedKeys,!0)):(P.selectionManager.toggleSelectAll(),s||N(!w))},[s,W,P.selectionManager,P.selectedKeys,E]),D=b.default.useCallback(()=>{P.selectionManager.setFocusedKey(null)},[P.selectionManager]);b.default.useEffect(()=>{if(!s&&P.selectedItems){const w=Array.from(P.collection.getKeys()),F=Array.from(P.selectedKeys);!(w.length>0&&w.length===F.length&&w.every(Y=>F.includes(Y)))&&R&&N(!1)}},[P.selectedKeys,s,R,P.collection,P.selectedItems]);const A=(w,F=!1,U)=>m(Rt,{children:F&&U?m("span",{children:U}):m("span",{children:w.map(Y=>Y.textValue).join(", ")})});return Q(jt,{className:sE("select-wrapper",{"select-wrapper--opens":P.isOpen},o),children:[t?Q(et,{...B,mb:f.spacing_150,onClick:a?void 0:()=>P.open(),bold:n,children:[t,p?m(ft,{icon:h,children:p}):null]}):null,m(Z8,{focusRingClass:"select--focused",autoFocus:r,children:Q(Fp,{...V,ref:C,isOpen:P.isOpen,"data-state":g?"invalid":void 0,disabled:a??!1,children:[m("span",{...T,children:P.selectedItems?A(P.selectedItems,W,c):m(Bp,{children:d})}),m(Gz,{children:m(Il,{style:{width:"18px",height:"18px"},"aria-hidden":"true"})})]})}),v?m(Wt,{...H,children:v}):null,P.isOpen?Q(ar,{state:P,targetRef:C,isTargetWidth:!0,children:[l?Q(Ge,{children:[Q(Fl,{onMouseOver:()=>{z(!0),D()},onMouseOut:()=>z(!1),isFocused:G,tabIndex:G?0:-1,onClick:K,"aria-label":c,children:[m(Lf,{isDisabled:a??!1,isSelected:W,"aria-label":c,onChange:K}),Q(Jf,{children:[m(Et,{as:"span",children:c}),m(Qf,{children:W?m(Le.Check,{"aria-hidden":"true",style:{width:18,height:18}}):null})]})]}),m(i$,{})]}):null,m(OM,{...O,state:P,isSelectableAll:!0})]}):null]})};Ip.displayName="MultiSelectComponent";const fE=({items:e,...t})=>{const{children:n}=t,r=o=>o.textValue?m(zo,{textValue:o.textValue,children:o.textValue},o.id):m(zo,{children:o.name},o.id);if(!e)throw new Error("MultiSelect requires items");return m(Ip,{...t,items:e,children:n||r})};fE.displayName="MultiSelect";const Rp="nav-menu-portal";var pE=(e=>(e.Up="Up",e.Down="Down",e))(pE||{});const Mp=b.default.createContext({direction:"Down",menuRef:null,triggerRef:null,setTriggerRef:function(){throw new Error("Function not implemented.")},open:!1,setOpen:function(){throw new Error("Function not implemented.")}}),Yz=L.default.div`
|
|
2472
2473
|
position: relative;
|
|
2473
2474
|
width: inherit;
|
|
2474
|
-
`,Go=y.forwardRef((e,t)=>{const[n,r]=y.useState(!1),[o,i]=y.useState(null),u=er(t);return y.useEffect(()=>{const
|
|
2475
|
+
`,Go=y.forwardRef((e,t)=>{const[n,r]=y.useState(!1),[o,i]=y.useState(null),u=er(t),a=e.isOpen!==void 0,l=a?e.isOpen??!1:n,s=y.useCallback(c=>{var d;if(a){const p=typeof c=="function"?c(e.isOpen??!1):c;(d=e.onOpenChange)==null||d.call(e,p)}else r(c)},[a,e]);return y.useEffect(()=>{const c=document.getElementById(Rp);function d(p){const h=p.target;u.current&&!u.current.contains(h)&&!(c!=null&&c.contains(h))&&s(!1)}return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[u,s]),m(Mp.Provider,{value:{menuRef:u,triggerRef:o,setTriggerRef:i,open:l,setOpen:s,direction:e.direction??"Down"},children:m(Yz,{ref:u,role:"menu",children:e.children})})});Go.displayName="NavigationMenu";const qz=L.default.button`
|
|
2475
2476
|
cursor: pointer;
|
|
2476
2477
|
padding: ${e=>e.padding??"8px"};
|
|
2477
2478
|
border: 1px solid transparent;
|