asma-ui-core 3.134.0 → 3.134.2
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/dialog/StyledDialog.js +177 -149
- package/dist/components/feedback/dialog/StyledDialog.module.js +1 -1
- package/dist/components/feedback/dialog/StyledDialogActions.js +4 -3
- package/dist/components/feedback/dialog/StyledDialogContent.js +9 -8
- package/dist/components/feedback/dialog/StyledDialogTitle.js +23 -21
- package/dist/components/feedback/dialog/dialog-footer/StyledDialogFooter.js +1 -0
- package/dist/components/feedback/dialog/dialogHeaderStyles.js +7 -0
- package/dist/components/feedback/dialog/useDialogHeaderPinning.js +56 -0
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +203 -182
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +148 -133
- package/dist/components/inputs/full-screen-picker/FullScreenPicker.js +1 -1
- package/dist/components/inputs/full-screen-picker/useReleaseFieldOnKeyboardDismiss.js +13 -12
- package/dist/components/inputs/input-field/StyledInputField.js +139 -136
- package/dist/hooks/useElementHeightPx.js +26 -0
- package/dist/hooks/useLayoutViewportHeight.js +5 -0
- package/dist/hooks/useMediaQuery.hook.js +9 -8
- package/dist/hooks/useOnScreenKeyboard.js +24 -0
- package/dist/index.js +366 -352
- package/dist/src/components/feedback/dialog/StyledDialog.d.ts +4 -3
- package/dist/src/components/feedback/dialog/StyledDialogTitle.d.ts +4 -0
- package/dist/src/components/feedback/dialog/dialogHeaderStyles.d.ts +28 -0
- package/dist/src/components/feedback/dialog/dialogTitleContext.d.ts +5 -0
- package/dist/src/components/feedback/dialog/useDialogHeaderPinning.d.ts +33 -0
- package/dist/src/hooks/useElementHeightPx.d.ts +16 -0
- package/dist/src/hooks/useLayoutViewportHeight.d.ts +6 -0
- package/dist/src/hooks/useMediaQuery.hook.d.ts +6 -0
- package/dist/src/hooks/useOnScreenKeyboard.d.ts +21 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/table/components/StyledTableIndex.js +5 -5
- package/package.json +1 -1
- package/dist/src/table/components/columns/helpers/useElementHeightPx.d.ts +0 -7
- package/dist/table/components/columns/helpers/useElementHeightPx.js +0 -26
- /package/dist/{components/inputs/full-screen-picker → hooks}/useVisualViewportHeight.js +0 -0
- /package/dist/src/{components/inputs/full-screen-picker → hooks}/useVisualViewportHeight.d.ts +0 -0
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { firstTabbable as
|
|
3
|
-
import { StyledTooltip as
|
|
4
|
-
import { DialogBusyContext as
|
|
5
|
-
import { OverlayBackOwnerContext as
|
|
6
|
-
import { useFocusTrap as
|
|
7
|
-
import { useMobileMediaQuery as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { cn as u } from "../../../../helpers/cn.js";
|
|
2
|
+
import { firstTabbable as q } from "../../../../helpers/focusable.js";
|
|
3
|
+
import { StyledTooltip as de } from "../../../data-display/tooltip/StyledTooltip.js";
|
|
4
|
+
import { DialogBusyContext as V, useDialogBusyBoundary as ce } from "../../dialog/DialogBusyContext.js";
|
|
5
|
+
import { OverlayBackOwnerContext as me, isOverlayBackNavigationPending as ue, useBackCloses as fe } from "../../../../hooks/useBackCloses.hook.js";
|
|
6
|
+
import { useFocusTrap as pe } from "../../../../hooks/useFocusTrap.hook.js";
|
|
7
|
+
import { useMobileMediaQuery as ve } from "../../../../hooks/useMediaQuery.hook.js";
|
|
8
|
+
import { useDialogHeaderPinning as he } from "../../dialog/useDialogHeaderPinning.js";
|
|
9
|
+
import { DIALOG_HEADER_ACTIONS_ROW_CLASSES as xe, DIALOG_HEADER_CLASSES as ge, DIALOG_TITLE_CLASSES as be, dialogContentFlowClasses as ye } from "../../dialog/dialogHeaderStyles.js";
|
|
10
|
+
import { fullScreenFieldWidthVars as we } from "../../../inputs/field-styles.js";
|
|
11
|
+
import { CloseBtn as W } from "../components/CloseBtn.js";
|
|
10
12
|
import { MinimizeBtn as $ } from "../components/MinimizeBtn.js";
|
|
11
|
-
import { FullScreenBtn as
|
|
12
|
-
import
|
|
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 { FullScreenBtn as Ce } from "../components/FullscreenBtn.js";
|
|
14
|
+
import f from "./MinimizableDialogV2.module.js";
|
|
15
|
+
import { useTranslations as ze } from "./useTranslations.js";
|
|
16
|
+
import { useControlledProps as Re } from "./useControlledProps.js";
|
|
17
|
+
import Se from "clsx";
|
|
18
|
+
import { useId as G, useLayoutEffect as Q, useRef as l } from "react";
|
|
19
|
+
import { Fragment as Ne, jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
20
|
+
var Ue = (S) => {
|
|
21
|
+
const { showCloseIcon: N = !0, showMinimizeIcon: U = !0, showExpandIcon: J = !0, enableFullscreen: K = !0, fullscreenLockedReason: B, title: p, label: v, children: X, open: i, onClose: Y, classNameOverrides: h = {
|
|
20
22
|
maximized: "",
|
|
21
23
|
minimized: "",
|
|
22
24
|
fullscreen: ""
|
|
23
|
-
}, dataTest:
|
|
24
|
-
if (
|
|
25
|
-
|
|
25
|
+
}, dataTest: Z, actionNode: ee, locale: te = "en", busyReason: ie, style: I, initialFocusRef: _ } = S, x = ve(), o = ze(te), n = l(null), c = l(null), k = l(null), E = l(null), g = l(!1), b = l(null), y = G(), F = G(), T = l(null), { headerRef: oe, pinned: w, hidden: C, scrollPaddingTop: ne, scrollPaddingBottom: le } = he(T), { minimized: t, setMinimized: A, fullScreen: a, setFullScreen: D } = Re(S), s = a && !t, L = !!B, { busy: z, busyReason: O, contextValue: M } = ce(ie ?? o.waitUntilSaved), m = () => {
|
|
26
|
+
if (z) return !1;
|
|
27
|
+
A(!1), Y();
|
|
26
28
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, [t]),
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
|
|
29
|
+
Q(() => {
|
|
30
|
+
n.current?.toggleAttribute("inert", t), c.current?.toggleAttribute("inert", !t);
|
|
31
|
+
}, [t]), Q(() => {
|
|
32
|
+
const R = i && !g.current, d = !i && g.current;
|
|
33
|
+
if (g.current = i, d) {
|
|
34
|
+
const H = b.current;
|
|
35
|
+
b.current = null, (!document.activeElement || document.activeElement === document.body) && H?.isConnected && H.focus({ preventScroll: !0 });
|
|
34
36
|
return;
|
|
35
37
|
}
|
|
36
|
-
if (!
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
(
|
|
38
|
+
if (!R) return;
|
|
39
|
+
b.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
40
|
+
const j = t ? c.current : n.current, se = t ? E.current : k.current;
|
|
41
|
+
(_?.current ?? se ?? (j ? q(j) : void 0))?.focus({ preventScroll: !0 });
|
|
40
42
|
}, [
|
|
41
|
-
|
|
43
|
+
_,
|
|
42
44
|
t,
|
|
43
|
-
|
|
45
|
+
i
|
|
44
46
|
]);
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const d =
|
|
49
|
-
d && (d.querySelector('[data-testid="toggle-minimize-btn"]') ??
|
|
47
|
+
const P = () => {
|
|
48
|
+
const R = t ? n : c;
|
|
49
|
+
A(!t), requestAnimationFrame(() => {
|
|
50
|
+
const d = R.current;
|
|
51
|
+
d && (d.querySelector('[data-testid="toggle-minimize-btn"]') ?? q(d))?.focus({ preventScroll: !0 });
|
|
50
52
|
});
|
|
51
53
|
};
|
|
52
|
-
|
|
53
|
-
active:
|
|
54
|
-
requestClose: () => !
|
|
55
|
-
ownerRef:
|
|
54
|
+
pe(i && s, n, m), fe({
|
|
55
|
+
active: i && !t,
|
|
56
|
+
requestClose: () => !s && ue() ? !1 : m(),
|
|
57
|
+
ownerRef: n
|
|
56
58
|
});
|
|
57
|
-
const
|
|
59
|
+
const re = s ? x ? {
|
|
58
60
|
inset: 0,
|
|
59
61
|
maxHeight: "100dvh",
|
|
60
62
|
maxWidth: "100dvw",
|
|
@@ -70,126 +72,139 @@ var Pe = (C) => {
|
|
|
70
72
|
width: "min(1000px, calc(100vw - 32px))",
|
|
71
73
|
maxWidth: "min(1000px, calc(100vw - 32px))",
|
|
72
74
|
height: "95dvh",
|
|
73
|
-
...
|
|
75
|
+
...we
|
|
74
76
|
} : void 0;
|
|
75
|
-
if (!
|
|
76
|
-
const
|
|
77
|
-
return /* @__PURE__ */
|
|
77
|
+
if (!i) return null;
|
|
78
|
+
const ae = v ? `${F} ${y}` : y;
|
|
79
|
+
return /* @__PURE__ */ r(Ne, { children: [
|
|
78
80
|
/* @__PURE__ */ e("div", {
|
|
79
|
-
ref:
|
|
81
|
+
ref: c,
|
|
80
82
|
style: {
|
|
81
83
|
zIndex: 51,
|
|
82
|
-
...
|
|
84
|
+
...I
|
|
83
85
|
},
|
|
84
|
-
className:
|
|
85
|
-
children: /* @__PURE__ */
|
|
86
|
-
className:
|
|
87
|
-
"data-testid":
|
|
86
|
+
className: u(f["minimized-dialog"], !t && f.hidden, h.minimized),
|
|
87
|
+
children: /* @__PURE__ */ r("div", {
|
|
88
|
+
className: Se("flex items-center justify-between", !t && "hidden"),
|
|
89
|
+
"data-testid": Z,
|
|
88
90
|
children: [/* @__PURE__ */ e("div", {
|
|
89
|
-
className:
|
|
90
|
-
children: /* @__PURE__ */ e(
|
|
91
|
-
title:
|
|
91
|
+
className: "min-w-0 max-w-[303px] truncate pr-1 text-lg font-semibold text-delta-800",
|
|
92
|
+
children: /* @__PURE__ */ e(de, {
|
|
93
|
+
title: p,
|
|
92
94
|
placement: "top",
|
|
93
95
|
children: /* @__PURE__ */ e("div", {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
tabIndex: 0,
|
|
97
|
+
"data-testid": "minimized-title",
|
|
98
|
+
className: "truncate focus-visible:[outline-offset:-2px]",
|
|
99
|
+
children: p
|
|
96
100
|
})
|
|
97
101
|
})
|
|
98
|
-
}), /* @__PURE__ */
|
|
102
|
+
}), /* @__PURE__ */ r("div", {
|
|
99
103
|
className: "flex items-center gap-x-1",
|
|
100
104
|
children: [/* @__PURE__ */ e($, {
|
|
101
105
|
type: "expand",
|
|
102
|
-
visibility:
|
|
103
|
-
onClick:
|
|
104
|
-
tooltipTitle:
|
|
105
|
-
}), /* @__PURE__ */ e(
|
|
106
|
-
buttonRef:
|
|
107
|
-
showCloseIcon:
|
|
108
|
-
onClick:
|
|
109
|
-
disabledReason:
|
|
110
|
-
tooltipTitle:
|
|
106
|
+
visibility: J,
|
|
107
|
+
onClick: P,
|
|
108
|
+
tooltipTitle: o.expand
|
|
109
|
+
}), /* @__PURE__ */ e(W, {
|
|
110
|
+
buttonRef: E,
|
|
111
|
+
showCloseIcon: N,
|
|
112
|
+
onClick: m,
|
|
113
|
+
disabledReason: z ? O : void 0,
|
|
114
|
+
tooltipTitle: o.close
|
|
111
115
|
})]
|
|
112
116
|
})]
|
|
113
117
|
})
|
|
114
118
|
}),
|
|
115
|
-
|
|
119
|
+
s && /* @__PURE__ */ e("div", {
|
|
116
120
|
className: "fixed inset-0 z-[52] bg-[rgb(98,110,126)] bg-opacity-70",
|
|
117
121
|
onClick: () => {
|
|
118
|
-
|
|
122
|
+
L || D(!1);
|
|
119
123
|
}
|
|
120
124
|
}),
|
|
121
125
|
/* @__PURE__ */ e("div", {
|
|
122
126
|
style: {
|
|
123
127
|
zIndex: 51,
|
|
124
|
-
...
|
|
125
|
-
...
|
|
128
|
+
...I,
|
|
129
|
+
...re
|
|
126
130
|
},
|
|
127
|
-
ref:
|
|
131
|
+
ref: n,
|
|
128
132
|
role: "dialog",
|
|
129
|
-
"aria-modal":
|
|
130
|
-
"aria-labelledby":
|
|
131
|
-
className:
|
|
132
|
-
children: /* @__PURE__ */
|
|
133
|
-
value:
|
|
134
|
-
children:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
133
|
+
"aria-modal": s ? !0 : void 0,
|
|
134
|
+
"aria-labelledby": ae,
|
|
135
|
+
className: u(f.dialog, t && f.hidden, !a && h.maximized, a && h.fullscreen, s && "fixed z-[53] duration-0"),
|
|
136
|
+
children: /* @__PURE__ */ e(me.Provider, {
|
|
137
|
+
value: n,
|
|
138
|
+
children: /* @__PURE__ */ r("div", {
|
|
139
|
+
ref: T,
|
|
140
|
+
"data-dialog-body": "",
|
|
141
|
+
className: u(t && "hidden", "flex min-h-0 flex-grow flex-col overflow-y-auto overscroll-contain", "[&>[data-dialog-content-flow]>[data-dialog-content]]:!flex-[1_0_auto]", "[&_[data-dialog-footer]]:sticky [&_[data-dialog-footer]]:bottom-0 [&_[data-dialog-footer]]:z-[2] [&_[data-dialog-footer]]:bg-white"),
|
|
142
|
+
style: {
|
|
143
|
+
scrollPaddingTop: ne,
|
|
144
|
+
scrollPaddingBottom: le
|
|
145
|
+
},
|
|
146
|
+
children: [/* @__PURE__ */ r("div", {
|
|
147
|
+
ref: oe,
|
|
148
|
+
"data-dialog-header": "",
|
|
149
|
+
"data-header-pinned": w ? "true" : "false",
|
|
150
|
+
"aria-hidden": C || void 0,
|
|
151
|
+
hidden: C,
|
|
152
|
+
className: u(ge, "border-b-[1px] border-delta-200 sm:rounded-t-lg", w && "sticky top-0 z-[2]", C && "hidden"),
|
|
153
|
+
children: [/* @__PURE__ */ r("div", {
|
|
154
|
+
className: xe,
|
|
155
|
+
children: [v && /* @__PURE__ */ e("div", {
|
|
156
|
+
id: F,
|
|
157
|
+
className: "min-w-0 flex-auto hyphens-auto text-sm text-delta-700 [overflow-wrap:anywhere]",
|
|
158
|
+
children: v
|
|
159
|
+
}), /* @__PURE__ */ r("div", {
|
|
160
|
+
className: "ml-auto flex items-center gap-x-1 max-xs:flex-wrap max-xs:justify-end max-xs:gap-y-2",
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ e(V.Provider, {
|
|
163
|
+
value: M,
|
|
164
|
+
children: ee
|
|
165
|
+
}),
|
|
166
|
+
/* @__PURE__ */ e($, {
|
|
167
|
+
visibility: U && !x,
|
|
168
|
+
type: "minimize",
|
|
169
|
+
onClick: P,
|
|
170
|
+
tooltipTitle: o.minimize
|
|
171
|
+
}),
|
|
172
|
+
/* @__PURE__ */ e(Ce, {
|
|
173
|
+
showFullScreenIcon: (K || L) && !x,
|
|
174
|
+
disabledReason: B,
|
|
175
|
+
fullScreen: a,
|
|
176
|
+
onClick: () => {
|
|
177
|
+
D(!a);
|
|
178
|
+
},
|
|
179
|
+
tooltipTitle: a ? o.exitFullscreen : o.fullscreen
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ e(W, {
|
|
182
|
+
buttonRef: k,
|
|
183
|
+
showCloseIcon: N,
|
|
184
|
+
onClick: m,
|
|
185
|
+
disabledReason: z ? O : void 0,
|
|
186
|
+
tooltipTitle: o.close
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
})]
|
|
190
|
+
}), /* @__PURE__ */ e("div", {
|
|
191
|
+
id: y,
|
|
192
|
+
className: be,
|
|
193
|
+
children: p
|
|
176
194
|
})]
|
|
177
|
-
}),
|
|
178
|
-
|
|
179
|
-
className:
|
|
180
|
-
children:
|
|
195
|
+
}), /* @__PURE__ */ e("div", {
|
|
196
|
+
"data-dialog-content-flow": "",
|
|
197
|
+
className: ye(w),
|
|
198
|
+
children: /* @__PURE__ */ e(V.Provider, {
|
|
199
|
+
value: M,
|
|
200
|
+
children: X
|
|
201
|
+
})
|
|
181
202
|
})]
|
|
182
|
-
})
|
|
183
|
-
className: n(t && "hidden", "flex flex-grow flex-col overflow-y-auto overscroll-contain"),
|
|
184
|
-
children: /* @__PURE__ */ e(L.Provider, {
|
|
185
|
-
value: P,
|
|
186
|
-
children: G
|
|
187
|
-
})
|
|
188
|
-
})]
|
|
203
|
+
})
|
|
189
204
|
})
|
|
190
205
|
})
|
|
191
206
|
] });
|
|
192
207
|
};
|
|
193
208
|
export {
|
|
194
|
-
|
|
209
|
+
Ue as MinimizableDialogV2
|
|
195
210
|
};
|
|
@@ -5,7 +5,7 @@ import { usePickerOneRowHeaderMediaQuery as N } from "../../../hooks/useMediaQue
|
|
|
5
5
|
import { StyledDialog as S } from "../../feedback/dialog/StyledDialog.js";
|
|
6
6
|
import { PickerLiveRegion as R } from "./PickerLiveRegion.js";
|
|
7
7
|
import { useReleaseFieldOnKeyboardDismiss as I } from "./useReleaseFieldOnKeyboardDismiss.js";
|
|
8
|
-
import { useVisualViewportHeight as F } from "
|
|
8
|
+
import { useVisualViewportHeight as F } from "../../../hooks/useVisualViewportHeight.js";
|
|
9
9
|
import { useEffect as x, useRef as p } from "react";
|
|
10
10
|
import { jsx as e, jsxs as m } from "react/jsx-runtime";
|
|
11
11
|
var E = ({ open: i, onClose: o, dataTest: l, title: r, fallbackName: n, ...c }) => {
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import { isTextField as a, isVisualViewportShrunkByKeyboard as d } from "../../../hooks/useOnScreenKeyboard.js";
|
|
1
2
|
import { useEffect as c } from "react";
|
|
2
|
-
var
|
|
3
|
+
var p = (t) => {
|
|
3
4
|
c(() => {
|
|
4
|
-
const
|
|
5
|
-
if (!
|
|
6
|
-
let
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
|
|
5
|
+
const e = window.visualViewport;
|
|
6
|
+
if (!e) return;
|
|
7
|
+
let i = d(e);
|
|
8
|
+
const r = () => {
|
|
9
|
+
const o = d(e), l = i && !o;
|
|
10
|
+
if (i = o, !l) return;
|
|
11
|
+
const s = t.current?.closest("dialog"), n = document.activeElement;
|
|
12
|
+
s && a(n) && s.contains(n) && s.focus({ preventScroll: !0 });
|
|
12
13
|
};
|
|
13
|
-
return
|
|
14
|
-
}, [
|
|
14
|
+
return e.addEventListener("resize", r), () => e.removeEventListener("resize", r);
|
|
15
|
+
}, [t]);
|
|
15
16
|
};
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
p as useReleaseFieldOnKeyboardDismiss
|
|
18
19
|
};
|