@viasat/beam-react 2.11.0 → 2.12.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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("@floating-ui/react"),I=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const b=require("./Panel.context.cjs.js"),q=require("../../FloatingUI/FloatingUI.root.cjs.js"),v=require("../../../chunks/FloatingUI.context.Du9g2lSg.js"),f=require("../../Divider/Divider.cjs.js"),C=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:F}=I.getBEMClassNames("panel"),a=({position:n,className:i})=>e.jsx(f.Divider,{borderColor:"01",orientation:n==="bottom"?"horizontal":"vertical",className:i}),U=({children:n,panelClassName:i,inlineWrapperClassName:o,resolvedPosition:t,dividerBefore:r,dividerInner:l,dividerAfter:c,alwaysVisible:s,...u})=>{const{context:d,transitionConfig:x,refs:g}=v.useBmFloatingUIContext(),{isMounted:j,status:_}=p.useTransitionStatus(d,x),m=s&&_==="initial"?"open":_;return j?e.jsxs(e.Fragment,{children:[r&&e.jsx(a,{position:t}),e.jsx("div",{ref:g.setFloating,className:o,"data-position":t,"data-status":m,children:e.jsxs("div",{className:C.styles[`${F}__inline-wrapper-content`],children:[l&&e.jsx(a,{position:t}),e.jsx("aside",{...u,className:i,children:n})]})}),c&&e.jsx(a,{position:t})]}):null},h=({contextValue:n,panelClassName:i,inlineWrapperClassName:o,resolvedPosition:t,dividerBefore:r,dividerInner:l,dividerAfter:c,open:s,transitionConfig:u,children:d,...x})=>e.jsx(b.PanelContext.Provider,{value:n,children:e.jsx(q.FloatingUIRoot,{open:s??!0,portalled:!1,transitionConfig:u,children:e.jsx(U,{panelClassName:i,inlineWrapperClassName:o,resolvedPosition:t,dividerBefore:r,dividerInner:l,dividerAfter:c,alwaysVisible:s===void 0,...x,children:d})})});exports.InlineDivider=a;exports.InlinePanel=h;
@@ -0,0 +1,21 @@
1
+ import { UseTransitionStylesProps } from '@floating-ui/react';
2
+ import { PanelPosition } from './Panel.types';
3
+ import { PanelContextValue } from './Panel.context';
4
+ export declare const InlineDivider: ({ position, className, }: {
5
+ position?: PanelPosition;
6
+ className?: string;
7
+ }) => import("react/jsx-runtime").JSX.Element;
8
+ type InlinePanelProps = {
9
+ contextValue: PanelContextValue;
10
+ panelClassName: string;
11
+ inlineWrapperClassName: string;
12
+ resolvedPosition: PanelPosition;
13
+ dividerBefore: boolean;
14
+ dividerInner: boolean;
15
+ dividerAfter: boolean;
16
+ open?: boolean;
17
+ transitionConfig: UseTransitionStylesProps;
18
+ children: React.ReactNode;
19
+ } & React.ComponentPropsWithoutRef<'aside'>;
20
+ export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, children, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1,93 @@
1
+ import { jsx as t, jsxs as u, Fragment as h } from "react/jsx-runtime";
2
+ import { useTransitionStatus as I } from "@floating-ui/react";
3
+ import { g as v } from "../../../chunks/classNames.BTJmrO_L.js";
4
+ import "../../../chunks/constants.CKKGf1-i.js";
5
+ import { PanelContext as N } from "./Panel.context.es.js";
6
+ import { FloatingUIRoot as b } from "../../FloatingUI/FloatingUI.root.es.js";
7
+ import { a as F } from "../../../chunks/FloatingUI.context.DtJA57si.js";
8
+ import { Divider as w } from "../../Divider/Divider.es.js";
9
+ import { s as U } from "../../../chunks/panel.module.BVm3KvDs.js";
10
+ const { baseClassNamePrefix: j } = v("panel"), f = ({
11
+ position: n,
12
+ className: i
13
+ }) => /* @__PURE__ */ t(
14
+ w,
15
+ {
16
+ borderColor: "01",
17
+ orientation: n === "bottom" ? "horizontal" : "vertical",
18
+ className: i
19
+ }
20
+ ), y = ({
21
+ children: n,
22
+ panelClassName: i,
23
+ inlineWrapperClassName: e,
24
+ resolvedPosition: o,
25
+ dividerBefore: r,
26
+ dividerInner: s,
27
+ dividerAfter: l,
28
+ alwaysVisible: a,
29
+ ...m
30
+ }) => {
31
+ const {
32
+ context: p,
33
+ transitionConfig: c,
34
+ refs: g
35
+ } = F(), { isMounted: x, status: d } = I(
36
+ p,
37
+ c
38
+ ), C = a && d === "initial" ? "open" : d;
39
+ return x ? /* @__PURE__ */ u(h, { children: [
40
+ r && /* @__PURE__ */ t(f, { position: o }),
41
+ /* @__PURE__ */ t(
42
+ "div",
43
+ {
44
+ ref: g.setFloating,
45
+ className: e,
46
+ "data-position": o,
47
+ "data-status": C,
48
+ children: /* @__PURE__ */ u("div", { className: U[`${j}__inline-wrapper-content`], children: [
49
+ s && /* @__PURE__ */ t(f, { position: o }),
50
+ /* @__PURE__ */ t("aside", { ...m, className: i, children: n })
51
+ ] })
52
+ }
53
+ ),
54
+ l && /* @__PURE__ */ t(f, { position: o })
55
+ ] }) : null;
56
+ }, T = ({
57
+ contextValue: n,
58
+ panelClassName: i,
59
+ inlineWrapperClassName: e,
60
+ resolvedPosition: o,
61
+ dividerBefore: r,
62
+ dividerInner: s,
63
+ dividerAfter: l,
64
+ open: a,
65
+ transitionConfig: m,
66
+ children: p,
67
+ ...c
68
+ }) => /* @__PURE__ */ t(N.Provider, { value: n, children: /* @__PURE__ */ t(
69
+ b,
70
+ {
71
+ open: a ?? !0,
72
+ portalled: !1,
73
+ transitionConfig: m,
74
+ children: /* @__PURE__ */ t(
75
+ y,
76
+ {
77
+ panelClassName: i,
78
+ inlineWrapperClassName: e,
79
+ resolvedPosition: o,
80
+ dividerBefore: r,
81
+ dividerInner: s,
82
+ dividerAfter: l,
83
+ alwaysVisible: a === void 0,
84
+ ...c,
85
+ children: p
86
+ }
87
+ )
88
+ }
89
+ ) });
90
+ export {
91
+ f as InlineDivider,
92
+ T as InlinePanel
93
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("clsx"),y=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const g=require("./Panel.context.cjs.js"),m=require("../../FloatingUI/FloatingUI.root.cjs.js"),p=require("../../FloatingUI/FloatingUI.content.cjs.js"),q=require("./Panel.Inline.cjs.js"),t=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:n}=y.getBEMClassNames("panel"),x=({contextValue:r,panelClassName:i,resolvedPosition:l,showDivider:a,open:s,onOpenChange:o,transitionConfig:c,children:u,..._})=>{const d=v(t.styles[`${n}__overlay-divider`],t.styles[`${n}__overlay-divider--${l}`]);return e.jsx(g.PanelContext.Provider,{value:r,children:e.jsx(m.FloatingUIRoot,{open:s,onOpenChange:o,portalled:!0,transitionConfig:c,children:e.jsxs(p.Content,{className:i,skipFloatingStyles:!0,overlay:!0,..._,"data-position":l,children:[u,a&&e.jsx(q.InlineDivider,{position:l,className:d})]})})})};exports.OverlayPanel=x;
@@ -0,0 +1,16 @@
1
+ import { UseTransitionStylesProps } from '@floating-ui/react';
2
+ import { PanelPosition } from './Panel.types';
3
+ import { PanelContextValue } from './Panel.context';
4
+ import { FloatingUIProps } from '../../FloatingUI/FloatingUI.context';
5
+ type OverlayPanelProps = {
6
+ contextValue: PanelContextValue;
7
+ panelClassName: string;
8
+ resolvedPosition: PanelPosition;
9
+ showDivider: boolean;
10
+ open?: boolean;
11
+ onOpenChange?: FloatingUIProps['onOpenChange'];
12
+ transitionConfig: UseTransitionStylesProps;
13
+ children: React.ReactNode;
14
+ } & React.ComponentPropsWithoutRef<'aside'>;
15
+ export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, open, onOpenChange, transitionConfig, children, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,51 @@
1
+ import { jsx as e, jsxs as f } from "react/jsx-runtime";
2
+ import v from "clsx";
3
+ import { g as y } from "../../../chunks/classNames.BTJmrO_L.js";
4
+ import "../../../chunks/constants.CKKGf1-i.js";
5
+ import { PanelContext as x } from "./Panel.context.es.js";
6
+ import { FloatingUIRoot as u } from "../../FloatingUI/FloatingUI.root.es.js";
7
+ import { Content as C } from "../../FloatingUI/FloatingUI.content.es.js";
8
+ import { InlineDivider as N } from "./Panel.Inline.es.js";
9
+ import { s as o } from "../../../chunks/panel.module.BVm3KvDs.js";
10
+ const { baseClassNamePrefix: t } = y("panel"), b = ({
11
+ contextValue: a,
12
+ panelClassName: i,
13
+ resolvedPosition: r,
14
+ showDivider: s,
15
+ open: l,
16
+ onOpenChange: m,
17
+ transitionConfig: n,
18
+ children: p,
19
+ ...d
20
+ }) => {
21
+ const c = v(
22
+ o[`${t}__overlay-divider`],
23
+ o[`${t}__overlay-divider--${r}`]
24
+ );
25
+ return /* @__PURE__ */ e(x.Provider, { value: a, children: /* @__PURE__ */ e(
26
+ u,
27
+ {
28
+ open: l,
29
+ onOpenChange: m,
30
+ portalled: !0,
31
+ transitionConfig: n,
32
+ children: /* @__PURE__ */ f(
33
+ C,
34
+ {
35
+ className: i,
36
+ skipFloatingStyles: !0,
37
+ overlay: !0,
38
+ ...d,
39
+ "data-position": r,
40
+ children: [
41
+ p,
42
+ s && /* @__PURE__ */ e(N, { position: r, className: c })
43
+ ]
44
+ }
45
+ )
46
+ }
47
+ ) });
48
+ };
49
+ export {
50
+ b as OverlayPanel
51
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("clsx"),U=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const N=require("./Panel.context.cjs.js"),B=require("./Panel.Header.cjs.js"),T=require("./Panel.Body.cjs.js"),A=require("./Panel.Footer.cjs.js"),t=require("./Panel.helpers.cjs.js"),H=require("../../FloatingUI/FloatingUI.root.cjs.js"),M=require("../../FloatingUI/FloatingUI.content.cjs.js"),E=require("../../Divider/Divider.cjs.js"),n=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:s}=U.getBEMClassNames("panel"),a=({position:o,className:d})=>e.jsx(E.Divider,{borderColor:"01",orientation:o==="bottom"?"horizontal":"vertical",className:d}),l=({children:o,className:d,padding:j="md",onOpenChange:q,open:v,size:c,dismissible:C=!0,closeButtonAriaLabel:$="Close panel",kind:r="inline",position:p,divider:h=!0,isAnimated:P=!0,onBeforeClose:I,...y})=>{const i=t.getResolvedPanelPosition(p),x=u(n.styles[s],n.styles[`${s}--${r}`],c&&n.styles[`${s}--size-${c}`],n.styles[`${s}--padding-${j}`],n.styles[`${s}--position-${i}`],d),f=u(n.styles[`${s}__inline-wrapper`],c==="full"&&n.styles[`${s}__inline-wrapper--full`]),{requestClose:w,handleOverlayOpenChange:D}=t.usePanelClose(I,q),m={dismissible:C,closeButtonAriaLabel:$,position:p,requestClose:w},{inlineStatus:F,isInlineVisible:b}=t.useInlineTransition(r==="inline"?v:void 0,P),{showDivider:g,dividerBefore:S,dividerAfter:O}=t.getPanelDividerState(h,i),R=r==="overlay"?u(n.styles[`${s}__overlay-divider`],n.styles[`${s}__overlay-divider--${i}`]):void 0,_=g&&b;return r==="inline"?b?e.jsxs(N.PanelContext.Provider,{value:m,children:[S&&_&&e.jsx(a,{position:i}),e.jsx("div",{className:f,"data-position":i,"data-status":F,children:e.jsxs("div",{className:n.styles[`${s}__inline-wrapper-content`],children:[i==="bottom"&&_&&e.jsx(a,{position:i}),e.jsx("aside",{className:x,...y,children:o})]})}),O&&_&&e.jsx(a,{position:i})]}):null:e.jsx(N.PanelContext.Provider,{value:m,children:e.jsx(H.FloatingUIRoot,{open:v,onOpenChange:D,portalled:!0,transitionConfig:{duration:P?t.PANEL_TRANSITION_DURATION_MS:0},children:e.jsxs(M.Content,{className:x,skipFloatingStyles:!0,overlay:!0,...y,"data-position":i,children:[o,g&&e.jsx(a,{position:i,className:R})]})})})};l.displayName="Panel";l.Header=B.Header;l.Body=T.Body;l.Footer=A.Footer;exports.Panel=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react/jsx-runtime"),v=require("clsx"),C=require("react"),h=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const j=require("./Panel.Header.cjs.js"),B=require("./Panel.Body.cjs.js"),T=require("./Panel.Footer.cjs.js"),a=require("./Panel.helpers.cjs.js"),D=require("./Panel.Inline.cjs.js"),F=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:n}=h.getBEMClassNames("panel"),l=({children:i,className:$,padding:g="md",onOpenChange:w,open:o,size:r,dismissible:_=!0,closeButtonAriaLabel:u="Close panel",kind:c="inline",position:t,divider:f=!0,isAnimated:P=!0,onBeforeClose:O,...d})=>{const s=a.getResolvedPanelPosition(t),p=v(e.styles[n],e.styles[`${n}--${c}`],r&&e.styles[`${n}--size-${r}`],e.styles[`${n}--padding-${g}`],e.styles[`${n}--position-${s}`],$),b=v(e.styles[`${n}__inline-wrapper`],r==="full"&&e.styles[`${n}__inline-wrapper--full`]),{requestClose:y,handleOverlayOpenChange:x}=a.usePanelClose(O,w),m=C.useMemo(()=>({dismissible:_,closeButtonAriaLabel:u,position:t,requestClose:y}),[_,u,t,y]),{showDivider:I,dividerBefore:M,dividerInner:R,dividerAfter:S}=a.getPanelDividerState(f,s),q=C.useMemo(()=>({duration:P?a.PANEL_TRANSITION_DURATION_MS:0}),[P]);return c==="inline"?N.jsx(D.InlinePanel,{contextValue:m,panelClassName:p,inlineWrapperClassName:b,resolvedPosition:s,dividerBefore:M,dividerInner:R,dividerAfter:S,open:o,transitionConfig:q,...d,children:i}):N.jsx(F.OverlayPanel,{contextValue:m,panelClassName:p,resolvedPosition:s,showDivider:I,open:o,onOpenChange:x,transitionConfig:q,...d,children:i})};l.displayName="Panel";l.Header=j.Header;l.Body=B.Body;l.Footer=T.Footer;exports.Panel=l;
@@ -1,6 +1,6 @@
1
1
  import { PanelProps } from './Panel.types';
