asma-ui-core 3.61.0 → 3.61.2

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.
@@ -17,9 +17,9 @@ import H from "clsx";
17
17
  import { useRef as fe, useState as J } from "react";
18
18
  import { Fragment as z, jsx as e, jsxs as i } from "react/jsx-runtime";
19
19
  var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", onFullScreenText: M = "", showCloseIcon: j = !0, showMinimizeIcon: Q = !0, showExpandIcon: T = !0, showFullScreenIcon: W = !0, title: s, label: b, children: g, open: C, onClose: x, className: _ = "", primaryButtonText: w, primaryButtonLoading: k = !1, secondaryButtonText: c, onPrimaryButtonClick: v, onSecondaryButtonClick: p, dataTest: F, actionNode: X, extraActions: r, extraActionsText: m, btnContainerClassName: G, footerClassName: Y, footerInfo: D, locale: l = "en", enableFullscreen: Z = !0, fullScreenState: E, handleFullScreenState: L }) => {
20
- const [d, A] = J(!1), [R, P] = J(!1), { open: B, anchorEl: ee, handleOpen: ie, handleClose: te } = he(), S = fe(null), o = E ?? R, a = o && !d;
21
- if (se(C && a, S, x), !C) return null;
22
- const le = a ? {
20
+ const [d, A] = J(!1), [R, P] = J(!1), { open: B, anchorEl: ee, handleOpen: ie, handleClose: te } = he(), S = fe(null), a = E ?? R, n = a && !d;
21
+ if (se(C && n, S, x), !C) return null;
22
+ const le = n ? {
23
23
  right: "auto",
24
24
  bottom: "auto",
25
25
  left: "50%",
@@ -27,11 +27,11 @@ var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", o
27
27
  transform: "translate(-50%, -50%)",
28
28
  width: "min(1000px, calc(100vw - 32px))",
29
29
  height: "95dvh"
30
- } : void 0, O = o ? l === "en" ? "Exit full screen" : "Avslutt fullskjerm" : l === "en" ? "Full screen" : "Fullskjerm", y = w ?? k, U = y || c, V = () => {
30
+ } : void 0, O = a ? l === "en" ? "Exit full screen" : "Avslutt fullskjerm" : l === "en" ? "Full screen" : "Fullskjerm", y = w ?? k, U = y || c, V = () => {
31
31
  A(!d);
32
32
  };
33
33
  return /* @__PURE__ */ i(z, { children: [
34
- a && /* @__PURE__ */ e("div", { className: "fixed inset-0 z-[51] bg-[rgb(98,110,126)] bg-opacity-70" }),
34
+ n && /* @__PURE__ */ e("div", { className: "fixed inset-0 z-[51] bg-[rgb(98,110,126)] bg-opacity-70" }),
35
35
  /* @__PURE__ */ e("div", {
36
36
  style: { zIndex: 51 },
37
37
  className: h(q.dialog, !d && q.hidden),
@@ -80,10 +80,10 @@ var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", o
80
80
  /* @__PURE__ */ i("div", {
81
81
  ref: S,
82
82
  style: le,
83
- role: a ? "dialog" : void 0,
84
- "aria-modal": a ? !0 : void 0,
85
- "aria-label": a && typeof s == "string" ? s : void 0,
86
- className: h("fixed bottom-4 right-4 z-[51] rounded-lg bg-white shadow-[0_4px_40px_0px_rgba(34,33,51,0.4)] transition-all duration-300", _ && !d && !o ? _ : "", d && "!h-0 !w-0 opacity-0 duration-0", a && "fixed duration-0"),
83
+ role: n ? "dialog" : void 0,
84
+ "aria-modal": n ? !0 : void 0,
85
+ "aria-label": n && typeof s == "string" ? s : void 0,
86
+ className: h("fixed bottom-4 right-4 z-[51] rounded-lg bg-white shadow-[0_4px_40px_0px_rgba(34,33,51,0.4)] transition-all duration-300", _ && !d && !a ? _ : "", d && "!h-0 !w-0 opacity-0 duration-0", n && "fixed duration-0"),
87
87
  "data-testid": F,
88
88
  children: [/* @__PURE__ */ i("div", {
89
89
  className: "flex flex-col gap-y-2 border-b-[1px] border-delta-200 p-4",
@@ -99,7 +99,7 @@ var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", o
99
99
  className: "flex items-center gap-x-1",
100
100
  children: [
101
101
  X,
102
- Q && /* @__PURE__ */ e(f, {
102
+ Q && !a && /* @__PURE__ */ e(f, {
103
103
  title: l === "en" ? "Minimize" : "Minimer",
104
104
  children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(t, {
105
105
  dataTest: "minimize-button",
@@ -122,10 +122,10 @@ var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", o
122
122
  "aria-label": M ? void 0 : O,
123
123
  variant: "textGray",
124
124
  size: "small",
125
- onClick: (n) => {
126
- E !== void 0 && L ? L() : P(!R), n.detail !== 0 && n.currentTarget.blur();
125
+ onClick: (o) => {
126
+ E !== void 0 && L ? L() : P(!R), o.detail !== 0 && o.currentTarget.blur();
127
127
  },
128
- endIcon: o ? /* @__PURE__ */ e(oe, {
128
+ endIcon: a ? /* @__PURE__ */ e(oe, {
129
129
  width: 20,
130
130
  height: 20,
131
131
  color: "text-delta-700"
@@ -160,10 +160,10 @@ var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", o
160
160
  children: s
161
161
  })]
162
162
  }), /* @__PURE__ */ i("div", {
163
- className: H("flex flex-col", o && !d && "h-[87dvh]"),
163
+ className: H("flex flex-col", a && !d && "h-[87dvh]"),
164
164
  children: [/* @__PURE__ */ e("div", {
165
165
  className: "flex-grow overflow-y-auto",
166
- children: typeof g == "function" ? g({ fullScreen: o }) : g
166
+ children: typeof g == "function" ? g({ fullScreen: a }) : g
167
167
  }), (Array.isArray(r) && r.length || typeof r == "function") && m || D ? /* @__PURE__ */ i("div", {
168
168
  className: h("flex items-center justify-between border-0 border-t-[1px] border-solid border-delta-200 bg-white p-4", Y),
169
169
  children: [
@@ -180,11 +180,11 @@ var Ee = ({ onCloseText: u = "", onMinimizeText: N = "", onExpandText: I = "", o
180
180
  open: B,
181
181
  anchorEl: ee,
182
182
  onClose: te,
183
- children: r.map((n) => /* @__PURE__ */ e(me, {
184
- className: n.className,
185
- onClick: n.onClick,
186
- children: n.label
187
- }, n.label))
183
+ children: r.map((o) => /* @__PURE__ */ e(me, {
184
+ className: o.className,
185
+ onClick: o.onClick,
186
+ children: o.label
187
+ }, o.label))
188
188
  })] }) : m && typeof r == "function" && /* @__PURE__ */ e(t, {
189
189
  dataTest: "extra-action-button",
190
190
  variant: "text",
@@ -10,17 +10,17 @@ import { useTranslations as V } from "./useTranslations.js";
10
10
  import { useControlledProps as _ } from "./useControlledProps.js";
11
11
  import $ from "clsx";
12
12
  import { useRef as A } from "react";
13
- import { Fragment as E, jsx as e, jsxs as t } from "react/jsx-runtime";
13
+ import { Fragment as E, jsx as e, jsxs as o } from "react/jsx-runtime";
14
14
  var ee = (f) => {
15
- const { showCloseIcon: u = !0, showMinimizeIcon: N = !0, showExpandIcon: w = !0, enableFullscreen: C = !0, title: o, label: m, children: F, open: h, onClose: T, classNameOverrides: d = {
15
+ const { showCloseIcon: u = !0, showMinimizeIcon: N = !0, showExpandIcon: w = !0, enableFullscreen: C = !0, title: n, label: m, children: F, open: h, onClose: T, classNameOverrides: d = {
16
16
  maximized: "",
17
17
  minimized: "",
18
18
  fullscreen: ""
19
- }, dataTest: M, actionNode: S, locale: k = "en", style: v } = f, s = B(), n = V(k), b = A(null), { minimized: i, setMinimized: x, fullScreen: a, setFullScreen: g } = _(f), l = a && !i, p = () => {
19
+ }, dataTest: M, actionNode: S, locale: k = "en", style: v } = f, s = B(), a = V(k), b = A(null), { minimized: i, setMinimized: x, fullScreen: l, setFullScreen: g } = _(f), t = l && !i, p = () => {
20
20
  x(!1), T();
21
21
  };
22
- D(h && l, b, p);
23
- const I = l ? {
22
+ D(h && t, b, p);
23
+ const I = t ? {
24
24
  right: "auto",
25
25
  bottom: "auto",
26
26
  left: "50%",
@@ -30,27 +30,27 @@ var ee = (f) => {
30
30
  maxWidth: "min(1000px, calc(100vw - 32px))",
31
31
  height: "95dvh"
32
32
  } : void 0;
33
- return h ? /* @__PURE__ */ t(E, { children: [
33
+ return h ? /* @__PURE__ */ o(E, { children: [
34
34
  /* @__PURE__ */ e("div", {
35
35
  style: {
36
36
  zIndex: 51,
37
37
  ...v
38
38
  },
39
39
  className: r(c["minimized-dialog"], !i && c.hidden, d.minimized),
40
- children: /* @__PURE__ */ t("div", {
40
+ children: /* @__PURE__ */ o("div", {
41
41
  className: $("flex items-center justify-between", !i && "hidden"),
42
42
  "data-testid": M,
43
43
  children: [/* @__PURE__ */ e("div", {
44
44
  className: "max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800",
45
45
  children: /* @__PURE__ */ e(j, {
46
- title: o,
46
+ title: n,
47
47
  placement: "top",
48
48
  children: /* @__PURE__ */ e("div", {
49
49
  className: "truncate",
50
- children: o
50
+ children: n
51
51
  })
52
52
  })
53
- }), /* @__PURE__ */ t("div", {
53
+ }), /* @__PURE__ */ o("div", {
54
54
  className: "flex items-center gap-x-1",
55
55
  children: [/* @__PURE__ */ e(z, {
56
56
  type: "expand",
@@ -58,72 +58,72 @@ var ee = (f) => {
58
58
  onClick: () => {
59
59
  x(!i);
60
60
  },
61
- tooltipTitle: n.expand
61
+ tooltipTitle: a.expand
62
62
  }), /* @__PURE__ */ e(y, {
63
63
  showCloseIcon: u,
64
64
  onClick: p,
65
- tooltipTitle: n.close
65
+ tooltipTitle: a.close
66
66
  })]
67
67
  })]
68
68
  })
69
69
  }),
70
- l && /* @__PURE__ */ e("div", {
70
+ t && /* @__PURE__ */ e("div", {
71
71
  className: "fixed inset-0 z-[52] bg-[rgb(98,110,126)] bg-opacity-70",
72
72
  onClick: () => {
73
73
  g(!1);
74
74
  }
75
75
  }),
76
- /* @__PURE__ */ t("div", {
76
+ /* @__PURE__ */ o("div", {
77
77
  style: {
78
78
  zIndex: 51,
79
79
  ...v,
80
80
  ...I
81
81
  },
82
82
  ref: b,
83
- role: l ? "dialog" : void 0,
84
- "aria-modal": l ? !0 : void 0,
85
- "aria-label": l && typeof o == "string" ? o : void 0,
86
- className: r(c.dialog, i && c.hidden, !a && d.maximized, a && d.fullscreen, l && "fixed z-[53] duration-0"),
87
- children: [/* @__PURE__ */ t("div", {
83
+ role: t ? "dialog" : void 0,
84
+ "aria-modal": t ? !0 : void 0,
85
+ "aria-label": t && typeof n == "string" ? n : void 0,
86
+ className: r(c.dialog, i && c.hidden, !l && d.maximized, l && d.fullscreen, t && "fixed z-[53] duration-0"),
87
+ children: [/* @__PURE__ */ o("div", {
88
88
  className: r("flex flex-col border-b-[1px] border-delta-200 px-4", s ? "py-3" : "py-4"),
89
- children: [/* @__PURE__ */ t("div", {
89
+ children: [/* @__PURE__ */ o("div", {
90
90
  className: "flex items-center justify-between",
91
91
  children: [m ? /* @__PURE__ */ e("div", {
92
92
  className: "text-sm text-delta-700",
93
93
  children: m
94
94
  }) : /* @__PURE__ */ e("div", {
95
95
  className: r("font-semibold text-delta-800", s ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
96
- children: o
97
- }), /* @__PURE__ */ t("div", {
96
+ children: n
97
+ }), /* @__PURE__ */ o("div", {
98
98
  className: "flex items-center gap-x-1",
99
99
  children: [
100
100
  S,
101
101
  /* @__PURE__ */ e(z, {
102
- visibility: N && !s,
102
+ visibility: N && !s && !l,
103
103
  type: "minimize",
104
104
  onClick: () => {
105
105
  x(!i);
106
106
  },
107
- tooltipTitle: n.minimize
107
+ tooltipTitle: a.minimize
108
108
  }),
109
109
  /* @__PURE__ */ e(R, {
110
110
  showFullScreenIcon: C && !s,
111
- fullScreen: a,
111
+ fullScreen: l,
112
112
  onClick: () => {
113
- g(!a);
113
+ g(!l);
114
114
  },
115
- tooltipTitle: a ? n.exitFullscreen : n.fullscreen
115
+ tooltipTitle: l ? a.exitFullscreen : a.fullscreen
116
116
  }),
117
117
  /* @__PURE__ */ e(y, {
118
118
  showCloseIcon: u,
119
119
  onClick: p,
120
- tooltipTitle: n.close
120
+ tooltipTitle: a.close
121
121
  })
122
122
  ]
123
123
  })]
124
124
  }), m && /* @__PURE__ */ e("div", {
125
125
  className: r("font-semibold text-delta-800", s ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
126
- children: o
126
+ children: n
127
127
  })]
128
128
  }), /* @__PURE__ */ e("div", {
129
129
  className: r(i && "hidden", "flex flex-grow flex-col overflow-y-auto"),
@@ -1,35 +1,48 @@
1
- import { useState as P } from "react";
2
- import { jsx as r } from "react/jsx-runtime";
3
- import { FloatingPortal as y, autoUpdate as E, flip as F, shift as h, useFloating as w, useMergeRefs as M } from "@floating-ui/react";
4
- var j = ({ open: e = !1, anchorEl: s, id: l, placement: a = "bottom", transition: f, disablePortal: d, className: m, style: c, children: t }) => {
5
- const [o, n] = P(!0);
6
- e && o && n(!1);
7
- const { refs: p, floatingStyles: u, placement: g } = w({
8
- open: e,
9
- placement: a,
10
- whileElementsMounted: E,
11
- elements: { reference: s ?? void 0 },
12
- middleware: [F({ padding: 8 }), h({ padding: 8 })]
13
- }), x = M([p.setFloating]);
14
- if (!(e || f && !o)) return null;
15
- const v = typeof t == "function" ? t({
1
+ import { TOP_LAYER_PROPS as _, TOP_LAYER_RESET_STYLE as v, getOpenModalDialogAncestor as x, useTopLayerRef as y } from "../../hooks/useTopLayer.hook.js";
2
+ import { useState as L } from "react";
3
+ import { jsx as l } from "react/jsx-runtime";
4
+ import { FloatingPortal as S, autoUpdate as b, flip as A, shift as O, useFloating as F, useMergeRefs as Y } from "@floating-ui/react";
5
+ var w = {
6
+ ...v,
7
+ background: "transparent",
8
+ border: 0,
9
+ overflow: "visible",
10
+ padding: 0
11
+ }, k = ({ open: t = !1, anchorEl: r, id: f, placement: d = "bottom", transition: p, disablePortal: m, className: g, style: c, children: o }) => {
12
+ const [n, a] = L(!0);
13
+ t && n && a(!1);
14
+ const e = x(r), { refs: i, floatingStyles: u, placement: R } = F({
15
+ open: t,
16
+ placement: d,
17
+ strategy: e ? "fixed" : "absolute",
18
+ whileElementsMounted: b,
19
+ elements: { reference: r ?? void 0 },
20
+ middleware: [A({ padding: 8 }), O({ padding: 8 })]
21
+ }), E = y(i.setFloating), P = Y([e ? E : i.setFloating]);
22
+ if (!(t || p && !n)) return null;
23
+ const T = typeof o == "function" ? o({
16
24
  TransitionProps: {
17
- in: e,
18
- onExited: () => n(!0)
25
+ in: t,
26
+ onExited: () => a(!0)
19
27
  },
20
- placement: g
21
- }) : t, i = /* @__PURE__ */ r("div", {
22
- ref: x,
23
- id: l,
28
+ placement: R
29
+ }) : o, s = /* @__PURE__ */ l("div", {
30
+ ref: P,
31
+ id: f,
32
+ ...e ? _ : {},
24
33
  style: {
34
+ ...e ? w : {},
25
35
  ...u,
26
36
  ...c
27
37
  },
28
- className: m,
29
- children: v
38
+ className: g,
39
+ children: T
40
+ });
41
+ return m ? s : /* @__PURE__ */ l(S, {
42
+ root: e,
43
+ children: s
30
44
  });
31
- return d ? i : /* @__PURE__ */ r(y, { children: i });
32
45
  };
33
46
  export {
34
- j as Popper
47
+ k as Popper
35
48
  };
@@ -1,6 +1,6 @@
1
1
  import { StyledButton as r } from "../../shared-components/button/StyledButton.js";
2
- import { bindPopper as s } from "../../../hooks/usePopupState.js";
3
- import { Paper as l } from "../../../components/mui-compat/Paper.js";
2
+ import { bindPopper as l } from "../../../hooks/usePopupState.js";
3
+ import { Paper as s } from "../../../components/mui-compat/Paper.js";
4
4
  import { Fade as c } from "../../../components/mui-compat/Fade.js";
5
5
  import { Popper as f } from "../../../components/mui-compat/Popper.js";
6
6
  import h from "./StyledTimePicker.module.js";
@@ -12,16 +12,13 @@ import { jsx as t, jsxs as o } from "react/jsx-runtime";
12
12
  var I = (m) => {
13
13
  const { popupState: e, dataTest: a, value: i, onSelect: n, handleClear: p } = m;
14
14
  return /* @__PURE__ */ t(f, {
15
- ...s(e),
15
+ ...l(e),
16
16
  transition: !0,
17
- style: {
18
- zIndex: "1300",
19
- position: "absolute"
20
- },
17
+ style: { zIndex: "1300" },
21
18
  children: ({ TransitionProps: d }) => /* @__PURE__ */ t(c, {
22
19
  ...d,
23
20
  timeout: 350,
24
- children: /* @__PURE__ */ o(l, {
21
+ children: /* @__PURE__ */ o(s, {
25
22
  elevation: 0,
26
23
  className: y(h["time-picker-surface"]),
27
24
  style: { paddingBottom: "1px" },
@@ -24,6 +24,10 @@ export interface PopperProps {
24
24
  * content against `anchorEl`; with `transition`, renders children as a function receiving
25
25
  * `TransitionProps` (`in`/`onExited`) so a child `Fade` can animate and unmount. Public props
26
26
  * preserved (DEC-003). TASK-403.
27
+ *
28
+ * When `anchorEl` sits inside an open modal `<dialog>` the popper portals into that dialog and joins
29
+ * the top layer instead of the default `document.body` portal — a body portal is both occluded by
30
+ * the dialog and `inert`, so the popper looks dead on click. See `useTopLayer.hook`.
27
31
  */
28
32
  export declare const Popper: ({ open, anchorEl, id, placement, transition, disablePortal, className, style, children, }: PopperProps) => JSX.Element | null;
29
33
  export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "3.61.0",
6
+ "version": "3.61.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",