@maxio-com/react-ui-components 9.20.1 → 9.21.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.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import a,{useRef as t,useEffect as l,useState as n,forwardRef as i,cloneElement as o,isValidElement as r,createContext as s,useId as c,useContext as m,Children as d,useMemo as u,useCallback as p,useLayoutEffect as v,useImperativeHandle as g}from"react";import x from"classnames";import{useId as b,useLink as h,useButton as f,usePress as E,useFocusRing as _,mergeProps as w,useCheckboxGroupItem as N,useCheckbox as y,useCheckboxGroup as I,useRadio as k,useRadioGroup as R,useTextField as C,useProgressBar as S,useToggleButton as P}from"react-aria";import{useObjectRef as $,useResizeObserver as D}from"@react-aria/utils";import{flexRender as T,useReactTable as M,getSortedRowModel as O,getExpandedRowModel as z,getCoreRowModel as B}from"@tanstack/react-table";export{createColumnHelper}from"@tanstack/react-table";import{dropTargetForElements as A,draggable as L,monitorForElements as W}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/element/adapter.js";import{attachInstruction as F,extractInstruction as H}from"@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/tree-item.js";import{useToggleState as V}from"@react-stately/toggle";import{useCheckboxGroupState as j}from"@react-stately/checkbox";import{Popover as K,OverlayArrow as q,Button as U,TooltipTrigger as G,Tooltip as Z,MenuTrigger as Y,Menu as X,MenuItem as Q,ModalOverlay as J,Modal as ee,Dialog as ae,ListBox as te,composeRenderProps as le,ListBoxItem as ne,ListBoxSection as ie,Header as oe,ComboBox as re,Label as se,Input as ce,Text as me,FieldError as de,TextField as ue,TextArea as pe,ToggleButtonGroup as ve,ToggleButton as ge,SelectionIndicator as xe,Tab as be,Tabs as he,TabPanel as fe,TabPanels as Ee,TabListStateContext as _e,TabList as we}from"react-aria-components";export{DialogTrigger,Pressable}from"react-aria-components";import{AnimatePresence as Ne,motion as ye}from"framer-motion";import{useDismiss as Ie,useFocus as ke,useHover as Re,useClick as Ce,useFloating as Se,offset as Pe,useInteractions as $e,useRole as De,FloatingPortal as Te}from"@floating-ui/react-dom-interactions";import{useRadioGroupState as Me}from"@react-stately/radio";import{useToastState as Oe,useToastQueue as ze,ToastQueue as Be}from"@react-stately/toast";import{useToast as Ae,useToastRegion as Le}from"@react-aria/toast";const We=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],Fe=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],He=["avalara","pipedrive","quickbooks","salesforce","xero"],Ve=({variant:e,color:t,className:l,size:n})=>{const i=(e,a)=>a.includes(e),o=i(e,We)||i(e,Fe),r=i(e,He),s=x({"fa-kit":o,"fa-kit-duotone":r,"fa-sharp fa-regular":!o&&!r,[`fa-${e}`]:!0,[`fa-${n}`]:n,[`maxio-icon--${t}`]:t&&!i(e,Fe)&&!i(e,He)},l);return a.createElement("i",{className:s})},je=({item:e,isSelected:n,truncateLabel:i=!1,role:o="option",small:r=!1})=>{const s=t(null),c=t(!1),m=b();if(l(()=>{var e;n&&c.current&&(null===(e=s.current)||void 0===e||e.focus())},[n]),l(()=>{c.current=!0},[]),"divider"===e.type)return a.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:d,leadingIconClassName:u,trailingIconName:p,label:v,description:g,link:h}=e,f=x("maxio-action-list__label",{"maxio-truncate":i});return a.createElement("a",{"aria-labelledby":m,...h,className:x("maxio-action-list__content",h.className,{"maxio-action-list__content--size-small":r}),tabIndex:n?0:-1,ref:s,role:o},d&&a.createElement(Ve,{variant:d,className:x("maxio-action-list__leading-icon",u)}),a.createElement("span",{className:f,id:m},v),g&&a.createElement("span",{className:"maxio-action-list__description"},g),p&&a.createElement(Ve,{variant:p,className:"maxio-action-list__trailing-icon"}))},Ke=(e,a,t)=>0===e?e:1===e&&"divider"===a[e-1].type?t||e:"divider"===a[e-1].type?Ke(e-1,a,t||e):e-1,qe=({items:e,isShadowed:t=!0,itemProps:l={},className:i,truncateLabels:o=!1,small:r=!1,...s})=>{const c=x("maxio-action-list",i,{"maxio-action-list--shadow":t}),[m,d]=n(()=>e.findIndex(e=>"divider"!==e.type));return 0===e.length?null:a.createElement("div",{className:c,onKeyDown:a=>{if("Space"===a.code||"Enter"===a.code){const a=e[m];a&&"divider"!==a.type&&window.open(a.link.href,a.link.target||"_self")}"ArrowUp"===a.code&&(a.preventDefault(),d(a=>Ke(a,e))),"ArrowDown"===a.code&&(a.preventDefault(),d(a=>((e,a)=>{const t=a.findIndex((a,t)=>"divider"!==a.type&&t>e);return-1===t?e:t})(a,e)))},role:"listbox",...s},e.map((e,t)=>a.createElement(je,{item:e,truncateLabel:o,key:`listbox-${e.id}`,isSelected:t===m,small:r,...l})))},Ue=({className:e,children:t,disabled:l,external:n,icon:i,size:o="sm",underline:r,variant:s,...c})=>{const m=x("maxio-link",{[`maxio-link--${o}`]:o,"maxio-link--disabled":l,[`maxio-link--${s}`]:s,"maxio-link--underline":r},e),d=n?"_blank":"_self";return a.createElement("a",{className:m,target:d,...c},t,i&&a.createElement(Ve,{variant:i,className:"maxio-link__icon"}))},Ge=({size:e="md",white:t=!1,className:l})=>{const n=x("maxio-loading-spinner",l,`maxio-loading-spinner--${e}`,{"maxio-loading-spinner--white":t});return a.createElement("div",{className:n,role:"status","aria-label":"loading"})},Ze=i(({fullWidth:e=!1,leadingElement:t,trailingElement:l,icon:n,variant:i="primary",size:s,...c},m)=>{const d=$(m),{linkProps:u}=h({...c},d),p=x("maxio-button",c.className,{[`maxio-button--${s}`]:s,[`maxio-button--${i}`]:i,"maxio-button--full-width":e});return a.createElement("a",{...u,ref:d,className:p,href:c.href},t&&o(t,{...r(t)&&{className:"maxio-button__leading-element"}}),c.children,(l||n)&&o(l||n,{...r(l||n)&&{className:"maxio-button__trailing-element"}}))}),Ye=i(({disabled:e,loading:t=!1,fullWidth:l=!1,leadingElement:n,trailingElement:i,icon:s,variant:c="primary",size:m,...d},u)=>{const p=$(u),{buttonProps:v}=f({...d,isDisabled:e,formAction:"string"==typeof d.formAction?d.formAction:void 0},p),g=["primary","danger"].includes(c),b=x("maxio-button",d.className,{[`maxio-button--${m}`]:m,[`maxio-button--${c}`]:c,"maxio-button--loading":t,"maxio-button--full-width":l});return a.createElement("button",{...v,className:b,ref:p},n&&o(n,{...r(n)&&{className:"maxio-button__leading-element"}}),d.children,!t&&(i||s)&&o(i||s,{...r(i||s)&&{className:"maxio-button__trailing-element"}}),t&&a.createElement(Ge,{className:"maxio-button__trailing-element",size:"md",white:g}))}),Xe=i((e,t)=>(e=>"href"in e)(e)?a.createElement(Ze,{...e,ref:t}):a.createElement(Ye,{...e,ref:t})),Qe=({"aria-label":e,className:t,...l})=>a.createElement(Xe,{"aria-label":e,className:x("maxio-button--icon",t),...l},null),Je=({children:e,title:t,linkText:l,linkExternal:n,href:i,display:o="inline",sentiment:r="info",onDismiss:s,className:c})=>{if(!e&&!t)return console.warn("Alert component requires either children or title prop to be rendered"),null;const m=x("maxio-alert",{[`maxio-alert--${r}`]:"info"!==r&&r},c),d={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[r],u=x("maxio-alert__content",{"maxio-alert__content--block":"block"===o});return a.createElement("div",{className:m},a.createElement(Ve,{variant:d,className:"maxio-alert__icon","aria-hidden":"true"}),a.createElement("section",{className:"maxio-alert__container"},a.createElement("div",{className:u},t&&a.createElement("span",{className:"maxio-alert__title"},t),e&&a.createElement("span",{className:"maxio-alert__message"},e),l&&i&&a.createElement(Ue,{className:"maxio-alert__link",href:i,variant:"high-contrast",underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(Qe,{icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-alert__dismiss"}))},ea=s({}),aa=({children:e})=>{const[t,l]=n(!1),i=c(),o=c();return a.createElement(ea.Provider,{value:{controlsId:i,buttonId:o,isOpen:t,onClose:()=>l(!1),onOpen:()=>l(!0),onToggle:()=>l(e=>!e)}},e)};function ta(){const e=m(ea);if(!e||"object"==typeof e&&0===Object.keys(e).length)throw new Error("useMenu hook must be used within a MenuProvider");return e}const la=({children:e})=>{const{isOpen:t,onToggle:l,onClose:n}=ta();return a.createElement("details",{open:t,onToggle:l,className:"maxio-action-menu"},"function"==typeof e?e({isOpen:t,onClose:n}):e)},na=({children:e})=>a.createElement(aa,null,a.createElement(la,null,e)),ia=({items:e,alignItemsEnd:t=!1})=>{const l=x("maxio-action-menu__content",{"maxio-action-menu__content--align-end":t}),{controlsId:n,buttonId:i}=ta();return a.createElement("div",{className:l,role:"presentation"},a.createElement(qe,{role:"menu",itemProps:{role:"menuitem"},id:n,"aria-labelledby":i,items:e}))},oa=({children:e,iconName:t="chevron-down","aria-label":l,size:n="md",variant:i="secondary"})=>{const o=x({"maxio-action-menu__chevron":"chevron-down"===t}),r=x("maxio-button",`maxio-button--${i}`,`maxio-button--${n}`,{"maxio-button--icon":t&&!e}),{isOpen:s,buttonId:c,controlsId:m}=ta();return a.createElement("summary",{className:r,"aria-haspopup":"true","aria-label":l,"aria-expanded":s,"aria-controls":m,id:c},e&&a.createElement("span",null,e),t&&a.createElement(Ve,{variant:t,className:`${o} maxio-button__trailing-element`}))},ra=({className:e,src:t,alt:l="avatar"})=>a.createElement("img",{className:x("maxio-avatar",e),alt:l,src:t}),sa=({children:e,title:t,linkText:l,linkExternal:n,href:i,display:o="inline",sentiment:r="info",onDismiss:s,className:c})=>{if(!e&&!t)return console.warn("Banner component requires either children or title prop to be rendered"),null;const m=x("maxio-banner",{[`maxio-banner--${r}`]:"info"!==r&&r,className:c}),d={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[r],u=x("maxio-banner__content",{"maxio-banner__content--block":"block"===o});return a.createElement("div",{className:m,"aria-live":"assertive"},a.createElement(Ve,{variant:d,className:"maxio-banner__icon","aria-hidden":"true"}),a.createElement("section",{className:"maxio-banner__container"},a.createElement("div",{className:u},t&&a.createElement("span",{className:"maxio-banner__title"},t),e&&a.createElement("span",{className:"maxio-banner__message"},e),l&&i&&a.createElement(Ue,{href:i,..."warning"!==r&&{variant:"inverse"},underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(Qe,{icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-banner__dismiss"}))},ca=({children:e,className:t,href:l,...n})=>{const i=l?a.createElement(Ue,{size:"sm",href:l},e):e;return a.createElement("li",{className:x("maxio-breadcrumbs__item",t),...n},i)},ma="Breadcrumbs requires at least one BreadcrumbsItem as children",da='Last BreadcrumbsItem should not have "href" prop. It is the current page.',ua="Breadcrumbs only accepts BreadcrumbsItem as children",pa=({className:e,children:t,...l})=>{const n=d.count(t);if(0===n)throw new Error(ma);const i=d.map(t,(e,a)=>{if(r(e)&&e.type===ca){if(a===n-1&&e.props.href)throw new Error(da);return o(e,{"aria-current":a===n-1?"page":void 0})}throw new Error(ua)});return a.createElement("nav",{"aria-label":"Breadcrumb",...l},a.createElement("ol",{className:x("maxio-breadcrumbs",e)},i))},va="row-controls",ga="row-actions",xa=({children:e,pattern:t,size:l,isExpandable:i,isUsingCustomRow:o})=>{const[r,s]=n(!1),[c,m]=n(!1),d=t&&o&&i,u=x("maxio-data-table",{"maxio-data-table--pattern":t&&!d,"maxio-data-table--expanded-child-pattern":d,"maxio-data-table--with-custom-row":o,[`maxio-data-table--${l}`]:l,"maxio-data-table--with-pinned-left-border":r,"maxio-data-table--with-pinned-right-border":c});return a.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const a=e.target;s(a.scrollLeft>0),m(a.scrollWidth-a.clientWidth-a.scrollLeft>0)}},a.createElement("table",{className:u},e))},ba=({children:e})=>a.createElement("thead",null,e),ha=({children:e})=>a.createElement("tbody",null,e),fa=({children:e,table:t,header:l,className:n,enableExpanding:i,...o})=>{var r,s,c,m,d,u,p,v,g,b,h;const f=null==l?void 0:l.column,E=null===(r=null==f?void 0:f.getCanSort)||void 0===r?void 0:r.call(f),_=null===(s=null==f?void 0:f.getToggleSortingHandler)||void 0===s?void 0:s.call(f),w=null==l?void 0:l.isPlaceholder,N=null===(m=null===(c=null==f?void 0:f.columnDef)||void 0===c?void 0:c.meta)||void 0===m?void 0:m.align,y=null===(u=null===(d=null==f?void 0:f.columnDef)||void 0===d?void 0:d.meta)||void 0===u?void 0:u.width,I=null===(v=null===(p=null==f?void 0:f.columnDef)||void 0===p?void 0:p.meta)||void 0===v?void 0:v.controls,k=null===(b=null===(g=null==f?void 0:f.columnDef)||void 0===g?void 0:g.meta)||void 0===b?void 0:b.actions,R=null==f?void 0:f.getIsPinned(),C=null==f?void 0:f.getIsSorted(),S="asc"===C,P=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${R}`]:R,"maxio-data-table__cell--sortable":E,"maxio-data-table__cell--active":C,[`maxio-data-table__cell--${N}`]:N,"maxio-data-table__cell--controls":I,"maxio-data-table__cell--actions":k}),$={...y?{width:y}:{},..."left"===R?{left:null==f?void 0:f.getStart("left")}:"right"===R?{right:null==f?void 0:f.getAfter("right")}:{}},D=((e,a)=>e&&a?"arrow-up":e&&!a?"arrow-down":"arrow-down-up")(!!C,S),T=null==t?void 0:t.getToggleAllRowsExpandedHandler(),M=null===(h=null==t?void 0:t.getIsAllRowsExpanded)||void 0===h?void 0:h.call(t),O=(null==l?void 0:l.headerGroup.headers[0].id)===va?1:0,z=i&&(null==l?void 0:l.index)===O;return w?null:a.createElement("th",{scope:"col",role:"columnheader","aria-sort":C?S?"ascending":"descending":"none",className:P,onClick:_,colSpan:null==l?void 0:l.colSpan,style:$,...o},a.createElement("div",{className:"maxio-data-table__cell-flex"},!0===i&&z&&a.createElement(Qe,{size:"sm",variant:"ghost",icon:a.createElement(Ve,{size:"xs",variant:M?"chevron-down":"chevron-right"}),onClick:T,"aria-label":M?"Collapse all rows":"Expand all rows","data-open":M,className:"maxio-data-table__expand-button"}),e,E&&a.createElement(Ve,{variant:D,className:"maxio-data-table__sort-icon"})))},Ea=e=>{var a;return null!==(a=e.subRows)&&void 0!==a?a:[]},_a=(e,a)=>Object.assign({},e,{subRows:a}),wa=(e,a,t=[])=>{for(let l=0;l<e.length;l+=1){const n=e[l],i=[...t,l];if(n===a)return i;const o=wa(Ea(n),a,i);if(o)return o}return null},Na=(e,a)=>{const[t,...l]=a,n=e[t];if(!n)return null;const i=[...e];if(0===l.length)return i.splice(t,1),{data:i,item:n};const o=Na(Ea(n),l);return o?(i[t]=_a(n,o.data),{data:i,item:o.item}):null},ya=(e,a,t,l)=>{const n=[...e];if(0===a.length)return n.splice(t,0,l),n;const[i,...o]=a,r=e[i];if(!r)return null;const s=ya(Ea(r),o,t,l);return s?(n[i]=_a(r,s),n):null},Ia=(e,a)=>{let t,l=e;for(const e of a){if(t=l[e],!t)return;l=Ea(t)}return t},ka="maxio-data-table-row",Ra=s(null),Ca=()=>m(Ra),Sa=e=>e.type===ka&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,Pa=e=>{const a=(e=>{const a=H(e);return a&&"instruction-blocked"!==a.type?"reorder-above"===a.type?"before":"reorder-below"===a.type?"after":"make-child"===a.type?"inside":null:null})(e);return"string"==typeof e.rowId&&a?{rowId:e.rowId,position:a}:null},$a=({availability:e,children:i,data:o,enableExpanding:r,getRowReorderLabel:s,onRowReorder:m,rowReorderMode:d,table:v})=>{const g=`maxio-data-table-${c()}`,[x,b]=n(""),[h,f]=n(null),[E,_]=n(null),w=t(null),N=p(e=>v.getCoreRowModel().rowsById[e],[v]),y=p(e=>{var a;return null!==(a=null==s?void 0:s(e))&&void 0!==a?a:e.id},[s]),I=p((e,a)=>{const t=N(e),l=N(a.rowId);if(!t||!l)return null;const n=((e,a,t,l,n)=>{var i,o;if(a.id===t.id||!((e,a,t,l)=>{var n,i;return"all"===l||("siblings"===l?"inside"!==t&&(null!==(n=e.parentId)&&void 0!==n?n:null)===(null!==(i=a.parentId)&&void 0!==i?i:null):"inside"===t?e.depth===a.depth+1:e.depth===a.depth)})(a,t,l,n))return null;const r=wa(e,a.original),s=wa(e,t.original);if(!r||!s||(m=s,(c=r).length<m.length&&c.every((e,a)=>m[a]===e)))return null;var c,m;const d=Na(e,r);if(!d)return null;const u=((e,a)=>{const t=[...e],l=a.length-1;return l>=0&&e.length>l&&a.slice(0,l).every((a,t)=>e[t]===a)&&a[l]<e[l]&&(t[l]-=1),t})(s,r),p=u[u.length-1];if(void 0===p)return null;const v="inside"===l?u:u.slice(0,-1),g=Ia(d.data,u);if(!g)return null;const x="inside"===l?Ea(g).length:p+("after"===l?1:0),b={parentRowId:"inside"===l?t.id:null!==(i=t.parentId)&&void 0!==i?i:null,index:x},h={parentRowId:null!==(o=a.parentId)&&void 0!==o?o:null,index:a.index};if(h.parentRowId===b.parentRowId&&h.index===b.index)return null;const f=ya(d.data,v,x,d.item);return f?{data:f,source:h,destination:b}:null})(o,t,l,a.position,d);return n&&!r&&null!==n.destination.parentRowId&&n.destination.parentRowId!==n.source.parentRowId?null:n},[o,r,N,d]),k=p(e=>{w.current=e,f(e)},[]),R=p((e,a)=>{const t=N(e),l=N(a.rowId),n=I(e,a);return t&&l&&n?(m({...n,row:t,rowId:t.id,targetRow:l,targetRowId:l.id,position:a.position}),b(`${y(t)} moved ${i=y(l),o=a.position,"inside"===o?`inside ${i}`:`${o} ${i}`}.`),!0):(b("That row cannot be moved to this position."),!1);var i,o},[y,I,N,m]),C=p((e,{input:a,element:t,source:l})=>{const n={rowId:e.id,instanceId:g},i=F(n,{element:t,input:a,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),o=Pa(i),r=Sa(l.data)&&l.data.instanceId===g&&Boolean(o&&I(l.data.rowId,o));return{...i,isValid:r}},[I,g]),S=p((a,t)=>{if(!e.available)return()=>{};const l=e=>{const a=e.isValid?Pa(e):null;k(a)};return A({element:t,canDrop:({source:e})=>Sa(e.data)&&e.data.instanceId===g&&e.data.rowId!==a.id&&!a.getParentRows().some(a=>a.id===e.data.rowId),getData:e=>C(a,e),onDragEnter:({self:e})=>l(e.data),onDrag:({self:e})=>l(e.data),onDragLeave:()=>{var e;(null===(e=w.current)||void 0===e?void 0:e.rowId)===a.id&&k(null)}})},[e,C,g,k]),P=p((a,t)=>{const l=t.closest("tr");return e.available&&l instanceof HTMLElement?L({element:l,dragHandle:t,getInitialData:()=>({type:ka,instanceId:g,rowId:a.id})}):()=>{}},[e,g]);l(()=>{if(e.available)return W({canMonitor:({source:e})=>Sa(e.data)&&e.data.instanceId===g,onDragStart:({source:e})=>{if(!Sa(e.data))return;const a=N(e.data.rowId);_(e.data.rowId),a&&b(`${y(a)} grabbed. Choose a destination.`)},onDrop:({source:e,location:a})=>{var t;if(Sa(e.data)){const l=null===(t=a.current.dropTargets[0])||void 0===t?void 0:t.data,n=!0===(null==l?void 0:l.isValid)?Pa(l):null;n?R(e.data.rowId,n):b("Row move cancelled.")}_(null),k(null)}})},[R,e,y,N,g,k]),l(()=>{if("inside"!==(null==h?void 0:h.position))return;const e=N(h.rowId);if(!(null==e?void 0:e.getCanExpand())||e.getIsExpanded())return;const a=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(a)},[h,N]);const $=p(a=>{var t;if(!e.available)return[];const l=a.parentId?N(a.parentId):null,n=null!==(t=null==l?void 0:l.subRows)&&void 0!==t?t:v.getCoreRowModel().rows,i=n.findIndex(e=>e.id===a.id);if(-1===i)return[];const o=n[i-1],r=n[i+1],s=n[0],c=n[n.length-1],m=[];if(i>1&&s&&m.push({id:"top",label:"Move to top",target:{rowId:s.id,position:"before"}}),o&&m.push({id:"up",label:"Move up",target:{rowId:o.id,position:"before"}}),r&&m.push({id:"down",label:"Move down",target:{rowId:r.id,position:"after"}}),i<n.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),l){let e=l;for(;e.parentId;){const a=N(e.parentId);if(!a)break;e=a}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return v.getCoreRowModel().flatRows.forEach(e=>{e.id!==a.parentId&&m.push({id:`move-to:${e.id}`,label:`Move to ${y(e)}`,target:{rowId:e.id,position:"inside"}})}),m.filter(e=>Boolean(I(a.id,e.target)))},[e,y,I,N,v]),D=p(a=>{var t;if(!e.available)return!1;const l=a.parentId?N(a.parentId):null;return(null!==(t=null==l?void 0:l.subRows)&&void 0!==t?t:v.getCoreRowModel().rows).length>1||"siblings"!==d&&("all"===d?Boolean(l):!(!r||0===a.depth)&&v.getCoreRowModel().flatRows.some(e=>e.depth===a.depth-1&&e.id!==a.parentId))},[e,r,N,d,v]),T=u(()=>({activeTarget:h,availability:e,draggingRowId:E,getActions:$,getLabel:y,hasActions:D,moveRow:R,registerHandle:P,registerRow:S}),[h,e,R,E,$,y,D,P,S]);return a.createElement(Ra.Provider,{value:T},i,a.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},x))},Da=({children:e,row:t,isChild:l,isHeader:n,className:i,onRowAction:o,...r})=>{var s,c,m,d,u;const p=null===(s=null==t?void 0:t.getIsSelected)||void 0===s?void 0:s.call(t),v=(null===(c=null==t?void 0:t.getCanExpand)||void 0===c?void 0:c.call(t))&&(null===(m=null==t?void 0:t.getIsExpanded)||void 0===m?void 0:m.call(t)),g=Boolean(t&&o&&!n&&!l),b=a.useRef(null),h=Ca(),f=null==h?void 0:h.registerRow,N=a.useRef(null),y=e=>{N.current=e.target},{pressProps:I}=E({isDisabled:!g,onPress:e=>{var a;const l=null!==(a=N.current)&&void 0!==a?a:e.target;N.current=null,t&&o&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(l)&&o(t)}}),{focusProps:k,isFocused:R}=_(),C=x({"maxio-data-table__row":!n,"maxio-data-table__header-row":n,"maxio-data-table__row--active":p||R,"maxio-data-table__row--expanded":v,"maxio-data-table__row--expanded-child":l,"maxio-data-table__row--actionable":g,"maxio-data-table__row--dragging":Boolean(t)&&(null==h?void 0:h.draggingRowId)===(null==t?void 0:t.id),[`maxio-data-table__row--drop-${null===(d=null==h?void 0:h.activeTarget)||void 0===d?void 0:d.position}`]:Boolean(t)&&(null===(u=null==h?void 0:h.activeTarget)||void 0===u?void 0:u.rowId)===(null==t?void 0:t.id)},i);a.useEffect(()=>{if(t&&f&&b.current&&!n&&!l)return f(t,b.current)},[l,n,f,t]);const S=g?w({onClickCapture:y,onKeyDownCapture:y,tabIndex:0},I,k,r):r;return a.createElement("tr",{...S,ref:b,className:C,tabIndex:g?S.tabIndex:r.tabIndex},e)},Ta=s({}),Ma=i(({checked:e,disabled:t,invalid:l,indeterminate:n,className:i,inputProps:o,error:r,label:s},c)=>{const m=x("maxio-checkbox",{"maxio-checkbox--checked":e,"maxio-checkbox--disabled":t,"maxio-checkbox--error":l,"maxio-checkbox--indeterminate":n},i);return a.createElement("label",{className:m},a.createElement("input",{type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:c,...o}),a.createElement("span",{className:"maxio-checkbox__control"},r&&a.createElement("span",{className:"maxio-checkbox__control-error"})),s&&a.createElement("span",{className:"maxio-checkbox__label"},s))});Ma.displayName="InnerCheckbox";const Oa=({label:e,error:l=!1,className:n,indeterminate:i,value:o="",disabled:r,readOnly:s,defaultChecked:c,checked:d,...u})=>{const p=t(null),v=m(Ta),{inputProps:g,isDisabled:x,isInvalid:b,isSelected:h}=v&&Object.keys(v).length>0?N({value:o,"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,...u},v,p):y({"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,value:o,...u},V({...u,isSelected:d,defaultSelected:c}),p);return a.createElement(Ma,{inputProps:g,checked:h,disabled:x,invalid:b,indeterminate:i,className:n,error:l,label:e,ref:p,...u})},za=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-helper-text",t),...l},e),Ba=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-error",t),...l},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},e)),Aa=({helperText:e,className:t,errorMessage:l,children:n,disabled:i,label:o,defaultValue:r,name:s,...c})=>{var m;const d=j({defaultValue:r,name:s,errorMessage:l,description:e,label:o,isDisabled:i,isInvalid:!!l,...c}),{groupProps:u,labelProps:p,descriptionProps:v,errorMessageProps:g,isInvalid:b}=I({"aria-label":null===(m=null!=o?o:c["aria-label"])||void 0===m?void 0:m.toString(),isDisabled:i,isInvalid:!!l,...c},d),h=x("maxio-checkbox-group",{"maxio-checkbox-group--disabled":i},t),f=e&&!l;return a.createElement("div",{className:h,...u},o&&a.createElement("label",{className:"maxio-checkbox-group__label",...p},o),a.createElement(Ta.Provider,{value:d},n),f&&a.createElement(za,{...v},e),l&&b&&a.createElement(Ba,{...g},l))},La=({table:e,enableRowSelection:t,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==e?void 0:e.getToggleAllPageRowsSelectedHandler)||void 0===n?void 0:n.call(e),c=(null===(i=null==e?void 0:e.getIsAllPageRowsSelected)||void 0===i?void 0:i.call(e))||(null===(o=null==e?void 0:e.getIsAllRowsSelected)||void 0===o?void 0:o.call(e)),m=null===(r=null==e?void 0:e.getIsSomePageRowsSelected)||void 0===r?void 0:r.call(e);return t?a.createElement(a.Fragment,null,l&&a.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),a.createElement(Oa,{"aria-label":"Select all rows",onChange:e=>{s("boolean"==typeof e?{target:{checked:e}}:e)},checked:c,indeterminate:!c&&m})):null},Wa=({className:e,hideArrow:t=!1,children:l,offset:n=4,...i})=>a.createElement(K,{...i,className:x("maxio-popover",e),offset:n},a.createElement(a.Fragment,null,!t&&a.createElement(q,{className:"maxio-popover__arrow"},a.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},a.createElement("path",{d:"M0 0 L6 6 L12 0"}))),l)),Fa=({row:e})=>{var t,l;const n=Ca(),i=null==n?void 0:n.registerHandle,o=null==n?void 0:n.getActions,r=null==n?void 0:n.hasActions,s=a.useRef(null),[c,m]=a.useState(!1),d=(null==n?void 0:n.draggingRowId)===e.id,u=null!==(t=null==n?void 0:n.getLabel(e))&&void 0!==t?t:e.id,p=a.useMemo(()=>{var a;return null!==(a=null==r?void 0:r(e))&&void 0!==a&&a},[r,e]),v=a.useMemo(()=>{var a;return c&&null!==(a=null==o?void 0:o(e))&&void 0!==a?a:[]},[o,c,e]),g=null!==(l=n&&!n.availability.available?n.availability.message:void 0)&&void 0!==l?l:p?void 0:`No moves are available for ${u}.`;a.useEffect(()=>{if(i&&s.current&&!g)return i(e,s.current)},[i,e,g]),a.useEffect(()=>{g&&m(!1)},[g]);const x=a.createElement(U,{ref:s,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${u}`,"aria-pressed":d,"aria-disabled":!!g||void 0,onPress:()=>{g||m(!0)}},a.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(g?"maxio-icon--disabled":"maxio-icon--secondary")}));return g?a.createElement(G,{delay:0,closeDelay:0},x,a.createElement(Z,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},a.createElement("div",{className:"maxio-tooltip__content"},g))):a.createElement(Y,{trigger:"longPress",isOpen:c,onOpenChange:m},x,a.createElement(Wa,{placement:"bottom start",hideArrow:!0},a.createElement(X,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:v,onAction:a=>{const t=v.find(e=>e.id===a);t&&(null==n||n.moveRow(e.id,t.target),requestAnimationFrame(()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}},e=>a.createElement(Q,{id:e.id,textValue:e.label,className:"maxio-data-table__reorder-menu-item"},e.label))))},Ha=({row:e,enableRowSelection:t,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==e?void 0:e.getToggleSelectedHandler)||void 0===n?void 0:n.call(e),c=(null===(i=null==e?void 0:e.getIsSelected)||void 0===i?void 0:i.call(e))||(null===(o=null==e?void 0:e.getIsAllSubRowsSelected)||void 0===o?void 0:o.call(e)),m=null===(r=null==e?void 0:e.getIsSomeSelected)||void 0===r?void 0:r.call(e),d=e.id||e.index;return a.createElement(a.Fragment,null,l&&a.createElement(Fa,{row:e}),t&&a.createElement(Oa,{"aria-label":`Select row ${d}`,onChange:s,checked:c,indeterminate:m}))},Va=({children:e})=>a.createElement("div",{className:"maxio-data-table__cell-flex"},e),ja=({row:e,cell:t,children:l,className:n,...i})=>{var o,r,s,c,m,d;const u=null==t?void 0:t.column,p=null===(r=null===(o=null==u?void 0:u.columnDef)||void 0===o?void 0:o.meta)||void 0===r?void 0:r.align,v=null===(c=null===(s=null==u?void 0:u.columnDef)||void 0===s?void 0:s.meta)||void 0===c?void 0:c.controls,g=null===(d=null===(m=null==u?void 0:u.columnDef)||void 0===m?void 0:m.meta)||void 0===d?void 0:d.actions,b=null==u?void 0:u.getIsPinned(),h=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${b}`]:b,[`maxio-data-table__cell--${p}`]:p,"maxio-data-table__cell--controls":v,"maxio-data-table__cell--actions":g}),f="left"===b?{left:null==u?void 0:u.getStart("left")}:"right"===b?{right:null==u?void 0:u.getAfter("right")}:{};return a.createElement("td",{className:h,style:f,...i},l)},Ka=({row:e,SubRowComponent:t,pattern:l,enableExpanding:n,onRowAction:i})=>{var o,r,s,c,m;const d=t&&e.getParentRow()&&e.getParentRow().getIsExpanded(),u=d&&e.getVisibleCells()[0].column.columnDef.id===va,p=d&&e.getVisibleCells()[e.getVisibleCells().length-1].column.columnDef.id===ga,v=[p,u].filter(Boolean).length,g=e.getVisibleCells().length-v,x=null!==(r=null===(o=e.getParentRow())||void 0===o?void 0:o.index)&&void 0!==r?r:e.index,b=l&&t&&x%2==1?"maxio-data-table__row--with-pattern":void 0,h=null===(s=e.getCanExpand)||void 0===s?void 0:s.call(e),f=null===(c=null==e?void 0:e.getToggleExpandedHandler)||void 0===c?void 0:c.call(e),E=null===(m=null==e?void 0:e.getIsExpanded)||void 0===m?void 0:m.call(e),_=h&&n?0:1.75,w=e.getVisibleCells()[0].column.columnDef.id===va?1:0,N=e.getVisibleCells().find(({column:e})=>{var a;const{actions:t,controls:l}=null!==(a=e.columnDef.meta)&&void 0!==a?a:{};return!t&&!l}),y=i&&N?N.id:void 0;return a.createElement(a.Fragment,{key:e.id},d?a.createElement(Da,{key:`${e.id}-sub`,row:e,isChild:!0,className:b},u&&a.createElement(ja,{className:"maxio-data-table__cell--pinned-left"}),a.createElement(ja,{colSpan:g},t(e)),p&&a.createElement(ja,{className:"maxio-data-table__cell--pinned-right"})):a.createElement(Da,{key:`${e.id}-parent`,row:e,className:b,onRowAction:i,"aria-labelledby":y},e.getVisibleCells().map(t=>{const l=n&&t.column.getIndex()===w;return a.createElement(ja,{key:t.id,row:e,cell:t,id:t.id},a.createElement("div",{className:"maxio-data-table__cell-flex",style:n&&l?{paddingLeft:`${(null==e?void 0:e.depth)+_}rem`}:void 0},n&&h&&l&&a.createElement(Qe,{size:"sm",variant:"ghost",icon:a.createElement(Ve,{size:"xs",variant:E?"chevron-down":"chevron-right"}),onClick:f,"aria-label":E?"Collapse row":"Expand row","data-open":E,className:"maxio-data-table__expand-button"}),T(t.column.columnDef.cell,t.getContext())))})))},qa={available:!0},Ua={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},Ga={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},Za={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},Ya=(e=[])=>e.filter(e=>e!==va&&e!==ga),Xa=[],Qa=e=>e.subRows,Ja=({pattern:e,size:t="md",SubRowComponent:n,onExpand:i,onSelect:o,onSort:r,enableSorting:s=!1,enableRowSelection:c=!1,enableExpanding:m,columns:d,actions:p,actionsColumnSize:v,onRowAction:g,enableRowReordering:x=!1,getRowReorderLabel:b,onRowReorder:h,rowReorderMode:f="siblings",getRowId:E,getSubRows:_,state:w,...N})=>{var y,I;const k=x?void 0:n,R=!x&&s,C=(({columns:e,HeaderControls:t,RowControls:l,RowActions:n,actions:i,actionsColumnSize:o,enableExpanding:r,enableRowSelection:s,enableRowReordering:c})=>u(()=>{const m={id:va,size:s&&c?72:40,header:e=>a.createElement(t,{...e,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),cell:e=>a.createElement(l,{...e,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),meta:{controls:!0,width:(s&&c?72:40)+"px"}},d=i&&n?{id:ga,size:null!=o?o:40,header:"",cell:e=>a.createElement(n,null,i(e.row,e.table)),meta:{actions:!0}}:null;let u=[...e];return(s||c)&&(u=[m,...u]),d&&(u=[...u,d]),u},[i,o,n,r,s,c,e,t,l]))({columns:d,HeaderControls:La,RowControls:Ha,RowActions:Va,actions:p,actionsColumnSize:v,enableRowSelection:c,enableRowReordering:x,enableExpanding:Boolean(m)}),S=M({state:{...w,...x&&{sorting:Xa},columnPinning:{left:[...c||x?[va]:[],...Ya(null===(y=null==w?void 0:w.columnPinning)||void 0===y?void 0:y.left)],right:[...Ya(null===(I=null==w?void 0:w.columnPinning)||void 0===I?void 0:I.right),...p?[ga]:[]]}},getCoreRowModel:B(),enableRowSelection:c,enableExpanding:Boolean(m),...!N.manualExpanding&&{getExpandedRowModel:z()},...!N.manualSorting&&!x&&{getSortedRowModel:O()},columns:C,getRowId:E,...N,getSubRows:x?Qa:null!=_?_:Qa,enableSorting:R,...x&&{getSortedRowModel:void 0}}),P=S.getCanSomeRowsExpand(),$=S.getState(),D=(({columnFilters:e,globalFilter:a,grouping:t,hasPagination:l})=>e.length>0||null!=a&&""!==a?Ua:t.length>0?Ga:l?Za:qa)({columnFilters:$.columnFilters,globalFilter:$.globalFilter,grouping:$.grouping,hasPagination:Boolean(N.getPaginationRowModel||N.manualPagination)});l(()=>{null==i||i($.expanded)},[i,$.expanded]),l(()=>{null==o||o($.rowSelection)},[o,$.rowSelection]),l(()=>{x||null==r||r($.sorting)},[x,r,$.sorting]);const A=a.createElement(xa,{pattern:e,size:t,isExpandable:P,isUsingCustomRow:Boolean(k)},a.createElement(ba,null,S.getHeaderGroups().map(e=>a.createElement(Da,{key:e.id,table:S,isHeader:!0},e.headers.map(e=>a.createElement(fa,{key:e.id,table:S,header:e,enableExpanding:m},T(e.column.columnDef.header,e.getContext())))))),a.createElement(ha,null,S.getRowModel().rows.map(t=>a.createElement(Ka,{key:t.id,row:t,pattern:e,SubRowComponent:k,enableExpanding:m,onRowAction:g}))));return x&&E&&h?a.createElement($a,{availability:D,data:N.data,enableExpanding:Boolean(m),getRowReorderLabel:b,onRowReorder:h,rowReorderMode:f,table:S},A):A},et={sm:"h3",md:"h2",lg:"h1"},at=({children:e,size:t="sm",className:l,...n})=>{const i=et[t],o=x(`maxio-heading-${t}`,l);return a.createElement(i,{className:o,...n},e)},tt=({open:e,onOpenChange:t,placement:l="right",backdrop:n="dim",size:i="md",className:o,title:r,description:s,children:c,footer:m})=>{const d=a.useId(),u={"data-placement":l,"data-size":i};return a.createElement(J,{isOpen:e,onOpenChange:t,isDismissable:!0,className:x("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===n})},a.createElement(ee,{className:x("maxio-drawer",o),...u},a.createElement(ae,{className:"maxio-drawer__dialog","aria-labelledby":d},({close:e})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-drawer__header"},a.createElement("div",{className:"maxio-drawer__title-group"},a.createElement(at,{id:d,size:"md",className:"maxio-drawer__title"},r),s&&a.createElement("p",{className:"maxio-drawer__description"},s)),a.createElement(Qe,{"aria-label":"Close",onClick:e,icon:a.createElement(Ve,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-drawer__close"})),a.createElement("div",{className:"maxio-drawer__body"},c),null!=m&&a.createElement("div",{className:"maxio-drawer__footer"},m)))))},lt={click:Ce,hover:e=>Re(e,{delay:100}),focus:ke,dismiss:Ie},nt=(e,a)=>a.map(a=>lt[a](e)),it=({placement:e="top",isActive:a=!1,interactions:n=["hover"],floatingElementOffset:i=0,onOverlayUpdate:o,autoHideMs:r})=>{const s=t(null),{strategy:c,x:m,y:d,context:u,floating:p,reference:v}=Se({placement:e,open:a,onOpenChange:e=>o(e),middleware:[Pe(i)]}),{getReferenceProps:g,getFloatingProps:x}=$e([...nt(u,n),De(u,{role:"tooltip"})]);l(()=>{s.current&&clearTimeout(s.current),a&&r&&(s.current=window.setTimeout(()=>o(!1),r))},[a,r]);return{isActive:a,refs:{floating:p,reference:v},floatingElementCSSPosition:{position:c,top:null!=d?d:0,left:null!=m?m:0},getReferenceProps:g,getFloatingProps:x}};function ot(e,a=0){const i=t((new Date).getTime()),o=t((new Date).getTime()),[r,s]=n(!1);return l(()=>{const t=()=>{i.current=(new Date).getTime(),s(!0)},l=()=>{o.current=(new Date).getTime(),window.setTimeout(()=>{i.current-o.current<=0&&s(!1)},a)},n=e&&e.current;return n&&(n.addEventListener("mouseenter",t),n.addEventListener("mouseleave",l)),()=>{n&&(n.removeEventListener("mouseenter",t),n.removeEventListener("mouseleave",l))}},[e]),r}function rt(e=500){const[a,i]=n(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:a}=window;return{windowWitdh:e,windowHeight:a}}),o=t(null);return l(()=>{if("undefined"==typeof window)return;const a=()=>{var a;const{innerWidth:t,innerHeight:l}=window;window.clearTimeout(null!==(a=o.current)&&void 0!==a?a:void 0),o.current=window.setTimeout(()=>{i({windowWitdh:t,windowHeight:l})},e)};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[e]),a}function st(e){const[a,t]=n(()=>{var a,t;return null!==(t=null===(a=e.current)||void 0===a?void 0:a.clientWidth)&&void 0!==t?t:0}),l=()=>{var a,l;const n=null!==(l=null===(a=e.current)||void 0===a?void 0:a.clientWidth)&&void 0!==l?l:0;t(e=>0===n&&e>0?e:n)};return v(l,[e]),D({ref:e,onResize:l}),a}const ct=({children:e,usePortal:t=!1,isActive:l=!1,placement:n="top",interactions:i=["hover"],role:o="tooltip",renderOverlay:r,floatingElementOffset:s,motionSettings:c={},autoHideMs:m,onOverlayUpdate:d,className:u})=>{const{getReferenceProps:p,getFloatingProps:v,refs:{floating:g,reference:b},floatingElementCSSPosition:h}=it({isActive:l,onOverlayUpdate:d,autoHideMs:m,floatingElementOffset:s,interactions:i,placement:n}),f=a.createElement(Ne,null,l&&a.createElement(ye.div,{ref:g,style:h,...c,...v()},r()));return a.createElement(a.Fragment,null,a.createElement("div",{ref:b,className:x("maxio-inline-flex",u),...p(),"data-testid":"overlay-trigger"},e),t?a.createElement(Te,{id:"maxio-ui-portal"},f):f)},mt=({children:e,arrowPosition:t,size:l="regular",maxWidth:n=160})=>a.createElement("div",{"data-testid":"tooltip",className:x("maxio-tooltip",`maxio-tooltip--${l}`,{[`maxio-tooltip--arrow-${t}`]:t})},a.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:n}},e)),dt={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},ut=({children:e,interactions:i=["hover"],placement:o="right",maxWidth:r=160,size:s="regular",renderContent:c,autoHideMs:m,isVisible:d,usePortal:v,className:g,onVisibilityUpdate:x,floatingElementOffset:b=5})=>{const[h,f]=n(!1),E=void 0!==d,_=t(null),w=p(e=>{_.current&&clearTimeout(_.current),_.current=window.setTimeout(()=>{E||f(e),x&&x(e)},50)},[E,x]),N=u(()=>(e=>{const a=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",t=`translate${a}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:t},animate:{opacity:1,visibility:"visible",transform:`translate${a}(0px)`},exit:{opacity:0,visibility:"hidden",transform:t},transition:{ease:[.4,0,.5,1],duration:.2}}})(o),[o]);return l(()=>()=>{_.current&&clearTimeout(_.current)},[]),a.createElement(ct,{role:"tooltip",className:g,floatingElementOffset:b,motionSettings:N,isActive:E?d:h,onOverlayUpdate:w,autoHideMs:m,usePortal:v,placement:o,interactions:i,renderOverlay:()=>a.createElement(mt,{size:s,arrowPosition:dt[o],maxWidth:r},c())},e)},pt=({as:e="div",children:t,compact:l=!1,size:n="md",className:i,...o})=>{const r=e,s=x({[`maxio-body-${n}`]:!l,[`maxio-body-${n}-compact`]:l},i);return a.createElement(r,{className:s,...o},t)},vt=({className:e,render:t,showSelectAll:l=!1,...n})=>a.createElement(te,{...n,className:le(e,e=>x("maxio-listbox",e)),render:(e,n)=>{const{selectionManager:i}=n.state,o=t?t(e,n):a.createElement("div",{...e});if("multiple"!==i.selectionMode||!l)return o;if(0===[...i.collection.getKeys()].filter(e=>{const a=i.collection.getItem(e);return"item"===(null==a?void 0:a.type)&&i.canSelectItem(e)}).length)return o;const r=i.isSelectAll,s=r&&i.disallowEmptySelection;return a.createElement("div",null,a.createElement("div",{className:"maxio-listbox__select-all"},a.createElement(Xe,{type:"button",variant:"ghost",trailingElement:a.createElement(Ve,{variant:r?"check":""}),fullWidth:!0,"aria-pressed":r,disabled:s,onClick:()=>i.toggleSelectAll()},"Select all")),o)}});vt.displayName="ListBox";const gt=({className:e,...t})=>{const l=t.textValue||("string"==typeof t.children?t.children:void 0);return a.createElement(ne,{...t,textValue:l,className:x("maxio-listbox__item",e)},le(t.children,(e,{isSelected:t})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-listbox__content"},"string"==typeof e?a.createElement(pt,{size:"sm"},e):e),t&&a.createElement(Ve,{variant:"check"}))))};gt.displayName="ListBox.Item";const xt=({className:e,...t})=>a.createElement(ie,{...t,className:x("maxio-listbox__section",e)});xt.displayName="ListBox.Section";const bt=({className:e,...t})=>a.createElement(oe,{...t,className:x("maxio-listbox__header",e)});bt.displayName="ListBox.Header";const ht=Object.assign(vt,{Item:gt,Section:xt,Header:bt}),ft=({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,leadingElement:s=null,fullWidth:c,className:m,placeholder:d,renderEmptyState:u,selectionMode:p,children:v,...g})=>{const b=a.useRef(null),h=a.useRef(null),[f,E]=a.useState(),[_,w]=a.useState(0),N=!!r,y=t||N,I=v,k=a.useCallback(()=>{const e=b.current;if(!e)return;const a=h.current,t=a?a.getBoundingClientRect().left-e.getBoundingClientRect().left:0;w(e=>e===-t?e:-t),E(a=>{const t=`${e.offsetWidth}px`;return(null==a?void 0:a["--trigger-width"])===t?a:{"--trigger-width":t}})},[]);a.useEffect(()=>{const e=b.current;if(!e)return;if(k(),"undefined"==typeof ResizeObserver)return;const a=new ResizeObserver(k);return a.observe(e),()=>a.disconnect()},[k]);const R=x("maxio-text-field",`maxio-text-field--${n}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":y,"maxio-text-field--readonly":l,"maxio-text-field--full-width":c},m);return a.createElement(re,{...g,isDisabled:e,isInvalid:y,isReadOnly:l,selectionMode:p,className:R},i&&a.createElement(se,{className:"maxio-text-field__label"},i),a.createElement("div",{ref:b,className:"maxio-text-field__items"},s&&a.createElement("div",{className:"maxio-text-field__leading-element"},s),a.createElement(ce,{ref:h,className:"maxio-text-field__input",placeholder:d}),a.createElement("div",{className:"maxio-text-field__trailing-element"},a.createElement(U,{className:x("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},a.createElement(Ve,{variant:"chevron-up-down"})))),o&&!N&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},e=>a.createElement(a.Fragment,null,a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},"function"==typeof r?r(e):r))),a.createElement(Wa,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:_,style:f},a.createElement(ht,{renderEmptyState:u},I)))};ft.displayName="ComboBox";const Et=e=>a.createElement(ht.Item,{...e});Et.displayName="ComboBox.Item";const _t=e=>a.createElement(ht.Section,{...e});_t.displayName="ComboBox.Section";const wt=e=>a.createElement(ht.Header,{...e});wt.displayName="ComboBox.Header";const Nt=Object.assign(ft,{Item:Et,Section:_t,Header:wt}),yt=s({}),It=({indent:e=!1,disabled:l=!1,invalid:n=!1,label:i,...o})=>{const r=t(null),s=m(yt),{inputProps:c,isDisabled:d}=k({...o,value:(o.value||"").toString(),"aria-label":o["aria-label"]||i,isDisabled:l},s,r),u=x("maxio-radio",{"maxio-radio--indent":e,"maxio-radio--disabled":d||s.isDisabled,"maxio-radio--error":n||s.isInvalid});return a.createElement("label",{className:u},a.createElement("input",{ref:r,role:"radio",type:"radio",className:"maxio-radio__input",...c,name:s.name||c.name}),a.createElement("span",{className:"maxio-radio__control"}),a.createElement("span",{className:"maxio-radio__label"},i))},kt=({children:e,label:t,errorMessage:l,helperText:n,disabled:i=!1,invalid:o=!1,name:r,defaultValue:s,...c})=>{const m=Me({isDisabled:i,isInvalid:o,description:n,name:r,label:t,errorMessage:l,defaultValue:s,...c}),{radioGroupProps:d,labelProps:u,descriptionProps:p,errorMessageProps:v}=R({"aria-label":c["aria-label"]||t,...c},m);return a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-radio-group",...d},t&&a.createElement("label",{className:"maxio-radio-group__label",...u},t),a.createElement(yt.Provider,{value:m},e),o&&l&&a.createElement(Ba,{...v},l),n&&!o&&a.createElement(za,{...p},n)))},Rt=i(({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,leadingElement:s=null,trailingElement:c=null,fullWidth:m,className:d,...u},p)=>{const v=x("maxio-text-field",`maxio-text-field--${n}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":t,"maxio-text-field--readonly":l,"maxio-text-field--full-width":m},d);return a.createElement(ue,{...u,isDisabled:e,isReadOnly:l,isInvalid:t,className:v},i&&a.createElement(se,{className:"maxio-text-field__label"},i),a.createElement("div",{className:"maxio-text-field__items"},s&&a.createElement("div",{className:"maxio-text-field__leading-element"},s),a.createElement(ce,{ref:p,className:"maxio-text-field__input"}),c&&a.createElement("div",{className:"maxio-text-field__trailing-element"},c)),o&&!(t&&r)&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},r)))});Rt.displayName="TextField";const Ct=i(({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,fullWidth:s,className:c,...m},d)=>{const u=x("maxio-text-area",`maxio-text-area--${n}`,{"maxio-text-area--disabled":e,"maxio-text-area--error":t,"maxio-text-area--readonly":l,"maxio-text-area--full-width":s},c);return a.createElement(ue,{...m,isDisabled:e,isReadOnly:l,isInvalid:t,className:u},i&&a.createElement(se,{className:"maxio-form-label"},i),a.createElement(pe,{ref:d,className:"maxio-text-area__input"}),o&&!(t&&r)&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},r)))});Ct.displayName="TextArea";const St=i(({disabled:e=!1,invalid:n=!1,readOnly:i=!1,size:o="md",label:r,helperText:s,showErrorMessage:c=!0,errorMessage:m,leadingElement:d=null,trailingElement:u=null,fullWidth:p,className:v,...b},h)=>{var f,E;const _=t(null);g(h,()=>_.current),l(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:w,...N}=b,y={...N,label:r,description:s,errorMessage:m,defaultValue:null===(f=b.defaultValue)||void 0===f?void 0:f.toString(),value:null===(E=b.value)||void 0===E?void 0:E.toString(),isDisabled:e,isReadOnly:i,isInvalid:n},{labelProps:I,inputProps:k,descriptionProps:R,errorMessageProps:S}=C(y,_),P=x("maxio-text-field",`maxio-text-field--${o}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":n,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},v),$=n&&m&&c;return a.createElement("div",{className:P},r&&a.createElement("label",{className:"maxio-text-field__label",...I},r),a.createElement("div",{className:"maxio-text-field__items"},d&&a.createElement("div",{className:"maxio-text-field__leading-element"},d),a.createElement("input",{ref:_,type:"text",className:"maxio-text-field__input",...k,spellCheck:w}),u&&a.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!$&&a.createElement("div",{className:"maxio-form-helper-text",...R},s),$&&a.createElement(Ba,{...S},m))});St.displayName="TextInput";const Pt=({options:e,label:t,size:l="md",inline:n=!1,disabled:i=!1,helperText:o,errorMessage:r,fullWidth:s=!1,...c})=>{const m=x("maxio-select",`maxio-select--${l}`,{"maxio-select--disabled":i,"maxio-select--inline":n,"maxio-select--error":!!r,"maxio-select--full-width":s}),d=b();return a.createElement("div",{className:m},t&&a.createElement("label",{htmlFor:d,className:"maxio-select__label"},t),a.createElement("div",{className:"maxio-select__input-container"},a.createElement("select",{id:d,className:"maxio-select__input",disabled:i,...c},e.map(e=>a.createElement("option",{key:`option-${e.value}`,value:e.value,disabled:e.disabled},e.label))),a.createElement(Ve,{variant:"chevron-up-down"})),!!r&&a.createElement(Ba,null,r),o&&!r&&a.createElement("div",{className:"maxio-form-helper-text"},o))},$t=({size:e="md",onChange:t,totalItems:i=0,itemsPerPage:o=30,currentPage:r=1,pageSizeOptions:s,manualPageInput:c=!1})=>{const[m,d]=n(r),[u,p]=n(o),[v,g]=n(r.toString());l(()=>{g(m.toString())},[m]);const x=Math.ceil(i/u),b=m<x,h=m>1,f=u*(m-1)+1,E=Math.min(u*m,i),_=s.map(e=>({label:e.toString(),value:e.toString()})),w=Array.from({length:x},(e,a)=>a+1).map(e=>({label:e.toString(),value:e.toString()})),N=e=>{d(e),null==t||t({currentPage:e,itemsPerPage:u})},y=e=>{const a=parseInt(e,10);if(isNaN(a))return void g(m.toString());const t=Math.max(1,Math.min(a,x));g(t.toString()),N(t)};return a.createElement("div",{className:"maxio-pagination"},a.createElement("div",{className:"maxio-pagination__items-per-page"},a.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),a.createElement(Pt,{inline:!0,size:e,options:_,onChange:e=>{return a=Number(e.target.value),p(a),d(1),void(null==t||t({currentPage:1,itemsPerPage:a}));var a},value:u,id:"items-per-page-large"})),a.createElement("div",{className:"maxio-pagination__total-items"},a.createElement("span",null,f,"–",E," of ",i," items")),a.createElement("div",{className:"maxio-pagination__current-page"},c?a.createElement(St,{className:"maxio-pagination__page-input",value:v,min:1,max:x,onChange:e=>(e=>{g(e)})(e),onBlur:e=>{y(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(y(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:e,type:"number",onWheel:e=>e.preventDefault()}):a.createElement(Pt,{inline:!0,size:e,"aria-label":"Select page",onChange:e=>N(Number(e.target.value)),value:m,options:w,id:"page-index-large"}),a.createElement("div",{className:"maxio-pagination__label"},"of ",x," pages")),a.createElement("div",{className:"maxio-pagination__controls"},a.createElement(ut,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(Qe,{icon:a.createElement(Ve,{variant:"chevron-left"}),size:e,variant:"ghost",onClick:()=>N(m-1),"aria-label":"Previous",disabled:!h})),a.createElement(ut,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(Qe,{icon:a.createElement(Ve,{variant:"chevron-right"}),size:e,variant:"ghost",onClick:()=>N(m+1),"aria-label":"Next",disabled:!b}))))},Dt=({label:e,helperText:t,size:l="md",variant:n="default",status:i,value:o,maxValue:r=100})=>{const s=b(),c=b(),m=i&&!!e&&!!o&&!("inline"===n),d=t&&!("inline"===n),u=t&&"inline"===n,{progressBarProps:p,labelProps:v}=S({maxValue:r,value:o,label:e}),g=x("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===l,"maxio-progress-bar--success":o&&!("inline"===n)&&"success"===i,"maxio-progress-bar--error":o&&!("inline"===n)&&"error"===i,"maxio-progress-bar--indent":"indent"===n,"maxio-progress-bar--inline":"inline"===n,"maxio-progress-bar--indeterminate":void 0===o});return a.createElement("div",{className:g,...p},a.createElement("div",{id:s,className:"maxio-progress-bar__label",...v},e),u&&a.createElement("div",{id:c,className:"maxio-progress-bar__helper-text"},t),a.createElement("div",{className:"maxio-progress-bar__track"},a.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${o}%`}})),m&&a.createElement("div",{className:`maxio-progress-bar__${i}-icon`}),d&&a.createElement("div",{id:c,className:"maxio-progress-bar__helper-text"},t))},Tt=({className:e,size:t="md",fullWidth:l=!1,selectionMode:n="single",orientation:i="horizontal",disallowEmptySelection:o=!0,...r})=>a.createElement(ve,{...r,selectionMode:n,orientation:i,disallowEmptySelection:o,className:le(e,e=>x("maxio-segmented-control",`maxio-segmented-control--${t}`,{"maxio-segmented-control--full-width":l},e))});Tt.displayName="SegmentedControl";const Mt=({className:e,children:t,...l})=>a.createElement(ge,{...l,className:le(e,e=>x("maxio-segmented-control__item",e))},le(t,e=>a.createElement(a.Fragment,null,a.createElement(xe,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),e)));Mt.displayName="SegmentedControl.Item";const Ot=Object.assign(Tt,{Item:Mt}),zt=({leadingIcon:e,trailingIcon:t,type:l="menu",children:n,leadingIconClassName:i,isTooltipVisible:o=!1})=>a.createElement(a.Fragment,null,e&&a.createElement(ut,{usePortal:!0,isVisible:o,renderContent:()=>n,floatingElementOffset:12},a.createElement("span",{className:"maxio-side-nav__icon"},a.createElement(Ve,{variant:e,className:i}))),a.createElement("span",{className:`maxio-side-nav__${l}-title`,"data-testid":"maxio-sidebar-section-name"},n),t&&a.createElement("span",{className:"maxio-side-nav__menu-chevron"},a.createElement(Ve,{variant:t}))),Bt=e=>"heading"!==e.type,At=e=>{const a=(e=>e.flat().filter(Bt).map(e=>e.items).flat().find(e=>null==e?void 0:e.isCurrent))(e);return a?e.map(e=>e.map(e=>{var t;return Bt(e)&&(null===(t=e.items)||void 0===t?void 0:t.includes(a))?{...e,isOpen:!0}:e})):e},Lt=s({}),Wt=()=>m(Lt),Ft=({children:e,isOpen:i,onChange:o,withIcons:r=!0,sections:s,shouldToggleSidebar:c=!0,topDropdownItems:m,collapseBreakpoint:d=800})=>{const u=t(!1),[p,v]=n(()=>!c||("boolean"==typeof i?i:"undefined"==typeof window||window.innerWidth>d)),[g,x]=n(()=>At(s)),{windowWitdh:b}=rt(200);l(()=>{u.current&&(null==o||o(p))},[p,o]),l(()=>{u.current=!0},[]),l(()=>{!function(e){if(!c)return;e<d&&p&&h()}(b)},[b]),l(()=>{"boolean"==typeof i&&v(i)},[i]);const h=()=>{v(!1)};return a.createElement(Lt.Provider,{value:{sections:g,topDropdownItems:m,onSectionOpen:e=>{x(a=>a.map(a=>a.map(a=>Bt(a)?{...a,isOpen:(null==a?void 0:a.name)===e&&!a.isOpen}:a)))},isOpen:p,onOpen:()=>{v(!0)},onClose:h,withIcons:r,shouldToggleSidebar:c}},e)},Ht=()=>{const{onOpen:e,topDropdownItems:l,isOpen:n}=Wt(),{mainItem:i,otherItems:o,actions:r}=l,s=t(null),c=ot(s),m=({id:e,title:a,icon:t,iconClass:l,url:n,...i})=>({id:e,label:a,leadingIconName:t,leadingIconClassName:l,link:{href:n,...i}}),{items:d,itemsCount:p}=u(()=>({itemsCount:o.length+r.length,items:[...o.map(m),(null==o?void 0:o.length)>0&&(null==r?void 0:r.length)>0?{type:"divider",id:"item-divider"}:null,...r.map(m)].filter(e=>null!=e)}),[r,o]);return a.createElement(a.Fragment,null,0===p?a.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:i.url,onClick:e},a.createElement("span",{className:"maxio-side-nav__menu-title"},i.title)):a.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},a.createElement("summary",{onClick:e,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:s},i.url?a.createElement(a.Fragment,null,a.createElement(zt,{type:"menu",isTooltipVisible:!n&&c,leadingIcon:i.icon,trailingIcon:"chevron-up-down",leadingIconClassName:i.iconClass},i.title)):a.createElement(zt,{type:"menu",trailingIcon:"chevron-up-down"},i.title)),a.createElement(qe,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:d,small:!0})))},Vt=({section:e})=>{const{isOpen:l,withIcons:n}=Wt(),i=t(null),o=ot(i);return a.createElement("li",{className:"maxio-side-nav__item","data-key":e.key,"data-testid":"maxio-sidebar-section"},a.createElement("a",{className:"maxio-side-nav__link","aria-current":e.isCurrent?"page":void 0,role:"button",href:e.href,ref:i},a.createElement(zt,{isTooltipVisible:o&&!l,type:"menu",leadingIcon:n?e.icon:void 0},e.name)))},jt=({section:e})=>{var l,n;const{onOpen:i,onSectionOpen:o,isOpen:r,withIcons:s}=Wt(),c=t(null),m=ot(c);if(!Bt(e))return a.createElement("li",{className:"maxio-side-nav__item-header"},e.title);return e.Component?a.createElement(e.Component,{section:e}):e.href?a.createElement(Vt,{section:e}):a.createElement("li",{className:x("maxio-side-nav__item",{"maxio-side-nav__item--icon":s}),"data-testid":"maxio-sidebar-section"},a.createElement("button",{className:"maxio-side-nav__menu-button",ref:c,"aria-expanded":e.isOpen?"true":"false",type:"button",onClick:()=>{o(e.name),i()}},a.createElement(zt,{type:"menu",isTooltipVisible:!r&&m,leadingIcon:s?e.icon:void 0,trailingIcon:(null===(l=e.items)||void 0===l?void 0:l.length)?"chevron-down":void 0},e.name)),a.createElement("ul",{className:"maxio-side-nav__menu"},null===(n=e.items)||void 0===n?void 0:n.map(e=>a.createElement("li",{key:`section-sub-item-${e.name}`,className:"maxio-side-nav__item","data-testid":"maxio-section-item"},a.createElement("a",{className:"maxio-side-nav__link",href:e.href,"aria-current":e.isCurrent?"page":void 0},a.createElement("span",{className:"maxio-side-nav__link-title"},e.name))))))},Kt=()=>{const{sections:e}=Wt();return a.createElement(a.Fragment,null,e.map((e,t)=>a.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${t}`},e.map((e,l)=>a.createElement(jt,{key:`section-list-item-${e.type}-${t}-${l}`,section:e})))))},qt=()=>{const{onClose:e,shouldToggleSidebar:t}=Wt();return a.createElement("div",{className:"maxio-side-nav__logo-container"},a.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),t&&a.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":"toggle sidebar",onClick:e},a.createElement(Ve,{variant:"sidebar"})))},Ut=()=>{const{isOpen:e}=Wt();return a.createElement("nav",{className:x("maxio-side-nav",{"maxio-side-nav--collapsed":!e})},a.createElement(qt,null),a.createElement(Ht,null),a.createElement("div",{className:"maxio-side-nav__items-container"},a.createElement(Kt,null)))},Gt=({withIcons:e=!0,shouldToggleSidebar:t=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:o,onChange:r})=>a.createElement(Ft,{isOpen:o,onChange:r,collapseBreakpoint:i,withIcons:e,shouldToggleSidebar:t,topDropdownItems:l,sections:n},a.createElement(Ut,null)),Zt=({disabled:e=!1,value:t=0,className:l,id:n,isCurrent:i,...o})=>{const r="icon"===o.type,s=({isSelected:a})=>x("maxio-tabs__tab",l,{"maxio-tabs__tab--active":a,"maxio-tabs__tab--disabled":e,"maxio-tabs__tab--icon":r});if("icon"===o.type){const{icon:l,...n}=o;return a.createElement(be,{id:t,isDisabled:e,...n,className:s},a.createElement("div",{className:"maxio-tabs__tab__content"},l))}const{children:c,rightIcon:m,...d}=o;return a.createElement(be,{id:t,isDisabled:e,...d,className:s},a.createElement("div",{className:"maxio-tabs__tab__content"},c,m||null))},Yt=s({variant:"line",withDivider:!1}),Xt=({children:e,variant:t="line",withDivider:l=!1})=>a.createElement(Yt.Provider,{value:{variant:t,withDivider:l}},e),Qt=({children:e,variant:t="line",withDivider:l=!1,defaultIndex:n=0,index:i,onChange:o})=>a.createElement(he,{className:"maxio-tabs-container",selectedKey:i,defaultSelectedKey:n,onSelectionChange:e=>null==o?void 0:o(Number(e))},a.createElement(Xt,{variant:t,withDivider:l},e)),Jt=({children:e,value:t,className:l,id:n,...i})=>a.createElement(fe,{id:t,className:x("maxio-tabs__panel",l),...i},e),el=({children:e})=>{const t=d.map(e,(e,a)=>{if(!r(e)||e.type!==Jt)throw new Error("You can only pass <TabPanel /> component as children");return o(e,{key:a,value:a})});return a.createElement(Ee,{className:"maxio-tabs__panels"},t)},al=({children:e,className:l,ariaLabel:i,overflow:s="none",moreLabel:u="More",...p})=>{const{variant:g,withDivider:b}=m(Yt),h=m(_e),f=c(),[E,_]=n(!1),w=x("maxio-tabs",l,{"maxio-tabs--contained":"contained"===g,"maxio-tabs--divider":b}),N=d.map(e,e=>e);(null!=N?N:[]).forEach(e=>{if(!r(e)||e.type!==Zt)throw new Error("You can only pass <Tab /> component as children")});const y="auto"===s&&!!(null==N?void 0:N.length),{ref:I,moreButtonRef:k,overflowIndexes:R,handleKeyDownCapture:C}=(({overflowEnabled:e,childrenArray:a})=>{const l=t(null),i=t(null),o=t(null),[r,s]=n(null),c=st(l),d=m(_e),u=null!=(null==d?void 0:d.selectedKey)?Number(d.selectedKey):null,[p,g]=n([]);v(()=>{var t;if(!e||!r)return void g((null!=a?a:[]).map((e,a)=>a));const{visibleIndexes:l}=((e,a,t,l)=>{const n=e.map((e,a)=>a);if(e.reduce((e,a)=>e+a,0)<=a)return{visibleIndexes:n,overflowIndexes:[]};const i=[];let o=t;for(const t of n){if(o+e[t]>a)break;o+=e[t],i.push(t)}if(null!==l&&!i.includes(l)){for(o+=e[l];o>a&&i.length>0;)o-=e[i.pop()];i.push(l)}i.sort((e,a)=>e-a);const r=n.filter(e=>!i.includes(e));return{visibleIndexes:i,overflowIndexes:r}})(r.tabWidths,c,r.moreButtonWidth,null!==(t=o.current)&&void 0!==t?t:u);l.length===(null!=a?a:[]).length&&(o.current=null),g(l)},[e,r,c]),v(()=>{e&&r&&null!==u&&g(e=>(e.includes(u)||(o.current=u),((e,a,t,l,n)=>{if(e.includes(n))return e;const i=[...e,n].sort((e,a)=>e-a);let o=l+i.reduce((e,t)=>e+a[t],0);for(;o>t&&i.length>1;){const e=i.length-1,t=i[e]===n?e-1:e,[l]=i.splice(t,1);o-=a[l]}return i})(e,r.tabWidths,c,r.moreButtonWidth,u)))},[u]);const x=e?(null!=a?a:[]).map((e,a)=>a).filter(e=>!p.includes(e)):[],b=((e,a)=>e.filter(e=>{var t;return!(null===(t=null==a?void 0:a[e])||void 0===t?void 0:t.props.disabled)}))(p,a);v(()=>{var t,n;if(!e||!l.current)return void s(e=>null===e?e:null);const o=Array.from(l.current.querySelectorAll('[role="tab"]')),r=null!==(n=null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect().width)&&void 0!==n?n:0;s(e=>{var t;const l=(null!=a?a:[]).map((a,t)=>{var l,n,i;const r=null!==(n=null===(l=o[t])||void 0===l?void 0:l.getBoundingClientRect().width)&&void 0!==n?n:0;return r>0?r:null!==(i=null==e?void 0:e.tabWidths[t])&&void 0!==i?i:0}),n=r>0?r:null!==(t=null==e?void 0:e.moreButtonWidth)&&void 0!==t?t:0,i=(null==e?void 0:e.tabWidths.length)===l.length&&e.tabWidths.every((e,a)=>e===l[a]);return e&&i&&e.moreButtonWidth===n?e:{tabWidths:l,moreButtonWidth:n}})},[a,e]);const h=e=>{var a,t;void 0!==e&&(null==d||d.selectionManager.setFocused(!0),null==d||d.selectionManager.setFocusedKey(e),null==d||d.setSelectedKey(e),null===(t=null===(a=l.current)||void 0===a?void 0:a.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===t||t.focus())};return{ref:l,moreButtonRef:i,visibleIndexes:p,overflowIndexes:x,handleKeyDownCapture:e=>{var a;if(0===x.length)return;const t=document.activeElement===i.current,l=null==d?void 0:d.selectionManager.focusedKey,n=t?-1:b.indexOf(Number(l));if(t||-1!==n)switch(e.key){case"ArrowRight":if(t)return;return e.preventDefault(),e.stopPropagation(),void(n<b.length-1?h(b[n+1]):null===(a=i.current)||void 0===a||a.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(t?h(b[b.length-1]):n>0&&h(b[n-1]));case"Home":if(t)return;return e.preventDefault(),e.stopPropagation(),void h(b[0]);case"End":if(t)return;return e.preventDefault(),e.stopPropagation(),void h(b[b.length-1])}}}})({overflowEnabled:y,childrenArray:N}),S=a.createElement("span",{className:"maxio-tabs__tab__content"},u,a.createElement(Ve,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),P=R.map(e=>{return`#${a=f,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(a):a.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var a});return a.createElement("div",{id:f,className:w,ref:I,onKeyDownCapture:C},P.length>0&&a.createElement("style",null,`${P.join(", ")} { display: none; }`),a.createElement(we,{"aria-label":i,className:"maxio-contents",...p},(null!=N?N:[]).map((e,a)=>o(e,{key:a,value:a}))),y&&R.length>0&&a.createElement(Y,{isOpen:E,onOpenChange:_},a.createElement(U,{ref:k,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":u},S),E&&a.createElement(Wa,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},a.createElement(X,{"aria-label":`${u} tabs`,onAction:e=>{null==h||h.setSelectedKey(e),requestAnimationFrame(()=>{var a,t;null===(t=null===(a=I.current)||void 0===a?void 0:a.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===t||t.focus()})}},R.map(e=>{const t=N[e],{disabled:l,type:n,"aria-label":i,"aria-labelledby":o}=t.props,r="icon"===n?t.props.icon:t.props.children;return a.createElement(Q,{key:e,id:e,isDisabled:!!l,"aria-label":i,"aria-labelledby":o,className:"maxio-tabs__more__item"},r)})))))},tl=({children:e,size:t,sentiment:l,kind:n="primary",leadingIcon:i,trailingIcon:o})=>{const r=x("maxio-tag",`maxio-tag--${n}`,!!l&&`maxio-tag--${l}`,!!t&&`maxio-tag--${t}`);return a.createElement("div",{className:r},i&&a.createElement(Ve,{variant:i,className:"maxio-tag__icon"}),a.createElement("span",{className:"maxio-tag__label"},e),o&&a.createElement(Ve,{variant:o,className:"maxio-tag__icon"}))},ll=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__header",t),...l},e);ll.displayName="Card.Header";const nl=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__body",t),...l},e);nl.displayName="Card.Body";const il=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__footer",t),...l},e);il.displayName="Card.Footer";const ol=({children:e,className:t,variant:l="primary",...n})=>a.createElement("div",{className:x("maxio-card",`maxio-card--${l}`,t),...n},e);ol.displayName="Card";const rl=Object.assign(ol,{Header:ll,Body:nl,Footer:il}),sl=({children:e,className:t,href:l,onClick:n,target:i,disabled:o})=>{const r=l||n;if(!r)return a.createElement("div",{className:"maxio-tile"},e);const s=x("maxio-tile",t,{"maxio-tile--clickable":r,"maxio-tile--disabled":o});return a.createElement("a",{className:s,href:l,target:i,onClick:e=>{o&&l&&e.preventDefault(),!o&&n&&n()}},e)};var cl,ml,dl,ul;function pl(){return pl=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var l in t)({}).hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},pl.apply(null,arguments)}const vl=a=>e.createElement("svg",pl({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},a),cl||(cl=e.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),ml||(ml=e.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),dl||(dl=e.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),ul||(ul=e.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),gl=e=>{const{size:t="sm",className:l,variant:n="lockup",alt:i="maxio logo"}=e,o="mark"===n,r="number"==typeof t;return a.createElement(vl,{role:"img",viewBox:o?"0 0 240 240":"0 0 1036 240","aria-label":i,height:r?t:void 0,className:x("maxio-logo",!r&&`maxio-logo--${t}`,o&&"maxio-logo--mark",l)})},xl=({state:e,...l})=>{var n,i;const o=t(null),{toastProps:r,contentProps:s,titleProps:c,closeButtonProps:m}=Ae(l,e,o),{closable:d=!0,underline:u=!0,external:p=!1}=l.toast.content,v=x("maxio-toast",{[`maxio-toast--${l.toast.content.sentiment}`]:l.toast.content.sentiment}),g={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[l.toast.content.sentiment||"default"];return a.createElement("div",{className:v,"data-maxio-mode":"dark",...r,ref:o},a.createElement(Ve,{variant:g,className:"maxio-toast__icon"}),a.createElement("div",{className:"maxio-toast__container",...s},a.createElement("div",{className:"maxio-toast__content",...c},l.toast.content.title&&a.createElement("span",{className:"maxio-toast__title"},l.toast.content.title),l.toast.content.message&&a.createElement("span",{className:"maxio-toast__message"},l.toast.content.message),(null===(n=l.toast.content.link)||void 0===n?void 0:n.text)&&(null===(i=l.toast.content.link)||void 0===i?void 0:i.href)&&a.createElement(Ue,{href:l.toast.content.link.href,underline:u,external:p},l.toast.content.link.text))),d&&a.createElement(Qe,{variant:"ghost",icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss",...m}))},bl=({state:e,...t})=>{const l=a.useRef(null),{regionProps:n}=Le(t,e,l);return a.createElement("div",{...n,ref:l,className:t.className,style:{display:"flex",flexDirection:"column",gap:"10px"}},e.visibleToasts.map(t=>a.createElement(xl,{key:t.key,toast:t,state:e})))},hl=({children:e,...t})=>{const{maxVisibleToasts:l=5,...n}=t,i=Oe({maxVisibleToasts:l,...n});return a.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),a.createElement(a.Fragment,null,e(i),i.visibleToasts.length>0&&a.createElement(bl,{...t,state:i}))},fl=s(null),El=({children:e,toastQueue:t,...l})=>{const n=ze(t),i=p(()=>{n.visibleToasts.forEach(e=>{t.close(e.key)})},[n.visibleToasts,t]),o=u(()=>({addToast:t.add.bind(t),removeToast:t.clear.bind(t),removeAllToasts:i,state:n}),[t,i,n]);return a.createElement(fl.Provider,{value:o},e,n.visibleToasts.length>0&&a.createElement(bl,{...l,state:n}))},_l=()=>{const e=m(fl);if(!e)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return e};class wl extends Be{}const Nl=({defaultChecked:e,checked:t,onChange:l,disabled:n,valueDescription:i,valueDescriptionPosition:o,className:r,name:s,id:m,...d})=>{const u=c(),v="boolean"==typeof e,g=m||u,b="left"===o?"row":"row-reverse",h=i&&o,f=p(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const a=e.currentTarget.checked;v&&(e.currentTarget.checked=!a),l&&l(!a,e)}},[v,l]),E=d["aria-label"]||(h?void 0:i);return a.createElement("div",{className:x("maxio-toggle",r,{"maxio-toggle--disabled":n}),style:{display:"inline-flex",flexDirection:b},"data-testid":"toggle-container"},h?a.createElement("label",{className:"maxio-toggle__label",htmlFor:g},i):null,a.createElement("div",{className:"maxio-toggle__container"},a.createElement("input",{type:"checkbox",defaultChecked:e,checked:t,onChange:e=>{l&&l(e.target.checked,e)},onKeyDown:f,disabled:n,className:"maxio-toggle__checkbox",id:g,name:s,"aria-label":E}),a.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":t,"aria-hidden":"true"},a.createElement("div",{className:"maxio-toggle__handle"}),a.createElement("span",{className:"maxio-toggle__icon"},a.createElement("i",{className:"maxio-toggle__icon-on"})),a.createElement("span",{className:"maxio-toggle__icon"},a.createElement("i",{className:"maxio-toggle__icon-off"})))))},yl=({basis:e,flex:t,flexDirection:l,wrap:n,grow:i,shrink:o,gap:r,gapX:s,gapY:c,className:m,children:d,alignItems:u,justifyContent:p,...v})=>{const g=x("maxio-flex",{[`maxio-flex-${t}`]:t,[`maxio-basis-${e}`]:void 0!==e,[`maxio-flex-${l}`]:l,[`maxio-flex-${n}`]:n,"maxio-grow":i,"maxio-grow-0":!1===i,"maxio-shrink":o,"maxio-shrink-0":!1===o,[`maxio-gap-${r}`]:void 0!==r,[`maxio-gap-x-${s}`]:void 0!==s,[`maxio-gap-y-${c}`]:void 0!==c,[`maxio-items-${u}`]:u,[`maxio-justify-${p}`]:p},m);return a.createElement("div",{className:g,...v},d)},Il=({children:e,actions:t,sideNavIsClosed:l,openSideNav:n})=>a.createElement("nav",{className:"maxio-top-bar"},l&&a.createElement(Qe,{"aria-label":"Open Side Navigation",variant:"ghost",icon:a.createElement(Ve,{variant:"sidebar"}),onClick:n}),a.createElement(yl,{grow:!0,justifyContent:"end"},e),t),kl=({as:e="div",children:t,size:l="md",className:n,...i})=>{const o=e,r=x(`maxio-display-${l}`,n);return a.createElement(o,{className:r,...i},t)},Rl=({as:e="div",children:t,className:l,...n})=>{const i=e,o=x("maxio-code",l);return a.createElement(i,{className:o,...n},t)},Cl=({as:e="div",children:t,size:l="sm",className:n,...i})=>{const o=e,r=x(`maxio-label-${l}`,n);return a.createElement(o,{className:r,...i},t)},Sl=({...e})=>{const l=t(null),{buttonProps:n}=f(e,l);return a.createElement("button",{...n,className:"maxio-chip__dismiss-button"},a.createElement(Ve,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},Pl=({label:e,onDismiss:l,dismissLabel:n,leadingIcon:i,trailingIcon:o,title:r,...s})=>{const c=t(null),m=V(s),{buttonProps:d}=P(s,m,c),u=x("maxio-chip",{"maxio-chip--selected":null==m?void 0:m.isSelected}),p=x("maxio-chip__button",{"maxio-chip--dismissible":l});return a.createElement("div",{className:u},a.createElement("button",{className:p,ref:c,...d,title:r},i&&a.createElement(Ve,{variant:i,className:"maxio-chip__icon"}),a.createElement("span",{className:"maxio-chip__label"},e),o&&!l&&a.createElement(Ve,{variant:o,className:"maxio-chip__icon"})),l&&a.createElement(Sl,{onPress:l,"aria-label":n}))},$l=({children:e,templateColumns:t,templateRows:l,autoColumns:n,autoRows:i,inline:o,column:r,columnStart:s,columnEnd:c,row:m,rowStart:d,rowEnd:u,gap:p,gapX:v,gapY:g,className:b,justifyContent:h,alignItems:f,...E})=>{const _=x(b,{"maxio-grid":!o,"maxio-inline-grid":o,[`maxio-grid-cols-${t}`]:t,[`maxio-grid-rows-${l}`]:l,[`maxio-auto-cols-${n}`]:n,[`maxio-auto-rows-${i}`]:i,["maxio-col-"+("auto"===r?"auto":`span-${r}`)]:r,[`maxio-col-start-${s}`]:s,[`maxio-col-end-${c}`]:c,["maxio-row-"+("auto"===m?"auto":`span-${m}`)]:m,[`maxio-row-start-${d}`]:d,[`maxio-row-end-${u}`]:u,[`maxio-gap-${p}`]:void 0!==p,[`maxio-gap-x-${v}`]:void 0!==v,[`maxio-gap-y-${g}`]:void 0!==g,[`maxio-justify-${h}`]:h,[`maxio-items-${f}`]:f});return a.createElement("div",{className:_||void 0,...E},e)},Dl={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"},Tl=({children:e,heading:t,description:l,sentiment:n="success",leadingElement:i=null,alert:o,topAddon:r=null,footer:s})=>a.createElement("div",{className:"maxio-auth-layout"},a.createElement(yl,{alignItems:"center",justifyContent:"between"},a.createElement(gl,{size:"md"}),r),o&&a.createElement(Je,{display:"block",title:o.title,sentiment:o.sentiment},o.children),a.createElement(rl,{variant:"secondary"},a.createElement(rl.Body,null,a.createElement(yl,{flexDirection:"col",gap:6},a.createElement(yl,{flexDirection:"col",gap:2},a.createElement(yl,{alignItems:"center",gap:2},i,a.createElement(at,{size:"lg",className:x("maxio-auth-layout__heading",Dl[n])},t)),l&&a.createElement(yl,{style:{color:"var(--maxio-color-text-tertiary)"}},a.createElement(pt,{size:"sm",className:"maxio-auth-layout__description"},l))),e)),s&&a.createElement(rl.Footer,null,s)));export{qe as ActionList,Je as Alert,Tl as AuthLayout,ra as Avatar,sa as Banner,pt as Body,pa as Breadcrumbs,ca as BreadcrumbsItem,Xe as Button,rl as Card,Oa as Checkbox,Aa as CheckboxGroup,Pl as Chip,Rl as Code,Nt as ComboBox,Ja as DataTable,kl as Display,tt as Drawer,yl as Flex,Ba as FormErrorMessage,za as FormHelperText,El as GlobalToastProvider,$l as Grid,at as Heading,Ve as Icon,Qe as IconButton,Cl as Label,Ue as Link,ht as ListBox,Ge as LoadingSpinner,gl as Logo,na as Menu,oa as MenuButton,ia as MenuList,ct as OverlayTrigger,$t as Pagination,Wa as Popover,Dt as ProgressBar,It as Radio,kt as RadioGroup,Ot as SegmentedControl,Pt as Select,Gt as SideNav,Zt as Tab,al as TabList,Jt as TabPanel,el as TabPanels,Qt as Tabs,tl as Tag,Ct as TextArea,Rt as TextField,St as TextInput,sl as Tile,hl as ToastProvider,wl as ToastQueue,Nl as Toggle,mt as Tooltip,ut as TooltipTrigger,Il as TopBar,st as useElementResizeObserver,ot as useHover,it as useOverlayTrigger,_l as useToast,rt as useWindowSize};
|
|
1
|
+
import*as e from"react";import a,{useRef as t,useEffect as l,useState as n,forwardRef as i,cloneElement as o,isValidElement as r,createContext as s,useId as c,useContext as m,Children as d,useMemo as u,useCallback as p,useLayoutEffect as v,useImperativeHandle as g}from"react";import x from"classnames";import{useId as b,useLink as h,useButton as f,usePress as E,useFocusRing as _,mergeProps as w,useCheckboxGroupItem as N,useCheckbox as y,useCheckboxGroup as I,useRadio as k,useRadioGroup as R,useTextField as C,useProgressBar as S,useToggleButton as P}from"react-aria";import{useObjectRef as $,useResizeObserver as D}from"@react-aria/utils";import{flexRender as T,useReactTable as M,getSortedRowModel as O,getExpandedRowModel as z,getCoreRowModel as A}from"@tanstack/react-table";export{createColumnHelper}from"@tanstack/react-table";import{dropTargetForElements as B,draggable as L,monitorForElements as W}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/element/adapter.js";import{attachInstruction as F,extractInstruction as H}from"@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/tree-item.js";import{useToggleState as V}from"@react-stately/toggle";import{useCheckboxGroupState as j}from"@react-stately/checkbox";import{Popover as K,OverlayArrow as q,Button as U,TooltipTrigger as G,Tooltip as Z,MenuTrigger as Y,Menu as X,MenuItem as Q,ModalOverlay as J,Modal as ee,Dialog as ae,ListBox as te,composeRenderProps as le,ListBoxItem as ne,ListBoxSection as ie,Header as oe,ComboBox as re,Label as se,Input as ce,Text as me,FieldError as de,TextField as ue,TextArea as pe,ToggleButtonGroup as ve,ToggleButton as ge,SelectionIndicator as xe,Tab as be,Tabs as he,TabPanel as fe,TabPanels as Ee,TabListStateContext as _e,TabList as we}from"react-aria-components";export{DialogTrigger,Pressable}from"react-aria-components";import{AnimatePresence as Ne,motion as ye}from"framer-motion";import{useDismiss as Ie,useFocus as ke,useHover as Re,useClick as Ce,useFloating as Se,offset as Pe,useInteractions as $e,useRole as De,FloatingPortal as Te}from"@floating-ui/react-dom-interactions";import{useRadioGroupState as Me}from"@react-stately/radio";import{useToastState as Oe,useToastQueue as ze,ToastQueue as Ae}from"@react-stately/toast";import{useToast as Be,useToastRegion as Le}from"@react-aria/toast";const We=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],Fe=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],He=["avalara","pipedrive","quickbooks","salesforce","xero"],Ve=({variant:e,color:t,className:l,size:n})=>{const i=(e,a)=>a.includes(e),o=i(e,We)||i(e,Fe),r=i(e,He),s=x({"fa-kit":o,"fa-kit-duotone":r,"fa-sharp fa-regular":!o&&!r,[`fa-${e}`]:!0,[`fa-${n}`]:n,[`maxio-icon--${t}`]:t&&!i(e,Fe)&&!i(e,He)},l);return a.createElement("i",{className:s})},je=({item:e,isSelected:n,truncateLabel:i=!1,role:o="option",small:r=!1})=>{const s=t(null),c=t(!1),m=b();if(l(()=>{var e;n&&c.current&&(null===(e=s.current)||void 0===e||e.focus())},[n]),l(()=>{c.current=!0},[]),"divider"===e.type)return a.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:d,leadingIconClassName:u,trailingIconName:p,label:v,description:g,link:h}=e,f=x("maxio-action-list__label",{"maxio-truncate":i});return a.createElement("a",{"aria-labelledby":m,...h,className:x("maxio-action-list__content",h.className,{"maxio-action-list__content--size-small":r}),tabIndex:n?0:-1,ref:s,role:o},d&&a.createElement(Ve,{variant:d,className:x("maxio-action-list__leading-icon",u)}),a.createElement("span",{className:f,id:m},v),g&&a.createElement("span",{className:"maxio-action-list__description"},g),p&&a.createElement(Ve,{variant:p,className:"maxio-action-list__trailing-icon"}))},Ke=(e,a,t)=>0===e?e:1===e&&"divider"===a[e-1].type?t||e:"divider"===a[e-1].type?Ke(e-1,a,t||e):e-1,qe=({items:e,isShadowed:t=!0,itemProps:l={},className:i,truncateLabels:o=!1,small:r=!1,...s})=>{const c=x("maxio-action-list",i,{"maxio-action-list--shadow":t}),[m,d]=n(()=>e.findIndex(e=>"divider"!==e.type));return 0===e.length?null:a.createElement("div",{className:c,onKeyDown:a=>{if("Space"===a.code||"Enter"===a.code){const a=e[m];a&&"divider"!==a.type&&window.open(a.link.href,a.link.target||"_self")}"ArrowUp"===a.code&&(a.preventDefault(),d(a=>Ke(a,e))),"ArrowDown"===a.code&&(a.preventDefault(),d(a=>((e,a)=>{const t=a.findIndex((a,t)=>"divider"!==a.type&&t>e);return-1===t?e:t})(a,e)))},role:"listbox",...s},e.map((e,t)=>a.createElement(je,{item:e,truncateLabel:o,key:`listbox-${e.id}`,isSelected:t===m,small:r,...l})))},Ue=({className:e,children:t,disabled:l,external:n,icon:i,size:o="sm",underline:r,variant:s,...c})=>{const m=x("maxio-link",{[`maxio-link--${o}`]:o,"maxio-link--disabled":l,[`maxio-link--${s}`]:s,"maxio-link--underline":r},e),d=n?"_blank":"_self";return a.createElement("a",{className:m,target:d,...c},t,i&&a.createElement(Ve,{variant:i,className:"maxio-link__icon"}))},Ge=({size:e="md",white:t=!1,className:l})=>{const n=x("maxio-loading-spinner",l,`maxio-loading-spinner--${e}`,{"maxio-loading-spinner--white":t});return a.createElement("div",{className:n,role:"status","aria-label":"loading"})},Ze=i(({fullWidth:e=!1,leadingElement:t,trailingElement:l,icon:n,variant:i="primary",size:s,...c},m)=>{const d=$(m),{linkProps:u}=h({...c},d),p=x("maxio-button",c.className,{[`maxio-button--${s}`]:s,[`maxio-button--${i}`]:i,"maxio-button--full-width":e});return a.createElement("a",{...u,ref:d,className:p,href:c.href},t&&o(t,{...r(t)&&{className:"maxio-button__leading-element"}}),c.children,(l||n)&&o(l||n,{...r(l||n)&&{className:"maxio-button__trailing-element"}}))}),Ye=i(({disabled:e,loading:t=!1,fullWidth:l=!1,leadingElement:n,trailingElement:i,icon:s,variant:c="primary",size:m,...d},u)=>{const p=$(u),{buttonProps:v}=f({...d,isDisabled:e,formAction:"string"==typeof d.formAction?d.formAction:void 0},p),g=["primary","danger"].includes(c),b=x("maxio-button",d.className,{[`maxio-button--${m}`]:m,[`maxio-button--${c}`]:c,"maxio-button--loading":t,"maxio-button--full-width":l});return a.createElement("button",{...v,className:b,ref:p},n&&o(n,{...r(n)&&{className:"maxio-button__leading-element"}}),d.children,!t&&(i||s)&&o(i||s,{...r(i||s)&&{className:"maxio-button__trailing-element"}}),t&&a.createElement(Ge,{className:"maxio-button__trailing-element",size:"md",white:g}))}),Xe=i((e,t)=>(e=>"href"in e)(e)?a.createElement(Ze,{...e,ref:t}):a.createElement(Ye,{...e,ref:t})),Qe=({"aria-label":e,className:t,...l})=>a.createElement(Xe,{"aria-label":e,className:x("maxio-button--icon",t),...l},null),Je=({children:e,title:t,linkText:l,linkExternal:n,href:i,display:o="inline",sentiment:r="info",onDismiss:s,className:c})=>{if(!e&&!t)return console.warn("Alert component requires either children or title prop to be rendered"),null;const m=x("maxio-alert",{[`maxio-alert--${r}`]:"info"!==r&&r},c),d={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[r],u=x("maxio-alert__content",{"maxio-alert__content--block":"block"===o});return a.createElement("div",{className:m},a.createElement(Ve,{variant:d,className:"maxio-alert__icon","aria-hidden":"true"}),a.createElement("section",{className:"maxio-alert__container"},a.createElement("div",{className:u},t&&a.createElement("span",{className:"maxio-alert__title"},t),e&&a.createElement("span",{className:"maxio-alert__message"},e),l&&i&&a.createElement(Ue,{className:"maxio-alert__link",href:i,variant:"high-contrast",underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(Qe,{icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-alert__dismiss"}))},ea=s({}),aa=({children:e})=>{const[t,l]=n(!1),i=c(),o=c();return a.createElement(ea.Provider,{value:{controlsId:i,buttonId:o,isOpen:t,onClose:()=>l(!1),onOpen:()=>l(!0),onToggle:()=>l(e=>!e)}},e)};function ta(){const e=m(ea);if(!e||"object"==typeof e&&0===Object.keys(e).length)throw new Error("useMenu hook must be used within a MenuProvider");return e}const la=({children:e})=>{const{isOpen:t,onToggle:l,onClose:n}=ta();return a.createElement("details",{open:t,onToggle:l,className:"maxio-action-menu"},"function"==typeof e?e({isOpen:t,onClose:n}):e)},na=({children:e})=>a.createElement(aa,null,a.createElement(la,null,e)),ia=({items:e,alignItemsEnd:t=!1})=>{const l=x("maxio-action-menu__content",{"maxio-action-menu__content--align-end":t}),{controlsId:n,buttonId:i}=ta();return a.createElement("div",{className:l,role:"presentation"},a.createElement(qe,{role:"menu",itemProps:{role:"menuitem"},id:n,"aria-labelledby":i,items:e}))},oa=({children:e,iconName:t="chevron-down","aria-label":l,size:n="md",variant:i="secondary"})=>{const o=x({"maxio-action-menu__chevron":"chevron-down"===t}),r=x("maxio-button",`maxio-button--${i}`,`maxio-button--${n}`,{"maxio-button--icon":t&&!e}),{isOpen:s,buttonId:c,controlsId:m}=ta();return a.createElement("summary",{className:r,"aria-haspopup":"true","aria-label":l,"aria-expanded":s,"aria-controls":m,id:c},e&&a.createElement("span",null,e),t&&a.createElement(Ve,{variant:t,className:`${o} maxio-button__trailing-element`}))},ra=({className:e,src:t,alt:l="avatar"})=>a.createElement("img",{className:x("maxio-avatar",e),alt:l,src:t}),sa=({children:e,title:t,linkText:l,linkExternal:n,href:i,display:o="inline",sentiment:r="info",onDismiss:s,className:c})=>{if(!e&&!t)return console.warn("Banner component requires either children or title prop to be rendered"),null;const m=x("maxio-banner",{[`maxio-banner--${r}`]:"info"!==r&&r,className:c}),d={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[r],u=x("maxio-banner__content",{"maxio-banner__content--block":"block"===o});return a.createElement("div",{className:m,"aria-live":"assertive"},a.createElement(Ve,{variant:d,className:"maxio-banner__icon","aria-hidden":"true"}),a.createElement("section",{className:"maxio-banner__container"},a.createElement("div",{className:u},t&&a.createElement("span",{className:"maxio-banner__title"},t),e&&a.createElement("span",{className:"maxio-banner__message"},e),l&&i&&a.createElement(Ue,{href:i,..."warning"!==r&&{variant:"inverse"},underline:!0,...n?{external:!0}:{}},l))),s&&a.createElement(Qe,{icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:s,className:"maxio-banner__dismiss"}))},ca=({children:e,className:t,href:l,...n})=>{const i=l?a.createElement(Ue,{size:"sm",href:l},e):e;return a.createElement("li",{className:x("maxio-breadcrumbs__item",t),...n},i)},ma="Breadcrumbs requires at least one BreadcrumbsItem as children",da='Last BreadcrumbsItem should not have "href" prop. It is the current page.',ua="Breadcrumbs only accepts BreadcrumbsItem as children",pa=({className:e,children:t,...l})=>{const n=d.count(t);if(0===n)throw new Error(ma);const i=d.map(t,(e,a)=>{if(r(e)&&e.type===ca){if(a===n-1&&e.props.href)throw new Error(da);return o(e,{"aria-current":a===n-1?"page":void 0})}throw new Error(ua)});return a.createElement("nav",{"aria-label":"Breadcrumb",...l},a.createElement("ol",{className:x("maxio-breadcrumbs",e)},i))},va="row-controls",ga="row-actions",xa=({children:e,pattern:t,size:l,isExpandable:i,isUsingCustomRow:o})=>{const[r,s]=n(!1),[c,m]=n(!1),d=t&&o&&i,u=x("maxio-data-table",{"maxio-data-table--pattern":t&&!d,"maxio-data-table--expanded-child-pattern":d,"maxio-data-table--with-custom-row":o,[`maxio-data-table--${l}`]:l,"maxio-data-table--with-pinned-left-border":r,"maxio-data-table--with-pinned-right-border":c});return a.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const a=e.target;s(a.scrollLeft>0),m(a.scrollWidth-a.clientWidth-a.scrollLeft>0)}},a.createElement("table",{className:u},e))},ba=({children:e})=>a.createElement("thead",null,e),ha=({children:e})=>a.createElement("tbody",null,e),fa=({children:e,table:t,header:l,className:n,enableExpanding:i,...o})=>{var r,s,c,m,d,u,p,v,g,b,h;const f=null==l?void 0:l.column,E=null===(r=null==f?void 0:f.getCanSort)||void 0===r?void 0:r.call(f),_=null===(s=null==f?void 0:f.getToggleSortingHandler)||void 0===s?void 0:s.call(f),w=null==l?void 0:l.isPlaceholder,N=null===(m=null===(c=null==f?void 0:f.columnDef)||void 0===c?void 0:c.meta)||void 0===m?void 0:m.align,y=null===(u=null===(d=null==f?void 0:f.columnDef)||void 0===d?void 0:d.meta)||void 0===u?void 0:u.width,I=null===(v=null===(p=null==f?void 0:f.columnDef)||void 0===p?void 0:p.meta)||void 0===v?void 0:v.controls,k=null===(b=null===(g=null==f?void 0:f.columnDef)||void 0===g?void 0:g.meta)||void 0===b?void 0:b.actions,R=null==f?void 0:f.getIsPinned(),C=null==f?void 0:f.getIsSorted(),S="asc"===C,P=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${R}`]:R,"maxio-data-table__cell--sortable":E,"maxio-data-table__cell--active":C,[`maxio-data-table__cell--${N}`]:N,"maxio-data-table__cell--controls":I,"maxio-data-table__cell--actions":k}),$={...y?{width:y}:{},..."left"===R?{left:null==f?void 0:f.getStart("left")}:"right"===R?{right:null==f?void 0:f.getAfter("right")}:{}},D=((e,a)=>e&&a?"arrow-up":e&&!a?"arrow-down":"arrow-down-up")(!!C,S),T=null==t?void 0:t.getToggleAllRowsExpandedHandler(),M=null===(h=null==t?void 0:t.getIsAllRowsExpanded)||void 0===h?void 0:h.call(t),O=(null==l?void 0:l.headerGroup.headers[0].id)===va?1:0,z=i&&(null==l?void 0:l.index)===O;return w?null:a.createElement("th",{scope:"col",role:"columnheader","aria-sort":C?S?"ascending":"descending":"none",className:P,onClick:_,colSpan:null==l?void 0:l.colSpan,style:$,...o},a.createElement("div",{className:"maxio-data-table__cell-flex"},!0===i&&z&&a.createElement(Qe,{size:"sm",variant:"ghost",icon:a.createElement(Ve,{size:"xs",variant:M?"chevron-down":"chevron-right"}),onClick:T,"aria-label":M?"Collapse all rows":"Expand all rows","data-open":M,className:"maxio-data-table__expand-button"}),e,E&&a.createElement(Ve,{variant:D,className:"maxio-data-table__sort-icon"})))},Ea=e=>{var a;return null!==(a=e.subRows)&&void 0!==a?a:[]},_a=(e,a)=>Object.assign({},e,{subRows:a}),wa=(e,a,t=[])=>{for(let l=0;l<e.length;l+=1){const n=e[l],i=[...t,l];if(n===a)return i;const o=wa(Ea(n),a,i);if(o)return o}return null},Na=(e,a)=>{const[t,...l]=a,n=e[t];if(!n)return null;const i=[...e];if(0===l.length)return i.splice(t,1),{data:i,item:n};const o=Na(Ea(n),l);return o?(i[t]=_a(n,o.data),{data:i,item:o.item}):null},ya=(e,a,t,l)=>{const n=[...e];if(0===a.length)return n.splice(t,0,l),n;const[i,...o]=a,r=e[i];if(!r)return null;const s=ya(Ea(r),o,t,l);return s?(n[i]=_a(r,s),n):null},Ia=(e,a)=>{let t,l=e;for(const e of a){if(t=l[e],!t)return;l=Ea(t)}return t},ka="maxio-data-table-row",Ra=s(null),Ca=()=>m(Ra),Sa=e=>e.type===ka&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,Pa=e=>{const a=(e=>{const a=H(e);return a&&"instruction-blocked"!==a.type?"reorder-above"===a.type?"before":"reorder-below"===a.type?"after":"make-child"===a.type?"inside":null:null})(e);return"string"==typeof e.rowId&&a?{rowId:e.rowId,position:a}:null},$a=({availability:e,children:i,data:o,enableExpanding:r,getRowReorderLabel:s,onRowReorder:m,rowReorderMode:d,table:v})=>{const g=`maxio-data-table-${c()}`,[x,b]=n(""),[h,f]=n(null),[E,_]=n(null),w=t(null),N=p(e=>v.getCoreRowModel().rowsById[e],[v]),y=p(e=>{var a;return null!==(a=null==s?void 0:s(e))&&void 0!==a?a:e.id},[s]),I=p((e,a)=>{const t=N(e),l=N(a.rowId);if(!t||!l)return null;const n=((e,a,t,l,n)=>{var i,o;if(a.id===t.id||!((e,a,t,l)=>{var n,i;return"all"===l||("siblings"===l?"inside"!==t&&(null!==(n=e.parentId)&&void 0!==n?n:null)===(null!==(i=a.parentId)&&void 0!==i?i:null):"inside"===t?e.depth===a.depth+1:e.depth===a.depth)})(a,t,l,n))return null;const r=wa(e,a.original),s=wa(e,t.original);if(!r||!s||(m=s,(c=r).length<m.length&&c.every((e,a)=>m[a]===e)))return null;var c,m;const d=Na(e,r);if(!d)return null;const u=((e,a)=>{const t=[...e],l=a.length-1;return l>=0&&e.length>l&&a.slice(0,l).every((a,t)=>e[t]===a)&&a[l]<e[l]&&(t[l]-=1),t})(s,r),p=u[u.length-1];if(void 0===p)return null;const v="inside"===l?u:u.slice(0,-1),g=Ia(d.data,u);if(!g)return null;const x="inside"===l?Ea(g).length:p+("after"===l?1:0),b={parentRowId:"inside"===l?t.id:null!==(i=t.parentId)&&void 0!==i?i:null,index:x},h={parentRowId:null!==(o=a.parentId)&&void 0!==o?o:null,index:a.index};if(h.parentRowId===b.parentRowId&&h.index===b.index)return null;const f=ya(d.data,v,x,d.item);return f?{data:f,source:h,destination:b}:null})(o,t,l,a.position,d);return n&&!r&&null!==n.destination.parentRowId&&n.destination.parentRowId!==n.source.parentRowId?null:n},[o,r,N,d]),k=p(e=>{w.current=e,f(e)},[]),R=p((e,a)=>{const t=N(e),l=N(a.rowId),n=I(e,a);return t&&l&&n?(m({...n,row:t,rowId:t.id,targetRow:l,targetRowId:l.id,position:a.position}),b(`${y(t)} moved ${i=y(l),o=a.position,"inside"===o?`inside ${i}`:`${o} ${i}`}.`),!0):(b("That row cannot be moved to this position."),!1);var i,o},[y,I,N,m]),C=p((e,{input:a,element:t,source:l})=>{const n={rowId:e.id,instanceId:g},i=F(n,{element:t,input:a,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),o=Pa(i),r=Sa(l.data)&&l.data.instanceId===g&&Boolean(o&&I(l.data.rowId,o));return{...i,isValid:r}},[I,g]),S=p((a,t)=>{if(!e.available)return()=>{};const l=e=>{const a=e.isValid?Pa(e):null;k(a)};return B({element:t,canDrop:({source:e})=>Sa(e.data)&&e.data.instanceId===g&&e.data.rowId!==a.id&&!a.getParentRows().some(a=>a.id===e.data.rowId),getData:e=>C(a,e),onDragEnter:({self:e})=>l(e.data),onDrag:({self:e})=>l(e.data),onDragLeave:()=>{var e;(null===(e=w.current)||void 0===e?void 0:e.rowId)===a.id&&k(null)}})},[e,C,g,k]),P=p((a,t)=>{const l=t.closest("tr");return e.available&&l instanceof HTMLElement?L({element:l,dragHandle:t,getInitialData:()=>({type:ka,instanceId:g,rowId:a.id})}):()=>{}},[e,g]);l(()=>{if(e.available)return W({canMonitor:({source:e})=>Sa(e.data)&&e.data.instanceId===g,onDragStart:({source:e})=>{if(!Sa(e.data))return;const a=N(e.data.rowId);_(e.data.rowId),a&&b(`${y(a)} grabbed. Choose a destination.`)},onDrop:({source:e,location:a})=>{var t;if(Sa(e.data)){const l=null===(t=a.current.dropTargets[0])||void 0===t?void 0:t.data,n=!0===(null==l?void 0:l.isValid)?Pa(l):null;n?R(e.data.rowId,n):b("Row move cancelled.")}_(null),k(null)}})},[R,e,y,N,g,k]),l(()=>{if("inside"!==(null==h?void 0:h.position))return;const e=N(h.rowId);if(!(null==e?void 0:e.getCanExpand())||e.getIsExpanded())return;const a=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(a)},[h,N]);const $=p(a=>{var t;if(!e.available)return[];const l=a.parentId?N(a.parentId):null,n=null!==(t=null==l?void 0:l.subRows)&&void 0!==t?t:v.getCoreRowModel().rows,i=n.findIndex(e=>e.id===a.id);if(-1===i)return[];const o=n[i-1],r=n[i+1],s=n[0],c=n[n.length-1],m=[];if(i>1&&s&&m.push({id:"top",label:"Move to top",target:{rowId:s.id,position:"before"}}),o&&m.push({id:"up",label:"Move up",target:{rowId:o.id,position:"before"}}),r&&m.push({id:"down",label:"Move down",target:{rowId:r.id,position:"after"}}),i<n.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),l){let e=l;for(;e.parentId;){const a=N(e.parentId);if(!a)break;e=a}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return v.getCoreRowModel().flatRows.forEach(e=>{e.id!==a.parentId&&m.push({id:`move-to:${e.id}`,label:`Move to ${y(e)}`,target:{rowId:e.id,position:"inside"}})}),m.filter(e=>Boolean(I(a.id,e.target)))},[e,y,I,N,v]),D=p(a=>{var t;if(!e.available)return!1;const l=a.parentId?N(a.parentId):null;return(null!==(t=null==l?void 0:l.subRows)&&void 0!==t?t:v.getCoreRowModel().rows).length>1||"siblings"!==d&&("all"===d?Boolean(l):!(!r||0===a.depth)&&v.getCoreRowModel().flatRows.some(e=>e.depth===a.depth-1&&e.id!==a.parentId))},[e,r,N,d,v]),T=u(()=>({activeTarget:h,availability:e,draggingRowId:E,getActions:$,getLabel:y,hasActions:D,moveRow:R,registerHandle:P,registerRow:S}),[h,e,R,E,$,y,D,P,S]);return a.createElement(Ra.Provider,{value:T},i,a.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},x))},Da=({children:e,row:t,isChild:l,isHeader:n,className:i,onRowAction:o,...r})=>{var s,c,m,d,u;const p=null===(s=null==t?void 0:t.getIsSelected)||void 0===s?void 0:s.call(t),v=(null===(c=null==t?void 0:t.getCanExpand)||void 0===c?void 0:c.call(t))&&(null===(m=null==t?void 0:t.getIsExpanded)||void 0===m?void 0:m.call(t)),g=Boolean(t&&o&&!n&&!l),b=a.useRef(null),h=Ca(),f=null==h?void 0:h.registerRow,N=a.useRef(null),y=e=>{N.current=e.target},{pressProps:I}=E({isDisabled:!g,onPress:e=>{var a;const l=null!==(a=N.current)&&void 0!==a?a:e.target;N.current=null,t&&o&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(l)&&o(t)}}),{focusProps:k,isFocused:R}=_(),C=x({"maxio-data-table__row":!n,"maxio-data-table__header-row":n,"maxio-data-table__row--active":p||R,"maxio-data-table__row--expanded":v,"maxio-data-table__row--expanded-child":l,"maxio-data-table__row--actionable":g,"maxio-data-table__row--dragging":Boolean(t)&&(null==h?void 0:h.draggingRowId)===(null==t?void 0:t.id),[`maxio-data-table__row--drop-${null===(d=null==h?void 0:h.activeTarget)||void 0===d?void 0:d.position}`]:Boolean(t)&&(null===(u=null==h?void 0:h.activeTarget)||void 0===u?void 0:u.rowId)===(null==t?void 0:t.id)},i);a.useEffect(()=>{if(t&&f&&b.current&&!n&&!l)return f(t,b.current)},[l,n,f,t]);const S=g?w({onClickCapture:y,onKeyDownCapture:y,tabIndex:0},I,k,r):r;return a.createElement("tr",{...S,ref:b,className:C,tabIndex:g?S.tabIndex:r.tabIndex},e)},Ta=s({}),Ma=i(({checked:e,disabled:t,invalid:l,indeterminate:n,className:i,inputProps:o,error:r,label:s},c)=>{const m=x("maxio-checkbox",{"maxio-checkbox--checked":e,"maxio-checkbox--disabled":t,"maxio-checkbox--error":l,"maxio-checkbox--indeterminate":n},i);return a.createElement("label",{className:m},a.createElement("input",{type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:c,...o}),a.createElement("span",{className:"maxio-checkbox__control"},r&&a.createElement("span",{className:"maxio-checkbox__control-error"})),s&&a.createElement("span",{className:"maxio-checkbox__label"},s))});Ma.displayName="InnerCheckbox";const Oa=({label:e,error:l=!1,className:n,indeterminate:i,value:o="",disabled:r,readOnly:s,defaultChecked:c,checked:d,...u})=>{const p=t(null),v=m(Ta),{inputProps:g,isDisabled:x,isInvalid:b,isSelected:h}=v&&Object.keys(v).length>0?N({value:o,"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,...u},v,p):y({"aria-label":null!=e?e:u["aria-label"],isDisabled:r,isInvalid:l,isIndeterminate:i,isReadOnly:s,value:o,...u},V({...u,isSelected:d,defaultSelected:c}),p);return a.createElement(Ma,{inputProps:g,checked:h,disabled:x,invalid:b,indeterminate:i,className:n,error:l,label:e,ref:p,...u})},za=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-helper-text",t),...l},e),Aa=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-form-error",t),...l},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},e)),Ba=({helperText:e,className:t,errorMessage:l,children:n,disabled:i,label:o,defaultValue:r,name:s,...c})=>{var m;const d=j({defaultValue:r,name:s,errorMessage:l,description:e,label:o,isDisabled:i,isInvalid:!!l,...c}),{groupProps:u,labelProps:p,descriptionProps:v,errorMessageProps:g,isInvalid:b}=I({"aria-label":null===(m=null!=o?o:c["aria-label"])||void 0===m?void 0:m.toString(),isDisabled:i,isInvalid:!!l,...c},d),h=x("maxio-checkbox-group",{"maxio-checkbox-group--disabled":i},t),f=e&&!l;return a.createElement("div",{className:h,...u},o&&a.createElement("label",{className:"maxio-checkbox-group__label",...p},o),a.createElement(Ta.Provider,{value:d},n),f&&a.createElement(za,{...v},e),l&&b&&a.createElement(Aa,{...g},l))},La=({table:e,enableRowSelection:t,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==e?void 0:e.getToggleAllPageRowsSelectedHandler)||void 0===n?void 0:n.call(e),c=(null===(i=null==e?void 0:e.getIsAllPageRowsSelected)||void 0===i?void 0:i.call(e))||(null===(o=null==e?void 0:e.getIsAllRowsSelected)||void 0===o?void 0:o.call(e)),m=null===(r=null==e?void 0:e.getIsSomePageRowsSelected)||void 0===r?void 0:r.call(e);return t?a.createElement(a.Fragment,null,l&&a.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),a.createElement(Oa,{"aria-label":"Select all rows",onChange:e=>{s("boolean"==typeof e?{target:{checked:e}}:e)},checked:c,indeterminate:!c&&m})):null},Wa=({className:e,hideArrow:t=!1,children:l,offset:n=4,...i})=>a.createElement(K,{...i,className:x("maxio-popover",e),offset:n},a.createElement(a.Fragment,null,!t&&a.createElement(q,{className:"maxio-popover__arrow"},a.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},a.createElement("path",{d:"M0 0 L6 6 L12 0"}))),l)),Fa=({row:e})=>{var t,l;const n=Ca(),i=null==n?void 0:n.registerHandle,o=null==n?void 0:n.getActions,r=null==n?void 0:n.hasActions,s=a.useRef(null),[c,m]=a.useState(!1),d=(null==n?void 0:n.draggingRowId)===e.id,u=null!==(t=null==n?void 0:n.getLabel(e))&&void 0!==t?t:e.id,p=a.useMemo(()=>{var a;return null!==(a=null==r?void 0:r(e))&&void 0!==a&&a},[r,e]),v=a.useMemo(()=>{var a;return c&&null!==(a=null==o?void 0:o(e))&&void 0!==a?a:[]},[o,c,e]),g=null!==(l=n&&!n.availability.available?n.availability.message:void 0)&&void 0!==l?l:p?void 0:`No moves are available for ${u}.`;a.useEffect(()=>{if(i&&s.current&&!g)return i(e,s.current)},[i,e,g]),a.useEffect(()=>{g&&m(!1)},[g]);const x=a.createElement(U,{ref:s,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${u}`,"aria-pressed":d,"aria-disabled":!!g||void 0,onPress:()=>{g||m(!0)}},a.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(g?"maxio-icon--disabled":"maxio-icon--secondary")}));return g?a.createElement(G,{delay:0,closeDelay:0},x,a.createElement(Z,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},a.createElement("div",{className:"maxio-tooltip__content"},g))):a.createElement(Y,{trigger:"longPress",isOpen:c,onOpenChange:m},x,a.createElement(Wa,{placement:"bottom start",hideArrow:!0},a.createElement(X,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:v,onAction:a=>{const t=v.find(e=>e.id===a);t&&(null==n||n.moveRow(e.id,t.target),requestAnimationFrame(()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}},e=>a.createElement(Q,{id:e.id,textValue:e.label,className:"maxio-data-table__reorder-menu-item"},e.label))))},Ha=({row:e,enableRowSelection:t,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==e?void 0:e.getToggleSelectedHandler)||void 0===n?void 0:n.call(e),c=(null===(i=null==e?void 0:e.getIsSelected)||void 0===i?void 0:i.call(e))||(null===(o=null==e?void 0:e.getIsAllSubRowsSelected)||void 0===o?void 0:o.call(e)),m=null===(r=null==e?void 0:e.getIsSomeSelected)||void 0===r?void 0:r.call(e),d=e.id||e.index;return a.createElement(a.Fragment,null,l&&a.createElement(Fa,{row:e}),t&&a.createElement(Oa,{"aria-label":`Select row ${d}`,onChange:s,checked:c,indeterminate:m}))},Va=({children:e})=>a.createElement("div",{className:"maxio-data-table__cell-flex"},e),ja=({row:e,cell:t,children:l,className:n,...i})=>{var o,r,s,c,m,d;const u=null==t?void 0:t.column,p=null===(r=null===(o=null==u?void 0:u.columnDef)||void 0===o?void 0:o.meta)||void 0===r?void 0:r.align,v=null===(c=null===(s=null==u?void 0:u.columnDef)||void 0===s?void 0:s.meta)||void 0===c?void 0:c.controls,g=null===(d=null===(m=null==u?void 0:u.columnDef)||void 0===m?void 0:m.meta)||void 0===d?void 0:d.actions,b=null==u?void 0:u.getIsPinned(),h=x("maxio-data-table__cell",n,{[`maxio-data-table__cell--pinned-${b}`]:b,[`maxio-data-table__cell--${p}`]:p,"maxio-data-table__cell--controls":v,"maxio-data-table__cell--actions":g}),f="left"===b?{left:null==u?void 0:u.getStart("left")}:"right"===b?{right:null==u?void 0:u.getAfter("right")}:{};return a.createElement("td",{className:h,style:f,...i},l)},Ka=({row:e,SubRowComponent:t,pattern:l,enableExpanding:n,onRowAction:i})=>{var o,r,s,c,m;const d=t&&e.getParentRow()&&e.getParentRow().getIsExpanded(),u=d&&e.getVisibleCells()[0].column.columnDef.id===va,p=d&&e.getVisibleCells()[e.getVisibleCells().length-1].column.columnDef.id===ga,v=[p,u].filter(Boolean).length,g=e.getVisibleCells().length-v,x=null!==(r=null===(o=e.getParentRow())||void 0===o?void 0:o.index)&&void 0!==r?r:e.index,b=l&&t&&x%2==1?"maxio-data-table__row--with-pattern":void 0,h=null===(s=e.getCanExpand)||void 0===s?void 0:s.call(e),f=null===(c=null==e?void 0:e.getToggleExpandedHandler)||void 0===c?void 0:c.call(e),E=null===(m=null==e?void 0:e.getIsExpanded)||void 0===m?void 0:m.call(e),_=h&&n?0:1.75,w=e.getVisibleCells()[0].column.columnDef.id===va?1:0,N=e.getVisibleCells().find(({column:e})=>{var a;const{actions:t,controls:l}=null!==(a=e.columnDef.meta)&&void 0!==a?a:{};return!t&&!l}),y=i&&N?N.id:void 0;return a.createElement(a.Fragment,{key:e.id},d?a.createElement(Da,{key:`${e.id}-sub`,row:e,isChild:!0,className:b},u&&a.createElement(ja,{className:"maxio-data-table__cell--pinned-left"}),a.createElement(ja,{colSpan:g},t(e)),p&&a.createElement(ja,{className:"maxio-data-table__cell--pinned-right"})):a.createElement(Da,{key:`${e.id}-parent`,row:e,className:b,onRowAction:i,"aria-labelledby":y},e.getVisibleCells().map(t=>{const l=n&&t.column.getIndex()===w;return a.createElement(ja,{key:t.id,row:e,cell:t,id:t.id},a.createElement("div",{className:"maxio-data-table__cell-flex",style:n&&l?{paddingLeft:`${(null==e?void 0:e.depth)+_}rem`}:void 0},n&&h&&l&&a.createElement(Qe,{size:"sm",variant:"ghost",icon:a.createElement(Ve,{size:"xs",variant:E?"chevron-down":"chevron-right"}),onClick:f,"aria-label":E?"Collapse row":"Expand row","data-open":E,className:"maxio-data-table__expand-button"}),T(t.column.columnDef.cell,t.getContext())))})))},qa={available:!0},Ua={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},Ga={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},Za={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},Ya=(e=[])=>e.filter(e=>e!==va&&e!==ga),Xa=[],Qa=e=>e.subRows,Ja=({pattern:e,size:t="md",SubRowComponent:n,onExpand:i,onSelect:o,onSort:r,enableSorting:s=!1,enableRowSelection:c=!1,enableExpanding:m,columns:d,actions:p,actionsColumnSize:v,onRowAction:g,enableRowReordering:x=!1,getRowReorderLabel:b,onRowReorder:h,rowReorderMode:f="siblings",getRowId:E,getSubRows:_,state:w,...N})=>{var y,I;const k=x?void 0:n,R=!x&&s,C=(({columns:e,HeaderControls:t,RowControls:l,RowActions:n,actions:i,actionsColumnSize:o,enableExpanding:r,enableRowSelection:s,enableRowReordering:c})=>u(()=>{const m={id:va,size:s&&c?72:40,header:e=>a.createElement(t,{...e,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),cell:e=>a.createElement(l,{...e,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),meta:{controls:!0,width:(s&&c?72:40)+"px"}},d=i&&n?{id:ga,size:null!=o?o:40,header:"",cell:e=>a.createElement(n,null,i(e.row,e.table)),meta:{actions:!0}}:null;let u=[...e];return(s||c)&&(u=[m,...u]),d&&(u=[...u,d]),u},[i,o,n,r,s,c,e,t,l]))({columns:d,HeaderControls:La,RowControls:Ha,RowActions:Va,actions:p,actionsColumnSize:v,enableRowSelection:c,enableRowReordering:x,enableExpanding:Boolean(m)}),S=M({state:{...w,...x&&{sorting:Xa},columnPinning:{left:[...c||x?[va]:[],...Ya(null===(y=null==w?void 0:w.columnPinning)||void 0===y?void 0:y.left)],right:[...Ya(null===(I=null==w?void 0:w.columnPinning)||void 0===I?void 0:I.right),...p?[ga]:[]]}},getCoreRowModel:A(),enableRowSelection:c,enableExpanding:Boolean(m),...!N.manualExpanding&&{getExpandedRowModel:z()},...!N.manualSorting&&!x&&{getSortedRowModel:O()},columns:C,getRowId:E,...N,getSubRows:x?Qa:null!=_?_:Qa,enableSorting:R,...x&&{getSortedRowModel:void 0}}),P=S.getCanSomeRowsExpand(),$=S.getState(),D=(({columnFilters:e,globalFilter:a,grouping:t,hasPagination:l})=>e.length>0||null!=a&&""!==a?Ua:t.length>0?Ga:l?Za:qa)({columnFilters:$.columnFilters,globalFilter:$.globalFilter,grouping:$.grouping,hasPagination:Boolean(N.getPaginationRowModel||N.manualPagination)});l(()=>{null==i||i($.expanded)},[i,$.expanded]),l(()=>{null==o||o($.rowSelection)},[o,$.rowSelection]),l(()=>{x||null==r||r($.sorting)},[x,r,$.sorting]);const B=a.createElement(xa,{pattern:e,size:t,isExpandable:P,isUsingCustomRow:Boolean(k)},a.createElement(ba,null,S.getHeaderGroups().map(e=>a.createElement(Da,{key:e.id,table:S,isHeader:!0},e.headers.map(e=>a.createElement(fa,{key:e.id,table:S,header:e,enableExpanding:m},T(e.column.columnDef.header,e.getContext())))))),a.createElement(ha,null,S.getRowModel().rows.map(t=>a.createElement(Ka,{key:t.id,row:t,pattern:e,SubRowComponent:k,enableExpanding:m,onRowAction:g}))));return x&&E&&h?a.createElement($a,{availability:D,data:N.data,enableExpanding:Boolean(m),getRowReorderLabel:b,onRowReorder:h,rowReorderMode:f,table:S},B):B},et={sm:"h3",md:"h2",lg:"h1"},at=({children:e,size:t="sm",className:l,...n})=>{const i=et[t],o=x(`maxio-heading-${t}`,l);return a.createElement(i,{className:o,...n},e)},tt=({open:e,onOpenChange:t,placement:l="right",backdrop:n="dim",size:i="md",className:o,title:r,description:s,children:c,footer:m})=>{const d=a.useId(),u={"data-placement":l,"data-size":i};return a.createElement(J,{isOpen:e,onOpenChange:t,isDismissable:!0,className:x("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===n})},a.createElement(ee,{className:x("maxio-drawer",o),...u},a.createElement(ae,{className:"maxio-drawer__dialog","aria-labelledby":d},({close:e})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-drawer__header"},a.createElement("div",{className:"maxio-drawer__title-group"},a.createElement(at,{id:d,size:"md",className:"maxio-drawer__title"},r),s&&a.createElement("p",{className:"maxio-drawer__description"},s)),a.createElement(Qe,{"aria-label":"Close",onClick:e,icon:a.createElement(Ve,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-drawer__close"})),a.createElement("div",{className:"maxio-drawer__body"},c),null!=m&&a.createElement("div",{className:"maxio-drawer__footer"},m)))))},lt=({as:e="div",children:t,compact:l=!1,size:n="md",className:i,...o})=>{const r=e,s=x({[`maxio-body-${n}`]:!l,[`maxio-body-${n}-compact`]:l},i);return a.createElement(r,{className:s,...o},t)},nt=({as:e="div",children:t,size:l="md",className:n,...i})=>{const o=e,r=x(`maxio-display-${l}`,n);return a.createElement(o,{className:r,...i},t)},it=({as:e="div",children:t,className:l,...n})=>{const i=e,o=x("maxio-code",l);return a.createElement(i,{className:o,...n},t)},ot=({as:e="div",children:t,size:l="sm",className:n,...i})=>{const o=e,r=x(`maxio-label-${l}`,n);return a.createElement(o,{className:r,...i},t)},rt=({basis:e,flex:t,flexDirection:l,wrap:n,grow:i,shrink:o,gap:r,gapX:s,gapY:c,className:m,children:d,alignItems:u,justifyContent:p,...v})=>{const g=x("maxio-flex",{[`maxio-flex-${t}`]:t,[`maxio-basis-${e}`]:void 0!==e,[`maxio-flex-${l}`]:l,[`maxio-flex-${n}`]:n,"maxio-grow":i,"maxio-grow-0":!1===i,"maxio-shrink":o,"maxio-shrink-0":!1===o,[`maxio-gap-${r}`]:void 0!==r,[`maxio-gap-x-${s}`]:void 0!==s,[`maxio-gap-y-${c}`]:void 0!==c,[`maxio-items-${u}`]:u,[`maxio-justify-${p}`]:p},m);return a.createElement("div",{className:g,...v},d)},st=({hasActiveFilters:e=!1,title:t,headingLevel:l="h2",description:n,actions:i,className:o,...r})=>{const s=x("maxio-empty-state",o),c=l,m=!t&&!n?e?"We couldn't find any items matching your criteria. Try adjusting your search or filters to see more results.":"There is no data to display yet.":n;return a.createElement("div",{className:s,...r},a.createElement(rt,{flexDirection:"col",alignItems:"center",gap:4,className:"maxio-empty-state__content"},a.createElement(rt,{flexDirection:"col",alignItems:"center",gap:2,className:"maxio-empty-state__copy"},t&&a.createElement(c,{className:"maxio-heading-lg"},t),m&&a.createElement(lt,{size:"sm",className:"maxio-empty-state__description"},m)),i&&a.createElement(rt,{alignItems:"center",gap:2},i)))},ct={click:Ce,hover:e=>Re(e,{delay:100}),focus:ke,dismiss:Ie},mt=(e,a)=>a.map(a=>ct[a](e)),dt=({placement:e="top",isActive:a=!1,interactions:n=["hover"],floatingElementOffset:i=0,onOverlayUpdate:o,autoHideMs:r})=>{const s=t(null),{strategy:c,x:m,y:d,context:u,floating:p,reference:v}=Se({placement:e,open:a,onOpenChange:e=>o(e),middleware:[Pe(i)]}),{getReferenceProps:g,getFloatingProps:x}=$e([...mt(u,n),De(u,{role:"tooltip"})]);l(()=>{s.current&&clearTimeout(s.current),a&&r&&(s.current=window.setTimeout(()=>o(!1),r))},[a,r]);return{isActive:a,refs:{floating:p,reference:v},floatingElementCSSPosition:{position:c,top:null!=d?d:0,left:null!=m?m:0},getReferenceProps:g,getFloatingProps:x}};function ut(e,a=0){const i=t((new Date).getTime()),o=t((new Date).getTime()),[r,s]=n(!1);return l(()=>{const t=()=>{i.current=(new Date).getTime(),s(!0)},l=()=>{o.current=(new Date).getTime(),window.setTimeout(()=>{i.current-o.current<=0&&s(!1)},a)},n=e&&e.current;return n&&(n.addEventListener("mouseenter",t),n.addEventListener("mouseleave",l)),()=>{n&&(n.removeEventListener("mouseenter",t),n.removeEventListener("mouseleave",l))}},[e]),r}function pt(e=500){const[a,i]=n(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:a}=window;return{windowWitdh:e,windowHeight:a}}),o=t(null);return l(()=>{if("undefined"==typeof window)return;const a=()=>{var a;const{innerWidth:t,innerHeight:l}=window;window.clearTimeout(null!==(a=o.current)&&void 0!==a?a:void 0),o.current=window.setTimeout(()=>{i({windowWitdh:t,windowHeight:l})},e)};return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[e]),a}function vt(e){const[a,t]=n(()=>{var a,t;return null!==(t=null===(a=e.current)||void 0===a?void 0:a.clientWidth)&&void 0!==t?t:0}),l=()=>{var a,l;const n=null!==(l=null===(a=e.current)||void 0===a?void 0:a.clientWidth)&&void 0!==l?l:0;t(e=>0===n&&e>0?e:n)};return v(l,[e]),D({ref:e,onResize:l}),a}const gt=({children:e,usePortal:t=!1,isActive:l=!1,placement:n="top",interactions:i=["hover"],role:o="tooltip",renderOverlay:r,floatingElementOffset:s,motionSettings:c={},autoHideMs:m,onOverlayUpdate:d,className:u})=>{const{getReferenceProps:p,getFloatingProps:v,refs:{floating:g,reference:b},floatingElementCSSPosition:h}=dt({isActive:l,onOverlayUpdate:d,autoHideMs:m,floatingElementOffset:s,interactions:i,placement:n}),f=a.createElement(Ne,null,l&&a.createElement(ye.div,{ref:g,style:h,...c,...v()},r()));return a.createElement(a.Fragment,null,a.createElement("div",{ref:b,className:x("maxio-inline-flex",u),...p(),"data-testid":"overlay-trigger"},e),t?a.createElement(Te,{id:"maxio-ui-portal"},f):f)},xt=({children:e,arrowPosition:t,size:l="regular",maxWidth:n=160})=>a.createElement("div",{"data-testid":"tooltip",className:x("maxio-tooltip",`maxio-tooltip--${l}`,{[`maxio-tooltip--arrow-${t}`]:t})},a.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:n}},e)),bt={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},ht=({children:e,interactions:i=["hover"],placement:o="right",maxWidth:r=160,size:s="regular",renderContent:c,autoHideMs:m,isVisible:d,usePortal:v,className:g,onVisibilityUpdate:x,floatingElementOffset:b=5})=>{const[h,f]=n(!1),E=void 0!==d,_=t(null),w=p(e=>{_.current&&clearTimeout(_.current),_.current=window.setTimeout(()=>{E||f(e),x&&x(e)},50)},[E,x]),N=u(()=>(e=>{const a=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",t=`translate${a}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:t},animate:{opacity:1,visibility:"visible",transform:`translate${a}(0px)`},exit:{opacity:0,visibility:"hidden",transform:t},transition:{ease:[.4,0,.5,1],duration:.2}}})(o),[o]);return l(()=>()=>{_.current&&clearTimeout(_.current)},[]),a.createElement(gt,{role:"tooltip",className:g,floatingElementOffset:b,motionSettings:N,isActive:E?d:h,onOverlayUpdate:w,autoHideMs:m,usePortal:v,placement:o,interactions:i,renderOverlay:()=>a.createElement(xt,{size:s,arrowPosition:bt[o],maxWidth:r},c())},e)},ft=({className:e,render:t,showSelectAll:l=!1,...n})=>a.createElement(te,{...n,className:le(e,e=>x("maxio-listbox",e)),render:(e,n)=>{const{selectionManager:i}=n.state,o=t?t(e,n):a.createElement("div",{...e});if("multiple"!==i.selectionMode||!l)return o;if(0===[...i.collection.getKeys()].filter(e=>{const a=i.collection.getItem(e);return"item"===(null==a?void 0:a.type)&&i.canSelectItem(e)}).length)return o;const r=i.isSelectAll,s=r&&i.disallowEmptySelection;return a.createElement("div",null,a.createElement("div",{className:"maxio-listbox__select-all"},a.createElement(Xe,{type:"button",variant:"ghost",trailingElement:a.createElement(Ve,{variant:r?"check":""}),fullWidth:!0,"aria-pressed":r,disabled:s,onClick:()=>i.toggleSelectAll()},"Select all")),o)}});ft.displayName="ListBox";const Et=({className:e,...t})=>{const l=t.textValue||("string"==typeof t.children?t.children:void 0);return a.createElement(ne,{...t,textValue:l,className:x("maxio-listbox__item",e)},le(t.children,(e,{isSelected:t})=>a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-listbox__content"},"string"==typeof e?a.createElement(lt,{size:"sm"},e):e),t&&a.createElement(Ve,{variant:"check"}))))};Et.displayName="ListBox.Item";const _t=({className:e,...t})=>a.createElement(ie,{...t,className:x("maxio-listbox__section",e)});_t.displayName="ListBox.Section";const wt=({className:e,...t})=>a.createElement(oe,{...t,className:x("maxio-listbox__header",e)});wt.displayName="ListBox.Header";const Nt=Object.assign(ft,{Item:Et,Section:_t,Header:wt}),yt=({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,leadingElement:s=null,fullWidth:c,className:m,placeholder:d,renderEmptyState:u,selectionMode:p,children:v,...g})=>{const b=a.useRef(null),h=a.useRef(null),[f,E]=a.useState(),[_,w]=a.useState(0),N=!!r,y=t||N,I=v,k=a.useCallback(()=>{const e=b.current;if(!e)return;const a=h.current,t=a?a.getBoundingClientRect().left-e.getBoundingClientRect().left:0;w(e=>e===-t?e:-t),E(a=>{const t=`${e.offsetWidth}px`;return(null==a?void 0:a["--trigger-width"])===t?a:{"--trigger-width":t}})},[]);a.useEffect(()=>{const e=b.current;if(!e)return;if(k(),"undefined"==typeof ResizeObserver)return;const a=new ResizeObserver(k);return a.observe(e),()=>a.disconnect()},[k]);const R=x("maxio-text-field",`maxio-text-field--${n}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":y,"maxio-text-field--readonly":l,"maxio-text-field--full-width":c},m);return a.createElement(re,{...g,isDisabled:e,isInvalid:y,isReadOnly:l,selectionMode:p,className:R},i&&a.createElement(se,{className:"maxio-text-field__label"},i),a.createElement("div",{ref:b,className:"maxio-text-field__items"},s&&a.createElement("div",{className:"maxio-text-field__leading-element"},s),a.createElement(ce,{ref:h,className:"maxio-text-field__input",placeholder:d}),a.createElement("div",{className:"maxio-text-field__trailing-element"},a.createElement(U,{className:x("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},a.createElement(Ve,{variant:"chevron-up-down"})))),o&&!N&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},e=>a.createElement(a.Fragment,null,a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},"function"==typeof r?r(e):r))),a.createElement(Wa,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:_,style:f},a.createElement(Nt,{renderEmptyState:u},I)))};yt.displayName="ComboBox";const It=e=>a.createElement(Nt.Item,{...e});It.displayName="ComboBox.Item";const kt=e=>a.createElement(Nt.Section,{...e});kt.displayName="ComboBox.Section";const Rt=e=>a.createElement(Nt.Header,{...e});Rt.displayName="ComboBox.Header";const Ct=Object.assign(yt,{Item:It,Section:kt,Header:Rt}),St=s({}),Pt=({indent:e=!1,disabled:l=!1,invalid:n=!1,label:i,...o})=>{const r=t(null),s=m(St),{inputProps:c,isDisabled:d}=k({...o,value:(o.value||"").toString(),"aria-label":o["aria-label"]||i,isDisabled:l},s,r),u=x("maxio-radio",{"maxio-radio--indent":e,"maxio-radio--disabled":d||s.isDisabled,"maxio-radio--error":n||s.isInvalid});return a.createElement("label",{className:u},a.createElement("input",{ref:r,role:"radio",type:"radio",className:"maxio-radio__input",...c,name:s.name||c.name}),a.createElement("span",{className:"maxio-radio__control"}),a.createElement("span",{className:"maxio-radio__label"},i))},$t=({children:e,label:t,errorMessage:l,helperText:n,disabled:i=!1,invalid:o=!1,name:r,defaultValue:s,...c})=>{const m=Me({isDisabled:i,isInvalid:o,description:n,name:r,label:t,errorMessage:l,defaultValue:s,...c}),{radioGroupProps:d,labelProps:u,descriptionProps:p,errorMessageProps:v}=R({"aria-label":c["aria-label"]||t,...c},m);return a.createElement(a.Fragment,null,a.createElement("div",{className:"maxio-radio-group",...d},t&&a.createElement("label",{className:"maxio-radio-group__label",...u},t),a.createElement(St.Provider,{value:m},e),o&&l&&a.createElement(Aa,{...v},l),n&&!o&&a.createElement(za,{...p},n)))},Dt=i(({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,leadingElement:s=null,trailingElement:c=null,fullWidth:m,className:d,...u},p)=>{const v=x("maxio-text-field",`maxio-text-field--${n}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":t,"maxio-text-field--readonly":l,"maxio-text-field--full-width":m},d);return a.createElement(ue,{...u,isDisabled:e,isReadOnly:l,isInvalid:t,className:v},i&&a.createElement(se,{className:"maxio-text-field__label"},i),a.createElement("div",{className:"maxio-text-field__items"},s&&a.createElement("div",{className:"maxio-text-field__leading-element"},s),a.createElement(ce,{ref:p,className:"maxio-text-field__input"}),c&&a.createElement("div",{className:"maxio-text-field__trailing-element"},c)),o&&!(t&&r)&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},r)))});Dt.displayName="TextField";const Tt=i(({isDisabled:e=!1,isInvalid:t=!1,isReadOnly:l=!1,size:n="md",label:i,description:o,errorMessage:r,fullWidth:s,className:c,...m},d)=>{const u=x("maxio-text-area",`maxio-text-area--${n}`,{"maxio-text-area--disabled":e,"maxio-text-area--error":t,"maxio-text-area--readonly":l,"maxio-text-area--full-width":s},c);return a.createElement(ue,{...m,isDisabled:e,isReadOnly:l,isInvalid:t,className:u},i&&a.createElement(se,{className:"maxio-form-label"},i),a.createElement(pe,{ref:d,className:"maxio-text-area__input"}),o&&!(t&&r)&&a.createElement(me,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},o),r&&a.createElement(de,{className:"maxio-form-error"},a.createElement(Ve,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),a.createElement("div",{className:"maxio-form-error__text"},r)))});Tt.displayName="TextArea";const Mt=i(({disabled:e=!1,invalid:n=!1,readOnly:i=!1,size:o="md",label:r,helperText:s,showErrorMessage:c=!0,errorMessage:m,leadingElement:d=null,trailingElement:u=null,fullWidth:p,className:v,...b},h)=>{var f,E;const _=t(null);g(h,()=>_.current),l(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:w,...N}=b,y={...N,label:r,description:s,errorMessage:m,defaultValue:null===(f=b.defaultValue)||void 0===f?void 0:f.toString(),value:null===(E=b.value)||void 0===E?void 0:E.toString(),isDisabled:e,isReadOnly:i,isInvalid:n},{labelProps:I,inputProps:k,descriptionProps:R,errorMessageProps:S}=C(y,_),P=x("maxio-text-field",`maxio-text-field--${o}`,{"maxio-text-field--disabled":e,"maxio-text-field--error":n,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},v),$=n&&m&&c;return a.createElement("div",{className:P},r&&a.createElement("label",{className:"maxio-text-field__label",...I},r),a.createElement("div",{className:"maxio-text-field__items"},d&&a.createElement("div",{className:"maxio-text-field__leading-element"},d),a.createElement("input",{ref:_,type:"text",className:"maxio-text-field__input",...k,spellCheck:w}),u&&a.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!$&&a.createElement("div",{className:"maxio-form-helper-text",...R},s),$&&a.createElement(Aa,{...S},m))});Mt.displayName="TextInput";const Ot=({options:e,label:t,size:l="md",inline:n=!1,disabled:i=!1,helperText:o,errorMessage:r,fullWidth:s=!1,...c})=>{const m=x("maxio-select",`maxio-select--${l}`,{"maxio-select--disabled":i,"maxio-select--inline":n,"maxio-select--error":!!r,"maxio-select--full-width":s}),d=b();return a.createElement("div",{className:m},t&&a.createElement("label",{htmlFor:d,className:"maxio-select__label"},t),a.createElement("div",{className:"maxio-select__input-container"},a.createElement("select",{id:d,className:"maxio-select__input",disabled:i,...c},e.map(e=>a.createElement("option",{key:`option-${e.value}`,value:e.value,disabled:e.disabled},e.label))),a.createElement(Ve,{variant:"chevron-up-down"})),!!r&&a.createElement(Aa,null,r),o&&!r&&a.createElement("div",{className:"maxio-form-helper-text"},o))},zt=({size:e="md",onChange:t,totalItems:i=0,itemsPerPage:o=30,currentPage:r=1,pageSizeOptions:s,manualPageInput:c=!1})=>{const[m,d]=n(r),[u,p]=n(o),[v,g]=n(r.toString());l(()=>{g(m.toString())},[m]);const x=Math.ceil(i/u),b=m<x,h=m>1,f=u*(m-1)+1,E=Math.min(u*m,i),_=s.map(e=>({label:e.toString(),value:e.toString()})),w=Array.from({length:x},(e,a)=>a+1).map(e=>({label:e.toString(),value:e.toString()})),N=e=>{d(e),null==t||t({currentPage:e,itemsPerPage:u})},y=e=>{const a=parseInt(e,10);if(isNaN(a))return void g(m.toString());const t=Math.max(1,Math.min(a,x));g(t.toString()),N(t)};return a.createElement("div",{className:"maxio-pagination"},a.createElement("div",{className:"maxio-pagination__items-per-page"},a.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),a.createElement(Ot,{inline:!0,size:e,options:_,onChange:e=>{return a=Number(e.target.value),p(a),d(1),void(null==t||t({currentPage:1,itemsPerPage:a}));var a},value:u,id:"items-per-page-large"})),a.createElement("div",{className:"maxio-pagination__total-items"},a.createElement("span",null,f,"–",E," of ",i," items")),a.createElement("div",{className:"maxio-pagination__current-page"},c?a.createElement(Mt,{className:"maxio-pagination__page-input",value:v,min:1,max:x,onChange:e=>(e=>{g(e)})(e),onBlur:e=>{y(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(y(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:e,type:"number",onWheel:e=>e.preventDefault()}):a.createElement(Ot,{inline:!0,size:e,"aria-label":"Select page",onChange:e=>N(Number(e.target.value)),value:m,options:w,id:"page-index-large"}),a.createElement("div",{className:"maxio-pagination__label"},"of ",x," pages")),a.createElement("div",{className:"maxio-pagination__controls"},a.createElement(ht,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(Qe,{icon:a.createElement(Ve,{variant:"chevron-left"}),size:e,variant:"ghost",onClick:()=>N(m-1),"aria-label":"Previous",disabled:!h})),a.createElement(ht,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},a.createElement(Qe,{icon:a.createElement(Ve,{variant:"chevron-right"}),size:e,variant:"ghost",onClick:()=>N(m+1),"aria-label":"Next",disabled:!b}))))},At=({label:e,helperText:t,size:l="md",variant:n="default",status:i,value:o,maxValue:r=100})=>{const s=b(),c=b(),m=i&&!!e&&!!o&&!("inline"===n),d=t&&!("inline"===n),u=t&&"inline"===n,{progressBarProps:p,labelProps:v}=S({maxValue:r,value:o,label:e}),g=x("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===l,"maxio-progress-bar--success":o&&!("inline"===n)&&"success"===i,"maxio-progress-bar--error":o&&!("inline"===n)&&"error"===i,"maxio-progress-bar--indent":"indent"===n,"maxio-progress-bar--inline":"inline"===n,"maxio-progress-bar--indeterminate":void 0===o});return a.createElement("div",{className:g,...p},a.createElement("div",{id:s,className:"maxio-progress-bar__label",...v},e),u&&a.createElement("div",{id:c,className:"maxio-progress-bar__helper-text"},t),a.createElement("div",{className:"maxio-progress-bar__track"},a.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${o}%`}})),m&&a.createElement("div",{className:`maxio-progress-bar__${i}-icon`}),d&&a.createElement("div",{id:c,className:"maxio-progress-bar__helper-text"},t))},Bt=({className:e,size:t="md",fullWidth:l=!1,selectionMode:n="single",orientation:i="horizontal",disallowEmptySelection:o=!0,...r})=>a.createElement(ve,{...r,selectionMode:n,orientation:i,disallowEmptySelection:o,className:le(e,e=>x("maxio-segmented-control",`maxio-segmented-control--${t}`,{"maxio-segmented-control--full-width":l},e))});Bt.displayName="SegmentedControl";const Lt=({className:e,children:t,...l})=>a.createElement(ge,{...l,className:le(e,e=>x("maxio-segmented-control__item",e))},le(t,e=>a.createElement(a.Fragment,null,a.createElement(xe,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),e)));Lt.displayName="SegmentedControl.Item";const Wt=Object.assign(Bt,{Item:Lt}),Ft=({leadingIcon:e,trailingIcon:t,type:l="menu",children:n,leadingIconClassName:i,isTooltipVisible:o=!1})=>a.createElement(a.Fragment,null,e&&a.createElement(ht,{usePortal:!0,isVisible:o,renderContent:()=>n,floatingElementOffset:12},a.createElement("span",{className:"maxio-side-nav__icon"},a.createElement(Ve,{variant:e,className:i}))),a.createElement("span",{className:`maxio-side-nav__${l}-title`,"data-testid":"maxio-sidebar-section-name"},n),t&&a.createElement("span",{className:"maxio-side-nav__menu-chevron"},a.createElement(Ve,{variant:t}))),Ht=e=>"heading"!==e.type,Vt=e=>{const a=(e=>e.flat().filter(Ht).map(e=>e.items).flat().find(e=>null==e?void 0:e.isCurrent))(e);return a?e.map(e=>e.map(e=>{var t;return Ht(e)&&(null===(t=e.items)||void 0===t?void 0:t.includes(a))?{...e,isOpen:!0}:e})):e},jt=s({}),Kt=()=>m(jt),qt=({children:e,isOpen:i,onChange:o,withIcons:r=!0,sections:s,shouldToggleSidebar:c=!0,topDropdownItems:m,collapseBreakpoint:d=800})=>{const u=t(!1),[p,v]=n(()=>!c||("boolean"==typeof i?i:"undefined"==typeof window||window.innerWidth>d)),[g,x]=n(()=>Vt(s)),{windowWitdh:b}=pt(200);l(()=>{u.current&&(null==o||o(p))},[p,o]),l(()=>{u.current=!0},[]),l(()=>{!function(e){if(!c)return;e<d&&p&&h()}(b)},[b]),l(()=>{"boolean"==typeof i&&v(i)},[i]);const h=()=>{v(!1)};return a.createElement(jt.Provider,{value:{sections:g,topDropdownItems:m,onSectionOpen:e=>{x(a=>a.map(a=>a.map(a=>Ht(a)?{...a,isOpen:(null==a?void 0:a.name)===e&&!a.isOpen}:a)))},isOpen:p,onOpen:()=>{v(!0)},onClose:h,withIcons:r,shouldToggleSidebar:c}},e)},Ut=()=>{const{onOpen:e,topDropdownItems:l,isOpen:n}=Kt(),{mainItem:i,otherItems:o,actions:r}=l,s=t(null),c=ut(s),m=({id:e,title:a,icon:t,iconClass:l,url:n,...i})=>({id:e,label:a,leadingIconName:t,leadingIconClassName:l,link:{href:n,...i}}),{items:d,itemsCount:p}=u(()=>({itemsCount:o.length+r.length,items:[...o.map(m),(null==o?void 0:o.length)>0&&(null==r?void 0:r.length)>0?{type:"divider",id:"item-divider"}:null,...r.map(m)].filter(e=>null!=e)}),[r,o]);return a.createElement(a.Fragment,null,0===p?a.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:i.url,onClick:e},a.createElement("span",{className:"maxio-side-nav__menu-title"},i.title)):a.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},a.createElement("summary",{onClick:e,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:s},i.url?a.createElement(a.Fragment,null,a.createElement(Ft,{type:"menu",isTooltipVisible:!n&&c,leadingIcon:i.icon,trailingIcon:"chevron-up-down",leadingIconClassName:i.iconClass},i.title)):a.createElement(Ft,{type:"menu",trailingIcon:"chevron-up-down"},i.title)),a.createElement(qe,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:d,small:!0})))},Gt=({section:e})=>{const{isOpen:l,withIcons:n}=Kt(),i=t(null),o=ut(i);return a.createElement("li",{className:"maxio-side-nav__item","data-key":e.key,"data-testid":"maxio-sidebar-section"},a.createElement("a",{className:"maxio-side-nav__link","aria-current":e.isCurrent?"page":void 0,role:"button",href:e.href,ref:i},a.createElement(Ft,{isTooltipVisible:o&&!l,type:"menu",leadingIcon:n?e.icon:void 0},e.name)))},Zt=({section:e})=>{var l,n;const{onOpen:i,onSectionOpen:o,isOpen:r,withIcons:s}=Kt(),c=t(null),m=ut(c);if(!Ht(e))return a.createElement("li",{className:"maxio-side-nav__item-header"},e.title);return e.Component?a.createElement(e.Component,{section:e}):e.href?a.createElement(Gt,{section:e}):a.createElement("li",{className:x("maxio-side-nav__item",{"maxio-side-nav__item--icon":s}),"data-testid":"maxio-sidebar-section"},a.createElement("button",{className:"maxio-side-nav__menu-button",ref:c,"aria-expanded":e.isOpen?"true":"false",type:"button",onClick:()=>{o(e.name),i()}},a.createElement(Ft,{type:"menu",isTooltipVisible:!r&&m,leadingIcon:s?e.icon:void 0,trailingIcon:(null===(l=e.items)||void 0===l?void 0:l.length)?"chevron-down":void 0},e.name)),a.createElement("ul",{className:"maxio-side-nav__menu"},null===(n=e.items)||void 0===n?void 0:n.map(e=>a.createElement("li",{key:`section-sub-item-${e.name}`,className:"maxio-side-nav__item","data-testid":"maxio-section-item"},a.createElement("a",{className:"maxio-side-nav__link",href:e.href,"aria-current":e.isCurrent?"page":void 0},a.createElement("span",{className:"maxio-side-nav__link-title"},e.name))))))},Yt=()=>{const{sections:e}=Kt();return a.createElement(a.Fragment,null,e.map((e,t)=>a.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${t}`},e.map((e,l)=>a.createElement(Zt,{key:`section-list-item-${e.type}-${t}-${l}`,section:e})))))},Xt=()=>{const{onClose:e,shouldToggleSidebar:t}=Kt();return a.createElement("div",{className:"maxio-side-nav__logo-container"},a.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),t&&a.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":"toggle sidebar",onClick:e},a.createElement(Ve,{variant:"sidebar"})))},Qt=()=>{const{isOpen:e}=Kt();return a.createElement("nav",{className:x("maxio-side-nav",{"maxio-side-nav--collapsed":!e})},a.createElement(Xt,null),a.createElement(Ut,null),a.createElement("div",{className:"maxio-side-nav__items-container"},a.createElement(Yt,null)))},Jt=({withIcons:e=!0,shouldToggleSidebar:t=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:o,onChange:r})=>a.createElement(qt,{isOpen:o,onChange:r,collapseBreakpoint:i,withIcons:e,shouldToggleSidebar:t,topDropdownItems:l,sections:n},a.createElement(Qt,null)),el=({disabled:e=!1,value:t=0,className:l,id:n,isCurrent:i,...o})=>{const r="icon"===o.type,s=({isSelected:a})=>x("maxio-tabs__tab",l,{"maxio-tabs__tab--active":a,"maxio-tabs__tab--disabled":e,"maxio-tabs__tab--icon":r});if("icon"===o.type){const{icon:l,...n}=o;return a.createElement(be,{id:t,isDisabled:e,...n,className:s},a.createElement("div",{className:"maxio-tabs__tab__content"},l))}const{children:c,rightIcon:m,...d}=o;return a.createElement(be,{id:t,isDisabled:e,...d,className:s},a.createElement("div",{className:"maxio-tabs__tab__content"},c,m||null))},al=s({variant:"line",withDivider:!1}),tl=({children:e,variant:t="line",withDivider:l=!1})=>a.createElement(al.Provider,{value:{variant:t,withDivider:l}},e),ll=({children:e,variant:t="line",withDivider:l=!1,defaultIndex:n=0,index:i,onChange:o})=>a.createElement(he,{className:"maxio-tabs-container",selectedKey:i,defaultSelectedKey:n,onSelectionChange:e=>null==o?void 0:o(Number(e))},a.createElement(tl,{variant:t,withDivider:l},e)),nl=({children:e,value:t,className:l,id:n,...i})=>a.createElement(fe,{id:t,className:x("maxio-tabs__panel",l),...i},e),il=({children:e})=>{const t=d.map(e,(e,a)=>{if(!r(e)||e.type!==nl)throw new Error("You can only pass <TabPanel /> component as children");return o(e,{key:a,value:a})});return a.createElement(Ee,{className:"maxio-tabs__panels"},t)},ol=({children:e,className:l,ariaLabel:i,overflow:s="none",moreLabel:u="More",...p})=>{const{variant:g,withDivider:b}=m(al),h=m(_e),f=c(),[E,_]=n(!1),w=x("maxio-tabs",l,{"maxio-tabs--contained":"contained"===g,"maxio-tabs--divider":b}),N=d.map(e,e=>e);(null!=N?N:[]).forEach(e=>{if(!r(e)||e.type!==el)throw new Error("You can only pass <Tab /> component as children")});const y="auto"===s&&!!(null==N?void 0:N.length),{ref:I,moreButtonRef:k,overflowIndexes:R,handleKeyDownCapture:C}=(({overflowEnabled:e,childrenArray:a})=>{const l=t(null),i=t(null),o=t(null),[r,s]=n(null),c=vt(l),d=m(_e),u=null!=(null==d?void 0:d.selectedKey)?Number(d.selectedKey):null,[p,g]=n([]);v(()=>{var t;if(!e||!r)return void g((null!=a?a:[]).map((e,a)=>a));const{visibleIndexes:l}=((e,a,t,l)=>{const n=e.map((e,a)=>a);if(e.reduce((e,a)=>e+a,0)<=a)return{visibleIndexes:n,overflowIndexes:[]};const i=[];let o=t;for(const t of n){if(o+e[t]>a)break;o+=e[t],i.push(t)}if(null!==l&&!i.includes(l)){for(o+=e[l];o>a&&i.length>0;)o-=e[i.pop()];i.push(l)}i.sort((e,a)=>e-a);const r=n.filter(e=>!i.includes(e));return{visibleIndexes:i,overflowIndexes:r}})(r.tabWidths,c,r.moreButtonWidth,null!==(t=o.current)&&void 0!==t?t:u);l.length===(null!=a?a:[]).length&&(o.current=null),g(l)},[e,r,c]),v(()=>{e&&r&&null!==u&&g(e=>(e.includes(u)||(o.current=u),((e,a,t,l,n)=>{if(e.includes(n))return e;const i=[...e,n].sort((e,a)=>e-a);let o=l+i.reduce((e,t)=>e+a[t],0);for(;o>t&&i.length>1;){const e=i.length-1,t=i[e]===n?e-1:e,[l]=i.splice(t,1);o-=a[l]}return i})(e,r.tabWidths,c,r.moreButtonWidth,u)))},[u]);const x=e?(null!=a?a:[]).map((e,a)=>a).filter(e=>!p.includes(e)):[],b=((e,a)=>e.filter(e=>{var t;return!(null===(t=null==a?void 0:a[e])||void 0===t?void 0:t.props.disabled)}))(p,a);v(()=>{var t,n;if(!e||!l.current)return void s(e=>null===e?e:null);const o=Array.from(l.current.querySelectorAll('[role="tab"]')),r=null!==(n=null===(t=i.current)||void 0===t?void 0:t.getBoundingClientRect().width)&&void 0!==n?n:0;s(e=>{var t;const l=(null!=a?a:[]).map((a,t)=>{var l,n,i;const r=null!==(n=null===(l=o[t])||void 0===l?void 0:l.getBoundingClientRect().width)&&void 0!==n?n:0;return r>0?r:null!==(i=null==e?void 0:e.tabWidths[t])&&void 0!==i?i:0}),n=r>0?r:null!==(t=null==e?void 0:e.moreButtonWidth)&&void 0!==t?t:0,i=(null==e?void 0:e.tabWidths.length)===l.length&&e.tabWidths.every((e,a)=>e===l[a]);return e&&i&&e.moreButtonWidth===n?e:{tabWidths:l,moreButtonWidth:n}})},[a,e]);const h=e=>{var a,t;void 0!==e&&(null==d||d.selectionManager.setFocused(!0),null==d||d.selectionManager.setFocusedKey(e),null==d||d.setSelectedKey(e),null===(t=null===(a=l.current)||void 0===a?void 0:a.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===t||t.focus())};return{ref:l,moreButtonRef:i,visibleIndexes:p,overflowIndexes:x,handleKeyDownCapture:e=>{var a;if(0===x.length)return;const t=document.activeElement===i.current,l=null==d?void 0:d.selectionManager.focusedKey,n=t?-1:b.indexOf(Number(l));if(t||-1!==n)switch(e.key){case"ArrowRight":if(t)return;return e.preventDefault(),e.stopPropagation(),void(n<b.length-1?h(b[n+1]):null===(a=i.current)||void 0===a||a.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(t?h(b[b.length-1]):n>0&&h(b[n-1]));case"Home":if(t)return;return e.preventDefault(),e.stopPropagation(),void h(b[0]);case"End":if(t)return;return e.preventDefault(),e.stopPropagation(),void h(b[b.length-1])}}}})({overflowEnabled:y,childrenArray:N}),S=a.createElement("span",{className:"maxio-tabs__tab__content"},u,a.createElement(Ve,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),P=R.map(e=>{return`#${a=f,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(a):a.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var a});return a.createElement("div",{id:f,className:w,ref:I,onKeyDownCapture:C},P.length>0&&a.createElement("style",null,`${P.join(", ")} { display: none; }`),a.createElement(we,{"aria-label":i,className:"maxio-contents",...p},(null!=N?N:[]).map((e,a)=>o(e,{key:a,value:a}))),y&&R.length>0&&a.createElement(Y,{isOpen:E,onOpenChange:_},a.createElement(U,{ref:k,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":u},S),E&&a.createElement(Wa,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},a.createElement(X,{"aria-label":`${u} tabs`,onAction:e=>{null==h||h.setSelectedKey(e),requestAnimationFrame(()=>{var a,t;null===(t=null===(a=I.current)||void 0===a?void 0:a.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===t||t.focus()})}},R.map(e=>{const t=N[e],{disabled:l,type:n,"aria-label":i,"aria-labelledby":o}=t.props,r="icon"===n?t.props.icon:t.props.children;return a.createElement(Q,{key:e,id:e,isDisabled:!!l,"aria-label":i,"aria-labelledby":o,className:"maxio-tabs__more__item"},r)})))))},rl=({children:e,size:t,sentiment:l,kind:n="primary",leadingIcon:i,trailingIcon:o})=>{const r=x("maxio-tag",`maxio-tag--${n}`,!!l&&`maxio-tag--${l}`,!!t&&`maxio-tag--${t}`);return a.createElement("div",{className:r},i&&a.createElement(Ve,{variant:i,className:"maxio-tag__icon"}),a.createElement("span",{className:"maxio-tag__label"},e),o&&a.createElement(Ve,{variant:o,className:"maxio-tag__icon"}))},sl=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__header",t),...l},e);sl.displayName="Card.Header";const cl=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__body",t),...l},e);cl.displayName="Card.Body";const ml=({children:e,className:t,...l})=>a.createElement("div",{className:x("maxio-card__footer",t),...l},e);ml.displayName="Card.Footer";const dl=({children:e,className:t,variant:l="primary",...n})=>a.createElement("div",{className:x("maxio-card",`maxio-card--${l}`,t),...n},e);dl.displayName="Card";const ul=Object.assign(dl,{Header:sl,Body:cl,Footer:ml}),pl=({children:e,className:t,href:l,onClick:n,target:i,disabled:o})=>{const r=l||n;if(!r)return a.createElement("div",{className:"maxio-tile"},e);const s=x("maxio-tile",t,{"maxio-tile--clickable":r,"maxio-tile--disabled":o});return a.createElement("a",{className:s,href:l,target:i,onClick:e=>{o&&l&&e.preventDefault(),!o&&n&&n()}},e)};var vl,gl,xl,bl;function hl(){return hl=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var l in t)({}).hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},hl.apply(null,arguments)}const fl=a=>e.createElement("svg",hl({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},a),vl||(vl=e.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),gl||(gl=e.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),xl||(xl=e.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),bl||(bl=e.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),El=e=>{const{size:t="sm",className:l,variant:n="lockup",alt:i="maxio logo"}=e,o="mark"===n,r="number"==typeof t;return a.createElement(fl,{role:"img",viewBox:o?"0 0 240 240":"0 0 1036 240","aria-label":i,height:r?t:void 0,className:x("maxio-logo",!r&&`maxio-logo--${t}`,o&&"maxio-logo--mark",l)})},_l=({state:e,...l})=>{var n,i;const o=t(null),{toastProps:r,contentProps:s,titleProps:c,closeButtonProps:m}=Be(l,e,o),{closable:d=!0,underline:u=!0,external:p=!1}=l.toast.content,v=x("maxio-toast",{[`maxio-toast--${l.toast.content.sentiment}`]:l.toast.content.sentiment}),g={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[l.toast.content.sentiment||"default"];return a.createElement("div",{className:v,"data-maxio-mode":"dark",...r,ref:o},a.createElement(Ve,{variant:g,className:"maxio-toast__icon"}),a.createElement("div",{className:"maxio-toast__container",...s},a.createElement("div",{className:"maxio-toast__content",...c},l.toast.content.title&&a.createElement("span",{className:"maxio-toast__title"},l.toast.content.title),l.toast.content.message&&a.createElement("span",{className:"maxio-toast__message"},l.toast.content.message),(null===(n=l.toast.content.link)||void 0===n?void 0:n.text)&&(null===(i=l.toast.content.link)||void 0===i?void 0:i.href)&&a.createElement(Ue,{href:l.toast.content.link.href,underline:u,external:p},l.toast.content.link.text))),d&&a.createElement(Qe,{variant:"ghost",icon:a.createElement(Ve,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss",...m}))},wl=({state:e,...t})=>{const l=a.useRef(null),{regionProps:n}=Le(t,e,l);return a.createElement("div",{...n,ref:l,className:t.className,style:{display:"flex",flexDirection:"column",gap:"10px"}},e.visibleToasts.map(t=>a.createElement(_l,{key:t.key,toast:t,state:e})))},Nl=({children:e,...t})=>{const{maxVisibleToasts:l=5,...n}=t,i=Oe({maxVisibleToasts:l,...n});return a.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),a.createElement(a.Fragment,null,e(i),i.visibleToasts.length>0&&a.createElement(wl,{...t,state:i}))},yl=s(null),Il=({children:e,toastQueue:t,...l})=>{const n=ze(t),i=p(()=>{n.visibleToasts.forEach(e=>{t.close(e.key)})},[n.visibleToasts,t]),o=u(()=>({addToast:t.add.bind(t),removeToast:t.clear.bind(t),removeAllToasts:i,state:n}),[t,i,n]);return a.createElement(yl.Provider,{value:o},e,n.visibleToasts.length>0&&a.createElement(wl,{...l,state:n}))},kl=()=>{const e=m(yl);if(!e)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return e};class Rl extends Ae{}const Cl=({defaultChecked:e,checked:t,onChange:l,disabled:n,valueDescription:i,valueDescriptionPosition:o,className:r,name:s,id:m,...d})=>{const u=c(),v="boolean"==typeof e,g=m||u,b="left"===o?"row":"row-reverse",h=i&&o,f=p(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const a=e.currentTarget.checked;v&&(e.currentTarget.checked=!a),l&&l(!a,e)}},[v,l]),E=d["aria-label"]||(h?void 0:i);return a.createElement("div",{className:x("maxio-toggle",r,{"maxio-toggle--disabled":n}),style:{display:"inline-flex",flexDirection:b},"data-testid":"toggle-container"},h?a.createElement("label",{className:"maxio-toggle__label",htmlFor:g},i):null,a.createElement("div",{className:"maxio-toggle__container"},a.createElement("input",{type:"checkbox",defaultChecked:e,checked:t,onChange:e=>{l&&l(e.target.checked,e)},onKeyDown:f,disabled:n,className:"maxio-toggle__checkbox",id:g,name:s,"aria-label":E}),a.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":t,"aria-hidden":"true"},a.createElement("div",{className:"maxio-toggle__handle"}),a.createElement("span",{className:"maxio-toggle__icon"},a.createElement("i",{className:"maxio-toggle__icon-on"})),a.createElement("span",{className:"maxio-toggle__icon"},a.createElement("i",{className:"maxio-toggle__icon-off"})))))},Sl=({children:e,actions:t,sideNavIsClosed:l,openSideNav:n})=>a.createElement("nav",{className:"maxio-top-bar"},l&&a.createElement(Qe,{"aria-label":"Open Side Navigation",variant:"ghost",icon:a.createElement(Ve,{variant:"sidebar"}),onClick:n}),a.createElement(rt,{grow:!0,justifyContent:"end"},e),t),Pl=({...e})=>{const l=t(null),{buttonProps:n}=f(e,l);return a.createElement("button",{...n,className:"maxio-chip__dismiss-button"},a.createElement(Ve,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},$l=({label:e,onDismiss:l,dismissLabel:n,leadingIcon:i,trailingIcon:o,title:r,...s})=>{const c=t(null),m=V(s),{buttonProps:d}=P(s,m,c),u=x("maxio-chip",{"maxio-chip--selected":null==m?void 0:m.isSelected}),p=x("maxio-chip__button",{"maxio-chip--dismissible":l});return a.createElement("div",{className:u},a.createElement("button",{className:p,ref:c,...d,title:r},i&&a.createElement(Ve,{variant:i,className:"maxio-chip__icon"}),a.createElement("span",{className:"maxio-chip__label"},e),o&&!l&&a.createElement(Ve,{variant:o,className:"maxio-chip__icon"})),l&&a.createElement(Pl,{onPress:l,"aria-label":n}))},Dl=({children:e,templateColumns:t,templateRows:l,autoColumns:n,autoRows:i,inline:o,column:r,columnStart:s,columnEnd:c,row:m,rowStart:d,rowEnd:u,gap:p,gapX:v,gapY:g,className:b,justifyContent:h,alignItems:f,...E})=>{const _=x(b,{"maxio-grid":!o,"maxio-inline-grid":o,[`maxio-grid-cols-${t}`]:t,[`maxio-grid-rows-${l}`]:l,[`maxio-auto-cols-${n}`]:n,[`maxio-auto-rows-${i}`]:i,["maxio-col-"+("auto"===r?"auto":`span-${r}`)]:r,[`maxio-col-start-${s}`]:s,[`maxio-col-end-${c}`]:c,["maxio-row-"+("auto"===m?"auto":`span-${m}`)]:m,[`maxio-row-start-${d}`]:d,[`maxio-row-end-${u}`]:u,[`maxio-gap-${p}`]:void 0!==p,[`maxio-gap-x-${v}`]:void 0!==v,[`maxio-gap-y-${g}`]:void 0!==g,[`maxio-justify-${h}`]:h,[`maxio-items-${f}`]:f});return a.createElement("div",{className:_||void 0,...E},e)},Tl={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"},Ml=({children:e,heading:t,description:l,sentiment:n="success",leadingElement:i=null,alert:o,topAddon:r=null,footer:s})=>a.createElement("div",{className:"maxio-auth-layout"},a.createElement(rt,{alignItems:"center",justifyContent:"between"},a.createElement(El,{size:"md"}),r),o&&a.createElement(Je,{display:"block",title:o.title,sentiment:o.sentiment},o.children),a.createElement(ul,{variant:"secondary"},a.createElement(ul.Body,null,a.createElement(rt,{flexDirection:"col",gap:6},a.createElement(rt,{flexDirection:"col",gap:2},a.createElement(rt,{alignItems:"center",gap:2},i,a.createElement(at,{size:"lg",className:x("maxio-auth-layout__heading",Tl[n])},t)),l&&a.createElement(rt,{style:{color:"var(--maxio-color-text-tertiary)"}},a.createElement(lt,{size:"sm",className:"maxio-auth-layout__description"},l))),e)),s&&a.createElement(ul.Footer,null,s)));export{qe as ActionList,Je as Alert,Ml as AuthLayout,ra as Avatar,sa as Banner,lt as Body,pa as Breadcrumbs,ca as BreadcrumbsItem,Xe as Button,ul as Card,Oa as Checkbox,Ba as CheckboxGroup,$l as Chip,it as Code,Ct as ComboBox,Ja as DataTable,nt as Display,tt as Drawer,st as EmptyState,rt as Flex,Aa as FormErrorMessage,za as FormHelperText,Il as GlobalToastProvider,Dl as Grid,at as Heading,Ve as Icon,Qe as IconButton,ot as Label,Ue as Link,Nt as ListBox,Ge as LoadingSpinner,El as Logo,na as Menu,oa as MenuButton,ia as MenuList,gt as OverlayTrigger,zt as Pagination,Wa as Popover,At as ProgressBar,Pt as Radio,$t as RadioGroup,Wt as SegmentedControl,Ot as Select,Jt as SideNav,el as Tab,ol as TabList,nl as TabPanel,il as TabPanels,ll as Tabs,rl as Tag,Tt as TextArea,Dt as TextField,Mt as TextInput,pl as Tile,Nl as ToastProvider,Rl as ToastQueue,Cl as Toggle,xt as Tooltip,ht as TooltipTrigger,Sl as TopBar,vt as useElementResizeObserver,ut as useHover,dt as useOverlayTrigger,kl as useToast,pt as useWindowSize};
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("classnames"),a=require("react-aria"),l=require("@react-aria/utils"),n=require("@tanstack/react-table"),i=require("@atlaskit/pragmatic-drag-and-drop/element/adapter"),o=require("@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item"),r=require("@react-stately/toggle"),s=require("@react-stately/checkbox"),c=require("react-aria-components"),d=require("framer-motion"),m=require("@floating-ui/react-dom-interactions"),u=require("@react-stately/radio"),p=require("@react-stately/toast"),g=require("@react-aria/toast");function x(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var v=x(e);const b=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],f=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],h=["avalara","pipedrive","quickbooks","salesforce","xero"],E=({variant:a,color:l,className:n,size:i})=>{const o=(e,t)=>t.includes(e),r=o(a,b)||o(a,f),s=o(a,h),c=t({"fa-kit":r,"fa-kit-duotone":s,"fa-sharp fa-regular":!r&&!s,[`fa-${a}`]:!0,[`fa-${i}`]:i,[`maxio-icon--${l}`]:l&&!o(a,f)&&!o(a,h)},n);return e.createElement("i",{className:c})},_=({item:l,isSelected:n,truncateLabel:i=!1,role:o="option",small:r=!1})=>{const s=e.useRef(null),c=e.useRef(!1),d=a.useId();if(e.useEffect(()=>{var e;n&&c.current&&(null===(e=s.current)||void 0===e||e.focus())},[n]),e.useEffect(()=>{c.current=!0},[]),"divider"===l.type)return e.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:m,leadingIconClassName:u,trailingIconName:p,label:g,description:x,link:v}=l,b=t("maxio-action-list__label",{"maxio-truncate":i});return e.createElement("a",{"aria-labelledby":d,...v,className:t("maxio-action-list__content",v.className,{"maxio-action-list__content--size-small":r}),tabIndex:n?0:-1,ref:s,role:o},m&&e.createElement(E,{variant:m,className:t("maxio-action-list__leading-icon",u)}),e.createElement("span",{className:b,id:d},g),x&&e.createElement("span",{className:"maxio-action-list__description"},x),p&&e.createElement(E,{variant:p,className:"maxio-action-list__trailing-icon"}))},w=(e,t,a)=>0===e?e:1===e&&"divider"===t[e-1].type?a||e:"divider"===t[e-1].type?w(e-1,t,a||e):e-1,N=({items:a,isShadowed:l=!0,itemProps:n={},className:i,truncateLabels:o=!1,small:r=!1,...s})=>{const c=t("maxio-action-list",i,{"maxio-action-list--shadow":l}),[d,m]=e.useState(()=>a.findIndex(e=>"divider"!==e.type));return 0===a.length?null:e.createElement("div",{className:c,onKeyDown:e=>{if("Space"===e.code||"Enter"===e.code){const e=a[d];e&&"divider"!==e.type&&window.open(e.link.href,e.link.target||"_self")}"ArrowUp"===e.code&&(e.preventDefault(),m(e=>w(e,a))),"ArrowDown"===e.code&&(e.preventDefault(),m(e=>((e,t)=>{const a=t.findIndex((t,a)=>"divider"!==t.type&&a>e);return-1===a?e:a})(e,a)))},role:"listbox",...s},a.map((t,a)=>e.createElement(_,{item:t,truncateLabel:o,key:`listbox-${t.id}`,isSelected:a===d,small:r,...n})))},y=({className:a,children:l,disabled:n,external:i,icon:o,size:r="sm",underline:s,variant:c,...d})=>{const m=t("maxio-link",{[`maxio-link--${r}`]:r,"maxio-link--disabled":n,[`maxio-link--${c}`]:c,"maxio-link--underline":s},a),u=i?"_blank":"_self";return e.createElement("a",{className:m,target:u,...d},l,o&&e.createElement(E,{variant:o,className:"maxio-link__icon"}))},I=({size:a="md",white:l=!1,className:n})=>{const i=t("maxio-loading-spinner",n,`maxio-loading-spinner--${a}`,{"maxio-loading-spinner--white":l});return e.createElement("div",{className:i,role:"status","aria-label":"loading"})},R=e.forwardRef(({fullWidth:n=!1,leadingElement:i,trailingElement:o,icon:r,variant:s="primary",size:c,...d},m)=>{const u=l.useObjectRef(m),{linkProps:p}=a.useLink({...d},u),g=t("maxio-button",d.className,{[`maxio-button--${c}`]:c,[`maxio-button--${s}`]:s,"maxio-button--full-width":n});return e.createElement("a",{...p,ref:u,className:g,href:d.href},i&&e.cloneElement(i,{...e.isValidElement(i)&&{className:"maxio-button__leading-element"}}),d.children,(o||r)&&e.cloneElement(o||r,{...e.isValidElement(o||r)&&{className:"maxio-button__trailing-element"}}))}),C=e.forwardRef(({disabled:n,loading:i=!1,fullWidth:o=!1,leadingElement:r,trailingElement:s,icon:c,variant:d="primary",size:m,...u},p)=>{const g=l.useObjectRef(p),{buttonProps:x}=a.useButton({...u,isDisabled:n,formAction:"string"==typeof u.formAction?u.formAction:void 0},g),v=["primary","danger"].includes(d),b=t("maxio-button",u.className,{[`maxio-button--${m}`]:m,[`maxio-button--${d}`]:d,"maxio-button--loading":i,"maxio-button--full-width":o});return e.createElement("button",{...x,className:b,ref:g},r&&e.cloneElement(r,{...e.isValidElement(r)&&{className:"maxio-button__leading-element"}}),u.children,!i&&(s||c)&&e.cloneElement(s||c,{...e.isValidElement(s||c)&&{className:"maxio-button__trailing-element"}}),i&&e.createElement(I,{className:"maxio-button__trailing-element",size:"md",white:v}))}),k=e.forwardRef((t,a)=>(e=>"href"in e)(t)?e.createElement(R,{...t,ref:a}):e.createElement(C,{...t,ref:a})),S=({"aria-label":a,className:l,...n})=>e.createElement(k,{"aria-label":a,className:t("maxio-button--icon",l),...n},null),P=({children:a,title:l,linkText:n,linkExternal:i,href:o,display:r="inline",sentiment:s="info",onDismiss:c,className:d})=>{if(!a&&!l)return console.warn("Alert component requires either children or title prop to be rendered"),null;const m=t("maxio-alert",{[`maxio-alert--${s}`]:"info"!==s&&s},d),u={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],p=t("maxio-alert__content",{"maxio-alert__content--block":"block"===r});return e.createElement("div",{className:m},e.createElement(E,{variant:u,className:"maxio-alert__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-alert__container"},e.createElement("div",{className:p},l&&e.createElement("span",{className:"maxio-alert__title"},l),a&&e.createElement("span",{className:"maxio-alert__message"},a),n&&o&&e.createElement(y,{className:"maxio-alert__link",href:o,variant:"high-contrast",underline:!0,...i?{external:!0}:{}},n))),c&&e.createElement(S,{icon:e.createElement(E,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-alert__dismiss"}))},T=e.createContext({}),$=({children:t})=>{const[a,l]=e.useState(!1),n=e.useId(),i=e.useId();return e.createElement(T.Provider,{value:{controlsId:n,buttonId:i,isOpen:a,onClose:()=>l(!1),onOpen:()=>l(!0),onToggle:()=>l(e=>!e)}},t)};function D(){const t=e.useContext(T);if(!t||"object"==typeof t&&0===Object.keys(t).length)throw new Error("useMenu hook must be used within a MenuProvider");return t}const M=({children:t})=>{const{isOpen:a,onToggle:l,onClose:n}=D();return e.createElement("details",{open:a,onToggle:l,className:"maxio-action-menu"},"function"==typeof t?t({isOpen:a,onClose:n}):t)},O=({children:a,className:l,href:n,...i})=>{const o=n?e.createElement(y,{size:"sm",href:n},a):a;return e.createElement("li",{className:t("maxio-breadcrumbs__item",l),...i},o)},B="Breadcrumbs requires at least one BreadcrumbsItem as children",z='Last BreadcrumbsItem should not have "href" prop. It is the current page.',A="Breadcrumbs only accepts BreadcrumbsItem as children",L="row-controls",F="row-actions",H=({children:a,pattern:l,size:n,isExpandable:i,isUsingCustomRow:o})=>{const[r,s]=e.useState(!1),[c,d]=e.useState(!1),m=l&&o&&i,u=t("maxio-data-table",{"maxio-data-table--pattern":l&&!m,"maxio-data-table--expanded-child-pattern":m,"maxio-data-table--with-custom-row":o,[`maxio-data-table--${n}`]:n,"maxio-data-table--with-pinned-left-border":r,"maxio-data-table--with-pinned-right-border":c});return e.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const t=e.target;s(t.scrollLeft>0),d(t.scrollWidth-t.clientWidth-t.scrollLeft>0)}},e.createElement("table",{className:u},a))},V=({children:t})=>e.createElement("thead",null,t),W=({children:t})=>e.createElement("tbody",null,t),j=({children:a,table:l,header:n,className:i,enableExpanding:o,...r})=>{var s,c,d,m,u,p,g,x,v,b,f;const h=null==n?void 0:n.column,_=null===(s=null==h?void 0:h.getCanSort)||void 0===s?void 0:s.call(h),w=null===(c=null==h?void 0:h.getToggleSortingHandler)||void 0===c?void 0:c.call(h),N=null==n?void 0:n.isPlaceholder,y=null===(m=null===(d=null==h?void 0:h.columnDef)||void 0===d?void 0:d.meta)||void 0===m?void 0:m.align,I=null===(p=null===(u=null==h?void 0:h.columnDef)||void 0===u?void 0:u.meta)||void 0===p?void 0:p.width,R=null===(x=null===(g=null==h?void 0:h.columnDef)||void 0===g?void 0:g.meta)||void 0===x?void 0:x.controls,C=null===(b=null===(v=null==h?void 0:h.columnDef)||void 0===v?void 0:v.meta)||void 0===b?void 0:b.actions,k=null==h?void 0:h.getIsPinned(),P=null==h?void 0:h.getIsSorted(),T="asc"===P,$=t("maxio-data-table__cell",i,{[`maxio-data-table__cell--pinned-${k}`]:k,"maxio-data-table__cell--sortable":_,"maxio-data-table__cell--active":P,[`maxio-data-table__cell--${y}`]:y,"maxio-data-table__cell--controls":R,"maxio-data-table__cell--actions":C}),D={...I?{width:I}:{},..."left"===k?{left:null==h?void 0:h.getStart("left")}:"right"===k?{right:null==h?void 0:h.getAfter("right")}:{}},M=((e,t)=>e&&t?"arrow-up":e&&!t?"arrow-down":"arrow-down-up")(!!P,T),O=null==l?void 0:l.getToggleAllRowsExpandedHandler(),B=null===(f=null==l?void 0:l.getIsAllRowsExpanded)||void 0===f?void 0:f.call(l),z=(null==n?void 0:n.headerGroup.headers[0].id)===L?1:0,A=o&&(null==n?void 0:n.index)===z;return N?null:e.createElement("th",{scope:"col",role:"columnheader","aria-sort":P?T?"ascending":"descending":"none",className:$,onClick:w,colSpan:null==n?void 0:n.colSpan,style:D,...r},e.createElement("div",{className:"maxio-data-table__cell-flex"},!0===o&&A&&e.createElement(S,{size:"sm",variant:"ghost",icon:e.createElement(E,{size:"xs",variant:B?"chevron-down":"chevron-right"}),onClick:O,"aria-label":B?"Collapse all rows":"Expand all rows","data-open":B,className:"maxio-data-table__expand-button"}),a,_&&e.createElement(E,{variant:M,className:"maxio-data-table__sort-icon"})))},q=e=>{var t;return null!==(t=e.subRows)&&void 0!==t?t:[]},G=(e,t)=>Object.assign({},e,{subRows:t}),K=(e,t,a=[])=>{for(let l=0;l<e.length;l+=1){const n=e[l],i=[...a,l];if(n===t)return i;const o=K(q(n),t,i);if(o)return o}return null},U=(e,t)=>{const[a,...l]=t,n=e[a];if(!n)return null;const i=[...e];if(0===l.length)return i.splice(a,1),{data:i,item:n};const o=U(q(n),l);return o?(i[a]=G(n,o.data),{data:i,item:o.item}):null},Z=(e,t,a,l)=>{const n=[...e];if(0===t.length)return n.splice(a,0,l),n;const[i,...o]=t,r=e[i];if(!r)return null;const s=Z(q(r),o,a,l);return s?(n[i]=G(r,s),n):null},Y=(e,t)=>{let a,l=e;for(const e of t){if(a=l[e],!a)return;l=q(a)}return a},Q="maxio-data-table-row",X=e.createContext(null),J=()=>e.useContext(X),ee=e=>e.type===Q&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,te=e=>{const t=(e=>{const t=o.extractInstruction(e);return t&&"instruction-blocked"!==t.type?"reorder-above"===t.type?"before":"reorder-below"===t.type?"after":"make-child"===t.type?"inside":null:null})(e);return"string"==typeof e.rowId&&t?{rowId:e.rowId,position:t}:null},ae=({availability:t,children:a,data:l,enableExpanding:n,getRowReorderLabel:r,onRowReorder:s,rowReorderMode:c,table:d})=>{const m=`maxio-data-table-${e.useId()}`,[u,p]=e.useState(""),[g,x]=e.useState(null),[v,b]=e.useState(null),f=e.useRef(null),h=e.useCallback(e=>d.getCoreRowModel().rowsById[e],[d]),E=e.useCallback(e=>{var t;return null!==(t=null==r?void 0:r(e))&&void 0!==t?t:e.id},[r]),_=e.useCallback((e,t)=>{const a=h(e),i=h(t.rowId);if(!a||!i)return null;const o=((e,t,a,l,n)=>{var i,o;if(t.id===a.id||!((e,t,a,l)=>{var n,i;return"all"===l||("siblings"===l?"inside"!==a&&(null!==(n=e.parentId)&&void 0!==n?n:null)===(null!==(i=t.parentId)&&void 0!==i?i:null):"inside"===a?e.depth===t.depth+1:e.depth===t.depth)})(t,a,l,n))return null;const r=K(e,t.original),s=K(e,a.original);if(!r||!s||(d=s,(c=r).length<d.length&&c.every((e,t)=>d[t]===e)))return null;var c,d;const m=U(e,r);if(!m)return null;const u=((e,t)=>{const a=[...e],l=t.length-1;return l>=0&&e.length>l&&t.slice(0,l).every((t,a)=>e[a]===t)&&t[l]<e[l]&&(a[l]-=1),a})(s,r),p=u[u.length-1];if(void 0===p)return null;const g="inside"===l?u:u.slice(0,-1),x=Y(m.data,u);if(!x)return null;const v="inside"===l?q(x).length:p+("after"===l?1:0),b={parentRowId:"inside"===l?a.id:null!==(i=a.parentId)&&void 0!==i?i:null,index:v},f={parentRowId:null!==(o=t.parentId)&&void 0!==o?o:null,index:t.index};if(f.parentRowId===b.parentRowId&&f.index===b.index)return null;const h=Z(m.data,g,v,m.item);return h?{data:h,source:f,destination:b}:null})(l,a,i,t.position,c);return o&&!n&&null!==o.destination.parentRowId&&o.destination.parentRowId!==o.source.parentRowId?null:o},[l,n,h,c]),w=e.useCallback(e=>{f.current=e,x(e)},[]),N=e.useCallback((e,t)=>{const a=h(e),l=h(t.rowId),n=_(e,t);return a&&l&&n?(s({...n,row:a,rowId:a.id,targetRow:l,targetRowId:l.id,position:t.position}),p(`${E(a)} moved ${i=E(l),o=t.position,"inside"===o?`inside ${i}`:`${o} ${i}`}.`),!0):(p("That row cannot be moved to this position."),!1);var i,o},[E,_,h,s]),y=e.useCallback((e,{input:t,element:a,source:l})=>{const n={rowId:e.id,instanceId:m},i=o.attachInstruction(n,{element:a,input:t,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),r=te(i),s=ee(l.data)&&l.data.instanceId===m&&Boolean(r&&_(l.data.rowId,r));return{...i,isValid:s}},[_,m]),I=e.useCallback((e,a)=>{if(!t.available)return()=>{};const l=e=>{const t=e.isValid?te(e):null;w(t)};return i.dropTargetForElements({element:a,canDrop:({source:t})=>ee(t.data)&&t.data.instanceId===m&&t.data.rowId!==e.id&&!e.getParentRows().some(e=>e.id===t.data.rowId),getData:t=>y(e,t),onDragEnter:({self:e})=>l(e.data),onDrag:({self:e})=>l(e.data),onDragLeave:()=>{var t;(null===(t=f.current)||void 0===t?void 0:t.rowId)===e.id&&w(null)}})},[t,y,m,w]),R=e.useCallback((e,a)=>{const l=a.closest("tr");return t.available&&l instanceof HTMLElement?i.draggable({element:l,dragHandle:a,getInitialData:()=>({type:Q,instanceId:m,rowId:e.id})}):()=>{}},[t,m]);e.useEffect(()=>{if(t.available)return i.monitorForElements({canMonitor:({source:e})=>ee(e.data)&&e.data.instanceId===m,onDragStart:({source:e})=>{if(!ee(e.data))return;const t=h(e.data.rowId);b(e.data.rowId),t&&p(`${E(t)} grabbed. Choose a destination.`)},onDrop:({source:e,location:t})=>{var a;if(ee(e.data)){const l=null===(a=t.current.dropTargets[0])||void 0===a?void 0:a.data,n=!0===(null==l?void 0:l.isValid)?te(l):null;n?N(e.data.rowId,n):p("Row move cancelled.")}b(null),w(null)}})},[N,t,E,h,m,w]),e.useEffect(()=>{if("inside"!==(null==g?void 0:g.position))return;const e=h(g.rowId);if(!(null==e?void 0:e.getCanExpand())||e.getIsExpanded())return;const t=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(t)},[g,h]);const C=e.useCallback(e=>{var a;if(!t.available)return[];const l=e.parentId?h(e.parentId):null,n=null!==(a=null==l?void 0:l.subRows)&&void 0!==a?a:d.getCoreRowModel().rows,i=n.findIndex(t=>t.id===e.id);if(-1===i)return[];const o=n[i-1],r=n[i+1],s=n[0],c=n[n.length-1],m=[];if(i>1&&s&&m.push({id:"top",label:"Move to top",target:{rowId:s.id,position:"before"}}),o&&m.push({id:"up",label:"Move up",target:{rowId:o.id,position:"before"}}),r&&m.push({id:"down",label:"Move down",target:{rowId:r.id,position:"after"}}),i<n.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),l){let e=l;for(;e.parentId;){const t=h(e.parentId);if(!t)break;e=t}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return d.getCoreRowModel().flatRows.forEach(t=>{t.id!==e.parentId&&m.push({id:`move-to:${t.id}`,label:`Move to ${E(t)}`,target:{rowId:t.id,position:"inside"}})}),m.filter(t=>Boolean(_(e.id,t.target)))},[t,E,_,h,d]),k=e.useCallback(e=>{var a;if(!t.available)return!1;const l=e.parentId?h(e.parentId):null;return(null!==(a=null==l?void 0:l.subRows)&&void 0!==a?a:d.getCoreRowModel().rows).length>1||"siblings"!==c&&("all"===c?Boolean(l):!(!n||0===e.depth)&&d.getCoreRowModel().flatRows.some(t=>t.depth===e.depth-1&&t.id!==e.parentId))},[t,n,h,c,d]),S=e.useMemo(()=>({activeTarget:g,availability:t,draggingRowId:v,getActions:C,getLabel:E,hasActions:k,moveRow:N,registerHandle:R,registerRow:I}),[g,t,N,v,C,E,k,R,I]);return e.createElement(X.Provider,{value:S},a,e.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},u))},le=({children:l,row:n,isChild:i,isHeader:o,className:r,onRowAction:s,...c})=>{var d,m,u,p,g;const x=null===(d=null==n?void 0:n.getIsSelected)||void 0===d?void 0:d.call(n),v=(null===(m=null==n?void 0:n.getCanExpand)||void 0===m?void 0:m.call(n))&&(null===(u=null==n?void 0:n.getIsExpanded)||void 0===u?void 0:u.call(n)),b=Boolean(n&&s&&!o&&!i),f=e.useRef(null),h=J(),E=null==h?void 0:h.registerRow,_=e.useRef(null),w=e=>{_.current=e.target},{pressProps:N}=a.usePress({isDisabled:!b,onPress:e=>{var t;const a=null!==(t=_.current)&&void 0!==t?t:e.target;_.current=null,n&&s&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(a)&&s(n)}}),{focusProps:y,isFocused:I}=a.useFocusRing(),R=t({"maxio-data-table__row":!o,"maxio-data-table__header-row":o,"maxio-data-table__row--active":x||I,"maxio-data-table__row--expanded":v,"maxio-data-table__row--expanded-child":i,"maxio-data-table__row--actionable":b,"maxio-data-table__row--dragging":Boolean(n)&&(null==h?void 0:h.draggingRowId)===(null==n?void 0:n.id),[`maxio-data-table__row--drop-${null===(p=null==h?void 0:h.activeTarget)||void 0===p?void 0:p.position}`]:Boolean(n)&&(null===(g=null==h?void 0:h.activeTarget)||void 0===g?void 0:g.rowId)===(null==n?void 0:n.id)},r);e.useEffect(()=>{if(n&&E&&f.current&&!o&&!i)return E(n,f.current)},[i,o,E,n]);const C=b?a.mergeProps({onClickCapture:w,onKeyDownCapture:w,tabIndex:0},N,y,c):c;return e.createElement("tr",{...C,ref:f,className:R,tabIndex:b?C.tabIndex:c.tabIndex},l)},ne=e.createContext({}),ie=e.forwardRef(({checked:a,disabled:l,invalid:n,indeterminate:i,className:o,inputProps:r,error:s,label:c},d)=>{const m=t("maxio-checkbox",{"maxio-checkbox--checked":a,"maxio-checkbox--disabled":l,"maxio-checkbox--error":n,"maxio-checkbox--indeterminate":i},o);return e.createElement("label",{className:m},e.createElement("input",{type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:d,...r}),e.createElement("span",{className:"maxio-checkbox__control"},s&&e.createElement("span",{className:"maxio-checkbox__control-error"})),c&&e.createElement("span",{className:"maxio-checkbox__label"},c))});ie.displayName="InnerCheckbox";const oe=({label:t,error:l=!1,className:n,indeterminate:i,value:o="",disabled:s,readOnly:c,defaultChecked:d,checked:m,...u})=>{const p=e.useRef(null),g=e.useContext(ne),{inputProps:x,isDisabled:v,isInvalid:b,isSelected:f}=g&&Object.keys(g).length>0?a.useCheckboxGroupItem({value:o,"aria-label":null!=t?t:u["aria-label"],isDisabled:s,isInvalid:l,isIndeterminate:i,isReadOnly:c,...u},g,p):a.useCheckbox({"aria-label":null!=t?t:u["aria-label"],isDisabled:s,isInvalid:l,isIndeterminate:i,isReadOnly:c,value:o,...u},r.useToggleState({...u,isSelected:m,defaultSelected:d}),p);return e.createElement(ie,{inputProps:x,checked:f,disabled:v,invalid:b,indeterminate:i,className:n,error:l,label:t,ref:p,...u})},re=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-form-helper-text",l),...n},a),se=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-form-error",l),...n},e.createElement(E,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},a)),ce=({table:t,enableRowSelection:a,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==t?void 0:t.getToggleAllPageRowsSelectedHandler)||void 0===n?void 0:n.call(t),c=(null===(i=null==t?void 0:t.getIsAllPageRowsSelected)||void 0===i?void 0:i.call(t))||(null===(o=null==t?void 0:t.getIsAllRowsSelected)||void 0===o?void 0:o.call(t)),d=null===(r=null==t?void 0:t.getIsSomePageRowsSelected)||void 0===r?void 0:r.call(t);return a?e.createElement(e.Fragment,null,l&&e.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),e.createElement(oe,{"aria-label":"Select all rows",onChange:e=>{s("boolean"==typeof e?{target:{checked:e}}:e)},checked:c,indeterminate:!c&&d})):null},de=({className:a,hideArrow:l=!1,children:n,offset:i=4,...o})=>e.createElement(c.Popover,{...o,className:t("maxio-popover",a),offset:i},e.createElement(e.Fragment,null,!l&&e.createElement(c.OverlayArrow,{className:"maxio-popover__arrow"},e.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},e.createElement("path",{d:"M0 0 L6 6 L12 0"}))),n)),me=({row:t})=>{var a,l;const n=J(),i=null==n?void 0:n.registerHandle,o=null==n?void 0:n.getActions,r=null==n?void 0:n.hasActions,s=e.useRef(null),[d,m]=e.useState(!1),u=(null==n?void 0:n.draggingRowId)===t.id,p=null!==(a=null==n?void 0:n.getLabel(t))&&void 0!==a?a:t.id,g=e.useMemo(()=>{var e;return null!==(e=null==r?void 0:r(t))&&void 0!==e&&e},[r,t]),x=e.useMemo(()=>{var e;return d&&null!==(e=null==o?void 0:o(t))&&void 0!==e?e:[]},[o,d,t]),v=null!==(l=n&&!n.availability.available?n.availability.message:void 0)&&void 0!==l?l:g?void 0:`No moves are available for ${p}.`;e.useEffect(()=>{if(i&&s.current&&!v)return i(t,s.current)},[i,t,v]),e.useEffect(()=>{v&&m(!1)},[v]);const b=e.createElement(c.Button,{ref:s,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${p}`,"aria-pressed":u,"aria-disabled":!!v||void 0,onPress:()=>{v||m(!0)}},e.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(v?"maxio-icon--disabled":"maxio-icon--secondary")}));return v?e.createElement(c.TooltipTrigger,{delay:0,closeDelay:0},b,e.createElement(c.Tooltip,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},e.createElement("div",{className:"maxio-tooltip__content"},v))):e.createElement(c.MenuTrigger,{trigger:"longPress",isOpen:d,onOpenChange:m},b,e.createElement(de,{placement:"bottom start",hideArrow:!0},e.createElement(c.Menu,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:x,onAction:e=>{const a=x.find(t=>t.id===e);a&&(null==n||n.moveRow(t.id,a.target),requestAnimationFrame(()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}},t=>e.createElement(c.MenuItem,{id:t.id,textValue:t.label,className:"maxio-data-table__reorder-menu-item"},t.label))))},ue=({row:t,enableRowSelection:a,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==t?void 0:t.getToggleSelectedHandler)||void 0===n?void 0:n.call(t),c=(null===(i=null==t?void 0:t.getIsSelected)||void 0===i?void 0:i.call(t))||(null===(o=null==t?void 0:t.getIsAllSubRowsSelected)||void 0===o?void 0:o.call(t)),d=null===(r=null==t?void 0:t.getIsSomeSelected)||void 0===r?void 0:r.call(t),m=t.id||t.index;return e.createElement(e.Fragment,null,l&&e.createElement(me,{row:t}),a&&e.createElement(oe,{"aria-label":`Select row ${m}`,onChange:s,checked:c,indeterminate:d}))},pe=({children:t})=>e.createElement("div",{className:"maxio-data-table__cell-flex"},t),ge=({row:a,cell:l,children:n,className:i,...o})=>{var r,s,c,d,m,u;const p=null==l?void 0:l.column,g=null===(s=null===(r=null==p?void 0:p.columnDef)||void 0===r?void 0:r.meta)||void 0===s?void 0:s.align,x=null===(d=null===(c=null==p?void 0:p.columnDef)||void 0===c?void 0:c.meta)||void 0===d?void 0:d.controls,v=null===(u=null===(m=null==p?void 0:p.columnDef)||void 0===m?void 0:m.meta)||void 0===u?void 0:u.actions,b=null==p?void 0:p.getIsPinned(),f=t("maxio-data-table__cell",i,{[`maxio-data-table__cell--pinned-${b}`]:b,[`maxio-data-table__cell--${g}`]:g,"maxio-data-table__cell--controls":x,"maxio-data-table__cell--actions":v}),h="left"===b?{left:null==p?void 0:p.getStart("left")}:"right"===b?{right:null==p?void 0:p.getAfter("right")}:{};return e.createElement("td",{className:f,style:h,...o},n)},xe=({row:t,SubRowComponent:a,pattern:l,enableExpanding:i,onRowAction:o})=>{var r,s,c,d,m;const u=a&&t.getParentRow()&&t.getParentRow().getIsExpanded(),p=u&&t.getVisibleCells()[0].column.columnDef.id===L,g=u&&t.getVisibleCells()[t.getVisibleCells().length-1].column.columnDef.id===F,x=[g,p].filter(Boolean).length,v=t.getVisibleCells().length-x,b=null!==(s=null===(r=t.getParentRow())||void 0===r?void 0:r.index)&&void 0!==s?s:t.index,f=l&&a&&b%2==1?"maxio-data-table__row--with-pattern":void 0,h=null===(c=t.getCanExpand)||void 0===c?void 0:c.call(t),_=null===(d=null==t?void 0:t.getToggleExpandedHandler)||void 0===d?void 0:d.call(t),w=null===(m=null==t?void 0:t.getIsExpanded)||void 0===m?void 0:m.call(t),N=h&&i?0:1.75,y=t.getVisibleCells()[0].column.columnDef.id===L?1:0,I=t.getVisibleCells().find(({column:e})=>{var t;const{actions:a,controls:l}=null!==(t=e.columnDef.meta)&&void 0!==t?t:{};return!a&&!l}),R=o&&I?I.id:void 0;return e.createElement(e.Fragment,{key:t.id},u?e.createElement(le,{key:`${t.id}-sub`,row:t,isChild:!0,className:f},p&&e.createElement(ge,{className:"maxio-data-table__cell--pinned-left"}),e.createElement(ge,{colSpan:v},a(t)),g&&e.createElement(ge,{className:"maxio-data-table__cell--pinned-right"})):e.createElement(le,{key:`${t.id}-parent`,row:t,className:f,onRowAction:o,"aria-labelledby":R},t.getVisibleCells().map(a=>{const l=i&&a.column.getIndex()===y;return e.createElement(ge,{key:a.id,row:t,cell:a,id:a.id},e.createElement("div",{className:"maxio-data-table__cell-flex",style:i&&l?{paddingLeft:`${(null==t?void 0:t.depth)+N}rem`}:void 0},i&&h&&l&&e.createElement(S,{size:"sm",variant:"ghost",icon:e.createElement(E,{size:"xs",variant:w?"chevron-down":"chevron-right"}),onClick:_,"aria-label":w?"Collapse row":"Expand row","data-open":w,className:"maxio-data-table__expand-button"}),n.flexRender(a.column.columnDef.cell,a.getContext())))})))},ve={available:!0},be={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},fe={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},he={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},Ee=(e=[])=>e.filter(e=>e!==L&&e!==F),_e=[],we=e=>e.subRows,Ne={sm:"h3",md:"h2",lg:"h1"},ye=({children:a,size:l="sm",className:n,...i})=>{const o=Ne[l],r=t(`maxio-heading-${l}`,n);return e.createElement(o,{className:r,...i},a)},Ie={click:m.useClick,hover:e=>m.useHover(e,{delay:100}),focus:m.useFocus,dismiss:m.useDismiss},Re=(e,t)=>t.map(t=>Ie[t](e)),Ce=({placement:t="top",isActive:a=!1,interactions:l=["hover"],floatingElementOffset:n=0,onOverlayUpdate:i,autoHideMs:o})=>{const r=e.useRef(null),{strategy:s,x:c,y:d,context:u,floating:p,reference:g}=m.useFloating({placement:t,open:a,onOpenChange:e=>i(e),middleware:[m.offset(n)]}),{getReferenceProps:x,getFloatingProps:v}=m.useInteractions([...Re(u,l),m.useRole(u,{role:"tooltip"})]);e.useEffect(()=>{r.current&&clearTimeout(r.current),a&&o&&(r.current=window.setTimeout(()=>i(!1),o))},[a,o]);return{isActive:a,refs:{floating:p,reference:g},floatingElementCSSPosition:{position:s,top:null!=d?d:0,left:null!=c?c:0},getReferenceProps:x,getFloatingProps:v}};function ke(t,a=0){const l=e.useRef((new Date).getTime()),n=e.useRef((new Date).getTime()),[i,o]=e.useState(!1);return e.useEffect(()=>{const e=()=>{l.current=(new Date).getTime(),o(!0)},i=()=>{n.current=(new Date).getTime(),window.setTimeout(()=>{l.current-n.current<=0&&o(!1)},a)},r=t&&t.current;return r&&(r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",i)),()=>{r&&(r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",i))}},[t]),i}function Se(t=500){const[a,l]=e.useState(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:t}=window;return{windowWitdh:e,windowHeight:t}}),n=e.useRef(null);return e.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{var e;const{innerWidth:a,innerHeight:i}=window;window.clearTimeout(null!==(e=n.current)&&void 0!==e?e:void 0),n.current=window.setTimeout(()=>{l({windowWitdh:a,windowHeight:i})},t)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t]),a}function Pe(t){const[a,n]=e.useState(()=>{var e,a;return null!==(a=null===(e=t.current)||void 0===e?void 0:e.clientWidth)&&void 0!==a?a:0}),i=()=>{var e,a;const l=null!==(a=null===(e=t.current)||void 0===e?void 0:e.clientWidth)&&void 0!==a?a:0;n(e=>0===l&&e>0?e:l)};return e.useLayoutEffect(i,[t]),l.useResizeObserver({ref:t,onResize:i}),a}const Te=({children:a,usePortal:l=!1,isActive:n=!1,placement:i="top",interactions:o=["hover"],role:r="tooltip",renderOverlay:s,floatingElementOffset:c,motionSettings:u={},autoHideMs:p,onOverlayUpdate:g,className:x})=>{const{getReferenceProps:v,getFloatingProps:b,refs:{floating:f,reference:h},floatingElementCSSPosition:E}=Ce({isActive:n,onOverlayUpdate:g,autoHideMs:p,floatingElementOffset:c,interactions:o,placement:i}),_=e.createElement(d.AnimatePresence,null,n&&e.createElement(d.motion.div,{ref:f,style:E,...u,...b()},s()));return e.createElement(e.Fragment,null,e.createElement("div",{ref:h,className:t("maxio-inline-flex",x),...v(),"data-testid":"overlay-trigger"},a),l?e.createElement(m.FloatingPortal,{id:"maxio-ui-portal"},_):_)},$e=({children:a,arrowPosition:l,size:n="regular",maxWidth:i=160})=>e.createElement("div",{"data-testid":"tooltip",className:t("maxio-tooltip",`maxio-tooltip--${n}`,{[`maxio-tooltip--arrow-${l}`]:l})},e.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:i}},a)),De={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},Me=({children:t,interactions:a=["hover"],placement:l="right",maxWidth:n=160,size:i="regular",renderContent:o,autoHideMs:r,isVisible:s,usePortal:c,className:d,onVisibilityUpdate:m,floatingElementOffset:u=5})=>{const[p,g]=e.useState(!1),x=void 0!==s,v=e.useRef(null),b=e.useCallback(e=>{v.current&&clearTimeout(v.current),v.current=window.setTimeout(()=>{x||g(e),m&&m(e)},50)},[x,m]),f=e.useMemo(()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",a=`translate${t}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:a},animate:{opacity:1,visibility:"visible",transform:`translate${t}(0px)`},exit:{opacity:0,visibility:"hidden",transform:a},transition:{ease:[.4,0,.5,1],duration:.2}}})(l),[l]);return e.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]),e.createElement(Te,{role:"tooltip",className:d,floatingElementOffset:u,motionSettings:f,isActive:x?s:p,onOverlayUpdate:b,autoHideMs:r,usePortal:c,placement:l,interactions:a,renderOverlay:()=>e.createElement($e,{size:i,arrowPosition:De[l],maxWidth:n},o())},t)},Oe=({as:a="div",children:l,compact:n=!1,size:i="md",className:o,...r})=>{const s=a,c=t({[`maxio-body-${i}`]:!n,[`maxio-body-${i}-compact`]:n},o);return e.createElement(s,{className:c,...r},l)},Be=({className:a,render:l,showSelectAll:n=!1,...i})=>e.createElement(c.ListBox,{...i,className:c.composeRenderProps(a,e=>t("maxio-listbox",e)),render:(t,a)=>{const{selectionManager:i}=a.state,o=l?l(t,a):e.createElement("div",{...t});if("multiple"!==i.selectionMode||!n)return o;if(0===[...i.collection.getKeys()].filter(e=>{const t=i.collection.getItem(e);return"item"===(null==t?void 0:t.type)&&i.canSelectItem(e)}).length)return o;const r=i.isSelectAll,s=r&&i.disallowEmptySelection;return e.createElement("div",null,e.createElement("div",{className:"maxio-listbox__select-all"},e.createElement(k,{type:"button",variant:"ghost",trailingElement:e.createElement(E,{variant:r?"check":""}),fullWidth:!0,"aria-pressed":r,disabled:s,onClick:()=>i.toggleSelectAll()},"Select all")),o)}});Be.displayName="ListBox";const ze=({className:a,...l})=>{const n=l.textValue||("string"==typeof l.children?l.children:void 0);return e.createElement(c.ListBoxItem,{...l,textValue:n,className:t("maxio-listbox__item",a)},c.composeRenderProps(l.children,(t,{isSelected:a})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-listbox__content"},"string"==typeof t?e.createElement(Oe,{size:"sm"},t):t),a&&e.createElement(E,{variant:"check"}))))};ze.displayName="ListBox.Item";const Ae=({className:a,...l})=>e.createElement(c.ListBoxSection,{...l,className:t("maxio-listbox__section",a)});Ae.displayName="ListBox.Section";const Le=({className:a,...l})=>e.createElement(c.Header,{...l,className:t("maxio-listbox__header",a)});Le.displayName="ListBox.Header";const Fe=Object.assign(Be,{Item:ze,Section:Ae,Header:Le}),He=({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:n=!1,size:i="md",label:o,description:r,errorMessage:s,leadingElement:d=null,fullWidth:m,className:u,placeholder:p,renderEmptyState:g,selectionMode:x,children:v,...b})=>{const f=e.useRef(null),h=e.useRef(null),[_,w]=e.useState(),[N,y]=e.useState(0),I=!!s,R=l||I,C=v,k=e.useCallback(()=>{const e=f.current;if(!e)return;const t=h.current,a=t?t.getBoundingClientRect().left-e.getBoundingClientRect().left:0;y(e=>e===-a?e:-a),w(t=>{const a=`${e.offsetWidth}px`;return(null==t?void 0:t["--trigger-width"])===a?t:{"--trigger-width":a}})},[]);e.useEffect(()=>{const e=f.current;if(!e)return;if(k(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(k);return t.observe(e),()=>t.disconnect()},[k]);const S=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":R,"maxio-text-field--readonly":n,"maxio-text-field--full-width":m},u);return e.createElement(c.ComboBox,{...b,isDisabled:a,isInvalid:R,isReadOnly:n,selectionMode:x,className:S},o&&e.createElement(c.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{ref:f,className:"maxio-text-field__items"},d&&e.createElement("div",{className:"maxio-text-field__leading-element"},d),e.createElement(c.Input,{ref:h,className:"maxio-text-field__input",placeholder:p}),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(c.Button,{className:t("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},e.createElement(E,{variant:"chevron-up-down"})))),r&&!I&&e.createElement(c.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},r),s&&e.createElement(c.FieldError,{className:"maxio-form-error"},t=>e.createElement(e.Fragment,null,e.createElement(E,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},"function"==typeof s?s(t):s))),e.createElement(de,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:N,style:_},e.createElement(Fe,{renderEmptyState:g},C)))};He.displayName="ComboBox";const Ve=t=>e.createElement(Fe.Item,{...t});Ve.displayName="ComboBox.Item";const We=t=>e.createElement(Fe.Section,{...t});We.displayName="ComboBox.Section";const je=t=>e.createElement(Fe.Header,{...t});je.displayName="ComboBox.Header";const qe=Object.assign(He,{Item:Ve,Section:We,Header:je}),Ge=e.createContext({}),Ke=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:n=!1,size:i="md",label:o,description:r,errorMessage:s,leadingElement:d=null,trailingElement:m=null,fullWidth:u,className:p,...g},x)=>{const v=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":l,"maxio-text-field--readonly":n,"maxio-text-field--full-width":u},p);return e.createElement(c.TextField,{...g,isDisabled:a,isReadOnly:n,isInvalid:l,className:v},o&&e.createElement(c.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},d&&e.createElement("div",{className:"maxio-text-field__leading-element"},d),e.createElement(c.Input,{ref:x,className:"maxio-text-field__input"}),m&&e.createElement("div",{className:"maxio-text-field__trailing-element"},m)),r&&!(l&&s)&&e.createElement(c.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},r),s&&e.createElement(c.FieldError,{className:"maxio-form-error"},e.createElement(E,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},s)))});Ke.displayName="TextField";const Ue=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:n=!1,size:i="md",label:o,description:r,errorMessage:s,fullWidth:d,className:m,...u},p)=>{const g=t("maxio-text-area",`maxio-text-area--${i}`,{"maxio-text-area--disabled":a,"maxio-text-area--error":l,"maxio-text-area--readonly":n,"maxio-text-area--full-width":d},m);return e.createElement(c.TextField,{...u,isDisabled:a,isReadOnly:n,isInvalid:l,className:g},o&&e.createElement(c.Label,{className:"maxio-form-label"},o),e.createElement(c.TextArea,{ref:p,className:"maxio-text-area__input"}),r&&!(l&&s)&&e.createElement(c.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},r),s&&e.createElement(c.FieldError,{className:"maxio-form-error"},e.createElement(E,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},s)))});Ue.displayName="TextArea";const Ze=e.forwardRef(({disabled:l=!1,invalid:n=!1,readOnly:i=!1,size:o="md",label:r,helperText:s,showErrorMessage:c=!0,errorMessage:d,leadingElement:m=null,trailingElement:u=null,fullWidth:p,className:g,...x},v)=>{var b,f;const h=e.useRef(null);e.useImperativeHandle(v,()=>h.current),e.useEffect(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:E,..._}=x,w={..._,label:r,description:s,errorMessage:d,defaultValue:null===(b=x.defaultValue)||void 0===b?void 0:b.toString(),value:null===(f=x.value)||void 0===f?void 0:f.toString(),isDisabled:l,isReadOnly:i,isInvalid:n},{labelProps:N,inputProps:y,descriptionProps:I,errorMessageProps:R}=a.useTextField(w,h),C=t("maxio-text-field",`maxio-text-field--${o}`,{"maxio-text-field--disabled":l,"maxio-text-field--error":n,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},g),k=n&&d&&c;return e.createElement("div",{className:C},r&&e.createElement("label",{className:"maxio-text-field__label",...N},r),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement("input",{ref:h,type:"text",className:"maxio-text-field__input",...y,spellCheck:E}),u&&e.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!k&&e.createElement("div",{className:"maxio-form-helper-text",...I},s),k&&e.createElement(se,{...R},d))});Ze.displayName="TextInput";const Ye=({options:l,label:n,size:i="md",inline:o=!1,disabled:r=!1,helperText:s,errorMessage:c,fullWidth:d=!1,...m})=>{const u=t("maxio-select",`maxio-select--${i}`,{"maxio-select--disabled":r,"maxio-select--inline":o,"maxio-select--error":!!c,"maxio-select--full-width":d}),p=a.useId();return e.createElement("div",{className:u},n&&e.createElement("label",{htmlFor:p,className:"maxio-select__label"},n),e.createElement("div",{className:"maxio-select__input-container"},e.createElement("select",{id:p,className:"maxio-select__input",disabled:r,...m},l.map(t=>e.createElement("option",{key:`option-${t.value}`,value:t.value,disabled:t.disabled},t.label))),e.createElement(E,{variant:"chevron-up-down"})),!!c&&e.createElement(se,null,c),s&&!c&&e.createElement("div",{className:"maxio-form-helper-text"},s))},Qe=({className:a,size:l="md",fullWidth:n=!1,selectionMode:i="single",orientation:o="horizontal",disallowEmptySelection:r=!0,...s})=>e.createElement(c.ToggleButtonGroup,{...s,selectionMode:i,orientation:o,disallowEmptySelection:r,className:c.composeRenderProps(a,e=>t("maxio-segmented-control",`maxio-segmented-control--${l}`,{"maxio-segmented-control--full-width":n},e))});Qe.displayName="SegmentedControl";const Xe=({className:a,children:l,...n})=>e.createElement(c.ToggleButton,{...n,className:c.composeRenderProps(a,e=>t("maxio-segmented-control__item",e))},c.composeRenderProps(l,t=>e.createElement(e.Fragment,null,e.createElement(c.SelectionIndicator,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),t)));Xe.displayName="SegmentedControl.Item";const Je=Object.assign(Qe,{Item:Xe}),et=({leadingIcon:t,trailingIcon:a,type:l="menu",children:n,leadingIconClassName:i,isTooltipVisible:o=!1})=>e.createElement(e.Fragment,null,t&&e.createElement(Me,{usePortal:!0,isVisible:o,renderContent:()=>n,floatingElementOffset:12},e.createElement("span",{className:"maxio-side-nav__icon"},e.createElement(E,{variant:t,className:i}))),e.createElement("span",{className:`maxio-side-nav__${l}-title`,"data-testid":"maxio-sidebar-section-name"},n),a&&e.createElement("span",{className:"maxio-side-nav__menu-chevron"},e.createElement(E,{variant:a}))),tt=e=>"heading"!==e.type,at=e=>{const t=(e=>e.flat().filter(tt).map(e=>e.items).flat().find(e=>null==e?void 0:e.isCurrent))(e);return t?e.map(e=>e.map(e=>{var a;return tt(e)&&(null===(a=e.items)||void 0===a?void 0:a.includes(t))?{...e,isOpen:!0}:e})):e},lt=e.createContext({}),nt=()=>e.useContext(lt),it=({children:t,isOpen:a,onChange:l,withIcons:n=!0,sections:i,shouldToggleSidebar:o=!0,topDropdownItems:r,collapseBreakpoint:s=800})=>{const c=e.useRef(!1),[d,m]=e.useState(()=>!o||("boolean"==typeof a?a:"undefined"==typeof window||window.innerWidth>s)),[u,p]=e.useState(()=>at(i)),{windowWitdh:g}=Se(200);e.useEffect(()=>{c.current&&(null==l||l(d))},[d,l]),e.useEffect(()=>{c.current=!0},[]),e.useEffect(()=>{!function(e){if(!o)return;e<s&&d&&x()}(g)},[g]),e.useEffect(()=>{"boolean"==typeof a&&m(a)},[a]);const x=()=>{m(!1)};return e.createElement(lt.Provider,{value:{sections:u,topDropdownItems:r,onSectionOpen:e=>{p(t=>t.map(t=>t.map(t=>tt(t)?{...t,isOpen:(null==t?void 0:t.name)===e&&!t.isOpen}:t)))},isOpen:d,onOpen:()=>{m(!0)},onClose:x,withIcons:n,shouldToggleSidebar:o}},t)},ot=()=>{const{onOpen:t,topDropdownItems:a,isOpen:l}=nt(),{mainItem:n,otherItems:i,actions:o}=a,r=e.useRef(null),s=ke(r),c=({id:e,title:t,icon:a,iconClass:l,url:n,...i})=>({id:e,label:t,leadingIconName:a,leadingIconClassName:l,link:{href:n,...i}}),{items:d,itemsCount:m}=e.useMemo(()=>({itemsCount:i.length+o.length,items:[...i.map(c),(null==i?void 0:i.length)>0&&(null==o?void 0:o.length)>0?{type:"divider",id:"item-divider"}:null,...o.map(c)].filter(e=>null!=e)}),[o,i]);return e.createElement(e.Fragment,null,0===m?e.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:n.url,onClick:t},e.createElement("span",{className:"maxio-side-nav__menu-title"},n.title)):e.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},e.createElement("summary",{onClick:t,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:r},n.url?e.createElement(e.Fragment,null,e.createElement(et,{type:"menu",isTooltipVisible:!l&&s,leadingIcon:n.icon,trailingIcon:"chevron-up-down",leadingIconClassName:n.iconClass},n.title)):e.createElement(et,{type:"menu",trailingIcon:"chevron-up-down"},n.title)),e.createElement(N,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:d,small:!0})))},rt=({section:t})=>{const{isOpen:a,withIcons:l}=nt(),n=e.useRef(null),i=ke(n);return e.createElement("li",{className:"maxio-side-nav__item","data-key":t.key,"data-testid":"maxio-sidebar-section"},e.createElement("a",{className:"maxio-side-nav__link","aria-current":t.isCurrent?"page":void 0,role:"button",href:t.href,ref:n},e.createElement(et,{isTooltipVisible:i&&!a,type:"menu",leadingIcon:l?t.icon:void 0},t.name)))},st=({section:a})=>{var l,n;const{onOpen:i,onSectionOpen:o,isOpen:r,withIcons:s}=nt(),c=e.useRef(null),d=ke(c);if(!tt(a))return e.createElement("li",{className:"maxio-side-nav__item-header"},a.title);return a.Component?e.createElement(a.Component,{section:a}):a.href?e.createElement(rt,{section:a}):e.createElement("li",{className:t("maxio-side-nav__item",{"maxio-side-nav__item--icon":s}),"data-testid":"maxio-sidebar-section"},e.createElement("button",{className:"maxio-side-nav__menu-button",ref:c,"aria-expanded":a.isOpen?"true":"false",type:"button",onClick:()=>{o(a.name),i()}},e.createElement(et,{type:"menu",isTooltipVisible:!r&&d,leadingIcon:s?a.icon:void 0,trailingIcon:(null===(l=a.items)||void 0===l?void 0:l.length)?"chevron-down":void 0},a.name)),e.createElement("ul",{className:"maxio-side-nav__menu"},null===(n=a.items)||void 0===n?void 0:n.map(t=>e.createElement("li",{key:`section-sub-item-${t.name}`,className:"maxio-side-nav__item","data-testid":"maxio-section-item"},e.createElement("a",{className:"maxio-side-nav__link",href:t.href,"aria-current":t.isCurrent?"page":void 0},e.createElement("span",{className:"maxio-side-nav__link-title"},t.name))))))},ct=()=>{const{sections:t}=nt();return e.createElement(e.Fragment,null,t.map((t,a)=>e.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${a}`},t.map((t,l)=>e.createElement(st,{key:`section-list-item-${t.type}-${a}-${l}`,section:t})))))},dt=()=>{const{onClose:t,shouldToggleSidebar:a}=nt();return e.createElement("div",{className:"maxio-side-nav__logo-container"},e.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),a&&e.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":"toggle sidebar",onClick:t},e.createElement(E,{variant:"sidebar"})))},mt=()=>{const{isOpen:a}=nt();return e.createElement("nav",{className:t("maxio-side-nav",{"maxio-side-nav--collapsed":!a})},e.createElement(dt,null),e.createElement(ot,null),e.createElement("div",{className:"maxio-side-nav__items-container"},e.createElement(ct,null)))},ut=({disabled:a=!1,value:l=0,className:n,id:i,isCurrent:o,...r})=>{const s="icon"===r.type,d=({isSelected:e})=>t("maxio-tabs__tab",n,{"maxio-tabs__tab--active":e,"maxio-tabs__tab--disabled":a,"maxio-tabs__tab--icon":s});if("icon"===r.type){const{icon:t,...n}=r;return e.createElement(c.Tab,{id:l,isDisabled:a,...n,className:d},e.createElement("div",{className:"maxio-tabs__tab__content"},t))}const{children:m,rightIcon:u,...p}=r;return e.createElement(c.Tab,{id:l,isDisabled:a,...p,className:d},e.createElement("div",{className:"maxio-tabs__tab__content"},m,u||null))},pt=e.createContext({variant:"line",withDivider:!1}),gt=({children:t,variant:a="line",withDivider:l=!1})=>e.createElement(pt.Provider,{value:{variant:a,withDivider:l}},t),xt=({children:a,value:l,className:n,id:i,...o})=>e.createElement(c.TabPanel,{id:l,className:t("maxio-tabs__panel",n),...o},a),vt=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-card__header",l),...n},a);vt.displayName="Card.Header";const bt=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-card__body",l),...n},a);bt.displayName="Card.Body";const ft=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-card__footer",l),...n},a);ft.displayName="Card.Footer";const ht=({children:a,className:l,variant:n="primary",...i})=>e.createElement("div",{className:t("maxio-card",`maxio-card--${n}`,l),...i},a);ht.displayName="Card";const Et=Object.assign(ht,{Header:vt,Body:bt,Footer:ft});var _t,wt,Nt,yt;function It(){return It=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},It.apply(null,arguments)}const Rt=e=>v.createElement("svg",It({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},e),_t||(_t=v.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),wt||(wt=v.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),Nt||(Nt=v.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),yt||(yt=v.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),Ct=a=>{const{size:l="sm",className:n,variant:i="lockup",alt:o="maxio logo"}=a,r="mark"===i,s="number"==typeof l;return e.createElement(Rt,{role:"img",viewBox:r?"0 0 240 240":"0 0 1036 240","aria-label":o,height:s?l:void 0,className:t("maxio-logo",!s&&`maxio-logo--${l}`,r&&"maxio-logo--mark",n)})},kt=({state:a,...l})=>{var n,i;const o=e.useRef(null),{toastProps:r,contentProps:s,titleProps:c,closeButtonProps:d}=g.useToast(l,a,o),{closable:m=!0,underline:u=!0,external:p=!1}=l.toast.content,x=t("maxio-toast",{[`maxio-toast--${l.toast.content.sentiment}`]:l.toast.content.sentiment}),v={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[l.toast.content.sentiment||"default"];return e.createElement("div",{className:x,"data-maxio-mode":"dark",...r,ref:o},e.createElement(E,{variant:v,className:"maxio-toast__icon"}),e.createElement("div",{className:"maxio-toast__container",...s},e.createElement("div",{className:"maxio-toast__content",...c},l.toast.content.title&&e.createElement("span",{className:"maxio-toast__title"},l.toast.content.title),l.toast.content.message&&e.createElement("span",{className:"maxio-toast__message"},l.toast.content.message),(null===(n=l.toast.content.link)||void 0===n?void 0:n.text)&&(null===(i=l.toast.content.link)||void 0===i?void 0:i.href)&&e.createElement(y,{href:l.toast.content.link.href,underline:u,external:p},l.toast.content.link.text))),m&&e.createElement(S,{variant:"ghost",icon:e.createElement(E,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss",...d}))},St=({state:t,...a})=>{const l=e.useRef(null),{regionProps:n}=g.useToastRegion(a,t,l);return e.createElement("div",{...n,ref:l,className:a.className,style:{display:"flex",flexDirection:"column",gap:"10px"}},t.visibleToasts.map(a=>e.createElement(kt,{key:a.key,toast:a,state:t})))},Pt=e.createContext(null);class Tt extends p.ToastQueue{}const $t=({basis:a,flex:l,flexDirection:n,wrap:i,grow:o,shrink:r,gap:s,gapX:c,gapY:d,className:m,children:u,alignItems:p,justifyContent:g,...x})=>{const v=t("maxio-flex",{[`maxio-flex-${l}`]:l,[`maxio-basis-${a}`]:void 0!==a,[`maxio-flex-${n}`]:n,[`maxio-flex-${i}`]:i,"maxio-grow":o,"maxio-grow-0":!1===o,"maxio-shrink":r,"maxio-shrink-0":!1===r,[`maxio-gap-${s}`]:void 0!==s,[`maxio-gap-x-${c}`]:void 0!==c,[`maxio-gap-y-${d}`]:void 0!==d,[`maxio-items-${p}`]:p,[`maxio-justify-${g}`]:g},m);return e.createElement("div",{className:v,...x},u)},Dt=({...t})=>{const l=e.useRef(null),{buttonProps:n}=a.useButton(t,l);return e.createElement("button",{...n,className:"maxio-chip__dismiss-button"},e.createElement(E,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},Mt={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"};Object.defineProperty(exports,"createColumnHelper",{enumerable:!0,get:function(){return n.createColumnHelper}}),Object.defineProperty(exports,"DialogTrigger",{enumerable:!0,get:function(){return c.DialogTrigger}}),Object.defineProperty(exports,"Pressable",{enumerable:!0,get:function(){return c.Pressable}}),exports.ActionList=N,exports.Alert=P,exports.AuthLayout=({children:a,heading:l,description:n,sentiment:i="success",leadingElement:o=null,alert:r,topAddon:s=null,footer:c})=>e.createElement("div",{className:"maxio-auth-layout"},e.createElement($t,{alignItems:"center",justifyContent:"between"},e.createElement(Ct,{size:"md"}),s),r&&e.createElement(P,{display:"block",title:r.title,sentiment:r.sentiment},r.children),e.createElement(Et,{variant:"secondary"},e.createElement(Et.Body,null,e.createElement($t,{flexDirection:"col",gap:6},e.createElement($t,{flexDirection:"col",gap:2},e.createElement($t,{alignItems:"center",gap:2},o,e.createElement(ye,{size:"lg",className:t("maxio-auth-layout__heading",Mt[i])},l)),n&&e.createElement($t,{style:{color:"var(--maxio-color-text-tertiary)"}},e.createElement(Oe,{size:"sm",className:"maxio-auth-layout__description"},n))),a)),c&&e.createElement(Et.Footer,null,c))),exports.Avatar=({className:a,src:l,alt:n="avatar"})=>e.createElement("img",{className:t("maxio-avatar",a),alt:n,src:l}),exports.Banner=({children:a,title:l,linkText:n,linkExternal:i,href:o,display:r="inline",sentiment:s="info",onDismiss:c,className:d})=>{if(!a&&!l)return console.warn("Banner component requires either children or title prop to be rendered"),null;const m=t("maxio-banner",{[`maxio-banner--${s}`]:"info"!==s&&s,className:d}),u={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],p=t("maxio-banner__content",{"maxio-banner__content--block":"block"===r});return e.createElement("div",{className:m,"aria-live":"assertive"},e.createElement(E,{variant:u,className:"maxio-banner__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-banner__container"},e.createElement("div",{className:p},l&&e.createElement("span",{className:"maxio-banner__title"},l),a&&e.createElement("span",{className:"maxio-banner__message"},a),n&&o&&e.createElement(y,{href:o,..."warning"!==s&&{variant:"inverse"},underline:!0,...i?{external:!0}:{}},n))),c&&e.createElement(S,{icon:e.createElement(E,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-banner__dismiss"}))},exports.Body=Oe,exports.Breadcrumbs=({className:a,children:l,...n})=>{const i=e.Children.count(l);if(0===i)throw new Error(B);const o=e.Children.map(l,(t,a)=>{if(e.isValidElement(t)&&t.type===O){if(a===i-1&&t.props.href)throw new Error(z);return e.cloneElement(t,{"aria-current":a===i-1?"page":void 0})}throw new Error(A)});return e.createElement("nav",{"aria-label":"Breadcrumb",...n},e.createElement("ol",{className:t("maxio-breadcrumbs",a)},o))},exports.BreadcrumbsItem=O,exports.Button=k,exports.Card=Et,exports.Checkbox=oe,exports.CheckboxGroup=({helperText:l,className:n,errorMessage:i,children:o,disabled:r,label:c,defaultValue:d,name:m,...u})=>{var p;const g=s.useCheckboxGroupState({defaultValue:d,name:m,errorMessage:i,description:l,label:c,isDisabled:r,isInvalid:!!i,...u}),{groupProps:x,labelProps:v,descriptionProps:b,errorMessageProps:f,isInvalid:h}=a.useCheckboxGroup({"aria-label":null===(p=null!=c?c:u["aria-label"])||void 0===p?void 0:p.toString(),isDisabled:r,isInvalid:!!i,...u},g),E=t("maxio-checkbox-group",{"maxio-checkbox-group--disabled":r},n),_=l&&!i;return e.createElement("div",{className:E,...x},c&&e.createElement("label",{className:"maxio-checkbox-group__label",...v},c),e.createElement(ne.Provider,{value:g},o),_&&e.createElement(re,{...b},l),i&&h&&e.createElement(se,{...f},i))},exports.Chip=({label:l,onDismiss:n,dismissLabel:i,leadingIcon:o,trailingIcon:s,title:c,...d})=>{const m=e.useRef(null),u=r.useToggleState(d),{buttonProps:p}=a.useToggleButton(d,u,m),g=t("maxio-chip",{"maxio-chip--selected":null==u?void 0:u.isSelected}),x=t("maxio-chip__button",{"maxio-chip--dismissible":n});return e.createElement("div",{className:g},e.createElement("button",{className:x,ref:m,...p,title:c},o&&e.createElement(E,{variant:o,className:"maxio-chip__icon"}),e.createElement("span",{className:"maxio-chip__label"},l),s&&!n&&e.createElement(E,{variant:s,className:"maxio-chip__icon"})),n&&e.createElement(Dt,{onPress:n,"aria-label":i}))},exports.Code=({as:a="div",children:l,className:n,...i})=>{const o=a,r=t("maxio-code",n);return e.createElement(o,{className:r,...i},l)},exports.ComboBox=qe,exports.DataTable=({pattern:t,size:a="md",SubRowComponent:l,onExpand:i,onSelect:o,onSort:r,enableSorting:s=!1,enableRowSelection:c=!1,enableExpanding:d,columns:m,actions:u,actionsColumnSize:p,onRowAction:g,enableRowReordering:x=!1,getRowReorderLabel:v,onRowReorder:b,rowReorderMode:f="siblings",getRowId:h,getSubRows:E,state:_,...w})=>{var N,y;const I=x?void 0:l,R=!x&&s,C=(({columns:t,HeaderControls:a,RowControls:l,RowActions:n,actions:i,actionsColumnSize:o,enableExpanding:r,enableRowSelection:s,enableRowReordering:c})=>e.useMemo(()=>{const d={id:L,size:s&&c?72:40,header:t=>e.createElement(a,{...t,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),cell:t=>e.createElement(l,{...t,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),meta:{controls:!0,width:(s&&c?72:40)+"px"}},m=i&&n?{id:F,size:null!=o?o:40,header:"",cell:t=>e.createElement(n,null,i(t.row,t.table)),meta:{actions:!0}}:null;let u=[...t];return(s||c)&&(u=[d,...u]),m&&(u=[...u,m]),u},[i,o,n,r,s,c,t,a,l]))({columns:m,HeaderControls:ce,RowControls:ue,RowActions:pe,actions:u,actionsColumnSize:p,enableRowSelection:c,enableRowReordering:x,enableExpanding:Boolean(d)}),k=n.useReactTable({state:{..._,...x&&{sorting:_e},columnPinning:{left:[...c||x?[L]:[],...Ee(null===(N=null==_?void 0:_.columnPinning)||void 0===N?void 0:N.left)],right:[...Ee(null===(y=null==_?void 0:_.columnPinning)||void 0===y?void 0:y.right),...u?[F]:[]]}},getCoreRowModel:n.getCoreRowModel(),enableRowSelection:c,enableExpanding:Boolean(d),...!w.manualExpanding&&{getExpandedRowModel:n.getExpandedRowModel()},...!w.manualSorting&&!x&&{getSortedRowModel:n.getSortedRowModel()},columns:C,getRowId:h,...w,getSubRows:x?we:null!=E?E:we,enableSorting:R,...x&&{getSortedRowModel:void 0}}),S=k.getCanSomeRowsExpand(),P=k.getState(),T=(({columnFilters:e,globalFilter:t,grouping:a,hasPagination:l})=>e.length>0||null!=t&&""!==t?be:a.length>0?fe:l?he:ve)({columnFilters:P.columnFilters,globalFilter:P.globalFilter,grouping:P.grouping,hasPagination:Boolean(w.getPaginationRowModel||w.manualPagination)});e.useEffect(()=>{null==i||i(P.expanded)},[i,P.expanded]),e.useEffect(()=>{null==o||o(P.rowSelection)},[o,P.rowSelection]),e.useEffect(()=>{x||null==r||r(P.sorting)},[x,r,P.sorting]);const $=e.createElement(H,{pattern:t,size:a,isExpandable:S,isUsingCustomRow:Boolean(I)},e.createElement(V,null,k.getHeaderGroups().map(t=>e.createElement(le,{key:t.id,table:k,isHeader:!0},t.headers.map(t=>e.createElement(j,{key:t.id,table:k,header:t,enableExpanding:d},n.flexRender(t.column.columnDef.header,t.getContext())))))),e.createElement(W,null,k.getRowModel().rows.map(a=>e.createElement(xe,{key:a.id,row:a,pattern:t,SubRowComponent:I,enableExpanding:d,onRowAction:g}))));return x&&h&&b?e.createElement(ae,{availability:T,data:w.data,enableExpanding:Boolean(d),getRowReorderLabel:v,onRowReorder:b,rowReorderMode:f,table:k},$):$},exports.Display=({as:a="div",children:l,size:n="md",className:i,...o})=>{const r=a,s=t(`maxio-display-${n}`,i);return e.createElement(r,{className:s,...o},l)},exports.Drawer=({open:a,onOpenChange:l,placement:n="right",backdrop:i="dim",size:o="md",className:r,title:s,description:d,children:m,footer:u})=>{const p=e.useId(),g={"data-placement":n,"data-size":o};return e.createElement(c.ModalOverlay,{isOpen:a,onOpenChange:l,isDismissable:!0,className:t("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===i})},e.createElement(c.Modal,{className:t("maxio-drawer",r),...g},e.createElement(c.Dialog,{className:"maxio-drawer__dialog","aria-labelledby":p},({close:t})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-drawer__header"},e.createElement("div",{className:"maxio-drawer__title-group"},e.createElement(ye,{id:p,size:"md",className:"maxio-drawer__title"},s),d&&e.createElement("p",{className:"maxio-drawer__description"},d)),e.createElement(S,{"aria-label":"Close",onClick:t,icon:e.createElement(E,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-drawer__close"})),e.createElement("div",{className:"maxio-drawer__body"},m),null!=u&&e.createElement("div",{className:"maxio-drawer__footer"},u)))))},exports.Flex=$t,exports.FormErrorMessage=se,exports.FormHelperText=re,exports.GlobalToastProvider=({children:t,toastQueue:a,...l})=>{const n=p.useToastQueue(a),i=e.useCallback(()=>{n.visibleToasts.forEach(e=>{a.close(e.key)})},[n.visibleToasts,a]),o=e.useMemo(()=>({addToast:a.add.bind(a),removeToast:a.clear.bind(a),removeAllToasts:i,state:n}),[a,i,n]);return e.createElement(Pt.Provider,{value:o},t,n.visibleToasts.length>0&&e.createElement(St,{...l,state:n}))},exports.Grid=({children:a,templateColumns:l,templateRows:n,autoColumns:i,autoRows:o,inline:r,column:s,columnStart:c,columnEnd:d,row:m,rowStart:u,rowEnd:p,gap:g,gapX:x,gapY:v,className:b,justifyContent:f,alignItems:h,...E})=>{const _=t(b,{"maxio-grid":!r,"maxio-inline-grid":r,[`maxio-grid-cols-${l}`]:l,[`maxio-grid-rows-${n}`]:n,[`maxio-auto-cols-${i}`]:i,[`maxio-auto-rows-${o}`]:o,["maxio-col-"+("auto"===s?"auto":`span-${s}`)]:s,[`maxio-col-start-${c}`]:c,[`maxio-col-end-${d}`]:d,["maxio-row-"+("auto"===m?"auto":`span-${m}`)]:m,[`maxio-row-start-${u}`]:u,[`maxio-row-end-${p}`]:p,[`maxio-gap-${g}`]:void 0!==g,[`maxio-gap-x-${x}`]:void 0!==x,[`maxio-gap-y-${v}`]:void 0!==v,[`maxio-justify-${f}`]:f,[`maxio-items-${h}`]:h});return e.createElement("div",{className:_||void 0,...E},a)},exports.Heading=ye,exports.Icon=E,exports.IconButton=S,exports.Label=({as:a="div",children:l,size:n="sm",className:i,...o})=>{const r=a,s=t(`maxio-label-${n}`,i);return e.createElement(r,{className:s,...o},l)},exports.Link=y,exports.ListBox=Fe,exports.LoadingSpinner=I,exports.Logo=Ct,exports.Menu=({children:t})=>e.createElement($,null,e.createElement(M,null,t)),exports.MenuButton=({children:a,iconName:l="chevron-down","aria-label":n,size:i="md",variant:o="secondary"})=>{const r=t({"maxio-action-menu__chevron":"chevron-down"===l}),s=t("maxio-button",`maxio-button--${o}`,`maxio-button--${i}`,{"maxio-button--icon":l&&!a}),{isOpen:c,buttonId:d,controlsId:m}=D();return e.createElement("summary",{className:s,"aria-haspopup":"true","aria-label":n,"aria-expanded":c,"aria-controls":m,id:d},a&&e.createElement("span",null,a),l&&e.createElement(E,{variant:l,className:`${r} maxio-button__trailing-element`}))},exports.MenuList=({items:a,alignItemsEnd:l=!1})=>{const n=t("maxio-action-menu__content",{"maxio-action-menu__content--align-end":l}),{controlsId:i,buttonId:o}=D();return e.createElement("div",{className:n,role:"presentation"},e.createElement(N,{role:"menu",itemProps:{role:"menuitem"},id:i,"aria-labelledby":o,items:a}))},exports.OverlayTrigger=Te,exports.Pagination=({size:t="md",onChange:a,totalItems:l=0,itemsPerPage:n=30,currentPage:i=1,pageSizeOptions:o,manualPageInput:r=!1})=>{const[s,c]=e.useState(i),[d,m]=e.useState(n),[u,p]=e.useState(i.toString());e.useEffect(()=>{p(s.toString())},[s]);const g=Math.ceil(l/d),x=s<g,v=s>1,b=d*(s-1)+1,f=Math.min(d*s,l),h=o.map(e=>({label:e.toString(),value:e.toString()})),_=Array.from({length:g},(e,t)=>t+1).map(e=>({label:e.toString(),value:e.toString()})),w=e=>{c(e),null==a||a({currentPage:e,itemsPerPage:d})},N=e=>{const t=parseInt(e,10);if(isNaN(t))return void p(s.toString());const a=Math.max(1,Math.min(t,g));p(a.toString()),w(a)};return e.createElement("div",{className:"maxio-pagination"},e.createElement("div",{className:"maxio-pagination__items-per-page"},e.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),e.createElement(Ye,{inline:!0,size:t,options:h,onChange:e=>{return t=Number(e.target.value),m(t),c(1),void(null==a||a({currentPage:1,itemsPerPage:t}));var t},value:d,id:"items-per-page-large"})),e.createElement("div",{className:"maxio-pagination__total-items"},e.createElement("span",null,b,"–",f," of ",l," items")),e.createElement("div",{className:"maxio-pagination__current-page"},r?e.createElement(Ze,{className:"maxio-pagination__page-input",value:u,min:1,max:g,onChange:e=>(e=>{p(e)})(e),onBlur:e=>{N(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(N(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:t,type:"number",onWheel:e=>e.preventDefault()}):e.createElement(Ye,{inline:!0,size:t,"aria-label":"Select page",onChange:e=>w(Number(e.target.value)),value:s,options:_,id:"page-index-large"}),e.createElement("div",{className:"maxio-pagination__label"},"of ",g," pages")),e.createElement("div",{className:"maxio-pagination__controls"},e.createElement(Me,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(S,{icon:e.createElement(E,{variant:"chevron-left"}),size:t,variant:"ghost",onClick:()=>w(s-1),"aria-label":"Previous",disabled:!v})),e.createElement(Me,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(S,{icon:e.createElement(E,{variant:"chevron-right"}),size:t,variant:"ghost",onClick:()=>w(s+1),"aria-label":"Next",disabled:!x}))))},exports.Popover=de,exports.ProgressBar=({label:l,helperText:n,size:i="md",variant:o="default",status:r,value:s,maxValue:c=100})=>{const d=a.useId(),m=a.useId(),u=r&&!!l&&!!s&&!("inline"===o),p=n&&!("inline"===o),g=n&&"inline"===o,{progressBarProps:x,labelProps:v}=a.useProgressBar({maxValue:c,value:s,label:l}),b=t("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===i,"maxio-progress-bar--success":s&&!("inline"===o)&&"success"===r,"maxio-progress-bar--error":s&&!("inline"===o)&&"error"===r,"maxio-progress-bar--indent":"indent"===o,"maxio-progress-bar--inline":"inline"===o,"maxio-progress-bar--indeterminate":void 0===s});return e.createElement("div",{className:b,...x},e.createElement("div",{id:d,className:"maxio-progress-bar__label",...v},l),g&&e.createElement("div",{id:m,className:"maxio-progress-bar__helper-text"},n),e.createElement("div",{className:"maxio-progress-bar__track"},e.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${s}%`}})),u&&e.createElement("div",{className:`maxio-progress-bar__${r}-icon`}),p&&e.createElement("div",{id:m,className:"maxio-progress-bar__helper-text"},n))},exports.Radio=({indent:l=!1,disabled:n=!1,invalid:i=!1,label:o,...r})=>{const s=e.useRef(null),c=e.useContext(Ge),{inputProps:d,isDisabled:m}=a.useRadio({...r,value:(r.value||"").toString(),"aria-label":r["aria-label"]||o,isDisabled:n},c,s),u=t("maxio-radio",{"maxio-radio--indent":l,"maxio-radio--disabled":m||c.isDisabled,"maxio-radio--error":i||c.isInvalid});return e.createElement("label",{className:u},e.createElement("input",{ref:s,role:"radio",type:"radio",className:"maxio-radio__input",...d,name:c.name||d.name}),e.createElement("span",{className:"maxio-radio__control"}),e.createElement("span",{className:"maxio-radio__label"},o))},exports.RadioGroup=({children:t,label:l,errorMessage:n,helperText:i,disabled:o=!1,invalid:r=!1,name:s,defaultValue:c,...d})=>{const m=u.useRadioGroupState({isDisabled:o,isInvalid:r,description:i,name:s,label:l,errorMessage:n,defaultValue:c,...d}),{radioGroupProps:p,labelProps:g,descriptionProps:x,errorMessageProps:v}=a.useRadioGroup({"aria-label":d["aria-label"]||l,...d},m);return e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-radio-group",...p},l&&e.createElement("label",{className:"maxio-radio-group__label",...g},l),e.createElement(Ge.Provider,{value:m},t),r&&n&&e.createElement(se,{...v},n),i&&!r&&e.createElement(re,{...x},i)))},exports.SegmentedControl=Je,exports.Select=Ye,exports.SideNav=({withIcons:t=!0,shouldToggleSidebar:a=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:o,onChange:r})=>e.createElement(it,{isOpen:o,onChange:r,collapseBreakpoint:i,withIcons:t,shouldToggleSidebar:a,topDropdownItems:l,sections:n},e.createElement(mt,null)),exports.Tab=ut,exports.TabList=({children:a,className:l,ariaLabel:n,overflow:i="none",moreLabel:o="More",...r})=>{const{variant:s,withDivider:d}=e.useContext(pt),m=e.useContext(c.TabListStateContext),u=e.useId(),[p,g]=e.useState(!1),x=t("maxio-tabs",l,{"maxio-tabs--contained":"contained"===s,"maxio-tabs--divider":d}),v=e.Children.map(a,e=>e);(null!=v?v:[]).forEach(t=>{if(!e.isValidElement(t)||t.type!==ut)throw new Error("You can only pass <Tab /> component as children")});const b="auto"===i&&!!(null==v?void 0:v.length),{ref:f,moreButtonRef:h,overflowIndexes:_,handleKeyDownCapture:w}=(({overflowEnabled:t,childrenArray:a})=>{const l=e.useRef(null),n=e.useRef(null),i=e.useRef(null),[o,r]=e.useState(null),s=Pe(l),d=e.useContext(c.TabListStateContext),m=null!=(null==d?void 0:d.selectedKey)?Number(d.selectedKey):null,[u,p]=e.useState([]);e.useLayoutEffect(()=>{var e;if(!t||!o)return void p((null!=a?a:[]).map((e,t)=>t));const{visibleIndexes:l}=((e,t,a,l)=>{const n=e.map((e,t)=>t);if(e.reduce((e,t)=>e+t,0)<=t)return{visibleIndexes:n,overflowIndexes:[]};const i=[];let o=a;for(const a of n){if(o+e[a]>t)break;o+=e[a],i.push(a)}if(null!==l&&!i.includes(l)){for(o+=e[l];o>t&&i.length>0;)o-=e[i.pop()];i.push(l)}i.sort((e,t)=>e-t);const r=n.filter(e=>!i.includes(e));return{visibleIndexes:i,overflowIndexes:r}})(o.tabWidths,s,o.moreButtonWidth,null!==(e=i.current)&&void 0!==e?e:m);l.length===(null!=a?a:[]).length&&(i.current=null),p(l)},[t,o,s]),e.useLayoutEffect(()=>{t&&o&&null!==m&&p(e=>(e.includes(m)||(i.current=m),((e,t,a,l,n)=>{if(e.includes(n))return e;const i=[...e,n].sort((e,t)=>e-t);let o=l+i.reduce((e,a)=>e+t[a],0);for(;o>a&&i.length>1;){const e=i.length-1,a=i[e]===n?e-1:e,[l]=i.splice(a,1);o-=t[l]}return i})(e,o.tabWidths,s,o.moreButtonWidth,m)))},[m]);const g=t?(null!=a?a:[]).map((e,t)=>t).filter(e=>!u.includes(e)):[],x=((e,t)=>e.filter(e=>{var a;return!(null===(a=null==t?void 0:t[e])||void 0===a?void 0:a.props.disabled)}))(u,a);e.useLayoutEffect(()=>{var e,i;if(!t||!l.current)return void r(e=>null===e?e:null);const o=Array.from(l.current.querySelectorAll('[role="tab"]')),s=null!==(i=null===(e=n.current)||void 0===e?void 0:e.getBoundingClientRect().width)&&void 0!==i?i:0;r(e=>{var t;const l=(null!=a?a:[]).map((t,a)=>{var l,n,i;const r=null!==(n=null===(l=o[a])||void 0===l?void 0:l.getBoundingClientRect().width)&&void 0!==n?n:0;return r>0?r:null!==(i=null==e?void 0:e.tabWidths[a])&&void 0!==i?i:0}),n=s>0?s:null!==(t=null==e?void 0:e.moreButtonWidth)&&void 0!==t?t:0,i=(null==e?void 0:e.tabWidths.length)===l.length&&e.tabWidths.every((e,t)=>e===l[t]);return e&&i&&e.moreButtonWidth===n?e:{tabWidths:l,moreButtonWidth:n}})},[a,t]);const v=e=>{var t,a;void 0!==e&&(null==d||d.selectionManager.setFocused(!0),null==d||d.selectionManager.setFocusedKey(e),null==d||d.setSelectedKey(e),null===(a=null===(t=l.current)||void 0===t?void 0:t.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===a||a.focus())};return{ref:l,moreButtonRef:n,visibleIndexes:u,overflowIndexes:g,handleKeyDownCapture:e=>{var t;if(0===g.length)return;const a=document.activeElement===n.current,l=null==d?void 0:d.selectionManager.focusedKey,i=a?-1:x.indexOf(Number(l));if(a||-1!==i)switch(e.key){case"ArrowRight":if(a)return;return e.preventDefault(),e.stopPropagation(),void(i<x.length-1?v(x[i+1]):null===(t=n.current)||void 0===t||t.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(a?v(x[x.length-1]):i>0&&v(x[i-1]));case"Home":if(a)return;return e.preventDefault(),e.stopPropagation(),void v(x[0]);case"End":if(a)return;return e.preventDefault(),e.stopPropagation(),void v(x[x.length-1])}}}})({overflowEnabled:b,childrenArray:v}),N=e.createElement("span",{className:"maxio-tabs__tab__content"},o,e.createElement(E,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),y=_.map(e=>{return`#${t=u,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var t});return e.createElement("div",{id:u,className:x,ref:f,onKeyDownCapture:w},y.length>0&&e.createElement("style",null,`${y.join(", ")} { display: none; }`),e.createElement(c.TabList,{"aria-label":n,className:"maxio-contents",...r},(null!=v?v:[]).map((t,a)=>e.cloneElement(t,{key:a,value:a}))),b&&_.length>0&&e.createElement(c.MenuTrigger,{isOpen:p,onOpenChange:g},e.createElement(c.Button,{ref:h,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":o},N),p&&e.createElement(de,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},e.createElement(c.Menu,{"aria-label":`${o} tabs`,onAction:e=>{null==m||m.setSelectedKey(e),requestAnimationFrame(()=>{var t,a;null===(a=null===(t=f.current)||void 0===t?void 0:t.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===a||a.focus()})}},_.map(t=>{const a=v[t],{disabled:l,type:n,"aria-label":i,"aria-labelledby":o}=a.props,r="icon"===n?a.props.icon:a.props.children;return e.createElement(c.MenuItem,{key:t,id:t,isDisabled:!!l,"aria-label":i,"aria-labelledby":o,className:"maxio-tabs__more__item"},r)})))))},exports.TabPanel=xt,exports.TabPanels=({children:t})=>{const a=e.Children.map(t,(t,a)=>{if(!e.isValidElement(t)||t.type!==xt)throw new Error("You can only pass <TabPanel /> component as children");return e.cloneElement(t,{key:a,value:a})});return e.createElement(c.TabPanels,{className:"maxio-tabs__panels"},a)},exports.Tabs=({children:t,variant:a="line",withDivider:l=!1,defaultIndex:n=0,index:i,onChange:o})=>e.createElement(c.Tabs,{className:"maxio-tabs-container",selectedKey:i,defaultSelectedKey:n,onSelectionChange:e=>null==o?void 0:o(Number(e))},e.createElement(gt,{variant:a,withDivider:l},t)),exports.Tag=({children:a,size:l,sentiment:n,kind:i="primary",leadingIcon:o,trailingIcon:r})=>{const s=t("maxio-tag",`maxio-tag--${i}`,!!n&&`maxio-tag--${n}`,!!l&&`maxio-tag--${l}`);return e.createElement("div",{className:s},o&&e.createElement(E,{variant:o,className:"maxio-tag__icon"}),e.createElement("span",{className:"maxio-tag__label"},a),r&&e.createElement(E,{variant:r,className:"maxio-tag__icon"}))},exports.TextArea=Ue,exports.TextField=Ke,exports.TextInput=Ze,exports.Tile=({children:a,className:l,href:n,onClick:i,target:o,disabled:r})=>{const s=n||i;if(!s)return e.createElement("div",{className:"maxio-tile"},a);const c=t("maxio-tile",l,{"maxio-tile--clickable":s,"maxio-tile--disabled":r});return e.createElement("a",{className:c,href:n,target:o,onClick:e=>{r&&n&&e.preventDefault(),!r&&i&&i()}},a)},exports.ToastProvider=({children:t,...a})=>{const{maxVisibleToasts:l=5,...n}=a,i=p.useToastState({maxVisibleToasts:l,...n});return e.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),e.createElement(e.Fragment,null,t(i),i.visibleToasts.length>0&&e.createElement(St,{...a,state:i}))},exports.ToastQueue=Tt,exports.Toggle=({defaultChecked:a,checked:l,onChange:n,disabled:i,valueDescription:o,valueDescriptionPosition:r,className:s,name:c,id:d,...m})=>{const u=e.useId(),p="boolean"==typeof a,g=d||u,x="left"===r?"row":"row-reverse",v=o&&r,b=e.useCallback(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const t=e.currentTarget.checked;p&&(e.currentTarget.checked=!t),n&&n(!t,e)}},[p,n]),f=m["aria-label"]||(v?void 0:o);return e.createElement("div",{className:t("maxio-toggle",s,{"maxio-toggle--disabled":i}),style:{display:"inline-flex",flexDirection:x},"data-testid":"toggle-container"},v?e.createElement("label",{className:"maxio-toggle__label",htmlFor:g},o):null,e.createElement("div",{className:"maxio-toggle__container"},e.createElement("input",{type:"checkbox",defaultChecked:a,checked:l,onChange:e=>{n&&n(e.target.checked,e)},onKeyDown:b,disabled:i,className:"maxio-toggle__checkbox",id:g,name:c,"aria-label":f}),e.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":l,"aria-hidden":"true"},e.createElement("div",{className:"maxio-toggle__handle"}),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-on"})),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-off"})))))},exports.Tooltip=$e,exports.TooltipTrigger=Me,exports.TopBar=({children:t,actions:a,sideNavIsClosed:l,openSideNav:n})=>e.createElement("nav",{className:"maxio-top-bar"},l&&e.createElement(S,{"aria-label":"Open Side Navigation",variant:"ghost",icon:e.createElement(E,{variant:"sidebar"}),onClick:n}),e.createElement($t,{grow:!0,justifyContent:"end"},t),a),exports.useElementResizeObserver=Pe,exports.useHover=ke,exports.useOverlayTrigger=Ce,exports.useToast=()=>{const t=e.useContext(Pt);if(!t)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return t},exports.useWindowSize=Se;
|
|
1
|
+
"use strict";var e=require("react"),t=require("classnames"),a=require("react-aria"),l=require("@react-aria/utils"),n=require("@tanstack/react-table"),i=require("@atlaskit/pragmatic-drag-and-drop/element/adapter"),o=require("@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item"),r=require("@react-stately/toggle"),s=require("@react-stately/checkbox"),c=require("react-aria-components"),d=require("framer-motion"),m=require("@floating-ui/react-dom-interactions"),u=require("@react-stately/radio"),p=require("@react-stately/toast"),g=require("@react-aria/toast");function x(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var v=x(e);const b=["address-card","arrow-down","arrow-down-left","arrow-down-left-long","arrow-down-long","arrow-down-right","arrow-down-right-long","arrow-down-up","arrow-left","arrow-left-long","arrow-left-right","arrow-right","arrow-right-long","arrow-turn-down-right","arrow-up","arrow-up-left","arrow-up-left-long","arrow-up-long","arrow-up-right","arrow-up-right-long","bank","bar-chart","briefcase","building","business-intelligence","calendar","caret-down","caret-left","caret-right","caret-up","chat","check","check-box","check-box-checked","check-box-checked-fill","check-box-indeterminate-fill","check-circle","check-circle-fill","chevron-down","chevron-left","chevron-right","chevron-up","chevron-up-down","circle","circle-half-stroke-small","circle-small-dash","circle-small-fill","circle-small-stroke","clipboard","cog","copy-file","credit-card","cross","cross-circle","cross-circle-fill","dashboard","diamond-small-fill","document","document-blank","dollar","dot-circle-fill","dot-fill","error","error-fill","error-small-fill","graph","home","info-circle","info-circle-fill","line-vertical","list","login","logout","megaphone","menu","menu-chevron-left","menu-chevron-right","notification","notification-unread","pen","plus","plus-circle","plus-circle-fill","question-circle","question-circle-fill","recently-viewed","search","square-small-fill","trash","triangle-small-fill","user","warning-circle","warning-circle-fill"],f=["anrok","dropbox","hubspot","numeral","oracle","quotapath","sage","sphere","taxjar"],h=["avalara","pipedrive","quickbooks","salesforce","xero"],E=({variant:a,color:l,className:n,size:i})=>{const o=(e,t)=>t.includes(e),r=o(a,b)||o(a,f),s=o(a,h),c=t({"fa-kit":r,"fa-kit-duotone":s,"fa-sharp fa-regular":!r&&!s,[`fa-${a}`]:!0,[`fa-${i}`]:i,[`maxio-icon--${l}`]:l&&!o(a,f)&&!o(a,h)},n);return e.createElement("i",{className:c})},_=({item:l,isSelected:n,truncateLabel:i=!1,role:o="option",small:r=!1})=>{const s=e.useRef(null),c=e.useRef(!1),d=a.useId();if(e.useEffect(()=>{var e;n&&c.current&&(null===(e=s.current)||void 0===e||e.focus())},[n]),e.useEffect(()=>{c.current=!0},[]),"divider"===l.type)return e.createElement("div",{className:"maxio-action-list__divider",role:"separator","aria-hidden":"true"});const{leadingIconName:m,leadingIconClassName:u,trailingIconName:p,label:g,description:x,link:v}=l,b=t("maxio-action-list__label",{"maxio-truncate":i});return e.createElement("a",{"aria-labelledby":d,...v,className:t("maxio-action-list__content",v.className,{"maxio-action-list__content--size-small":r}),tabIndex:n?0:-1,ref:s,role:o},m&&e.createElement(E,{variant:m,className:t("maxio-action-list__leading-icon",u)}),e.createElement("span",{className:b,id:d},g),x&&e.createElement("span",{className:"maxio-action-list__description"},x),p&&e.createElement(E,{variant:p,className:"maxio-action-list__trailing-icon"}))},w=(e,t,a)=>0===e?e:1===e&&"divider"===t[e-1].type?a||e:"divider"===t[e-1].type?w(e-1,t,a||e):e-1,N=({items:a,isShadowed:l=!0,itemProps:n={},className:i,truncateLabels:o=!1,small:r=!1,...s})=>{const c=t("maxio-action-list",i,{"maxio-action-list--shadow":l}),[d,m]=e.useState(()=>a.findIndex(e=>"divider"!==e.type));return 0===a.length?null:e.createElement("div",{className:c,onKeyDown:e=>{if("Space"===e.code||"Enter"===e.code){const e=a[d];e&&"divider"!==e.type&&window.open(e.link.href,e.link.target||"_self")}"ArrowUp"===e.code&&(e.preventDefault(),m(e=>w(e,a))),"ArrowDown"===e.code&&(e.preventDefault(),m(e=>((e,t)=>{const a=t.findIndex((t,a)=>"divider"!==t.type&&a>e);return-1===a?e:a})(e,a)))},role:"listbox",...s},a.map((t,a)=>e.createElement(_,{item:t,truncateLabel:o,key:`listbox-${t.id}`,isSelected:a===d,small:r,...n})))},y=({className:a,children:l,disabled:n,external:i,icon:o,size:r="sm",underline:s,variant:c,...d})=>{const m=t("maxio-link",{[`maxio-link--${r}`]:r,"maxio-link--disabled":n,[`maxio-link--${c}`]:c,"maxio-link--underline":s},a),u=i?"_blank":"_self";return e.createElement("a",{className:m,target:u,...d},l,o&&e.createElement(E,{variant:o,className:"maxio-link__icon"}))},I=({size:a="md",white:l=!1,className:n})=>{const i=t("maxio-loading-spinner",n,`maxio-loading-spinner--${a}`,{"maxio-loading-spinner--white":l});return e.createElement("div",{className:i,role:"status","aria-label":"loading"})},R=e.forwardRef(({fullWidth:n=!1,leadingElement:i,trailingElement:o,icon:r,variant:s="primary",size:c,...d},m)=>{const u=l.useObjectRef(m),{linkProps:p}=a.useLink({...d},u),g=t("maxio-button",d.className,{[`maxio-button--${c}`]:c,[`maxio-button--${s}`]:s,"maxio-button--full-width":n});return e.createElement("a",{...p,ref:u,className:g,href:d.href},i&&e.cloneElement(i,{...e.isValidElement(i)&&{className:"maxio-button__leading-element"}}),d.children,(o||r)&&e.cloneElement(o||r,{...e.isValidElement(o||r)&&{className:"maxio-button__trailing-element"}}))}),C=e.forwardRef(({disabled:n,loading:i=!1,fullWidth:o=!1,leadingElement:r,trailingElement:s,icon:c,variant:d="primary",size:m,...u},p)=>{const g=l.useObjectRef(p),{buttonProps:x}=a.useButton({...u,isDisabled:n,formAction:"string"==typeof u.formAction?u.formAction:void 0},g),v=["primary","danger"].includes(d),b=t("maxio-button",u.className,{[`maxio-button--${m}`]:m,[`maxio-button--${d}`]:d,"maxio-button--loading":i,"maxio-button--full-width":o});return e.createElement("button",{...x,className:b,ref:g},r&&e.cloneElement(r,{...e.isValidElement(r)&&{className:"maxio-button__leading-element"}}),u.children,!i&&(s||c)&&e.cloneElement(s||c,{...e.isValidElement(s||c)&&{className:"maxio-button__trailing-element"}}),i&&e.createElement(I,{className:"maxio-button__trailing-element",size:"md",white:v}))}),k=e.forwardRef((t,a)=>(e=>"href"in e)(t)?e.createElement(R,{...t,ref:a}):e.createElement(C,{...t,ref:a})),S=({"aria-label":a,className:l,...n})=>e.createElement(k,{"aria-label":a,className:t("maxio-button--icon",l),...n},null),T=({children:a,title:l,linkText:n,linkExternal:i,href:o,display:r="inline",sentiment:s="info",onDismiss:c,className:d})=>{if(!a&&!l)return console.warn("Alert component requires either children or title prop to be rendered"),null;const m=t("maxio-alert",{[`maxio-alert--${s}`]:"info"!==s&&s},d),u={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],p=t("maxio-alert__content",{"maxio-alert__content--block":"block"===r});return e.createElement("div",{className:m},e.createElement(E,{variant:u,className:"maxio-alert__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-alert__container"},e.createElement("div",{className:p},l&&e.createElement("span",{className:"maxio-alert__title"},l),a&&e.createElement("span",{className:"maxio-alert__message"},a),n&&o&&e.createElement(y,{className:"maxio-alert__link",href:o,variant:"high-contrast",underline:!0,...i?{external:!0}:{}},n))),c&&e.createElement(S,{icon:e.createElement(E,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-alert__dismiss"}))},P=e.createContext({}),$=({children:t})=>{const[a,l]=e.useState(!1),n=e.useId(),i=e.useId();return e.createElement(P.Provider,{value:{controlsId:n,buttonId:i,isOpen:a,onClose:()=>l(!1),onOpen:()=>l(!0),onToggle:()=>l(e=>!e)}},t)};function D(){const t=e.useContext(P);if(!t||"object"==typeof t&&0===Object.keys(t).length)throw new Error("useMenu hook must be used within a MenuProvider");return t}const M=({children:t})=>{const{isOpen:a,onToggle:l,onClose:n}=D();return e.createElement("details",{open:a,onToggle:l,className:"maxio-action-menu"},"function"==typeof t?t({isOpen:a,onClose:n}):t)},O=({children:a,className:l,href:n,...i})=>{const o=n?e.createElement(y,{size:"sm",href:n},a):a;return e.createElement("li",{className:t("maxio-breadcrumbs__item",l),...i},o)},B="Breadcrumbs requires at least one BreadcrumbsItem as children",z='Last BreadcrumbsItem should not have "href" prop. It is the current page.',A="Breadcrumbs only accepts BreadcrumbsItem as children",L="row-controls",F="row-actions",H=({children:a,pattern:l,size:n,isExpandable:i,isUsingCustomRow:o})=>{const[r,s]=e.useState(!1),[c,d]=e.useState(!1),m=l&&o&&i,u=t("maxio-data-table",{"maxio-data-table--pattern":l&&!m,"maxio-data-table--expanded-child-pattern":m,"maxio-data-table--with-custom-row":o,[`maxio-data-table--${n}`]:n,"maxio-data-table--with-pinned-left-border":r,"maxio-data-table--with-pinned-right-border":c});return e.createElement("div",{className:"maxio-data-table-wrapper",onScroll:e=>{const t=e.target;s(t.scrollLeft>0),d(t.scrollWidth-t.clientWidth-t.scrollLeft>0)}},e.createElement("table",{className:u},a))},V=({children:t})=>e.createElement("thead",null,t),W=({children:t})=>e.createElement("tbody",null,t),j=({children:a,table:l,header:n,className:i,enableExpanding:o,...r})=>{var s,c,d,m,u,p,g,x,v,b,f;const h=null==n?void 0:n.column,_=null===(s=null==h?void 0:h.getCanSort)||void 0===s?void 0:s.call(h),w=null===(c=null==h?void 0:h.getToggleSortingHandler)||void 0===c?void 0:c.call(h),N=null==n?void 0:n.isPlaceholder,y=null===(m=null===(d=null==h?void 0:h.columnDef)||void 0===d?void 0:d.meta)||void 0===m?void 0:m.align,I=null===(p=null===(u=null==h?void 0:h.columnDef)||void 0===u?void 0:u.meta)||void 0===p?void 0:p.width,R=null===(x=null===(g=null==h?void 0:h.columnDef)||void 0===g?void 0:g.meta)||void 0===x?void 0:x.controls,C=null===(b=null===(v=null==h?void 0:h.columnDef)||void 0===v?void 0:v.meta)||void 0===b?void 0:b.actions,k=null==h?void 0:h.getIsPinned(),T=null==h?void 0:h.getIsSorted(),P="asc"===T,$=t("maxio-data-table__cell",i,{[`maxio-data-table__cell--pinned-${k}`]:k,"maxio-data-table__cell--sortable":_,"maxio-data-table__cell--active":T,[`maxio-data-table__cell--${y}`]:y,"maxio-data-table__cell--controls":R,"maxio-data-table__cell--actions":C}),D={...I?{width:I}:{},..."left"===k?{left:null==h?void 0:h.getStart("left")}:"right"===k?{right:null==h?void 0:h.getAfter("right")}:{}},M=((e,t)=>e&&t?"arrow-up":e&&!t?"arrow-down":"arrow-down-up")(!!T,P),O=null==l?void 0:l.getToggleAllRowsExpandedHandler(),B=null===(f=null==l?void 0:l.getIsAllRowsExpanded)||void 0===f?void 0:f.call(l),z=(null==n?void 0:n.headerGroup.headers[0].id)===L?1:0,A=o&&(null==n?void 0:n.index)===z;return N?null:e.createElement("th",{scope:"col",role:"columnheader","aria-sort":T?P?"ascending":"descending":"none",className:$,onClick:w,colSpan:null==n?void 0:n.colSpan,style:D,...r},e.createElement("div",{className:"maxio-data-table__cell-flex"},!0===o&&A&&e.createElement(S,{size:"sm",variant:"ghost",icon:e.createElement(E,{size:"xs",variant:B?"chevron-down":"chevron-right"}),onClick:O,"aria-label":B?"Collapse all rows":"Expand all rows","data-open":B,className:"maxio-data-table__expand-button"}),a,_&&e.createElement(E,{variant:M,className:"maxio-data-table__sort-icon"})))},q=e=>{var t;return null!==(t=e.subRows)&&void 0!==t?t:[]},G=(e,t)=>Object.assign({},e,{subRows:t}),K=(e,t,a=[])=>{for(let l=0;l<e.length;l+=1){const n=e[l],i=[...a,l];if(n===t)return i;const o=K(q(n),t,i);if(o)return o}return null},U=(e,t)=>{const[a,...l]=t,n=e[a];if(!n)return null;const i=[...e];if(0===l.length)return i.splice(a,1),{data:i,item:n};const o=U(q(n),l);return o?(i[a]=G(n,o.data),{data:i,item:o.item}):null},Z=(e,t,a,l)=>{const n=[...e];if(0===t.length)return n.splice(a,0,l),n;const[i,...o]=t,r=e[i];if(!r)return null;const s=Z(q(r),o,a,l);return s?(n[i]=G(r,s),n):null},Y=(e,t)=>{let a,l=e;for(const e of t){if(a=l[e],!a)return;l=q(a)}return a},Q="maxio-data-table-row",X=e.createContext(null),J=()=>e.useContext(X),ee=e=>e.type===Q&&"string"==typeof e.instanceId&&"string"==typeof e.rowId,te=e=>{const t=(e=>{const t=o.extractInstruction(e);return t&&"instruction-blocked"!==t.type?"reorder-above"===t.type?"before":"reorder-below"===t.type?"after":"make-child"===t.type?"inside":null:null})(e);return"string"==typeof e.rowId&&t?{rowId:e.rowId,position:t}:null},ae=({availability:t,children:a,data:l,enableExpanding:n,getRowReorderLabel:r,onRowReorder:s,rowReorderMode:c,table:d})=>{const m=`maxio-data-table-${e.useId()}`,[u,p]=e.useState(""),[g,x]=e.useState(null),[v,b]=e.useState(null),f=e.useRef(null),h=e.useCallback(e=>d.getCoreRowModel().rowsById[e],[d]),E=e.useCallback(e=>{var t;return null!==(t=null==r?void 0:r(e))&&void 0!==t?t:e.id},[r]),_=e.useCallback((e,t)=>{const a=h(e),i=h(t.rowId);if(!a||!i)return null;const o=((e,t,a,l,n)=>{var i,o;if(t.id===a.id||!((e,t,a,l)=>{var n,i;return"all"===l||("siblings"===l?"inside"!==a&&(null!==(n=e.parentId)&&void 0!==n?n:null)===(null!==(i=t.parentId)&&void 0!==i?i:null):"inside"===a?e.depth===t.depth+1:e.depth===t.depth)})(t,a,l,n))return null;const r=K(e,t.original),s=K(e,a.original);if(!r||!s||(d=s,(c=r).length<d.length&&c.every((e,t)=>d[t]===e)))return null;var c,d;const m=U(e,r);if(!m)return null;const u=((e,t)=>{const a=[...e],l=t.length-1;return l>=0&&e.length>l&&t.slice(0,l).every((t,a)=>e[a]===t)&&t[l]<e[l]&&(a[l]-=1),a})(s,r),p=u[u.length-1];if(void 0===p)return null;const g="inside"===l?u:u.slice(0,-1),x=Y(m.data,u);if(!x)return null;const v="inside"===l?q(x).length:p+("after"===l?1:0),b={parentRowId:"inside"===l?a.id:null!==(i=a.parentId)&&void 0!==i?i:null,index:v},f={parentRowId:null!==(o=t.parentId)&&void 0!==o?o:null,index:t.index};if(f.parentRowId===b.parentRowId&&f.index===b.index)return null;const h=Z(m.data,g,v,m.item);return h?{data:h,source:f,destination:b}:null})(l,a,i,t.position,c);return o&&!n&&null!==o.destination.parentRowId&&o.destination.parentRowId!==o.source.parentRowId?null:o},[l,n,h,c]),w=e.useCallback(e=>{f.current=e,x(e)},[]),N=e.useCallback((e,t)=>{const a=h(e),l=h(t.rowId),n=_(e,t);return a&&l&&n?(s({...n,row:a,rowId:a.id,targetRow:l,targetRowId:l.id,position:t.position}),p(`${E(a)} moved ${i=E(l),o=t.position,"inside"===o?`inside ${i}`:`${o} ${i}`}.`),!0):(p("That row cannot be moved to this position."),!1);var i,o},[E,_,h,s]),y=e.useCallback((e,{input:t,element:a,source:l})=>{const n={rowId:e.id,instanceId:m},i=o.attachInstruction(n,{element:a,input:t,currentLevel:e.depth,indentPerLevel:24,mode:"standard"}),r=te(i),s=ee(l.data)&&l.data.instanceId===m&&Boolean(r&&_(l.data.rowId,r));return{...i,isValid:s}},[_,m]),I=e.useCallback((e,a)=>{if(!t.available)return()=>{};const l=e=>{const t=e.isValid?te(e):null;w(t)};return i.dropTargetForElements({element:a,canDrop:({source:t})=>ee(t.data)&&t.data.instanceId===m&&t.data.rowId!==e.id&&!e.getParentRows().some(e=>e.id===t.data.rowId),getData:t=>y(e,t),onDragEnter:({self:e})=>l(e.data),onDrag:({self:e})=>l(e.data),onDragLeave:()=>{var t;(null===(t=f.current)||void 0===t?void 0:t.rowId)===e.id&&w(null)}})},[t,y,m,w]),R=e.useCallback((e,a)=>{const l=a.closest("tr");return t.available&&l instanceof HTMLElement?i.draggable({element:l,dragHandle:a,getInitialData:()=>({type:Q,instanceId:m,rowId:e.id})}):()=>{}},[t,m]);e.useEffect(()=>{if(t.available)return i.monitorForElements({canMonitor:({source:e})=>ee(e.data)&&e.data.instanceId===m,onDragStart:({source:e})=>{if(!ee(e.data))return;const t=h(e.data.rowId);b(e.data.rowId),t&&p(`${E(t)} grabbed. Choose a destination.`)},onDrop:({source:e,location:t})=>{var a;if(ee(e.data)){const l=null===(a=t.current.dropTargets[0])||void 0===a?void 0:a.data,n=!0===(null==l?void 0:l.isValid)?te(l):null;n?N(e.data.rowId,n):p("Row move cancelled.")}b(null),w(null)}})},[N,t,E,h,m,w]),e.useEffect(()=>{if("inside"!==(null==g?void 0:g.position))return;const e=h(g.rowId);if(!(null==e?void 0:e.getCanExpand())||e.getIsExpanded())return;const t=window.setTimeout(()=>e.toggleExpanded(!0),500);return()=>window.clearTimeout(t)},[g,h]);const C=e.useCallback(e=>{var a;if(!t.available)return[];const l=e.parentId?h(e.parentId):null,n=null!==(a=null==l?void 0:l.subRows)&&void 0!==a?a:d.getCoreRowModel().rows,i=n.findIndex(t=>t.id===e.id);if(-1===i)return[];const o=n[i-1],r=n[i+1],s=n[0],c=n[n.length-1],m=[];if(i>1&&s&&m.push({id:"top",label:"Move to top",target:{rowId:s.id,position:"before"}}),o&&m.push({id:"up",label:"Move up",target:{rowId:o.id,position:"before"}}),r&&m.push({id:"down",label:"Move down",target:{rowId:r.id,position:"after"}}),i<n.length-2&&c&&m.push({id:"bottom",label:"Move to bottom",target:{rowId:c.id,position:"after"}}),l){let e=l;for(;e.parentId;){const t=h(e.parentId);if(!t)break;e=t}m.push({id:"move-to-root",label:"Move to root",target:{rowId:e.id,position:"after"}})}return d.getCoreRowModel().flatRows.forEach(t=>{t.id!==e.parentId&&m.push({id:`move-to:${t.id}`,label:`Move to ${E(t)}`,target:{rowId:t.id,position:"inside"}})}),m.filter(t=>Boolean(_(e.id,t.target)))},[t,E,_,h,d]),k=e.useCallback(e=>{var a;if(!t.available)return!1;const l=e.parentId?h(e.parentId):null;return(null!==(a=null==l?void 0:l.subRows)&&void 0!==a?a:d.getCoreRowModel().rows).length>1||"siblings"!==c&&("all"===c?Boolean(l):!(!n||0===e.depth)&&d.getCoreRowModel().flatRows.some(t=>t.depth===e.depth-1&&t.id!==e.parentId))},[t,n,h,c,d]),S=e.useMemo(()=>({activeTarget:g,availability:t,draggingRowId:v,getActions:C,getLabel:E,hasActions:k,moveRow:N,registerHandle:R,registerRow:I}),[g,t,N,v,C,E,k,R,I]);return e.createElement(X.Provider,{value:S},a,e.createElement("span",{className:"maxio-data-table__live-region",role:"status","aria-live":"polite","aria-atomic":"true"},u))},le=({children:l,row:n,isChild:i,isHeader:o,className:r,onRowAction:s,...c})=>{var d,m,u,p,g;const x=null===(d=null==n?void 0:n.getIsSelected)||void 0===d?void 0:d.call(n),v=(null===(m=null==n?void 0:n.getCanExpand)||void 0===m?void 0:m.call(n))&&(null===(u=null==n?void 0:n.getIsExpanded)||void 0===u?void 0:u.call(n)),b=Boolean(n&&s&&!o&&!i),f=e.useRef(null),h=J(),E=null==h?void 0:h.registerRow,_=e.useRef(null),w=e=>{_.current=e.target},{pressProps:N}=a.usePress({isDisabled:!b,onPress:e=>{var t;const a=null!==(t=_.current)&&void 0!==t?t:e.target;_.current=null,n&&s&&!(e=>e instanceof Element&&Boolean(e.closest("a,button,input,select,textarea,label,.maxio-data-table__cell--controls,.maxio-data-table__cell--actions")))(a)&&s(n)}}),{focusProps:y,isFocused:I}=a.useFocusRing(),R=t({"maxio-data-table__row":!o,"maxio-data-table__header-row":o,"maxio-data-table__row--active":x||I,"maxio-data-table__row--expanded":v,"maxio-data-table__row--expanded-child":i,"maxio-data-table__row--actionable":b,"maxio-data-table__row--dragging":Boolean(n)&&(null==h?void 0:h.draggingRowId)===(null==n?void 0:n.id),[`maxio-data-table__row--drop-${null===(p=null==h?void 0:h.activeTarget)||void 0===p?void 0:p.position}`]:Boolean(n)&&(null===(g=null==h?void 0:h.activeTarget)||void 0===g?void 0:g.rowId)===(null==n?void 0:n.id)},r);e.useEffect(()=>{if(n&&E&&f.current&&!o&&!i)return E(n,f.current)},[i,o,E,n]);const C=b?a.mergeProps({onClickCapture:w,onKeyDownCapture:w,tabIndex:0},N,y,c):c;return e.createElement("tr",{...C,ref:f,className:R,tabIndex:b?C.tabIndex:c.tabIndex},l)},ne=e.createContext({}),ie=e.forwardRef(({checked:a,disabled:l,invalid:n,indeterminate:i,className:o,inputProps:r,error:s,label:c},d)=>{const m=t("maxio-checkbox",{"maxio-checkbox--checked":a,"maxio-checkbox--disabled":l,"maxio-checkbox--error":n,"maxio-checkbox--indeterminate":i},o);return e.createElement("label",{className:m},e.createElement("input",{type:"checkbox",role:"checkbox",className:"maxio-checkbox__input",ref:d,...r}),e.createElement("span",{className:"maxio-checkbox__control"},s&&e.createElement("span",{className:"maxio-checkbox__control-error"})),c&&e.createElement("span",{className:"maxio-checkbox__label"},c))});ie.displayName="InnerCheckbox";const oe=({label:t,error:l=!1,className:n,indeterminate:i,value:o="",disabled:s,readOnly:c,defaultChecked:d,checked:m,...u})=>{const p=e.useRef(null),g=e.useContext(ne),{inputProps:x,isDisabled:v,isInvalid:b,isSelected:f}=g&&Object.keys(g).length>0?a.useCheckboxGroupItem({value:o,"aria-label":null!=t?t:u["aria-label"],isDisabled:s,isInvalid:l,isIndeterminate:i,isReadOnly:c,...u},g,p):a.useCheckbox({"aria-label":null!=t?t:u["aria-label"],isDisabled:s,isInvalid:l,isIndeterminate:i,isReadOnly:c,value:o,...u},r.useToggleState({...u,isSelected:m,defaultSelected:d}),p);return e.createElement(ie,{inputProps:x,checked:f,disabled:v,invalid:b,indeterminate:i,className:n,error:l,label:t,ref:p,...u})},re=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-form-helper-text",l),...n},a),se=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-form-error",l),...n},e.createElement(E,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},a)),ce=({table:t,enableRowSelection:a,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==t?void 0:t.getToggleAllPageRowsSelectedHandler)||void 0===n?void 0:n.call(t),c=(null===(i=null==t?void 0:t.getIsAllPageRowsSelected)||void 0===i?void 0:i.call(t))||(null===(o=null==t?void 0:t.getIsAllRowsSelected)||void 0===o?void 0:o.call(t)),d=null===(r=null==t?void 0:t.getIsSomePageRowsSelected)||void 0===r?void 0:r.call(t);return a?e.createElement(e.Fragment,null,l&&e.createElement("span",{className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon","aria-hidden":"true",style:{visibility:"hidden"}}),e.createElement(oe,{"aria-label":"Select all rows",onChange:e=>{s("boolean"==typeof e?{target:{checked:e}}:e)},checked:c,indeterminate:!c&&d})):null},de=({className:a,hideArrow:l=!1,children:n,offset:i=4,...o})=>e.createElement(c.Popover,{...o,className:t("maxio-popover",a),offset:i},e.createElement(e.Fragment,null,!l&&e.createElement(c.OverlayArrow,{className:"maxio-popover__arrow"},e.createElement("svg",{width:12,height:12,viewBox:"0 0 12 12","aria-hidden":!0},e.createElement("path",{d:"M0 0 L6 6 L12 0"}))),n)),me=({row:t})=>{var a,l;const n=J(),i=null==n?void 0:n.registerHandle,o=null==n?void 0:n.getActions,r=null==n?void 0:n.hasActions,s=e.useRef(null),[d,m]=e.useState(!1),u=(null==n?void 0:n.draggingRowId)===t.id,p=null!==(a=null==n?void 0:n.getLabel(t))&&void 0!==a?a:t.id,g=e.useMemo(()=>{var e;return null!==(e=null==r?void 0:r(t))&&void 0!==e&&e},[r,t]),x=e.useMemo(()=>{var e;return d&&null!==(e=null==o?void 0:o(t))&&void 0!==e?e:[]},[o,d,t]),v=null!==(l=n&&!n.availability.available?n.availability.message:void 0)&&void 0!==l?l:g?void 0:`No moves are available for ${p}.`;e.useEffect(()=>{if(i&&s.current&&!v)return i(t,s.current)},[i,t,v]),e.useEffect(()=>{v&&m(!1)},[v]);const b=e.createElement(c.Button,{ref:s,type:"button",className:"maxio-button maxio-button--sm maxio-button--ghost maxio-button--icon maxio-data-table__drag-handle","aria-label":`Reorder ${p}`,"aria-pressed":u,"aria-disabled":!!v||void 0,onPress:()=>{v||m(!0)}},e.createElement("i",{className:"fa-sharp fa-solid fa-grip-dots-vertical "+(v?"maxio-icon--disabled":"maxio-icon--secondary")}));return v?e.createElement(c.TooltipTrigger,{delay:0,closeDelay:0},b,e.createElement(c.Tooltip,{placement:"bottom start",offset:8,className:"maxio-tooltip maxio-tooltip--arrow-top-left"},e.createElement("div",{className:"maxio-tooltip__content"},v))):e.createElement(c.MenuTrigger,{trigger:"longPress",isOpen:d,onOpenChange:m},b,e.createElement(de,{placement:"bottom start",hideArrow:!0},e.createElement(c.Menu,{autoFocus:"first",className:"maxio-data-table__reorder-menu",items:x,onAction:e=>{const a=x.find(t=>t.id===e);a&&(null==n||n.moveRow(t.id,a.target),requestAnimationFrame(()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}},t=>e.createElement(c.MenuItem,{id:t.id,textValue:t.label,className:"maxio-data-table__reorder-menu-item"},t.label))))},ue=({row:t,enableRowSelection:a,enableRowReordering:l})=>{var n,i,o,r;const s=null===(n=null==t?void 0:t.getToggleSelectedHandler)||void 0===n?void 0:n.call(t),c=(null===(i=null==t?void 0:t.getIsSelected)||void 0===i?void 0:i.call(t))||(null===(o=null==t?void 0:t.getIsAllSubRowsSelected)||void 0===o?void 0:o.call(t)),d=null===(r=null==t?void 0:t.getIsSomeSelected)||void 0===r?void 0:r.call(t),m=t.id||t.index;return e.createElement(e.Fragment,null,l&&e.createElement(me,{row:t}),a&&e.createElement(oe,{"aria-label":`Select row ${m}`,onChange:s,checked:c,indeterminate:d}))},pe=({children:t})=>e.createElement("div",{className:"maxio-data-table__cell-flex"},t),ge=({row:a,cell:l,children:n,className:i,...o})=>{var r,s,c,d,m,u;const p=null==l?void 0:l.column,g=null===(s=null===(r=null==p?void 0:p.columnDef)||void 0===r?void 0:r.meta)||void 0===s?void 0:s.align,x=null===(d=null===(c=null==p?void 0:p.columnDef)||void 0===c?void 0:c.meta)||void 0===d?void 0:d.controls,v=null===(u=null===(m=null==p?void 0:p.columnDef)||void 0===m?void 0:m.meta)||void 0===u?void 0:u.actions,b=null==p?void 0:p.getIsPinned(),f=t("maxio-data-table__cell",i,{[`maxio-data-table__cell--pinned-${b}`]:b,[`maxio-data-table__cell--${g}`]:g,"maxio-data-table__cell--controls":x,"maxio-data-table__cell--actions":v}),h="left"===b?{left:null==p?void 0:p.getStart("left")}:"right"===b?{right:null==p?void 0:p.getAfter("right")}:{};return e.createElement("td",{className:f,style:h,...o},n)},xe=({row:t,SubRowComponent:a,pattern:l,enableExpanding:i,onRowAction:o})=>{var r,s,c,d,m;const u=a&&t.getParentRow()&&t.getParentRow().getIsExpanded(),p=u&&t.getVisibleCells()[0].column.columnDef.id===L,g=u&&t.getVisibleCells()[t.getVisibleCells().length-1].column.columnDef.id===F,x=[g,p].filter(Boolean).length,v=t.getVisibleCells().length-x,b=null!==(s=null===(r=t.getParentRow())||void 0===r?void 0:r.index)&&void 0!==s?s:t.index,f=l&&a&&b%2==1?"maxio-data-table__row--with-pattern":void 0,h=null===(c=t.getCanExpand)||void 0===c?void 0:c.call(t),_=null===(d=null==t?void 0:t.getToggleExpandedHandler)||void 0===d?void 0:d.call(t),w=null===(m=null==t?void 0:t.getIsExpanded)||void 0===m?void 0:m.call(t),N=h&&i?0:1.75,y=t.getVisibleCells()[0].column.columnDef.id===L?1:0,I=t.getVisibleCells().find(({column:e})=>{var t;const{actions:a,controls:l}=null!==(t=e.columnDef.meta)&&void 0!==t?t:{};return!a&&!l}),R=o&&I?I.id:void 0;return e.createElement(e.Fragment,{key:t.id},u?e.createElement(le,{key:`${t.id}-sub`,row:t,isChild:!0,className:f},p&&e.createElement(ge,{className:"maxio-data-table__cell--pinned-left"}),e.createElement(ge,{colSpan:v},a(t)),g&&e.createElement(ge,{className:"maxio-data-table__cell--pinned-right"})):e.createElement(le,{key:`${t.id}-parent`,row:t,className:f,onRowAction:o,"aria-labelledby":R},t.getVisibleCells().map(a=>{const l=i&&a.column.getIndex()===y;return e.createElement(ge,{key:a.id,row:t,cell:a,id:a.id},e.createElement("div",{className:"maxio-data-table__cell-flex",style:i&&l?{paddingLeft:`${(null==t?void 0:t.depth)+N}rem`}:void 0},i&&h&&l&&e.createElement(S,{size:"sm",variant:"ghost",icon:e.createElement(E,{size:"xs",variant:w?"chevron-down":"chevron-right"}),onClick:_,"aria-label":w?"Collapse row":"Expand row","data-open":w,className:"maxio-data-table__expand-button"}),n.flexRender(a.column.columnDef.cell,a.getContext())))})))},ve={available:!0},be={available:!1,reason:"filtering",message:"Reordering is unavailable while the table is filtered."},fe={available:!1,reason:"grouping",message:"Reordering is unavailable while the table is grouped."},he={available:!1,reason:"pagination",message:"Reordering is unavailable while the table is paginated."},Ee=(e=[])=>e.filter(e=>e!==L&&e!==F),_e=[],we=e=>e.subRows,Ne={sm:"h3",md:"h2",lg:"h1"},ye=({children:a,size:l="sm",className:n,...i})=>{const o=Ne[l],r=t(`maxio-heading-${l}`,n);return e.createElement(o,{className:r,...i},a)},Ie=({as:a="div",children:l,compact:n=!1,size:i="md",className:o,...r})=>{const s=a,c=t({[`maxio-body-${i}`]:!n,[`maxio-body-${i}-compact`]:n},o);return e.createElement(s,{className:c,...r},l)},Re=({basis:a,flex:l,flexDirection:n,wrap:i,grow:o,shrink:r,gap:s,gapX:c,gapY:d,className:m,children:u,alignItems:p,justifyContent:g,...x})=>{const v=t("maxio-flex",{[`maxio-flex-${l}`]:l,[`maxio-basis-${a}`]:void 0!==a,[`maxio-flex-${n}`]:n,[`maxio-flex-${i}`]:i,"maxio-grow":o,"maxio-grow-0":!1===o,"maxio-shrink":r,"maxio-shrink-0":!1===r,[`maxio-gap-${s}`]:void 0!==s,[`maxio-gap-x-${c}`]:void 0!==c,[`maxio-gap-y-${d}`]:void 0!==d,[`maxio-items-${p}`]:p,[`maxio-justify-${g}`]:g},m);return e.createElement("div",{className:v,...x},u)},Ce={click:m.useClick,hover:e=>m.useHover(e,{delay:100}),focus:m.useFocus,dismiss:m.useDismiss},ke=(e,t)=>t.map(t=>Ce[t](e)),Se=({placement:t="top",isActive:a=!1,interactions:l=["hover"],floatingElementOffset:n=0,onOverlayUpdate:i,autoHideMs:o})=>{const r=e.useRef(null),{strategy:s,x:c,y:d,context:u,floating:p,reference:g}=m.useFloating({placement:t,open:a,onOpenChange:e=>i(e),middleware:[m.offset(n)]}),{getReferenceProps:x,getFloatingProps:v}=m.useInteractions([...ke(u,l),m.useRole(u,{role:"tooltip"})]);e.useEffect(()=>{r.current&&clearTimeout(r.current),a&&o&&(r.current=window.setTimeout(()=>i(!1),o))},[a,o]);return{isActive:a,refs:{floating:p,reference:g},floatingElementCSSPosition:{position:s,top:null!=d?d:0,left:null!=c?c:0},getReferenceProps:x,getFloatingProps:v}};function Te(t,a=0){const l=e.useRef((new Date).getTime()),n=e.useRef((new Date).getTime()),[i,o]=e.useState(!1);return e.useEffect(()=>{const e=()=>{l.current=(new Date).getTime(),o(!0)},i=()=>{n.current=(new Date).getTime(),window.setTimeout(()=>{l.current-n.current<=0&&o(!1)},a)},r=t&&t.current;return r&&(r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",i)),()=>{r&&(r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",i))}},[t]),i}function Pe(t=500){const[a,l]=e.useState(()=>{if("undefined"==typeof window)return{windowWitdh:0,windowHeight:0};const{innerWidth:e,innerHeight:t}=window;return{windowWitdh:e,windowHeight:t}}),n=e.useRef(null);return e.useEffect(()=>{if("undefined"==typeof window)return;const e=()=>{var e;const{innerWidth:a,innerHeight:i}=window;window.clearTimeout(null!==(e=n.current)&&void 0!==e?e:void 0),n.current=window.setTimeout(()=>{l({windowWitdh:a,windowHeight:i})},t)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t]),a}function $e(t){const[a,n]=e.useState(()=>{var e,a;return null!==(a=null===(e=t.current)||void 0===e?void 0:e.clientWidth)&&void 0!==a?a:0}),i=()=>{var e,a;const l=null!==(a=null===(e=t.current)||void 0===e?void 0:e.clientWidth)&&void 0!==a?a:0;n(e=>0===l&&e>0?e:l)};return e.useLayoutEffect(i,[t]),l.useResizeObserver({ref:t,onResize:i}),a}const De=({children:a,usePortal:l=!1,isActive:n=!1,placement:i="top",interactions:o=["hover"],role:r="tooltip",renderOverlay:s,floatingElementOffset:c,motionSettings:u={},autoHideMs:p,onOverlayUpdate:g,className:x})=>{const{getReferenceProps:v,getFloatingProps:b,refs:{floating:f,reference:h},floatingElementCSSPosition:E}=Se({isActive:n,onOverlayUpdate:g,autoHideMs:p,floatingElementOffset:c,interactions:o,placement:i}),_=e.createElement(d.AnimatePresence,null,n&&e.createElement(d.motion.div,{ref:f,style:E,...u,...b()},s()));return e.createElement(e.Fragment,null,e.createElement("div",{ref:h,className:t("maxio-inline-flex",x),...v(),"data-testid":"overlay-trigger"},a),l?e.createElement(m.FloatingPortal,{id:"maxio-ui-portal"},_):_)},Me=({children:a,arrowPosition:l,size:n="regular",maxWidth:i=160})=>e.createElement("div",{"data-testid":"tooltip",className:t("maxio-tooltip",`maxio-tooltip--${n}`,{[`maxio-tooltip--arrow-${l}`]:l})},e.createElement("div",{className:"maxio-tooltip__content",style:{maxWidth:i}},a)),Oe={top:"bottom",right:"left",bottom:"top",left:"right","top-start":"bottom-left","top-end":"bottom-right","right-start":"left-top","right-end":"left-bottom","bottom-start":"top-left","bottom-end":"top-right","left-start":"right-top","left-end":"right-bottom"},Be=({children:t,interactions:a=["hover"],placement:l="right",maxWidth:n=160,size:i="regular",renderContent:o,autoHideMs:r,isVisible:s,usePortal:c,className:d,onVisibilityUpdate:m,floatingElementOffset:u=5})=>{const[p,g]=e.useState(!1),x=void 0!==s,v=e.useRef(null),b=e.useCallback(e=>{v.current&&clearTimeout(v.current),v.current=window.setTimeout(()=>{x||g(e),m&&m(e)},50)},[x,m]),f=e.useMemo(()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"Y":"X",a=`translate${t}(${e.startsWith("bottom")||e.startsWith("right")?"-":""}10px)`;return{initial:{opacity:0,visibility:"hidden",transform:a},animate:{opacity:1,visibility:"visible",transform:`translate${t}(0px)`},exit:{opacity:0,visibility:"hidden",transform:a},transition:{ease:[.4,0,.5,1],duration:.2}}})(l),[l]);return e.useEffect(()=>()=>{v.current&&clearTimeout(v.current)},[]),e.createElement(De,{role:"tooltip",className:d,floatingElementOffset:u,motionSettings:f,isActive:x?s:p,onOverlayUpdate:b,autoHideMs:r,usePortal:c,placement:l,interactions:a,renderOverlay:()=>e.createElement(Me,{size:i,arrowPosition:Oe[l],maxWidth:n},o())},t)},ze=({className:a,render:l,showSelectAll:n=!1,...i})=>e.createElement(c.ListBox,{...i,className:c.composeRenderProps(a,e=>t("maxio-listbox",e)),render:(t,a)=>{const{selectionManager:i}=a.state,o=l?l(t,a):e.createElement("div",{...t});if("multiple"!==i.selectionMode||!n)return o;if(0===[...i.collection.getKeys()].filter(e=>{const t=i.collection.getItem(e);return"item"===(null==t?void 0:t.type)&&i.canSelectItem(e)}).length)return o;const r=i.isSelectAll,s=r&&i.disallowEmptySelection;return e.createElement("div",null,e.createElement("div",{className:"maxio-listbox__select-all"},e.createElement(k,{type:"button",variant:"ghost",trailingElement:e.createElement(E,{variant:r?"check":""}),fullWidth:!0,"aria-pressed":r,disabled:s,onClick:()=>i.toggleSelectAll()},"Select all")),o)}});ze.displayName="ListBox";const Ae=({className:a,...l})=>{const n=l.textValue||("string"==typeof l.children?l.children:void 0);return e.createElement(c.ListBoxItem,{...l,textValue:n,className:t("maxio-listbox__item",a)},c.composeRenderProps(l.children,(t,{isSelected:a})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-listbox__content"},"string"==typeof t?e.createElement(Ie,{size:"sm"},t):t),a&&e.createElement(E,{variant:"check"}))))};Ae.displayName="ListBox.Item";const Le=({className:a,...l})=>e.createElement(c.ListBoxSection,{...l,className:t("maxio-listbox__section",a)});Le.displayName="ListBox.Section";const Fe=({className:a,...l})=>e.createElement(c.Header,{...l,className:t("maxio-listbox__header",a)});Fe.displayName="ListBox.Header";const He=Object.assign(ze,{Item:Ae,Section:Le,Header:Fe}),Ve=({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:n=!1,size:i="md",label:o,description:r,errorMessage:s,leadingElement:d=null,fullWidth:m,className:u,placeholder:p,renderEmptyState:g,selectionMode:x,children:v,...b})=>{const f=e.useRef(null),h=e.useRef(null),[_,w]=e.useState(),[N,y]=e.useState(0),I=!!s,R=l||I,C=v,k=e.useCallback(()=>{const e=f.current;if(!e)return;const t=h.current,a=t?t.getBoundingClientRect().left-e.getBoundingClientRect().left:0;y(e=>e===-a?e:-a),w(t=>{const a=`${e.offsetWidth}px`;return(null==t?void 0:t["--trigger-width"])===a?t:{"--trigger-width":a}})},[]);e.useEffect(()=>{const e=f.current;if(!e)return;if(k(),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(k);return t.observe(e),()=>t.disconnect()},[k]);const S=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":R,"maxio-text-field--readonly":n,"maxio-text-field--full-width":m},u);return e.createElement(c.ComboBox,{...b,isDisabled:a,isInvalid:R,isReadOnly:n,selectionMode:x,className:S},o&&e.createElement(c.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{ref:f,className:"maxio-text-field__items"},d&&e.createElement("div",{className:"maxio-text-field__leading-element"},d),e.createElement(c.Input,{ref:h,className:"maxio-text-field__input",placeholder:p}),e.createElement("div",{className:"maxio-text-field__trailing-element"},e.createElement(c.Button,{className:t("maxio-button","maxio-button--ghost","maxio-button--icon","maxio-button--sm")},e.createElement(E,{variant:"chevron-up-down"})))),r&&!I&&e.createElement(c.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},r),s&&e.createElement(c.FieldError,{className:"maxio-form-error"},t=>e.createElement(e.Fragment,null,e.createElement(E,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},"function"==typeof s?s(t):s))),e.createElement(de,{hideArrow:!0,className:"maxio-combobox__popover",crossOffset:N,style:_},e.createElement(He,{renderEmptyState:g},C)))};Ve.displayName="ComboBox";const We=t=>e.createElement(He.Item,{...t});We.displayName="ComboBox.Item";const je=t=>e.createElement(He.Section,{...t});je.displayName="ComboBox.Section";const qe=t=>e.createElement(He.Header,{...t});qe.displayName="ComboBox.Header";const Ge=Object.assign(Ve,{Item:We,Section:je,Header:qe}),Ke=e.createContext({}),Ue=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:n=!1,size:i="md",label:o,description:r,errorMessage:s,leadingElement:d=null,trailingElement:m=null,fullWidth:u,className:p,...g},x)=>{const v=t("maxio-text-field",`maxio-text-field--${i}`,{"maxio-text-field--disabled":a,"maxio-text-field--error":l,"maxio-text-field--readonly":n,"maxio-text-field--full-width":u},p);return e.createElement(c.TextField,{...g,isDisabled:a,isReadOnly:n,isInvalid:l,className:v},o&&e.createElement(c.Label,{className:"maxio-text-field__label"},o),e.createElement("div",{className:"maxio-text-field__items"},d&&e.createElement("div",{className:"maxio-text-field__leading-element"},d),e.createElement(c.Input,{ref:x,className:"maxio-text-field__input"}),m&&e.createElement("div",{className:"maxio-text-field__trailing-element"},m)),r&&!(l&&s)&&e.createElement(c.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},r),s&&e.createElement(c.FieldError,{className:"maxio-form-error"},e.createElement(E,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},s)))});Ue.displayName="TextField";const Ze=e.forwardRef(({isDisabled:a=!1,isInvalid:l=!1,isReadOnly:n=!1,size:i="md",label:o,description:r,errorMessage:s,fullWidth:d,className:m,...u},p)=>{const g=t("maxio-text-area",`maxio-text-area--${i}`,{"maxio-text-area--disabled":a,"maxio-text-area--error":l,"maxio-text-area--readonly":n,"maxio-text-area--full-width":d},m);return e.createElement(c.TextField,{...u,isDisabled:a,isReadOnly:n,isInvalid:l,className:g},o&&e.createElement(c.Label,{className:"maxio-form-label"},o),e.createElement(c.TextArea,{ref:p,className:"maxio-text-area__input"}),r&&!(l&&s)&&e.createElement(c.Text,{slot:"description",elementType:"div",className:"maxio-form-helper-text"},r),s&&e.createElement(c.FieldError,{className:"maxio-form-error"},e.createElement(E,{variant:"warning-circle-fill",className:"maxio-form-error__icon"}),e.createElement("div",{className:"maxio-form-error__text"},s)))});Ze.displayName="TextArea";const Ye=e.forwardRef(({disabled:l=!1,invalid:n=!1,readOnly:i=!1,size:o="md",label:r,helperText:s,showErrorMessage:c=!0,errorMessage:d,leadingElement:m=null,trailingElement:u=null,fullWidth:p,className:g,...x},v)=>{var b,f;const h=e.useRef(null);e.useImperativeHandle(v,()=>h.current),e.useEffect(()=>{console.warn("TextInput is deprecated. Please use TextField instead.")},[]);const{spellCheck:E,..._}=x,w={..._,label:r,description:s,errorMessage:d,defaultValue:null===(b=x.defaultValue)||void 0===b?void 0:b.toString(),value:null===(f=x.value)||void 0===f?void 0:f.toString(),isDisabled:l,isReadOnly:i,isInvalid:n},{labelProps:N,inputProps:y,descriptionProps:I,errorMessageProps:R}=a.useTextField(w,h),C=t("maxio-text-field",`maxio-text-field--${o}`,{"maxio-text-field--disabled":l,"maxio-text-field--error":n,"maxio-text-field--readonly":i,"maxio-text-field--full-width":p},g),k=n&&d&&c;return e.createElement("div",{className:C},r&&e.createElement("label",{className:"maxio-text-field__label",...N},r),e.createElement("div",{className:"maxio-text-field__items"},m&&e.createElement("div",{className:"maxio-text-field__leading-element"},m),e.createElement("input",{ref:h,type:"text",className:"maxio-text-field__input",...y,spellCheck:E}),u&&e.createElement("div",{className:"maxio-text-field__trailing-element"},u)),s&&!k&&e.createElement("div",{className:"maxio-form-helper-text",...I},s),k&&e.createElement(se,{...R},d))});Ye.displayName="TextInput";const Qe=({options:l,label:n,size:i="md",inline:o=!1,disabled:r=!1,helperText:s,errorMessage:c,fullWidth:d=!1,...m})=>{const u=t("maxio-select",`maxio-select--${i}`,{"maxio-select--disabled":r,"maxio-select--inline":o,"maxio-select--error":!!c,"maxio-select--full-width":d}),p=a.useId();return e.createElement("div",{className:u},n&&e.createElement("label",{htmlFor:p,className:"maxio-select__label"},n),e.createElement("div",{className:"maxio-select__input-container"},e.createElement("select",{id:p,className:"maxio-select__input",disabled:r,...m},l.map(t=>e.createElement("option",{key:`option-${t.value}`,value:t.value,disabled:t.disabled},t.label))),e.createElement(E,{variant:"chevron-up-down"})),!!c&&e.createElement(se,null,c),s&&!c&&e.createElement("div",{className:"maxio-form-helper-text"},s))},Xe=({className:a,size:l="md",fullWidth:n=!1,selectionMode:i="single",orientation:o="horizontal",disallowEmptySelection:r=!0,...s})=>e.createElement(c.ToggleButtonGroup,{...s,selectionMode:i,orientation:o,disallowEmptySelection:r,className:c.composeRenderProps(a,e=>t("maxio-segmented-control",`maxio-segmented-control--${l}`,{"maxio-segmented-control--full-width":n},e))});Xe.displayName="SegmentedControl";const Je=({className:a,children:l,...n})=>e.createElement(c.ToggleButton,{...n,className:c.composeRenderProps(a,e=>t("maxio-segmented-control__item",e))},c.composeRenderProps(l,t=>e.createElement(e.Fragment,null,e.createElement(c.SelectionIndicator,{className:"maxio-segmented-control__selection-indicator","data-selected":!0}),t)));Je.displayName="SegmentedControl.Item";const et=Object.assign(Xe,{Item:Je}),tt=({leadingIcon:t,trailingIcon:a,type:l="menu",children:n,leadingIconClassName:i,isTooltipVisible:o=!1})=>e.createElement(e.Fragment,null,t&&e.createElement(Be,{usePortal:!0,isVisible:o,renderContent:()=>n,floatingElementOffset:12},e.createElement("span",{className:"maxio-side-nav__icon"},e.createElement(E,{variant:t,className:i}))),e.createElement("span",{className:`maxio-side-nav__${l}-title`,"data-testid":"maxio-sidebar-section-name"},n),a&&e.createElement("span",{className:"maxio-side-nav__menu-chevron"},e.createElement(E,{variant:a}))),at=e=>"heading"!==e.type,lt=e=>{const t=(e=>e.flat().filter(at).map(e=>e.items).flat().find(e=>null==e?void 0:e.isCurrent))(e);return t?e.map(e=>e.map(e=>{var a;return at(e)&&(null===(a=e.items)||void 0===a?void 0:a.includes(t))?{...e,isOpen:!0}:e})):e},nt=e.createContext({}),it=()=>e.useContext(nt),ot=({children:t,isOpen:a,onChange:l,withIcons:n=!0,sections:i,shouldToggleSidebar:o=!0,topDropdownItems:r,collapseBreakpoint:s=800})=>{const c=e.useRef(!1),[d,m]=e.useState(()=>!o||("boolean"==typeof a?a:"undefined"==typeof window||window.innerWidth>s)),[u,p]=e.useState(()=>lt(i)),{windowWitdh:g}=Pe(200);e.useEffect(()=>{c.current&&(null==l||l(d))},[d,l]),e.useEffect(()=>{c.current=!0},[]),e.useEffect(()=>{!function(e){if(!o)return;e<s&&d&&x()}(g)},[g]),e.useEffect(()=>{"boolean"==typeof a&&m(a)},[a]);const x=()=>{m(!1)};return e.createElement(nt.Provider,{value:{sections:u,topDropdownItems:r,onSectionOpen:e=>{p(t=>t.map(t=>t.map(t=>at(t)?{...t,isOpen:(null==t?void 0:t.name)===e&&!t.isOpen}:t)))},isOpen:d,onOpen:()=>{m(!0)},onClose:x,withIcons:n,shouldToggleSidebar:o}},t)},rt=()=>{const{onOpen:t,topDropdownItems:a,isOpen:l}=it(),{mainItem:n,otherItems:i,actions:o}=a,r=e.useRef(null),s=Te(r),c=({id:e,title:t,icon:a,iconClass:l,url:n,...i})=>({id:e,label:t,leadingIconName:a,leadingIconClassName:l,link:{href:n,...i}}),{items:d,itemsCount:m}=e.useMemo(()=>({itemsCount:i.length+o.length,items:[...i.map(c),(null==i?void 0:i.length)>0&&(null==o?void 0:o.length)>0?{type:"divider",id:"item-divider"}:null,...o.map(c)].filter(e=>null!=e)}),[o,i]);return e.createElement(e.Fragment,null,0===m?e.createElement("a",{className:"maxio-side-nav__menu-button maxio-side-nav__menu-button--large",href:n.url,onClick:t},e.createElement("span",{className:"maxio-side-nav__menu-title"},n.title)):e.createElement("details",{className:"maxio-action-menu maxio-side-nav--action-menu"},e.createElement("summary",{onClick:t,className:"maxio-side-nav__menu-button","aria-haspopup":"true",ref:r},n.url?e.createElement(e.Fragment,null,e.createElement(tt,{type:"menu",isTooltipVisible:!l&&s,leadingIcon:n.icon,trailingIcon:"chevron-up-down",leadingIconClassName:n.iconClass},n.title)):e.createElement(tt,{type:"menu",trailingIcon:"chevron-up-down"},n.title)),e.createElement(N,{truncateLabels:!0,className:"maxio-action-menu__content","aria-label":"Action list",items:d,small:!0})))},st=({section:t})=>{const{isOpen:a,withIcons:l}=it(),n=e.useRef(null),i=Te(n);return e.createElement("li",{className:"maxio-side-nav__item","data-key":t.key,"data-testid":"maxio-sidebar-section"},e.createElement("a",{className:"maxio-side-nav__link","aria-current":t.isCurrent?"page":void 0,role:"button",href:t.href,ref:n},e.createElement(tt,{isTooltipVisible:i&&!a,type:"menu",leadingIcon:l?t.icon:void 0},t.name)))},ct=({section:a})=>{var l,n;const{onOpen:i,onSectionOpen:o,isOpen:r,withIcons:s}=it(),c=e.useRef(null),d=Te(c);if(!at(a))return e.createElement("li",{className:"maxio-side-nav__item-header"},a.title);return a.Component?e.createElement(a.Component,{section:a}):a.href?e.createElement(st,{section:a}):e.createElement("li",{className:t("maxio-side-nav__item",{"maxio-side-nav__item--icon":s}),"data-testid":"maxio-sidebar-section"},e.createElement("button",{className:"maxio-side-nav__menu-button",ref:c,"aria-expanded":a.isOpen?"true":"false",type:"button",onClick:()=>{o(a.name),i()}},e.createElement(tt,{type:"menu",isTooltipVisible:!r&&d,leadingIcon:s?a.icon:void 0,trailingIcon:(null===(l=a.items)||void 0===l?void 0:l.length)?"chevron-down":void 0},a.name)),e.createElement("ul",{className:"maxio-side-nav__menu"},null===(n=a.items)||void 0===n?void 0:n.map(t=>e.createElement("li",{key:`section-sub-item-${t.name}`,className:"maxio-side-nav__item","data-testid":"maxio-section-item"},e.createElement("a",{className:"maxio-side-nav__link",href:t.href,"aria-current":t.isCurrent?"page":void 0},e.createElement("span",{className:"maxio-side-nav__link-title"},t.name))))))},dt=()=>{const{sections:t}=it();return e.createElement(e.Fragment,null,t.map((t,a)=>e.createElement("ul",{role:"list",className:"maxio-side-nav__items",key:`section-list-${a}`},t.map((t,l)=>e.createElement(ct,{key:`section-list-item-${t.type}-${a}-${l}`,section:t})))))},mt=()=>{const{onClose:t,shouldToggleSidebar:a}=it();return e.createElement("div",{className:"maxio-side-nav__logo-container"},e.createElement("a",{className:"maxio-side-nav__brand",href:"/","aria-label":"Maxio"}),a&&e.createElement("button",{className:"maxio-side-nav__menu-toggle","aria-label":"toggle sidebar",onClick:t},e.createElement(E,{variant:"sidebar"})))},ut=()=>{const{isOpen:a}=it();return e.createElement("nav",{className:t("maxio-side-nav",{"maxio-side-nav--collapsed":!a})},e.createElement(mt,null),e.createElement(rt,null),e.createElement("div",{className:"maxio-side-nav__items-container"},e.createElement(dt,null)))},pt=({disabled:a=!1,value:l=0,className:n,id:i,isCurrent:o,...r})=>{const s="icon"===r.type,d=({isSelected:e})=>t("maxio-tabs__tab",n,{"maxio-tabs__tab--active":e,"maxio-tabs__tab--disabled":a,"maxio-tabs__tab--icon":s});if("icon"===r.type){const{icon:t,...n}=r;return e.createElement(c.Tab,{id:l,isDisabled:a,...n,className:d},e.createElement("div",{className:"maxio-tabs__tab__content"},t))}const{children:m,rightIcon:u,...p}=r;return e.createElement(c.Tab,{id:l,isDisabled:a,...p,className:d},e.createElement("div",{className:"maxio-tabs__tab__content"},m,u||null))},gt=e.createContext({variant:"line",withDivider:!1}),xt=({children:t,variant:a="line",withDivider:l=!1})=>e.createElement(gt.Provider,{value:{variant:a,withDivider:l}},t),vt=({children:a,value:l,className:n,id:i,...o})=>e.createElement(c.TabPanel,{id:l,className:t("maxio-tabs__panel",n),...o},a),bt=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-card__header",l),...n},a);bt.displayName="Card.Header";const ft=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-card__body",l),...n},a);ft.displayName="Card.Body";const ht=({children:a,className:l,...n})=>e.createElement("div",{className:t("maxio-card__footer",l),...n},a);ht.displayName="Card.Footer";const Et=({children:a,className:l,variant:n="primary",...i})=>e.createElement("div",{className:t("maxio-card",`maxio-card--${n}`,l),...i},a);Et.displayName="Card";const _t=Object.assign(Et,{Header:bt,Body:ft,Footer:ht});var wt,Nt,yt,It;function Rt(){return Rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var l in a)({}).hasOwnProperty.call(a,l)&&(e[l]=a[l])}return e},Rt.apply(null,arguments)}const Ct=e=>v.createElement("svg",Rt({xmlns:"http://www.w3.org/2000/svg","data-name":"Maxio Logo SVG",viewBox:"0 0 1036 240"},e),wt||(wt=v.createElement("path",{d:"M59.32 11.3 70.64 0l40.74 40.35v70.99H40.89L0 70.52l11.15-11.14 36.2 36.15h30.07l3.07-3.39-50.91-51.15 10.99-10.97 51.24 50.83 3.72-3.38V47.13zM180.68 11.3 169.36 0l-40.73 40.35v70.99h70.48L240 70.51l-11.15-11.14-36.2 36.15h-30.06l-3.07-3.39 50.91-51.15-10.99-10.97-51.24 50.83-3.72-3.38V47.12l36.2-35.83ZM59.32 228.7l11.31 11.29 40.74-40.35v-70.99H40.89L0 169.48l11.15 11.14 36.2-36.15h30.07l3.07 3.39-50.92 51.15 10.99 10.97 51.24-50.83 3.72 3.38v30.34zM180.68 228.7l-11.32 11.29-40.73-40.35v-70.99h70.48L240 169.48l-11.15 11.14-36.2-36.15h-30.06l-3.07 3.39 50.91 51.15-10.99 10.97-51.24-50.83-3.72 3.38v30.34zM1015.27 139.55c0-29.94-23.74-53.46-52.11-53.46s-52.11 23.52-52.11 53.46 23.74 53.46 52.11 53.46 52.11-23.52 52.11-53.46m20.32.95c-.5 40.27-32.73 72.76-72.43 72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71 72.44-73.71h.94c39.57.52 71.5 33.32 71.5 73.71v.95Z"})),Nt||(Nt=v.createElement("path",{fillRule:"evenodd",d:"M870.39 24h-20.33v20.33h20.33zm0 40.67h-20.33v148.59h20.33z"})),yt||(yt=v.createElement("path",{fillRule:"evenodd",d:"M850.05 24h20.33v20.33h-20.33zM695.01 82.85l50.83 56.28v6.53l-50.28 55.67 15.23 13.2 49.22-54.49h4.71l49.22 54.49 15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15 55.52h-3.96l-50.15-55.52L695 82.85ZM660.49 78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13 0-52.44 18.93-58.09 44.86l-.28 1.27 19.33 3.72.31-1.14c2.39-8.91 6.66-16.54 13.04-21.94 6.36-5.39 14.91-8.63 26.02-8.63s19.12 3.25 24.76 8.96c5.64 5.72 8.73 14.06 8.73 24.53v6.11L616.62 130l-3.26.68c-16.14 3.47-29.79 7.84-39.59 14.45-10.54 7.11-16.64 16.83-16.64 30.62 0 12.51 4.51 22.62 12.5 29.59 7.96 6.95 19.25 10.67 32.63 10.67 22.27 0 41.87-12.03 51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58Zm-40.09 68.13c-12.86 2.77-23.05 5.42-30.03 9.63-3.46 2.09-6.08 4.54-7.84 7.54s-2.71 6.62-2.71 11.15c0 6.38 2.1 12.12 6.32 16.27 4.22 4.14 10.7 6.82 19.7 6.82 26.85 0 47.46-20.48 47.46-51.36v-7.2l-32.9 7.14Z"})),It||(It=v.createElement("path",{d:"M434.8 188.74h4.54l61.73-164.33.15-.41h35.57v189.35H515.9V55.37h-4.33l-59.7 157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98H336V24h35.57z"}))),kt=a=>{const{size:l="sm",className:n,variant:i="lockup",alt:o="maxio logo"}=a,r="mark"===i,s="number"==typeof l;return e.createElement(Ct,{role:"img",viewBox:r?"0 0 240 240":"0 0 1036 240","aria-label":o,height:s?l:void 0,className:t("maxio-logo",!s&&`maxio-logo--${l}`,r&&"maxio-logo--mark",n)})},St=({state:a,...l})=>{var n,i;const o=e.useRef(null),{toastProps:r,contentProps:s,titleProps:c,closeButtonProps:d}=g.useToast(l,a,o),{closable:m=!0,underline:u=!0,external:p=!1}=l.toast.content,x=t("maxio-toast",{[`maxio-toast--${l.toast.content.sentiment}`]:l.toast.content.sentiment}),v={default:"info-circle-fill",success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[l.toast.content.sentiment||"default"];return e.createElement("div",{className:x,"data-maxio-mode":"dark",...r,ref:o},e.createElement(E,{variant:v,className:"maxio-toast__icon"}),e.createElement("div",{className:"maxio-toast__container",...s},e.createElement("div",{className:"maxio-toast__content",...c},l.toast.content.title&&e.createElement("span",{className:"maxio-toast__title"},l.toast.content.title),l.toast.content.message&&e.createElement("span",{className:"maxio-toast__message"},l.toast.content.message),(null===(n=l.toast.content.link)||void 0===n?void 0:n.text)&&(null===(i=l.toast.content.link)||void 0===i?void 0:i.href)&&e.createElement(y,{href:l.toast.content.link.href,underline:u,external:p},l.toast.content.link.text))),m&&e.createElement(S,{variant:"ghost",icon:e.createElement(E,{variant:"cross"}),"aria-label":"Dismiss Notification",className:"maxio-toast__dismiss",...d}))},Tt=({state:t,...a})=>{const l=e.useRef(null),{regionProps:n}=g.useToastRegion(a,t,l);return e.createElement("div",{...n,ref:l,className:a.className,style:{display:"flex",flexDirection:"column",gap:"10px"}},t.visibleToasts.map(a=>e.createElement(St,{key:a.key,toast:a,state:t})))},Pt=e.createContext(null);class $t extends p.ToastQueue{}const Dt=({...t})=>{const l=e.useRef(null),{buttonProps:n}=a.useButton(t,l);return e.createElement("button",{...n,className:"maxio-chip__dismiss-button"},e.createElement(E,{variant:"cross-circle-fill",className:"maxio-chip__icon"}))},Mt={success:"maxio-auth-layout__heading--success",danger:"maxio-auth-layout__heading--danger"};Object.defineProperty(exports,"createColumnHelper",{enumerable:!0,get:function(){return n.createColumnHelper}}),Object.defineProperty(exports,"DialogTrigger",{enumerable:!0,get:function(){return c.DialogTrigger}}),Object.defineProperty(exports,"Pressable",{enumerable:!0,get:function(){return c.Pressable}}),exports.ActionList=N,exports.Alert=T,exports.AuthLayout=({children:a,heading:l,description:n,sentiment:i="success",leadingElement:o=null,alert:r,topAddon:s=null,footer:c})=>e.createElement("div",{className:"maxio-auth-layout"},e.createElement(Re,{alignItems:"center",justifyContent:"between"},e.createElement(kt,{size:"md"}),s),r&&e.createElement(T,{display:"block",title:r.title,sentiment:r.sentiment},r.children),e.createElement(_t,{variant:"secondary"},e.createElement(_t.Body,null,e.createElement(Re,{flexDirection:"col",gap:6},e.createElement(Re,{flexDirection:"col",gap:2},e.createElement(Re,{alignItems:"center",gap:2},o,e.createElement(ye,{size:"lg",className:t("maxio-auth-layout__heading",Mt[i])},l)),n&&e.createElement(Re,{style:{color:"var(--maxio-color-text-tertiary)"}},e.createElement(Ie,{size:"sm",className:"maxio-auth-layout__description"},n))),a)),c&&e.createElement(_t.Footer,null,c))),exports.Avatar=({className:a,src:l,alt:n="avatar"})=>e.createElement("img",{className:t("maxio-avatar",a),alt:n,src:l}),exports.Banner=({children:a,title:l,linkText:n,linkExternal:i,href:o,display:r="inline",sentiment:s="info",onDismiss:c,className:d})=>{if(!a&&!l)return console.warn("Banner component requires either children or title prop to be rendered"),null;const m=t("maxio-banner",{[`maxio-banner--${s}`]:"info"!==s&&s,className:d}),u={success:"check-circle-fill",warning:"warning-circle-fill",danger:"error-fill",info:"info-circle-fill"}[s],p=t("maxio-banner__content",{"maxio-banner__content--block":"block"===r});return e.createElement("div",{className:m,"aria-live":"assertive"},e.createElement(E,{variant:u,className:"maxio-banner__icon","aria-hidden":"true"}),e.createElement("section",{className:"maxio-banner__container"},e.createElement("div",{className:p},l&&e.createElement("span",{className:"maxio-banner__title"},l),a&&e.createElement("span",{className:"maxio-banner__message"},a),n&&o&&e.createElement(y,{href:o,..."warning"!==s&&{variant:"inverse"},underline:!0,...i?{external:!0}:{}},n))),c&&e.createElement(S,{icon:e.createElement(E,{variant:"cross"}),"aria-label":"Dismiss Notification",variant:"ghost",onClick:c,className:"maxio-banner__dismiss"}))},exports.Body=Ie,exports.Breadcrumbs=({className:a,children:l,...n})=>{const i=e.Children.count(l);if(0===i)throw new Error(B);const o=e.Children.map(l,(t,a)=>{if(e.isValidElement(t)&&t.type===O){if(a===i-1&&t.props.href)throw new Error(z);return e.cloneElement(t,{"aria-current":a===i-1?"page":void 0})}throw new Error(A)});return e.createElement("nav",{"aria-label":"Breadcrumb",...n},e.createElement("ol",{className:t("maxio-breadcrumbs",a)},o))},exports.BreadcrumbsItem=O,exports.Button=k,exports.Card=_t,exports.Checkbox=oe,exports.CheckboxGroup=({helperText:l,className:n,errorMessage:i,children:o,disabled:r,label:c,defaultValue:d,name:m,...u})=>{var p;const g=s.useCheckboxGroupState({defaultValue:d,name:m,errorMessage:i,description:l,label:c,isDisabled:r,isInvalid:!!i,...u}),{groupProps:x,labelProps:v,descriptionProps:b,errorMessageProps:f,isInvalid:h}=a.useCheckboxGroup({"aria-label":null===(p=null!=c?c:u["aria-label"])||void 0===p?void 0:p.toString(),isDisabled:r,isInvalid:!!i,...u},g),E=t("maxio-checkbox-group",{"maxio-checkbox-group--disabled":r},n),_=l&&!i;return e.createElement("div",{className:E,...x},c&&e.createElement("label",{className:"maxio-checkbox-group__label",...v},c),e.createElement(ne.Provider,{value:g},o),_&&e.createElement(re,{...b},l),i&&h&&e.createElement(se,{...f},i))},exports.Chip=({label:l,onDismiss:n,dismissLabel:i,leadingIcon:o,trailingIcon:s,title:c,...d})=>{const m=e.useRef(null),u=r.useToggleState(d),{buttonProps:p}=a.useToggleButton(d,u,m),g=t("maxio-chip",{"maxio-chip--selected":null==u?void 0:u.isSelected}),x=t("maxio-chip__button",{"maxio-chip--dismissible":n});return e.createElement("div",{className:g},e.createElement("button",{className:x,ref:m,...p,title:c},o&&e.createElement(E,{variant:o,className:"maxio-chip__icon"}),e.createElement("span",{className:"maxio-chip__label"},l),s&&!n&&e.createElement(E,{variant:s,className:"maxio-chip__icon"})),n&&e.createElement(Dt,{onPress:n,"aria-label":i}))},exports.Code=({as:a="div",children:l,className:n,...i})=>{const o=a,r=t("maxio-code",n);return e.createElement(o,{className:r,...i},l)},exports.ComboBox=Ge,exports.DataTable=({pattern:t,size:a="md",SubRowComponent:l,onExpand:i,onSelect:o,onSort:r,enableSorting:s=!1,enableRowSelection:c=!1,enableExpanding:d,columns:m,actions:u,actionsColumnSize:p,onRowAction:g,enableRowReordering:x=!1,getRowReorderLabel:v,onRowReorder:b,rowReorderMode:f="siblings",getRowId:h,getSubRows:E,state:_,...w})=>{var N,y;const I=x?void 0:l,R=!x&&s,C=(({columns:t,HeaderControls:a,RowControls:l,RowActions:n,actions:i,actionsColumnSize:o,enableExpanding:r,enableRowSelection:s,enableRowReordering:c})=>e.useMemo(()=>{const d={id:L,size:s&&c?72:40,header:t=>e.createElement(a,{...t,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),cell:t=>e.createElement(l,{...t,enableExpanding:r,enableRowSelection:s,enableRowReordering:c}),meta:{controls:!0,width:(s&&c?72:40)+"px"}},m=i&&n?{id:F,size:null!=o?o:40,header:"",cell:t=>e.createElement(n,null,i(t.row,t.table)),meta:{actions:!0}}:null;let u=[...t];return(s||c)&&(u=[d,...u]),m&&(u=[...u,m]),u},[i,o,n,r,s,c,t,a,l]))({columns:m,HeaderControls:ce,RowControls:ue,RowActions:pe,actions:u,actionsColumnSize:p,enableRowSelection:c,enableRowReordering:x,enableExpanding:Boolean(d)}),k=n.useReactTable({state:{..._,...x&&{sorting:_e},columnPinning:{left:[...c||x?[L]:[],...Ee(null===(N=null==_?void 0:_.columnPinning)||void 0===N?void 0:N.left)],right:[...Ee(null===(y=null==_?void 0:_.columnPinning)||void 0===y?void 0:y.right),...u?[F]:[]]}},getCoreRowModel:n.getCoreRowModel(),enableRowSelection:c,enableExpanding:Boolean(d),...!w.manualExpanding&&{getExpandedRowModel:n.getExpandedRowModel()},...!w.manualSorting&&!x&&{getSortedRowModel:n.getSortedRowModel()},columns:C,getRowId:h,...w,getSubRows:x?we:null!=E?E:we,enableSorting:R,...x&&{getSortedRowModel:void 0}}),S=k.getCanSomeRowsExpand(),T=k.getState(),P=(({columnFilters:e,globalFilter:t,grouping:a,hasPagination:l})=>e.length>0||null!=t&&""!==t?be:a.length>0?fe:l?he:ve)({columnFilters:T.columnFilters,globalFilter:T.globalFilter,grouping:T.grouping,hasPagination:Boolean(w.getPaginationRowModel||w.manualPagination)});e.useEffect(()=>{null==i||i(T.expanded)},[i,T.expanded]),e.useEffect(()=>{null==o||o(T.rowSelection)},[o,T.rowSelection]),e.useEffect(()=>{x||null==r||r(T.sorting)},[x,r,T.sorting]);const $=e.createElement(H,{pattern:t,size:a,isExpandable:S,isUsingCustomRow:Boolean(I)},e.createElement(V,null,k.getHeaderGroups().map(t=>e.createElement(le,{key:t.id,table:k,isHeader:!0},t.headers.map(t=>e.createElement(j,{key:t.id,table:k,header:t,enableExpanding:d},n.flexRender(t.column.columnDef.header,t.getContext())))))),e.createElement(W,null,k.getRowModel().rows.map(a=>e.createElement(xe,{key:a.id,row:a,pattern:t,SubRowComponent:I,enableExpanding:d,onRowAction:g}))));return x&&h&&b?e.createElement(ae,{availability:P,data:w.data,enableExpanding:Boolean(d),getRowReorderLabel:v,onRowReorder:b,rowReorderMode:f,table:k},$):$},exports.Display=({as:a="div",children:l,size:n="md",className:i,...o})=>{const r=a,s=t(`maxio-display-${n}`,i);return e.createElement(r,{className:s,...o},l)},exports.Drawer=({open:a,onOpenChange:l,placement:n="right",backdrop:i="dim",size:o="md",className:r,title:s,description:d,children:m,footer:u})=>{const p=e.useId(),g={"data-placement":n,"data-size":o};return e.createElement(c.ModalOverlay,{isOpen:a,onOpenChange:l,isDismissable:!0,className:t("maxio-drawer__backdrop",{"maxio-drawer__backdrop--dim":"dim"===i})},e.createElement(c.Modal,{className:t("maxio-drawer",r),...g},e.createElement(c.Dialog,{className:"maxio-drawer__dialog","aria-labelledby":p},({close:t})=>e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-drawer__header"},e.createElement("div",{className:"maxio-drawer__title-group"},e.createElement(ye,{id:p,size:"md",className:"maxio-drawer__title"},s),d&&e.createElement("p",{className:"maxio-drawer__description"},d)),e.createElement(S,{"aria-label":"Close",onClick:t,icon:e.createElement(E,{variant:"cross"}),variant:"ghost",size:"sm",className:"maxio-drawer__close"})),e.createElement("div",{className:"maxio-drawer__body"},m),null!=u&&e.createElement("div",{className:"maxio-drawer__footer"},u)))))},exports.EmptyState=({hasActiveFilters:a=!1,title:l,headingLevel:n="h2",description:i,actions:o,className:r,...s})=>{const c=t("maxio-empty-state",r),d=n,m=!l&&!i?a?"We couldn't find any items matching your criteria. Try adjusting your search or filters to see more results.":"There is no data to display yet.":i;return e.createElement("div",{className:c,...s},e.createElement(Re,{flexDirection:"col",alignItems:"center",gap:4,className:"maxio-empty-state__content"},e.createElement(Re,{flexDirection:"col",alignItems:"center",gap:2,className:"maxio-empty-state__copy"},l&&e.createElement(d,{className:"maxio-heading-lg"},l),m&&e.createElement(Ie,{size:"sm",className:"maxio-empty-state__description"},m)),o&&e.createElement(Re,{alignItems:"center",gap:2},o)))},exports.Flex=Re,exports.FormErrorMessage=se,exports.FormHelperText=re,exports.GlobalToastProvider=({children:t,toastQueue:a,...l})=>{const n=p.useToastQueue(a),i=e.useCallback(()=>{n.visibleToasts.forEach(e=>{a.close(e.key)})},[n.visibleToasts,a]),o=e.useMemo(()=>({addToast:a.add.bind(a),removeToast:a.clear.bind(a),removeAllToasts:i,state:n}),[a,i,n]);return e.createElement(Pt.Provider,{value:o},t,n.visibleToasts.length>0&&e.createElement(Tt,{...l,state:n}))},exports.Grid=({children:a,templateColumns:l,templateRows:n,autoColumns:i,autoRows:o,inline:r,column:s,columnStart:c,columnEnd:d,row:m,rowStart:u,rowEnd:p,gap:g,gapX:x,gapY:v,className:b,justifyContent:f,alignItems:h,...E})=>{const _=t(b,{"maxio-grid":!r,"maxio-inline-grid":r,[`maxio-grid-cols-${l}`]:l,[`maxio-grid-rows-${n}`]:n,[`maxio-auto-cols-${i}`]:i,[`maxio-auto-rows-${o}`]:o,["maxio-col-"+("auto"===s?"auto":`span-${s}`)]:s,[`maxio-col-start-${c}`]:c,[`maxio-col-end-${d}`]:d,["maxio-row-"+("auto"===m?"auto":`span-${m}`)]:m,[`maxio-row-start-${u}`]:u,[`maxio-row-end-${p}`]:p,[`maxio-gap-${g}`]:void 0!==g,[`maxio-gap-x-${x}`]:void 0!==x,[`maxio-gap-y-${v}`]:void 0!==v,[`maxio-justify-${f}`]:f,[`maxio-items-${h}`]:h});return e.createElement("div",{className:_||void 0,...E},a)},exports.Heading=ye,exports.Icon=E,exports.IconButton=S,exports.Label=({as:a="div",children:l,size:n="sm",className:i,...o})=>{const r=a,s=t(`maxio-label-${n}`,i);return e.createElement(r,{className:s,...o},l)},exports.Link=y,exports.ListBox=He,exports.LoadingSpinner=I,exports.Logo=kt,exports.Menu=({children:t})=>e.createElement($,null,e.createElement(M,null,t)),exports.MenuButton=({children:a,iconName:l="chevron-down","aria-label":n,size:i="md",variant:o="secondary"})=>{const r=t({"maxio-action-menu__chevron":"chevron-down"===l}),s=t("maxio-button",`maxio-button--${o}`,`maxio-button--${i}`,{"maxio-button--icon":l&&!a}),{isOpen:c,buttonId:d,controlsId:m}=D();return e.createElement("summary",{className:s,"aria-haspopup":"true","aria-label":n,"aria-expanded":c,"aria-controls":m,id:d},a&&e.createElement("span",null,a),l&&e.createElement(E,{variant:l,className:`${r} maxio-button__trailing-element`}))},exports.MenuList=({items:a,alignItemsEnd:l=!1})=>{const n=t("maxio-action-menu__content",{"maxio-action-menu__content--align-end":l}),{controlsId:i,buttonId:o}=D();return e.createElement("div",{className:n,role:"presentation"},e.createElement(N,{role:"menu",itemProps:{role:"menuitem"},id:i,"aria-labelledby":o,items:a}))},exports.OverlayTrigger=De,exports.Pagination=({size:t="md",onChange:a,totalItems:l=0,itemsPerPage:n=30,currentPage:i=1,pageSizeOptions:o,manualPageInput:r=!1})=>{const[s,c]=e.useState(i),[d,m]=e.useState(n),[u,p]=e.useState(i.toString());e.useEffect(()=>{p(s.toString())},[s]);const g=Math.ceil(l/d),x=s<g,v=s>1,b=d*(s-1)+1,f=Math.min(d*s,l),h=o.map(e=>({label:e.toString(),value:e.toString()})),_=Array.from({length:g},(e,t)=>t+1).map(e=>({label:e.toString(),value:e.toString()})),w=e=>{c(e),null==a||a({currentPage:e,itemsPerPage:d})},N=e=>{const t=parseInt(e,10);if(isNaN(t))return void p(s.toString());const a=Math.max(1,Math.min(t,g));p(a.toString()),w(a)};return e.createElement("div",{className:"maxio-pagination"},e.createElement("div",{className:"maxio-pagination__items-per-page"},e.createElement("label",{htmlFor:"items-per-page-large",className:"maxio-pagination__label"},"Items per page"),e.createElement(Qe,{inline:!0,size:t,options:h,onChange:e=>{return t=Number(e.target.value),m(t),c(1),void(null==a||a({currentPage:1,itemsPerPage:t}));var t},value:d,id:"items-per-page-large"})),e.createElement("div",{className:"maxio-pagination__total-items"},e.createElement("span",null,b,"–",f," of ",l," items")),e.createElement("div",{className:"maxio-pagination__current-page"},r?e.createElement(Ye,{className:"maxio-pagination__page-input",value:u,min:1,max:g,onChange:e=>(e=>{p(e)})(e),onBlur:e=>{N(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(N(e.currentTarget.value),e.currentTarget.blur())},"aria-label":"Page number",size:t,type:"number",onWheel:e=>e.preventDefault()}):e.createElement(Qe,{inline:!0,size:t,"aria-label":"Select page",onChange:e=>w(Number(e.target.value)),value:s,options:_,id:"page-index-large"}),e.createElement("div",{className:"maxio-pagination__label"},"of ",g," pages")),e.createElement("div",{className:"maxio-pagination__controls"},e.createElement(Be,{onVisibilityUpdate:()=>{},renderContent:()=>"Previous",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(S,{icon:e.createElement(E,{variant:"chevron-left"}),size:t,variant:"ghost",onClick:()=>w(s-1),"aria-label":"Previous",disabled:!v})),e.createElement(Be,{onVisibilityUpdate:()=>{},renderContent:()=>"Next",floatingElementOffset:9,placement:"top",size:"small"},e.createElement(S,{icon:e.createElement(E,{variant:"chevron-right"}),size:t,variant:"ghost",onClick:()=>w(s+1),"aria-label":"Next",disabled:!x}))))},exports.Popover=de,exports.ProgressBar=({label:l,helperText:n,size:i="md",variant:o="default",status:r,value:s,maxValue:c=100})=>{const d=a.useId(),m=a.useId(),u=r&&!!l&&!!s&&!("inline"===o),p=n&&!("inline"===o),g=n&&"inline"===o,{progressBarProps:x,labelProps:v}=a.useProgressBar({maxValue:c,value:s,label:l}),b=t("maxio-progress-bar",{"maxio-progress-bar--lg":"lg"===i,"maxio-progress-bar--success":s&&!("inline"===o)&&"success"===r,"maxio-progress-bar--error":s&&!("inline"===o)&&"error"===r,"maxio-progress-bar--indent":"indent"===o,"maxio-progress-bar--inline":"inline"===o,"maxio-progress-bar--indeterminate":void 0===s});return e.createElement("div",{className:b,...x},e.createElement("div",{id:d,className:"maxio-progress-bar__label",...v},l),g&&e.createElement("div",{id:m,className:"maxio-progress-bar__helper-text"},n),e.createElement("div",{className:"maxio-progress-bar__track"},e.createElement("div",{className:"maxio-progress-bar__progress",style:{"--tw-scale-x":`${s}%`}})),u&&e.createElement("div",{className:`maxio-progress-bar__${r}-icon`}),p&&e.createElement("div",{id:m,className:"maxio-progress-bar__helper-text"},n))},exports.Radio=({indent:l=!1,disabled:n=!1,invalid:i=!1,label:o,...r})=>{const s=e.useRef(null),c=e.useContext(Ke),{inputProps:d,isDisabled:m}=a.useRadio({...r,value:(r.value||"").toString(),"aria-label":r["aria-label"]||o,isDisabled:n},c,s),u=t("maxio-radio",{"maxio-radio--indent":l,"maxio-radio--disabled":m||c.isDisabled,"maxio-radio--error":i||c.isInvalid});return e.createElement("label",{className:u},e.createElement("input",{ref:s,role:"radio",type:"radio",className:"maxio-radio__input",...d,name:c.name||d.name}),e.createElement("span",{className:"maxio-radio__control"}),e.createElement("span",{className:"maxio-radio__label"},o))},exports.RadioGroup=({children:t,label:l,errorMessage:n,helperText:i,disabled:o=!1,invalid:r=!1,name:s,defaultValue:c,...d})=>{const m=u.useRadioGroupState({isDisabled:o,isInvalid:r,description:i,name:s,label:l,errorMessage:n,defaultValue:c,...d}),{radioGroupProps:p,labelProps:g,descriptionProps:x,errorMessageProps:v}=a.useRadioGroup({"aria-label":d["aria-label"]||l,...d},m);return e.createElement(e.Fragment,null,e.createElement("div",{className:"maxio-radio-group",...p},l&&e.createElement("label",{className:"maxio-radio-group__label",...g},l),e.createElement(Ke.Provider,{value:m},t),r&&n&&e.createElement(se,{...v},n),i&&!r&&e.createElement(re,{...x},i)))},exports.SegmentedControl=et,exports.Select=Qe,exports.SideNav=({withIcons:t=!0,shouldToggleSidebar:a=!1,topDropdownItems:l,sections:n=[],collapseBreakpoint:i=800,isOpen:o,onChange:r})=>e.createElement(ot,{isOpen:o,onChange:r,collapseBreakpoint:i,withIcons:t,shouldToggleSidebar:a,topDropdownItems:l,sections:n},e.createElement(ut,null)),exports.Tab=pt,exports.TabList=({children:a,className:l,ariaLabel:n,overflow:i="none",moreLabel:o="More",...r})=>{const{variant:s,withDivider:d}=e.useContext(gt),m=e.useContext(c.TabListStateContext),u=e.useId(),[p,g]=e.useState(!1),x=t("maxio-tabs",l,{"maxio-tabs--contained":"contained"===s,"maxio-tabs--divider":d}),v=e.Children.map(a,e=>e);(null!=v?v:[]).forEach(t=>{if(!e.isValidElement(t)||t.type!==pt)throw new Error("You can only pass <Tab /> component as children")});const b="auto"===i&&!!(null==v?void 0:v.length),{ref:f,moreButtonRef:h,overflowIndexes:_,handleKeyDownCapture:w}=(({overflowEnabled:t,childrenArray:a})=>{const l=e.useRef(null),n=e.useRef(null),i=e.useRef(null),[o,r]=e.useState(null),s=$e(l),d=e.useContext(c.TabListStateContext),m=null!=(null==d?void 0:d.selectedKey)?Number(d.selectedKey):null,[u,p]=e.useState([]);e.useLayoutEffect(()=>{var e;if(!t||!o)return void p((null!=a?a:[]).map((e,t)=>t));const{visibleIndexes:l}=((e,t,a,l)=>{const n=e.map((e,t)=>t);if(e.reduce((e,t)=>e+t,0)<=t)return{visibleIndexes:n,overflowIndexes:[]};const i=[];let o=a;for(const a of n){if(o+e[a]>t)break;o+=e[a],i.push(a)}if(null!==l&&!i.includes(l)){for(o+=e[l];o>t&&i.length>0;)o-=e[i.pop()];i.push(l)}i.sort((e,t)=>e-t);const r=n.filter(e=>!i.includes(e));return{visibleIndexes:i,overflowIndexes:r}})(o.tabWidths,s,o.moreButtonWidth,null!==(e=i.current)&&void 0!==e?e:m);l.length===(null!=a?a:[]).length&&(i.current=null),p(l)},[t,o,s]),e.useLayoutEffect(()=>{t&&o&&null!==m&&p(e=>(e.includes(m)||(i.current=m),((e,t,a,l,n)=>{if(e.includes(n))return e;const i=[...e,n].sort((e,t)=>e-t);let o=l+i.reduce((e,a)=>e+t[a],0);for(;o>a&&i.length>1;){const e=i.length-1,a=i[e]===n?e-1:e,[l]=i.splice(a,1);o-=t[l]}return i})(e,o.tabWidths,s,o.moreButtonWidth,m)))},[m]);const g=t?(null!=a?a:[]).map((e,t)=>t).filter(e=>!u.includes(e)):[],x=((e,t)=>e.filter(e=>{var a;return!(null===(a=null==t?void 0:t[e])||void 0===a?void 0:a.props.disabled)}))(u,a);e.useLayoutEffect(()=>{var e,i;if(!t||!l.current)return void r(e=>null===e?e:null);const o=Array.from(l.current.querySelectorAll('[role="tab"]')),s=null!==(i=null===(e=n.current)||void 0===e?void 0:e.getBoundingClientRect().width)&&void 0!==i?i:0;r(e=>{var t;const l=(null!=a?a:[]).map((t,a)=>{var l,n,i;const r=null!==(n=null===(l=o[a])||void 0===l?void 0:l.getBoundingClientRect().width)&&void 0!==n?n:0;return r>0?r:null!==(i=null==e?void 0:e.tabWidths[a])&&void 0!==i?i:0}),n=s>0?s:null!==(t=null==e?void 0:e.moreButtonWidth)&&void 0!==t?t:0,i=(null==e?void 0:e.tabWidths.length)===l.length&&e.tabWidths.every((e,t)=>e===l[t]);return e&&i&&e.moreButtonWidth===n?e:{tabWidths:l,moreButtonWidth:n}})},[a,t]);const v=e=>{var t,a;void 0!==e&&(null==d||d.selectionManager.setFocused(!0),null==d||d.selectionManager.setFocusedKey(e),null==d||d.setSelectedKey(e),null===(a=null===(t=l.current)||void 0===t?void 0:t.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===a||a.focus())};return{ref:l,moreButtonRef:n,visibleIndexes:u,overflowIndexes:g,handleKeyDownCapture:e=>{var t;if(0===g.length)return;const a=document.activeElement===n.current,l=null==d?void 0:d.selectionManager.focusedKey,i=a?-1:x.indexOf(Number(l));if(a||-1!==i)switch(e.key){case"ArrowRight":if(a)return;return e.preventDefault(),e.stopPropagation(),void(i<x.length-1?v(x[i+1]):null===(t=n.current)||void 0===t||t.focus());case"ArrowLeft":return e.preventDefault(),e.stopPropagation(),void(a?v(x[x.length-1]):i>0&&v(x[i-1]));case"Home":if(a)return;return e.preventDefault(),e.stopPropagation(),void v(x[0]);case"End":if(a)return;return e.preventDefault(),e.stopPropagation(),void v(x[x.length-1])}}}})({overflowEnabled:b,childrenArray:v}),N=e.createElement("span",{className:"maxio-tabs__tab__content"},o,e.createElement(E,{variant:"chevron-down",className:"maxio-tabs__more__chevron"})),y=_.map(e=>{return`#${t=u,"undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,"\\$&")} [role="tablist"] > .maxio-tabs__tab:nth-child(${e+1})`;var t});return e.createElement("div",{id:u,className:x,ref:f,onKeyDownCapture:w},y.length>0&&e.createElement("style",null,`${y.join(", ")} { display: none; }`),e.createElement(c.TabList,{"aria-label":n,className:"maxio-contents",...r},(null!=v?v:[]).map((t,a)=>e.cloneElement(t,{key:a,value:a}))),b&&_.length>0&&e.createElement(c.MenuTrigger,{isOpen:p,onOpenChange:g},e.createElement(c.Button,{ref:h,className:"maxio-tabs__tab maxio-tabs__more__trigger","aria-label":o},N),p&&e.createElement(de,{hideArrow:!0,placement:"bottom end",className:"maxio-tabs__more__menu"},e.createElement(c.Menu,{"aria-label":`${o} tabs`,onAction:e=>{null==m||m.setSelectedKey(e),requestAnimationFrame(()=>{var t,a;null===(a=null===(t=f.current)||void 0===t?void 0:t.querySelector(`[role="tab"][data-key="${e}"]`))||void 0===a||a.focus()})}},_.map(t=>{const a=v[t],{disabled:l,type:n,"aria-label":i,"aria-labelledby":o}=a.props,r="icon"===n?a.props.icon:a.props.children;return e.createElement(c.MenuItem,{key:t,id:t,isDisabled:!!l,"aria-label":i,"aria-labelledby":o,className:"maxio-tabs__more__item"},r)})))))},exports.TabPanel=vt,exports.TabPanels=({children:t})=>{const a=e.Children.map(t,(t,a)=>{if(!e.isValidElement(t)||t.type!==vt)throw new Error("You can only pass <TabPanel /> component as children");return e.cloneElement(t,{key:a,value:a})});return e.createElement(c.TabPanels,{className:"maxio-tabs__panels"},a)},exports.Tabs=({children:t,variant:a="line",withDivider:l=!1,defaultIndex:n=0,index:i,onChange:o})=>e.createElement(c.Tabs,{className:"maxio-tabs-container",selectedKey:i,defaultSelectedKey:n,onSelectionChange:e=>null==o?void 0:o(Number(e))},e.createElement(xt,{variant:a,withDivider:l},t)),exports.Tag=({children:a,size:l,sentiment:n,kind:i="primary",leadingIcon:o,trailingIcon:r})=>{const s=t("maxio-tag",`maxio-tag--${i}`,!!n&&`maxio-tag--${n}`,!!l&&`maxio-tag--${l}`);return e.createElement("div",{className:s},o&&e.createElement(E,{variant:o,className:"maxio-tag__icon"}),e.createElement("span",{className:"maxio-tag__label"},a),r&&e.createElement(E,{variant:r,className:"maxio-tag__icon"}))},exports.TextArea=Ze,exports.TextField=Ue,exports.TextInput=Ye,exports.Tile=({children:a,className:l,href:n,onClick:i,target:o,disabled:r})=>{const s=n||i;if(!s)return e.createElement("div",{className:"maxio-tile"},a);const c=t("maxio-tile",l,{"maxio-tile--clickable":s,"maxio-tile--disabled":r});return e.createElement("a",{className:c,href:n,target:o,onClick:e=>{r&&n&&e.preventDefault(),!r&&i&&i()}},a)},exports.ToastProvider=({children:t,...a})=>{const{maxVisibleToasts:l=5,...n}=a,i=p.useToastState({maxVisibleToasts:l,...n});return e.useEffect(()=>{console.warn("ToastProvider is deprecated. Please use the global toast API instead.")},[]),e.createElement(e.Fragment,null,t(i),i.visibleToasts.length>0&&e.createElement(Tt,{...a,state:i}))},exports.ToastQueue=$t,exports.Toggle=({defaultChecked:a,checked:l,onChange:n,disabled:i,valueDescription:o,valueDescriptionPosition:r,className:s,name:c,id:d,...m})=>{const u=e.useId(),p="boolean"==typeof a,g=d||u,x="left"===r?"row":"row-reverse",v=o&&r,b=e.useCallback(e=>{if("Enter"===e.code||"Space"===e.code){e.preventDefault();const t=e.currentTarget.checked;p&&(e.currentTarget.checked=!t),n&&n(!t,e)}},[p,n]),f=m["aria-label"]||(v?void 0:o);return e.createElement("div",{className:t("maxio-toggle",s,{"maxio-toggle--disabled":i}),style:{display:"inline-flex",flexDirection:x},"data-testid":"toggle-container"},v?e.createElement("label",{className:"maxio-toggle__label",htmlFor:g},o):null,e.createElement("div",{className:"maxio-toggle__container"},e.createElement("input",{type:"checkbox",defaultChecked:a,checked:l,onChange:e=>{n&&n(e.target.checked,e)},onKeyDown:b,disabled:i,className:"maxio-toggle__checkbox",id:g,name:c,"aria-label":f}),e.createElement("div",{className:"maxio-toggle__track",role:"switch","aria-checked":l,"aria-hidden":"true"},e.createElement("div",{className:"maxio-toggle__handle"}),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-on"})),e.createElement("span",{className:"maxio-toggle__icon"},e.createElement("i",{className:"maxio-toggle__icon-off"})))))},exports.Tooltip=Me,exports.TooltipTrigger=Be,exports.TopBar=({children:t,actions:a,sideNavIsClosed:l,openSideNav:n})=>e.createElement("nav",{className:"maxio-top-bar"},l&&e.createElement(S,{"aria-label":"Open Side Navigation",variant:"ghost",icon:e.createElement(E,{variant:"sidebar"}),onClick:n}),e.createElement(Re,{grow:!0,justifyContent:"end"},t),a),exports.useElementResizeObserver=$e,exports.useHover=Te,exports.useOverlayTrigger=Se,exports.useToast=()=>{const t=e.useContext(Pt);if(!t)throw new Error("useToast must be used within a GlobalToastProvider. Please wrap your app with <GlobalToastProvider> to use the global toast API.");return t},exports.useWindowSize=Pe;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/components/Logo/logo.svg"],"sourcesContent":["<svg\n id=\"logo-svg\"\n data-name=\"Maxio Logo SVG\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 1036 240\"\n>\n <path d=\"M59.32,11.3L70.64,0h0s40.74,40.35,40.74,40.35v70.99H40.89L0,70.52l11.15-11.14,36.2,36.15h30.07l3.07-3.39L29.58,40.99l10.99-10.97,51.24,50.83,3.72-3.38v-30.34L59.32,11.3Z\" />\n <path d=\"M180.68,11.3L169.36,0h0s-40.73,40.35-40.73,40.35v70.99h70.48l40.89-40.83-11.15-11.14-36.2,36.15h-30.06l-3.07-3.39,50.91-51.15-10.99-10.97-51.24,50.83-3.72-3.38v-30.34l36.2-35.83Z\" />\n <path d=\"M59.32,228.7l11.31,11.29h0s40.74-40.35,40.74-40.35v-70.99H40.89L0,169.48l11.15,11.14,36.2-36.15h30.07l3.07,3.39-50.92,51.15,10.99,10.97,51.24-50.83,3.72,3.38v30.34l-36.2,35.83Z\" />\n <path d=\"M180.68,228.7l-11.32,11.29-40.73-40.35v-70.99h70.48l40.89,40.83-11.15,11.14-36.2-36.15h-30.06l-3.07,3.39,50.91,51.15-10.99,10.97-51.24-50.83-3.72,3.38v30.34l36.2,35.83Z\" />\n <path d=\"M1015.27,139.55c0-29.94-23.74-53.46-52.11-53.46-28.37,0-52.11,23.52-52.11,53.46s23.74,53.46,52.11,53.46,52.11-23.52,52.11-53.46ZM1035.59,140.5c-.5,40.27-32.73,72.76-72.43,72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71,72.44-73.71h.94c39.57.52,71.5,33.32,71.5,73.71v.95Z\" />\n <path fill-rule=\"evenodd\" d=\"M870.39,24h-20.33v20.33h20.33v-20.33ZM870.39,64.67h-20.33v148.59h20.33V64.67Z\" />\n <path fill-rule=\"evenodd\" d=\"M850.05,24h20.33v20.33h-20.33v-20.33Z\" />\n <path fill-rule=\"evenodd\" d=\"M695.01,82.85l50.83,56.28v6.53l-50.28,55.67,15.23,13.2,49.22-54.49h4.71l49.22,54.49,15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15,55.52h-3.96l-50.15-55.52-15.23,13.2Z\" />\n <path fill-rule=\"evenodd\" d=\"M660.49,78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13,0-52.44,18.93-58.09,44.86l-.28,1.27,19.33,3.72.31-1.14c2.39-8.91,6.66-16.54,13.04-21.94,6.36-5.39,14.91-8.63,26.02-8.63s19.12,3.25,24.76,8.96c5.64,5.72,8.73,14.06,8.73,24.53v6.11l-36.67,7.59-3.26.68c-16.14,3.47-29.79,7.84-39.59,14.45-10.54,7.11-16.64,16.83-16.64,30.62,0,12.51,4.51,22.62,12.5,29.59,7.96,6.95,19.25,10.67,32.63,10.67,22.27,0,41.87-12.03,51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58ZM620.4,146.77c-12.86,2.77-23.05,5.42-30.03,9.63-3.46,2.09-6.08,4.54-7.84,7.54-1.76,3-2.71,6.62-2.71,11.15,0,6.38,2.1,12.12,6.32,16.27,4.22,4.14,10.7,6.82,19.7,6.82,26.85,0,47.46-20.48,47.46-51.36v-7.2l-32.9,7.14Z\" />\n <path d=\"M434.8,188.74h4.54l61.73-164.33.15-.41h35.57v189.35h-20.89V55.37h-4.33l-59.7,157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98h-20.88V24h35.57l63.23,164.74Z\" />\n</svg>\n"],"names":["_path","_path2","_path3","_path4","_extends","Object","assign","bind","n","e","arguments","length","t","r","hasOwnProperty","call","apply","SvgLogo","props","React","createElement","xmlns","viewBox","d","fillRule"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/Logo/logo.svg"],"sourcesContent":["<svg\n id=\"logo-svg\"\n data-name=\"Maxio Logo SVG\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 1036 240\"\n>\n <path d=\"M59.32,11.3L70.64,0h0s40.74,40.35,40.74,40.35v70.99H40.89L0,70.52l11.15-11.14,36.2,36.15h30.07l3.07-3.39L29.58,40.99l10.99-10.97,51.24,50.83,3.72-3.38v-30.34L59.32,11.3Z\" />\n <path d=\"M180.68,11.3L169.36,0h0s-40.73,40.35-40.73,40.35v70.99h70.48l40.89-40.83-11.15-11.14-36.2,36.15h-30.06l-3.07-3.39,50.91-51.15-10.99-10.97-51.24,50.83-3.72-3.38v-30.34l36.2-35.83Z\" />\n <path d=\"M59.32,228.7l11.31,11.29h0s40.74-40.35,40.74-40.35v-70.99H40.89L0,169.48l11.15,11.14,36.2-36.15h30.07l3.07,3.39-50.92,51.15,10.99,10.97,51.24-50.83,3.72,3.38v30.34l-36.2,35.83Z\" />\n <path d=\"M180.68,228.7l-11.32,11.29-40.73-40.35v-70.99h70.48l40.89,40.83-11.15,11.14-36.2-36.15h-30.06l-3.07,3.39,50.91,51.15-10.99,10.97-51.24-50.83-3.72,3.38v30.34l36.2,35.83Z\" />\n <path d=\"M1015.27,139.55c0-29.94-23.74-53.46-52.11-53.46-28.37,0-52.11,23.52-52.11,53.46s23.74,53.46,52.11,53.46,52.11-23.52,52.11-53.46ZM1035.59,140.5c-.5,40.27-32.73,72.76-72.43,72.76h-.94c-39.58-.52-71.5-33.32-71.5-73.71s32.43-73.71,72.44-73.71h.94c39.57.52,71.5,33.32,71.5,73.71v.95Z\" />\n <path fill-rule=\"evenodd\" d=\"M870.39,24h-20.33v20.33h20.33v-20.33ZM870.39,64.67h-20.33v148.59h20.33V64.67Z\" />\n <path fill-rule=\"evenodd\" d=\"M850.05,24h20.33v20.33h-20.33v-20.33Z\" />\n <path fill-rule=\"evenodd\" d=\"M695.01,82.85l50.83,56.28v6.53l-50.28,55.67,15.23,13.2,49.22-54.49h4.71l49.22,54.49,15.23-13.2-50.28-55.67v-6.53l50.83-56.28-15.23-13.2-50.15,55.52h-3.96l-50.15-55.52-15.23,13.2Z\" />\n <path fill-rule=\"evenodd\" d=\"M660.49,78.64c-9.41-9.28-23.26-13.97-41.02-13.97-31.13,0-52.44,18.93-58.09,44.86l-.28,1.27,19.33,3.72.31-1.14c2.39-8.91,6.66-16.54,13.04-21.94,6.36-5.39,14.91-8.63,26.02-8.63s19.12,3.25,24.76,8.96c5.64,5.72,8.73,14.06,8.73,24.53v6.11l-36.67,7.59-3.26.68c-16.14,3.47-29.79,7.84-39.59,14.45-10.54,7.11-16.64,16.83-16.64,30.62,0,12.51,4.51,22.62,12.5,29.59,7.96,6.95,19.25,10.67,32.63,10.67,22.27,0,41.87-12.03,51.04-27.03v25.55h21.39v-95.3c0-17.6-4.77-31.3-14.19-40.58ZM620.4,146.77c-12.86,2.77-23.05,5.42-30.03,9.63-3.46,2.09-6.08,4.54-7.84,7.54-1.76,3-2.71,6.62-2.71,11.15,0,6.38,2.1,12.12,6.32,16.27,4.22,4.14,10.7,6.82,19.7,6.82,26.85,0,47.46-20.48,47.46-51.36v-7.2l-32.9,7.14Z\" />\n <path d=\"M434.8,188.74h4.54l61.73-164.33.15-.41h35.57v189.35h-20.89V55.37h-4.33l-59.7,157.57-.15.41h-29.29l-61.2-157.98h-4.35v157.98h-20.88V24h35.57l63.23,164.74Z\" />\n</svg>\n"],"names":["_path","_path2","_path3","_path4","_extends","Object","assign","bind","n","e","arguments","length","t","r","hasOwnProperty","call","apply","SvgLogo","props","React","createElement","xmlns","viewBox","d","fillRule"],"mappings":"q5gDAAA,IAAIA,GAAOC,GAAQC,GAAQC,GAC3B,SAASC,KAAa,OAAOA,GAAWC,OAAOC,OAASD,OAAOC,OAAOC,OAAS,SAAUC,GAAK,IAAK,IAAIC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAAE,IAAIG,EAAIF,UAAUD,GAAI,IAAK,IAAII,KAAKD,GAAG,CAAG,GAAEE,eAAeC,KAAKH,EAAGC,KAAOL,EAAEK,GAAKD,EAAEC,GAAK,CAAE,OAAOL,CAAG,EAAGJ,GAASY,MAAM,KAAMN,UAAY,CAEnR,MAAMO,GAAUC,GAAsBC,EAAMC,cAAc,MAAOhB,GAAS,CACxEiB,MAAO,6BACP,YAAa,iBACbC,QAAS,gBACRJ,GAAQlB,KAAUA,GAAqBmB,EAAMC,cAAc,OAAQ,CACpEG,EAAG,m3BACAtB,KAAWA,GAAsBkB,EAAMC,cAAc,OAAQ,CAChEI,SAAU,UACVD,EAAG,iEACArB,KAAWA,GAAsBiB,EAAMC,cAAc,OAAQ,CAChEI,SAAU,UACVD,EAAG,s3BACApB,KAAWA,GAAsBgB,EAAMC,cAAc,OAAQ,CAChEG,EAAG"}
|
|
@@ -33,6 +33,7 @@ Use this skill to build React components using `@maxio-com/react-ui-components`.
|
|
|
33
33
|
- [Components / Chip](references/components-chip.md)
|
|
34
34
|
- [Components / Data Table](references/components-data-table.md)
|
|
35
35
|
- [Components / Drawer](references/components-drawer.md)
|
|
36
|
+
- [Components / Empty State](references/components-empty-state.md)
|
|
36
37
|
- [Components / Flex](references/components-flex.md)
|
|
37
38
|
- [Components / Forms / Checkbox](references/components-forms-checkbox.md)
|
|
38
39
|
- [Components / Forms / ComboBox](references/components-forms-combobox.md)
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
# EmptyState
|
|
2
|
+
|
|
3
|
+
## Usage Guidelines
|
|
4
|
+
|
|
5
|
+
### Overview
|
|
6
|
+
|
|
7
|
+
EmptyState fills a table, list, search result, or other page section when there is no data to show, whether the surface has never had data or an active search or filter returned zero results.
|
|
8
|
+
|
|
9
|
+
#### When to Use
|
|
10
|
+
|
|
11
|
+
- Use EmptyState inside a DataTable, legacy table, list, or search results
|
|
12
|
+
view when there is nothing to show.
|
|
13
|
+
- Use the full layout with `title` when a surface has never had data and one
|
|
14
|
+
clear action would create the first record.
|
|
15
|
+
- Omit `title` when a surface has no data yet but no action belongs inline,
|
|
16
|
+
such as read-only or permission-restricted views; the same centered layout
|
|
17
|
+
renders without the heading.
|
|
18
|
+
- Omit both `title` and `description` to fall back to the built-in message.
|
|
19
|
+
Providing either one replaces it, so a `description` on its own renders as
|
|
20
|
+
the only copy.
|
|
21
|
+
- Set `hasActiveFilters` when the empty result comes from an active search or
|
|
22
|
+
filter rather than the true absence of data.
|
|
23
|
+
|
|
24
|
+
#### When Not to Use
|
|
25
|
+
|
|
26
|
+
- Do not use EmptyState for page-level errors or failed requests. Use an
|
|
27
|
+
[Alert](components-notifications-alert.md) or dedicated
|
|
28
|
+
error state instead.
|
|
29
|
+
- Do not use EmptyState for loading states. Pair a
|
|
30
|
+
[LoadingSpinner](components-loading-spinner.md) with the
|
|
31
|
+
surface shell instead.
|
|
32
|
+
|
|
33
|
+
### Variants
|
|
34
|
+
|
|
35
|
+
| Variants | Purpose | Usage notes |
|
|
36
|
+
| :----------------- | :------------------------------------------------------------ | :----------------------------------------------------------------------------- |
|
|
37
|
+
| With `title` | Heading, description, and actions in one centered layout | Use when the empty state should guide users toward creating the first record. |
|
|
38
|
+
| Without `title` | The same layout with the heading skipped | Use inside dense tables or lists where a full call to action would not fit. |
|
|
39
|
+
| Built-in message | Fallback copy when neither `title` nor `description` is given | Use when no bespoke copy is needed, such as read-only tables. |
|
|
40
|
+
| `hasActiveFilters` | Swaps in filter-specific fallback messaging | Use whenever the empty result is caused by the current search or filter state. |
|
|
41
|
+
|
|
42
|
+
### Behavior
|
|
43
|
+
|
|
44
|
+
- **Mouse and touch**: `actions` behaves according to what is composed into
|
|
45
|
+
it — a `Button` activates its click handler or navigates when given an
|
|
46
|
+
`href`, a `Link` navigates and opens in a new tab when marked `external`.
|
|
47
|
+
- **Keyboard**: composed actions are reachable with Tab and keep their native
|
|
48
|
+
activation keys.
|
|
49
|
+
- **Focus management**: EmptyState does not move or trap focus.
|
|
50
|
+
|
|
51
|
+
### Accessibility
|
|
52
|
+
|
|
53
|
+
- The decorative grid background is a `:before` pseudo-element on the root
|
|
54
|
+
container; it is generated content and is never exposed to assistive
|
|
55
|
+
technology, so no additional markup or `aria-hidden` is needed.
|
|
56
|
+
- `title` renders as an `h2` by default, since EmptyState sits inside a page
|
|
57
|
+
section rather than acting as the page title. Set `headingLevel` to match the
|
|
58
|
+
surrounding outline so the page never ends up with two `h1`s or a skipped
|
|
59
|
+
level.
|
|
60
|
+
- Keep `title` and `description` as the source of truth for why the surface
|
|
61
|
+
is empty; do not rely on the background alone.
|
|
62
|
+
- Give the primary action a specific, verb-first label such as "Add Customer"
|
|
63
|
+
instead of "Create".
|
|
64
|
+
- Mark an external link action `external` with a trailing `arrow-up-right`
|
|
65
|
+
icon so the new-tab behavior is visible, not just conveyed through
|
|
66
|
+
`target="_blank"`.
|
|
67
|
+
|
|
68
|
+
### Content
|
|
69
|
+
|
|
70
|
+
- Keep `title` short and specific to the empty resource, such as "Create your
|
|
71
|
+
first customer".
|
|
72
|
+
- Use `description` to explain what the resource is for and what appears once
|
|
73
|
+
data exists.
|
|
74
|
+
- Compose `actions` from `Button` and `Link` directly; keep at most one
|
|
75
|
+
primary (`variant="primary"`) action plus an optional secondary link.
|
|
76
|
+
- Keep action labels action-oriented and specific to what gets created.
|
|
77
|
+
|
|
78
|
+
### Related
|
|
79
|
+
|
|
80
|
+
- **[DataTable](components-data-table.md)**: render
|
|
81
|
+
EmptyState in place of table rows when there is no data.
|
|
82
|
+
- **[Card](components-card.md)**: wrap EmptyState in a Card
|
|
83
|
+
when it lives inside a smaller container.
|
|
84
|
+
|
|
85
|
+
## React
|
|
86
|
+
|
|
87
|
+
```tsx
|
|
88
|
+
import { EmptyState } from '@maxio-com/react-ui-components';
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Imports
|
|
92
|
+
|
|
93
|
+
```tsx
|
|
94
|
+
import { Button, EmptyState, Link } from "@maxio-com/react-ui-components";
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Prop Types
|
|
98
|
+
|
|
99
|
+
### EmptyState
|
|
100
|
+
|
|
101
|
+
| Prop | Type | Required | Default | Description | Source |
|
|
102
|
+
| --- | --- | --- | --- | --- | --- |
|
|
103
|
+
| `actions` | `ReactNode` | no | - | Action elements rendered below the description, such as `Button` and `Link`. | TypeLiteral |
|
|
104
|
+
| `description` | `string` | no | - | Supporting copy shown under the title, with or without a `title`. When neither `title` nor `description` is given, a built-in message is shown instead. | TypeLiteral |
|
|
105
|
+
| `hasActiveFilters` | `boolean` | no | `false` | Set when a search or filter is active but returned zero results. Swaps in filter-specific messaging when `title` is not provided. | TypeLiteral |
|
|
106
|
+
| `headingLevel` | `"h1" \| "h2" \| "h3" \| "h4" \| "h5" \| "h6"` | no | `h2` | Heading element used for `title`, so it fits the surrounding page outline. EmptyState renders inside a page section, so it defaults to `h2` rather than `h1`. | TypeLiteral |
|
|
107
|
+
| `title` | `string` | no | - | Heading text. When omitted, the heading is skipped and the rest of the layout is unchanged. | TypeLiteral |
|
|
108
|
+
|
|
109
|
+
## Stories
|
|
110
|
+
|
|
111
|
+
### Default
|
|
112
|
+
|
|
113
|
+
Use the full layout with a title when a surface has never had data. Pair a clear heading with one primary action that creates the first record.
|
|
114
|
+
|
|
115
|
+
```tsx
|
|
116
|
+
const Default = () => <EmptyState
|
|
117
|
+
title="Create your first customer"
|
|
118
|
+
description="Customers hold billing details and connect to subscriptions. Once created, every customer will show their plans, invoices, and payment history here."
|
|
119
|
+
actions={(<Button variant="primary" onClick={action('Add customer clicked')}>Add Customer
|
|
120
|
+
</Button>)} />;
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### With Primary Action
|
|
124
|
+
|
|
125
|
+
Use a link-styled primary action when creating the first record navigates to another page instead of opening a modal or form inline.
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
const WithPrimaryAction = () => <EmptyState
|
|
129
|
+
title="Create your first subscription"
|
|
130
|
+
description="Subscriptions connect a customer to a plan and start their billing cycle. Once created, every subscription will show its status, billing details, and renewal date here."
|
|
131
|
+
actions={(<Button variant="primary" href="#">Create Subscription
|
|
132
|
+
</Button>)} />;
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### With Secondary Action
|
|
136
|
+
|
|
137
|
+
Use a secondary link next to the primary action when a related resource, such as documentation, helps users decide what to do next.
|
|
138
|
+
|
|
139
|
+
```tsx
|
|
140
|
+
const WithSecondaryAction = () => <EmptyState
|
|
141
|
+
title="Connect your first integration"
|
|
142
|
+
description="Integrations sync customer and billing data with the tools your team already uses."
|
|
143
|
+
actions={(<>
|
|
144
|
+
<Button variant="primary" onClick={action('Add integration clicked')}>
|
|
145
|
+
Add Integration
|
|
146
|
+
</Button>
|
|
147
|
+
<Link
|
|
148
|
+
href="#"
|
|
149
|
+
external
|
|
150
|
+
icon="arrow-up-right"
|
|
151
|
+
variant="primary"
|
|
152
|
+
size="sm"
|
|
153
|
+
>
|
|
154
|
+
View documentation
|
|
155
|
+
</Link>
|
|
156
|
+
</>)} />;
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### No Data
|
|
160
|
+
|
|
161
|
+
Use the default no-title message when a surface has no data yet and no primary action belongs inline, such as read-only or permission-restricted views.
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
const NoData = () => <EmptyState />;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### No Results
|
|
168
|
+
|
|
169
|
+
Use the filtered message when an active search or filter returns zero results. Set `hasActiveFilters` so users understand adjusting their search or filters may surface results.
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
const NoResults = () => <EmptyState hasActiveFilters />;
|
|
173
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maxio-com/react-ui-components",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.21.0",
|
|
4
4
|
"description": "React UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "b9a22146235d44ea3b67a38c63bf2d6683bbef90"
|
|
69
69
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -243,6 +243,18 @@ interface DrawerProps {
|
|
|
243
243
|
declare const Drawer: ({ open, onOpenChange, placement, backdrop, size, className, title, description, children, footer, }: DrawerProps) => React$1.JSX.Element;
|
|
244
244
|
//# sourceMappingURL=Drawer.d.ts.map
|
|
245
245
|
|
|
246
|
+
type EmptyStateHeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
247
|
+
type EmptyStateProps = {
|
|
248
|
+
hasActiveFilters?: boolean;
|
|
249
|
+
title?: string;
|
|
250
|
+
headingLevel?: EmptyStateHeadingLevel;
|
|
251
|
+
description?: string;
|
|
252
|
+
actions?: ReactNode;
|
|
253
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'title'>;
|
|
254
|
+
|
|
255
|
+
declare const EmptyState: ({ hasActiveFilters, title, headingLevel, description, actions, className, ...rest }: EmptyStateProps) => React$1.JSX.Element;
|
|
256
|
+
//# sourceMappingURL=EmptyState.d.ts.map
|
|
257
|
+
|
|
246
258
|
type Variant = 'primary' | 'secondary' | 'tertiary' | 'high-contrast' | 'inverse';
|
|
247
259
|
type Size = 'xs' | 'sm' | 'md' | 'lg';
|
|
248
260
|
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
@@ -920,5 +932,5 @@ type AuthLayoutProps = {
|
|
|
920
932
|
declare const AuthLayout: ({ children, heading, description, sentiment, leadingElement, alert, topAddon, footer, }: AuthLayoutProps) => React$1.JSX.Element;
|
|
921
933
|
//# sourceMappingURL=AuthLayout.d.ts.map
|
|
922
934
|
|
|
923
|
-
export { ActionList, Alert, AuthLayout, Avatar, Banner, Body, Breadcrumbs, BreadcrumbsItem, Button, Card, Checkbox, CheckboxGroup, Chip, Code, ComboBox, DataTable, Display, Drawer, Flex, FormErrorMessage, FormHelperText, GlobalToastProvider, Grid, Heading, Icon, IconButton, Label, Link, ListBox, LoadingSpinner, Logo, Menu, MenuButton, MenuList, OverlayTrigger, Pagination, Popover, ProgressBar, Radio, RadioGroup, SegmentedControl, Select, SideNavWrapper as SideNav, Tab, TabList, TabPanel, TabPanels, Tabs, Tag, TextArea, TextField, TextInput, Tile, ToastProvider, ToastQueue, Toggle, Tooltip, TooltipTrigger, TopBar, useElementResizeObserver, useHover, useOverlayTrigger, useToast, useWindowSize };
|
|
924
|
-
export type { ComboBoxProps, DrawerProps, Interactions, OverlayAriaRole, Placement, PopoverProps, SegmentedControlItemProps, SegmentedControlProps, SegmentedControlSize, TextAreaProps, TextFieldProps, TextInputProps };
|
|
935
|
+
export { ActionList, Alert, AuthLayout, Avatar, Banner, Body, Breadcrumbs, BreadcrumbsItem, Button, Card, Checkbox, CheckboxGroup, Chip, Code, ComboBox, DataTable, Display, Drawer, EmptyState, Flex, FormErrorMessage, FormHelperText, GlobalToastProvider, Grid, Heading, Icon, IconButton, Label, Link, ListBox, LoadingSpinner, Logo, Menu, MenuButton, MenuList, OverlayTrigger, Pagination, Popover, ProgressBar, Radio, RadioGroup, SegmentedControl, Select, SideNavWrapper as SideNav, Tab, TabList, TabPanel, TabPanels, Tabs, Tag, TextArea, TextField, TextInput, Tile, ToastProvider, ToastQueue, Toggle, Tooltip, TooltipTrigger, TopBar, useElementResizeObserver, useHover, useOverlayTrigger, useToast, useWindowSize };
|
|
936
|
+
export type { ComboBoxProps, DrawerProps, EmptyStateHeadingLevel, EmptyStateProps, Interactions, OverlayAriaRole, Placement, PopoverProps, SegmentedControlItemProps, SegmentedControlProps, SegmentedControlSize, TextAreaProps, TextFieldProps, TextInputProps };
|