@viasat/beam-react 2.20.0 → 2.21.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 t=require("react/jsx-runtime"),l=require("clsx"),i=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const c=require("../../../chunks/panel.module.BX1x4FlX.js"),{subElementClassPrefix:o}=i.getBEMClassNames("panel"),u=`${o}header`,e=({children:s,className:a,...n})=>{const r=l(c.styles[`${u}__heading`],a);return t.jsx("div",{className:r,...n,children:s})};e.displayName="Panel.Header.Heading";exports.Heading=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),o=require("react"),g=require("clsx"),m=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const q=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),b=require("./Panel.context.cjs.js"),x=require("../../../utils/hooks/useId.cjs.js"),I=require("../../../chunks/panel.module.BX1x4FlX.js"),{subElementClassPrefix:y}=m.getBEMClassNames("panel"),P=`${y}header`,a=({children:r,className:i,id:c,...l})=>{const u=x.useId(),e=c??u,d=g(I.styles[`${P}__heading`],i),t=o.useContext(b.PanelContext),n=o.useContext(q.BmFloatingUIContext),s=(t==null?void 0:t.kind)==="overlay"?n==null?void 0:n.setLabelId:void 0;return o.useLayoutEffect(()=>{if(!(!s||!e))return s(e),()=>s(void 0)},[e,s]),_.jsx("div",{id:e,className:d,...l,children:r})};a.displayName="Panel.Header.Heading";exports.Heading=a;
@@ -6,6 +6,6 @@ export interface PanelHeaderHeadingProps extends ComponentPropsWithoutRef<'div'>
6
6
  children?: React.ReactNode;
7
7
  }
8
8
  export declare const Heading: {
9
- ({ children, className: _className, ...props }: PanelHeaderHeadingProps): import("react/jsx-runtime").JSX.Element;
9
+ ({ children, className: _className, id: _id, ...props }: PanelHeaderHeadingProps): import("react/jsx-runtime").JSX.Element;
10
10
  displayName: string;
11
11
  };
@@ -1,17 +1,25 @@
1
- import { jsx as m } from "react/jsx-runtime";
2
- import o from "clsx";
3
- import { g as t } from "../../../chunks/classNames.BTJmrO_L.js";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { useContext as r, useLayoutEffect as f } from "react";
3
+ import p from "clsx";
4
+ import { g as u } from "../../../chunks/classNames.BTJmrO_L.js";
4
5
  import "../../../chunks/constants.CKKGf1-i.js";
