asma-ui-core 3.104.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 +62 -43
- 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 -52
- package/dist/components/data-display/tooltip/StyledTooltip.js +110 -65
- package/dist/components/feedback/dialog/DialogBusyContext.js +32 -0
- package/dist/components/feedback/dialog/StyledDialog.js +104 -80
- 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 +8 -8
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +32 -32
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +91 -82
- package/dist/components/inputs/select/StyledSelect.js +8 -8
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +152 -152
- 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/menu/StyledMenuList.js +47 -38
- package/dist/components/navigation/tabs/StyledTab.js +25 -18
- package/dist/components/navigation/tabs/StyledTabs.js +33 -33
- 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 +4 -3
- package/dist/helpers/warnUnnamedDialog.js +6 -0
- 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 +15 -2
- package/dist/src/components/feedback/dialog/dialog-footer/StyledDialogFooter.d.ts +10 -7
- 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/menu/StyledMenuList.d.ts +2 -1
- package/dist/src/components/navigation/tabs/StyledTab.d.ts +17 -1
- package/dist/src/forms/submitChanged.d.ts +3 -0
- package/dist/src/helpers/focusable.d.ts +9 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/uiCoreLocale.d.ts +1 -0
- package/dist/src/helpers/warnUnnamedDialog.d.ts +5 -0
- package/dist/src/table/shared-components/StyledMenuItem.d.ts +5 -1
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +57 -50
- package/dist/table/shared-components/StyledMenuItem.js +28 -16
- package/dist/table/shared-components/button/StyledButton.module.js +11 -11
- package/package.json +1 -1
|
@@ -1,92 +1,137 @@
|
|
|
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 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
10
|
return n.selectNodeContents(t), n.getBoundingClientRect();
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,
|
|
16
44
|
onOpenChange: S,
|
|
17
|
-
placement:
|
|
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
|
-
|
|
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(() => {
|
|
41
87
|
const e = o.domReference.current;
|
|
42
|
-
if (!
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
-
|
|
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");
|
|
46
93
|
};
|
|
47
94
|
}, [
|
|
48
|
-
|
|
95
|
+
O,
|
|
49
96
|
o.domReference,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
})
|
|
56
|
-
J(() => {
|
|
97
|
+
u,
|
|
98
|
+
A
|
|
99
|
+
]), U(() => {
|
|
100
|
+
const e = o.domReference.current;
|
|
101
|
+
!O || !u || !(e instanceof HTMLElement) || N(I(e), u);
|
|
102
|
+
}), L(() => {
|
|
57
103
|
const e = o.domReference.current;
|
|
58
|
-
!
|
|
104
|
+
!s || !e || o.setPositionReference({
|
|
59
105
|
contextElement: e,
|
|
60
|
-
getBoundingClientRect: () =>
|
|
106
|
+
getBoundingClientRect: () => De(e)
|
|
61
107
|
});
|
|
62
|
-
}, [
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
...
|
|
72
|
-
...B(),
|
|
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(),
|
|
73
118
|
style: {
|
|
74
|
-
...
|
|
75
|
-
|
|
119
|
+
...F ? se : {},
|
|
120
|
+
...$,
|
|
76
121
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
77
122
|
overflow: "visible",
|
|
78
|
-
...
|
|
79
|
-
...
|
|
123
|
+
...x?.tooltip?.style,
|
|
124
|
+
...te(x?.tooltip?.sx)
|
|
80
125
|
},
|
|
81
|
-
className:
|
|
82
|
-
children: [t,
|
|
83
|
-
ref:
|
|
84
|
-
context:
|
|
85
|
-
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
|
|
86
131
|
})]
|
|
87
132
|
})
|
|
88
133
|
})] });
|
|
89
134
|
};
|
|
90
135
|
export {
|
|
91
|
-
|
|
136
|
+
ke as StyledTooltip
|
|
92
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,143 +1,167 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
import { cn as k } from "../../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as W } from "../../../helpers/sx.js";
|
|
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 = {
|
|
12
14
|
xs: 444,
|
|
13
15
|
sm: 600,
|
|
14
16
|
md: 900,
|
|
15
17
|
lg: 1200,
|
|
16
18
|
xl: 1536
|
|
17
|
-
},
|
|
18
|
-
const
|
|
19
|
-
titleId:
|
|
20
|
-
setTitleId:
|
|
21
|
-
}), [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
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(() => ({
|
|
21
|
+
titleId: m,
|
|
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;
|
|
26
|
+
o && !o.id && (o.id = _);
|
|
27
|
+
const O = o?.id;
|
|
28
|
+
O !== h && ne(O), e && t && !n && !o && !B.current && (B.current = !0, pe(a));
|
|
29
|
+
}, [
|
|
30
|
+
t,
|
|
31
|
+
f,
|
|
32
|
+
w,
|
|
33
|
+
C,
|
|
34
|
+
h,
|
|
35
|
+
_,
|
|
36
|
+
a
|
|
37
|
+
]), E(() => {
|
|
38
|
+
M.current && !t && s?.transition?.onExited?.(), M.current = t;
|
|
39
|
+
}, [t, s]), P(() => {
|
|
40
|
+
const e = l.current;
|
|
26
41
|
if (!e || !t) return;
|
|
27
|
-
e.open || (
|
|
28
|
-
const
|
|
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);
|
|
29
44
|
return () => {
|
|
30
|
-
|
|
45
|
+
n(), v.current?.isConnected && v.current.focus({ preventScroll: !0 });
|
|
31
46
|
};
|
|
32
|
-
}, [t]),
|
|
47
|
+
}, [t]), E(() => {
|
|
33
48
|
if (!t) return;
|
|
34
|
-
const e = document.body.style.overflow,
|
|
49
|
+
const e = document.body.style.overflow, n = document.documentElement.style.overflow;
|
|
35
50
|
return document.body.style.overflow = "hidden", document.documentElement.style.overflow = "hidden", () => {
|
|
36
|
-
document.body.style.overflow = e, document.documentElement.style.overflow =
|
|
51
|
+
document.body.style.overflow = e, document.documentElement.style.overflow = n;
|
|
37
52
|
};
|
|
38
53
|
}, [t]);
|
|
39
|
-
const
|
|
40
|
-
...
|
|
41
|
-
...
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}, 0),
|
|
46
|
-
},
|
|
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) => {
|
|
47
62
|
e.preventDefault();
|
|
48
63
|
};
|
|
49
|
-
return
|
|
50
|
-
if (!t ||
|
|
51
|
-
const e = (
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
|
|
64
|
+
return E(() => {
|
|
65
|
+
if (!t || F) return;
|
|
66
|
+
const e = (n) => {
|
|
67
|
+
if (n.key !== "Escape" || n.defaultPrevented) return;
|
|
68
|
+
const o = document.activeElement;
|
|
69
|
+
o instanceof Element && o.closest("dialog[open]") !== l.current || de(n);
|
|
55
70
|
};
|
|
56
71
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
57
|
-
}), t ? /* @__PURE__ */
|
|
58
|
-
ref:
|
|
72
|
+
}), t ? /* @__PURE__ */ d("dialog", {
|
|
73
|
+
ref: l,
|
|
59
74
|
tabIndex: -1,
|
|
60
|
-
"data-testid":
|
|
61
|
-
"aria-labelledby":
|
|
62
|
-
"aria-label":
|
|
63
|
-
onCancel:
|
|
64
|
-
|
|
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),
|
|
65
83
|
style: {
|
|
66
84
|
zIndex: 999,
|
|
67
|
-
...
|
|
68
|
-
...
|
|
85
|
+
...W(X),
|
|
86
|
+
...U
|
|
69
87
|
},
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
-
...
|
|
72
|
-
className:
|
|
73
|
-
style:
|
|
88
|
+
children: [/* @__PURE__ */ r("div", {
|
|
89
|
+
...ie,
|
|
90
|
+
className: k("absolute inset-0 bg-[#626e7eb2]", oe),
|
|
91
|
+
style: re,
|
|
74
92
|
onClick: (e) => {
|
|
75
|
-
|
|
93
|
+
le?.(e), !e.defaultPrevented && !p && y?.(e, "backdropClick");
|
|
76
94
|
}
|
|
77
|
-
}), /* @__PURE__ */
|
|
78
|
-
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),
|
|
79
97
|
style: {
|
|
80
98
|
minWidth: 0,
|
|
81
99
|
minHeight: 0,
|
|
82
|
-
...!
|
|
83
|
-
...
|
|
100
|
+
...!x && j ? { maxWidth: j } : {},
|
|
101
|
+
...x ? {
|
|
84
102
|
width: "100%",
|
|
85
103
|
maxWidth: "100%",
|
|
86
104
|
height: "100%",
|
|
87
105
|
maxHeight: "100%"
|
|
88
106
|
} : {
|
|
89
|
-
width:
|
|
107
|
+
width: z ? "calc(100% - 64px)" : "auto",
|
|
90
108
|
maxHeight: "100%"
|
|
91
109
|
},
|
|
92
|
-
...
|
|
93
|
-
...
|
|
94
|
-
...
|
|
110
|
+
...W(g.sx),
|
|
111
|
+
...g.style,
|
|
112
|
+
...x ? {
|
|
95
113
|
width: "100%",
|
|
96
114
|
maxWidth: "100%",
|
|
97
115
|
height: "100%",
|
|
98
116
|
maxHeight: "100%"
|
|
99
117
|
} : { maxHeight: "calc(100% - 64px)" }
|
|
100
118
|
},
|
|
101
|
-
children: [(!!
|
|
119
|
+
children: [(!!c || !!u || H) && /* @__PURE__ */ d("div", {
|
|
102
120
|
className: "box-border flex w-full min-w-0 max-w-full justify-between px-4 pt-4",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ d("div", {
|
|
104
122
|
className: "flex min-w-0 flex-1 flex-col justify-start gap-0.5",
|
|
105
|
-
children: [
|
|
123
|
+
children: [c && /* @__PURE__ */ r("div", {
|
|
124
|
+
id: R,
|
|
106
125
|
className: "flex h-8 items-center text-sm font-normal leading-5 text-delta-600",
|
|
107
|
-
children:
|
|
108
|
-
}),
|
|
109
|
-
id:
|
|
126
|
+
children: c
|
|
127
|
+
}), u && /* @__PURE__ */ r("div", {
|
|
128
|
+
id: m,
|
|
110
129
|
className: "flex text-2xl font-semibold leading-8 text-delta-800",
|
|
111
|
-
children:
|
|
130
|
+
children: u
|
|
112
131
|
})]
|
|
113
|
-
}),
|
|
132
|
+
}), H && /* @__PURE__ */ d("div", {
|
|
114
133
|
className: "flex min-w-0 max-w-full shrink-0 justify-end gap-2",
|
|
115
|
-
children: [
|
|
116
|
-
dataTest: `close-button-${
|
|
117
|
-
"aria-label":
|
|
134
|
+
children: [V, /* @__PURE__ */ r(fe, {
|
|
135
|
+
dataTest: `close-button-${a}`,
|
|
136
|
+
"aria-label": N ? void 0 : "Close",
|
|
118
137
|
variant: "textGray",
|
|
119
138
|
size: "small",
|
|
120
|
-
endIcon: /* @__PURE__ */
|
|
139
|
+
endIcon: /* @__PURE__ */ r(ce, {
|
|
121
140
|
width: 20,
|
|
122
141
|
height: 20
|
|
123
142
|
}),
|
|
124
143
|
className: "max-w-full shrink-0 whitespace-nowrap",
|
|
125
|
-
|
|
144
|
+
disabled: p,
|
|
145
|
+
disabledReason: ee,
|
|
146
|
+
onClick: (e) => y?.(e, "escapeKeyDown"),
|
|
126
147
|
style: {
|
|
127
148
|
color: "var(--colors-delta-800)",
|
|
128
149
|
paddingRight: "6px",
|
|
129
150
|
paddingLeft: "6px"
|
|
130
151
|
},
|
|
131
|
-
children:
|
|
152
|
+
children: N
|
|
132
153
|
})]
|
|
133
154
|
})]
|
|
134
|
-
}), /* @__PURE__ */
|
|
135
|
-
value:
|
|
136
|
-
children:
|
|
155
|
+
}), /* @__PURE__ */ r(ye.Provider, {
|
|
156
|
+
value: Y,
|
|
157
|
+
children: /* @__PURE__ */ r(ue.Provider, {
|
|
158
|
+
value: te,
|
|
159
|
+
children: C
|
|
160
|
+
})
|
|
137
161
|
})]
|
|
138
162
|
})]
|
|
139
163
|
}) : null;
|
|
140
164
|
};
|
|
141
165
|
export {
|
|
142
|
-
|
|
166
|
+
_e as StyledDialog
|
|
143
167
|
};
|