@acronis-platform/ui-react 5.4.4 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/components/ui/area-chart/area-chart.js +114 -113
  2. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  3. package/dist/components/ui/bar-chart/bar-chart.js +53 -49
  4. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  5. package/dist/components/ui/chart/chart.js +108 -97
  6. package/dist/components/ui/chart/chart.js.map +1 -1
  7. package/dist/components/ui/composed-chart/composed-chart.js +134 -130
  8. package/dist/components/ui/composed-chart/composed-chart.js.map +1 -1
  9. package/dist/components/ui/confidence-cone/confidence-cone.js +36 -35
  10. package/dist/components/ui/confidence-cone/confidence-cone.js.map +1 -1
  11. package/dist/components/ui/dialog/dialog.js +69 -67
  12. package/dist/components/ui/dialog/dialog.js.map +1 -1
  13. package/dist/components/ui/funnel-chart/funnel-chart.js +38 -37
  14. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  15. package/dist/components/ui/line-chart/line-chart.js +35 -34
  16. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  17. package/dist/components/ui/pie-chart/pie-chart.js +28 -27
  18. package/dist/components/ui/pie-chart/pie-chart.js.map +1 -1
  19. package/dist/components/ui/radar-chart/radar-chart.js +68 -65
  20. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  21. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js +64 -63
  22. package/dist/components/ui/radial-bar-chart/radial-bar-chart.js.map +1 -1
  23. package/dist/components/ui/scatter-chart/scatter-chart.js +26 -26
  24. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  25. package/dist/components/ui/treemap/treemap.js +22 -22
  26. package/dist/components/ui/treemap/treemap.js.map +1 -1
  27. package/dist/index.js +106 -106
  28. package/dist/llms/area-chart.md +1 -0
  29. package/dist/llms/bar-chart.md +1 -0
  30. package/dist/llms/chart.md +10 -0
  31. package/dist/llms/composed-chart.md +1 -0
  32. package/dist/llms/confidence-cone.md +1 -0
  33. package/dist/llms/funnel-chart.md +1 -0
  34. package/dist/llms/line-chart.md +1 -0
  35. package/dist/llms/pie-chart.md +1 -0
  36. package/dist/llms/radar-chart.md +1 -0
  37. package/dist/llms/radial-bar-chart.md +1 -0
  38. package/dist/llms/scatter-chart.md +1 -0
  39. package/dist/llms/treemap.md +1 -0
  40. package/dist/llms.txt +1 -1
  41. package/dist/react.js +106 -106
  42. package/dist/src/components/ui/area-chart/area-chart.d.ts +6 -1
  43. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +8 -2
  44. package/dist/src/components/ui/category-bar/category-bar.d.ts +1 -1
  45. package/dist/src/components/ui/chart/__stories__/palette-control.d.ts +16 -0
  46. package/dist/src/components/ui/chart/chart.d.ts +12 -1
  47. package/dist/src/components/ui/chart/index.d.ts +1 -1
  48. package/dist/src/components/ui/composed-chart/composed-chart.d.ts +6 -1
  49. package/dist/src/components/ui/confidence-cone/confidence-cone.d.ts +6 -1
  50. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +6 -1
  51. package/dist/src/components/ui/grid/grid.d.ts +1 -1
  52. package/dist/src/components/ui/line-chart/line-chart.d.ts +6 -1
  53. package/dist/src/components/ui/pie-chart/pie-chart.d.ts +6 -1
  54. package/dist/src/components/ui/progress-circle/progress-circle.d.ts +1 -1
  55. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +9 -1
  56. package/dist/src/components/ui/radial-bar-chart/radial-bar-chart.d.ts +6 -1
  57. package/dist/src/components/ui/scatter-chart/scatter-chart.d.ts +6 -1
  58. package/dist/src/components/ui/spinner/spinner.d.ts +1 -1
  59. package/dist/src/components/ui/stack/stack.d.ts +1 -1
  60. package/dist/src/components/ui/treemap/treemap.d.ts +6 -1
  61. package/dist/ui-react.css +1 -1
  62. package/package.json +1 -1
@@ -1,116 +1,118 @@
1
1
  import { cn as e } from "../../../lib/utils.js";
2
2
  import { usePortalContainer as t } from "../../../lib/portal-container.js";
3
3
  import { cva as n } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
- import { Button as r } from "../button/button.js";
5
- import { DialogFooterDefault as i } from "../dialog-footer-default/dialog-footer-default.js";
6
- import { InputText as a } from "../input-text/input-text.js";
7
- import { Loading as o } from "../loading/loading.js";
8
- import * as s from "react";
9
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
10
- import { TimesIcon as d } from "@acronis-platform/icons-react/stroke-mono";
11
- import { Dialog as f } from "@base-ui/react/dialog";
4
+ import { ButtonIcon as r } from "../button-icon/button-icon.js";
5
+ import { Button as i } from "../button/button.js";
6
+ import { DialogFooterDefault as a } from "../dialog-footer-default/dialog-footer-default.js";
7
+ import { InputText as o } from "../input-text/input-text.js";
8
+ import { Loading as s } from "../loading/loading.js";
9
+ import * as c from "react";
10
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
11
+ import { TimesIcon as f } from "@acronis-platform/icons-react/stroke-mono";
12
+ import { Dialog as p } from "@base-ui/react/dialog";
12
13
  //#region src/components/ui/dialog/dialog.tsx
