@viasat/beam-react 2.16.0 → 2.17.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.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +2 -1
- package/lib/wip/Panel/Panel.Overlay.es.js +36 -33
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.es.js +68 -66
- package/lib/wip/Panel/Panel.helpers.cjs.js +1 -1
- package/lib/wip/Panel/Panel.helpers.d.ts +12 -1
- package/lib/wip/Panel/Panel.helpers.es.js +29 -25
- package/lib/wip/Panel/Panel.types.d.ts +6 -0
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),m=require("clsx"),x=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const b=require("./Panel.context.cjs.js"),p=require("./Panel.helpers.cjs.js"),y=require("../../FloatingUI/FloatingUI.root.cjs.js"),C=require("../../FloatingUI/FloatingUI.content.cjs.js"),I=require("./Panel.Inline.cjs.js"),n=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:t}=x.getBEMClassNames("panel"),f=({contextValue:r,panelClassName:a,resolvedPosition:l,showDivider:o,modalType:e,closeOnOutsidePress:c,open:_,onOpenChange:u,transitionConfig:d,children:g,...v})=>{const s=e==="isModal"||e==="alert",P=p.getPanelDismissConfig(e,c),q=m(n.styles[`${t}__overlay-divider`],n.styles[`${t}__overlay-divider--${l}`]);return i.jsx(b.PanelContext.Provider,{value:r,children:i.jsx(y.FloatingUIRoot,{open:_,onOpenChange:u,portalled:!0,transitionConfig:d,dismiss:P,focusConfiguration:s||void 0,children:i.jsxs(C.Content,{className:a,skipFloatingStyles:!0,overlay:s,...v,role:e==="alert"?"alertdialog":"dialog","data-position":l,children:[g,o&&i.jsx(I.InlineDivider,{position:l,className:q})]})})})};exports.OverlayPanel=f;
|
|
@@ -8,10 +8,11 @@ type OverlayPanelProps = {
|
|
|
8
8
|
resolvedPosition: PanelPosition;
|
|
9
9
|
showDivider: boolean;
|
|
10
10
|
modalType?: PanelModalType;
|
|
11
|
+
closeOnOutsidePress?: boolean;
|
|
11
12
|
open?: boolean;
|
|
12
13
|
onOpenChange?: FloatingUIProps['onOpenChange'];
|
|
13
14
|
transitionConfig: UseTransitionStylesProps;
|
|
14
15
|
children: React.ReactNode;
|
|
15
16
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
16
|
-
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, open, onOpenChange, transitionConfig, children, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, open, onOpenChange, transitionConfig, children, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
export {};
|
|
@@ -1,48 +1,51 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import x from "clsx";
|
|
3
|
+
import { g as N } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { PanelContext as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
5
|
+
import { PanelContext as y } from "./Panel.context.es.js";
|
|
6
|
+
import { getPanelDismissConfig as _ } from "./Panel.helpers.es.js";
|
|
7
|
+
import { FloatingUIRoot as h } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
8
|
+
import { Content as D } from "../../FloatingUI/FloatingUI.content.es.js";
|
|
9
|
+
import { InlineDivider as P } from "./Panel.Inline.es.js";
|
|
10
|
+
import { s as t } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
11
|
+
const { baseClassNamePrefix: e } = N("panel"), R = ({
|
|
11
12
|
contextValue: a,
|
|
12
|
-
panelClassName:
|
|
13
|
-
resolvedPosition:
|
|
14
|
-
showDivider:
|
|
15
|
-
modalType:
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
panelClassName: l,
|
|
14
|
+
resolvedPosition: o,
|
|
15
|
+
showDivider: n,
|
|
16
|
+
modalType: i,
|
|
17
|
+
closeOnOutsidePress: m,
|
|
18
|
+
open: f,
|
|
19
|
+
onOpenChange: c,
|
|
18
20
|
transitionConfig: d,
|
|
19
21
|
children: p,
|
|
20
|
-
...
|
|
22
|
+
...g
|
|
21
23
|
}) => {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
const s = i === "isModal" || i === "alert", v = _(i, m), C = x(
|
|
25
|
+
t[`${e}__overlay-divider`],
|
|
26
|
+
t[`${e}__overlay-divider--${o}`]
|
|
25
27
|
);
|
|
26
|
-
return /* @__PURE__ */ r(
|
|
27
|
-
|
|
28
|
+
return /* @__PURE__ */ r(y.Provider, { value: a, children: /* @__PURE__ */ r(
|
|
29
|
+
h,
|
|
28
30
|
{
|
|
29
|
-
open:
|
|
30
|
-
onOpenChange:
|
|
31
|
+
open: f,
|
|
32
|
+
onOpenChange: c,
|
|
31
33
|
portalled: !0,
|
|
32
34
|
transitionConfig: d,
|
|
33
|
-
dismiss:
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
dismiss: v,
|
|
36
|
+
focusConfiguration: s || void 0,
|
|
37
|
+
children: /* @__PURE__ */ u(
|
|
38
|
+
D,
|
|
36
39
|
{
|
|
37
|
-
className:
|
|
40
|
+
className: l,
|
|
38
41
|
skipFloatingStyles: !0,
|
|
39
|
-
overlay:
|
|
40
|
-
...
|
|
41
|
-
role:
|
|
42
|
-
"data-position":
|
|
42
|
+
overlay: s,
|
|
43
|
+
...g,
|
|
44
|
+
role: i === "alert" ? "alertdialog" : "dialog",
|
|
45
|
+
"data-position": o,
|
|
43
46
|
children: [
|
|
44
47
|
p,
|
|
45
|
-
|
|
48
|
+
n && /* @__PURE__ */ r(P, { position: o, className: C })
|
|
46
49
|
]
|
|
47
50
|
}
|
|
48
51
|
)
|
|
@@ -50,5 +53,5 @@ const { baseClassNamePrefix: i } = u("panel"), B = ({
|
|
|
50
53
|
) });
|
|
51
54
|
};
|
|
52
55
|
export {
|
|
53
|
-
|
|
56
|
+
R as OverlayPanel
|
|
54
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),f=require("clsx"),q=require("react"),S=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const j=require("./Panel.Header.cjs.js"),B=require("./Panel.Body.cjs.js"),F=require("./Panel.Footer.cjs.js"),i=require("./Panel.helpers.cjs.js"),H=require("./Panel.Inline.cjs.js"),T=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:s}=S.getBEMClassNames("panel"),l=({children:c,className:b,padding:C="md",onOpenChange:g,open:u,size:a,dismissible:_=!0,closeButtonAriaLabel:d="Close panel",kind:P="inline",position:o,divider:$=!0,isAnimated:p=!0,onBeforeClose:h,modalType:n,...t})=>{process.env.NODE_ENV!=="production"&&n==="alert"&&_&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'),process.env.NODE_ENV!=="production"&&t.closeOnOutsidePress&&n!=="nonModal"&&n!==void 0&&console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.');const N=n==="alert"?!1:_,r=i.getResolvedPanelPosition(o),v=f(e.styles[s],e.styles[`${s}--${P}`],a&&e.styles[`${s}--size-${a}`],e.styles[`${s}--padding-${C}`],e.styles[`${s}--position-${r}`],b),M=f(e.styles[`${s}__inline-wrapper`],a==="full"&&e.styles[`${s}__inline-wrapper--full`]),{requestClose:y,handleOverlayOpenChange:x}=i.usePanelClose(h,g),m=q.useMemo(()=>({dismissible:N,closeButtonAriaLabel:d,position:o,requestClose:y}),[N,d,o,y]),{showDivider:D,dividerBefore:E,dividerInner:I,dividerAfter:R}=i.getPanelDividerState($,r),w=q.useMemo(()=>({duration:p?i.PANEL_TRANSITION_DURATION_MS:0}),[p]);return P==="inline"?O.jsx(H.InlinePanel,{contextValue:m,panelClassName:v,inlineWrapperClassName:M,resolvedPosition:r,dividerBefore:E,dividerInner:I,dividerAfter:R,open:u,transitionConfig:w,...t,children:c}):O.jsx(T.OverlayPanel,{contextValue:m,panelClassName:v,resolvedPosition:r,showDivider:D,modalType:n,open:u,onOpenChange:x,transitionConfig:w,...t,children:c})};l.displayName="Panel";l.Header=j.Header;l.Body=B.Body;l.Footer=F.Footer;exports.Panel=l;
|
|
@@ -1,90 +1,92 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import $ from "clsx";
|
|
3
|
+
import { useMemo as g } from "react";
|
|
4
4
|
import { g as R } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
5
5
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
6
6
|
import { Header as S } from "./Panel.Header.es.js";
|
|
7
|
-
import { Body as
|
|
7
|
+
import { Body as V } from "./Panel.Body.es.js";
|
|
8
8
|
import { Footer as A } from "./Panel.Footer.es.js";
|
|
9
|
-
import { usePanelClose as F, getPanelDividerState as H, PANEL_TRANSITION_DURATION_MS as
|
|
9
|
+
import { usePanelClose as F, getPanelDividerState as H, PANEL_TRANSITION_DURATION_MS as T, getResolvedPanelPosition as j } from "./Panel.helpers.es.js";
|
|
10
10
|
import { InlinePanel as q } from "./Panel.Inline.es.js";
|
|
11
11
|
import { OverlayPanel as U } from "./Panel.Overlay.es.js";
|
|
12
12
|
import { s as e } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
13
|
-
const { baseClassNamePrefix:
|
|
14
|
-
children:
|
|
15
|
-
className:
|
|
13
|
+
const { baseClassNamePrefix: o } = R("panel"), r = ({
|
|
14
|
+
children: l,
|
|
15
|
+
className: _,
|
|
16
16
|
padding: h = "md",
|
|
17
17
|
onOpenChange: w,
|
|
18
|
-
open:
|
|
19
|
-
size:
|
|
20
|
-
dismissible:
|
|
21
|
-
closeButtonAriaLabel:
|
|
22
|
-
kind:
|
|
23
|
-
position:
|
|
24
|
-
divider:
|
|
25
|
-
isAnimated:
|
|
26
|
-
onBeforeClose:
|
|
27
|
-
modalType:
|
|
28
|
-
...
|
|
18
|
+
open: m,
|
|
19
|
+
size: i,
|
|
20
|
+
dismissible: d = !0,
|
|
21
|
+
closeButtonAriaLabel: f = "Close panel",
|
|
22
|
+
kind: p = "inline",
|
|
23
|
+
position: t,
|
|
24
|
+
divider: D = !0,
|
|
25
|
+
isAnimated: c = !0,
|
|
26
|
+
onBeforeClose: E,
|
|
27
|
+
modalType: s,
|
|
28
|
+
...a
|
|
29
29
|
}) => {
|
|
30
|
-
process.env.NODE_ENV !== "production" &&
|
|
30
|
+
process.env.NODE_ENV !== "production" && s === "alert" && d && console.warn(
|
|
31
31
|
'Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'
|
|
32
|
+
), process.env.NODE_ENV !== "production" && a.closeOnOutsidePress && s !== "nonModal" && s !== void 0 && console.warn(
|
|
33
|
+
'Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'
|
|
32
34
|
);
|
|
33
|
-
const
|
|
34
|
-
e[
|
|
35
|
-
e[`${
|
|
36
|
-
|
|
37
|
-
e[`${
|
|
38
|
-
e[`${
|
|
39
|
-
|
|
40
|
-
),
|
|
41
|
-
e[`${
|
|
42
|
-
|
|
43
|
-
), { requestClose: v, handleOverlayOpenChange:
|
|
44
|
-
|
|
35
|
+
const u = s === "alert" ? !1 : d, n = j(t), N = $(
|
|
36
|
+
e[o],
|
|
37
|
+
e[`${o}--${p}`],
|
|
38
|
+
i && e[`${o}--size-${i}`],
|
|
39
|
+
e[`${o}--padding-${h}`],
|
|
40
|
+
e[`${o}--position-${n}`],
|
|
41
|
+
_
|
|
42
|
+
), x = $(
|
|
43
|
+
e[`${o}__inline-wrapper`],
|
|
44
|
+
i === "full" && e[`${o}__inline-wrapper--full`]
|
|
45
|
+
), { requestClose: v, handleOverlayOpenChange: y } = F(
|
|
46
|
+
E,
|
|
45
47
|
w
|
|
46
|
-
),
|
|
47
|
-
() => ({ dismissible:
|
|
48
|
-
[
|
|
49
|
-
), { showDivider:
|
|
50
|
-
() => ({ duration:
|
|
51
|
-
[
|
|
48
|
+
), P = g(
|
|
49
|
+
() => ({ dismissible: u, closeButtonAriaLabel: f, position: t, requestClose: v }),
|
|
50
|
+
[u, f, t, v]
|
|
51
|
+
), { showDivider: I, dividerBefore: M, dividerInner: b, dividerAfter: B } = H(D, n), O = g(
|
|
52
|
+
() => ({ duration: c ? T : 0 }),
|
|
53
|
+
[c]
|
|
52
54
|
);
|
|
53
|
-
return
|
|
55
|
+
return p === "inline" ? /* @__PURE__ */ C(
|
|
54
56
|
q,
|
|
55
57
|
{
|
|
56
|
-
contextValue:
|
|
57
|
-
panelClassName:
|
|
58
|
-
inlineWrapperClassName:
|
|
59
|
-
resolvedPosition:
|
|
60
|
-
dividerBefore:
|
|
61
|
-
dividerInner:
|
|
62
|
-
dividerAfter:
|
|
63
|
-
open:
|
|
64
|
-
transitionConfig:
|
|
65
|
-
...
|
|
66
|
-
children:
|
|
58
|
+
contextValue: P,
|
|
59
|
+
panelClassName: N,
|
|
60
|
+
inlineWrapperClassName: x,
|
|
61
|
+
resolvedPosition: n,
|
|
62
|
+
dividerBefore: M,
|
|
63
|
+
dividerInner: b,
|
|
64
|
+
dividerAfter: B,
|
|
65
|
+
open: m,
|
|
66
|
+
transitionConfig: O,
|
|
67
|
+
...a,
|
|
68
|
+
children: l
|
|
67
69
|
}
|
|
68
|
-
) : /* @__PURE__ */
|
|
70
|
+
) : /* @__PURE__ */ C(
|
|
69
71
|
U,
|
|
70
72
|
{
|
|
71
|
-
contextValue:
|
|
72
|
-
panelClassName:
|
|
73
|
-
resolvedPosition:
|
|
74
|
-
showDivider:
|
|
75
|
-
modalType:
|
|
76
|
-
open:
|
|
77
|
-
onOpenChange:
|
|
78
|
-
transitionConfig:
|
|
79
|
-
...
|
|
80
|
-
children:
|
|
73
|
+
contextValue: P,
|
|
74
|
+
panelClassName: N,
|
|
75
|
+
resolvedPosition: n,
|
|
76
|
+
showDivider: I,
|
|
77
|
+
modalType: s,
|
|
78
|
+
open: m,
|
|
79
|
+
onOpenChange: y,
|
|
80
|
+
transitionConfig: O,
|
|
81
|
+
...a,
|
|
82
|
+
children: l
|
|
81
83
|
}
|
|
82
84
|
);
|
|
83
85
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
r.displayName = "Panel";
|
|
87
|
+
r.Header = S;
|
|
88
|
+
r.Body = V;
|
|
89
|
+
r.Footer = A;
|
|
88
90
|
export {
|
|
89
|
-
|
|
91
|
+
r as Panel
|
|
90
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),d=400,f=t=>t||"end",P=(t,s)=>{const e=t&&s!=="full";return{showDivider:e,dividerBefore:e&&s!=="start"&&s!=="bottom",dividerInner:e&&s==="bottom",dividerAfter:e&&s==="start"}},a=(t,s)=>{if(t!=="isModal")return t==="alert"?{escapeKey:!1,outsidePress:!1}:{escapeKey:!1,outsidePress:s??!1}},v=t=>t==="escape-key"?"escapeKey":t==="outside-press"?"outsidePress":"programmatic",N=(t,s)=>{const e=u.useCallback(i=>{if(!t){s==null||s(!1);return}const r=t(i);r instanceof Promise?r.then(l=>{l&&(s==null||s(!1))}).catch(()=>{}):r&&(s==null||s(!1))},[t,s]),c=u.useCallback((i,r,l)=>{i?s==null||s(!0):e(v(l))},[s,e]);return{requestClose:e,handleOverlayOpenChange:c}};exports.PANEL_TRANSITION_DURATION_MS=d;exports.getPanelDismissConfig=a;exports.getPanelDividerState=P;exports.getResolvedPanelPosition=f;exports.usePanelClose=N;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OpenChangeReason } from '@floating-ui/react';
|
|
2
|
-
import { PanelCloseReason, PanelPosition, PanelProps } from './Panel.types';
|
|
2
|
+
import { PanelCloseReason, PanelModalType, PanelPosition, PanelProps } from './Panel.types';
|
|
3
3
|
export declare const PANEL_TRANSITION_DURATION_MS = 400;
|
|
4
4
|
export declare const getResolvedPanelPosition: (position?: PanelPosition) => PanelPosition;
|
|
5
5
|
export declare const getPanelDividerState: (divider: boolean, position?: PanelPosition) => {
|
|
@@ -8,6 +8,17 @@ export declare const getPanelDividerState: (divider: boolean, position?: PanelPo
|
|
|
8
8
|
dividerInner: boolean;
|
|
9
9
|
dividerAfter: boolean;
|
|
10
10
|
};
|
|
11
|
+
/**
|
|
12
|
+
* Returns the floating-ui `dismiss` config for an overlay panel.
|
|
13
|
+
*
|
|
14
|
+
* - `isModal` — `undefined` (floating-ui defaults: ESC + backdrop click both close)
|
|
15
|
+
* - `nonModal` / omitted — ESC suppressed; outside-press controlled by `closeOnOutsidePress`
|
|
16
|
+
* - `alert` — ESC and outside-press both suppressed
|
|
17
|
+
*/
|
|
18
|
+
export declare const getPanelDismissConfig: (modalType: PanelModalType | undefined, closeOnOutsidePress?: boolean) => {
|
|
19
|
+
escapeKey: boolean;
|
|
20
|
+
outsidePress: boolean;
|
|
21
|
+
} | undefined;
|
|
11
22
|
export declare const usePanelClose: (onBeforeClose: PanelProps["onBeforeClose"], onOpenChange: PanelProps["onOpenChange"]) => {
|
|
12
23
|
requestClose: (reason: PanelCloseReason) => void;
|
|
13
24
|
handleOverlayOpenChange: (nextOpen: boolean, _event?: Event, floatingReason?: OpenChangeReason) => void;
|
|
@@ -1,39 +1,43 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
1
|
+
import { useCallback as c } from "react";
|
|
2
|
+
const P = 400, v = (t) => t || "end", m = (t, s) => {
|
|
3
|
+
const r = t && s !== "full";
|
|
4
4
|
return {
|
|
5
|
-
showDivider:
|
|
6
|
-
dividerBefore:
|
|
5
|
+
showDivider: r,
|
|
6
|
+
dividerBefore: r && s !== "start" && s !== "bottom",
|
|
7
7
|
// For 'bottom' panels the divider must sit inside the scrollable wrapper (above the content),
|
|
8
8
|
// not outside it — so it is rendered via dividerInner rather than dividerBefore.
|
|
9
|
-
dividerInner:
|
|
10
|
-
dividerAfter:
|
|
9
|
+
dividerInner: r && s === "bottom",
|
|
10
|
+
dividerAfter: r && s === "start"
|
|
11
11
|
};
|
|
12
|
-
},
|
|
13
|
-
|
|
12
|
+
}, a = (t, s) => {
|
|
13
|
+
if (t !== "isModal")
|
|
14
|
+
return t === "alert" ? { escapeKey: !1, outsidePress: !1 } : { escapeKey: !1, outsidePress: s ?? !1 };
|
|
15
|
+
}, u = (t) => t === "escape-key" ? "escapeKey" : t === "outside-press" ? "outsidePress" : "programmatic", y = (t, s) => {
|
|
16
|
+
const r = c(
|
|
14
17
|
(i) => {
|
|
15
|
-
if (!
|
|
16
|
-
|
|
18
|
+
if (!t) {
|
|
19
|
+
s == null || s(!1);
|
|
17
20
|
return;
|
|
18
21
|
}
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
l && (
|
|
22
|
+
const e = t(i);
|
|
23
|
+
e instanceof Promise ? e.then((l) => {
|
|
24
|
+
l && (s == null || s(!1));
|
|
22
25
|
}).catch(() => {
|
|
23
|
-
}) :
|
|
24
|
-
},
|
|
25
|
-
[r, t]
|
|
26
|
-
), d = u(
|
|
27
|
-
(i, c, l) => {
|
|
28
|
-
i ? t == null || t(!0) : s(e(l));
|
|
26
|
+
}) : e && (s == null || s(!1));
|
|
29
27
|
},
|
|
30
28
|
[t, s]
|
|
29
|
+
), f = c(
|
|
30
|
+
(i, e, l) => {
|
|
31
|
+
i ? s == null || s(!0) : r(u(l));
|
|
32
|
+
},
|
|
33
|
+
[s, r]
|
|
31
34
|
);
|
|
32
|
-
return { requestClose:
|
|
35
|
+
return { requestClose: r, handleOverlayOpenChange: f };
|
|
33
36
|
};
|
|
34
37
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
m as
|
|
38
|
-
|
|
38
|
+
P as PANEL_TRANSITION_DURATION_MS,
|
|
39
|
+
a as getPanelDismissConfig,
|
|
40
|
+
m as getPanelDividerState,
|
|
41
|
+
v as getResolvedPanelPosition,
|
|
42
|
+
y as usePanelClose
|
|
39
43
|
};
|
|
@@ -112,6 +112,12 @@ export interface OverlayPanelProps extends BasePanelProps {
|
|
|
112
112
|
* @default 'nonModal'
|
|
113
113
|
*/
|
|
114
114
|
modalType?: PanelModalType;
|
|
115
|
+
/**
|
|
116
|
+
* When `modalType="nonModal"`, allows the panel to close when the user
|
|
117
|
+
* clicks outside it. Has no effect for `'isModal'` or `'alert'` panels.
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
closeOnOutsidePress?: boolean;
|
|
115
121
|
}
|
|
116
122
|
export type PanelProps = InlinePanelProps | OverlayPanelProps;
|
|
117
123
|
export type { PanelHeaderProps } from './Panel.Header';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.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.17.0",
|
|
63
|
+
"@viasat/beam-shared": "2.17.0",
|
|
64
|
+
"@viasat/beam-styles": "2.17.0",
|
|
65
|
+
"@viasat/beam-tokens": "2.17.0",
|
|
66
|
+
"@viasat/beam-icons": "2.17.0",
|
|
67
67
|
"clsx": "^1.2.1",
|
|
68
68
|
"@floating-ui/react": "^0.26.18",
|
|
69
69
|
"@stepperize/react": "^5.1.5",
|