@orfium/ictinus 5.32.0 → 5.33.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/index.js CHANGED
@@ -19381,10 +19381,8 @@ const nH = ({
19381
19381
  }) => {
19382
19382
  const f = t === "compact";
19383
19383
  return /* @__PURE__ */ d(B8, { isOpen: l, onOpenChange: s, children: /* @__PURE__ */ d(t2, { triggerRef: i, css: ac, children: /* @__PURE__ */ d(lc, { selectionMode: e, selectedKeys: a, disabledKeys: o, onSelectionChange: n, css: io(p.listProps), "data-testid": u, onAction: c, children: g.Children.map(r, (h) => {
19384
- const {
19385
- key: m = ""
19386
- } = h;
19387
- return h.type === e9 ? h : /* @__PURE__ */ d(ic, { isCompact: f, rowSize: t, isDisabled: o.has(m), id: m, children: h }, m);
19384
+ const m = g.isValidElement(h) ? h.key ?? "" : "";
19385
+ return g.isValidElement(h) && h.type === e9 ? h : /* @__PURE__ */ d(ic, { isCompact: f, rowSize: t, isDisabled: o.has(m), id: m, children: h }, m);
19388
19386
  }) }) }) });
19389
19387
  }, sc = (e) => {
19390
19388
  le(() => {
@@ -127,7 +127,7 @@ Unable to find an `+(n===!1?"accessible ":"")+'element with the role "'+t+'"'+s+
127
127
  }`,";","")},_B=({isBetween:e})=>t=>m.css("vertical-align:middle;text-align:center;cursor:pointer;position:relative;background:",e?t.tokens.colors.get("palette.tertiary.muted"):t.tokens.colors.get("palette.tertiary.base"),";",""),kB=({isSelected:e,isToday:t,isDisabled:r,isBetween:n})=>o=>{const a=tl(o);return m.css(e1(o),";border:",e?0:o.dimension.borderWidth.get("default")," solid ",t?o.tokens.colors.get("borderColor.interactive.active"):o.tokens.colors.get("borderColor.decorative.transparent"),";border-radius:",(t||e)&&o.dimension.borderRadius.get("circle"),";width:",a("dateSize"),";height:",a("dateSize"),";color:",e?o.tokens.colors.get("textColor.inverted.primary"):o.tokens.colors.get("textColor.default.primary"),";box-sizing:border-box;display:flex;align-items:center;justify-content:center;background:",e?o.tokens.colors.get("palette.primary.contrast"):"transparent",";",!r&&`&:hover {
128
128
  border-radius: ${o.dimension.borderRadius.get("circle")};
129
129
  background: ${!e&&(n?"transparent":o.tokens.colors.get("palette.tertiary.muted"))};
130
- }`,";","")},TB=({day:e,month:t,year:r,onSelect:n,isSelected:o=!1,isBetween:a=!1,isLast:i=!1,isFirst:l=!1,isDisabled:s=!1,tabIndex:u})=>{const d=v.useMemo(()=>e&&re.month(t).date(e).year(r),[r,e,t]),f=v.useMemo(()=>re.month()===t&&re.year()===r&&re.date()===e,[r,t,e]),p=v.useCallback(y=>{y.preventDefault(),n&&d&&n(d)},[n,d]),{keyboardProps:h}=Xt({events:{keydown:{onEnter:y=>{s||p(y)}}},hasPropagation:!0});return e?c.jsx("td",{style:{padding:0},onClick:s?void 0:p,children:c.jsx("div",{css:EB({isSelected:o,isBetween:a,isLast:i,isFirst:l,isToday:f,isDisabled:s}),tabIndex:u,"data-testid":`${e}_${t+1}_${r}${o?"_selected":""}`,...h,children:c.jsx("div",{css:kB({isSelected:o,isBetween:a,isToday:f,isDisabled:s}),children:e})})}):c.jsx("td",{css:_B({isBetween:a})})},$B=v.memo(TB);fe.extend(z9);const AB=["Monday","Tuesday","Wednesday","Thurdsday","Friday","Saturday","Sunday"],PB=({year:e,month:t,onDaySelect:r,selectedDays:n,disabledDates:o,isFirstCalendar:a})=>{const i=g.useMemo(()=>{const b=re.month(t).year(e).date(1),S=b.daysInMonth(),C=b.day()||7,x=7,k=xB(e,t),$=Array(k*x).fill(null).reduce((w,_,T)=>{const B=T+1,W=D.inRange(B,C,S+C)?B-C+1:void 0;return[...w,W]},[]);return D.chunk($,x)},[e,t]),l=v.useCallback(SB,[]),s=v.useCallback(bB,[]),u=v.useCallback(mB,[]),d=v.useCallback(wB,[]),{focusedDay:f,setFocusedDay:p,calendarRef:h,keyboardProps:y}=pB({selectedDays:n,isFirstCalendar:a,month:t,year:e});return c.jsxs(g.Fragment,{children:[c.jsx("div",{css:vB(),children:AB.map(b=>c.jsx("div",{css:yB(),children:b.substr(0,2)},b))}),c.jsx("table",{css:hB(),ref:h,tabIndex:0,"data-testid":"calendar_table",...y,onFocus:()=>{f===0&&p(1)},children:c.jsx("tbody",{children:i.map((b,S)=>c.jsx("tr",{children:b.map((C,x)=>c.jsx($B,{tabIndex:f===C?0:-1,year:e,month:t,day:C,onSelect:r,isDisabled:!!s(C,t,e,o),isSelected:!!l(C,t,e,n.from,n.to),isBetween:!!u(C,t,e,n.from,n.to),isLast:!!d(C,"last",t,e,n.from,n.to),isFirst:!!d(C,"first",t,e,n.from,n.to)},`${e}-${t}-${S}-${x}-day`))},`${e}-${t}-${S}-week`))})})]})},OB=g.memo(PB),Ae={value:"select_all",label:"Select All"},Ed=({isSelected:e,hasNoResultsExist:t})=>r=>m.css("padding:",r.globals.spacing.get("6"),";font-size:",r.globals.typography.fontSize.get("4"),";background-color:",r.globals.oldColors.white,";cursor:default;color:",r.tokens.colors.get("textColor.default.secondary"),";text-align:","center",";text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;&:hover{background-color:",L.darken(.03,r.globals.oldColors.white),";}",""),MB=({status:e,isVirtualized:t,sx:r})=>n=>m.css("background-color:",n.globals.oldColors.white,";border-radius:4px;box-shadow:",n.globals.elevation["02"],";top:",(e==null?void 0:e.type)!=="normal"?"70%":"110%",";z-index:500;position:absolute;overflow-y:",t?"hidden":"auto",";min-width:100%;max-width:",O(620),";max-height:inherit;",r,";",""),LB=({height:e})=>m.css("max-height:",O(e),";",""),Q2=v.forwardRef((e,t)=>{const{filteredOptions:r,handleOptionClick:n,selectedOption:o,isLoading:a,isVirtualized:i,size:l="normal",hasSelectAllOption:s=!1}=e,u=v.useRef(null),d=Kt(u,t),f=Jc*an[l],p=()=>{var b,S;return((b=u.current)==null?void 0:b.scrollIntoView)&&((S=u.current)==null?void 0:S.scrollIntoView({block:"nearest",inline:"start"}))},h=v.useCallback(b=>{const S=String(D.head(Array.from(b)));if(S===Ae.value)n(Ae);else{const C=D.flatMap(r,x=>x.options||x).find(x=>String(x.value)===S);C&&n(C)}},[r,n]);v.useEffect(()=>{p()},[o]);const y=()=>r.length>0?c.jsxs(r1,{label:D.uniqueId("menu_list"),ref:d,height:f,isVirtualized:i&&r.length>Jc,onSelectionChange:h,selectedKeys:[o.value],disabledKeys:r.filter(b=>b.isDisabled).map(b=>b.value),children:[s?c.jsx(Le,{rowSize:l,textValue:Ae.label,children:c.jsx(We,{children:Ae.label})},Ae.value):null,r.map(b=>{var S;return b.options&&((S=b.options)==null?void 0:S.length)>0?c.jsx(El,{title:b.value,children:b.options.map(C=>c.jsx(Le,{rowSize:l,textValue:C.label,children:c.jsx(We,{description:C.helperText,children:C.label})},C.value))},b.value):c.jsx(Le,{rowSize:l,textValue:b.label,children:c.jsx(We,{description:b.helperText,children:b.label})},b.value)})]}):c.jsx("div",{css:Ed({isSelected:!1,hasNoResultsExist:!0}),children:"No options"});return c.jsx("div",{css:MB({...e}),tabIndex:-1,children:c.jsx("div",{css:LB({height:f}),children:a?c.jsx("div",{css:Ed({isSelected:!1,hasNoResultsExist:!0}),children:"Loading..."}):y()})})});Q2.displayName="SelectMenu";function IB(e){const r=new Date().getFullYear()+10,n=new Date().getFullYear()-10;return D.range(n,r).map(a=>({value:a.toString(),label:`${e.format("MMMM")} ${a.toString()}`}))}const BB=({setDate:e,onDaySelect:t=()=>{},selectedDays:r,date:n,handleArrow:o=()=>{},showedArrows:a="both",disabledDates:i,isRangePicker:l=!1})=>{const[s,u]=v.useState(!1),d=a!=="right",f=v.useMemo(()=>IB(n),[n]),p=v.useRef(null),{keyboardProps:h}=Xt({events:{keydown:{onArrowDown:()=>{setTimeout(()=>{var b;const y=(b=p.current)==null?void 0:b.querySelectorAll('[role="option"]');if(y&&(y==null?void 0:y.length)>0){const S=D.head(y);S instanceof HTMLElement&&typeof S.focus=="function"&&S.focus()}},0)}}},hasPropagation:!0});return c.jsx(v.Fragment,{children:c.jsxs("div",{css:lB(),children:[c.jsxs("div",{css:cB(),children:[(a==="left"||a==="both")&&c.jsx("div",{css:xd({position:"left"}),children:c.jsx(le,{iconName:"triangleLeft",type:"tertiary",onClick:()=>o("back"),dataTestId:"month_back"})}),c.jsxs(pl,{onClick:()=>{u(!1)},children:[c.jsxs("div",{css:dB(),children:[c.jsx("div",{css:fB({isRangePicker:l}),"data-testid":"month_header",...l?{}:h,children:c.jsxs(xe,{onClick:l?void 0:()=>u(!s),type:"tertiary",dataTestId:`${a!=="both"?a+"_":""}month`,children:[n.format("MMMM")," ",n.format("YYYY")]})}),s&&c.jsx(Q2,{ref:p,filteredOptions:f,handleOptionClick:y=>{e(n.year(Number(y.value))),u(!1)},selectedOption:{value:n.format("YYYY"),label:n.format("YYYY")},sx:{top:"124%"}})]}),(a==="right"||a==="both")&&c.jsx("div",{css:xd({position:"right"}),children:c.jsx(le,{iconName:"triangleRight",type:"tertiary",onClick:()=>o("forward"),dataTestId:"month_forward"})})]})]}),c.jsx(OB,{year:n.year(),month:n.month(),onDaySelect:t,selectedDays:r,disabledDates:i,isFirstCalendar:d})]})})},_d=v.memo(BB),qB=()=>e=>m.css(be,";border:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";border-radius:",e.dimension.borderRadius.get("md"),";width:fit-content;background-color:",e.tokens.colors.get("backgroundColor.default"),";",""),DB=()=>e=>m.css("border-right:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";",""),RB=({isSelected:e})=>t=>m.css(e1(t),";white-space:nowrap;padding:",t.globals.spacing.get("6"),";font-weight:",e?t.globals.typography.fontWeight.get("medium"):t.globals.typography.fontWeight.get("regular"),";color:",e&&t.tokens.colors.get("textColor.default.active"),";cursor:pointer;background-color:",e?t.tokens.colors.get("palette.tertiary.muted"):"transparent",";position:relative;&:hover{background-color:",t.tokens.colors.get("palette.tertiary.muted"),";}","");var FB={name:"yqjhl6",styles:"display:flex;flex-direction:column;position:relative"};const NB=()=>FB;var HB={name:"1wbxrzl",styles:"display:flex;flex-direction:row;position:relative;z-index:10"};const zB=()=>HB,VB=()=>e=>{const t=tl(e);return m.css("display:flex;justify-content:flex-end;height:",t("actionsContainer"),";align-items:center;gap:",e.dimension.spacing.get("sm"),";padding:0 ",e.dimension.spacing.get("xl"),";border-top:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";","")},WB=e=>e.from??re,jB=e=>{var t,r;return((r=e.from)==null?void 0:r.month(((t=e.from)==null?void 0:t.month())+1))??re.month(re.month()+1)};var UB={name:"zjik7",styles:"display:flex"};const ZB=({selectedOption:e,setSelectedOption:t=()=>{},isRangePicker:r=!1,extraOptions:n=[],onDaySelect:o,selectedDays:a,disabledDates:i,onClearAll:l=()=>{},onApply:s=()=>{}})=>{const[u,d]=v.useState(WB(a)),[f,p]=v.useState(jB(a)),h=v.useCallback((y="back")=>{d(b=>b.month(b.month()+(y==="forward"?1:-1))),p(b=>b.month(b.month()+(y==="forward"?1:-1)))},[u,f]);return c.jsx("div",{css:qB(),children:c.jsxs("div",{css:NB(),"data-testid":"buttonMonthsWrapperStyle",children:[c.jsxs("div",{css:UB,children:[n.length>0&&r&&c.jsx("div",{css:DB(),"data-testid":"optionsWrapperStyle",children:n.map(y=>c.jsx("div",{css:RB({isSelected:e===y.value}),onClick:()=>t(y.value),children:y.label},y.value))}),c.jsxs("div",{css:zB(),children:[c.jsx(_d,{date:u,onDaySelect:o,selectedDays:a,setDate:d,handleArrow:h,showedArrows:r?"left":"both",disabledDates:i,isRangePicker:r}),r&&c.jsx(_d,{date:f,onDaySelect:o,selectedDays:a,setDate:p,handleArrow:h,showedArrows:r?"right":"both",disabledDates:i,isRangePicker:r})]})]}),c.jsxs("div",{css:VB(),children:[c.jsx(xe,{onClick:l,dataTestId:"cancel",type:"tertiary",children:bI}),c.jsx(xe,{onClick:s,dataTestId:"apply",isDisabled:!a.from||!a.to,children:hI})]})]})})},GB=g.memo(ZB),KB=({isRangePicker:e=!1,onChange:t=()=>{},onClear:r=()=>{},disableDates:n,value:o,inputProps:a,dateFormatOverride:i=void 0,isClearable:l=!1,filterConfig:s,options:u,dataTestId:d,placement:f})=>{const p=v.useMemo(()=>yI(o||{}),[o]),[h,y]=v.useState(!1),[b,S]=v.useState(""),[C,x]=v.useState(p),{keyboardProps:k}=Xt({events:{keydown:{onEscape:()=>{y(!1)}}},hasPropagation:!0}),P=v.useCallback(A=>{const I=u==null?void 0:u.find(q=>q.value===A);I&&(x(Array.isArray(I.dates)?{from:I.dates[0],to:I.dates[1]}:{from:I.dates,to:I.dates}),S(A))},[u]),$=v.useCallback(A=>{var Y,ne,ae,Ne;const I=A.to&&((Y=A.from)!=null&&Y.isAfter(A.to))?A.to:A.from,q=A.to&&((ne=A.from)!=null&&ne.isAfter(A.to))?A.from:A.to,R={from:I,to:q};R.to&&y(!1),t({from:(ae=R.from)==null?void 0:ae.toDate(),to:(Ne=R.to)==null?void 0:Ne.toDate()})},[t]),w=v.useCallback(()=>{b.length&&S("")},[b]),_=v.useCallback(A=>{const I=A.startOf("day"),q=A.endOf("day");return x(e?R=>R.from&&R.to?{from:I,to:void 0}:R.from?I.isBefore(R.from)?{from:I,to:R.from.endOf("day")}:{...R,to:q}:{...R,from:I}:R=>R.from&&R.to&&A.isBetween(R.from,R.to)?gr:{from:I,to:q})},[e]),T=v.useCallback(()=>{x(gr),t(gr),w(),y(!1)},[t,w]),B=v.useCallback(()=>{y(!h)},[h]),W=v.useCallback(A=>{if(!l&&!s.filterType)return!1;if(s!=null&&s.filterType)return y(!1),x(gr),w(),(s==null?void 0:s.filterType)==="added"?r():t(gr);if((A==null?void 0:A.keyCode)===27)return y(!1);if((A==null?void 0:A.keyCode)===8){if(e&&p.from&&p.to)return x({from:p.from,to:void 0}),w(),t({from:p.from.toDate(),to:void 0});x(gr),t(gr)}},[l,s==null?void 0:s.filterType,w,t,r,e,p.from,p.to]),N=v.useCallback(()=>{$(C)},[$,C]);return c.jsx("div",{...k,children:c.jsx(Ol,{isVisible:h,setIsVisible:y,placement:f,offsetY:8,parent:c.jsx(Sd,{filterConfig:s,isRangePicker:e,selectedDay:p,inputProps:a,dateFormatOverride:i,handleIconClick:B,handleClear:W,isOpen:h,dataTestId:d}),children:c.jsx("div",{css:xI(),children:c.jsx(GB,{selectedOption:b,setSelectedOption:P,extraOptions:u,isRangePicker:e,onDaySelect:_,selectedDays:C,disabledDates:n,onClearAll:T,onApply:N})})})})},YB=v.memo(KB,Se),XB=(e,t)=>m.css("transition:opacity ",e?t+100:0,"ms ease,transform ",e?t+100:0,"ms ease;opacity:",Number(e),";transform:translateY(",e?0:O("-10px"),");",""),QB=(e,t)=>{const r=g.useRef(null),n=()=>{if(r.current===null)throw new Error("Uninitialised element ref");e?r.current.style.height="":r.current.style.height="0"},o=()=>{if(r.current===null)throw new Error("Uninitialised element ref");let a;return e?r.current.style.visibility="":a=window.setTimeout(()=>{if(r.current===null)throw new Error("Uninitialised element ref");r.current.style.visibility="hidden"},t),function(){clearTimeout(a)}};return g.useLayoutEffect(n,[e]),g.useLayoutEffect(o,[e,t]),r},JB=[{condition:({isExpanded:e,onChange:t})=>!!(e===void 0&&t||t===void 0&&typeof e=="boolean"),error:new Zt("If expanded is defined onChange must be defined too and vice versa")},{condition:({content:e,children:t})=>e===void 0&&t===void 0,error:new Zt("Either content or children must be defined")}],kd=e=>{const{textAndControl:t,component:r="div",transitionDuration:n=200,content:o,children:a,isInitiallyExpanded:i=!1,isExpanded:l,onChange:s,dataTestId:u}=e;Q1(JB,e);const[d,f]=g.useState(i),p=r,h=o??a,y=l??d,b=QB(y,n),S=C=>{typeof l!="boolean"?f(x=>!x):s&&s(C)};return c.jsxs(p,{"data-testid":K("expand-collapse",u),children:[t(S,y),c.jsx("div",{css:XB(y,n),ref:b,children:h(y)})]})},J2={name:"np6l6x",styles:"min-width:150px;background:#ffffff"},ec=_e(ee.MenuItem,{target:"e73b2cc1"})(({rowSize:e,isCompact:t,isDisabled:r,theme:n})=>{const o=L.rem(an[e]),a=m.css("0 ",n.dimension.spacing.get("md"),";",""),i=t?t1(n):Sl(n);return m.css("background-color:",n.tokens.colors.get("palette.tertiary.base"),";&>div{",i,";}div[parenttype='Menu']{display:flex;flex-direction:row;gap:",L.rem(12),";}padding:",a,";min-height:",o,";display:flex;flex-direction:row;&:hover{background-color:",r?void 0:n.tokens.colors.get("palette.tertiary.muted"),";cursor:",r?"initial":"pointer",";}span[role='presentation']{align-items:center;",i,";font-weight:",n.globals.typography.fontWeight.get("bold"),";}&[role='option']{gap:",L.rem(12),";}&[data-focus-visible]{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";}&[aria-selected='true']{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";&>div{color:",n.tokens.colors.get("textColor.default.active"),";",t?wl(n):e1(n),";}&[data-focus-visible]{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";}}opacity:",r?"0.5":"1",";cursor:",r?"not-allowed":"initial",";","")},""),tc=_e(ee.Menu,{target:"e73b2cc0"})(({theme:e})=>m.css("background-color:",e.tokens.colors.get("backgroundColor.default"),";border-color:",e.tokens.colors.get("borderColor.decorative.default"),";border-radius:",e.dimension.borderRadius.get("md"),";box-shadow:",e.tokens.boxShadow.get("2"),";border-width:",e.dimension.borderWidth.get("default"),";",""),""),rc=({sx:e})=>{const t=F();return c.jsx(ee.Separator,{css:[m.css("height:",L.rem(1),";border-color:",t.tokens.colors.get("borderColor.decorative.default"),";width:100%;margin:auto;border-bottom-width:",L.rem(1),";border-bottom-style:solid;",""),e,"",""]})},Td=({selectionMode:e="single",rowSize:t="normal",children:r,onSelectionChange:n=()=>{},disabledKeys:o=new Set,selectedKeys:a=new Set,triggerRef:i=null,isOpen:l=!1,onClose:s=()=>{},onAction:u=()=>{},dataTestId:d,sx:f={listProps:{}}})=>{const p=t==="compact";return c.jsx(ee.MenuTrigger,{isOpen:l,onOpenChange:s,children:c.jsx(ee.Popover,{triggerRef:i,css:J2,children:c.jsx(tc,{selectionMode:e,selectedKeys:a,disabledKeys:o,onSelectionChange:n,css:ln(f.listProps),"data-testid":d,onAction:u,children:g.Children.map(r,h=>{const{key:y=""}=h;return h.type===rc?h:c.jsx(ec,{isCompact:p,rowSize:t,isDisabled:o.has(y),id:y,children:h},y)})})})})},rl=e=>{v.useEffect(()=>{const t=r=>{r.key==="Escape"&&e()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[e])},eq=e=>m.css("position:fixed;z-index:3000;width:100vw;height:100vh;top:0;left:0;background-color:",L.transparentize(.3,e.tokens.colors.get("backgroundColor.invertedAlt")),";display:flex;justify-content:center;align-items:center;",""),tq=(e,t)=>m.css("max-width:",e,";max-height:",t,";",""),rq=({isContentPadded:e})=>t=>m.css("display:flex;flex-direction:row;flex-wrap:wrap;padding:",e?`${t.globals.spacing.get("8")} ${t.globals.spacing.get("9")} ${t.globals.spacing.get("9")} ${t.globals.spacing.get("9")}`:void 0,";",""),nq=e=>m.css("width:100%;display:flex;justify-content:flex-end;padding:",e.globals.spacing.get("4")," ",e.globals.spacing.get("4")," 0 0;box-sizing:border-box;",""),oq=e=>m.css("width:100%;height:100%;display:flex;flex-direction:column;flex-wrap:wrap;text-align:left;color:",e.tokens.colors.get("textColor.default.primary"),";font-weight:",e.globals.typography.fontWeight.get("regular"),";",""),aq=e=>m.css("font-size:",e.globals.typography.fontSize.get("3"),";margin:0 0 ",e.globals.spacing.get("3")," 0;",""),iq=e=>m.css("font-size:",e.globals.typography.fontSize.get("9"),";color:",e.tokens.colors.get("textColor.default.primary"),";font-weight:",e.globals.typography.fontWeight.get("medium"),";margin:0 0 ",e.globals.spacing.get("9")," 0;",""),lq=e=>m.css("font-size:",e.globals.typography.fontSize.get("4"),";color:",e.tokens.colors.get("textColor.default.secondary"),";max-height:",O(430),";overflow-y:hidden;margin:0;",""),sq=e=>m.css("width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-end;margin:",e.globals.spacing.get("9")," 0 0 0;button{margin-left:",e.globals.spacing.get("6"),";}",""),cq=({label:e,heading:t,message:r,primaryCTA:n,primaryCTALabel:o,secondaryCTA:a,secondaryCTALabel:i,dataTestId:l})=>c.jsxs("div",{role:"dialog",css:oq,"data-testid":K("modal-content",l),children:[!!e&&c.jsx("p",{css:aq,children:e}),c.jsx("h5",{css:iq,"data-testid":K("modal-content-header",l),children:t}),c.jsx("p",{css:lq,"data-testid":K("modal-content-message",l),children:r}),c.jsxs("div",{css:sq,children:[!!(a&&i)&&c.jsx(xe,{onClick:a,type:"tertiary",dataTestId:"modal-content-secondaryCTA",children:i}),!!(n&&o)&&c.jsx(xe,{onClick:n,dataTestId:"modal-content-primaryCTA",children:o})]})]}),uq=({isOpen:e=!1,onClose:t,dataTestId:r,children:n,contentProps:o,isContentPadded:a=!0,maxWidth:i=`${L.rem(500)}`,maxHeight:l=`${L.rem(684)}`})=>{const s=v.useRef(null),u=F(),{overlayProps:d}=Pl({isVisible:e,isNonModal:!1,overlayRef:s,onClose:t});return rl(()=>{t()}),v.useEffect(()=>(e&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[e]),e?c.jsx("div",{css:eq,"data-testid":K("modal-container",r),children:c.jsx("div",{...d,ref:s,css:tq(i,l),children:c.jsxs(Yc,{elevated:"02",radius:"3",children:[c.jsx("div",{css:nq,children:c.jsx(le,{type:"tertiary",iconName:"close",onClick:t,color:u.tokens.colors.get("textColor.default.secondary"),dataTestId:"modal-close"})}),c.jsx("div",{css:rq({isContentPadded:a}),children:o?c.jsx(cq,{...o}):n})]})})}):null},dq=(e,t)=>{const r=fl.useLocation(),[n,o]=v.useState();return v.useLayoutEffect(()=>{e.forEach(a=>{(a.options.map(s=>s.url).includes(r.pathname)||a.url===r.pathname)&&(o(a.url),t([a.url]))})},[r.pathname,e,t]),[n]},$d={semantic:{focus:{border:{width:{step:1},color:{name:"magenta",shade:500}}}}},fq=$d.semantic.focus.border.width.step,Ad=$d.semantic.focus.border.color,pq=({theme:e,borderWidth:t=0})=>{const r=t+fq,n=e.utils.getColor(Ad.name,Ad.shade);return{borderWidth:O(r),focusColor:n,styleBorder:`${O(r)} solid ${n}`,styleOutline:`${n} auto ${O(r)}`}},gq=39,Cq=e=>()=>m.css(de(10.2),";width:100%;background-color:white;height:100%;padding:",O(24)," 0;box-sizing:border-box;.menu-item-text,.submenu-item-text{opacity:",e?1:0,";width:",O(e?204:16),";white-space:nowrap;}",""),Pd=e=>m.css(Ut,";height:",O(44),";color:",e.tokens.colors.get("textColor.default.primary"),";cursor:default;",""),Od=()=>e=>m.css(Pd(e),";width:100%;font-size:",O(16),";font-weight:",e.globals.typography.fontWeight.get("regular"),";padding:0 ",e.globals.spacing.get("6"),";background:transparent;border:0 solid transparent;display:flex;text-align:left;text-decoration:none;&:hover{background-color:",e.tokens.colors.get("palette.tertiary.muted"),";}&:focus-visible{outline:",e.tokens.colors.get("palette.tertiary.muted"),";}",""),vq=()=>e=>m.css(Od()(e),";text-decoration:none;",""),yq=e=>t=>m.css(de(.2),";color:",e?t.tokens.colors.get("textColor.default.active"):t.tokens.colors.get("textColor.default.primary"),";font-weight:",e?t.globals.typography.fontWeight.get("bold"):"initial",";",""),hq=()=>e=>m.css(Pd(e),";",de(.2),";box-sizing:border-box;font-size:",e.globals.typography.fontSize.get("3"),";color:",e.tokens.colors.get("textColor.default.primary"),";margin:",e.globals.spacing.get("3")," 0 ",e.globals.spacing.get("3")," 0;padding-left:",O(gq),";&:hover{background-color:",e.tokens.colors.get("palette.tertiary.muted"),"!important;}&.active:hover{background-color:",e.tokens.colors.get("palette.tertiary.contrast"),"!important;}&.active{font-weight:",e.globals.typography.fontWeight.get("bold"),";background-color:",e.tokens.colors.get("palette.tertiary.muted"),"!important;color:",e.tokens.colors.get("textColor.default.active"),";path{fill:",e.tokens.colors.get("textColor.default.active"),"!important;}}&:focus-visible{outline:",pq({theme:e}).styleOutline,";}text-decoration:none;",""),bq=(e,t)=>()=>m.css(de(.2),";opacity:",t?"1":"0",";transform:",e?"rotate(90deg)":"rotate(0deg);",";",""),mq=()=>e=>m.css(de(.2),";",et,";margin-right:",e.globals.spacing.get("4"),";width:",O(32),";height:",O(32),";border-radius:50%;flex-shrink:0;",""),wq=()=>e=>m.css(et,";width:",O(32),";height:",O(32),";margin-right:",e.globals.spacing.get("4"),";flex-shrink:0;",""),Md=v.memo(({isCurrent:e,isExpanded:t,name:r,url:n,iconName:o,options:a,toggleMenuItem:i,state:l})=>{const s=F(),u=v.useMemo(()=>a.length>0,[a.length]),d=c.jsxs(v.Fragment,{children:[c.jsx("div",{css:bq(t,u),children:c.jsx(H,{name:"triangleRight",color:s.tokens.colors.get("textColor.default.primary"),size:20})}),c.jsx("div",{css:mq(),children:c.jsx(H,{name:o,color:e?s.tokens.colors.get("textColor.default.active"):s.tokens.colors.get("textColor.default.primary"),size:20})}),c.jsx("span",{className:"menu-item-text",css:yq(e),children:r})]});return c.jsx(v.Fragment,{children:u?c.jsx(kd,{isExpanded:t,onChange:()=>i(n),textAndControl:f=>c.jsx("button",{type:"button",css:Od(),"data-testid":n,onClick:f,children:d}),children:()=>c.jsx(v.Fragment,{children:a.map(f=>f.isVisible&&c.jsxs(fl.NavLink,{to:f.url,state:f.state,"data-testid":f.url,className:({isActive:p,isPending:h})=>h?"pending":p?"active":"",css:hq(),id:"submenu-item-link",children:[c.jsx("div",{css:wq(),children:c.jsx(H,{name:f.iconName,color:s.tokens.colors.get("textColor.default.primary"),size:20})}),c.jsx("span",{className:"submenu-item-text",children:f.name})]},f.url))})}):c.jsx(fl.NavLink,{to:n,state:l,"data-testid":n,className:({isActive:f,isPending:p})=>p?"pending":f?"active":"",css:vq(),children:d},n)})});Md.displayName="MenuItem";const Sq=({menuItems:e,isExpanded:t})=>{const[r,n]=v.useState([]),[o]=dq(e,n),a=v.useCallback(i=>{n(l=>l.indexOf(i)!==-1?[]:[i])},[]);return c.jsx("div",{css:Cq(t),children:e.map(i=>i.isVisible&&c.jsx(Md,{isCurrent:o===i.url,isExpanded:r.includes(i.url),toggleMenuItem:a,...i},i.url))})},xq=(e,t,r)=>n=>m.css(de(.2),";width:",O(e?"308px":t?"112px":"0px"),";background-color:",n.tokens.colors.get("backgroundColor.default"),";overflow:hidden;flex-grow:0;flex-shrink:0;height:100%;min-height:100%;z-index:100;position:",r?"absolute":"relative",";border-right:",O(1)," solid ",n.tokens.colors.get("borderColor.decorative.default"),";",""),Eq=e=>{var n;const t=Qr(),r=t.des1200&&!t.des1440;return c.jsxs("div",{css:xq(e.isExpanded,t.des1200,!t.des1440),onMouseEnter:()=>r&&e.setExpanded(!0),onMouseLeave:()=>r&&e.setExpanded(!1),"data-testid":"sidebar",children:[(n=e.renderHeader)==null?void 0:n.call(e),c.jsx(Sq,{...D.omit(e,"renderHeader")})]})},gt=e=>e==="info"?"active":e,Ld=e=>e==="info"?"primaryAlt":e,_q=(e,t,r)=>m.css("border:",r.globals.borderWidth.get("2")," solid ",r.tokens.colors.get(`borderColor.interactive.${gt(e)}`),";&[notification-type='banner']{box-shadow:",r.globals.elevation["02"],";}",t==="outlined"?`
130
+ }`,";","")},TB=({day:e,month:t,year:r,onSelect:n,isSelected:o=!1,isBetween:a=!1,isLast:i=!1,isFirst:l=!1,isDisabled:s=!1,tabIndex:u})=>{const d=v.useMemo(()=>e&&re.month(t).date(e).year(r),[r,e,t]),f=v.useMemo(()=>re.month()===t&&re.year()===r&&re.date()===e,[r,t,e]),p=v.useCallback(y=>{y.preventDefault(),n&&d&&n(d)},[n,d]),{keyboardProps:h}=Xt({events:{keydown:{onEnter:y=>{s||p(y)}}},hasPropagation:!0});return e?c.jsx("td",{style:{padding:0},onClick:s?void 0:p,children:c.jsx("div",{css:EB({isSelected:o,isBetween:a,isLast:i,isFirst:l,isToday:f,isDisabled:s}),tabIndex:u,"data-testid":`${e}_${t+1}_${r}${o?"_selected":""}`,...h,children:c.jsx("div",{css:kB({isSelected:o,isBetween:a,isToday:f,isDisabled:s}),children:e})})}):c.jsx("td",{css:_B({isBetween:a})})},$B=v.memo(TB);fe.extend(z9);const AB=["Monday","Tuesday","Wednesday","Thurdsday","Friday","Saturday","Sunday"],PB=({year:e,month:t,onDaySelect:r,selectedDays:n,disabledDates:o,isFirstCalendar:a})=>{const i=g.useMemo(()=>{const b=re.month(t).year(e).date(1),S=b.daysInMonth(),C=b.day()||7,x=7,k=xB(e,t),$=Array(k*x).fill(null).reduce((w,_,T)=>{const B=T+1,W=D.inRange(B,C,S+C)?B-C+1:void 0;return[...w,W]},[]);return D.chunk($,x)},[e,t]),l=v.useCallback(SB,[]),s=v.useCallback(bB,[]),u=v.useCallback(mB,[]),d=v.useCallback(wB,[]),{focusedDay:f,setFocusedDay:p,calendarRef:h,keyboardProps:y}=pB({selectedDays:n,isFirstCalendar:a,month:t,year:e});return c.jsxs(g.Fragment,{children:[c.jsx("div",{css:vB(),children:AB.map(b=>c.jsx("div",{css:yB(),children:b.substr(0,2)},b))}),c.jsx("table",{css:hB(),ref:h,tabIndex:0,"data-testid":"calendar_table",...y,onFocus:()=>{f===0&&p(1)},children:c.jsx("tbody",{children:i.map((b,S)=>c.jsx("tr",{children:b.map((C,x)=>c.jsx($B,{tabIndex:f===C?0:-1,year:e,month:t,day:C,onSelect:r,isDisabled:!!s(C,t,e,o),isSelected:!!l(C,t,e,n.from,n.to),isBetween:!!u(C,t,e,n.from,n.to),isLast:!!d(C,"last",t,e,n.from,n.to),isFirst:!!d(C,"first",t,e,n.from,n.to)},`${e}-${t}-${S}-${x}-day`))},`${e}-${t}-${S}-week`))})})]})},OB=g.memo(PB),Ae={value:"select_all",label:"Select All"},Ed=({isSelected:e,hasNoResultsExist:t})=>r=>m.css("padding:",r.globals.spacing.get("6"),";font-size:",r.globals.typography.fontSize.get("4"),";background-color:",r.globals.oldColors.white,";cursor:default;color:",r.tokens.colors.get("textColor.default.secondary"),";text-align:","center",";text-overflow:ellipsis;white-space:nowrap;overflow-x:hidden;&:hover{background-color:",L.darken(.03,r.globals.oldColors.white),";}",""),MB=({status:e,isVirtualized:t,sx:r})=>n=>m.css("background-color:",n.globals.oldColors.white,";border-radius:4px;box-shadow:",n.globals.elevation["02"],";top:",(e==null?void 0:e.type)!=="normal"?"70%":"110%",";z-index:500;position:absolute;overflow-y:",t?"hidden":"auto",";min-width:100%;max-width:",O(620),";max-height:inherit;",r,";",""),LB=({height:e})=>m.css("max-height:",O(e),";",""),Q2=v.forwardRef((e,t)=>{const{filteredOptions:r,handleOptionClick:n,selectedOption:o,isLoading:a,isVirtualized:i,size:l="normal",hasSelectAllOption:s=!1}=e,u=v.useRef(null),d=Kt(u,t),f=Jc*an[l],p=()=>{var b,S;return((b=u.current)==null?void 0:b.scrollIntoView)&&((S=u.current)==null?void 0:S.scrollIntoView({block:"nearest",inline:"start"}))},h=v.useCallback(b=>{const S=String(D.head(Array.from(b)));if(S===Ae.value)n(Ae);else{const C=D.flatMap(r,x=>x.options||x).find(x=>String(x.value)===S);C&&n(C)}},[r,n]);v.useEffect(()=>{p()},[o]);const y=()=>r.length>0?c.jsxs(r1,{label:D.uniqueId("menu_list"),ref:d,height:f,isVirtualized:i&&r.length>Jc,onSelectionChange:h,selectedKeys:[o.value],disabledKeys:r.filter(b=>b.isDisabled).map(b=>b.value),children:[s?c.jsx(Le,{rowSize:l,textValue:Ae.label,children:c.jsx(We,{children:Ae.label})},Ae.value):null,r.map(b=>{var S;return b.options&&((S=b.options)==null?void 0:S.length)>0?c.jsx(El,{title:b.value,children:b.options.map(C=>c.jsx(Le,{rowSize:l,textValue:C.label,children:c.jsx(We,{description:C.helperText,children:C.label})},C.value))},b.value):c.jsx(Le,{rowSize:l,textValue:b.label,children:c.jsx(We,{description:b.helperText,children:b.label})},b.value)})]}):c.jsx("div",{css:Ed({isSelected:!1,hasNoResultsExist:!0}),children:"No options"});return c.jsx("div",{css:MB({...e}),tabIndex:-1,children:c.jsx("div",{css:LB({height:f}),children:a?c.jsx("div",{css:Ed({isSelected:!1,hasNoResultsExist:!0}),children:"Loading..."}):y()})})});Q2.displayName="SelectMenu";function IB(e){const r=new Date().getFullYear()+10,n=new Date().getFullYear()-10;return D.range(n,r).map(a=>({value:a.toString(),label:`${e.format("MMMM")} ${a.toString()}`}))}const BB=({setDate:e,onDaySelect:t=()=>{},selectedDays:r,date:n,handleArrow:o=()=>{},showedArrows:a="both",disabledDates:i,isRangePicker:l=!1})=>{const[s,u]=v.useState(!1),d=a!=="right",f=v.useMemo(()=>IB(n),[n]),p=v.useRef(null),{keyboardProps:h}=Xt({events:{keydown:{onArrowDown:()=>{setTimeout(()=>{var b;const y=(b=p.current)==null?void 0:b.querySelectorAll('[role="option"]');if(y&&(y==null?void 0:y.length)>0){const S=D.head(y);S instanceof HTMLElement&&typeof S.focus=="function"&&S.focus()}},0)}}},hasPropagation:!0});return c.jsx(v.Fragment,{children:c.jsxs("div",{css:lB(),children:[c.jsxs("div",{css:cB(),children:[(a==="left"||a==="both")&&c.jsx("div",{css:xd({position:"left"}),children:c.jsx(le,{iconName:"triangleLeft",type:"tertiary",onClick:()=>o("back"),dataTestId:"month_back"})}),c.jsxs(pl,{onClick:()=>{u(!1)},children:[c.jsxs("div",{css:dB(),children:[c.jsx("div",{css:fB({isRangePicker:l}),"data-testid":"month_header",...l?{}:h,children:c.jsxs(xe,{onClick:l?void 0:()=>u(!s),type:"tertiary",dataTestId:`${a!=="both"?a+"_":""}month`,children:[n.format("MMMM")," ",n.format("YYYY")]})}),s&&c.jsx(Q2,{ref:p,filteredOptions:f,handleOptionClick:y=>{e(n.year(Number(y.value))),u(!1)},selectedOption:{value:n.format("YYYY"),label:n.format("YYYY")},sx:{top:"124%"}})]}),(a==="right"||a==="both")&&c.jsx("div",{css:xd({position:"right"}),children:c.jsx(le,{iconName:"triangleRight",type:"tertiary",onClick:()=>o("forward"),dataTestId:"month_forward"})})]})]}),c.jsx(OB,{year:n.year(),month:n.month(),onDaySelect:t,selectedDays:r,disabledDates:i,isFirstCalendar:d})]})})},_d=v.memo(BB),qB=()=>e=>m.css(be,";border:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";border-radius:",e.dimension.borderRadius.get("md"),";width:fit-content;background-color:",e.tokens.colors.get("backgroundColor.default"),";",""),DB=()=>e=>m.css("border-right:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";",""),RB=({isSelected:e})=>t=>m.css(e1(t),";white-space:nowrap;padding:",t.globals.spacing.get("6"),";font-weight:",e?t.globals.typography.fontWeight.get("medium"):t.globals.typography.fontWeight.get("regular"),";color:",e&&t.tokens.colors.get("textColor.default.active"),";cursor:pointer;background-color:",e?t.tokens.colors.get("palette.tertiary.muted"):"transparent",";position:relative;&:hover{background-color:",t.tokens.colors.get("palette.tertiary.muted"),";}","");var FB={name:"yqjhl6",styles:"display:flex;flex-direction:column;position:relative"};const NB=()=>FB;var HB={name:"1wbxrzl",styles:"display:flex;flex-direction:row;position:relative;z-index:10"};const zB=()=>HB,VB=()=>e=>{const t=tl(e);return m.css("display:flex;justify-content:flex-end;height:",t("actionsContainer"),";align-items:center;gap:",e.dimension.spacing.get("sm"),";padding:0 ",e.dimension.spacing.get("xl"),";border-top:",e.dimension.borderWidth.get("default")," solid ",e.tokens.colors.get("borderColor.decorative.default"),";","")},WB=e=>e.from??re,jB=e=>{var t,r;return((r=e.from)==null?void 0:r.month(((t=e.from)==null?void 0:t.month())+1))??re.month(re.month()+1)};var UB={name:"zjik7",styles:"display:flex"};const ZB=({selectedOption:e,setSelectedOption:t=()=>{},isRangePicker:r=!1,extraOptions:n=[],onDaySelect:o,selectedDays:a,disabledDates:i,onClearAll:l=()=>{},onApply:s=()=>{}})=>{const[u,d]=v.useState(WB(a)),[f,p]=v.useState(jB(a)),h=v.useCallback((y="back")=>{d(b=>b.month(b.month()+(y==="forward"?1:-1))),p(b=>b.month(b.month()+(y==="forward"?1:-1)))},[u,f]);return c.jsx("div",{css:qB(),children:c.jsxs("div",{css:NB(),"data-testid":"buttonMonthsWrapperStyle",children:[c.jsxs("div",{css:UB,children:[n.length>0&&r&&c.jsx("div",{css:DB(),"data-testid":"optionsWrapperStyle",children:n.map(y=>c.jsx("div",{css:RB({isSelected:e===y.value}),onClick:()=>t(y.value),children:y.label},y.value))}),c.jsxs("div",{css:zB(),children:[c.jsx(_d,{date:u,onDaySelect:o,selectedDays:a,setDate:d,handleArrow:h,showedArrows:r?"left":"both",disabledDates:i,isRangePicker:r}),r&&c.jsx(_d,{date:f,onDaySelect:o,selectedDays:a,setDate:p,handleArrow:h,showedArrows:r?"right":"both",disabledDates:i,isRangePicker:r})]})]}),c.jsxs("div",{css:VB(),children:[c.jsx(xe,{onClick:l,dataTestId:"cancel",type:"tertiary",children:bI}),c.jsx(xe,{onClick:s,dataTestId:"apply",isDisabled:!a.from||!a.to,children:hI})]})]})})},GB=g.memo(ZB),KB=({isRangePicker:e=!1,onChange:t=()=>{},onClear:r=()=>{},disableDates:n,value:o,inputProps:a,dateFormatOverride:i=void 0,isClearable:l=!1,filterConfig:s,options:u,dataTestId:d,placement:f})=>{const p=v.useMemo(()=>yI(o||{}),[o]),[h,y]=v.useState(!1),[b,S]=v.useState(""),[C,x]=v.useState(p),{keyboardProps:k}=Xt({events:{keydown:{onEscape:()=>{y(!1)}}},hasPropagation:!0}),P=v.useCallback(A=>{const I=u==null?void 0:u.find(q=>q.value===A);I&&(x(Array.isArray(I.dates)?{from:I.dates[0],to:I.dates[1]}:{from:I.dates,to:I.dates}),S(A))},[u]),$=v.useCallback(A=>{var Y,ne,ae,Ne;const I=A.to&&((Y=A.from)!=null&&Y.isAfter(A.to))?A.to:A.from,q=A.to&&((ne=A.from)!=null&&ne.isAfter(A.to))?A.from:A.to,R={from:I,to:q};R.to&&y(!1),t({from:(ae=R.from)==null?void 0:ae.toDate(),to:(Ne=R.to)==null?void 0:Ne.toDate()})},[t]),w=v.useCallback(()=>{b.length&&S("")},[b]),_=v.useCallback(A=>{const I=A.startOf("day"),q=A.endOf("day");return x(e?R=>R.from&&R.to?{from:I,to:void 0}:R.from?I.isBefore(R.from)?{from:I,to:R.from.endOf("day")}:{...R,to:q}:{...R,from:I}:R=>R.from&&R.to&&A.isBetween(R.from,R.to)?gr:{from:I,to:q})},[e]),T=v.useCallback(()=>{x(gr),t(gr),w(),y(!1)},[t,w]),B=v.useCallback(()=>{y(!h)},[h]),W=v.useCallback(A=>{if(!l&&!s.filterType)return!1;if(s!=null&&s.filterType)return y(!1),x(gr),w(),(s==null?void 0:s.filterType)==="added"?r():t(gr);if((A==null?void 0:A.keyCode)===27)return y(!1);if((A==null?void 0:A.keyCode)===8){if(e&&p.from&&p.to)return x({from:p.from,to:void 0}),w(),t({from:p.from.toDate(),to:void 0});x(gr),t(gr)}},[l,s==null?void 0:s.filterType,w,t,r,e,p.from,p.to]),N=v.useCallback(()=>{$(C)},[$,C]);return c.jsx("div",{...k,children:c.jsx(Ol,{isVisible:h,setIsVisible:y,placement:f,offsetY:8,parent:c.jsx(Sd,{filterConfig:s,isRangePicker:e,selectedDay:p,inputProps:a,dateFormatOverride:i,handleIconClick:B,handleClear:W,isOpen:h,dataTestId:d}),children:c.jsx("div",{css:xI(),children:c.jsx(GB,{selectedOption:b,setSelectedOption:P,extraOptions:u,isRangePicker:e,onDaySelect:_,selectedDays:C,disabledDates:n,onClearAll:T,onApply:N})})})})},YB=v.memo(KB,Se),XB=(e,t)=>m.css("transition:opacity ",e?t+100:0,"ms ease,transform ",e?t+100:0,"ms ease;opacity:",Number(e),";transform:translateY(",e?0:O("-10px"),");",""),QB=(e,t)=>{const r=g.useRef(null),n=()=>{if(r.current===null)throw new Error("Uninitialised element ref");e?r.current.style.height="":r.current.style.height="0"},o=()=>{if(r.current===null)throw new Error("Uninitialised element ref");let a;return e?r.current.style.visibility="":a=window.setTimeout(()=>{if(r.current===null)throw new Error("Uninitialised element ref");r.current.style.visibility="hidden"},t),function(){clearTimeout(a)}};return g.useLayoutEffect(n,[e]),g.useLayoutEffect(o,[e,t]),r},JB=[{condition:({isExpanded:e,onChange:t})=>!!(e===void 0&&t||t===void 0&&typeof e=="boolean"),error:new Zt("If expanded is defined onChange must be defined too and vice versa")},{condition:({content:e,children:t})=>e===void 0&&t===void 0,error:new Zt("Either content or children must be defined")}],kd=e=>{const{textAndControl:t,component:r="div",transitionDuration:n=200,content:o,children:a,isInitiallyExpanded:i=!1,isExpanded:l,onChange:s,dataTestId:u}=e;Q1(JB,e);const[d,f]=g.useState(i),p=r,h=o??a,y=l??d,b=QB(y,n),S=C=>{typeof l!="boolean"?f(x=>!x):s&&s(C)};return c.jsxs(p,{"data-testid":K("expand-collapse",u),children:[t(S,y),c.jsx("div",{css:XB(y,n),ref:b,children:h(y)})]})},J2={name:"np6l6x",styles:"min-width:150px;background:#ffffff"},ec=_e(ee.MenuItem,{target:"e73b2cc1"})(({rowSize:e,isCompact:t,isDisabled:r,theme:n})=>{const o=L.rem(an[e]),a=m.css("0 ",n.dimension.spacing.get("md"),";",""),i=t?t1(n):Sl(n);return m.css("background-color:",n.tokens.colors.get("palette.tertiary.base"),";&>div{",i,";}div[parenttype='Menu']{display:flex;flex-direction:row;gap:",L.rem(12),";}padding:",a,";min-height:",o,";display:flex;flex-direction:row;&:hover{background-color:",r?void 0:n.tokens.colors.get("palette.tertiary.muted"),";cursor:",r?"initial":"pointer",";}span[role='presentation']{align-items:center;",i,";font-weight:",n.globals.typography.fontWeight.get("bold"),";}&[role='option']{gap:",L.rem(12),";}&[data-focus-visible]{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";}&[aria-selected='true']{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";&>div{color:",n.tokens.colors.get("textColor.default.active"),";",t?wl(n):e1(n),";}&[data-focus-visible]{background-color:",n.tokens.colors.get("palette.tertiary.muted"),";}}opacity:",r?"0.5":"1",";cursor:",r?"not-allowed":"initial",";","")},""),tc=_e(ee.Menu,{target:"e73b2cc0"})(({theme:e})=>m.css("background-color:",e.tokens.colors.get("backgroundColor.default"),";border-color:",e.tokens.colors.get("borderColor.decorative.default"),";border-radius:",e.dimension.borderRadius.get("md"),";box-shadow:",e.tokens.boxShadow.get("2"),";border-width:",e.dimension.borderWidth.get("default"),";",""),""),rc=({sx:e})=>{const t=F();return c.jsx(ee.Separator,{css:[m.css("height:",L.rem(1),";border-color:",t.tokens.colors.get("borderColor.decorative.default"),";width:100%;margin:auto;border-bottom-width:",L.rem(1),";border-bottom-style:solid;",""),e,"",""]})},Td=({selectionMode:e="single",rowSize:t="normal",children:r,onSelectionChange:n=()=>{},disabledKeys:o=new Set,selectedKeys:a=new Set,triggerRef:i=null,isOpen:l=!1,onClose:s=()=>{},onAction:u=()=>{},dataTestId:d,sx:f={listProps:{}}})=>{const p=t==="compact";return c.jsx(ee.MenuTrigger,{isOpen:l,onOpenChange:s,children:c.jsx(ee.Popover,{triggerRef:i,css:J2,children:c.jsx(tc,{selectionMode:e,selectedKeys:a,disabledKeys:o,onSelectionChange:n,css:ln(f.listProps),"data-testid":d,onAction:u,children:g.Children.map(r,h=>{const y=g.isValidElement(h)?h.key??"":"";return g.isValidElement(h)&&h.type===rc?h:c.jsx(ec,{isCompact:p,rowSize:t,isDisabled:o.has(y),id:y,children:h},y)})})})})},rl=e=>{v.useEffect(()=>{const t=r=>{r.key==="Escape"&&e()};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[e])},eq=e=>m.css("position:fixed;z-index:3000;width:100vw;height:100vh;top:0;left:0;background-color:",L.transparentize(.3,e.tokens.colors.get("backgroundColor.invertedAlt")),";display:flex;justify-content:center;align-items:center;",""),tq=(e,t)=>m.css("max-width:",e,";max-height:",t,";",""),rq=({isContentPadded:e})=>t=>m.css("display:flex;flex-direction:row;flex-wrap:wrap;padding:",e?`${t.globals.spacing.get("8")} ${t.globals.spacing.get("9")} ${t.globals.spacing.get("9")} ${t.globals.spacing.get("9")}`:void 0,";",""),nq=e=>m.css("width:100%;display:flex;justify-content:flex-end;padding:",e.globals.spacing.get("4")," ",e.globals.spacing.get("4")," 0 0;box-sizing:border-box;",""),oq=e=>m.css("width:100%;height:100%;display:flex;flex-direction:column;flex-wrap:wrap;text-align:left;color:",e.tokens.colors.get("textColor.default.primary"),";font-weight:",e.globals.typography.fontWeight.get("regular"),";",""),aq=e=>m.css("font-size:",e.globals.typography.fontSize.get("3"),";margin:0 0 ",e.globals.spacing.get("3")," 0;",""),iq=e=>m.css("font-size:",e.globals.typography.fontSize.get("9"),";color:",e.tokens.colors.get("textColor.default.primary"),";font-weight:",e.globals.typography.fontWeight.get("medium"),";margin:0 0 ",e.globals.spacing.get("9")," 0;",""),lq=e=>m.css("font-size:",e.globals.typography.fontSize.get("4"),";color:",e.tokens.colors.get("textColor.default.secondary"),";max-height:",O(430),";overflow-y:hidden;margin:0;",""),sq=e=>m.css("width:100%;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:flex-end;margin:",e.globals.spacing.get("9")," 0 0 0;button{margin-left:",e.globals.spacing.get("6"),";}",""),cq=({label:e,heading:t,message:r,primaryCTA:n,primaryCTALabel:o,secondaryCTA:a,secondaryCTALabel:i,dataTestId:l})=>c.jsxs("div",{role:"dialog",css:oq,"data-testid":K("modal-content",l),children:[!!e&&c.jsx("p",{css:aq,children:e}),c.jsx("h5",{css:iq,"data-testid":K("modal-content-header",l),children:t}),c.jsx("p",{css:lq,"data-testid":K("modal-content-message",l),children:r}),c.jsxs("div",{css:sq,children:[!!(a&&i)&&c.jsx(xe,{onClick:a,type:"tertiary",dataTestId:"modal-content-secondaryCTA",children:i}),!!(n&&o)&&c.jsx(xe,{onClick:n,dataTestId:"modal-content-primaryCTA",children:o})]})]}),uq=({isOpen:e=!1,onClose:t,dataTestId:r,children:n,contentProps:o,isContentPadded:a=!0,maxWidth:i=`${L.rem(500)}`,maxHeight:l=`${L.rem(684)}`})=>{const s=v.useRef(null),u=F(),{overlayProps:d}=Pl({isVisible:e,isNonModal:!1,overlayRef:s,onClose:t});return rl(()=>{t()}),v.useEffect(()=>(e&&(document.body.style.overflow="hidden"),()=>{document.body.style.overflow=""}),[e]),e?c.jsx("div",{css:eq,"data-testid":K("modal-container",r),children:c.jsx("div",{...d,ref:s,css:tq(i,l),children:c.jsxs(Yc,{elevated:"02",radius:"3",children:[c.jsx("div",{css:nq,children:c.jsx(le,{type:"tertiary",iconName:"close",onClick:t,color:u.tokens.colors.get("textColor.default.secondary"),dataTestId:"modal-close"})}),c.jsx("div",{css:rq({isContentPadded:a}),children:o?c.jsx(cq,{...o}):n})]})})}):null},dq=(e,t)=>{const r=fl.useLocation(),[n,o]=v.useState();return v.useLayoutEffect(()=>{e.forEach(a=>{(a.options.map(s=>s.url).includes(r.pathname)||a.url===r.pathname)&&(o(a.url),t([a.url]))})},[r.pathname,e,t]),[n]},$d={semantic:{focus:{border:{width:{step:1},color:{name:"magenta",shade:500}}}}},fq=$d.semantic.focus.border.width.step,Ad=$d.semantic.focus.border.color,pq=({theme:e,borderWidth:t=0})=>{const r=t+fq,n=e.utils.getColor(Ad.name,Ad.shade);return{borderWidth:O(r),focusColor:n,styleBorder:`${O(r)} solid ${n}`,styleOutline:`${n} auto ${O(r)}`}},gq=39,Cq=e=>()=>m.css(de(10.2),";width:100%;background-color:white;height:100%;padding:",O(24)," 0;box-sizing:border-box;.menu-item-text,.submenu-item-text{opacity:",e?1:0,";width:",O(e?204:16),";white-space:nowrap;}",""),Pd=e=>m.css(Ut,";height:",O(44),";color:",e.tokens.colors.get("textColor.default.primary"),";cursor:default;",""),Od=()=>e=>m.css(Pd(e),";width:100%;font-size:",O(16),";font-weight:",e.globals.typography.fontWeight.get("regular"),";padding:0 ",e.globals.spacing.get("6"),";background:transparent;border:0 solid transparent;display:flex;text-align:left;text-decoration:none;&:hover{background-color:",e.tokens.colors.get("palette.tertiary.muted"),";}&:focus-visible{outline:",e.tokens.colors.get("palette.tertiary.muted"),";}",""),vq=()=>e=>m.css(Od()(e),";text-decoration:none;",""),yq=e=>t=>m.css(de(.2),";color:",e?t.tokens.colors.get("textColor.default.active"):t.tokens.colors.get("textColor.default.primary"),";font-weight:",e?t.globals.typography.fontWeight.get("bold"):"initial",";",""),hq=()=>e=>m.css(Pd(e),";",de(.2),";box-sizing:border-box;font-size:",e.globals.typography.fontSize.get("3"),";color:",e.tokens.colors.get("textColor.default.primary"),";margin:",e.globals.spacing.get("3")," 0 ",e.globals.spacing.get("3")," 0;padding-left:",O(gq),";&:hover{background-color:",e.tokens.colors.get("palette.tertiary.muted"),"!important;}&.active:hover{background-color:",e.tokens.colors.get("palette.tertiary.contrast"),"!important;}&.active{font-weight:",e.globals.typography.fontWeight.get("bold"),";background-color:",e.tokens.colors.get("palette.tertiary.muted"),"!important;color:",e.tokens.colors.get("textColor.default.active"),";path{fill:",e.tokens.colors.get("textColor.default.active"),"!important;}}&:focus-visible{outline:",pq({theme:e}).styleOutline,";}text-decoration:none;",""),bq=(e,t)=>()=>m.css(de(.2),";opacity:",t?"1":"0",";transform:",e?"rotate(90deg)":"rotate(0deg);",";",""),mq=()=>e=>m.css(de(.2),";",et,";margin-right:",e.globals.spacing.get("4"),";width:",O(32),";height:",O(32),";border-radius:50%;flex-shrink:0;",""),wq=()=>e=>m.css(et,";width:",O(32),";height:",O(32),";margin-right:",e.globals.spacing.get("4"),";flex-shrink:0;",""),Md=v.memo(({isCurrent:e,isExpanded:t,name:r,url:n,iconName:o,options:a,toggleMenuItem:i,state:l})=>{const s=F(),u=v.useMemo(()=>a.length>0,[a.length]),d=c.jsxs(v.Fragment,{children:[c.jsx("div",{css:bq(t,u),children:c.jsx(H,{name:"triangleRight",color:s.tokens.colors.get("textColor.default.primary"),size:20})}),c.jsx("div",{css:mq(),children:c.jsx(H,{name:o,color:e?s.tokens.colors.get("textColor.default.active"):s.tokens.colors.get("textColor.default.primary"),size:20})}),c.jsx("span",{className:"menu-item-text",css:yq(e),children:r})]});return c.jsx(v.Fragment,{children:u?c.jsx(kd,{isExpanded:t,onChange:()=>i(n),textAndControl:f=>c.jsx("button",{type:"button",css:Od(),"data-testid":n,onClick:f,children:d}),children:()=>c.jsx(v.Fragment,{children:a.map(f=>f.isVisible&&c.jsxs(fl.NavLink,{to:f.url,state:f.state,"data-testid":f.url,className:({isActive:p,isPending:h})=>h?"pending":p?"active":"",css:hq(),id:"submenu-item-link",children:[c.jsx("div",{css:wq(),children:c.jsx(H,{name:f.iconName,color:s.tokens.colors.get("textColor.default.primary"),size:20})}),c.jsx("span",{className:"submenu-item-text",children:f.name})]},f.url))})}):c.jsx(fl.NavLink,{to:n,state:l,"data-testid":n,className:({isActive:f,isPending:p})=>p?"pending":f?"active":"",css:vq(),children:d},n)})});Md.displayName="MenuItem";const Sq=({menuItems:e,isExpanded:t})=>{const[r,n]=v.useState([]),[o]=dq(e,n),a=v.useCallback(i=>{n(l=>l.indexOf(i)!==-1?[]:[i])},[]);return c.jsx("div",{css:Cq(t),children:e.map(i=>i.isVisible&&c.jsx(Md,{isCurrent:o===i.url,isExpanded:r.includes(i.url),toggleMenuItem:a,...i},i.url))})},xq=(e,t,r)=>n=>m.css(de(.2),";width:",O(e?"308px":t?"112px":"0px"),";background-color:",n.tokens.colors.get("backgroundColor.default"),";overflow:hidden;flex-grow:0;flex-shrink:0;height:100%;min-height:100%;z-index:100;position:",r?"absolute":"relative",";border-right:",O(1)," solid ",n.tokens.colors.get("borderColor.decorative.default"),";",""),Eq=e=>{var n;const t=Qr(),r=t.des1200&&!t.des1440;return c.jsxs("div",{css:xq(e.isExpanded,t.des1200,!t.des1440),onMouseEnter:()=>r&&e.setExpanded(!0),onMouseLeave:()=>r&&e.setExpanded(!1),"data-testid":"sidebar",children:[(n=e.renderHeader)==null?void 0:n.call(e),c.jsx(Sq,{...D.omit(e,"renderHeader")})]})},gt=e=>e==="info"?"active":e,Ld=e=>e==="info"?"primaryAlt":e,_q=(e,t,r)=>m.css("border:",r.globals.borderWidth.get("2")," solid ",r.tokens.colors.get(`borderColor.interactive.${gt(e)}`),";&[notification-type='banner']{box-shadow:",r.globals.elevation["02"],";}",t==="outlined"?`
131
131
  background: ${r.tokens.colors.get("backgroundColor.default")};
132
132
  `:`
133
133
  background: ${r.tokens.colors.get(`palette.${Ld(e)}.muted`)};
@@ -2,7 +2,7 @@ import { TestProps } from '../../utils/types';
2
2
  import { ListRowSize } from '../List';
3
3
  import * as React from 'react';
4
4
  export type MenuProps = {
5
- children?: React.ReactElement[] | React.ReactElement;
5
+ children?: React.ReactNode[] | React.ReactNode;
6
6
  /** A callback that is being triggered when selection change */
7
7
  onSelectionChange?: (e: Set<string>) => any;
8
8
  /** The keys of the items that are disabled */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orfium/ictinus",
3
- "version": "5.32.0",
3
+ "version": "5.33.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.umd.cjs",
6
6
  "module": "./dist/index.js",