@viasat/beam-react 2.29.1 → 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/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 +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=_;
|
|
@@ -1,116 +1,124 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { g as
|
|
1
|
+
import { jsx as S } from "react/jsx-runtime";
|
|
2
|
+
import z from "clsx";
|
|
3
|
+
import { useMemo as x, useRef as W } from "react";
|
|
4
|
+
import { g as q } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
5
5
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
6
|
-
import { Header as
|
|
7
|
-
import { Body as
|
|
8
|
-
import { Footer as
|
|
9
|
-
import { resolveOffset as
|
|
10
|
-
import { InlinePanel as
|
|
11
|
-
import { OverlayPanel as
|
|
6
|
+
import { Header as G } from "./Header/Panel.Header.es.js";
|
|
7
|
+
import { Body as U } from "./Panel.Body.es.js";
|
|
8
|
+
import { Footer as Q } from "./Footer/Panel.Footer.es.js";
|
|
9
|
+
import { resolveOffset as X, usePanelClose as Y, getPanelDividerState as Z, PANEL_TRANSITION_DURATION_MS as k, getResolvedPanelPosition as ee } from "./Panel.helpers.es.js";
|
|
10
|
+
import { InlinePanel as oe } from "./Panel.Inline.es.js";
|
|
11
|
+
import { OverlayPanel as se } from "./Panel.Overlay.es.js";
|
|
12
12
|
import { s as e } from "../../../chunks/panel.module.BblnuBjO.js";
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
15
|
-
const p = m === "bottom",
|
|
16
|
-
return { minSize:
|
|
17
|
-
}, { baseClassNamePrefix: o } =
|
|
18
|
-
children:
|
|
13
|
+
const ne = 165, te = 100, re = (n, m) => {
|
|
14
|
+
if (!n || m === "full") return;
|
|
15
|
+
const p = m === "bottom", i = typeof n == "object" ? n : {}, a = i.minSize ?? (p ? te : ne), t = i.maxSize ?? 1 / 0, f = i.storageKey ?? "";
|
|
16
|
+
return { minSize: a, maxSize: t, storageKey: f };
|
|
17
|
+
}, { baseClassNamePrefix: o } = q("panel"), d = ({
|
|
18
|
+
children: n,
|
|
19
19
|
className: m,
|
|
20
20
|
padding: p = "md",
|
|
21
|
-
onOpenChange:
|
|
22
|
-
open:
|
|
23
|
-
size:
|
|
21
|
+
onOpenChange: i,
|
|
22
|
+
open: a,
|
|
23
|
+
size: t = "md",
|
|
24
24
|
dismissible: f = !0,
|
|
25
25
|
closeButtonAriaLabel: N = "Close panel",
|
|
26
|
-
kind:
|
|
27
|
-
position:
|
|
28
|
-
divider:
|
|
29
|
-
dividerColor:
|
|
30
|
-
isAnimated:
|
|
31
|
-
onBeforeClose:
|
|
32
|
-
modalType:
|
|
33
|
-
offset:
|
|
34
|
-
resizable:
|
|
26
|
+
kind: s = "inline",
|
|
27
|
+
position: u,
|
|
28
|
+
divider: D = !0,
|
|
29
|
+
dividerColor: P,
|
|
30
|
+
isAnimated: O = !0,
|
|
31
|
+
onBeforeClose: A,
|
|
32
|
+
modalType: l,
|
|
33
|
+
offset: C,
|
|
34
|
+
resizable: B,
|
|
35
35
|
id: _,
|
|
36
|
-
...
|
|
36
|
+
...g
|
|
37
37
|
}) => {
|
|
38
|
-
const
|
|
38
|
+
const r = ee(u), c = re(B, r), R = !!c;
|
|
39
39
|
if (process.env.NODE_ENV !== "production") {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
c && !c.storageKey && console.warn(
|
|
41
|
+
"Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."
|
|
42
|
+
), l === "alert" && f && console.warn(
|
|
43
|
+
'Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'
|
|
44
|
+
);
|
|
45
|
+
const { closeOnOutsidePress: V } = g;
|
|
46
|
+
V && l !== "nonModal" && l !== void 0 && console.warn(
|
|
47
|
+
'Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'
|
|
48
|
+
);
|
|
43
49
|
}
|
|
44
|
-
const y =
|
|
50
|
+
const y = l === "alert" ? !1 : f, T = t && (r !== "bottom" || t === "full"), $ = s === "overlay" && C ? X(C) : void 0, h = !!$, I = z(
|
|
45
51
|
e[o],
|
|
46
|
-
e[`${o}--${
|
|
47
|
-
T && e[`${o}--size-${
|
|
52
|
+
e[`${o}--${s}`],
|
|
53
|
+
T && e[`${o}--size-${t}`],
|
|
48
54
|
e[`${o}--padding-${p}`],
|
|
49
|
-
e[`${o}--position-${
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
e[`${o}--position-${r}`],
|
|
56
|
+
h && e[`${o}--floating`],
|
|
57
|
+
R && e[`${o}--resizable`],
|
|
52
58
|
m
|
|
53
|
-
),
|
|
59
|
+
), H = z(
|
|
54
60
|
e[`${o}__inline-wrapper`],
|
|
55
|
-
e[`${o}__inline-wrapper--size-${
|
|
56
|
-
), { requestClose:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
),
|
|
61
|
+
e[`${o}__inline-wrapper--size-${t}`]
|
|
62
|
+
), { requestClose: b, handleOverlayOpenChange: K } = Y(
|
|
63
|
+
A,
|
|
64
|
+
i
|
|
65
|
+
), w = x(
|
|
60
66
|
() => ({
|
|
61
|
-
kind:
|
|
67
|
+
kind: s,
|
|
62
68
|
dismissible: y,
|
|
63
69
|
closeButtonAriaLabel: N,
|
|
64
|
-
position:
|
|
65
|
-
requestClose:
|
|
70
|
+
position: u,
|
|
71
|
+
requestClose: b
|
|
66
72
|
}),
|
|
67
|
-
[
|
|
68
|
-
), { showDivider:
|
|
69
|
-
() => ({ duration:
|
|
70
|
-
[
|
|
71
|
-
);
|
|
72
|
-
return
|
|
73
|
-
|
|
73
|
+
[s, y, N, u, b]
|
|
74
|
+
), { showDivider: F, dividerBefore: j, dividerInner: J, dividerAfter: L } = Z(D && !h, r), E = x(
|
|
75
|
+
() => ({ duration: O ? k : 0 }),
|
|
76
|
+
[O]
|
|
77
|
+
), v = W(void 0), M = v.current !== void 0 && v.current !== s && a === !0;
|
|
78
|
+
return v.current = s, s === "inline" ? /* @__PURE__ */ S(
|
|
79
|
+
oe,
|
|
74
80
|
{
|
|
75
|
-
contextValue:
|
|
81
|
+
contextValue: w,
|
|
76
82
|
panelClassName: I,
|
|
77
|
-
inlineWrapperClassName:
|
|
78
|
-
resolvedPosition:
|
|
79
|
-
dividerBefore:
|
|
80
|
-
dividerInner:
|
|
81
|
-
dividerAfter:
|
|
82
|
-
dividerColor:
|
|
83
|
-
open:
|
|
84
|
-
transitionConfig:
|
|
85
|
-
resizeConfig:
|
|
83
|
+
inlineWrapperClassName: H,
|
|
84
|
+
resolvedPosition: r,
|
|
85
|
+
dividerBefore: j,
|
|
86
|
+
dividerInner: J,
|
|
87
|
+
dividerAfter: L,
|
|
88
|
+
dividerColor: P,
|
|
89
|
+
open: a,
|
|
90
|
+
transitionConfig: E,
|
|
91
|
+
resizeConfig: c,
|
|
92
|
+
skipMountAnimation: M,
|
|
86
93
|
id: _,
|
|
87
|
-
...
|
|
88
|
-
children:
|
|
94
|
+
...g,
|
|
95
|
+
children: n
|
|
89
96
|
}
|
|
90
|
-
) : /* @__PURE__ */
|
|
91
|
-
|
|
97
|
+
) : /* @__PURE__ */ S(
|
|
98
|
+
se,
|
|
92
99
|
{
|
|
93
|
-
contextValue:
|
|
100
|
+
contextValue: w,
|
|
94
101
|
panelClassName: I,
|
|
95
|
-
resolvedPosition:
|
|
96
|
-
showDivider:
|
|
97
|
-
dividerColor:
|
|
98
|
-
modalType:
|
|
102
|
+
resolvedPosition: r,
|
|
103
|
+
showDivider: F,
|
|
104
|
+
dividerColor: P,
|
|
105
|
+
modalType: l,
|
|
99
106
|
floatingOffset: $,
|
|
100
|
-
open:
|
|
101
|
-
onOpenChange:
|
|
102
|
-
transitionConfig:
|
|
103
|
-
resizeConfig:
|
|
107
|
+
open: a,
|
|
108
|
+
onOpenChange: K,
|
|
109
|
+
transitionConfig: E,
|
|
110
|
+
resizeConfig: c,
|
|
111
|
+
skipMountAnimation: M,
|
|
104
112
|
id: _,
|
|
105
|
-
...
|
|
106
|
-
children:
|
|
113
|
+
...g,
|
|
114
|
+
children: n
|
|
107
115
|
}
|
|
108
116
|
);
|
|
109
117
|
};
|
|
110
118
|
d.displayName = "Panel";
|
|
111
|
-
d.Header =
|
|
112
|
-
d.Body =
|
|
113
|
-
d.Footer =
|
|
119
|
+
d.Header = G;
|
|
120
|
+
d.Body = U;
|
|
121
|
+
d.Footer = Q;
|
|
114
122
|
export {
|
|
115
123
|
d as Panel
|
|
116
124
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.0",
|
|
4
4
|
"description": "React component library for the Beam design system",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Viasat",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@viasat/beam-fonts": "2.
|
|
63
|
-
"@viasat/beam-shared": "2.
|
|
64
|
-
"@viasat/beam-styles": "2.
|
|
65
|
-
"@viasat/beam-tokens": "2.
|
|
66
|
-
"@viasat/beam-icons": "2.
|
|
62
|
+
"@viasat/beam-fonts": "2.30.0",
|
|
63
|
+
"@viasat/beam-shared": "2.30.0",
|
|
64
|
+
"@viasat/beam-styles": "2.30.0",
|
|
65
|
+
"@viasat/beam-tokens": "2.30.0",
|
|
66
|
+
"@viasat/beam-icons": "2.30.0",
|
|
67
67
|
"clsx": "^1.2.1",
|
|
68
68
|
"@floating-ui/react": "^0.26.18",
|
|
69
69
|
"@stepperize/react": "^5.1.5",
|