@epam/ai-dial-ui-kit 0.15.0-dev.13 → 0.15.0-dev.14

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 (43) hide show
  1. package/README.md +33 -0
  2. package/dist/CHANGELOG.md +4 -0
  3. package/dist/DateCellRenderer-Cci6cUvX.cjs +1 -0
  4. package/dist/{DateCellRenderer-S5QJV-Wp.cjs → DateCellRenderer-Cm09x2e4.cjs} +2 -2
  5. package/dist/IconButton-CVttu-k-.cjs +1 -0
  6. package/dist/{JsonEditor-qv1Z0dLX.cjs → JsonEditor-BDe6elKO.cjs} +1 -1
  7. package/dist/{MarkdownEditor-DHn2pYOJ.cjs → MarkdownEditor-C7BONfsl.cjs} +1 -1
  8. package/dist/{MarkdownEditor-jQ8nDJfx.cjs → MarkdownEditor-FVzYMdkC.cjs} +1 -1
  9. package/dist/{MarkdownEditorContainer-Bzcnoemw.cjs → MarkdownEditorContainer-BA94ffC4.cjs} +1 -1
  10. package/dist/{Switch-CUKClcEz.cjs → Switch-CfxMs3AZ.cjs} +1 -1
  11. package/dist/components/Dropdown/constants.js +5 -5
  12. package/dist/components/New/Calendar/constants.js +5 -5
  13. package/dist/components/New/Dropdown/Dropdown.js +94 -93
  14. package/dist/components/New/Dropdown/constants.js +3 -3
  15. package/dist/components/New/InteractiveTooltip/constants.js +2 -2
  16. package/dist/components/New/Popup/constants.js +3 -3
  17. package/dist/components/New/Tooltip/constants.js +1 -1
  18. package/dist/components/Popup/constants.js +8 -8
  19. package/dist/components/Tooltip/TooltipContent.js +11 -11
  20. package/dist/components-manifest.json +9 -3
  21. package/dist/dial-ui-kit.cjs +2 -2
  22. package/dist/editors.cjs +1 -1
  23. package/dist/file-manager.cjs +1 -1
  24. package/dist/grid.cjs +1 -1
  25. package/dist/index.css +1 -1
  26. package/dist/lazy-BEsZqouS.cjs +1 -0
  27. package/dist/merge-classes-BEJXjzkx.cjs +1 -0
  28. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +419 -399
  29. package/dist/src/components/New/Calendar/constants.d.ts +1 -1
  30. package/dist/src/components/New/Dropdown/Dropdown.d.ts +9 -1
  31. package/dist/src/components/New/InteractiveTooltip/constants.d.ts +5 -4
  32. package/dist/src/components/New/Popup/constants.d.ts +1 -1
  33. package/dist/src/components/New/Tooltip/constants.d.ts +5 -3
  34. package/dist/src/components/Popup/constants.d.ts +1 -1
  35. package/dist/use-file-manager-tabs-Atz7tLcd.cjs +3 -0
  36. package/dist/utils/merge-classes.js +12 -5
  37. package/dist/utils/sub-menu-floating.js +11 -11
  38. package/package.json +1 -1
  39. package/dist/DateCellRenderer-Ba9tlNbk.cjs +0 -1
  40. package/dist/IconButton-DWqoaBWf.cjs +0 -1
  41. package/dist/lazy-tfN4sKhq.cjs +0 -1
  42. package/dist/merge-classes-Dipy1Ih1.cjs +0 -1
  43. package/dist/use-file-manager-tabs-Ff6KIQOF.cjs +0 -3
package/README.md CHANGED
@@ -193,6 +193,39 @@ These are defaults, not overrides: a `rounded-*` utility passed to a single
193
193
  control through `className` still wins, because a consumer's utilities are
194
194
  emitted after this package's stylesheet.
195
195
 
196
+ #### Overlay stacking
197
+
198
+ Overlays render in a portal at the end of `<body>`, so they stack against the
199
+ host's own fixed and sticky chrome — a header, a side sheet, an embedding
200
+ overlay. They sit on a four-step ladder driven by one variable:
201
+
202
+ | Layer | Utility | `z-index` | Components |
203
+ | ----------------- | ----------------------- | -------------------------- | ---------------------------------------------------------------- |
204
+ | Popup | `z-popup` | `var(--z-overlay, 52)` | `Popup` backdrop, both generations |
205
+ | Floating panel | `z-floating` | `--z-overlay` + 1 | `Dropdown` and `Select` overlays, submenus, `Calendar` |
206
+ | Interactive panel | `z-interactive-tooltip` | `--z-overlay` + 2 | `InteractiveTooltip` |
207
+ | Tooltip | `z-tooltip` | `--z-overlay` + 3 | `Tooltip`, both generations |
208
+
209
+ To lift every overlay above a host layer, set the base once:
210
+
211
+ ```css
212
+ :root {
213
+ --z-overlay: 1000; /* popup 1000, dropdown 1001, interactive tooltip 1002, tooltip 1003 */
214
+ }
215
+ ```
216
+
217
+ Each layer is a fixed step above the one below, so raising the base never
218
+ reorders them: a dropdown still opens above the popup it sits in, and a tooltip
219
+ above the dropdown row that triggered it. Set the variable on `:root`, or in the
220
+ class a `ThemeScope` re-applies to its portalled overlays — a portal escapes any
221
+ other wrapper, so a value set only there never reaches the overlay.
222
+
223
+ A single overlay can still be moved on its own: a `z-*` utility passed to a
224
+ `Dropdown`'s `listClassName`, a `Popup`'s `overlayClassName`, an
225
+ `InteractiveTooltip`'s `contentClassName` or a `Calendar`'s `panelClassName`
226
+ replaces the layer's own step rather than landing beside it, because
227
+ `mergeClasses` knows the ladder utilities are z-index.
228
+
196
229
  ### Public class names
197
230
 
198
231
  Some hosts need to restyle a part of a component the props do not reach — the
package/dist/CHANGELOG.md CHANGED
@@ -15,6 +15,10 @@ Versions match the git tags on the `development` branch.
15
15
 
