@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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("@floating-ui/react"),q=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const b=require("./Panel.context.cjs.js"),F=require("../../FloatingUI/FloatingUI.root.cjs.js"),R=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),p=require("./Panel.Divider.cjs.js"),h=require("./Panel.ResizeHandle.cjs.js"),w=require("./Panel.useResize.cjs.js"),U=require("../../../chunks/panel.module.CVyUzyCZ.js"),{baseClassNamePrefix:N}=q.getBEMClassNames("panel"),v=({children:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,alwaysVisible:i,dividerColor:t,resizeConfig:s,..._})=>{const{context:x,transitionConfig:d,refs:g}=R.useBmFloatingUIContext(),{isMounted:I,status:j}=m.useTransitionStatus(x,d),P=i&&j==="initial"?"open":j,{handleRef:f}=w.usePanelResize({resizeConfig:s,position:n,floatingRef:g.floating});return I?e.jsxs(e.Fragment,{children:[o&&e.jsx(p.InlineDivider,{position:n,dividerColor:t}),e.jsx("div",{ref:g.setFloating,className:r,"data-position":n,"data-status":P,children:e.jsxs("div",{className:U.styles[`${N}__inline-wrapper-content`],children:[c&&e.jsx(p.InlineDivider,{position:n,dividerColor:t}),e.jsxs("aside",{..._,className:l,children:[a,s&&e.jsx(h.PanelResizeHandle,{ref:f})]})]})}),u&&e.jsx(p.InlineDivider,{position:n,dividerColor:t})]}):null},y=({contextValue:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,open:i,transitionConfig:t,dividerColor:s,children:_,resizeConfig:x,...d})=>e.jsx(b.PanelContext.Provider,{value:a,children:e.jsx(F.FloatingUIRoot,{open:i??!0,portalled:!1,transitionConfig:t,children:e.jsx(v,{panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,dividerColor:s,alwaysVisible:i===void 0,resizeConfig:x,...d,children:_})})});exports.InlinePanel=y;
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 d, Fragment as C } from "react/jsx-runtime";
2
- import { useTransitionStatus as F } from "@floating-ui/react";
3
- import { g as w } from "../../../chunks/classNames.BTJmrO_L.js";
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 P } from "./Panel.context.es.js";
6
- import { FloatingUIRoot as U } from "../../FloatingUI/FloatingUI.root.es.js";
7
- import { a as b } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
8
- import { InlineDivider as g } from "./Panel.Divider.es.js";
9
- import { PanelResizeHandle as j } from "./Panel.ResizeHandle.es.js";
10
- import { usePanelResize as y } from "./Panel.useResize.es.js";
11
- import { s as B } from "../../../chunks/panel.module.BblnuBjO.js";
12
- const { baseClassNamePrefix: M } = w("panel"), S = ({
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
- ...f
24
+ ...c
24
25
  }) => {
25
26
  const {
26
- context: c,
27
- transitionConfig: u,
28
- refs: x
29
- } = b(), { isMounted: I, status: h } = F(
30
- c,
31
- u
32
- ), N = e && h === "initial" ? "open" : h, { handleRef: R } = y({
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: x.floating
36
+ floatingRef: h.floating
36
37
  });
37
- return I ? /* @__PURE__ */ d(C, { children: [
38
- l && /* @__PURE__ */ t(g, { position: n, dividerColor: a }),
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: x.setFloating,
43
+ ref: h.setFloating,
43
44
  className: r,
44
45
  "data-position": n,
45
- "data-status": N,
46
- children: /* @__PURE__ */ d("div", { className: B[`${M}__inline-wrapper-content`], children: [
47
- m && /* @__PURE__ */ t(g, { position: n, dividerColor: a }),
48
- /* @__PURE__ */ d("aside", { ...f, className: o, children: [
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(j, { ref: R })
51
+ i && /* @__PURE__ */ t(y, { ref: C })
51
52
  ] })
52
53
  ] })
53
54
  }
54
55
  ),
55
- p && /* @__PURE__ */ t(g, { position: n, dividerColor: a })
56
+ p && /* @__PURE__ */ t(x, { position: n, dividerColor: a })
56
57
  ] }) : null;
