@epam/ai-dial-ui-kit 0.14.0-dev.41 → 0.14.0-dev.44

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.
Files changed (32) hide show
  1. package/dist/CHANGELOG.md +1 -0
  2. package/dist/DateCellRenderer-B_oow9gn.cjs +1 -0
  3. package/dist/{DateCellRenderer-p6k-mVZt.cjs → DateCellRenderer-CS8ZbiFh.cjs} +5 -5
  4. package/dist/JsonEditor-BlaSMX26.cjs +1 -0
  5. package/dist/{MarkdownEditor-CBH7ILah.cjs → MarkdownEditor-5kljDPcm.cjs} +1 -1
  6. package/dist/{MarkdownEditor-CMRC_XsQ.cjs → MarkdownEditor-C0_gU7Fi.cjs} +1 -1
  7. package/dist/MarkdownEditorContainer-BqTGQArV.cjs +1 -0
  8. package/dist/components/Analytics/BarGroup/BarGroup.js +60 -58
  9. package/dist/components/Grid/constants.js +2 -2
  10. package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +16 -18
  11. package/dist/components/New/Dropdown/Dropdown.js +163 -152
  12. package/dist/components/New/Dropdown/DropdownSubMenuItem.js +75 -55
  13. package/dist/components/New/InteractiveTooltip/InteractiveTooltip.js +45 -44
  14. package/dist/components/New/Select/SelectSubMenuItem.js +26 -24
  15. package/dist/components-manifest.json +7 -3
  16. package/dist/dial-ui-kit.cjs +2 -2
  17. package/dist/editors.cjs +1 -1
  18. package/dist/file-manager.cjs +1 -1
  19. package/dist/grid.cjs +1 -1
  20. package/dist/index.css +1 -1
  21. package/dist/lazy-B1eG0EeX.cjs +1 -0
  22. package/dist/src/components/Analytics/BarGroup/BarGroup.d.ts +9 -2
  23. package/dist/src/models/dropdown.d.ts +23 -0
  24. package/dist/src/utils/sub-menu-floating.d.ts +1 -0
  25. package/dist/{use-file-manager-tabs-CIQjiyK-.cjs → use-file-manager-tabs-D0RFLbl1.cjs} +1 -1
  26. package/dist/utils/sub-menu-floating.js +45 -38
  27. package/package.json +1 -1
  28. package/dist/DateCellRenderer-DNPEX0I7.cjs +0 -1
  29. package/dist/JsonEditor-BZCyPc2D.cjs +0 -1
  30. package/dist/MarkdownEditorContainer-B_6-Gd-T.cjs +0 -1
  31. package/dist/editor-BKQqPhwX.cjs +0 -1
  32. package/dist/lazy-CJ-0Pjkj.cjs +0 -1
package/dist/CHANGELOG.md CHANGED
@@ -40,6 +40,7 @@ Versions match the git tags on the `development` branch.
40
40
 
41
41
  ### Fixed
42
42
 
43
+ - **`DialAnalyticsBarGroup` — compare-mode hover now highlights both bars of an entry as one block** — click already targeted the whole entry (label, delta, both bars), but hover used CSS `:hover` on each bar's own container, so only the bar under the pointer lit up (and a per-bar fill left a gap between the pair). The compare entry wrapper is now a Tailwind `group`; when `onBarClick` is set the shared bars container gets a default `group-hover` / `group-focus-visible` accent fill, and in compare mode `barClassName` applies to that container so consumers can use `group-hover:` for a continuous pair highlight. Single-bar mode is unchanged.
43
44
  - **`Tooltip` (2.0) and `DialTooltip` — no tooltip anywhere in an app embedded below 640px, mouse or not** — both bubbles asked `useIsMobileScreen()`, a `window.innerWidth < 640` test, and rendered `null` when it was true. Width is the wrong question: an app running inside an iframe reads the _iframe's_ width, so a chat in a 380px overlay panel lost every tooltip it had — the agent name on a conversation row included — while the desktop mouse hovering it worked exactly as before. The gate is now the `(hover: none)` media query, via the new internal `useHasHover`: a touch-only phone still gets nothing, since nothing there can reveal a hover-only bubble, and a narrow embed driven by a pointer gets its tooltips back. A hybrid device that gains or loses a hovering pointer re-evaluates without a reload, and an environment that cannot answer the question at all (SSR, or no `matchMedia`) counts as hover-capable, so a tooltip is never dropped on a guess. `(pointer: coarse)` is deliberately not part of the query — a touchscreen laptop on a mouse hovers fine. Tooltips remain unusable by touch, so a control still must not depend on one for its accessible name.
44
45
  - **`Grid` (2.0) — an `additionalGridOptions.rowSelection` put a second checkbox column on every row** — the grid draws its own selection column and switches ag-Grid's inputs off through `checkboxes` and `headerCheckbox`, but it passed `rowSelection` to ag-Grid _before_ spreading `additionalGridOptions`, so a consumer supplying that key at all replaced the whole object. Both flags default back to `true` for `multiRow`, and ag-Grid drew a full selection column of its own beside the grid's. `rowSelection` is now pulled out of `additionalGridOptions` and merged, the way `defaultColDef` already was: a consumer contributes `isRowSelectable` and the rest, while `mode`, `checkboxes` and `headerCheckbox` stay with `selectionMode` — which is what decides whether the column draws checkboxes or radios. Without a `selectionMode` there is no selection column, so a consumer's `rowSelection` still reaches ag-Grid untouched.