16
16
  Nothing in `dist/index.css` selects on any of them — they carry no declarations and exist only as selectors, so this is not a visual change and a host rule needs no `!important` it would not otherwise need. A row's class sits on the element that draws the row box, which is the wrapper rather than the inner button for a `MenuItem` with a `rightControl`; a `ProgressBar` with neither label nor readout returns its track as its own root, and the class follows it there. Components whose target element already carries a stable `dial-kit-*` class have no entry, because a second name for one thing is worse than none: `Button` and `IconButton` with their variant wrappers, `FabButton`, `Input`, `Textarea`, `Slider`, `MarkdownEditor` and `Grid`. A `Dropdown`'s floating panel, a `Popup`'s backdrop and the `DialDropdownIcon` trigger button keep being reached through `listClassName`, `overlayClassName` and `buttonClassName`. See the README for the full table. Requested in [ai-dial-chat#8707](https://github.com/epam/ai-dial-chat/issues/8707), the counterpart of the `dial-*` classes that issue adds to the chat libraries.
17
17
 
18
+ - **Overlay stacking token, `--z-overlay`** — every portalled overlay was a hardcoded Tailwind literal (`z-[52]` for the `Popup` backdrop, `z-[53]` for dropdown and select overlays, submenus and the `Calendar`, `z-[54]` for `InteractiveTooltip`, `z-[55]` for `Tooltip`), so a host whose own overlay or sticky header sits higher had no documented way to lift the kit's menus above it and fell back to `[role='menu']` and `z-[52]` overrides. The four layers are now theme steps — `z-popup`, `z-floating`, `z-interactive-tooltip`, `z-tooltip` — computed from one variable as base, +1, +2 and +3, so setting `--z-overlay` on `:root` (or in a `ThemeScope` class) moves the whole ladder without reordering it. The fallback is `52`, which reproduces today's values exactly: a host that sets nothing sees no change. `mergeClasses` registers the four steps as z-index, so a `z-*` a caller passes through `listClassName`, `overlayClassName`, `contentClassName` or `panelClassName` still replaces the layer's step rather than landing beside it. See the README's _Overlay stacking_ section. Requested in [ai-dial-chat#8943](https://github.com/epam/ai-dial-chat/issues/8943).
19
+
20
+ - **`Dropdown` (2.0) — `listStyle`** — the floating panel renders in a portal at the end of `<body>`, so CSS custom properties a caller sets on its own wrapper never reach the panel's rows or `menuHeader`, and `listClassName` can carry a class but not a runtime value. A wrapping component that themes its menu through `var(--…)` — a composer's model picker colouring its selected row and check — had no way to deliver the values. `listStyle` is an inline style on that panel. Positioning stays the dropdown's own: `floatingStyles` is applied on top, so a caller's `position`, `top` or `transform` cannot unanchor it. Additive; nothing renders differently without it. Requested in [ai-dial-chat#8943](https://github.com/epam/ai-dial-chat/issues/8943).
21
+
18
22
  - **`FilterChips` (2.0)** — a row of filter chips that picks one value out of a few, the chip-shaped sibling of `Tabs` and `SegmentedControl`. It draws `TagAppearance.Selectable` tags: no fill until selected, a semibold label once selected. Each chip is a toggle button carrying its state on `aria-pressed` inside a named `role="group"`, so every chip is its own tab stop and arrowing across the row never changes the filter by accident — unlike a `radiogroup`. `stretch` grows the chips to share the row width equally for a filter row spanning a side panel; without it they hug their labels. There is no disabled chip: an option the user must not pick is left out of `items`. Labels carry no English defaults, so the caller translates them. The row carries the public class `dial-kit-filter-chips` (`DIAL_KIT_CLASS.filterChips`); its chips are `Tag` pills, so they carry `dial-kit-tag`.
19
23
 
20
24
  - **`Tabs` — `tabListClassName`, and a public class on the selected tab** — `className` lands on whichever element is outermost, so a `Tabs` with a `sectionLabel` left its `role="tablist"` unreachable: a caller wanting to repad the list had to choose between that and styling the wrapper. `tabListClassName` reaches the list in either case, and is additive to `className` when there is no heading and the two elements are one. The selected tab now also carries `dial-kit-tab-selected` (`DIAL_KIT_CLASS.tabSelected`) in both orientations, additive to `dial-kit-tab` — a wrapping component could mark a tab but not its selection, since the horizontal row's `dial-kit-tab-selected-underline` carries the gradient rule and the vertical rail draws its selection in Tailwind utilities alone. Like every entry in the record it carries no declarations. Both are additive: nothing renders differently.
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react/jsx-runtime"),g=require("./DateCellRenderer-Cm09x2e4.cjs"),U=require("@tabler/icons-react"),a=require("react"),x=require("./merge-classes-BEJXjzkx.cjs"),p=require("@floating-ui/react"),ge=require("./icon-DhjrDQ8I.cjs"),ne=require("./icon-CrGVkVpG.cjs"),C=require("./IconButton-CVttu-k-.cjs"),mt=require("classnames");function ft(e){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return s.default=e,Object.freeze(s)}const de=ft(a);var he=(e=>(e.Top="top",e.Right="right",e.Bottom="bottom",e.Left="left",e))(he||{});const pt=7,Ct=2,gt=500,ht="fill-control-inverted",xt="z-tooltip 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",Ge=a.createContext(null),ze=()=>{const e=a.useContext(Ge);if(e==null)throw new Error("Tooltip components must be wrapped in <TooltipContainer />");return e},bt=({initialOpen:e=!1,placement:s=he.Bottom,isTriggerClickable:n=!1,open:r,onOpenChange:i}={})=>{const[u,l]=a.useState(e),d=a.useRef(null),m=r??u,h=i??l,S=p.useFloating({placement:s,open:m,onOpenChange:h,whileElementsMounted:p.autoUpdate,middleware:[p.offset(pt+Ct),p.flip({fallbackAxisSideDirection:"start",padding:5}),p.shift({padding:5}),p.arrow({element:d})]}),f=p.useHover(S.context,{move:!1,enabled:r==null,mouseOnly:n,delay:{open:gt,close:0}}),I=p.useFocus(S.context,{enabled:r==null}),E=p.useDismiss(S.context),A=p.useRole(S.context,{role:"tooltip"}),k=p.useInteractions([f,I,E,A]);return a.useEffect(()=>{if(!m)return;const y=S.refs.reference.current;if(!(y instanceof Element))return;const T=new IntersectionObserver(([M])=>{M.isIntersecting||h(!1)},{root:null,threshold:0});return T.observe(y),()=>T.disconnect()},[m,S.refs.reference,h]),a.useMemo(()=>({open:m,setOpen:h,arrowRef:d,...k,...S}),[m,h,k,S])},Le=({children:e,...s})=>{const n=bt(s);return t.jsx(Ge.Provider,{value:n,children:e})},Re=({style:e,...s})=>{const n=ze(),r=C.useHasHover(),i=g.useThemeScope(),u=a.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:mt(xt,i,n.getFloatingProps(s).className,g.DIAL_KIT_CLASS.tooltip),children:[s.children,t.jsx(p.FloatingArrow,{ref:n.arrowRef,context:n.context,className:ht})]})})},we=({children:e,asChild:s=!1,...n})=>{const r=ze(),i=s&&a.isValidElement(e),u=i?e.props?.ref:null,l=p.useMergeRefs([r.refs.setReference,...u?[u]:[]]);if(i){const d=e.props;return a.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})},Ze=({hideTooltip:e=!1,tooltip:s,children:n,asChild:r=!1,triggerClassName:i,contentClassName:u,...l})=>{const d=!e&&!!s;return t.jsxs(Le,{...l,children:[t.jsx(we,{asChild:r,className:i,children:n}),d&&t.jsx(Re,{className:u,children:s})]})},Be={[C.ButtonVariant.Primary]:{[C.ButtonAppearance.Solid]:"dial-kit-primary-solid-button",[C.ButtonAppearance.Ghost]:"dial-kit-primary-ghost-button",[C.ButtonAppearance.Link]:"dial-kit-primary-link-button"},[C.ButtonVariant.Neutral]:{[C.ButtonAppearance.Solid]:"dial-kit-neutral-solid-button",[C.ButtonAppearance.Outlined]:"dial-kit-neutral-outlined-button"},[C.ButtonVariant.Danger]:{[C.ButtonAppearance.Solid]:"dial-kit-danger-solid-button",[C.ButtonAppearance.Ghost]:"dial-kit-danger-ghost-button",[C.ButtonAppearance.Outlined]:"dial-kit-danger-outlined-button"},[C.ButtonVariant.Static]:{[C.ButtonAppearance.Solid]:"dial-kit-static-solid-button"},[C.ButtonVariant.Success]:{},[C.ButtonVariant.Secondary]:{},[C.ButtonVariant.Tertiary]:{}},We=(e=C.ButtonVariant.Primary,s=C.ButtonAppearance.Solid)=>{const n=Be[e]?.[s];return n||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${s}. Using default primary solid button styles.`),Be[C.ButtonVariant.Primary][C.ButtonAppearance.Solid])},St={[C.ElementSize.Small]:"size-[24px]",[C.ElementSize.Standard]:"size-[40px] dial-kit-enhanced-target",[C.ElementSize.Large]:"size-[48px] dial-kit-enhanced-target"},xe=({variant:e,appearance:s=C.ButtonAppearance.Solid,size:n=C.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&&We(e,s),St[n],r),h=t.jsx("button",{...d,type:l,className:m,"aria-label":C.resolveAccessibleName(d["aria-label"],u?.tooltip),children:i});return u?t.jsx(Ze,{asChild:!0,...u,children:h}):h},Ke=({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",g.DIAL_KIT_CLASS.infoButton);return t.jsx(xe,{"aria-label":n,className:r,icon:t.jsx(U.IconInfoCircle,{size:ne.DIAL_ICON_SIZE.SM,stroke:ge.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),onClick:s,size:C.ElementSize.Small,tooltipProps:{tooltip:e}})},De=({label:e,required:s,className:n,containerClassName:r,caption:i,size:u=C.ElementSize.Small,...l})=>e?t.jsxs("span",{className:x.mergeClasses("flex items-center gap-0.5",r,g.DIAL_KIT_CLASS.label),children:[t.jsxs("label",{...l,className:x.mergeClasses("text-secondary flex items-center gap-0.5",u===C.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(Ke,{caption:i})]}):null;var O=(e=>(e.None="none",e.Check="check",e.Tint="tint",e.Checkbox="checkbox",e.Highlight="highlight",e))(O||{});const je=(e,s)=>({appearance:r,...i})=>t.jsx(xe,{...i,variant:e,appearance:r||s}),Ue=(e,s)=>({variant:r,...i})=>t.jsx(xe,{...i,variant:r||s,appearance:e}),It=je(C.ButtonVariant.Primary,C.ButtonAppearance.Solid),Nt=je(C.ButtonVariant.Neutral,C.ButtonAppearance.Solid),vt=je(C.ButtonVariant.Danger,C.ButtonAppearance.Ghost),$e=Ue(C.ButtonAppearance.Ghost,C.ButtonVariant.Primary),Et=Ue(C.ButtonAppearance.Solid,C.ButtonVariant.Static),qe=({ariaLabel:e="Close",className:s,size:n=C.ElementSize.Small,onClose:r,...i})=>t.jsx($e,{...i,size:n,"aria-label":e,className:x.mergeClasses(s,g.DIAL_KIT_CLASS.closeButton),onClick:r,icon:t.jsx(U.IconX,{size:n===C.ElementSize.Small?ne.DIAL_ICON_SIZE.SM:ne.DIAL_ICON_SIZE.MD,stroke:ge.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"})}),yt=e=>{const s=a.useRef(null),[n,r]=a.useState(!1),[i,u]=a.useState(""),l=a.useRef(!1),d=a.useCallback(()=>{const h=s.current;h&&(l.current&&u(h.textContent??""),r(h.scrollWidth>h.clientWidth))},[]),m=a.useCallback(()=>g.scheduleMeasure(d),[d]);return a.useEffect(()=>{const h=s.current;if(h)return g.observeElementSize(h,d)},[d]),a.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:S}=yt(e),f=typeof e=="string"?e:h,I=a.useMemo(()=>r||!m?null:u??f,[u,f,r,m]);return t.jsxs(Le,{...l,children:[t.jsx(we,{asChild:!0,onMouseEnter:S,onFocusCapture:S,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,g.DIAL_KIT_CLASS.ellipsisTooltip),children:e})}),!!I&&t.jsx(Re,{className:n,children:I})]})},Tt=8,_t=400,At="z-interactive-tooltip max-w-[320px] rounded-xl bg-layer-0 p-4 dial-small-text text-primary shadow-md",fe=({content:e,placement:s=he.Right,children:n,asChild:r=!1,hideTooltip:i=!1,initialOpen:u=!1,open:l,onOpenChange:d,triggerClassName:m,contentClassName:h})=>{const S=g.useIsMobileScreen(),f=g.useThemeScope(),[I,E]=a.useState(u),A=l??I,k=j=>{d?.(j),l==null&&E(j)},y=p.useFloatingNodeId(),{refs:T,floatingStyles:M,context:R}=p.useFloating({nodeId:y,placement:s,open:A,onOpenChange:k,whileElementsMounted:p.autoUpdate,middleware:[p.offset(Tt),p.flip({padding:5}),p.shift({padding:5})]}),$=p.useHover(R,{enabled:l==null,handleClose:p.safePolygon(),delay:{open:_t,close:0}}),w=p.useFocus(R,{enabled:l==null}),F=p.useDismiss(R),{getReferenceProps:V,getFloatingProps:v}=p.useInteractions([$,w,F]),q=a.useRef(null),Q=p.useMergeRefs(a.useMemo(()=>[T.setFloating,q],[T.setFloating])),X=r&&a.isValidElement(n),P=X?n.props?.ref:null,G=p.useMergeRefs(a.useMemo(()=>[T.setReference,...P?[P]:[]],[T.setReference,P])),L=!i&&!S&&!!e,D=X?a.cloneElement(n,V({...n.props,ref:G,className:x.mergeClasses(n.props.className,m)||void 0})):t.jsx("span",{ref:G,...V(),className:m??"text-start",children:n});return t.jsxs(t.Fragment,{children:[D,A&&L&&t.jsx(p.FloatingPortal,{id:"interactive-tooltip-portal",children:t.jsx(p.FloatingFocusManager,{context:R,modal:!1,initialFocus:-1,returnFocus:!1,order:["reference","content"],children:t.jsx("div",{ref:Q,"data-placement":R.placement,style:M,...v(),className:x.mergeClasses(At,f,h,g.DIAL_KIT_CLASS.interactiveTooltip),children:e})})})]})},Xe="rounded-xl bg-layer-raised p-1 shadow-md",Ye=x.mergeClasses(Xe,"w-max"),Je=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"),Qe="bg-control-accent-alpha",kt=x.mergeClasses(Qe,"text-accent"),Lt=x.mergeClasses("cursor-not-allowed text-control-disable-primary","bg-transparent hover:bg-transparent"),et=4,Rt=x.mergeClasses("flex items-center gap-2 align-middle","h-auto px-0 bg-transparent border-0"),wt=x.mergeClasses("z-floating focus-visible:outline-none",Xe),Dt=Ye,jt="my-1 border-t border-tertiary",J=et,Ht=t.jsx(U.IconChevronRight,{size:ne.DIAL_ICON_SIZE.SM,stroke:ge.DIAL_KIT_ICON_STROKE,"aria-hidden":"true"}),Fe={size:14,stroke:3,"aria-hidden":!0},He=({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,g.DIAL_KIT_CLASS.checkboxBox),h=s?t.jsx(U.IconMinus,{...Fe}):e&&t.jsx(U.IconCheck,{...Fe});return d?t.jsx("label",{htmlFor:i,className:m,children:h}):t.jsx("span",{"aria-hidden":"true",className:m,children:h})},Ot=t.jsx(U.IconCheck,{size:ne.DIAL_ICON_SIZE.SM,stroke:ge.DIAL_KIT_ICON_STROKE,className:`shrink-0 ${g.DIAL_KIT_CLASS.menuItemCheck}`,"aria-hidden":!0}),pe=({label:e,icon:s,description:n,mark:r=O.None,selected:i=!1,danger:u=!1,trailing:l,rightControl:d,ellipsisLabel:m=!1,labelClassName:h,children:S,className:f,disabled:I=!1,type:E="button",...A})=>{const k=i&&r===O.Highlight,y=i&&(r===O.Checkbox||r===O.Tint),T=x.mergeClasses(u&&"text-error",I&&"text-control-disable-primary"),M=x.mergeClasses(Je,"aria-expanded:bg-control-accent-alpha-hover",k&&kt,y&&Qe,I&&Lt,u&&"text-error",f,g.DIAL_KIT_CLASS.menuItem),R=t.jsxs("button",{type:E,disabled:I,"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":M,...A,children:[S??t.jsxs(t.Fragment,{children:[r===O.Checkbox&&t.jsx(He,{isSelected:i,disabled:I}),s&&t.jsx(g.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",I&&"text-control-disable-primary"),children:n}),i&&r===O.Check&&Ot]}),l&&t.jsx("span",{className:x.mergeClasses("ml-auto shrink-0",T),children:l})]});return d?t.jsxs("div",{role:"none",className:x.mergeClasses(M,"has-[[data-menu-item-row]:focus-visible]:outline","has-[[data-menu-item-row]:focus-visible]:outline-focus"),children:[R,d]}):R},Ce=e=>e.mark??(e.selectable?O.Checkbox:O.None),tt=e=>e.selectable?"menuitemcheckbox":Ce(e)===O.Check?"menuitemradio":"menuitem",Mt=({item:e,onRootClose:s})=>{const{isOpen:n,nodeId:r,refs:i,floatingStyles:u,context:l,getReferenceProps:d,getFloatingProps:m}=g.useSubMenuFloating(J,"menu",!!e.disabled),h=a.useCallback(f=>I=>{f.disabled||(f.onClick?.({key:f.key,domEvent:I}),f.selectable||s())},[s]),S=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:Ht,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:S}):S,n&&t.jsx(g.SubMenuPanel,{refs:i,floatingStyles:u,context:l,getFloatingProps:m,role:"menu",surfaceClassName:Dt,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 I=tt(f),E=t.jsx(pe,{role:I,"aria-checked":I==="menuitem"?void 0:!!f.checked,"aria-current":Ce(f)===O.Highlight&&f.checked?!0:void 0,"aria-disabled":!!f.disabled,disabled:f.disabled,mark:Ce(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(a.Fragment,{children:f.interactiveTooltip?t.jsx(fe,{asChild:!0,placement:f.interactiveTooltip.placement,content:f.interactiveTooltip.content,contentClassName:f.interactiveTooltip.contentClassName,children:E}):E},f.key)}),e.menuFooter&&(typeof e.menuFooter=="function"?e.menuFooter():e.menuFooter)]})})]})},Bt='[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"], [role="option"]',Ft=e=>!e.hasAttribute("disabled")&&e.getAttribute("aria-disabled")!=="true",Vt=["ArrowDown","ArrowUp","Home","End"],Pt=(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},Gt=e=>"clientWidth"in e?e.clientWidth:e.getBoundingClientRect?.()?.width??0,nt=({children:e,items:s,onItemClick:n,menuHeader:r,menuFooter:i,renderOverlay:u,trigger:l=[g.DropdownTrigger.Click],placement:d,disabled:m=!1,open:h,defaultOpen:S=!1,onOpenChange:f,closable:I=!1,onClose:E,className:A,overlayContentClassName:k,separatorClassName:y,listClassName:T,listStyle:M,outsidePressIgnoreRef:R,outsideClosable:$=!0,allowedPlacements:w,anchorToMouse:F=!1,matchReferenceWidth:V=!0,maxDropdownHeight:v,initialFocus:q})=>{const Q=g.useThemeScope(),[X,P]=a.useState(S),G=h!==void 0,L=G?!!h:X,D=a.useRef(null),[j,se]=a.useState(!0),_=a.useCallback((c,o,b)=>{c&&se(b!=="hover"&&b!=="safe-polygon"),G||P(c),f?.(c)},[G,f]),re=a.useId(),Se=d===void 0,oe=p.useFloatingNodeId(),{refs:H,floatingStyles:K,context:z}=p.useFloating({nodeId:oe,placement:d,open:L,onOpenChange:_,whileElementsMounted:p.autoUpdate,middleware:[p.offset({mainAxis:J,crossAxis:0}),Se?p.autoPlacement({alignment:"start",crossAxis:!0,padding:J,allowedPlacements:w}):p.flip({padding:J}),p.shift({padding:J}),p.size({padding:J,apply({availableWidth:c,availableHeight:o,elements:b}){const N=b.floating,B=Gt(b.reference);N.style.setProperty("--fui-available-height",`${Math.floor(o)}px`),N.style.setProperty("--reference-width",V?`${Math.round(B)}px`:"0px"),V?N.style.minWidth=`${Math.round(B)}px`:N.style.removeProperty("min-width"),N.style.maxWidth=`${Math.floor(c)}px`;const te=Math.floor(o);N.style.maxHeight=`${v?Math.min(te,v):te}px`}})]}),Y=p.useClick(z,{enabled:l.includes(g.DropdownTrigger.Click)&&!m}),Ie=p.useHover(z,{enabled:l.includes(g.DropdownTrigger.Hover)&&!m,move:!1,restMs:40,handleClose:p.safePolygon(),delay:{open:80,close:80}}),ee=p.useDismiss(z,{bubbles:!0,referencePress:!1,outsidePress:c=>{if(!$)return!1;const o=c.target;return!(R?.current&&o instanceof Node&&R.current.contains(o))}}),ae=p.useRole(z,{role:"menu"}),{getReferenceProps:Ne,getFloatingProps:le}=p.useInteractions([Y,Ie,ee,ae]),Z=a.useCallback((c,o)=>{H.setPositionReference({getBoundingClientRect:()=>({width:0,height:0,x:c,y:o,top:o,left:c,right:c,bottom:o})})},[H]),ve=a.useCallback(c=>{!l.includes(g.DropdownTrigger.ContextMenu)||m||(c.preventDefault(),F&&(Z(c.clientX,c.clientY),D.current=document.elementFromPoint(c.clientX,c.clientY)),_(!0))},[F,m,_,Z,l]),Ee=a.useCallback(c=>{!F||m||(l.includes(g.DropdownTrigger.ContextMenu)&&L&&_(!1),Z(c.clientX,c.clientY),D.current=document.elementFromPoint(c.clientX,c.clientY))},[F,m,Z,L,l,_]);a.useEffect(()=>{m&&L&&_(!1)},[m,L,_]);const ye=a.useCallback(c=>{if(c.defaultPrevented||!Vt.includes(c.key))return;const o=Array.from(c.currentTarget.querySelectorAll(Bt)).filter(Ft);if(o.length===0)return;c.preventDefault();const b=c.currentTarget.ownerDocument.activeElement,N=o.findIndex(B=>B===b);o[Pt(c.key,N,o.length)]?.focus()},[]),ce=a.useCallback(c=>o=>{c.disabled||(c.onClick?.({key:c.key,domEvent:o}),n?.({key:c.key,domEvent:o}),c.selectable||_(!1))},[n,_]),ie=a.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",k,g.DIAL_KIT_CLASS.dropdownList),"aria-label":"dropdown",children:s.map(c=>{if(c.type===g.DropdownItemType.Divider)return t.jsx("div",{role:"separator",className:x.mergeClasses(jt,y)},c.key);if(c.type===g.DropdownItemType.PlainText)return t.jsx("div",{className:x.mergeClasses("px-3 py-2 text-secondary dial-caption-text",c.className),children:c.label},c.key);if(c.children?.length)return t.jsx(Mt,{item:c,onRootClose:()=>_(!1)},c.key);const o=Ce(c),b=tt(c),N=t.jsx(pe,{role:b,"aria-checked":b==="menuitem"?void 0:!!c.checked,"aria-current":o===O.Highlight&&c.checked?!0:void 0,"aria-disabled":!!c.disabled,disabled:c.disabled,mark:o,selected:!!c.checked,danger:c.danger,icon:c.icon,label:c.label,className:c.className,rightControl:c.rightControl,onClick:ce(c),children:c.renderItem?.(c)});return t.jsx(a.Fragment,{children:c.interactiveTooltip?t.jsx(fe,{asChild:!0,placement:c.interactiveTooltip.placement,content:c.interactiveTooltip.content,contentClassName:c.interactiveTooltip.contentClassName,children:N}):N},c.key)})}),i&&t.jsx(t.Fragment,{children:typeof i=="function"?i():i})]}):null,[ce,s,i,r,u,_,k,y]),Te=Ne({onContextMenu:ve,onMouseDown:Ee});return a.useEffect(()=>{if(!L)return;const c=H.reference.current;let o=null;if(c instanceof Element?o=c:D.current instanceof Element&&(o=D.current),!o)return;const b=new IntersectionObserver(([N])=>{N.isIntersecting||_(!1)},{root:null,threshold:0});return b.observe(o),()=>b.disconnect()},[L,H.reference,_]),t.jsx(p.FloatingTree,{children:t.jsxs(p.FloatingNode,{id:oe,children:[t.jsx("span",{ref:H.setReference,className:x.mergeClasses(Rt,m&&"!cursor-not-allowed opacity-75",A,g.DIAL_KIT_CLASS.dropdown),"aria-haspopup":"menu","aria-expanded":L,"aria-controls":re,...Te,children:e}),L&&t.jsx(p.FloatingPortal,{children:t.jsx(p.FloatingFocusManager,{context:z,modal:!1,initialFocus:q!==void 0?q:j?0:-1,returnFocus:!0,children:t.jsxs("div",{id:re,ref:H.setFloating,style:M?{...M,...K}:K,className:x.mergeClasses(wt,!V&&"w-max","overflow-auto",Q,T),...le({onKeyDown:ye}),children:[I&&t.jsx("div",{className:"flex items-center justify-between px-2 pt-2",children:t.jsx(qe,{ariaLabel:"Close dropdown",onClose:c=>{E?.(c),_(!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,...S})=>{const f=a.useId(),I=e??f,E=d?`${I}-caption`:void 0,A=a.useCallback(y=>{l?.(y.target.checked)},[l]),k=a.useCallback(y=>{y&&(y.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,g.DIAL_KIT_CLASS.checkbox),children:[t.jsx("input",{...S,ref:k,type:"checkbox",id:I,checked:n,disabled:u,onChange:A,"aria-checked":r?"mixed":n,"aria-invalid":i||void 0,"aria-label":C.resolveAccessibleName(typeof s?.label!="string"?S["aria-label"]:void 0),"aria-describedby":E,className:"peer sr-only"}),t.jsx(He,{htmlFor:I,isSelected:n,isIndeterminate:r,invalid:i,disabled:u,className:h}),s&&t.jsx(De,{size:C.ElementSize.Standard,...s,htmlFor:I,className:x.mergeClasses("py-[1px]",u?"cursor-not-allowed text-control-disable-primary":"cursor-pointer text-primary",s.className)})]}),d&&t.jsx("span",{id:E,className:"dial-tiny-text text-secondary ml-[28px]",children:d})]})},st=e=>de.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},de.createElement("path",{d:"M20.2954 16.7035C20.2954 17.088 20.6029 17.4069 20.9737 17.4069C21.3445 17.4069 21.6519 17.088 21.6519 16.7035C21.6519 16.3189 21.3445 16 20.9737 16C20.6029 16 20.2954 16.3189 20.2954 16.7035Z",fill:"currentColor"}),de.createElement("path",{d:"M11.7041 16.7035C11.7041 17.088 11.3966 17.4069 11.0258 17.4069C10.655 17.4069 10.3476 17.088 10.3476 16.7035C10.3476 16.3189 10.655 16 11.0258 16C11.3966 16 11.7041 16.3189 11.7041 16.7035Z",fill:"currentColor"}),de.createElement("path",{d:"M19.0221 2.40002L19.5525 1.86969C19.4118 1.72904 19.221 1.65002 19.0221 1.65002V2.40002ZM26.5777 9.95558H27.3277C27.3277 9.75667 27.2487 9.5659 27.108 9.42525L26.5777 9.95558ZM5.42212 29.6H4.67212C4.67212 30.0142 5.00791 30.35 5.42212 30.35V29.6ZM8.44434 2.40002V1.65002V2.40002ZM13.8932 19.5173C13.8932 19.9315 14.229 20.2673 14.6432 20.2673C15.0574 20.2673 15.3932 19.9315 15.3932 19.5173H14.6432H13.8932ZM16.6063 19.5173C16.6063 19.9315 16.9421 20.2673 17.3563 20.2673C17.7705 20.2673 18.1063 19.9315 18.1063 19.5173H17.3563H16.6063ZM19.0221 2.40002H18.2721V8.44447H19.0221H19.7721V2.40002H19.0221ZM19.0221 8.44447H18.2721C18.2721 9.04415 18.5103 9.61927 18.9344 10.0433L19.4647 9.51299L19.995 8.98266C19.8523 8.83992 19.7721 8.64633 19.7721 8.44447H19.0221ZM19.4647 9.51299L18.9344 10.0433C19.3584 10.4674 19.9335 10.7056 20.5332 10.7056V9.95558V9.20558C20.3314 9.20558 20.1378 9.12539 19.995 8.98266L19.4647 9.51299ZM20.5332 9.95558V10.7056H26.5777V9.95558V9.20558H20.5332V9.95558ZM5.42212 29.6H6.17212V5.42225H5.42212H4.67212V29.6H5.42212ZM5.42212 5.42225H6.17212C6.17212 4.81962 6.41151 4.24167 6.83764 3.81554L6.30731 3.28521L5.77698 2.75488C5.06955 3.46231 4.67212 4.42179 4.67212 5.42225H5.42212ZM6.30731 3.28521L6.83764 3.81554C7.26376 3.38942 7.84171 3.15002 8.44434 3.15002V2.40002V1.65002C7.44389 1.65002 6.48441 2.04745 5.77698 2.75488L6.30731 3.28521ZM8.44434 2.40002V3.15002H19.0221V2.40002V1.65002H8.44434V2.40002ZM19.0221 2.40002L18.4918 2.93035L26.0473 10.4859L26.5777 9.95558L27.108 9.42525L19.5525 1.86969L19.0221 2.40002ZM26.5777 9.95558H25.8277V26.5778H26.5777H27.3277V9.95558H26.5777ZM26.5777 26.5778H25.8277C25.8277 27.1804 25.5883 27.7584 25.1622 28.1845L25.6925 28.7148L26.2228 29.2452C26.9302 28.5377 27.3277 27.5783 27.3277 26.5778H26.5777ZM25.6925 28.7148L25.1622 28.1845C24.736 28.6106 24.1581 28.85 23.5555 28.85V29.6V30.35C24.5559 30.35 25.5154 29.9526 26.2228 29.2452L25.6925 28.7148ZM23.5555 29.6V28.85H5.42212V29.6V30.35H23.5555V29.6ZM20.9737 16V16.75C20.9388 16.75 20.9181 16.7345 20.9119 16.7281C20.906 16.722 20.9019 16.7133 20.9019 16.7035H21.6519H22.4019C22.4019 15.9307 21.7842 15.25 20.9737 15.25V16ZM21.6519 16.7035H20.9019C20.9019 16.6936 20.906 16.685 20.9119 16.6788C20.9181 16.6724 20.9388 16.6569 20.9737 16.6569V17.4069V18.1569C21.7842 18.1569 22.4019 17.4762 22.4019 16.7035H21.6519ZM20.9737 17.4069V16.6569C21.0086 16.6569 21.0292 16.6724 21.0354 16.6788C21.0414 16.685 21.0454 16.6936 21.0454 16.7035H20.2954H19.5454C19.5454 17.4762 20.1631 18.1569 20.9737 18.1569V17.4069ZM20.2954 16.7035H21.0454C21.0454 16.7133 21.0414 16.722 21.0354 16.7281C21.0292 16.7345 21.0086 16.75 20.9737 16.75V16V15.25C20.1631 15.25 19.5454 15.9307 19.5454 16.7035H20.2954ZM11.0258 16V16.75C10.9909 16.75 10.9703 16.7345 10.9641 16.7281C10.9582 16.722 10.9541 16.7133 10.9541 16.7035H11.7041H12.4541C12.4541 15.9307 11.8364 15.25 11.0258 15.25V16ZM11.7041 16.7035H10.9541C10.9541 16.6936 10.9582 16.685 10.9641 16.6788C10.9703 16.6724 10.9909 16.6569 11.0258 16.6569V17.4069V18.1569C11.8364 18.1569 12.4541 17.4762 12.4541 16.7035H11.7041ZM11.0258 17.4069V16.6569C11.0607 16.6569 11.0814 16.6724 11.0876 16.6788C11.0935 16.685 11.0976 16.6936 11.0976 16.7035H10.3476H9.59757C9.59757 17.4762 10.2153 18.1569 11.0258 18.1569V17.4069ZM10.3476 16.7035H11.0976C11.0976 16.7133 11.0935 16.722 11.0876 16.7281C11.0814 16.7345 11.0607 16.75 11.0258 16.75V16V15.25C10.2153 15.25 9.59757 15.9307 9.59757 16.7035H10.3476ZM14.6432 19.5173H15.3932C15.3932 19.127 15.6889 18.8604 15.9998 18.8604V18.1104V17.3604C14.8094 17.3604 13.8932 18.3506 13.8932 19.5173H14.6432ZM15.9998 18.1104V18.8604C16.3106 18.8604 16.6063 19.127 16.6063 19.5173H17.3563H18.1063C18.1063 18.3506 17.1901 17.3604 15.9998 17.3604V18.1104Z",fill:"currentColor"})),rt=({id:e,name:s,value:n,labelProps:r,isSelected:i=!1,disabled:u,onChange:l,caption:d,className:m,...h})=>{const S=a.useId(),f=e??S,I=d?`${f}-caption`:void 0,E=a.useCallback(A=>{A.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,g.DIAL_KIT_CLASS.radio),children:[t.jsx("input",{...h,type:"radio",id:f,name:s,value:n,checked:i,disabled:u,onChange:E,"aria-label":C.resolveAccessibleName(typeof r?.label!="string"?h["aria-label"]:void 0),"aria-describedby":I,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(De,{size:C.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:I,className:"dial-tiny-text text-secondary ml-[26px]",children:d})]})},Ve=32,ot=({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,g.DIAL_KIT_CLASS.noDataContent),children:[n??t.jsx(st,{width:Ve,height:Ve,"aria-hidden":"true"}),t.jsx("span",{className:x.mergeClasses("dial-tiny-text text-secondary",u),children:e}),s&&t.jsx("span",{className:x.mergeClasses("dial-tiny-text text-secondary",l),children:s})]}),at="dial-kit-grid",zt="dial-kit-grid-with-selection",Zt="dial-kit-grid-without-header-borders",Wt="dial-kit-grid-row-select",Kt="dial-kit-grid-header-select",Ut="dial-kit-grid-selection-visible",$t="dial-kit-grid-align-right",ke=40,_e="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:_e,headerRowBorder:_e,headerColumnBorder:_e,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 W=(e=>(e.API="api",e.ROW_DATA_CHANGED="rowDataChanged",e.CHECKBOX_SELECTED="checkboxSelected",e))(W||{});const qt=({params:e,mode:s,label:n,radioName:r,rowId:i,disabled:u})=>{const l=e.node,[d,m]=a.useState(()=>!!l.isSelected());a.useEffect(()=>{const S=()=>m(!!l.isSelected());return S(),l.addEventListener("rowSelected",S),()=>l.removeEventListener("rowSelected",S)},[l]);const h=S=>{u||l.setSelected(S,s===g.GridSelectionMode.SINGLE,W.CHECKBOX_SELECTED)};return s===g.GridSelectionMode.SINGLE?t.jsx(rt,{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})},Pe=e=>{let s=0,n=0;return e.forEachNodeAfterFilter(r=>{r.selectable!==!1&&(n++,r.isSelected()&&s++)}),{selected:s,selectable:n}},Xt=({api:e,label:s})=>{const[{selected:n,selectable:r},i]=a.useState(()=>Pe(e));a.useEffect(()=>{const l=()=>i(Pe(e));return l(),e.addEventListener("selectionChanged",l),e.addEventListener("modelUpdated",l),()=>{e.isDestroyed()||(e.removeEventListener("selectionChanged",l),e.removeEventListener("modelUpdated",l))}},[e]);const u=a.useCallback(l=>{if(l){e.selectAll("filtered",W.CHECKBOX_SELECTED);return}e.deselectAll("filtered",W.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})},lt="en-US",ct={year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"},Ae=40,Yt={minWidth:Ae,width:Ae,maxWidth:Ae,resizable:!1,sortable:!1,filter:!1,floatingFilter:!1,suppressMovable:!0,suppressHeaderMenuButton:!0,suppressAutoSize:!0,suppressSizeToFit:!0},it="dial-kit-grid-selection",Jt=150,Qt=100,en=({columnDefs:e,rowData:s,additionalGridOptions:n,getContextMenuItems:r,className:i,ariaLabel:u="Data grid",wrapCustomCellRenderers:l=!0,disabledRowIds:d,selectedRowIds:m,onSelectionChange:h,onGridApiChange:S,getRowId:f,alternateOddRowColors:I=!1,filterPlaceholder:E="Enter value",emptyStateIcon:A,emptyStateTitle:k="No results found",emptyStateDescription:y="Sorry, we couldn't find any results for your search.",loading:T=!1,wrapperBorder:M=!0,withoutHeaderBorders:R=!1,allowDisabledContextMenu:$=!1,selectionMode:w,selectRowLabel:F,selectAllLabel:V="Select all rows"})=>{g.registerAgGridModulesOnce();const[v,q]=a.useState(),Q=g.useIsMobileScreen(),X=g.useIsTabletScreen(),P=a.useRef(new Set),G=a.useRef(void 0),L=`dial-kit-grid-selection-${a.useId()}`,D=a.useRef({getRowId:f,getContextMenuItems:r,onSelectionChange:h,selectRowLabel:F,wrapCustomCellRenderers:l});D.current={getRowId:f,getContextMenuItems:r,onSelectionChange:h,selectRowLabel:F,wrapCustomCellRenderers:l};const j=a.useCallback(o=>{const b=D.current.getRowId;return b?b(o):String(o.id??JSON.stringify(o))},[]),se=!!r,_=!!l,re=a.useMemo(()=>g.themeBalham.withPart(g.colorSchemeLight).withParams({...me,oddRowBackgroundColor:I?me.oddRowBackgroundColor:me.backgroundColor,wrapperBorder:M}),[I,M]),Se=a.useCallback(o=>{o.api.sizeColumnsToFit()},[]),oe=Q||X||(m?.size??0)>0,H=a.useCallback(o=>!!o&&!!d?.has(j(o)),[d,j]),K=a.useCallback((o,b,N)=>se?t.jsx(nt,{trigger:[g.DropdownTrigger.ContextMenu],items:o.data?D.current.getContextMenuItems?.(o.data)??[]:[],anchorToMouse:!0,matchReferenceWidth:!0,className:x.mergeClasses("size-full",N&&"cursor-not-allowed opacity-75"),disabled:N&&!$,children:t.jsx("span",{className:"block min-w-0 max-w-full flex-1",children:b})}):b,[se,$]),z=a.useCallback(o=>{if(!o.data)return null;const b=H(o.data);return K(o,t.jsx(be,{text:o.value==null?"":String(o.value),className:"max-w-full dial-small-text text-primary",hideTooltip:b}),b)},[H,K]),Y=a.useCallback(o=>o===W.API||o===W.ROW_DATA_CHANGED,[]),Ie=a.useMemo(()=>g.debounceFn(o=>{const N=(o.selectedNodes??[]).map(te=>te.data),B=new Set(N.map(j));P.current=B,G.current=o.source,!Y(o.source)&&D.current.onSelectionChange?.(B,N)},Qt),[Y,j]),ee=a.useMemo(()=>{if(w)return{...Yt,colId:it,headerName:"",headerClass:Kt,cellClass:Wt,headerComponent:w===g.GridSelectionMode.MULTIPLE?Xt:void 0,headerComponentParams:{label:V},cellRenderer:o=>{if(!o.data)return null;const b=j(o.data);return t.jsx(qt,{params:o,mode:w,rowId:b,radioName:L,label:D.current.selectRowLabel?.(o.data)??"Select row",disabled:d?.has(b)})}}},[w,V,j,d,L]),ae=a.useCallback(o=>{if(!o.cellRenderer)return{...o,cellRenderer:z};const b=D.current.wrapCustomCellRenderers;if(!(typeof b=="function"?b(o):!!b))return o;const B=o.cellRenderer;return{...o,cellRenderer:ue=>{const ut=H(ue.data),Me=typeof B=="function"?B:void 0,dt=Me?t.jsx(Me,{...ue}):z(ue);return K(ue,dt,ut)}}},[H,z,K]),Ne=a.useMemo(()=>{const o=_?(e??[]).map(ae):e??[];return ee?[ee,...o]:o},[e,_,ae,ee]),{defaultColDef:le,rowSelection:Z,...ve}=n??{},Ee=a.useMemo(()=>({minWidth:Jt,resizable:!0,sortable:!0,floatingFilter:!0,filter:"agTextColumnFilter",filterParams:{filterPlaceholder:E,buttons:["reset"]},comparator:g.baseColumnComparator,...g.omitUndefined(le)}),[E,le]),ye=o=>{o.api.sizeColumnsToFit(),q(o.api),n?.onGridReady?.(o),S?.(o.api)};a.useEffect(()=>{v&&s&&v.setGridOption("rowData",s)},[v,s]);const ce=a.useCallback(()=>t.jsx(ot,{live:!0,title:k,description:y,icon:A??t.jsx(U.IconZoomCancel,{size:100,stroke:.5,"aria-hidden":"true"})}),[k,y,A]),ie=typeof Z=="object"?Z:void 0,Te=a.useMemo(()=>w?{isRowSelectable:o=>!H(o.data),...ie,mode:w===g.GridSelectionMode.SINGLE?"singleRow":"multiRow",checkboxes:!1,headerCheckbox:!1}:Z,[Z,ie,H,w]);a.useEffect(()=>{v&&s&&P.current.size&&P.current.forEach(o=>{const b=v.getRowNode(o);b&&!b.isSelected()&&b.setSelected(!0,!1,W.API)})},[v,s]),a.useEffect(()=>{v&&m&&(v.deselectAll("all",W.API),m.forEach(o=>{const b=v.getRowNode(o);b&&!b.isSelected()&&b.setSelected(!0,!1,W.API)}))},[v,m]);const c=a.useCallback(o=>o.data?j(o.data):"",[j]);return a.useEffect(()=>{const o=Y(G.current);if(v&&m?.size&&o){const b=Array.from(m)[0];if(b){const N=v.getRowNode(b);N&&v.ensureNodeVisible(N)}}},[v,Y,m]),t.jsx("div",{className:x.mergeClasses(at,"size-full",w&&zt,w&&oe&&Ut,R&&Zt,i),role:"region","aria-label":u,"aria-busy":T,children:t.jsx("div",{className:"h-full overflow-x-auto",children:t.jsx(g.AgGridReact,{rowModelType:"clientSide",headerHeight:ke,rowHeight:ke,cellSelection:!1,theme:re,autoSizeStrategy:{type:"fitGridWidth"},columnDefs:Ne,defaultColDef:Ee,onGridSizeChanged:Se,onGridReady:ye,loading:T,suppressCellFocus:!0,suppressDragLeaveHidesColumns:!0,noRowsOverlayComponent:ce,rowData:s,rowSelection:Te,onSelectionChanged:Ie,getRowId:c,...ve})})})},tn=({value:e,locale:s=lt,options:n=ct,emptyPlaceholder:r,className:i,hideTooltip:u=!1})=>{const l=g.convertToDate(e),d=a.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=He;exports.CloseButton=qe;exports.DEFAULT_DATE_FORMAT_OPTIONS=ct;exports.DEFAULT_LOCALE=lt;exports.DangerIconButton=vt;exports.DateCellRenderer=tn;exports.Dropdown=nt;exports.EllipsisTooltip=be;exports.GRID_ALIGN_RIGHT_CLASS=$t;exports.GRID_ROOT_CLASS=at;exports.GRID_SELECTION_COLUMN_ID=it;exports.GRID_THEME_PARAMS=me;exports.GhostIconButton=$e;exports.Grid=en;exports.IconButton=xe;exports.InfoButton=Ke;exports.InteractiveTooltip=fe;exports.Label=De;exports.MenuItem=pe;exports.MenuItemMark=O;exports.NeutralIconButton=Nt;exports.NoDataContent=ot;exports.PrimaryIconButton=It;exports.ROW_HEIGHT=ke;exports.Radio=rt;exports.StaticIconButton=Et;exports.SvgNoData=st;exports.Tooltip=Ze;exports.TooltipContainer=Le;exports.TooltipContent=Re;exports.TooltipPlacement=he;exports.TooltipTrigger=we;exports.getButtonClassNames=We;exports.overlayGap=et;exports.overlayItemClassName=Je;exports.overlaySubMenuClassName=Ye;