asma-ui-core 3.103.1 → 3.105.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.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +6 -6
- package/dist/components/data-display/chip/StyledChip.js +48 -47
- package/dist/components/data-display/tooltip/StyledTooltip.js +62 -60
- package/dist/components/feedback/dialog/StyledDialog.js +94 -79
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +51 -51
- package/dist/components/inputs/button/StyledButton.module.js +13 -13
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +91 -82
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +152 -152
- package/dist/components/navigation/menu/StyledMenu.js +17 -16
- package/dist/components/navigation/menu/StyledMenu.module.js +5 -2
- package/dist/components/navigation/menu/StyledMenuList.js +50 -36
- package/dist/components/navigation/tabs/StyledTab.js +28 -19
- package/dist/components/navigation/tabs/StyledTabs.js +33 -33
- package/dist/helpers/focusable.js +3 -2
- package/dist/helpers/warnUnnamedDialog.js +6 -0
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +10 -2
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +5 -3
- package/dist/src/components/navigation/menu/StyledMenuList.d.ts +2 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +11 -1
- package/dist/src/helpers/focusable.d.ts +1 -0
- package/dist/src/helpers/warnUnnamedDialog.d.ts +5 -0
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +60 -47
- package/dist/table/shared-components/button/StyledButton.module.js +11 -11
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { cn as h } from "../../../../helpers/cn.js";
|
|
2
2
|
import { DotsVerticalIcon as g } from "../../../icons/dots-vertical-icon/DotsVerticalIcon.js";
|
|
3
3
|
import { StyledButton as p } from "../../../inputs/button/StyledButton.js";
|
|
4
|
-
import { StyledMenu as
|
|
5
|
-
import { StyledMenuItem as
|
|
4
|
+
import { StyledMenu as v } from "../../../navigation/menu/StyledMenu.js";
|
|
5
|
+
import { StyledMenuItem as x } from "../../../navigation/menu/StyledMenuItem.js";
|
|
6
6
|
import { useState as k } from "react";
|
|
7
7
|
import { Fragment as y, jsx as n, jsxs as s } from "react/jsx-runtime";
|
|
8
8
|
function O(e) {
|
|
@@ -17,9 +17,9 @@ function T({ action: e, showLabel: l, selectionTone: t = !1 }) {
|
|
|
17
17
|
error: e.tone === "danger",
|
|
18
18
|
size: e.size ?? "large",
|
|
19
19
|
type: "button",
|
|
20
|
-
disabled: e.disabled,
|
|
20
|
+
"aria-disabled": e.disabled ? !0 : void 0,
|
|
21
21
|
startIcon: e.icon,
|
|
22
|
-
onClick: e.onClick,
|
|
22
|
+
onClick: e.disabled ? void 0 : e.onClick,
|
|
23
23
|
"aria-label": l && e.ariaLabel == null ? void 0 : o,
|
|
24
24
|
children: l ? e.label : void 0
|
|
25
25
|
});
|
|
@@ -58,7 +58,7 @@ function j({ plan: e, overflowMenuLabel: l, className: t, selectionTone: o = !1,
|
|
|
58
58
|
}), c && /* @__PURE__ */ s(y, { children: [/* @__PURE__ */ n(A, {
|
|
59
59
|
overflowMenuLabel: l,
|
|
60
60
|
onOpen: (r) => a((i) => i ? null : r)
|
|
61
|
-
}), /* @__PURE__ */ n(
|
|
61
|
+
}), /* @__PURE__ */ n(v, {
|
|
62
62
|
anchorEl: u,
|
|
63
63
|
open: !!u,
|
|
64
64
|
onClose: () => a(null),
|
|
@@ -70,7 +70,7 @@ function j({ plan: e, overflowMenuLabel: l, className: t, selectionTone: o = !1,
|
|
|
70
70
|
vertical: "top",
|
|
71
71
|
horizontal: "right"
|
|
72
72
|
},
|
|
73
|
-
children: b.map((r) => /* @__PURE__ */ n(
|
|
73
|
+
children: b.map((r) => /* @__PURE__ */ n(x, {
|
|
74
74
|
disabled: r.disabled,
|
|
75
75
|
onClick: () => {
|
|
76
76
|
a(null), r.onClick();
|
|
@@ -1,59 +1,60 @@
|
|
|
1
1
|
import { cn as i } from "../../../helpers/cn.js";
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { consumerOverrides as
|
|
5
|
-
import { getChipPadding as
|
|
6
|
-
import
|
|
7
|
-
import { forwardRef as
|
|
8
|
-
import { jsx as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
paddingTop:
|
|
12
|
-
paddingRight:
|
|
13
|
-
paddingBottom:
|
|
14
|
-
paddingLeft:
|
|
15
|
-
}, K = (e) => {
|
|
16
|
-
e.stopPropagation(), l?.(e);
|
|
2
|
+
import { resolveSx as L } from "../../../helpers/sx.js";
|
|
3
|
+
import { CloseIcon as U } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { consumerOverrides as b } from "../../../helpers/classOverride.js";
|
|
5
|
+
import { getChipPadding as q } from "./chipPadding.js";
|
|
6
|
+
import A from "./StyledChip.module.js";
|
|
7
|
+
import { forwardRef as F } from "react";
|
|
8
|
+
import { jsx as p, jsxs as G } from "react/jsx-runtime";
|
|
9
|
+
var oo = F(({ dataTest: v, label: l, size: r = "medium", disabled: o, readOnly: t, clickable: x, icon: _, avatar: w, deleteIcon: y, onDelete: h, onClick: n, onMouseDown: S, onMouseUp: k, className: s, classes: a, sx: j, tabIndex: u, deleteButtonTabIndex: D, "aria-label": R, role: f, "aria-checked": B, "aria-readonly": C, "data-hovered": M, "data-focus": N, variant: H, color: J }, I) => {
|
|
10
|
+
const d = !t && !o && (!!x || !!n), m = !t && !!o && (!!x || !!n), g = w ?? _, c = q(r, !!g, !!(h && !t)), K = {
|
|
11
|
+
paddingTop: c.top,
|
|
12
|
+
paddingRight: c.right,
|
|
13
|
+
paddingBottom: c.bottom,
|
|
14
|
+
paddingLeft: c.left
|
|
17
15
|
}, P = (e) => {
|
|
18
|
-
|
|
19
|
-
}, W =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"data-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
e.stopPropagation(), h?.(e);
|
|
17
|
+
}, W = (e) => {
|
|
18
|
+
d && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.(e));
|
|
19
|
+
}, $ = b(s, "width"), E = b(s, "max-width");
|
|
20
|
+
return /* @__PURE__ */ G("div", {
|
|
21
|
+
ref: I,
|
|
22
|
+
"data-testid": v,
|
|
23
|
+
"aria-label": R,
|
|
24
|
+
"data-hovered": M,
|
|
25
|
+
"data-focus": N,
|
|
26
|
+
role: f ?? (d || m ? "button" : void 0),
|
|
27
|
+
"aria-checked": f ? B : void 0,
|
|
28
|
+
"aria-readonly": f ? C : void 0,
|
|
29
|
+
"aria-disabled": m ? !0 : void 0,
|
|
30
|
+
tabIndex: m ? u ?? 0 : t || o ? void 0 : d ? u ?? 0 : u,
|
|
31
|
+
onClick: o || t ? void 0 : n,
|
|
32
|
+
onKeyDown: o || t ? void 0 : W,
|
|
33
|
+
onMouseDown: o || t ? void 0 : S,
|
|
34
|
+
onMouseUp: o || t ? void 0 : k,
|
|
35
|
+
className: i("box-border inline-flex items-center gap-1 rounded-[25px] border border-solid border-delta-300 bg-white text-base text-delta-700", !$ && "w-fit", !E && "max-w-full", r === "small" ? "h-6" : "h-8", t && "pointer-events-none", o && "opacity-[0.38]", o && (m ? "cursor-not-allowed" : "pointer-events-none"), d && i("cursor-pointer outline-none", "asma-touch-ready", "data-[hovered]:border-gama-200 data-[hovered]:bg-gama-25 hover:border-gama-200 hover:bg-gama-25", "active:!border-gama-400 active:bg-gama-25 active:shadow-[0_0_0_2px_var(--colors-gama-400)]"), A["focus-ring"], a?.root, s),
|
|
35
36
|
style: {
|
|
36
|
-
...
|
|
37
|
-
...
|
|
37
|
+
...K,
|
|
38
|
+
...L(j)
|
|
38
39
|
},
|
|
39
40
|
children: [
|
|
40
|
-
|
|
41
|
-
className: i("flex shrink-0 items-center justify-center", r === "small" ? "h-[18px] w-[18px]" : "h-6 w-6",
|
|
42
|
-
children:
|
|
41
|
+
g && /* @__PURE__ */ p("span", {
|
|
42
|
+
className: i("flex shrink-0 items-center justify-center", r === "small" ? "h-[18px] w-[18px]" : "h-6 w-6", w ? a?.avatar : a?.icon),
|
|
43
|
+
children: g
|
|
43
44
|
}),
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ p("span", {
|
|
45
46
|
className: i("min-w-0 truncate", a?.label),
|
|
46
|
-
children:
|
|
47
|
+
children: l
|
|
47
48
|
}),
|
|
48
|
-
|
|
49
|
+
h && !t && /* @__PURE__ */ p("button", {
|
|
49
50
|
type: "button",
|
|
50
|
-
tabIndex:
|
|
51
|
-
"data-testid": `${
|
|
52
|
-
"aria-label": typeof
|
|
53
|
-
onClick:
|
|
54
|
-
disabled:
|
|
51
|
+
tabIndex: D,
|
|
52
|
+
"data-testid": `${v}-delete`,
|
|
53
|
+
"aria-label": typeof l == "string" ? `Remove ${l}` : "Remove",
|
|
54
|
+
onClick: P,
|
|
55
|
+
disabled: o,
|
|
55
56
|
className: i("flex shrink-0 items-center justify-center rounded-full border border-solid border-delta-100 bg-delta-50 p-0 text-delta-700 [outline:none]", r === "small" ? "h-[18px] w-[18px]" : "h-5 w-5", a?.deleteIcon),
|
|
56
|
-
children: y ?? /* @__PURE__ */
|
|
57
|
+
children: y ?? /* @__PURE__ */ p(U, {
|
|
57
58
|
height: r === "small" ? 14 : 16,
|
|
58
59
|
width: r === "small" ? 14 : 16,
|
|
59
60
|
className: "min-w-0 shrink-0"
|
|
@@ -63,5 +64,5 @@ var O = A(({ dataTest: u, label: c, size: r = "medium", disabled: t, readOnly: o
|
|
|
63
64
|
});
|
|
64
65
|
});
|
|
65
66
|
export {
|
|
66
|
-
|
|
67
|
+
oo as StyledChip
|
|
67
68
|
};
|
|
@@ -1,92 +1,94 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { firstTabbable as
|
|
4
|
-
import { TOP_LAYER_PROPS as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { FloatingArrow as
|
|
8
|
-
var
|
|
1
|
+
import { cn as j } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as k } from "../../../helpers/sx.js";
|
|
3
|
+
import { firstFocusable as D, firstTabbable as z } from "../../../helpers/focusable.js";
|
|
4
|
+
import { TOP_LAYER_PROPS as G, TOP_LAYER_RESET_STYLE as W, getOpenModalDialogAncestor as $, shouldUsePopoverTopLayer as q, useTopLayerRef as J } from "../../../hooks/useTopLayer.hook.js";
|
|
5
|
+
import { Fragment as K, cloneElement as Q, useEffect as V, useLayoutEffect as X, useRef as Z, useState as ee } from "react";
|
|
6
|
+
import { Fragment as te, jsx as c, jsxs as E } from "react/jsx-runtime";
|
|
7
|
+
import { FloatingArrow as oe, FloatingPortal as ne, arrow as re, autoUpdate as se, flip as ie, offset as ae, safePolygon as le, shift as ce, useDismiss as fe, useFloating as de, useFocus as pe, useHover as me, useInteractions as ue, useMergeRefs as ge, useRole as be } from "@floating-ui/react";
|
|
8
|
+
var ye = "#363E4A", Re = (e) => {
|
|
9
9
|
const n = document.createRange();
|
|
10
|
-
return n.selectNodeContents(
|
|
11
|
-
},
|
|
12
|
-
const [
|
|
13
|
-
p ||
|
|
14
|
-
}, { refs: o, floatingStyles:
|
|
10
|
+
return n.selectNodeContents(e), n.getBoundingClientRect();
|
|
11
|
+
}, we = (e) => !e.title && e.title !== 0 ? e.children : /* @__PURE__ */ c(xe, { ...e }), xe = ({ title: e, children: n, placement: h = "top", arrow: f = !1, enterDelay: F = 500, leaveDelay: T = 0, open: y, onOpen: A, onClose: P, disableHoverListener: _, disableFocusListener: w, offsetDistance: L, className: O, slotProps: d }) => {
|
|
12
|
+
const [S, C] = ee(!1), p = y !== void 0, s = y ?? S, R = Z(null), B = (t) => {
|
|
13
|
+
p || C(t), t ? A?.() : P?.();
|
|
14
|
+
}, { refs: o, floatingStyles: I, context: r } = de({
|
|
15
15
|
open: s,
|
|
16
|
-
onOpenChange:
|
|
17
|
-
placement:
|
|
16
|
+
onOpenChange: B,
|
|
17
|
+
placement: h,
|
|
18
18
|
strategy: "fixed",
|
|
19
|
-
whileElementsMounted:
|
|
19
|
+
whileElementsMounted: se,
|
|
20
20
|
middleware: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
...f ? [
|
|
21
|
+
ae(L ?? (f ? 8 : 6)),
|
|
22
|
+
ie({ padding: 8 }),
|
|
23
|
+
ce({ padding: 8 }),
|
|
24
|
+
...f ? [re({ element: R })] : []
|
|
25
25
|
]
|
|
26
|
-
}), { getReferenceProps: M, getFloatingProps:
|
|
27
|
-
|
|
28
|
-
enabled: !p && !
|
|
26
|
+
}), { getReferenceProps: M, getFloatingProps: H } = ue([
|
|
27
|
+
me(r, {
|
|
28
|
+
enabled: !p && !_,
|
|
29
29
|
delay: {
|
|
30
|
-
open:
|
|
31
|
-
close:
|
|
30
|
+
open: F,
|
|
31
|
+
close: T
|
|
32
32
|
},
|
|
33
33
|
move: !1,
|
|
34
|
-
handleClose:
|
|
34
|
+
handleClose: le()
|
|
35
35
|
}),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]),
|
|
40
|
-
|
|
41
|
-
const
|
|
42
|
-
if (!s || !
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
l
|
|
46
|
-
|
|
36
|
+
pe(r, { enabled: !p && !w }),
|
|
37
|
+
fe(r),
|
|
38
|
+
be(r, { role: "tooltip" })
|
|
39
|
+
]), x = s ? $(o.domReference.current) : void 0, m = q(x), N = J(o.setFloating, m), { floatingId: a } = r;
|
|
40
|
+
V(() => {
|
|
41
|
+
const t = o.domReference.current;
|
|
42
|
+
if (!s || !a || !(t instanceof HTMLElement)) return;
|
|
43
|
+
const l = z(t) ?? D(t) ?? t, i = l.getAttribute("aria-describedby"), v = typeof e == "string" || typeof e == "number" ? String(e).trim() : "", Y = (b) => document.getElementById(b)?.textContent?.trim();
|
|
44
|
+
if (!(v && i?.split(/\s+/).some((b) => Y(b) === v)))
|
|
45
|
+
return l.setAttribute("aria-describedby", i ? `${i} ${a}` : a), () => {
|
|
46
|
+
i === null ? l.removeAttribute("aria-describedby") : l.setAttribute("aria-describedby", i);
|
|
47
|
+
};
|
|
47
48
|
}, [
|
|
48
49
|
s,
|
|
49
50
|
o.domReference,
|
|
50
|
-
|
|
51
|
+
a,
|
|
52
|
+
e
|
|
51
53
|
]);
|
|
52
|
-
const
|
|
54
|
+
const u = n.type === K, g = u ? /* @__PURE__ */ c("span", {
|
|
53
55
|
style: { display: "contents" },
|
|
54
56
|
children: n
|
|
55
57
|
}) : n;
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
!
|
|
59
|
-
contextElement:
|
|
60
|
-
getBoundingClientRect: () =>
|
|
58
|
+
X(() => {
|
|
59
|
+
const t = o.domReference.current;
|
|
60
|
+
!u || !t || o.setPositionReference({
|
|
61
|
+
contextElement: t,
|
|
62
|
+
getBoundingClientRect: () => Re(t)
|
|
61
63
|
});
|
|
62
|
-
}, [
|
|
63
|
-
const { ["aria-describedby"]:
|
|
64
|
-
ref:
|
|
64
|
+
}, [u, o]);
|
|
65
|
+
const { ["aria-describedby"]: ve, ...U } = M({
|
|
66
|
+
ref: ge([o.setReference, g.ref]),
|
|
65
67
|
...g.props
|
|
66
68
|
});
|
|
67
|
-
return /* @__PURE__ */
|
|
68
|
-
root:
|
|
69
|
-
children: /* @__PURE__ */
|
|
70
|
-
ref:
|
|
71
|
-
...
|
|
72
|
-
...
|
|
69
|
+
return /* @__PURE__ */ E(te, { children: [Q(g, U), s && /* @__PURE__ */ c(ne, {
|
|
70
|
+
root: x,
|
|
71
|
+
children: /* @__PURE__ */ E("div", {
|
|
72
|
+
ref: N,
|
|
73
|
+
...m ? G : {},
|
|
74
|
+
...H(),
|
|
73
75
|
style: {
|
|
74
|
-
...
|
|
75
|
-
...
|
|
76
|
+
...m ? W : {},
|
|
77
|
+
...I,
|
|
76
78
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
77
79
|
overflow: "visible",
|
|
78
80
|
...d?.tooltip?.style,
|
|
79
|
-
...
|
|
81
|
+
...k(d?.tooltip?.sx)
|
|
80
82
|
},
|
|
81
|
-
className:
|
|
82
|
-
children: [
|
|
83
|
+
className: j("z-[1500] block max-w-[320px] whitespace-normal break-words rounded-[3px] bg-[#363E4A] px-2 py-1 text-sm leading-5 text-white shadow-[0px_1px_6px_0px_rgba(0,0,0,0.15)]", O, d?.tooltip?.className),
|
|
84
|
+
children: [e, f && /* @__PURE__ */ c(oe, {
|
|
83
85
|
ref: R,
|
|
84
86
|
context: r,
|
|
85
|
-
fill:
|
|
87
|
+
fill: ye
|
|
86
88
|
})]
|
|
87
89
|
})
|
|
88
90
|
})] });
|
|
89
91
|
};
|
|
90
92
|
export {
|
|
91
|
-
|
|
93
|
+
we as StyledTooltip
|
|
92
94
|
};
|
|
@@ -1,143 +1,158 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { registerOpenModalDialog as
|
|
5
|
-
import { StyledButton as
|
|
6
|
-
import { useMobileMediaQuery as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { cn as g } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as W } from "../../../helpers/sx.js";
|
|
3
|
+
import { CloseIcon as le } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { registerOpenModalDialog as re } from "../../../hooks/useTopLayer.hook.js";
|
|
5
|
+
import { StyledButton as ie } from "../../inputs/button/StyledButton.js";
|
|
6
|
+
import { useMobileMediaQuery as de } from "../../../hooks/useMediaQuery.hook.js";
|
|
7
|
+
import { warnUnnamedDialog as ae } from "../../../helpers/warnUnnamedDialog.js";
|
|
8
|
+
import ce from "./StyledDialog.module.js";
|
|
9
|
+
import { StyledDialogTitleContext as se } from "./dialogTitleContext.js";
|
|
10
|
+
import { useEffect as k, useId as E, useLayoutEffect as B, useMemo as me, useRef as r, useState as q } from "react";
|
|
11
|
+
import { jsx as l, jsxs as i } from "react/jsx-runtime";
|
|
12
|
+
var ue = {
|
|
12
13
|
xs: 444,
|
|
13
14
|
sm: 600,
|
|
14
15
|
md: 900,
|
|
15
16
|
lg: 1200,
|
|
16
17
|
xl: 1536
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
titleId:
|
|
20
|
-
setTitleId:
|
|
21
|
-
}), [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
18
|
+
}, Ie = ({ open: t, onClose: p, children: I, dataTest: d, maxWidth: S = "sm", fullWidth: z, fullScreen: P, scroll: A = "paper", disableEscapeKeyDown: F, className: K, style: L, sx: U, classes: C, PaperProps: X, slotProps: a, onCloseText: N, showCloseIcon: D = !0, dialogLabel: c, dialogTitle: s, dialogHeaderNode: G, ariaLabel: w }) => {
|
|
19
|
+
const m = E(), H = E(), [Q, $] = q(), J = me(() => ({
|
|
20
|
+
titleId: m,
|
|
21
|
+
setTitleId: $
|
|
22
|
+
}), [m]), u = s ? m : Q ?? (c ? H : void 0), T = de(), f = r(null), y = r(null), v = r(!1), M = r(t), x = P ?? T, _ = E(), [h, V] = q(), R = r(!1);
|
|
23
|
+
B(() => {
|
|
24
|
+
const e = f.current, n = !!u || !!w, o = e && t && !n ? e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]') : null;
|
|
25
|
+
o && !o.id && (o.id = _);
|
|
26
|
+
const O = o?.id;
|
|
27
|
+
O !== h && V(O), e && t && !n && !o && !R.current && (R.current = !0, ae(d));
|
|
28
|
+
}, [
|
|
29
|
+
t,
|
|
30
|
+
u,
|
|
31
|
+
w,
|
|
32
|
+
I,
|
|
33
|
+
h,
|
|
34
|
+
_,
|
|
35
|
+
d
|
|
36
|
+
]), k(() => {
|
|
37
|
+
M.current && !t && a?.transition?.onExited?.(), M.current = t;
|
|
38
|
+
}, [t, a]), B(() => {
|
|
39
|
+
const e = f.current;
|
|
26
40
|
if (!e || !t) return;
|
|
27
|
-
e.open || (
|
|
28
|
-
const
|
|
41
|
+
e.open || (y.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.showModal(), e.focus({ preventScroll: !0 }), requestAnimationFrame(() => e.open && e.focus({ preventScroll: !0 })));
|
|
42
|
+
const n = re(e);
|
|
29
43
|
return () => {
|
|
30
|
-
|
|
44
|
+
n(), y.current?.isConnected && y.current.focus({ preventScroll: !0 });
|
|
31
45
|
};
|
|
32
|
-
}, [t]),
|
|
46
|
+
}, [t]), k(() => {
|
|
33
47
|
if (!t) return;
|
|
34
|
-
const e = document.body.style.overflow,
|
|
48
|
+
const e = document.body.style.overflow, n = document.documentElement.style.overflow;
|
|
35
49
|
return document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", () => {
|
|
36
|
-
document.body.style.overflow = e, document.documentElement.style.overflow =
|
|
50
|
+
document.body.style.overflow = e, document.documentElement.style.overflow = n;
|
|
37
51
|
};
|
|
38
52
|
}, [t]);
|
|
39
|
-
const
|
|
40
|
-
...
|
|
41
|
-
...
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, 0),
|
|
46
|
-
},
|
|
53
|
+
const b = {
|
|
54
|
+
...X,
|
|
55
|
+
...a?.paper
|
|
56
|
+
}, j = S === !1 ? void 0 : ue[S], { className: Y, style: Z, onClick: ee, ...te } = a?.backdrop ?? {}, ne = (e) => {
|
|
57
|
+
v.current || (v.current = !0, window.setTimeout(() => {
|
|
58
|
+
v.current = !1;
|
|
59
|
+
}, 0), p?.(e, "escapeKeyDown"));
|
|
60
|
+
}, oe = (e) => {
|
|
47
61
|
e.preventDefault();
|
|
48
62
|
};
|
|
49
|
-
return
|
|
50
|
-
if (!t ||
|
|
51
|
-
const e = (
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
63
|
+
return k(() => {
|
|
64
|
+
if (!t || F) return;
|
|
65
|
+
const e = (n) => {
|
|
66
|
+
if (n.key !== "Escape" || n.defaultPrevented) return;
|
|
67
|
+
const o = document.activeElement;
|
|
68
|
+
o instanceof Element && o.closest("dialog[open]") !== f.current || ne(n);
|
|
55
69
|
};
|
|
56
70
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
57
|
-
}), t ? /* @__PURE__ */
|
|
58
|
-
ref:
|
|
71
|
+
}), t ? /* @__PURE__ */ i("dialog", {
|
|
72
|
+
ref: f,
|
|
59
73
|
tabIndex: -1,
|
|
60
|
-
"data-testid":
|
|
61
|
-
"aria-labelledby":
|
|
62
|
-
"aria-label":
|
|
63
|
-
onCancel:
|
|
64
|
-
className:
|
|
74
|
+
"data-testid": d,
|
|
75
|
+
"aria-labelledby": u ?? h,
|
|
76
|
+
"aria-label": u || h ? void 0 : w,
|
|
77
|
+
onCancel: oe,
|
|
78
|
+
className: g(ce.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", A === "body" && "overflow-y-auto", K, C?.root),
|
|
65
79
|
style: {
|
|
66
80
|
zIndex: 999,
|
|
67
|
-
...
|
|
68
|
-
...
|
|
81
|
+
...W(U),
|
|
82
|
+
...L
|
|
69
83
|
},
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
-
...
|
|
72
|
-
className:
|
|
73
|
-
style:
|
|
84
|
+
children: [/* @__PURE__ */ l("div", {
|
|
85
|
+
...te,
|
|
86
|
+
className: g("absolute inset-0 bg-[#626e7eb2]", Y),
|
|
87
|
+
style: Z,
|
|
74
88
|
onClick: (e) => {
|
|
75
|
-
|
|
89
|
+
ee?.(e), e.defaultPrevented || p?.(e, "backdropClick");
|
|
76
90
|
}
|
|
77
|
-
}), /* @__PURE__ */
|
|
78
|
-
className:
|
|
91
|
+
}), /* @__PURE__ */ i("div", {
|
|
92
|
+
className: g("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]", x && "rounded-none", b.className, C?.paper),
|
|
79
93
|
style: {
|
|
80
94
|
minWidth: 0,
|
|
81
95
|
minHeight: 0,
|
|
82
|
-
...!
|
|
83
|
-
...
|
|
96
|
+
...!x && j ? { maxWidth: j } : {},
|
|
97
|
+
...x ? {
|
|
84
98
|
width: "100%",
|
|
85
99
|
maxWidth: "100%",
|
|
86
100
|
height: "100%",
|
|
87
101
|
maxHeight: "100%"
|
|
88
102
|
} : {
|
|
89
|
-
width:
|
|
103
|
+
width: z ? "calc(100% - 64px)" : "auto",
|
|
90
104
|
maxHeight: "100%"
|
|
91
105
|
},
|
|
92
|
-
...
|
|
93
|
-
...
|
|
94
|
-
...
|
|
106
|
+
...W(b.sx),
|
|
107
|
+
...b.style,
|
|
108
|
+
...x ? {
|
|
95
109
|
width: "100%",
|
|
96
110
|
maxWidth: "100%",
|
|
97
111
|
height: "100%",
|
|
98
112
|
maxHeight: "100%"
|
|
99
113
|
} : { maxHeight: "calc(100% - 64px)" }
|
|
100
114
|
},
|
|
101
|
-
children: [(!!
|
|
115
|
+
children: [(!!c || !!s || D) && /* @__PURE__ */ i("div", {
|
|
102
116
|
className: "box-border flex w-full min-w-0 max-w-full justify-between px-4 pt-4",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
117
|
+
children: [/* @__PURE__ */ i("div", {
|
|
104
118
|
className: "flex min-w-0 flex-1 flex-col justify-start gap-0.5",
|
|
105
|
-
children: [
|
|
119
|
+
children: [c && /* @__PURE__ */ l("div", {
|
|
120
|
+
id: H,
|
|
106
121
|
className: "flex h-8 items-center text-sm font-normal leading-5 text-delta-600",
|
|
107
|
-
children:
|
|
108
|
-
}),
|
|
109
|
-
id:
|
|
122
|
+
children: c
|
|
123
|
+
}), s && /* @__PURE__ */ l("div", {
|
|
124
|
+
id: m,
|
|
110
125
|
className: "flex text-2xl font-semibold leading-8 text-delta-800",
|
|
111
|
-
children:
|
|
126
|
+
children: s
|
|
112
127
|
})]
|
|
113
|
-
}),
|
|
128
|
+
}), D && /* @__PURE__ */ i("div", {
|
|
114
129
|
className: "flex min-w-0 max-w-full shrink-0 justify-end gap-2",
|
|
115
|
-
children: [
|
|
116
|
-
dataTest: `close-button-${
|
|
117
|
-
"aria-label":
|
|
130
|
+
children: [G, /* @__PURE__ */ l(ie, {
|
|
131
|
+
dataTest: `close-button-${d}`,
|
|
132
|
+
"aria-label": N ? void 0 : "Close",
|
|
118
133
|
variant: "textGray",
|
|
119
134
|
size: "small",
|
|
120
|
-
endIcon: /* @__PURE__ */
|
|
135
|
+
endIcon: /* @__PURE__ */ l(le, {
|
|
121
136
|
width: 20,
|
|
122
137
|
height: 20
|
|
123
138
|
}),
|
|
124
139
|
className: "max-w-full shrink-0 whitespace-nowrap",
|
|
125
|
-
onClick: (e) =>
|
|
140
|
+
onClick: (e) => p?.(e, "escapeKeyDown"),
|
|
126
141
|
style: {
|
|
127
142
|
color: "var(--colors-delta-800)",
|
|
128
143
|
paddingRight: "6px",
|
|
129
144
|
paddingLeft: "6px"
|
|
130
145
|
},
|
|
131
|
-
children:
|
|
146
|
+
children: N
|
|
132
147
|
})]
|
|
133
148
|
})]
|
|
134
|
-
}), /* @__PURE__ */
|
|
135
|
-
value:
|
|
149
|
+
}), /* @__PURE__ */ l(se.Provider, {
|
|
150
|
+
value: J,
|
|
136
151
|
children: I
|
|
137
152
|
})]
|
|
138
153
|
})]
|
|
139
154
|
}) : null;
|
|
140
155
|
};
|
|
141
156
|
export {
|
|
142
|
-
|
|
157
|
+
Ie as StyledDialog
|
|
143
158
|
};
|