asma-ui-core 3.117.0 → 3.119.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/feedback/minimizable-dialog/MinimizableDialog.js +96 -93
- package/dist/components/feedback/minimizable-dialog/components/FullscreenBtn.js +15 -12
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +80 -79
- package/dist/components/feedback/minimizable-dialog/v2/useControlledProps.js +6 -6
- package/dist/components/utils/popover/PopoverAnatomy.js +22 -17
- package/dist/components/utils/popover/PopoverSheet.js +165 -123
- package/dist/hooks/useFocusTrap.hook.js +7 -7
- package/dist/src/components/feedback/minimizable-dialog/components/FullscreenBtn.d.ts +8 -1
- package/dist/src/components/feedback/minimizable-dialog/types.d.ts +19 -1
- package/dist/src/components/feedback/minimizable-dialog/v2/types.d.ts +19 -1
- package/dist/src/components/utils/popover/PopoverAnatomy.d.ts +6 -1
- package/dist/src/components/utils/popover/PopoverSheet.d.ts +13 -1
- package/package.json +1 -1
|
@@ -1,60 +1,60 @@
|
|
|
1
1
|
import { cn as a } from "../../../../helpers/cn.js";
|
|
2
|
-
import { firstTabbable as
|
|
3
|
-
import { StyledTooltip as
|
|
4
|
-
import { DialogBusyContext as
|
|
5
|
-
import { useMobileMediaQuery as
|
|
6
|
-
import { OverlayBackOwnerContext as
|
|
7
|
-
import { useFocusTrap as
|
|
8
|
-
import { fullScreenFieldWidthVars as
|
|
9
|
-
import { CloseBtn as
|
|
10
|
-
import { MinimizeBtn as
|
|
11
|
-
import { FullScreenBtn as
|
|
2
|
+
import { firstTabbable as A } from "../../../../helpers/focusable.js";
|
|
3
|
+
import { StyledTooltip as le } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
4
|
+
import { DialogBusyContext as L, useDialogBusyBoundary as ne } from "../../dialog/DialogBusyContext.js";
|
|
5
|
+
import { useMobileMediaQuery as oe } from "../../../../hooks/useMediaQuery.hook.js";
|
|
6
|
+
import { OverlayBackOwnerContext as re, isOverlayBackNavigationPending as se, useBackCloses as ce } from "../../../../hooks/useBackCloses.hook.js";
|
|
7
|
+
import { useFocusTrap as ae } from "../../../../hooks/useFocusTrap.hook.js";
|
|
8
|
+
import { fullScreenFieldWidthVars as de } from "../../../inputs/field-styles.js";
|
|
9
|
+
import { CloseBtn as V } from "../components/CloseBtn.js";
|
|
10
|
+
import { MinimizeBtn as $ } from "../components/MinimizeBtn.js";
|
|
11
|
+
import { FullScreenBtn as me } from "../components/FullscreenBtn.js";
|
|
12
12
|
import h from "./MinimizableDialogV2.module.js";
|
|
13
|
-
import { useTranslations as
|
|
14
|
-
import { useControlledProps as
|
|
15
|
-
import
|
|
16
|
-
import { useId as
|
|
17
|
-
import { Fragment as
|
|
18
|
-
var
|
|
19
|
-
const { showCloseIcon:
|
|
13
|
+
import { useTranslations as ue } from "./useTranslations.js";
|
|
14
|
+
import { useControlledProps as fe } from "./useControlledProps.js";
|
|
15
|
+
import pe from "clsx";
|
|
16
|
+
import { useId as W, useLayoutEffect as H, useRef as d } from "react";
|
|
17
|
+
import { Fragment as xe, jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
18
|
+
var je = (w) => {
|
|
19
|
+
const { showCloseIcon: R = !0, showMinimizeIcon: _ = !0, showExpandIcon: Q = !0, enableFullscreen: U = !0, fullscreenLockedReason: N, title: u, label: f, children: G, open: i, onClose: J, classNameOverrides: b = {
|
|
20
20
|
maximized: "",
|
|
21
21
|
minimized: "",
|
|
22
22
|
fullscreen: ""
|
|
23
|
-
}, dataTest:
|
|
23
|
+
}, dataTest: K, actionNode: X, locale: Y = "en", busyReason: Z, style: B, initialFocusRef: F } = w, r = oe(), l = ue(Y), n = d(null), p = d(null), S = d(null), k = d(null), g = d(!1), y = d(null), x = W(), T = W(), { minimized: t, setMinimized: I, fullScreen: s, setFullScreen: M } = fe(w), c = s && !t, E = !!N, { busy: z, busyReason: P, contextValue: j } = ne(Z ?? l.waitUntilSaved), v = () => {
|
|
24
24
|
if (z) return !1;
|
|
25
|
-
|
|
25
|
+
I(!1), J();
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
H(() => {
|
|
28
28
|
n.current?.toggleAttribute("inert", t), p.current?.toggleAttribute("inert", !t);
|
|
29
|
-
}, [t]),
|
|
29
|
+
}, [t]), H(() => {
|
|
30
30
|
const C = i && !g.current, m = !i && g.current;
|
|
31
31
|
if (g.current = i, m) {
|
|
32
|
-
const
|
|
33
|
-
y.current = null, (!document.activeElement || document.activeElement === document.body) &&
|
|
32
|
+
const D = y.current;
|
|
33
|
+
y.current = null, (!document.activeElement || document.activeElement === document.body) && D?.isConnected && D.focus({ preventScroll: !0 });
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
if (!C) return;
|
|
37
37
|
y.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
38
|
-
const
|
|
39
|
-
(
|
|
38
|
+
const q = t ? p.current : n.current, ie = t ? k.current : S.current;
|
|
39
|
+
(F?.current ?? ie ?? (q ? A(q) : void 0))?.focus({ preventScroll: !0 });
|
|
40
40
|
}, [
|
|
41
|
-
|
|
41
|
+
F,
|
|
42
42
|
t,
|
|
43
43
|
i
|
|
44
44
|
]);
|
|
45
|
-
const
|
|
45
|
+
const O = () => {
|
|
46
46
|
const C = t ? n : p;
|
|
47
|
-
|
|
47
|
+
I(!t), requestAnimationFrame(() => {
|
|
48
48
|
const m = C.current;
|
|
49
|
-
m && (m.querySelector('[data-testid="toggle-minimize-btn"]') ??
|
|
49
|
+
m && (m.querySelector('[data-testid="toggle-minimize-btn"]') ?? A(m))?.focus({ preventScroll: !0 });
|
|
50
50
|
});
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
ae(i && c, n, v), ce({
|
|
53
53
|
active: i && !t,
|
|
54
|
-
requestClose: () => !c &&
|
|
54
|
+
requestClose: () => !c && se() ? !1 : v(),
|
|
55
55
|
ownerRef: n
|
|
56
56
|
});
|
|
57
|
-
const
|
|
57
|
+
const ee = c ? r ? {
|
|
58
58
|
inset: 0,
|
|
59
59
|
maxHeight: "100dvh",
|
|
60
60
|
maxWidth: "100dvw",
|
|
@@ -70,24 +70,24 @@ var Ee = (w) => {
|
|
|
70
70
|
width: "min(1000px, calc(100vw - 32px))",
|
|
71
71
|
maxWidth: "min(1000px, calc(100vw - 32px))",
|
|
72
72
|
height: "95dvh",
|
|
73
|
-
...
|
|
73
|
+
...de
|
|
74
74
|
} : void 0;
|
|
75
75
|
if (!i) return null;
|
|
76
|
-
const
|
|
77
|
-
return /* @__PURE__ */
|
|
76
|
+
const te = f ? `${T} ${x}` : x;
|
|
77
|
+
return /* @__PURE__ */ o(xe, { children: [
|
|
78
78
|
/* @__PURE__ */ e("div", {
|
|
79
79
|
ref: p,
|
|
80
80
|
style: {
|
|
81
81
|
zIndex: 51,
|
|
82
|
-
...
|
|
82
|
+
...B
|
|
83
83
|
},
|
|
84
84
|
className: a(h["minimized-dialog"], !t && h.hidden, b.minimized),
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
className:
|
|
87
|
-
"data-testid":
|
|
85
|
+
children: /* @__PURE__ */ o("div", {
|
|
86
|
+
className: pe("flex items-center justify-between", !t && "hidden"),
|
|
87
|
+
"data-testid": K,
|
|
88
88
|
children: [/* @__PURE__ */ e("div", {
|
|
89
89
|
className: "max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800",
|
|
90
|
-
children: /* @__PURE__ */ e(
|
|
90
|
+
children: /* @__PURE__ */ e(le, {
|
|
91
91
|
title: u,
|
|
92
92
|
placement: "top",
|
|
93
93
|
children: /* @__PURE__ */ e("div", {
|
|
@@ -95,18 +95,18 @@ var Ee = (w) => {
|
|
|
95
95
|
children: u
|
|
96
96
|
})
|
|
97
97
|
})
|
|
98
|
-
}), /* @__PURE__ */
|
|
98
|
+
}), /* @__PURE__ */ o("div", {
|
|
99
99
|
className: "flex items-center gap-x-1",
|
|
100
|
-
children: [/* @__PURE__ */ e(
|
|
100
|
+
children: [/* @__PURE__ */ e($, {
|
|
101
101
|
type: "expand",
|
|
102
|
-
visibility:
|
|
103
|
-
onClick:
|
|
102
|
+
visibility: Q,
|
|
103
|
+
onClick: O,
|
|
104
104
|
tooltipTitle: l.expand
|
|
105
|
-
}), /* @__PURE__ */ e(
|
|
106
|
-
buttonRef:
|
|
107
|
-
showCloseIcon:
|
|
105
|
+
}), /* @__PURE__ */ e(V, {
|
|
106
|
+
buttonRef: k,
|
|
107
|
+
showCloseIcon: R,
|
|
108
108
|
onClick: v,
|
|
109
|
-
disabledReason: z ?
|
|
109
|
+
disabledReason: z ? P : void 0,
|
|
110
110
|
tooltipTitle: l.close
|
|
111
111
|
})]
|
|
112
112
|
})]
|
|
@@ -115,74 +115,75 @@ var Ee = (w) => {
|
|
|
115
115
|
c && /* @__PURE__ */ e("div", {
|
|
116
116
|
className: "fixed inset-0 z-[52] bg-[rgb(98,110,126)] bg-opacity-70",
|
|
117
117
|
onClick: () => {
|
|
118
|
-
|
|
118
|
+
E || M(!1);
|
|
119
119
|
}
|
|
120
120
|
}),
|
|
121
121
|
/* @__PURE__ */ e("div", {
|
|
122
122
|
style: {
|
|
123
123
|
zIndex: 51,
|
|
124
|
-
...
|
|
125
|
-
...
|
|
124
|
+
...B,
|
|
125
|
+
...ee
|
|
126
126
|
},
|
|
127
127
|
ref: n,
|
|
128
128
|
role: "dialog",
|
|
129
129
|
"aria-modal": c ? !0 : void 0,
|
|
130
|
-
"aria-labelledby":
|
|
131
|
-
className: a(h.dialog, t && h.hidden, !
|
|
132
|
-
children: /* @__PURE__ */
|
|
130
|
+
"aria-labelledby": te,
|
|
131
|
+
className: a(h.dialog, t && h.hidden, !s && b.maximized, s && b.fullscreen, c && "fixed z-[53] duration-0"),
|
|
132
|
+
children: /* @__PURE__ */ o(re.Provider, {
|
|
133
133
|
value: n,
|
|
134
|
-
children: [/* @__PURE__ */
|
|
135
|
-
className: a("flex flex-col border-b-[1px] border-delta-200 px-4",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ o("div", {
|
|
135
|
+
className: a("flex flex-col border-b-[1px] border-delta-200 px-4", r ? "py-3" : "py-4"),
|
|
136
|
+
children: [/* @__PURE__ */ o("div", {
|
|
137
137
|
className: "flex items-center justify-between",
|
|
138
138
|
children: [f ? /* @__PURE__ */ e("div", {
|
|
139
|
-
id:
|
|
139
|
+
id: T,
|
|
140
140
|
className: "text-sm text-delta-700",
|
|
141
141
|
children: f
|
|
142
142
|
}) : /* @__PURE__ */ e("div", {
|
|
143
143
|
id: x,
|
|
144
|
-
className: a("font-semibold text-delta-800",
|
|
144
|
+
className: a("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
|
|
145
145
|
children: u
|
|
146
|
-
}), /* @__PURE__ */
|
|
146
|
+
}), /* @__PURE__ */ o("div", {
|
|
147
147
|
className: "flex items-center gap-x-1",
|
|
148
148
|
children: [
|
|
149
|
-
/* @__PURE__ */ e(
|
|
150
|
-
value:
|
|
151
|
-
children:
|
|
149
|
+
/* @__PURE__ */ e(L.Provider, {
|
|
150
|
+
value: j,
|
|
151
|
+
children: X
|
|
152
152
|
}),
|
|
153
|
-
/* @__PURE__ */ e(
|
|
154
|
-
visibility:
|
|
153
|
+
/* @__PURE__ */ e($, {
|
|
154
|
+
visibility: _ && !r,
|
|
155
155
|
type: "minimize",
|
|
156
|
-
onClick:
|
|
156
|
+
onClick: O,
|
|
157
157
|
tooltipTitle: l.minimize
|
|
158
158
|
}),
|
|
159
|
-
/* @__PURE__ */ e(
|
|
160
|
-
showFullScreenIcon:
|
|
161
|
-
|
|
159
|
+
/* @__PURE__ */ e(me, {
|
|
160
|
+
showFullScreenIcon: (U || E) && !r,
|
|
161
|
+
disabledReason: N,
|
|
162
|
+
fullScreen: s,
|
|
162
163
|
onClick: () => {
|
|
163
|
-
|
|
164
|
+
M(!s);
|
|
164
165
|
},
|
|
165
|
-
tooltipTitle:
|
|
166
|
+
tooltipTitle: s ? l.exitFullscreen : l.fullscreen
|
|
166
167
|
}),
|
|
167
|
-
/* @__PURE__ */ e(
|
|
168
|
+
/* @__PURE__ */ e(V, {
|
|
168
169
|
buttonRef: S,
|
|
169
|
-
showCloseIcon:
|
|
170
|
+
showCloseIcon: R,
|
|
170
171
|
onClick: v,
|
|
171
|
-
disabledReason: z ?
|
|
172
|
+
disabledReason: z ? P : void 0,
|
|
172
173
|
tooltipTitle: l.close
|
|
173
174
|
})
|
|
174
175
|
]
|
|
175
176
|
})]
|
|
176
177
|
}), f && /* @__PURE__ */ e("div", {
|
|
177
178
|
id: x,
|
|
178
|
-
className: a("font-semibold text-delta-800",
|
|
179
|
+
className: a("font-semibold text-delta-800", r ? "line-clamp-2 text-xl" : "line-clamp-1 text-2xl"),
|
|
179
180
|
children: u
|
|
180
181
|
})]
|
|
181
182
|
}), /* @__PURE__ */ e("div", {
|
|
182
183
|
className: a(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
|
|
183
|
-
children: /* @__PURE__ */ e(
|
|
184
|
-
value:
|
|
185
|
-
children:
|
|
184
|
+
children: /* @__PURE__ */ e(L.Provider, {
|
|
185
|
+
value: j,
|
|
186
|
+
children: G
|
|
186
187
|
})
|
|
187
188
|
})]
|
|
188
189
|
})
|
|
@@ -190,5 +191,5 @@ var Ee = (w) => {
|
|
|
190
191
|
] });
|
|
191
192
|
};
|
|
192
193
|
export {
|
|
193
|
-
|
|
194
|
+
je as MinimizableDialogV2
|
|
194
195
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useState as t } from "react";
|
|
2
|
-
var p = ({ fullScreenState: i, handleFullScreenState: s, minimizedState:
|
|
3
|
-
const [
|
|
2
|
+
var p = ({ fullScreenState: i, handleFullScreenState: s, minimizedState: o, handleMinimizedState: n }) => {
|
|
3
|
+
const [r, c] = t(!1), [l, m] = t(!1);
|
|
4
4
|
return {
|
|
5
|
-
fullScreen: i ??
|
|
6
|
-
setFullScreen: (e) => s ? s() : m(e),
|
|
7
|
-
minimized:
|
|
8
|
-
setMinimized: (e) => n ? n(e) :
|
|
5
|
+
fullScreen: i ?? l,
|
|
6
|
+
setFullScreen: (e) => s ? s(e) : m(e),
|
|
7
|
+
minimized: o ?? r,
|
|
8
|
+
setMinimized: (e) => n ? n(e) : c(e)
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { cn as
|
|
1
|
+
import { cn as d } from "../../../helpers/cn.js";
|
|
2
2
|
import { CloseIcon as c } from "../../icons/close-icon/CloseIcon.js";
|
|
3
3
|
import { StyledButton as h } from "../../inputs/button/StyledButton.js";
|
|
4
4
|
import { useScrollGutter as u } from "./useScrollGutter.js";
|
|
5
5
|
import { useRef as v } from "react";
|
|
6
|
-
import { Fragment as
|
|
7
|
-
var
|
|
8
|
-
const
|
|
9
|
-
return /* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
6
|
+
import { Fragment as _, jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
7
|
+
var g = 40, j = "relative box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[0px_4px_40px_0px_#22213366]", b = "pointer-events-none absolute inset-0 rounded-[inherit] shadow-[inset_0_0_0_1px_var(--colors-delta-300)]", k = ({ dataTest: a, title: t, titleId: m, children: p, viewResultsAction: r, resetAction: o, footerActions: i, closeLabel: f, onClose: x }) => {
|
|
8
|
+
const n = v(null), s = u(n);
|
|
9
|
+
return /* @__PURE__ */ l(_, { children: [
|
|
10
|
+
/* @__PURE__ */ l("div", {
|
|
11
11
|
className: "relative flex min-h-0 flex-1 flex-col",
|
|
12
12
|
children: [
|
|
13
13
|
t && /* @__PURE__ */ e("div", {
|
|
@@ -16,18 +16,18 @@ var _ = 40, j = "box-border flex flex-col overflow-hidden rounded-lg bg-white te
|
|
|
16
16
|
children: t
|
|
17
17
|
}),
|
|
18
18
|
/* @__PURE__ */ e("div", {
|
|
19
|
-
ref:
|
|
20
|
-
className:
|
|
21
|
-
style: { paddingRight: Math.max(0,
|
|
22
|
-
children:
|
|
19
|
+
ref: n,
|
|
20
|
+
className: d("flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto py-2 pl-4 [scrollbar-gutter:stable]", !t && s.overflows && "mt-10"),
|
|
21
|
+
style: { paddingRight: Math.max(0, g - s.width) },
|
|
22
|
+
children: p
|
|
23
23
|
}),
|
|
24
24
|
/* @__PURE__ */ e("div", {
|
|
25
25
|
className: "absolute right-0 top-0",
|
|
26
26
|
children: /* @__PURE__ */ e(h, {
|
|
27
|
-
dataTest: `${
|
|
27
|
+
dataTest: `${a}-close`,
|
|
28
28
|
variant: "textGray",
|
|
29
29
|
type: "button",
|
|
30
|
-
"aria-label":
|
|
30
|
+
"aria-label": f,
|
|
31
31
|
onClick: x,
|
|
32
32
|
startIcon: /* @__PURE__ */ e(c, {
|
|
33
33
|
width: 24,
|
|
@@ -37,13 +37,18 @@ var _ = 40, j = "box-border flex flex-col overflow-hidden rounded-lg bg-white te
|
|
|
37
37
|
})
|
|
38
38
|
]
|
|
39
39
|
}),
|
|
40
|
-
(
|
|
41
|
-
className:
|
|
42
|
-
children: [
|
|
40
|
+
(r ?? o) && /* @__PURE__ */ l("div", {
|
|
41
|
+
className: d("flex shrink-0 items-start p-1", r ? "justify-between" : "justify-end"),
|
|
42
|
+
children: [r, o]
|
|
43
43
|
}),
|
|
44
|
-
|
|
44
|
+
i && /* @__PURE__ */ e("div", {
|
|
45
45
|
className: "flex shrink-0 flex-col items-end p-3",
|
|
46
|
-
children:
|
|
46
|
+
children: i
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ e("span", {
|
|
49
|
+
"aria-hidden": !0,
|
|
50
|
+
"data-test": `${a}-edge`,
|
|
51
|
+
className: b
|
|
47
52
|
})
|
|
48
53
|
] });
|
|
49
54
|
};
|