45
46
  - **`--stroke-primary` and `--stroke-info` light defaults matched their comments, not their tokens** — `--stroke-primary` fell back to `#6B7280`, Tailwind's own `gray-500`, while every other grey-800 token in the kit is `#57647A`; `--stroke-info` fell back to `#124ACE` where blue-500 is `#1D4ED8`. Both now match the palette. Hosts that define the variables are unaffected.
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),S=require("./DateCellRenderer-CS8ZbiFh.cjs"),U=require("@tabler/icons-react"),o=require("react"),x=require("./merge-classes-Dipy1Ih1.cjs"),p=require("@floating-ui/react"),he=require("./icon-DhjrDQ8I.cjs"),oe=require("./icon-CrGVkVpG.cjs"),g=require("./IconButton-DWqoaBWf.cjs"),it=require("classnames");var xe=(e=>(e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left",e))(xe||{});const ut=7,dt=2,mt=500,ft="fill-control-inverted",pt="z-[55] max-w-[376px] whitespace-pre-wrap break-words rounded-lg bg-control-inverted px-3 py-2 dial-small-text text-control-inverted shadow-xs",Pe=o.createContext(null),ze=()=>{const e=o.useContext(Pe);if(e==null)throw new Error("Tooltip components must be wrapped in <TooltipContainer />");return e},gt=({initialOpen:e=!1,placement:s=xe.Bottom,isTriggerClickable:n=!1,open:r,onOpenChange:i}={})=>{const[u,l]=o.useState(e),d=o.useRef(null),m=r??u,h=i??l,C=p.useFloating({placement:s,open:m,onOpenChange:h,whileElementsMounted:p.autoUpdate,middleware:[p.offset(ut+dt),p.flip({fallbackAxisSideDirection:"start",padding:5}),p.shift({padding:5}),p.arrow({element:d})]}),f=p.useHover(C.context,{move:!1,enabled:r==null,mouseOnly:n,delay:{open:mt,close:0}}),N=p.useFocus(C.context,{enabled:r==null}),v=p.useDismiss(C.context),w=p.useRole(C.context,{role:"tooltip"}),_=p.useInteractions([f,N,v,w]);return o.useEffect(()=>{if(!m)return;const k=C.refs.reference.current;if(!(k instanceof Element))return;const T=new IntersectionObserver(([O])=>{O.isIntersecting||h(!1)},{root:null,threshold:0});return T.observe(k),()=>T.disconnect()},[m,C.refs.reference,h]),o.useMemo(()=>({open:m,setOpen:h,arrowRef:d,..._,...C}),[m,h,_,C])},Re=({children:e,...s})=>{const n=gt(s);return t.jsx(Pe.Provider,{value:n,children:e})},je=({style:e,...s})=>{const n=ze(),r=g.useHasHover(),i=S.useThemeScope(),u=o.useRef(null),l=p.useMergeRefs([n.refs.setFloating,u]);return!n.open||!r?null:t.jsx(p.FloatingPortal,{id:"tooltip-portal",children:t.jsxs("div",{ref:l,"data-placement":n.placement,style:{...n.floatingStyles,...e},...n.getFloatingProps(s),className:it(pt,i,n.getFloatingProps(s).className),children:[s.children,t.jsx(p.FloatingArrow,{ref:n.arrowRef,context:n.context,className:ft})]})})},we=({children:e,asChild:s=!1,...n})=>{const r=ze(),i=s&&o.isValidElement(e),u=i?e.props?.ref:null,l=p.useMergeRefs([r.refs.setReference,...u?[u]:[]]);if(i){const d=e.props;return o.cloneElement(e,r.getReferenceProps({...d,...n,className:x.mergeClasses(d.className,n.className)||void 0,ref:l}))}return t.jsx("span",{ref:l,...r.getReferenceProps(n),className:n.className??"text-start",children:e})},He=({hideTooltip:e=!1,tooltip:s,children:n,asChild:r=!1,triggerClassName:i,contentClassName:u,...l})=>{const d=!e&&!!s;return t.jsxs(Re,{...l,children:[t.jsx(we,{asChild:r,className:i,children:n}),d&&t.jsx(je,{className:u,children:s})]})},Le={[g.ButtonVariant.Primary]:{[g.ButtonAppearance.Solid]:"dial-kit-primary-solid-button",[g.ButtonAppearance.Ghost]:"dial-kit-primary-ghost-button",[g.ButtonAppearance.Link]:"dial-kit-primary-link-button"},[g.ButtonVariant.Neutral]:{[g.ButtonAppearance.Solid]:"dial-kit-neutral-solid-button",[g.ButtonAppearance.Outlined]:"dial-kit-neutral-outlined-button"},[g.ButtonVariant.Danger]:{[g.ButtonAppearance.Solid]:"dial-kit-danger-solid-button",[g.ButtonAppearance.Ghost]:"dial-kit-danger-ghost-button",[g.ButtonAppearance.Outlined]:"dial-kit-danger-outlined-button"},[g.ButtonVariant.Static]:{[g.ButtonAppearance.Solid]:"dial-kit-static-solid-button"},[g.ButtonVariant.Success]:{},[g.ButtonVariant.Secondary]:{},[g.ButtonVariant.Tertiary]:{}},Ve=(e=g.ButtonVariant.Primary,s=g.ButtonAppearance.Solid)=>{const n=Le[e]?.[s];return n||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${s}. Using default primary solid button styles.`),Le[g.ButtonVariant.Primary][g.ButtonAppearance.Solid])},ht={[g.ElementSize.Small]:"size-[24px]",[g.ElementSize.Standard]:"size-[40px] dial-kit-enhanced-target",[g.ElementSize.Large]:"size-[48px] dial-kit-enhanced-target"},Ce=({variant:e,appearance:s=g.ButtonAppearance.Solid,size:n=g.ElementSize.Standard,className:r,icon:i,tooltipProps:u,type:l="button",...d})=>{const m=x.mergeClasses("dial-kit-base-icon-button dial-kit-base-button",e&&Ve(e,s),ht[n],r),h=t.jsx("button",{...d,type:l,className:m,"aria-label":g.resolveAccessibleName(d["aria-label"],u?.tooltip),children:i});return u?t.jsx(He,{asChild:!0,...u,children:h}):h},We=({caption:e,onClick:s,"aria-label":n})=>{if(!e)return null;const r=x.mergeClasses("text-secondary hover:text-control-accent-hover active:text-control-accent-active","focus-visible:outline focus-visible:outline-focus");return t.jsx(Ce,{"aria-label":n,className:r,icon:t.jsx(U.IconInfoCircle,{size:oe.DIAL_ICON_SIZE.SM,stroke:he.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:s,size:g.ElementSize.Small,tooltipProps:{tooltip:e}})},Ae=({label:e,required:s,className:n,containerClassName:r,caption:i,size:u=g.ElementSize.Small,...l})=>e?t.jsxs("span",{className:x.mergeClasses("flex items-center gap-0.5",r),children:[t.jsxs("label",{...l,className:x.mergeClasses("text-secondary flex items-center gap-0.5",u===g.ElementSize.Small?"dial-tiny-semi-text":"dial-small-text",n),children:[typeof e=="string"?t.jsx("span",{className:"min-h-4",children:e}):e,s&&t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",className:"text-error dial-tiny-text",children:"*"}),t.jsx("span",{className:"sr-only",children:"(required)"})]})]}),t.jsx(We,{caption:i})]}):null;var D=(e=>(e.None="none",e.Check="check",e.Tint="tint",e.Checkbox="checkbox",e.Highlight="highlight",e))(D||{});const _e=(e,s)=>({appearance:r,...i})=>t.jsx(Ce,{...i,variant:e,appearance:r||s}),Ue=(e,s)=>({variant:r,...i})=>t.jsx(Ce,{...i,variant:r||s,appearance:e}),xt=_e(g.ButtonVariant.Primary,g.ButtonAppearance.Solid),Ct=_e(g.ButtonVariant.Neutral,g.ButtonAppearance.Solid),bt=_e(g.ButtonVariant.Danger,g.ButtonAppearance.Ghost),Ke=Ue(g.ButtonAppearance.Ghost,g.ButtonVariant.Primary),St=Ue(g.ButtonAppearance.Solid,g.ButtonVariant.Static),$e=({ariaLabel:e="Close",className:s,size:n=g.ElementSize.Small,onClose:r,...i})=>t.jsx(Ke,{...i,size:n,"aria-label":e,className:s,onClick:r,icon:t.jsx(U.IconX,{size:n===g.ElementSize.Small?oe.DIAL_ICON_SIZE.SM:oe.DIAL_ICON_SIZE.MD,stroke:he.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),Nt=e=>{const s=o.useRef(null),[n,r]=o.useState(!1),[i,u]=o.useState(""),l=o.useRef(!1),d=o.useCallback(()=>{const h=s.current;h&&(l.current&&u(h.textContent??""),r(h.scrollWidth>h.clientWidth))},[]),m=o.useCallback(()=>S.scheduleMeasure(d),[d]);return o.useEffect(()=>{const h=s.current;if(h)return S.observeElementSize(h,d)},[d]),o.useEffect(()=>{l.current=typeof e!="string",m()},[e,m]),{ref:s,isTruncated:n,textContent:i,remeasure:m}},be=({text:e,className:s,contentClassName:n,hideTooltip:r=!1,id:i,customTooltipContent:u,...l})=>{const{ref:d,isTruncated:m,textContent:h,remeasure:C}=Nt(e),f=typeof e=="string"?e:h,N=o.useMemo(()=>r||!m?null:u??f,[u,f,r,m]);return t.jsxs(Re,{...l,children:[t.jsx(we,{asChild:!0,onMouseEnter:C,onFocusCapture:C,children:t.jsx("span",{id:i,ref:d,"aria-label":m&&f?f:void 0,className:x.mergeClasses("block min-w-0 max-w-full flex-1 truncate text-start",s),children:e})}),!!N&&t.jsx(je,{className:n,children:N})]})},Et=8,It=400,vt="z-[54] max-w-[320px] rounded-xl bg-layer-0 p-4 dial-small-text text-primary shadow-md",fe=({content:e,placement:s=xe.Right,children:n,asChild:r=!1,hideTooltip:i=!1,initialOpen:u=!1,open:l,onOpenChange:d,triggerClassName:m,contentClassName:h})=>{const C=S.useIsMobileScreen(),f=S.useThemeScope(),[N,v]=o.useState(u),w=l??N,_=d??v,k=p.useFloatingNodeId(),{refs:T,floatingStyles:O,context:B}=p.useFloating({nodeId:k,placement:s,open:w,onOpenChange:_,whileElementsMounted:p.autoUpdate,middleware:[p.offset(Et),p.flip({padding:5}),p.shift({padding:5})]}),K=p.useHover(B,{enabled:l==null,handleClose:p.safePolygon(),delay:{open:It,close:0}}),j=p.useFocus(B,{enabled:l==null}),z=p.useDismiss(B),{getReferenceProps:H,getFloatingProps:y}=p.useInteractions([K,j,z]),Q=o.useRef(null),ee=p.useMergeRefs(o.useMemo(()=>[T.setFloating,Q],[T.setFloating])),V=r&&o.isValidElement(n),R=V?n.props?.ref:null,M=p.useMergeRefs(o.useMemo(()=>[T.setReference,...R?[R]:[]],[T.setReference,R])),$=!i&&!C&&!!e,G=V?o.cloneElement(n,H({...n.props,ref:M,className:x.mergeClasses(n.props.className,m)||void 0})):t.jsx("span",{ref:M,...H(),className:m??"text-start",children:n});return t.jsxs(t.Fragment,{children:[G,w&&$&&t.jsx(p.FloatingPortal,{id:"interactive-tooltip-portal",children:t.jsx(p.FloatingFocusManager,{context:B,modal:!1,initialFocus:-1,returnFocus:!1,order:["reference","content"],children:t.jsx("div",{ref:ee,"data-placement":B.placement,style:O,...y(),className:x.mergeClasses(vt,f,h),children:e})})})]})},qe="rounded-xl bg-layer-raised p-1 shadow-md",Xe=x.mergeClasses(qe,"w-max"),Ze=x.mergeClasses("flex w-full cursor-pointer items-center gap-2 px-3 h-[40px] rounded-lg","dial-small-text text-primary truncate","hover:bg-control-accent-alpha-hover","focus-visible:outline focus-visible:outline-focus"),Ye="bg-control-accent-alpha",yt=x.mergeClasses(Ye,"text-accent"),kt=x.mergeClasses("cursor-not-allowed text-control-disable-primary","bg-transparent hover:bg-transparent"),Je=4,Tt=x.mergeClasses("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),Rt=x.mergeClasses("z-[53] focus-visible:outline-none",qe),jt=Xe,wt="my-1 border-t border-tertiary",J=Je,At=t.jsx(U.IconChevronRight,{size:oe.DIAL_ICON_SIZE.SM,stroke:he.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Me={size:14,stroke:3,"aria-hidden":!0},De=({isSelected:e=!1,isIndeterminate:s=!1,invalid:n=!1,disabled:r=!1,htmlFor:i,className:u})=>{const l=s||e,d=!!i,m=x.mergeClasses("grid size-[20px] shrink-0 place-items-center rounded border transition-colors duration-200",d&&"dial-kit-minimum-target",d&&"peer-focus-visible:outline peer-focus-visible:outline-focus",r?"border-transparent bg-control-disable-primary text-control-disable-primary":x.mergeClasses(n&&l&&"border-transparent bg-control-error text-control-permanent",n&&!l&&"border-error bg-control-neutral",!n&&l&&"border-transparent bg-control-accent text-control-permanent hover:bg-control-accent-hover",!n&&!l&&"border-default bg-control-neutral hover:border-accent hover:bg-control-accent-alpha-hover"),r?"cursor-not-allowed":d&&"cursor-pointer",u),h=s?t.jsx(U.IconMinus,{...Me}):e&&t.jsx(U.IconCheck,{...Me});return d?t.jsx("label",{htmlFor:i,className:m,children:h}):t.jsx("span",{"aria-hidden":"true",className:m,children:h})},_t=t.jsx(U.IconCheck,{size:oe.DIAL_ICON_SIZE.SM,stroke:he.DIAL_KIT_ICON_STROKE,className:"shrink-0","aria-hidden":!0}),pe=({label:e,icon:s,description:n,mark:r=D.None,selected:i=!1,danger:u=!1,trailing:l,rightControl:d,ellipsisLabel:m=!1,labelClassName:h,children:C,className:f,disabled:N=!1,type:v="button",...w})=>{const _=i&&r===D.Highlight,k=i&&(r===D.Checkbox||r===D.Tint),T=x.mergeClasses(u&&"text-error",N&&"text-control-disable-primary"),O=x.mergeClasses(Ze,"aria-expanded:bg-control-accent-alpha-hover",_&&yt,k&&Ye,N&&kt,u&&"text-error",f),B=t.jsxs("button",{type:v,disabled:N,"data-menu-item-row":d?"":void 0,className:d?"flex h-full min-w-0 flex-1 items-center gap-2 truncate text-start focus-visible:outline-none":O,...w,children:[C??t.jsxs(t.Fragment,{children:[r===D.Checkbox&&t.jsx(De,{isSelected:i,disabled:N}),s&&t.jsx(S.DialIcon,{icon:s,className:T}),m?t.jsx(be,{text:e,className:x.mergeClasses(T,h)}):t.jsx("span",{className:x.mergeClasses("min-w-0 flex-1 truncate text-start",T,h),children:e}),n&&t.jsx("span",{className:x.mergeClasses("shrink-0 text-secondary dial-small-text",N&&"text-control-disable-primary"),children:n}),i&&r===D.Check&&_t]}),l&&t.jsx("span",{className:x.mergeClasses("ml-auto shrink-0",T),children:l})]});return d?t.jsxs("div",{role:"none",className:x.mergeClasses(O,"has-[[data-menu-item-row]:focus-visible]:outline","has-[[data-menu-item-row]:focus-visible]:outline-focus"),children:[B,d]}):B},ge=e=>e.mark??(e.selectable?D.Checkbox:D.None),Qe=e=>e.selectable?"menuitemcheckbox":ge(e)===D.Check?"menuitemradio":"menuitem",Dt=({item:e,onRootClose:s})=>{const{isOpen:n,nodeId:r,refs:i,floatingStyles:u,context:l,getReferenceProps:d,getFloatingProps:m}=S.useSubMenuFloating(J,"menu",!!e.disabled),h=o.useCallback(f=>N=>{f.disabled||(f.onClick?.({key:f.key,domEvent:N}),f.selectable||s())},[s]),C=t.jsx(pe,{ref:i.setReference,role:"menuitem","aria-haspopup":"menu","aria-expanded":n,"aria-disabled":!!e.disabled,disabled:e.disabled,icon:e.icon,label:e.label,trailing:At,className:e.className,...d(),children:e.renderItem?.(e)});return t.jsxs(p.FloatingNode,{id:r,children:[e.interactiveTooltip?t.jsx(fe,{asChild:!0,placement:e.interactiveTooltip.placement,content:e.interactiveTooltip.content,contentClassName:e.interactiveTooltip.contentClassName,children:C}):C,n&&t.jsx(S.SubMenuPanel,{refs:i,floatingStyles:u,context:l,getFloatingProps:m,role:"menu",surfaceClassName:jt,children:e.renderSubMenu?e.renderSubMenu():t.jsxs(t.Fragment,{children:[e.menuHeader&&(typeof e.menuHeader=="function"?e.menuHeader():e.menuHeader),e.children.map(f=>{const N=Qe(f),v=t.jsx(pe,{role:N,"aria-checked":N==="menuitem"?void 0:!!f.checked,"aria-current":ge(f)===D.Highlight&&f.checked?!0:void 0,"aria-disabled":!!f.disabled,disabled:f.disabled,mark:ge(f),selected:!!f.checked,danger:f.danger,icon:f.icon,label:f.label,className:f.className,rightControl:f.rightControl,onClick:h(f),children:f.renderItem?.(f)});return t.jsx(o.Fragment,{children:f.interactiveTooltip?t.jsx(fe,{asChild:!0,placement:f.interactiveTooltip.placement,content:f.interactiveTooltip.content,contentClassName:f.interactiveTooltip.contentClassName,children:v}):v},f.key)}),e.menuFooter&&(typeof e.menuFooter=="function"?e.menuFooter():e.menuFooter)]})})]})},Ot='[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]',Bt=e=>!e.hasAttribute("disabled")&&e.getAttribute("aria-disabled")!=="true",Ft=["ArrowDown","ArrowUp","Home","End"],Lt=(e,s,n)=>{if(e==="Home")return 0;if(e==="End")return n-1;const r=e==="ArrowDown"?1:-1;return s===-1?r===1?0:n-1:(s+r+n)%n},Mt=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,et=({children:e,items:s,onItemClick:n,menuHeader:r,menuFooter:i,renderOverlay:u,trigger:l=[S.DropdownTrigger.Click],placement:d,disabled:m=!1,open:h,defaultOpen:C=!1,onOpenChange:f,closable:N=!1,onClose:v,className:w,overlayContentClassName:_,separatorClassName:k,listClassName:T,outsidePressIgnoreRef:O,outsideClosable:B=!0,allowedPlacements:K,anchorToMouse:j=!1,matchReferenceWidth:z=!0,maxDropdownHeight:H})=>{const y=S.useThemeScope(),[Q,ee]=o.useState(C),V=h!==void 0,R=V?!!h:Q,M=o.useRef(null),[$,G]=o.useState(!0),I=o.useCallback((a,E,A)=>{a&&G(A!=="hover"&&A!=="safe-polygon"),V||ee(a),f?.(a)},[V,f]),te=o.useId(),ae=d===void 0,le=p.useFloatingNodeId(),{refs:W,floatingStyles:Se,context:F}=p.useFloating({nodeId:le,placement:d,open:R,onOpenChange:I,whileElementsMounted:p.autoUpdate,middleware:[p.offset({mainAxis:J,crossAxis:0}),ae?p.autoPlacement({alignment:"start",crossAxis:!0,padding:J,allowedPlacements:K}):p.flip({padding:J}),p.shift({padding:J}),p.size({padding:J,apply({availableWidth:a,availableHeight:E,elements:A}){const c=A.floating,b=Mt(A.reference);c.style.setProperty("--fui-available-height",`${Math.floor(E)}px`),c.style.setProperty("--reference-width",z?`${Math.round(b)}px`:"0px"),z?c.style.minWidth=`${Math.round(b)}px`:c.style.removeProperty("min-width"),c.style.maxWidth=`${Math.floor(a)}px`;const L=Math.floor(E);c.style.maxHeight=`${H?Math.min(L,H):L}px`}})]}),q=p.useClick(F,{enabled:l.includes(S.DropdownTrigger.Click)&&!m}),ne=p.useHover(F,{enabled:l.includes(S.DropdownTrigger.Hover)&&!m,move:!1,restMs:40,handleClose:p.safePolygon(),delay:{open:80,close:80}}),X=p.useDismiss(F,{bubbles:!0,referencePress:!1,outsidePress:a=>{if(!B)return!1;const E=a.target;return!(O?.current&&E instanceof Node&&O.current.contains(E))}}),Ne=p.useRole(F,{role:"menu"}),{getReferenceProps:se,getFloatingProps:ce}=p.useInteractions([q,ne,X,Ne]),Z=o.useCallback((a,E)=>{W.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:a,y:E,top:E,left:a,right:a,bottom:E})})},[W]),ie=o.useCallback(a=>{!l.includes(S.DropdownTrigger.ContextMenu)||m||(a.preventDefault(),j&&(Z(a.clientX,a.clientY),M.current=document.elementFromPoint(a.clientX,a.clientY)),I(!0))},[j,m,I,Z,l]),Y=o.useCallback(a=>{!j||m||(l.includes(S.DropdownTrigger.ContextMenu)&&R&&I(!1),Z(a.clientX,a.clientY),M.current=document.elementFromPoint(a.clientX,a.clientY))},[j,m,Z,R,l,I]);o.useEffect(()=>{m&&R&&I(!1)},[m,R,I]);const Ee=o.useCallback(a=>{if(a.defaultPrevented||!Ft.includes(a.key))return;const E=Array.from(a.currentTarget.querySelectorAll(Ot)).filter(Bt);if(E.length===0)return;a.preventDefault();const A=a.currentTarget.ownerDocument.activeElement,c=E.findIndex(b=>b===A);E[Lt(a.key,c,E.length)]?.focus()},[]),ue=o.useCallback(a=>E=>{a.disabled||(a.onClick?.({key:a.key,domEvent:E}),n?.({key:a.key,domEvent:E}),a.selectable||I(!1))},[n,I]),Ie=o.useMemo(()=>u?u():s?t.jsxs(t.Fragment,{children:[r&&t.jsx(t.Fragment,{children:typeof r=="function"?r():r}),t.jsx("div",{role:"none",className:x.mergeClasses("py-1",_),"aria-label":"dropdown",children:s.map(a=>{if(a.type===S.DropdownItemType.Divider)return t.jsx("div",{role:"separator",className:x.mergeClasses(wt,k)},a.key);if(a.type===S.DropdownItemType.PlainText)return t.jsx("div",{className:x.mergeClasses("px-3 py-2 text-secondary dial-caption-text",a.className),children:a.label},a.key);if(a.children?.length)return t.jsx(Dt,{item:a,onRootClose:()=>I(!1)},a.key);const E=ge(a),A=Qe(a),c=t.jsx(pe,{role:A,"aria-checked":A==="menuitem"?void 0:!!a.checked,"aria-current":E===D.Highlight&&a.checked?!0:void 0,"aria-disabled":!!a.disabled,disabled:a.disabled,mark:E,selected:!!a.checked,danger:a.danger,icon:a.icon,label:a.label,className:a.className,rightControl:a.rightControl,onClick:ue(a),children:a.renderItem?.(a)});return t.jsx(o.Fragment,{children:a.interactiveTooltip?t.jsx(fe,{asChild:!0,placement:a.interactiveTooltip.placement,content:a.interactiveTooltip.content,contentClassName:a.interactiveTooltip.contentClassName,children:c}):c},a.key)})}),i&&t.jsx(t.Fragment,{children:typeof i=="function"?i():i})]}):null,[ue,s,i,r,u,I,_,k]),ve=se({onContextMenu:ie,onMouseDown:Y});return o.useEffect(()=>{if(!R)return;const a=W.reference.current;let E=null;if(a instanceof Element?E=a:M.current instanceof Element&&(E=M.current),!E)return;const A=new IntersectionObserver(([c])=>{c.isIntersecting||I(!1)},{root:null,threshold:0});return A.observe(E),()=>A.disconnect()},[R,W.reference,I]),t.jsx(p.FloatingTree,{children:t.jsxs(p.FloatingNode,{id:le,children:[t.jsx("span",{ref:W.setReference,className:x.mergeClasses(Tt,m&&"!cursor-not-allowed opacity-75",w),"aria-haspopup":"menu","aria-expanded":R,"aria-controls":te,...ve,children:e}),R&&t.jsx(p.FloatingPortal,{children:t.jsx(p.FloatingFocusManager,{context:F,modal:!1,initialFocus:$?0:-1,returnFocus:!0,children:t.jsxs("div",{id:te,ref:W.setFloating,style:Se,className:x.mergeClasses(Rt,!z&&"w-max","overflow-auto",y,T),...ce({onKeyDown:Ee}),children:[N&&t.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:t.jsx($e,{ariaLabel:"Close dropdown",onClose:a=>{v?.(a),I(!1)}})}),Ie]})})})]})})},Oe=({id:e,labelProps:s,isSelected:n=!1,isIndeterminate:r=!1,invalid:i=!1,disabled:u,onChange:l,caption:d,className:m,boxClassName:h,...C})=>{const f=o.useId(),N=e??f,v=d?`${N}-caption`:void 0,w=o.useCallback(k=>{l?.(k.target.checked)},[l]),_=o.useCallback(k=>{k&&(k.indeterminate=r)},[r]);return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:x.mergeClasses("flex items-center gap-2",m),children:[t.jsx("input",{...C,ref:_,type:"checkbox",id:N,checked:n,disabled:u,onChange:w,"aria-checked":r?"mixed":n,"aria-invalid":i||void 0,"aria-label":g.resolveAccessibleName(typeof s?.label!="string"?C["aria-label"]:void 0),"aria-describedby":v,className:"peer sr-only"}),t.jsx(De,{htmlFor:N,isSelected:n,isIndeterminate:r,invalid:i,disabled:u,className:h}),s&&t.jsx(Ae,{size:g.ElementSize.Standard,...s,htmlFor:N,className:x.mergeClasses("py-[1px]",u?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",s.className)})]}),d&&t.jsx("span",{id:v,className:"dial-tiny-text text-secondary ml-[28px]",children:d})]})},tt=({id:e,name:s,value:n,labelProps:r,isSelected:i=!1,disabled:u,onChange:l,caption:d,className:m,...h})=>{const C=o.useId(),f=e??C,N=d?`${f}-caption`:void 0,v=o.useCallback(w=>{w.target.checked&&l?.(n)},[l,n]);return t.jsxs("div",{className:"flex flex-col gap-1",children:[t.jsxs("div",{className:x.mergeClasses("flex items-center gap-2 ",m),children:[t.jsx("input",{...h,type:"radio",id:f,name:s,value:n,checked:i,disabled:u,onChange:v,"aria-label":g.resolveAccessibleName(typeof r?.label!="string"?h["aria-label"]:void 0),"aria-describedby":N,className:"peer sr-only"}),t.jsx("label",{htmlFor:f,className:x.mergeClasses("group grid size-[20px] shrink-0 place-items-center rounded-full border transition-colors duration-200 hover:bg-control-accent-alpha-hover","dial-kit-minimum-target","peer-focus-visible:outline peer-focus-visible:outline-focus",u?"cursor-not-allowed border-default bg-control-disable-primary":x.mergeClasses("cursor-pointer",i?"border border-accent bg-control-neutral":"border-default bg-control-neutral")),children:i&&t.jsx("span",{className:x.mergeClasses("size-3 rounded-full",u?"bg-control-disable-secondary":"bg-control-accent")})}),r&&t.jsx(Ae,{size:g.ElementSize.Standard,...r,htmlFor:f,className:x.mergeClasses("py-[1px]",u?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",r.className)})]}),d&&t.jsx("span",{id:N,className:"dial-tiny-text text-secondary ml-[26px]",children:d})]})},Gt=60,nt=({title:e,description:s,icon:n,live:r=!1,className:i,titleClassName:u,descriptionClassName:l})=>t.jsxs("div",{role:r?"status":void 0,className:x.mergeClasses("flex size-full flex-col items-center justify-center gap-2 text-tertiary",i),children:[n??t.jsx(U.IconClipboardX,{size:Gt,stroke:.5,"aria-hidden":"true"}),t.jsx("span",{className:x.mergeClasses("dial-body-semi-text text-primary",u),children:e}),s&&t.jsx("span",{className:x.mergeClasses("dial-small-text text-secondary",l),children:s})]}),st="dial-kit-grid",Pt="dial-kit-grid-with-selection",zt="dial-kit-grid-without-header-borders",Ht="dial-kit-grid-row-select",Vt="dial-kit-grid-header-select",Wt="dial-kit-grid-selection-visible",Ut="dial-kit-grid-align-right",Te=40,ye="0.5px solid var(--stroke-tertiary, #E0E6F0)",me={accentColor:"var(--bg-control-accent, #1D4ED8)",backgroundColor:"var(--bg-layer-raised, #FCFCFC)",oddRowBackgroundColor:"var(--bg-layer-sunken, #EEF1F7)",selectedRowBackgroundColor:"var(--bg-control-accent-alpha, #2764D90F)",rowHoverColor:"var(--bg-control-accent-alpha-hover, #2764D924)",borderColor:"var(--stroke-tertiary, #E0E6F0)",rowBorder:ye,headerRowBorder:ye,headerColumnBorder:ye,chromeBackgroundColor:"var(--bg-layer-base, #F5F7FA)",foregroundColor:"var(--text-primary, #161B2D)",headerTextColor:"var(--text-secondary, #57647A)",browserColorScheme:"light",headerFontSize:14,headerFontWeight:600,fontSize:14,fontFamily:"var(--theme-font, var(--font-inter))",spacing:4,borderRadius:4,wrapperBorderRadius:8};var P=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(P||{});const Kt=({params:e,mode:s,label:n,radioName:r,rowId:i,disabled:u})=>{const l=e.node,[d,m]=o.useState(()=>!!l.isSelected());o.useEffect(()=>{const C=()=>m(!!l.isSelected());return C(),l.addEventListener("rowSelected",C),()=>l.removeEventListener("rowSelected",C)},[l]);const h=C=>{u||l.setSelected(C,s===S.GridSelectionMode.SINGLE,P.CHECKBOX_SELECTED)};return s===S.GridSelectionMode.SINGLE?t.jsx(tt,{name:r,value:i,isSelected:d,disabled:u,"aria-label":n,onChange:()=>h(!0)}):t.jsx(Oe,{isSelected:d,disabled:u,"aria-label":n,onChange:h})},Ge=e=>{let s=0,n=0;return e.forEachNodeAfterFilter(r=>{r.selectable!==!1&&(n++,r.isSelected()&&s++)}),{selected:s,selectable:n}},$t=({api:e,label:s})=>{const[{selected:n,selectable:r},i]=o.useState(()=>Ge(e));o.useEffect(()=>{const l=()=>i(Ge(e));return l(),e.addEventListener("selectionChanged",l),e.addEventListener("modelUpdated",l),()=>{e.isDestroyed()||(e.removeEventListener("selectionChanged",l),e.removeEventListener("modelUpdated",l))}},[e]);const u=o.useCallback(l=>{if(l){e.selectAll("filtered",P.CHECKBOX_SELECTED);return}e.deselectAll("filtered",P.CHECKBOX_SELECTED)},[e]);return t.jsx(Oe,{isSelected:r>0&&n===r,isIndeterminate:n>0&&n<r,disabled:r===0,"aria-label":s,onChange:u})},rt="en-US",ot={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},ke=40,qt={minWidth:ke,width:ke,maxWidth:ke,resizable:!1,sortable:!1,filter:!1,floatingFilter:!1,suppressMovable:!0,suppressHeaderMenuButton:!0,suppressAutoSize:!0,suppressSizeToFit:!0},at="dial-kit-grid-selection",Xt=150,Zt=100,Yt=({columnDefs:e,rowData:s,additionalGridOptions:n,getContextMenuItems:r,className:i,ariaLabel:u="Data grid",wrapCustomCellRenderers:l=!0,disabledRowIds:d,selectedRowIds:m,onSelectionChange:h,onGridApiChange:C,getRowId:f,alternateOddRowColors:N=!1,filterPlaceholder:v="Enter value",emptyStateIcon:w,emptyStateTitle:_="No results found",emptyStateDescription:k="Sorry, we couldn't find any results for your search.",loading:T=!1,wrapperBorder:O=!0,withoutHeaderBorders:B=!1,allowDisabledContextMenu:K=!1,selectionMode:j,selectRowLabel:z,selectAllLabel:H="Select all rows"})=>{S.registerAgGridModulesOnce();const[y,Q]=o.useState(),ee=S.useIsMobileScreen(),V=S.useIsTabletScreen(),R=o.useRef(new Set),M=o.useRef(void 0),$=`dial-kit-grid-selection-${o.useId()}`,G=o.useRef({getRowId:f,getContextMenuItems:r,onSelectionChange:h,selectRowLabel:z,wrapCustomCellRenderers:l});G.current={getRowId:f,getContextMenuItems:r,onSelectionChange:h,selectRowLabel:z,wrapCustomCellRenderers:l};const I=o.useCallback(c=>{const b=G.current.getRowId;return b?b(c):String(c.id??JSON.stringify(c))},[]),te=!!r,ae=!!l,le=o.useMemo(()=>S.themeBalham.withPart(S.colorSchemeLight).withParams({...me,oddRowBackgroundColor:N?me.oddRowBackgroundColor:me.backgroundColor,wrapperBorder:O}),[N,O]),W=o.useCallback(c=>{c.api.sizeColumnsToFit()},[]),Se=ee||V||(m?.size??0)>0,F=o.useCallback(c=>!!c&&!!d?.has(I(c)),[d,I]),q=o.useCallback((c,b,L)=>te?t.jsx(et,{trigger:[S.DropdownTrigger.ContextMenu],items:c.data?G.current.getContextMenuItems?.(c.data)??[]:[],anchorToMouse:!0,matchReferenceWidth:!0,className:x.mergeClasses("size-full",L&&"cursor-not-allowed opacity-75"),disabled:L&&!K,children:t.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:b})}):b,[te,K]),ne=o.useCallback(c=>{if(!c.data)return null;const b=F(c.data);return q(c,t.jsx(be,{text:c.value==null?"":String(c.value),className:"max-w-full dial-small-text text-primary",hideTooltip:b}),b)},[F,q]),X=o.useCallback(c=>c===P.API||c===P.ROW_DATA_CHANGED,[]),Ne=o.useMemo(()=>S.debounceFn(c=>{const L=(c.selectedNodes??[]).map(Be=>Be.data),re=new Set(L.map(I));R.current=re,M.current=c.source,!X(c.source)&&G.current.onSelectionChange?.(re,L)},Zt),[X,I]),se=o.useMemo(()=>{if(j)return{...qt,colId:at,headerName:"",headerClass:Vt,cellClass:Ht,headerComponent:j===S.GridSelectionMode.MULTIPLE?$t:void 0,headerComponentParams:{label:H},cellRenderer:c=>{if(!c.data)return null;const b=I(c.data);return t.jsx(Kt,{params:c,mode:j,rowId:b,radioName:$,label:G.current.selectRowLabel?.(c.data)??"Select row",disabled:d?.has(b)})}}},[j,H,I,d,$]),ce=o.useCallback(c=>{if(!c.cellRenderer)return{...c,cellRenderer:ne};const b=G.current.wrapCustomCellRenderers;if(!(typeof b=="function"?b(c):!!b))return c;const re=c.cellRenderer;return{...c,cellRenderer:de=>{const lt=F(de.data),Fe=typeof re=="function"?re:void 0,ct=Fe?t.jsx(Fe,{...de}):ne(de);return q(de,ct,lt)}}},[F,ne,q]),Z=o.useMemo(()=>{const c=ae?(e??[]).map(ce):e??[];return se?[se,...c]:c},[e,ae,ce,se]),{defaultColDef:ie,rowSelection:Y,...Ee}=n??{},ue=o.useMemo(()=>({minWidth:Xt,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:v,buttons:["reset"]},comparator:S.baseColumnComparator,...S.omitUndefined(ie)}),[v,ie]),Ie=c=>{c.api.sizeColumnsToFit(),Q(c.api),n?.onGridReady?.(c),C?.(c.api)};o.useEffect(()=>{y&&s&&y.setGridOption("rowData",s)},[y,s]);const ve=o.useCallback(()=>t.jsx(nt,{live:!0,title:_,description:k,icon:w??t.jsx(U.IconZoomCancel,{size:100,stroke:.5,"aria-hidden":"true"})}),[_,k,w]),a=typeof Y=="object"?Y:void 0,E=o.useMemo(()=>j?{isRowSelectable:c=>!F(c.data),...a,mode:j===S.GridSelectionMode.SINGLE?"singleRow":"multiRow",checkboxes:!1,headerCheckbox:!1}:Y,[Y,a,F,j]);o.useEffect(()=>{y&&s&&R.current.size&&R.current.forEach(c=>{const b=y.getRowNode(c);b&&!b.isSelected()&&b.setSelected(!0,!1,P.API)})},[y,s]),o.useEffect(()=>{y&&m&&(y.deselectAll("all",P.API),m.forEach(c=>{const b=y.getRowNode(c);b&&!b.isSelected()&&b.setSelected(!0,!1,P.API)}))},[y,m]);const A=o.useCallback(c=>c.data?I(c.data):"",[I]);return o.useEffect(()=>{const c=X(M.current);if(y&&m?.size&&c){const b=Array.from(m)[0];if(b){const L=y.getRowNode(b);L&&y.ensureNodeVisible(L)}}},[y,X,m]),t.jsx("div",{className:x.mergeClasses(st,"size-full",j&&Pt,j&&Se&&Wt,B&&zt,i),role:"region","aria-label":u,"aria-busy":T,children:t.jsx("div",{className:"h-full overflow-x-auto",children:t.jsx(S.AgGridReact,{rowModelType:"clientSide",headerHeight:Te,rowHeight:Te,cellSelection:!1,theme:le,autoSizeStrategy:{type:"fitGridWidth"},columnDefs:Z,defaultColDef:ue,onGridSizeChanged:W,onGridReady:Ie,loading:T,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:ve,rowData:s,rowSelection:E,onSelectionChanged:Ne,getRowId:A,...Ee})})})},Jt=({value:e,locale:s=rt,options:n=ot,emptyPlaceholder:r,className:i,hideTooltip:u=!1})=>{const l=S.convertToDate(e),d=o.useMemo(()=>l?new Intl.DateTimeFormat(s,n).format(l):r,[l,r,s,n]),m=l?l.toISOString():void 0;return t.jsx(be,{text:m?t.jsx("time",{dateTime:m,children:d}):t.jsx("span",{children:d}),className:x.mergeClasses("dial-small-text text-primary",i),hideTooltip:u})};exports.Checkbox=Oe;exports.CheckboxBox=De;exports.CloseButton=$e;exports.DEFAULT_DATE_FORMAT_OPTIONS=ot;exports.DEFAULT_LOCALE=rt;exports.DangerIconButton=bt;exports.DateCellRenderer=Jt;exports.Dropdown=et;exports.EllipsisTooltip=be;exports.GRID_ALIGN_RIGHT_CLASS=Ut;exports.GRID_ROOT_CLASS=st;exports.GRID_SELECTION_COLUMN_ID=at;exports.GRID_THEME_PARAMS=me;exports.GhostIconButton=Ke;exports.Grid=Yt;exports.IconButton=Ce;exports.InfoButton=We;exports.InteractiveTooltip=fe;exports.Label=Ae;exports.MenuItem=pe;exports.MenuItemMark=D;exports.NeutralIconButton=Ct;exports.NoDataContent=nt;exports.PrimaryIconButton=xt;exports.ROW_HEIGHT=Te;exports.Radio=tt;exports.StaticIconButton=St;exports.Tooltip=He;exports.TooltipContainer=Re;exports.TooltipContent=je;exports.TooltipPlacement=xe;exports.TooltipTrigger=we;exports.getButtonClassNames=Ve;exports.overlayGap=Je;exports.overlayItemClassName=Ze;exports.overlaySubMenuClassName=Xe;