asma-ui-core 3.72.0 → 3.73.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.
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as s } from "../../../../helpers/cn.js";
|
|
2
2
|
import { StyledTooltip as j } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
3
3
|
import { useMobileMediaQuery as B } from "../../../../hooks/useMediaQuery.hook.js";
|
|
4
4
|
import { useFocusTrap as D } from "../../../../hooks/useFocusTrap.hook.js";
|
|
5
5
|
import { CloseBtn as y } from "../components/CloseBtn.js";
|
|
6
6
|
import { MinimizeBtn as z } from "../components/MinimizeBtn.js";
|
|
7
7
|
import { FullScreenBtn as R } from "../components/FullscreenBtn.js";
|
|
8
|
-
import
|
|
8
|
+
import d from "./MinimizableDialogV2.module.js";
|
|
9
9
|
import { useTranslations as V } from "./useTranslations.js";
|
|
10
|
-
import { useControlledProps as
|
|
11
|
-
import
|
|
12
|
-
import { useRef as
|
|
13
|
-
import { Fragment as
|
|
10
|
+
import { useControlledProps as W } from "./useControlledProps.js";
|
|
11
|
+
import _ from "clsx";
|
|
12
|
+
import { useRef as $ } from "react";
|
|
13
|
+
import { Fragment as A, jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
14
14
|
var ee = (f) => {
|
|
15
|
-
const { showCloseIcon:
|
|
15
|
+
const { showCloseIcon: h = !0, showMinimizeIcon: N = !0, showExpandIcon: w = !0, enableFullscreen: C = !0, title: n, label: m, children: F, open: u, onClose: T, classNameOverrides: c = {
|
|
16
16
|
maximized: "",
|
|
17
17
|
minimized: "",
|
|
18
18
|
fullscreen: ""
|
|
19
|
-
}, dataTest: M, actionNode: S, locale: k = "en", style: v } = f,
|
|
19
|
+
}, dataTest: M, actionNode: S, locale: k = "en", style: v } = f, a = B(), r = V(k), b = $(null), { minimized: i, setMinimized: x, fullScreen: l, setFullScreen: g } = W(f), t = l && !i, p = () => {
|
|
20
20
|
x(!1), T();
|
|
21
21
|
};
|
|
22
|
-
D(
|
|
23
|
-
const I = t ? {
|
|
22
|
+
D(u && t, b, p);
|
|
23
|
+
const I = t ? a ? {
|
|
24
|
+
inset: 0,
|
|
25
|
+
maxHeight: "100dvh",
|
|
26
|
+
maxWidth: "100dvw",
|
|
27
|
+
transform: "none",
|
|
28
|
+
height: "100dvh",
|
|
29
|
+
width: "100dvw"
|
|
30
|
+
} : {
|
|
24
31
|
right: "auto",
|
|
25
32
|
bottom: "auto",
|
|
26
33
|
left: "50%",
|
|
@@ -30,15 +37,15 @@ var ee = (f) => {
|
|
|
30
37
|
maxWidth: "min(1000px, calc(100vw - 32px))",
|
|
31
38
|
height: "95dvh"
|
|
32
39
|
} : void 0;
|
|
33
|
-
return
|
|
40
|
+
return u ? /* @__PURE__ */ o(A, { children: [
|
|
34
41
|
/* @__PURE__ */ e("div", {
|
|
35
42
|
style: {
|
|
36
43
|
zIndex: 51,
|
|
37
44
|
...v
|
|
38
45
|
},
|
|
39
|
-
className:
|
|
46
|
+
className: s(d["minimized-dialog"], !i && d.hidden, c.minimized),
|
|
40
47
|
children: /* @__PURE__ */ o("div", {
|
|
41
|
-
className:
|
|
48
|
+
className: _("flex items-center justify-between", !i && "hidden"),
|
|
42
49
|
"data-testid": M,
|
|
43
50
|
children: [/* @__PURE__ */ e("div", {
|
|
44
51
|
className: "max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800",
|
|
@@ -58,11 +65,11 @@ var ee = (f) => {
|
|
|
58
65
|
onClick: () => {
|
|
59
66
|
x(!i);
|
|
60
67
|
},
|
|
61
|
-
tooltipTitle:
|
|
68
|
+
tooltipTitle: r.expand
|
|
62
69
|
}), /* @__PURE__ */ e(y, {
|
|
63
|
-
showCloseIcon:
|
|
70
|
+
showCloseIcon: h,
|
|
64
71
|
onClick: p,
|
|
65
|
-
tooltipTitle:
|
|
72
|
+
tooltipTitle: r.close
|
|
66
73
|
})]
|
|
67
74
|
})]
|
|
68
75
|
})
|
|
@@ -83,50 +90,50 @@ var ee = (f) => {
|
|
|
83
90
|
role: t ? "dialog" : void 0,
|
|
84
91
|
"aria-modal": t ? !0 : void 0,
|
|
85
92
|
"aria-label": t && typeof n == "string" ? n : void 0,
|
|
86
|
-
className:
|
|
93
|
+
className: s(d.dialog, i && d.hidden, !l && c.maximized, l && c.fullscreen, t && "fixed z-[53] duration-0"),
|
|
87
94
|
children: [/* @__PURE__ */ o("div", {
|
|
88
|
-
className:
|
|
95
|
+
className: s("flex flex-col border-b-[1px] border-delta-200 px-4", a ? "py-3" : "py-4"),
|
|
89
96
|
children: [/* @__PURE__ */ o("div", {
|
|
90
97
|
className: "flex items-center justify-between",
|
|
91
98
|
children: [m ? /* @__PURE__ */ e("div", {
|
|
92
99
|
className: "text-sm text-delta-700",
|
|
93
100
|
children: m
|
|
94
101
|
}) : /* @__PURE__ */ e("div", {
|
|
95
|
-
className:
|
|
102
|
+
className: s("font-semibold text-delta-800", a ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
|
|
96
103
|
children: n
|
|
97
104
|
}), /* @__PURE__ */ o("div", {
|
|
98
105
|
className: "flex items-center gap-x-1",
|
|
99
106
|
children: [
|
|
100
107
|
S,
|
|
101
108
|
/* @__PURE__ */ e(z, {
|
|
102
|
-
visibility: N && !
|
|
109
|
+
visibility: N && !a && !l,
|
|
103
110
|
type: "minimize",
|
|
104
111
|
onClick: () => {
|
|
105
112
|
x(!i);
|
|
106
113
|
},
|
|
107
|
-
tooltipTitle:
|
|
114
|
+
tooltipTitle: r.minimize
|
|
108
115
|
}),
|
|
109
116
|
/* @__PURE__ */ e(R, {
|
|
110
|
-
showFullScreenIcon: C && !
|
|
117
|
+
showFullScreenIcon: C && !a,
|
|
111
118
|
fullScreen: l,
|
|
112
119
|
onClick: () => {
|
|
113
120
|
g(!l);
|
|
114
121
|
},
|
|
115
|
-
tooltipTitle: l ?
|
|
122
|
+
tooltipTitle: l ? r.exitFullscreen : r.fullscreen
|
|
116
123
|
}),
|
|
117
124
|
/* @__PURE__ */ e(y, {
|
|
118
|
-
showCloseIcon:
|
|
125
|
+
showCloseIcon: h,
|
|
119
126
|
onClick: p,
|
|
120
|
-
tooltipTitle:
|
|
127
|
+
tooltipTitle: r.close
|
|
121
128
|
})
|
|
122
129
|
]
|
|
123
130
|
})]
|
|
124
131
|
}), m && /* @__PURE__ */ e("div", {
|
|
125
|
-
className:
|
|
132
|
+
className: s("font-semibold text-delta-800", a ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
|
|
126
133
|
children: n
|
|
127
134
|
})]
|
|
128
135
|
}), /* @__PURE__ */ e("div", {
|
|
129
|
-
className:
|
|
136
|
+
className: s(i && "hidden", "flex flex-grow flex-col overflow-y-auto"),
|
|
130
137
|
children: F
|
|
131
138
|
})]
|
|
132
139
|
})
|