asma-ui-core 3.126.1 → 3.126.3

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.
@@ -1,55 +1,55 @@
1
- import { cn as i } from "../../../helpers/cn.js";
1
+ import { cn as c } from "../../../helpers/cn.js";
2
2
  import { resolveSx as K } from "../../../helpers/sx.js";
3
3
  import { registerOpenModalDialog as he } from "../../../hooks/useTopLayer.hook.js";
4
- import { CloseIcon as pe } from "../../icons/close-icon/CloseIcon.js";
5
- import { DialogBusyContext as we, useDialogBusyBoundary as ye } from "./DialogBusyContext.js";
4
+ import { CloseIcon as we } from "../../icons/close-icon/CloseIcon.js";
5
+ import { DialogBusyContext as pe, useDialogBusyBoundary as ye } from "./DialogBusyContext.js";
6
6
  import { StyledButton as ve } from "../../inputs/button/StyledButton.js";
7
7
  import { useMobileMediaQuery as ge } from "../../../hooks/useMediaQuery.hook.js";
8
8
  import { OverlayBackOwnerContext as be, isOverlayBackEnabled as T, requestCloseTopOverlayBack as D, useBackCloses as ke } from "../../../hooks/useBackCloses.hook.js";
9
9
  import { warnUnnamedDialog as Ce } from "../../../helpers/warnUnnamedDialog.js";
10
10
  import Ee from "./StyledDialog.module.js";
11
11
  import { StyledDialogTitleContext as Be } from "./dialogTitleContext.js";
