@overmap-ai/blocks 1.0.5-fix-problems-magnus.1 → 1.0.6-master.1
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/README.md +3 -3
- package/dist/BaseMenuGroups/BaseItemGroup/BaseItemGroup.d.ts +3 -0
- package/dist/BaseMenuGroups/BaseItemGroup/index.d.ts +2 -0
- package/dist/BaseMenuGroups/BaseItemGroup/typings.d.ts +11 -0
- package/dist/BaseMenuGroups/BaseMenuComponents.d.ts +11 -0
- package/dist/BaseMenuGroups/BaseMultiSelectGroup/BaseMultiSelectGroup.d.ts +3 -0
- package/dist/BaseMenuGroups/BaseMultiSelectGroup/index.d.ts +2 -0
- package/dist/BaseMenuGroups/BaseMultiSelectGroup/typings.d.ts +16 -0
- package/dist/BaseMenuGroups/BaseSelectGroup/BaseSelectGroup.d.ts +3 -0
- package/dist/BaseMenuGroups/BaseSelectGroup/index.d.ts +2 -0
- package/dist/BaseMenuGroups/BaseSelectGroup/typings.d.ts +16 -0
- package/dist/BaseMenuGroups/BaseSubMenuGroup/BaseSubMenuGroup.d.ts +3 -0
- package/dist/BaseMenuGroups/BaseSubMenuGroup/index.d.ts +2 -0
- package/dist/BaseMenuGroups/BaseSubMenuGroup/typings.d.ts +14 -0
- package/dist/BaseMenuGroups/index.d.ts +5 -0
- package/dist/BaseMenuGroups/typings.d.ts +37 -0
- package/dist/BaseMenuGroups/utils.d.ts +5 -0
- package/dist/ConfirmEditInput/ConfirmEditInput.d.ts +3 -0
- package/dist/ConfirmEditInput/index.d.ts +2 -0
- package/dist/ConfirmEditInput/typings.d.ts +14 -0
- package/dist/Dialogs/Dialog/index.d.ts +1 -0
- package/dist/Dialogs/Dialog/utils.d.ts +7 -0
- package/dist/DropdownItemMenu/DropdownItemMenu.d.ts +9 -0
- package/dist/DropdownItemMenu/index.d.ts +2 -0
- package/dist/DropdownMenu/DropdownMenu.d.ts +5 -17
- package/dist/DropdownMenu/DropdownMenuGroups.d.ts +18 -0
- package/dist/DropdownMenu/index.d.ts +2 -0
- package/dist/DropdownMultiSelect/DropdownMultiSelect.d.ts +6 -0
- package/dist/DropdownMultiSelect/index.d.ts +2 -0
- package/dist/DropdownSelect/DropdownSelect.d.ts +5 -57
- package/dist/DropdownSelect/index.d.ts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/Separator/typings.d.ts +2 -1
- package/dist/blocks.js +3014 -1926
- package/dist/blocks.js.map +1 -0
- package/dist/blocks.umd.cjs +3749 -10
- package/dist/blocks.umd.cjs.map +1 -0
- package/dist/index.d.ts +6 -3
- package/dist/style.css +655 -1
- package/dist/utils.d.ts +12 -1
- package/package.json +102 -98
package/dist/blocks.umd.cjs
CHANGED
|
@@ -1,12 +1,3232 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/(function(n){(function(){var a={}.hasOwnProperty;function r(){for(var o=[],l=0;l<arguments.length;l++){var i=arguments[l];if(i){var d=typeof i;if(d==="string"||d==="number")o.push(i);else if(Array.isArray(i)){if(i.length){var s=r.apply(null,i);s&&o.push(s)}}else if(d==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){o.push(i.toString());continue}for(var f in i)a.call(i,f)&&i[f]&&o.push(f)}}}return o.join(" ")}n.exports?(r.default=r,n.exports=r):window.classNames=r})()})(Ze);var Lt=Ze.exports;const x=jt(Lt);function K(n,a){return e.useMemo(()=>{if(n!==void 0)if(typeof n=="object"){if(!("initial"in n))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(n).map(([r,o])=>[r,a[o]]))}else return a[n]},[a,n])}const Wt={success:"green",danger:"red",warning:"amber",info:"gray"},N=n=>{const a=c.useThemeContext();if(n)return n==="primary"?a.accentColor:Wt[n]},Ht=()=>{const[n,a]=e.useState("initial"),[r,o]=e.useState("initial"),l=he.useMediaQuery({minWidth:"520px"}),i=he.useMediaQuery({minWidth:"768px"}),d=he.useMediaQuery({minWidth:"1024px"}),s=he.useMediaQuery({minWidth:"1280px"}),f=he.useMediaQuery({minWidth:"1640px"});return e.useLayoutEffect(()=>{o(u=>(a(u),f?"xl":s?"lg":d?"md":i?"sm":l?"xs":"initial"))},[s,d,i,f,l]),{size:r,prevSize:n,xs:l,sm:i,md:d,lg:s,xl:f}},Re=(n,a,r)=>{const[o,l]=e.useState([]),[i,d]=e.useState(!0),s=e.useCallback(g=>{const{repeat:h,key:_}=g;d(!0),!(h||o.includes(_))&&l(C=>[...C,_])},[o]),f=e.useCallback(g=>{const{key:h}=g;d(!1),o.includes(h)&&l(_=>{const C=[..._];return C.splice(_.indexOf(h),1),C})},[o]);e.useEffect(()=>(a||document.addEventListener("keydown",s,!0),()=>{document.removeEventListener("keydown",s,!0)}),[a,s]),e.useEffect(()=>(a||document.addEventListener("keyup",f,!0),()=>{document.removeEventListener("keyup",f,!0)}),[a,f]);const u=e.useMemo(()=>!a&&i&&o.length===n.length&&o.every(g=>n.includes(g)),[a,i,o,n]);return e.useEffect(()=>{u&&r()},[u,r]),u},Vt=n=>{const a=[];for(const r of e.Children.toArray(n))e.isValidElement(r)&&a.push(r);return a},qt=e.forwardRef(function({className:a,severity:r="primary",color:o,children:l,...i},d){const s=N(r);return t.jsx(c.Badge,{className:x("overmap-badge",a),ref:d,color:o||s,...i,children:l})}),Ut=e.memo(qt),Ae={zeroMinWidth:"_zeroMinWidth_curjh_1",zeroMinHeight:"_zeroMinHeight_curjh_5",radius:"_radius_curjh_9"},j=e.memo(e.forwardRef(({className:n,radius:a=!1,children:r,zeroMinWidth:o=!1,zeroMinHeight:l=!1,...i},d)=>t.jsx(c.Flex,{className:x(n,{[Ae.radius]:a,[Ae.zeroMinWidth]:o,[Ae.zeroMinHeight]:l}),ref:d,...i,children:r}))),et=e.createContext({}),Gt=()=>e.useContext(et),Kt=e.memo(e.forwardRef(({className:n,children:a,...r},o)=>{const{size:l,severity:i}=Gt(),d=N(i);return t.jsx(c.Box,{className:x("overmap-breadcrumb-item",n),height:"max-content",width:"max-content",children:t.jsx(c.Link,{ref:o,size:l,color:d,...r,children:t.jsx(j,{height:"100%",width:"100%",align:"center",gap:"1",children:a})})})})),Xt={Group:e.memo(e.forwardRef(({className:n,children:a,separator:r,severity:o="info",size:l,gap:i="2",...d},s)=>{const f=N(o),u=Vt(a);return t.jsx(et.Provider,{value:{size:l,severity:o},children:t.jsx(j,{className:x("overmap-breadcrumb-group",n),ref:s,gap:i,role:"breadcrumb",height:"max-content",width:"max-content",...d,children:u.map((g,h)=>t.jsxs(t.Fragment,{children:[e.cloneElement(g,{key:h}),u.length-1!==h&&t.jsx(c.Text,{color:f,children:t.jsx(j,{height:"100%",width:"100%",align:"center",children:r})})]}))})})})),Item:Kt},be={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},tt={spin90Clockwise:be.hoverSpin90Clockwise,spin180Clockwise:be.hoverSpin180Clockwise,spin360Clockwise:be.hoverSpin360Clockwise},Qt={role:"button",tabIndex:0,onKeyDown:n=>{(n.key==="Enter"||n.key===" ")&&n.currentTarget.click()}},le={small:"1",medium:"2",large:"3"},nt=e.createContext({}),ze=()=>e.useContext(nt),Jt={spinner:"_spinner_isifr_9",spin:"_spin_isifr_9"},Be=e.memo(()=>t.jsx("div",{className:Jt.spinner}));Be.displayName="Spinner";const Yt=e.forwardRef(function(a,r){const o=ze(),{className:l,type:i="button",fluid:d=o.fluid??!1,size:s=o.size??"medium",severity:f=o.severity??"primary",hoverEffects:u=o.hoverEffects??[],variant:g=o.variant,shortcut:h={keys:[],action:()=>{},disabled:!1},loading:_,children:C,disabled:m,...w}=a,v=N(f),P=u.map(S=>tt[S]);return Re(h.keys,h.disabled||h.keys.length===0,h.action),t.jsx(c.Button,{ref:r,type:i,className:x(l,P,{[be.fluid]:d}),color:v,size:K(s,le),variant:g,disabled:_||m,...w,children:_?t.jsx(Be,{}):C})}),Z=e.memo(Yt),Zt=e.forwardRef(function(a,r){const o=ze(),{className:l,children:i,type:d="button",fluid:s=o.fluid??!1,size:f=o.size??"medium",severity:u=o.severity??"primary",hoverEffects:g=o.hoverEffects??[],variant:h=o.variant,shortcut:_={keys:[],action:()=>{},disabled:!1},...C}=a,m=N(u),w=(g==null?void 0:g.map(v=>tt[v]))||[];return Re(_.keys,_.disabled||_.keys.length===0,_.action),t.jsx(c.IconButton,{className:x(l,w,{[be.fluid]:s}),ref:r,color:m,size:K(f,le),variant:h,type:d,...C,children:i})}),H=e.memo(Zt),Rt={merged:"_merged_wdgxo_1"},en={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},tn=e.forwardRef(function({className:a,merged:r=!1,children:o,gap:l,direction:i="row",severity:d,size:s="medium",variant:f,hoverEffects:u,fluid:g,...h},_){const C=K(s,en[i]),m=f==="ghost"?C:"0";return t.jsx(c.Flex,{className:x("overmap-button-group",a,{[Rt.merged]:r}),ref:_,gap:r?l??m:l??"2",direction:i,"data-direction":i,...h,children:t.jsx(nt.Provider,{value:{size:s,severity:d,variant:f,hoverEffects:u,fluid:g},children:o})})}),Fe=e.memo(tn),nn={separators:"_separators_1f7v1_1"},on=e.memo(e.forwardRef((n,a)=>{const{children:r,border:o,before:l,after:i,size:d}=n,s=o?"surface":"ghost",f=K(d,le),u=l&&i?t.jsx(c.Inset,{side:"x",pt:"current",pb:"current",children:r}):l?t.jsx(c.Inset,{side:"bottom",pt:"current",children:r}):i?t.jsx(c.Inset,{side:"top",pb:"current",children:r}):t.jsx(c.Inset,{children:r}),g=t.jsxs(c.Card,{ref:a,size:f,variant:s,children:[l,u,i]});return s==="ghost"?t.jsx(c.Box,{p:"3",children:g}):g})),rn=e.memo(e.forwardRef((n,a)=>{const{children:r,variant:o="outline",size:l,className:i,...d}=n,s=o==="outline"||o==="surface",f=o==="outline"?"ghost":o==="surface"?"soft":o;return t.jsx(on,{...d,border:s,size:l,children:t.jsx(Fe,{size:l,severity:"info",variant:f,className:x(i,nn.separators),merged:!0,gap:"0",direction:"column",ref:a,children:r})})})),an=e.memo(e.forwardRef((n,a)=>{const{variant:r}=ze(),o=t.jsx(Z,{ref:a,...n,radius:"large",variant:r});return r==="ghost"?t.jsx(c.Box,{asChild:!0,my:"1",mx:"2",children:o}):o})),ln={Root:rn,Item:an},sn=e.memo(function(a){const{title:r,description:o,content:l,closeDialog:i}=a;return t.jsxs(c.Flex,{direction:"column",gap:"2",children:[t.jsxs(c.Flex,{direction:"column",gap:"1",children:[t.jsxs(c.Flex,{justify:"between",children:[t.jsx(c.Dialog.Title,{mb:"0",children:r}),t.jsx(c.Dialog.Close,{children:t.jsx(c.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:t.jsx(T.Cross1Icon,{})})})]}),o&&t.jsx(c.Dialog.Description,{children:o})]}),l(i)]})}),cn=e.memo(e.forwardRef((n,a)=>{const{children:r,content:o,title:l,description:i,onOpen:d,onClose:s,defaultOpen:f,onCloseInterrupt:u,open:g,onOpenChange:h,..._}=n,[C,m]=e.useState(f??!1),w=g??C;if((u||d)&&h)throw new Error("Neither the `onCloseInterrupt` nor `onOpen` props can be used with `onOpenChange`.");if(g!==void 0&&h===void 0)throw new Error("The `open` prop requires the `onOpenChange` prop.");if(!r&&g===void 0)throw new Error("Either the `children` or `open` prop must be defined.");if(r&&g!==void 0)throw new Error("The `children` and `open` props cannot be used together.");const v=e.useCallback(S=>{if(h)return h(S);if(S&&d)d();else{if(!S&&u)return u(()=>{m(!1),s&&s()});!S&&s&&s()}m(S)},[h,d,s,u]),P=e.useCallback(S=>{if(S!=null&&S.force)return m(!1);v(!1)},[v]);return t.jsxs(c.Dialog.Root,{open:w,onOpenChange:v,children:[t.jsx(c.Dialog.Trigger,{children:r}),t.jsx(c.Dialog.Content,{ref:a,..._,children:t.jsx(sn,{closeDialog:P,content:o,title:l,description:i})})]})})),ot=n=>t.jsx(c.AlertDialog.Title,{mb:"0",...n}),dn=n=>{const{title:a,description:r,actionText:o="Confirm",cancelText:l="Cancel",onAction:i,onCancel:d,severity:s}=n;return t.jsxs(c.Flex,{direction:"column",gap:"2",children:[t.jsxs(c.Flex,{direction:"column",gap:"1",children:[t.jsx(ot,{children:a}),t.jsx(c.AlertDialog.Description,{children:r})]}),t.jsxs(c.Flex,{gap:"3",mt:"4",justify:"end",children:[t.jsx(c.AlertDialog.Cancel,{children:t.jsx(Z,{variant:"soft",severity:"info",onClick:d,children:l})}),t.jsx(c.AlertDialog.Action,{children:t.jsx(Z,{variant:"solid",severity:s,onClick:i,children:o})})]})]})},rt=e.memo(function(a){const{open:r,setOpen:o,children:l,...i}=a,d=e.useMemo(()=>({close:()=>o(!1),Title:ot,Description:c.AlertDialog.Description}),[o]);return t.jsxs(c.AlertDialog.Root,{open:r,onOpenChange:o,children:[t.jsx(c.AlertDialog.Content,{children:"content"in i?i.content(d):t.jsx(dn,{...i})}),l]})}),je=e.createContext(()=>{throw new Error("No AlertDialogProvider found")}),un={content:()=>null},fn=e.memo(function({children:a}){const[r,o]=e.useState(!1),[l,i]=e.useState(un),d=e.useCallback(s=>{if(r)throw new Error("AlertDialog is already open");i(s),o(!0)},[r]);return t.jsx(rt,{open:r,setOpen:o,...l,children:t.jsx(je.Provider,{value:d,children:a})})}),at=()=>e.useContext(je),pn=()=>{const n=at();return e.useCallback(a=>n({title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",actionText:"Discard",severity:"danger",onAction:a.onDiscard,onCancel:a.onCancel}),[n])},we={DropdownMenu:"_DropdownMenu_hj4sz_1",DropdownMenuItemWrapper:"_DropdownMenuItemWrapper_hj4sz_8",DropdownMenuSeparatorWrapper:"_DropdownMenuSeparatorWrapper_hj4sz_13",DropdownMenuItem:"_DropdownMenuItem_hj4sz_8"},hn={1:"max-content",2:"max-content",3:"max-content",4:"100%"},gn=e.forwardRef(function({severity:a="info",weight:r="light",gap:o="1",text:l,orientation:i="horizontal",size:d,...s},f){const u=K(d,hn),g=N(a);return t.jsxs(c.Flex,{ref:f,width:i==="horizontal"?u:"max-content",height:i==="vertical"?u:"max-content",direction:i==="vertical"?"column":"row",align:"center",gap:o,children:[t.jsx(c.Separator,{size:d,orientation:i,color:g,...s}),l&&t.jsxs(t.Fragment,{children:[t.jsx(c.Text,{as:"span",size:"1",weight:r,color:g,children:l}),t.jsx(c.Separator,{size:d,orientation:i,color:g,...s})]})]})}),it=e.memo(gn),bn=e.memo(function({content:a,onSelect:r,closeOnSelect:o,...l}){const i=e.useCallback(d=>{r&&r(d),o||d.preventDefault()},[o,r]);return t.jsx(c.DropdownMenu.Item,{className:we.DropdownMenuItem,textValue:"",onSelect:i,...l,children:t.jsx(c.Flex,{align:"center",gap:"1",children:a})})}),Cn=e.memo(e.forwardRef(({className:n,trigger:a,items:r,label:o,disabled:l,severity:i="info",modal:d=!1,closeOnSelect:s=!0,...f},u)=>{const g=N(i);return t.jsxs(c.DropdownMenu.Root,{modal:d,children:[t.jsx(c.DropdownMenu.Trigger,{disabled:l,children:a}),t.jsx(c.DropdownMenu.Content,{className:x("overmap-dropdown",n),color:g,variant:"soft",ref:u,...f,children:t.jsxs(c.Flex,{className:we.DropdownMenu,direction:"column",height:"max-content",width:"max-content",children:[!!o&&t.jsx(c.DropdownMenu.Label,{children:o}),r.map(({closeOnSelect:h,separator:_,...C},m)=>t.jsxs(c.Box,{children:[t.jsx(c.Box,{className:we.DropdownMenuItemWrapper,children:t.jsx(bn,{closeOnSelect:h??s,...C},m)}),!!_&&t.jsx(c.Box,{className:we.DropdownMenuSeparatorWrapper,children:t.jsx(it,{size:"4"})})]},m))]})})]})})),se={DropdownSelect:"_DropdownSelect_k517z_1",BorderBottom:"_BorderBottom_k517z_8",DropdownSelectInputWrapper:"_DropdownSelectInputWrapper_k517z_12",DropdownSelectInput:"_DropdownSelectInput_k517z_12",DropdownSelectItem:"_DropdownSelectItem_k517z_27"},vn=150,mn=e.memo(e.forwardRef(({trigger:n,items:a,disabled:r=!1,value:o,onValueChange:l,placeholder:i,filterValue:d,onFilterValueChange:s,closeOnSelect:f=!0,icons:u,severity:g="info"},h)=>{const _=N(g),C=e.useCallback(v=>P=>{l(o!==v?v:void 0),f||P.preventDefault()},[o,f,l]),m=e.useCallback(v=>{s&&s(v.target.value)},[s]),w=e.useCallback(v=>{!v&&s&&setTimeout(()=>{s("")},vn)},[s]);return t.jsxs(c.DropdownMenu.Root,{onOpenChange:w,children:[t.jsx(c.DropdownMenu.Trigger,{disabled:r,children:n}),t.jsx(c.DropdownMenu.Content,{ref:h,variant:"soft",color:_,className:se.Test,children:t.jsxs(j,{className:se.DropdownSelect,direction:"column",children:[d!==void 0&&!!s&&t.jsx(c.Box,{px:"1",className:x({[se.BorderBottom]:a.length!==0}),children:t.jsxs(c.TextField.Root,{className:se.DropdownSelectInputWrapper,size:"2",variant:"soft",children:[!!u&&!!u.leftInputIcon&&t.jsx(c.TextField.Slot,{children:u.leftInputIcon}),t.jsx(c.TextField.Input,{className:se.DropdownSelectInput,value:d,placeholder:i,onChange:m}),!!u&&!!u.rightInputIcon&&t.jsx(c.TextField.Slot,{children:u.rightInputIcon})]})}),t.jsx(c.Box,{p:a.length!==0?"1":"0",children:t.jsx(j,{direction:"column",children:a.map(({content:v,value:P},S)=>t.jsx(c.DropdownMenu.Item,{className:se.DropdownSelectItem,onSelect:C(P),textValue:"",asChild:!0,children:t.jsxs(j,{align:"center",height:"max-content",width:"100%",gap:"5",children:[t.jsx(c.Box,{grow:"1",children:v}),t.jsx(j,{justify:"center",align:"center",height:"max-content",width:"4",children:o===P&&(u&&(u!=null&&u.selectedItemIcon)?u.selectedItemIcon:t.jsx(T.CheckIcon,{}))})]})},S))})})]})})]})})),lt=e.memo(function({children:a}){const[r,o]=e.useState(!1),l=e.useCallback(()=>{o(!0)},[]),i=e.useCallback(()=>{o(!1)},[]);return a({isHovered:r,onPointerEnter:l,onPointerLeave:i})}),st={fluid:"_fluid_7n1wr_1"},_n=e.forwardRef(function({className:a,fluid:r,size:o="medium",variant:l="surface",severity:i="primary",itemSeverity:d="info",placeholder:s="Select",side:f,items:u=[],value:g,id:h,..._},C){const m=K(o,le),w=N(i),v=N(d);return e.createElement(c.Select.Root,{size:m,..._,key:g===void 0?1:0,value:g},t.jsx(c.Select.Trigger,{className:x(a,{[st.fluid]:r}),id:h,ref:C,variant:l,placeholder:s,color:w}),t.jsx(c.Select.Content,{side:f,className:st.contentDefault,position:"popper",variant:l!=="surface"?"soft":"solid",color:v,children:u.map(({itemContent:P,value:S,...k})=>t.jsx(c.Select.Item,{className:"overmap-select-item",value:S,...k,children:P},S))}))}),ct=e.memo(_n),dt=e.memo(e.forwardRef((n,a)=>{const{checked:r,label:o,value:l,size:i="2"}=n;return t.jsx(c.Box,{asChild:!0,px:i,children:t.jsx(c.Select.Item,{value:l,ref:a,children:t.jsxs(c.Flex,{gap:i,align:"center",children:[t.jsx(c.Checkbox,{checked:r}),o]})})})})),Se="__select_all__",yn=e.memo(e.forwardRef((n,a)=>{const[r,o]=e.useState(!1),{placeholder:l,value:i,onValueChange:d,options:s,disabled:f,name:u,...g}=n,h=K(n.size,le),_=N(n.severity),C=e.useMemo(()=>new Map(s.map(S=>[S.value,S.label])),[s]),m=i.length>4?`${i.length} options selected`:t.jsx("span",{children:i.flatMap(S=>[C.get(S),", "]).slice(0,-1)}),w=e.useCallback(()=>o(!1),[]),v=e.useCallback(S=>{S&&o(!0)},[]),P=e.useCallback(S=>{let k;S===Se?k=i.length===s.length?[]:s.map(J=>J.value):k=i.includes(S)?i.filter(M=>M!==S):[...i,S],d(k)},[d,s,i]);return e.useEffect(()=>{if(s.some(({value:S})=>S===Se))throw new Error(`Cannot have an option with the value "${Se}"`)},[s]),t.jsxs(c.Select.Root,{open:r,value:"",onOpenChange:v,onValueChange:P,disabled:f,size:h,name:u,autoComplete:"off",children:[t.jsx(c.Select.Trigger,{ref:a,color:_,placeholder:i.length>0?m:l,"data-placeholder":i.length>0?void 0:!0,...g}),t.jsxs(c.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:w,onPointerDownOutside:w,children:[t.jsx(dt,{value:Se,label:"Select all",checked:i.length===s.length,size:h}),s.map(S=>t.jsx(dt,{...S,checked:i.includes(S.value),size:h},S.value))]})]})})),wn={default:"_default_u936h_1"},Sn=e.forwardRef(function({className:a,severity:r="primary",icon:o,defaultChecked:l=!1,onCheckedChange:i,...d},s){const f=e.useRef(null),[u,g]=e.useState(d.checked?d.checked:l),[h,_]=e.useState(),C=N(r);e.useLayoutEffect(()=>{var P;const v=s||f;"current"in v&&v.current&&_((P=v.current)==null?void 0:P.querySelector("span.rt-SwitchThumb"))},[s]);const m=e.useCallback(v=>{g(v),i&&i(v)},[i]),w=d.checked?d.checked:u;return t.jsxs(t.Fragment,{children:[t.jsx(c.Switch,{className:x("overmap-switch",a,wn.default),ref:s||f,color:C,radius:"full",defaultChecked:l,onCheckedChange:m,...d}),t.jsx(c.Portal,{container:h,asChild:!0,children:o&&"checked"in o?w?o.checked:o.unchecked:o})]})}),xn=e.memo(Sn),ce={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},Pn={width:"auto",height:"100%"},kn=e.forwardRef(function({side:a="left",modal:r=!0,children:o,open:l,containerSelector:i,overlay:d=!0,resizable:s=!0,minWidth:f="300px",maxWidth:u="500px",...g},h){const _=a==="right",C=a==="left",[m,w]=e.useState();return e.useEffect(()=>{const v=i??'[data-is-root-theme="true"]',P=document.querySelector(v);if(P===void 0)throw new Error(`Could not find a container element using the following selector ${v}`);w(P)},[i]),t.jsx(ye.Root,{open:l,modal:r,children:t.jsxs(ye.Portal,{container:m,children:[d&&t.jsx(ye.Overlay,{className:x(ce.overlay)}),t.jsx(ye.Content,{className:x("overmap-sidebar","rt-DialogContent",ce.sidebarContent,{[ce.left]:C,[ce.right]:_}),ref:h,asChild:!0,...g,children:t.jsx(c.Box,{width:"auto",children:t.jsx(me.Resizable,{minWidth:f,maxWidth:u,defaultSize:Pn,enable:{right:s&&C,left:s&&_},handleClasses:{left:ce.resizeHandle,right:ce.resizeHandle},handleComponent:{right:t.jsx(T.DragHandleDots2Icon,{}),left:t.jsx(T.DragHandleDots2Icon,{})},children:o})})})]})})}),$n=e.memo(kn),V={outerContent:"_outerContent_1iy9c_1",enter:"_enter_1iy9c_4",right:"_right_1iy9c_4",left:"_left_1iy9c_8",enterActive:"_enterActive_1iy9c_12",exitActive:"_exitActive_1iy9c_22",exitDone:"_exitDone_1iy9c_32",resizable:"_resizable_1iy9c_41",slideOutOverlay:"_slideOutOverlay_1iy9c_47"},Tn=200,Dn=e.memo(function({className:a,open:r,side:o="left",children:l,minWidth:i,maxWidth:d,resizable:s=!0,overlay:f=!1,modal:u=!1,resizeHandle:g,position:h="absolute",..._}){const C=e.useRef(null),[m,w]=e.useState(i),v=o==="left",P=o==="right",S=e.useCallback((k,M,J,Te)=>{w(J.clientWidth),C.current&&(C.current.style.width=`${J.clientWidth}px`)},[]);return t.jsx(Me.CSSTransition,{in:r,classNames:{enter:V.enter,enterActive:V.enterActive,exitActive:V.exitActive,exitDone:V.exitDone},timeout:Tn,nodeRef:C,unmountOnExit:!0,mountOnEnter:!0,children:t.jsxs(t.Fragment,{children:[f&&t.jsx("div",{className:x("overamp-slide-out-overlay",V.slideOutOverlay)}),t.jsx(Et.DismissableLayer,{disableOutsidePointerEvents:u,asChild:!0,..._,children:t.jsx(c.Flex,{className:x("overmap-slide-out",a,V.outerContent,{[V.left]:v,[V.right]:P}),style:{"--slide-out-width":`${m}px`},height:"100%",width:"auto",position:h,top:"0",bottom:"0",left:v?"0":void 0,right:P?"0":void 0,ref:C,children:t.jsx(me.Resizable,{className:V.resizable,defaultSize:{width:m,height:"100%"},onResize:S,enable:{right:s&&v,left:s&&P},handleComponent:{left:g,right:g},minWidth:i,maxWidth:d,children:l})})})]})})}),R={accommodateCharCount:"_accommodateCharCount_1octa_1",wrapper:"_wrapper_1octa_5",default:"_default_1octa_10",noLeftIcon:"_noLeftIcon_1octa_14",noRightIcon:"_noRightIcon_1octa_18",ghost:"_ghost_1octa_22",charCount:"_charCount_1octa_40"},On=e.forwardRef(function({className:a,leftSlot:r,rightSlot:o,size:l="medium",showInputLength:i,value:d,variant:s,severity:f="primary",...u},g){const h=K(l,le),_=N(f),C=i||i===void 0&&u.maxLength!==void 0,m=d!==void 0?d.toString():void 0;return t.jsxs(c.TextField.Root,{className:x(R.wrapper,a,{[R.ghost]:s==="ghost",[R.accommodateCharCount]:C}),size:h,variant:s!=="ghost"?s:void 0,color:_,children:[r&&t.jsx(c.TextField.Slot,{children:r}),t.jsx(c.TextField.Input,{className:x(R.default,{[R.noLeftIcon]:!r,[R.noRightIcon]:!o}),ref:g,value:d,size:h,variant:s!=="ghost"?s:void 0,color:_,...u}),o&&t.jsx(c.TextField.Slot,{children:o}),C&&t.jsx(c.Text,{as:"p",className:R.charCount,size:"1",color:"gray",children:u.maxLength!==void 0?`${m==null?void 0:m.length}/${u.maxLength}`:`${m==null?void 0:m.length}`})]})}),ut=e.memo(On),Nn=e.memo(function({color:a,severity:r,children:o}){const l=N(r??"primary"),i=e.useMemo(()=>({"data-accent-color":r&&l?l:a||"gray",style:{color:"var(--accent-a11)"}}),[a,r,l]);return e.cloneElement(o,{...i})}),In={wrapper:"_wrapper_tmtz0_1"},Mn=e.forwardRef(function({className:a,trigger:r,open:o,onOpenChange:l,defaultOpen:i=!1,modal:d=!1,children:s,...f},u){return t.jsxs(c.Popover.Root,{defaultOpen:i,modal:d,open:o,onOpenChange:l,children:[t.jsx(c.Popover.Trigger,{children:r}),t.jsx(c.Popover.Content,{ref:u,className:x("overmap-popover",a,In.wrapper),...f,children:s(c.Popover.Close)})]})}),ft=e.memo(Mn),B={wrapper:"_wrapper_1ssf2_1",panelContent:"_panelContent_1ssf2_6",left:"_left_1ssf2_14",right:"_right_1ssf2_18",resizable:"_resizable_1ssf2_23",resizeHandle:"_resizeHandle_1ssf2_28",panelMainContent:"_panelMainContent_1ssf2_48"},pt=200,X=150,En=e.memo(function({children:a,showLeft:r,leftPanel:o,leftMinWidth:l=pt,showRight:i,rightPanel:d,rightMinWidth:s=pt,resizeable:f}){const u=e.useRef(null),g=e.useRef(null),[h,_]=e.useState(0),[C,m]=e.useState(),w=e.useRef(null),[v,P]=e.useState(0),[S,k]=e.useState(),M=e.useCallback((D,E,F)=>(z,Oe,Ce,ve)=>{if(!u.current)return;const ne=D+ve.width;F(u.current.clientWidth-ne),E(()=>ne)},[]),J=e.useCallback((D,E,F,z)=>M(h,_,k)(D,E,F,z),[M,h]),Te=e.useCallback((D,E,F,z)=>M(v,P,m)(D,E,F,z),[M,v]),ue=e.useCallback((D,E,F,z,Oe,Ce,ve,ne)=>{if(!u.current)return;let q=D;if(q===0&&(q=E,F(q)),Ce){const Y=u.current.clientWidth-q;ne(Y),Oe>Y&&(ve(Y),z(u.current.clientWidth-Y))}},[]),qe=e.useCallback(()=>ue(v,s,P,k,h,r,_,m),[ue,h,s,v,r]),te=e.useCallback(()=>ue(h,l,_,m,v,i,P,k),[ue,l,h,v,i]),fe=e.useCallback((D,E)=>{u.current&&D&&E(u.current.clientWidth)},[]),Ue=e.useCallback(()=>fe(r,m),[fe,r]),Ge=e.useCallback(()=>fe(i,k),[fe,i]),Ke=e.useCallback(()=>{var D,E,F,z;u.current&&(m(u.current.clientWidth-(((D=w.current)==null?void 0:D.clientWidth)||0)),k(u.current.clientWidth-(((E=g.current)==null?void 0:E.clientWidth)||0)),_(((F=g.current)==null?void 0:F.clientWidth)||0),P(((z=w.current)==null?void 0:z.clientWidth)||0))},[]);e.useEffect(()=>{if(!u.current)return;const D=new ResizeObserver(Ke);return D.observe(u.current),()=>{D.disconnect()}},[Ke]);const De=e.useMemo(()=>({entering:{transform:`translateX(-${h}px)`,marginRight:`-${h}px`,transitionProperty:"transform, margin-right",transitionDuration:`${X}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${X}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${h}px)`,marginRight:`-${h}px`,transitionProperty:"transform, margin-right",transitionDuration:`${X}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[h]),L=e.useMemo(()=>({entering:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${X}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${X}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${v}px)`,marginLeft:`${-v}px`,transitionProperty:"transform, margin-left",transitionDuration:`${X}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[v]);return t.jsxs(c.Flex,{className:B.wrapper,style:{minWidth:`${l+s}px`},ref:u,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[t.jsx(Me.Transition,{nodeRef:g,timeout:r?0:X,in:r,unmountOnExit:!0,onEntering:te,onExited:Ge,children:D=>t.jsx(c.Box,{ref:g,className:x(B.panelContent,B.left),style:De[D],width:"auto",height:"100%",m:"0",p:"0",children:t.jsx(me.Resizable,{className:B.resizable,size:{width:h,height:"100%"},onResizeStop:J,enable:{right:(f==null?void 0:f.left)!==void 0?f.left:!0},minWidth:l,maxWidth:C,handleClasses:{right:x(B.resizeHandle,B.left)},handleComponent:{right:t.jsx(T.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:o})})}),t.jsx("div",{className:B.panelMainContent,children:a}),t.jsx(Me.Transition,{nodeRef:w,timeout:i?0:X,in:i,unmountOnExit:!0,onEntering:qe,onExited:Ue,children:D=>t.jsx(c.Box,{ref:w,className:x(B.panelContent,B.right),style:L[D],width:"auto",height:"100%",m:"0",p:"0",children:t.jsx(me.Resizable,{className:B.resizable,size:{width:v,height:"100%"},onResizeStop:Te,enable:{left:(f==null?void 0:f.right)!==void 0?f.right:!0},minWidth:s,maxWidth:S,handleClasses:{left:x(B.resizeHandle,B.right)},handleComponent:{left:t.jsx(T.DragHandleDots2Icon,{height:"14px",width:"14px"})},children:d})})})]})}),xe={multiPagePopover:"_multiPagePopover_spfw7_1",pageTitle:"_pageTitle_spfw7_12",buttonContainer:"_buttonContainer_spfw7_17",optionsButtonContainer:"_optionsButtonContainer_spfw7_22",optionsButton:"_optionsButton_spfw7_22"};function ht(n,a,r,o=0){if(!n.options)return n.content||t.jsx(t.Fragment,{});const l=n.options.map((i,d)=>t.jsx(Z,{className:x(xe.optionsButton,i.buttonClassName),variant:"ghost",radius:"large",style:{width:r==="vertical"?"100%":"auto"},severity:"info",highContrast:!0,onClick:i.onClick||(()=>a(ht(i.page||{},a,r,o+1))),children:i.label},`${i.value}-page-${o}-button-${d}`));return t.jsxs(t.Fragment,{children:[n.title&&t.jsx("div",{className:xe.pageTitle,children:n.title}),n.content,t.jsx("div",{className:x(xe.optionsButtonContainer,n.buttonsContainerClassName),style:{flexDirection:r==="vertical"?"column":"row"},children:l})]})}const An=e.forwardRef(function({page:a,className:r,direction:o="vertical",...l},i){const[d,s]=e.useState(void 0),f=e.useCallback(()=>{s(ht(a,s,o,0))},[o,a]),u=e.useCallback(g=>d,[d]);return t.jsx(ft,{className:x(xe.multiPagePopover,r),ref:i,onOpenAutoFocus:f,onCloseAutoFocus:f,...l,children:g=>u(g)})}),gt=e.memo(An),bt={charCount:"_charCount_1lz28_1",ghost:"_ghost_1lz28_5"},zn=e.forwardRef(function({className:a,showInputLength:r,inputLengthTemplate:o,value:l,severity:i="primary",resize:d,variant:s,...f},u){const g=N(i),h=N("info"),_=r||r===void 0&&(f.maxLength!==void 0||f.minLength!==void 0),C=l!==void 0?l.toString():"",m=e.useMemo(()=>{if(o){let w=o.replace("{current}",C.length.toString());return f.minLength!==void 0&&(w=w.replace("{min}",f.minLength.toString())),f.maxLength!==void 0&&(w=w.replace("{max}",f.maxLength.toString())),w}return C.length},[o,f.maxLength,f.minLength,C.length]);return t.jsxs(t.Fragment,{children:[t.jsx(c.TextArea,{className:x("overmap-textarea",a,{[bt.ghost]:s==="ghost"}),style:{resize:d},variant:s!=="ghost"?s:void 0,ref:u,value:l,color:g,...f}),_&&t.jsx(c.Text,{as:"p",className:bt.charCount,color:h,align:"right",children:m})]})}),Bn=e.memo(zn),Fn=e.forwardRef(function({loop:a,type:r,rovingFocus:o,value:l,onValueChange:i,defaultValue:d,disabled:s,items:f,className:u,direction:g="row",...h},_){return t.jsx(Qe.Root,{type:r,className:x("overmap-toggle-group",u),ref:_,value:l,onValueChange:i,disabled:s,orientation:g==="column"?"vertical":"horizontal",loop:a,rovingFocus:o,defaultValue:d,asChild:!0,children:t.jsx(Fe,{direction:g,...h,children:f.map(({children:C,...m})=>e.createElement(Qe.Item,{asChild:!0,...m,key:m.value},t.jsx(H,{className:x("overmap-toggle-group-button"),"aria-label":m.value,variant:m.value===l?"solid":"soft",children:C})))})})}),jn=e.memo(Fn),Ln={default:"_default_xqvoc_1"},Ct=e.memo(e.forwardRef(({className:n,minContentGap:a="2",children:r,...o},l)=>t.jsx(At.Root,{className:x(n,"overmap-toolbar",Ln.default),ref:l,asChild:!0,...o,children:t.jsx(j,{grow:"1",width:"100%",height:"max-content",align:"center",gap:a,wrap:"nowrap",children:r})}))),Wn=e.memo(e.forwardRef(({children:n,gap:a="2"},r)=>t.jsx(j,{ref:r,grow:"1",width:"max-content",height:"100%",align:"center",gap:a,children:n}))),Hn=e.memo(e.forwardRef(({children:n,gap:a},r)=>t.jsx(j,{ref:r,grow:"1",width:"max-content",direction:"row-reverse",height:"100%",align:"center",gap:a||"2",children:n}))),Vn={Root:Ct,LeftContent:Wn,RightContent:Hn},Le={ToastViewport:"_ToastViewport_1i6bp_1",actionButton:"_actionButton_1i6bp_20",ToastRoot:"_ToastRoot_1i6bp_24",slideIn:"_slideIn_1i6bp_1",swipeOut:"_swipeOut_1i6bp_1"},qn=e.forwardRef(function({title:a,description:r,icon:o,severity:l="primary",size:i,onClose:d,sensitivity:s,action:f,...u},g){const[h,_]=e.useState(!0),C=N(l),m=e.useCallback(w=>{!w&&d&&d(),_(w)},[d]);return t.jsx(ge.Root,{asChild:!0,ref:g,...u,open:h,type:s,onOpenChange:m,children:t.jsx(c.Callout.Root,{className:Le.ToastRoot,variant:"surface",color:C,size:i,children:t.jsxs(c.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[t.jsxs(c.Flex,{align:"center",gap:"3",children:[t.jsx(c.Callout.Icon,{children:o}),t.jsxs(c.Flex,{direction:"column",gap:"2",children:[t.jsxs(c.Flex,{direction:"column",gap:"0",children:[t.jsx(ge.Title,{asChild:!0,children:t.jsx(c.Callout.Text,{size:"3",weight:"medium",children:a})}),t.jsx(ge.Description,{asChild:!0,children:t.jsx(c.Callout.Text,{children:r})})]}),f&&t.jsx(ge.Action,{className:Le.actionButton,altText:f.altText,asChild:!0,children:f.content})]})]}),t.jsx(ge.Close,{asChild:!0,children:t.jsx(H,{"aria-label":"Close",variant:"ghost",severity:l,children:t.jsx(T.Cross2Icon,{})})})]})})})}),vt=e.memo(qn),We=e.createContext({}),Un=()=>{const n=e.useContext(We);if(!n)throw new Error("useToast must be used within a ToastProvider");return n},Gn=240/60,mt=5e3,Kn=n=>{if(n.duration&&n.duration>=mt)return n.duration;const a=n.severity==="danger"?1.5:1,r=n.description.split(" ").length+n.title.split(" ").length;return(mt+r/Gn)*a};p.unsafeShowToast=void 0;const Xn=e.memo(function({children:a,className:r,hotkey:o,...l}){const[i,d]=e.useState([]),s=e.useCallback((u,g,h)=>{d(_=>{const C=_.find(m=>m.id===u);return C&&g===0&&clearTimeout(C.timeout),_.filter(m=>m.id!==u)}),h&&h()},[]),f=e.useMemo(()=>{let u=0;const g=v=>{const P=Kn(v),S=u.toString();u+=1;const k=setTimeout(()=>s(S,1,v.onClose),P);d(M=>[...M,{...v,timeout:k,duration:P,id:S}])},h=v=>g({...v,severity:"primary"}),_=v=>g({...v,severity:"success"}),C=v=>g({...v,severity:"danger"}),m=v=>g({...v,severity:"info"}),w=v=>g({...v,severity:"warning"});return p.unsafeShowToast=g,{showToast:g,showPrimary:h,showSuccess:_,showError:C,showInfo:m,showWarning:w}},[s]);return e.useEffect(()=>()=>{for(const{timeout:u}of i)clearTimeout(u)},[]),t.jsx(We.Provider,{value:f,children:t.jsxs(Ee.ToastProvider,{...l,children:[a,t.jsx(Ee.ToastViewport,{className:x(r,Le.ToastViewport),hotkey:o}),i.map(({id:u,onClose:g,...h})=>t.jsx(vt,{...h,onClose:()=>s(u,0,g)},u))]})})}),Qn={default:"_default_1odpt_1"},Jn=e.memo(e.forwardRef(({className:n,children:a,content:r,...o},l)=>t.jsx(c.Tooltip,{className:x("overmap-tooltip",n,Qn.default),ref:l,content:t.jsx(c.Flex,{align:"center",gap:"1",width:"max-content",height:"max-content",justify:"center",children:r}),...o,children:a}))),Yn={noWrap:"_noWrap_1wpa5_1"},Pe=e.memo(e.forwardRef(({className:n,noWrap:a,severity:r,as:o,...l},i)=>{const d=N(r);return t.jsx(c.Text,{ref:i,as:o,className:x(n,{[Yn.noWrap]:a}),color:d,...l})})),qr="",Zn=e.memo(e.forwardRef((n,a)=>{const{panelBackground:r="solid",radius:o="full",...l}=n;return t.jsx(c.Theme,{panelBackground:r,radius:o,ref:a,...l})}));function Q(){return Q=Object.assign?Object.assign.bind():function(n){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])}return n},Q.apply(this,arguments)}function Rn(n,a){typeof n=="function"?n(a):n!=null&&(n.current=a)}function _t(...n){return a=>n.forEach(r=>Rn(r,a))}function yt(...n){return e.useCallback(_t(...n),n)}function eo(n,a=[]){let r=[];function o(i,d){const s=e.createContext(d),f=r.length;r=[...r,d];function u(h){const{scope:_,children:C,...m}=h,w=(_==null?void 0:_[n][f])||s,v=e.useMemo(()=>m,Object.values(m));return e.createElement(w.Provider,{value:v},C)}function g(h,_){const C=(_==null?void 0:_[n][f])||s,m=e.useContext(C);if(m)return m;if(d!==void 0)return d;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,g]}const l=()=>{const i=r.map(d=>e.createContext(d));return function(s){const f=(s==null?void 0:s[n])||i;return e.useMemo(()=>({[`__scope${n}`]:{...s,[n]:f}}),[s,f])}};return l.scopeName=n,[o,to(l,...a)]}function to(...n){const a=n[0];if(n.length===1)return a;const r=()=>{const o=n.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(i){const d=o.reduce((s,{useScope:f,scopeName:u})=>{const h=f(i)[`__scope${u}`];return{...s,...h}},{});return e.useMemo(()=>({[`__scope${a.scopeName}`]:d}),[d])}};return r.scopeName=a.scopeName,r}function wt(n,a,{checkForDefaultPrevented:r=!0}={}){return function(l){if(n==null||n(l),r===!1||!l.defaultPrevented)return a==null?void 0:a(l)}}function St(n){const a=e.useRef(n);return e.useEffect(()=>{a.current=n}),e.useMemo(()=>(...r)=>{var o;return(o=a.current)===null||o===void 0?void 0:o.call(a,...r)},[])}function no({prop:n,defaultProp:a,onChange:r=()=>{}}){const[o,l]=oo({defaultProp:a,onChange:r}),i=n!==void 0,d=i?n:o,s=St(r),f=e.useCallback(u=>{if(i){const h=typeof u=="function"?u(n):u;h!==n&&s(h)}else l(u)},[i,n,l,s]);return[d,f]}function oo({defaultProp:n,onChange:a}){const r=e.useState(n),[o]=r,l=e.useRef(o),i=St(a);return e.useEffect(()=>{l.current!==o&&(i(o),l.current=o)},[o,l,i]),r}function ro(n){const a=e.useRef({value:n,previous:n});return e.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}const He=globalThis!=null&&globalThis.document?e.useLayoutEffect:()=>{};function ao(n){const[a,r]=e.useState(void 0);return He(()=>{if(n){r({width:n.offsetWidth,height:n.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const i=l[0];let d,s;if("borderBoxSize"in i){const f=i.borderBoxSize,u=Array.isArray(f)?f[0]:f;d=u.inlineSize,s=u.blockSize}else d=n.offsetWidth,s=n.offsetHeight;r({width:d,height:s})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else r(void 0)},[n]),a}function io(n,a){return e.useReducer((r,o)=>{const l=a[r][o];return l??r},n)}const xt=n=>{const{present:a,children:r}=n,o=lo(a),l=typeof r=="function"?r({present:o.isPresent}):e.Children.only(r),i=yt(o.ref,l.ref);return typeof r=="function"||o.isPresent?e.cloneElement(l,{ref:i}):null};xt.displayName="Presence";function lo(n){const[a,r]=e.useState(),o=e.useRef({}),l=e.useRef(n),i=e.useRef("none"),d=n?"mounted":"unmounted",[s,f]=io(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const u=ke(o.current);i.current=s==="mounted"?u:"none"},[s]),He(()=>{const u=o.current,g=l.current;if(g!==n){const _=i.current,C=ke(u);n?f("MOUNT"):C==="none"||(u==null?void 0:u.display)==="none"?f("UNMOUNT"):f(g&&_!==C?"ANIMATION_OUT":"UNMOUNT"),l.current=n}},[n,f]),He(()=>{if(a){const u=h=>{const C=ke(o.current).includes(h.animationName);h.target===a&&C&&zt.flushSync(()=>f("ANIMATION_END"))},g=h=>{h.target===a&&(i.current=ke(o.current))};return a.addEventListener("animationstart",g),a.addEventListener("animationcancel",u),a.addEventListener("animationend",u),()=>{a.removeEventListener("animationstart",g),a.removeEventListener("animationcancel",u),a.removeEventListener("animationend",u)}}else f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:e.useCallback(u=>{u&&(o.current=getComputedStyle(u)),r(u)},[])}}function ke(n){return(n==null?void 0:n.animationName)||"none"}const Pt=e.forwardRef((n,a)=>{const{children:r,...o}=n,l=e.Children.toArray(r),i=l.find(co);if(i){const d=i.props.children,s=l.map(f=>f===i?e.Children.count(d)>1?e.Children.only(null):e.isValidElement(d)?d.props.children:null:f);return e.createElement(Ve,Q({},o,{ref:a}),e.isValidElement(d)?e.cloneElement(d,void 0,s):null)}return e.createElement(Ve,Q({},o,{ref:a}),r)});Pt.displayName="Slot";const Ve=e.forwardRef((n,a)=>{const{children:r,...o}=n;return e.isValidElement(r)?e.cloneElement(r,{...uo(o,r.props),ref:a?_t(a,r.ref):r.ref}):e.Children.count(r)>1?e.Children.only(null):null});Ve.displayName="SlotClone";const so=({children:n})=>e.createElement(e.Fragment,null,n);function co(n){return e.isValidElement(n)&&n.type===so}function uo(n,a){const r={...a};for(const o in a){const l=n[o],i=a[o];/^on[A-Z]/.test(o)?l&&i?r[o]=(...s)=>{i(...s),l(...s)}:l&&(r[o]=l):o==="style"?r[o]={...l,...i}:o==="className"&&(r[o]=[l,i].filter(Boolean).join(" "))}return{...n,...r}}const kt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((n,a)=>{const r=e.forwardRef((o,l)=>{const{asChild:i,...d}=o,s=i?Pt:a;return e.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),e.createElement(s,Q({},d,{ref:l}))});return r.displayName=`Primitive.${a}`,{...n,[a]:r}},{}),$t="Checkbox",[fo,Gr]=eo($t),[po,ho]=fo($t),go=e.forwardRef((n,a)=>{const{__scopeCheckbox:r,name:o,checked:l,defaultChecked:i,required:d,disabled:s,value:f="on",onCheckedChange:u,...g}=n,[h,_]=e.useState(null),C=yt(a,k=>_(k)),m=e.useRef(!1),w=h?!!h.closest("form"):!0,[v=!1,P]=no({prop:l,defaultProp:i,onChange:u}),S=e.useRef(v);return e.useEffect(()=>{const k=h==null?void 0:h.form;if(k){const M=()=>P(S.current);return k.addEventListener("reset",M),()=>k.removeEventListener("reset",M)}},[h,P]),e.createElement(po,{scope:r,state:v,disabled:s},e.createElement(kt.button,Q({type:"button",role:"checkbox","aria-checked":ee(v)?"mixed":v,"aria-required":d,"data-state":Tt(v),"data-disabled":s?"":void 0,disabled:s,value:f},g,{ref:C,onKeyDown:wt(n.onKeyDown,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:wt(n.onClick,k=>{P(M=>ee(M)?!0:!M),w&&(m.current=k.isPropagationStopped(),m.current||k.stopPropagation())})})),w&&e.createElement(vo,{control:h,bubbles:!m.current,name:o,value:f,checked:v,required:d,disabled:s,style:{transform:"translateX(-100%)"}}))}),bo="CheckboxIndicator",Co=e.forwardRef((n,a)=>{const{__scopeCheckbox:r,forceMount:o,...l}=n,i=ho(bo,r);return e.createElement(xt,{present:o||ee(i.state)||i.state===!0},e.createElement(kt.span,Q({"data-state":Tt(i.state),"data-disabled":i.disabled?"":void 0},l,{ref:a,style:{pointerEvents:"none",...n.style}})))}),vo=n=>{const{control:a,checked:r,bubbles:o=!0,...l}=n,i=e.useRef(null),d=ro(r),s=ao(a);return e.useEffect(()=>{const f=i.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(d!==r&&h){const _=new Event("click",{bubbles:o});f.indeterminate=ee(r),h.call(f,ee(r)?!1:r),f.dispatchEvent(_)}},[d,r,o]),e.createElement("input",Q({type:"checkbox","aria-hidden":!0,defaultChecked:ee(r)?!1:r},l,{tabIndex:-1,ref:i,style:{...n.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ee(n){return n==="indeterminate"}function Tt(n){return ee(n)?"indeterminate":n?"checked":"unchecked"}const mo=go,_o=Co,de={checkboxContainer:"_checkboxContainer_pb9za_5",checkbox:"_checkbox_pb9za_5",checkboxIndicator:"_checkboxIndicator_pb9za_27",checkboxLabel:"_checkboxLabel_pb9za_38",noTextHighlight:"_noTextHighlight_pb9za_42",checkboxHidden:"_checkboxHidden_pb9za_51"},yo=e.forwardRef(function({className:a,labelClassName:r,label:o,checked:l,onCheckedChange:i,...d},s){return t.jsx(lt,{children:({isHovered:f,...u})=>t.jsxs(c.Flex,{className:de.checkboxContainer,...u,children:[t.jsx(mo,{className:x(de.checkbox,!f&&!l&&de.checkboxHidden,a),checked:l,onCheckedChange:g=>{i&&i(g)},ref:s,...d,children:t.jsx(_o,{className:de.checkboxIndicator,children:l==="indeterminate"?t.jsx(T.DividerHorizontalIcon,{width:"13px"}):t.jsx(T.CheckIcon,{})})}),o&&t.jsx("div",{className:x(de.checkboxLabel,r,de.noTextHighlight),onClick:()=>{i&&i(!l)},children:o})]})})}),$e=e.memo(yo);$e.displayName="Checkbox";const Dt=e.memo(function({className:a,labelClassName:r,label:o,onCheckedChange:l,children:i,...d}){const[s,f]=e.useState(e.Children.toArray(i).every(C=>e.isValidElement(C)&&C.props.checked)?!0:e.Children.toArray(i).some(C=>e.isValidElement(C)&&C.props.checked)?"indeterminate":!1),[u,g]=e.useState(e.Children.map(i,C=>C.props.checked)),h=C=>{const m=s==="indeterminate"||!C;s==="indeterminate"&&(C=!1),g(u.map(w=>!m)),l&&l(C)};e.useEffect(()=>{const C=u.filter(m=>m).length;C===0?f(!1):C===i.length?f(!0):f("indeterminate")},[i,u]);const _=e.Children.map(i,(C,m)=>e.cloneElement(C,{...C.props,checked:u[m],onCheckedChange:w=>{const v=[...u];v[m]=w,g(v),C.props.onCheckedChange&&C.props.onCheckedChange(w)}}));return t.jsxs(t.Fragment,{children:[t.jsx($e,{className:a,labelClassName:r,label:o,checked:s,onCheckedChange:h,...d}),_]})}),A={tableContainer:"_tableContainer_go3yk_1",headerContainer:"_headerContainer_go3yk_14",tableTopContainer:"_tableTopContainer_go3yk_18",searchContainer:"_searchContainer_go3yk_22",columnFilterSelect:"_columnFilterSelect_go3yk_32",table:"_table_go3yk_1",tableHeaderCell:"_tableHeaderCell_go3yk_50",tableRow:"_tableRow_go3yk_56",tableCell:"_tableCell_go3yk_71",noDataTextContainer:"_noDataTextContainer_go3yk_78",tableBottomContainer:"_tableBottomContainer_go3yk_84",rowsPerPageContainer:"_rowsPerPageContainer_go3yk_88",rowsPerPageText:"_rowsPerPageText_go3yk_98"},wo=e.forwardRef(function(a,r){const{columns:o,data:l,color:i="light",title:d="",description:s="",rowsPerPage:f=[10,20,30,40,50],showSearchBar:u,searchBarPlaceholder:g,showSelect:h,showFilterButton:_,showContainer:C,showRowsPerPage:m,showPageNumber:w,showPageNavigation:v,showTopBar:P=!0,showBottomBar:S=!0,emptyMessage:k="There is no data",children:M,className:J,columnClassName:Te,rowClassName:ue,cellClassName:qe}=a,[te,fe]=e.useState(""),[Ue,Ge]=e.useState([]);if(!l.every(b=>Object.keys(b.columns).length===o.length&&Object.values(o).every(y=>Object.keys(b.columns).includes(y.id.toString()))))throw new Error("Columns in rows do not match ones declared in columns variable.");const De=e.useMemo(()=>o.filter(b=>b.filter).map(b=>({[b.id]:[]})).reduce((b,y)=>Object.assign(b,y),{}),[o]),[L,D]=e.useState(De),[E,F]=e.useState(f[0]??10),z=e.useMemo(()=>f.map(b=>({value:b.toString(),itemContent:b.toString()})),[f]),Oe=l.some(b=>b.onClick),Ce=e.useCallback(b=>{var $,O;return((($=b.searchValue)==null?void 0:$.toString())||((O=b.value)==null?void 0:O.toString())||"").toLowerCase().includes(te.toLowerCase())},[te]),ve=e.useCallback((b,y)=>{var W,oe,pe,re;const $=((W=b.sortValue)==null?void 0:W.toString())||((oe=b.value)==null?void 0:oe.toString())||"",O=((pe=y.sortValue)==null?void 0:pe.toString())||((re=y.value)==null?void 0:re.toString())||"";return $.toLowerCase().localeCompare(O.toLowerCase(),void 0,{numeric:!0})},[]),ne=e.useCallback((b,y)=>{var O,W,oe;const $=((O=b.filterValue)==null?void 0:O.toString())||((W=b.value)==null?void 0:W.toString())||"";return(oe=L[y.id])==null?void 0:oe.some(pe=>$.toString().toLowerCase()===pe.toString().toLowerCase())},[L]),q=e.useMemo(()=>o.map(b=>({...b,sort:b.sort?{sortKey:b.id.toString().toUpperCase()}:!1})),[o]),Y=o.some(b=>{var y;return b.filter&&b.id in L&&((y=L[b.id])==null?void 0:y.length)!==0}),Ne=e.useMemo(()=>l.filter(b=>!te||o.some(y=>y.search&&Ce(b.columns[y.id]))).filter(b=>!Y||o.every(y=>{var $;return!y.filter||(($=L[y.id])==null?void 0:$.length)===0||ne(b.columns[y.id],y)})).map(b=>{const y={...b.columns,...b},{columns:$,...O}=y;return O}),[ne,L,o,l,Y,te,Ce]),[U,xo]=e.useState(Math.ceil(Ne.length/E)),Xe=e.useCallback(b=>b.filterValues?b.filterValues:[...new Set(l.map($=>{var O,W;return((O=$.columns[b.id].filterValue)==null?void 0:O.toString())||((W=$.columns[b.id].value)==null?void 0:W.toString())||""}))].sort().map($=>({value:$,label:$})),[l]),Po=e.useMemo(()=>(h?"auto ":"")+q.reduce((b,y)=>b+`${y.width||"auto"} `,""),[q,h]),ko=e.useCallback(b=>{fe(b.target.value)},[]),Ie={nodes:Ne},$o=ie.useRowSelect(Ie,{onChange:(b,y)=>{Ge(y.ids)}},{rowSelect:ie.SelectTypes.MultiSelect,buttonSelect:ie.SelectTypes.MultiSelect,clickType:ie.SelectClickTypes.ButtonClick,isCarryForward:!1}),I=Ft.usePagination(Ie,{state:{page:0,size:f[0]}},{isServer:!1}),To=Je.useSort(Ie,{onChange:()=>null},{sortIcon:{margin:"10px",size:"15px",iconDefault:t.jsx(T.CaretSortIcon,{width:"20px"}),iconUp:t.jsx(T.ArrowUpIcon,{}),iconDown:t.jsx(T.ArrowDownIcon,{})},sortFns:Object.assign({},...q.map(b=>({[b.id.toString().toUpperCase()]:y=>y.sort(($,O)=>ve($[b.id],O[b.id]))})))}),Do=e.useMemo(()=>({options:o.filter(b=>b.filter).map(b=>({label:b.label,value:b.id.toString(),page:{content:t.jsx(Dt,{label:"Select all",onCheckedChange:y=>{const $=JSON.parse(JSON.stringify(L));y===!0?$[b.id]=Xe(b).map(O=>O.value):$[b.id]=[],D($)},children:Xe(b).map((y,$)=>{var O,W;return t.jsx($e,{label:y.label,checked:(W=L[b.id])==null?void 0:W.includes(((O=y.value)==null?void 0:O.toString())||""),onCheckedChange:oe=>{D(pe=>{var It;const re={...pe},Nt=re[b.id]||[];return oe?re[b.id]=[...Nt,((It=y.value)==null?void 0:It.toString())||""]:re[b.id]=Nt.filter(Mo=>Mo!==(y.value??"").toString()),re})}},`checkbox-filter-${b.id}-${$}`)})},`select-all-checkbox-${b.id}`)}}))}),[L,o,Xe]),Oo=q.map(b=>{const y=b.sort?Je.HeaderCellSort:G.HeaderCell;return t.jsx(y,{className:x(A.tableHeaderCell,Te,b.className),sortKey:b.sort?b.id.toString().toUpperCase():"",children:b.label},b.id)}),Ot=_e.isMobile?H:Z,No=e.useMemo(()=>({custom:!0}),[]),Io=Bt.useTheme({Table:`
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
(function(global, factory) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@radix-ui/colors"), require("@radix-ui/react-icons"), require("@radix-ui/themes"), require("react/jsx-runtime"), require("react"), require("react-responsive"), require("@radix-ui/react-dropdown-menu"), require("@radix-ui/react-dialog"), require("re-resizable"), require("@radix-ui/react-dismissable-layer"), require("react-transition-group"), require("@radix-ui/react-toggle-group"), require("@radix-ui/react-toolbar"), require("@radix-ui/react-toast"), require("react-dom"), require("@table-library/react-table-library/table"), require("@table-library/react-table-library/theme"), require("@table-library/react-table-library/sort"), require("@table-library/react-table-library/select"), require("@table-library/react-table-library/pagination"), require("react-device-detect")) : typeof define === "function" && define.amd ? define(["exports", "@radix-ui/colors", "@radix-ui/react-icons", "@radix-ui/themes", "react/jsx-runtime", "react", "react-responsive", "@radix-ui/react-dropdown-menu", "@radix-ui/react-dialog", "re-resizable", "@radix-ui/react-dismissable-layer", "react-transition-group", "@radix-ui/react-toggle-group", "@radix-ui/react-toolbar", "@radix-ui/react-toast", "react-dom", "@table-library/react-table-library/table", "@table-library/react-table-library/theme", "@table-library/react-table-library/sort", "@table-library/react-table-library/select", "@table-library/react-table-library/pagination", "react-device-detect"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.blocks = {}, global.colors, global.reactIcons, global.themes, global.jsxRuntime, global.React, global.reactResponsive, global.RadixDropdownMenu, global.RadixDialogPrimitive, global.reResizable, global.reactDismissableLayer, global.reactTransitionGroup, global.reactToggleGroup, global.reactToolbar, global.RadixToast, global.reactDom, global.table$1, global.theme, global.sort, global.select, global.pagination, global.reactDeviceDetect));
|
|
3
|
+
})(this, function(exports2, colors, reactIcons, themes, jsxRuntime, React, reactResponsive, RadixDropdownMenu, RadixDialogPrimitive, reResizable, reactDismissableLayer, reactTransitionGroup, reactToggleGroup, reactToolbar, RadixToast, reactDom, table$1, theme, sort, select, pagination, reactDeviceDetect) {
|
|
4
|
+
"use strict";
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
+
if (e) {
|
|
8
|
+
for (const k in e) {
|
|
9
|
+
if (k !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: () => e[k]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
const RadixDropdownMenu__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixDropdownMenu);
|
|
22
|
+
const RadixDialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixDialogPrimitive);
|
|
23
|
+
const RadixToast__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixToast);
|
|
24
|
+
function getDefaultExportFromCjs(x) {
|
|
25
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
26
|
+
}
|
|
27
|
+
var classnames = { exports: {} };
|
|
28
|
+
/*!
|
|
29
|
+
Copyright (c) 2018 Jed Watson.
|
|
30
|
+
Licensed under the MIT License (MIT), see
|
|
31
|
+
http://jedwatson.github.io/classnames
|
|
32
|
+
*/
|
|
33
|
+
(function(module2) {
|
|
34
|
+
(function() {
|
|
35
|
+
var hasOwn = {}.hasOwnProperty;
|
|
36
|
+
function classNames2() {
|
|
37
|
+
var classes = [];
|
|
38
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
39
|
+
var arg = arguments[i];
|
|
40
|
+
if (!arg)
|
|
41
|
+
continue;
|
|
42
|
+
var argType = typeof arg;
|
|
43
|
+
if (argType === "string" || argType === "number") {
|
|
44
|
+
classes.push(arg);
|
|
45
|
+
} else if (Array.isArray(arg)) {
|
|
46
|
+
if (arg.length) {
|
|
47
|
+
var inner = classNames2.apply(null, arg);
|
|
48
|
+
if (inner) {
|
|
49
|
+
classes.push(inner);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
} else if (argType === "object") {
|
|
53
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
|
|
54
|
+
classes.push(arg.toString());
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
for (var key in arg) {
|
|
58
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
59
|
+
classes.push(key);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return classes.join(" ");
|
|
65
|
+
}
|
|
66
|
+
if (module2.exports) {
|
|
67
|
+
classNames2.default = classNames2;
|
|
68
|
+
module2.exports = classNames2;
|
|
69
|
+
} else {
|
|
70
|
+
window.classNames = classNames2;
|
|
71
|
+
}
|
|
72
|
+
})();
|
|
73
|
+
})(classnames);
|
|
74
|
+
var classnamesExports = classnames.exports;
|
|
75
|
+
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
76
|
+
function useResponsiveMapping(value, mapping) {
|
|
77
|
+
return React.useMemo(() => {
|
|
78
|
+
if (value === void 0)
|
|
79
|
+
return void 0;
|
|
80
|
+
if (typeof value === "object") {
|
|
81
|
+
if (!("initial" in value)) {
|
|
82
|
+
throw new Error("Expected initial property to be set in Responsive object");
|
|
83
|
+
}
|
|
84
|
+
return Object.fromEntries(Object.entries(value).map(([breakpoint, value2]) => [breakpoint, mapping[value2]]));
|
|
85
|
+
} else {
|
|
86
|
+
return mapping[value];
|
|
87
|
+
}
|
|
88
|
+
}, [mapping, value]);
|
|
89
|
+
}
|
|
90
|
+
const nonThemeSeverityMapping = {
|
|
91
|
+
success: "green",
|
|
92
|
+
danger: "red",
|
|
93
|
+
warning: "amber",
|
|
94
|
+
info: "gray"
|
|
95
|
+
};
|
|
96
|
+
const useSeverityColor = (severity) => {
|
|
97
|
+
const theme2 = themes.useThemeContext();
|
|
98
|
+
if (!severity)
|
|
99
|
+
return void 0;
|
|
100
|
+
if (severity === "primary")
|
|
101
|
+
return theme2.accentColor;
|
|
102
|
+
return nonThemeSeverityMapping[severity];
|
|
103
|
+
};
|
|
104
|
+
const useViewportSize = () => {
|
|
105
|
+
const [prevSize, setPrevSize] = React.useState("initial");
|
|
106
|
+
const [size, setSize] = React.useState("initial");
|
|
107
|
+
const xs = reactResponsive.useMediaQuery({ minWidth: "520px" });
|
|
108
|
+
const sm = reactResponsive.useMediaQuery({ minWidth: "768px" });
|
|
109
|
+
const md = reactResponsive.useMediaQuery({ minWidth: "1024px" });
|
|
110
|
+
const lg = reactResponsive.useMediaQuery({ minWidth: "1280px" });
|
|
111
|
+
const xl = reactResponsive.useMediaQuery({ minWidth: "1640px" });
|
|
112
|
+
React.useLayoutEffect(() => {
|
|
113
|
+
setSize((prev) => {
|
|
114
|
+
setPrevSize(prev);
|
|
115
|
+
return xl ? "xl" : lg ? "lg" : md ? "md" : sm ? "sm" : xs ? "xs" : "initial";
|
|
116
|
+
});
|
|
117
|
+
}, [lg, md, sm, xl, xs]);
|
|
118
|
+
return { size, prevSize, xs, sm, md, lg, xl };
|
|
119
|
+
};
|
|
120
|
+
const useKeyboardShortcut = (shortcutKeys, disable, callback) => {
|
|
121
|
+
const [keys, setKeys] = React.useState([]);
|
|
122
|
+
const [lastWasKeyDown, setLastWasKeyDown] = React.useState(true);
|
|
123
|
+
const handleKeyDown = React.useCallback(
|
|
124
|
+
(event) => {
|
|
125
|
+
const { repeat, key } = event;
|
|
126
|
+
setLastWasKeyDown(true);
|
|
127
|
+
if (repeat || keys.includes(key))
|
|
128
|
+
return;
|
|
129
|
+
setKeys((prevKeys) => [...prevKeys, key]);
|
|
130
|
+
},
|
|
131
|
+
[keys]
|
|
132
|
+
);
|
|
133
|
+
const handleKeyUp = React.useCallback(
|
|
134
|
+
(event) => {
|
|
135
|
+
const { key } = event;
|
|
136
|
+
setLastWasKeyDown(false);
|
|
137
|
+
if (!keys.includes(key))
|
|
138
|
+
return;
|
|
139
|
+
setKeys((prevKeys) => {
|
|
140
|
+
const tempKeys = [...prevKeys];
|
|
141
|
+
tempKeys.splice(prevKeys.indexOf(key), 1);
|
|
142
|
+
return tempKeys;
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
[keys]
|
|
146
|
+
);
|
|
147
|
+
React.useEffect(() => {
|
|
148
|
+
if (!disable)
|
|
149
|
+
document.addEventListener("keydown", handleKeyDown, true);
|
|
150
|
+
return () => {
|
|
151
|
+
document.removeEventListener("keydown", handleKeyDown, true);
|
|
152
|
+
};
|
|
153
|
+
}, [disable, handleKeyDown]);
|
|
154
|
+
React.useEffect(() => {
|
|
155
|
+
if (!disable)
|
|
156
|
+
document.addEventListener("keyup", handleKeyUp, true);
|
|
157
|
+
return () => {
|
|
158
|
+
document.removeEventListener("keyup", handleKeyUp, true);
|
|
159
|
+
};
|
|
160
|
+
}, [disable, handleKeyUp]);
|
|
161
|
+
const triggerAction = React.useMemo(() => {
|
|
162
|
+
return !disable && lastWasKeyDown && keys.length === shortcutKeys.length && keys.every((key) => shortcutKeys.includes(key));
|
|
163
|
+
}, [disable, lastWasKeyDown, keys, shortcutKeys]);
|
|
164
|
+
React.useEffect(() => {
|
|
165
|
+
if (triggerAction)
|
|
166
|
+
callback();
|
|
167
|
+
}, [triggerAction, callback]);
|
|
168
|
+
return triggerAction;
|
|
169
|
+
};
|
|
170
|
+
const childrenToArray = (children) => {
|
|
171
|
+
const tempChildrenToArray = [];
|
|
172
|
+
for (const child of React.Children.toArray(children)) {
|
|
173
|
+
if (React.isValidElement(child))
|
|
174
|
+
tempChildrenToArray.push(child);
|
|
175
|
+
}
|
|
176
|
+
return tempChildrenToArray;
|
|
177
|
+
};
|
|
178
|
+
const useStopEventPropagation = () => {
|
|
179
|
+
return React.useCallback((event) => {
|
|
180
|
+
event.stopPropagation();
|
|
181
|
+
}, []);
|
|
182
|
+
};
|
|
183
|
+
function useTextFilter(values, filterFunction) {
|
|
184
|
+
const [filteredOptions, setFilteredOptions] = React.useState([]);
|
|
185
|
+
const [filterValue, setFilterValue] = React.useState("");
|
|
186
|
+
React.useEffect(() => {
|
|
187
|
+
setFilteredOptions(values.filter((value) => filterFunction(value, filterValue)));
|
|
188
|
+
}, [filterFunction, filterValue, values]);
|
|
189
|
+
return [filteredOptions, filterValue, setFilterValue];
|
|
190
|
+
}
|
|
191
|
+
const _Badge = React.forwardRef(function Badge2({ className, severity = "primary", color, children, ...rest }, ref) {
|
|
192
|
+
const severityColor = useSeverityColor(severity);
|
|
193
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
194
|
+
themes.Badge,
|
|
195
|
+
{
|
|
196
|
+
className: classNames("overmap-badge", className),
|
|
197
|
+
ref,
|
|
198
|
+
color: color ? color : severityColor,
|
|
199
|
+
...rest,
|
|
200
|
+
children
|
|
201
|
+
}
|
|
202
|
+
);
|
|
203
|
+
});
|
|
204
|
+
const Badge = React.memo(_Badge);
|
|
205
|
+
const zeroMinWidth = "_zeroMinWidth_curjh_1";
|
|
206
|
+
const zeroMinHeight = "_zeroMinHeight_curjh_5";
|
|
207
|
+
const radius = "_radius_curjh_9";
|
|
208
|
+
const styles$m = {
|
|
209
|
+
zeroMinWidth,
|
|
210
|
+
zeroMinHeight,
|
|
211
|
+
radius
|
|
212
|
+
};
|
|
213
|
+
const Flex = React.memo(
|
|
214
|
+
React.forwardRef(
|
|
215
|
+
({ className, radius: radius2 = false, children, zeroMinWidth: zeroMinWidth2 = false, zeroMinHeight: zeroMinHeight2 = false, ...rest }, ref) => {
|
|
216
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
217
|
+
themes.Flex,
|
|
218
|
+
{
|
|
219
|
+
className: classNames(className, {
|
|
220
|
+
[styles$m.radius]: radius2,
|
|
221
|
+
[styles$m.zeroMinWidth]: zeroMinWidth2,
|
|
222
|
+
[styles$m.zeroMinHeight]: zeroMinHeight2
|
|
223
|
+
}),
|
|
224
|
+
ref,
|
|
225
|
+
...rest,
|
|
226
|
+
children
|
|
227
|
+
}
|
|
228
|
+
);
|
|
229
|
+
}
|
|
230
|
+
)
|
|
231
|
+
);
|
|
232
|
+
const BreadcrumbContext = React.createContext({});
|
|
233
|
+
const useBreadcrumbContext = () => React.useContext(BreadcrumbContext);
|
|
234
|
+
const Item = React.memo(
|
|
235
|
+
React.forwardRef(({ className, children, ...rest }, ref) => {
|
|
236
|
+
const { size, severity } = useBreadcrumbContext();
|
|
237
|
+
const severityColor = useSeverityColor(severity);
|
|
238
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { className: classNames("overmap-breadcrumb-item", className), height: "max-content", width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(themes.Link, { ref, size, color: severityColor, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { height: "100%", width: "100%", align: "center", gap: "1", children }) }) });
|
|
239
|
+
})
|
|
240
|
+
);
|
|
241
|
+
const Group = React.memo(
|
|
242
|
+
React.forwardRef(
|
|
243
|
+
({ className, children, separator, severity = "info", size, gap = "2", ...rest }, ref) => {
|
|
244
|
+
const severityColor = useSeverityColor(severity);
|
|
245
|
+
const childrenAsArray = childrenToArray(children);
|
|
246
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BreadcrumbContext.Provider, { value: { size, severity }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
247
|
+
Flex,
|
|
248
|
+
{
|
|
249
|
+
className: classNames("overmap-breadcrumb-group", className),
|
|
250
|
+
ref,
|
|
251
|
+
gap,
|
|
252
|
+
role: "breadcrumb",
|
|
253
|
+
height: "max-content",
|
|
254
|
+
width: "max-content",
|
|
255
|
+
...rest,
|
|
256
|
+
children: childrenAsArray.map((child, index) => {
|
|
257
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
258
|
+
React.cloneElement(child, { key: index }),
|
|
259
|
+
childrenAsArray.length - 1 !== index && /* @__PURE__ */ jsxRuntime.jsx(themes.Text, { color: severityColor, children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { height: "100%", width: "100%", align: "center", children: separator }) })
|
|
260
|
+
] });
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
) });
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
);
|
|
267
|
+
const Breadcrumb = {
|
|
268
|
+
Group,
|
|
269
|
+
Item
|
|
270
|
+
};
|
|
271
|
+
const fluid$1 = "_fluid_r73gr_1";
|
|
272
|
+
const hoverSpin90Clockwise = "_hoverSpin90Clockwise_r73gr_15";
|
|
273
|
+
const hoverSpin180Clockwise = "_hoverSpin180Clockwise_r73gr_25";
|
|
274
|
+
const hoverSpin360Clockwise = "_hoverSpin360Clockwise_r73gr_35";
|
|
275
|
+
const styles$l = {
|
|
276
|
+
fluid: fluid$1,
|
|
277
|
+
hoverSpin90Clockwise,
|
|
278
|
+
hoverSpin180Clockwise,
|
|
279
|
+
hoverSpin360Clockwise
|
|
280
|
+
};
|
|
281
|
+
const hoverEffectClassNameMapping = {
|
|
282
|
+
spin90Clockwise: styles$l.hoverSpin90Clockwise,
|
|
283
|
+
spin180Clockwise: styles$l.hoverSpin180Clockwise,
|
|
284
|
+
spin360Clockwise: styles$l.hoverSpin360Clockwise
|
|
285
|
+
};
|
|
286
|
+
const clickOnEnterOrSpace = (e) => {
|
|
287
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
288
|
+
e.currentTarget.click();
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
const divButtonProps = {
|
|
292
|
+
role: "button",
|
|
293
|
+
tabIndex: 0,
|
|
294
|
+
onKeyDown: clickOnEnterOrSpace
|
|
295
|
+
};
|
|
296
|
+
const SizeMapping = {
|
|
297
|
+
small: "1",
|
|
298
|
+
medium: "2",
|
|
299
|
+
large: "3"
|
|
300
|
+
};
|
|
301
|
+
const ButtonGroupContext = React.createContext({});
|
|
302
|
+
const useButtonGroupContext = () => React.useContext(ButtonGroupContext);
|
|
303
|
+
const spinner = "_spinner_isifr_9";
|
|
304
|
+
const spin = "_spin_isifr_9";
|
|
305
|
+
const styles$k = {
|
|
306
|
+
spinner,
|
|
307
|
+
spin
|
|
308
|
+
};
|
|
309
|
+
const Spinner = React.memo(() => {
|
|
310
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$k.spinner });
|
|
311
|
+
});
|
|
312
|
+
Spinner.displayName = "Spinner";
|
|
313
|
+
const _Button$1 = React.forwardRef(function Button(props, ref) {
|
|
314
|
+
const buttonGroupContext = useButtonGroupContext();
|
|
315
|
+
const {
|
|
316
|
+
className,
|
|
317
|
+
type = "button",
|
|
318
|
+
fluid: fluid2 = buttonGroupContext.fluid ?? false,
|
|
319
|
+
size = buttonGroupContext.size ?? "medium",
|
|
320
|
+
severity = buttonGroupContext.severity ?? "primary",
|
|
321
|
+
hoverEffects = buttonGroupContext.hoverEffects ?? [],
|
|
322
|
+
variant = buttonGroupContext.variant,
|
|
323
|
+
shortcut = {
|
|
324
|
+
keys: [],
|
|
325
|
+
action: () => {
|
|
326
|
+
},
|
|
327
|
+
disabled: false
|
|
328
|
+
},
|
|
329
|
+
loading,
|
|
330
|
+
children,
|
|
331
|
+
disabled,
|
|
332
|
+
...rest
|
|
333
|
+
} = props;
|
|
334
|
+
const color = useSeverityColor(severity);
|
|
335
|
+
const hoverEffectClasses = hoverEffects.map((hoverEffect) => {
|
|
336
|
+
return hoverEffectClassNameMapping[hoverEffect];
|
|
337
|
+
});
|
|
338
|
+
useKeyboardShortcut(shortcut.keys, shortcut.disabled || shortcut.keys.length === 0, shortcut.action);
|
|
339
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
340
|
+
themes.Button,
|
|
341
|
+
{
|
|
342
|
+
ref,
|
|
343
|
+
type,
|
|
344
|
+
className: classNames(className, hoverEffectClasses, {
|
|
345
|
+
[styles$l.fluid]: fluid2
|
|
346
|
+
}),
|
|
347
|
+
color,
|
|
348
|
+
size: useResponsiveMapping(size, SizeMapping),
|
|
349
|
+
variant,
|
|
350
|
+
disabled: loading || disabled,
|
|
351
|
+
...rest,
|
|
352
|
+
children: loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : children
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
});
|
|
356
|
+
const Button2 = React.memo(_Button$1);
|
|
357
|
+
const _Button = React.forwardRef(function Button(props, ref) {
|
|
358
|
+
const buttonGroupContext = useButtonGroupContext();
|
|
359
|
+
const {
|
|
360
|
+
className,
|
|
361
|
+
children,
|
|
362
|
+
type = "button",
|
|
363
|
+
fluid: fluid2 = buttonGroupContext.fluid ?? false,
|
|
364
|
+
size = buttonGroupContext.size ?? "medium",
|
|
365
|
+
severity = buttonGroupContext.severity ?? "primary",
|
|
366
|
+
hoverEffects = buttonGroupContext.hoverEffects ?? [],
|
|
367
|
+
variant = buttonGroupContext.variant,
|
|
368
|
+
shortcut = {
|
|
369
|
+
keys: [],
|
|
370
|
+
action: () => {
|
|
371
|
+
},
|
|
372
|
+
disabled: false
|
|
373
|
+
},
|
|
374
|
+
...rest
|
|
375
|
+
} = props;
|
|
376
|
+
const color = useSeverityColor(severity);
|
|
377
|
+
const hoverEffectClasses = (hoverEffects == null ? void 0 : hoverEffects.map((hoverEffect) => {
|
|
378
|
+
return hoverEffectClassNameMapping[hoverEffect];
|
|
379
|
+
})) || [];
|
|
380
|
+
useKeyboardShortcut(shortcut.keys, shortcut.disabled || shortcut.keys.length === 0, shortcut.action);
|
|
381
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
382
|
+
themes.IconButton,
|
|
383
|
+
{
|
|
384
|
+
className: classNames(className, hoverEffectClasses, {
|
|
385
|
+
[styles$l.fluid]: fluid2
|
|
386
|
+
}),
|
|
387
|
+
ref,
|
|
388
|
+
color,
|
|
389
|
+
size: useResponsiveMapping(size, SizeMapping),
|
|
390
|
+
variant,
|
|
391
|
+
type,
|
|
392
|
+
...rest,
|
|
393
|
+
children
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
});
|
|
397
|
+
const IconButton = React.memo(_Button);
|
|
398
|
+
const merged = "_merged_wdgxo_1";
|
|
399
|
+
const styles$j = {
|
|
400
|
+
merged
|
|
401
|
+
};
|
|
402
|
+
const GhostVariantSizeToGapMapping = {
|
|
403
|
+
row: { small: "4", medium: "4", large: "5" },
|
|
404
|
+
column: { small: "2", medium: "3", large: "4" }
|
|
405
|
+
};
|
|
406
|
+
const _ButtonGroup = React.forwardRef(function ButtonGroup2({
|
|
407
|
+
className,
|
|
408
|
+
merged: merged2 = false,
|
|
409
|
+
children,
|
|
410
|
+
gap,
|
|
411
|
+
direction = "row",
|
|
412
|
+
severity,
|
|
413
|
+
size = "medium",
|
|
414
|
+
variant,
|
|
415
|
+
hoverEffects,
|
|
416
|
+
fluid: fluid2,
|
|
417
|
+
...rest
|
|
418
|
+
}, ref) {
|
|
419
|
+
const ghostSize = useResponsiveMapping(size, GhostVariantSizeToGapMapping[direction]);
|
|
420
|
+
const mergedAutoGap = variant === "ghost" ? ghostSize : "0";
|
|
421
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
422
|
+
themes.Flex,
|
|
423
|
+
{
|
|
424
|
+
className: classNames("overmap-button-group", className, {
|
|
425
|
+
[styles$j.merged]: merged2
|
|
426
|
+
}),
|
|
427
|
+
ref,
|
|
428
|
+
gap: merged2 ? gap ?? mergedAutoGap : gap ?? "2",
|
|
429
|
+
direction,
|
|
430
|
+
"data-direction": direction,
|
|
431
|
+
...rest,
|
|
432
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ButtonGroupContext.Provider, { value: { size, severity, variant, hoverEffects, fluid: fluid2 }, children })
|
|
433
|
+
}
|
|
434
|
+
);
|
|
435
|
+
});
|
|
436
|
+
const ButtonGroup = React.memo(_ButtonGroup);
|
|
437
|
+
const separators = "_separators_1f7v1_1";
|
|
438
|
+
const styles$i = {
|
|
439
|
+
separators
|
|
440
|
+
};
|
|
441
|
+
const ButtonListBorder = React.memo(
|
|
442
|
+
React.forwardRef((props, ref) => {
|
|
443
|
+
const { children, border, before, after, size } = props;
|
|
444
|
+
const variant = border ? "surface" : "ghost";
|
|
445
|
+
const radixSize = useResponsiveMapping(size, SizeMapping);
|
|
446
|
+
const inset = before && after ? /* @__PURE__ */ jsxRuntime.jsx(themes.Inset, { side: "x", pt: "current", pb: "current", children }) : before ? /* @__PURE__ */ jsxRuntime.jsx(themes.Inset, { side: "bottom", pt: "current", children }) : after ? /* @__PURE__ */ jsxRuntime.jsx(themes.Inset, { side: "top", pb: "current", children }) : /* @__PURE__ */ jsxRuntime.jsx(themes.Inset, { children });
|
|
447
|
+
const ret = /* @__PURE__ */ jsxRuntime.jsxs(themes.Card, { ref, size: radixSize, variant, children: [
|
|
448
|
+
before,
|
|
449
|
+
inset,
|
|
450
|
+
after
|
|
451
|
+
] });
|
|
452
|
+
if (variant === "ghost") {
|
|
453
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { p: "3", children: ret });
|
|
454
|
+
}
|
|
455
|
+
return ret;
|
|
456
|
+
})
|
|
457
|
+
);
|
|
458
|
+
const ButtonListRoot = React.memo(
|
|
459
|
+
React.forwardRef((props, ref) => {
|
|
460
|
+
const { children, variant = "outline", size, className, ...borderProps } = props;
|
|
461
|
+
const showBorder = variant === "outline" || variant === "surface";
|
|
462
|
+
const buttonVariant = variant === "outline" ? "ghost" : variant === "surface" ? "soft" : variant;
|
|
463
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ButtonListBorder, { ...borderProps, border: showBorder, size, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
464
|
+
ButtonGroup,
|
|
465
|
+
{
|
|
466
|
+
size,
|
|
467
|
+
severity: "info",
|
|
468
|
+
variant: buttonVariant,
|
|
469
|
+
className: classNames(className, styles$i.separators),
|
|
470
|
+
merged: true,
|
|
471
|
+
gap: "0",
|
|
472
|
+
direction: "column",
|
|
473
|
+
ref,
|
|
474
|
+
children
|
|
475
|
+
}
|
|
476
|
+
) });
|
|
477
|
+
})
|
|
478
|
+
);
|
|
479
|
+
const ButtonListItem = React.memo(
|
|
480
|
+
React.forwardRef((props, ref) => {
|
|
481
|
+
const { variant } = useButtonGroupContext();
|
|
482
|
+
const ret = /* @__PURE__ */ jsxRuntime.jsx(Button2, { ref, ...props, radius: "large", variant });
|
|
483
|
+
if (variant === "ghost") {
|
|
484
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { asChild: true, my: "1", mx: "2", children: ret });
|
|
485
|
+
}
|
|
486
|
+
return ret;
|
|
487
|
+
})
|
|
488
|
+
);
|
|
489
|
+
const ButtonList = {
|
|
490
|
+
Root: ButtonListRoot,
|
|
491
|
+
Item: ButtonListItem
|
|
492
|
+
};
|
|
493
|
+
const DialogContent = React.memo(function DialogContent2(props) {
|
|
494
|
+
const { title, description, content, closeDialog } = props;
|
|
495
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "2", children: [
|
|
496
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "1", children: [
|
|
497
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { justify: "between", children: [
|
|
498
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Title, { mb: "0", children: title }),
|
|
499
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(themes.IconButton, { color: "gray", variant: "ghost", "aria-label": "Close", children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.Cross1Icon, {}) }) })
|
|
500
|
+
] }),
|
|
501
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Description, { children: description })
|
|
502
|
+
] }),
|
|
503
|
+
content(closeDialog)
|
|
504
|
+
] });
|
|
505
|
+
});
|
|
506
|
+
const Dialog = React.memo(
|
|
507
|
+
React.forwardRef((props, ref) => {
|
|
508
|
+
const {
|
|
509
|
+
children,
|
|
510
|
+
content,
|
|
511
|
+
title,
|
|
512
|
+
description,
|
|
513
|
+
onOpen,
|
|
514
|
+
onClose,
|
|
515
|
+
defaultOpen,
|
|
516
|
+
onCloseInterrupt,
|
|
517
|
+
open: externalOpen,
|
|
518
|
+
onOpenChange: externalOpenChange,
|
|
519
|
+
...contentProps
|
|
520
|
+
} = props;
|
|
521
|
+
const [innerOpen, setInnerOpen] = React.useState(defaultOpen ?? false);
|
|
522
|
+
const open = externalOpen ?? innerOpen;
|
|
523
|
+
if ((!!onCloseInterrupt || !!onOpen) && !!externalOpenChange) {
|
|
524
|
+
throw new Error("Neither the `onCloseInterrupt` nor `onOpen` props can be used with `onOpenChange`.");
|
|
525
|
+
}
|
|
526
|
+
if (externalOpen !== void 0 && externalOpenChange === void 0) {
|
|
527
|
+
throw new Error("The `open` prop requires the `onOpenChange` prop.");
|
|
528
|
+
}
|
|
529
|
+
if (!children && externalOpen === void 0) {
|
|
530
|
+
throw new Error("Either the `children` or `open` prop must be defined.");
|
|
531
|
+
} else if (children && externalOpen !== void 0) {
|
|
532
|
+
throw new Error("The `children` and `open` props cannot be used together.");
|
|
533
|
+
}
|
|
534
|
+
const handleOpenChange = React.useCallback(
|
|
535
|
+
(next) => {
|
|
536
|
+
if (externalOpenChange)
|
|
537
|
+
return externalOpenChange(next);
|
|
538
|
+
if (next && onOpen) {
|
|
539
|
+
onOpen();
|
|
540
|
+
} else if (!next && onCloseInterrupt) {
|
|
541
|
+
const confirmClose = () => {
|
|
542
|
+
setInnerOpen(false);
|
|
543
|
+
if (onClose)
|
|
544
|
+
onClose();
|
|
545
|
+
};
|
|
546
|
+
return onCloseInterrupt(confirmClose);
|
|
547
|
+
} else if (!next && onClose) {
|
|
548
|
+
onClose();
|
|
549
|
+
}
|
|
550
|
+
setInnerOpen(next);
|
|
551
|
+
},
|
|
552
|
+
[externalOpenChange, onOpen, onClose, onCloseInterrupt]
|
|
553
|
+
);
|
|
554
|
+
const closeDialog = React.useCallback(
|
|
555
|
+
(options) => {
|
|
556
|
+
if (options == null ? void 0 : options.force) {
|
|
557
|
+
return setInnerOpen(false);
|
|
558
|
+
}
|
|
559
|
+
handleOpenChange(false);
|
|
560
|
+
},
|
|
561
|
+
[handleOpenChange]
|
|
562
|
+
);
|
|
563
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Dialog.Root, { open, onOpenChange: handleOpenChange, children: [
|
|
564
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Trigger, { children }),
|
|
565
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Dialog.Content, { ref, ...contentProps, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
566
|
+
DialogContent,
|
|
567
|
+
{
|
|
568
|
+
closeDialog,
|
|
569
|
+
content,
|
|
570
|
+
title,
|
|
571
|
+
description
|
|
572
|
+
}
|
|
573
|
+
) })
|
|
574
|
+
] });
|
|
575
|
+
})
|
|
576
|
+
);
|
|
577
|
+
const useWrapCallbackInDialogClose = (callback, closeOptions) => {
|
|
578
|
+
return React.useCallback(
|
|
579
|
+
(...arg) => (closeDialog) => {
|
|
580
|
+
callback(...arg);
|
|
581
|
+
closeDialog(closeOptions);
|
|
582
|
+
},
|
|
583
|
+
[callback, closeOptions]
|
|
584
|
+
);
|
|
585
|
+
};
|
|
586
|
+
const Title = (props) => /* @__PURE__ */ jsxRuntime.jsx(themes.AlertDialog.Title, { mb: "0", ...props });
|
|
587
|
+
const AlertDialogContent$1 = (props) => {
|
|
588
|
+
const { title, description, actionText = "Confirm", cancelText = "Cancel", onAction, onCancel, severity } = props;
|
|
589
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "2", children: [
|
|
590
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "1", children: [
|
|
591
|
+
/* @__PURE__ */ jsxRuntime.jsx(Title, { children: title }),
|
|
592
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.AlertDialog.Description, { children: description })
|
|
593
|
+
] }),
|
|
594
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { gap: "3", mt: "4", justify: "end", children: [
|
|
595
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.AlertDialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(Button2, { variant: "soft", severity: "info", onClick: onCancel, children: cancelText }) }),
|
|
596
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.AlertDialog.Action, { children: /* @__PURE__ */ jsxRuntime.jsx(Button2, { variant: "solid", severity, onClick: onAction, children: actionText }) })
|
|
597
|
+
] })
|
|
598
|
+
] });
|
|
599
|
+
};
|
|
600
|
+
const AlertDialog = React.memo(function AlertDialog2(props) {
|
|
601
|
+
const { open, setOpen, children, ...contentProps } = props;
|
|
602
|
+
const helpers = React.useMemo(() => {
|
|
603
|
+
return {
|
|
604
|
+
close: () => setOpen(false),
|
|
605
|
+
Title,
|
|
606
|
+
Description: themes.AlertDialog.Description
|
|
607
|
+
};
|
|
608
|
+
}, [setOpen]);
|
|
609
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.AlertDialog.Root, { open, onOpenChange: setOpen, children: [
|
|
610
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.AlertDialog.Content, { children: "content" in contentProps ? contentProps.content(helpers) : /* @__PURE__ */ jsxRuntime.jsx(AlertDialogContent$1, { ...contentProps }) }),
|
|
611
|
+
children
|
|
612
|
+
] });
|
|
613
|
+
});
|
|
614
|
+
const AlertDialogContent = React.createContext(() => {
|
|
615
|
+
throw new Error("No AlertDialogProvider found");
|
|
616
|
+
});
|
|
617
|
+
const initialState = {
|
|
618
|
+
content: () => null
|
|
619
|
+
};
|
|
620
|
+
const AlertDialogProvider = React.memo(function AlertDialogProvider2({ children }) {
|
|
621
|
+
const [open, setOpen] = React.useState(false);
|
|
622
|
+
const [state, setState] = React.useState(initialState);
|
|
623
|
+
const openDialog = React.useCallback(
|
|
624
|
+
(options) => {
|
|
625
|
+
if (open)
|
|
626
|
+
throw new Error("AlertDialog is already open");
|
|
627
|
+
setState(options);
|
|
628
|
+
setOpen(true);
|
|
629
|
+
},
|
|
630
|
+
[open]
|
|
631
|
+
);
|
|
632
|
+
return /* @__PURE__ */ jsxRuntime.jsx(AlertDialog, { open, setOpen, ...state, children: /* @__PURE__ */ jsxRuntime.jsx(AlertDialogContent.Provider, { value: openDialog, children }) });
|
|
633
|
+
});
|
|
634
|
+
const useAlertDialog = () => {
|
|
635
|
+
return React.useContext(AlertDialogContent);
|
|
636
|
+
};
|
|
637
|
+
const useDiscardAlertDialog = () => {
|
|
638
|
+
const openAlertDialog = useAlertDialog();
|
|
639
|
+
return React.useCallback(
|
|
640
|
+
(props) => openAlertDialog({
|
|
641
|
+
title: "Discard changes?",
|
|
642
|
+
description: "You have unsaved changes. Are you sure you want to discard them?",
|
|
643
|
+
actionText: "Discard",
|
|
644
|
+
severity: "danger",
|
|
645
|
+
onAction: props.onDiscard,
|
|
646
|
+
onCancel: props.onCancel
|
|
647
|
+
}),
|
|
648
|
+
[openAlertDialog]
|
|
649
|
+
);
|
|
650
|
+
};
|
|
651
|
+
const DropdownMenu = React.memo(
|
|
652
|
+
React.forwardRef(({ trigger, disabled, children, ...rest }) => {
|
|
653
|
+
const infoColor = useSeverityColor("info");
|
|
654
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.DropdownMenu.Root, { children: [
|
|
655
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.DropdownMenu.Trigger, { disabled, children: trigger }),
|
|
656
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.DropdownMenu.Content, { variant: "soft", color: infoColor, ...rest, children })
|
|
657
|
+
] });
|
|
658
|
+
})
|
|
659
|
+
);
|
|
660
|
+
const BaseMenuItem$1 = "_BaseMenuItem_1s610_1";
|
|
661
|
+
const RemoveOutline = "_RemoveOutline_1s610_15";
|
|
662
|
+
const BaseMenuSeparator$1 = "_BaseMenuSeparator_1s610_19";
|
|
663
|
+
const BaseMenuInput$1 = "_BaseMenuInput_1s610_27";
|
|
664
|
+
const styles$h = {
|
|
665
|
+
BaseMenuItem: BaseMenuItem$1,
|
|
666
|
+
RemoveOutline,
|
|
667
|
+
BaseMenuSeparator: BaseMenuSeparator$1,
|
|
668
|
+
BaseMenuInput: BaseMenuInput$1
|
|
669
|
+
};
|
|
670
|
+
const BaseMenuItem = React.memo(
|
|
671
|
+
React.forwardRef(({ children, rightSlot }, ref) => {
|
|
672
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { className: styles$h.BaseMenuItem, ref, position: "relative", px: "2", height: "6", children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { gap: "6", height: "100%", align: "center", children: [
|
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(Flex, { grow: "1", height: "100%", align: "center", gap: "1", children }),
|
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsx(Flex, { height: "100%", width: "4", align: "center", justify: "end", children: rightSlot })
|
|
675
|
+
] }) });
|
|
676
|
+
})
|
|
677
|
+
);
|
|
678
|
+
const BaseMenuInput = React.memo(
|
|
679
|
+
React.forwardRef((props) => {
|
|
680
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { className: styles$h.BaseMenuInput, px: "2", height: "6", width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(Input, { ...props, variant: "ghost" }) });
|
|
681
|
+
})
|
|
682
|
+
);
|
|
683
|
+
const BaseMenuSeparator = React.memo(function BaseMenuSeparator2() {
|
|
684
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { className: styles$h.BaseMenuSeparator, width: "100%", py: "1", children: /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { height: "0", width: "100%" }) });
|
|
685
|
+
});
|
|
686
|
+
const useCloseOnSelectHandler = (closeOnSelect) => {
|
|
687
|
+
return React.useCallback(
|
|
688
|
+
(onSelect) => (event) => {
|
|
689
|
+
if (!closeOnSelect) {
|
|
690
|
+
event.preventDefault();
|
|
691
|
+
}
|
|
692
|
+
if (onSelect)
|
|
693
|
+
onSelect(event);
|
|
694
|
+
},
|
|
695
|
+
[closeOnSelect]
|
|
696
|
+
);
|
|
697
|
+
};
|
|
698
|
+
const useTextFilterChangeHandler = () => {
|
|
699
|
+
return React.useCallback(
|
|
700
|
+
(onTextFilterChange) => (event) => {
|
|
701
|
+
if (onTextFilterChange)
|
|
702
|
+
onTextFilterChange(event.target.value);
|
|
703
|
+
},
|
|
704
|
+
[]
|
|
705
|
+
);
|
|
706
|
+
};
|
|
707
|
+
const BaseItemGroup = React.memo(function BaseItemGroup2({
|
|
708
|
+
items,
|
|
709
|
+
closeOnSelect = true,
|
|
710
|
+
groupElement: GroupElement,
|
|
711
|
+
itemElement: ItemElement,
|
|
712
|
+
filterValue,
|
|
713
|
+
onFilterValueChange,
|
|
714
|
+
placeholder,
|
|
715
|
+
icons,
|
|
716
|
+
separator,
|
|
717
|
+
...rest
|
|
718
|
+
}) {
|
|
719
|
+
const closeOnSelectHandler = useCloseOnSelectHandler(closeOnSelect);
|
|
720
|
+
const textFilterChangeHandler = useTextFilterChangeHandler();
|
|
721
|
+
React.useEffect(() => {
|
|
722
|
+
return () => {
|
|
723
|
+
if (onFilterValueChange) {
|
|
724
|
+
onFilterValueChange("");
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
}, []);
|
|
728
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
729
|
+
/* @__PURE__ */ jsxRuntime.jsx(GroupElement, { ...rest, children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", children: [
|
|
730
|
+
filterValue !== void 0 && !!onFilterValueChange && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
731
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
732
|
+
BaseMenuInput,
|
|
733
|
+
{
|
|
734
|
+
value: filterValue,
|
|
735
|
+
onChange: textFilterChangeHandler(onFilterValueChange),
|
|
736
|
+
placeholder,
|
|
737
|
+
leftSlot: icons == null ? void 0 : icons.left,
|
|
738
|
+
rightSlot: icons == null ? void 0 : icons.right
|
|
739
|
+
}
|
|
740
|
+
),
|
|
741
|
+
items.length !== 0 && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
742
|
+
] }),
|
|
743
|
+
items.map(({ content, shortcut, className, onSelect, ...rest2 }, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
744
|
+
ItemElement,
|
|
745
|
+
{
|
|
746
|
+
className: classNames(className, styles$h.RemoveOutline),
|
|
747
|
+
onSelect: closeOnSelectHandler(onSelect),
|
|
748
|
+
...rest2,
|
|
749
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(BaseMenuItem, { rightSlot: shortcut == null ? void 0 : shortcut.map((key, index2) => /* @__PURE__ */ jsxRuntime.jsx(themes.Kbd, { children: key }, index2)), children: content })
|
|
750
|
+
},
|
|
751
|
+
index
|
|
752
|
+
))
|
|
753
|
+
] }) }),
|
|
754
|
+
separator && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
755
|
+
] });
|
|
756
|
+
});
|
|
757
|
+
const BaseSelectGroup = React.memo(function BaseSelectGroup2({
|
|
758
|
+
items,
|
|
759
|
+
value,
|
|
760
|
+
closeOnSelect = false,
|
|
761
|
+
onValueChange,
|
|
762
|
+
groupElement: GroupElement,
|
|
763
|
+
selectedIndicator,
|
|
764
|
+
itemElement: ItemElement,
|
|
765
|
+
itemIndicatorElement: ItemIndicatorElement,
|
|
766
|
+
filterValue,
|
|
767
|
+
onFilterValueChange,
|
|
768
|
+
placeholder,
|
|
769
|
+
icons,
|
|
770
|
+
separator
|
|
771
|
+
}) {
|
|
772
|
+
const textFilterChangeHandler = useTextFilterChangeHandler();
|
|
773
|
+
const closeOnSelectHandler = useCloseOnSelectHandler(closeOnSelect);
|
|
774
|
+
React.useEffect(() => {
|
|
775
|
+
return () => {
|
|
776
|
+
if (onFilterValueChange) {
|
|
777
|
+
onFilterValueChange("");
|
|
778
|
+
}
|
|
779
|
+
};
|
|
780
|
+
}, []);
|
|
781
|
+
const handleCheckedChange = React.useCallback(
|
|
782
|
+
(value2) => (checked) => {
|
|
783
|
+
onValueChange(checked ? value2 : null);
|
|
784
|
+
},
|
|
785
|
+
[onValueChange]
|
|
786
|
+
);
|
|
787
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
788
|
+
/* @__PURE__ */ jsxRuntime.jsx(GroupElement, { children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", children: [
|
|
789
|
+
filterValue !== void 0 && !!onFilterValueChange && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
790
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
791
|
+
BaseMenuInput,
|
|
792
|
+
{
|
|
793
|
+
value: filterValue,
|
|
794
|
+
onChange: textFilterChangeHandler(onFilterValueChange),
|
|
795
|
+
placeholder,
|
|
796
|
+
leftSlot: icons == null ? void 0 : icons.left,
|
|
797
|
+
rightSlot: (icons == null ? void 0 : icons.right) || /* @__PURE__ */ jsxRuntime.jsx(reactIcons.MagnifyingGlassIcon, {})
|
|
798
|
+
}
|
|
799
|
+
),
|
|
800
|
+
items.length !== 0 && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
801
|
+
] }),
|
|
802
|
+
items.map(({ content, value: itemValue, onSelect, ...rest }, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
803
|
+
ItemElement,
|
|
804
|
+
{
|
|
805
|
+
className: styles$h.RemoveOutline,
|
|
806
|
+
checked: itemValue === value,
|
|
807
|
+
onCheckedChange: handleCheckedChange(itemValue),
|
|
808
|
+
onSelect: closeOnSelectHandler(onSelect),
|
|
809
|
+
textValue: "",
|
|
810
|
+
...rest,
|
|
811
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
812
|
+
BaseMenuItem,
|
|
813
|
+
{
|
|
814
|
+
rightSlot: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorElement, { asChild: true, children: selectedIndicator || /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, {}) }),
|
|
815
|
+
children: content
|
|
816
|
+
}
|
|
817
|
+
)
|
|
818
|
+
},
|
|
819
|
+
index
|
|
820
|
+
))
|
|
821
|
+
] }) }),
|
|
822
|
+
separator && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
823
|
+
] });
|
|
824
|
+
});
|
|
825
|
+
const BaseMultiSelectGroup = React.memo(function BaseMultiSelectGroup2({
|
|
826
|
+
items,
|
|
827
|
+
values,
|
|
828
|
+
onValueChange,
|
|
829
|
+
closeOnSelect = false,
|
|
830
|
+
groupElement: GroupElement,
|
|
831
|
+
selectedIndicator,
|
|
832
|
+
itemElement: ItemElement,
|
|
833
|
+
itemIndicatorElement: ItemIndicatorElement,
|
|
834
|
+
filterValue,
|
|
835
|
+
onFilterValueChange,
|
|
836
|
+
placeholder,
|
|
837
|
+
icons,
|
|
838
|
+
separator = false
|
|
839
|
+
}) {
|
|
840
|
+
const closeOnSelectHandler = useCloseOnSelectHandler(closeOnSelect);
|
|
841
|
+
const textFilterChangeHandler = useTextFilterChangeHandler();
|
|
842
|
+
React.useEffect(() => {
|
|
843
|
+
return () => {
|
|
844
|
+
if (onFilterValueChange) {
|
|
845
|
+
onFilterValueChange("");
|
|
846
|
+
}
|
|
847
|
+
};
|
|
848
|
+
}, []);
|
|
849
|
+
const handleCheckedChange = React.useCallback(
|
|
850
|
+
(value) => (checked) => {
|
|
851
|
+
if (checked) {
|
|
852
|
+
onValueChange([...values, value]);
|
|
853
|
+
} else {
|
|
854
|
+
const valueIndex = values.indexOf(value);
|
|
855
|
+
if (valueIndex < 0) {
|
|
856
|
+
throw new Error("unexpected value not found within values array");
|
|
857
|
+
}
|
|
858
|
+
const tempValues = [...values];
|
|
859
|
+
tempValues.splice(valueIndex, 1);
|
|
860
|
+
onValueChange(tempValues);
|
|
861
|
+
}
|
|
862
|
+
},
|
|
863
|
+
[onValueChange, values]
|
|
864
|
+
);
|
|
865
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
866
|
+
/* @__PURE__ */ jsxRuntime.jsx(GroupElement, { children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { direction: "column", children: [
|
|
867
|
+
filterValue !== void 0 && !!onFilterValueChange && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
868
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
869
|
+
BaseMenuInput,
|
|
870
|
+
{
|
|
871
|
+
value: filterValue,
|
|
872
|
+
onChange: textFilterChangeHandler(onFilterValueChange),
|
|
873
|
+
placeholder,
|
|
874
|
+
leftSlot: icons == null ? void 0 : icons.left,
|
|
875
|
+
rightSlot: icons == null ? void 0 : icons.right
|
|
876
|
+
}
|
|
877
|
+
),
|
|
878
|
+
items.length !== 0 && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
879
|
+
] }),
|
|
880
|
+
items.map(({ value, content, className, onSelect, ...rest }, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
881
|
+
ItemElement,
|
|
882
|
+
{
|
|
883
|
+
className: classNames(className, styles$h.RemoveOutline),
|
|
884
|
+
onSelect: closeOnSelectHandler(onSelect),
|
|
885
|
+
onCheckedChange: handleCheckedChange(value),
|
|
886
|
+
checked: values.includes(value),
|
|
887
|
+
textValue: "",
|
|
888
|
+
...rest,
|
|
889
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
890
|
+
BaseMenuItem,
|
|
891
|
+
{
|
|
892
|
+
rightSlot: /* @__PURE__ */ jsxRuntime.jsx(ItemIndicatorElement, { asChild: true, children: selectedIndicator || /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, {}) }),
|
|
893
|
+
children: content
|
|
894
|
+
}
|
|
895
|
+
)
|
|
896
|
+
},
|
|
897
|
+
index
|
|
898
|
+
))
|
|
899
|
+
] }) }),
|
|
900
|
+
separator && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
901
|
+
] });
|
|
902
|
+
});
|
|
903
|
+
const BaseSubMenuGroup = React.memo(function BaseSubMenuGroup2({
|
|
904
|
+
subTriggerElement: SubTriggerElement,
|
|
905
|
+
groupElement: GroupElement,
|
|
906
|
+
subContentElement: SubContentElement,
|
|
907
|
+
subElement: SubElement,
|
|
908
|
+
items,
|
|
909
|
+
separator = false,
|
|
910
|
+
...rest
|
|
911
|
+
}) {
|
|
912
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
913
|
+
/* @__PURE__ */ jsxRuntime.jsx(GroupElement, { ...rest, children: items.map(({ triggerIndicator, content, subContent, className, ...rest2 }, index) => /* @__PURE__ */ jsxRuntime.jsxs(SubElement, { children: [
|
|
914
|
+
/* @__PURE__ */ jsxRuntime.jsx(SubTriggerElement, { className: classNames(className, styles$h.RemoveOutline), ...rest2, children: /* @__PURE__ */ jsxRuntime.jsx(BaseMenuItem, { rightSlot: triggerIndicator, children: content }) }),
|
|
915
|
+
/* @__PURE__ */ jsxRuntime.jsx(SubContentElement, { sideOffset: 10, children: subContent })
|
|
916
|
+
] }, index)) }),
|
|
917
|
+
separator && /* @__PURE__ */ jsxRuntime.jsx(BaseMenuSeparator, {})
|
|
918
|
+
] });
|
|
919
|
+
});
|
|
920
|
+
const DropdownMenuItemGroup = React.memo(function DropdownMenuItemGroup2(props) {
|
|
921
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BaseItemGroup, { ...props, itemElement: RadixDropdownMenu__namespace.Item, groupElement: RadixDropdownMenu__namespace.Group });
|
|
922
|
+
});
|
|
923
|
+
const DropdownMenuSelectGroup = React.memo(function DropdownMenuSelectGroup2(props) {
|
|
924
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
925
|
+
BaseSelectGroup,
|
|
926
|
+
{
|
|
927
|
+
...props,
|
|
928
|
+
itemElement: RadixDropdownMenu__namespace.CheckboxItem,
|
|
929
|
+
groupElement: RadixDropdownMenu__namespace.Group,
|
|
930
|
+
itemIndicatorElement: RadixDropdownMenu__namespace.ItemIndicator
|
|
931
|
+
}
|
|
932
|
+
);
|
|
933
|
+
});
|
|
934
|
+
const DropdownMenuMultiSelectGroup = React.memo(function DropdownMenuMultiSelectGroup2(props) {
|
|
935
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
936
|
+
BaseMultiSelectGroup,
|
|
937
|
+
{
|
|
938
|
+
...props,
|
|
939
|
+
itemElement: RadixDropdownMenu__namespace.CheckboxItem,
|
|
940
|
+
groupElement: RadixDropdownMenu__namespace.Group,
|
|
941
|
+
itemIndicatorElement: RadixDropdownMenu__namespace.ItemIndicator
|
|
942
|
+
}
|
|
943
|
+
);
|
|
944
|
+
});
|
|
945
|
+
const DropdownMenuSubMenuGroup = React.memo(function DropdownMenuSubMenuGroup2(props) {
|
|
946
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
947
|
+
BaseSubMenuGroup,
|
|
948
|
+
{
|
|
949
|
+
...props,
|
|
950
|
+
groupElement: RadixDropdownMenu__namespace.Group,
|
|
951
|
+
subElement: themes.DropdownMenu.Sub,
|
|
952
|
+
subTriggerElement: RadixDropdownMenu__namespace.SubTrigger,
|
|
953
|
+
subContentElement: themes.DropdownMenu.SubContent
|
|
954
|
+
}
|
|
955
|
+
);
|
|
956
|
+
});
|
|
957
|
+
const DropdownItemMenu = React.memo(
|
|
958
|
+
React.forwardRef(
|
|
959
|
+
({
|
|
960
|
+
trigger,
|
|
961
|
+
items,
|
|
962
|
+
disabled,
|
|
963
|
+
closeOnSelect = true,
|
|
964
|
+
filterValue,
|
|
965
|
+
onFilterValueChange,
|
|
966
|
+
placeholder,
|
|
967
|
+
...rest
|
|
968
|
+
}) => {
|
|
969
|
+
const infoColor = useSeverityColor("info");
|
|
970
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.DropdownMenu.Root, { children: [
|
|
971
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.DropdownMenu.Trigger, { disabled, children: trigger }),
|
|
972
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.DropdownMenu.Content, { variant: "soft", ...rest, color: infoColor, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
973
|
+
DropdownMenuItemGroup,
|
|
974
|
+
{
|
|
975
|
+
items,
|
|
976
|
+
filterValue,
|
|
977
|
+
onFilterValueChange,
|
|
978
|
+
placeholder,
|
|
979
|
+
closeOnSelect
|
|
980
|
+
}
|
|
981
|
+
) })
|
|
982
|
+
] });
|
|
983
|
+
}
|
|
984
|
+
)
|
|
985
|
+
);
|
|
986
|
+
const DropdownSelect = React.memo(
|
|
987
|
+
React.forwardRef(
|
|
988
|
+
({
|
|
989
|
+
trigger,
|
|
990
|
+
items,
|
|
991
|
+
disabled = false,
|
|
992
|
+
value,
|
|
993
|
+
onValueChange,
|
|
994
|
+
placeholder,
|
|
995
|
+
filterValue,
|
|
996
|
+
onFilterValueChange,
|
|
997
|
+
closeOnSelect = true,
|
|
998
|
+
icons,
|
|
999
|
+
side
|
|
1000
|
+
}, ref) => {
|
|
1001
|
+
const infoColor = useSeverityColor("info");
|
|
1002
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.DropdownMenu.Root, { children: [
|
|
1003
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.DropdownMenu.Trigger, { disabled, children: trigger }),
|
|
1004
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.DropdownMenu.Content, { ref, variant: "soft", color: infoColor, side, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1005
|
+
DropdownMenuSelectGroup,
|
|
1006
|
+
{
|
|
1007
|
+
value,
|
|
1008
|
+
onValueChange,
|
|
1009
|
+
items,
|
|
1010
|
+
closeOnSelect,
|
|
1011
|
+
filterValue,
|
|
1012
|
+
onFilterValueChange,
|
|
1013
|
+
placeholder,
|
|
1014
|
+
icons
|
|
1015
|
+
}
|
|
1016
|
+
) })
|
|
1017
|
+
] });
|
|
1018
|
+
}
|
|
1019
|
+
)
|
|
1020
|
+
);
|
|
1021
|
+
const DropdownMultiSelect = React.memo(
|
|
1022
|
+
React.forwardRef(
|
|
1023
|
+
({
|
|
1024
|
+
trigger,
|
|
1025
|
+
items,
|
|
1026
|
+
disabled = false,
|
|
1027
|
+
values,
|
|
1028
|
+
onValueChange,
|
|
1029
|
+
placeholder,
|
|
1030
|
+
filterValue,
|
|
1031
|
+
onFilterValueChange,
|
|
1032
|
+
closeOnSelect = false,
|
|
1033
|
+
icons,
|
|
1034
|
+
side
|
|
1035
|
+
}, ref) => {
|
|
1036
|
+
const infoColor = useSeverityColor("info");
|
|
1037
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.DropdownMenu.Root, { children: [
|
|
1038
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.DropdownMenu.Trigger, { disabled, children: trigger }),
|
|
1039
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.DropdownMenu.Content, { ref, variant: "soft", color: infoColor, side, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1040
|
+
DropdownMenuMultiSelectGroup,
|
|
1041
|
+
{
|
|
1042
|
+
values,
|
|
1043
|
+
onValueChange,
|
|
1044
|
+
items,
|
|
1045
|
+
closeOnSelect,
|
|
1046
|
+
filterValue,
|
|
1047
|
+
onFilterValueChange,
|
|
1048
|
+
placeholder,
|
|
1049
|
+
icons
|
|
1050
|
+
}
|
|
1051
|
+
) })
|
|
1052
|
+
] });
|
|
1053
|
+
}
|
|
1054
|
+
)
|
|
1055
|
+
);
|
|
1056
|
+
const HoverUtility = React.memo(function Root2({ children }) {
|
|
1057
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
1058
|
+
const handlePointerEnter = React.useCallback(() => {
|
|
1059
|
+
setIsHovered(true);
|
|
1060
|
+
}, []);
|
|
1061
|
+
const handlePointerLeave = React.useCallback(() => {
|
|
1062
|
+
setIsHovered(false);
|
|
1063
|
+
}, []);
|
|
1064
|
+
return children({
|
|
1065
|
+
isHovered,
|
|
1066
|
+
onPointerEnter: handlePointerEnter,
|
|
1067
|
+
onPointerLeave: handlePointerLeave
|
|
1068
|
+
});
|
|
1069
|
+
});
|
|
1070
|
+
const fluid = "_fluid_7n1wr_1";
|
|
1071
|
+
const styles$g = {
|
|
1072
|
+
fluid
|
|
1073
|
+
};
|
|
1074
|
+
const _Select = React.forwardRef(function Select2({
|
|
1075
|
+
className,
|
|
1076
|
+
fluid: fluid2,
|
|
1077
|
+
size = "medium",
|
|
1078
|
+
variant = "surface",
|
|
1079
|
+
severity = "primary",
|
|
1080
|
+
itemSeverity = "info",
|
|
1081
|
+
placeholder = "Select",
|
|
1082
|
+
side,
|
|
1083
|
+
items = [],
|
|
1084
|
+
value,
|
|
1085
|
+
id,
|
|
1086
|
+
...rest
|
|
1087
|
+
}, ref) {
|
|
1088
|
+
const mappedSize = useResponsiveMapping(size, SizeMapping);
|
|
1089
|
+
const severityColor = useSeverityColor(severity);
|
|
1090
|
+
const itemSeverityColor = useSeverityColor(itemSeverity);
|
|
1091
|
+
return /* @__PURE__ */ React.createElement(themes.Select.Root, { size: mappedSize, ...rest, key: value === void 0 ? 1 : 0, value }, /* @__PURE__ */ jsxRuntime.jsx(
|
|
1092
|
+
themes.Select.Trigger,
|
|
1093
|
+
{
|
|
1094
|
+
className: classNames(className, {
|
|
1095
|
+
[styles$g.fluid]: fluid2
|
|
1096
|
+
}),
|
|
1097
|
+
id,
|
|
1098
|
+
ref,
|
|
1099
|
+
variant,
|
|
1100
|
+
placeholder,
|
|
1101
|
+
color: severityColor
|
|
1102
|
+
}
|
|
1103
|
+
), /* @__PURE__ */ jsxRuntime.jsx(
|
|
1104
|
+
themes.Select.Content,
|
|
1105
|
+
{
|
|
1106
|
+
side,
|
|
1107
|
+
className: styles$g.contentDefault,
|
|
1108
|
+
position: "popper",
|
|
1109
|
+
variant: variant !== "surface" ? "soft" : "solid",
|
|
1110
|
+
color: itemSeverityColor,
|
|
1111
|
+
children: items.map(({ itemContent, value: value2, ...rest2 }) => /* @__PURE__ */ jsxRuntime.jsx(themes.Select.Item, { className: "overmap-select-item", value: value2, ...rest2, children: itemContent }, value2))
|
|
1112
|
+
}
|
|
1113
|
+
));
|
|
1114
|
+
});
|
|
1115
|
+
const Select = React.memo(_Select);
|
|
1116
|
+
const MultiSelectItem = React.memo(
|
|
1117
|
+
React.forwardRef((props, ref) => {
|
|
1118
|
+
const { checked, label, value, size = "2" } = props;
|
|
1119
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { asChild: true, px: size, children: /* @__PURE__ */ jsxRuntime.jsx(themes.Select.Item, { value, ref, children: /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { gap: size, align: "center", children: [
|
|
1120
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Checkbox, { checked }),
|
|
1121
|
+
label
|
|
1122
|
+
] }) }) });
|
|
1123
|
+
})
|
|
1124
|
+
);
|
|
1125
|
+
const SELECT_ALL_VALUE = "__select_all__";
|
|
1126
|
+
const MultiSelect = React.memo(
|
|
1127
|
+
React.forwardRef((props, ref) => {
|
|
1128
|
+
const [open, setOpen] = React.useState(false);
|
|
1129
|
+
const { placeholder, value, onValueChange, options, disabled, name, ...triggerProps } = props;
|
|
1130
|
+
const size = useResponsiveMapping(props.size, SizeMapping);
|
|
1131
|
+
const color = useSeverityColor(props.severity);
|
|
1132
|
+
const optionsMap = React.useMemo(() => new Map(options.map((o) => [o.value, o.label])), [options]);
|
|
1133
|
+
const displayValue = value.length > 4 ? (
|
|
1134
|
+
// to ensure the width of the select doesn't get too big
|
|
1135
|
+
`${value.length} options selected`
|
|
1136
|
+
) : (
|
|
1137
|
+
// convert the values to labels
|
|
1138
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: value.flatMap((v) => [optionsMap.get(v), ", "]).slice(0, -1) })
|
|
1139
|
+
);
|
|
1140
|
+
const close = React.useCallback(() => setOpen(false), []);
|
|
1141
|
+
const handleOpenChange = React.useCallback((open2) => {
|
|
1142
|
+
if (open2)
|
|
1143
|
+
setOpen(true);
|
|
1144
|
+
}, []);
|
|
1145
|
+
const handleValueChange = React.useCallback(
|
|
1146
|
+
(selected) => {
|
|
1147
|
+
let next;
|
|
1148
|
+
if (selected === SELECT_ALL_VALUE) {
|
|
1149
|
+
const isAllSelected = value.length === options.length;
|
|
1150
|
+
next = isAllSelected ? [] : options.map((o) => o.value);
|
|
1151
|
+
} else {
|
|
1152
|
+
next = value.includes(selected) ? value.filter((v) => v !== selected) : [...value, selected];
|
|
1153
|
+
}
|
|
1154
|
+
onValueChange(next);
|
|
1155
|
+
},
|
|
1156
|
+
[onValueChange, options, value]
|
|
1157
|
+
);
|
|
1158
|
+
React.useEffect(() => {
|
|
1159
|
+
if (options.some(({ value: value2 }) => value2 === SELECT_ALL_VALUE)) {
|
|
1160
|
+
throw new Error(`Cannot have an option with the value "${SELECT_ALL_VALUE}"`);
|
|
1161
|
+
}
|
|
1162
|
+
}, [options]);
|
|
1163
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1164
|
+
themes.Select.Root,
|
|
1165
|
+
{
|
|
1166
|
+
open,
|
|
1167
|
+
value: "",
|
|
1168
|
+
onOpenChange: handleOpenChange,
|
|
1169
|
+
onValueChange: handleValueChange,
|
|
1170
|
+
disabled,
|
|
1171
|
+
size,
|
|
1172
|
+
name,
|
|
1173
|
+
autoComplete: "off",
|
|
1174
|
+
children: [
|
|
1175
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1176
|
+
themes.Select.Trigger,
|
|
1177
|
+
{
|
|
1178
|
+
ref,
|
|
1179
|
+
color,
|
|
1180
|
+
placeholder: value.length > 0 ? displayValue : placeholder,
|
|
1181
|
+
"data-placeholder": value.length > 0 ? void 0 : true,
|
|
1182
|
+
...triggerProps
|
|
1183
|
+
}
|
|
1184
|
+
),
|
|
1185
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1186
|
+
themes.Select.Content,
|
|
1187
|
+
{
|
|
1188
|
+
color: "gray",
|
|
1189
|
+
variant: "soft",
|
|
1190
|
+
position: "popper",
|
|
1191
|
+
onEscapeKeyDown: close,
|
|
1192
|
+
onPointerDownOutside: close,
|
|
1193
|
+
children: [
|
|
1194
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1195
|
+
MultiSelectItem,
|
|
1196
|
+
{
|
|
1197
|
+
value: SELECT_ALL_VALUE,
|
|
1198
|
+
label: "Select all",
|
|
1199
|
+
checked: value.length === options.length,
|
|
1200
|
+
size
|
|
1201
|
+
}
|
|
1202
|
+
),
|
|
1203
|
+
options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1204
|
+
MultiSelectItem,
|
|
1205
|
+
{
|
|
1206
|
+
...option,
|
|
1207
|
+
checked: value.includes(option.value),
|
|
1208
|
+
size
|
|
1209
|
+
},
|
|
1210
|
+
option.value
|
|
1211
|
+
))
|
|
1212
|
+
]
|
|
1213
|
+
}
|
|
1214
|
+
)
|
|
1215
|
+
]
|
|
1216
|
+
}
|
|
1217
|
+
);
|
|
1218
|
+
})
|
|
1219
|
+
);
|
|
1220
|
+
const styles$f = {
|
|
1221
|
+
"default": "_default_u936h_1"
|
|
1222
|
+
};
|
|
1223
|
+
const _Switch = React.forwardRef(function Switch2({ className, severity = "primary", icon, defaultChecked = false, onCheckedChange, ...rest }, ref) {
|
|
1224
|
+
const fallbackRef = React.useRef(null);
|
|
1225
|
+
const [checked, setChecked] = React.useState(rest.checked ? rest.checked : defaultChecked);
|
|
1226
|
+
const [iconContainer, setIconContainer] = React.useState();
|
|
1227
|
+
const severityColor = useSeverityColor(severity);
|
|
1228
|
+
React.useLayoutEffect(() => {
|
|
1229
|
+
var _a;
|
|
1230
|
+
const usedRef = ref ? ref : fallbackRef;
|
|
1231
|
+
if ("current" in usedRef && usedRef.current) {
|
|
1232
|
+
setIconContainer((_a = usedRef.current) == null ? void 0 : _a.querySelector("span.rt-SwitchThumb"));
|
|
1233
|
+
}
|
|
1234
|
+
}, [ref]);
|
|
1235
|
+
const handleValueChange = React.useCallback(
|
|
1236
|
+
(checked2) => {
|
|
1237
|
+
setChecked(checked2);
|
|
1238
|
+
if (onCheckedChange)
|
|
1239
|
+
onCheckedChange(checked2);
|
|
1240
|
+
},
|
|
1241
|
+
[onCheckedChange]
|
|
1242
|
+
);
|
|
1243
|
+
const _checked = rest.checked ? rest.checked : checked;
|
|
1244
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1245
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1246
|
+
themes.Switch,
|
|
1247
|
+
{
|
|
1248
|
+
className: classNames("overmap-switch", className, styles$f.default),
|
|
1249
|
+
ref: ref ? ref : fallbackRef,
|
|
1250
|
+
color: severityColor,
|
|
1251
|
+
radius: "full",
|
|
1252
|
+
defaultChecked,
|
|
1253
|
+
onCheckedChange: handleValueChange,
|
|
1254
|
+
...rest
|
|
1255
|
+
}
|
|
1256
|
+
),
|
|
1257
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Portal, { container: iconContainer, asChild: true, children: icon && "checked" in icon ? _checked ? icon["checked"] : icon["unchecked"] : icon })
|
|
1258
|
+
] });
|
|
1259
|
+
});
|
|
1260
|
+
const Switch = React.memo(_Switch);
|
|
1261
|
+
const sidebarContent = "_sidebarContent_1onyo_1";
|
|
1262
|
+
const right$2 = "_right_1onyo_7";
|
|
1263
|
+
const resizeHandle$1 = "_resizeHandle_1onyo_10";
|
|
1264
|
+
const left$2 = "_left_1onyo_13";
|
|
1265
|
+
const overlay = "_overlay_1onyo_33";
|
|
1266
|
+
const styles$e = {
|
|
1267
|
+
sidebarContent,
|
|
1268
|
+
right: right$2,
|
|
1269
|
+
resizeHandle: resizeHandle$1,
|
|
1270
|
+
left: left$2,
|
|
1271
|
+
overlay
|
|
1272
|
+
};
|
|
1273
|
+
const defaultSidebarSize = { width: "auto", height: "100%" };
|
|
1274
|
+
const _Sidebar = React.forwardRef(function Sidebar2({
|
|
1275
|
+
side = "left",
|
|
1276
|
+
modal = true,
|
|
1277
|
+
children,
|
|
1278
|
+
open,
|
|
1279
|
+
containerSelector,
|
|
1280
|
+
overlay: overlay2 = true,
|
|
1281
|
+
resizable: resizable2 = true,
|
|
1282
|
+
// Props related to Resizable
|
|
1283
|
+
minWidth = "300px",
|
|
1284
|
+
maxWidth = "500px",
|
|
1285
|
+
...rest
|
|
1286
|
+
}, ref) {
|
|
1287
|
+
const isRight = side === "right";
|
|
1288
|
+
const isLeft = side === "left";
|
|
1289
|
+
const [container, setContainer] = React.useState();
|
|
1290
|
+
React.useEffect(() => {
|
|
1291
|
+
const selector = containerSelector ?? '[data-is-root-theme="true"]';
|
|
1292
|
+
const tempContainer = document.querySelector(selector);
|
|
1293
|
+
if (tempContainer === void 0) {
|
|
1294
|
+
throw new Error(`Could not find a container element using the following selector ${selector}`);
|
|
1295
|
+
}
|
|
1296
|
+
setContainer(tempContainer);
|
|
1297
|
+
}, [containerSelector]);
|
|
1298
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialogPrimitive__namespace.Root, { open, modal, children: /* @__PURE__ */ jsxRuntime.jsxs(RadixDialogPrimitive__namespace.Portal, { container, children: [
|
|
1299
|
+
overlay2 && /* @__PURE__ */ jsxRuntime.jsx(RadixDialogPrimitive__namespace.Overlay, { className: classNames(styles$e.overlay) }),
|
|
1300
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1301
|
+
RadixDialogPrimitive__namespace.Content,
|
|
1302
|
+
{
|
|
1303
|
+
className: classNames("overmap-sidebar", "rt-DialogContent", styles$e.sidebarContent, {
|
|
1304
|
+
[styles$e.left]: isLeft,
|
|
1305
|
+
[styles$e.right]: isRight
|
|
1306
|
+
}),
|
|
1307
|
+
ref,
|
|
1308
|
+
asChild: true,
|
|
1309
|
+
...rest,
|
|
1310
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(themes.Box, { width: "auto", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1311
|
+
reResizable.Resizable,
|
|
1312
|
+
{
|
|
1313
|
+
minWidth,
|
|
1314
|
+
maxWidth,
|
|
1315
|
+
defaultSize: defaultSidebarSize,
|
|
1316
|
+
enable: { right: resizable2 && isLeft, left: resizable2 && isRight },
|
|
1317
|
+
handleClasses: { left: styles$e.resizeHandle, right: styles$e.resizeHandle },
|
|
1318
|
+
handleComponent: {
|
|
1319
|
+
right: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DragHandleDots2Icon, {}),
|
|
1320
|
+
left: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DragHandleDots2Icon, {})
|
|
1321
|
+
},
|
|
1322
|
+
children
|
|
1323
|
+
}
|
|
1324
|
+
) })
|
|
1325
|
+
}
|
|
1326
|
+
)
|
|
1327
|
+
] }) });
|
|
1328
|
+
});
|
|
1329
|
+
const Sidebar = React.memo(_Sidebar);
|
|
1330
|
+
const outerContent = "_outerContent_1iy9c_1";
|
|
1331
|
+
const enter = "_enter_1iy9c_4";
|
|
1332
|
+
const right$1 = "_right_1iy9c_4";
|
|
1333
|
+
const left$1 = "_left_1iy9c_8";
|
|
1334
|
+
const enterActive = "_enterActive_1iy9c_12";
|
|
1335
|
+
const exitActive = "_exitActive_1iy9c_22";
|
|
1336
|
+
const exitDone = "_exitDone_1iy9c_32";
|
|
1337
|
+
const resizable$1 = "_resizable_1iy9c_41";
|
|
1338
|
+
const slideOutOverlay = "_slideOutOverlay_1iy9c_47";
|
|
1339
|
+
const styles$d = {
|
|
1340
|
+
outerContent,
|
|
1341
|
+
enter,
|
|
1342
|
+
right: right$1,
|
|
1343
|
+
left: left$1,
|
|
1344
|
+
enterActive,
|
|
1345
|
+
exitActive,
|
|
1346
|
+
exitDone,
|
|
1347
|
+
resizable: resizable$1,
|
|
1348
|
+
slideOutOverlay
|
|
1349
|
+
};
|
|
1350
|
+
const TRANSITION_DURATION$1 = 200;
|
|
1351
|
+
const SlideOut = React.memo(function SlideOut2({
|
|
1352
|
+
className,
|
|
1353
|
+
open,
|
|
1354
|
+
side = "left",
|
|
1355
|
+
children,
|
|
1356
|
+
minWidth,
|
|
1357
|
+
maxWidth,
|
|
1358
|
+
resizable: resizable2 = true,
|
|
1359
|
+
overlay: overlay2 = false,
|
|
1360
|
+
modal = false,
|
|
1361
|
+
resizeHandle: resizeHandle2,
|
|
1362
|
+
position = "absolute",
|
|
1363
|
+
...rest
|
|
1364
|
+
}) {
|
|
1365
|
+
const contentRef = React.useRef(null);
|
|
1366
|
+
const [slideOutWidth, setSideBarWith] = React.useState(minWidth);
|
|
1367
|
+
const isSideLeft = side === "left";
|
|
1368
|
+
const isSideRight = side === "right";
|
|
1369
|
+
const handleResize = React.useCallback(
|
|
1370
|
+
(_event, _dir, ref, _delta) => {
|
|
1371
|
+
setSideBarWith(ref.clientWidth);
|
|
1372
|
+
if (contentRef.current) {
|
|
1373
|
+
contentRef.current.style.width = `${ref.clientWidth}px`;
|
|
1374
|
+
}
|
|
1375
|
+
},
|
|
1376
|
+
[]
|
|
1377
|
+
);
|
|
1378
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1379
|
+
reactTransitionGroup.CSSTransition,
|
|
1380
|
+
{
|
|
1381
|
+
in: open,
|
|
1382
|
+
classNames: {
|
|
1383
|
+
enter: styles$d.enter,
|
|
1384
|
+
enterActive: styles$d.enterActive,
|
|
1385
|
+
exitActive: styles$d.exitActive,
|
|
1386
|
+
exitDone: styles$d.exitDone
|
|
1387
|
+
},
|
|
1388
|
+
timeout: TRANSITION_DURATION$1,
|
|
1389
|
+
nodeRef: contentRef,
|
|
1390
|
+
unmountOnExit: true,
|
|
1391
|
+
mountOnEnter: true,
|
|
1392
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1393
|
+
overlay2 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames("overamp-slide-out-overlay", styles$d.slideOutOverlay) }),
|
|
1394
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactDismissableLayer.DismissableLayer, { disableOutsidePointerEvents: modal, asChild: true, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1395
|
+
themes.Flex,
|
|
1396
|
+
{
|
|
1397
|
+
className: classNames("overmap-slide-out", className, styles$d.outerContent, {
|
|
1398
|
+
[styles$d.left]: isSideLeft,
|
|
1399
|
+
[styles$d.right]: isSideRight
|
|
1400
|
+
}),
|
|
1401
|
+
style: { "--slide-out-width": `${slideOutWidth}px` },
|
|
1402
|
+
height: "100%",
|
|
1403
|
+
width: "auto",
|
|
1404
|
+
position,
|
|
1405
|
+
top: "0",
|
|
1406
|
+
bottom: "0",
|
|
1407
|
+
left: isSideLeft ? "0" : void 0,
|
|
1408
|
+
right: isSideRight ? "0" : void 0,
|
|
1409
|
+
ref: contentRef,
|
|
1410
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1411
|
+
reResizable.Resizable,
|
|
1412
|
+
{
|
|
1413
|
+
className: styles$d.resizable,
|
|
1414
|
+
defaultSize: { width: slideOutWidth, height: "100%" },
|
|
1415
|
+
onResize: handleResize,
|
|
1416
|
+
enable: { right: resizable2 && isSideLeft, left: resizable2 && isSideRight },
|
|
1417
|
+
handleComponent: { left: resizeHandle2, right: resizeHandle2 },
|
|
1418
|
+
minWidth,
|
|
1419
|
+
maxWidth,
|
|
1420
|
+
children
|
|
1421
|
+
}
|
|
1422
|
+
)
|
|
1423
|
+
}
|
|
1424
|
+
) })
|
|
1425
|
+
] })
|
|
1426
|
+
}
|
|
1427
|
+
);
|
|
1428
|
+
});
|
|
1429
|
+
const accommodateCharCount = "_accommodateCharCount_1octa_1";
|
|
1430
|
+
const wrapper$2 = "_wrapper_1octa_5";
|
|
1431
|
+
const noLeftIcon = "_noLeftIcon_1octa_14";
|
|
1432
|
+
const noRightIcon = "_noRightIcon_1octa_18";
|
|
1433
|
+
const ghost$1 = "_ghost_1octa_22";
|
|
1434
|
+
const charCount$1 = "_charCount_1octa_40";
|
|
1435
|
+
const styles$c = {
|
|
1436
|
+
accommodateCharCount,
|
|
1437
|
+
wrapper: wrapper$2,
|
|
1438
|
+
"default": "_default_1octa_10",
|
|
1439
|
+
noLeftIcon,
|
|
1440
|
+
noRightIcon,
|
|
1441
|
+
ghost: ghost$1,
|
|
1442
|
+
charCount: charCount$1
|
|
1443
|
+
};
|
|
1444
|
+
const _Input = React.forwardRef(function Input2({
|
|
1445
|
+
className,
|
|
1446
|
+
leftSlot,
|
|
1447
|
+
rightSlot,
|
|
1448
|
+
size = "medium",
|
|
1449
|
+
showInputLength,
|
|
1450
|
+
value,
|
|
1451
|
+
variant,
|
|
1452
|
+
severity = "primary",
|
|
1453
|
+
...rest
|
|
1454
|
+
}, ref) {
|
|
1455
|
+
const computedSize = useResponsiveMapping(size, SizeMapping);
|
|
1456
|
+
const color = useSeverityColor(severity);
|
|
1457
|
+
const displayInputLength = showInputLength || showInputLength === void 0 && rest.maxLength !== void 0;
|
|
1458
|
+
const valueAsString = value !== void 0 ? value.toString() : void 0;
|
|
1459
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1460
|
+
themes.TextField.Root,
|
|
1461
|
+
{
|
|
1462
|
+
className: classNames(styles$c.wrapper, className, {
|
|
1463
|
+
[styles$c.ghost]: variant === "ghost",
|
|
1464
|
+
[styles$c.accommodateCharCount]: displayInputLength
|
|
1465
|
+
}),
|
|
1466
|
+
size: computedSize,
|
|
1467
|
+
variant: variant !== "ghost" ? variant : void 0,
|
|
1468
|
+
color,
|
|
1469
|
+
children: [
|
|
1470
|
+
leftSlot && /* @__PURE__ */ jsxRuntime.jsx(themes.TextField.Slot, { children: leftSlot }),
|
|
1471
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1472
|
+
themes.TextField.Input,
|
|
1473
|
+
{
|
|
1474
|
+
className: classNames(styles$c.default, {
|
|
1475
|
+
[styles$c.noLeftIcon]: !leftSlot,
|
|
1476
|
+
[styles$c.noRightIcon]: !rightSlot
|
|
1477
|
+
}),
|
|
1478
|
+
ref,
|
|
1479
|
+
value,
|
|
1480
|
+
size: computedSize,
|
|
1481
|
+
variant: variant !== "ghost" ? variant : void 0,
|
|
1482
|
+
color,
|
|
1483
|
+
...rest
|
|
1484
|
+
}
|
|
1485
|
+
),
|
|
1486
|
+
rightSlot && /* @__PURE__ */ jsxRuntime.jsx(themes.TextField.Slot, { children: rightSlot }),
|
|
1487
|
+
displayInputLength && /* @__PURE__ */ jsxRuntime.jsx(themes.Text, { as: "p", className: styles$c.charCount, size: "1", color: "gray", children: rest.maxLength !== void 0 ? `${valueAsString == null ? void 0 : valueAsString.length}/${rest.maxLength}` : `${valueAsString == null ? void 0 : valueAsString.length}` })
|
|
1488
|
+
]
|
|
1489
|
+
}
|
|
1490
|
+
);
|
|
1491
|
+
});
|
|
1492
|
+
const Input = React.memo(_Input);
|
|
1493
|
+
const IconColorUtility = React.memo(function IconColorUtility2({
|
|
1494
|
+
color,
|
|
1495
|
+
severity,
|
|
1496
|
+
children
|
|
1497
|
+
}) {
|
|
1498
|
+
const severityColor = useSeverityColor(severity ?? "primary");
|
|
1499
|
+
const childProps = React.useMemo(
|
|
1500
|
+
() => ({
|
|
1501
|
+
"data-accent-color": severity && severityColor ? severityColor : color ? color : "gray",
|
|
1502
|
+
style: {
|
|
1503
|
+
color: "var(--accent-a9)"
|
|
1504
|
+
}
|
|
1505
|
+
}),
|
|
1506
|
+
[color, severity, severityColor]
|
|
1507
|
+
);
|
|
1508
|
+
return React.cloneElement(children, { ...childProps });
|
|
1509
|
+
});
|
|
1510
|
+
const wrapper$1 = "_wrapper_tmtz0_1";
|
|
1511
|
+
const styles$b = {
|
|
1512
|
+
wrapper: wrapper$1
|
|
1513
|
+
};
|
|
1514
|
+
const _Popover = React.forwardRef(function Popover2({ className, trigger, open, onOpenChange, defaultOpen = false, modal = false, children, ...rest }, ref) {
|
|
1515
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(themes.Popover.Root, { defaultOpen, modal, open, onOpenChange, children: [
|
|
1516
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Popover.Trigger, { children: trigger }),
|
|
1517
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1518
|
+
themes.Popover.Content,
|
|
1519
|
+
{
|
|
1520
|
+
ref,
|
|
1521
|
+
className: classNames("overmap-popover", className, styles$b.wrapper),
|
|
1522
|
+
...rest,
|
|
1523
|
+
children: children(themes.Popover.Close)
|
|
1524
|
+
}
|
|
1525
|
+
)
|
|
1526
|
+
] });
|
|
1527
|
+
});
|
|
1528
|
+
const Popover = React.memo(_Popover);
|
|
1529
|
+
const wrapper = "_wrapper_1ssf2_1";
|
|
1530
|
+
const panelContent = "_panelContent_1ssf2_6";
|
|
1531
|
+
const left = "_left_1ssf2_14";
|
|
1532
|
+
const right = "_right_1ssf2_18";
|
|
1533
|
+
const resizable = "_resizable_1ssf2_23";
|
|
1534
|
+
const resizeHandle = "_resizeHandle_1ssf2_28";
|
|
1535
|
+
const panelMainContent = "_panelMainContent_1ssf2_48";
|
|
1536
|
+
const styles$a = {
|
|
1537
|
+
wrapper,
|
|
1538
|
+
panelContent,
|
|
1539
|
+
left,
|
|
1540
|
+
right,
|
|
1541
|
+
resizable,
|
|
1542
|
+
resizeHandle,
|
|
1543
|
+
panelMainContent
|
|
1544
|
+
};
|
|
1545
|
+
const DEFAULT_MIN_WIDTH = 200;
|
|
1546
|
+
const TRANSITION_DURATION = 150;
|
|
1547
|
+
const LeftAndRightPanels = React.memo(function Panels({
|
|
1548
|
+
children,
|
|
1549
|
+
showLeft,
|
|
1550
|
+
leftPanel,
|
|
1551
|
+
leftMinWidth = DEFAULT_MIN_WIDTH,
|
|
1552
|
+
showRight,
|
|
1553
|
+
rightPanel,
|
|
1554
|
+
rightMinWidth = DEFAULT_MIN_WIDTH,
|
|
1555
|
+
resizeable
|
|
1556
|
+
}) {
|
|
1557
|
+
const wrapperRef = React.useRef(null);
|
|
1558
|
+
const leftPanelRef = React.useRef(null);
|
|
1559
|
+
const [leftPanelWidth, setLeftPanelWidth] = React.useState(0);
|
|
1560
|
+
const [leftPanelMaxWidth, setLeftPanelMaxWidth] = React.useState();
|
|
1561
|
+
const rightPanelRef = React.useRef(null);
|
|
1562
|
+
const [rightPanelWidth, setRightPanelWidth] = React.useState(0);
|
|
1563
|
+
const [rightPanelMaxWidth, setRightPanelMaxWidth] = React.useState();
|
|
1564
|
+
const handleResizePanel = React.useCallback(
|
|
1565
|
+
(resizedPanelWidth, setResizedPanelWidth, setOtherPanelMaxWidth) => {
|
|
1566
|
+
return (_event, _dir, _ref, delta) => {
|
|
1567
|
+
if (!wrapperRef.current)
|
|
1568
|
+
return;
|
|
1569
|
+
const newWidth = resizedPanelWidth + delta.width;
|
|
1570
|
+
setOtherPanelMaxWidth(wrapperRef.current.clientWidth - newWidth);
|
|
1571
|
+
setResizedPanelWidth(() => newWidth);
|
|
1572
|
+
};
|
|
1573
|
+
},
|
|
1574
|
+
[]
|
|
1575
|
+
);
|
|
1576
|
+
const handleResizeLeftPanel = React.useCallback(
|
|
1577
|
+
(_event, _dir, _ref, delta) => handleResizePanel(leftPanelWidth, setLeftPanelWidth, setRightPanelMaxWidth)(_event, _dir, _ref, delta),
|
|
1578
|
+
[handleResizePanel, leftPanelWidth]
|
|
1579
|
+
);
|
|
1580
|
+
const handleResizeRightPanel = React.useCallback(
|
|
1581
|
+
(_event, _dir, _ref, delta) => handleResizePanel(rightPanelWidth, setRightPanelWidth, setLeftPanelMaxWidth)(_event, _dir, _ref, delta),
|
|
1582
|
+
[handleResizePanel, rightPanelWidth]
|
|
1583
|
+
);
|
|
1584
|
+
const handleResizeOtherPanelOnPanelOpen = React.useCallback(
|
|
1585
|
+
(openingPanelWidth, openingPanelMinWidth, setOpeningPanelWidth, setOpeningPanelMaxWidth, otherPanelWidth, otherPanelOpen, setOtherPanelWidth, setOtherPanelMaxWidth) => {
|
|
1586
|
+
if (!wrapperRef.current)
|
|
1587
|
+
return;
|
|
1588
|
+
let newOpeningPanelWidth = openingPanelWidth;
|
|
1589
|
+
if (newOpeningPanelWidth === 0) {
|
|
1590
|
+
newOpeningPanelWidth = openingPanelMinWidth;
|
|
1591
|
+
setOpeningPanelWidth(newOpeningPanelWidth);
|
|
1592
|
+
}
|
|
1593
|
+
if (otherPanelOpen) {
|
|
1594
|
+
const newOtherPanelMaxWidth = wrapperRef.current.clientWidth - newOpeningPanelWidth;
|
|
1595
|
+
setOtherPanelMaxWidth(newOtherPanelMaxWidth);
|
|
1596
|
+
if (otherPanelWidth > newOtherPanelMaxWidth) {
|
|
1597
|
+
setOtherPanelWidth(newOtherPanelMaxWidth);
|
|
1598
|
+
setOpeningPanelMaxWidth(wrapperRef.current.clientWidth - newOtherPanelMaxWidth);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
},
|
|
1602
|
+
[]
|
|
1603
|
+
);
|
|
1604
|
+
const handleResizeLeftPanelOnRightPanelOpen = React.useCallback(
|
|
1605
|
+
() => handleResizeOtherPanelOnPanelOpen(
|
|
1606
|
+
rightPanelWidth,
|
|
1607
|
+
rightMinWidth,
|
|
1608
|
+
setRightPanelWidth,
|
|
1609
|
+
setRightPanelMaxWidth,
|
|
1610
|
+
leftPanelWidth,
|
|
1611
|
+
showLeft,
|
|
1612
|
+
setLeftPanelWidth,
|
|
1613
|
+
setLeftPanelMaxWidth
|
|
1614
|
+
),
|
|
1615
|
+
[handleResizeOtherPanelOnPanelOpen, leftPanelWidth, rightMinWidth, rightPanelWidth, showLeft]
|
|
1616
|
+
);
|
|
1617
|
+
const handleResizeRightPanelOnLeftPanelOpen = React.useCallback(
|
|
1618
|
+
() => handleResizeOtherPanelOnPanelOpen(
|
|
1619
|
+
leftPanelWidth,
|
|
1620
|
+
leftMinWidth,
|
|
1621
|
+
setLeftPanelWidth,
|
|
1622
|
+
setLeftPanelMaxWidth,
|
|
1623
|
+
rightPanelWidth,
|
|
1624
|
+
showRight,
|
|
1625
|
+
setRightPanelWidth,
|
|
1626
|
+
setRightPanelMaxWidth
|
|
1627
|
+
),
|
|
1628
|
+
[handleResizeOtherPanelOnPanelOpen, leftMinWidth, leftPanelWidth, rightPanelWidth, showRight]
|
|
1629
|
+
);
|
|
1630
|
+
const handleResizeOtherPanelOnPanelClose = React.useCallback(
|
|
1631
|
+
(otherPanelOpen, setOtherPanelMaxWidth) => {
|
|
1632
|
+
if (!wrapperRef.current)
|
|
1633
|
+
return;
|
|
1634
|
+
if (otherPanelOpen)
|
|
1635
|
+
setOtherPanelMaxWidth(wrapperRef.current.clientWidth);
|
|
1636
|
+
},
|
|
1637
|
+
[]
|
|
1638
|
+
);
|
|
1639
|
+
const handleResizeLeftPanelOnRightPanelClose = React.useCallback(
|
|
1640
|
+
() => handleResizeOtherPanelOnPanelClose(showLeft, setLeftPanelMaxWidth),
|
|
1641
|
+
[handleResizeOtherPanelOnPanelClose, showLeft]
|
|
1642
|
+
);
|
|
1643
|
+
const handleResizeRightPanelOnLeftPanelClose = React.useCallback(
|
|
1644
|
+
() => handleResizeOtherPanelOnPanelClose(showRight, setRightPanelMaxWidth),
|
|
1645
|
+
[handleResizeOtherPanelOnPanelClose, showRight]
|
|
1646
|
+
);
|
|
1647
|
+
const resizeObserverCallback = React.useCallback(() => {
|
|
1648
|
+
var _a, _b, _c, _d;
|
|
1649
|
+
if (!wrapperRef.current)
|
|
1650
|
+
return;
|
|
1651
|
+
setLeftPanelMaxWidth(wrapperRef.current.clientWidth - (((_a = rightPanelRef.current) == null ? void 0 : _a.clientWidth) || 0));
|
|
1652
|
+
setRightPanelMaxWidth(wrapperRef.current.clientWidth - (((_b = leftPanelRef.current) == null ? void 0 : _b.clientWidth) || 0));
|
|
1653
|
+
setLeftPanelWidth(((_c = leftPanelRef.current) == null ? void 0 : _c.clientWidth) || 0);
|
|
1654
|
+
setRightPanelWidth(((_d = rightPanelRef.current) == null ? void 0 : _d.clientWidth) || 0);
|
|
1655
|
+
}, []);
|
|
1656
|
+
React.useEffect(() => {
|
|
1657
|
+
if (!wrapperRef.current)
|
|
1658
|
+
return;
|
|
1659
|
+
const resizeObserver = new ResizeObserver(resizeObserverCallback);
|
|
1660
|
+
resizeObserver.observe(wrapperRef.current);
|
|
1661
|
+
return () => {
|
|
1662
|
+
resizeObserver.disconnect();
|
|
1663
|
+
};
|
|
1664
|
+
}, [resizeObserverCallback]);
|
|
1665
|
+
const leftPanelTransitionStyles = React.useMemo(() => {
|
|
1666
|
+
return {
|
|
1667
|
+
entering: {
|
|
1668
|
+
transform: `translateX(-${leftPanelWidth}px)`,
|
|
1669
|
+
marginRight: `-${leftPanelWidth}px`,
|
|
1670
|
+
transitionProperty: "transform, margin-right",
|
|
1671
|
+
transitionDuration: `${TRANSITION_DURATION}ms`,
|
|
1672
|
+
transitionTimingFunction: "linear"
|
|
1673
|
+
},
|
|
1674
|
+
entered: {
|
|
1675
|
+
transform: `translateX(0)`,
|
|
1676
|
+
marginRight: 0,
|
|
1677
|
+
transitionProperty: "transform, margin-right",
|
|
1678
|
+
transitionDuration: `${TRANSITION_DURATION}ms`,
|
|
1679
|
+
transitionTimingFunction: "linear"
|
|
1680
|
+
},
|
|
1681
|
+
exiting: {
|
|
1682
|
+
transform: `translateX(-${leftPanelWidth}px)`,
|
|
1683
|
+
marginRight: `-${leftPanelWidth}px`,
|
|
1684
|
+
transitionProperty: "transform, margin-right",
|
|
1685
|
+
transitionDuration: `${TRANSITION_DURATION}ms`,
|
|
1686
|
+
transitionTimingFunction: "linear"
|
|
1687
|
+
},
|
|
1688
|
+
exited: {},
|
|
1689
|
+
unmounted: {}
|
|
1690
|
+
};
|
|
1691
|
+
}, [leftPanelWidth]);
|
|
1692
|
+
const rightPanelTransitionStyles = React.useMemo(() => {
|
|
1693
|
+
return {
|
|
1694
|
+
entering: {
|
|
1695
|
+
transform: `translateX(${rightPanelWidth}px)`,
|
|
1696
|
+
marginLeft: `${-rightPanelWidth}px`,
|
|
1697
|
+
transitionProperty: "transform, margin-left",
|
|
1698
|
+
transitionDuration: `${TRANSITION_DURATION}ms`,
|
|
1699
|
+
transitionTimingFunction: "linear"
|
|
1700
|
+
},
|
|
1701
|
+
entered: {
|
|
1702
|
+
transform: `translateX(0)`,
|
|
1703
|
+
marginLeft: 0,
|
|
1704
|
+
transitionProperty: "transform, margin-left",
|
|
1705
|
+
transitionDuration: `${TRANSITION_DURATION}ms`,
|
|
1706
|
+
transitionTimingFunction: "linear"
|
|
1707
|
+
},
|
|
1708
|
+
exiting: {
|
|
1709
|
+
transform: `translateX(${rightPanelWidth}px)`,
|
|
1710
|
+
marginLeft: `${-rightPanelWidth}px`,
|
|
1711
|
+
transitionProperty: "transform, margin-left",
|
|
1712
|
+
transitionDuration: `${TRANSITION_DURATION}ms`,
|
|
1713
|
+
transitionTimingFunction: "linear"
|
|
1714
|
+
},
|
|
1715
|
+
exited: {},
|
|
1716
|
+
unmounted: {}
|
|
1717
|
+
};
|
|
1718
|
+
}, [rightPanelWidth]);
|
|
1719
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1720
|
+
themes.Flex,
|
|
1721
|
+
{
|
|
1722
|
+
className: styles$a.wrapper,
|
|
1723
|
+
style: { minWidth: `${leftMinWidth + rightMinWidth}px` },
|
|
1724
|
+
ref: wrapperRef,
|
|
1725
|
+
width: "100%",
|
|
1726
|
+
height: "100%",
|
|
1727
|
+
justify: "center",
|
|
1728
|
+
m: "0",
|
|
1729
|
+
p: "0",
|
|
1730
|
+
children: [
|
|
1731
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1732
|
+
reactTransitionGroup.Transition,
|
|
1733
|
+
{
|
|
1734
|
+
nodeRef: leftPanelRef,
|
|
1735
|
+
timeout: !showLeft ? TRANSITION_DURATION : 0,
|
|
1736
|
+
in: showLeft,
|
|
1737
|
+
unmountOnExit: true,
|
|
1738
|
+
onEntering: handleResizeRightPanelOnLeftPanelOpen,
|
|
1739
|
+
onExited: handleResizeRightPanelOnLeftPanelClose,
|
|
1740
|
+
children: (state) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1741
|
+
themes.Box,
|
|
1742
|
+
{
|
|
1743
|
+
ref: leftPanelRef,
|
|
1744
|
+
className: classNames(styles$a.panelContent, styles$a.left),
|
|
1745
|
+
style: leftPanelTransitionStyles[state],
|
|
1746
|
+
width: "auto",
|
|
1747
|
+
height: "100%",
|
|
1748
|
+
m: "0",
|
|
1749
|
+
p: "0",
|
|
1750
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1751
|
+
reResizable.Resizable,
|
|
1752
|
+
{
|
|
1753
|
+
className: styles$a.resizable,
|
|
1754
|
+
size: {
|
|
1755
|
+
width: leftPanelWidth,
|
|
1756
|
+
height: "100%"
|
|
1757
|
+
},
|
|
1758
|
+
onResizeStop: handleResizeLeftPanel,
|
|
1759
|
+
enable: { right: (resizeable == null ? void 0 : resizeable.left) !== void 0 ? resizeable.left : true },
|
|
1760
|
+
minWidth: leftMinWidth,
|
|
1761
|
+
maxWidth: leftPanelMaxWidth,
|
|
1762
|
+
handleClasses: { right: classNames(styles$a.resizeHandle, styles$a.left) },
|
|
1763
|
+
handleComponent: {
|
|
1764
|
+
right: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DragHandleDots2Icon, { height: "14px", width: "14px" })
|
|
1765
|
+
},
|
|
1766
|
+
children: leftPanel
|
|
1767
|
+
}
|
|
1768
|
+
)
|
|
1769
|
+
}
|
|
1770
|
+
)
|
|
1771
|
+
}
|
|
1772
|
+
),
|
|
1773
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$a.panelMainContent, children }),
|
|
1774
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1775
|
+
reactTransitionGroup.Transition,
|
|
1776
|
+
{
|
|
1777
|
+
nodeRef: rightPanelRef,
|
|
1778
|
+
timeout: !showRight ? TRANSITION_DURATION : 0,
|
|
1779
|
+
in: showRight,
|
|
1780
|
+
unmountOnExit: true,
|
|
1781
|
+
onEntering: handleResizeLeftPanelOnRightPanelOpen,
|
|
1782
|
+
onExited: handleResizeLeftPanelOnRightPanelClose,
|
|
1783
|
+
children: (state) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1784
|
+
themes.Box,
|
|
1785
|
+
{
|
|
1786
|
+
ref: rightPanelRef,
|
|
1787
|
+
className: classNames(styles$a.panelContent, styles$a.right),
|
|
1788
|
+
style: rightPanelTransitionStyles[state],
|
|
1789
|
+
width: "auto",
|
|
1790
|
+
height: "100%",
|
|
1791
|
+
m: "0",
|
|
1792
|
+
p: "0",
|
|
1793
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1794
|
+
reResizable.Resizable,
|
|
1795
|
+
{
|
|
1796
|
+
className: styles$a.resizable,
|
|
1797
|
+
size: { width: rightPanelWidth, height: "100%" },
|
|
1798
|
+
onResizeStop: handleResizeRightPanel,
|
|
1799
|
+
enable: { left: (resizeable == null ? void 0 : resizeable.right) !== void 0 ? resizeable.right : true },
|
|
1800
|
+
minWidth: rightMinWidth,
|
|
1801
|
+
maxWidth: rightPanelMaxWidth,
|
|
1802
|
+
handleClasses: { left: classNames(styles$a.resizeHandle, styles$a.right) },
|
|
1803
|
+
handleComponent: { left: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DragHandleDots2Icon, { height: "14px", width: "14px" }) },
|
|
1804
|
+
children: rightPanel
|
|
1805
|
+
}
|
|
1806
|
+
)
|
|
1807
|
+
}
|
|
1808
|
+
)
|
|
1809
|
+
}
|
|
1810
|
+
)
|
|
1811
|
+
]
|
|
1812
|
+
}
|
|
1813
|
+
);
|
|
1814
|
+
});
|
|
1815
|
+
const multiPagePopover = "_multiPagePopover_spfw7_1";
|
|
1816
|
+
const pageTitle = "_pageTitle_spfw7_12";
|
|
1817
|
+
const buttonContainer = "_buttonContainer_spfw7_17";
|
|
1818
|
+
const optionsButtonContainer = "_optionsButtonContainer_spfw7_22";
|
|
1819
|
+
const optionsButton = "_optionsButton_spfw7_22";
|
|
1820
|
+
const styles$9 = {
|
|
1821
|
+
multiPagePopover,
|
|
1822
|
+
pageTitle,
|
|
1823
|
+
buttonContainer,
|
|
1824
|
+
optionsButtonContainer,
|
|
1825
|
+
optionsButton
|
|
1826
|
+
};
|
|
1827
|
+
function getMultiPagePopoverContent(popoverOption, setMultiPagePopoverContent, direction, page = 0) {
|
|
1828
|
+
if (!popoverOption.options) {
|
|
1829
|
+
return popoverOption.content || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1830
|
+
}
|
|
1831
|
+
const optionButtons = popoverOption.options.map((option, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1832
|
+
Button2,
|
|
1833
|
+
{
|
|
1834
|
+
className: classNames(styles$9.optionsButton, option.buttonClassName),
|
|
1835
|
+
variant: "ghost",
|
|
1836
|
+
radius: "large",
|
|
1837
|
+
style: {
|
|
1838
|
+
width: direction === "vertical" ? "100%" : "auto"
|
|
1839
|
+
},
|
|
1840
|
+
severity: "info",
|
|
1841
|
+
highContrast: true,
|
|
1842
|
+
onClick: option.onClick || (() => setMultiPagePopoverContent(
|
|
1843
|
+
getMultiPagePopoverContent(option.page || {}, setMultiPagePopoverContent, direction, page + 1)
|
|
1844
|
+
)),
|
|
1845
|
+
children: option.label
|
|
1846
|
+
},
|
|
1847
|
+
`${option.value}-page-${page}-button-${i}`
|
|
1848
|
+
));
|
|
1849
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1850
|
+
popoverOption.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$9.pageTitle, children: popoverOption.title }),
|
|
1851
|
+
popoverOption.content,
|
|
1852
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1853
|
+
"div",
|
|
1854
|
+
{
|
|
1855
|
+
className: classNames(styles$9.optionsButtonContainer, popoverOption.buttonsContainerClassName),
|
|
1856
|
+
style: {
|
|
1857
|
+
flexDirection: direction === "vertical" ? "column" : "row"
|
|
1858
|
+
},
|
|
1859
|
+
children: optionButtons
|
|
1860
|
+
}
|
|
1861
|
+
)
|
|
1862
|
+
] });
|
|
1863
|
+
}
|
|
1864
|
+
const _MultiPagePopover = React.forwardRef(function MultiPagePopover2({ page, className, direction = "vertical", ...rest }, ref) {
|
|
1865
|
+
const [popoverContent, setPopoverContent] = React.useState(void 0);
|
|
1866
|
+
const resetPopoverContent = React.useCallback(() => {
|
|
1867
|
+
setPopoverContent(getMultiPagePopoverContent(page, setPopoverContent, direction, 0));
|
|
1868
|
+
}, [direction, page]);
|
|
1869
|
+
const multiPagePopoverContent = React.useCallback((_Close) => popoverContent, [popoverContent]);
|
|
1870
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1871
|
+
Popover,
|
|
1872
|
+
{
|
|
1873
|
+
className: classNames(styles$9.multiPagePopover, className),
|
|
1874
|
+
ref,
|
|
1875
|
+
onOpenAutoFocus: resetPopoverContent,
|
|
1876
|
+
onCloseAutoFocus: resetPopoverContent,
|
|
1877
|
+
...rest,
|
|
1878
|
+
children: (Close) => multiPagePopoverContent(Close)
|
|
1879
|
+
}
|
|
1880
|
+
);
|
|
1881
|
+
});
|
|
1882
|
+
const MultiPagePopover = React.memo(_MultiPagePopover);
|
|
1883
|
+
const charCount = "_charCount_1lz28_1";
|
|
1884
|
+
const ghost = "_ghost_1lz28_5";
|
|
1885
|
+
const styles$8 = {
|
|
1886
|
+
charCount,
|
|
1887
|
+
ghost
|
|
1888
|
+
};
|
|
1889
|
+
const _TextArea = React.forwardRef(function TextArea2({
|
|
1890
|
+
className,
|
|
1891
|
+
showInputLength,
|
|
1892
|
+
inputLengthTemplate,
|
|
1893
|
+
value,
|
|
1894
|
+
severity = "primary",
|
|
1895
|
+
resize,
|
|
1896
|
+
variant,
|
|
1897
|
+
...rest
|
|
1898
|
+
}, ref) {
|
|
1899
|
+
const severityColor = useSeverityColor(severity);
|
|
1900
|
+
const infoColor = useSeverityColor("info");
|
|
1901
|
+
const displayInputLength = showInputLength || showInputLength === void 0 && (rest.maxLength !== void 0 || rest.minLength !== void 0);
|
|
1902
|
+
const valueAsString = value !== void 0 ? value.toString() : "";
|
|
1903
|
+
const displayInputLengthValue = React.useMemo(() => {
|
|
1904
|
+
if (inputLengthTemplate) {
|
|
1905
|
+
let template = inputLengthTemplate.replace("{current}", valueAsString.length.toString());
|
|
1906
|
+
if (rest.minLength !== void 0) {
|
|
1907
|
+
template = template.replace("{min}", rest.minLength.toString());
|
|
1908
|
+
}
|
|
1909
|
+
if (rest.maxLength !== void 0) {
|
|
1910
|
+
template = template.replace("{max}", rest.maxLength.toString());
|
|
1911
|
+
}
|
|
1912
|
+
return template;
|
|
1913
|
+
}
|
|
1914
|
+
return valueAsString.length;
|
|
1915
|
+
}, [inputLengthTemplate, rest.maxLength, rest.minLength, valueAsString.length]);
|
|
1916
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1917
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1918
|
+
themes.TextArea,
|
|
1919
|
+
{
|
|
1920
|
+
className: classNames("overmap-textarea", className, {
|
|
1921
|
+
[styles$8.ghost]: variant === "ghost"
|
|
1922
|
+
}),
|
|
1923
|
+
style: { resize },
|
|
1924
|
+
variant: variant !== "ghost" ? variant : void 0,
|
|
1925
|
+
ref,
|
|
1926
|
+
value,
|
|
1927
|
+
color: severityColor,
|
|
1928
|
+
...rest
|
|
1929
|
+
}
|
|
1930
|
+
),
|
|
1931
|
+
displayInputLength && /* @__PURE__ */ jsxRuntime.jsx(themes.Text, { as: "p", className: styles$8.charCount, color: infoColor, align: "right", children: displayInputLengthValue })
|
|
1932
|
+
] });
|
|
1933
|
+
});
|
|
1934
|
+
const TextArea = React.memo(_TextArea);
|
|
1935
|
+
const _ToggleGroup = React.forwardRef(function ToggleGroup2({
|
|
1936
|
+
// ToggleGroup Primitive Props
|
|
1937
|
+
loop,
|
|
1938
|
+
type,
|
|
1939
|
+
rovingFocus,
|
|
1940
|
+
value,
|
|
1941
|
+
onValueChange,
|
|
1942
|
+
defaultValue,
|
|
1943
|
+
disabled,
|
|
1944
|
+
items,
|
|
1945
|
+
// ButtonGroup Props
|
|
1946
|
+
className,
|
|
1947
|
+
direction = "row",
|
|
1948
|
+
...rest
|
|
1949
|
+
}, ref) {
|
|
1950
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1951
|
+
reactToggleGroup.Root,
|
|
1952
|
+
{
|
|
1953
|
+
type,
|
|
1954
|
+
className: classNames("overmap-toggle-group", className),
|
|
1955
|
+
ref,
|
|
1956
|
+
value,
|
|
1957
|
+
onValueChange,
|
|
1958
|
+
disabled,
|
|
1959
|
+
orientation: direction === "column" ? "vertical" : "horizontal",
|
|
1960
|
+
loop,
|
|
1961
|
+
rovingFocus,
|
|
1962
|
+
defaultValue,
|
|
1963
|
+
asChild: true,
|
|
1964
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ButtonGroup, { direction, ...rest, children: items.map(({ children, ...rest2 }) => /* @__PURE__ */ React.createElement(reactToggleGroup.Item, { asChild: true, ...rest2, key: rest2.value }, /* @__PURE__ */ jsxRuntime.jsx(
|
|
1965
|
+
IconButton,
|
|
1966
|
+
{
|
|
1967
|
+
className: classNames("overmap-toggle-group-button"),
|
|
1968
|
+
"aria-label": rest2.value,
|
|
1969
|
+
variant: rest2.value === value ? "solid" : "soft",
|
|
1970
|
+
children
|
|
1971
|
+
}
|
|
1972
|
+
))) })
|
|
1973
|
+
}
|
|
1974
|
+
);
|
|
1975
|
+
});
|
|
1976
|
+
const ToggleGroup = React.memo(_ToggleGroup);
|
|
1977
|
+
const styles$7 = {
|
|
1978
|
+
"default": "_default_xqvoc_1"
|
|
1979
|
+
};
|
|
1980
|
+
const Root = React.memo(
|
|
1981
|
+
React.forwardRef(({ className, minContentGap = "2", children, ...rest }, ref) => {
|
|
1982
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1983
|
+
reactToolbar.Root,
|
|
1984
|
+
{
|
|
1985
|
+
className: classNames(className, "overmap-toolbar", styles$7.default),
|
|
1986
|
+
ref,
|
|
1987
|
+
asChild: true,
|
|
1988
|
+
...rest,
|
|
1989
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Flex, { grow: "1", width: "100%", height: "max-content", align: "center", gap: minContentGap, wrap: "nowrap", children })
|
|
1990
|
+
}
|
|
1991
|
+
);
|
|
1992
|
+
})
|
|
1993
|
+
);
|
|
1994
|
+
const LeftContent = React.memo(
|
|
1995
|
+
React.forwardRef(({ children, gap = "2" }, ref) => {
|
|
1996
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Flex, { ref, grow: "1", width: "max-content", height: "100%", align: "center", gap, children });
|
|
1997
|
+
})
|
|
1998
|
+
);
|
|
1999
|
+
const RightContent = React.memo(
|
|
2000
|
+
React.forwardRef(({ children, gap }, ref) => {
|
|
2001
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2002
|
+
Flex,
|
|
2003
|
+
{
|
|
2004
|
+
ref,
|
|
2005
|
+
grow: "1",
|
|
2006
|
+
width: "max-content",
|
|
2007
|
+
direction: "row-reverse",
|
|
2008
|
+
height: "100%",
|
|
2009
|
+
align: "center",
|
|
2010
|
+
gap: gap ? gap : "2",
|
|
2011
|
+
children
|
|
2012
|
+
}
|
|
2013
|
+
);
|
|
2014
|
+
})
|
|
2015
|
+
);
|
|
2016
|
+
const Toolbar = {
|
|
2017
|
+
Root,
|
|
2018
|
+
LeftContent,
|
|
2019
|
+
RightContent
|
|
2020
|
+
};
|
|
2021
|
+
const ToastViewport = "_ToastViewport_1i6bp_1";
|
|
2022
|
+
const actionButton = "_actionButton_1i6bp_20";
|
|
2023
|
+
const ToastRoot = "_ToastRoot_1i6bp_24";
|
|
2024
|
+
const slideIn = "_slideIn_1i6bp_1";
|
|
2025
|
+
const swipeOut = "_swipeOut_1i6bp_1";
|
|
2026
|
+
const styles$6 = {
|
|
2027
|
+
ToastViewport,
|
|
2028
|
+
actionButton,
|
|
2029
|
+
ToastRoot,
|
|
2030
|
+
slideIn,
|
|
2031
|
+
swipeOut
|
|
2032
|
+
};
|
|
2033
|
+
const _Toast = React.forwardRef(function Toast2({ title, description, icon, severity = "primary", size, onClose, sensitivity, action, ...rest }, ref) {
|
|
2034
|
+
const [open, setOpen] = React.useState(true);
|
|
2035
|
+
const color = useSeverityColor(severity);
|
|
2036
|
+
const handleOpenChange = React.useCallback(
|
|
2037
|
+
(open2) => {
|
|
2038
|
+
if (!open2 && onClose)
|
|
2039
|
+
onClose();
|
|
2040
|
+
setOpen(open2);
|
|
2041
|
+
},
|
|
2042
|
+
[onClose]
|
|
2043
|
+
);
|
|
2044
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Root, { asChild: true, ref, ...rest, open, type: sensitivity, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsx(themes.Callout.Root, { className: styles$6.ToastRoot, variant: "surface", color, size, children: /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { width: "100%", align: "center", gap: "4", justify: "between", children: [
|
|
2045
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { align: "center", gap: "3", children: [
|
|
2046
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Callout.Icon, { children: icon }),
|
|
2047
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "2", children: [
|
|
2048
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { direction: "column", gap: "0", children: [
|
|
2049
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Title, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(themes.Callout.Text, { size: "3", weight: "medium", children: title }) }),
|
|
2050
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Description, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(themes.Callout.Text, { children: description }) })
|
|
2051
|
+
] }),
|
|
2052
|
+
action && /* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Action, { className: styles$6.actionButton, altText: action.altText, asChild: true, children: action.content })
|
|
2053
|
+
] })
|
|
2054
|
+
] }),
|
|
2055
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { "aria-label": "Close", variant: "ghost", severity, children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.Cross2Icon, {}) }) })
|
|
2056
|
+
] }) }) });
|
|
2057
|
+
});
|
|
2058
|
+
const Toast = React.memo(_Toast);
|
|
2059
|
+
const ToastContext = React.createContext({});
|
|
2060
|
+
const useToast = () => {
|
|
2061
|
+
const context = React.useContext(ToastContext);
|
|
2062
|
+
if (!context) {
|
|
2063
|
+
throw new Error("useToast must be used within a ToastProvider");
|
|
2064
|
+
}
|
|
2065
|
+
return context;
|
|
2066
|
+
};
|
|
2067
|
+
const WORDS_PER_SECOND = 240 / 60;
|
|
2068
|
+
const MIN_DURATION = 5e3;
|
|
2069
|
+
const calculatedDuration = (toast) => {
|
|
2070
|
+
if (toast.duration && toast.duration >= MIN_DURATION)
|
|
2071
|
+
return toast.duration;
|
|
2072
|
+
const severityFactor = toast.severity === "danger" ? 1.5 : 1;
|
|
2073
|
+
const words = toast.description.split(" ").length + toast.title.split(" ").length;
|
|
2074
|
+
const duration = (MIN_DURATION + words / WORDS_PER_SECOND) * severityFactor;
|
|
2075
|
+
return duration;
|
|
2076
|
+
};
|
|
2077
|
+
exports2.unsafeShowToast = void 0;
|
|
2078
|
+
const ToastProvider = React.memo(function ToastContextProvider({
|
|
2079
|
+
children,
|
|
2080
|
+
// Use this class to change where the viewport for the toasts should be
|
|
2081
|
+
className,
|
|
2082
|
+
hotkey,
|
|
2083
|
+
...rest
|
|
2084
|
+
}) {
|
|
2085
|
+
const [toasts, setToasts] = React.useState([]);
|
|
2086
|
+
const handleCloseToast = React.useCallback((id, reason, callback) => {
|
|
2087
|
+
setToasts((prevToasts) => {
|
|
2088
|
+
const toast = prevToasts.find((toast2) => toast2.id === id);
|
|
2089
|
+
if (toast && reason === 0)
|
|
2090
|
+
clearTimeout(toast.timeout);
|
|
2091
|
+
return prevToasts.filter((toast2) => toast2.id !== id);
|
|
2092
|
+
});
|
|
2093
|
+
if (callback)
|
|
2094
|
+
callback();
|
|
2095
|
+
}, []);
|
|
2096
|
+
const toastContextValue = React.useMemo(() => {
|
|
2097
|
+
let counter = 0;
|
|
2098
|
+
const showToast = (toastProps) => {
|
|
2099
|
+
const duration = calculatedDuration(toastProps);
|
|
2100
|
+
const id = counter.toString();
|
|
2101
|
+
counter += 1;
|
|
2102
|
+
const pending = setTimeout(() => handleCloseToast(id, 1, toastProps.onClose), duration);
|
|
2103
|
+
setToasts((prevToasts) => [...prevToasts, { ...toastProps, timeout: pending, duration, id }]);
|
|
2104
|
+
};
|
|
2105
|
+
const showPrimary = (toastProps) => showToast({ ...toastProps, severity: "primary" });
|
|
2106
|
+
const showSuccess = (toastProps) => showToast({ ...toastProps, severity: "success" });
|
|
2107
|
+
const showError = (toastProps) => showToast({ ...toastProps, severity: "danger" });
|
|
2108
|
+
const showInfo = (toastProps) => showToast({ ...toastProps, severity: "info" });
|
|
2109
|
+
const showWarning = (toastProps) => showToast({ ...toastProps, severity: "warning" });
|
|
2110
|
+
exports2.unsafeShowToast = showToast;
|
|
2111
|
+
return {
|
|
2112
|
+
showToast,
|
|
2113
|
+
showPrimary,
|
|
2114
|
+
showSuccess,
|
|
2115
|
+
showError,
|
|
2116
|
+
showInfo,
|
|
2117
|
+
showWarning
|
|
2118
|
+
};
|
|
2119
|
+
}, [handleCloseToast]);
|
|
2120
|
+
React.useEffect(() => {
|
|
2121
|
+
return () => {
|
|
2122
|
+
for (const { timeout } of toasts)
|
|
2123
|
+
clearTimeout(timeout);
|
|
2124
|
+
};
|
|
2125
|
+
}, []);
|
|
2126
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Provider, { value: toastContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(RadixToast.ToastProvider, { ...rest, children: [
|
|
2127
|
+
children,
|
|
2128
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixToast.ToastViewport, { className: classNames(className, styles$6.ToastViewport), hotkey }),
|
|
2129
|
+
toasts.map(({ id, onClose, ...toastProps }) => /* @__PURE__ */ jsxRuntime.jsx(Toast, { ...toastProps, onClose: () => handleCloseToast(id, 0, onClose) }, id))
|
|
2130
|
+
] }) });
|
|
2131
|
+
});
|
|
2132
|
+
const styles$5 = {
|
|
2133
|
+
"default": "_default_1odpt_1"
|
|
2134
|
+
};
|
|
2135
|
+
const Tooltip = React.memo(
|
|
2136
|
+
React.forwardRef(({ className, children, content, ...rest }, ref) => {
|
|
2137
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2138
|
+
themes.Tooltip,
|
|
2139
|
+
{
|
|
2140
|
+
className: classNames("overmap-tooltip", className, styles$5.default),
|
|
2141
|
+
ref,
|
|
2142
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { align: "center", gap: "1", width: "max-content", height: "max-content", justify: "center", children: content }),
|
|
2143
|
+
...rest,
|
|
2144
|
+
children
|
|
2145
|
+
}
|
|
2146
|
+
);
|
|
2147
|
+
})
|
|
2148
|
+
);
|
|
2149
|
+
const noWrap = "_noWrap_1wpa5_1";
|
|
2150
|
+
const styles$4 = {
|
|
2151
|
+
noWrap
|
|
2152
|
+
};
|
|
2153
|
+
const Text$1 = React.memo(
|
|
2154
|
+
React.forwardRef(({ className, noWrap: noWrap2, severity, as, ...props }, ref) => {
|
|
2155
|
+
const color = useSeverityColor(severity);
|
|
2156
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2157
|
+
themes.Text,
|
|
2158
|
+
{
|
|
2159
|
+
ref,
|
|
2160
|
+
as,
|
|
2161
|
+
className: classNames(className, { [styles$4.noWrap]: noWrap2 }),
|
|
2162
|
+
color,
|
|
2163
|
+
...props
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2166
|
+
})
|
|
2167
|
+
);
|
|
2168
|
+
const DefaultTheme$1 = "";
|
|
2169
|
+
const DefaultTheme = React.memo(
|
|
2170
|
+
React.forwardRef((props, ref) => {
|
|
2171
|
+
const { panelBackground = "solid", radius: radius2 = "full", ...rest } = props;
|
|
2172
|
+
return /* @__PURE__ */ jsxRuntime.jsx(themes.Theme, { panelBackground, radius: radius2, ref, ...rest });
|
|
2173
|
+
})
|
|
2174
|
+
);
|
|
2175
|
+
const light = "_light_1u8fs_1";
|
|
2176
|
+
const bold = "_bold_1u8fs_8";
|
|
2177
|
+
const full = "_full_1u8fs_15";
|
|
2178
|
+
const Text = "_Text_1u8fs_22";
|
|
2179
|
+
const styles$3 = {
|
|
2180
|
+
light,
|
|
2181
|
+
bold,
|
|
2182
|
+
full,
|
|
2183
|
+
Text
|
|
2184
|
+
};
|
|
2185
|
+
const SeparatorSizeMapping = {
|
|
2186
|
+
"1": "max-content",
|
|
2187
|
+
"2": "max-content",
|
|
2188
|
+
"3": "max-content",
|
|
2189
|
+
"4": "100%"
|
|
2190
|
+
};
|
|
2191
|
+
const _Separator = React.forwardRef(function Separator2({
|
|
2192
|
+
className,
|
|
2193
|
+
severity = "info",
|
|
2194
|
+
textWeight = "light",
|
|
2195
|
+
gap = "1",
|
|
2196
|
+
text,
|
|
2197
|
+
orientation = "horizontal",
|
|
2198
|
+
size,
|
|
2199
|
+
weight = "medium",
|
|
2200
|
+
...rest
|
|
2201
|
+
}, ref) {
|
|
2202
|
+
const computedSizing = useResponsiveMapping(size, SeparatorSizeMapping);
|
|
2203
|
+
const severityColor = useSeverityColor(severity);
|
|
2204
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2205
|
+
themes.Flex,
|
|
2206
|
+
{
|
|
2207
|
+
className: classNames("overmap-separator", className, {
|
|
2208
|
+
[styles$3.light]: weight === "light",
|
|
2209
|
+
[styles$3.bold]: weight === "bold",
|
|
2210
|
+
[styles$3.full]: weight === "full"
|
|
2211
|
+
}),
|
|
2212
|
+
ref,
|
|
2213
|
+
width: orientation === "horizontal" ? computedSizing : "max-content",
|
|
2214
|
+
height: orientation === "vertical" ? computedSizing : "max-content",
|
|
2215
|
+
direction: orientation === "vertical" ? "column" : "row",
|
|
2216
|
+
align: "center",
|
|
2217
|
+
gap,
|
|
2218
|
+
children: [
|
|
2219
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Separator, { size, orientation, color: severityColor, ...rest }),
|
|
2220
|
+
text && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2221
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Text, { className: styles$3.Text, as: "span", size: "1", weight: textWeight, color: severityColor, children: text }),
|
|
2222
|
+
/* @__PURE__ */ jsxRuntime.jsx(themes.Separator, { size, orientation, color: severityColor, ...rest })
|
|
2223
|
+
] })
|
|
2224
|
+
]
|
|
2225
|
+
}
|
|
2226
|
+
);
|
|
2227
|
+
});
|
|
2228
|
+
const Separator = React.memo(_Separator);
|
|
2229
|
+
function _extends() {
|
|
2230
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
2231
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2232
|
+
var source = arguments[i];
|
|
2233
|
+
for (var key in source) {
|
|
2234
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2235
|
+
target[key] = source[key];
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
}
|
|
2239
|
+
return target;
|
|
2240
|
+
};
|
|
2241
|
+
return _extends.apply(this, arguments);
|
|
2242
|
+
}
|
|
2243
|
+
function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
2244
|
+
if (typeof ref === "function")
|
|
2245
|
+
ref(value);
|
|
2246
|
+
else if (ref !== null && ref !== void 0)
|
|
2247
|
+
ref.current = value;
|
|
2248
|
+
}
|
|
2249
|
+
function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
2250
|
+
return (node) => refs.forEach(
|
|
2251
|
+
(ref) => $6ed0406888f73fc4$var$setRef(ref, node)
|
|
2252
|
+
);
|
|
2253
|
+
}
|
|
2254
|
+
function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
2255
|
+
return React.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
2256
|
+
}
|
|
2257
|
+
function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
2258
|
+
let defaultContexts = [];
|
|
2259
|
+
function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
2260
|
+
const BaseContext = /* @__PURE__ */ React.createContext(defaultContext);
|
|
2261
|
+
const index = defaultContexts.length;
|
|
2262
|
+
defaultContexts = [
|
|
2263
|
+
...defaultContexts,
|
|
2264
|
+
defaultContext
|
|
2265
|
+
];
|
|
2266
|
+
function Provider(props) {
|
|
2267
|
+
const { scope, children, ...context } = props;
|
|
2268
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
2269
|
+
const value = React.useMemo(
|
|
2270
|
+
() => context,
|
|
2271
|
+
Object.values(context)
|
|
2272
|
+
);
|
|
2273
|
+
return /* @__PURE__ */ React.createElement(Context.Provider, {
|
|
2274
|
+
value
|
|
2275
|
+
}, children);
|
|
2276
|
+
}
|
|
2277
|
+
function useContext(consumerName, scope) {
|
|
2278
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
|
|
2279
|
+
const context = React.useContext(Context);
|
|
2280
|
+
if (context)
|
|
2281
|
+
return context;
|
|
2282
|
+
if (defaultContext !== void 0)
|
|
2283
|
+
return defaultContext;
|
|
2284
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
2285
|
+
}
|
|
2286
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
2287
|
+
return [
|
|
2288
|
+
Provider,
|
|
2289
|
+
useContext
|
|
2290
|
+
];
|
|
2291
|
+
}
|
|
2292
|
+
const createScope = () => {
|
|
2293
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
2294
|
+
return /* @__PURE__ */ React.createContext(defaultContext);
|
|
2295
|
+
});
|
|
2296
|
+
return function useScope(scope) {
|
|
2297
|
+
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
2298
|
+
return React.useMemo(
|
|
2299
|
+
() => ({
|
|
2300
|
+
[`__scope${scopeName}`]: {
|
|
2301
|
+
...scope,
|
|
2302
|
+
[scopeName]: contexts
|
|
2303
|
+
}
|
|
2304
|
+
}),
|
|
2305
|
+
[
|
|
2306
|
+
scope,
|
|
2307
|
+
contexts
|
|
2308
|
+
]
|
|
2309
|
+
);
|
|
2310
|
+
};
|
|
2311
|
+
};
|
|
2312
|
+
createScope.scopeName = scopeName;
|
|
2313
|
+
return [
|
|
2314
|
+
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
2315
|
+
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
2316
|
+
];
|
|
2317
|
+
}
|
|
2318
|
+
function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
2319
|
+
const baseScope = scopes[0];
|
|
2320
|
+
if (scopes.length === 1)
|
|
2321
|
+
return baseScope;
|
|
2322
|
+
const createScope1 = () => {
|
|
2323
|
+
const scopeHooks = scopes.map(
|
|
2324
|
+
(createScope) => ({
|
|
2325
|
+
useScope: createScope(),
|
|
2326
|
+
scopeName: createScope.scopeName
|
|
2327
|
+
})
|
|
2328
|
+
);
|
|
2329
|
+
return function useComposedScopes(overrideScopes) {
|
|
2330
|
+
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {
|
|
2331
|
+
const scopeProps = useScope(overrideScopes);
|
|
2332
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
2333
|
+
return {
|
|
2334
|
+
...nextScopes,
|
|
2335
|
+
...currentScope
|
|
2336
|
+
};
|
|
2337
|
+
}, {});
|
|
2338
|
+
return React.useMemo(
|
|
2339
|
+
() => ({
|
|
2340
|
+
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
2341
|
+
}),
|
|
2342
|
+
[
|
|
2343
|
+
nextScopes1
|
|
2344
|
+
]
|
|
2345
|
+
);
|
|
2346
|
+
};
|
|
2347
|
+
};
|
|
2348
|
+
createScope1.scopeName = baseScope.scopeName;
|
|
2349
|
+
return createScope1;
|
|
2350
|
+
}
|
|
2351
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
2352
|
+
return function handleEvent(event) {
|
|
2353
|
+
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
2354
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented)
|
|
2355
|
+
return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
2356
|
+
};
|
|
2357
|
+
}
|
|
2358
|
+
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
2359
|
+
const callbackRef = React.useRef(callback);
|
|
2360
|
+
React.useEffect(() => {
|
|
2361
|
+
callbackRef.current = callback;
|
|
2362
|
+
});
|
|
2363
|
+
return React.useMemo(
|
|
2364
|
+
() => (...args) => {
|
|
2365
|
+
var _callbackRef$current;
|
|
2366
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
2367
|
+
},
|
|
2368
|
+
[]
|
|
2369
|
+
);
|
|
2370
|
+
}
|
|
2371
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
|
|
2372
|
+
} }) {
|
|
2373
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
2374
|
+
defaultProp,
|
|
2375
|
+
onChange
|
|
2376
|
+
});
|
|
2377
|
+
const isControlled = prop !== void 0;
|
|
2378
|
+
const value1 = isControlled ? prop : uncontrolledProp;
|
|
2379
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
2380
|
+
const setValue = React.useCallback((nextValue) => {
|
|
2381
|
+
if (isControlled) {
|
|
2382
|
+
const setter = nextValue;
|
|
2383
|
+
const value = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
2384
|
+
if (value !== prop)
|
|
2385
|
+
handleChange(value);
|
|
2386
|
+
} else
|
|
2387
|
+
setUncontrolledProp(nextValue);
|
|
2388
|
+
}, [
|
|
2389
|
+
isControlled,
|
|
2390
|
+
prop,
|
|
2391
|
+
setUncontrolledProp,
|
|
2392
|
+
handleChange
|
|
2393
|
+
]);
|
|
2394
|
+
return [
|
|
2395
|
+
value1,
|
|
2396
|
+
setValue
|
|
2397
|
+
];
|
|
2398
|
+
}
|
|
2399
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
|
|
2400
|
+
const uncontrolledState = React.useState(defaultProp);
|
|
2401
|
+
const [value] = uncontrolledState;
|
|
2402
|
+
const prevValueRef = React.useRef(value);
|
|
2403
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
2404
|
+
React.useEffect(() => {
|
|
2405
|
+
if (prevValueRef.current !== value) {
|
|
2406
|
+
handleChange(value);
|
|
2407
|
+
prevValueRef.current = value;
|
|
2408
|
+
}
|
|
2409
|
+
}, [
|
|
2410
|
+
value,
|
|
2411
|
+
prevValueRef,
|
|
2412
|
+
handleChange
|
|
2413
|
+
]);
|
|
2414
|
+
return uncontrolledState;
|
|
2415
|
+
}
|
|
2416
|
+
function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
|
2417
|
+
const ref = React.useRef({
|
|
2418
|
+
value,
|
|
2419
|
+
previous: value
|
|
2420
|
+
});
|
|
2421
|
+
return React.useMemo(() => {
|
|
2422
|
+
if (ref.current.value !== value) {
|
|
2423
|
+
ref.current.previous = ref.current.value;
|
|
2424
|
+
ref.current.value = value;
|
|
2425
|
+
}
|
|
2426
|
+
return ref.current.previous;
|
|
2427
|
+
}, [
|
|
2428
|
+
value
|
|
2429
|
+
]);
|
|
2430
|
+
}
|
|
2431
|
+
const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? React.useLayoutEffect : () => {
|
|
2432
|
+
};
|
|
2433
|
+
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
2434
|
+
const [size, setSize] = React.useState(void 0);
|
|
2435
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
2436
|
+
if (element) {
|
|
2437
|
+
setSize({
|
|
2438
|
+
width: element.offsetWidth,
|
|
2439
|
+
height: element.offsetHeight
|
|
2440
|
+
});
|
|
2441
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
2442
|
+
if (!Array.isArray(entries))
|
|
2443
|
+
return;
|
|
2444
|
+
if (!entries.length)
|
|
2445
|
+
return;
|
|
2446
|
+
const entry = entries[0];
|
|
2447
|
+
let width;
|
|
2448
|
+
let height;
|
|
2449
|
+
if ("borderBoxSize" in entry) {
|
|
2450
|
+
const borderSizeEntry = entry["borderBoxSize"];
|
|
2451
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
2452
|
+
width = borderSize["inlineSize"];
|
|
2453
|
+
height = borderSize["blockSize"];
|
|
2454
|
+
} else {
|
|
2455
|
+
width = element.offsetWidth;
|
|
2456
|
+
height = element.offsetHeight;
|
|
2457
|
+
}
|
|
2458
|
+
setSize({
|
|
2459
|
+
width,
|
|
2460
|
+
height
|
|
2461
|
+
});
|
|
2462
|
+
});
|
|
2463
|
+
resizeObserver.observe(element, {
|
|
2464
|
+
box: "border-box"
|
|
2465
|
+
});
|
|
2466
|
+
return () => resizeObserver.unobserve(element);
|
|
2467
|
+
} else
|
|
2468
|
+
setSize(void 0);
|
|
2469
|
+
}, [
|
|
2470
|
+
element
|
|
2471
|
+
]);
|
|
2472
|
+
return size;
|
|
2473
|
+
}
|
|
2474
|
+
function $fe963b355347cc68$export$3e6543de14f8614f(initialState2, machine) {
|
|
2475
|
+
return React.useReducer((state, event) => {
|
|
2476
|
+
const nextState = machine[state][event];
|
|
2477
|
+
return nextState !== null && nextState !== void 0 ? nextState : state;
|
|
2478
|
+
}, initialState2);
|
|
2479
|
+
}
|
|
2480
|
+
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props) => {
|
|
2481
|
+
const { present, children } = props;
|
|
2482
|
+
const presence = $921a889cee6df7e8$var$usePresence(present);
|
|
2483
|
+
const child = typeof children === "function" ? children({
|
|
2484
|
+
present: presence.isPresent
|
|
2485
|
+
}) : React.Children.only(children);
|
|
2486
|
+
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
|
2487
|
+
const forceMount = typeof children === "function";
|
|
2488
|
+
return forceMount || presence.isPresent ? /* @__PURE__ */ React.cloneElement(child, {
|
|
2489
|
+
ref
|
|
2490
|
+
}) : null;
|
|
2491
|
+
};
|
|
2492
|
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = "Presence";
|
|
2493
|
+
function $921a889cee6df7e8$var$usePresence(present) {
|
|
2494
|
+
const [node1, setNode] = React.useState();
|
|
2495
|
+
const stylesRef = React.useRef({});
|
|
2496
|
+
const prevPresentRef = React.useRef(present);
|
|
2497
|
+
const prevAnimationNameRef = React.useRef("none");
|
|
2498
|
+
const initialState2 = present ? "mounted" : "unmounted";
|
|
2499
|
+
const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState2, {
|
|
2500
|
+
mounted: {
|
|
2501
|
+
UNMOUNT: "unmounted",
|
|
2502
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
2503
|
+
},
|
|
2504
|
+
unmountSuspended: {
|
|
2505
|
+
MOUNT: "mounted",
|
|
2506
|
+
ANIMATION_END: "unmounted"
|
|
2507
|
+
},
|
|
2508
|
+
unmounted: {
|
|
2509
|
+
MOUNT: "mounted"
|
|
2510
|
+
}
|
|
2511
|
+
});
|
|
2512
|
+
React.useEffect(() => {
|
|
2513
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
2514
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
2515
|
+
}, [
|
|
2516
|
+
state
|
|
2517
|
+
]);
|
|
2518
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
2519
|
+
const styles2 = stylesRef.current;
|
|
2520
|
+
const wasPresent = prevPresentRef.current;
|
|
2521
|
+
const hasPresentChanged = wasPresent !== present;
|
|
2522
|
+
if (hasPresentChanged) {
|
|
2523
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
2524
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles2);
|
|
2525
|
+
if (present)
|
|
2526
|
+
send("MOUNT");
|
|
2527
|
+
else if (currentAnimationName === "none" || (styles2 === null || styles2 === void 0 ? void 0 : styles2.display) === "none")
|
|
2528
|
+
send("UNMOUNT");
|
|
2529
|
+
else {
|
|
2530
|
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
2531
|
+
if (wasPresent && isAnimating)
|
|
2532
|
+
send("ANIMATION_OUT");
|
|
2533
|
+
else
|
|
2534
|
+
send("UNMOUNT");
|
|
2535
|
+
}
|
|
2536
|
+
prevPresentRef.current = present;
|
|
2537
|
+
}
|
|
2538
|
+
}, [
|
|
2539
|
+
present,
|
|
2540
|
+
send
|
|
2541
|
+
]);
|
|
2542
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
2543
|
+
if (node1) {
|
|
2544
|
+
const handleAnimationEnd = (event) => {
|
|
2545
|
+
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
2546
|
+
const isCurrentAnimation = currentAnimationName.includes(event.animationName);
|
|
2547
|
+
if (event.target === node1 && isCurrentAnimation)
|
|
2548
|
+
reactDom.flushSync(
|
|
2549
|
+
() => send("ANIMATION_END")
|
|
2550
|
+
);
|
|
2551
|
+
};
|
|
2552
|
+
const handleAnimationStart = (event) => {
|
|
2553
|
+
if (event.target === node1)
|
|
2554
|
+
prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
|
2555
|
+
};
|
|
2556
|
+
node1.addEventListener("animationstart", handleAnimationStart);
|
|
2557
|
+
node1.addEventListener("animationcancel", handleAnimationEnd);
|
|
2558
|
+
node1.addEventListener("animationend", handleAnimationEnd);
|
|
2559
|
+
return () => {
|
|
2560
|
+
node1.removeEventListener("animationstart", handleAnimationStart);
|
|
2561
|
+
node1.removeEventListener("animationcancel", handleAnimationEnd);
|
|
2562
|
+
node1.removeEventListener("animationend", handleAnimationEnd);
|
|
2563
|
+
};
|
|
2564
|
+
} else
|
|
2565
|
+
send("ANIMATION_END");
|
|
2566
|
+
}, [
|
|
2567
|
+
node1,
|
|
2568
|
+
send
|
|
2569
|
+
]);
|
|
2570
|
+
return {
|
|
2571
|
+
isPresent: [
|
|
2572
|
+
"mounted",
|
|
2573
|
+
"unmountSuspended"
|
|
2574
|
+
].includes(state),
|
|
2575
|
+
ref: React.useCallback((node) => {
|
|
2576
|
+
if (node)
|
|
2577
|
+
stylesRef.current = getComputedStyle(node);
|
|
2578
|
+
setNode(node);
|
|
2579
|
+
}, [])
|
|
2580
|
+
};
|
|
2581
|
+
}
|
|
2582
|
+
function $921a889cee6df7e8$var$getAnimationName(styles2) {
|
|
2583
|
+
return (styles2 === null || styles2 === void 0 ? void 0 : styles2.animationName) || "none";
|
|
2584
|
+
}
|
|
2585
|
+
const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
2586
|
+
const { children, ...slotProps } = props;
|
|
2587
|
+
const childrenArray = React.Children.toArray(children);
|
|
2588
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
2589
|
+
if (slottable) {
|
|
2590
|
+
const newElement = slottable.props.children;
|
|
2591
|
+
const newChildren = childrenArray.map((child) => {
|
|
2592
|
+
if (child === slottable) {
|
|
2593
|
+
if (React.Children.count(newElement) > 1)
|
|
2594
|
+
return React.Children.only(null);
|
|
2595
|
+
return /* @__PURE__ */ React.isValidElement(newElement) ? newElement.props.children : null;
|
|
2596
|
+
} else
|
|
2597
|
+
return child;
|
|
2598
|
+
});
|
|
2599
|
+
return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
2600
|
+
ref: forwardedRef
|
|
2601
|
+
}), /* @__PURE__ */ React.isValidElement(newElement) ? /* @__PURE__ */ React.cloneElement(newElement, void 0, newChildren) : null);
|
|
2602
|
+
}
|
|
2603
|
+
return /* @__PURE__ */ React.createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
2604
|
+
ref: forwardedRef
|
|
2605
|
+
}), children);
|
|
2606
|
+
});
|
|
2607
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
|
|
2608
|
+
const $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
2609
|
+
const { children, ...slotProps } = props;
|
|
2610
|
+
if (/* @__PURE__ */ React.isValidElement(children))
|
|
2611
|
+
return /* @__PURE__ */ React.cloneElement(children, {
|
|
2612
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
2613
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
2614
|
+
});
|
|
2615
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
2616
|
+
});
|
|
2617
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
|
|
2618
|
+
const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => {
|
|
2619
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
2620
|
+
};
|
|
2621
|
+
function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
2622
|
+
return /* @__PURE__ */ React.isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
2623
|
+
}
|
|
2624
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
2625
|
+
const overrideProps = {
|
|
2626
|
+
...childProps
|
|
2627
|
+
};
|
|
2628
|
+
for (const propName in childProps) {
|
|
2629
|
+
const slotPropValue = slotProps[propName];
|
|
2630
|
+
const childPropValue = childProps[propName];
|
|
2631
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
2632
|
+
if (isHandler) {
|
|
2633
|
+
if (slotPropValue && childPropValue)
|
|
2634
|
+
overrideProps[propName] = (...args) => {
|
|
2635
|
+
childPropValue(...args);
|
|
2636
|
+
slotPropValue(...args);
|
|
2637
|
+
};
|
|
2638
|
+
else if (slotPropValue)
|
|
2639
|
+
overrideProps[propName] = slotPropValue;
|
|
2640
|
+
} else if (propName === "style")
|
|
2641
|
+
overrideProps[propName] = {
|
|
2642
|
+
...slotPropValue,
|
|
2643
|
+
...childPropValue
|
|
2644
|
+
};
|
|
2645
|
+
else if (propName === "className")
|
|
2646
|
+
overrideProps[propName] = [
|
|
2647
|
+
slotPropValue,
|
|
2648
|
+
childPropValue
|
|
2649
|
+
].filter(Boolean).join(" ");
|
|
2650
|
+
}
|
|
2651
|
+
return {
|
|
2652
|
+
...slotProps,
|
|
2653
|
+
...overrideProps
|
|
2654
|
+
};
|
|
2655
|
+
}
|
|
2656
|
+
const $8927f6f2acc4f386$var$NODES = [
|
|
2657
|
+
"a",
|
|
2658
|
+
"button",
|
|
2659
|
+
"div",
|
|
2660
|
+
"form",
|
|
2661
|
+
"h2",
|
|
2662
|
+
"h3",
|
|
2663
|
+
"img",
|
|
2664
|
+
"input",
|
|
2665
|
+
"label",
|
|
2666
|
+
"li",
|
|
2667
|
+
"nav",
|
|
2668
|
+
"ol",
|
|
2669
|
+
"p",
|
|
2670
|
+
"span",
|
|
2671
|
+
"svg",
|
|
2672
|
+
"ul"
|
|
2673
|
+
];
|
|
2674
|
+
const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node) => {
|
|
2675
|
+
const Node = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
2676
|
+
const { asChild, ...primitiveProps } = props;
|
|
2677
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
2678
|
+
React.useEffect(() => {
|
|
2679
|
+
window[Symbol.for("radix-ui")] = true;
|
|
2680
|
+
}, []);
|
|
2681
|
+
return /* @__PURE__ */ React.createElement(Comp, _extends({}, primitiveProps, {
|
|
2682
|
+
ref: forwardedRef
|
|
2683
|
+
}));
|
|
2684
|
+
});
|
|
2685
|
+
Node.displayName = `Primitive.${node}`;
|
|
2686
|
+
return {
|
|
2687
|
+
...primitive,
|
|
2688
|
+
[node]: Node
|
|
2689
|
+
};
|
|
2690
|
+
}, {});
|
|
2691
|
+
const $e698a72e93240346$var$CHECKBOX_NAME = "Checkbox";
|
|
2692
|
+
const [$e698a72e93240346$var$createCheckboxContext, $e698a72e93240346$export$b566c4ff5488ea01] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($e698a72e93240346$var$CHECKBOX_NAME);
|
|
2693
|
+
const [$e698a72e93240346$var$CheckboxProvider, $e698a72e93240346$var$useCheckboxContext] = $e698a72e93240346$var$createCheckboxContext($e698a72e93240346$var$CHECKBOX_NAME);
|
|
2694
|
+
const $e698a72e93240346$export$48513f6b9f8ce62d = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
2695
|
+
const { __scopeCheckbox, name, checked: checkedProp, defaultChecked, required, disabled, value = "on", onCheckedChange, ...checkboxProps } = props;
|
|
2696
|
+
const [button, setButton] = React.useState(null);
|
|
2697
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
2698
|
+
forwardedRef,
|
|
2699
|
+
(node) => setButton(node)
|
|
2700
|
+
);
|
|
2701
|
+
const hasConsumerStoppedPropagationRef = React.useRef(false);
|
|
2702
|
+
const isFormControl = button ? Boolean(button.closest("form")) : true;
|
|
2703
|
+
const [checked = false, setChecked] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
2704
|
+
prop: checkedProp,
|
|
2705
|
+
defaultProp: defaultChecked,
|
|
2706
|
+
onChange: onCheckedChange
|
|
2707
|
+
});
|
|
2708
|
+
const initialCheckedStateRef = React.useRef(checked);
|
|
2709
|
+
React.useEffect(() => {
|
|
2710
|
+
const form = button === null || button === void 0 ? void 0 : button.form;
|
|
2711
|
+
if (form) {
|
|
2712
|
+
const reset = () => setChecked(initialCheckedStateRef.current);
|
|
2713
|
+
form.addEventListener("reset", reset);
|
|
2714
|
+
return () => form.removeEventListener("reset", reset);
|
|
2715
|
+
}
|
|
2716
|
+
}, [
|
|
2717
|
+
button,
|
|
2718
|
+
setChecked
|
|
2719
|
+
]);
|
|
2720
|
+
return /* @__PURE__ */ React.createElement($e698a72e93240346$var$CheckboxProvider, {
|
|
2721
|
+
scope: __scopeCheckbox,
|
|
2722
|
+
state: checked,
|
|
2723
|
+
disabled
|
|
2724
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
2725
|
+
type: "button",
|
|
2726
|
+
role: "checkbox",
|
|
2727
|
+
"aria-checked": $e698a72e93240346$var$isIndeterminate(checked) ? "mixed" : checked,
|
|
2728
|
+
"aria-required": required,
|
|
2729
|
+
"data-state": $e698a72e93240346$var$getState(checked),
|
|
2730
|
+
"data-disabled": disabled ? "" : void 0,
|
|
2731
|
+
disabled,
|
|
2732
|
+
value
|
|
2733
|
+
}, checkboxProps, {
|
|
2734
|
+
ref: composedRefs,
|
|
2735
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
|
|
2736
|
+
if (event.key === "Enter")
|
|
2737
|
+
event.preventDefault();
|
|
2738
|
+
}),
|
|
2739
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, (event) => {
|
|
2740
|
+
setChecked(
|
|
2741
|
+
(prevChecked) => $e698a72e93240346$var$isIndeterminate(prevChecked) ? true : !prevChecked
|
|
2742
|
+
);
|
|
2743
|
+
if (isFormControl) {
|
|
2744
|
+
hasConsumerStoppedPropagationRef.current = event.isPropagationStopped();
|
|
2745
|
+
if (!hasConsumerStoppedPropagationRef.current)
|
|
2746
|
+
event.stopPropagation();
|
|
2747
|
+
}
|
|
2748
|
+
})
|
|
2749
|
+
})), isFormControl && /* @__PURE__ */ React.createElement($e698a72e93240346$var$BubbleInput, {
|
|
2750
|
+
control: button,
|
|
2751
|
+
bubbles: !hasConsumerStoppedPropagationRef.current,
|
|
2752
|
+
name,
|
|
2753
|
+
value,
|
|
2754
|
+
checked,
|
|
2755
|
+
required,
|
|
2756
|
+
disabled,
|
|
2757
|
+
style: {
|
|
2758
|
+
transform: "translateX(-100%)"
|
|
2759
|
+
}
|
|
2760
|
+
}));
|
|
2761
|
+
});
|
|
2762
|
+
const $e698a72e93240346$var$INDICATOR_NAME = "CheckboxIndicator";
|
|
2763
|
+
const $e698a72e93240346$export$59aad738f51d1c05 = /* @__PURE__ */ React.forwardRef((props, forwardedRef) => {
|
|
2764
|
+
const { __scopeCheckbox, forceMount, ...indicatorProps } = props;
|
|
2765
|
+
const context = $e698a72e93240346$var$useCheckboxContext($e698a72e93240346$var$INDICATOR_NAME, __scopeCheckbox);
|
|
2766
|
+
return /* @__PURE__ */ React.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
2767
|
+
present: forceMount || $e698a72e93240346$var$isIndeterminate(context.state) || context.state === true
|
|
2768
|
+
}, /* @__PURE__ */ React.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
2769
|
+
"data-state": $e698a72e93240346$var$getState(context.state),
|
|
2770
|
+
"data-disabled": context.disabled ? "" : void 0
|
|
2771
|
+
}, indicatorProps, {
|
|
2772
|
+
ref: forwardedRef,
|
|
2773
|
+
style: {
|
|
2774
|
+
pointerEvents: "none",
|
|
2775
|
+
...props.style
|
|
2776
|
+
}
|
|
2777
|
+
})));
|
|
2778
|
+
});
|
|
2779
|
+
const $e698a72e93240346$var$BubbleInput = (props) => {
|
|
2780
|
+
const { control, checked, bubbles = true, ...inputProps } = props;
|
|
2781
|
+
const ref = React.useRef(null);
|
|
2782
|
+
const prevChecked = $010c2913dbd2fe3d$export$5cae361ad82dce8b(checked);
|
|
2783
|
+
const controlSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(control);
|
|
2784
|
+
React.useEffect(() => {
|
|
2785
|
+
const input = ref.current;
|
|
2786
|
+
const inputProto = window.HTMLInputElement.prototype;
|
|
2787
|
+
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "checked");
|
|
2788
|
+
const setChecked = descriptor.set;
|
|
2789
|
+
if (prevChecked !== checked && setChecked) {
|
|
2790
|
+
const event = new Event("click", {
|
|
2791
|
+
bubbles
|
|
2792
|
+
});
|
|
2793
|
+
input.indeterminate = $e698a72e93240346$var$isIndeterminate(checked);
|
|
2794
|
+
setChecked.call(input, $e698a72e93240346$var$isIndeterminate(checked) ? false : checked);
|
|
2795
|
+
input.dispatchEvent(event);
|
|
2796
|
+
}
|
|
2797
|
+
}, [
|
|
2798
|
+
prevChecked,
|
|
2799
|
+
checked,
|
|
2800
|
+
bubbles
|
|
2801
|
+
]);
|
|
2802
|
+
return /* @__PURE__ */ React.createElement("input", _extends({
|
|
2803
|
+
type: "checkbox",
|
|
2804
|
+
"aria-hidden": true,
|
|
2805
|
+
defaultChecked: $e698a72e93240346$var$isIndeterminate(checked) ? false : checked
|
|
2806
|
+
}, inputProps, {
|
|
2807
|
+
tabIndex: -1,
|
|
2808
|
+
ref,
|
|
2809
|
+
style: {
|
|
2810
|
+
...props.style,
|
|
2811
|
+
...controlSize,
|
|
2812
|
+
position: "absolute",
|
|
2813
|
+
pointerEvents: "none",
|
|
2814
|
+
opacity: 0,
|
|
2815
|
+
margin: 0
|
|
2816
|
+
}
|
|
2817
|
+
}));
|
|
2818
|
+
};
|
|
2819
|
+
function $e698a72e93240346$var$isIndeterminate(checked) {
|
|
2820
|
+
return checked === "indeterminate";
|
|
2821
|
+
}
|
|
2822
|
+
function $e698a72e93240346$var$getState(checked) {
|
|
2823
|
+
return $e698a72e93240346$var$isIndeterminate(checked) ? "indeterminate" : checked ? "checked" : "unchecked";
|
|
2824
|
+
}
|
|
2825
|
+
const $e698a72e93240346$export$be92b6f5f03c0fe9 = $e698a72e93240346$export$48513f6b9f8ce62d;
|
|
2826
|
+
const $e698a72e93240346$export$adb584737d712b70 = $e698a72e93240346$export$59aad738f51d1c05;
|
|
2827
|
+
const checkboxContainer = "_checkboxContainer_pb9za_5";
|
|
2828
|
+
const checkbox = "_checkbox_pb9za_5";
|
|
2829
|
+
const checkboxIndicator = "_checkboxIndicator_pb9za_27";
|
|
2830
|
+
const checkboxLabel = "_checkboxLabel_pb9za_38";
|
|
2831
|
+
const noTextHighlight = "_noTextHighlight_pb9za_42";
|
|
2832
|
+
const checkboxHidden = "_checkboxHidden_pb9za_51";
|
|
2833
|
+
const styles$2 = {
|
|
2834
|
+
checkboxContainer,
|
|
2835
|
+
checkbox,
|
|
2836
|
+
checkboxIndicator,
|
|
2837
|
+
checkboxLabel,
|
|
2838
|
+
noTextHighlight,
|
|
2839
|
+
checkboxHidden
|
|
2840
|
+
};
|
|
2841
|
+
const _Checkbox = React.forwardRef(function Checkbox2({ className, labelClassName, label, checked, onCheckedChange, ...rest }, ref) {
|
|
2842
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HoverUtility, { children: ({ isHovered, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$2.checkboxContainer, ...props, children: [
|
|
2843
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2844
|
+
$e698a72e93240346$export$be92b6f5f03c0fe9,
|
|
2845
|
+
{
|
|
2846
|
+
className: classNames(
|
|
2847
|
+
styles$2.checkbox,
|
|
2848
|
+
!isHovered && !checked && styles$2.checkboxHidden,
|
|
2849
|
+
className
|
|
2850
|
+
),
|
|
2851
|
+
checked,
|
|
2852
|
+
onCheckedChange: (checked2) => {
|
|
2853
|
+
if (onCheckedChange) {
|
|
2854
|
+
onCheckedChange(checked2);
|
|
2855
|
+
}
|
|
2856
|
+
},
|
|
2857
|
+
ref,
|
|
2858
|
+
...rest,
|
|
2859
|
+
children: /* @__PURE__ */ jsxRuntime.jsx($e698a72e93240346$export$adb584737d712b70, { className: styles$2.checkboxIndicator, children: checked === "indeterminate" ? /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DividerHorizontalIcon, { width: "13px" }) : /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, {}) })
|
|
2860
|
+
}
|
|
2861
|
+
),
|
|
2862
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2863
|
+
"div",
|
|
2864
|
+
{
|
|
2865
|
+
className: classNames(styles$2.checkboxLabel, labelClassName, styles$2.noTextHighlight),
|
|
2866
|
+
onClick: () => {
|
|
2867
|
+
if (onCheckedChange) {
|
|
2868
|
+
onCheckedChange(!checked);
|
|
2869
|
+
}
|
|
2870
|
+
},
|
|
2871
|
+
children: label
|
|
2872
|
+
}
|
|
2873
|
+
)
|
|
2874
|
+
] }) });
|
|
2875
|
+
});
|
|
2876
|
+
const Checkbox = React.memo(_Checkbox);
|
|
2877
|
+
Checkbox.displayName = "Checkbox";
|
|
2878
|
+
const SelectAllCheckbox = React.memo(function SelectAllCheckbox2({
|
|
2879
|
+
className,
|
|
2880
|
+
labelClassName,
|
|
2881
|
+
label,
|
|
2882
|
+
onCheckedChange,
|
|
2883
|
+
children,
|
|
2884
|
+
...rest
|
|
2885
|
+
}) {
|
|
2886
|
+
const [isChecked, setIsChecked] = React.useState(
|
|
2887
|
+
React.Children.toArray(children).every((child) => React.isValidElement(child) && child.props.checked) ? true : React.Children.toArray(children).some((child) => React.isValidElement(child) && child.props.checked) ? "indeterminate" : false
|
|
2888
|
+
);
|
|
2889
|
+
const [isChildChecked, setIsChildChecked] = React.useState(
|
|
2890
|
+
React.Children.map(children, (child) => child.props.checked)
|
|
2891
|
+
);
|
|
2892
|
+
const handleOnCheckedChange = (checked) => {
|
|
2893
|
+
const isAllSelected = isChecked === "indeterminate" || !checked;
|
|
2894
|
+
if (isChecked === "indeterminate") {
|
|
2895
|
+
checked = false;
|
|
2896
|
+
}
|
|
2897
|
+
setIsChildChecked(isChildChecked.map((_child) => !isAllSelected));
|
|
2898
|
+
if (onCheckedChange) {
|
|
2899
|
+
onCheckedChange(checked);
|
|
2900
|
+
}
|
|
2901
|
+
};
|
|
2902
|
+
React.useEffect(() => {
|
|
2903
|
+
const numSelected = isChildChecked.filter((child) => child).length;
|
|
2904
|
+
if (numSelected === 0) {
|
|
2905
|
+
setIsChecked(false);
|
|
2906
|
+
} else if (numSelected === children.length) {
|
|
2907
|
+
setIsChecked(true);
|
|
2908
|
+
} else {
|
|
2909
|
+
setIsChecked("indeterminate");
|
|
2910
|
+
}
|
|
2911
|
+
}, [children, isChildChecked]);
|
|
2912
|
+
const childrenWithProps = React.Children.map(
|
|
2913
|
+
children,
|
|
2914
|
+
(child, i) => React.cloneElement(child, {
|
|
2915
|
+
...child.props,
|
|
2916
|
+
checked: isChildChecked[i],
|
|
2917
|
+
onCheckedChange: (checked) => {
|
|
2918
|
+
const _isChildChecked = [...isChildChecked];
|
|
2919
|
+
_isChildChecked[i] = checked;
|
|
2920
|
+
setIsChildChecked(_isChildChecked);
|
|
2921
|
+
if (child.props.onCheckedChange) {
|
|
2922
|
+
child.props.onCheckedChange(checked);
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
})
|
|
2926
|
+
);
|
|
2927
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2928
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2929
|
+
Checkbox,
|
|
2930
|
+
{
|
|
2931
|
+
className,
|
|
2932
|
+
labelClassName,
|
|
2933
|
+
label,
|
|
2934
|
+
checked: isChecked,
|
|
2935
|
+
onCheckedChange: handleOnCheckedChange,
|
|
2936
|
+
...rest
|
|
2937
|
+
}
|
|
2938
|
+
),
|
|
2939
|
+
childrenWithProps
|
|
2940
|
+
] });
|
|
2941
|
+
});
|
|
2942
|
+
const tableContainer = "_tableContainer_go3yk_1";
|
|
2943
|
+
const headerContainer = "_headerContainer_go3yk_14";
|
|
2944
|
+
const tableTopContainer = "_tableTopContainer_go3yk_18";
|
|
2945
|
+
const searchContainer = "_searchContainer_go3yk_22";
|
|
2946
|
+
const columnFilterSelect = "_columnFilterSelect_go3yk_32";
|
|
2947
|
+
const table = "_table_go3yk_1";
|
|
2948
|
+
const tableHeaderCell = "_tableHeaderCell_go3yk_50";
|
|
2949
|
+
const tableRow = "_tableRow_go3yk_56";
|
|
2950
|
+
const tableCell = "_tableCell_go3yk_71";
|
|
2951
|
+
const noDataTextContainer = "_noDataTextContainer_go3yk_78";
|
|
2952
|
+
const tableBottomContainer = "_tableBottomContainer_go3yk_84";
|
|
2953
|
+
const rowsPerPageContainer = "_rowsPerPageContainer_go3yk_88";
|
|
2954
|
+
const rowsPerPageText = "_rowsPerPageText_go3yk_98";
|
|
2955
|
+
const styles$1 = {
|
|
2956
|
+
tableContainer,
|
|
2957
|
+
headerContainer,
|
|
2958
|
+
tableTopContainer,
|
|
2959
|
+
searchContainer,
|
|
2960
|
+
columnFilterSelect,
|
|
2961
|
+
table,
|
|
2962
|
+
tableHeaderCell,
|
|
2963
|
+
tableRow,
|
|
2964
|
+
tableCell,
|
|
2965
|
+
noDataTextContainer,
|
|
2966
|
+
tableBottomContainer,
|
|
2967
|
+
rowsPerPageContainer,
|
|
2968
|
+
rowsPerPageText
|
|
2969
|
+
};
|
|
2970
|
+
const _Table = React.forwardRef(function Table2(props, ref) {
|
|
2971
|
+
const {
|
|
2972
|
+
columns,
|
|
2973
|
+
data,
|
|
2974
|
+
color = "light",
|
|
2975
|
+
title = "",
|
|
2976
|
+
description = "",
|
|
2977
|
+
rowsPerPage = [10, 20, 30, 40, 50],
|
|
2978
|
+
showSearchBar,
|
|
2979
|
+
searchBarPlaceholder,
|
|
2980
|
+
showSelect,
|
|
2981
|
+
showFilterButton,
|
|
2982
|
+
showContainer,
|
|
2983
|
+
showRowsPerPage,
|
|
2984
|
+
showPageNumber,
|
|
2985
|
+
showPageNavigation,
|
|
2986
|
+
showTopBar = true,
|
|
2987
|
+
showBottomBar = true,
|
|
2988
|
+
emptyMessage = "There is no data",
|
|
2989
|
+
children,
|
|
2990
|
+
className,
|
|
2991
|
+
columnClassName,
|
|
2992
|
+
rowClassName,
|
|
2993
|
+
cellClassName
|
|
2994
|
+
} = props;
|
|
2995
|
+
const [search, setSearch] = React.useState("");
|
|
2996
|
+
const [selected, setSelected] = React.useState([]);
|
|
2997
|
+
const rowsColumnsHaveAllColumns = data.every(
|
|
2998
|
+
(row) => Object.keys(row.columns).length === columns.length && Object.values(columns).every((column) => Object.keys(row.columns).includes(column.id.toString()))
|
|
2999
|
+
);
|
|
3000
|
+
if (!rowsColumnsHaveAllColumns) {
|
|
3001
|
+
throw new Error("Columns in rows do not match ones declared in columns variable.");
|
|
3002
|
+
}
|
|
3003
|
+
const defaultColumnFilterValues = React.useMemo(
|
|
3004
|
+
() => columns.filter((column) => column.filter).map((column) => ({ [column.id]: [] })).reduce((arr, column) => Object.assign(arr, column), {}),
|
|
3005
|
+
[columns]
|
|
3006
|
+
);
|
|
3007
|
+
const [columnFilterValues, setColumnFilterValues] = React.useState(defaultColumnFilterValues);
|
|
3008
|
+
const [numRowsPerPage, setNumRowsPerPage] = React.useState(rowsPerPage[0] ?? 10);
|
|
3009
|
+
const rowsPerPageOptions = React.useMemo(
|
|
3010
|
+
() => rowsPerPage.map((numRows) => ({
|
|
3011
|
+
value: numRows.toString(),
|
|
3012
|
+
itemContent: numRows.toString()
|
|
3013
|
+
})),
|
|
3014
|
+
[rowsPerPage]
|
|
3015
|
+
);
|
|
3016
|
+
const rowsHaveOnClick = data.some((row) => row.onClick);
|
|
3017
|
+
const searchFilter = React.useCallback(
|
|
3018
|
+
(cell) => {
|
|
3019
|
+
var _a, _b;
|
|
3020
|
+
const cellVal = ((_a = cell.searchValue) == null ? void 0 : _a.toString()) || ((_b = cell.value) == null ? void 0 : _b.toString()) || "";
|
|
3021
|
+
return cellVal.toLowerCase().includes(search.toLowerCase());
|
|
3022
|
+
},
|
|
3023
|
+
[search]
|
|
3024
|
+
);
|
|
3025
|
+
const sortFilter = React.useCallback((a, b) => {
|
|
3026
|
+
var _a, _b, _c, _d;
|
|
3027
|
+
const aVal = ((_a = a.sortValue) == null ? void 0 : _a.toString()) || ((_b = a.value) == null ? void 0 : _b.toString()) || "";
|
|
3028
|
+
const bVal = ((_c = b.sortValue) == null ? void 0 : _c.toString()) || ((_d = b.value) == null ? void 0 : _d.toString()) || "";
|
|
3029
|
+
return aVal.toLowerCase().localeCompare(bVal.toLowerCase(), void 0, { numeric: true });
|
|
3030
|
+
}, []);
|
|
3031
|
+
const columnFilter = React.useCallback(
|
|
3032
|
+
(cell, column) => {
|
|
3033
|
+
var _a, _b, _c;
|
|
3034
|
+
const cellVal = ((_a = cell.filterValue) == null ? void 0 : _a.toString()) || ((_b = cell.value) == null ? void 0 : _b.toString()) || "";
|
|
3035
|
+
return (_c = columnFilterValues[column.id]) == null ? void 0 : _c.some(
|
|
3036
|
+
(filter) => cellVal.toString().toLowerCase() === filter.toString().toLowerCase()
|
|
3037
|
+
);
|
|
3038
|
+
},
|
|
3039
|
+
[columnFilterValues]
|
|
3040
|
+
);
|
|
3041
|
+
const columnsData = React.useMemo(
|
|
3042
|
+
() => columns.map((column) => ({
|
|
3043
|
+
...column,
|
|
3044
|
+
sort: column.sort ? { sortKey: column.id.toString().toUpperCase() } : false
|
|
3045
|
+
})),
|
|
3046
|
+
[columns]
|
|
3047
|
+
);
|
|
3048
|
+
const isColumnFilterValueSelected = columns.some(
|
|
3049
|
+
(column) => {
|
|
3050
|
+
var _a;
|
|
3051
|
+
return column.filter && column.id in columnFilterValues && ((_a = columnFilterValues[column.id]) == null ? void 0 : _a.length) !== 0;
|
|
3052
|
+
}
|
|
3053
|
+
);
|
|
3054
|
+
const rows = React.useMemo(
|
|
3055
|
+
() => data.filter(
|
|
3056
|
+
(row) => !search || columns.some((column) => column.search && searchFilter(row.columns[column.id]))
|
|
3057
|
+
).filter(
|
|
3058
|
+
(row) => (
|
|
3059
|
+
// If no column filter is selected, then return true AKA: show all rows
|
|
3060
|
+
!isColumnFilterValueSelected || // Check if any of the table values match the selected column filters. First return true if that
|
|
3061
|
+
// column is not selected for filtering (has a filter prop). Second, return true if that column
|
|
3062
|
+
// has any values in it selected for filtering, lastly, return if row has that filter value
|
|
3063
|
+
columns.every((column) => {
|
|
3064
|
+
var _a;
|
|
3065
|
+
return !column.filter || ((_a = columnFilterValues[column.id]) == null ? void 0 : _a.length) === 0 || columnFilter(row.columns[column.id], column);
|
|
3066
|
+
})
|
|
3067
|
+
)
|
|
3068
|
+
).map((row) => {
|
|
3069
|
+
const destructedRow = { ...row.columns, ...row };
|
|
3070
|
+
const { columns: _, ...newRow } = destructedRow;
|
|
3071
|
+
return newRow;
|
|
3072
|
+
}),
|
|
3073
|
+
[columnFilter, columnFilterValues, columns, data, isColumnFilterValueSelected, search, searchFilter]
|
|
3074
|
+
);
|
|
3075
|
+
const [totalPages, setTotalPages] = React.useState(Math.ceil(rows.length / numRowsPerPage));
|
|
3076
|
+
const getFilterValues = React.useCallback(
|
|
3077
|
+
(column) => {
|
|
3078
|
+
if (column.filterValues) {
|
|
3079
|
+
return column.filterValues;
|
|
3080
|
+
}
|
|
3081
|
+
const uniqueFilterValues = new Set(
|
|
3082
|
+
data.map(
|
|
3083
|
+
(row) => {
|
|
3084
|
+
var _a, _b;
|
|
3085
|
+
return ((_a = row.columns[column.id].filterValue) == null ? void 0 : _a.toString()) || ((_b = row.columns[column.id].value) == null ? void 0 : _b.toString()) || "";
|
|
3086
|
+
}
|
|
3087
|
+
)
|
|
3088
|
+
);
|
|
3089
|
+
return [...uniqueFilterValues].sort().map((rowVal) => ({
|
|
3090
|
+
value: rowVal,
|
|
3091
|
+
label: rowVal
|
|
3092
|
+
}));
|
|
3093
|
+
},
|
|
3094
|
+
[data]
|
|
3095
|
+
);
|
|
3096
|
+
const gridTemplateColumns = React.useMemo(
|
|
3097
|
+
() => (showSelect ? "auto " : "") + columnsData.reduce((accum, column) => accum + `${column.width || "auto"} `, ""),
|
|
3098
|
+
[columnsData, showSelect]
|
|
3099
|
+
);
|
|
3100
|
+
const handleSearch = React.useCallback((e) => {
|
|
3101
|
+
setSearch(e.target.value);
|
|
3102
|
+
}, []);
|
|
3103
|
+
const tableData = { nodes: rows };
|
|
3104
|
+
const tableSelect = select.useRowSelect(
|
|
3105
|
+
tableData,
|
|
3106
|
+
{
|
|
3107
|
+
onChange: (_action, state) => {
|
|
3108
|
+
setSelected(state.ids);
|
|
3109
|
+
}
|
|
3110
|
+
},
|
|
3111
|
+
{
|
|
3112
|
+
rowSelect: select.SelectTypes.MultiSelect,
|
|
3113
|
+
buttonSelect: select.SelectTypes.MultiSelect,
|
|
3114
|
+
clickType: select.SelectClickTypes.ButtonClick,
|
|
3115
|
+
isCarryForward: false
|
|
3116
|
+
}
|
|
3117
|
+
);
|
|
3118
|
+
const pagination$1 = pagination.usePagination(
|
|
3119
|
+
tableData,
|
|
3120
|
+
{
|
|
3121
|
+
state: {
|
|
3122
|
+
page: 0,
|
|
3123
|
+
size: rowsPerPage[0]
|
|
3124
|
+
}
|
|
3125
|
+
},
|
|
3126
|
+
{
|
|
3127
|
+
isServer: false
|
|
3128
|
+
}
|
|
3129
|
+
);
|
|
3130
|
+
const sort$1 = sort.useSort(
|
|
3131
|
+
tableData,
|
|
3132
|
+
{ onChange: () => null },
|
|
3133
|
+
{
|
|
3134
|
+
sortIcon: {
|
|
3135
|
+
margin: "10px",
|
|
3136
|
+
size: "15px",
|
|
3137
|
+
iconDefault: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CaretSortIcon, { width: "20px" }),
|
|
3138
|
+
iconUp: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ArrowUpIcon, {}),
|
|
3139
|
+
iconDown: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ArrowDownIcon, {})
|
|
3140
|
+
},
|
|
3141
|
+
sortFns: Object.assign(
|
|
3142
|
+
{},
|
|
3143
|
+
...columnsData.map((column) => ({
|
|
3144
|
+
[column.id.toString().toUpperCase()]: (array) => array.sort((a, b) => sortFilter(a[column.id], b[column.id]))
|
|
3145
|
+
}))
|
|
3146
|
+
)
|
|
3147
|
+
}
|
|
3148
|
+
);
|
|
3149
|
+
const columnFilterPopoverContent = React.useMemo(
|
|
3150
|
+
() => ({
|
|
3151
|
+
options: columns.filter((column) => column.filter).map((column) => ({
|
|
3152
|
+
label: column.label,
|
|
3153
|
+
value: column.id.toString(),
|
|
3154
|
+
page: {
|
|
3155
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3156
|
+
SelectAllCheckbox,
|
|
3157
|
+
{
|
|
3158
|
+
label: "Select all",
|
|
3159
|
+
onCheckedChange: (checked) => {
|
|
3160
|
+
const _columnFilterValues = JSON.parse(JSON.stringify(columnFilterValues));
|
|
3161
|
+
if (checked === true) {
|
|
3162
|
+
_columnFilterValues[column.id] = getFilterValues(column).map(
|
|
3163
|
+
(filterValue) => filterValue.value
|
|
3164
|
+
);
|
|
3165
|
+
} else {
|
|
3166
|
+
_columnFilterValues[column.id] = [];
|
|
3167
|
+
}
|
|
3168
|
+
setColumnFilterValues(_columnFilterValues);
|
|
3169
|
+
},
|
|
3170
|
+
children: getFilterValues(column).map((filterValue, i) => {
|
|
3171
|
+
var _a, _b;
|
|
3172
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3173
|
+
Checkbox,
|
|
3174
|
+
{
|
|
3175
|
+
label: filterValue.label,
|
|
3176
|
+
checked: (_b = columnFilterValues[column.id]) == null ? void 0 : _b.includes(
|
|
3177
|
+
((_a = filterValue.value) == null ? void 0 : _a.toString()) || ""
|
|
3178
|
+
),
|
|
3179
|
+
onCheckedChange: (checked) => {
|
|
3180
|
+
setColumnFilterValues((prevColumnFilterValues) => {
|
|
3181
|
+
var _a2;
|
|
3182
|
+
const _columnFilterValues = { ...prevColumnFilterValues };
|
|
3183
|
+
const values = _columnFilterValues[column.id] || [];
|
|
3184
|
+
if (checked) {
|
|
3185
|
+
_columnFilterValues[column.id] = [
|
|
3186
|
+
...values,
|
|
3187
|
+
((_a2 = filterValue.value) == null ? void 0 : _a2.toString()) || ""
|
|
3188
|
+
];
|
|
3189
|
+
} else {
|
|
3190
|
+
_columnFilterValues[column.id] = values.filter(
|
|
3191
|
+
(fValue) => fValue !== (filterValue.value ?? "").toString()
|
|
3192
|
+
);
|
|
3193
|
+
}
|
|
3194
|
+
return _columnFilterValues;
|
|
3195
|
+
});
|
|
3196
|
+
}
|
|
3197
|
+
},
|
|
3198
|
+
`checkbox-filter-${column.id}-${i}`
|
|
3199
|
+
);
|
|
3200
|
+
})
|
|
3201
|
+
},
|
|
3202
|
+
`select-all-checkbox-${column.id}`
|
|
3203
|
+
)
|
|
3204
|
+
}
|
|
3205
|
+
}))
|
|
3206
|
+
}),
|
|
3207
|
+
[columnFilterValues, columns, getFilterValues]
|
|
3208
|
+
);
|
|
3209
|
+
const columnCells = columnsData.map((column) => {
|
|
3210
|
+
const Component = column.sort ? sort.HeaderCellSort : table$1.HeaderCell;
|
|
3211
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3212
|
+
Component,
|
|
3213
|
+
{
|
|
3214
|
+
className: classNames(styles$1.tableHeaderCell, columnClassName, column.className),
|
|
3215
|
+
sortKey: column.sort ? column.id.toString().toUpperCase() : "",
|
|
3216
|
+
children: column.label
|
|
3217
|
+
},
|
|
3218
|
+
column.id
|
|
3219
|
+
);
|
|
3220
|
+
});
|
|
3221
|
+
const SelectedModeButton = reactDeviceDetect.isMobile ? IconButton : Button2;
|
|
3222
|
+
const layout = React.useMemo(() => ({ custom: true }), []);
|
|
3223
|
+
const theme$1 = theme.useTheme({
|
|
3224
|
+
Table: `
|
|
3225
|
+
--data-table-library_grid-template-columns: ${gridTemplateColumns};
|
|
3226
|
+
`,
|
|
3227
|
+
Row: `
|
|
8
3228
|
&:hover {
|
|
9
|
-
cursor: ${
|
|
3229
|
+
cursor: ${rowsHaveOnClick ? "pointer" : "inherit"};
|
|
10
3230
|
}
|
|
11
3231
|
&.row-select-selected {
|
|
12
3232
|
background-color: var(--gray-a4);
|
|
@@ -14,6 +3234,525 @@
|
|
|
14
3234
|
&:not(:last-of-type) .td {
|
|
15
3235
|
border-bottom: 1px solid var(--gray-a4);
|
|
16
3236
|
}
|
|
17
|
-
`,
|
|
3237
|
+
`,
|
|
3238
|
+
BaseRow: `
|
|
18
3239
|
background-color: inherit;
|
|
19
|
-
`
|
|
3240
|
+
`
|
|
3241
|
+
});
|
|
3242
|
+
React.useEffect(() => {
|
|
3243
|
+
if (showPageNavigation) {
|
|
3244
|
+
const numTotalPages = Math.ceil(rows.length / numRowsPerPage);
|
|
3245
|
+
setTotalPages(numTotalPages);
|
|
3246
|
+
if (pagination$1.state.page < 0) {
|
|
3247
|
+
pagination$1.fns.onSetPage(0);
|
|
3248
|
+
}
|
|
3249
|
+
if (pagination$1.state.page > numTotalPages - 1) {
|
|
3250
|
+
pagination$1.fns.onSetPage(numTotalPages - 1);
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
}, [rowsPerPage, rows.length, numRowsPerPage, pagination$1, showPageNavigation]);
|
|
3254
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classNames({ [styles$1.tableContainer]: showContainer }), children: [
|
|
3255
|
+
(!!title || !!description) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles$1.headerContainer, children: [
|
|
3256
|
+
!!title && /* @__PURE__ */ jsxRuntime.jsx(Text$1, { weight: "bold", size: "7", children: title }),
|
|
3257
|
+
!!description && /* @__PURE__ */ jsxRuntime.jsx(Text$1, { as: "div", children: description })
|
|
3258
|
+
] }),
|
|
3259
|
+
showTopBar && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { justify: "between", className: styles$1.tableTopContainer, children: [
|
|
3260
|
+
/* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { gap: "2", children: [
|
|
3261
|
+
showSearchBar && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.searchContainer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3262
|
+
Input,
|
|
3263
|
+
{
|
|
3264
|
+
value: search,
|
|
3265
|
+
onChange: handleSearch,
|
|
3266
|
+
leftSlot: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.MagnifyingGlassIcon, {}),
|
|
3267
|
+
placeholder: searchBarPlaceholder || "Filter tasks..."
|
|
3268
|
+
}
|
|
3269
|
+
) }),
|
|
3270
|
+
showFilterButton && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3271
|
+
MultiPagePopover,
|
|
3272
|
+
{
|
|
3273
|
+
color,
|
|
3274
|
+
page: columnFilterPopoverContent,
|
|
3275
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { variant: "surface", "aria-label": "Filter columns", children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.MixerHorizontalIcon, {}) }),
|
|
3276
|
+
children: (_Close) => ""
|
|
3277
|
+
}
|
|
3278
|
+
),
|
|
3279
|
+
showFilterButton && isColumnFilterValueSelected && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3280
|
+
Button2,
|
|
3281
|
+
{
|
|
3282
|
+
variant: "surface",
|
|
3283
|
+
color: "crimson",
|
|
3284
|
+
onClick: () => {
|
|
3285
|
+
setColumnFilterValues(defaultColumnFilterValues);
|
|
3286
|
+
pagination$1.fns.onSetPage(0);
|
|
3287
|
+
},
|
|
3288
|
+
children: [
|
|
3289
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.Cross2Icon, {}),
|
|
3290
|
+
"Clear filters"
|
|
3291
|
+
]
|
|
3292
|
+
}
|
|
3293
|
+
)
|
|
3294
|
+
] }),
|
|
3295
|
+
showSelect && selected.length !== 0 && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { gap: "2", children: [
|
|
3296
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SelectedModeButton, { variant: "soft", "aria-label": "Edit rows", children: [
|
|
3297
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.Pencil1Icon, {}),
|
|
3298
|
+
!reactDeviceDetect.isMobile && "Edit"
|
|
3299
|
+
] }),
|
|
3300
|
+
/* @__PURE__ */ jsxRuntime.jsxs(SelectedModeButton, { color: "red", "aria-label": "Delete rows", children: [
|
|
3301
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactIcons.TrashIcon, {}),
|
|
3302
|
+
!reactDeviceDetect.isMobile && "Delete"
|
|
3303
|
+
] })
|
|
3304
|
+
] })
|
|
3305
|
+
] }),
|
|
3306
|
+
children,
|
|
3307
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3308
|
+
table$1.Table,
|
|
3309
|
+
{
|
|
3310
|
+
className: classNames(styles$1.table, className),
|
|
3311
|
+
data: tableData,
|
|
3312
|
+
theme: theme$1,
|
|
3313
|
+
sort: sort$1,
|
|
3314
|
+
pagination: showPageNavigation && pagination$1,
|
|
3315
|
+
select: tableSelect,
|
|
3316
|
+
layout,
|
|
3317
|
+
ref,
|
|
3318
|
+
children: (tableList) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3319
|
+
/* @__PURE__ */ jsxRuntime.jsx(table$1.Header, { children: /* @__PURE__ */ jsxRuntime.jsxs(table$1.HeaderRow, { children: [
|
|
3320
|
+
showSelect && /* @__PURE__ */ jsxRuntime.jsx(select.HeaderCellSelect, { className: styles$1.tableHeaderCell }),
|
|
3321
|
+
...columnCells
|
|
3322
|
+
] }) }),
|
|
3323
|
+
/* @__PURE__ */ jsxRuntime.jsxs(table$1.Body, { children: [
|
|
3324
|
+
tableList.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(themes.TableRow, { className: styles$1.noDataTextContainer, children: /* @__PURE__ */ jsxRuntime.jsx(table$1.Cell, { children: emptyMessage }) }),
|
|
3325
|
+
tableList.map((row) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3326
|
+
table$1.Row,
|
|
3327
|
+
{
|
|
3328
|
+
item: row,
|
|
3329
|
+
className: classNames(styles$1.tableRow, rowClassName, row.className),
|
|
3330
|
+
onClick: row.onClick,
|
|
3331
|
+
children: [
|
|
3332
|
+
showSelect && /* @__PURE__ */ jsxRuntime.jsx(select.CellSelect, { item: row }, row.id),
|
|
3333
|
+
columns.map((column, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3334
|
+
table$1.Cell,
|
|
3335
|
+
{
|
|
3336
|
+
className: classNames(
|
|
3337
|
+
styles$1.tableCell,
|
|
3338
|
+
cellClassName,
|
|
3339
|
+
row[column.id].className
|
|
3340
|
+
),
|
|
3341
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Text$1, { children: row[column.id].label })
|
|
3342
|
+
},
|
|
3343
|
+
i
|
|
3344
|
+
))
|
|
3345
|
+
]
|
|
3346
|
+
},
|
|
3347
|
+
row.id
|
|
3348
|
+
))
|
|
3349
|
+
] })
|
|
3350
|
+
] })
|
|
3351
|
+
}
|
|
3352
|
+
),
|
|
3353
|
+
showBottomBar && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.tableBottomContainer, wrap: "wrap", direction: reactDeviceDetect.isMobile ? "column" : "row", children: [
|
|
3354
|
+
showRowsPerPage && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.rowsPerPageContainer, children: [
|
|
3355
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles$1.rowsPerPageText, children: "Rows per page:" }),
|
|
3356
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3357
|
+
Select,
|
|
3358
|
+
{
|
|
3359
|
+
items: rowsPerPageOptions,
|
|
3360
|
+
defaultValue: rowsPerPageOptions[0].value.toString(),
|
|
3361
|
+
onValueChange: (v) => {
|
|
3362
|
+
pagination$1.fns.onSetSize(Number(v));
|
|
3363
|
+
setNumRowsPerPage(Number(v));
|
|
3364
|
+
},
|
|
3365
|
+
placeholder: rowsPerPageOptions[0].itemContent,
|
|
3366
|
+
"aria-label": "Select number of rows per page"
|
|
3367
|
+
}
|
|
3368
|
+
)
|
|
3369
|
+
] }),
|
|
3370
|
+
showPageNumber && /* @__PURE__ */ jsxRuntime.jsx(themes.Flex, { justify: "center", children: totalPages > 0 && `Page ${pagination$1.state.page + 1} of ${totalPages}` }),
|
|
3371
|
+
showPageNavigation && /* @__PURE__ */ jsxRuntime.jsxs(themes.Flex, { className: styles$1.rowsPerPageContainer, gap: "2", justify: "end", children: [
|
|
3372
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3373
|
+
IconButton,
|
|
3374
|
+
{
|
|
3375
|
+
variant: "surface",
|
|
3376
|
+
onClick: () => pagination$1.fns.onSetPage(0),
|
|
3377
|
+
disabled: pagination$1.state.page === 0 || totalPages === 0,
|
|
3378
|
+
"aria-label": "Go to first page",
|
|
3379
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DoubleArrowLeftIcon, {})
|
|
3380
|
+
}
|
|
3381
|
+
),
|
|
3382
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3383
|
+
IconButton,
|
|
3384
|
+
{
|
|
3385
|
+
variant: "surface",
|
|
3386
|
+
disabled: pagination$1.state.page === 0 || totalPages === 0,
|
|
3387
|
+
onClick: () => pagination$1.fns.onSetPage(pagination$1.state.page - 1),
|
|
3388
|
+
"aria-label": "Previous page",
|
|
3389
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronLeftIcon, {})
|
|
3390
|
+
}
|
|
3391
|
+
),
|
|
3392
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3393
|
+
IconButton,
|
|
3394
|
+
{
|
|
3395
|
+
variant: "surface",
|
|
3396
|
+
disabled: pagination$1.state.page + 1 === totalPages || totalPages === 0,
|
|
3397
|
+
onClick: () => pagination$1.fns.onSetPage(pagination$1.state.page + 1),
|
|
3398
|
+
"aria-label": "Next page",
|
|
3399
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.ChevronRightIcon, {})
|
|
3400
|
+
}
|
|
3401
|
+
),
|
|
3402
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3403
|
+
IconButton,
|
|
3404
|
+
{
|
|
3405
|
+
variant: "surface",
|
|
3406
|
+
disabled: pagination$1.state.page + 1 === totalPages || totalPages === 0,
|
|
3407
|
+
onClick: () => pagination$1.fns.onSetPage(totalPages - 1),
|
|
3408
|
+
"aria-label": "Go to last page",
|
|
3409
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.DoubleArrowRightIcon, {})
|
|
3410
|
+
}
|
|
3411
|
+
)
|
|
3412
|
+
] })
|
|
3413
|
+
] })
|
|
3414
|
+
] });
|
|
3415
|
+
});
|
|
3416
|
+
const Table = React.memo(_Table);
|
|
3417
|
+
const editableTextContainer = "_editableTextContainer_174g6_1";
|
|
3418
|
+
const editableTextText = "_editableTextText_174g6_5";
|
|
3419
|
+
const editableTextInput = "_editableTextInput_174g6_19";
|
|
3420
|
+
const iconHidden = "_iconHidden_174g6_23";
|
|
3421
|
+
const styles = {
|
|
3422
|
+
editableTextContainer,
|
|
3423
|
+
editableTextText,
|
|
3424
|
+
editableTextInput,
|
|
3425
|
+
iconHidden
|
|
3426
|
+
};
|
|
3427
|
+
const _ConfirmEditInput = React.forwardRef(function ConfirmEditInput2({
|
|
3428
|
+
value,
|
|
3429
|
+
onChange,
|
|
3430
|
+
onEditActivate,
|
|
3431
|
+
onEditConfirm,
|
|
3432
|
+
onEditCancel,
|
|
3433
|
+
textClassName,
|
|
3434
|
+
inputClassName,
|
|
3435
|
+
iconClassName,
|
|
3436
|
+
buttonVariant,
|
|
3437
|
+
variant,
|
|
3438
|
+
severity,
|
|
3439
|
+
size,
|
|
3440
|
+
mode = "buttons",
|
|
3441
|
+
...rest
|
|
3442
|
+
}, ref) {
|
|
3443
|
+
const [text, setText] = React.useState(value == null ? void 0 : value.toString());
|
|
3444
|
+
const [input, setInput] = React.useState(value == null ? void 0 : value.toString());
|
|
3445
|
+
const [isEditMode, setIsEditMode] = React.useState(false);
|
|
3446
|
+
const isConfirmDisabled = !input || text === input;
|
|
3447
|
+
const onInputChange = React.useCallback(
|
|
3448
|
+
(e) => {
|
|
3449
|
+
var _a;
|
|
3450
|
+
setInput((_a = e.target.value) == null ? void 0 : _a.toString());
|
|
3451
|
+
if (onChange) {
|
|
3452
|
+
onChange(e);
|
|
3453
|
+
}
|
|
3454
|
+
},
|
|
3455
|
+
[onChange]
|
|
3456
|
+
);
|
|
3457
|
+
const onPencilClick = React.useCallback(() => {
|
|
3458
|
+
setIsEditMode(true);
|
|
3459
|
+
if (onEditActivate) {
|
|
3460
|
+
onEditActivate(text);
|
|
3461
|
+
}
|
|
3462
|
+
}, [onEditActivate, text]);
|
|
3463
|
+
const onCheckClick = React.useCallback(() => {
|
|
3464
|
+
setText(input);
|
|
3465
|
+
setIsEditMode(false);
|
|
3466
|
+
if (onEditConfirm) {
|
|
3467
|
+
onEditConfirm(input);
|
|
3468
|
+
}
|
|
3469
|
+
}, [onEditConfirm, input]);
|
|
3470
|
+
const onCancelClick = React.useCallback(() => {
|
|
3471
|
+
setIsEditMode(false);
|
|
3472
|
+
const prevInput = input;
|
|
3473
|
+
setInput(text);
|
|
3474
|
+
if (onEditCancel) {
|
|
3475
|
+
onEditCancel(prevInput);
|
|
3476
|
+
}
|
|
3477
|
+
}, [text, input, onEditCancel]);
|
|
3478
|
+
const handleKeyDown = React.useCallback(
|
|
3479
|
+
(e) => {
|
|
3480
|
+
if (mode !== "keys") {
|
|
3481
|
+
return;
|
|
3482
|
+
}
|
|
3483
|
+
switch (e.key) {
|
|
3484
|
+
case "Enter":
|
|
3485
|
+
if (!isConfirmDisabled)
|
|
3486
|
+
onCheckClick();
|
|
3487
|
+
break;
|
|
3488
|
+
case "Escape":
|
|
3489
|
+
onCancelClick();
|
|
3490
|
+
break;
|
|
3491
|
+
}
|
|
3492
|
+
},
|
|
3493
|
+
[onCheckClick, onCancelClick, isConfirmDisabled, mode]
|
|
3494
|
+
);
|
|
3495
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HoverUtility, { children: ({ isHovered, ...props }) => /* @__PURE__ */ jsxRuntime.jsxs(Flex, { className: styles.editableTextContainer, gap: "3", ...props, children: [
|
|
3496
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3497
|
+
Input,
|
|
3498
|
+
{
|
|
3499
|
+
className: classNames(
|
|
3500
|
+
isEditMode ? styles.editableTextInput : styles.editableTextText,
|
|
3501
|
+
isEditMode ? inputClassName : textClassName
|
|
3502
|
+
),
|
|
3503
|
+
onClick: () => !isEditMode && mode === "keys" && onPencilClick(),
|
|
3504
|
+
value: isEditMode ? input : text,
|
|
3505
|
+
onChange: onInputChange,
|
|
3506
|
+
ref,
|
|
3507
|
+
onKeyDown: handleKeyDown,
|
|
3508
|
+
autoFocus: true,
|
|
3509
|
+
size,
|
|
3510
|
+
variant,
|
|
3511
|
+
severity,
|
|
3512
|
+
readOnly: !isEditMode,
|
|
3513
|
+
style: isEditMode ? void 0 : {
|
|
3514
|
+
cursor: mode === "keys" ? "text" : "unset"
|
|
3515
|
+
},
|
|
3516
|
+
...rest
|
|
3517
|
+
}
|
|
3518
|
+
),
|
|
3519
|
+
mode === "buttons" && (isEditMode ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3520
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3521
|
+
IconButton,
|
|
3522
|
+
{
|
|
3523
|
+
className: classNames(iconClassName, styles.icon, !isHovered && styles.iconHidden),
|
|
3524
|
+
size,
|
|
3525
|
+
variant: buttonVariant,
|
|
3526
|
+
severity,
|
|
3527
|
+
disabled: isConfirmDisabled,
|
|
3528
|
+
onClick: onCheckClick,
|
|
3529
|
+
"aria-label": "Confirm edit",
|
|
3530
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, {})
|
|
3531
|
+
}
|
|
3532
|
+
),
|
|
3533
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3534
|
+
IconButton,
|
|
3535
|
+
{
|
|
3536
|
+
className: classNames(iconClassName, styles.icon, !isHovered && styles.iconHidden),
|
|
3537
|
+
color: "red",
|
|
3538
|
+
size,
|
|
3539
|
+
variant: buttonVariant,
|
|
3540
|
+
severity,
|
|
3541
|
+
onClick: onCancelClick,
|
|
3542
|
+
"aria-label": "Cancel edit",
|
|
3543
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.Cross1Icon, {})
|
|
3544
|
+
}
|
|
3545
|
+
)
|
|
3546
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
3547
|
+
IconButton,
|
|
3548
|
+
{
|
|
3549
|
+
className: classNames(
|
|
3550
|
+
iconClassName,
|
|
3551
|
+
styles.editIcon,
|
|
3552
|
+
styles.icon,
|
|
3553
|
+
!isHovered && styles.iconHidden
|
|
3554
|
+
),
|
|
3555
|
+
size,
|
|
3556
|
+
variant: buttonVariant,
|
|
3557
|
+
severity,
|
|
3558
|
+
onClick: onPencilClick,
|
|
3559
|
+
"aria-label": "Edit text",
|
|
3560
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactIcons.Pencil1Icon, {})
|
|
3561
|
+
}
|
|
3562
|
+
))
|
|
3563
|
+
] }) });
|
|
3564
|
+
});
|
|
3565
|
+
const ConfirmEditInput = React.memo(_ConfirmEditInput);
|
|
3566
|
+
Object.defineProperty(exports2, "AccessibleIcon", {
|
|
3567
|
+
enumerable: true,
|
|
3568
|
+
get: () => themes.AccessibleIcon
|
|
3569
|
+
});
|
|
3570
|
+
Object.defineProperty(exports2, "AspectRatio", {
|
|
3571
|
+
enumerable: true,
|
|
3572
|
+
get: () => themes.AspectRatio
|
|
3573
|
+
});
|
|
3574
|
+
Object.defineProperty(exports2, "Avatar", {
|
|
3575
|
+
enumerable: true,
|
|
3576
|
+
get: () => themes.Avatar
|
|
3577
|
+
});
|
|
3578
|
+
Object.defineProperty(exports2, "Blockquote", {
|
|
3579
|
+
enumerable: true,
|
|
3580
|
+
get: () => themes.Blockquote
|
|
3581
|
+
});
|
|
3582
|
+
Object.defineProperty(exports2, "Box", {
|
|
3583
|
+
enumerable: true,
|
|
3584
|
+
get: () => themes.Box
|
|
3585
|
+
});
|
|
3586
|
+
Object.defineProperty(exports2, "Callout", {
|
|
3587
|
+
enumerable: true,
|
|
3588
|
+
get: () => themes.Callout
|
|
3589
|
+
});
|
|
3590
|
+
Object.defineProperty(exports2, "Card", {
|
|
3591
|
+
enumerable: true,
|
|
3592
|
+
get: () => themes.Card
|
|
3593
|
+
});
|
|
3594
|
+
Object.defineProperty(exports2, "Code", {
|
|
3595
|
+
enumerable: true,
|
|
3596
|
+
get: () => themes.Code
|
|
3597
|
+
});
|
|
3598
|
+
Object.defineProperty(exports2, "Container", {
|
|
3599
|
+
enumerable: true,
|
|
3600
|
+
get: () => themes.Container
|
|
3601
|
+
});
|
|
3602
|
+
Object.defineProperty(exports2, "Em", {
|
|
3603
|
+
enumerable: true,
|
|
3604
|
+
get: () => themes.Em
|
|
3605
|
+
});
|
|
3606
|
+
Object.defineProperty(exports2, "Grid", {
|
|
3607
|
+
enumerable: true,
|
|
3608
|
+
get: () => themes.Grid
|
|
3609
|
+
});
|
|
3610
|
+
Object.defineProperty(exports2, "Heading", {
|
|
3611
|
+
enumerable: true,
|
|
3612
|
+
get: () => themes.Heading
|
|
3613
|
+
});
|
|
3614
|
+
Object.defineProperty(exports2, "HoverCard", {
|
|
3615
|
+
enumerable: true,
|
|
3616
|
+
get: () => themes.HoverCard
|
|
3617
|
+
});
|
|
3618
|
+
Object.defineProperty(exports2, "Inset", {
|
|
3619
|
+
enumerable: true,
|
|
3620
|
+
get: () => themes.Inset
|
|
3621
|
+
});
|
|
3622
|
+
Object.defineProperty(exports2, "Kbd", {
|
|
3623
|
+
enumerable: true,
|
|
3624
|
+
get: () => themes.Kbd
|
|
3625
|
+
});
|
|
3626
|
+
Object.defineProperty(exports2, "Link", {
|
|
3627
|
+
enumerable: true,
|
|
3628
|
+
get: () => themes.Link
|
|
3629
|
+
});
|
|
3630
|
+
Object.defineProperty(exports2, "Portal", {
|
|
3631
|
+
enumerable: true,
|
|
3632
|
+
get: () => themes.Portal
|
|
3633
|
+
});
|
|
3634
|
+
Object.defineProperty(exports2, "Quote", {
|
|
3635
|
+
enumerable: true,
|
|
3636
|
+
get: () => themes.Quote
|
|
3637
|
+
});
|
|
3638
|
+
Object.defineProperty(exports2, "RadioGroup", {
|
|
3639
|
+
enumerable: true,
|
|
3640
|
+
get: () => themes.RadioGroup
|
|
3641
|
+
});
|
|
3642
|
+
Object.defineProperty(exports2, "ScrollArea", {
|
|
3643
|
+
enumerable: true,
|
|
3644
|
+
get: () => themes.ScrollArea
|
|
3645
|
+
});
|
|
3646
|
+
Object.defineProperty(exports2, "Section", {
|
|
3647
|
+
enumerable: true,
|
|
3648
|
+
get: () => themes.Section
|
|
3649
|
+
});
|
|
3650
|
+
Object.defineProperty(exports2, "Slider", {
|
|
3651
|
+
enumerable: true,
|
|
3652
|
+
get: () => themes.Slider
|
|
3653
|
+
});
|
|
3654
|
+
Object.defineProperty(exports2, "Slot", {
|
|
3655
|
+
enumerable: true,
|
|
3656
|
+
get: () => themes.Slot
|
|
3657
|
+
});
|
|
3658
|
+
Object.defineProperty(exports2, "Strong", {
|
|
3659
|
+
enumerable: true,
|
|
3660
|
+
get: () => themes.Strong
|
|
3661
|
+
});
|
|
3662
|
+
Object.defineProperty(exports2, "Tabs", {
|
|
3663
|
+
enumerable: true,
|
|
3664
|
+
get: () => themes.Tabs
|
|
3665
|
+
});
|
|
3666
|
+
Object.defineProperty(exports2, "TextField", {
|
|
3667
|
+
enumerable: true,
|
|
3668
|
+
get: () => themes.TextField
|
|
3669
|
+
});
|
|
3670
|
+
Object.defineProperty(exports2, "Theme", {
|
|
3671
|
+
enumerable: true,
|
|
3672
|
+
get: () => themes.Theme
|
|
3673
|
+
});
|
|
3674
|
+
Object.defineProperty(exports2, "VisuallyHidden", {
|
|
3675
|
+
enumerable: true,
|
|
3676
|
+
get: () => themes.VisuallyHidden
|
|
3677
|
+
});
|
|
3678
|
+
Object.defineProperty(exports2, "updateThemeAppearanceClass", {
|
|
3679
|
+
enumerable: true,
|
|
3680
|
+
get: () => themes.updateThemeAppearanceClass
|
|
3681
|
+
});
|
|
3682
|
+
Object.defineProperty(exports2, "useThemeContext", {
|
|
3683
|
+
enumerable: true,
|
|
3684
|
+
get: () => themes.useThemeContext
|
|
3685
|
+
});
|
|
3686
|
+
exports2.AlertDialog = AlertDialog;
|
|
3687
|
+
exports2.AlertDialogContent = AlertDialogContent;
|
|
3688
|
+
exports2.AlertDialogProvider = AlertDialogProvider;
|
|
3689
|
+
exports2.Badge = Badge;
|
|
3690
|
+
exports2.Breadcrumb = Breadcrumb;
|
|
3691
|
+
exports2.Button = Button2;
|
|
3692
|
+
exports2.ButtonGroup = ButtonGroup;
|
|
3693
|
+
exports2.ButtonList = ButtonList;
|
|
3694
|
+
exports2.Checkbox = Checkbox;
|
|
3695
|
+
exports2.ConfirmEditInput = ConfirmEditInput;
|
|
3696
|
+
exports2.DefaultTheme = DefaultTheme;
|
|
3697
|
+
exports2.Dialog = Dialog;
|
|
3698
|
+
exports2.DropdownItemMenu = DropdownItemMenu;
|
|
3699
|
+
exports2.DropdownMenu = DropdownMenu;
|
|
3700
|
+
exports2.DropdownMenuItemGroup = DropdownMenuItemGroup;
|
|
3701
|
+
exports2.DropdownMenuMultiSelectGroup = DropdownMenuMultiSelectGroup;
|
|
3702
|
+
exports2.DropdownMenuSelectGroup = DropdownMenuSelectGroup;
|
|
3703
|
+
exports2.DropdownMenuSubMenuGroup = DropdownMenuSubMenuGroup;
|
|
3704
|
+
exports2.DropdownMultiSelect = DropdownMultiSelect;
|
|
3705
|
+
exports2.DropdownSelect = DropdownSelect;
|
|
3706
|
+
exports2.Flex = Flex;
|
|
3707
|
+
exports2.HoverUtility = HoverUtility;
|
|
3708
|
+
exports2.IconButton = IconButton;
|
|
3709
|
+
exports2.IconColorUtility = IconColorUtility;
|
|
3710
|
+
exports2.Input = Input;
|
|
3711
|
+
exports2.LeftAndRightPanels = LeftAndRightPanels;
|
|
3712
|
+
exports2.MultiPagePopover = MultiPagePopover;
|
|
3713
|
+
exports2.MultiSelect = MultiSelect;
|
|
3714
|
+
exports2.Popover = Popover;
|
|
3715
|
+
exports2.Root = Root;
|
|
3716
|
+
exports2.Select = Select;
|
|
3717
|
+
exports2.SelectAllCheckbox = SelectAllCheckbox;
|
|
3718
|
+
exports2.Separator = Separator;
|
|
3719
|
+
exports2.Sidebar = Sidebar;
|
|
3720
|
+
exports2.SlideOut = SlideOut;
|
|
3721
|
+
exports2.Spinner = Spinner;
|
|
3722
|
+
exports2.Switch = Switch;
|
|
3723
|
+
exports2.Table = Table;
|
|
3724
|
+
exports2.Text = Text$1;
|
|
3725
|
+
exports2.TextArea = TextArea;
|
|
3726
|
+
exports2.Toast = Toast;
|
|
3727
|
+
exports2.ToastContext = ToastContext;
|
|
3728
|
+
exports2.ToastProvider = ToastProvider;
|
|
3729
|
+
exports2.ToggleGroup = ToggleGroup;
|
|
3730
|
+
exports2.Toolbar = Toolbar;
|
|
3731
|
+
exports2.Tooltip = Tooltip;
|
|
3732
|
+
exports2.divButtonProps = divButtonProps;
|
|
3733
|
+
exports2.useAlertDialog = useAlertDialog;
|
|
3734
|
+
exports2.useDiscardAlertDialog = useDiscardAlertDialog;
|
|
3735
|
+
exports2.useKeyboardShortcut = useKeyboardShortcut;
|
|
3736
|
+
exports2.useSeverityColor = useSeverityColor;
|
|
3737
|
+
exports2.useStopEventPropagation = useStopEventPropagation;
|
|
3738
|
+
exports2.useTextFilter = useTextFilter;
|
|
3739
|
+
exports2.useToast = useToast;
|
|
3740
|
+
exports2.useViewportSize = useViewportSize;
|
|
3741
|
+
exports2.useWrapCallbackInDialogClose = useWrapCallbackInDialogClose;
|
|
3742
|
+
Object.keys(colors).forEach((k) => {
|
|
3743
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k))
|
|
3744
|
+
Object.defineProperty(exports2, k, {
|
|
3745
|
+
enumerable: true,
|
|
3746
|
+
get: () => colors[k]
|
|
3747
|
+
});
|
|
3748
|
+
});
|
|
3749
|
+
Object.keys(reactIcons).forEach((k) => {
|
|
3750
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports2, k))
|
|
3751
|
+
Object.defineProperty(exports2, k, {
|
|
3752
|
+
enumerable: true,
|
|
3753
|
+
get: () => reactIcons[k]
|
|
3754
|
+
});
|
|
3755
|
+
});
|
|
3756
|
+
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
3757
|
+
});
|
|
3758
|
+
//# sourceMappingURL=blocks.umd.cjs.map
|