@tap-payments/os-micro-frontend-shared 0.3.230 → 0.3.231
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/build/_chunks/{chunk-DBFH6OKQ.js → chunk-ACYZKBPV.js} +1 -1
- package/build/_chunks/{chunk-TH5E43JD.js → chunk-AFARM6XG.js} +1 -1
- package/build/_chunks/chunk-B456PAFV.js +2 -0
- package/build/_chunks/{chunk-MBTSXCJW.js → chunk-I44O3S7R.js} +1 -1
- package/build/_chunks/{chunk-FKG3SYY6.js → chunk-ILCM3NDX.js} +1 -1
- package/build/_chunks/{chunk-WAY7BWQL.js → chunk-KZRRNZPG.js} +1 -1
- package/build/_chunks/chunk-M5WXIRWE.js +1 -0
- package/build/_chunks/{chunk-33C463YL.js → chunk-STH6XR2G.js} +1 -1
- package/build/_chunks/{chunk-W4PURLBP.js → chunk-X7OBJ7R3.js} +1 -1
- package/build/components/AppServices/index.js +1 -1
- package/build/components/AppServicesBar/index.js +1 -1
- package/build/components/AppWindowWrapper/index.js +1 -1
- package/build/components/AvatarStack/AnimatedStack.d.ts +9 -0
- package/build/components/AvatarStack/AvatarStack.d.ts +5 -0
- package/build/components/AvatarStack/AvatarStackItem.d.ts +4 -0
- package/build/components/AvatarStack/StaticStack.d.ts +4 -0
- package/build/components/AvatarStack/constants.d.ts +40 -0
- package/build/components/AvatarStack/hooks/useAnimatedStack.d.ts +25 -0
- package/build/components/AvatarStack/index.d.ts +4 -0
- package/build/components/AvatarStack/index.js +1 -0
- package/build/components/AvatarStack/style.d.ts +303 -0
- package/build/components/AvatarStack/type.d.ts +122 -0
- package/build/components/AvatarStack/utils.d.ts +63 -0
- package/build/components/BrandLogo/index.js +1 -1
- package/build/components/ColumnViews/index.js +1 -1
- package/build/components/DateFilter/index.js +1 -1
- package/build/components/ExpandableSideBar/index.js +1 -1
- package/build/components/FileInputPreview/index.js +1 -1
- package/build/components/FilterDropdown/index.js +1 -1
- package/build/components/FormSelect/index.js +1 -1
- package/build/components/JSONViewer/index.js +1 -1
- package/build/components/ListColumnFilter/index.js +1 -1
- package/build/components/ListHeader/index.js +1 -1
- package/build/components/MerchantLogo/index.js +1 -1
- package/build/components/MultiSelect/index.js +1 -1
- package/build/components/PaymentSourceFilter/index.js +1 -1
- package/build/components/PhoneFilter/index.js +1 -1
- package/build/components/PhoneInput/index.js +1 -1
- package/build/components/RHFPhoneInput/index.js +1 -1
- package/build/components/RangeCalender/index.js +1 -1
- package/build/components/ReferenceTypeFilter/index.js +1 -1
- package/build/components/StatusFilter/index.js +1 -1
- package/build/components/StatusIcons/index.js +1 -1
- package/build/components/TableCells/index.js +1 -1
- package/build/components/TableReports/index.js +1 -1
- package/build/components/TreeDropdown/index.js +1 -1
- package/build/components/VerificationIcon/index.js +1 -1
- package/build/components/ViewColumnRadioFilter/index.js +1 -1
- package/build/components/VirtualTables/index.js +1 -1
- package/build/components/Widget/index.js +1 -1
- package/build/components/WindowSideBar/index.js +1 -1
- package/build/components/index.d.ts +2 -1
- package/build/components/index.js +1 -1
- package/build/index.js +1 -1
- package/package.json +1 -1
- package/build/_chunks/chunk-OF3Z5SNR.js +0 -2
- package/build/_chunks/chunk-WE7NB24K.js +0 -1
- package/build/components/ChipStack/ChipStack.d.ts +0 -67
- package/build/components/ChipStack/components/AnimatedStack.d.ts +0 -24
- package/build/components/ChipStack/components/ChipStackFaceSlot.d.ts +0 -11
- package/build/components/ChipStack/components/OverlapChip.d.ts +0 -9
- package/build/components/ChipStack/components/StaticStack.d.ts +0 -12
- package/build/components/ChipStack/constants.d.ts +0 -14
- package/build/components/ChipStack/hooks/useAnimatedStack.d.ts +0 -28
- package/build/components/ChipStack/index.d.ts +0 -10
- package/build/components/ChipStack/index.js +0 -1
- package/build/components/ChipStack/style.d.ts +0 -31
- package/build/components/ChipStack/types.d.ts +0 -127
- package/build/components/ChipStack/util.d.ts +0 -74
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {t,p}from'./chunk-TIO3V7XA.js';import {zc,ec,Aa}from'./chunk-4XXNGLS6.js';import St,{forwardRef,useId,memo,useMemo,Children,useState,useRef,useEffect,useCallback,useLayoutEffect,isValidElement}from'react';import {motion}from'framer-motion';import P from'@mui/material/Box';import {styled}from'@mui/material/styles';import {styled as styled$1}from'@mui/material';import Ye from'@mui/material/TableCell';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var f=24;var $=.22;var pe=styled(Ye,{shouldForwardProp:e=>e!=="rowId"})(({theme:e})=>({fontSize:e.typography.body2.fontSize,fontWeight:e.typography.fontWeightRegular,color:e.palette.text.primary,padding:e.spacing(0),verticalAlign:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"block",width:"100%",border:"none",textAlign:e?.direction==="ltr"?"left":"right"}));var ot=forwardRef(({children:e,...t},r)=>{let o=zc(useId(),"table-cell");return jsx(pe,{id:o,component:"div","data-testid":"TableCell",...t,ref:r,children:e})}),le=memo(ot);var Xt=styled$1("span",{shouldForwardProp:e=>e!=="variant"})(({theme:e,variant:t})=>({display:"flex",width:"17px",height:"12px",backgroundColor:t?ec(e.palette)[t]:"transparent",borderRadius:"2px",flexShrink:0,overflow:"hidden",visibility:"hidden","& > img":{width:"100%",height:"100%",objectFit:"cover"}})),Zt=styled$1("button")({background:"transparent",border:"none",padding:0,cursor:"pointer",outline:"none",display:"flex",alignItems:"center",justifyContent:"center",overflow:"visible"}),jt=styled$1(motion.div)(({theme:e})=>({borderRadius:"12px",backgroundColor:e.palette.background.paper,height:"24px",display:"flex",alignItems:"center",justifyContent:"center",gap:e.spacing(.5)})),Ut=styled$1("img")(()=>({width:"12px",height:"12px"})),Gt=styled$1("span",{shouldForwardProp:e=>e!=="isShown"})(({theme:e,isShown:t})=>({...t&&{border:`1px solid ${e.palette.divider}`},borderRadius:"12px",backgroundColor:t?e.palette.background.paper:"transparent",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,overflow:"hidden",visibility:"hidden"})),qt=styled$1("span")(({theme:e})=>({color:e.palette.common.white,borderRadius:e.spacing(.5),padding:"1.285px 2.569px",height:"12px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"9.782px",fontWeight:600})),Jt=styled$1("div")(()=>({display:"flex",width:"24px",height:"24px",alignItems:"center",justifyContent:"center",borderRadius:"64px;",border:"1px solid #F2F2F2;"})),ce=styled$1(t)(({theme:e})=>({width:24,height:24,fontSize:"8.5px",fontWeight:500,color:e.palette.background.default,border:`1px solid ${e.palette.divider}`})),se=styled$1("div")(({theme:e})=>({fontSize:"11px",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"4px 8px",borderRadius:"24px",border:`1px solid ${e.palette.divider}`})),Qt=styled$1(se)(({theme:e})=>({color:e.palette.info.dark,backgroundColor:e.palette.info.light,borderColor:e.palette.divider,minWidth:"88px",height:"24px"})),Yt=styled$1(se)(({theme:e})=>({color:e.palette.grey.A700,backgroundColor:`${e.palette.grey.A700}1A`,minWidth:"88px",height:"24px"})),er=styled$1(le)(()=>({fontSize:"11px",textAlign:"left",display:"flex",justifyContent:"flex-start",alignItems:"center",overflow:"hidden",gap:"4px",textOverflow:"ellipsis",whiteSpace:"nowrap"})),tr=styled$1("span")(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-start",gap:e.spacing(1)})),rr=styled$1("span")(()=>({width:"24px",height:"24px",borderRadius:"50%",backgroundColor:"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0})),or=styled$1("img")(()=>({width:"36px",height:"24px"})),nr=styled$1("div")(({percentage:e,isCapture:t,theme:r})=>({background:`conic-gradient(${t?r.palette.info.dark:"#656565"} ${e}%, transparent 0.00%)`,borderRadius:"50%",width:"8.333px",height:"8.333px",border:`0.6px solid ${t?r.palette.info.dark:"#656565"}`}));var de=styled(P)(()=>({display:"flex",gap:"8px",overflow:"visible"})),lt=["trackWidth","minTrackWidth","slotSize","hoverZIndex"],me=styled("div",{shouldForwardProp:e=>!lt.includes(e)})(({trackWidth:e,minTrackWidth:t,slotSize:r,hoverZIndex:o})=>({position:"relative",overflow:"visible",width:e,minWidth:t,height:r,transition:`width ${.22}s ease-out`,...o!==void 0?{zIndex:o}:{}})),B=styled(P)(()=>({display:"flex",alignItems:"center",paddingRight:"8px","& .chip-stack-overlap-slot":{marginRight:"-8px",position:"relative",zIndex:1},"& .chip-stack-overlap-slot:hover":{zIndex:2}}));function ue(e){return {display:"flex",alignItems:"center",justifyContent:"center",width:`var(--chip-stack-slot-size, ${24}px)`,height:`var(--chip-stack-slot-size, ${24}px)`,borderRadius:"50%",border:`1px solid ${e.palette.divider}`,backgroundColor:e.palette.common.white,flexShrink:0}}var he=styled(({title:e,className:t,...r})=>e!=null&&e!==""?jsx(p,{title:e,wrapperProps:{className:"chip-stack-overlap-slot"},children:jsx(P,{className:t,...r})}):jsx(P,{className:["chip-stack-overlap-slot",t].filter(Boolean).join(" "),...r}))(({theme:e})=>({...ue(e),overflow:"hidden",lineHeight:0,boxSizing:"border-box",padding:0,"& > *":{width:"100%",height:"100%",minWidth:0,minHeight:0},"& img":{display:"block",width:"100%",height:"100%",objectFit:"contain"}})),V=styled(({title:e,...t})=>jsx(p,{title:e??"",wrapperProps:{className:"chip-stack-overlap-slot"},children:jsx(P,{...t})}))(({theme:e})=>({...ue(e),fontSize:`max(${8}px, calc(var(--chip-stack-slot-size, ${24}px) * ${8.5} / ${24}))`,fontWeight:500,color:e.palette.text.disabled}));function fe({overflowItems:e,size:t}){let r=`${Math.max(8,8.5*t/24)}px`;return jsxs(P,{sx:{width:t,height:t,borderRadius:"50%",border:o=>`1px solid ${o.palette.divider}`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:r,fontWeight:600,bgcolor:"action.hover",flexShrink:0},children:["+",e.length]})}var ct=["faceSize","avatarFill"],Se=styled(ce,{shouldForwardProp:e=>!ct.includes(e)})(({theme:e,faceSize:t,avatarFill:r})=>{let o=`${t}px`,i=`${Math.max(7,8.5*t/24)}px`;return {width:o,height:o,fontSize:i,fontWeight:500,lineHeight:"100%",letterSpacing:"0%",textAlign:"center",color:e.palette.common.white,background:r,backgroundSize:"cover","&.MuiAvatar-colorDefault":{background:r,color:e.palette.common.white},"& .MuiAvatar-img":{objectFit:"cover"}}});function xe(e){return e==="fanout-left"?"left":e==="fanout-center"?"center":"right"}function Ce(e,t,r){return e==="static"?t?"static-children":r?"static-items":null:t?"animated-children":r?"animated-items":null}function ge({size:e,stackStep:t,gap:r,minTrackWidth:o}){let i=e??24,n=t??Math.round(i/2),l=r??Math.max(1,Math.round(i*3/24)),a=o??Math.max(60,Math.round(i*60/24));return {size:i,stackStep:n,gap:l,minTrackWidth:a}}function ke(e,t){if(e<=0)return 0;switch(t){case "right":return 0;case "left":return e-1;default:return Math.floor((e-1)/2)}}function ye(e,t){return t!==void 0&&e>t}function M(e,t){return t===void 0||t<1||e.length<t?{visibleItems:e,hiddenItems:[]}:{visibleItems:e.slice(0,t-1),hiddenItems:e.slice(t-1)}}function ht(e,t){return isValidElement(e)&&e.key!=null&&e.key!==""?String(e.key):`chip-stack-child-${t}`}function Z({items:e,maxItems:t,getItemKey:r,renderItem:o,renderOverflow:i,slotSize:n}){let l={slotSize:n};if(e.length===0)return [];let{visibleItems:a,hiddenItems:p}=M(e,t),c=a.map((d,s)=>({key:r(d,s),render:()=>o(d,s,l)}));return p.length>0&&c.push({key:`chip-stack-overflow-${p.length}-${a.length}`,render:()=>i({items:e,overflowItems:p,size:n})}),c}function be({children:e,maxItems:t,slotSize:r,renderOverflow:o}){let i=Children.toArray(e);return Z({items:i,maxItems:t,getItemKey:ht,renderItem:n=>n,renderOverflow:o,slotSize:r})}function Ae(e,t){return e.length===t.length&&e.every((r,o)=>r===t[o])}function X(e,t,r){return e[t]??r}function ve(e,t,r,o,i,n){if(e===0)return [];let l=t*i,a=new Array(e);a[t]=l;for(let p=t-1;p>=0;p-=1)a[p]=a[p+1]-X(r,p,n)-o;for(let p=t+1;p<e;p+=1)a[p]=a[p-1]+X(r,p-1,n)+o;return a}function Te(e,t,r){return e<=0?0:(e-1)*t+r}function Re(e,t,r,o){return Array.from({length:e},(i,n)=>e<=1||!t?0:r[n]-n*o)}function Ie(e,t,r,o,i){if(e<=0)return 0;let n=t.map((p,c)=>p+X(r,c,i)),l=Math.min(...t),a=Math.max(...n);return Math.max(o,a-l)}function Pe(e,t,r){return Array.from({length:e},(o,i)=>{let n=t.current[i];return n?n.offsetWidth:r})}function j(e,t){return e.id??`${e.first}-${e.last}-${t}`}function we(e){return [e.first,e.last].map(t=>t?.[0]).filter(t=>t!=null&&t!=="").join("")}function _e(e){if(e.tooltip!==void 0)return e.tooltip===null?null:e.tooltip;let t=`${e.first||""} ${e.last||""}`.trim();return t!==""?t:null}function Ne({slotCount:e,anchorIndex:t,size:r,stackStep:o,gap:i,fanOutEnabled:n,compact:l}){let[a,p]=useState(false),[c,d]=useState(()=>Array.from({length:e},()=>r)),s=useRef(null),S=useRef([]),g=useRef(null),k=useCallback(()=>{let R=Pe(e,S,r);d(b=>Ae(b,R)?b:R);},[e,r]),u=useCallback(()=>{g.current&&cancelAnimationFrame(g.current),g.current=requestAnimationFrame(k);},[k]),y=useMemo(()=>ve(e,t,c,i,o,r),[e,t,c,i,o,r]),A=useMemo(()=>Re(e,n&&a,y,o),[e,n,a,y,o]),x=useMemo(()=>Te(e,o,r),[e,o,r]),O=useMemo(()=>Ie(e,y,c,x,r),[e,y,c,x,r]),C=useCallback(()=>{n&&(s.current&&clearTimeout(s.current),p(true));},[n]),h=useCallback(()=>{n&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>p(false),120));},[n]);useEffect(()=>()=>{s.current&&clearTimeout(s.current);},[]),useEffect(()=>{n||p(false);},[n]),useLayoutEffect(()=>{d(Array.from({length:e},()=>r));},[e,r]),useLayoutEffect(()=>{k();},[e,r,k]),useEffect(()=>(u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u),g.current&&cancelAnimationFrame(g.current);}),[u]);let v=n&&a?O:l?r:x,T=n&&a,N=useMemo(()=>l?Array.from({length:e},(R,b)=>b===t||a?1:0):Array.from({length:e},()=>1),[l,e,t,a]);return {isHovering:a,handleMouseEnter:C,handleMouseLeave:h,slotRefs:S,translateX:A,slotOpacity:N,collapsedStackWidthPx:x,fannedRowWidthPx:O,trackWidth:v,hoverZIndexActive:T}}function D({items:e,children:t,maxItems:r,getItemKey:o,renderItem:i,renderOverflow:n,fanOutDirection:l,compact:a=false,"data-testid":p,sx:c,className:d,slotProps:s}){let S=Children.count(t)>0,{zIndex:g=1e3,size:k,stackStep:u,gap:y,minTrackWidth:A}=s?.layout??{},x=useMemo(()=>S?Children.toArray(t??null).length:e?.length??0,[S,t,e]),C=!(!a&&ye(x,r)),{size:h,stackStep:F,gap:v,minTrackWidth:T}=useMemo(()=>ge({size:k,stackStep:u,gap:y,minTrackWidth:A}),[k,u,y,A]),N=n??fe,R=useMemo(()=>S?be({children:t??null,maxItems:r,slotSize:h,renderOverflow:N}):!e?.length||!o||!i?[]:Z({items:e,maxItems:r,getItemKey:o,renderItem:i,slotSize:h,renderOverflow:N}),[S,t,e,r,o,i,N,h]),b=R.length,Ke=useMemo(()=>ke(b,l),[b,l]),{handleMouseEnter:He,handleMouseLeave:De,slotRefs:$e,translateX:Be,slotOpacity:te,collapsedStackWidthPx:Xe,trackWidth:Ze,hoverZIndexActive:je}=Ne({slotCount:b,anchorIndex:Ke,size:h,stackStep:F,gap:v,fanOutEnabled:C,compact:a});if(b===0)return null;let{sx:z,...Ue}=s?.shell??{},{style:Ge,...qe}=s?.track??{};return jsx(de,{className:d,...Ue,sx:[{justifyContent:"flex-start",...C||a?{width:"100%"}:{}},...Array.isArray(c)?c:c!=null?[c]:[],...Array.isArray(z)?z:z!=null?[z]:[]],children:jsx(me,{"data-testid":p,...qe,style:Ge,onMouseEnter:C?He:void 0,onMouseLeave:C?De:void 0,trackWidth:Ze,minTrackWidth:a?h:Math.max(T,Xe),slotSize:h,hoverZIndex:je?g:void 0,children:R.map((re,I)=>jsx(motion.div,{ref:Je=>{$e.current[I]=Je;},initial:false,animate:{x:Be[I]??0,opacity:te[I]??1},transition:{duration:.22,ease:"easeOut"},style:{position:"absolute",top:0,left:I*F,zIndex:I,width:h,height:h,pointerEvents:te[I]===0?"none":"auto"},children:re.render()},re.key))})})}function Ct({children:e,maxItems:t,renderOverflow:r,slotSize:o=24,sx:i,...n}){let l=useMemo(()=>St.Children.toArray(e),[e]),{visibleItems:a,hiddenItems:p}=useMemo(()=>M(l,t),[l,t]),c=p.length>0,d=useMemo(()=>[{"--chip-stack-slot-size":`${o}px`},...Array.isArray(i)?i:i!=null?[i]:[]],[o,i]);if(!c)return jsx(B,{"data-testid":"ChipStack",...n,sx:d,children:e});let s=r?.({items:l,overflowItems:p,size:o});return jsxs(B,{"data-testid":"ChipStack",...n,sx:d,children:[a,s??jsx(V,{title:`${p.length} more`,children:jsxs("span",{children:["+",p.length]})})]})}var Q=memo(Ct);function kt(e){return jsx(he,{"data-testid":"OverlapChip",...e})}var Y=memo(kt);var bt=["static","fanout-right","fanout-left","fanout-center"],ee="static";function vt(e){let{variant:t=ee,maxItems:r,renderOverflow:o,children:i,items:n,getItemKey:l,renderItem:a,compact:p=false,"data-testid":c,slotProps:d,sx:s,className:S}=e,g=Children.count(i??null)>0,k=!g&&(n?.length??0)>0&&l!=null&&a!=null,u=Ce(t,g,k);if(u===null)return null;if(u==="static-children"||u==="static-items"){let x=d?.layout?.size??24;if(u==="static-items"&&n&&l&&a){let{visibleItems:O,hiddenItems:C}=M(n,r),h=C.length>0?o?.({items:n,overflowItems:C,size:x})??jsx(V,{title:`${C.length} more`,children:jsxs("span",{children:["+",C.length]})}):null,F=jsxs(Fragment,{children:[O.map((v,T)=>jsx(Y,{children:a(v,T,{slotSize:x})},l(v,T))),h]});return jsx(Q,{"data-testid":c,slotSize:x,sx:s,className:S,children:F})}return jsx(Q,{"data-testid":c,maxItems:r,renderOverflow:o,slotSize:x,sx:s,className:S,children:i})}let y=xe(t),A={maxItems:r,renderOverflow:o,fanOutDirection:y,compact:p,"data-testid":c??"ChipStack",slotProps:d,sx:s,className:S};return u==="animated-children"?jsx(D,{...A,children:i}):jsx(D,{...A,items:n,getItemKey:l,renderItem:a})}var ze=vt;function wt({item:e,sourceIndex:t,slotSize:r}){let[o,i]=useState(false),n=useRef(null);useEffect(()=>{i(false);},[e.logo]);let l=!e.logo||o,a=j(e,t),p$1="transparent";l&&(n.current?.key!==a&&(n.current={key:a,fill:Aa()}),p$1=n.current.fill);let c=jsx(Se,{faceSize:r,avatarFill:p$1,src:l?void 0:e.logo,slotProps:l?void 0:{img:{onError:()=>i(true)}},children:we(e)}),d=_e(e);return d!=null&&d!==""?jsx(p,{title:d,children:c}):c}var _t=wt;var to=ze;export{le as a,Xt as b,Zt as c,jt as d,Ut as e,Gt as f,qt as g,Jt as h,ce as i,se as j,Qt as k,Yt as l,er as m,tr as n,rr as o,or as p,nr as q,f as r,$ as s,j as t,Y as u,bt as v,ee as w,ze as x,_t as y,to as z};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { ChipStackProps } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Overlapping chip row for avatars, logos, flags, or any circular content.
|
|
5
|
-
*
|
|
6
|
-
* ### Variant
|
|
7
|
-
* Pick one of four variants — the variant encodes both the render mode and fan-out direction:
|
|
8
|
-
*
|
|
9
|
-
* | Variant | Behavior |
|
|
10
|
-
* |---|---|
|
|
11
|
-
* | `"static"` *(default)* | Overlapping row, no animation |
|
|
12
|
-
* | `"fanout-right"` | Fans right on hover (anchor: leftmost chip) |
|
|
13
|
-
* | `"fanout-left"` | Fans left on hover (anchor: rightmost chip) |
|
|
14
|
-
* | `"fanout-center"` | Fans both ways on hover (anchor: middle chip) |
|
|
15
|
-
*
|
|
16
|
-
* Add `compact` to show only the anchor chip until hovered.
|
|
17
|
-
*
|
|
18
|
-
* ### Input styles
|
|
19
|
-
* - **Data-driven** — `items` + `getItemKey` + `renderItem`
|
|
20
|
-
* - **Compositional** — `children` (wrap in `<OverlapChip>` for static, or pass raw nodes)
|
|
21
|
-
*
|
|
22
|
-
* When both are provided, `children` takes precedence. Face avatars: `ChipStackFaceSlot` in `renderItem` with `getChipStackFaceItemKey` as `getItemKey`.
|
|
23
|
-
* Hoist `renderItem` to module scope when referential stability matters.
|
|
24
|
-
*
|
|
25
|
-
* ---
|
|
26
|
-
*
|
|
27
|
-
* ### Examples
|
|
28
|
-
*
|
|
29
|
-
* ```tsx
|
|
30
|
-
* <ChipStack
|
|
31
|
-
* variant="fanout-right"
|
|
32
|
-
* items={members}
|
|
33
|
-
* getItemKey={getChipStackFaceItemKey}
|
|
34
|
-
* renderItem={(item, index, { slotSize }) => (
|
|
35
|
-
* <ChipStackFaceSlot item={item} sourceIndex={index} slotSize={slotSize} />
|
|
36
|
-
* )}
|
|
37
|
-
* />
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* ```tsx
|
|
41
|
-
* // Brand logos — static overlap row
|
|
42
|
-
* <ChipStack variant="static" maxItems={4}>
|
|
43
|
-
* {methods.map((m) => (
|
|
44
|
-
* <OverlapChip key={m.id} title={m.label}>
|
|
45
|
-
* <img src={m.logo} alt={m.label} />
|
|
46
|
-
* </OverlapChip>
|
|
47
|
-
* ))}
|
|
48
|
-
* </ChipStack>
|
|
49
|
-
* ```
|
|
50
|
-
*
|
|
51
|
-
* ```tsx
|
|
52
|
-
* // Custom overflow slot
|
|
53
|
-
* <ChipStack
|
|
54
|
-
* variant="fanout-right"
|
|
55
|
-
* items={assignees}
|
|
56
|
-
* getItemKey={(a) => a.id}
|
|
57
|
-
* renderItem={renderFaceItem}
|
|
58
|
-
* maxItems={3}
|
|
59
|
-
* renderOverflow={({ overflowItems, size }) => (
|
|
60
|
-
* <MyBadge count={overflowItems.length} size={size} />
|
|
61
|
-
* )}
|
|
62
|
-
* />
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
declare function ChipStack<T = unknown>(props: Readonly<ChipStackProps<T>>): import("react").JSX.Element | null;
|
|
66
|
-
export default ChipStack;
|
|
67
|
-
export { ChipStack };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { BoxProps } from '@mui/material/Box';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
import type { ChipStackOverflowRenderArgs, ChipStackFanOutDirection, ChipStackItemRenderContext, ChipStackSlotProps } from '../types';
|
|
4
|
-
type AnimatedStackProps<T> = {
|
|
5
|
-
children?: ReactNode;
|
|
6
|
-
items?: readonly T[];
|
|
7
|
-
maxItems?: number;
|
|
8
|
-
getItemKey?: (item: T, index: number) => string;
|
|
9
|
-
renderItem?: (item: T, index: number, ctx: ChipStackItemRenderContext) => ReactNode;
|
|
10
|
-
renderOverflow?: (args: ChipStackOverflowRenderArgs<T>) => ReactNode;
|
|
11
|
-
/** Fan-out direction derived from `variant` in the parent. */
|
|
12
|
-
fanOutDirection: ChipStackFanOutDirection;
|
|
13
|
-
/**
|
|
14
|
-
* When `true` (`compact` prop on `ChipStack`), only the anchor chip is
|
|
15
|
-
* visible while idle. Hovering reveals all chips with the fan-out animation.
|
|
16
|
-
*/
|
|
17
|
-
compact?: boolean;
|
|
18
|
-
'data-testid'?: string;
|
|
19
|
-
sx?: BoxProps['sx'];
|
|
20
|
-
className?: string;
|
|
21
|
-
slotProps?: Pick<ChipStackSlotProps, 'shell' | 'track' | 'layout'>;
|
|
22
|
-
};
|
|
23
|
-
export default function AnimatedStack<T>({ items, children, maxItems, getItemKey, renderItem, renderOverflow, fanOutDirection, compact, 'data-testid': dataTestId, sx, className, slotProps, }: Readonly<AnimatedStackProps<T>>): import("react").JSX.Element | null;
|
|
24
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { ChipStackFaceItem } from '../types';
|
|
3
|
-
type Props = {
|
|
4
|
-
item: ChipStackFaceItem;
|
|
5
|
-
sourceIndex: number;
|
|
6
|
-
slotSize: number;
|
|
7
|
-
};
|
|
8
|
-
export type ChipStackFaceSlotProps = Props;
|
|
9
|
-
/** Face chip for `ChipStack` `renderItem`. */
|
|
10
|
-
declare function ChipStackFaceSlot({ item, sourceIndex, slotSize }: Props): import("react").JSX.Element;
|
|
11
|
-
export default ChipStackFaceSlot;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react';
|
|
2
|
-
import { StyledOverlapChip } from '../style';
|
|
3
|
-
/**
|
|
4
|
-
* Single circular chip used inside `ChipStack` (**static** variant). Pass an icon, image, or text node as children.
|
|
5
|
-
* Use a `title` for the hover tooltip.
|
|
6
|
-
*/
|
|
7
|
-
declare function OverlapChip(props: ComponentProps<typeof StyledOverlapChip>): import("react").JSX.Element;
|
|
8
|
-
declare const _default: import("react").MemoExoticComponent<typeof OverlapChip>;
|
|
9
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { BoxProps } from '@mui/material/Box';
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
import type { ChipStackOverflowRenderArgs } from '../types';
|
|
5
|
-
export type StaticStackProps = BoxProps & {
|
|
6
|
-
maxItems?: number;
|
|
7
|
-
renderOverflow?: (args: ChipStackOverflowRenderArgs<ReactNode>) => ReactNode;
|
|
8
|
-
slotSize?: number;
|
|
9
|
-
};
|
|
10
|
-
declare function StaticStack({ children, maxItems, renderOverflow, slotSize, sx, ...props }: StaticStackProps): React.JSX.Element;
|
|
11
|
-
declare const _default: React.MemoExoticComponent<typeof StaticStack>;
|
|
12
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** Default circular slot size (px); used to derive stack step, gap, and min track width. */
|
|
2
|
-
export declare const OVERLAP_STACK_SIZE_PX = 24;
|
|
3
|
-
export declare const OVERLAP_STACK_GAP_PX = 3;
|
|
4
|
-
export declare const OVERLAP_STACK_MIN_TRACK_WIDTH_PX = 60;
|
|
5
|
-
/** Fan-out animation duration (s) for the animated variant (per-slot translate transitions). */
|
|
6
|
-
export declare const CHIP_STACK_ANIMATED_DURATION_S = 0.22;
|
|
7
|
-
/** Hover-leave debounce (ms) before collapsing the row, to absorb pointer jitter between slots. */
|
|
8
|
-
export declare const CHIP_STACK_HOVER_LEAVE_MS = 120;
|
|
9
|
-
/** Default elevated z-index applied to the track while hovered. */
|
|
10
|
-
export declare const CHIP_STACK_DEFAULT_HOVER_Z_INDEX = 1000;
|
|
11
|
-
/** Minimum legible font size for the overflow chip. */
|
|
12
|
-
export declare const CHIP_STACK_OVERFLOW_MIN_FONT_PX = 8;
|
|
13
|
-
/** Reference font size for the overflow chip at the default slot size. */
|
|
14
|
-
export declare const CHIP_STACK_OVERFLOW_REF_FONT_PX = 8.5;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export type UseAnimatedStackArgs = {
|
|
3
|
-
slotCount: number;
|
|
4
|
-
/** Anchor slot index — resolved from fan direction in `AnimatedStack`. */
|
|
5
|
-
anchorIndex: number;
|
|
6
|
-
size: number;
|
|
7
|
-
stackStep: number;
|
|
8
|
-
gap: number;
|
|
9
|
-
/** Whether hover should expand the row into the fanned layout. */
|
|
10
|
-
fanOutEnabled: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* When `true` (`compact` prop on `ChipStack`), non-anchor chips are
|
|
13
|
-
* invisible while idle and animate into view on hover.
|
|
14
|
-
*/
|
|
15
|
-
compact: boolean;
|
|
16
|
-
};
|
|
17
|
-
export declare function useAnimatedStack({ slotCount, anchorIndex, size, stackStep, gap, fanOutEnabled, compact }: UseAnimatedStackArgs): {
|
|
18
|
-
isHovering: boolean;
|
|
19
|
-
handleMouseEnter: () => void;
|
|
20
|
-
handleMouseLeave: () => void;
|
|
21
|
-
slotRefs: import("react").MutableRefObject<(HTMLDivElement | null)[]>;
|
|
22
|
-
translateX: number[];
|
|
23
|
-
slotOpacity: number[];
|
|
24
|
-
collapsedStackWidthPx: number;
|
|
25
|
-
fannedRowWidthPx: number;
|
|
26
|
-
trackWidth: number;
|
|
27
|
-
hoverZIndexActive: boolean;
|
|
28
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import ChipStack from './ChipStack';
|
|
2
|
-
export default ChipStack;
|
|
3
|
-
export { ChipStack };
|
|
4
|
-
export { default as OverlapChip } from './components/OverlapChip';
|
|
5
|
-
export { default as ChipStackFaceSlot } from './components/ChipStackFaceSlot';
|
|
6
|
-
export type { ChipStackFaceSlotProps } from './components/ChipStackFaceSlot';
|
|
7
|
-
export { getChipStackFaceItemKey } from './util';
|
|
8
|
-
export { OVERLAP_STACK_SIZE_PX, CHIP_STACK_ANIMATED_DURATION_S } from './constants';
|
|
9
|
-
export { CHIP_STACK_VARIANTS, DEFAULT_CHIP_STACK_VARIANT } from './types';
|
|
10
|
-
export type { ChipStackProps, ChipStackFaceItem, ChipStackVariant, ChipStackSlotProps, ChipStackItemRenderContext, ChipStackOverflowRenderArgs, } from './types';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{s as CHIP_STACK_ANIMATED_DURATION_S,v as CHIP_STACK_VARIANTS,x as ChipStack,y as ChipStackFaceSlot,w as DEFAULT_CHIP_STACK_VARIANT,r as OVERLAP_STACK_SIZE_PX,u as OverlapChip,z as default,t as getChipStackFaceItemKey}from'../../_chunks/chunk-WE7NB24K.js';import'../../_chunks/chunk-TIO3V7XA.js';import'../../_chunks/chunk-4XXNGLS6.js';import'../../_chunks/chunk-V2RLDP5A.js';import'../../_chunks/chunk-ZDBICST5.js';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { type BoxProps } from '@mui/material/Box';
|
|
2
|
-
import type { Theme } from '@mui/material/styles';
|
|
3
|
-
import type { ReactNode } from 'react';
|
|
4
|
-
import type { ChipStackOverflowRenderArgs } from './types';
|
|
5
|
-
export declare const AnimatedStackShell: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
7
|
-
}, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
8
|
-
export declare const AnimatedStackTrack: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
9
|
-
trackWidth: number;
|
|
10
|
-
minTrackWidth: number;
|
|
11
|
-
slotSize: number;
|
|
12
|
-
hoverZIndex?: number | undefined;
|
|
13
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
-
export declare const OverlapChipRow: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
15
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
16
|
-
}, keyof import("@mui/system").BoxOwnProps<Theme>> & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
17
|
-
export declare const StyledOverlapChip: import("@emotion/styled").StyledComponent<Omit<BoxProps, "title"> & {
|
|
18
|
-
title?: ReactNode;
|
|
19
|
-
} & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
20
|
-
/** Default styled `+N` chip for the **static** variant overflow slot. */
|
|
21
|
-
export declare const ChipStackStaticOverflowChip: import("@emotion/styled").StyledComponent<Omit<BoxProps, "title"> & {
|
|
22
|
-
title?: ReactNode;
|
|
23
|
-
} & import("@mui/system").MUIStyledCommonProps<Theme>, {}, {}>;
|
|
24
|
-
/** Default overflow renderer used when `renderOverflow` is not provided. */
|
|
25
|
-
export declare function ChipStackOverflowDefault({ overflowItems, size }: Readonly<ChipStackOverflowRenderArgs>): import("react").JSX.Element;
|
|
26
|
-
export declare const ChipStackFace: import("@emotion/styled").StyledComponent<Omit<Omit<import("../primitives").AvatarProps, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
27
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
28
|
-
} & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
29
|
-
faceSize: number;
|
|
30
|
-
avatarFill: string;
|
|
31
|
-
}, {}, {}>;
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import type { BoxProps } from '@mui/material/Box';
|
|
2
|
-
import type { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
-
/**
|
|
4
|
-
* Controls both the render mode and (for fanout variants) the fan-out direction.
|
|
5
|
-
*
|
|
6
|
-
* - `"static"` — overlapping row, no hover animation **(default)**
|
|
7
|
-
* - `"fanout-right"` — fans right on hover (anchor: leftmost chip)
|
|
8
|
-
* - `"fanout-left"` — fans left on hover (anchor: rightmost chip)
|
|
9
|
-
* - `"fanout-center"` — fans both ways on hover (anchor: middle chip)
|
|
10
|
-
*/
|
|
11
|
-
export type ChipStackVariant = 'static' | 'fanout-right' | 'fanout-left' | 'fanout-center';
|
|
12
|
-
/** All variant values — useful for building selects/controls. */
|
|
13
|
-
export declare const CHIP_STACK_VARIANTS: readonly ["static", "fanout-right", "fanout-left", "fanout-center"];
|
|
14
|
-
/** Default variant when `variant` is omitted. */
|
|
15
|
-
export declare const DEFAULT_CHIP_STACK_VARIANT: ChipStackVariant;
|
|
16
|
-
/** Resolved internally from `variant` — not exposed as a prop. */
|
|
17
|
-
export type ChipStackFanOutDirection = 'right' | 'left' | 'center';
|
|
18
|
-
/** Passed to `renderItem` so the callback knows how large to render each chip. */
|
|
19
|
-
export type ChipStackItemRenderContext = {
|
|
20
|
-
slotSize: number;
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Passed to `renderOverflow` when items exceed `maxItems`.
|
|
24
|
-
*
|
|
25
|
-
* @template T — matches the `items` array type on `ChipStackProps<T>`.
|
|
26
|
-
* `ReactNode` for compositional (children) usage.
|
|
27
|
-
*/
|
|
28
|
-
export type ChipStackOverflowRenderArgs<T = unknown> = {
|
|
29
|
-
/** The full `items` array passed to `ChipStack`. */
|
|
30
|
-
items: readonly T[];
|
|
31
|
-
/** The hidden items that overflowed past `maxItems`. */
|
|
32
|
-
overflowItems: readonly T[];
|
|
33
|
-
/** Chip diameter in px — size your overflow chip to this value. */
|
|
34
|
-
size: number;
|
|
35
|
-
};
|
|
36
|
-
export type ChipStackFaceItem = {
|
|
37
|
-
/** Optional stable key — defaults to `first-last-index`. */
|
|
38
|
-
id?: string;
|
|
39
|
-
first: string;
|
|
40
|
-
last: string;
|
|
41
|
-
/** Omitted or broken → initials on gradient. */
|
|
42
|
-
logo?: string;
|
|
43
|
-
/** Custom tooltip content — defaults to `"First Last"`. Pass `null` to disable. */
|
|
44
|
-
tooltip?: ReactNode | null;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Fine-grained style/prop overrides for internal slots.
|
|
48
|
-
*/
|
|
49
|
-
export type ChipStackSlotProps = {
|
|
50
|
-
/** Outer flex shell wrapping the chip track (`Box`). */
|
|
51
|
-
shell?: BoxProps;
|
|
52
|
-
/** Positioned `<div>` holding all chip slots — use for `aria-label` and other HTML attributes. */
|
|
53
|
-
track?: HTMLAttributes<HTMLDivElement>;
|
|
54
|
-
/**
|
|
55
|
-
* Layout dimensions for the animated track.
|
|
56
|
-
* Pass here instead of as top-level props to keep the component surface clean.
|
|
57
|
-
*/
|
|
58
|
-
layout?: {
|
|
59
|
-
/** Z-index of the track while hovered. @default 1000 */
|
|
60
|
-
zIndex?: number;
|
|
61
|
-
/** Chip diameter in px. @default 24 */
|
|
62
|
-
size?: number;
|
|
63
|
-
/** Horizontal distance between stacked chips in px. */
|
|
64
|
-
stackStep?: number;
|
|
65
|
-
/** Space between chips when fully expanded in px. */
|
|
66
|
-
gap?: number;
|
|
67
|
-
/** Minimum width of the chip track container in px. */
|
|
68
|
-
minTrackWidth?: number;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* Props for `ChipStack`.
|
|
73
|
-
*
|
|
74
|
-
* Two input styles:
|
|
75
|
-
* - **Data-driven** — `items` + `getItemKey` + `renderItem`
|
|
76
|
-
* - **Compositional** — `children` (wrap in `OverlapChip` for static, or pass raw nodes)
|
|
77
|
-
*
|
|
78
|
-
* When both are provided, `children` takes precedence and `items` is ignored.
|
|
79
|
-
*/
|
|
80
|
-
export type ChipStackProps<T = unknown> = {
|
|
81
|
-
/**
|
|
82
|
-
* Controls render mode and fan-out direction.
|
|
83
|
-
*
|
|
84
|
-
* - `"static"` — overlapping row, no animation **(default)**
|
|
85
|
-
* - `"fanout-right"` — fans right on hover
|
|
86
|
-
* - `"fanout-left"` — fans left on hover
|
|
87
|
-
* - `"fanout-center"` — fans both ways on hover
|
|
88
|
-
*/
|
|
89
|
-
variant?: ChipStackVariant;
|
|
90
|
-
/** Data array. Requires `getItemKey` and `renderItem`. */
|
|
91
|
-
items?: readonly T[];
|
|
92
|
-
getItemKey?: (item: T, index: number) => string;
|
|
93
|
-
renderItem?: (item: T, index: number, ctx: ChipStackItemRenderContext) => ReactNode;
|
|
94
|
-
/** Rendered as-is. Wrap in `OverlapChip` for static variants. */
|
|
95
|
-
children?: ReactNode;
|
|
96
|
-
/** Cap visible chips; collapse the rest into a `+N` indicator. */
|
|
97
|
-
maxItems?: number;
|
|
98
|
-
/**
|
|
99
|
-
* **Fanout variants only.** When `true`, only the anchor chip is visible while idle.
|
|
100
|
-
* Hovering reveals all chips with the fan-out animation defined by `variant`.
|
|
101
|
-
*
|
|
102
|
-
* Pairs with any `fanout-*` variant:
|
|
103
|
-
* ```tsx
|
|
104
|
-
* <ChipStack variant="fanout-right" compact items={apps} ... />
|
|
105
|
-
* ```
|
|
106
|
-
*
|
|
107
|
-
* @default false
|
|
108
|
-
*/
|
|
109
|
-
compact?: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* Fully replace the `+N` overflow slot.
|
|
112
|
-
* Receives `{ items, overflowItems, size }` where `items` is the full data array
|
|
113
|
-
* and `overflowItems` is the hidden slice.
|
|
114
|
-
*
|
|
115
|
-
* ```tsx
|
|
116
|
-
* renderOverflow={({ items, overflowItems, size }) => (
|
|
117
|
-
* <MyPopover trigger={`+${overflowItems.length}`} chipSize={size} data={items} />
|
|
118
|
-
* )}
|
|
119
|
-
* ```
|
|
120
|
-
*/
|
|
121
|
-
renderOverflow?: (args: ChipStackOverflowRenderArgs<T>) => ReactNode;
|
|
122
|
-
sx?: BoxProps['sx'];
|
|
123
|
-
className?: string;
|
|
124
|
-
/** Style/prop overrides for internal slots and layout dimensions. */
|
|
125
|
-
slotProps?: ChipStackSlotProps;
|
|
126
|
-
'data-testid'?: string;
|
|
127
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { MutableRefObject, ReactNode } from 'react';
|
|
2
|
-
import type { ChipStackFaceItem, ChipStackFanOutDirection, ChipStackOverflowRenderArgs, ChipStackVariant } from './types';
|
|
3
|
-
type ChipStackAnimatedLayout = {
|
|
4
|
-
size: number;
|
|
5
|
-
stackStep: number;
|
|
6
|
-
gap: number;
|
|
7
|
-
minTrackWidth: number;
|
|
8
|
-
};
|
|
9
|
-
type ChipStackAnimatedLayoutOverrides = Partial<ChipStackAnimatedLayout>;
|
|
10
|
-
export type ChipStackSlotModel = {
|
|
11
|
-
key: string;
|
|
12
|
-
render: () => ReactNode;
|
|
13
|
-
};
|
|
14
|
-
/** Three exclusive render paths resolved from props. */
|
|
15
|
-
export declare enum ChipStackRenderMode {
|
|
16
|
-
StaticChildren = "static-children",
|
|
17
|
-
StaticItems = "static-items",
|
|
18
|
-
AnimatedChildren = "animated-children",
|
|
19
|
-
AnimatedItems = "animated-items"
|
|
20
|
-
}
|
|
21
|
-
/** Returns true when the variant is any of the animated variants. */
|
|
22
|
-
export declare function isAnimatedVariant(variant: ChipStackVariant): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Extracts the fan-out direction from the variant string.
|
|
25
|
-
* Only meaningful for fanout variants.
|
|
26
|
-
*/
|
|
27
|
-
export declare function getFanOutDirection(variant: ChipStackVariant): ChipStackFanOutDirection;
|
|
28
|
-
/**
|
|
29
|
-
* Resolves which render path `ChipStack` should take.
|
|
30
|
-
* Returns `null` when there is nothing to render.
|
|
31
|
-
*/
|
|
32
|
-
export declare function resolveChipStackMode(variant: ChipStackVariant, hasChildren: boolean, hasItems: boolean): ChipStackRenderMode | null;
|
|
33
|
-
export declare function getChipStackAnimatedLayout({ size: sizeProp, stackStep: stackStepProp, gap: gapProp, minTrackWidth: minTrackWidthProp, }: ChipStackAnimatedLayoutOverrides): ChipStackAnimatedLayout;
|
|
34
|
-
export declare function getFanOutAnchorIndex(slotCount: number, direction: ChipStackFanOutDirection): number;
|
|
35
|
-
/** True when `maxItems` forces overflow handling. */
|
|
36
|
-
export declare function isChipStackAnimatedCapped(sourceCount: number, maxItems: number | undefined): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Splits `items` into visible and hidden slices based on `maxItems`.
|
|
39
|
-
*
|
|
40
|
-
* Overflow triggers when `items.length >= maxItems` and `maxItems >= 1`.
|
|
41
|
-
* The first `maxItems - 1` items are visible; the rest are hidden.
|
|
42
|
-
* When `maxItems` is undefined or `< 1`, all items are visible and hidden is empty.
|
|
43
|
-
*/
|
|
44
|
-
export declare function splitChipStackOverflow<T>(items: readonly T[], maxItems: number | undefined): {
|
|
45
|
-
visibleItems: readonly T[];
|
|
46
|
-
hiddenItems: readonly T[];
|
|
47
|
-
};
|
|
48
|
-
export declare function getReactChildKey(child: unknown, index: number): string;
|
|
49
|
-
export declare function buildChipStackSlots<T>({ items, maxItems, getItemKey, renderItem, renderOverflow, slotSize, }: {
|
|
50
|
-
items: readonly T[];
|
|
51
|
-
maxItems: number | undefined;
|
|
52
|
-
getItemKey: (item: T, sourceIndex: number) => string;
|
|
53
|
-
renderItem: (item: T, sourceIndex: number, ctx: {
|
|
54
|
-
slotSize: number;
|
|
55
|
-
}) => ReactNode;
|
|
56
|
-
renderOverflow: (args: ChipStackOverflowRenderArgs<T>) => ReactNode;
|
|
57
|
-
slotSize: number;
|
|
58
|
-
}): ChipStackSlotModel[];
|
|
59
|
-
export declare function buildChipStackSlotsFromChildren({ children, maxItems, slotSize, renderOverflow, }: {
|
|
60
|
-
children: ReactNode;
|
|
61
|
-
maxItems: number | undefined;
|
|
62
|
-
slotSize: number;
|
|
63
|
-
renderOverflow: (args: ChipStackOverflowRenderArgs<ReactNode>) => ReactNode;
|
|
64
|
-
}): ChipStackSlotModel[];
|
|
65
|
-
export declare function areSlotWidthArraysEqual(a: number[], b: number[]): boolean;
|
|
66
|
-
export declare function computeFannedOutLeftPositionsPx(slotCount: number, anchorIndex: number, slotWidthsPx: number[], gap: number, stackStep: number, fallbackSlotWidthPx: number): number[];
|
|
67
|
-
export declare function computeCollapsedStackWidthPx(slotCount: number, stackStep: number, faceSize: number): number;
|
|
68
|
-
export declare function computeFanOutTranslateXPx(slotCount: number, isHovering: boolean, fannedLeftPositionsPx: number[], stackStep: number): number[];
|
|
69
|
-
export declare function computeFannedRowWidthPx(slotCount: number, fannedLeftPositionsPx: number[], slotWidthsPx: number[], collapsedWidthPx: number, fallbackSlotWidthPx: number): number;
|
|
70
|
-
export declare function readMeasuredSlotWidthsPx(slotCount: number, slotRefs: MutableRefObject<Array<HTMLDivElement | null>>, fallbackSlotWidthPx: number): number[];
|
|
71
|
-
export declare function getChipStackFaceItemKey(item: ChipStackFaceItem, index: number): string;
|
|
72
|
-
export declare function getChipStackFaceInitials(item: ChipStackFaceItem): string;
|
|
73
|
-
export declare function getChipStackFaceItemTooltipContent(item: ChipStackFaceItem): ReactNode | null;
|
|
74
|
-
export {};
|