13
- var p = n("fixed left-1/2 top-1/2 z-50 flex max-h-[calc(100dvh-96px)] w-full min-w-[var(--ui-dialog-container-width-min)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-[var(--ui-dialog-container-border-radius)] bg-[var(--ui-dialog-container-color)] text-foreground shadow-lg duration-200 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95", {
14
+ var m = n("fixed left-1/2 top-1/2 z-50 flex max-h-[calc(100dvh-96px)] w-full min-w-[var(--ui-dialog-container-width-min)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-[var(--ui-dialog-container-border-radius)] bg-[var(--ui-dialog-container-color)] text-foreground shadow-lg duration-200 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95", {
14
15
  variants: { size: {
15
16
  sm: "max-w-[min(var(--ui-dialog-container-size-sm),calc(100dvw-96px))]",
16
17
  large: "max-w-[min(832px,calc(100dvw-96px))]"
17
18
  } },
18
19
  defaultVariants: { size: "sm" }
19
- }), m = f.Root;
20
- f.Trigger, f.Portal;
21
- var h = f.Close, g = s.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ l(f.Backdrop, {
20
+ }), h = p.Root;
21
+ p.Trigger, p.Portal;
22
+ var g = p.Close, _ = c.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ u(p.Backdrop, {
22
23
  ref: r,
23
24
  className: e("fixed inset-0 z-50 bg-[var(--ui-background-backdrop-screen)] duration-200 data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0", t),
24
25
  ...n
25
26
  }));
26
- g.displayName = "DialogOverlay";
27
- var _ = s.forwardRef(({ className: n, children: r, size: i, portal: a = !0, portalContainer: o, keepMounted: s, ...d }, m) => {
28
- let h = t(), _ = o ?? h, v = /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(g, {}), /* @__PURE__ */ l(f.Popup, {
29
- ref: m,
30
- className: e(p({ size: i }), n),
31
- ...d,
27
+ _.displayName = "DialogOverlay";
28
+ var v = c.forwardRef(({ className: n, children: r, size: i, portal: a = !0, portalContainer: o, keepMounted: s, ...c }, f) => {
29
+ let h = t(), g = o ?? h, v = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(_, {}), /* @__PURE__ */ u(p.Popup, {
30
+ ref: f,
31
+ className: e(m({ size: i }), n),
32
+ ...c,
32
33
  children: r
33
34
  })] });
34
- return a ? /* @__PURE__ */ l(f.Portal, {
35
- container: _,
35
+ return a ? /* @__PURE__ */ u(p.Portal, {
36
+ container: g,
36
37
  keepMounted: s,
37
38
  children: v
38
39
  }) : v;
39
40
  });
40
- _.displayName = "DialogContent";
41
- var v = s.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ l("div", {
41
+ v.displayName = "DialogContent";
42
+ var y = c.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ u("div", {
42
43
  ref: r,
43
44
  className: e("flex h-16 items-center gap-4 border-b border-border bg-background px-5 py-4", t),
44
45
  ...n
45
46
  }));
46
- v.displayName = "DialogHeaderRoot";
47
- var y = s.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ l("div", {
47
+ y.displayName = "DialogHeaderRoot";
48
+ var b = c.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ u("div", {
48
49
  ref: r,
49
50
  className: e("flex h-16 items-center justify-end gap-4 border-t border-border bg-background px-6 py-4", t),
50
51
  ...n
51
52
  }));
52
- y.displayName = "DialogFooterRoot";
53
- var b = s.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ l("div", {
53
+ b.displayName = "DialogFooterRoot";
54
+ var x = c.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ u("div", {
54
55
  ref: r,
55
56
  className: e("flex-1 overflow-auto p-6", t),
56
57
  ...n
57
58
  }));
58
- b.displayName = "DialogBodyRoot";
59
- var x = s.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ l(f.Title, {
59
+ x.displayName = "DialogBodyRoot";
60
+ var S = c.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ u(p.Title, {
60
61
  ref: r,
61
62
  className: e("flex-1 text-2xl font-normal leading-8 text-foreground", t),
62
63
  ...n
63
64
  }));
64
- x.displayName = "DialogTitle";
65
- var S = s.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ l(f.Description, {
65
+ S.displayName = "DialogTitle";
66
+ var C = c.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ u(p.Description, {
66
67
  ref: r,
67
68
  className: e("text-sm text-muted-foreground", t),
68
69
  ...n
69
70
  }));
70
- S.displayName = "DialogDescription";
71
- var C = s.forwardRef(({ className: t, closeLabel: n = "Close", ...r }, i) => /* @__PURE__ */ u(f.Close, {
71
+ C.displayName = "DialogDescription";
72
+ var w = c.forwardRef(({ className: e, closeLabel: t = "Close", ...n }, i) => /* @__PURE__ */ d(p.Close, {
72
73
  ref: i,
73
- className: e("cursor-pointer rounded p-1 text-[var(--ui-button-icon-global-icon-color-idle)] transition-colors hover:bg-[var(--ui-button-icon-global-container-color-hover)] hover:text-[var(--ui-button-icon-global-icon-color-hover)] active:bg-[var(--ui-button-icon-global-container-color-active)] active:text-[var(--ui-button-icon-global-icon-color-active)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none disabled:cursor-default disabled:text-[var(--ui-button-icon-global-icon-color-disabled)]", t),
74
- ...r,
75
- children: [/* @__PURE__ */ l(d, { size: 24 }), /* @__PURE__ */ l("span", {
74
+ render: /* @__PURE__ */ u(r, { variant: "ghost" }),
75
+ className: e,
76
+ ...n,
77
+ children: [/* @__PURE__ */ u(f, {}), /* @__PURE__ */ u("span", {
76
78
  className: "sr-only",
77
- children: n
79
+ children: t
78
80
  })]
79
81
  }));
80
- C.displayName = "DialogCloseButton";
81
- function w({ title: e, closeLabel: t }) {
82
- return /* @__PURE__ */ u("div", {
82
+ w.displayName = "DialogCloseButton";
83
+ function T({ title: e, closeLabel: t }) {
84
+ return /* @__PURE__ */ d("div", {
83
85
  className: "flex h-[var(--ui-dialog-header-height)] shrink-0 items-center gap-[var(--ui-dialog-header-gap)] border-b-[length:var(--ui-dialog-header-border-width)] border-[var(--ui-dialog-header-border-color)] bg-[var(--ui-dialog-header-color)] px-[var(--ui-dialog-header-padding-x)]",
84
- children: [/* @__PURE__ */ l(x, { children: e }), /* @__PURE__ */ l(C, { closeLabel: t })]
86
+ children: [/* @__PURE__ */ u(S, { children: e }), /* @__PURE__ */ u(w, { closeLabel: t })]
85
87
  });
86
88
  }
87
- function T({ children: e, inert: t }) {
88
- return /* @__PURE__ */ l("div", {
89
+ function E({ children: e, inert: t }) {
90
+ return /* @__PURE__ */ u("div", {
89
91
  inert: t,
90
92
  className: "flex min-h-[var(--ui-dialog-body-height-min)] flex-col justify-center-safe gap-[var(--ui-dialog-body-gap)] overflow-y-auto px-4 py-[var(--ui-dialog-body-padding-y)]",
91
- children: typeof e == "string" ? /* @__PURE__ */ l("p", {
93
+ children: typeof e == "string" ? /* @__PURE__ */ u("p", {
92
94
  className: "text-sm leading-6 text-foreground",
93
95
  children: e
94
96
  }) : e
95
97
  });
96
98
  }
97
- function E({ secondaryLabel: e, primaryLabel: t, primaryVariant: n, primaryCloses: i, onPrimaryAction: a }) {
98
- return /* @__PURE__ */ u(c, { children: [e && /* @__PURE__ */ l(h, { render: /* @__PURE__ */ l(r, {
99
+ function D({ secondaryLabel: e, primaryLabel: t, primaryVariant: n, primaryCloses: r, onPrimaryAction: a }) {
100
+ return /* @__PURE__ */ d(l, { children: [e && /* @__PURE__ */ u(g, { render: /* @__PURE__ */ u(i, {
99
101
  variant: "secondary",
100
102
  children: e
101
- }) }), i ? /* @__PURE__ */ l(h, {
103
+ }) }), r ? /* @__PURE__ */ u(g, {
102
104
  onClick: a,
103
- render: /* @__PURE__ */ l(r, {
105
+ render: /* @__PURE__ */ u(i, {
104
106
  variant: n,
105
107
  children: t
106
108
  })
107
- }) : /* @__PURE__ */ l(r, {
109
+ }) : /* @__PURE__ */ u(i, {
108
110
  variant: n,
109
111
  onClick: a,
110
112
  children: t
111
113
  })] });
112
114
  }
113
- var D = {
115
+ var O = {
114
116
  default: {
115
117
  title: "Dialog title",
116
118
  body: "Drop any content into this slot.",
@@ -120,7 +122,7 @@ var D = {
120
122
  },
121
123
  rename: {
122
124
  title: (e = "object name") => `Rename ${e}`,
123
- body: (e = "Current name", t = "Object name") => /* @__PURE__ */ l(a, {
125
+ body: (e = "Current name", t = "Object name") => /* @__PURE__ */ u(o, {
124
126
  "aria-label": t,
125
127
  defaultValue: e
126
128
  }),
@@ -144,12 +146,12 @@ var D = {
144
146
  },
145
147
  "discard changes": {
146
148
  title: "Discard changes",
147
- body: (e = "Object name") => /* @__PURE__ */ u("p", {
149
+ body: (e = "Object name") => /* @__PURE__ */ d("p", {
148
150
  className: "text-sm leading-6 text-foreground",
149
151
  children: [
150
152
  "Are you sure you want to discard the unsaved changes to",
151
153
  " ",
152
- /* @__PURE__ */ l("strong", {
154
+ /* @__PURE__ */ u("strong", {
153
155
  className: "font-semibold",
154
156
  children: e
155
157
  }),
@@ -181,52 +183,52 @@ var D = {
181
183
  primaryLabel: "Confirm",
182
184
  primaryVariant: "default"
183
185
  }
184
- }, O = s.forwardRef(({ variant: t = "default", hasLoading: n = !1, loadingLabel: r, hasHeader: a = !0, hasFooter: s = !0, children: c, title: d, objectName: f, objectNameLabel: p, secondaryLabel: h, primaryLabel: g, onPrimaryAction: v, footer: y, closeLabel: b, size: S, portal: C, portalContainer: O, keepMounted: k, className: A, ...j }, M) => {
185
- let N = D[t], P = typeof N.title == "function" ? N.title(f) : N.title, F = typeof N.body == "function" ? N.body(f, p) : N.body, I = c ?? F, L = d ?? P, R = h ?? N.secondaryLabel, z = g ?? N.primaryLabel, B = S ?? (t === "wide" ? "large" : "sm");
186
- return /* @__PURE__ */ l(m, {
186
+ }, k = c.forwardRef(({ variant: t = "default", hasLoading: n = !1, loadingLabel: r, hasHeader: i = !0, hasFooter: o = !0, children: c, title: l, objectName: f, objectNameLabel: p, secondaryLabel: m, primaryLabel: g, onPrimaryAction: _, footer: y, closeLabel: b, size: x, portal: C, portalContainer: w, keepMounted: k, className: A, ...j }, M) => {
187
+ let N = O[t], P = typeof N.title == "function" ? N.title(f) : N.title, F = typeof N.body == "function" ? N.body(f, p) : N.body, I = c ?? F, L = l ?? P, R = m ?? N.secondaryLabel, z = g ?? N.primaryLabel, B = x ?? (t === "wide" ? "large" : "sm");
188
+ return /* @__PURE__ */ u(h, {
187
189
  ...j,
188
- children: /* @__PURE__ */ u(_, {
190
+ children: /* @__PURE__ */ d(v, {
189
191
  ref: M,
190
192
  size: B,
191
193
  portal: C,
192
- portalContainer: O,
194
+ portalContainer: w,
193
195
  keepMounted: k,
194
196
  className: A,
195
197
  "aria-busy": n || void 0,
196
198
  children: [
197
- a ? /* @__PURE__ */ l(w, {
199
+ i ? /* @__PURE__ */ u(T, {
198
200
  title: L,
199
201
  closeLabel: b
200
- }) : /* @__PURE__ */ l(x, {
202
+ }) : /* @__PURE__ */ u(S, {
201
203
  className: "sr-only",
202
204
  children: L
203
205
  }),
204
- /* @__PURE__ */ l(T, {
206
+ /* @__PURE__ */ u(E, {
205
207
  inert: n,
206
208
  children: I
207
209
  }),
208
- s && /* @__PURE__ */ l(i, {
210
+ o && /* @__PURE__ */ u(a, {
209
211
  inert: n,
210
- children: y ?? /* @__PURE__ */ l(E, {
212
+ children: y ?? /* @__PURE__ */ u(D, {
211
213
  secondaryLabel: R,
212
214
  primaryLabel: z,
213
215
  primaryVariant: N.primaryVariant,
214
216
  primaryCloses: N.primaryCloses,
215
- onPrimaryAction: v
217
+ onPrimaryAction: _
216
218
  })
217
219
  }),
218
- n && /* @__PURE__ */ l(o, {
220
+ n && /* @__PURE__ */ u(s, {
219
221
  variant: "onSurfaceSecondary",
220
222
  hasLabel: !1,
221
223
  label: r,
222
- className: e("absolute inset-x-0 bottom-0 rounded-none", a ? "top-[var(--ui-dialog-header-height)]" : "top-0")
224
+ className: e("absolute inset-x-0 bottom-0 rounded-none", i ? "top-[var(--ui-dialog-header-height)]" : "top-0")
223
225
  })
224
226
  ]
225
227
  })
226
228
  });
227
229
  });
228
- O.displayName = "Dialog";
230
+ k.displayName = "Dialog";
229
231
  //#endregion
230
- export { O as Dialog, b as DialogBodyRoot, h as DialogClose, C as DialogCloseButton, _ as DialogContent, S as DialogDescription, y as DialogFooterRoot, v as DialogHeaderRoot, g as DialogOverlay, m as DialogRoot, x as DialogTitle, p as dialogContentVariants };
232
+ export { k as Dialog, x as DialogBodyRoot, g as DialogClose, w as DialogCloseButton, v as DialogContent, C as DialogDescription, b as DialogFooterRoot, y as DialogHeaderRoot, _ as DialogOverlay, h as DialogRoot, S as DialogTitle, m as dialogContentVariants };
231
233
 
232
234
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","names":[],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { TimesIcon } from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { usePortalContainer } from '@/lib/portal-container';\n\nimport { Button } from '../button';\nimport { DialogFooterDefault } from '../dialog-footer-default';\nimport { InputText } from '../input-text';\nimport { Loading } from '../loading';\n\n// Initial version ported from `@acronis-platform/shadcn-uikit`'s `dialog`\n// (packages/ui-legacy/src/components/ui/dialog.tsx). A modal overlay built on\n// the Base UI Dialog primitive (keyboard, focus trap, scroll lock, ARIA come\n// from Base UI). A `--ui-dialog-*` / `--ui-button-icon-*` token tier covers the\n// container + close button (reconciled against the Figma \"DialogDefault\" node,\n// 6343:58898); the composable DialogRoot / DialogHeaderRoot / DialogFooterRoot\n// / DialogBodyRoot parts below are internal-only (no public export, no Figma\n// node of their own) and keep the prior semantic-token approach — not to be\n// confused with the recipe-local `DialogHeader`/`DialogBody` further down,\n// which back the public `Dialog` and are reconciled against Figma:\n// • overlay -> var(--ui-background-backdrop-screen) (legacy `bg-black/80`)\n// • popup -> var(--ui-dialog-container-color) / var(--ui-dialog-container-border-radius)\n// • header / footer -> bg-background = --ui-background-surface-primary (white\n// bars over the muted body), divided by border-border\n// • title -> text-foreground / description -> text-muted-foreground\n// • close -> var(--ui-button-icon-global-icon-color-*) (idle/hover/active\n// share one blue in the default brand), bg via\n// var(--ui-button-icon-global-container-color-*), focus ring var(--ui-focus-primary)\n// Enter/exit animations use `tw-animate-css` (imported in styles/index.css),\n// keyed to Base UI's data-[open] / data-[closed] state attributes — overlay\n// fades, popup fades + zooms. `size` has two values: `sm` (512px, the Figma\n// default, backed by `--ui-dialog-container-size-sm`) and `large` (832px) — the\n// latter predates the Figma node and has no token; it's kept as a plain\n// arbitrary value solely for backward compatibility with existing call sites\n// that need a wider popup (see the `Large` story).\n//\n// Dialog's composable primitive parts (this file) are internal-only — not\n// re-exported from the package root — except `DialogClose`, which stays\n// public: it's required by the `wide` variant's documented custom-`footer`\n// escape hatch (see the `footer` prop and dialog.mdx). The public `Dialog`\n// component below is the sole sanctioned entry point; it's built on these\n// parts internally. (In Figma the matching component set is named\n// \"DialogDefault\"; the code-facing name stays `Dialog` — see dialog.figma.tsx.)\n\n// Figma's \"DialogWelcome\" frame (variant=carousel, node 6353:6164) wraps its\n// popup preview in a `p-[48px]` ancestor — the minimum margin the popup must\n// keep from the viewport edge on any screen size. `max-w`/`max-h` (not\n// padding, since the popup itself is centered via `fixed` + transform)\n// enforce it here so every consumer keeps that margin, not just the frame\n// that surfaced it.\nconst dialogContentVariants = cva(\n 'fixed left-1/2 top-1/2 z-50 flex max-h-[calc(100dvh-96px)] w-full min-w-[var(--ui-dialog-container-width-min)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-[var(--ui-dialog-container-border-radius)] bg-[var(--ui-dialog-container-color)] text-foreground shadow-lg duration-200 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95',\n {\n variants: {\n size: {\n sm: 'max-w-[min(var(--ui-dialog-container-size-sm),calc(100dvw-96px))]',\n large: 'max-w-[min(832px,calc(100dvw-96px))]',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n }\n);\n\nconst DialogRoot = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Backdrop>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Backdrop>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Backdrop\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-[var(--ui-background-backdrop-screen)] duration-200 data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0',\n className\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = 'DialogOverlay';\n\nexport interface DialogContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Popup>,\n VariantProps<typeof dialogContentVariants> {\n /**\n * Popup max-width. `sm` (512px, default) is the Figma-defined size; `large`\n * (832px) is a backward-compatibility size with no design token (see the\n * `Large` story).\n */\n size?: VariantProps<typeof dialogContentVariants>['size'];\n /**\n * Render the content inside a portal (default `true`). Base UI requires the\n * Popup to sit in a Portal for correct stacking; set `false` for inline usage\n * (e.g. when the caller supplies its own `DialogPortal`, or in tests).\n */\n portal?: boolean;\n /**\n * Portal container. Pass a shadow-root mount for isolated-style previews\n * (the docs demos do this via `useShadowMount`).\n */\n portalContainer?: DialogPrimitive.Portal.Props['container'];\n /** Keep the content mounted while closed (Base UI `Portal` prop). */\n keepMounted?: DialogPrimitive.Portal.Props['keepMounted'];\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Popup>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n size,\n portal = true,\n portalContainer,\n keepMounted,\n ...props\n },\n ref\n ) => {\n const ctxContainer = usePortalContainer();\n const resolvedContainer = portalContainer ?? ctxContainer;\n\n const popup = (\n <>\n <DialogOverlay />\n <DialogPrimitive.Popup\n ref={ref}\n className={cn(dialogContentVariants({ size }), className)}\n {...props}\n >\n {children}\n </DialogPrimitive.Popup>\n </>\n );\n\n return portal ? (\n <DialogPrimitive.Portal container={resolvedContainer} keepMounted={keepMounted}>\n {popup}\n </DialogPrimitive.Portal>\n ) : (\n popup\n );\n }\n);\nDialogContent.displayName = 'DialogContent';\n\nconst DialogHeaderRoot = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex h-16 items-center gap-4 border-b border-border bg-background px-5 py-4',\n className\n )}\n {...props}\n />\n));\nDialogHeaderRoot.displayName = 'DialogHeaderRoot';\n\nconst DialogFooterRoot = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex h-16 items-center justify-end gap-4 border-t border-border bg-background px-6 py-4',\n className\n )}\n {...props}\n />\n));\nDialogFooterRoot.displayName = 'DialogFooterRoot';\n\nconst DialogBodyRoot = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex-1 overflow-auto p-6', className)} {...props} />\n));\nDialogBodyRoot.displayName = 'DialogBodyRoot';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'flex-1 text-2xl font-normal leading-8 text-foreground',\n className\n )}\n {...props}\n />\n));\nDialogTitle.displayName = 'DialogTitle';\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport interface DialogCloseButtonProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close> {\n /** Accessible name for screen readers. Defaults to `'Close'`. */\n closeLabel?: string;\n}\n\nconst DialogCloseButton = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Close>,\n DialogCloseButtonProps\n>(({ className, closeLabel = 'Close', ...props }, ref) => (\n <DialogPrimitive.Close\n ref={ref}\n className={cn(\n 'cursor-pointer rounded p-1 text-[var(--ui-button-icon-global-icon-color-idle)] transition-colors hover:bg-[var(--ui-button-icon-global-container-color-hover)] hover:text-[var(--ui-button-icon-global-icon-color-hover)] active:bg-[var(--ui-button-icon-global-container-color-active)] active:text-[var(--ui-button-icon-global-icon-color-active)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)] disabled:pointer-events-none disabled:cursor-default disabled:text-[var(--ui-button-icon-global-icon-color-disabled)]',\n className\n )}\n {...props}\n >\n <TimesIcon size={24} />\n <span className=\"sr-only\">{closeLabel}</span>\n </DialogPrimitive.Close>\n));\nDialogCloseButton.displayName = 'DialogCloseButton';\n\n// The recipe-specific header: title + close button, reconciled against the\n// Figma \"DialogHeader\" node (4220:3516) via the `--ui-dialog-header-*` tier.\n// Local to this file (not exported) — distinct from the generic, unstyled\n// `DialogHeaderRoot` composable primitive above.\ninterface DialogHeaderProps {\n title: string;\n closeLabel?: string;\n}\n\nfunction DialogHeader({ title, closeLabel }: DialogHeaderProps) {\n return (\n <div className=\"flex h-[var(--ui-dialog-header-height)] shrink-0 items-center gap-[var(--ui-dialog-header-gap)] border-b-[length:var(--ui-dialog-header-border-width)] border-[var(--ui-dialog-header-border-color)] bg-[var(--ui-dialog-header-color)] px-[var(--ui-dialog-header-padding-x)]\">\n <DialogTitle>{title}</DialogTitle>\n <DialogCloseButton closeLabel={closeLabel} />\n </div>\n );\n}\n\n// The recipe-specific body: the variant's canned copy (or the `children`\n// override), reconciled against the Figma DialogDefault node via the\n// `--ui-dialog-body-*` tier. Local to this file — distinct from the generic\n// `DialogBodyRoot` composable primitive above.\ninterface DialogBodyProps {\n children: React.ReactNode;\n /** Makes the body unfocusable/unclickable while the loading overlay is shown. */\n inert?: boolean;\n}\n\nfunction DialogBody({ children, inert }: DialogBodyProps) {\n return (\n <div\n inert={inert}\n className=\"flex min-h-[var(--ui-dialog-body-height-min)] flex-col justify-center-safe gap-[var(--ui-dialog-body-gap)] overflow-y-auto px-4 py-[var(--ui-dialog-body-padding-y)]\"\n >\n {typeof children === 'string' ? (\n <p className=\"text-sm leading-6 text-foreground\">{children}</p>\n ) : (\n children\n )}\n </div>\n );\n}\n\n// The recipe-specific footer actions: a secondary (dismiss) button plus a\n// primary action, the latter either closing the dialog itself (`read-only`'s\n// \"Done\") or firing `onPrimaryAction` and leaving the close to the caller.\n// Local to this file — distinct from the generic `DialogFooterRoot`.\ninterface DialogFooterActionsProps {\n secondaryLabel?: string;\n primaryLabel: string;\n primaryVariant: 'default' | 'destructive';\n primaryCloses?: boolean;\n onPrimaryAction?: () => void;\n}\n\nfunction DialogFooterActions({\n secondaryLabel,\n primaryLabel,\n primaryVariant,\n primaryCloses,\n onPrimaryAction,\n}: DialogFooterActionsProps) {\n return (\n <>\n {secondaryLabel && (\n <DialogClose render={<Button variant=\"secondary\">{secondaryLabel}</Button>} />\n )}\n {primaryCloses ? (\n <DialogClose\n onClick={onPrimaryAction}\n render={<Button variant={primaryVariant}>{primaryLabel}</Button>}\n />\n ) : (\n <Button variant={primaryVariant} onClick={onPrimaryAction}>\n {primaryLabel}\n </Button>\n )}\n </>\n );\n}\n\n// A higher-level \"recipe\" built on top of the Dialog primitive parts above\n// (DialogRoot + DialogContent give the portal, backdrop, focus trap, scroll\n// lock and open state; DialogTitle wires the accessible name; DialogCloseButton\n// / DialogClose give the dismiss controls). It bakes in the seven Figma\n// \"DialogDefault\" use-cases (node 6343:58898) plus one legacy `wide` escape\n// hatch kept for backward compatibility: each `variant` picks a canned title,\n// body copy and footer buttons; `children` overrides only the body slot;\n// `title` overrides only the title; `footer` overrides only the footer's\n// action content (the free-form escape hatch `wide` relies on); `hasLoading`\n// drops a spinner overlay over the body + footer. `hasHeader`/`hasFooter`\n// (both default `true`) hide the header/footer chrome entirely — a\n// ui-react-only extension beyond the Figma DialogDefault contract, which\n// always shows both; the title stays rendered off-screen when the header is\n// hidden so the dialog keeps an accessible name.\n//\n// Colors resolve to shipped semantic tokens via the bridged Tailwind names the\n// Dialog family already uses (text-foreground, the backdrop + focus tokens\n// inside DialogContent / DialogCloseButton) and the Button / InputText token\n// tiers — nothing is hand-authored. The loading scrim renders `Loading`'s\n// `onSurfaceSecondary` variant (`--ui-loading-element-container-color-secondary`),\n// matching the design's translucent surface fill.\n//\n// Header + footer geometry/color resolve to the `--ui-dialog-header-*` /\n// `--ui-footer-*` tiers, reconciled against the DialogDefault Figma node.\n\nexport type DialogVariant =\n | 'default'\n | 'rename'\n | 'save changes'\n | 'reset password'\n | 'discard changes'\n | 'accept'\n | 'read-only'\n | 'wide';\n\ninterface DialogVariantContent {\n /**\n * The variant's canned title. A function receives `objectName` (falls back\n * to its own placeholder default when omitted) for variants whose title\n * embeds the acted-on object's name.\n */\n title: string | ((objectName?: string) => string);\n /**\n * Same `objectName` interpolation as `title`, for body copy/fields that\n * embed it. The `rename` variant's field also receives `objectNameLabel`\n * for its accessible name.\n */\n body:\n | React.ReactNode\n | ((objectName?: string, objectNameLabel?: string) => React.ReactNode);\n /** Secondary (dismiss) button label. Omitted when the variant has none. */\n secondaryLabel?: string;\n primaryLabel: string;\n primaryVariant: 'default' | 'destructive';\n /** Whether the primary button dismisses the dialog (e.g. read-only \"Done\"). */\n primaryCloses?: boolean;\n}\n\nconst DIALOG_VARIANT_CONTENT: Record<DialogVariant, DialogVariantContent> = {\n default: {\n title: 'Dialog title',\n body: 'Drop any content into this slot.',\n secondaryLabel: 'Cancel',\n primaryLabel: 'Label',\n primaryVariant: 'default',\n },\n rename: {\n title: (objectName = 'object name') => `Rename ${objectName}`,\n // `objectName` prefills the field with the real current name; the field's\n // accessible name (`objectNameLabel`) is separate — it's the label, not the value.\n body: (objectName = 'Current name', objectNameLabel = 'Object name') => (\n <InputText aria-label={objectNameLabel} defaultValue={objectName} />\n ),\n secondaryLabel: 'Cancel',\n primaryLabel: 'Rename',\n primaryVariant: 'default',\n },\n 'save changes': {\n title: 'Save changes',\n body: 'You have unsaved changes. Do you want to save them before leaving?',\n secondaryLabel: 'Go back',\n primaryLabel: 'Save',\n primaryVariant: 'default',\n },\n 'reset password': {\n title: 'Reset password',\n body: 'Further instructions will be sent to your email address.',\n secondaryLabel: 'Cancel',\n primaryLabel: 'Reset',\n primaryVariant: 'default',\n },\n 'discard changes': {\n title: 'Discard changes',\n body: (objectName = 'Object name') => (\n <p className=\"text-sm leading-6 text-foreground\">\n Are you sure you want to discard the unsaved changes to{' '}\n <strong className=\"font-semibold\">{objectName}</strong>?\n </p>\n ),\n secondaryLabel: 'Go back',\n primaryLabel: 'Confirm',\n primaryVariant: 'destructive',\n },\n accept: {\n title: (objectName = 'object name') => `Accept ${objectName}`,\n body: 'Click Accept to confirm that you have read, understood, and agree to the terms and conditions below.',\n secondaryLabel: 'Cancel',\n primaryLabel: 'Accept',\n primaryVariant: 'default',\n },\n 'read-only': {\n title: 'License agreement',\n body: 'This is a read-only dialog used to view legal documents such as the License Agreement, EULA updates, Terms of Service, and other legal documents.',\n primaryLabel: 'Done',\n primaryVariant: 'default',\n primaryCloses: true,\n },\n // No Figma preset — a legacy, free-form escape hatch (see the `footer` prop\n // and the `Large` story). This fallback title/body/footer only renders if\n // the caller supplies neither `footer` nor `title`/`children` — every real\n // `wide` call site overrides them.\n wide: {\n title: 'Dialog title',\n body: 'Drop any content into this slot.',\n secondaryLabel: 'Cancel',\n primaryLabel: 'Confirm',\n primaryVariant: 'default',\n },\n};\n\ntype DialogRootProps = React.ComponentPropsWithoutRef<typeof DialogRoot>;\n\nexport interface DialogProps extends Omit<DialogRootProps, 'children'> {\n /**\n * Selects the canned title / body / footer preset. Defaults to `'default'`.\n * `'wide'` is a legacy escape hatch (no canned preset) kept for backward\n * compatibility — pair it with `size=\"large\"` and the `footer` prop.\n */\n variant?: DialogVariant;\n /**\n * Show a spinner overlay across the body + footer, and make both `inert`\n * (unfocusable, unclickable, hidden from assistive tech) so a keyboard user\n * can't activate the visually obscured footer buttons while busy.\n */\n hasLoading?: boolean;\n /**\n * Overrides the loading overlay's accessible label. Defaults to `Loading`'s\n * own default (`'Data is loading…'`). Ignored when `hasLoading` is `false`.\n */\n loadingLabel?: string;\n /**\n * Show the header (title + close button). Defaults to `true`. When `false`,\n * the title is still rendered off-screen so the dialog keeps an accessible\n * name — only the visible bar and close button are omitted. Beyond the\n * strict Figma contract (all seven `DialogDefault` variants always show the\n * header); a ui-react-only extension, like `wide`/`size=\"large\"`.\n */\n hasHeader?: boolean;\n /**\n * Show the footer (action buttons). Defaults to `true`. Beyond the strict\n * Figma contract (all seven `DialogDefault` variants always show the\n * footer); a ui-react-only extension, like `wide`/`size=\"large\"`. When\n * `false`, `footer` (and the canned footer it would otherwise replace) is\n * not rendered either.\n */\n hasFooter?: boolean;\n /** Overrides the variant's default body content. */\n children?: React.ReactNode;\n /** Overrides the variant's default title. */\n title?: string;\n /**\n * The real name of the object being acted on (e.g. a file or resource\n * name). Interpolated into the `rename`/`discard changes`/`accept`\n * variants' canned title/body in place of the generic placeholder text;\n * ignored by variants that don't reference an object name.\n */\n objectName?: string;\n /**\n * Overrides the accessible name of the `rename` variant's text field\n * (default `'Object name'`). Ignored by every other variant.\n */\n objectNameLabel?: string;\n /**\n * Overrides the variant's default secondary (dismiss) button label. Passing\n * this for a variant with no secondary button by default (e.g. `read-only`)\n * also makes the button appear. Ignored when `footer` is provided.\n */\n secondaryLabel?: string;\n /** Overrides the variant's default primary button label. Ignored when `footer` is provided. */\n primaryLabel?: string;\n /**\n * Fires when the primary footer button is clicked. The dialog does not\n * close automatically afterwards — pair this with `open`/`onOpenChange` to\n * close it once the action completes. Ignored when `footer` is provided\n * (wire behavior onto your own buttons there instead).\n */\n onPrimaryAction?: () => void;\n /**\n * Replaces the footer's action content entirely with free-form buttons —\n * the escape hatch the `wide` variant is meant to be paired with, for\n * legacy call sites that don't fit one of the seven canned presets. Ignored\n * (along with the canned footer) when `hasFooter` is `false`.\n */\n footer?: React.ReactNode;\n /** Overrides the close button's accessible name. Defaults to `'Close'`. */\n closeLabel?: string;\n /**\n * Popup max-width (forwarded to `DialogContent`). Defaults to `'sm'`, or to\n * `'large'` when `variant` is `'wide'`.\n */\n size?: DialogContentProps['size'];\n /** Render inside a portal (forwarded to `DialogContent`). Defaults to `true`. */\n portal?: boolean;\n /** Portal container (forwarded to `DialogContent`). */\n portalContainer?: DialogContentProps['portalContainer'];\n /** Keep the content mounted while closed (forwarded to `DialogContent`). */\n keepMounted?: DialogContentProps['keepMounted'];\n /** Extra classes merged onto the popup container. */\n className?: string;\n}\n\nconst Dialog = React.forwardRef<HTMLDivElement, DialogProps>(\n (\n {\n variant = 'default',\n hasLoading = false,\n loadingLabel,\n hasHeader = true,\n hasFooter = true,\n children,\n title,\n objectName,\n objectNameLabel,\n secondaryLabel,\n primaryLabel,\n onPrimaryAction,\n footer,\n closeLabel,\n size,\n portal,\n portalContainer,\n keepMounted,\n className,\n ...rootProps\n },\n ref\n ) => {\n const content = DIALOG_VARIANT_CONTENT[variant];\n const resolvedTitle =\n typeof content.title === 'function' ? content.title(objectName) : content.title;\n const resolvedBody =\n typeof content.body === 'function'\n ? content.body(objectName, objectNameLabel)\n : content.body;\n const bodyContent = children ?? resolvedBody;\n const titleText = title ?? resolvedTitle;\n const secondaryLabelText = secondaryLabel ?? content.secondaryLabel;\n const primaryLabelText = primaryLabel ?? content.primaryLabel;\n const resolvedSize = size ?? (variant === 'wide' ? 'large' : 'sm');\n\n return (\n <DialogRoot {...rootProps}>\n <DialogContent\n ref={ref}\n size={resolvedSize}\n portal={portal}\n portalContainer={portalContainer}\n keepMounted={keepMounted}\n className={className}\n aria-busy={hasLoading || undefined}\n >\n {hasHeader ? (\n <DialogHeader title={titleText} closeLabel={closeLabel} />\n ) : (\n // Header hidden, but the dialog still needs an accessible name.\n <DialogTitle className=\"sr-only\">{titleText}</DialogTitle>\n )}\n\n <DialogBody inert={hasLoading}>{bodyContent}</DialogBody>\n\n {hasFooter && (\n <DialogFooterDefault inert={hasLoading}>\n {footer ?? (\n <DialogFooterActions\n secondaryLabel={secondaryLabelText}\n primaryLabel={primaryLabelText}\n primaryVariant={content.primaryVariant}\n primaryCloses={content.primaryCloses}\n onPrimaryAction={onPrimaryAction}\n />\n )}\n </DialogFooterDefault>\n )}\n\n {hasLoading && (\n <Loading\n variant=\"onSurfaceSecondary\"\n hasLabel={false}\n label={loadingLabel}\n className={cn(\n 'absolute inset-x-0 bottom-0 rounded-none',\n hasHeader ? 'top-[var(--ui-dialog-header-height)]' : 'top-0'\n )}\n />\n )}\n </DialogContent>\n </DialogRoot>\n );\n }\n);\nDialog.displayName = 'Dialog';\n\nexport {\n DialogRoot,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogCloseButton,\n DialogTrigger,\n DialogContent,\n DialogHeaderRoot,\n DialogFooterRoot,\n DialogTitle,\n DialogBodyRoot,\n DialogDescription,\n dialogContentVariants,\n Dialog,\n};\n"],"mappings":";;;;;;;;;;;;AAqDA,IAAM,IAAwB,EAC5B,8bACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,OAAO;CACT,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF,GAEM,IAAa,EAAgB;AAEb,EAAgB,SAEjB,EAAgB;AAErC,IAAM,IAAc,EAAgB,OAE9B,IAAgB,EAAM,YAGzB,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,EAAgB,UAAjB;CACO;CACL,WAAW,EACT,6KACA,CACF;CACA,GAAI;AACL,CAAA,CACF;AACD,EAAc,cAAc;AA0B5B,IAAM,IAAgB,EAAM,YAKxB,EACE,cACA,aACA,SACA,YAAS,IACT,oBACA,gBACA,GAAG,KAEL,MACG;CACH,IAAM,IAAe,EAAmB,GAClC,IAAoB,KAAmB,GAEvC,IACJ,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,CAAgB,CAAA,GAChB,kBAAC,EAAgB,OAAjB;EACO;EACL,WAAW,EAAG,EAAsB,EAAE,QAAK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,GAAD;KAAY,OAAO;KAAa,UAAA;IAAwB,CAAA;IAEvD,KACC,kBAAC,GAAD;KAAqB,OAAO;KACzB,UAAA,KACC,kBAAC,GAAD;MACE,gBAAgB;MAChB,cAAc;MACd,gBAAgB,EAAQ;MACxB,eAAe,EAAQ;MACN;KAClB,CAAA;IAEgB,CAAA;IAGtB,KACC,kBAAC,GAAD;KACE,SAAQ;KACR,UAAU;KACV,OAAO;KACP,WAAW,EACT,4CACA,IAAY,yCAAyC,OACvD;IACD,CAAA;GAEU;;CACL,CAAA;AAEhB,CACF;AACA,EAAO,cAAc"}
1
+ {"version":3,"file":"dialog.js","names":[],"sources":["../../../../src/components/ui/dialog/dialog.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dialog as DialogPrimitive } from '@base-ui/react/dialog';\nimport { TimesIcon } from '@acronis-platform/icons-react/stroke-mono';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\nimport { usePortalContainer } from '@/lib/portal-container';\n\nimport { Button } from '../button';\nimport { ButtonIcon } from '../button-icon';\nimport { DialogFooterDefault } from '../dialog-footer-default';\nimport { InputText } from '../input-text';\nimport { Loading } from '../loading';\n\n// Initial version ported from `@acronis-platform/shadcn-uikit`'s `dialog`\n// (packages/ui-legacy/src/components/ui/dialog.tsx). A modal overlay built on\n// the Base UI Dialog primitive (keyboard, focus trap, scroll lock, ARIA come\n// from Base UI). A `--ui-dialog-*` / `--ui-button-icon-*` token tier covers the\n// container + close button (reconciled against the Figma \"DialogDefault\" node,\n// 6343:58898); the composable DialogRoot / DialogHeaderRoot / DialogFooterRoot\n// / DialogBodyRoot parts below are internal-only (no public export, no Figma\n// node of their own) and keep the prior semantic-token approach — not to be\n// confused with the recipe-local `DialogHeader`/`DialogBody` further down,\n// which back the public `Dialog` and are reconciled against Figma:\n// • overlay -> var(--ui-background-backdrop-screen) (legacy `bg-black/80`)\n// • popup -> var(--ui-dialog-container-color) / var(--ui-dialog-container-border-radius)\n// • header / footer -> bg-background = --ui-background-surface-primary (white\n// bars over the muted body), divided by border-border\n// • title -> text-foreground / description -> text-muted-foreground\n// • close -> var(--ui-button-icon-global-icon-color-*) (idle/hover/active\n// share one blue in the default brand), bg via\n// var(--ui-button-icon-global-container-color-*), focus ring var(--ui-focus-primary)\n// Enter/exit animations use `tw-animate-css` (imported in styles/index.css),\n// keyed to Base UI's data-[open] / data-[closed] state attributes — overlay\n// fades, popup fades + zooms. `size` has two values: `sm` (512px, the Figma\n// default, backed by `--ui-dialog-container-size-sm`) and `large` (832px) — the\n// latter predates the Figma node and has no token; it's kept as a plain\n// arbitrary value solely for backward compatibility with existing call sites\n// that need a wider popup (see the `Large` story).\n//\n// Dialog's composable primitive parts (this file) are internal-only — not\n// re-exported from the package root — except `DialogClose`, which stays\n// public: it's required by the `wide` variant's documented custom-`footer`\n// escape hatch (see the `footer` prop and dialog.mdx). The public `Dialog`\n// component below is the sole sanctioned entry point; it's built on these\n// parts internally. (In Figma the matching component set is named\n// \"DialogDefault\"; the code-facing name stays `Dialog` — see dialog.figma.tsx.)\n\n// Figma's \"DialogWelcome\" frame (variant=carousel, node 6353:6164) wraps its\n// popup preview in a `p-[48px]` ancestor — the minimum margin the popup must\n// keep from the viewport edge on any screen size. `max-w`/`max-h` (not\n// padding, since the popup itself is centered via `fixed` + transform)\n// enforce it here so every consumer keeps that margin, not just the frame\n// that surfaced it.\nconst dialogContentVariants = cva(\n 'fixed left-1/2 top-1/2 z-50 flex max-h-[calc(100dvh-96px)] w-full min-w-[var(--ui-dialog-container-width-min)] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-[var(--ui-dialog-container-border-radius)] bg-[var(--ui-dialog-container-color)] text-foreground shadow-lg duration-200 data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95 data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95',\n {\n variants: {\n size: {\n sm: 'max-w-[min(var(--ui-dialog-container-size-sm),calc(100dvw-96px))]',\n large: 'max-w-[min(832px,calc(100dvw-96px))]',\n },\n },\n defaultVariants: {\n size: 'sm',\n },\n }\n);\n\nconst DialogRoot = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Backdrop>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Backdrop>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Backdrop\n ref={ref}\n className={cn(\n 'fixed inset-0 z-50 bg-[var(--ui-background-backdrop-screen)] duration-200 data-[open]:animate-in data-[open]:fade-in-0 data-[closed]:animate-out data-[closed]:fade-out-0',\n className\n )}\n {...props}\n />\n));\nDialogOverlay.displayName = 'DialogOverlay';\n\nexport interface DialogContentProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Popup>,\n VariantProps<typeof dialogContentVariants> {\n /**\n * Popup max-width. `sm` (512px, default) is the Figma-defined size; `large`\n * (832px) is a backward-compatibility size with no design token (see the\n * `Large` story).\n */\n size?: VariantProps<typeof dialogContentVariants>['size'];\n /**\n * Render the content inside a portal (default `true`). Base UI requires the\n * Popup to sit in a Portal for correct stacking; set `false` for inline usage\n * (e.g. when the caller supplies its own `DialogPortal`, or in tests).\n */\n portal?: boolean;\n /**\n * Portal container. Pass a shadow-root mount for isolated-style previews\n * (the docs demos do this via `useShadowMount`).\n */\n portalContainer?: DialogPrimitive.Portal.Props['container'];\n /** Keep the content mounted while closed (Base UI `Portal` prop). */\n keepMounted?: DialogPrimitive.Portal.Props['keepMounted'];\n}\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Popup>,\n DialogContentProps\n>(\n (\n {\n className,\n children,\n size,\n portal = true,\n portalContainer,\n keepMounted,\n ...props\n },\n ref\n ) => {\n const ctxContainer = usePortalContainer();\n const resolvedContainer = portalContainer ?? ctxContainer;\n\n const popup = (\n <>\n <DialogOverlay />\n <DialogPrimitive.Popup\n ref={ref}\n className={cn(dialogContentVariants({ size }), className)}\n {...props}\n >\n {children}\n </DialogPrimitive.Popup>\n </>\n );\n\n return portal ? (\n <DialogPrimitive.Portal container={resolvedContainer} keepMounted={keepMounted}>\n {popup}\n </DialogPrimitive.Portal>\n ) : (\n popup\n );\n }\n);\nDialogContent.displayName = 'DialogContent';\n\nconst DialogHeaderRoot = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex h-16 items-center gap-4 border-b border-border bg-background px-5 py-4',\n className\n )}\n {...props}\n />\n));\nDialogHeaderRoot.displayName = 'DialogHeaderRoot';\n\nconst DialogFooterRoot = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex h-16 items-center justify-end gap-4 border-t border-border bg-background px-6 py-4',\n className\n )}\n {...props}\n />\n));\nDialogFooterRoot.displayName = 'DialogFooterRoot';\n\nconst DialogBodyRoot = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('flex-1 overflow-auto p-6', className)} {...props} />\n));\nDialogBodyRoot.displayName = 'DialogBodyRoot';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn(\n 'flex-1 text-2xl font-normal leading-8 text-foreground',\n className\n )}\n {...props}\n />\n));\nDialogTitle.displayName = 'DialogTitle';\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nDialogDescription.displayName = 'DialogDescription';\n\nexport interface DialogCloseButtonProps\n extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close> {\n /** Accessible name for screen readers. Defaults to `'Close'`. */\n closeLabel?: string;\n}\n\nconst DialogCloseButton = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Close>,\n DialogCloseButtonProps\n>(({ className, closeLabel = 'Close', ...props }, ref) => (\n <DialogPrimitive.Close\n ref={ref}\n render={<ButtonIcon variant=\"ghost\" />}\n className={className}\n {...props}\n >\n <TimesIcon />\n <span className=\"sr-only\">{closeLabel}</span>\n </DialogPrimitive.Close>\n));\nDialogCloseButton.displayName = 'DialogCloseButton';\n\n// The recipe-specific header: title + close button, reconciled against the\n// Figma \"DialogHeader\" node (4220:3516) via the `--ui-dialog-header-*` tier.\n// Local to this file (not exported) — distinct from the generic, unstyled\n// `DialogHeaderRoot` composable primitive above.\ninterface DialogHeaderProps {\n title: string;\n closeLabel?: string;\n}\n\nfunction DialogHeader({ title, closeLabel }: DialogHeaderProps) {\n return (\n <div className=\"flex h-[var(--ui-dialog-header-height)] shrink-0 items-center gap-[var(--ui-dialog-header-gap)] border-b-[length:var(--ui-dialog-header-border-width)] border-[var(--ui-dialog-header-border-color)] bg-[var(--ui-dialog-header-color)] px-[var(--ui-dialog-header-padding-x)]\">\n <DialogTitle>{title}</DialogTitle>\n <DialogCloseButton closeLabel={closeLabel} />\n </div>\n );\n}\n\n// The recipe-specific body: the variant's canned copy (or the `children`\n// override), reconciled against the Figma DialogDefault node via the\n// `--ui-dialog-body-*` tier. Local to this file — distinct from the generic\n// `DialogBodyRoot` composable primitive above.\ninterface DialogBodyProps {\n children: React.ReactNode;\n /** Makes the body unfocusable/unclickable while the loading overlay is shown. */\n inert?: boolean;\n}\n\nfunction DialogBody({ children, inert }: DialogBodyProps) {\n return (\n <div\n inert={inert}\n className=\"flex min-h-[var(--ui-dialog-body-height-min)] flex-col justify-center-safe gap-[var(--ui-dialog-body-gap)] overflow-y-auto px-4 py-[var(--ui-dialog-body-padding-y)]\"\n >\n {typeof children === 'string' ? (\n <p className=\"text-sm leading-6 text-foreground\">{children}</p>\n ) : (\n children\n )}\n </div>\n );\n}\n\n// The recipe-specific footer actions: a secondary (dismiss) button plus a\n// primary action, the latter either closing the dialog itself (`read-only`'s\n// \"Done\") or firing `onPrimaryAction` and leaving the close to the caller.\n// Local to this file — distinct from the generic `DialogFooterRoot`.\ninterface DialogFooterActionsProps {\n secondaryLabel?: string;\n primaryLabel: string;\n primaryVariant: 'default' | 'destructive';\n primaryCloses?: boolean;\n onPrimaryAction?: () => void;\n}\n\nfunction DialogFooterActions({\n secondaryLabel,\n primaryLabel,\n primaryVariant,\n primaryCloses,\n onPrimaryAction,\n}: DialogFooterActionsProps) {\n return (\n <>\n {secondaryLabel && (\n <DialogClose render={<Button variant=\"secondary\">{secondaryLabel}</Button>} />\n )}\n {primaryCloses ? (\n <DialogClose\n onClick={onPrimaryAction}\n render={<Button variant={primaryVariant}>{primaryLabel}</Button>}\n />\n ) : (\n <Button variant={primaryVariant} onClick={onPrimaryAction}>\n {primaryLabel}\n </Button>\n )}\n </>\n );\n}\n\n// A higher-level \"recipe\" built on top of the Dialog primitive parts above\n// (DialogRoot + DialogContent give the portal, backdrop, focus trap, scroll\n// lock and open state; DialogTitle wires the accessible name; DialogCloseButton\n// / DialogClose give the dismiss controls). It bakes in the seven Figma\n// \"DialogDefault\" use-cases (node 6343:58898) plus one legacy `wide` escape\n// hatch kept for backward compatibility: each `variant` picks a canned title,\n// body copy and footer buttons; `children` overrides only the body slot;\n// `title` overrides only the title; `footer` overrides only the footer's\n// action content (the free-form escape hatch `wide` relies on); `hasLoading`\n// drops a spinner overlay over the body + footer. `hasHeader`/`hasFooter`\n// (both default `true`) hide the header/footer chrome entirely — a\n// ui-react-only extension beyond the Figma DialogDefault contract, which\n// always shows both; the title stays rendered off-screen when the header is\n// hidden so the dialog keeps an accessible name.\n//\n// Colors resolve to shipped semantic tokens via the bridged Tailwind names the\n// Dialog family already uses (text-foreground, the backdrop + focus tokens\n// inside DialogContent / DialogCloseButton) and the Button / InputText token\n// tiers — nothing is hand-authored. The loading scrim renders `Loading`'s\n// `onSurfaceSecondary` variant (`--ui-loading-element-container-color-secondary`),\n// matching the design's translucent surface fill.\n//\n// Header + footer geometry/color resolve to the `--ui-dialog-header-*` /\n// `--ui-footer-*` tiers, reconciled against the DialogDefault Figma node.\n\nexport type DialogVariant =\n | 'default'\n | 'rename'\n | 'save changes'\n | 'reset password'\n | 'discard changes'\n | 'accept'\n | 'read-only'\n | 'wide';\n\ninterface DialogVariantContent {\n /**\n * The variant's canned title. A function receives `objectName` (falls back\n * to its own placeholder default when omitted) for variants whose title\n * embeds the acted-on object's name.\n */\n title: string | ((objectName?: string) => string);\n /**\n * Same `objectName` interpolation as `title`, for body copy/fields that\n * embed it. The `rename` variant's field also receives `objectNameLabel`\n * for its accessible name.\n */\n body:\n | React.ReactNode\n | ((objectName?: string, objectNameLabel?: string) => React.ReactNode);\n /** Secondary (dismiss) button label. Omitted when the variant has none. */\n secondaryLabel?: string;\n primaryLabel: string;\n primaryVariant: 'default' | 'destructive';\n /** Whether the primary button dismisses the dialog (e.g. read-only \"Done\"). */\n primaryCloses?: boolean;\n}\n\nconst DIALOG_VARIANT_CONTENT: Record<DialogVariant, DialogVariantContent> = {\n default: {\n title: 'Dialog title',\n body: 'Drop any content into this slot.',\n secondaryLabel: 'Cancel',\n primaryLabel: 'Label',\n primaryVariant: 'default',\n },\n rename: {\n title: (objectName = 'object name') => `Rename ${objectName}`,\n // `objectName` prefills the field with the real current name; the field's\n // accessible name (`objectNameLabel`) is separate — it's the label, not the value.\n body: (objectName = 'Current name', objectNameLabel = 'Object name') => (\n <InputText aria-label={objectNameLabel} defaultValue={objectName} />\n ),\n secondaryLabel: 'Cancel',\n primaryLabel: 'Rename',\n primaryVariant: 'default',\n },\n 'save changes': {\n title: 'Save changes',\n body: 'You have unsaved changes. Do you want to save them before leaving?',\n secondaryLabel: 'Go back',\n primaryLabel: 'Save',\n primaryVariant: 'default',\n },\n 'reset password': {\n title: 'Reset password',\n body: 'Further instructions will be sent to your email address.',\n secondaryLabel: 'Cancel',\n primaryLabel: 'Reset',\n primaryVariant: 'default',\n },\n 'discard changes': {\n title: 'Discard changes',\n body: (objectName = 'Object name') => (\n <p className=\"text-sm leading-6 text-foreground\">\n Are you sure you want to discard the unsaved changes to{' '}\n <strong className=\"font-semibold\">{objectName}</strong>?\n </p>\n ),\n secondaryLabel: 'Go back',\n primaryLabel: 'Confirm',\n primaryVariant: 'destructive',\n },\n accept: {\n title: (objectName = 'object name') => `Accept ${objectName}`,\n body: 'Click Accept to confirm that you have read, understood, and agree to the terms and conditions below.',\n secondaryLabel: 'Cancel',\n primaryLabel: 'Accept',\n primaryVariant: 'default',\n },\n 'read-only': {\n title: 'License agreement',\n body: 'This is a read-only dialog used to view legal documents such as the License Agreement, EULA updates, Terms of Service, and other legal documents.',\n primaryLabel: 'Done',\n primaryVariant: 'default',\n primaryCloses: true,\n },\n // No Figma preset — a legacy, free-form escape hatch (see the `footer` prop\n // and the `Large` story). This fallback title/body/footer only renders if\n // the caller supplies neither `footer` nor `title`/`children` — every real\n // `wide` call site overrides them.\n wide: {\n title: 'Dialog title',\n body: 'Drop any content into this slot.',\n secondaryLabel: 'Cancel',\n primaryLabel: 'Confirm',\n primaryVariant: 'default',\n },\n};\n\ntype DialogRootProps = React.ComponentPropsWithoutRef<typeof DialogRoot>;\n\nexport interface DialogProps extends Omit<DialogRootProps, 'children'> {\n /**\n * Selects the canned title / body / footer preset. Defaults to `'default'`.\n * `'wide'` is a legacy escape hatch (no canned preset) kept for backward\n * compatibility — pair it with `size=\"large\"` and the `footer` prop.\n */\n variant?: DialogVariant;\n /**\n * Show a spinner overlay across the body + footer, and make both `inert`\n * (unfocusable, unclickable, hidden from assistive tech) so a keyboard user\n * can't activate the visually obscured footer buttons while busy.\n */\n hasLoading?: boolean;\n /**\n * Overrides the loading overlay's accessible label. Defaults to `Loading`'s\n * own default (`'Data is loading…'`). Ignored when `hasLoading` is `false`.\n */\n loadingLabel?: string;\n /**\n * Show the header (title + close button). Defaults to `true`. When `false`,\n * the title is still rendered off-screen so the dialog keeps an accessible\n * name — only the visible bar and close button are omitted. Beyond the\n * strict Figma contract (all seven `DialogDefault` variants always show the\n * header); a ui-react-only extension, like `wide`/`size=\"large\"`.\n */\n hasHeader?: boolean;\n /**\n * Show the footer (action buttons). Defaults to `true`. Beyond the strict\n * Figma contract (all seven `DialogDefault` variants always show the\n * footer); a ui-react-only extension, like `wide`/`size=\"large\"`. When\n * `false`, `footer` (and the canned footer it would otherwise replace) is\n * not rendered either.\n */\n hasFooter?: boolean;\n /** Overrides the variant's default body content. */\n children?: React.ReactNode;\n /** Overrides the variant's default title. */\n title?: string;\n /**\n * The real name of the object being acted on (e.g. a file or resource\n * name). Interpolated into the `rename`/`discard changes`/`accept`\n * variants' canned title/body in place of the generic placeholder text;\n * ignored by variants that don't reference an object name.\n */\n objectName?: string;\n /**\n * Overrides the accessible name of the `rename` variant's text field\n * (default `'Object name'`). Ignored by every other variant.\n */\n objectNameLabel?: string;\n /**\n * Overrides the variant's default secondary (dismiss) button label. Passing\n * this for a variant with no secondary button by default (e.g. `read-only`)\n * also makes the button appear. Ignored when `footer` is provided.\n */\n secondaryLabel?: string;\n /** Overrides the variant's default primary button label. Ignored when `footer` is provided. */\n primaryLabel?: string;\n /**\n * Fires when the primary footer button is clicked. The dialog does not\n * close automatically afterwards — pair this with `open`/`onOpenChange` to\n * close it once the action completes. Ignored when `footer` is provided\n * (wire behavior onto your own buttons there instead).\n */\n onPrimaryAction?: () => void;\n /**\n * Replaces the footer's action content entirely with free-form buttons —\n * the escape hatch the `wide` variant is meant to be paired with, for\n * legacy call sites that don't fit one of the seven canned presets. Ignored\n * (along with the canned footer) when `hasFooter` is `false`.\n */\n footer?: React.ReactNode;\n /** Overrides the close button's accessible name. Defaults to `'Close'`. */\n closeLabel?: string;\n /**\n * Popup max-width (forwarded to `DialogContent`). Defaults to `'sm'`, or to\n * `'large'` when `variant` is `'wide'`.\n */\n size?: DialogContentProps['size'];\n /** Render inside a portal (forwarded to `DialogContent`). Defaults to `true`. */\n portal?: boolean;\n /** Portal container (forwarded to `DialogContent`). */\n portalContainer?: DialogContentProps['portalContainer'];\n /** Keep the content mounted while closed (forwarded to `DialogContent`). */\n keepMounted?: DialogContentProps['keepMounted'];\n /** Extra classes merged onto the popup container. */\n className?: string;\n}\n\nconst Dialog = React.forwardRef<HTMLDivElement, DialogProps>(\n (\n {\n variant = 'default',\n hasLoading = false,\n loadingLabel,\n hasHeader = true,\n hasFooter = true,\n children,\n title,\n objectName,\n objectNameLabel,\n secondaryLabel,\n primaryLabel,\n onPrimaryAction,\n footer,\n closeLabel,\n size,\n portal,\n portalContainer,\n keepMounted,\n className,\n ...rootProps\n },\n ref\n ) => {\n const content = DIALOG_VARIANT_CONTENT[variant];\n const resolvedTitle =\n typeof content.title === 'function' ? content.title(objectName) : content.title;\n const resolvedBody =\n typeof content.body === 'function'\n ? content.body(objectName, objectNameLabel)\n : content.body;\n const bodyContent = children ?? resolvedBody;\n const titleText = title ?? resolvedTitle;\n const secondaryLabelText = secondaryLabel ?? content.secondaryLabel;\n const primaryLabelText = primaryLabel ?? content.primaryLabel;\n const resolvedSize = size ?? (variant === 'wide' ? 'large' : 'sm');\n\n return (\n <DialogRoot {...rootProps}>\n <DialogContent\n ref={ref}\n size={resolvedSize}\n portal={portal}\n portalContainer={portalContainer}\n keepMounted={keepMounted}\n className={className}\n aria-busy={hasLoading || undefined}\n >\n {hasHeader ? (\n <DialogHeader title={titleText} closeLabel={closeLabel} />\n ) : (\n // Header hidden, but the dialog still needs an accessible name.\n <DialogTitle className=\"sr-only\">{titleText}</DialogTitle>\n )}\n\n <DialogBody inert={hasLoading}>{bodyContent}</DialogBody>\n\n {hasFooter && (\n <DialogFooterDefault inert={hasLoading}>\n {footer ?? (\n <DialogFooterActions\n secondaryLabel={secondaryLabelText}\n primaryLabel={primaryLabelText}\n primaryVariant={content.primaryVariant}\n primaryCloses={content.primaryCloses}\n onPrimaryAction={onPrimaryAction}\n />\n )}\n </DialogFooterDefault>\n )}\n\n {hasLoading && (\n <Loading\n variant=\"onSurfaceSecondary\"\n hasLabel={false}\n label={loadingLabel}\n className={cn(\n 'absolute inset-x-0 bottom-0 rounded-none',\n hasHeader ? 'top-[var(--ui-dialog-header-height)]' : 'top-0'\n )}\n />\n )}\n </DialogContent>\n </DialogRoot>\n );\n }\n);\nDialog.displayName = 'Dialog';\n\nexport {\n DialogRoot,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogCloseButton,\n DialogTrigger,\n DialogContent,\n DialogHeaderRoot,\n DialogFooterRoot,\n DialogTitle,\n DialogBodyRoot,\n DialogDescription,\n dialogContentVariants,\n Dialog,\n};\n"],"mappings":";;;;;;;;;;;;;AAsDA,IAAM,IAAwB,EAC5B,8bACA;CACE,UAAU,EACR,MAAM;EACJ,IAAI;EACJ,OAAO;CACT,EACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CACF,GAEM,IAAa,EAAgB;AAEb,EAAgB,SAEjB,EAAgB;AAErC,IAAM,IAAc,EAAgB,OAE9B,IAAgB,EAAM,YAGzB,EAAE,cAAW,GAAG,KAAS,MAC1B,kBAAC,EAAgB,UAAjB;CACO;CACL,WAAW,EACT,6KACA,CACF;CACA,GAAI;AACL,CAAA,CACF;AACD,EAAc,cAAc;AA0B5B,IAAM,IAAgB,EAAM,YAKxB,EACE,cACA,aACA,SACA,YAAS,IACT,oBACA,gBACA,GAAG,KAEL,MACG;CACH,IAAM,IAAe,EAAmB,GAClC,IAAoB,KAAmB,GAEvC,IACJ,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD,CAAgB,CAAA,GAChB,kBAAC,EAAgB,OAAjB;EACO;EACL,WAAW,EAAG,EAAsB,EAAE,QAAK,CAA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IAG3D,kBAAC,GAAD;KAAY,OAAO;KAAa,UAAA;IAAwB,CAAA;IAEvD,KACC,kBAAC,GAAD;KAAqB,OAAO;KACzB,UAAA,KACC,kBAAC,GAAD;MACE,gBAAgB;MAChB,cAAc;MACd,gBAAgB,EAAQ;MACxB,eAAe,EAAQ;MACN;KAClB,CAAA;IAEgB,CAAA;IAGtB,KACC,kBAAC,GAAD;KACE,SAAQ;KACR,UAAU;KACV,OAAO;KACP,WAAW,EACT,4CACA,IAAY,yCAAyC,OACvD;IACD,CAAA;GAEU;;CACL,CAAA;AAEhB,CACF;AACA,EAAO,cAAc"}
@@ -127,19 +127,19 @@ function te({ x: t = 0, y: n = 0, upperWidth: r = 0, lowerWidth: i = 0, height:
127
127
  strokeWidth: g ? w : c
128
128
  });
129
129
  }
130
- var W = u.forwardRef(({ className: t, config: C, palette: w, data: T, dataKey: E, nameKey: D, lastShape: O = "triangle", reversed: A = !1, showLabels: j = !1, labelFormat: M = "name", labelPosition: N = "right", showValueLabels: P = !1, valuePosition: F, labelFill: I, labelFormatter: L, percentFormatter: R, showLegend: z = !0, legendValueFormatter: H, stageSettings: W, showActiveShape: ne = !1, stroke: re, strokeWidth: G, funnelWidth: ie, margin: ae, showTooltip: K = !0, tooltipContent: q, animate: oe, animationDuration: se, animationBegin: ce, animationEasing: le, ...ue }, de) => {
131
- let fe = c({
132
- animate: oe,
133
- animationDuration: se,
134
- animationBegin: ce,
135
- animationEasing: le
136
- }), J = u.useMemo(() => {
137
- let e = T.filter((e) => !W?.[String(e[D])]?.hidden), t = e.reduce((e, t) => {
130
+ var W = u.forwardRef(({ className: t, config: C, palette: w, data: T, dataKey: E, nameKey: D, lastShape: O = "triangle", reversed: A = !1, showLabels: j = !1, labelFormat: M = "name", labelPosition: N = "right", showValueLabels: P = !1, valuePosition: F, labelFill: I, labelFormatter: L, percentFormatter: R, showLegend: z = !0, legendFontSize: H, legendValueFormatter: W, stageSettings: G, showActiveShape: ne = !1, stroke: re, strokeWidth: K, funnelWidth: ie, margin: ae, showTooltip: oe = !0, tooltipContent: se, animate: ce, animationDuration: le, animationBegin: ue, animationEasing: de, ...fe }, pe) => {
131
+ let me = c({
132
+ animate: ce,
133
+ animationDuration: le,
134
+ animationBegin: ue,
135
+ animationEasing: de
136
+ }), q = u.useMemo(() => {
137
+ let e = T.filter((e) => !G?.[String(e[D])]?.hidden), t = e.reduce((e, t) => {
138
138
  let n = Number(t[E]);
139
139
  return Number.isFinite(n) && n > e ? n : e;
140
140
  }, 0);
141
141
  return e.map((e, n) => {
142
- let r = String(e[D]), i = W?.[r]?.color ?? `var(--color-${s(r)})`, a = {
142
+ let r = String(e[D]), i = G?.[r]?.color ?? `var(--color-${s(r)})`, a = {
143
143
  name: r,
144
144
  value: e[E],
145
145
  base: t,
@@ -167,76 +167,76 @@ var W = u.forwardRef(({ className: t, config: C, palette: w, data: T, dataKey: E
167
167
  L,
168
168
  D,
169
169
  R,
170
- W
171
- ]), Y = u.useMemo(() => z ? o(C, w ?? k) : null, [
170
+ G
171
+ ]), J = u.useMemo(() => z ? o(C, w ?? k) : null, [
172
172
  z,
173
173
  C,
174
174
  w
175
- ]), pe = u.useMemo(() => {
176
- if (!Y) return [];
175
+ ]), he = u.useMemo(() => {
176
+ if (!J) return [];
177
177
  let e = /* @__PURE__ */ new Set();
178
- return J.flatMap((t) => {
178
+ return q.flatMap((t) => {
179
179
  let n = String(t[D]);
180
180
  return e.has(n) ? [] : (e.add(n), [{
181
181
  value: n,
182
182
  dataKey: D,
183
183
  type: "rect",
184
- color: W?.[n]?.color ?? Y[n]?.color ?? String(t.fill),
184
+ color: G?.[n]?.color ?? J[n]?.color ?? String(t.fill),
185
185
  payload: t
186
186
  }]);
187
187
  });
188
188
  }, [
189
189
  D,
190
+ q,
190
191
  J,
191
- Y,
192
- W
193
- ]), X = F ?? y(N), me = j && N !== "inside" || P && X !== "inside", Z = v[N], Q = v[X], he = {
192
+ G
193
+ ]), Y = F ?? y(N), X = j && N !== "inside" || P && Y !== "inside", Z = v[N], Q = v[Y], ge = {
194
194
  ...V({
195
195
  showLabels: j,
196
196
  labelPosition: N,
197
197
  showValueLabels: P,
198
- valuePosition: X
198
+ valuePosition: Y
199
199
  }),
200
200
  ...ae
201
- }, ge = ie ?? B({
201
+ }, _e = ie ?? B({
202
202
  showLabels: j,
203
203
  labelPosition: N,
204
204
  labelFormat: M
205
- }), _e = re ?? (G == null ? "none" : "var(--ui-border-on-surface-border)"), $ = (e) => /* @__PURE__ */ d(te, {
205
+ }), ve = re ?? (K == null ? "none" : "var(--ui-border-on-surface-border)"), $ = (e) => /* @__PURE__ */ d(te, {
206
206
  ...e,
207
207
  showActiveShape: ne,
208
- topStageIndex: A ? J.length - 1 : 0
208
+ topStageIndex: A ? q.length - 1 : 0
209
209
  });
210
210
  return /* @__PURE__ */ f("div", {
211
- ref: de,
211
+ ref: pe,
212
212
  "data-last-shape": O,
213
213
  className: e("flex flex-row items-center gap-4", !z && "justify-center", _({ lastShape: O }), t),
214
- ...ue,
214
+ ...fe,
215
215
  children: [/* @__PURE__ */ d("div", {
216
- className: me ? "h-[120px] flex-1" : e(ee, "shrink-0"),
216
+ className: X ? "h-[120px] flex-1" : e(ee, "shrink-0"),
217
217
  children: /* @__PURE__ */ d(n, {
218
218
  config: C,
219
219
  palette: w ?? k,
220
220
  className: "size-full",
221
221
  children: /* @__PURE__ */ f(h, {
222
- margin: he,
223
- children: [K && /* @__PURE__ */ d(i, { content: q ?? /* @__PURE__ */ d(a, {
222
+ margin: ge,
223
+ children: [oe && /* @__PURE__ */ d(i, { content: se ?? /* @__PURE__ */ d(a, {
224
224
  nameKey: D,
225
225
  hideLabel: !0
226
226
  }) }), /* @__PURE__ */ f(m, {
227
227
  dataKey: E,
228
228
  nameKey: D,
229
- data: J,
229
+ data: q,
230
230
  lastShapeType: O ?? "triangle",
231
231
  reversed: A,
232
- width: ge,
233
- stroke: _e,
234
- strokeWidth: G,
232
+ width: _e,
233
+ stroke: ve,
234
+ strokeWidth: K,
235
235
  shape: $,
236
236
  activeShape: $,
237
- ...fe,
237
+ ...me,
238
238
  children: [
239
- J.map((e, t) => /* @__PURE__ */ d(p, { fill: String(e.fill) }, t)),
239
+ q.map((e, t) => /* @__PURE__ */ d(p, { fill: String(e.fill) }, t)),
240
240
  j && /* @__PURE__ */ d(g, {
241
241
  position: Z,
242
242
  dataKey: b,
@@ -255,13 +255,14 @@ var W = u.forwardRef(({ className: t, config: C, palette: w, data: T, dataKey: E
255
255
  })]
256
256
  })
257
257
  })
258
- }), z && Y && /* @__PURE__ */ d(r, {
258
+ }), z && J && /* @__PURE__ */ d(r, {
259
259
  variant: "list",
260
- payload: pe,
261
- config: Y,
260
+ payload: he,
261
+ config: J,
262
262
  nameKey: D,
263
+ fontSize: H,
263
264
  valueKey: E,
264
- valueFormatter: H,
265
+ valueFormatter: W,
265
266
  valueClassName: "text-[var(--ui-text-on-surface-primary)]",
266
267
  className: "min-w-0 flex-1"
267
268
  })]