@viasat/beam-react 2.29.0 → 2.30.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/lib/Autocomplete/Autocomplete.cjs.js +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +6 -0
- package/lib/Autocomplete/Autocomplete.es.js +108 -106
- package/lib/Autocomplete/AutocompleteField.cjs.js +1 -1
- package/lib/Autocomplete/AutocompleteField.d.ts +1 -0
- package/lib/Autocomplete/AutocompleteField.es.js +24 -23
- package/lib/_Options/useSelectValue.cjs.js +1 -1
- package/lib/_Options/useSelectValue.es.js +84 -70
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.d.ts +3 -1
- package/lib/wip/Panel/Panel.Inline.es.js +45 -42
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +3 -1
- package/lib/wip/Panel/Panel.Overlay.es.js +61 -50
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.es.js +91 -83
- package/package.json +6 -6
|
@@ -1,109 +1,123 @@
|
|
|
1
|
-
import q, { useRef as
|
|
2
|
-
import { useUniversalRef as
|
|
1
|
+
import q, { useRef as V, useState as G, useEffect as T, useCallback as f, useMemo as I } from "react";
|
|
2
|
+
import { useUniversalRef as H } from "../Form/hooks/useUniversalRef.hook.es.js";
|
|
3
3
|
import "../../chunks/constants.CKKGf1-i.js";
|
|
4
4
|
import "react/jsx-runtime";
|
|
5
|
-
import { F as
|
|
5
|
+
import { F as J } from "../../chunks/form.context.D7b4066_.js";
|
|
6
6
|
import "../Form/contexts/label.context.es.js";
|
|
7
7
|
import "../Form/contexts/helperText.context.es.js";
|
|
8
|
-
const
|
|
8
|
+
const ee = ({
|
|
9
9
|
value: e,
|
|
10
10
|
defaultValue: b,
|
|
11
|
-
onChange:
|
|
11
|
+
onChange: l,
|
|
12
12
|
name: d,
|
|
13
|
-
multiple:
|
|
14
|
-
},
|
|
15
|
-
const { refFn:
|
|
16
|
-
|
|
17
|
-
const [
|
|
13
|
+
multiple: x = !1
|
|
14
|
+
}, k) => {
|
|
15
|
+
const { refFn: C, ref: c } = H(k), { ctxInitialValues: D } = q.useContext(J), i = b || D[d], F = V(i);
|
|
16
|
+
F.current = i;
|
|
17
|
+
const [U, v] = G(i), y = e !== void 0, a = V(y);
|
|
18
18
|
a.current = y;
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
a.current ||
|
|
19
|
+
const M = y ? e : U, s = V(l);
|
|
20
|
+
s.current = l, T(() => {
|
|
21
|
+
a.current || v(i);
|
|
22
22
|
}, [i]);
|
|
23
|
-
const
|
|
24
|
-
(
|
|
25
|
-
var
|
|
26
|
-
const
|
|
27
|
-
if (!
|
|
23
|
+
const p = f(
|
|
24
|
+
(r) => {
|
|
25
|
+
var L;
|
|
26
|
+
const n = P(r), t = c.current;
|
|
27
|
+
if (!t) {
|
|
28
28
|
console.warn(
|
|
29
29
|
"Component is controlled but selectRef is not set. This may lead to unexpected behavior."
|
|
30
|
-
), (
|
|
31
|
-
target: { value:
|
|
30
|
+
), (L = s.current) == null || L.call(s, {
|
|
31
|
+
target: { value: r }
|
|
32
32
|
});
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
o.selected =
|
|
38
|
-
}),
|
|
39
|
-
const
|
|
40
|
-
|
|
35
|
+
const u = Array.from(t.options), h = Array.from(t.selectedOptions);
|
|
36
|
+
u.forEach((o) => {
|
|
37
|
+
o.selected = n.includes(o.value);
|
|
38
|
+
}), n.forEach((o) => {
|
|
39
|
+
const O = u.find((j) => j.value === o);
|
|
40
|
+
O && t.appendChild(O);
|
|
41
41
|
});
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
44
|
-
Array.from(
|
|
45
|
-
o.selected =
|
|
46
|
-
}),
|
|
47
|
-
|
|
42
|
+
const B = new Event("change", { bubbles: !0 });
|
|
43
|
+
if (t.dispatchEvent(B), B.defaultPrevented) {
|
|
44
|
+
Array.from(t.options).forEach((o) => {
|
|
45
|
+
o.selected = h.includes(o);
|
|
46
|
+
}), u.reverse().forEach((o) => {
|
|
47
|
+
t.appendChild(o);
|
|
48
48
|
});
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
[
|
|
52
|
+
[c]
|
|
53
53
|
);
|
|
54
|
-
|
|
55
|
-
a.current &&
|
|
54
|
+
T(() => {
|
|
55
|
+
a.current && v(e);
|
|
56
56
|
}, [e]);
|
|
57
|
-
const
|
|
58
|
-
var
|
|
59
|
-
a.current ? (
|
|
60
|
-
Array.from(
|
|
57
|
+
const S = f((r) => {
|
|
58
|
+
var n;
|
|
59
|
+
a.current ? (n = s.current) == null || n.call(s, r) : v(
|
|
60
|
+
Array.from(r.target.selectedOptions).filter((t) => t.selected && t.value !== "").map((t) => t.value)
|
|
61
61
|
);
|
|
62
|
-
}, []),
|
|
63
|
-
var
|
|
64
|
-
const
|
|
65
|
-
(
|
|
66
|
-
}, [
|
|
62
|
+
}, []), w = f(() => {
|
|
63
|
+
var t, u;
|
|
64
|
+
const r = new FocusEvent("blur", { bubbles: !1 }), n = new FocusEvent("focusout", { bubbles: !0 });
|
|
65
|
+
(t = c.current) == null || t.dispatchEvent(r), (u = c.current) == null || u.dispatchEvent(n);
|
|
66
|
+
}, [c]), A = f(() => {
|
|
67
67
|
var t;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
const r = c.current, n = F.current;
|
|
69
|
+
if (r) {
|
|
70
|
+
const u = P(n);
|
|
71
|
+
Array.from(r.options).forEach((h) => {
|
|
72
|
+
h.defaultSelected = u.includes(h.value);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (a.current) {
|
|
76
|
+
(t = s.current) == null || t.call(s, {
|
|
77
|
+
target: { value: n }
|
|
78
|
+
});
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
r && p(n);
|
|
82
|
+
}, [p, c]), m = V(null), z = f(
|
|
83
|
+
(r) => {
|
|
84
|
+
var n, t;
|
|
85
|
+
C(r), r ? (m.current = r.form, (t = m.current) == null || t.addEventListener("reset", A)) : ((n = m.current) == null || n.removeEventListener("reset", A), m.current = null);
|
|
75
86
|
},
|
|
76
|
-
[
|
|
77
|
-
), E =
|
|
78
|
-
ref:
|
|
79
|
-
value:
|
|
80
|
-
onChange:
|
|
87
|
+
[A, C]
|
|
88
|
+
), E = I(() => ({
|
|
89
|
+
ref: z,
|
|
90
|
+
value: K(M, x),
|
|
91
|
+
onChange: S,
|
|
81
92
|
name: d
|
|
82
|
-
}), [
|
|
83
|
-
return
|
|
93
|
+
}), [z, x, M, S, d]);
|
|
94
|
+
return I(
|
|
84
95
|
() => ({
|
|
85
96
|
selectProps: E,
|
|
86
97
|
value: E.value,
|
|
87
|
-
singleValue:
|
|
88
|
-
setValue:
|
|
89
|
-
handleBlur:
|
|
98
|
+
singleValue: N(E.value),
|
|
99
|
+
setValue: p,
|
|
100
|
+
handleBlur: w
|
|
90
101
|
}),
|
|
91
|
-
[E,
|
|
102
|
+
[E, p, w]
|
|
92
103
|
);
|
|
93
104
|
};
|
|
94
|
-
function
|
|
105
|
+
function g(e) {
|
|
95
106
|
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
96
107
|
}
|
|
97
|
-
function
|
|
108
|
+
function R(e) {
|
|
98
109
|
return Array.isArray(e);
|
|
99
110
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
function P(e) {
|
|
112
|
+
return R(e) ? e : g(e) ? [] : [e];
|
|
113
|
+
}
|
|
114
|
+
function K(e, b) {
|
|
115
|
+
const l = R(e);
|
|
116
|
+
return b ? l ? e : g(e) ? [] : [e] : l ? g(e) ? "" : e[0] ?? "" : e ?? "";
|
|
103
117
|
}
|
|
104
|
-
function
|
|
105
|
-
return
|
|
118
|
+
function N(e) {
|
|
119
|
+
return R(e) ? e.length > 0 ? e[e.length - 1] : void 0 : e;
|
|
106
120
|
}
|
|
107
121
|
export {
|
|
108
|
-
|
|
122
|
+
ee as useSelectValue
|
|
109
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),q=require("@floating-ui/react"),b=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const F=require("./Panel.context.cjs.js"),R=require("../../FloatingUI/FloatingUI.root.cjs.js"),h=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),g=require("./Panel.Divider.cjs.js"),w=require("./Panel.ResizeHandle.cjs.js"),U=require("./Panel.useResize.cjs.js"),N=require("../../../chunks/panel.module.CVyUzyCZ.js"),{baseClassNamePrefix:v}=b.getBEMClassNames("panel"),y=({children:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,alwaysVisible:i,skipMountAnimation:_,dividerColor:t,resizeConfig:s,...x})=>{const{context:d,transitionConfig:p,refs:j}=h.useBmFloatingUIContext(),{isMounted:P,status:I}=q.useTransitionStatus(d,p),f=(i||_)&&I==="initial"?"open":I,{handleRef:m}=U.usePanelResize({resizeConfig:s,position:n,floatingRef:j.floating});return P?e.jsxs(e.Fragment,{children:[o&&e.jsx(g.InlineDivider,{position:n,dividerColor:t}),e.jsx("div",{ref:j.setFloating,className:r,"data-position":n,"data-status":f,children:e.jsxs("div",{className:N.styles[`${v}__inline-wrapper-content`],children:[c&&e.jsx(g.InlineDivider,{position:n,dividerColor:t}),e.jsxs("aside",{...x,className:l,children:[a,s&&e.jsx(w.PanelResizeHandle,{ref:m})]})]})}),u&&e.jsx(g.InlineDivider,{position:n,dividerColor:t})]}):null},C=({contextValue:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,open:i,transitionConfig:_,dividerColor:t,children:s,resizeConfig:x,skipMountAnimation:d,...p})=>e.jsx(F.PanelContext.Provider,{value:a,children:e.jsx(R.FloatingUIRoot,{open:i??!0,portalled:!1,transitionConfig:_,children:e.jsx(y,{panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,dividerColor:t,alwaysVisible:i===void 0,skipMountAnimation:d,resizeConfig:x,...p,children:s})})});exports.InlinePanel=C;
|
|
@@ -14,6 +14,8 @@ type InlinePanelProps = {
|
|
|
14
14
|
children: React.ReactNode;
|
|
15
15
|
dividerColor?: PanelDividerColor;
|
|
16
16
|
resizeConfig?: PanelResizeConfig;
|
|
17
|
+
/** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
|
|
18
|
+
skipMountAnimation?: boolean;
|
|
17
19
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
18
|
-
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig, skipMountAnimation, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTransitionStatus as
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as t, jsxs as g, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import { useTransitionStatus as w } from "@floating-ui/react";
|
|
3
|
+
import { g as P } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { PanelContext as
|
|
6
|
-
import { FloatingUIRoot as
|
|
7
|
-
import { a as
|
|
8
|
-
import { InlineDivider as
|
|
9
|
-
import { PanelResizeHandle as
|
|
10
|
-
import { usePanelResize as
|
|
11
|
-
import { s as
|
|
12
|
-
const { baseClassNamePrefix:
|
|
5
|
+
import { PanelContext as U } from "./Panel.context.es.js";
|
|
6
|
+
import { FloatingUIRoot as b } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
7
|
+
import { a as j } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
8
|
+
import { InlineDivider as x } from "./Panel.Divider.es.js";
|
|
9
|
+
import { PanelResizeHandle as y } from "./Panel.ResizeHandle.es.js";
|
|
10
|
+
import { usePanelResize as B } from "./Panel.useResize.es.js";
|
|
11
|
+
import { s as M } from "../../../chunks/panel.module.BblnuBjO.js";
|
|
12
|
+
const { baseClassNamePrefix: S } = P("panel"), _ = ({
|
|
13
13
|
children: s,
|
|
14
14
|
panelClassName: o,
|
|
15
15
|
inlineWrapperClassName: r,
|
|
@@ -18,43 +18,44 @@ const { baseClassNamePrefix: M } = w("panel"), S = ({
|
|
|
18
18
|
dividerInner: m,
|
|
19
19
|
dividerAfter: p,
|
|
20
20
|
alwaysVisible: e,
|
|
21
|
+
skipMountAnimation: f,
|
|
21
22
|
dividerColor: a,
|
|
22
23
|
resizeConfig: i,
|
|
23
|
-
...
|
|
24
|
+
...c
|
|
24
25
|
}) => {
|
|
25
26
|
const {
|
|
26
|
-
context:
|
|
27
|
-
transitionConfig:
|
|
28
|
-
refs:
|
|
29
|
-
} =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
),
|
|
27
|
+
context: u,
|
|
28
|
+
transitionConfig: d,
|
|
29
|
+
refs: h
|
|
30
|
+
} = j(), { isMounted: N, status: I } = w(
|
|
31
|
+
u,
|
|
32
|
+
d
|
|
33
|
+
), R = (e || f) && I === "initial" ? "open" : I, { handleRef: C } = B({
|
|
33
34
|
resizeConfig: i,
|
|
34
35
|
position: n,
|
|
35
|
-
floatingRef:
|
|
36
|
+
floatingRef: h.floating
|
|
36
37
|
});
|
|
37
|
-
return
|
|
38
|
-
l && /* @__PURE__ */ t(
|
|
38
|
+
return N ? /* @__PURE__ */ g(F, { children: [
|
|
39
|
+
l && /* @__PURE__ */ t(x, { position: n, dividerColor: a }),
|
|
39
40
|
/* @__PURE__ */ t(
|
|
40
41
|
"div",
|
|
41
42
|
{
|
|
42
|
-
ref:
|
|
43
|
+
ref: h.setFloating,
|
|
43
44
|
className: r,
|
|
44
45
|
"data-position": n,
|
|
45
|
-
"data-status":
|
|
46
|
-
children: /* @__PURE__ */
|
|
47
|
-
m && /* @__PURE__ */ t(
|
|
48
|
-
/* @__PURE__ */
|
|
46
|
+
"data-status": R,
|
|
47
|
+
children: /* @__PURE__ */ g("div", { className: M[`${S}__inline-wrapper-content`], children: [
|
|
48
|
+
m && /* @__PURE__ */ t(x, { position: n, dividerColor: a }),
|
|
49
|
+
/* @__PURE__ */ g("aside", { ...c, className: o, children: [
|
|
49
50
|
s,
|
|
50
|
-
i && /* @__PURE__ */ t(
|
|
51
|
+
i && /* @__PURE__ */ t(y, { ref: C })
|
|
51
52
|
] })
|
|
52
53
|
] })
|
|
53
54
|
}
|
|
54
55
|
),
|
|
55
|
-
p && /* @__PURE__ */ t(
|
|
56
|
+
p && /* @__PURE__ */ t(x, { position: n, dividerColor: a })
|
|
56
57
|
] }) : null;
|
|
57
|
-
},
|
|
58
|
+
}, G = ({
|
|
58
59
|
contextValue: s,
|
|
59
60
|
panelClassName: o,
|
|
60
61
|
inlineWrapperClassName: r,
|
|
@@ -63,19 +64,20 @@ const { baseClassNamePrefix: M } = w("panel"), S = ({
|
|
|
63
64
|
dividerInner: m,
|
|
64
65
|
dividerAfter: p,
|
|
65
66
|
open: e,
|
|
66
|
-
transitionConfig:
|
|
67
|
-
dividerColor:
|
|
68
|
-
children:
|
|
67
|
+
transitionConfig: f,
|
|
68
|
+
dividerColor: a,
|
|
69
|
+
children: i,
|
|
69
70
|
resizeConfig: c,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
skipMountAnimation: u,
|
|
72
|
+
...d
|
|
73
|
+
}) => /* @__PURE__ */ t(U.Provider, { value: s, children: /* @__PURE__ */ t(
|
|
74
|
+
b,
|
|
73
75
|
{
|
|
74
76
|
open: e ?? !0,
|
|
75
77
|
portalled: !1,
|
|
76
|
-
transitionConfig:
|
|
78
|
+
transitionConfig: f,
|
|
77
79
|
children: /* @__PURE__ */ t(
|
|
78
|
-
|
|
80
|
+
_,
|
|
79
81
|
{
|
|
80
82
|
panelClassName: o,
|
|
81
83
|
inlineWrapperClassName: r,
|
|
@@ -83,15 +85,16 @@ const { baseClassNamePrefix: M } = w("panel"), S = ({
|
|
|
83
85
|
dividerBefore: l,
|
|
84
86
|
dividerInner: m,
|
|
85
87
|
dividerAfter: p,
|
|
86
|
-
dividerColor:
|
|
88
|
+
dividerColor: a,
|
|
87
89
|
alwaysVisible: e === void 0,
|
|
90
|
+
skipMountAnimation: u,
|
|
88
91
|
resizeConfig: c,
|
|
89
|
-
...
|
|
90
|
-
children:
|
|
92
|
+
...d,
|
|
93
|
+
children: i
|
|
91
94
|
}
|
|
92
95
|
)
|
|
93
96
|
}
|
|
94
97
|
) });
|
|
95
98
|
export {
|
|
96
|
-
|
|
99
|
+
G as InlinePanel
|
|
97
100
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),p=require("clsx"),F=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const I=require("./Panel.context.cjs.js"),j=require("./Panel.helpers.cjs.js"),C=require("../../FloatingUI/FloatingUI.root.cjs.js"),R=require("../../FloatingUI/FloatingUI.content.cjs.js"),U=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),N=require("./Panel.Divider.cjs.js"),h=require("./Panel.ResizeHandle.cjs.js"),w=require("./Panel.useResize.cjs.js"),v=require("../../../chunks/panel.module.CVyUzyCZ.js"),{baseClassNamePrefix:y,variable:b}=F.getBEMClassNames("panel"),D=({children:a,panelClassName:r,resolvedPosition:e,showDivider:o,dividerColor:n,resizeConfig:s,floatingOffset:i,overlayDividerClassName:c,isBlocking:u,skipMountAnimation:_,style:t,...d})=>{const{refs:g}=U.useBmFloatingUIContext(),{handleRef:P}=w.usePanelResize({resizeConfig:s,position:e,floatingRef:g.floating,requireMount:!0}),x=i?{...t,[b("offset-x")]:i.x,[b("offset-y")]:i.y}:t;return l.jsxs(R.Content,{className:r,skipFloatingStyles:!0,overlay:u,...d,style:x,"data-position":e,..._?{"data-status":"open"}:{},children:[a,o&&l.jsx(N.InlineDivider,{position:e,className:c,dividerColor:n}),s&&l.jsx(h.PanelResizeHandle,{ref:P})]})},M=({contextValue:a,panelClassName:r,resolvedPosition:e,showDivider:o,modalType:n,closeOnOutsidePress:s,floatingOffset:i,open:c,onOpenChange:u,transitionConfig:_,dividerColor:t,children:d,resizeConfig:g,skipMountAnimation:P,...x})=>{const q=n==="isModal"||n==="alert",f=j.getPanelDismissConfig(n,s),m=p(v.styles[`${y}__overlay-divider`],v.styles[`${y}__overlay-divider--${e}`]);return l.jsx(I.PanelContext.Provider,{value:a,children:l.jsx(C.FloatingUIRoot,{open:c,onOpenChange:u,portalled:!0,transitionConfig:_,dismiss:f,focusConfiguration:q?!0:{modal:!1,closeOnFocusOut:!1},children:l.jsx(D,{panelClassName:r,resolvedPosition:e,showDivider:o,dividerColor:t,floatingOffset:i,overlayDividerClassName:m,isBlocking:q,resizeConfig:g,skipMountAnimation:P,...x,role:n==="alert"?"alertdialog":"dialog","aria-modal":q||void 0,children:d})})})};exports.OverlayPanel=M;
|
|
@@ -16,6 +16,8 @@ type OverlayPanelProps = {
|
|
|
16
16
|
children: React.ReactNode;
|
|
17
17
|
dividerColor?: PanelDividerColor;
|
|
18
18
|
resizeConfig?: PanelResizeConfig;
|
|
19
|
+
/** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
|
|
20
|
+
skipMountAnimation?: boolean;
|
|
19
21
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
20
|
-
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, floatingOffset, open, onOpenChange, transitionConfig, dividerColor, children, resizeConfig, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, floatingOffset, open, onOpenChange, transitionConfig, dividerColor, children, resizeConfig, skipMountAnimation, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -1,98 +1,109 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as t, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import h from "clsx";
|
|
3
|
+
import { g as F } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { PanelContext as
|
|
6
|
-
import { getPanelDismissConfig as
|
|
7
|
-
import { FloatingUIRoot as
|
|
8
|
-
import { Content as
|
|
9
|
-
import { a as
|
|
10
|
-
import { InlineDivider as
|
|
11
|
-
import { PanelResizeHandle as
|
|
12
|
-
import { usePanelResize as
|
|
13
|
-
import { s as
|
|
14
|
-
const { baseClassNamePrefix:
|
|
15
|
-
children:
|
|
5
|
+
import { PanelContext as I } from "./Panel.context.es.js";
|
|
6
|
+
import { getPanelDismissConfig as B } from "./Panel.helpers.es.js";
|
|
7
|
+
import { FloatingUIRoot as D } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
8
|
+
import { Content as M } from "../../FloatingUI/FloatingUI.content.es.js";
|
|
9
|
+
import { a as _ } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
10
|
+
import { InlineDivider as $ } from "./Panel.Divider.es.js";
|
|
11
|
+
import { PanelResizeHandle as b } from "./Panel.ResizeHandle.es.js";
|
|
12
|
+
import { usePanelResize as j } from "./Panel.useResize.es.js";
|
|
13
|
+
import { s as x } from "../../../chunks/panel.module.BblnuBjO.js";
|
|
14
|
+
const { baseClassNamePrefix: y, variable: C } = F("panel"), k = ({
|
|
15
|
+
children: i,
|
|
16
16
|
panelClassName: l,
|
|
17
17
|
resolvedPosition: o,
|
|
18
18
|
showDivider: n,
|
|
19
19
|
dividerColor: e,
|
|
20
|
-
resizeConfig:
|
|
20
|
+
resizeConfig: a,
|
|
21
21
|
floatingOffset: r,
|
|
22
22
|
overlayDividerClassName: m,
|
|
23
23
|
isBlocking: f,
|
|
24
|
+
skipMountAnimation: c,
|
|
24
25
|
style: s,
|
|
25
|
-
...
|
|
26
|
+
...p
|
|
26
27
|
}) => {
|
|
27
|
-
const { refs:
|
|
28
|
-
resizeConfig:
|
|
28
|
+
const { refs: d } = _(), { handleRef: u } = j({
|
|
29
|
+
resizeConfig: a,
|
|
29
30
|
position: o,
|
|
30
|
-
floatingRef:
|
|
31
|
+
floatingRef: d.floating,
|
|
31
32
|
requireMount: !0
|
|
32
|
-
}),
|
|
33
|
+
}), g = r ? {
|
|
33
34
|
...s,
|
|
34
|
-
[
|
|
35
|
-
[
|
|
35
|
+
[C("offset-x")]: r.x,
|
|
36
|
+
[C("offset-y")]: r.y
|
|
36
37
|
} : s;
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
|
|
38
|
+
return /* @__PURE__ */ R(
|
|
39
|
+
M,
|
|
39
40
|
{
|
|
40
41
|
className: l,
|
|
41
42
|
skipFloatingStyles: !0,
|
|
42
43
|
overlay: f,
|
|
43
|
-
...
|
|
44
|
-
style:
|
|
44
|
+
...p,
|
|
45
|
+
style: g,
|
|
45
46
|
"data-position": o,
|
|
47
|
+
...c ? { "data-status": "open" } : {},
|
|
46
48
|
children: [
|
|
47
|
-
|
|
48
|
-
n && /* @__PURE__ */ t(
|
|
49
|
-
|
|
49
|
+
i,
|
|
50
|
+
n && /* @__PURE__ */ t(
|
|
51
|
+
$,
|
|
52
|
+
{
|
|
53
|
+
position: o,
|
|
54
|
+
className: m,
|
|
55
|
+
dividerColor: e
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
a && /* @__PURE__ */ t(b, { ref: u })
|
|
50
59
|
]
|
|
51
60
|
}
|
|
52
61
|
);
|
|
53
|
-
},
|
|
54
|
-
contextValue:
|
|
62
|
+
}, Q = ({
|
|
63
|
+
contextValue: i,
|
|
55
64
|
panelClassName: l,
|
|
56
65
|
resolvedPosition: o,
|
|
57
66
|
showDivider: n,
|
|
58
67
|
modalType: e,
|
|
59
|
-
closeOnOutsidePress:
|
|
68
|
+
closeOnOutsidePress: a,
|
|
60
69
|
floatingOffset: r,
|
|
61
70
|
open: m,
|
|
62
71
|
onOpenChange: f,
|
|
63
|
-
transitionConfig:
|
|
64
|
-
dividerColor:
|
|
72
|
+
transitionConfig: c,
|
|
73
|
+
dividerColor: s,
|
|
65
74
|
children: p,
|
|
66
75
|
resizeConfig: d,
|
|
67
|
-
|
|
76
|
+
skipMountAnimation: u,
|
|
77
|
+
...g
|
|
68
78
|
}) => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
79
|
+
const v = e === "isModal" || e === "alert", N = B(e, a), P = h(
|
|
80
|
+
x[`${y}__overlay-divider`],
|
|
81
|
+
x[`${y}__overlay-divider--${o}`]
|
|
72
82
|
);
|
|
73
|
-
return /* @__PURE__ */ t(
|
|
74
|
-
|
|
83
|
+
return /* @__PURE__ */ t(I.Provider, { value: i, children: /* @__PURE__ */ t(
|
|
84
|
+
D,
|
|
75
85
|
{
|
|
76
86
|
open: m,
|
|
77
87
|
onOpenChange: f,
|
|
78
88
|
portalled: !0,
|
|
79
|
-
transitionConfig:
|
|
80
|
-
dismiss:
|
|
81
|
-
focusConfiguration:
|
|
89
|
+
transitionConfig: c,
|
|
90
|
+
dismiss: N,
|
|
91
|
+
focusConfiguration: v ? !0 : { modal: !1, closeOnFocusOut: !1 },
|
|
82
92
|
children: /* @__PURE__ */ t(
|
|
83
|
-
|
|
93
|
+
k,
|
|
84
94
|
{
|
|
85
95
|
panelClassName: l,
|
|
86
96
|
resolvedPosition: o,
|
|
87
97
|
showDivider: n,
|
|
88
|
-
dividerColor:
|
|
98
|
+
dividerColor: s,
|
|
89
99
|
floatingOffset: r,
|
|
90
|
-
overlayDividerClassName:
|
|
91
|
-
isBlocking:
|
|
100
|
+
overlayDividerClassName: P,
|
|
101
|
+
isBlocking: v,
|
|
92
102
|
resizeConfig: d,
|
|
93
|
-
|
|
103
|
+
skipMountAnimation: u,
|
|
104
|
+
...g,
|
|
94
105
|
role: e === "alert" ? "alertdialog" : "dialog",
|
|
95
|
-
"aria-modal":
|
|
106
|
+
"aria-modal": v || void 0,
|
|
96
107
|
children: p
|
|
97
108
|
}
|
|
98
109
|
)
|
|
@@ -100,5 +111,5 @@ const { baseClassNamePrefix: x, variable: y } = h("panel"), j = ({
|
|
|
100
111
|
) });
|
|
101
112
|
};
|
|
102
113
|
export {
|
|
103
|
-
|
|
114
|
+
Q as OverlayPanel
|
|
104
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),z=require("clsx"),g=require("react"),W=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const G=require("./Header/Panel.Header.cjs.js"),U=require("./Panel.Body.cjs.js"),Q=require("./Footer/Panel.Footer.cjs.js"),u=require("./Panel.helpers.cjs.js"),X=require("./Panel.Inline.cjs.js"),Y=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.CVyUzyCZ.js"),Z=165,k=100,ee=(t,d)=>{if(!t||d==="full")return;const f=d==="bottom",i=typeof t=="object"?t:{},r=i.minSize??(f?k:Z),o=i.maxSize??1/0,P=i.storageKey??"";return{minSize:r,maxSize:o,storageKey:P}},{baseClassNamePrefix:s}=W.getBEMClassNames("panel"),_=({children:t,className:d,padding:f="md",onOpenChange:i,open:r,size:o="md",dismissible:P=!0,closeButtonAriaLabel:v="Close panel",kind:n="inline",position:y,divider:R=!0,dividerColor:N,isAnimated:O=!0,onBeforeClose:B,modalType:a,offset:b,resizable:D,id:w,...p})=>{const l=u.getResolvedPanelPosition(y),c=ee(D,l),H=!!c;if(process.env.NODE_ENV!=="production"){c&&!c.storageKey&&console.warn("Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."),a==="alert"&&P&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');const{closeOnOutsidePress:V}=p;V&&a!=="nonModal"&&a!==void 0&&console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.')}const C=a==="alert"?!1:P,T=o&&(l!=="bottom"||o==="full"),h=n==="overlay"&&b?u.resolveOffset(b):void 0,q=!!h,$=z(e.styles[s],e.styles[`${s}--${n}`],T&&e.styles[`${s}--size-${o}`],e.styles[`${s}--padding-${f}`],e.styles[`${s}--position-${l}`],q&&e.styles[`${s}--floating`],H&&e.styles[`${s}--resizable`],d),A=z(e.styles[`${s}__inline-wrapper`],e.styles[`${s}__inline-wrapper--size-${o}`]),{requestClose:I,handleOverlayOpenChange:j}=u.usePanelClose(B,i),M=g.useMemo(()=>({kind:n,dismissible:C,closeButtonAriaLabel:v,position:y,requestClose:I}),[n,C,v,y,I]),{showDivider:F,dividerBefore:K,dividerInner:J,dividerAfter:L}=u.getPanelDividerState(R&&!q,l),S=g.useMemo(()=>({duration:O?u.PANEL_TRANSITION_DURATION_MS:0}),[O]),m=g.useRef(void 0),E=m.current!==void 0&&m.current!==n&&r===!0;return m.current=n,n==="inline"?x.jsx(X.InlinePanel,{contextValue:M,panelClassName:$,inlineWrapperClassName:A,resolvedPosition:l,dividerBefore:K,dividerInner:J,dividerAfter:L,dividerColor:N,open:r,transitionConfig:S,resizeConfig:c,skipMountAnimation:E,id:w,...p,children:t}):x.jsx(Y.OverlayPanel,{contextValue:M,panelClassName:$,resolvedPosition:l,showDivider:F,dividerColor:N,modalType:a,floatingOffset:h,open:r,onOpenChange:j,transitionConfig:S,resizeConfig:c,skipMountAnimation:E,id:w,...p,children:t})};_.displayName="Panel";_.Header=G.Header;_.Body=U.Body;_.Footer=Q.Footer;exports.Panel=_;
|