@orfium/ictinus 5.29.1 → 5.29.2
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/index.js +8 -9
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1587,17 +1587,16 @@ const pr = (...e) => {
|
|
|
1587
1587
|
size: a = 20,
|
|
1588
1588
|
onClick: i,
|
|
1589
1589
|
dataTestId: l,
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
} = e, f = JC[n];
|
|
1590
|
+
hasHover: s,
|
|
1591
|
+
...c
|
|
1592
|
+
} = e, u = pr(t, Y(null)), p = !!i, f = JC[n];
|
|
1594
1593
|
return /* @__PURE__ */ d("div", { onClick: i, css: em({
|
|
1595
1594
|
size: a,
|
|
1596
|
-
hasHover: p,
|
|
1597
|
-
isInteractive:
|
|
1598
|
-
}), "data-testid": l, ref:
|
|
1599
|
-
C.key === "Enter" && i &&
|
|
1600
|
-
}, ...
|
|
1595
|
+
hasHover: s ?? p,
|
|
1596
|
+
isInteractive: p
|
|
1597
|
+
}), "data-testid": l, ref: u, tabIndex: p ? 0 : void 0, onKeyDown: (C) => {
|
|
1598
|
+
C.key === "Enter" && i && u.current.click();
|
|
1599
|
+
}, ...c, children: /* @__PURE__ */ d(f, { css: tm({
|
|
1601
1600
|
color: o,
|
|
1602
1601
|
size: a
|
|
1603
1602
|
}) }) });
|
package/dist/index.umd.cjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
background: ${n.tokens.state.get("backgroundColor.hover")};
|
|
8
8
|
box-shadow: 0px 0px 0px 8px ${n.tokens.state.get("backgroundColor.hover")};
|
|
9
9
|
}
|
|
10
|
-
`,";","")},lf=({color:e,size:t=20})=>()=>{const r=typeof t=="number"||t.includes("px")?P(t):t;return m.css("width:",r,";height:",r,";path,rect{fill:",e,"!important;}","")},H=g.forwardRef((e,t)=>{e=rn(e,"icon");const r=N(),{name:n,color:o=r.tokens.colors.get("textColor.default.secondary"),size:a=20,onClick:i,dataTestId:l,...
|
|
10
|
+
`,";","")},lf=({color:e,size:t=20})=>()=>{const r=typeof t=="number"||t.includes("px")?P(t):t;return m.css("width:",r,";height:",r,";path,rect{fill:",e,"!important;}","")},H=g.forwardRef((e,t)=>{e=rn(e,"icon");const r=N(),{name:n,color:o=r.tokens.colors.get("textColor.default.secondary"),size:a=20,onClick:i,dataTestId:l,hasHover:s,...u}=e,d=Kt(t,v.useRef(null)),f=!!i,p=of[n];return c.jsx("div",{onClick:i,css:af({size:a,hasHover:s??f,isInteractive:f}),"data-testid":l,ref:d,tabIndex:f?0:void 0,onKeyDown:C=>{C.key==="Enter"&&i&&d.current.click()},...u,children:c.jsx(p,{css:lf({color:o,size:a})})})});H.displayName="Icon";const on=v.forwardRef((e,t)=>{e=rn(e,"link");const{type:r="primary",placement:n="block",size:o=1,iconName:a,isDisabled:i,component:l,dataTestPrefixId:s="",children:u,...d}=e,f=N(),p=l??"a",C=l?{to:e.href}:{},y=r==="inverted";return c.jsxs(p,{css:nf({placement:n,type:r,size:o,isDisabled:i}),ref:t,"data-testid":`${s}_link`,...C,...d,children:[c.jsx("span",{children:u}),a&&c.jsx(H,{name:a,color:f.tokens.colors.get(y?"textColor.inverted.active":"textColor.default.active"),size:f.dimension.sizing.get(ef[o]),dataTestId:`${s}_link_icon`})]})});on.displayName="Link";const sf="Go back to",cf=({href:e,label:t,dataTestPrefixId:r=""})=>c.jsx("div",{css:J8(),children:c.jsx(on,{size:2,href:e,dataTestPrefixId:`${r}_breadcrumb_go_back_to_${t}`,children:`${sf} ${t}`})}),uf=()=>e=>m.css(me,";gap:",e.dimension.spacing.get("sm"),";flex-wrap:nowrap;list-style:none;padding:0;margin:0;","");var df={name:"s5xdrg",styles:"display:flex;align-items:center"};const ff=()=>df,pf=({isLastItem:e})=>t=>m.css("display:flex;align-items:center;gap:",t.dimension.spacing.get("sm"),";",e&&j(t.tokens.typography.get("normal.body02"))," ",e&&`
|
|
11
11
|
color: ${t.tokens.colors.get("textColor.default.secondary")};
|
|
12
12
|
`,";",""),gf=({childComponent:e,isLastItem:t=!1})=>{const r=N();return c.jsx("li",{css:ff(),children:c.jsxs("div",{css:pf({isLastItem:t}),children:[e,!t&&c.jsx(H,{name:"triangleRight",color:r.tokens.colors.get("textColor.default.secondary"),size:r.dimension.sizing.get("icon.md")})]})})},jc=(e,t)=>t===e.length-1,Uc=g.forwardRef(({items:e=[],backTo:t,dataTestPrefixId:r=""},n)=>{const o=g.useCallback((l,s)=>{const{label:u,href:d}=l;return jc(e,s)?c.jsx("span",{"data-testid":`${r}_breadcrumb_${u}`,children:u}):c.jsx(on,{size:2,dataTestPrefixId:`${r}_breadcrumb_link_${u}`,...q.omit(l,"label"),children:u},d)},[r,e]),a=g.useMemo(()=>(l,s)=>{const u=fl("data_item_"),d=jc(e,s);return c.jsx(gf,{childComponent:l,isLastItem:d},u)},[e]),i=g.useMemo(()=>{if(!q.isEmpty(e))return e.map(o).map(a);if(t)return c.jsx(cf,{href:t.href,label:t.label,dataTestPrefixId:r})},[t,r,a,e,o]);return c.jsx("ol",{"aria-label":"Breadcrumb",ref:n,css:uf(),"data-testid":`${r}_breadcrumb`,children:i})});Uc.displayName="Breadcrumb";const Cf=()=>e=>({display:"flex",alignItems:"center",justifyContent:"center",gap:e.globals.spacing.get("4")}),ze={primary:{defaultFill:"palette.primary.base",hoverFill:"palette.primary.muted",activeFill:"palette.primary.contrast",text:"textColor.inverted.primary"},secondary:{defaultFill:"palette.secondary.base",hoverFill:"palette.secondary.muted",activeFill:"palette.secondary.contrast",text:"textColor.default.active"},tertiary:{defaultFill:"palette.tertiary.base",hoverFill:"palette.tertiary.muted",activeFill:"palette.tertiary.contrast",text:"textColor.default.active"},danger:{defaultFill:"palette.error.base",hoverFill:"palette.error.muted",activeFill:"palette.error.contrast",text:"textColor.default.error"}},vf={normal:"normal.label02",compact:"normal.label03"},yf={compact:{size:{value:"{sizing.7}",type:"sizing",description:"Sets size for iconButton ('compact' variant)"},padding:{value:"{spacing.0} {spacing.4} {spacing.0} {spacing.4}",type:"spacing",description:"Sets horizontal/vertical padding for 'compact' textButton"}},normal:{size:{value:"{sizing.9}",type:"sizing",description:"Sets size for iconButtons"},padding:{value:"{spacing.0} {spacing.6} {spacing.0} {spacing.6}",type:"spacing",description:"Sets horizontal/vertical padding for 'normal' textButton"}}},hf=e=>Me(yf,e),bf=({isBlock:e})=>m.css({position:"relative",width:e?"100%":"fit-content"},"",""),mf=({type:e="primary",size:t="normal",isBlock:r,isLoading:n,isDisabled:o,isIconButton:a,shape:i,sx:l})=>s=>{const u=hf(s),d=()=>{if(r)return"100%";if(a)return u(`${t}.size`)},f={display:"flex",alignItems:"center",justifyContent:"center",color:s.tokens.colors.get(ze[e].text),width:d(),height:u(`${t}.size`),backgroundColor:s.tokens.colors.get(ze[e][n?"activeFill":"defaultFill"]),padding:u(`${t}.padding`),borderRadius:a&&i==="circle"?s.dimension.borderRadius.get("circle"):s.dimension.borderRadius.get("md"),border:"none",cursor:"pointer",transition:"background-color,border 150ms linear",":focus-visible:not(:disabled)":{backgroundColor:s.tokens.colors.get(ze[e].hoverFill)},":disabled":{opacity:s.tokens.disabledState.get("default"),cursor:"not-allowed"},":hover:not(:disabled)":{backgroundColor:s.tokens.colors.get(ze[e].hoverFill)},':active:not(:disabled), &[aria-expanded="true"]':{backgroundColor:s.tokens.colors.get(ze[e].activeFill)}},p=n&&!o?{pointerEvents:"none"}:{};return m.css(j(s.tokens.typography.get(vf[t])),";",f,";",p,";",l==null?void 0:l.container,";","")};var wf={name:"1duu0ib",styles:"width:100%;position:absolute"};const Sf=()=>wf,xf=()=>e=>m.css({width:"100%",height:P(4),overflow:"hidden",borderTopLeftRadius:e.dimension.borderRadius.get("md"),borderTopRightRadius:e.dimension.borderRadius.get("md"),position:"relative",":before":{content:'""',width:"100%",height:P(2),display:"block"}},"",""),Ef=()=>{const e=m.keyframes({from:{left:"-50%"},to:{left:"100%"}});return m.css({width:"50%",background:"linear-gradient(270deg, #F814E1 0.02%, #4945EE 100%)",height:P(2),position:"absolute",bottom:"0",top:"0",animation:`${e} 1.5s infinite`},"","")},Zc=({dataTestId:e})=>c.jsx("div",{css:Sf(),"data-testid":e,children:c.jsx("div",{css:xf(),children:c.jsx("div",{css:Ef()})})});Zc.displayName="ButtonLoader";const hl=v.forwardRef((e,t)=>{e=rn(e,"button");const{type:r="primary",size:n="normal",isBlock:o=!1,isDisabled:a=!1,isLoading:i=!1,isIconButton:l=!1,shape:s="circle",children:u,dataTestId:d="",dataTestPrefixId:f="",htmlType:p="button",onClick:C,onBlur:y,sx:b,...S}=e,h=`${f}button`;return c.jsxs("div",{css:bf({isBlock:o}),children:[i&&!a&&c.jsx(Zc,{dataTestId:h}),c.jsx("button",{...q.omit(S,["avatar","iconRightName","iconLeftName","iconName"]),ref:t,type:p,"data-testid":K(h,d),css:mf({type:r,size:n,isLoading:i,isBlock:o,isDisabled:a,isIconButton:l,shape:s,sx:b}),onClick:x=>{C&&C(x)},onBlur:y,disabled:a,children:u})]})});hl.displayName="ButtonBase";const xe=v.forwardRef((e,t)=>{const{type:r="primary",size:n="normal",iconLeftName:o,iconRightName:a,avatar:i,children:l,onClick:s,isLoading:u}=e,d=["primary","secondary","tertiary"].includes(r)&&i,f=N();return c.jsx(hl,{...e,ref:t,isLoading:u,onClick:s,children:c.jsx("span",{css:Cf(),children:n==="compact"?c.jsx("span",{children:l}):c.jsxs(c.Fragment,{children:[d&&c.jsx(tn,{src:i==null?void 0:i.src,children:i==null?void 0:i.label}),o&&!d&&c.jsx(H,{name:o,color:f.tokens.colors.get(ze[r].text)}),c.jsx("span",{children:l}),a&&c.jsx(H,{name:a,color:f.tokens.colors.get(ze[r].text)})]})})})});xe.displayName="Button";const _f=({elevated:e,isTransparent:t,radius:r})=>n=>m.css("box-shadow:",e?n.globals.elevation[e]:void 0,";background:",t?n.tokens.colors.get("backgroundColor.transparent"):n.tokens.colors.get("backgroundColor.default"),";border-radius:",r?n.globals.spacing.get(r):0,";outline:",t?void 0:`${n.globals.borderWidth.get("1")} solid ${n.tokens.colors.get("borderColor.decorative.default")}`,";",""),Gc=({elevated:e,isTransparent:t=!1,radius:r,children:n})=>c.jsx("div",{css:_f({elevated:e,isTransparent:t,radius:r}),children:n}),Kc=e=>({svg:{transform:`rotate(${e}deg)`,transition:"0.2s"}});var kf={name:"1nrevy2",styles:"position:relative;display:inline-block"};const Tf=()=>kf,$f=({type:e})=>t=>{const r=e!=="tertiary"?{borderRight:`${t.globals.borderWidth.get("1")} solid transparent`}:{};return m.css({"button:first-of-type":{borderTopRightRadius:"unset",borderBottomRightRadius:"unset"},...r},"","")},Yc=(e,t)=>({backgroundColor:e.tokens.colors.get(ze[t].activeFill),":hover:not(:disabled)":{backgroundColor:e.tokens.colors.get(ze[t].activeFill)}}),Af=({isOpen:e,type:t})=>r=>{const n=e?{button:Yc(r,t)}:{};return m.css(n,"","")},Pf=({isOpen:e,type:t})=>r=>{const n=e?{button:Yc(r,t),...Kc(180)}:{...Kc(0)};return m.css({"button:last-child":{borderTopLeftRadius:"unset",borderBottomLeftRadius:"unset"},...n},"","")},se=v.forwardRef((e,t)=>{const{iconName:r,size:n="normal",type:o="primary",shape:a="circle",dataTestPrefixId:i}=e,l=N(),s=l.tokens.colors.get(ze[o].text);return c.jsx(hl,{...e,ref:t,isIconButton:!0,shape:a,dataTestPrefixId:i?`${i}-icon-`:"icon-",children:c.jsx(H,{size:l.dimension.sizing.get(`icon.${n==="compact"?"sm":"md"}`),name:r,color:s})})});se.displayName="IconButton";const Of=6,Xc=5,an={compact:40,normal:52},Qc=(e,t="normal")=>j(e.tokens.typography.get(`${t}.headline01`)),Jc=(e,t="normal")=>j(e.tokens.typography.get(`${t}.headline02`)),e3=(e,t="normal")=>j(e.tokens.typography.get(`${t}.headline03`)),t3=(e,t="normal")=>j(e.tokens.typography.get(`${t}.headline04`)),r3=(e,t="normal")=>j(e.tokens.typography.get(`${t}.headline05`)),Mf=(e,t="normal")=>j(e.tokens.typography.get(`${t}.title01`)),Lf=(e,t="normal")=>j(e.tokens.typography.get(`${t}.title02`)),If=(e,t="normal")=>j(e.tokens.typography.get(`${t}.title03`)),n3=(e,t="normal")=>j(e.tokens.typography.get(`${t}.label01`)),e1=(e,t="normal")=>j(e.tokens.typography.get(`${t}.label02`)),bl=(e,t="normal")=>j(e.tokens.typography.get(`${t}.label03`)),Bf=(e,t="normal")=>j(e.tokens.typography.get(`${t}.label04`)),o3=(e,t="normal")=>j(e.tokens.typography.get(`${t}.body01`)),ml=(e,t="normal")=>j(e.tokens.typography.get(`${t}.body02`)),t1=(e,t="normal")=>j(e.tokens.typography.get(`${t}.body03`)),qf=(e,t="normal")=>j(e.tokens.typography.get(`${t}.body04`)),a3=_e("li",{target:""})(({rowSize:e="normal",isDisabled:t,theme:r})=>{const n=e==="compact",o=P(an[e]),a=m.css("0 ",r.dimension.spacing.get("md"),";",""),i=n?t1(r):ml(r);return m.css("background-color:",r.tokens.colors.get("palette.tertiary.base"),";&>div{",i,";}span[role='presentation']{padding:",a,";min-height:",o,";align-items:center;display:flex;",i,";font-weight:",r.globals.typography.fontWeight.get("bold"),";}&[role='option']{padding:",a,";min-height:",o,";display:flex;flex-direction:row;gap:",P(12),";&:hover{background-color:",t?void 0:r.tokens.colors.get("palette.tertiary.muted"),";cursor:",t?"initial":"pointer",";}}&[data-focus-visible]{background-color:",r.tokens.colors.get("palette.tertiary.muted"),";}&[aria-selected='true']{background-color:",r.tokens.colors.get("palette.tertiary.muted"),";&>div{color:",r.tokens.colors.get("textColor.default.active"),";",n?bl(r):e1(r),";}&[data-focus-visible]{background-color:",r.tokens.colors.get("palette.tertiary.muted"),";}}opacity:",t?"0.5":"1",";cursor:",t?"not-allowed":"initial",";","")},""),i3=v.forwardRef(({children:e,rowSize:t,isDisabled:r=!1,isHighlighted:n=!1,searchTerm:o,dataTestId:a,...i},l)=>{var s;return c.jsx(a3,{"data-testid":`ictinus_list_item_${(s=i["data-key"])==null?void 0:s.replace(/ /g,"_")}`,...i,rowSize:t,isDisabled:r,ref:l,children:e})});i3.displayName="ListItem";const Df=({width:e,isSearchable:t})=>r=>m.css("border:",t?"initial":`${r.dimension.borderWidth.get("default")} solid ${r.tokens.colors.get("borderColor.decorative.default")}`,";border-radius:",t?"initial":r.dimension.borderRadius.get("md"),";width:",`${e}px`||"100%",";box-shadow:",r.tokens.boxShadow.get("2"),";",""),ln=({width:e,height:t,maxHeight:r,isSearchable:n})=>o=>m.css("padding-left:0;margin-top:0;margin-bottom:0;border-radius:",n?"initial":o.dimension.borderRadius.get("md"),";width:",e?P(e):"100%",";height:",t?P(t):"auto",";max-height:",r?P(r):"auto",";overflow:auto;overflow-x:hidden;background:",o.tokens.colors.get("backgroundColor.default"),";","");var Rf={name:"n1lsvi",styles:"padding:0;list-style:none"};const Nf=()=>Rf,l3=typeof window<"u"?v.useLayoutEffect:v.useEffect;function Ff(e,t,r){const n=v.useRef(t);l3(()=>{n.current=t},[t]),v.useEffect(()=>{const o=window;if(!(o&&o.addEventListener))return;const a=i=>n.current(i);return o.addEventListener(e,a),()=>{o.removeEventListener(e,a)}},[e,r])}function Hf(){const[e,t]=v.useState(null),[r,n]=v.useState({width:0,height:0}),o=v.useCallback(()=>{n({width:(e==null?void 0:e.offsetWidth)||0,height:(e==null?void 0:e.offsetHeight)||0})},[e==null?void 0:e.offsetHeight,e==null?void 0:e.offsetWidth]);return Ff("resize",o),l3(()=>{o()},[e==null?void 0:e.offsetHeight,e==null?void 0:e.offsetWidth]),[t,r,e]}const s3=5,c3=v.forwardRef(({rowHeight:e,children:t,gap:r=0,isVirtualizationEnabled:n=!0,...o},a)=>{const[i,{height:l}]=Hf(),s=Kt(i,a),[u,d]=v.useState(0),f=v.useMemo(()=>{if(!n)return t.map((b,S)=>v.cloneElement(b,{}));const C=Math.max(Math.floor(u/e)-s3,0),y=Math.min(Math.ceil((u+l)/e-1)+s3,t.length-1);return t.slice(C,y+1).map((b,S)=>v.cloneElement(b,{style:{position:"absolute",top:(C+S)*e+S*r,height:e,left:0,right:0,lineHeight:`${e}px`}}))},[t,l,e,u,r,n]),p=v.useMemo(()=>q.throttle(function(C){d(C.target.scrollTop)},50,{leading:!1}),[]);return c.jsx("ul",{onScroll:p,...o,style:{overflowY:"auto",position:"relative",display:"flex",flexDirection:"column",height:"100%",listStyle:"none",padding:0},ref:s,children:f})});c3.displayName="Window";const r1=v.forwardRef((e,t)=>{const{width:r,height:n,isVirtualized:o=!1,dataTestId:a}=e,i=Ct.useListState({...e,selectionMode:"single"}),l=v.useRef(null),s=Kt(l,t),{listBoxProps:u}=ie.useListBox(e,i,s),d=i.collection.getFirstKey(),f=d?i.collection.getItem(d):null;return c.jsx("div",{css:Df({width:r}),children:c.jsx("div",{"data-testid":a?`${a}_list`:"ictinus_list",children:c.jsx("div",{style:{height:o&&n?n:"100%"},children:c.jsx(c3,{...u,css:ln({width:r,height:n}),id:u.id,isVirtualizationEnabled:o,rowHeight:an[(f==null?void 0:f.props.rowSize)??"normal"],ref:s,children:Array.from(i.collection).map(p=>p.type==="section"?c.jsx(zf,{section:p,state:i},p.key):c.jsx(u3,{item:p,state:i},p.key))})})})})});r1.displayName="List";function u3({item:e,state:t,style:r}){var u;const n=v.useRef(null),{optionProps:o,isDisabled:a}=ie.useOption({key:e.key},t,n),{isFocusVisible:i,isFocused:l,focusProps:s}=ie.useFocusRing();return c.jsx(i3,{...ie.mergeProps(o,s),id:o.id,ref:n,isDisabled:a,style:r,"data-focus-visible":i||void 0,"data-focused":l||void 0,"data-empty":t.collection.size===0||void 0,rowSize:((u=e.props)==null?void 0:u.rowSize)||"normal",children:e.rendered})}function zf({section:e,state:t}){var a;const{itemProps:r,headingProps:n,groupProps:o}=ie.useListBoxSection({heading:e.rendered,"aria-label":e["aria-label"]});return c.jsx(c.Fragment,{children:c.jsxs(a3,{...r,rowSize:((a=e.props)==null?void 0:a.rowSize)||"normal",isDisabled:!1,children:[e.rendered&&c.jsx("span",{...n,id:n.id,children:e.rendered}),c.jsx("ul",{...o,"aria-labelledby":o["aria-labelledby"],css:Nf,children:[...e.childNodes].map(i=>{var l;return c.jsx(u3,{item:{...i,props:{...i.props,rowSize:((l=e.props)==null?void 0:l.rowSize)||"normal"}},state:t},i.key)})})]})})}const Vf=(e,t)=>r=>m.css("color:",r.tokens.colors.get("textColor.default.primary"),";font-weight:","initial",";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:inherit;flex:1;display:flex;flex-direction:column;justify-content:center;strong{font-weight:bold;}span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}",""),Wf=()=>e=>m.css(j(e.tokens.typography.get("normal.body03")),";color:",e.tokens.colors.get("textColor.default.secondary"),";",""),Ve=e=>c.jsxs("div",{css:Vf(),children:[c.jsx("span",{children:e.children}),e.description&&c.jsx("p",{css:Wf(),children:e.description})]});var jf={name:"o2d6zf",styles:"display:flex;flex-direction:row;align-items:center;justify-content:center"};const Uf=()=>()=>jf,wl=e=>c.jsx("div",{css:Uf(),children:e.children}),Le=e=>{const t=e.parentType==="Menu"?"div":Ct.Item;return m.createElement(t,{...e,key:String(e.key)},e.children)};Le.getCollectionNode=Ct.Item.getCollectionNode;const Sl=e=>c.jsx(Ct.Section,{...e});Sl.getCollectionNode=Ct.Section.getCollectionNode;const Zf=({menuPosition:e,sx:t})=>r=>m.css("max-height:",P(253),";overflow-y:auto;position:absolute;left:",e==="left"?0:"initial",";right:0;min-width:",P(150),";max-width:",P(620),";width:fit-content;height:auto;background-color:",r.globals.oldColors.white,";box-shadow:",r.globals.elevation["02"],";border-radius:",P(4),";z-index:1;",t,";","");var Gf={name:"zjik7",styles:"display:flex"};const d3=v.forwardRef((e,t)=>{const{size:r="normal",onButtonClick:n,onOptionSelect:o,menuPosition:a="left",items:i,type:l="primary",dataTestPrefixId:s="",iconButtonName:u="moreOptions",children:d}=e,f=N(),[p,C]=v.useState(!1),y=!n,b=v.useCallback(E=>{n==null||n(E),C(!1)},[n]),S=v.useCallback(E=>{C(!1),o(E)},[o]),h=v.useCallback(()=>C(!p),[p]),x=v.useCallback(E=>{C(!1);const A=String(q.head(Array.from(E))),T=i==null?void 0:i.find(w=>w===A);T&&S(T)},[S,i]);return c.jsx(dl,{onClick:()=>C(!1),children:c.jsxs("div",{css:Tf(),children:[y?c.jsx("div",{css:Af({type:l,isOpen:p}),children:c.jsx(se,{type:l,size:r,iconName:u,onClick:h,dataTestPrefixId:K("icon-dropdown",s)})}):c.jsxs("div",{css:Gf,children:[c.jsx("div",{css:$f({type:l}),children:c.jsx(xe,{type:l,size:r,ref:t,onClick:b,dataTestPrefixId:K("dropdown",s),children:d})}),c.jsx("div",{css:Pf({isOpen:p,type:l}),children:c.jsx(se,{type:l,size:r,iconName:"triangleDown",shape:"square",onClick:h,dataTestPrefixId:K("dropdown-toggle",s)})})]}),p&&c.jsx("div",{css:Zf({menuPosition:a,sx:{top:P(r==="compact"?34:42)}})(f),children:i&&c.jsx(r1,{label:"dropdown-button",onSelectionChange:x,dataTestId:K("dropdown-button-options",s),children:i.map(E=>c.jsx(Le,{rowSize:"compact",children:c.jsx(Ve,{children:E})},E))})})]})})});d3.displayName="DropdownButton";const f3=16,Kf=2,Yf=({colors:e,value:t,x:r,y:n,width:o,height:a,index:i})=>{const l=N(),s=r&&o?Number(r)+Number(o)+f3:f3,u=n&&a?Number(n)+Number(a)/Kf:0,d=i&&e[i]?e[i]:l.globals.oldColors.black;return c.jsx("text",{x:s,y:u,children:c.jsx("tspan",{dy:"0.335em",fontWeight:"bold",fill:d,children:t})})},Xf=e=>()=>m.css("width:inherit;height:inherit;color:",e,";white-space:nowrap;overflow:hidden;text-overflow:ellipsis;",""),Qf=()=>e=>m.css("display:block;position:fixed;top:-33%;left:106%;color:",e.globals.colors.get("neutral.1"),";background-color:",e.tokens.colors.get("backgroundColor.inverted"),";opacity:90%;border-radius:",e.globals.spacing.get("3"),";padding:",e.globals.spacing.get("4"),";",""),Jf=()=>e=>m.css("content:'';position:absolute;border-style:solid;margin-top:",P(-5),";border-width:",P(5),";border-color:transparent ",e.tokens.colors.get("backgroundColor.inverted")," transparent transparent;top:50%;left:100%;opacity:90%;",""),ep=({content:e,fill:t})=>{const r=v.useRef(null),[n,o]=v.useState(!1),[a,i]=v.useState(!1);v.useEffect(()=>{i(r.current?r.current.scrollWidth>r.current.clientWidth:!1)},[i]);const l=v.useCallback(()=>{o(!0)},[o]),s=v.useCallback(()=>{o(!1)},[o]);return c.jsxs("div",{ref:r,onMouseEnter:l,onMouseLeave:s,css:Xf(t),children:[e,n&&a&&c.jsxs("div",{children:[c.jsx("div",{css:Qf(),children:e}),c.jsx("div",{css:Jf()})]})]})},tp=()=>e=>({fontSize:e.globals.typography.fontSize.get("3"),padding:`${e.globals.spacing.get("4")} ${e.globals.spacing.get("6")}`,margin:e.globals.spacing.get("4"),color:e.globals.colors.get("neutral.1"),background:e.tokens.colors.get("backgroundColor.inverted"),opacity:"90%",borderRadius:e.globals.spacing.get("3"),minWidth:P(200),whiteSpace:"nowrap"}),rp=()=>()=>({padding:"0px",margin:"0px"}),np=()=>e=>({listStyleType:"none",color:e.globals.colors.get("neutral.1"),width:"100%",display:"flex",justifyContent:"space-between",height:e.globals.spacing.get("6"),padding:`${e.globals.spacing.get("4")} 0px`,"div:last-child":{marginLeft:e.globals.spacing.get("6"),span:{marginLeft:e.globals.spacing.get("3")}}}),op=({payload:e})=>{var r,n,o;const t=e&&((o=(n=(r=e[0])==null?void 0:r.payload)==null?void 0:n.options)==null?void 0:o.hoverInfo);return t?c.jsx("div",{className:"custom-tooltip",css:tp(),children:c.jsx("ul",{css:rp(),children:t.map(({name:a,value:i,percentage:l})=>c.jsxs("li",{css:np(),children:[c.jsx("div",{children:a}),c.jsxs("div",{children:[c.jsx("span",{children:c.jsx("b",{children:i})}),l&&c.jsxs("span",{children:["(",l,")"]})]})]},`${a}${i}`))})}):null},ap=.05,ip=.2,lp=e=>{const t=e||0,r=t?Math.pow(10,t==null?void 0:t.toString().length):0,n=ap*r,o=n*(Math.floor(t/n)+1),a=o/n,i=a%2?o/n+1:a/2+1;return{maxDomainValue:o,tickCount:i}},sp=(e,t)=>e===0?`${e}`:t>1e9||e===1e9?`${e/1e9}B`:t>1e6||e===1e6?`${e/1e6}M`:t>=1e3||e===1e3?`${e/1e3}K`:`${e}`,cp=(e,t)=>e.map(r=>{var n,o,a,i;return(n=r==null?void 0:r.options)!=null&&n.color?((o=r==null?void 0:r.options)==null?void 0:o.coloringOption)==="all"?I.lighten(ip,(a=r==null?void 0:r.options)==null?void 0:a.color):(i=r==null?void 0:r.options)==null?void 0:i.color:t}),up=(e,t)=>e.reduce((r,n,o)=>{var a,i,l;return((a=n.options)==null?void 0:a.coloringOption)!=="all"||(t&&t(n)?r[t(n)]=(i=n.options)==null?void 0:i.color:r[o]=(l=n.options)==null?void 0:l.color),r},{});function xl(e){return({children:r,...n})=>c.jsx(oe.ResponsiveContainer,{aspect:n==null?void 0:n.aspect,children:c.jsx(e,{...n,children:r})})}const p3=9.5,g3=160,dp=({colors:e,y:t,width:r,payload:n})=>{const o=N(),a=typeof n.value=="string"&&e[n.value]?e[n.value]:o.globals.oldColors.black;return c.jsx("g",{children:c.jsx("foreignObject",{y:t-10,width:r,height:"20",style:{overflow:"visible"},children:c.jsx(ep,{content:n.value,fill:a})})})},fp=xl(oe.BarChart),pp=({data:e})=>{const t=N(),r=v.useMemo(()=>cp(e,t.globals.oldColors.flat.darkBlue[100]),[e,t.globals.oldColors.flat.darkBlue]),n=v.useCallback(p=>q.max(e.map(p)),[e]),o=v.useCallback(p=>up(e,p),[e]),a=n(p=>p.name.length),i=n(p=>p.value),l=a&&a*p3<g3?a*p3:g3,{maxDomainValue:s,tickCount:u}=lp(i),d=o(()=>!1),f=o(p=>p.name);return c.jsxs(fp,{data:e,margin:{top:5,right:60,left:20,bottom:15},layout:"vertical",barCategoryGap:"20%",maxBarSize:32,children:[c.jsx(oe.CartesianGrid,{horizontal:!1}),c.jsx(oe.XAxis,{type:"number",axisLine:!1,tickLine:!1,tickMargin:24,tickCount:u,domain:[0,s],tickFormatter:p=>sp(p,s)}),c.jsx(oe.Tooltip,{cursor:{fill:t.tokens.colors.get("backgroundColor.alt")},content:c.jsx(op,{})}),c.jsxs(oe.Bar,{dataKey:"value",children:[c.jsx(oe.LabelList,{dataKey:"barLabel",position:"right",content:c.jsx(Yf,{colors:d})}),e.map((p,C)=>c.jsx(oe.Cell,{fill:r[C]},`cell-${p.name}-${p.value}`))," "]}),c.jsx(oe.YAxis,{type:"category",dataKey:"name",tick:p=>c.jsx(dp,{...p,colors:f}),width:l,axisLine:!1,tickLine:!1})]})};var gp={name:"ih7ruz",styles:"display:flex;width:100%;justify-content:center"};const Cp=()=>()=>gp,vp=()=>e=>m.css("width:80%;font-size:",e.globals.typography.fontSize.get("2"),";color:",e.tokens.colors.get("textColor.default.secondary"),";text-align:center;",""),yp=({viewBox:e,value:t,units:r})=>{const{cx:n,cy:o}=e,a=N();return c.jsxs("g",{children:[c.jsx("text",{x:n,y:o,className:"recharts-text recharts-label",textAnchor:"middle",dominantBaseline:"central",children:c.jsx("tspan",{x:"50%",dy:"-7",alignmentBaseline:"middle",fontSize:a.globals.typography.fontSize.get("4"),fill:a.globals.oldColors.black,children:t})}),c.jsx("foreignObject",{y:"52%",width:"100%",height:o&&o/2.5,children:c.jsx("div",{css:Cp(),children:c.jsx("div",{css:vp(),children:r})})})]})},hp=xl(oe.PieChart),bp=({data:e,value:t,units:r})=>{const n=v.useMemo(()=>e.map(o=>(o==null?void 0:o.color)||""),[e]);return c.jsx(hp,{children:c.jsxs(oe.Pie,{data:e,innerRadius:"85%",outerRadius:"100%",paddingAngle:0,startAngle:90,endAngle:-270,dataKey:"value",blendStroke:!0,children:[e.map((o,a)=>c.jsx(oe.Cell,{fill:n[a]},`cell--${o.name}-${o.value}`)),c.jsx(oe.Label,{position:"center",content:c.jsx(yp,{value:t,units:r})})]})})},mp=()=>e=>({fontSize:e.globals.typography.fontSize.get("3"),padding:e.globals.spacing.get("4"),color:e.globals.colors.get("neutral.1"),background:e.tokens.colors.get("backgroundColor.inverted"),opacity:"90%",borderRadius:e.globals.spacing.get("3"),minWidth:P(200),whiteSpace:"nowrap"}),wp=()=>e=>({margin:`${e.globals.spacing.get("6")} 0`,height:P(1),borderWidth:0,backgroundColor:e.tokens.colors.get("backgroundColor.default"),opacity:"10%"}),Sp=()=>()=>({padding:0,margin:0}),xp=()=>e=>({listStyleType:"none",color:e.globals.colors.get("neutral.1"),width:"100%",display:"flex",justifyContent:"space-between",height:e.globals.spacing.get("6"),padding:`0px 0px ${P(-5)}`}),Ep=({label:e,payload:t})=>c.jsxs("div",{className:"custom-tooltip",css:mp(),children:[c.jsxs("p",{className:"label",style:{margin:"0px"},children:[`${e}`," "]}),t&&t.length>1&&c.jsx("hr",{css:wp()}),t&&c.jsx("ul",{css:Sp(),children:t.map(({name:r,value:n})=>c.jsxs("li",{css:xp(),children:[c.jsx("div",{children:r})," ",c.jsx("div",{children:n})]},r))})]}),_p=({dataLabel:e,color:t})=>c.jsxs("linearGradient",{id:`color${e}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:`${t}`,stopOpacity:.4}),c.jsx("stop",{offset:"95%",stopColor:`${t}`,stopOpacity:0})]}),kp=v.memo(_p),Tp=e=>q.uniq(q.flatten(e.map(t=>q.keys(q.omit(t,"name"))))),$p=({theme:e,uniqueKeyNames:t,color:r})=>{const n=q.sampleSize(e.globals.oldColors.flat,t.length);return t.reduce((o,a,i)=>{var s;const l=typeof r=="function"&&r(a)?r(a):(s=n[i])==null?void 0:s[400];return o[a]=l,o},{})},Ap=xl(oe.AreaChart),Pp=({data:e,labelX:t,labelY:r,isLegendVisible:n=!1,color:o})=>{const a=N(),i=v.useMemo(()=>Tp(e),[e]),l=v.useMemo(()=>$p({theme:a,uniqueKeyNames:i,color:o}),[a,i,o]),s=Object.entries(l);return i.length<=Object.keys(a.globals.oldColors.flat).length?c.jsxs(Ap,{data:e,margin:{top:10,right:20,left:20,bottom:50},aspect:1.5,children:[c.jsx("defs",{children:s.map(([u,d])=>c.jsx(kp,{dataLabel:u,color:d},`color${u}`))}),c.jsx(oe.XAxis,{dataKey:"name",tickMargin:31,axisLine:!1,tickLine:!1,label:t&&{value:t,angle:0,position:"bottom",offset:35}}),c.jsx(oe.YAxis,{tick:{textAnchor:"start"},tickMargin:40,axisLine:!1,tickLine:!1,label:r&&{value:r,angle:-90,position:"left",offset:15}}),c.jsx(oe.CartesianGrid,{vertical:!1}),n&&c.jsx(oe.Legend,{align:"left",iconType:"circle",iconSize:16,wrapperStyle:{paddingTop:P(50),paddingLeft:P(13)}}),c.jsx(oe.Tooltip,{cursor:{stroke:a.tokens.colors.get("backgroundColor.inverted"),strokeWidth:1},content:c.jsx(Ep,{})}),s.map(([u,d])=>c.jsx(oe.Area,{type:"linear",dataKey:u,stroke:d,fillOpacity:1,fill:`url(#color${u})`,activeDot:{r:3,stroke:"none"},dot:{r:3,fill:d}},u))]}):c.jsxs("p",{children:["You must define less than ",Object.keys(a.globals.oldColors.flat).length," different data"]})},Op={normal:"normal.body02",large:"normal.title01"},Mp=({size:e="normal"})=>t=>m.css(j(t.tokens.typography.get(Op[e])),";color:",t.tokens.colors.get("textColor.default.primary"),";",""),Lp=()=>e=>m.css(j(e.tokens.typography.get("normal.body03")),";color:",e.tokens.colors.get("textColor.default.secondary"),";padding-top:",e.globals.spacing.get("2"),";",""),El=({helpText:e,dataTestPrefixId:t})=>e?c.jsx("div",{css:Lp(),"data-testid":`${t}_helpText`,children:e}):null,_l=({size:e,dataTestPrefixId:t,children:r})=>typeof r=="string"?c.jsx("div",{css:Mp({size:e}),"data-testid":`${t}_label`,children:r}):c.jsx(c.Fragment,{children:r}),kl=v.createContext(null),C3=()=>v.useContext(kl),v3=g.forwardRef((e,t)=>{const{dataTestPrefixId:r,sx:n,children:o}=e,a=Ct.useRadioGroupState(e),{radioGroupProps:i}=ie.useRadioGroup(e,a);return c.jsx("div",{"aria-label":"RadioGroup",ref:t,...i,css:n,"data-testid":`${r}_radio_group_container`,children:c.jsx(kl.Provider,{value:a,children:o})})});v3.displayName="RadioGroup";const Ip=({placement:e="right",sx:t,isFocusVisible:r})=>n=>m.css("label{display:flex;flex-direction:",e==="right"?"row":"row-reverse",";align-items:center;justify-content:",e==="left"?"space-between":"unset",";gap:",n.dimension.spacing.get("md"),";position:relative;cursor:pointer;&:before{content:'';display:inline-block;width:",n.dimension.sizing.get("icon.md"),";height:",n.dimension.sizing.get("icon.md"),";box-sizing:border-box;border:",n.dimension.borderWidth.get("active")," solid ",n.tokens.colors.get("borderColor.interactive.default"),";border-radius:",n.dimension.borderRadius.get("circle"),";transition:all 200ms;background:",n.tokens.colors.get("backgroundColor.transparent"),";",r&&`
|
|
13
13
|
background: ${n.tokens.state.get("backgroundColor.hover")};
|