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,181 +1,223 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { firstTabbable as
|
|
3
|
-
import { TOP_LAYER_PROPS as
|
|
4
|
-
import { StyledButton as
|
|
5
|
-
import { useMobileMediaQuery as
|
|
6
|
-
import { OverlayBackOwnerContext as
|
|
7
|
-
import { useDebouncedValue as
|
|
8
|
-
import { useFocusTrap as
|
|
9
|
-
import { formatResultsLabel as
|
|
10
|
-
import { StyledBottomSheet as
|
|
11
|
-
import { PopoverAnatomy as
|
|
12
|
-
import { useCallback as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { FloatingPortal as
|
|
15
|
-
var
|
|
1
|
+
import { cn as Oe } from "../../../helpers/cn.js";
|
|
2
|
+
import { firstTabbable as oe } from "../../../helpers/focusable.js";
|
|
3
|
+
import { TOP_LAYER_PROPS as Te, TOP_LAYER_RESET_STYLE as Ce, getOpenModalDialogAncestor as Se, shouldUsePopoverTopLayer as Ie, useTopLayerRef as Me } from "../../../hooks/useTopLayer.hook.js";
|
|
4
|
+
import { StyledButton as _e } from "../../inputs/button/StyledButton.js";
|
|
5
|
+
import { useMobileMediaQuery as ke } from "../../../hooks/useMediaQuery.hook.js";
|
|
6
|
+
import { OverlayBackOwnerContext as He, requestCloseTopOverlayBack as We, useBackCloses as Be } from "../../../hooks/useBackCloses.hook.js";
|
|
7
|
+
import { useDebouncedValue as De } from "../../../hooks/useDebouncedValue.hook.js";
|
|
8
|
+
import { useFocusTrap as qe } from "../../../hooks/useFocusTrap.hook.js";
|
|
9
|
+
import { formatResultsLabel as $e } from "../bottom-sheet/formatResultsLabel.js";
|
|
10
|
+
import { StyledBottomSheet as Ne } from "../bottom-sheet/StyledBottomSheet.js";
|
|
11
|
+
import { PopoverAnatomy as Xe } from "./PopoverAnatomy.js";
|
|
12
|
+
import { useCallback as d, useEffect as v, useId as je, useRef as f, useState as l } from "react";
|
|
13
|
+
import { Fragment as ne, jsx as m, jsxs as re } from "react/jsx-runtime";
|
|
14
|
+
import { FloatingPortal as Ke, autoUpdate as Ue, flip as Ye, offset as ze, shift as Ve, size as Ge, useDismiss as Qe, useFloating as Je, useInteractions as Ze, useMergeRefs as et } from "@floating-ui/react";
|
|
15
|
+
var C = 240, tt = {
|
|
16
16
|
info: 472,
|
|
17
17
|
action: 472
|
|
18
|
-
},
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
}, [
|
|
18
|
+
}, ie = 0.6, se = "calc(100vw - 32px)", wt = ({ dataTest: p, renderTrigger: S, variant: I = "info", title: w, children: M, viewResultsAction: _, resetAction: k, footerActions: H, resultCount: E, closeLabel: W = "Lukk", ariaLabel: B, onOpenChange: D, className: q, align: $ = "auto", ignoreOutside: N }) => {
|
|
19
|
+
const g = je(), X = `${g}-title`, [o, ae] = l(!1), [j, ce] = l(), [le, K] = l(), [ue, de] = l("start"), [R, U] = l(), [fe, Y] = l(C), u = ke(), n = I === "action", me = u && !n, y = u && n, P = d((e) => {
|
|
20
|
+
ae(e), D?.(e);
|
|
21
|
+
}, [D]), { refs: b, floatingStyles: pe, context: ge, placement: z, isPositioned: he } = Je({
|
|
22
22
|
open: o,
|
|
23
|
-
onOpenChange:
|
|
24
|
-
placement: "bottom
|
|
23
|
+
onOpenChange: P,
|
|
24
|
+
placement: `${R ?? "bottom"}-${ue}`,
|
|
25
25
|
strategy: "fixed",
|
|
26
|
-
whileElementsMounted:
|
|
26
|
+
whileElementsMounted: Ue,
|
|
27
27
|
middleware: [
|
|
28
|
-
|
|
29
|
-
...
|
|
30
|
-
Te({ padding: 8 }),
|
|
31
|
-
Ee({
|
|
28
|
+
ze(8),
|
|
29
|
+
...me || R ? [] : [Ye({
|
|
32
30
|
padding: 8,
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
crossAxis: !1,
|
|
32
|
+
flipAlignment: !1
|
|
33
|
+
})],
|
|
34
|
+
Ve({ padding: 8 }),
|
|
35
|
+
Ge({
|
|
36
|
+
padding: 8,
|
|
37
|
+
apply({ availableHeight: e, rects: t }) {
|
|
38
|
+
K(Math.min(e, Math.round(window.innerHeight * ie))), u || Y((a) => Math.max(a, t.floating.width));
|
|
35
39
|
}
|
|
36
40
|
})
|
|
37
41
|
]
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
});
|
|
43
|
+
o && he && !R && U(z.startsWith("top") ? "top" : "bottom");
|
|
44
|
+
const F = Ie(j), c = f(null), [r, ve] = l(null), we = d((e) => {
|
|
45
|
+
c.current = e, ve(e);
|
|
46
|
+
}, []), ye = et([Me(b.setFloating, F), we]), A = f(null), Pe = d((e) => {
|
|
47
|
+
A.current = e, b.setReference(e);
|
|
48
|
+
}, [b]), V = f(null), L = N?.length ? N.join(",") : void 0, G = f(L);
|
|
49
|
+
v(() => {
|
|
50
|
+
G.current = L;
|
|
51
|
+
}, [L]);
|
|
52
|
+
const h = d((e) => {
|
|
53
|
+
if (!(e instanceof Element)) return !1;
|
|
54
|
+
if (c.current?.contains(e) || A.current?.contains(e) || V.current === e) return !0;
|
|
55
|
+
const t = G.current;
|
|
56
|
+
return t !== void 0 && e.closest(t) !== null;
|
|
57
|
+
}, []), Q = f(null), xe = d((e) => {
|
|
58
|
+
V.current = e.target, e.target instanceof HTMLElement && c.current?.contains(e.target) && (Q.current = e.target);
|
|
59
|
+
}, []), { getFloatingProps: Ee } = Ze([Qe(ge, {
|
|
60
|
+
enabled: !y,
|
|
61
|
+
escapeKey: !1,
|
|
41
62
|
outsidePress: (e) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
63
|
+
const t = e.target;
|
|
64
|
+
if (!(t instanceof Element)) return !0;
|
|
65
|
+
if (h(t) || t.closest("[data-floating-ui-portal]")) return !1;
|
|
66
|
+
const a = t.closest('dialog[open], [role="dialog"]');
|
|
67
|
+
return !a || a.contains(c.current);
|
|
44
68
|
}
|
|
45
|
-
})]),
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
|
|
49
|
-
}, [P]), n = x(() => {
|
|
50
|
-
g(!1);
|
|
51
|
-
}, [g]);
|
|
52
|
-
ge({
|
|
69
|
+
})]), s = d(() => {
|
|
70
|
+
P(!1);
|
|
71
|
+
}, [P]);
|
|
72
|
+
Be({
|
|
53
73
|
active: o,
|
|
54
|
-
requestClose:
|
|
74
|
+
requestClose: s,
|
|
55
75
|
ownerRef: c
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
76
|
+
}), v(() => {
|
|
77
|
+
if (!o || y) return;
|
|
78
|
+
const e = (t) => {
|
|
79
|
+
t.key !== "Escape" || t.defaultPrevented || t.isComposing || (t.preventDefault(), t.stopImmediatePropagation(), We(t));
|
|
80
|
+
};
|
|
81
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
82
|
+
}, [o, y]), qe(o && n && r !== null, c);
|
|
83
|
+
const [J, Re] = l(!1);
|
|
84
|
+
v(() => {
|
|
85
|
+
if (!r || n && !J) return;
|
|
60
86
|
const e = requestAnimationFrame(() => {
|
|
61
|
-
(
|
|
87
|
+
(n ? oe(r) : r)?.focus({ preventScroll: !0 });
|
|
62
88
|
});
|
|
63
89
|
return () => {
|
|
64
90
|
cancelAnimationFrame(e);
|
|
65
91
|
};
|
|
66
92
|
}, [
|
|
67
93
|
r,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
]),
|
|
71
|
-
if (!r
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
n,
|
|
95
|
+
J
|
|
96
|
+
]), v(() => {
|
|
97
|
+
if (!r) return;
|
|
98
|
+
let e = 0;
|
|
99
|
+
const t = () => {
|
|
100
|
+
cancelAnimationFrame(e), e = requestAnimationFrame(() => {
|
|
101
|
+
const i = document.activeElement;
|
|
102
|
+
if (!r.isConnected || i && i !== document.body && h(i)) return;
|
|
103
|
+
const T = Q.current;
|
|
104
|
+
(T?.isConnected && r.contains(T) ? T : oe(r) ?? r).focus({ preventScroll: !0 });
|
|
105
|
+
});
|
|
106
|
+
}, a = (i) => {
|
|
107
|
+
i.relatedTarget === null && s();
|
|
108
|
+
}, ee = (i) => {
|
|
109
|
+
i.relatedTarget === null && h(i.target) && t();
|
|
110
|
+
}, te = (i) => {
|
|
111
|
+
!r.isConnected || h(i.target) || (n ? t() : s());
|
|
75
112
|
};
|
|
76
|
-
return r.addEventListener("focusout",
|
|
77
|
-
r.removeEventListener("focusout",
|
|
113
|
+
return n ? document.addEventListener("focusout", ee) : r.addEventListener("focusout", a), document.addEventListener("focusin", te), () => {
|
|
114
|
+
cancelAnimationFrame(e), document.removeEventListener("focusout", ee), r.removeEventListener("focusout", a), document.removeEventListener("focusin", te);
|
|
78
115
|
};
|
|
79
116
|
}, [
|
|
80
117
|
r,
|
|
81
|
-
|
|
82
|
-
|
|
118
|
+
n,
|
|
119
|
+
s,
|
|
120
|
+
h
|
|
83
121
|
]);
|
|
84
|
-
const
|
|
85
|
-
|
|
122
|
+
const O = f(!1);
|
|
123
|
+
v(() => {
|
|
86
124
|
if (o) {
|
|
87
|
-
|
|
125
|
+
O.current = !0;
|
|
88
126
|
return;
|
|
89
127
|
}
|
|
90
|
-
if (!
|
|
91
|
-
|
|
92
|
-
const e =
|
|
128
|
+
if (!O.current) return;
|
|
129
|
+
O.current = !1;
|
|
130
|
+
const e = A.current;
|
|
93
131
|
if (!e) return;
|
|
94
|
-
const
|
|
132
|
+
const t = requestAnimationFrame(() => {
|
|
95
133
|
document.activeElement === document.body && e.focus();
|
|
96
134
|
});
|
|
97
135
|
return () => {
|
|
98
|
-
cancelAnimationFrame(
|
|
136
|
+
cancelAnimationFrame(t);
|
|
99
137
|
};
|
|
100
138
|
}, [o]);
|
|
101
|
-
const
|
|
102
|
-
ref:
|
|
139
|
+
const Z = {
|
|
140
|
+
ref: Pe,
|
|
103
141
|
isOpen: o,
|
|
104
142
|
triggerProps: {
|
|
105
143
|
onClick: (e) => {
|
|
106
144
|
if (o) {
|
|
107
|
-
|
|
145
|
+
s();
|
|
108
146
|
return;
|
|
109
147
|
}
|
|
110
|
-
|
|
148
|
+
ce(Se(e.currentTarget));
|
|
149
|
+
const t = e.currentTarget.getBoundingClientRect(), a = t.left + t.width / 2 > window.innerWidth / 2;
|
|
150
|
+
de($ === "auto" ? a ? "end" : "start" : $), U(void 0), Y(C), K(Math.round(window.innerHeight * ie)), Re(e.detail === 0), P(!0);
|
|
111
151
|
},
|
|
112
152
|
"aria-expanded": o,
|
|
113
|
-
"aria-controls": o ?
|
|
114
|
-
"aria-haspopup":
|
|
115
|
-
"aria-describedby": !
|
|
153
|
+
"aria-controls": o ? g : void 0,
|
|
154
|
+
"aria-haspopup": n ? "dialog" : void 0,
|
|
155
|
+
"aria-describedby": !n && o ? g : void 0
|
|
116
156
|
}
|
|
117
|
-
},
|
|
118
|
-
dataTest: `${
|
|
157
|
+
}, x = (e) => typeof e == "function" ? e({ close: s }) : e, be = De(E, 500), Fe = _ ?? (E === void 0 ? void 0 : /* @__PURE__ */ m(_e, {
|
|
158
|
+
dataTest: `${p}-view-results`,
|
|
119
159
|
type: "button",
|
|
120
160
|
variant: "text",
|
|
121
|
-
onClick:
|
|
122
|
-
children:
|
|
123
|
-
})),
|
|
124
|
-
return
|
|
125
|
-
id:
|
|
126
|
-
dataTest:
|
|
161
|
+
onClick: s,
|
|
162
|
+
children: $e(be)
|
|
163
|
+
})), Ae = u ? se : tt[I], Le = u ? se : void 0;
|
|
164
|
+
return y ? /* @__PURE__ */ re(ne, { children: [S(Z), /* @__PURE__ */ m(Ne, {
|
|
165
|
+
id: g,
|
|
166
|
+
dataTest: p,
|
|
127
167
|
open: o,
|
|
128
|
-
onClose:
|
|
168
|
+
onClose: s,
|
|
129
169
|
registerBackClose: !1,
|
|
130
170
|
ownerRef: c,
|
|
131
|
-
title:
|
|
132
|
-
ariaLabel:
|
|
133
|
-
viewResultsAction:
|
|
134
|
-
resetAction:
|
|
135
|
-
footerActions:
|
|
136
|
-
resultCount:
|
|
137
|
-
closeLabel:
|
|
138
|
-
className:
|
|
139
|
-
children:
|
|
140
|
-
})] }) : /* @__PURE__ */
|
|
141
|
-
root:
|
|
142
|
-
children: /* @__PURE__ */
|
|
143
|
-
...
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
"data-
|
|
148
|
-
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
171
|
+
title: w,
|
|
172
|
+
ariaLabel: B,
|
|
173
|
+
viewResultsAction: _,
|
|
174
|
+
resetAction: k,
|
|
175
|
+
footerActions: H,
|
|
176
|
+
resultCount: E,
|
|
177
|
+
closeLabel: W,
|
|
178
|
+
className: q,
|
|
179
|
+
children: M
|
|
180
|
+
})] }) : /* @__PURE__ */ re(ne, { children: [S(Z), o && /* @__PURE__ */ m(Ke, {
|
|
181
|
+
root: j,
|
|
182
|
+
children: /* @__PURE__ */ m("div", {
|
|
183
|
+
...Ee(),
|
|
184
|
+
onFocusCapture: xe,
|
|
185
|
+
ref: ye,
|
|
186
|
+
id: g,
|
|
187
|
+
"data-placement": z,
|
|
188
|
+
"data-test": p,
|
|
189
|
+
"data-testid": p,
|
|
190
|
+
role: n ? "dialog" : void 0,
|
|
191
|
+
"aria-labelledby": n && w ? X : void 0,
|
|
192
|
+
"aria-label": n && !w ? B : void 0,
|
|
193
|
+
tabIndex: n ? void 0 : -1,
|
|
194
|
+
...F ? Te : {},
|
|
153
195
|
style: {
|
|
154
|
-
...
|
|
155
|
-
|
|
156
|
-
minWidth:
|
|
157
|
-
width:
|
|
158
|
-
maxWidth:
|
|
159
|
-
maxHeight:
|
|
196
|
+
...F ? Ce : {},
|
|
197
|
+
...pe,
|
|
198
|
+
minWidth: u ? C : fe,
|
|
199
|
+
width: Le,
|
|
200
|
+
maxWidth: Ae,
|
|
201
|
+
maxHeight: le
|
|
160
202
|
},
|
|
161
|
-
className:
|
|
162
|
-
children: /* @__PURE__ */
|
|
203
|
+
className: Oe("z-[1300]", "relative box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[0px_4px_40px_0px_#22213366]", q),
|
|
204
|
+
children: /* @__PURE__ */ m(He.Provider, {
|
|
163
205
|
value: c,
|
|
164
|
-
children: /* @__PURE__ */
|
|
165
|
-
dataTest:
|
|
166
|
-
title:
|
|
167
|
-
titleId:
|
|
168
|
-
viewResultsAction:
|
|
169
|
-
resetAction:
|
|
170
|
-
footerActions:
|
|
171
|
-
closeLabel:
|
|
172
|
-
onClose:
|
|
173
|
-
children:
|
|
206
|
+
children: /* @__PURE__ */ m(Xe, {
|
|
207
|
+
dataTest: p,
|
|
208
|
+
title: w,
|
|
209
|
+
titleId: X,
|
|
210
|
+
viewResultsAction: x(Fe),
|
|
211
|
+
resetAction: x(k),
|
|
212
|
+
footerActions: x(H),
|
|
213
|
+
closeLabel: W,
|
|
214
|
+
onClose: s,
|
|
215
|
+
children: x(M)
|
|
174
216
|
})
|
|
175
217
|
})
|
|
176
218
|
})
|
|
177
219
|
})] });
|
|
178
220
|
};
|
|
179
221
|
export {
|
|
180
|
-
|
|
222
|
+
wt as PopoverSheet
|
|
181
223
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { tabbableWithin as p } from "../helpers/focusable.js";
|
|
2
2
|
import { useEffect as d, useRef as y } from "react";
|
|
3
|
-
var E = (c, i,
|
|
4
|
-
const f = y(
|
|
3
|
+
var E = (c, i, u) => {
|
|
4
|
+
const f = y(u);
|
|
5
5
|
d(() => {
|
|
6
|
-
f.current =
|
|
7
|
-
}, [
|
|
6
|
+
f.current = u;
|
|
7
|
+
}, [u]), d(() => {
|
|
8
8
|
if (!c) return;
|
|
9
9
|
const t = i.current;
|
|
10
10
|
if (!t) return;
|
|
@@ -17,14 +17,14 @@ var E = (c, i, s) => {
|
|
|
17
17
|
f.current?.();
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
if (e.key !== "Tab") return;
|
|
20
|
+
if (e.key !== "Tab" || e.defaultPrevented) return;
|
|
21
21
|
const r = p(t);
|
|
22
22
|
if (r.length === 0) {
|
|
23
23
|
e.preventDefault();
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
e.shiftKey && (o ===
|
|
26
|
+
const s = r[0], m = r[r.length - 1], o = document.activeElement;
|
|
27
|
+
e.shiftKey && (o === s || o === t) ? (e.preventDefault(), m?.focus()) : (!e.shiftKey && o === m || !e.shiftKey && o === t) && (e.preventDefault(), s?.focus());
|
|
28
28
|
};
|
|
29
29
|
return document.addEventListener("keydown", l), () => {
|
|
30
30
|
cancelAnimationFrame(b), document.removeEventListener("keydown", l), a === null ? t.removeAttribute("tabindex") : t.setAttribute("tabindex", a), requestAnimationFrame(() => {
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
2
|
export declare const FullScreenBtn: FC<{
|
|
3
3
|
fullScreen: boolean;
|
|
4
4
|
showFullScreenIcon: boolean;
|
|
5
5
|
tooltipTitle: string;
|
|
6
6
|
onClick: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* While set, the button is soft-disabled with this reason instead of being taken away — a dialog
|
|
9
|
+
* that only exists in fullscreen still shows its exit control, says why it cannot be used and
|
|
10
|
+
* stays focusable. Same contract as `CloseBtn`'s: `StyledButton` renders `aria-disabled`, the
|
|
11
|
+
* not-allowed cursor and the reason on hover, focus and tap.
|
|
12
|
+
*/
|
|
13
|
+
disabledReason?: ReactNode;
|
|
7
14
|
}>;
|
|
@@ -44,8 +44,26 @@ export interface IMinimizableDialogProps {
|
|
|
44
44
|
footerClassName?: string;
|
|
45
45
|
footerInfo?: ReactNode;
|
|
46
46
|
enableFullscreen?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Why fullscreen cannot be left, for a dialog that only ever runs fullscreen.
|
|
49
|
+
*
|
|
50
|
+
* While set, the fullscreen toggle is **shown disabled** with this reason rather than hidden:
|
|
51
|
+
* the header's minimize / fullscreen / close triad is a place people have learned, so a control
|
|
52
|
+
* missing from it reads as "this dialog cannot do that" instead of "not here, and here is why"
|
|
53
|
+
* (hide-or-disable HOD-4, disabled-states DIS-1/2/3). `StyledButton` keeps it focusable with
|
|
54
|
+
* `aria-disabled` and opens the reason on hover, focus and tap.
|
|
55
|
+
*
|
|
56
|
+
* App-owned and localized: shared components render no default reason, so leaving this unset
|
|
57
|
+
* keeps today's behaviour.
|
|
58
|
+
*/
|
|
59
|
+
fullscreenLockedReason?: ReactNode;
|
|
47
60
|
fullScreenState?: boolean;
|
|
48
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Called with the state being asked for, mirroring `handleMinimizedState`. A zero-argument
|
|
63
|
+
* toggle stays valid — TypeScript accepts the narrower signature, and the extra argument is
|
|
64
|
+
* ignored at runtime — so existing consumers need no change.
|
|
65
|
+
*/
|
|
66
|
+
handleFullScreenState?: (fullScreen: boolean) => void;
|
|
49
67
|
locale?: 'no' | 'en';
|
|
50
68
|
dataTest: string;
|
|
51
69
|
}
|
|
@@ -42,6 +42,24 @@ export interface IMinimizableDialogV2Props {
|
|
|
42
42
|
minimizedState?: boolean;
|
|
43
43
|
handleMinimizedState?: (minimized: boolean) => void;
|
|
44
44
|
enableFullscreen?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Why fullscreen cannot be left, for a dialog that only ever runs fullscreen.
|
|
47
|
+
*
|
|
48
|
+
* While set, the fullscreen toggle is **shown disabled** with this reason rather than hidden:
|
|
49
|
+
* the header's minimize / fullscreen / close triad is a place people have learned, so a control
|
|
50
|
+
* missing from it reads as "this dialog cannot do that" instead of "not here, and here is why"
|
|
51
|
+
* (hide-or-disable HOD-4, disabled-states DIS-1/2/3). `StyledButton` keeps it focusable with
|
|
52
|
+
* `aria-disabled` and opens the reason on hover, focus and tap.
|
|
53
|
+
*
|
|
54
|
+
* App-owned and localized: shared components render no default reason, so leaving this unset
|
|
55
|
+
* keeps today's behaviour.
|
|
56
|
+
*/
|
|
57
|
+
fullscreenLockedReason?: ReactNode;
|
|
45
58
|
fullScreenState?: boolean;
|
|
46
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Called with the state being asked for, mirroring `handleMinimizedState`. A zero-argument
|
|
61
|
+
* toggle stays valid — TypeScript accepts the narrower signature, and the extra argument is
|
|
62
|
+
* ignored at runtime — so existing consumers need no change.
|
|
63
|
+
*/
|
|
64
|
+
handleFullScreenState?: (fullScreen: boolean) => void;
|
|
47
65
|
}
|
|
@@ -9,13 +9,18 @@ import { ReactNode } from 'react';
|
|
|
9
9
|
* 40px body padding) needs the full 472px of the frame — with a border only 470px remain and the
|
|
10
10
|
* pair wraps. Figma's stroke takes no width from autolayout, and the inset shadow matches that.
|
|
11
11
|
*
|
|
12
|
+
* The ring is not on this surface itself: an element's own inset shadow paints beneath its
|
|
13
|
+
* children, so the Close button's hover fill in the top-right corner covered it. `PopoverAnatomy`
|
|
14
|
+
* draws it as its last, absolutely positioned layer (`SURFACE_EDGE_CLASSNAME`), above the content.
|
|
15
|
+
* `relative` makes the surface that layer's containing block where no floating position is set.
|
|
16
|
+
*
|
|
12
17
|
* `box-border` is load-bearing, not noise: this package builds Tailwind with `preflight: false`, so
|
|
13
18
|
* without it `box-sizing` falls back to `content-box` and a 472px max-width renders 474.
|
|
14
19
|
*
|
|
15
20
|
* Positioning (`z-index`, the floating transform, the top-layer props) deliberately stays with the
|
|
16
21
|
* caller, so the Gallery story can render the same surface statically in a grid.
|
|
17
22
|
*/
|
|
18
|
-
export declare const POPOVER_SURFACE_CLASSNAME = "box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[
|
|
23
|
+
export declare const POPOVER_SURFACE_CLASSNAME = "relative box-border flex flex-col overflow-hidden rounded-lg bg-white text-delta-700 outline-none shadow-[0px_4px_40px_0px_#22213366]";
|
|
19
24
|
export interface PopoverAnatomyProps {
|
|
20
25
|
dataTest: string;
|
|
21
26
|
title?: ReactNode;
|
|
@@ -60,6 +60,18 @@ export interface PopoverSheetProps {
|
|
|
60
60
|
onOpenChange?: (isOpen: boolean) => void;
|
|
61
61
|
/** @figmaProp none — style escape hatch, applied to the surface */
|
|
62
62
|
className?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Which trigger edge the surface lines up with. `auto` picks once per open: `end` when the
|
|
65
|
+
* trigger's centre is in the right half of the viewport, otherwise `start`.
|
|
66
|
+
* @figmaProp none — behavioral
|
|
67
|
+
*/
|
|
68
|
+
align?: 'start' | 'end' | 'auto';
|
|
69
|
+
/**
|
|
70
|
+
* CSS selectors for overlays rendered outside React (e.g. DevExtreme's `.dx-overlay-wrapper`).
|
|
71
|
+
* Pressing or focusing inside them counts as inside the surface.
|
|
72
|
+
* @figmaProp none — behavioral
|
|
73
|
+
*/
|
|
74
|
+
ignoreOutside?: string[];
|
|
63
75
|
}
|
|
64
76
|
/**
|
|
65
77
|
* ASMA Design System **Popover** (ASMA-8183) — an anchored overlay with the DS surface, an optional
|
|
@@ -83,4 +95,4 @@ export interface PopoverSheetProps {
|
|
|
83
95
|
* Separate from {@link StyledPopover}, which stays as the MUI-parity positioning primitive its eight
|
|
84
96
|
* internal consumers still depend on; those migrate here gradually.
|
|
85
97
|
*/
|
|
86
|
-
export declare const PopoverSheet: ({ dataTest, renderTrigger, variant, title, children, viewResultsAction, resetAction, footerActions, resultCount, closeLabel, ariaLabel, onOpenChange, className, }: PopoverSheetProps) => JSX.Element;
|
|
98
|
+
export declare const PopoverSheet: ({ dataTest, renderTrigger, variant, title, children, viewResultsAction, resetAction, footerActions, resultCount, closeLabel, ariaLabel, onOpenChange, className, align, ignoreOutside, }: PopoverSheetProps) => JSX.Element;
|