welcome-ui 10.0.0-alpha.3 → 10.0.0-alpha.5
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/2W3RN7C5-DMC82gDP.js +61 -0
- package/dist/{4I4MLMKD-z3Xm3qCo.js → 4I4MLMKD-BO6Lcy7s.js} +17 -17
- package/dist/Accordion.js +19 -17
- package/dist/Alert.css +1 -1
- package/dist/Alert.js +93 -87
- package/dist/AspectRatio.js +1 -0
- package/dist/Avatar.js +13 -11
- package/dist/{B7UTNDHN-BDa2-8JK.js → B7UTNDHN-BghjolIs.js} +30 -30
- package/dist/Badge.js +1 -0
- package/dist/Breadcrumb.js +76 -71
- package/dist/Button.js +8 -6
- package/dist/ButtonGroup.js +6 -4
- package/dist/Card.css +1 -1
- package/dist/Card.js +68 -15
- package/dist/Checkbox.js +30 -29
- package/dist/CloseButton.js +7 -5
- package/dist/{CustomPopper-vwbOQq72.js → CustomPopper-C1wIDHbM.js} +5 -4
- package/dist/{DSAASPLT-C-2xDjIv.js → DSAASPLT-Fx1kuAsk.js} +3 -3
- package/dist/DatePicker.js +82 -78
- package/dist/DateTimePicker.js +22 -21
- package/dist/Drawer.js +101 -80
- package/dist/DropdownMenu.css +1 -1
- package/dist/DropdownMenu.js +889 -462
- package/dist/Field.js +1 -0
- package/dist/FieldGroup.js +9 -7
- package/dist/FileDrop.js +184 -176
- package/dist/FileUpload.js +43 -40
- package/dist/{GVVKDT6A-C66-lr0B.js → GVVKDT6A-CF9ejW_c.js} +103 -103
- package/dist/Hint.js +9 -7
- package/dist/Icon.js +6 -4
- package/dist/InputText.js +30 -28
- package/dist/{KPUWHTQJ-Byij2al4.js → KPUWHTQJ-Dv3cAqjP.js} +33 -31
- package/dist/Label.js +9 -7
- package/dist/Link.js +25 -21
- package/dist/Loader.js +12 -10
- package/dist/Logo.js +21 -13
- package/dist/Modal.js +145 -114
- package/dist/{NI3IVY7K-DpF3td-7.js → NI3IVY7K-Dy240mkD.js} +160 -160
- package/dist/{NMGNQVTG-BgAqqGOq.js → NMGNQVTG-DRO2uXZT.js} +6 -6
- package/dist/{OE2EFRVA-DkdhQLJL.js → OE2EFRVA-Dg1R6gaC.js} +186 -170
- package/dist/{OLVWQA7U-wHytlFYu.js → OLVWQA7U-Dia3UUnG.js} +36 -36
- package/dist/Pagination.js +39 -37
- package/dist/PasswordInput.js +20 -17
- package/dist/Popover.js +89 -72
- package/dist/{RTNCFSKZ-LcIdBwa8.js → RTNCFSKZ-BywELldk.js} +42 -42
- package/dist/Radio.js +20 -19
- package/dist/RadioGroup.js +29 -27
- package/dist/RadioTab.js +2 -1
- package/dist/{SBSPVDDI-BoxPz2JY.js → SBSPVDDI-CmtnvvUX.js} +46 -46
- package/dist/SQZLCNLX-Dg4KKdNJ.js +83 -0
- package/dist/Search.css +1 -1
- package/dist/Search.js +62 -60
- package/dist/Select.css +1 -1
- package/dist/Select.js +204 -202
- package/dist/Slider.js +66 -61
- package/dist/Stepper.js +34 -27
- package/dist/StickyNote.css +1 -0
- package/dist/StickyNote.js +49 -0
- package/dist/Swiper.js +52 -50
- package/dist/{T22PY7TE-CzEDuEn1.js → T22PY7TE-gLuJpoOm.js} +46 -46
- package/dist/Table.js +34 -21
- package/dist/Tabs.js +161 -152
- package/dist/Tag.css +1 -1
- package/dist/Tag.js +66 -61
- package/dist/Text.js +4 -2
- package/dist/Textarea.js +10 -8
- package/dist/TimePicker.js +22 -21
- package/dist/Toast.js +186 -177
- package/dist/Toggle.js +16 -14
- package/dist/Tooltip.js +29 -27
- package/dist/VariantIcon.js +7 -5
- package/dist/VisuallyHidden.js +8 -6
- package/dist/WelcomeLoader.js +3 -2
- package/dist/XCKGTAUF-CJwwVibW.js +25 -0
- package/dist/{Y67KZUMI-BDyUNSJw.js → Y67KZUMI-BwLWwpNF.js} +2 -2
- package/dist/{ZTXFEM5L-CjFLRObi.js → ZTXFEM5L-WGHY_jqg.js} +3 -3
- package/dist/theme.css +1 -1
- package/dist/theme.js +1 -0
- package/dist/types/components/Alert/components/Buttons.d.ts +3 -0
- package/dist/types/components/Alert/components/Title.d.ts +5 -0
- package/dist/types/components/Alert/index.d.ts +7 -3
- package/dist/types/components/Alert/types.d.ts +3 -9
- package/dist/types/components/Card/Body.d.ts +2 -3
- package/dist/types/components/Card/Footer.d.ts +6 -0
- package/dist/types/components/Card/Header.d.ts +5 -0
- package/dist/types/components/Card/index.d.ts +7 -8
- package/dist/types/components/Card/types.d.ts +16 -3
- package/dist/types/components/Checkbox/index.d.ts +1 -2
- package/dist/types/components/Checkbox/types.d.ts +3 -1
- package/dist/types/components/DateTimePickerCommon/CustomHeader.d.ts +4 -1
- package/dist/types/components/DateTimePickerCommon/CustomPopper.d.ts +6 -3
- package/dist/types/components/Drawer/AssetDrawer/Header.d.ts +4 -1
- package/dist/types/components/Drawer/AssetDrawer/IconBlock.d.ts +4 -1
- package/dist/types/components/Drawer/components/Close.d.ts +4 -1
- package/dist/types/components/Drawer/components/Title.d.ts +4 -1
- package/dist/types/components/Drawer/index.d.ts +12 -3
- package/dist/types/components/DropdownMenu/Action.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Group.d.ts +4 -0
- package/dist/types/components/DropdownMenu/Item.d.ts +7 -0
- package/dist/types/components/DropdownMenu/Search.d.ts +2 -0
- package/dist/types/components/DropdownMenu/Submenu.d.ts +4 -0
- package/dist/types/components/DropdownMenu/index.d.ts +11 -0
- package/dist/types/components/DropdownMenu/types.d.ts +26 -5
- package/dist/types/components/FileDrop/components/FilePreview.d.ts +4 -1
- package/dist/types/components/FileDrop/components/Message.d.ts +4 -1
- package/dist/types/components/Loader/index.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetContent.d.ts +4 -1
- package/dist/types/components/Modal/Assets/AssetTitle.d.ts +4 -1
- package/dist/types/components/Modal/Assets/CloseButton.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Dialog.d.ts +4 -1
- package/dist/types/components/Modal/Assets/Iframe.d.ts +4 -1
- package/dist/types/components/Modal/Assets/index.d.ts +16 -4
- package/dist/types/components/Modal/components/Close.d.ts +4 -1
- package/dist/types/components/Modal/index.d.ts +16 -4
- package/dist/types/components/PasswordInput/ToggleButton.d.ts +4 -1
- package/dist/types/components/Popover/Arrow.d.ts +4 -1
- package/dist/types/components/Popover/ContentWrapper.d.ts +4 -1
- package/dist/types/components/RadioGroup/index.d.ts +4 -1
- package/dist/types/components/Stepper/index.d.ts +8 -2
- package/dist/types/components/StickyNote/components/Button.d.ts +5 -0
- package/dist/types/components/StickyNote/components/Title.d.ts +5 -0
- package/dist/types/components/StickyNote/index.d.ts +11 -0
- package/dist/types/components/StickyNote/index.test.d.ts +1 -0
- package/dist/types/components/StickyNote/types.d.ts +15 -0
- package/dist/types/components/Swiper/index.d.ts +4 -1
- package/dist/types/components/Table/index.d.ts +20 -5
- package/dist/types/components/Tabs/components/ActiveBar/index.d.ts +4 -1
- package/dist/types/components/Tag/types.d.ts +4 -2
- package/dist/types/components/Toast/index.d.ts +4 -1
- package/dist/types/theme/types.d.ts +233 -218
- package/dist/utils.js +1 -0
- package/package.json +2 -2
- package/dist/2W3RN7C5-uG7eBeTQ.js +0 -61
- package/dist/SQZLCNLX-CUlXoT69.js +0 -82
- package/dist/XCKGTAUF-CahZE721.js +0 -25
package/dist/FileUpload.js
CHANGED
|
@@ -1,98 +1,101 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import './FileUpload.css';
|
|
2
3
|
import { jsxs as U, Fragment as T, jsx as p } from "react/jsx-runtime";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { g as
|
|
4
|
+
import { forwardRef as O, useState as A, useRef as H, useMemo as K, useImperativeHandle as M, useEffect as R } from "react";
|
|
5
|
+
import { Button as Y } from "./Button.js";
|
|
6
|
+
import { g as d, b as q, a as G } from "./index-DmEMuVTM.js";
|
|
6
7
|
import { Icon as J } from "./Icon.js";
|
|
7
8
|
import { Tag as Q } from "./Tag.js";
|
|
8
9
|
import { c as V } from "./index-PAaZGbyz.js";
|
|
9
|
-
import { c as
|
|
10
|
+
import { c as j } from "./create-event-rXDe5aCQ.js";
|
|
10
11
|
const W = "_input_2g24s_2", X = {
|
|
11
12
|
input: W,
|
|
12
13
|
"preview-tag": "_preview-tag_2g24s_5",
|
|
13
14
|
"preview-tag-size": "_preview-tag-size_2g24s_9"
|
|
14
|
-
}, y = V(X), Z = "*/*",
|
|
15
|
-
const
|
|
15
|
+
}, y = V(X), Z = "*/*", k = (e) => Array.isArray(e) ? e : e ? [e] : [], x = ({ file: e, onRemove: m }) => {
|
|
16
|
+
const n = d(e), f = q(e), c = G(e);
|
|
16
17
|
return /* @__PURE__ */ U(Q, { className: y("preview-tag"), "data-testid": f, onRemove: m, children: [
|
|
17
|
-
/* @__PURE__ */ p(J, { name:
|
|
18
|
+
/* @__PURE__ */ p(J, { name: n, size: "md" }),
|
|
18
19
|
f,
|
|
19
|
-
|
|
20
|
+
c ? /* @__PURE__ */ U("span", { className: y("preview-tag-size"), children: [
|
|
20
21
|
"(",
|
|
21
|
-
|
|
22
|
+
c,
|
|
22
23
|
")"
|
|
23
24
|
] }) : null
|
|
24
25
|
] }, f);
|
|
25
|
-
}
|
|
26
|
+
};
|
|
27
|
+
x.displayName = "FileUpload.DefaultPreview";
|
|
28
|
+
const $ = O(
|
|
26
29
|
({
|
|
27
30
|
accept: e = Z,
|
|
28
31
|
children: m,
|
|
29
|
-
disabled:
|
|
32
|
+
disabled: n,
|
|
30
33
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
34
|
draggable: f,
|
|
32
|
-
handleAddFile:
|
|
35
|
+
handleAddFile: c,
|
|
33
36
|
handleRemoveFile: u,
|
|
34
37
|
multiple: N,
|
|
35
38
|
name: v,
|
|
36
|
-
onBlur:
|
|
37
|
-
onChange:
|
|
39
|
+
onBlur: i,
|
|
40
|
+
onChange: a,
|
|
38
41
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
42
|
onError: C,
|
|
40
|
-
preview:
|
|
43
|
+
preview: l,
|
|
41
44
|
value: w = [],
|
|
42
45
|
...I
|
|
43
|
-
},
|
|
44
|
-
const [r, g] =
|
|
45
|
-
|
|
46
|
-
g(
|
|
47
|
-
}, [w]),
|
|
46
|
+
}, P) => {
|
|
47
|
+
const [r, g] = A(k(w)), _ = H(), z = K(() => l || x, [l]);
|
|
48
|
+
M(P, () => _.current), R(() => {
|
|
49
|
+
g(k(w));
|
|
50
|
+
}, [w]), R(() => () => {
|
|
48
51
|
r == null || r.map((t) => t instanceof File ? URL.revokeObjectURL(t.preview) : t);
|
|
49
52
|
}, [r]);
|
|
50
|
-
const
|
|
53
|
+
const S = (t) => {
|
|
51
54
|
let s = Array.from(t.target.files).map(
|
|
52
|
-
(
|
|
55
|
+
(o) => (o instanceof File && (o.preview = URL.createObjectURL(o)), o)
|
|
53
56
|
);
|
|
54
57
|
g(s), s.length === 1 && (s = s[0]);
|
|
55
|
-
const F =
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
const s = r.filter((
|
|
58
|
+
const F = j({ name: v, value: s });
|
|
59
|
+
a == null || a(F), c == null || c(s), i == null || i();
|
|
60
|
+
}, E = (t) => {
|
|
61
|
+
const s = r.filter((D) => D !== t), F = N ? s : void 0;
|
|
59
62
|
g(s);
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
+
const o = j({ name: v, value: F });
|
|
64
|
+
a == null || a(o), u == null || u(t), i == null || i();
|
|
65
|
+
}, L = () => {
|
|
63
66
|
_.current.click();
|
|
64
|
-
},
|
|
67
|
+
}, b = r.map((t) => t instanceof File ? t.preview : void 0).join("");
|
|
65
68
|
return /* @__PURE__ */ U(T, { children: [
|
|
66
|
-
m ? m({ disabled:
|
|
69
|
+
m ? m({ disabled: n, files: r, onRemoveFile: E, openFile: L }) : /* @__PURE__ */ p(Y, { disabled: n, onClick: L, children: "Upload file" }),
|
|
67
70
|
/* @__PURE__ */ p("br", {}),
|
|
68
71
|
/* @__PURE__ */ p(
|
|
69
72
|
"input",
|
|
70
73
|
{
|
|
71
74
|
accept: e,
|
|
72
75
|
className: y("input"),
|
|
73
|
-
disabled:
|
|
76
|
+
disabled: n,
|
|
74
77
|
multiple: N,
|
|
75
78
|
name: v,
|
|
76
|
-
onBlur:
|
|
77
|
-
onChange:
|
|
79
|
+
onBlur: i,
|
|
80
|
+
onChange: S,
|
|
78
81
|
ref: _,
|
|
79
82
|
...I,
|
|
80
83
|
type: "file"
|
|
81
84
|
},
|
|
82
|
-
|
|
85
|
+
b
|
|
83
86
|
),
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
z ? r.map((t) => /* @__PURE__ */ p(
|
|
88
|
+
z,
|
|
86
89
|
{
|
|
87
90
|
file: t,
|
|
88
|
-
onRemove: () =>
|
|
91
|
+
onRemove: () => E(t)
|
|
89
92
|
},
|
|
90
93
|
t instanceof File ? t.name : t
|
|
91
94
|
)) : null
|
|
92
95
|
] });
|
|
93
96
|
}
|
|
94
97
|
);
|
|
95
|
-
|
|
98
|
+
$.displayName = "FileUpload";
|
|
96
99
|
export {
|
|
97
|
-
|
|
100
|
+
$ as FileUpload
|
|
98
101
|
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as
|
|
3
|
-
import { P as Me, b as
|
|
4
|
-
import { e as Ue, c as pe, _ as ne, i as se,
|
|
2
|
+
import { a as Ye, c as He, b as Ie, d as We } from "./NI3IVY7K-Dy240mkD.js";
|
|
3
|
+
import { P as Me, b as Xe, a as Ce } from "./Y67KZUMI-BwLWwpNF.js";
|
|
4
|
+
import { e as Ue, c as pe, _ as ne, i as se, ag as Re, u as U, m as ce, k as le, d as $, a as x, f as me, b as ve, o as Fe, p as de, V as Se, aa as L, Y as Ge, v as Te, E as Ze, w as fe, q as Je, F as Ke, Z as Qe, M as et, A as Y, B as F, z as M, C as tt } from "./OE2EFRVA-Dg1R6gaC.js";
|
|
5
5
|
import { B as ot, N as rt, L as nt, A as st, O as it, g as ut, C as at, a as ct } from "./floating-ui.dom.browser.min-Bza9K_UR.js";
|
|
6
|
-
import { useRef as
|
|
6
|
+
import { useRef as I, useState as he, useEffect as T, useContext as lt, createContext as dt, useCallback as $e } from "react";
|
|
7
7
|
import { jsx as re } from "react/jsx-runtime";
|
|
8
|
-
import {
|
|
8
|
+
import { d as ft, m as pt, o as mt, t as vt, c as _e, a as oe, u as De } from "./RTNCFSKZ-BywELldk.js";
|
|
9
9
|
var G = Ue(
|
|
10
|
-
[
|
|
10
|
+
[Xe],
|
|
11
11
|
[Me]
|
|
12
12
|
);
|
|
13
13
|
G.useContext;
|
|
14
14
|
G.useScopedContext;
|
|
15
|
-
var Pe = G.useProviderContext,
|
|
15
|
+
var Pe = G.useProviderContext, zt = G.ContextProvider, ht = G.ScopedContextProvider;
|
|
16
16
|
function ae(t) {
|
|
17
17
|
return [t.clientX, t.clientY];
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function xe(t, r) {
|
|
20
20
|
const [o, e] = t;
|
|
21
21
|
let n = !1;
|
|
22
22
|
const s = r.length;
|
|
23
23
|
for (let u = s, c = 0, a = u - 1; c < u; a = c++) {
|
|
24
|
-
const [i, d] = r[c], [g, P] = r[a], [,
|
|
24
|
+
const [i, d] = r[c], [g, P] = r[a], [, S] = r[a === 0 ? u - 1 : a - 1] || [0, 0], h = (d - P) * (o - i) - (i - g) * (e - d);
|
|
25
25
|
if (P < d) {
|
|
26
26
|
if (e >= P && e < d) {
|
|
27
27
|
if (h === 0) return !0;
|
|
28
|
-
h > 0 && (e === P ? e >
|
|
28
|
+
h > 0 && (e === P ? e > S && (n = !n) : n = !n);
|
|
29
29
|
}
|
|
30
30
|
} else if (d < P) {
|
|
31
31
|
if (e > d && e <= P) {
|
|
32
32
|
if (h === 0) return !0;
|
|
33
|
-
h < 0 && (e === P ? e <
|
|
33
|
+
h < 0 && (e === P ? e < S && (n = !n) : n = !n);
|
|
34
34
|
}
|
|
35
35
|
} else if (e === d && (o >= g && o <= i || o >= i && o <= g))
|
|
36
36
|
return !0;
|
|
@@ -59,7 +59,7 @@ function Oe(t = 0, r = 0, o = 0, e = 0) {
|
|
|
59
59
|
bottom: r + e,
|
|
60
60
|
left: t
|
|
61
61
|
};
|
|
62
|
-
return $(
|
|
62
|
+
return $(x({}, n), { toJSON: () => n });
|
|
63
63
|
}
|
|
64
64
|
function wt(t) {
|
|
65
65
|
if (!t) return Oe();
|
|
@@ -75,14 +75,14 @@ function Et(t, r) {
|
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function St(t) {
|
|
79
79
|
return /^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(t);
|
|
80
80
|
}
|
|
81
81
|
function be(t) {
|
|
82
82
|
const r = window.devicePixelRatio || 1;
|
|
83
83
|
return Math.round(t * r) / r;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function xt(t, r) {
|
|
86
86
|
return nt(({ placement: o }) => {
|
|
87
87
|
var e;
|
|
88
88
|
const n = ((t == null ? void 0 : t.clientHeight) || 0) / 2, s = typeof r.gutter == "number" ? r.gutter + n : (e = r.gutter) != null ? e : n;
|
|
@@ -97,7 +97,7 @@ function yt(t) {
|
|
|
97
97
|
if (t.flip === !1) return;
|
|
98
98
|
const r = typeof t.flip == "string" ? t.flip.split(" ") : void 0;
|
|
99
99
|
return se(
|
|
100
|
-
!r || r.every(
|
|
100
|
+
!r || r.every(St),
|
|
101
101
|
process.env.NODE_ENV !== "production" && "`flip` expects a spaced-delimited list of placements"
|
|
102
102
|
), st({
|
|
103
103
|
padding: t.overflowPadding,
|
|
@@ -151,7 +151,7 @@ var Ne = pe(
|
|
|
151
151
|
flip: d = !0,
|
|
152
152
|
shift: g = 0,
|
|
153
153
|
slide: P = !0,
|
|
154
|
-
overlap:
|
|
154
|
+
overlap: S = !1,
|
|
155
155
|
sameWidth: h = !1,
|
|
156
156
|
fitViewport: b = !1,
|
|
157
157
|
gutter: w,
|
|
@@ -184,39 +184,39 @@ var Ne = pe(
|
|
|
184
184
|
e,
|
|
185
185
|
process.env.NODE_ENV !== "production" && "Popover must receive a `store` prop or be wrapped in a PopoverProvider component."
|
|
186
186
|
);
|
|
187
|
-
const _ = e.useState("arrowElement"), y = e.useState("anchorElement"), ie = e.useState("disclosureElement"), m = e.useState("popoverElement"), D = e.useState("contentElement"),
|
|
187
|
+
const _ = e.useState("arrowElement"), y = e.useState("anchorElement"), ie = e.useState("disclosureElement"), m = e.useState("popoverElement"), D = e.useState("contentElement"), Z = e.useState("placement"), l = e.useState("mounted"), O = e.useState("rendered"), v = I(null), [A, R] = he(!1), { portalRef: ue, domReady: k } = Re(s, p.portalRef), B = U(N), j = U(C), W = !!C;
|
|
188
188
|
ce(() => {
|
|
189
189
|
if (!(m != null && m.isConnected)) return;
|
|
190
190
|
m.style.setProperty(
|
|
191
191
|
"--popover-overflow-padding",
|
|
192
192
|
`${E}px`
|
|
193
193
|
);
|
|
194
|
-
const H = Et(y,
|
|
194
|
+
const H = Et(y, B), X = async () => {
|
|
195
195
|
if (!l) return;
|
|
196
196
|
_ || (v.current = v.current || document.createElement("div"));
|
|
197
|
-
const
|
|
198
|
-
|
|
197
|
+
const q = _ || v.current, qe = [
|
|
198
|
+
xt(q, { gutter: w, shift: g }),
|
|
199
199
|
yt({ flip: d, overflowPadding: E }),
|
|
200
|
-
Ot({ slide: P, overlap:
|
|
201
|
-
At(
|
|
200
|
+
Ot({ slide: P, overlap: S, overflowPadding: E }),
|
|
201
|
+
At(q, { arrowPadding: f }),
|
|
202
202
|
bt({
|
|
203
203
|
sameWidth: h,
|
|
204
204
|
fitViewport: b,
|
|
205
205
|
overflowPadding: E
|
|
206
206
|
})
|
|
207
|
-
],
|
|
208
|
-
placement:
|
|
207
|
+
], z = await rt(H, m, {
|
|
208
|
+
placement: Z,
|
|
209
209
|
strategy: i ? "fixed" : "absolute",
|
|
210
|
-
middleware:
|
|
210
|
+
middleware: qe
|
|
211
211
|
});
|
|
212
|
-
e == null || e.setState("currentPlacement",
|
|
213
|
-
const
|
|
212
|
+
e == null || e.setState("currentPlacement", z.placement), R(!0);
|
|
213
|
+
const ze = be(z.x), Le = be(z.y);
|
|
214
214
|
if (Object.assign(m.style, {
|
|
215
215
|
top: "0",
|
|
216
216
|
left: "0",
|
|
217
|
-
transform: `translate3d(${
|
|
218
|
-
}),
|
|
219
|
-
const { x:
|
|
217
|
+
transform: `translate3d(${ze}px,${Le}px,0)`
|
|
218
|
+
}), q && z.middlewareData.arrow) {
|
|
219
|
+
const { x: K, y: Q } = z.middlewareData.arrow, ge = z.placement.split("-")[0], ee = q.clientWidth / 2, te = q.clientHeight / 2, we = K != null ? K + ee : -ee, Ee = Q != null ? Q + te : -te;
|
|
220
220
|
m.style.setProperty(
|
|
221
221
|
"--popover-transform-origin",
|
|
222
222
|
{
|
|
@@ -225,20 +225,20 @@ var Ne = pe(
|
|
|
225
225
|
left: `calc(100% + ${ee}px) ${Ee}px`,
|
|
226
226
|
right: `${-ee}px ${Ee}px`
|
|
227
227
|
}[ge]
|
|
228
|
-
), Object.assign(
|
|
229
|
-
left:
|
|
228
|
+
), Object.assign(q.style, {
|
|
229
|
+
left: K != null ? `${K}px` : "",
|
|
230
230
|
top: Q != null ? `${Q}px` : "",
|
|
231
231
|
[ge]: "100%"
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
-
},
|
|
235
|
-
|
|
234
|
+
}, je = ot(H, m, async () => {
|
|
235
|
+
W ? (await j({ updatePosition: X }), R(!0)) : await X();
|
|
236
236
|
}, {
|
|
237
237
|
// JSDOM doesn't support ResizeObserver
|
|
238
238
|
elementResize: typeof ResizeObserver == "function"
|
|
239
239
|
});
|
|
240
240
|
return () => {
|
|
241
|
-
R(!1),
|
|
241
|
+
R(!1), je();
|
|
242
242
|
};
|
|
243
243
|
}, [
|
|
244
244
|
e,
|
|
@@ -247,42 +247,42 @@ var Ne = pe(
|
|
|
247
247
|
_,
|
|
248
248
|
y,
|
|
249
249
|
m,
|
|
250
|
-
|
|
250
|
+
Z,
|
|
251
251
|
l,
|
|
252
252
|
k,
|
|
253
253
|
i,
|
|
254
254
|
d,
|
|
255
255
|
g,
|
|
256
256
|
P,
|
|
257
|
-
|
|
257
|
+
S,
|
|
258
258
|
h,
|
|
259
259
|
b,
|
|
260
260
|
w,
|
|
261
261
|
f,
|
|
262
262
|
E,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
263
|
+
B,
|
|
264
|
+
W,
|
|
265
|
+
j
|
|
266
266
|
]), ce(() => {
|
|
267
267
|
if (!l || !k || !(m != null && m.isConnected) || !(D != null && D.isConnected)) return;
|
|
268
268
|
const H = () => {
|
|
269
269
|
m.style.zIndex = getComputedStyle(D).zIndex;
|
|
270
270
|
};
|
|
271
271
|
H();
|
|
272
|
-
let
|
|
273
|
-
|
|
272
|
+
let X = requestAnimationFrame(() => {
|
|
273
|
+
X = requestAnimationFrame(H);
|
|
274
274
|
});
|
|
275
|
-
return () => cancelAnimationFrame(
|
|
275
|
+
return () => cancelAnimationFrame(X);
|
|
276
276
|
}, [l, k, m, D]);
|
|
277
|
-
const
|
|
277
|
+
const J = i ? "fixed" : "absolute";
|
|
278
278
|
return p = le(
|
|
279
279
|
p,
|
|
280
280
|
(H) => /* @__PURE__ */ re(
|
|
281
281
|
"div",
|
|
282
|
-
$(
|
|
283
|
-
style:
|
|
282
|
+
$(x({}, a), {
|
|
283
|
+
style: x({
|
|
284
284
|
// https://floating-ui.com/docs/computeposition#initial-layout
|
|
285
|
-
position:
|
|
285
|
+
position: J,
|
|
286
286
|
top: 0,
|
|
287
287
|
left: 0,
|
|
288
288
|
width: "max-content"
|
|
@@ -291,22 +291,22 @@ var Ne = pe(
|
|
|
291
291
|
children: H
|
|
292
292
|
})
|
|
293
293
|
),
|
|
294
|
-
[e,
|
|
294
|
+
[e, J, a]
|
|
295
295
|
), p = le(
|
|
296
296
|
p,
|
|
297
297
|
(H) => /* @__PURE__ */ re(Me, { value: e, children: H }),
|
|
298
298
|
[e]
|
|
299
|
-
), p = $(
|
|
299
|
+
), p = $(x({
|
|
300
300
|
// data-placing is not part of the public API. We're setting this here so
|
|
301
301
|
// we can wait for the popover to be positioned before other components
|
|
302
302
|
// move focus into it. For example, this attribute is observed by the
|
|
303
303
|
// Combobox component with the autoSelect behavior.
|
|
304
304
|
"data-placing": !A || void 0
|
|
305
305
|
}, p), {
|
|
306
|
-
style:
|
|
306
|
+
style: x({
|
|
307
307
|
position: "relative"
|
|
308
308
|
}, p.style)
|
|
309
|
-
}), p =
|
|
309
|
+
}), p = Ye($(x({
|
|
310
310
|
store: e,
|
|
311
311
|
modal: n,
|
|
312
312
|
portal: s,
|
|
@@ -317,7 +317,7 @@ var Ne = pe(
|
|
|
317
317
|
portalRef: ue
|
|
318
318
|
})), p;
|
|
319
319
|
}
|
|
320
|
-
),
|
|
320
|
+
), Lt = He(
|
|
321
321
|
me(function(r) {
|
|
322
322
|
const o = Ne(r);
|
|
323
323
|
return ve(gt, o);
|
|
@@ -325,7 +325,7 @@ var Ne = pe(
|
|
|
325
325
|
Ce
|
|
326
326
|
), Ht = "div";
|
|
327
327
|
function Ve(t, r, o, e) {
|
|
328
|
-
return
|
|
328
|
+
return Je(r) ? !0 : t ? !!(fe(r, t) || o && fe(o, t) || e != null && e.some((n) => Ve(t, n, o))) : !1;
|
|
329
329
|
}
|
|
330
330
|
function Mt(t) {
|
|
331
331
|
var r = t, {
|
|
@@ -339,10 +339,10 @@ function Mt(t) {
|
|
|
339
339
|
}, [u]);
|
|
340
340
|
const c = e.onFocus, a = U((d) => {
|
|
341
341
|
c == null || c(d), !d.defaultPrevented && s(!0);
|
|
342
|
-
}), i =
|
|
342
|
+
}), i = I(null);
|
|
343
343
|
return T(() => ft(o, ["anchorElement"], (d) => {
|
|
344
344
|
i.current = d.anchorElement;
|
|
345
|
-
}), []), e = $(
|
|
345
|
+
}), []), e = $(x({
|
|
346
346
|
autoFocusOnHide: n,
|
|
347
347
|
finalFocus: i
|
|
348
348
|
}, e), {
|
|
@@ -371,25 +371,25 @@ var Ae = dt(null), Ct = pe(
|
|
|
371
371
|
e,
|
|
372
372
|
process.env.NODE_ENV !== "production" && "Hovercard must receive a `store` prop or be wrapped in a HovercardProvider component."
|
|
373
373
|
);
|
|
374
|
-
const g =
|
|
374
|
+
const g = I(null), [P, S] = he([]), h = I(0), b = I(null), { portalRef: w, domReady: f } = Re(s, i.portalRef), E = Fe(), N = !!c, C = de(c), p = !!a, V = de(
|
|
375
375
|
a
|
|
376
376
|
), _ = e.useState("open"), y = e.useState("mounted");
|
|
377
377
|
T(() => {
|
|
378
378
|
if (!f || !y || !N && !p) return;
|
|
379
379
|
const l = g.current;
|
|
380
|
-
return l ?
|
|
381
|
-
|
|
380
|
+
return l ? Se(
|
|
381
|
+
L("mousemove", (v) => {
|
|
382
382
|
if (!e || !E()) return;
|
|
383
|
-
const { anchorElement: A, hideTimeout: R, timeout: ue } = e.getState(), k = b.current, [
|
|
384
|
-
if (Ve(
|
|
385
|
-
b.current =
|
|
383
|
+
const { anchorElement: A, hideTimeout: R, timeout: ue } = e.getState(), k = b.current, [B] = v.composedPath(), j = A;
|
|
384
|
+
if (Ve(B, l, j, P)) {
|
|
385
|
+
b.current = B && j && fe(j, B) ? ae(v) : null, window.clearTimeout(h.current), h.current = 0;
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
388
|
if (!h.current) {
|
|
389
389
|
if (k) {
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
392
|
-
if (b.current =
|
|
390
|
+
const W = ae(v), J = ye(l, k);
|
|
391
|
+
if (xe(W, J)) {
|
|
392
|
+
if (b.current = W, !V(v)) return;
|
|
393
393
|
v.preventDefault(), v.stopPropagation();
|
|
394
394
|
return;
|
|
395
395
|
}
|
|
@@ -419,17 +419,17 @@ var Ae = dt(null), Ct = pe(
|
|
|
419
419
|
const A = b.current;
|
|
420
420
|
if (!A) return;
|
|
421
421
|
const R = ye(v, A);
|
|
422
|
-
if (
|
|
422
|
+
if (xe(ae(O), R)) {
|
|
423
423
|
if (!V(O)) return;
|
|
424
424
|
O.preventDefault(), O.stopPropagation();
|
|
425
425
|
}
|
|
426
426
|
};
|
|
427
|
-
return
|
|
427
|
+
return Se(
|
|
428
428
|
// Note: we may need to add pointer events here in the future.
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
429
|
+
L("mouseenter", l, !0),
|
|
430
|
+
L("mouseover", l, !0),
|
|
431
|
+
L("mouseout", l, !0),
|
|
432
|
+
L("mouseleave", l, !0)
|
|
433
433
|
);
|
|
434
434
|
}, [f, y, p, V]), T(() => {
|
|
435
435
|
f && (_ || e == null || e.setAutoFocusOnShow(!1));
|
|
@@ -450,10 +450,10 @@ var Ae = dt(null), Ct = pe(
|
|
|
450
450
|
}, [n, s, y, f]);
|
|
451
451
|
const D = $e(
|
|
452
452
|
(l) => {
|
|
453
|
-
|
|
453
|
+
S((v) => [...v, l]);
|
|
454
454
|
const O = m == null ? void 0 : m(l);
|
|
455
455
|
return () => {
|
|
456
|
-
|
|
456
|
+
S(
|
|
457
457
|
(v) => v.filter((A) => A !== l)
|
|
458
458
|
), O == null || O();
|
|
459
459
|
};
|
|
@@ -464,21 +464,21 @@ var Ae = dt(null), Ct = pe(
|
|
|
464
464
|
i,
|
|
465
465
|
(l) => /* @__PURE__ */ re(ht, { value: e, children: /* @__PURE__ */ re(Ae.Provider, { value: D, children: l }) }),
|
|
466
466
|
[e, D]
|
|
467
|
-
), i = $(
|
|
467
|
+
), i = $(x({}, i), {
|
|
468
468
|
ref: Te(g, i.ref)
|
|
469
|
-
}), i = Mt(
|
|
470
|
-
const
|
|
469
|
+
}), i = Mt(x({ store: e }, i));
|
|
470
|
+
const Z = e.useState(
|
|
471
471
|
(l) => n || l.autoFocusOnShow
|
|
472
472
|
);
|
|
473
|
-
return i = Ne($(
|
|
473
|
+
return i = Ne($(x({
|
|
474
474
|
store: e,
|
|
475
475
|
modal: n,
|
|
476
476
|
portal: s,
|
|
477
|
-
autoFocusOnShow:
|
|
477
|
+
autoFocusOnShow: Z
|
|
478
478
|
}, i), {
|
|
479
479
|
portalRef: w,
|
|
480
480
|
hideOnEscape(l) {
|
|
481
|
-
return
|
|
481
|
+
return Ze(u, l) ? !1 : (requestAnimationFrame(() => {
|
|
482
482
|
requestAnimationFrame(() => {
|
|
483
483
|
e == null || e.hide();
|
|
484
484
|
});
|
|
@@ -486,7 +486,7 @@ var Ae = dt(null), Ct = pe(
|
|
|
486
486
|
}
|
|
487
487
|
})), i;
|
|
488
488
|
}
|
|
489
|
-
),
|
|
489
|
+
), Yt = He(
|
|
490
490
|
me(function(r) {
|
|
491
491
|
const o = Ct(r);
|
|
492
492
|
return ve(Ht, o);
|
|
@@ -500,8 +500,8 @@ var Ae = dt(null), Ct = pe(
|
|
|
500
500
|
e,
|
|
501
501
|
process.env.NODE_ENV !== "production" && "HovercardAnchor must receive a `store` prop or be wrapped in a HovercardProvider component."
|
|
502
502
|
);
|
|
503
|
-
const c =
|
|
504
|
-
T(() => () => window.clearTimeout(a.current), []), T(() =>
|
|
503
|
+
const c = Ke(s), a = I(0);
|
|
504
|
+
T(() => () => window.clearTimeout(a.current), []), T(() => L("mouseleave", (f) => {
|
|
505
505
|
if (!e) return;
|
|
506
506
|
const { anchorElement: E } = e.getState();
|
|
507
507
|
E && f.target === E && (window.clearTimeout(a.current), a.current = 0);
|
|
@@ -516,8 +516,8 @@ var Ae = dt(null), Ct = pe(
|
|
|
516
516
|
}));
|
|
517
517
|
}, p = E ?? N;
|
|
518
518
|
p === 0 ? C() : a.current = window.setTimeout(C, p);
|
|
519
|
-
}),
|
|
520
|
-
|
|
519
|
+
}), S = s.onClick, h = U((w) => {
|
|
520
|
+
S == null || S(w), e && (window.clearTimeout(a.current), a.current = 0);
|
|
521
521
|
}), b = $e(
|
|
522
522
|
(w) => {
|
|
523
523
|
if (!e) return;
|
|
@@ -526,13 +526,13 @@ var Ae = dt(null), Ct = pe(
|
|
|
526
526
|
},
|
|
527
527
|
[e]
|
|
528
528
|
);
|
|
529
|
-
return s = $(
|
|
529
|
+
return s = $(x({}, s), {
|
|
530
530
|
ref: Te(b, s.ref),
|
|
531
531
|
onMouseMove: P,
|
|
532
532
|
onClick: h
|
|
533
533
|
}), s = Qe(s), s;
|
|
534
534
|
}
|
|
535
|
-
),
|
|
535
|
+
), It = me(function(r) {
|
|
536
536
|
const o = Ft(r);
|
|
537
537
|
return ve(Rt, o);
|
|
538
538
|
});
|
|
@@ -553,11 +553,11 @@ function ke(t = {}) {
|
|
|
553
553
|
])
|
|
554
554
|
);
|
|
555
555
|
vt(e, n);
|
|
556
|
-
const s = n == null ? void 0 : n.getState(), u =
|
|
556
|
+
const s = n == null ? void 0 : n.getState(), u = Ie(Y(F({}, e), { store: n })), c = M(
|
|
557
557
|
e.placement,
|
|
558
558
|
s == null ? void 0 : s.placement,
|
|
559
559
|
"bottom"
|
|
560
|
-
), a =
|
|
560
|
+
), a = Y(F({}, u.getState()), {
|
|
561
561
|
placement: c,
|
|
562
562
|
currentPlacement: c,
|
|
563
563
|
anchorElement: M(s == null ? void 0 : s.anchorElement, null),
|
|
@@ -565,55 +565,55 @@ function ke(t = {}) {
|
|
|
565
565
|
arrowElement: M(s == null ? void 0 : s.arrowElement, null),
|
|
566
566
|
rendered: Symbol("rendered")
|
|
567
567
|
}), i = _e(a, u, n);
|
|
568
|
-
return
|
|
568
|
+
return Y(F(F({}, u), i), {
|
|
569
569
|
setAnchorElement: (d) => i.setState("anchorElement", d),
|
|
570
570
|
setPopoverElement: (d) => i.setState("popoverElement", d),
|
|
571
571
|
setArrowElement: (d) => i.setState("arrowElement", d),
|
|
572
572
|
render: () => i.setState("rendered", Symbol("rendered"))
|
|
573
573
|
});
|
|
574
574
|
}
|
|
575
|
-
function
|
|
576
|
-
return tt(r, [o.popover]), oe(t, o, "placement"),
|
|
575
|
+
function Be(t, r, o) {
|
|
576
|
+
return tt(r, [o.popover]), oe(t, o, "placement"), We(t, r, o);
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function Wt(t = {}) {
|
|
579
579
|
const [r, o] = De(ke, t);
|
|
580
|
-
return
|
|
580
|
+
return Be(r, o, t);
|
|
581
581
|
}
|
|
582
582
|
function Tt(t = {}) {
|
|
583
583
|
var r;
|
|
584
|
-
const o = (r = t.store) == null ? void 0 : r.getState(), e = ke(
|
|
584
|
+
const o = (r = t.store) == null ? void 0 : r.getState(), e = ke(Y(F({}, t), {
|
|
585
585
|
placement: M(
|
|
586
586
|
t.placement,
|
|
587
587
|
o == null ? void 0 : o.placement,
|
|
588
588
|
"bottom"
|
|
589
589
|
)
|
|
590
|
-
})), n = M(t.timeout, o == null ? void 0 : o.timeout, 500), s =
|
|
590
|
+
})), n = M(t.timeout, o == null ? void 0 : o.timeout, 500), s = Y(F({}, e.getState()), {
|
|
591
591
|
timeout: n,
|
|
592
592
|
showTimeout: M(t.showTimeout, o == null ? void 0 : o.showTimeout),
|
|
593
593
|
hideTimeout: M(t.hideTimeout, o == null ? void 0 : o.hideTimeout),
|
|
594
594
|
autoFocusOnShow: M(o == null ? void 0 : o.autoFocusOnShow, !1)
|
|
595
595
|
}), u = _e(s, e, t.store);
|
|
596
|
-
return
|
|
596
|
+
return Y(F(F({}, e), u), {
|
|
597
597
|
setAutoFocusOnShow: (c) => u.setState("autoFocusOnShow", c)
|
|
598
598
|
});
|
|
599
599
|
}
|
|
600
600
|
function $t(t, r, o) {
|
|
601
|
-
return oe(t, o, "timeout"), oe(t, o, "showTimeout"), oe(t, o, "hideTimeout"),
|
|
601
|
+
return oe(t, o, "timeout"), oe(t, o, "showTimeout"), oe(t, o, "hideTimeout"), Be(t, r, o);
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function Xt(t = {}) {
|
|
604
604
|
const [r, o] = De(Tt, t);
|
|
605
605
|
return $t(r, o, t);
|
|
606
606
|
}
|
|
607
607
|
export {
|
|
608
608
|
ht as H,
|
|
609
|
-
|
|
610
|
-
|
|
609
|
+
Lt as P,
|
|
610
|
+
zt as a,
|
|
611
611
|
Ft as b,
|
|
612
612
|
Tt as c,
|
|
613
613
|
$t as d,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
614
|
+
It as e,
|
|
615
|
+
Yt as f,
|
|
616
|
+
Wt as g,
|
|
617
|
+
Xt as h,
|
|
618
618
|
Ct as u
|
|
619
619
|
};
|