57
- }, A = ({
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: a,
67
- dividerColor: i,
68
- children: f,
67
+ transitionConfig: f,
68
+ dividerColor: a,
69
+ children: i,
69
70
  resizeConfig: c,
70
- ...u
71
- }) => /* @__PURE__ */ t(P.Provider, { value: s, children: /* @__PURE__ */ t(
72
- U,
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: a,
78
+ transitionConfig: f,
77
79
  children: /* @__PURE__ */ t(
78
- S,
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: i,
88
+ dividerColor: a,
87
89
  alwaysVisible: e === void 0,
90
+ skipMountAnimation: u,
88
91
  resizeConfig: c,
89
- ...u,
90
- children: f
92
+ ...d,
93
+ children: i
91
94
  }
92
95
  )
93
96
  }
94
97
  ) });
95
98
  export {
96
- A as InlinePanel
99
+ G as InlinePanel
97
100
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),m=require("clsx"),p=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const F=require("./Panel.context.cjs.js"),I=require("./Panel.helpers.cjs.js"),j=require("../../FloatingUI/FloatingUI.root.cjs.js"),C=require("../../FloatingUI/FloatingUI.content.cjs.js"),R=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),U=require("./Panel.Divider.cjs.js"),N=require("./Panel.ResizeHandle.cjs.js"),h=require("./Panel.useResize.cjs.js"),q=require("../../../chunks/panel.module.CVyUzyCZ.js"),{baseClassNamePrefix:v,variable:y}=p.getBEMClassNames("panel"),w=({children:a,panelClassName:r,resolvedPosition:e,showDivider:o,dividerColor:l,resizeConfig:s,floatingOffset:i,overlayDividerClassName:c,isBlocking:u,style:t,..._})=>{const{refs:d}=R.useBmFloatingUIContext(),{handleRef:g}=h.usePanelResize({resizeConfig:s,position:e,floatingRef:d.floating,requireMount:!0}),P=i?{...t,[y("offset-x")]:i.x,[y("offset-y")]:i.y}:t;return n.jsxs(C.Content,{className:r,skipFloatingStyles:!0,overlay:u,..._,style:P,"data-position":e,children:[a,o&&n.jsx(U.InlineDivider,{position:e,className:c,dividerColor:l}),s&&n.jsx(N.PanelResizeHandle,{ref:g})]})},D=({contextValue:a,panelClassName:r,resolvedPosition:e,showDivider:o,modalType:l,closeOnOutsidePress:s,floatingOffset:i,open:c,onOpenChange:u,transitionConfig:t,dividerColor:_,children:d,resizeConfig:g,...P})=>{const x=l==="isModal"||l==="alert",b=I.getPanelDismissConfig(l,s),f=m(q.styles[`${v}__overlay-divider`],q.styles[`${v}__overlay-divider--${e}`]);return n.jsx(F.PanelContext.Provider,{value:a,children:n.jsx(j.FloatingUIRoot,{open:c,onOpenChange:u,portalled:!0,transitionConfig:t,dismiss:b,focusConfiguration:x?!0:{modal:!1,closeOnFocusOut:!1},children:n.jsx(w,{panelClassName:r,resolvedPosition:e,showDivider:o,dividerColor:_,floatingOffset:i,overlayDividerClassName:f,isBlocking:x,resizeConfig:g,...P,role:l==="alert"?"alertdialog":"dialog","aria-modal":x||void 0,children:d})})})};exports.OverlayPanel=D;
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 P } from "react/jsx-runtime";
2
- import R from "clsx";
3
- import { g as h } from "../../../chunks/classNames.BTJmrO_L.js";
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 F } from "./Panel.context.es.js";
6
- import { getPanelDismissConfig as I } from "./Panel.helpers.es.js";
7
- import { FloatingUIRoot as B } from "../../FloatingUI/FloatingUI.root.es.js";
8
- import { Content as D } from "../../FloatingUI/FloatingUI.content.es.js";
9
- import { a as M } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
10
- import { InlineDivider as _ } from "./Panel.Divider.es.js";
11
- import { PanelResizeHandle as $ } from "./Panel.ResizeHandle.es.js";
12
- import { usePanelResize as b } from "./Panel.useResize.es.js";
13
- import { s as v } from "../../../chunks/panel.module.BblnuBjO.js";
14
- const { baseClassNamePrefix: x, variable: y } = h("panel"), j = ({
15
- children: a,
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: i,
20
+ resizeConfig: a,
21
21
  floatingOffset: r,
22
22
  overlayDividerClassName: m,
23
23
  isBlocking: f,
24
+ skipMountAnimation: c,
24
25
  style: s,
25
- ...c
26
+ ...p
26
27
  }) => {
27
- const { refs: p } = M(), { handleRef: d } = b({
28
- resizeConfig: i,
28
+ const { refs: d } = _(), { handleRef: u } = j({
29
+ resizeConfig: a,
29
30
  position: o,
30
- floatingRef: p.floating,
31
+ floatingRef: d.floating,
31
32
  requireMount: !0
32
- }), u = r ? {
33
+ }), g = r ? {
33
34
  ...s,
34
- [y("offset-x")]: r.x,
35
- [y("offset-y")]: r.y
35
+ [C("offset-x")]: r.x,
36
+ [C("offset-y")]: r.y
36
37
  } : s;
37
- return /* @__PURE__ */ P(
38
- D,
38
+ return /* @__PURE__ */ R(
39
+ M,
39
40
  {
40
41
  className: l,
41
42
  skipFloatingStyles: !0,
42
43
  overlay: f,
43
- ...c,
44
- style: u,
44
+ ...p,
45
+ style: g,
45
46
  "data-position": o,
47
+ ...c ? { "data-status": "open" } : {},
46
48
  children: [
47
- a,
48
- n && /* @__PURE__ */ t(_, { position: o, className: m, dividerColor: e }),
49
- i && /* @__PURE__ */ t($, { ref: d })
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
- }, L = ({
54
- contextValue: a,
62
+ }, Q = ({
63
+ contextValue: i,
55
64
  panelClassName: l,
56
65
  resolvedPosition: o,
57
66
  showDivider: n,
58
67
  modalType: e,
59
- closeOnOutsidePress: i,
68
+ closeOnOutsidePress: a,
60
69
  floatingOffset: r,
61
70
  open: m,
62
71
  onOpenChange: f,
63
- transitionConfig: s,
64
- dividerColor: c,
72
+ transitionConfig: c,
73
+ dividerColor: s,
65
74
  children: p,
66
75
  resizeConfig: d,
67
- ...u
76
+ skipMountAnimation: u,
77
+ ...g
68
78
  }) => {
69
- const g = e === "isModal" || e === "alert", C = I(e, i), N = R(
70
- v[`${x}__overlay-divider`],
71
- v[`${x}__overlay-divider--${o}`]
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(F.Provider, { value: a, children: /* @__PURE__ */ t(
74
- B,
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: s,
80
- dismiss: C,
81
- focusConfiguration: g ? !0 : { modal: !1, closeOnFocusOut: !1 },
89
+ transitionConfig: c,
90
+ dismiss: N,
91
+ focusConfiguration: v ? !0 : { modal: !1, closeOnFocusOut: !1 },
82
92
  children: /* @__PURE__ */ t(
83
- j,
93
+ k,
84
94
  {
85
95
  panelClassName: l,
86
96
  resolvedPosition: o,
87
97
  showDivider: n,
88
- dividerColor: c,
98
+ dividerColor: s,
89
99
  floatingOffset: r,
90
- overlayDividerClassName: N,
91
- isBlocking: g,
100
+ overlayDividerClassName: P,
101
+ isBlocking: v,
92
102
  resizeConfig: d,
93
- ...u,
103
+ skipMountAnimation: u,
104
+ ...g,
94
105
  role: e === "alert" ? "alertdialog" : "dialog",
95
- "aria-modal": g || void 0,
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
- L as OverlayPanel
114
+ Q as OverlayPanel
104
115
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),M=require("clsx"),E=require("react"),V=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const W=require("./Header/Panel.Header.cjs.js"),G=require("./Panel.Body.cjs.js"),U=require("./Footer/Panel.Footer.cjs.js"),c=require("./Panel.helpers.cjs.js"),J=require("./Panel.Inline.cjs.js"),Q=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.CVyUzyCZ.js"),X=165,Y=100,Z=(n,u)=>{if(!n||u==="full")return;const f=u==="bottom",l=typeof n=="object"?n:{},d=l.minSize??(f?Y:X),o=l.maxSize??1/0,P=l.storageKey??"";return{minSize:d,maxSize:o,storageKey:P}},{baseClassNamePrefix:s}=V.getBEMClassNames("panel"),_=({children:n,className:u,padding:f="md",onOpenChange:l,open:d,size:o="md",dismissible:P=!0,closeButtonAriaLabel:m="Close panel",kind:a="inline",position:y,divider:x=!0,dividerColor:g,isAnimated:v=!0,onBeforeClose:z,modalType:i,offset:N,resizable:B,id:O,...p})=>{const t=c.getResolvedPanelPosition(y),r=Z(B,t),D=!!r;if(process.env.NODE_ENV!=="production"){r&&!r.storageKey&&console.warn("Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."),i==="alert"&&P&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');const{closeOnOutsidePress:L}=p;L&&i!=="nonModal"&&i!==void 0&&console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.')}const b=i==="alert"?!1:P,H=o&&(t!=="bottom"||o==="full"),w=a==="overlay"&&N?c.resolveOffset(N):void 0,q=!!w,$=M(e.styles[s],e.styles[`${s}--${a}`],H&&e.styles[`${s}--size-${o}`],e.styles[`${s}--padding-${f}`],e.styles[`${s}--position-${t}`],q&&e.styles[`${s}--floating`],D&&e.styles[`${s}--resizable`],u),T=M(e.styles[`${s}__inline-wrapper`],e.styles[`${s}__inline-wrapper--size-${o}`]),{requestClose:C,handleOverlayOpenChange:R}=c.usePanelClose(z,l),I=E.useMemo(()=>({kind:a,dismissible:b,closeButtonAriaLabel:m,position:y,requestClose:C}),[a,b,m,y,C]),{showDivider:j,dividerBefore:A,dividerInner:F,dividerAfter:K}=c.getPanelDividerState(x&&!q,t),h=E.useMemo(()=>({duration:v?c.PANEL_TRANSITION_DURATION_MS:0}),[v]);return a==="inline"?S.jsx(J.InlinePanel,{contextValue:I,panelClassName:$,inlineWrapperClassName:T,resolvedPosition:t,dividerBefore:A,dividerInner:F,dividerAfter:K,dividerColor:g,open:d,transitionConfig:h,resizeConfig:r,id:O,...p,children:n}):S.jsx(Q.OverlayPanel,{contextValue:I,panelClassName:$,resolvedPosition:t,showDivider:j,dividerColor:g,modalType:i,floatingOffset:w,open:d,onOpenChange:R,transitionConfig:h,resizeConfig:r,id:O,...p,children:n})};_.displayName="Panel";_.Header=W.Header;_.Body=G.Body;_.Footer=U.Footer;exports.Panel=_;
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 E } from "react/jsx-runtime";
2
- import S from "clsx";
3
- import { useMemo as z } from "react";
4
- import { g as V } from "../../../chunks/classNames.BTJmrO_L.js";
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 W } from "./Header/Panel.Header.es.js";
7
- import { Body as q } from "./Panel.Body.es.js";
8
- import { Footer as G } from "./Footer/Panel.Footer.es.js";
9
- import { resolveOffset as U, usePanelClose as J, getPanelDividerState as Q, PANEL_TRANSITION_DURATION_MS as X, getResolvedPanelPosition as Y } from "./Panel.helpers.es.js";
10
- import { InlinePanel as Z } from "./Panel.Inline.es.js";
11
- import { OverlayPanel as k } from "./Panel.Overlay.es.js";
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 ee = 165, oe = 100, se = (s, m) => {
14
- if (!s || m === "full") return;
15
- const p = m === "bottom", r = typeof s == "object" ? s : {}, c = r.minSize ?? (p ? oe : ee), n = r.maxSize ?? 1 / 0, f = r.storageKey ?? "";
16
- return { minSize: c, maxSize: n, storageKey: f };
17
- }, { baseClassNamePrefix: o } = V("panel"), d = ({
18
- children: s,
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: r,
22
- open: c,
23
- size: n = "md",
21
+ onOpenChange: i,
22
+ open: a,
23
+ size: t = "md",
24
24
  dismissible: f = !0,
25
25
  closeButtonAriaLabel: N = "Close panel",
26
- kind: i = "inline",
27
- position: g,
28
- divider: M = !0,
29
- dividerColor: v,
30
- isAnimated: P = !0,
31
- onBeforeClose: x,
32
- modalType: a,
33
- offset: O,
34
- resizable: D,
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
- ...u
36
+ ...g
37
37
  }) => {
38
- const t = Y(g), l = se(D, t), B = !!l;
38
+ const r = ee(u), c = re(B, r), R = !!c;
39
39
  if (process.env.NODE_ENV !== "production") {
40
- l && !l.storageKey && console.warn("Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."), a === "alert" && f && console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');
41
- const { closeOnOutsidePress: L } = u;
42
- L && a !== "nonModal" && a !== void 0 && console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.');
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 = a === "alert" ? !1 : f, T = n && (t !== "bottom" || n === "full"), $ = i === "overlay" && O ? U(O) : void 0, C = !!$, I = S(
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}--${i}`],
47
- T && e[`${o}--size-${n}`],
52
+ e[`${o}--${s}`],
53
+ T && e[`${o}--size-${t}`],
48
54
  e[`${o}--padding-${p}`],
49
- e[`${o}--position-${t}`],
50
- C && e[`${o}--floating`],
51
- B && e[`${o}--resizable`],
55
+ e[`${o}--position-${r}`],
56
+ h && e[`${o}--floating`],
57
+ R && e[`${o}--resizable`],
52
58
  m
53
- ), A = S(
59
+ ), H = z(
54
60
  e[`${o}__inline-wrapper`],
55
- e[`${o}__inline-wrapper--size-${n}`]
56
- ), { requestClose: h, handleOverlayOpenChange: H } = J(
57
- x,
58
- r
59
- ), b = z(
61
+ e[`${o}__inline-wrapper--size-${t}`]
62
+ ), { requestClose: b, handleOverlayOpenChange: K } = Y(
63
+ A,
64
+ i
65
+ ), w = x(
60
66
  () => ({
61
- kind: i,
67
+ kind: s,
62
68
  dismissible: y,
63
69
  closeButtonAriaLabel: N,
64
- position: g,
65
- requestClose: h
70
+ position: u,
71
+ requestClose: b
66
72
  }),
67
- [i, y, N, g, h]
68
- ), { showDivider: K, dividerBefore: R, dividerInner: F, dividerAfter: j } = Q(M && !C, t), w = z(
69
- () => ({ duration: P ? X : 0 }),
70
- [P]
71
- );
72
- return i === "inline" ? /* @__PURE__ */ E(
73
- Z,
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: b,
81
+ contextValue: w,
76
82
  panelClassName: I,
77
- inlineWrapperClassName: A,
78
- resolvedPosition: t,
79
- dividerBefore: R,
80
- dividerInner: F,
81
- dividerAfter: j,
82
- dividerColor: v,
83
- open: c,
84
- transitionConfig: w,
85
- resizeConfig: l,
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
- ...u,
88
- children: s
94
+ ...g,
95
+ children: n
89
96
  }
90
- ) : /* @__PURE__ */ E(
91
- k,
97
+ ) : /* @__PURE__ */ S(
98
+ se,
92
99
  {
93
- contextValue: b,
100
+ contextValue: w,
94
101
  panelClassName: I,
95
- resolvedPosition: t,
96
- showDivider: K,
97
- dividerColor: v,
98
- modalType: a,
102
+ resolvedPosition: r,
103
+ showDivider: F,
104
+ dividerColor: P,
105
+ modalType: l,
99
106
  floatingOffset: $,
100
- open: c,
101
- onOpenChange: H,
102
- transitionConfig: w,
103
- resizeConfig: l,
107
+ open: a,
108
+ onOpenChange: K,
109
+ transitionConfig: E,
110
+ resizeConfig: c,
111
+ skipMountAnimation: M,
104
112
  id: _,
105
- ...u,
106
- children: s
113
+ ...g,
114
+ children: n
107
115
  }
108
116
  );
109
117
  };
110
118
  d.displayName = "Panel";
111
- d.Header = W;
112
- d.Body = q;
113
- d.Footer = G;
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.29.1",
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.29.1",
63
- "@viasat/beam-shared": "2.29.1",
64
- "@viasat/beam-styles": "2.29.1",
65
- "@viasat/beam-tokens": "2.29.1",
66
- "@viasat/beam-icons": "2.29.1",
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",