asma-ui-core 3.134.1 → 3.134.3
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 +174 -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 +13 -0
- package/dist/components/feedback/dialog/useDialogHeaderPinning.js +56 -0
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +200 -182
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +143 -131
- package/dist/components/inputs/full-screen-picker/FullScreenPicker.js +1 -1
- package/dist/components/inputs/full-screen-picker/useReleaseFieldOnKeyboardDismiss.js +13 -12
- 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 +39 -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, dialogScrollerStyle as we } from "../../dialog/dialogHeaderStyles.js";
|
|
10
|
+
import { fullScreenFieldWidthVars as Ce } 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 Se } 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 Ne from "clsx";
|
|
18
|
+
import { useId as G, useLayoutEffect as Q, useRef as l } from "react";
|
|
19
|
+
import { Fragment as Be, jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
20
|
+
var Je = (R) => {
|
|
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: _ } = R, 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(R), s = a && !t, L = !!B, { busy: S, busyReason: O, contextValue: M } = ce(ie ?? o.waitUntilSaved), m = () => {
|
|
26
|
+
if (S) return !1;
|
|
27
|
+
A(!1), Y();
|
|
26
28
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}, [t]),
|
|
30
|
-
const z =
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
|
|
29
|
+
Q(() => {
|
|
30
|
+
n.current?.toggleAttribute("inert", t), c.current?.toggleAttribute("inert", !t);
|
|
31
|
+
}, [t]), Q(() => {
|
|
32
|
+
const z = 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
38
|
if (!z) return;
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
(
|
|
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 z = t ?
|
|
47
|
-
|
|
47
|
+
const P = () => {
|
|
48
|
+
const z = t ? n : c;
|
|
49
|
+
A(!t), requestAnimationFrame(() => {
|
|
48
50
|
const d = z.current;
|
|
49
|
-
d && (d.querySelector('[data-testid="toggle-minimize-btn"]') ??
|
|
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,136 @@ 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
|
+
...Ce
|
|
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(Be, { 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: Ne("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: S ? 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
|
-
className:
|
|
148
|
-
children: [
|
|
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: we(ne, le),
|
|
143
|
+
children: [/* @__PURE__ */ r("div", {
|
|
144
|
+
ref: oe,
|
|
145
|
+
"data-dialog-header": "",
|
|
146
|
+
"data-header-pinned": w ? "true" : "false",
|
|
147
|
+
"aria-hidden": C || void 0,
|
|
148
|
+
hidden: C,
|
|
149
|
+
className: u(ge, "border-b-[1px] border-delta-200 sm:rounded-t-lg", w && "sticky top-0 z-[2]", C && "hidden"),
|
|
150
|
+
children: [/* @__PURE__ */ r("div", {
|
|
151
|
+
className: xe,
|
|
152
|
+
children: [v && /* @__PURE__ */ e("div", {
|
|
153
|
+
id: F,
|
|
154
|
+
className: "min-w-0 flex-auto hyphens-auto text-sm text-delta-700 [overflow-wrap:anywhere]",
|
|
155
|
+
children: v
|
|
156
|
+
}), /* @__PURE__ */ r("div", {
|
|
157
|
+
className: "ml-auto flex items-center gap-x-1 max-xs:flex-wrap max-xs:justify-end max-xs:gap-y-2",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ e(V.Provider, {
|
|
160
|
+
value: M,
|
|
161
|
+
children: ee
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ e($, {
|
|
164
|
+
visibility: U && !x,
|
|
165
|
+
type: "minimize",
|
|
166
|
+
onClick: P,
|
|
167
|
+
tooltipTitle: o.minimize
|
|
168
|
+
}),
|
|
169
|
+
/* @__PURE__ */ e(Se, {
|
|
170
|
+
showFullScreenIcon: (K || L) && !x,
|
|
171
|
+
disabledReason: B,
|
|
172
|
+
fullScreen: a,
|
|
173
|
+
onClick: () => {
|
|
174
|
+
D(!a);
|
|
175
|
+
},
|
|
176
|
+
tooltipTitle: a ? o.exitFullscreen : o.fullscreen
|
|
177
|
+
}),
|
|
178
|
+
/* @__PURE__ */ e(W, {
|
|
179
|
+
buttonRef: k,
|
|
180
|
+
showCloseIcon: N,
|
|
181
|
+
onClick: m,
|
|
182
|
+
disabledReason: S ? O : void 0,
|
|
183
|
+
tooltipTitle: o.close
|
|
184
|
+
})
|
|
185
|
+
]
|
|
186
|
+
})]
|
|
187
|
+
}), /* @__PURE__ */ e("div", {
|
|
188
|
+
id: y,
|
|
189
|
+
className: be,
|
|
190
|
+
children: p
|
|
176
191
|
})]
|
|
177
|
-
}),
|
|
178
|
-
|
|
179
|
-
className:
|
|
180
|
-
children:
|
|
192
|
+
}), /* @__PURE__ */ e("div", {
|
|
193
|
+
"data-dialog-content-flow": "",
|
|
194
|
+
className: ye(w),
|
|
195
|
+
children: /* @__PURE__ */ e(V.Provider, {
|
|
196
|
+
value: M,
|
|
197
|
+
children: X
|
|
198
|
+
})
|
|
181
199
|
})]
|
|
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
|
-
})]
|
|
200
|
+
})
|
|
189
201
|
})
|
|
190
202
|
})
|
|
191
203
|
] });
|
|
192
204
|
};
|
|
193
205
|
export {
|
|
194
|
-
|
|
206
|
+
Je as MinimizableDialogV2
|
|
195
207
|
};
|
|
@@ -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
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useCallback as h, useLayoutEffect as d, useState as s } from "react";
|
|
2
|
+
var g = (n) => Math.round(n.getBoundingClientRect().height);
|
|
3
|
+
function b(n = g) {
|
|
4
|
+
const [t, a] = s(null), [u, l] = s(0), m = h((e) => a(e), []);
|
|
5
|
+
return d(() => {
|
|
6
|
+
if (!t) return;
|
|
7
|
+
let e = 0;
|
|
8
|
+
const o = () => {
|
|
9
|
+
const i = n(t);
|
|
10
|
+
i !== null && l((c) => c === i ? c : i);
|
|
11
|
+
}, f = () => {
|
|
12
|
+
cancelAnimationFrame(e), e = requestAnimationFrame(o);
|
|
13
|
+
};
|
|
14
|
+
if (o(), typeof ResizeObserver > "u") return () => cancelAnimationFrame(e);
|
|
15
|
+
const r = new ResizeObserver(f);
|
|
16
|
+
return r.observe(t), () => {
|
|
17
|
+
cancelAnimationFrame(e), r.disconnect();
|
|
18
|
+
};
|
|
19
|
+
}, [t, n]), {
|
|
20
|
+
ref: m,
|
|
21
|
+
heightPx: t ? u : 0
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
b as useElementHeightPx
|
|
26
|
+
};
|
|
@@ -3,24 +3,25 @@ function e(t) {
|
|
|
3
3
|
function i() {
|
|
4
4
|
return window.matchMedia(t).matches;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
return
|
|
9
|
-
|
|
6
|
+
function n(r) {
|
|
7
|
+
const a = window.matchMedia(t);
|
|
8
|
+
return a.addEventListener("change", r), () => {
|
|
9
|
+
a.removeEventListener("change", r);
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
function u() {
|
|
13
13
|
return !1;
|
|
14
14
|
}
|
|
15
15
|
return function() {
|
|
16
|
-
return o(
|
|
16
|
+
return o(n, i, u);
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
var h = e("(max-width: 743px)"), s = e("not all and (min-width: 320px)"),
|
|
19
|
+
var h = e("(max-width: 743px)"), s = e("not all and (min-width: 320px)"), m = e("(max-height: 480px)"), x = e("(max-height: 30em)"), c = e("(max-height: 480px) and (min-width: 480px)"), p = e("(max-width: 743px), (max-height: 480px)");
|
|
20
20
|
export {
|
|
21
|
-
|
|
21
|
+
p as useFullScreenPickerMediaQuery,
|
|
22
22
|
s as useMaxXsMediaQuery,
|
|
23
23
|
h as useMobileMediaQuery,
|
|
24
24
|
c as usePickerOneRowHeaderMediaQuery,
|
|
25
|
-
x as
|
|
25
|
+
x as useShortScreenMediaQuery,
|
|
26
|
+
m as useShortViewportMediaQuery
|
|
26
27
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useSyncExternalStore as t } from "react";
|
|
2
|
+
var r = 150, i = (e = typeof window > "u" ? void 0 : window.visualViewport) => !!e && window.innerHeight - e.height * e.scale >= r, o = (e) => typeof HTMLElement > "u" || !(e instanceof HTMLElement) || e.inputMode === "none" ? !1 : e instanceof HTMLTextAreaElement || e.isContentEditable ? !0 : e instanceof HTMLInputElement ? ![
|
|
3
|
+
"button",
|
|
4
|
+
"checkbox",
|
|
5
|
+
"color",
|
|
6
|
+
"file",
|
|
7
|
+
"hidden",
|
|
8
|
+
"image",
|
|
9
|
+
"radio",
|
|
10
|
+
"range",
|
|
11
|
+
"reset",
|
|
12
|
+
"submit"
|
|
13
|
+
].includes(e.type) : !1, s = () => typeof document < "u" && o(document.activeElement) && i(), d = (e) => {
|
|
14
|
+
const n = window.visualViewport;
|
|
15
|
+
return n?.addEventListener("resize", e), window.addEventListener("resize", e), document.addEventListener("focusin", e), document.addEventListener("focusout", e), () => {
|
|
16
|
+
n?.removeEventListener("resize", e), window.removeEventListener("resize", e), document.removeEventListener("focusin", e), document.removeEventListener("focusout", e);
|
|
17
|
+
};
|
|
18
|
+
}, u = () => !1, f = () => t(d, s, u);
|
|
19
|
+
export {
|
|
20
|
+
s as isOnScreenKeyboardOpen,
|
|
21
|
+
o as isTextField,
|
|
22
|
+
i as isVisualViewportShrunkByKeyboard,
|
|
23
|
+
f as useOnScreenKeyboardOpen
|
|
24
|
+
};
|