@viasat/beam-react 2.45.0 → 2.46.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("clsx"),i=require("../../chunks/classNames.DC8Ra4sw.js");require("../../chunks/constants.CgMu0_1M.js");const d=require("../Box/Box.cjs.js"),x=require("./Panel.context.cjs.js"),b=require("../../chunks/panel.module.BzLGa7GY.js"),{subElementClassPrefix:m}=i.getBEMClassNames("panel"),B=`${m}body`,e=({children:s,className:o,backgroundColor:t,...n})=>{const{backgroundColor:r}=x.usePanelContext(),l=t??r,a=u(b.styles[B],o);return c.jsx(d.Box,{className:a,backgroundColor:l,...n,children:s})};e.displayName="Panel.Body";exports.Body=e;
|
|
@@ -11,6 +11,6 @@ export interface PanelBodyProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
11
11
|
backgroundColor?: BoxBackgroundColor;
|
|
12
12
|
}
|
|
13
13
|
export declare const Body: {
|
|
14
|
-
({ children, className: _className, backgroundColor,
|
|
14
|
+
({ children, className: _className, backgroundColor, ...props }: PanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
displayName: string;
|
|
16
16
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import n from "clsx";
|
|
3
|
+
import { g as c } from "../../chunks/classNames.ZWNk1hey.js";
|
|
4
4
|
import "../../chunks/constants.Cruz2A1w.js";
|
|
5
|
-
import { Box as
|
|
6
|
-
import { usePanelContext as
|
|
7
|
-
import { s as
|
|
8
|
-
const { subElementClassPrefix:
|
|
5
|
+
import { Box as p } from "../Box/Box.es.js";
|
|
6
|
+
import { usePanelContext as i } from "./Panel.context.es.js";
|
|
7
|
+
import { s as d } from "../../chunks/panel.module.CgFBtvbR.js";
|
|
8
|
+
const { subElementClassPrefix: f } = c("panel"), x = `${f}body`, C = ({
|
|
9
9
|
children: o,
|
|
10
10
|
className: s,
|
|
11
11
|
backgroundColor: r,
|
|
12
|
-
|
|
13
|
-
...e
|
|
12
|
+
...t
|
|
14
13
|
}) => {
|
|
15
|
-
const { backgroundColor:
|
|
16
|
-
return /* @__PURE__ */
|
|
14
|
+
const { backgroundColor: e } = i(), a = r ?? e, m = n(d[x], s);
|
|
15
|
+
return /* @__PURE__ */ l(p, { className: m, backgroundColor: a, ...t, children: o });
|
|
17
16
|
};
|
|
18
|
-
|
|
17
|
+
C.displayName = "Panel.Body";
|
|
19
18
|
export {
|
|
20
|
-
|
|
19
|
+
C as Body
|
|
21
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),S=require("clsx"),I=require("react"),h=require("../../chunks/classNames.DC8Ra4sw.js");require("../../chunks/constants.CgMu0_1M.js");const k=require("./Panel.context.cjs.js"),D=require("./Panel.helpers.cjs.js"),z=require("../FloatingUI/FloatingUI.root.cjs.js"),$=require("../FloatingUI/FloatingUI.content.cjs.js"),A=require("../../chunks/FloatingUI.context.B15Tz_4h.js"),B=require("./Panel.Divider.cjs.js"),H=require("./Panel.ResizeHandle.cjs.js"),O=require("./Panel.useResize.cjs.js"),g=require("../../chunks/panel.module.BzLGa7GY.js"),{baseClassNamePrefix:C,variable:j}=h.getBEMClassNames("panel");function R(s,a,e){if(!(!s&&!a&&!e))return{...s,...a,...e?{[j("offset-x")]:e.x,[j("offset-y")]:e.y}:null}}const T=({children:s,panelClassName:a,resolvedPosition:e,showDivider:_,dividerColor:n,resizeConfig:o,floatingOffset:v,overlayDividerClassName:P,isBlocking:d,cssVarStyle:y,skipMountAnimation:m,container:r,style:x,...b})=>{const{refs:q}=A.useBmFloatingUIContext(),{handleRef:i}=O.usePanelResize({resizeConfig:o,position:e,floatingRef:q.floating,requireMount:!0,container:r}),l=R(x,y,v),f=I.useMemo(()=>d?r?{lockScroll:!1}:!0:{lockScroll:!1},[d,r]);return t.jsxs($.Content,{className:a,skipFloatingStyles:!0,overlay:f,...b,style:l,"data-position":e,...m?{"data-status":"open"}:{},children:[s,_&&t.jsx(B.InlineDivider,{position:e,className:P,dividerColor:n}),o&&t.jsx(H.PanelResizeHandle,{ref:i})]})},E=({contextValue:s,panelClassName:a,resolvedPosition:e,showDivider:_,modalType:n,closeOnOutsidePress:o,floatingOffset:v,open:P,onOpenChange:d,transitionConfig:y,dividerColor:m,children:r,resizeConfig:x,cssVarStyle:b,skipMountAnimation:q,container:i,triggerRef:l,...f})=>{const u=n??"isModal",p=u==="isModal"||u==="alert",M=I.useCallback(c=>{const F=(l==null?void 0:l.current)??null;return!(F&&c.target instanceof Node&&F.contains(c.target))},[l]),U=I.useMemo(()=>{const c=D.getPanelDismissConfig(n,o);return!l||!(u==="isModal"||u==="nonModal"&&(o??!1))?c:{...c??{},outsidePress:M}},[n,u,o,l,M]),N=S(g.styles[`${C}__overlay-divider`],g.styles[`${C}__overlay-divider--${e}`]);return t.jsx(k.PanelContext.Provider,{value:s,children:t.jsx(z.FloatingUIRoot,{open:P,onOpenChange:d,portalled:i?{root:i,preserveTabOrder:!1}:{preserveTabOrder:!1},transitionConfig:y,dismiss:U,focusConfiguration:p?{modal:!0}:{modal:!1,guards:!1,closeOnFocusOut:!1},children:t.jsx(T,{panelClassName:a,resolvedPosition:e,showDivider:_,dividerColor:m,floatingOffset:v,overlayDividerClassName:N,isBlocking:p,resizeConfig:x,cssVarStyle:b,skipMountAnimation:q,container:i,...f,role:n==="alert"?"alertdialog":"dialog","aria-modal":p||void 0,children:r})})})};exports.OverlayPanel=E;
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { g as
|
|
1
|
+
import { jsx as d, jsxs as $ } from "react/jsx-runtime";
|
|
2
|
+
import g from "clsx";
|
|
3
|
+
import { useCallback as j, useMemo as S } from "react";
|
|
4
|
+
import { g as A } from "../../chunks/classNames.ZWNk1hey.js";
|
|
5
5
|
import "../../chunks/constants.Cruz2A1w.js";
|
|
6
|
-
import { PanelContext as
|
|
7
|
-
import { getPanelDismissConfig as
|
|
6
|
+
import { PanelContext as B } from "./Panel.context.es.js";
|
|
7
|
+
import { getPanelDismissConfig as U } from "./Panel.helpers.es.js";
|
|
8
8
|
import { FloatingUIRoot as q } from "../FloatingUI/FloatingUI.root.es.js";
|
|
9
9
|
import { Content as z } from "../FloatingUI/FloatingUI.content.es.js";
|
|
10
10
|
import { a as E } from "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
11
11
|
import { InlineDivider as H } from "./Panel.Divider.es.js";
|
|
12
|
-
import { PanelResizeHandle as
|
|
13
|
-
import { usePanelResize as
|
|
14
|
-
import { s as
|
|
15
|
-
const { baseClassNamePrefix:
|
|
16
|
-
function
|
|
17
|
-
if (!(!
|
|
12
|
+
import { PanelResizeHandle as T } from "./Panel.ResizeHandle.es.js";
|
|
13
|
+
import { usePanelResize as w } from "./Panel.useResize.es.js";
|
|
14
|
+
import { s as k } from "../../chunks/panel.module.CgFBtvbR.js";
|
|
15
|
+
const { baseClassNamePrefix: F, variable: I } = A("panel");
|
|
16
|
+
function G(r, s, o) {
|
|
17
|
+
if (!(!r && !s && !o))
|
|
18
18
|
return {
|
|
19
|
-
...t,
|
|
20
19
|
...r,
|
|
20
|
+
...s,
|
|
21
21
|
...o ? {
|
|
22
|
-
[
|
|
23
|
-
[
|
|
22
|
+
[I("offset-x")]: o.x,
|
|
23
|
+
[I("offset-y")]: o.y
|
|
24
24
|
} : null
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
children:
|
|
29
|
-
panelClassName:
|
|
27
|
+
const J = ({
|
|
28
|
+
children: r,
|
|
29
|
+
panelClassName: s,
|
|
30
30
|
resolvedPosition: o,
|
|
31
|
-
showDivider:
|
|
32
|
-
dividerColor:
|
|
31
|
+
showDivider: c,
|
|
32
|
+
dividerColor: a,
|
|
33
33
|
resizeConfig: l,
|
|
34
34
|
floatingOffset: f,
|
|
35
35
|
overlayDividerClassName: p,
|
|
36
|
-
isBlocking:
|
|
36
|
+
isBlocking: u,
|
|
37
37
|
cssVarStyle: v,
|
|
38
38
|
skipMountAnimation: y,
|
|
39
|
-
container:
|
|
39
|
+
container: t,
|
|
40
40
|
style: x,
|
|
41
41
|
...C
|
|
42
42
|
}) => {
|
|
43
|
-
const { refs: M } = E(), { handleRef: n } =
|
|
43
|
+
const { refs: M } = E(), { handleRef: n } = w({
|
|
44
44
|
resizeConfig: l,
|
|
45
45
|
position: o,
|
|
46
46
|
floatingRef: M.floating,
|
|
47
47
|
requireMount: !0,
|
|
48
|
-
container:
|
|
49
|
-
}), e =
|
|
50
|
-
() =>
|
|
51
|
-
[
|
|
48
|
+
container: t
|
|
49
|
+
}), e = G(x, v, f), P = S(
|
|
50
|
+
() => u ? t ? { lockScroll: !1 } : !0 : { lockScroll: !1 },
|
|
51
|
+
[u, t]
|
|
52
52
|
);
|
|
53
53
|
return /* @__PURE__ */ $(
|
|
54
54
|
z,
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
56
|
+
className: s,
|
|
57
57
|
skipFloatingStyles: !0,
|
|
58
58
|
overlay: P,
|
|
59
59
|
...C,
|
|
@@ -61,32 +61,32 @@ const K = ({
|
|
|
61
61
|
"data-position": o,
|
|
62
62
|
...y ? { "data-status": "open" } : {},
|
|
63
63
|
children: [
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
r,
|
|
65
|
+
c && /* @__PURE__ */ d(
|
|
66
66
|
H,
|
|
67
67
|
{
|
|
68
68
|
position: o,
|
|
69
69
|
className: p,
|
|
70
|
-
dividerColor:
|
|
70
|
+
dividerColor: a
|
|
71
71
|
}
|
|
72
72
|
),
|
|
73
|
-
l && /* @__PURE__ */
|
|
73
|
+
l && /* @__PURE__ */ d(T, { ref: n })
|
|
74
74
|
]
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
},
|
|
78
|
-
contextValue:
|
|
79
|
-
panelClassName:
|
|
77
|
+
}, ao = ({
|
|
78
|
+
contextValue: r,
|
|
79
|
+
panelClassName: s,
|
|
80
80
|
resolvedPosition: o,
|
|
81
|
-
showDivider:
|
|
82
|
-
modalType:
|
|
81
|
+
showDivider: c,
|
|
82
|
+
modalType: a,
|
|
83
83
|
closeOnOutsidePress: l,
|
|
84
84
|
floatingOffset: f,
|
|
85
85
|
open: p,
|
|
86
|
-
onOpenChange:
|
|
86
|
+
onOpenChange: u,
|
|
87
87
|
transitionConfig: v,
|
|
88
88
|
dividerColor: y,
|
|
89
|
-
children:
|
|
89
|
+
children: t,
|
|
90
90
|
resizeConfig: x,
|
|
91
91
|
cssVarStyle: C,
|
|
92
92
|
skipMountAnimation: M,
|
|
@@ -94,40 +94,40 @@ const K = ({
|
|
|
94
94
|
triggerRef: e,
|
|
95
95
|
...P
|
|
96
96
|
}) => {
|
|
97
|
-
const i =
|
|
97
|
+
const i = a ?? "isModal", N = i === "isModal" || i === "alert", h = j(
|
|
98
98
|
(m) => {
|
|
99
|
-
const
|
|
100
|
-
return !(
|
|
99
|
+
const b = (e == null ? void 0 : e.current) ?? null;
|
|
100
|
+
return !(b && m.target instanceof Node && b.contains(m.target));
|
|
101
101
|
},
|
|
102
102
|
[e]
|
|
103
|
-
),
|
|
104
|
-
const m =
|
|
105
|
-
return !e || !(i === "isModal" || i === "nonModal" && (l ?? !1)) ? m : { ...m ?? {}, outsidePress:
|
|
103
|
+
), _ = S(() => {
|
|
104
|
+
const m = U(a, l);
|
|
105
|
+
return !e || !(i === "isModal" || i === "nonModal" && (l ?? !1)) ? m : { ...m ?? {}, outsidePress: h };
|
|
106
106
|
}, [
|
|
107
|
-
|
|
107
|
+
a,
|
|
108
108
|
i,
|
|
109
109
|
l,
|
|
110
110
|
e,
|
|
111
|
-
|
|
112
|
-
]), D =
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
h
|
|
112
|
+
]), D = g(
|
|
113
|
+
k[`${F}__overlay-divider`],
|
|
114
|
+
k[`${F}__overlay-divider--${o}`]
|
|
115
115
|
);
|
|
116
|
-
return /* @__PURE__ */
|
|
116
|
+
return /* @__PURE__ */ d(B.Provider, { value: r, children: /* @__PURE__ */ d(
|
|
117
117
|
q,
|
|
118
118
|
{
|
|
119
119
|
open: p,
|
|
120
|
-
onOpenChange:
|
|
121
|
-
portalled: n ? { root: n } : !
|
|
120
|
+
onOpenChange: u,
|
|
121
|
+
portalled: n ? { root: n, preserveTabOrder: !1 } : { preserveTabOrder: !1 },
|
|
122
122
|
transitionConfig: v,
|
|
123
|
-
dismiss:
|
|
124
|
-
focusConfiguration: N ? !0 : { modal: !1, closeOnFocusOut: !1 },
|
|
125
|
-
children: /* @__PURE__ */
|
|
126
|
-
|
|
123
|
+
dismiss: _,
|
|
124
|
+
focusConfiguration: N ? { modal: !0 } : { modal: !1, guards: !1, closeOnFocusOut: !1 },
|
|
125
|
+
children: /* @__PURE__ */ d(
|
|
126
|
+
J,
|
|
127
127
|
{
|
|
128
|
-
panelClassName:
|
|
128
|
+
panelClassName: s,
|
|
129
129
|
resolvedPosition: o,
|
|
130
|
-
showDivider:
|
|
130
|
+
showDivider: c,
|
|
131
131
|
dividerColor: y,
|
|
132
132
|
floatingOffset: f,
|
|
133
133
|
overlayDividerClassName: D,
|
|
@@ -137,14 +137,14 @@ const K = ({
|
|
|
137
137
|
skipMountAnimation: M,
|
|
138
138
|
container: n,
|
|
139
139
|
...P,
|
|
140
|
-
role:
|
|
140
|
+
role: a === "alert" ? "alertdialog" : "dialog",
|
|
141
141
|
"aria-modal": N || void 0,
|
|
142
|
-
children:
|
|
142
|
+
children: t
|
|
143
143
|
}
|
|
144
144
|
)
|
|
145
145
|
}
|
|
146
146
|
) });
|
|
147
147
|
};
|
|
148
148
|
export {
|
|
149
|
-
|
|
149
|
+
ao as OverlayPanel
|
|
150
150
|
};
|
package/lib/Panel/Panel.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare const Panel: {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
Body: {
|
|
34
|
-
({ children, className: _className, backgroundColor,
|
|
34
|
+
({ children, className: _className, backgroundColor, ...props }: import('./Panel.Body').PanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
displayName: string;
|
|
36
36
|
};
|
|
37
37
|
Footer: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.46.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.46.0",
|
|
63
|
+
"@viasat/beam-shared": "2.46.0",
|
|
64
|
+
"@viasat/beam-styles": "2.46.0",
|
|
65
|
+
"@viasat/beam-tokens": "2.46.0",
|
|
66
|
+
"@viasat/beam-icons": "2.46.0",
|
|
67
67
|
"clsx": "^1.2.1",
|
|
68
68
|
"@floating-ui/react": "^0.26.18",
|
|
69
69
|
"@stepperize/react": "^5.1.5",
|