asma-ui-core 3.105.0 → 3.106.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/DynamicToolbar.js +99 -97
- package/dist/components/custom/module/header-layout/ToolbarActionGroup.js +60 -41
- package/dist/components/custom/module/header-layout/ToolbarRows.js +51 -47
- package/dist/components/custom/module/header-layout/useTranslations.js +12 -10
- package/dist/components/custom/page/page-header/PageHeader.js +41 -40
- package/dist/components/custom/widget/widget/StyledWidget.js +21 -20
- package/dist/components/data-display/chip/StyledChip.js +70 -53
- package/dist/components/data-display/tooltip/StyledTooltip.js +116 -73
- package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
- package/dist/components/feedback/dialog/StyledDialog.js +81 -72
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +76 -71
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +133 -137
- package/dist/components/feedback/minimizable-dialog/components/CloseBtn.js +11 -8
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +6 -6
- package/dist/components/feedback/minimizable-dialog/components/MinimizeBtn.js +1 -1
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +94 -85
- package/dist/components/feedback/minimizable-dialog/v2/useTranslations.js +6 -4
- package/dist/components/inputs/button/StyledButton.js +83 -33
- package/dist/components/inputs/button/StyledButton.module.js +13 -13
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +6 -6
- package/dist/components/inputs/select/StyledSelect.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +14 -14
- package/dist/components/navigation/link/StyledLink.js +53 -26
- package/dist/components/navigation/link/StyledLink.module.js +6 -6
- package/dist/components/navigation/menu/StyledMenuItem.js +35 -30
- package/dist/components/navigation/tabs/StyledTab.js +23 -25
- package/dist/components/utils/bottom-sheet/StyledBottomSheet.js +6 -6
- package/dist/components/utils/copy-wrapper/CopyButton.js +4 -4
- package/dist/components/utils/copy-wrapper/CopyWrapper.js +4 -4
- package/dist/datetime/shared-components/button/StyledButton.module.js +11 -11
- package/dist/helpers/focusable.js +2 -2
- package/dist/index.js +589 -585
- package/dist/src/components/custom/module/header-layout/ToolbarActionGroup.d.ts +13 -2
- package/dist/src/components/custom/module/header-layout/ToolbarRows.d.ts +2 -1
- package/dist/src/components/custom/module/header-layout/planToolbarActions.d.ts +18 -1
- package/dist/src/components/custom/module/header-layout/useTranslations.d.ts +2 -0
- package/dist/src/components/custom/widget/widget/StyledWidget.d.ts +5 -0
- package/dist/src/components/data-display/chip/StyledChip.d.ts +6 -0
- package/dist/src/components/data-display/interactive-chip/StyledInteractiveChip.d.ts +7 -1
- package/dist/src/components/data-display/tooltip/StyledTooltip.d.ts +16 -2
- package/dist/src/components/feedback/dialog/DialogBusy.test.d.ts +1 -0
- package/dist/src/components/feedback/dialog/DialogBusyContext.d.ts +28 -0
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +5 -0
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +9 -8
- package/dist/src/components/feedback/dialog/index.d.ts +1 -0
- package/dist/src/components/feedback/minimizable-dialog/components/CloseBtn.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/types.d.ts +11 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +2 -0
- package/dist/src/components/feedback/minimizable-dialog/v2/useTranslations.d.ts +2 -0
- package/dist/src/components/inputs/button/StyledButton.d.ts +25 -1
- package/dist/src/components/inputs/button/StyledButtonBusy.test.d.ts +1 -0
- package/dist/src/components/navigation/link/StyledLink.d.ts +6 -0
- package/dist/src/components/navigation/menu/StyledMenuItem.d.ts +8 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +6 -0
- package/dist/src/forms/submitChanged.d.ts +3 -0
- package/dist/src/helpers/focusable.d.ts +8 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +63 -69
- package/dist/table/shared-components/StyledMenuItem.js +28 -16
- package/package.json +1 -1
|
@@ -1,94 +1,137 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import { firstFocusable 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 ee } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as te } from "../../../helpers/sx.js";
|
|
3
|
+
import { firstFocusable as oe, firstTabbable as ne } from "../../../helpers/focusable.js";
|
|
4
|
+
import { TOP_LAYER_PROPS as re, TOP_LAYER_RESET_STYLE as se, getOpenModalDialogAncestor as ie, shouldUsePopoverTopLayer as ce, useTopLayerRef as le } from "../../../hooks/useTopLayer.hook.js";
|
|
5
|
+
import { Fragment as ae, cloneElement as fe, useCallback as ue, useEffect as U, useId as pe, useLayoutEffect as L, useMemo as de, useRef as H, useState as me } from "react";
|
|
6
|
+
import { Fragment as k, jsx as b, jsxs as _ } from "react/jsx-runtime";
|
|
7
|
+
import { FloatingArrow as ge, FloatingPortal as be, arrow as Re, autoUpdate as ye, flip as ve, offset as Ee, safePolygon as he, shift as Pe, useDismiss as xe, useFloating as Te, useFocus as we, useHover as Fe, useInteractions as Oe, useMergeRefs as Ae, useRole as Le } from "@floating-ui/react";
|
|
8
|
+
var _e = "#363E4A", De = (t) => {
|
|
9
9
|
const n = document.createRange();
|
|
10
|
-
return n.selectNodeContents(
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
return n.selectNodeContents(t), n.getBoundingClientRect();
|
|
11
|
+
}, Me = [
|
|
12
|
+
"onFocus",
|
|
13
|
+
"onBlur",
|
|
14
|
+
"onMouseEnter",
|
|
15
|
+
"onMouseLeave",
|
|
16
|
+
"onMouseMove",
|
|
17
|
+
"onPointerDown",
|
|
18
|
+
"onPointerEnter",
|
|
19
|
+
"onPointerUp",
|
|
20
|
+
"onKeyDown"
|
|
21
|
+
], ke = ({ children: t, ...n }) => {
|
|
22
|
+
const s = H({ element: null }), E = ue((i) => {
|
|
23
|
+
s.current.element = i, s.current.setReference?.(i);
|
|
24
|
+
}, []), c = t.type === ae, l = c ? /* @__PURE__ */ b("span", {
|
|
25
|
+
style: { display: "contents" },
|
|
26
|
+
children: t
|
|
27
|
+
}) : t, a = l.props, R = Ae([E, Object.getOwnPropertyDescriptor(a, "ref")?.value ?? Object.getOwnPropertyDescriptor(l, "ref")?.value]), h = de(() => Object.fromEntries(Me.map((i) => [i, (P) => {
|
|
28
|
+
const d = (s.current.getReferenceProps?.(a) ?? a)[i];
|
|
29
|
+
d?.(P);
|
|
30
|
+
}])), [a]), y = !!n.title || n.title === 0;
|
|
31
|
+
return /* @__PURE__ */ _(k, { children: [y ? fe(l, {
|
|
32
|
+
...h,
|
|
33
|
+
ref: R
|
|
34
|
+
}) : l, y && /* @__PURE__ */ b(Se, {
|
|
35
|
+
...n,
|
|
36
|
+
referenceRef: s,
|
|
37
|
+
isFragment: c
|
|
38
|
+
})] });
|
|
39
|
+
}, Se = ({ title: t, referenceRef: n, isFragment: s, placement: E = "top", arrow: c = !1, enterDelay: l = 500, leaveDelay: a = 0, open: R, onOpen: h, onClose: y, disableHoverListener: i, disableFocusListener: P, openOnTap: d, persistentDescription: Y, persistentDescriptionId: z, offsetDistance: G, className: K, slotProps: x }) => {
|
|
40
|
+
const [V, W] = me(!1), T = R !== void 0, D = !!t || t === 0, m = D && (R ?? V), w = D && Y, M = H(null), S = (e) => {
|
|
41
|
+
T || W(e), e ? h?.() : y?.();
|
|
42
|
+
}, { refs: o, floatingStyles: $, context: f } = Te({
|
|
43
|
+
open: m,
|
|
44
|
+
onOpenChange: S,
|
|
45
|
+
placement: E,
|
|
18
46
|
strategy: "fixed",
|
|
19
|
-
whileElementsMounted:
|
|
47
|
+
whileElementsMounted: ye,
|
|
20
48
|
middleware: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
...
|
|
49
|
+
Ee(G ?? (c ? 8 : 6)),
|
|
50
|
+
ve({ padding: 8 }),
|
|
51
|
+
Pe({ padding: 8 }),
|
|
52
|
+
...c ? [Re({ element: M })] : []
|
|
25
53
|
]
|
|
26
|
-
}), { getReferenceProps:
|
|
27
|
-
|
|
28
|
-
enabled: !
|
|
54
|
+
}), { getReferenceProps: C, getFloatingProps: q } = Oe([
|
|
55
|
+
Fe(f, {
|
|
56
|
+
enabled: !T && !i,
|
|
29
57
|
delay: {
|
|
30
|
-
open:
|
|
31
|
-
close:
|
|
58
|
+
open: l,
|
|
59
|
+
close: a
|
|
32
60
|
},
|
|
33
61
|
move: !1,
|
|
34
|
-
|
|
62
|
+
mouseOnly: !!d,
|
|
63
|
+
handleClose: he()
|
|
35
64
|
}),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
65
|
+
we(f, { enabled: !T && !P }),
|
|
66
|
+
xe(f, { ancestorScroll: !!d }),
|
|
67
|
+
Le(f, { role: "tooltip" }),
|
|
68
|
+
{ reference: { onPointerUp: (e) => {
|
|
69
|
+
!d || e.pointerType !== "touch" || S(!m);
|
|
70
|
+
} } }
|
|
71
|
+
]);
|
|
72
|
+
L(() => {
|
|
73
|
+
const e = n.current;
|
|
74
|
+
return e.setReference = o.setReference, o.setReference(e.element), () => {
|
|
75
|
+
e.setReference = void 0, e.getReferenceProps = void 0, o.setReference(null);
|
|
76
|
+
};
|
|
77
|
+
}, [n, o]), L(() => {
|
|
78
|
+
n.current.getReferenceProps = C;
|
|
79
|
+
}, [n, C]);
|
|
80
|
+
const B = m ? ie(o.domReference.current) : void 0, F = ce(B), J = le(o.setFloating, F), { floatingId: Q } = f, X = pe(), j = z ?? X, u = w ? j : Q, O = !!w || m, I = (e) => ne(e) ?? oe(e) ?? e, A = typeof t == "string" || typeof t == "number" ? String(t).trim() : "", N = (e, r) => {
|
|
81
|
+
const p = e.getAttribute("aria-describedby"), g = p?.split(/\s+/) ?? [];
|
|
82
|
+
if (g.includes(r)) return;
|
|
83
|
+
const Z = (v) => document.getElementById(v)?.textContent?.trim();
|
|
84
|
+
A && g.some((v) => v !== r && Z(v) === A) || e.setAttribute("aria-describedby", p ? `${p} ${r}` : r);
|
|
85
|
+
};
|
|
86
|
+
return U(() => {
|
|
87
|
+
const e = o.domReference.current;
|
|
88
|
+
if (!O || !u || !(e instanceof HTMLElement)) return;
|
|
89
|
+
const r = I(e);
|
|
90
|
+
return N(r, u), () => {
|
|
91
|
+
const p = r.getAttribute("aria-describedby")?.split(/\s+/).filter((g) => g && g !== u).join(" ");
|
|
92
|
+
p ? r.setAttribute("aria-describedby", p) : r.removeAttribute("aria-describedby");
|
|
93
|
+
};
|
|
48
94
|
}, [
|
|
49
|
-
|
|
95
|
+
O,
|
|
50
96
|
o.domReference,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
])
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
contextElement: t,
|
|
62
|
-
getBoundingClientRect: () => Re(t)
|
|
97
|
+
u,
|
|
98
|
+
A
|
|
99
|
+
]), U(() => {
|
|
100
|
+
const e = o.domReference.current;
|
|
101
|
+
!O || !u || !(e instanceof HTMLElement) || N(I(e), u);
|
|
102
|
+
}), L(() => {
|
|
103
|
+
const e = o.domReference.current;
|
|
104
|
+
!s || !e || o.setPositionReference({
|
|
105
|
+
contextElement: e,
|
|
106
|
+
getBoundingClientRect: () => De(e)
|
|
63
107
|
});
|
|
64
|
-
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
...
|
|
74
|
-
...H(),
|
|
108
|
+
}, [s, o]), /* @__PURE__ */ _(k, { children: [w && /* @__PURE__ */ b("span", {
|
|
109
|
+
id: j,
|
|
110
|
+
hidden: !0,
|
|
111
|
+
children: t
|
|
112
|
+
}), m && /* @__PURE__ */ b(be, {
|
|
113
|
+
root: B,
|
|
114
|
+
children: /* @__PURE__ */ _("div", {
|
|
115
|
+
ref: J,
|
|
116
|
+
...F ? re : {},
|
|
117
|
+
...q(),
|
|
75
118
|
style: {
|
|
76
|
-
...
|
|
77
|
-
|
|
119
|
+
...F ? se : {},
|
|
120
|
+
...$,
|
|
78
121
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
79
122
|
overflow: "visible",
|
|
80
|
-
...
|
|
81
|
-
...
|
|
123
|
+
...x?.tooltip?.style,
|
|
124
|
+
...te(x?.tooltip?.sx)
|
|
82
125
|
},
|
|
83
|
-
className:
|
|
84
|
-
children: [
|
|
85
|
-
ref:
|
|
86
|
-
context:
|
|
87
|
-
fill:
|
|
126
|
+
className: ee("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)]", K, x?.tooltip?.className),
|
|
127
|
+
children: [t, c && /* @__PURE__ */ b(ge, {
|
|
128
|
+
ref: M,
|
|
129
|
+
context: f,
|
|
130
|
+
fill: _e
|
|
88
131
|
})]
|
|
89
132
|
})
|
|
90
133
|
})] });
|
|
91
134
|
};
|
|
92
135
|
export {
|
|
93
|
-
|
|
136
|
+
ke as StyledTooltip
|
|
94
137
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createContext as a, useCallback as i, useContext as l, useEffect as c, useMemo as g, useState as B } from "react";
|
|
2
|
+
var y = {
|
|
3
|
+
en: "Wait until saved",
|
|
4
|
+
no: "Vent til lagringen er ferdig"
|
|
5
|
+
}, f = a(null), x = (e, t = "en") => {
|
|
6
|
+
const [o, u] = B(0), s = i(() => (u((n) => n + 1), () => u((n) => n - 1)), []), r = o > 0;
|
|
7
|
+
return {
|
|
8
|
+
busy: r,
|
|
9
|
+
busyReason: e ?? y[t],
|
|
10
|
+
contextValue: g(() => ({
|
|
11
|
+
registerBusy: s,
|
|
12
|
+
busy: r,
|
|
13
|
+
busyReason: e
|
|
14
|
+
}), [
|
|
15
|
+
s,
|
|
16
|
+
r,
|
|
17
|
+
e
|
|
18
|
+
])
|
|
19
|
+
};
|
|
20
|
+
}, C = (e) => {
|
|
21
|
+
const t = l(f)?.registerBusy;
|
|
22
|
+
c(() => {
|
|
23
|
+
if (!(!e || !t))
|
|
24
|
+
return t();
|
|
25
|
+
}, [e, t]);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
f as DialogBusyContext,
|
|
29
|
+
y as WAIT_UNTIL_SAVED,
|
|
30
|
+
x as useDialogBusyBoundary,
|
|
31
|
+
C as useReportDialogBusy
|
|
32
|
+
};
|
|
@@ -1,95 +1,99 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as k } from "../../../helpers/cn.js";
|
|
2
2
|
import { resolveSx as W } from "../../../helpers/sx.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
3
|
+
import { registerOpenModalDialog as se } from "../../../hooks/useTopLayer.hook.js";
|
|
4
|
+
import { CloseIcon as ce } from "../../icons/close-icon/CloseIcon.js";
|
|
5
|
+
import { DialogBusyContext as ue, useDialogBusyBoundary as me } from "./DialogBusyContext.js";
|
|
6
|
+
import { StyledButton as fe } from "../../inputs/button/StyledButton.js";
|
|
7
|
+
import { useMobileMediaQuery as xe } from "../../../hooks/useMediaQuery.hook.js";
|
|
8
|
+
import { warnUnnamedDialog as pe } from "../../../helpers/warnUnnamedDialog.js";
|
|
9
|
+
import he from "./StyledDialog.module.js";
|
|
10
|
+
import { StyledDialogTitleContext as ye } from "./dialogTitleContext.js";
|
|
11
|
+
import { useEffect as E, useId as D, useLayoutEffect as P, useMemo as we, useRef as i, useState as q } from "react";
|
|
12
|
+
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
13
|
+
var ve = {
|
|
13
14
|
xs: 444,
|
|
14
15
|
sm: 600,
|
|
15
16
|
md: 900,
|
|
16
17
|
lg: 1200,
|
|
17
18
|
xl: 1536
|
|
18
|
-
},
|
|
19
|
-
const m =
|
|
19
|
+
}, _e = ({ open: t, onClose: y, children: C, dataTest: a, maxWidth: I = "sm", fullWidth: z, fullScreen: K, scroll: A = "paper", disableEscapeKeyDown: F, className: L, style: U, sx: X, classes: S, PaperProps: G, slotProps: s, busyReason: Q, locale: T = "en", onCloseText: N, showCloseIcon: H = !0, dialogLabel: c, dialogTitle: u, dialogHeaderNode: V, ariaLabel: w }) => {
|
|
20
|
+
const m = D(), R = D(), [$, J] = q(), Y = we(() => ({
|
|
20
21
|
titleId: m,
|
|
21
|
-
setTitleId:
|
|
22
|
-
}), [m]),
|
|
23
|
-
|
|
24
|
-
const e =
|
|
22
|
+
setTitleId: J
|
|
23
|
+
}), [m]), f = u ? m : $ ?? (c ? R : void 0), Z = xe(), l = i(null), v = i(null), b = i(!1), M = i(t), x = K ?? Z, { busy: p, busyReason: ee, contextValue: te } = me(Q, T), _ = D(), [h, ne] = q(), B = i(!1);
|
|
24
|
+
P(() => {
|
|
25
|
+
const e = l.current, n = !!f || !!w, o = e && t && !n ? e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]') : null;
|
|
25
26
|
o && !o.id && (o.id = _);
|
|
26
27
|
const O = o?.id;
|
|
27
|
-
O !== h &&
|
|
28
|
+
O !== h && ne(O), e && t && !n && !o && !B.current && (B.current = !0, pe(a));
|
|
28
29
|
}, [
|
|
29
30
|
t,
|
|
30
|
-
|
|
31
|
+
f,
|
|
31
32
|
w,
|
|
32
|
-
|
|
33
|
+
C,
|
|
33
34
|
h,
|
|
34
35
|
_,
|
|
35
|
-
|
|
36
|
-
]),
|
|
37
|
-
M.current && !t &&
|
|
38
|
-
}, [t,
|
|
39
|
-
const e =
|
|
36
|
+
a
|
|
37
|
+
]), E(() => {
|
|
38
|
+
M.current && !t && s?.transition?.onExited?.(), M.current = t;
|
|
39
|
+
}, [t, s]), P(() => {
|
|
40
|
+
const e = l.current;
|
|
40
41
|
if (!e || !t) return;
|
|
41
|
-
e.open || (
|
|
42
|
-
const n =
|
|
42
|
+
e.open || (v.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, e.showModal(), e.focus({ preventScroll: !0 }), requestAnimationFrame(() => e.open && e.focus({ preventScroll: !0 })));
|
|
43
|
+
const n = se(e);
|
|
43
44
|
return () => {
|
|
44
|
-
n(),
|
|
45
|
+
n(), v.current?.isConnected && v.current.focus({ preventScroll: !0 });
|
|
45
46
|
};
|
|
46
|
-
}, [t]),
|
|
47
|
+
}, [t]), E(() => {
|
|
47
48
|
if (!t) return;
|
|
48
49
|
const e = document.body.style.overflow, n = document.documentElement.style.overflow;
|
|
49
50
|
return document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", () => {
|
|
50
51
|
document.body.style.overflow = e, document.documentElement.style.overflow = n;
|
|
51
52
|
};
|
|
52
53
|
}, [t]);
|
|
53
|
-
const
|
|
54
|
-
...
|
|
55
|
-
...
|
|
56
|
-
}, j =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, 0),
|
|
60
|
-
},
|
|
54
|
+
const g = {
|
|
55
|
+
...G,
|
|
56
|
+
...s?.paper
|
|
57
|
+
}, j = I === !1 ? void 0 : ve[I], { className: oe, style: re, onClick: le, ...ie } = s?.backdrop ?? {}, de = (e) => {
|
|
58
|
+
p || b.current || (b.current = !0, window.setTimeout(() => {
|
|
59
|
+
b.current = !1;
|
|
60
|
+
}, 0), y?.(e, "escapeKeyDown"));
|
|
61
|
+
}, ae = (e) => {
|
|
61
62
|
e.preventDefault();
|
|
62
63
|
};
|
|
63
|
-
return
|
|
64
|
+
return E(() => {
|
|
64
65
|
if (!t || F) return;
|
|
65
66
|
const e = (n) => {
|
|
66
67
|
if (n.key !== "Escape" || n.defaultPrevented) return;
|
|
67
68
|
const o = document.activeElement;
|
|
68
|
-
o instanceof Element && o.closest("dialog[open]") !==
|
|
69
|
+
o instanceof Element && o.closest("dialog[open]") !== l.current || de(n);
|
|
69
70
|
};
|
|
70
71
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
71
|
-
}), t ? /* @__PURE__ */
|
|
72
|
-
ref:
|
|
72
|
+
}), t ? /* @__PURE__ */ d("dialog", {
|
|
73
|
+
ref: l,
|
|
73
74
|
tabIndex: -1,
|
|
74
|
-
"data-testid":
|
|
75
|
-
"aria-labelledby":
|
|
76
|
-
"aria-label":
|
|
77
|
-
onCancel:
|
|
78
|
-
|
|
75
|
+
"data-testid": a,
|
|
76
|
+
"aria-labelledby": f ?? h,
|
|
77
|
+
"aria-label": f || h ? void 0 : w,
|
|
78
|
+
onCancel: ae,
|
|
79
|
+
onKeyDown: (e) => {
|
|
80
|
+
!p || e.key !== "Escape" || e.target.closest("dialog[open]") === l.current && e.preventDefault();
|
|
81
|
+
},
|
|
82
|
+
className: k(he.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", L, S?.root),
|
|
79
83
|
style: {
|
|
80
84
|
zIndex: 999,
|
|
81
|
-
...W(
|
|
82
|
-
...
|
|
85
|
+
...W(X),
|
|
86
|
+
...U
|
|
83
87
|
},
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
-
...
|
|
86
|
-
className:
|
|
87
|
-
style:
|
|
88
|
+
children: [/* @__PURE__ */ r("div", {
|
|
89
|
+
...ie,
|
|
90
|
+
className: k("absolute inset-0 bg-[#626e7eb2]", oe),
|
|
91
|
+
style: re,
|
|
88
92
|
onClick: (e) => {
|
|
89
|
-
|
|
93
|
+
le?.(e), !e.defaultPrevented && !p && y?.(e, "backdropClick");
|
|
90
94
|
}
|
|
91
|
-
}), /* @__PURE__ */
|
|
92
|
-
className:
|
|
95
|
+
}), /* @__PURE__ */ d("div", {
|
|
96
|
+
className: k("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", g.className, S?.paper),
|
|
93
97
|
style: {
|
|
94
98
|
minWidth: 0,
|
|
95
99
|
minHeight: 0,
|
|
@@ -103,8 +107,8 @@ var ue = {
|
|
|
103
107
|
width: z ? "calc(100% - 64px)" : "auto",
|
|
104
108
|
maxHeight: "100%"
|
|
105
109
|
},
|
|
106
|
-
...W(
|
|
107
|
-
...
|
|
110
|
+
...W(g.sx),
|
|
111
|
+
...g.style,
|
|
108
112
|
...x ? {
|
|
109
113
|
width: "100%",
|
|
110
114
|
maxWidth: "100%",
|
|
@@ -112,32 +116,34 @@ var ue = {
|
|
|
112
116
|
maxHeight: "100%"
|
|
113
117
|
} : { maxHeight: "calc(100% - 64px)" }
|
|
114
118
|
},
|
|
115
|
-
children: [(!!c || !!
|
|
119
|
+
children: [(!!c || !!u || H) && /* @__PURE__ */ d("div", {
|
|
116
120
|
className: "box-border flex w-full min-w-0 max-w-full justify-between px-4 pt-4",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ d("div", {
|
|
118
122
|
className: "flex min-w-0 flex-1 flex-col justify-start gap-0.5",
|
|
119
|
-
children: [c && /* @__PURE__ */
|
|
120
|
-
id:
|
|
123
|
+
children: [c && /* @__PURE__ */ r("div", {
|
|
124
|
+
id: R,
|
|
121
125
|
className: "flex h-8 items-center text-sm font-normal leading-5 text-delta-600",
|
|
122
126
|
children: c
|
|
123
|
-
}),
|
|
127
|
+
}), u && /* @__PURE__ */ r("div", {
|
|
124
128
|
id: m,
|
|
125
129
|
className: "flex text-2xl font-semibold leading-8 text-delta-800",
|
|
126
|
-
children:
|
|
130
|
+
children: u
|
|
127
131
|
})]
|
|
128
|
-
}),
|
|
132
|
+
}), H && /* @__PURE__ */ d("div", {
|
|
129
133
|
className: "flex min-w-0 max-w-full shrink-0 justify-end gap-2",
|
|
130
|
-
children: [
|
|
131
|
-
dataTest: `close-button-${
|
|
134
|
+
children: [V, /* @__PURE__ */ r(fe, {
|
|
135
|
+
dataTest: `close-button-${a}`,
|
|
132
136
|
"aria-label": N ? void 0 : "Close",
|
|
133
137
|
variant: "textGray",
|
|
134
138
|
size: "small",
|
|
135
|
-
endIcon: /* @__PURE__ */
|
|
139
|
+
endIcon: /* @__PURE__ */ r(ce, {
|
|
136
140
|
width: 20,
|
|
137
141
|
height: 20
|
|
138
142
|
}),
|
|
139
143
|
className: "max-w-full shrink-0 whitespace-nowrap",
|
|
140
|
-
|
|
144
|
+
disabled: p,
|
|
145
|
+
disabledReason: ee,
|
|
146
|
+
onClick: (e) => y?.(e, "escapeKeyDown"),
|
|
141
147
|
style: {
|
|
142
148
|
color: "var(--colors-delta-800)",
|
|
143
149
|
paddingRight: "6px",
|
|
@@ -146,13 +152,16 @@ var ue = {
|
|
|
146
152
|
children: N
|
|
147
153
|
})]
|
|
148
154
|
})]
|
|
149
|
-
}), /* @__PURE__ */
|
|
150
|
-
value:
|
|
151
|
-
children:
|
|
155
|
+
}), /* @__PURE__ */ r(ye.Provider, {
|
|
156
|
+
value: Y,
|
|
157
|
+
children: /* @__PURE__ */ r(ue.Provider, {
|
|
158
|
+
value: te,
|
|
159
|
+
children: C
|
|
160
|
+
})
|
|
152
161
|
})]
|
|
153
162
|
})]
|
|
154
163
|
}) : null;
|
|
155
164
|
};
|
|
156
165
|
export {
|
|
157
|
-
|
|
166
|
+
_e as StyledDialog
|
|
158
167
|
};
|