5
- import { s as i } from "../../../chunks/panel.module.BVm3KvDs.js";
6
- const { subElementClassPrefix: l } = t("panel"), n = `${l}header`, p = ({
7
- children: s,
8
- className: e,
9
- ...a
6
+ import { B as g } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
7
+ import { PanelContext as x } from "./Panel.context.es.js";
8
+ import { useId as I } from "../../../utils/hooks/useId.es.js";
9
+ import { s as b } from "../../../chunks/panel.module.BVm3KvDs.js";
10
+ const { subElementClassPrefix: v } = u("panel"), y = `${v}header`, C = ({
11
+ children: a,
12
+ className: m,
13
+ id: n,
14
+ ...i
10
15
  }) => {
11
- const r = o(i[`${n}__heading`], e);
12
- return /* @__PURE__ */ m("div", { className: r, ...a, children: s });
16
+ const d = I(), e = n ?? d, l = p(b[`${y}__heading`], m), o = r(x), t = r(g), s = (o == null ? void 0 : o.kind) === "overlay" ? t == null ? void 0 : t.setLabelId : void 0;
17
+ return f(() => {
18
+ if (!(!s || !e))
19
+ return s(e), () => s(void 0);
20
+ }, [e, s]), /* @__PURE__ */ c("div", { id: e, className: l, ...i, children: a });
13
21
  };
14
- p.displayName = "Panel.Header.Heading";
22
+ C.displayName = "Panel.Header.Heading";
15
23
  export {
16
- p as Heading
24
+ C as Heading
17
25
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("clsx"),m=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const _=require("../../CloseButton/CloseButton.cjs.js"),b=require("./Panel.context.cjs.js"),s=require("../../../chunks/panel.module.BX1x4FlX.js"),{subElementClassPrefix:C}=m.getBEMClassNames("panel"),t=`${C}header`,l=({children:o,className:n,...a})=>{const{dismissible:r,closeButtonAriaLabel:i,requestClose:c}=b.usePanelContext(),u=d(s.styles[`${t}__row`],n);return e.jsxs("div",{className:u,...a,children:[o,r&&e.jsx("div",{className:s.styles[`${t}__close-button`],children:e.jsx(_.CloseButton,{"aria-label":i,onClick:()=>c("closeButton"),size:"lg"})})]})};l.displayName="Panel.Header.Row";exports.Row=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("clsx"),b=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const m=require("../../CloseButton/CloseButton.cjs.js"),_=require("../../Tooltip/Tooltip.cjs.js"),p=require("./Panel.context.cjs.js"),t=require("../../../chunks/panel.module.BX1x4FlX.js"),{subElementClassPrefix:x}=b.getBEMClassNames("panel"),l=`${x}header`,o=({children:n,className:r,...a})=>{const{dismissible:i,closeButtonAriaLabel:s,requestClose:c}=p.usePanelContext(),u=d(t.styles[`${l}__row`],r);return e.jsxs("div",{className:u,...a,children:[n,i&&e.jsx("div",{className:t.styles[`${l}__close-button`],children:e.jsx(_.Tooltip,{text:s,placement:"bottom",portalled:!0,role:{enabled:!1},children:e.jsx(m.CloseButton,{"aria-label":s,onClick:()=>c("closeButton"),size:"lg"})})})]})};o.displayName="Panel.Header.Row";exports.Row=o;
@@ -1,29 +1,30 @@
1
- import { jsxs as c, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
2
  import p from "clsx";
3
3
  import { g as d } from "../../../chunks/classNames.BTJmrO_L.js";
4
4
  import "../../../chunks/constants.CKKGf1-i.js";
5
- import { CloseButton as u } from "../../CloseButton/CloseButton.es.js";
6
- import { usePanelContext as f } from "./Panel.context.es.js";
7
- import { s as e } from "../../../chunks/panel.module.BVm3KvDs.js";
8
- const { subElementClassPrefix: C } = d("panel"), o = `${C}header`, b = ({
9
- children: t,
10
- className: l,
5
+ import { CloseButton as f } from "../../CloseButton/CloseButton.es.js";
6
+ import { Tooltip as u } from "../../Tooltip/Tooltip.es.js";
7
+ import { usePanelContext as b } from "./Panel.context.es.js";
8
+ import { s as o } from "../../../chunks/panel.module.BVm3KvDs.js";
9
+ const { subElementClassPrefix: x } = d("panel"), t = `${x}header`, C = ({
10
+ children: l,
11
+ className: r,
11
12
  ...a
12
13
  }) => {
13
- const { dismissible: r, closeButtonAriaLabel: i, requestClose: m } = f(), n = p(e[`${o}__row`], l);
14
+ const { dismissible: m, closeButtonAriaLabel: s, requestClose: i } = b(), n = p(o[`${t}__row`], r);
14
15
  return /* @__PURE__ */ c("div", { className: n, ...a, children: [
15
- t,
16
- r && /* @__PURE__ */ s("div", { className: e[`${o}__close-button`], children: /* @__PURE__ */ s(
17
- u,
16
+ l,
17
+ m && /* @__PURE__ */ e("div", { className: o[`${t}__close-button`], children: /* @__PURE__ */ e(u, { text: s, placement: "bottom", portalled: !0, role: { enabled: !1 }, children: /* @__PURE__ */ e(
18
+ f,
18
19
  {
19
- "aria-label": i,
20
- onClick: () => m("closeButton"),
20
+ "aria-label": s,
21
+ onClick: () => i("closeButton"),
21
22
  size: "lg"
22
23
  }
23
- ) })
24
+ ) }) })
24
25
  ] });
25
26
  };
26
- b.displayName = "Panel.Header.Row";
27
+ C.displayName = "Panel.Header.Row";
27
28
  export {
28
- b as Row
29
+ C as Row
29
30
  };
@@ -22,7 +22,7 @@ export declare const Header: {
22
22
  displayName: string;
23
23
  };
24
24
  Heading: {
25
- ({ children, className: _className, ...props }: import('./Panel.Header.Heading').PanelHeaderHeadingProps): import("react/jsx-runtime").JSX.Element;
25
+ ({ children, className: _className, id: _id, ...props }: import('./Panel.Header.Heading').PanelHeaderHeadingProps): import("react/jsx-runtime").JSX.Element;
26
26
  displayName: string;
27
27
  };
28
28
  Description: {
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),q=require("clsx"),x=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const b=require("./Panel.context.cjs.js"),f=require("./Panel.helpers.cjs.js"),p=require("../../FloatingUI/FloatingUI.root.cjs.js"),y=require("../../FloatingUI/FloatingUI.content.cjs.js"),C=require("./Panel.Inline.cjs.js"),n=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:a}=x.getBEMClassNames("panel"),F=({contextValue:t,panelClassName:r,resolvedPosition:l,showDivider:o,modalType:e,closeOnOutsidePress:c,open:u,onOpenChange:_,transitionConfig:d,children:g,...v})=>{const s=e==="isModal"||e==="alert",m=f.getPanelDismissConfig(e,c),P=q(n.styles[`${a}__overlay-divider`],n.styles[`${a}__overlay-divider--${l}`]);return i.jsx(b.PanelContext.Provider,{value:t,children:i.jsx(p.FloatingUIRoot,{open:u,onOpenChange:_,portalled:!0,transitionConfig:d,dismiss:m,focusConfiguration:s?!0:{modal:!1,closeOnFocusOut:!1},children:i.jsxs(y.Content,{className:r,skipFloatingStyles:!0,overlay:s,...v,role:e==="alert"?"alertdialog":"dialog","aria-modal":s||void 0,"data-position":l,children:[g,o&&i.jsx(C.InlineDivider,{position:l,className:P})]})})})};exports.OverlayPanel=F;
@@ -1,4 +1,4 @@
1
- import { jsx as r, jsxs as u } from "react/jsx-runtime";
1
+ import { jsx as s, jsxs as C } from "react/jsx-runtime";
2
2
  import x from "clsx";
3
3
  import { g as N } from "../../../chunks/classNames.BTJmrO_L.js";
4
4
  import "../../../chunks/constants.CKKGf1-i.js";
@@ -6,26 +6,26 @@ import { PanelContext as y } from "./Panel.context.es.js";
6
6
  import { getPanelDismissConfig as _ } from "./Panel.helpers.es.js";
7
7
  import { FloatingUIRoot as h } from "../../FloatingUI/FloatingUI.root.es.js";
8
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";
9
+ import { InlineDivider as F } from "./Panel.Inline.es.js";
10
+ import { s as a } from "../../../chunks/panel.module.BVm3KvDs.js";
11
11
  const { baseClassNamePrefix: e } = N("panel"), R = ({
12
- contextValue: a,
12
+ contextValue: t,
13
13
  panelClassName: l,
14
- resolvedPosition: o,
15
- showDivider: n,
16
- modalType: i,
17
- closeOnOutsidePress: m,
14
+ resolvedPosition: r,
15
+ showDivider: m,
16
+ modalType: o,
17
+ closeOnOutsidePress: n,
18
18
  open: f,
19
19
  onOpenChange: c,
20
20
  transitionConfig: d,
21
21
  children: p,
22
22
  ...g
23
23
  }) => {
24
- const s = i === "isModal" || i === "alert", v = _(i, m), C = x(
25
- t[`${e}__overlay-divider`],
26
- t[`${e}__overlay-divider--${o}`]
24
+ const i = o === "isModal" || o === "alert", v = _(o, n), u = x(
25
+ a[`${e}__overlay-divider`],
26
+ a[`${e}__overlay-divider--${r}`]
27
27
  );
28
- return /* @__PURE__ */ r(y.Provider, { value: a, children: /* @__PURE__ */ r(
28
+ return /* @__PURE__ */ s(y.Provider, { value: t, children: /* @__PURE__ */ s(
29
29
  h,
30
30
  {
31
31
  open: f,
@@ -33,19 +33,20 @@ const { baseClassNamePrefix: e } = N("panel"), R = ({
33
33
  portalled: !0,
34
34
  transitionConfig: d,
35
35
  dismiss: v,
36
- focusConfiguration: s || void 0,
37
- children: /* @__PURE__ */ u(
36
+ focusConfiguration: i ? !0 : { modal: !1, closeOnFocusOut: !1 },
37
+ children: /* @__PURE__ */ C(
38
38
  D,
39
39
  {
40
40
  className: l,
41
41
  skipFloatingStyles: !0,
42
- overlay: s,
42
+ overlay: i,
43
43
  ...g,
44
- role: i === "alert" ? "alertdialog" : "dialog",
45
- "data-position": o,
44
+ role: o === "alert" ? "alertdialog" : "dialog",
45
+ "aria-modal": i || void 0,
46
+ "data-position": r,
46
47
  children: [
47
48
  p,
48
- n && /* @__PURE__ */ r(P, { position: o, className: C })
49
+ m && /* @__PURE__ */ s(F, { position: r, className: u })
49
50
  ]
50
51
  }
51
52
  )
@@ -1 +1 @@
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
+ "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:u,className:b,padding:C="md",onOpenChange:g,open:_,size:o,dismissible:d=!0,closeButtonAriaLabel:P="Close panel",kind:r="inline",position:t,divider:$=!0,isAnimated:p=!0,onBeforeClose:h,modalType:n,...c})=>{process.env.NODE_ENV!=="production"&&n==="alert"&&d&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'),process.env.NODE_ENV!=="production"&&c.closeOnOutsidePress&&n!=="nonModal"&&n!==void 0&&console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.');const N=n==="alert"?!1:d,a=i.getResolvedPanelPosition(t),v=f(e.styles[s],e.styles[`${s}--${r}`],o&&e.styles[`${s}--size-${o}`],e.styles[`${s}--padding-${C}`],e.styles[`${s}--position-${a}`],b),M=f(e.styles[`${s}__inline-wrapper`],o==="full"&&e.styles[`${s}__inline-wrapper--full`]),{requestClose:y,handleOverlayOpenChange:x}=i.usePanelClose(h,g),m=q.useMemo(()=>({kind:r,dismissible:N,closeButtonAriaLabel:P,position:t,requestClose:y}),[r,N,P,t,y]),{showDivider:D,dividerBefore:E,dividerInner:I,dividerAfter:R}=i.getPanelDividerState($,a),w=q.useMemo(()=>({duration:p?i.PANEL_TRANSITION_DURATION_MS:0}),[p]);return r==="inline"?O.jsx(H.InlinePanel,{contextValue:m,panelClassName:v,inlineWrapperClassName:M,resolvedPosition:a,dividerBefore:E,dividerInner:I,dividerAfter:R,open:_,transitionConfig:w,...c,children:u}):O.jsx(T.OverlayPanel,{contextValue:m,panelClassName:v,resolvedPosition:a,showDivider:D,modalType:n,open:_,onOpenChange:x,transitionConfig:w,...c,children:u})};l.displayName="Panel";l.Header=j.Header;l.Body=B.Body;l.Footer=F.Footer;exports.Panel=l;
@@ -1,5 +1,9 @@
1
- import { PanelCloseReason, PanelPosition } from './Panel.types';
1
+ import { PanelCloseReason, PanelKind, PanelPosition } from './Panel.types';
2
2
  export interface PanelContextValue {
3
+ /**
4
+ * The panel kind — used by sub-components to vary behaviour per kind.
5
+ */
6
+ kind: PanelKind;
3
7
  /**
4
8
  * Whether to show a dismissible button
5
9
  */
@@ -14,7 +14,7 @@ export declare const Panel: {
14
14
  displayName: string;
15
15
  };
16
16
  Heading: {
17
- ({ children, className: _className, ...props }: import('./Panel.Header.Heading').PanelHeaderHeadingProps): import("react/jsx-runtime").JSX.Element;
17
+ ({ children, className: _className, id: _id, ...props }: import('./Panel.Header.Heading').PanelHeaderHeadingProps): import("react/jsx-runtime").JSX.Element;
18
18
  displayName: string;
19
19
  };
20
20
  Description: {
@@ -10,49 +10,49 @@ import { usePanelClose as F, getPanelDividerState as H, PANEL_TRANSITION_DURATIO
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: o } = R("panel"), r = ({
14
- children: l,
13
+ const { baseClassNamePrefix: o } = R("panel"), i = ({
14
+ children: m,
15
15
  className: _,
16
16
  padding: h = "md",
17
17
  onOpenChange: w,
18
- open: m,
19
- size: i,
20
- dismissible: d = !0,
21
- closeButtonAriaLabel: f = "Close panel",
22
- kind: p = "inline",
23
- position: t,
18
+ open: d,
19
+ size: t,
20
+ dismissible: f = !0,
21
+ closeButtonAriaLabel: p = "Close panel",
22
+ kind: r = "inline",
23
+ position: a,
24
24
  divider: D = !0,
25
25
  isAnimated: c = !0,
26
26
  onBeforeClose: E,
27
27
  modalType: s,
28
- ...a
28
+ ...l
29
29
  }) => {
30
- process.env.NODE_ENV !== "production" && s === "alert" && d && console.warn(
30
+ process.env.NODE_ENV !== "production" && s === "alert" && f && 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(
32
+ ), process.env.NODE_ENV !== "production" && l.closeOnOutsidePress && s !== "nonModal" && s !== void 0 && console.warn(
33
33
  'Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'
34
34
  );
35
- const u = s === "alert" ? !1 : d, n = j(t), N = $(
35
+ const u = s === "alert" ? !1 : f, n = j(a), N = $(
36
36
  e[o],
37
- e[`${o}--${p}`],
38
- i && e[`${o}--size-${i}`],
37
+ e[`${o}--${r}`],
38
+ t && e[`${o}--size-${t}`],
39
39
  e[`${o}--padding-${h}`],
40
40
  e[`${o}--position-${n}`],
41
41
  _
42
42
  ), x = $(
43
43
  e[`${o}__inline-wrapper`],
44
- i === "full" && e[`${o}__inline-wrapper--full`]
44
+ t === "full" && e[`${o}__inline-wrapper--full`]
45
45
  ), { requestClose: v, handleOverlayOpenChange: y } = F(
46
46
  E,
47
47
  w
48
48
  ), P = g(
49
- () => ({ dismissible: u, closeButtonAriaLabel: f, position: t, requestClose: v }),
50
- [u, f, t, v]
49
+ () => ({ kind: r, dismissible: u, closeButtonAriaLabel: p, position: a, requestClose: v }),
50
+ [r, u, p, a, v]
51
51
  ), { showDivider: I, dividerBefore: M, dividerInner: b, dividerAfter: B } = H(D, n), O = g(
52
52
  () => ({ duration: c ? T : 0 }),
53
53
  [c]
54
54
  );
55
- return p === "inline" ? /* @__PURE__ */ C(
55
+ return r === "inline" ? /* @__PURE__ */ C(
56
56
  q,
57
57
  {
58
58
  contextValue: P,
@@ -62,10 +62,10 @@ const { baseClassNamePrefix: o } = R("panel"), r = ({
62
62
  dividerBefore: M,
63
63
  dividerInner: b,
64
64
  dividerAfter: B,
65
- open: m,
65
+ open: d,
66
66
  transitionConfig: O,
67
- ...a,
68
- children: l
67
+ ...l,
68
+ children: m
69
69
  }
70
70
  ) : /* @__PURE__ */ C(
71
71
  U,
@@ -75,18 +75,18 @@ const { baseClassNamePrefix: o } = R("panel"), r = ({
75
75
  resolvedPosition: n,
76
76
  showDivider: I,
77
77
  modalType: s,
78
- open: m,
78
+ open: d,
79
79
  onOpenChange: y,
80
80
  transitionConfig: O,
81
- ...a,
82
- children: l
81
+ ...l,
82
+ children: m
83
83
  }
84
84
  );
85
85
  };
86
- r.displayName = "Panel";
87
- r.Header = S;
88
- r.Body = V;
89
- r.Footer = A;
86
+ i.displayName = "Panel";
87
+ i.Header = S;
88
+ i.Body = V;
89
+ i.Footer = A;
90
90
  export {
91
- r as Panel
91
+ i as Panel
92
92
  };
@@ -18,6 +18,18 @@ interface BasePanelProps extends ComponentPropsWithoutRef<'aside'> {
18
18
  * Specify the content of the Panel
19
19
  */
20
20
  children: React.ReactNode;
21
+ /**
22
+ * Accessible name for the panel dialog when `Panel.Header.Heading` is not rendered.
23
+ * When a heading is present, `aria-labelledby` is set automatically.
24
+ * Provide this prop whenever you build a panel without `Panel.Header.Heading` to satisfy
25
+ * the WCAG requirement that every `role="dialog"` element has an accessible name.
26
+ *
27
+ * @example
28
+ * ```tsx
29
+ * <Panel kind="overlay" aria-label="User settings" ... />
30
+ * ```
31
+ */
32
+ 'aria-label'?: string;
21
33
  /**
22
34
  * Controls the Panel's visibility. For inline panels, omitting this prop
23
35
  * renders the panel as always-visible (uncontrolled).
@@ -44,7 +56,8 @@ interface BasePanelProps extends ComponentPropsWithoutRef<'aside'> {
44
56
  */
45
57
  dismissible?: boolean;
46
58
  /**
47
- * Aria label for the dismissible button
59
+ * Label for the close button. Used as both the button's `aria-label` (screen reader name)
60
+ * and the visible tooltip text. Provide a value that works in both contexts.
48
61
  * @default 'Close panel'
49
62
  */
50
63
  closeButtonAriaLabel?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viasat/beam-react",
3
- "version": "2.20.0",
3
+ "version": "2.21.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.20.0",
63
- "@viasat/beam-shared": "2.20.0",
64
- "@viasat/beam-styles": "2.20.0",
65
- "@viasat/beam-tokens": "2.20.0",
66
- "@viasat/beam-icons": "2.20.0",
62
+ "@viasat/beam-fonts": "2.21.0",
63
+ "@viasat/beam-shared": "2.21.0",
64
+ "@viasat/beam-styles": "2.21.0",
65
+ "@viasat/beam-tokens": "2.21.0",
66
+ "@viasat/beam-icons": "2.21.0",
67
67
  "clsx": "^1.2.1",
68
68
  "@floating-ui/react": "^0.26.18",
69
69
  "@stepperize/react": "^5.1.5",