12
- import { useEffect as c, useId as I, useLayoutEffect as U, useMemo as De, useRef as l, useState as X } from "react";
13
- import { jsx as a, jsxs as u } from "react/jsx-runtime";
12
+ import { useEffect as d, useId as I, useLayoutEffect as U, useMemo as De, useRef as s, useState as X } from "react";
13
+ import { jsx as a, jsxs as m } from "react/jsx-runtime";
14
14
  var Ie = {
15
15
  xs: 444,
16
16
  sm: 600,
17
17
  md: 900,
18
18
  lg: 1200,
19
19
  xl: 1536
20
- }, Fe = ({ open: t, onClose: R, children: S, dataTest: f, maxWidth: N = "sm", fullWidth: G, fullScreen: Q, scroll: V = "paper", disableEscapeKeyDown: H, className: $, style: J, sx: Y, classes: O, PaperProps: Z, slotProps: m, busyReason: ee, locale: te = "en", onCloseText: q, showCloseIcon: M = !0, dialogLabel: x, dialogTitle: h, dialogHeaderNode: re, ariaLabel: b }) => {
21
- const p = I(), P = I(), [ne, oe] = X(), le = De(() => ({
22
- titleId: p,
20
+ }, Fe = ({ open: t, onClose: R, children: S, dataTest: f, maxWidth: N = "sm", fullWidth: G, fullScreen: Q, scroll: V = "paper", disableEscapeKeyDown: H, className: $, style: J, sx: Y, classes: O, PaperProps: Z, slotProps: x, busyReason: ee, locale: te = "en", onCloseText: q, showCloseIcon: M = !0, dialogLabel: i, dialogTitle: h, dialogHeaderNode: re, ariaLabel: b }) => {
21
+ const w = I(), P = I(), [ne, oe] = X(), se = De(() => ({
22
+ titleId: w,
23
23
  setTitleId: oe
24
- }), [p]), w = h ? p : ne ?? (x ? P : void 0), ae = ge(), s = l(null), k = l(null), C = l(!1), E = l(!1), d = l(!1), _ = l(t);
25
- c(() => {
24
+ }), [w]), p = h ? w : ne ?? (i ? P : void 0), ae = ge(), l = s(null), k = s(null), C = s(!1), E = s(!1), u = s(!1), _ = s(t);
25
+ d(() => {
26
26
  _.current = t;
27
27
  }, [t]);
28
- const L = l(t), y = Q ?? ae, { busy: v, busyReason: se, contextValue: ie } = ye(ee, te), j = I(), [g, ce] = X(), W = l(!1);
28
+ const j = s(t), y = Q ?? ae, { busy: v, busyReason: le, contextValue: ie } = ye(ee, te), L = I(), [g, ce] = X(), W = s(!1);
29
29
  U(() => {
30
- const e = s.current, r = !!w || !!b, n = e && t && !r ? e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]') : null;
31
- n && !n.id && (n.id = j);
30
+ const e = l.current, r = !!p || !!b, n = e && t && !r ? e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]') : null;
31
+ n && !n.id && (n.id = L);
32
32
  const o = n?.id;
33
33
  o !== g && ce(o), e && t && !r && !n && !W.current && (W.current = !0, Ce(f));
34
34
  }, [
35
35
  t,
36
- w,
36
+ p,
37
37
  b,
38
38
  S,
39
39
  g,
40
- j,
40
+ L,
41
41
  f
42
- ]), c(() => {
43
- L.current && !t && m?.transition?.onExited?.(), L.current = t;
44
- }, [t, m]), U(() => {
45
- const e = s.current;
42
+ ]), d(() => {
43
+ j.current && !t && x?.transition?.onExited?.(), j.current = t;
44
+ }, [t, x]), U(() => {
45
+ const e = l.current;
46
46
  if (!e || !t) return;
47
47
  e.open || (k.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.showModal(), e.focus({ preventScroll: !0 }), requestAnimationFrame(() => e.open && e.focus({ preventScroll: !0 })));
48
48
  const r = he(e);
49
49
  return () => {
50
50
  r(), k.current?.isConnected && k.current.focus({ preventScroll: !0 });
51
51
  };
52
- }, [t]), c(() => {
52
+ }, [t]), d(() => {
53
53
  if (!t) return;
54
54
  const e = document.body.style.overflow, r = document.documentElement.style.overflow;
55
55
  return document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", () => {
@@ -58,14 +58,14 @@ var Ie = {
58
58
  }, [t]);
59
59
  const B = {
60
60
  ...Z,
61
- ...m?.paper
62
- }, z = N === !1 ? void 0 : Ie[N], { className: de, style: ue, onClick: fe, ...me } = m?.backdrop ?? {}, A = (e, r) => {
63
- if (v || d.current) return;
61
+ ...x?.paper
62
+ }, z = N === !1 ? void 0 : Ie[N], { className: de, style: ue, onClick: me, ...fe } = x?.backdrop ?? {}, A = (e, r) => {
63
+ if (v || u.current) return;
64
64
  const n = R?.(e, r);
65
65
  if (n && typeof n.then == "function") {
66
- d.current = !0;
66
+ u.current = !0;
67
67
  const o = () => {
68
- d.current = !1;
68
+ u.current = !1;
69
69
  };
70
70
  n.then(o, o);
71
71
  }
@@ -75,14 +75,14 @@ var Ie = {
75
75
  }, 0), A(e, "escapeKeyDown"));
76
76
  ke({
77
77
  active: t,
78
- requestClose: (e) => !R || H || v || d.current ? !1 : F(e ?? new Event("overlayBack")),
79
- ownerRef: s
78
+ requestClose: (e) => !R || H || v || u.current ? !1 : F(e ?? new Event("overlayBack")),
79
+ ownerRef: l
80
80
  });
81
81
  const xe = (e) => {
82
82
  e.cancelable && e.preventDefault(), !E.current && T() && D();
83
83
  };
84
- return c(() => {
85
- const e = s.current;
84
+ return d(() => {
85
+ const e = l.current;
86
86
  if (!e || !t) return;
87
87
  let r = !1;
88
88
  const n = () => {
@@ -90,16 +90,16 @@ var Ie = {
90
90
  r = !1, _.current && e.isConnected && !e.open && (e.showModal(), e.focus({ preventScroll: !0 }));
91
91
  });
92
92
  }, o = () => {
93
- r || (r = !0, T() && !d.current && D(), n());
93
+ r || (r = !0, T() && !u.current && D(), n());
94
94
  };
95
95
  return e.addEventListener("close", o), () => e.removeEventListener("close", o);
96
- }, [t]), c(() => {
96
+ }, [t]), d(() => {
97
97
  if (!t || H) return;
98
98
  const e = (r) => {
99
99
  r.key !== "Escape" || r.defaultPrevented || (r.preventDefault(), r.stopImmediatePropagation(), D(r));
100
100
  };
101
101
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
102
- }), c(() => {
102
+ }), d(() => {
103
103
  if (!t) return;
104
104
  const e = (r) => {
105
105
  r.key === "Escape" && (E.current = !0, window.setTimeout(() => {
@@ -107,31 +107,31 @@ var Ie = {
107
107
  }, 0));
108
108
  };
109
109
  return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
110
- }, [t]), t ? /* @__PURE__ */ u("dialog", {
111
- ref: s,
110
+ }, [t]), t ? /* @__PURE__ */ m("dialog", {
111
+ ref: l,
112
112
  tabIndex: -1,
113
113
  "data-testid": f,
114
- "aria-labelledby": w ?? g,
115
- "aria-label": w || g ? void 0 : b,
114
+ "aria-labelledby": p ?? g,
115
+ "aria-label": p || g ? void 0 : b,
116
116
  onCancel: xe,
117
117
  onKeyDown: (e) => {
118
- !v || e.key !== "Escape" || e.target.closest("dialog[open]") === s.current && e.preventDefault();
118
+ !v || e.key !== "Escape" || e.target.closest("dialog[open]") === l.current && e.preventDefault();
119
119
  },
120
- className: i(Ee.StyledDialog, "fixed inset-0 m-0 h-full max-h-none w-full max-w-none items-center justify-center overflow-hidden border-0 bg-transparent p-0 outline-none open:flex", V === "body" && "overflow-y-auto", $, O?.root),
120
+ className: c(Ee.StyledDialog, "fixed inset-0 m-0 h-full max-h-none w-full max-w-none items-center justify-center overflow-hidden border-0 bg-transparent p-0 outline-none open:flex", V === "body" && "overflow-y-auto", $, O?.root),
121
121
  style: {
122
122
  zIndex: 999,
123
123
  ...K(Y),
124
124
  ...J
125
125
  },
126
126
  children: [/* @__PURE__ */ a("div", {
127
- ...me,
128
- className: i("absolute inset-0 bg-[#626e7eb2]", de),
127
+ ...fe,
128
+ className: c("absolute inset-0 bg-[#626e7eb2]", de),
129
129
  style: ue,
130
130
  onClick: (e) => {
131
- fe?.(e), e.defaultPrevented || A(e, "backdropClick");
131
+ me?.(e), e.defaultPrevented || A(e, "backdropClick");
132
132
  }
133
- }), /* @__PURE__ */ u("div", {
134
- className: i("relative z-[1] flex flex-col overflow-hidden rounded-lg border-0 bg-white p-0 text-delta-800 shadow-[0px_4px_40px_0px_#22213366]", y && "rounded-none", B.className, O?.paper),
133
+ }), /* @__PURE__ */ m("div", {
134
+ className: c("relative z-[1] flex flex-col overflow-hidden rounded-lg border-0 bg-white p-0 text-delta-800 shadow-[0px_4px_40px_0px_#22213366]", y && "rounded-none", B.className, O?.paper),
135
135
  style: {
136
136
  minWidth: 0,
137
137
  minHeight: 0,
@@ -154,33 +154,33 @@ var Ie = {
154
154
  maxHeight: "100%"
155
155
  } : { maxHeight: "calc(100% - 64px)" }
156
156
  },
157
- children: [(!!x || !!h || M) && /* @__PURE__ */ u("div", {
158
- className: i("box-border flex w-full min-w-0 max-w-full justify-between px-4 pt-4", "max-xs:flex-col-reverse max-xs:gap-2"),
159
- children: [/* @__PURE__ */ u("div", {
160
- className: "flex min-w-0 flex-1 flex-col justify-start gap-0.5",
161
- children: [x && /* @__PURE__ */ a("div", {
157
+ children: [(!!i || !!h || M) && /* @__PURE__ */ m("div", {
158
+ className: c("box-border flex w-full min-w-0 max-w-full justify-between px-4 pt-4", "max-xs:flex-wrap-reverse max-xs:items-center max-xs:gap-x-2 max-xs:gap-y-0.5"),
159
+ children: [/* @__PURE__ */ m("div", {
160
+ className: "flex min-w-0 flex-1 flex-col justify-start gap-0.5 max-xs:contents",
161
+ children: [i && /* @__PURE__ */ a("div", {
162
162
  id: P,
163
- className: i("flex h-8 items-center text-sm font-normal leading-5 text-delta-600", "max-xs:h-auto max-xs:min-h-8 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]"),
164
- children: x
163
+ className: c("flex h-8 items-center text-sm font-normal leading-5 text-delta-600", "max-xs:h-auto max-xs:min-h-8 max-xs:min-w-0 max-xs:flex-auto max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]"),
164
+ children: i
165
165
  }), h && /* @__PURE__ */ a("div", {
166
- id: p,
167
- className: i("flex text-2xl font-semibold leading-8 text-delta-800", "max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]"),
166
+ id: w,
167
+ className: c("flex text-2xl font-semibold leading-8 text-delta-800", "max-xs:hyphens-auto", i && "max-xs:order-first max-xs:basis-full max-xs:![overflow-wrap:anywhere]", !i && "max-xs:block max-xs:min-w-[min(100%,5rem)] max-xs:grow max-xs:basis-[min-content] max-xs:break-words"),
168
168
  children: h
169
169
  })]
170
- }), M && /* @__PURE__ */ u("div", {
171
- className: "flex min-w-0 max-w-full shrink-0 justify-end gap-2 max-xs:flex-wrap max-xs:gap-y-2",
170
+ }), M && /* @__PURE__ */ m("div", {
171
+ className: "flex min-w-0 max-w-full shrink-0 justify-end gap-2 max-xs:ml-auto max-xs:flex-wrap max-xs:gap-y-2 max-xs:self-end",
172
172
  children: [re, /* @__PURE__ */ a(ve, {
173
173
  dataTest: `close-button-${f}`,
174
174
  "aria-label": q ? void 0 : "Close",
175
175
  variant: "textGray",
176
176
  size: "small",
177
- endIcon: /* @__PURE__ */ a(pe, {
177
+ endIcon: /* @__PURE__ */ a(we, {
178
178
  width: 20,
179
179
  height: 20
180
180
  }),
181
181
  className: "max-w-full shrink-0 whitespace-nowrap",
182
182
  disabled: v,
183
- disabledReason: se,
183
+ disabledReason: le,
184
184
  onClick: (e) => {
185
185
  F(e);
186
186
  },
@@ -193,10 +193,10 @@ var Ie = {
193
193
  })]
194
194
  })]
195
195
  }), /* @__PURE__ */ a(be.Provider, {
196
- value: s,
196
+ value: l,
197
197
  children: /* @__PURE__ */ a(Be.Provider, {
198
- value: le,
199
- children: /* @__PURE__ */ a(we.Provider, {
198
+ value: se,
199
+ children: /* @__PURE__ */ a(pe.Provider, {
200
200
  value: ie,
201
201
  children: S
202
202
  })
@@ -2,7 +2,7 @@ import { cn as w } from "../../../../helpers/cn.js";
2
2
  import { StyledTooltip as K } from "../../../data-display/tooltip/StyledTooltip.js";
3
3
  import { DotsVerticalIcon as U } from "../../../icons/dots-vertical-icon/DotsVerticalIcon.js";
4
4
  import { DialogBusyContext as X, WAIT_UNTIL_SAVED as V, useReportDialogBusy as G } from "../DialogBusyContext.js";
5
- import { StyledButton as I } from "../../../inputs/button/StyledButton.js";
5
+ import { StyledButton as P } from "../../../inputs/button/StyledButton.js";
6
6
  import { useMaxXsMediaQuery as Y } from "../../../../hooks/useMediaQuery.hook.js";
7
7
  import { StyledMenu as Q } from "../../../navigation/menu/StyledMenu.js";
8
8
  import { StyledMenuItem as q } from "../../../navigation/menu/StyledMenuItem.js";
@@ -11,15 +11,15 @@ import { useWidthRegistry as Z } from "../../../../hooks/useWidthRegistry.js";
11
11
  import { planToolbarActions as ee } from "../../../custom/module/header-layout/planToolbarActions.js";
12
12
  import { ToolbarActionButton as oe, overflowItemState as re } from "../../../custom/module/header-layout/ToolbarActionGroup.js";
13
13
  import { useToolbarTranslations as ne } from "../../../custom/module/header-layout/useTranslations.js";
14
- import { useContext as le, useMemo as P, useState as ae } from "react";
15
- import { Fragment as R, jsx as o, jsxs as c } from "react/jsx-runtime";
16
- var ie = 2, te = 470, se = 8, _ = "dialog-footer-right", O = "dialog-footer-more", E = (n, l) => `dialog-footer-action:${n}:${l ? "label" : "icon"}`;
17
- function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAction: p, fixed: L = !1, rounded: W = !0, locale: a = "en", className: S, dataTest: x = "styled-dialog-footer" }) {
18
- const T = le(X), h = ne(a), { ref: D, widthPx: u } = J(), { register: g, widths: i } = Z(), [b, v] = ae(null), t = u > 0 && u < te, j = t ? 8 : 16, s = P(() => n.filter((e) => !e.hidden).map((e) => e.icon == null && e.canHideLabel == null ? {
14
+ import { useContext as le, useMemo as R, useState as ie } from "react";
15
+ import { Fragment as _, jsx as o, jsxs as m } from "react/jsx-runtime";
16
+ var te = 2, ae = 470, se = 8, k = "dialog-footer-right", O = "dialog-footer-more", E = (n, l) => `dialog-footer-action:${n}:${l ? "label" : "icon"}`;
17
+ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAction: p, fixed: L = !1, rounded: W = !0, locale: i = "en", className: S, dataTest: h = "styled-dialog-footer" }) {
18
+ const T = le(X), u = ne(i), { ref: D, widthPx: x } = J(), { register: g, widths: t } = Z(), [b, v] = ie(null), a = x > 0 && x < ae, $ = a ? 8 : 16, s = R(() => n.filter((e) => !e.hidden).map((e) => e.icon == null && e.canHideLabel == null ? {
19
19
  ...e,
20
20
  canHideLabel: !1
21
- } : e), [n]), $ = i[_] ?? 0, B = f != null || p != null, z = Y(), C = Math.max(0, u - j * 2 - (z ? 0 : $ + (B ? se : 0))), d = P(() => {
22
- if (s.length >= ie) return {
21
+ } : e), [n]), z = t[k] ?? 0, B = f != null || p != null, F = Y(), C = Math.max(0, x - $ * 2 - (F ? 0 : z + (B ? se : 0))), d = R(() => {
22
+ if (s.length >= te) return {
23
23
  inlineActions: [],
24
24
  overflowActions: s,
25
25
  showMoreMenu: !0
@@ -28,10 +28,10 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
28
28
  actions: s,
29
29
  availableWidth: C,
30
30
  collapseLabels: !0,
31
- resolveActionWidth: (r, m) => i[E(r.id, m)],
32
- moreButtonWidthPx: i[O]
31
+ resolveActionWidth: (r, c) => t[E(r.id, c)],
32
+ moreButtonWidthPx: t[O]
33
33
  });
34
- return t ? {
34
+ return a ? {
35
35
  ...e,
36
36
  inlineActions: e.inlineActions.map((r) => r.action.canHideLabel === !1 ? r : {
37
37
  ...r,
@@ -41,25 +41,25 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
41
41
  }, [
42
42
  s,
43
43
  C,
44
- i,
45
- t
44
+ t,
45
+ a
46
46
  ]);
47
47
  G(l == null && d.overflowActions.some((e) => !!e.loading && e.holdsDialog !== !1));
48
- const M = (e, r, m) => {
49
- const N = m === "secondary" && T?.busy, y = !!e.disabled || !!N, k = N ? T.busyReason ?? V[a] : e.tooltip, A = y || !!e.loading, F = /* @__PURE__ */ o(I, {
50
- locale: a,
51
- dataTest: e.dataTest ?? `${x}-${m}`,
48
+ const M = (e, r, c) => {
49
+ const N = c === "secondary" && T?.busy, y = !!e.disabled || !!N, A = N ? T.busyReason ?? V[i] : e.tooltip, I = y || !!e.loading, j = /* @__PURE__ */ o(P, {
50
+ locale: i,
51
+ dataTest: e.dataTest ?? `${h}-${c}`,
52
52
  variant: e.variant ?? r,
53
53
  error: e.tone === "danger",
54
54
  size: "medium",
55
55
  type: e.type ?? "button",
56
- disabled: y && !!k,
57
- "aria-disabled": A || void 0,
58
- disabledReason: k,
56
+ disabled: y && !!A,
57
+ "aria-disabled": I || void 0,
58
+ disabledReason: A,
59
59
  loading: !!e.loading,
60
60
  startIcon: e.icon,
61
61
  endIcon: e.endIcon,
62
- onClick: A ? (H) => H.preventDefault() : e.onClick,
62
+ onClick: I ? (H) => H.preventDefault() : e.onClick,
63
63
  "aria-label": e.ariaLabel,
64
64
  children: e.label
65
65
  });
@@ -69,35 +69,35 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
69
69
  open: y || !e.tooltip ? !1 : void 0,
70
70
  children: /* @__PURE__ */ o("span", {
71
71
  className: "inline-flex",
72
- children: F
72
+ children: j
73
73
  })
74
74
  });
75
75
  };
76
- return /* @__PURE__ */ c("div", {
76
+ return /* @__PURE__ */ m("div", {
77
77
  ref: D,
78
- "data-testid": x,
79
- className: w("flex items-center justify-end self-stretch border-0 border-t border-solid border-delta-200 bg-white", "max-xs:flex-wrap max-xs:justify-between max-xs:gap-y-2", t ? "gap-2 p-2" : "gap-4 p-4", W && "rounded-b-lg", L && "sticky bottom-0 z-[1]", S),
78
+ "data-testid": h,
79
+ className: w("flex items-center justify-end self-stretch border-0 border-t border-solid border-delta-200 bg-white", "max-xs:flex-wrap max-xs:gap-y-2", a ? "gap-2 p-2" : "gap-4 p-4", W && "rounded-b-lg", L && "sticky bottom-0 z-[1]", S),
80
80
  children: [/* @__PURE__ */ o("div", {
81
- className: "flex shrink-0 flex-nowrap items-center gap-2 max-xs:min-w-0 max-xs:shrink",
82
- children: l ?? /* @__PURE__ */ c(R, { children: [d.inlineActions.map(({ action: e, showLabel: r }) => /* @__PURE__ */ o("span", {
81
+ className: "flex shrink-0 flex-nowrap items-center gap-2 max-xs:mr-auto max-xs:min-w-0 max-xs:shrink",
82
+ children: l ?? /* @__PURE__ */ m(_, { children: [d.inlineActions.map(({ action: e, showLabel: r }) => /* @__PURE__ */ o("span", {
83
83
  ref: g(E(e.id, r)),
84
84
  className: "inline-flex shrink-0",
85
85
  children: /* @__PURE__ */ o(oe, {
86
86
  action: e,
87
87
  showLabel: r,
88
- inProgressLabel: h.inProgress
88
+ inProgressLabel: u.inProgress
89
89
  })
90
- }, e.id)), d.showMoreMenu && /* @__PURE__ */ c(R, { children: [/* @__PURE__ */ o("span", {
90
+ }, e.id)), d.showMoreMenu && /* @__PURE__ */ m(_, { children: [/* @__PURE__ */ o("span", {
91
91
  ref: g(O),
92
92
  className: "inline-flex shrink-0",
93
- children: /* @__PURE__ */ o(I, {
94
- locale: a,
95
- dataTest: `${x}-more`,
93
+ children: /* @__PURE__ */ o(P, {
94
+ locale: i,
95
+ dataTest: `${h}-more`,
96
96
  variant: "outlined",
97
97
  size: "medium",
98
98
  type: "button",
99
99
  onClick: (e) => v(e.currentTarget),
100
- "aria-label": h.more,
100
+ "aria-label": u.more,
101
101
  "aria-haspopup": "menu",
102
102
  "aria-expanded": b != null,
103
103
  startIcon: /* @__PURE__ */ o(U, {
@@ -118,7 +118,7 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
118
118
  horizontal: "left"
119
119
  },
120
120
  children: d.overflowActions.map((e) => /* @__PURE__ */ o(q, {
121
- ...re(e, h.inProgress),
121
+ ...re(e, u.inProgress),
122
122
  onClick: () => {
123
123
  v(null), e.onClick();
124
124
  },
@@ -129,10 +129,10 @@ function Ce({ leftActions: n = [], leadingSlot: l, secondaryAction: f, primaryAc
129
129
  }, e.id))
130
130
  })] })] })
131
131
  }), B && /* @__PURE__ */ o("span", {
132
- className: w("flex min-w-px flex-1 flex-nowrap items-center justify-end", "max-xs:min-w-fit max-xs:flex-wrap max-xs:gap-y-2"),
133
- children: /* @__PURE__ */ c("span", {
134
- ref: g(_),
135
- className: w("flex shrink-0 flex-nowrap items-center gap-2", "max-xs:max-w-full max-xs:shrink max-xs:flex-wrap max-xs:justify-end"),
132
+ className: w("flex min-w-px flex-1 flex-nowrap items-center justify-end", "max-xs:contents"),
133
+ children: /* @__PURE__ */ m("span", {
134
+ ref: g(k),
135
+ className: w("flex shrink-0 flex-nowrap items-center gap-2", "max-xs:contents"),
136
136
  children: [f && M(f, "outlined", "secondary"), p && M(p, "contained", "primary")]
137
137
  })
138
138
  })]
@@ -1,9 +1,9 @@
1
- import { cn as l } from "../../../../helpers/cn.js";
1
+ import { cn as n } from "../../../../helpers/cn.js";
2
2
  import { firstTabbable as A } from "../../../../helpers/focusable.js";
3
- import { StyledTooltip as ne } from "../../../data-display/tooltip/StyledTooltip.js";
3
+ import { StyledTooltip as le } from "../../../data-display/tooltip/StyledTooltip.js";
4
4
  import { DialogBusyContext as L, useDialogBusyBoundary as ie } from "../../dialog/DialogBusyContext.js";
5
5
  import { useMobileMediaQuery as oe } from "../../../../hooks/useMediaQuery.hook.js";
6
- import { OverlayBackOwnerContext as re, isOverlayBackNavigationPending as ae, useBackCloses as se } from "../../../../hooks/useBackCloses.hook.js";
6
+ import { OverlayBackOwnerContext as ae, isOverlayBackNavigationPending as re, useBackCloses as se } from "../../../../hooks/useBackCloses.hook.js";
7
7
  import { useFocusTrap as ce } from "../../../../hooks/useFocusTrap.hook.js";
8
8
  import { fullScreenFieldWidthVars as me } from "../../../inputs/field-styles.js";
9
9
  import { CloseBtn as V } from "../components/CloseBtn.js";
@@ -14,33 +14,33 @@ import { useTranslations as ue } from "./useTranslations.js";
14
14
  import { useControlledProps as xe } from "./useControlledProps.js";
15
15
  import fe from "clsx";
16
16
  import { useId as W, useLayoutEffect as H, useRef as m } from "react";
17
- import { Fragment as pe, jsx as e, jsxs as r } from "react/jsx-runtime";
17
+ import { Fragment as pe, jsx as e, jsxs as a } from "react/jsx-runtime";
18
18
  var Pe = (C) => {
19
- const { showCloseIcon: R = !0, showMinimizeIcon: _ = !0, showExpandIcon: Q = !0, enableFullscreen: U = !0, fullscreenLockedReason: N, title: u, label: x, children: G, open: n, onClose: J, classNameOverrides: y = {
19
+ const { showCloseIcon: R = !0, showMinimizeIcon: _ = !0, showExpandIcon: Q = !0, enableFullscreen: U = !0, fullscreenLockedReason: N, title: u, label: x, children: G, open: l, onClose: J, classNameOverrides: b = {
20
20
  maximized: "",
21
21
  minimized: "",
22
22
  fullscreen: ""
23
- }, dataTest: K, actionNode: X, locale: Y = "en", busyReason: Z, style: B, initialFocusRef: F } = C, a = oe(), i = ue(Y), o = m(null), f = m(null), S = m(null), k = m(null), b = m(!1), w = m(null), p = W(), T = W(), { minimized: t, setMinimized: I, fullScreen: s, setFullScreen: M } = xe(C), c = s && !t, j = !!N, { busy: g, busyReason: E, contextValue: P } = ie(Z ?? i.waitUntilSaved), h = () => {
23
+ }, dataTest: K, actionNode: X, locale: Y = "en", busyReason: Z, style: k, initialFocusRef: B } = C, r = oe(), i = ue(Y), o = m(null), f = m(null), F = m(null), S = m(null), w = m(!1), y = m(null), p = W(), T = W(), { minimized: t, setMinimized: I, fullScreen: s, setFullScreen: M } = xe(C), c = s && !t, j = !!N, { busy: g, busyReason: E, contextValue: P } = ie(Z ?? i.waitUntilSaved), h = () => {
24
24
  if (g) return !1;
25
25
  I(!1), J();
26
26
  };
27
27
  H(() => {
28
28
  o.current?.toggleAttribute("inert", t), f.current?.toggleAttribute("inert", !t);
29
29
  }, [t]), H(() => {
30
- const z = n && !b.current, d = !n && b.current;
31
- if (b.current = n, d) {
32
- const D = w.current;
33
- w.current = null, (!document.activeElement || document.activeElement === document.body) && D?.isConnected && D.focus({ preventScroll: !0 });
30
+ const z = l && !w.current, d = !l && w.current;
31
+ if (w.current = l, d) {
32
+ const D = y.current;
33
+ y.current = null, (!document.activeElement || document.activeElement === document.body) && D?.isConnected && D.focus({ preventScroll: !0 });
34
34
  return;
35
35
  }
36
36
  if (!z) return;
37
- w.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
38
- const q = t ? f.current : o.current, le = t ? k.current : S.current;
39
- (F?.current ?? le ?? (q ? A(q) : void 0))?.focus({ preventScroll: !0 });
37
+ y.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
38
+ const q = t ? f.current : o.current, ne = t ? S.current : F.current;
39
+ (B?.current ?? ne ?? (q ? A(q) : void 0))?.focus({ preventScroll: !0 });
40
40
  }, [
41
- F,
41
+ B,
42
42
  t,
43
- n
43
+ l
44
44
  ]);
45
45
  const O = () => {
46
46
  const z = t ? o : f;
@@ -49,12 +49,12 @@ var Pe = (C) => {
49
49
  d && (d.querySelector('[data-testid="toggle-minimize-btn"]') ?? A(d))?.focus({ preventScroll: !0 });
50
50
  });
51
51
  };
52
- ce(n && c, o, h), se({
53
- active: n && !t,
54
- requestClose: () => !c && ae() ? !1 : h(),
52
+ ce(l && c, o, h), se({
53
+ active: l && !t,
54
+ requestClose: () => !c && re() ? !1 : h(),
55
55
  ownerRef: o
56
56
  });
57
- const ee = c ? a ? {
57
+ const ee = c ? r ? {
58
58
  inset: 0,
59
59
  maxHeight: "100dvh",
60
60
  maxWidth: "100dvw",
@@ -72,30 +72,30 @@ var Pe = (C) => {
72
72
  height: "95dvh",
73
73
  ...me
74
74
  } : void 0;
75
- if (!n) return null;
75
+ if (!l) return null;
76
76
  const te = x ? `${T} ${p}` : p;
77
- return /* @__PURE__ */ r(pe, { children: [
77
+ return /* @__PURE__ */ a(pe, { children: [
78
78
  /* @__PURE__ */ e("div", {
79
79
  ref: f,
80
80
  style: {
81
81
  zIndex: 51,
82
- ...B
82
+ ...k
83
83
  },
84
- className: l(v["minimized-dialog"], !t && v.hidden, y.minimized),
85
- children: /* @__PURE__ */ r("div", {
84
+ className: n(v["minimized-dialog"], !t && v.hidden, b.minimized),
85
+ children: /* @__PURE__ */ a("div", {
86
86
  className: fe("flex items-center justify-between", !t && "hidden"),
87
87
  "data-testid": K,
88
88
  children: [/* @__PURE__ */ e("div", {
89
- className: l("max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
90
- children: /* @__PURE__ */ e(ne, {
89
+ className: n("max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
90
+ children: /* @__PURE__ */ e(le, {
91
91
  title: u,
92
92
  placement: "top",
93
93
  children: /* @__PURE__ */ e("div", {
94
- className: l("truncate", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
94
+ className: n("truncate", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
95
95
  children: u
96
96
  })
97
97
  })
98
- }), /* @__PURE__ */ r("div", {
98
+ }), /* @__PURE__ */ a("div", {
99
99
  className: "flex items-center gap-x-1",
100
100
  children: [/* @__PURE__ */ e($, {
101
101
  type: "expand",
@@ -103,7 +103,7 @@ var Pe = (C) => {
103
103
  onClick: O,
104
104
  tooltipTitle: i.expand
105
105
  }), /* @__PURE__ */ e(V, {
106
- buttonRef: k,
106
+ buttonRef: S,
107
107
  showCloseIcon: R,
108
108
  onClick: h,
109
109
  disabledReason: g ? E : void 0,
@@ -121,43 +121,43 @@ var Pe = (C) => {
121
121
  /* @__PURE__ */ e("div", {
122
122
  style: {
123
123
  zIndex: 51,
124
- ...B,
124
+ ...k,
125
125
  ...ee
126
126
  },
127
127
  ref: o,
128
128
  role: "dialog",
129
129
  "aria-modal": c ? !0 : void 0,
130
130
  "aria-labelledby": te,
131
- className: l(v.dialog, t && v.hidden, !s && y.maximized, s && y.fullscreen, c && "fixed z-[53] duration-0"),
132
- children: /* @__PURE__ */ r(re.Provider, {
131
+ className: n(v.dialog, t && v.hidden, !s && b.maximized, s && b.fullscreen, c && "fixed z-[53] duration-0"),
132
+ children: /* @__PURE__ */ a(ae.Provider, {
133
133
  value: o,
134
- children: [/* @__PURE__ */ r("div", {
135
- className: l("flex flex-col border-b-[1px] border-delta-200 px-4", a ? "py-3" : "py-4"),
136
- children: [/* @__PURE__ */ r("div", {
137
- className: l("flex items-center justify-between", "max-xs:flex-col-reverse max-xs:items-stretch max-xs:gap-2"),
134
+ children: [/* @__PURE__ */ a("div", {
135
+ className: n("flex flex-col border-b-[1px] border-delta-200 px-4", r ? "py-3" : "py-4"),
136
+ children: [/* @__PURE__ */ a("div", {
137
+ className: n("flex items-center justify-between", "max-xs:flex-wrap-reverse max-xs:gap-x-2 max-xs:gap-y-2"),
138
138
  children: [x ? /* @__PURE__ */ e("div", {
139
139
  id: T,
140
- className: "text-sm text-delta-700 max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]",
140
+ className: "text-sm text-delta-700 max-xs:min-w-0 max-xs:flex-auto max-xs:hyphens-auto max-xs:![overflow-wrap:anywhere]",
141
141
  children: x
142
142
  }) : /* @__PURE__ */ e("div", {
143
143
  id: p,
144
- className: l("font-semibold text-delta-800", a ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl", "max-xs:line-clamp-none", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
144
+ className: n("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl", "max-xs:line-clamp-none max-xs:hyphens-auto max-xs:whitespace-normal", "max-xs:block max-xs:min-w-[min(100%,5rem)] max-xs:grow max-xs:basis-[min-content] max-xs:break-words"),
145
145
  children: u
146
- }), /* @__PURE__ */ r("div", {
147
- className: "flex items-center gap-x-1 max-xs:flex-wrap max-xs:justify-end max-xs:gap-y-2",
146
+ }), /* @__PURE__ */ a("div", {
147
+ className: "flex items-center gap-x-1 max-xs:ml-auto max-xs:flex-wrap max-xs:justify-end max-xs:gap-y-2 max-xs:self-end",
148
148
  children: [
149
149
  /* @__PURE__ */ e(L.Provider, {
150
150
  value: P,
151
151
  children: X
152
152
  }),
153
153
  /* @__PURE__ */ e($, {
154
- visibility: _ && !a,
154
+ visibility: _ && !r,
155
155
  type: "minimize",
156
156
  onClick: O,
157
157
  tooltipTitle: i.minimize
158
158
  }),
159
159
  /* @__PURE__ */ e(de, {
160
- showFullScreenIcon: (U || j) && !a,
160
+ showFullScreenIcon: (U || j) && !r,
161
161
  disabledReason: N,
162
162
  fullScreen: s,
163
163
  onClick: () => {
@@ -166,7 +166,7 @@ var Pe = (C) => {
166
166
  tooltipTitle: s ? i.exitFullscreen : i.fullscreen
167
167
  }),
168
168
  /* @__PURE__ */ e(V, {
169
- buttonRef: S,
169
+ buttonRef: F,
170
170
  showCloseIcon: R,
171
171
  onClick: h,
172
172
  disabledReason: g ? E : void 0,
@@ -176,11 +176,11 @@ var Pe = (C) => {
176
176
  })]
177
177
  }), x && /* @__PURE__ */ e("div", {
178
178
  id: p,
179
- className: l("font-semibold text-delta-800", a ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl", "max-xs:line-clamp-none", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
179
+ className: n("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl", "max-xs:line-clamp-none", "max-xs:hyphens-auto max-xs:whitespace-normal max-xs:![overflow-wrap:anywhere]"),
180
180
  children: u
181
181
  })]
182
182
  }), /* @__PURE__ */ e("div", {
183
- className: l(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
183
+ className: n(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
184
184
  children: /* @__PURE__ */ e(L.Provider, {
185
185
  value: P,
186
186
  children: G