@viasat/beam-react 2.12.0 → 2.14.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/assets/index.css +1 -1
- package/assets/panel.css +1 -1
- package/chunks/FloatingUI.context.B15Tz_4h.js +1 -0
- package/chunks/{FloatingUI.context.DtJA57si.js → FloatingUI.context.Dl4Y1y1z.js} +105 -103
- package/lib/Dialog/Dialog.Header.cjs.js +1 -1
- package/lib/Dialog/Dialog.Header.es.js +1 -1
- package/lib/Dialog/Dialog.Trigger.cjs.js +1 -1
- package/lib/Dialog/Dialog.Trigger.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.context.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.context.d.ts +6 -2
- package/lib/FloatingUI/FloatingUI.context.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.interactions.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.interactions.d.ts +3 -2
- package/lib/FloatingUI/FloatingUI.interactions.es.js +16 -15
- package/lib/FloatingUI/FloatingUI.root.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.root.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.close.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.close.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.es.js +1 -1
- package/lib/Menu/ActionListContextWrapper.cjs.js +1 -1
- package/lib/Menu/ActionListContextWrapper.es.js +1 -1
- package/lib/Popover/Popover.content.cjs.js +1 -1
- package/lib/Popover/Popover.content.es.js +1 -1
- package/lib/Popover/Popover.trigger.cjs.js +1 -1
- package/lib/Popover/Popover.trigger.es.js +1 -1
- package/lib/Tooltip/Tooltip.cjs.js +1 -1
- package/lib/Tooltip/Tooltip.es.js +1 -1
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.es.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +3 -2
- package/lib/wip/Panel/Panel.Overlay.es.js +33 -30
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.d.ts +1 -1
- package/lib/wip/Panel/Panel.es.js +57 -52
- package/lib/wip/Panel/Panel.types.d.ts +7 -1
- package/package.json +6 -6
- package/chunks/FloatingUI.context.Du9g2lSg.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { ActionListContextProvider as i } from "../ActionList/ActionList.context.es.js";
|
|
3
|
-
import { a as n } from "../../chunks/FloatingUI.context.
|
|
3
|
+
import { a as n } from "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
4
4
|
const x = ({
|
|
5
5
|
children: t,
|
|
6
6
|
...o
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("clsx"),l=require("../../chunks/popover.module.Dum8SaSU.js"),p=require("../../chunks/classNames.DAeKwerT.js"),t=require("../../chunks/constants.hwjHOsvT.js");require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),u=require("clsx"),l=require("../../chunks/popover.module.Dum8SaSU.js"),p=require("../../chunks/classNames.DAeKwerT.js"),t=require("../../chunks/constants.hwjHOsvT.js");require("../../chunks/FloatingUI.context.B15Tz_4h.js");require("react");require("@floating-ui/react");const m=require("../FloatingUI/FloatingUI.content.cjs.js"),q=require("./Popover.context.cjs.js");function o({children:r,className:n,...s}){const{theme:e,appearance:i}=q.usePopoverContext(),{baseClassNamePrefix:a}=p.getBEMClassNames("popover");return c.jsx(m.Content,{className:u(e&&t.themeClassName(e),l.popoverStyles[a],i==="inverse"&&t.BEAM_INVERSE,n),...s,children:r})}o.displayName="Popover.Content";exports.Content=o;
|
|
@@ -3,7 +3,7 @@ import a from "clsx";
|
|
|
3
3
|
import { p as n } from "../../chunks/popover.module.C6KFea25.js";
|
|
4
4
|
import { g as i } from "../../chunks/classNames.BTJmrO_L.js";
|
|
5
5
|
import { t as f, c as C } from "../../chunks/constants.CKKGf1-i.js";
|
|
6
|
-
import "../../chunks/FloatingUI.context.
|
|
6
|
+
import "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
7
7
|
import "react";
|
|
8
8
|
import "@floating-ui/react";
|
|
9
9
|
import { Content as c } from "../FloatingUI/FloatingUI.content.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("../../chunks/FloatingUI.context.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("../../chunks/FloatingUI.context.B15Tz_4h.js");const t=require("../FloatingUI/FloatingUI.trigger.cjs.js"),s=require("../FloatingUI/FloatingUI.trigger.close.cjs.js");require("../FloatingUI/FloatingUI.content.cjs.js");require("react");const g=({children:e,...r})=>i.jsx(t.Trigger,{...r,children:e});g.displayName="Popover.Trigger";const o=({children:e,...r})=>i.jsx(s.CloseTrigger,{...r,children:e});o.displayName="Popover.CloseTrigger";exports.CloseTrigger=o;exports.Trigger=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import "../../chunks/FloatingUI.context.
|
|
2
|
+
import "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
3
3
|
import { Trigger as g } from "../FloatingUI/FloatingUI.trigger.es.js";
|
|
4
4
|
import { CloseTrigger as i } from "../FloatingUI/FloatingUI.trigger.close.es.js";
|
|
5
5
|
import "../FloatingUI/FloatingUI.content.es.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var N=require("../../assets/Tooltip.css");Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),g=require("react"),h=require("../FloatingUI/FloatingUI.root.cjs.js"),d=require("../FloatingUI/FloatingUI.trigger.cjs.js");require("../../chunks/FloatingUI.context.
|
|
1
|
+
var N=require("../../assets/Tooltip.css");Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),g=require("react"),h=require("../FloatingUI/FloatingUI.root.cjs.js"),d=require("../FloatingUI/FloatingUI.trigger.cjs.js");require("../../chunks/FloatingUI.context.B15Tz_4h.js");const w=require("../FloatingUI/FloatingUI.content.cjs.js"),p=require("../../chunks/tokens.Bc11gmpN.js"),j=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const u=require("../../utils/hooks/index.cjs.js"),x=require("clsx"),b=require("../../chunks/CSSLookup.DESAWWRT.js"),l={"bm-light":"bm-light","bm-dark":"bm-dark","bm-inverse":"bm-inverse","bm-tooltip__icon-trigger":"bm-tooltip__icon-trigger","bm-tooltip":"bm-tooltip","bm-tooltip__arrow":"bm-tooltip__arrow","bm-tooltip__icon-trigger--disabled":"bm-tooltip__icon-trigger--disabled","bm-tooltip__icon-trigger--xs":"bm-tooltip__icon-trigger--xs","bm-tooltip__icon-trigger--sm":"bm-tooltip__icon-trigger--sm","bm-tooltip__icon-trigger--md":"bm-tooltip__icon-trigger--md","bm-tooltip__icon-trigger--lg":"bm-tooltip__icon-trigger--lg","bm-tooltip__icon-trigger--xl":"bm-tooltip__icon-trigger--xl"},{baseClassNamePrefix:I,subElementClassPrefix:_}=j.getBEMClassNames("tooltip");function f({children:e,portalled:r=!1,text:i,disabled:t,showDelay:a,role:c,...n}){const s=u.useCSSLookup(p.bmCompTooltipSpaceArrow),m=u.useCSSLookup(p.bmCompTooltipSpaceOffset),C=g.useMemo(()=>({edgePadding:b.parseSizeString(s),className:l[`${_}arrow`],hide:!1}),[s]),T=t?{}:{openOnHover:{restMs:a},openOnFocus:!0,openOnSelected:!0},q=c||{enabled:!0,role:"tooltip"};return o.jsxs(h.FloatingUIRoot,{...T,arrow:C,offset:b.parseSizeString(m),portalled:r,transitionConfig:{duration:{open:0,close:200}},role:q,...n,children:[o.jsx(S.Provider,{value:{disabled:t},children:o.jsx(d.Trigger,{children:e})}),o.jsx(F,{theme:n.theme,children:i})]})}const S=g.createContext({disabled:!1}),k=g.forwardRef(({children:e,size:r="md",type:i="button",className:t,...a},c)=>{const{disabled:n}=g.useContext(S),s=`${_}icon-trigger`,m=x(l[`${s}--${r}`],l[s],n&&l[`${_}icon-trigger--disabled`],t);return o.jsx(d.Trigger,{children:o.jsx("button",{ref:c,type:i,disabled:n,className:m,...a,"aria-label":"tooltip trigger",children:e})})});function F({children:e,theme:r,className:i,...t}){return o.jsx(w.Content,{className:x(r,l[I],i),...t,children:e})}exports.Tooltip=f;exports.TooltipIconTrigger=k;exports.default=f;
|
|
@@ -3,7 +3,7 @@ import { jsx as t, jsxs as w } from "react/jsx-runtime";
|
|
|
3
3
|
import { createContext as h, forwardRef as T, useContext as S, useMemo as N } from "react";
|
|
4
4
|
import { FloatingUIRoot as P } from "../FloatingUI/FloatingUI.root.es.js";
|
|
5
5
|
import { Trigger as _ } from "../FloatingUI/FloatingUI.trigger.es.js";
|
|
6
|
-
import "../../chunks/FloatingUI.context.
|
|
6
|
+
import "../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
7
7
|
import { Content as k } from "../FloatingUI/FloatingUI.content.es.js";
|
|
8
8
|
import { j as v, k as O } from "../../chunks/tokens.BD_71qmL.js";
|
|
9
9
|
import { g as $ } from "../../chunks/classNames.BTJmrO_L.js";
|
|
@@ -1 +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.
|
|
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.B15Tz_4h.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;
|
|
@@ -4,7 +4,7 @@ import { g as v } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
5
|
import { PanelContext as N } from "./Panel.context.es.js";
|
|
6
6
|
import { FloatingUIRoot as b } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
7
|
-
import { a as F } from "../../../chunks/FloatingUI.context.
|
|
7
|
+
import { a as F } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
8
8
|
import { Divider as w } from "../../Divider/Divider.es.js";
|
|
9
9
|
import { s as U } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
10
10
|
const { baseClassNamePrefix: j } = v("panel"), f = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("clsx"),m=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const p=require("./Panel.context.cjs.js"),q=require("../../FloatingUI/FloatingUI.root.cjs.js"),x=require("../../FloatingUI/FloatingUI.content.cjs.js"),P=require("./Panel.Inline.cjs.js"),i=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:t}=m.getBEMClassNames("panel"),b=({contextValue:r,panelClassName:a,resolvedPosition:l,showDivider:n,modalType:s,open:o,onOpenChange:c,transitionConfig:u,children:_,...d})=>{const g=s==="alert"?{escapeKey:!1,outsidePress:!1}:void 0,v=y(i.styles[`${t}__overlay-divider`],i.styles[`${t}__overlay-divider--${l}`]);return e.jsx(p.PanelContext.Provider,{value:r,children:e.jsx(q.FloatingUIRoot,{open:o,onOpenChange:c,portalled:!0,transitionConfig:u,dismiss:g,children:e.jsxs(x.Content,{className:a,skipFloatingStyles:!0,overlay:!0,...d,role:s==="alert"?"alertdialog":"dialog","data-position":l,children:[_,n&&e.jsx(P.InlineDivider,{position:l,className:v})]})})})};exports.OverlayPanel=b;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseTransitionStylesProps } from '@floating-ui/react';
|
|
2
|
-
import { PanelPosition } from './Panel.types';
|
|
2
|
+
import { PanelModalType, PanelPosition } from './Panel.types';
|
|
3
3
|
import { PanelContextValue } from './Panel.context';
|
|
4
4
|
import { FloatingUIProps } from '../../FloatingUI/FloatingUI.context';
|
|
5
5
|
type OverlayPanelProps = {
|
|
@@ -7,10 +7,11 @@ type OverlayPanelProps = {
|
|
|
7
7
|
panelClassName: string;
|
|
8
8
|
resolvedPosition: PanelPosition;
|
|
9
9
|
showDivider: boolean;
|
|
10
|
+
modalType?: PanelModalType;
|
|
10
11
|
open?: boolean;
|
|
11
12
|
onOpenChange?: FloatingUIProps['onOpenChange'];
|
|
12
13
|
transitionConfig: UseTransitionStylesProps;
|
|
13
14
|
children: React.ReactNode;
|
|
14
15
|
} & 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 declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, open, onOpenChange, transitionConfig, children, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import y from "clsx";
|
|
3
|
+
import { g as u } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
5
|
import { PanelContext as x } from "./Panel.context.es.js";
|
|
6
|
-
import { FloatingUIRoot as
|
|
7
|
-
import { Content as
|
|
8
|
-
import { InlineDivider as
|
|
9
|
-
import { s
|
|
10
|
-
const { baseClassNamePrefix:
|
|
6
|
+
import { FloatingUIRoot as C } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
7
|
+
import { Content as N } from "../../FloatingUI/FloatingUI.content.es.js";
|
|
8
|
+
import { InlineDivider as _ } from "./Panel.Inline.es.js";
|
|
9
|
+
import { s } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
10
|
+
const { baseClassNamePrefix: i } = u("panel"), B = ({
|
|
11
11
|
contextValue: a,
|
|
12
|
-
panelClassName:
|
|
13
|
-
resolvedPosition:
|
|
14
|
-
showDivider:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
panelClassName: t,
|
|
13
|
+
resolvedPosition: e,
|
|
14
|
+
showDivider: l,
|
|
15
|
+
modalType: o,
|
|
16
|
+
open: m,
|
|
17
|
+
onOpenChange: n,
|
|
18
|
+
transitionConfig: d,
|
|
18
19
|
children: p,
|
|
19
|
-
...
|
|
20
|
+
...f
|
|
20
21
|
}) => {
|
|
21
|
-
const c = v(
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const c = o === "alert" ? { escapeKey: !1, outsidePress: !1 } : void 0, v = y(
|
|
23
|
+
s[`${i}__overlay-divider`],
|
|
24
|
+
s[`${i}__overlay-divider--${e}`]
|
|
24
25
|
);
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
|
|
26
|
+
return /* @__PURE__ */ r(x.Provider, { value: a, children: /* @__PURE__ */ r(
|
|
27
|
+
C,
|
|
27
28
|
{
|
|
28
|
-
open:
|
|
29
|
-
onOpenChange:
|
|
29
|
+
open: m,
|
|
30
|
+
onOpenChange: n,
|
|
30
31
|
portalled: !0,
|
|
31
|
-
transitionConfig:
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
transitionConfig: d,
|
|
33
|
+
dismiss: c,
|
|
34
|
+
children: /* @__PURE__ */ g(
|
|
35
|
+
N,
|
|
34
36
|
{
|
|
35
|
-
className:
|
|
37
|
+
className: t,
|
|
36
38
|
skipFloatingStyles: !0,
|
|
37
39
|
overlay: !0,
|
|
38
|
-
...
|
|
39
|
-
"
|
|
40
|
+
...f,
|
|
41
|
+
role: o === "alert" ? "alertdialog" : "dialog",
|
|
42
|
+
"data-position": e,
|
|
40
43
|
children: [
|
|
41
44
|
p,
|
|
42
|
-
|
|
45
|
+
l && /* @__PURE__ */ r(_, { position: e, className: v })
|
|
43
46
|
]
|
|
44
47
|
}
|
|
45
48
|
)
|
|
@@ -47,5 +50,5 @@ const { baseClassNamePrefix: t } = y("panel"), b = ({
|
|
|
47
50
|
) });
|
|
48
51
|
};
|
|
49
52
|
export {
|
|
50
|
-
|
|
53
|
+
B as OverlayPanel
|
|
51
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react/jsx-runtime"),b=require("clsx"),C=require("react"),j=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const B=require("./Panel.Header.cjs.js"),E=require("./Panel.Body.cjs.js"),T=require("./Panel.Footer.cjs.js"),r=require("./Panel.helpers.cjs.js"),F=require("./Panel.Inline.cjs.js"),H=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:s}=j.getBEMClassNames("panel"),n=({children:o,className:f,padding:g="md",onOpenChange:$,open:_,size:a,dismissible:c=!0,closeButtonAriaLabel:u="Close panel",kind:d="inline",position:i,divider:O=!0,isAnimated:P=!0,onBeforeClose:h,modalType:t,...p})=>{process.env.NODE_ENV!=="production"&&t==="alert"&&c&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');const y=t==="alert"?!1:c,l=r.getResolvedPanelPosition(i),m=b(e.styles[s],e.styles[`${s}--${d}`],a&&e.styles[`${s}--size-${a}`],e.styles[`${s}--padding-${g}`],e.styles[`${s}--position-${l}`],f),x=b(e.styles[`${s}__inline-wrapper`],a==="full"&&e.styles[`${s}__inline-wrapper--full`]),{requestClose:N,handleOverlayOpenChange:I}=r.usePanelClose(h,$),q=C.useMemo(()=>({dismissible:y,closeButtonAriaLabel:u,position:i,requestClose:N}),[y,u,i,N]),{showDivider:D,dividerBefore:M,dividerInner:R,dividerAfter:S}=r.getPanelDividerState(O,l),v=C.useMemo(()=>({duration:P?r.PANEL_TRANSITION_DURATION_MS:0}),[P]);return d==="inline"?w.jsx(F.InlinePanel,{contextValue:q,panelClassName:m,inlineWrapperClassName:x,resolvedPosition:l,dividerBefore:M,dividerInner:R,dividerAfter:S,open:_,transitionConfig:v,...p,children:o}):w.jsx(H.OverlayPanel,{contextValue:q,panelClassName:m,resolvedPosition:l,showDivider:D,modalType:t,open:_,onOpenChange:I,transitionConfig:v,...p,children:o})};n.displayName="Panel";n.Header=B.Header;n.Body=E.Body;n.Footer=T.Footer;exports.Panel=n;
|
package/lib/wip/Panel/Panel.d.ts
CHANGED
|
@@ -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, ...
|
|
3
|
+
({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, isAnimated, onBeforeClose, modalType, ...panelProps }: 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,85 +1,90 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
1
|
+
import { jsx as $ } from "react/jsx-runtime";
|
|
2
|
+
import g from "clsx";
|
|
3
|
+
import { useMemo as _ } 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
7
|
import { Body as T } from "./Panel.Body.es.js";
|
|
8
8
|
import { Footer as A } from "./Panel.Footer.es.js";
|
|
9
|
-
import { usePanelClose as
|
|
9
|
+
import { usePanelClose as F, getPanelDividerState as H, PANEL_TRANSITION_DURATION_MS as V, 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: r } = R("panel"),
|
|
14
|
-
children:
|
|
15
|
-
className:
|
|
16
|
-
padding:
|
|
17
|
-
onOpenChange:
|
|
13
|
+
const { baseClassNamePrefix: r } = R("panel"), s = ({
|
|
14
|
+
children: t,
|
|
15
|
+
className: O,
|
|
16
|
+
padding: h = "md",
|
|
17
|
+
onOpenChange: w,
|
|
18
18
|
open: l,
|
|
19
|
-
size:
|
|
20
|
-
dismissible:
|
|
21
|
-
closeButtonAriaLabel:
|
|
22
|
-
kind:
|
|
23
|
-
position:
|
|
24
|
-
divider:
|
|
19
|
+
size: n,
|
|
20
|
+
dismissible: m = !0,
|
|
21
|
+
closeButtonAriaLabel: p = "Close panel",
|
|
22
|
+
kind: d = "inline",
|
|
23
|
+
position: i,
|
|
24
|
+
divider: y = !0,
|
|
25
25
|
isAnimated: f = !0,
|
|
26
26
|
onBeforeClose: x,
|
|
27
|
-
|
|
27
|
+
modalType: a,
|
|
28
|
+
...c
|
|
28
29
|
}) => {
|
|
29
|
-
|
|
30
|
+
process.env.NODE_ENV !== "production" && a === "alert" && m && console.warn(
|
|
31
|
+
'Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'
|
|
32
|
+
);
|
|
33
|
+
const N = a === "alert" ? !1 : m, o = j(i), u = g(
|
|
30
34
|
e[r],
|
|
31
|
-
e[`${r}--${
|
|
32
|
-
|
|
33
|
-
e[`${r}--padding-${
|
|
35
|
+
e[`${r}--${d}`],
|
|
36
|
+
n && e[`${r}--size-${n}`],
|
|
37
|
+
e[`${r}--padding-${h}`],
|
|
34
38
|
e[`${r}--position-${o}`],
|
|
35
|
-
|
|
36
|
-
),
|
|
39
|
+
O
|
|
40
|
+
), D = g(
|
|
37
41
|
e[`${r}__inline-wrapper`],
|
|
38
|
-
|
|
39
|
-
), { requestClose:
|
|
42
|
+
n === "full" && e[`${r}__inline-wrapper--full`]
|
|
43
|
+
), { requestClose: v, handleOverlayOpenChange: I } = F(
|
|
40
44
|
x,
|
|
41
|
-
|
|
42
|
-
),
|
|
43
|
-
() => ({ dismissible:
|
|
44
|
-
[
|
|
45
|
-
), { showDivider:
|
|
46
|
-
() => ({ duration: f ?
|
|
45
|
+
w
|
|
46
|
+
), C = _(
|
|
47
|
+
() => ({ dismissible: N, closeButtonAriaLabel: p, position: i, requestClose: v }),
|
|
48
|
+
[N, p, i, v]
|
|
49
|
+
), { showDivider: E, dividerBefore: b, dividerInner: B, dividerAfter: M } = H(y, o), P = _(
|
|
50
|
+
() => ({ duration: f ? V : 0 }),
|
|
47
51
|
[f]
|
|
48
52
|
);
|
|
49
|
-
return
|
|
53
|
+
return d === "inline" ? /* @__PURE__ */ $(
|
|
50
54
|
q,
|
|
51
55
|
{
|
|
52
|
-
contextValue:
|
|
53
|
-
panelClassName:
|
|
54
|
-
inlineWrapperClassName:
|
|
56
|
+
contextValue: C,
|
|
57
|
+
panelClassName: u,
|
|
58
|
+
inlineWrapperClassName: D,
|
|
55
59
|
resolvedPosition: o,
|
|
56
|
-
dividerBefore:
|
|
57
|
-
dividerInner:
|
|
60
|
+
dividerBefore: b,
|
|
61
|
+
dividerInner: B,
|
|
58
62
|
dividerAfter: M,
|
|
59
63
|
open: l,
|
|
60
|
-
transitionConfig:
|
|
61
|
-
...
|
|
62
|
-
children:
|
|
64
|
+
transitionConfig: P,
|
|
65
|
+
...c,
|
|
66
|
+
children: t
|
|
63
67
|
}
|
|
64
|
-
) : /* @__PURE__ */
|
|
68
|
+
) : /* @__PURE__ */ $(
|
|
65
69
|
U,
|
|
66
70
|
{
|
|
67
|
-
contextValue:
|
|
68
|
-
panelClassName:
|
|
71
|
+
contextValue: C,
|
|
72
|
+
panelClassName: u,
|
|
69
73
|
resolvedPosition: o,
|
|
70
|
-
showDivider:
|
|
74
|
+
showDivider: E,
|
|
75
|
+
modalType: a,
|
|
71
76
|
open: l,
|
|
72
|
-
onOpenChange:
|
|
73
|
-
transitionConfig:
|
|
74
|
-
...
|
|
75
|
-
children:
|
|
77
|
+
onOpenChange: I,
|
|
78
|
+
transitionConfig: P,
|
|
79
|
+
...c,
|
|
80
|
+
children: t
|
|
76
81
|
}
|
|
77
82
|
);
|
|
78
83
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
s.displayName = "Panel";
|
|
85
|
+
s.Header = S;
|
|
86
|
+
s.Body = T;
|
|
87
|
+
s.Footer = A;
|
|
83
88
|
export {
|
|
84
|
-
|
|
89
|
+
s as Panel
|
|
85
90
|
};
|
|
@@ -73,6 +73,9 @@ interface BasePanelProps extends ComponentPropsWithoutRef<'aside'> {
|
|
|
73
73
|
* by the parent; it only fires for UI-triggered close events (close button, Escape
|
|
74
74
|
* key, or outside press).
|
|
75
75
|
*
|
|
76
|
+
* When `modalType="alert"`, `'escapeKey'` and `'outsidePress'` reasons are
|
|
77
|
+
* suppressed entirely — this callback will not be invoked for those reasons.
|
|
78
|
+
*
|
|
76
79
|
* @example
|
|
77
80
|
* ```tsx
|
|
78
81
|
* // Use a stateful confirmation dialog — avoid window.confirm (blocking, breaks iframes).
|
|
@@ -95,6 +98,7 @@ export interface InlinePanelProps extends BasePanelProps {
|
|
|
95
98
|
* Specify the Panel as inline
|
|
96
99
|
*/
|
|
97
100
|
kind?: 'inline';
|
|
101
|
+
modalType?: never;
|
|
98
102
|
}
|
|
99
103
|
export interface OverlayPanelProps extends BasePanelProps {
|
|
100
104
|
/**
|
|
@@ -102,7 +106,9 @@ export interface OverlayPanelProps extends BasePanelProps {
|
|
|
102
106
|
*/
|
|
103
107
|
kind: 'overlay';
|
|
104
108
|
/**
|
|
105
|
-
* Specify the modal type (overlay only)
|
|
109
|
+
* Specify the modal type (overlay only).
|
|
110
|
+
* When set to `'alert'`, the close button is always hidden regardless of the
|
|
111
|
+
* `dismissible` prop, and ESC / backdrop clicks are suppressed.
|
|
106
112
|
* @default 'nonModal'
|
|
107
113
|
*/
|
|
108
114
|
modalType?: PanelModalType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.14.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.14.0",
|
|
63
|
+
"@viasat/beam-shared": "2.14.0",
|
|
64
|
+
"@viasat/beam-styles": "2.14.0",
|
|
65
|
+
"@viasat/beam-tokens": "2.14.0",
|
|
66
|
+
"@viasat/beam-icons": "2.14.0",
|
|
67
67
|
"clsx": "^1.2.1",
|
|
68
68
|
"@floating-ui/react": "^0.26.18",
|
|
69
69
|
"@stepperize/react": "^5.1.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const h=require("react"),F=require("@floating-ui/dom"),X=require("@floating-ui/react"),J=require("../lib/FloatingUI/FloatingUI.interactions.cjs.js"),G=Math.min,K=Math.max,Q={left:"right",right:"left",bottom:"top",top:"bottom"};function Z(t,e,i){return K(t,G(e,i))}function w(t,e){return typeof t=="function"?t(e):t}function T(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function Y(t){return t==="x"?"y":"x"}function et(t){return t==="y"?"height":"width"}function nt(t){return["top","bottom"].includes(T(t))?"y":"x"}function ot(t){return Y(nt(t))}function st(t){return t.replace(/left|right|bottom|top/g,e=>Q[e])}function it(t){return{top:0,right:0,bottom:0,left:0,...t}}function ct(t){return typeof t!="number"?it(t):{top:t,right:t,bottom:t,left:t}}const lt=16,rt=t=>{var e;return{visibility:(e=t.hide)!=null&&e.referenceHidden?"hidden":"visible"}},ut=t=>({name:"arrowStyles",options:t,async fn(e){var V,W;const{x:i,y:c,placement:r,rects:s,platform:n,elements:g,middlewareData:p}=e,{element:f,padding:a=0}=w(t,e)||{};if(f==null)return{};const y=ct(a),m={x:i,y:c},l=ot(r),U=Y(l),x=et(l),d=await n.getDimensions(f),A=l==="y",o=A?"top":"left",j=A?"bottom":"right",C=A?"clientHeight":"clientWidth",_=s.reference[x]+s.reference[l]-m[l]-s.floating[x],B=m[l]-s.reference[l],$=await((V=n.getOffsetParent)==null?void 0:V.call(n,f));let b=$?$[C]:0;(!b||!await((W=n.isElement)==null?void 0:W.call(n,$)))&&(b=g.floating[C]||s.floating[x]);const M=_/2-B/2,v=b/2-d.width/2-1,D=G(y[o],v),E=G(y[j],v),O=D,z=b-d.width-E,u=b/2-d.width/2+M,P=Z(O,u,z),I=!p.arrow&&tt(r)!=null&&u!==P&&s.reference[x]/2-(u<O?D:E)-d.width/2<0,H=I?u<O?u-O:u-z:0,S=T(r),L=["top","left"].includes(S)?-1:1,q=d.height*L,N=at({placement:S,arrowHeight:d.height,arrowWidth:d.width,[l]:P});return{[l]:m[l]+H,[U]:m[U]+q,data:N,reset:I}}}),R=(t,e,i,c)=>{if(c){const r=c===!0?i():i(c);t[e](r)}},ft=({baseConfig:t,middleware:e,offset:i,arrow:c,placement:r="top"})=>{const s={...t,placement:r};let n=[];if(typeof e.overrides!="object"){n.push(F.offset(i));let g=e.flip??!0;if(e.autoPlacement&&(g=!1),R(n,"unshift",F.autoPlacement,e.autoPlacement),R(n,"unshift",F.flip,g),e.size){const p=e.size===!0?{padding:lt,apply({availableHeight:f,elements:a}){Object.assign(a.floating.style,{maxHeight:`${f}px`})}}:e.size;n.push(F.size(p))}R(n,"push",F.shift,e.shift??!0),R(n,"push",F.hide,e.hide??!0)}else n.push(...e.overrides);return c.hide||n.push(ut(c.options)),typeof e.overrides=="function"&&(n=e.overrides(n)),s.middleware=n,s},at=({placement:t,arrowHeight:e,arrowWidth:i,x:c,y:r})=>{const s=T(t),n=i/2-e,g={top:"rotate(0deg)",bottom:"rotate(180deg)",left:`rotate(-90deg) translateX(${-n}px)`,right:`rotate(90deg) translateX(${n}px)`}[s],p=-i/2-e,f={top:`${-e}px`,bottom:`${-e*2}px`,left:`${p}px`,right:`${p}px`}[s],a={transform:g};a.left=c!=null?`${c}px`:"",a.top=r!=null?`${r}px`:"";const y=st(s);return a[y]=f,a},dt=({defaultOpen:t=!1,open:e,placement:i="top",offset:c,onOpenChange:r,openOnClick:s,openOnHover:n,openOnFocus:g,openOnSelected:p,focusConfiguration:f,listNavigation:a,typeahead:y,middleware:m,autoPlacement:l,flip:U=!0,shift:x=!0,autoHiding:d,size:A,arrow:o,transitionConfig:j,portalled:C,role:_,rootContext:B})=>{const[$,b]=h.useState(t),[M,v]=h.useState(),[D,E]=h.useState(),[O,z]=h.useState(null),u=e??$,P=r??b,I=X.useFloatingNodeId(),H=h.useMemo(()=>{const N={open:u,onOpenChange:P,whileElementsMounted:X.autoUpdate,nodeId:I,rootContext:B};return{...ft({baseConfig:N,middleware:{overrides:m,autoPlacement:l,flip:U,shift:x,hide:d,size:A},arrow:{hide:(o==null?void 0:o.hide)??!1,options:{element:O||null,padding:o==null?void 0:o.edgePadding}},placement:i,offset:c??0})}},[I,u,P,m,l,U,x,d,A,o==null?void 0:o.hide,o==null?void 0:o.edgePadding,O,i,c,B]),S=X.useFloating(H),L=S.context,q=J.useConfigurableInteractions({context:L,openOnClick:s,openOnHover:n,openOnFocus:g,openOnSelected:p,role:_,listNavigation:a,typeahead:y});return h.useMemo(()=>({open:u,setOpen:P,...q,...S,portalled:C,focusConfiguration:f,transitionConfig:j,labelId:M,descriptionId:D,arrow:o,setLabelId:v,setDescriptionId:E,setArrowEl:z,nodeId:I}),[u,P,q,S,C,f,j,M,D,o,I])},k=h.createContext(null),gt=()=>{const t=h.useContext(k);if(t==null)throw new Error("FloatingUI components must be wrapped in <FloatingUI />");return t};exports.BmFloatingUIContext=k;exports.useBmFloatingUI=dt;exports.useBmFloatingUIContext=gt;exports.visibilityHandler=rt;
|