asma-ui-core 3.61.1 → 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.
@@ -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.1",
6
+ "version": "3.61.2",
7
7
  "type": "module",
8
8
  "sideEffects": [
9
9
  "**/*.css",