2
2
  export declare const Panel: {
3
- ({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, isAnimated, onBeforeClose, ...props }: PanelProps): JSX.Element | null;
3
+ ({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, isAnimated, onBeforeClose, ...props }: PanelProps): JSX.Element;
4
4
  displayName: string;
5
5
  Header: {
6
6
  ({ children, className: _className, divider, ...props }: import('./Panel.Header').PanelHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -1,118 +1,85 @@
1
- import { jsxs as p, jsx as r } from "react/jsx-runtime";
2
- import v from "clsx";
3
- import { g as A } from "../../../chunks/classNames.BTJmrO_L.js";
1
+ import { jsx as P } from "react/jsx-runtime";
2
+ import $ from "clsx";
3
+ import { useMemo as v } from "react";
4
+ import { g as R } from "../../../chunks/classNames.BTJmrO_L.js";
4
5
  import "../../../chunks/constants.CKKGf1-i.js";
5
- import { PanelContext as h } from "./Panel.context.es.js";
6
- import { Header as j } from "./Panel.Header.es.js";
7
- import { Body as E } from "./Panel.Body.es.js";
8
- import { Footer as H } from "./Panel.Footer.es.js";
9
- import { usePanelClose as M, useInlineTransition as U, getPanelDividerState as V, PANEL_TRANSITION_DURATION_MS as q, getResolvedPanelPosition as L } from "./Panel.helpers.es.js";
10
- import { FloatingUIRoot as W } from "../../FloatingUI/FloatingUI.root.es.js";
11
- import { Content as z } from "../../FloatingUI/FloatingUI.content.es.js";
12
- import { Divider as G } from "../../Divider/Divider.es.js";
13
- import { s as o } from "../../../chunks/panel.module.BVm3KvDs.js";
14
- const { baseClassNamePrefix: i } = A("panel"), a = ({
6
+ import { Header as S } from "./Panel.Header.es.js";
7
+ import { Body as T } from "./Panel.Body.es.js";
8
+ import { Footer as A } from "./Panel.Footer.es.js";
9
+ import { usePanelClose as E, getPanelDividerState as F, PANEL_TRANSITION_DURATION_MS as H, getResolvedPanelPosition as j } from "./Panel.helpers.es.js";
10
+ import { InlinePanel as q } from "./Panel.Inline.es.js";
11
+ import { OverlayPanel as U } from "./Panel.Overlay.es.js";
12
+ import { s as e } from "../../../chunks/panel.module.BVm3KvDs.js";
13
+ const { baseClassNamePrefix: r } = R("panel"), n = ({
14
+ children: s,
15
+ className: g,
16
+ padding: _ = "md",
17
+ onOpenChange: y,
18
+ open: l,
19
+ size: a,
20
+ dismissible: i = !0,
21
+ closeButtonAriaLabel: m = "Close panel",
22
+ kind: p = "inline",
15
23
  position: t,
16
- className: s
17
- }) => /* @__PURE__ */ r(
18
- G,
19
- {
20
- borderColor: "01",
21
- orientation: t === "bottom" ? "horizontal" : "vertical",
22
- className: s
23
- }
24
- ), l = ({
25
- children: t,
26
- className: s,
27
- padding: y = "md",
28
- onOpenChange: g,
29
- open: c,
30
- size: d,
31
- dismissible: I = !0,
32
- closeButtonAriaLabel: x = "Close panel",
33
- kind: n = "inline",
34
- position: u,
35
- divider: D = !0,
24
+ divider: O = !0,
36
25
  isAnimated: f = !0,
37
- onBeforeClose: b,
38
- ...N
26
+ onBeforeClose: x,
27
+ ...d
39
28
  }) => {
40
- const e = L(u), $ = v(
41
- o[i],
42
- o[`${i}--${n}`],
43
- d && o[`${i}--size-${d}`],
44
- o[`${i}--padding-${y}`],
45
- o[`${i}--position-${e}`],
46
- s
47
- ), O = v(
48
- o[`${i}__inline-wrapper`],
49
- d === "full" && o[`${i}__inline-wrapper--full`]
50
- ), { requestClose: R, handleOverlayOpenChange: S } = M(b, g), C = {
51
- dismissible: I,
52
- closeButtonAriaLabel: x,
53
- position: u,
54
- requestClose: R
55
- }, { inlineStatus: w, isInlineVisible: _ } = U(
56
- n === "inline" ? c : void 0,
57
- f
58
- ), { showDivider: P, dividerBefore: B, dividerAfter: F } = V(
59
- D,
60
- e
61
- ), T = n === "overlay" ? v(
62
- o[`${i}__overlay-divider`],
63
- o[`${i}__overlay-divider--${e}`]
64
- ) : void 0, m = P && _;
65
- return n === "inline" ? _ ? /* @__PURE__ */ p(h.Provider, { value: C, children: [
66
- B && m && /* @__PURE__ */ r(a, { position: e }),
67
- /* @__PURE__ */ r(
68
- "div",
69
- {
70
- className: O,
71
- "data-position": e,
72
- "data-status": w,
73
- children: /* @__PURE__ */ p("div", { className: o[`${i}__inline-wrapper-content`], children: [
74
- e === "bottom" && m && /* @__PURE__ */ r(a, { position: e }),
75
- /* @__PURE__ */ r("aside", { className: $, ...N, children: t })
76
- ] })
77
- }
78
- ),
79
- F && m && /* @__PURE__ */ r(a, { position: e })
80
- ] }) : null : /* @__PURE__ */ r(h.Provider, { value: C, children: /* @__PURE__ */ r(
81
- W,
29
+ const o = j(t), N = $(
30
+ e[r],
31
+ e[`${r}--${p}`],
32
+ a && e[`${r}--size-${a}`],
33
+ e[`${r}--padding-${_}`],
34
+ e[`${r}--position-${o}`],
35
+ g
36
+ ), I = $(
37
+ e[`${r}__inline-wrapper`],
38
+ a === "full" && e[`${r}__inline-wrapper--full`]
39
+ ), { requestClose: c, handleOverlayOpenChange: h } = E(
40
+ x,
41
+ y
42
+ ), u = v(
43
+ () => ({ dismissible: i, closeButtonAriaLabel: m, position: t, requestClose: c }),
44
+ [i, m, t, c]
45
+ ), { showDivider: w, dividerBefore: B, dividerInner: D, dividerAfter: M } = F(O, o), C = v(
46
+ () => ({ duration: f ? H : 0 }),
47
+ [f]
48
+ );
49
+ return p === "inline" ? /* @__PURE__ */ P(
50
+ q,
82
51
  {
83
- open: c,
84
- onOpenChange: S,
85
- portalled: !0,
86
- transitionConfig: {
87
- duration: f ? q : 0
88
- },
89
- children: /* @__PURE__ */ p(
90
- z,
91
- {
92
- className: $,
93
- skipFloatingStyles: !0,
94
- overlay: !0,
95
- ...N,
96
- "data-position": e,
97
- children: [
98
- t,
99
- P && /* @__PURE__ */ r(
100
- a,
101
- {
102
- position: e,
103
- className: T
104
- }
105
- )
106
- ]
107
- }
108
- )
52
+ contextValue: u,
53
+ panelClassName: N,
54
+ inlineWrapperClassName: I,
55
+ resolvedPosition: o,
56
+ dividerBefore: B,
57
+ dividerInner: D,
58
+ dividerAfter: M,
59
+ open: l,
60
+ transitionConfig: C,
61
+ ...d,
62
+ children: s
109
63
  }
110
- ) });
64
+ ) : /* @__PURE__ */ P(
65
+ U,
66
+ {
67
+ contextValue: u,
68
+ panelClassName: N,
69
+ resolvedPosition: o,
70
+ showDivider: w,
71
+ open: l,
72
+ onOpenChange: h,
73
+ transitionConfig: C,
74
+ ...d,
75
+ children: s
76
+ }
77
+ );
111
78
  };
112
- l.displayName = "Panel";
113
- l.Header = j;
114
- l.Body = E;
115
- l.Footer = H;
79
+ n.displayName = "Panel";
80
+ n.Header = S;
81
+ n.Body = T;
82
+ n.Footer = A;
116
83
  export {
117
- l as Panel
84
+ n as Panel
118
85
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),a=400,f=e=>e||"end",o=(e,t)=>{const s=e&&t!=="full";return{showDivider:s,dividerBefore:s&&t!=="start"&&t!=="bottom",dividerAfter:s&&t==="start"}},m=e=>e==="escape-key"?"escapeKey":e==="outside-press"?"outsidePress":"programmatic",v=(e,t)=>{const s=c.useCallback(u=>{if(!e){t==null||t(!1);return}const r=e(u);r instanceof Promise?r.then(i=>{i&&(t==null||t(!1))}).catch(()=>{}):r&&(t==null||t(!1))},[e,t]),l=c.useCallback((u,r,i)=>{u?t==null||t(!0):s(m(i))},[t,s]);return{requestClose:s,handleOverlayOpenChange:l}},I=(e,t)=>{const[s,l]=c.useState(void 0),[u,r]=c.useState(e!==!1);return c.useEffect(()=>{if(!t){r(e!==!1),l(void 0);return}if(e!==void 0)if(e){r(!0),l("close");let i;const d=requestAnimationFrame(()=>{i=requestAnimationFrame(()=>l("open"))});return()=>{cancelAnimationFrame(d),cancelAnimationFrame(i)}}else{l("close");const i=setTimeout(()=>{r(!1),l(void 0)},a);return()=>clearTimeout(i)}},[t,e]),{inlineStatus:s,isInlineVisible:u}};exports.PANEL_TRANSITION_DURATION_MS=a;exports.getPanelDividerState=o;exports.getResolvedPanelPosition=f;exports.useInlineTransition=I;exports.usePanelClose=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),d=400,P=s=>s||"end",f=(s,t)=>{const r=s&&t!=="full";return{showDivider:r,dividerBefore:r&&t!=="start"&&t!=="bottom",dividerInner:r&&t==="bottom",dividerAfter:r&&t==="start"}},v=s=>s==="escape-key"?"escapeKey":s==="outside-press"?"outsidePress":"programmatic",N=(s,t)=>{const r=c.useCallback(l=>{if(!s){t==null||t(!1);return}const e=s(l);e instanceof Promise?e.then(i=>{i&&(t==null||t(!1))}).catch(()=>{}):e&&(t==null||t(!1))},[s,t]),u=c.useCallback((l,e,i)=>{l?t==null||t(!0):r(v(i))},[t,r]);return{requestClose:r,handleOverlayOpenChange:u}};exports.PANEL_TRANSITION_DURATION_MS=d;exports.getPanelDividerState=f;exports.getResolvedPanelPosition=P;exports.usePanelClose=N;
@@ -1,18 +1,14 @@
1
1
  import { OpenChangeReason } from '@floating-ui/react';
2
2
  import { PanelCloseReason, PanelPosition, PanelProps } from './Panel.types';
3
3
  export declare const PANEL_TRANSITION_DURATION_MS = 400;
4
- export type PanelInlineStatus = 'open' | 'close' | undefined;
5
4
  export declare const getResolvedPanelPosition: (position?: PanelPosition) => PanelPosition;
6
5
  export declare const getPanelDividerState: (divider: boolean, position?: PanelPosition) => {
7
6
  showDivider: boolean;
8
7
  dividerBefore: boolean;
8
+ dividerInner: boolean;
9
9
  dividerAfter: boolean;
10
10
  };
11
11
  export declare const usePanelClose: (onBeforeClose: PanelProps["onBeforeClose"], onOpenChange: PanelProps["onOpenChange"]) => {
12
12
  requestClose: (reason: PanelCloseReason) => void;
13
13
  handleOverlayOpenChange: (nextOpen: boolean, _event?: Event, floatingReason?: OpenChangeReason) => void;
14
14
  };
15
- export declare const useInlineTransition: (open: boolean | undefined, isAnimated: boolean) => {
16
- inlineStatus: PanelInlineStatus;
17
- isInlineVisible: boolean;
18
- };
@@ -1,62 +1,39 @@
1
- import { useState as c, useEffect as m, useCallback as f } from "react";
2
- const a = 400, I = (s) => s || "end", A = (s, t) => {
3
- const r = s && t !== "full";
1
+ import { useCallback as u } from "react";
2
+ const v = 400, m = (r) => r || "end", P = (r, t) => {
3
+ const s = r && t !== "full";
4
4
  return {
5
- showDivider: r,
6
- dividerBefore: r && t !== "start" && t !== "bottom",
7
- dividerAfter: r && t === "start"
5
+ showDivider: s,
6
+ dividerBefore: s && t !== "start" && t !== "bottom",
7
+ // For 'bottom' panels the divider must sit inside the scrollable wrapper (above the content),
8
+ // not outside it — so it is rendered via dividerInner rather than dividerBefore.
9
+ dividerInner: s && t === "bottom",
10
+ dividerAfter: s && t === "start"
8
11
  };
9
- }, v = (s) => s === "escape-key" ? "escapeKey" : s === "outside-press" ? "outsidePress" : "programmatic", P = (s, t) => {
10
- const r = f(
11
- (u) => {
12
- if (!s) {
12
+ }, e = (r) => r === "escape-key" ? "escapeKey" : r === "outside-press" ? "outsidePress" : "programmatic", A = (r, t) => {
13
+ const s = u(
14
+ (i) => {
15
+ if (!r) {
13
16
  t == null || t(!1);
14
17
  return;
15
18
  }
16
- const e = s(u);
17
- e instanceof Promise ? e.then((i) => {
18
- i && (t == null || t(!1));
19
+ const c = r(i);
20
+ c instanceof Promise ? c.then((l) => {
21
+ l && (t == null || t(!1));
19
22
  }).catch(() => {
20
- }) : e && (t == null || t(!1));
23
+ }) : c && (t == null || t(!1));
21
24
  },
22
- [s, t]
23
- ), l = f(
24
- (u, e, i) => {
25
- u ? t == null || t(!0) : r(v(i));
25
+ [r, t]
26
+ ), d = u(
27
+ (i, c, l) => {
28
+ i ? t == null || t(!0) : s(e(l));
26
29
  },
27
- [t, r]
30
+ [t, s]
28
31
  );
29
- return { requestClose: r, handleOverlayOpenChange: l };
30
- }, S = (s, t) => {
31
- const [r, l] = c(void 0), [u, e] = c(s !== !1);
32
- return m(() => {
33
- if (!t) {
34
- e(s !== !1), l(void 0);
35
- return;
36
- }
37
- if (s !== void 0)
38
- if (s) {
39
- e(!0), l("close");
40
- let i;
41
- const d = requestAnimationFrame(() => {
42
- i = requestAnimationFrame(() => l("open"));
43
- });
44
- return () => {
45
- cancelAnimationFrame(d), cancelAnimationFrame(i);
46
- };
47
- } else {
48
- l("close");
49
- const i = setTimeout(() => {
50
- e(!1), l(void 0);
51
- }, a);
52
- return () => clearTimeout(i);
53
- }
54
- }, [t, s]), { inlineStatus: r, isInlineVisible: u };
32
+ return { requestClose: s, handleOverlayOpenChange: d };
55
33
  };
56
34
  export {
57
- a as PANEL_TRANSITION_DURATION_MS,
58
- A as getPanelDividerState,
59
- I as getResolvedPanelPosition,
60
- S as useInlineTransition,
61
- P as usePanelClose
35
+ v as PANEL_TRANSITION_DURATION_MS,
36
+ P as getPanelDividerState,
37
+ m as getResolvedPanelPosition,
38
+ A as usePanelClose
62
39
  };
@@ -19,7 +19,8 @@ interface BasePanelProps extends ComponentPropsWithoutRef<'aside'> {
19
19
  */
20
20
  children: React.ReactNode;
21
21
  /**
22
- * Specify if the Panel is open (controlled)
22
+ * Controls the Panel's visibility. For inline panels, omitting this prop
23
+ * renders the panel as always-visible (uncontrolled).
23
24
  */
24
25
  open?: boolean;
25
26
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viasat/beam-react",
3
- "version": "2.11.0",
3
+ "version": "2.12.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.11.0",
63
- "@viasat/beam-shared": "2.11.0",
64
- "@viasat/beam-styles": "2.11.0",
65
- "@viasat/beam-tokens": "2.11.0",
66
- "@viasat/beam-icons": "2.11.0",
62
+ "@viasat/beam-fonts": "2.12.0",
63
+ "@viasat/beam-shared": "2.12.0",
64
+ "@viasat/beam-styles": "2.12.0",
65
+ "@viasat/beam-tokens": "2.12.0",
66
+ "@viasat/beam-icons": "2.12.0",
67
67
  "clsx": "^1.2.1",
68
68
  "@floating-ui/react": "^0.26.18",
69
69
  "@stepperize/react": "^5.1.5",