@viasat/beam-react 2.41.0 → 2.43.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/FloatingUI.css +1 -1
- package/assets/panel.css +1 -1
- package/chunks/FloatingUI.arrow.DDrTOpE-.js +1 -0
- package/chunks/{FloatingUI.arrow.90ecVA1X.js → FloatingUI.arrow.DGlk005P.js} +8 -7
- package/chunks/panel.module.BzLGa7GY.js +1 -0
- package/chunks/{panel.module.CnHWv4EZ.js → panel.module.CgFBtvbR.js} +6 -6
- package/lib/Autocomplete/AutocompleteDropdown.cjs.js +1 -1
- package/lib/Autocomplete/AutocompleteDropdown.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.arrow.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.arrow.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.es.js +1 -1
- package/lib/Search/SearchDropdown.cjs.js +1 -1
- package/lib/Search/SearchDropdown.es.js +1 -1
- package/lib/Select/SelectDropdown.cjs.js +1 -1
- package/lib/Select/SelectDropdown.es.js +1 -1
- package/lib/wip/DateField/DateField.cjs.js +1 -1
- package/lib/wip/DateField/DateField.es.js +75 -71
- package/lib/wip/DateField/useDateFieldKeyboard.cjs.js +1 -1
- package/lib/wip/DateField/useDateFieldKeyboard.d.ts +15 -1
- package/lib/wip/DateField/useDateFieldKeyboard.es.js +33 -29
- package/lib/wip/DateField/useDateFieldValue.cjs.js +1 -1
- package/lib/wip/DateField/useDateFieldValue.d.ts +19 -0
- package/lib/wip/DateField/useDateFieldValue.es.js +84 -66
- package/lib/wip/Panel/Footer/Panel.Footer.Actions.cjs.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.Actions.d.ts +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.Actions.es.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.cjs.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.d.ts +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.es.js +21 -20
- package/lib/wip/Panel/Header/Panel.Header.ContentAfter.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentAfter.d.ts +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentAfter.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentBefore.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentBefore.d.ts +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentBefore.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Description.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Description.d.ts +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Description.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Heading.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Heading.d.ts +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Heading.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Row.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Row.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Subheader.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Subheader.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.d.ts +1 -1
- package/lib/wip/Panel/Header/Panel.Header.es.js +35 -34
- package/lib/wip/Panel/Panel.Body.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Body.d.ts +1 -1
- package/lib/wip/Panel/Panel.Body.es.js +16 -14
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.d.ts +3 -3
- package/lib/wip/Panel/Panel.Inline.es.js +4 -4
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +3 -3
- package/lib/wip/Panel/Panel.Overlay.es.js +83 -80
- package/lib/wip/Panel/Panel.ResizeHandle.cjs.js +1 -1
- package/lib/wip/Panel/Panel.ResizeHandle.es.js +1 -1
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.context.d.ts +12 -1
- package/lib/wip/Panel/Panel.d.ts +2 -2
- package/lib/wip/Panel/Panel.es.js +135 -120
- package/lib/wip/Panel/Panel.helpers.cjs.js +1 -1
- package/lib/wip/Panel/Panel.helpers.d.ts +3 -3
- package/lib/wip/Panel/Panel.helpers.es.js +19 -19
- package/lib/wip/Panel/Panel.types.d.ts +94 -92
- package/lib/wip/Panel/index.d.ts +1 -1
- package/package.json +6 -6
- package/chunks/FloatingUI.arrow.DR8hzVDP.js +0 -1
- package/chunks/panel.module.BVmRxZHo.js +0 -1
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsxs as c, Fragment as C, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import g from "clsx";
|
|
3
|
+
import { g as x } from "../../../../chunks/classNames.ZWNk1hey.js";
|
|
4
4
|
import "../../../../chunks/constants.Cruz2A1w.js";
|
|
5
|
-
import { Divider as
|
|
6
|
-
import { Box as
|
|
7
|
-
import { DEFAULT_PANEL_DIVIDER_COLOR as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
5
|
+
import { Divider as u } from "../../../Divider/Divider.es.js";
|
|
6
|
+
import { Box as D } from "../../../Box/Box.es.js";
|
|
7
|
+
import { DEFAULT_PANEL_DIVIDER_COLOR as b } from "../Panel.helpers.es.js";
|
|
8
|
+
import { usePanelContext as v } from "../Panel.context.es.js";
|
|
9
|
+
import { Row as B } from "./Panel.Header.Row.es.js";
|
|
10
|
+
import { ContentBefore as h } from "./Panel.Header.ContentBefore.es.js";
|
|
11
|
+
import { Heading as E } from "./Panel.Header.Heading.es.js";
|
|
12
|
+
import { ContentAfter as N } from "./Panel.Header.ContentAfter.es.js";
|
|
13
|
+
import { Description as A } from "./Panel.Header.Description.es.js";
|
|
14
|
+
import { Subheader as H } from "./Panel.Header.Subheader.es.js";
|
|
15
|
+
import { s as P } from "../../../../chunks/panel.module.CgFBtvbR.js";
|
|
16
|
+
const { subElementClassPrefix: R } = x("panel"), L = `${R}header`, o = ({
|
|
16
17
|
children: e,
|
|
17
18
|
className: t,
|
|
18
|
-
divider:
|
|
19
|
-
dividerColor:
|
|
20
|
-
backgroundColor:
|
|
21
|
-
...
|
|
19
|
+
divider: s = !0,
|
|
20
|
+
dividerColor: m,
|
|
21
|
+
backgroundColor: i,
|
|
22
|
+
...n
|
|
22
23
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */
|
|
25
|
-
/* @__PURE__ */
|
|
26
|
-
|
|
24
|
+
const { backgroundColor: a, dividerColor: l } = v(), d = m ?? l ?? b, p = i ?? a, f = g(P[L], t);
|
|
25
|
+
return /* @__PURE__ */ c(C, { children: [
|
|
26
|
+
/* @__PURE__ */ r(
|
|
27
|
+
D,
|
|
27
28
|
{
|
|
28
29
|
as: "header",
|
|
29
|
-
className:
|
|
30
|
-
backgroundColor:
|
|
31
|
-
...
|
|
30
|
+
className: f,
|
|
31
|
+
backgroundColor: p,
|
|
32
|
+
...n,
|
|
32
33
|
children: e
|
|
33
34
|
}
|
|
34
35
|
),
|
|
35
|
-
|
|
36
|
+
s && /* @__PURE__ */ r(u, { borderColor: d })
|
|
36
37
|
] });
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
o.displayName = "Panel.Header";
|
|
40
|
+
o.Row = B;
|
|
41
|
+
o.ContentBefore = h;
|
|
42
|
+
o.Heading = E;
|
|
43
|
+
o.Description = A;
|
|
44
|
+
o.ContentAfter = N;
|
|
45
|
+
o.Subheader = H;
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
o as Header
|
|
47
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("clsx"),d=require("../../../chunks/classNames.DC8Ra4sw.js");require("../../../chunks/constants.CgMu0_1M.js");const x=require("../../Box/Box.cjs.js"),b=require("./Panel.context.cjs.js"),m=require("../../../chunks/panel.module.BzLGa7GY.js"),{subElementClassPrefix:B}=d.getBEMClassNames("panel"),y=`${B}body`,e=({children:s,className:o,backgroundColor:t,tabIndex:n=0,...r})=>{const{backgroundColor:l}=b.usePanelContext(),a=t??l,c=i(m.styles[y],o);return u.jsx(x.Box,{className:c,backgroundColor:a,tabIndex:n,...r,children:s})};e.displayName="Panel.Body";exports.Body=e;
|
|
@@ -11,6 +11,6 @@ export interface PanelBodyProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
11
11
|
backgroundColor?: BoxBackgroundColor;
|
|
12
12
|
}
|
|
13
13
|
export declare const Body: {
|
|
14
|
-
({ children, className: _className, backgroundColor, ...props }: PanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
({ children, className: _className, backgroundColor, tabIndex, ...props }: PanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
displayName: string;
|
|
16
16
|
};
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import c from "clsx";
|
|
3
|
+
import { g as p } from "../../../chunks/classNames.ZWNk1hey.js";
|
|
4
4
|
import "../../../chunks/constants.Cruz2A1w.js";
|
|
5
|
-
import { Box as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { Box as i } from "../../Box/Box.es.js";
|
|
6
|
+
import { usePanelContext as d } from "./Panel.context.es.js";
|
|
7
|
+
import { s as f } from "../../../chunks/panel.module.CgFBtvbR.js";
|
|
8
|
+
const { subElementClassPrefix: x } = p("panel"), C = `${x}body`, g = ({
|
|
9
|
+
children: o,
|
|
10
|
+
className: s,
|
|
11
|
+
backgroundColor: r,
|
|
12
|
+
tabIndex: t = 0,
|
|
13
|
+
...e
|
|
12
14
|
}) => {
|
|
13
|
-
const r =
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
+
const { backgroundColor: a } = d(), m = r ?? a, l = c(f[C], s);
|
|
16
|
+
return /* @__PURE__ */ n(i, { className: l, backgroundColor: m, tabIndex: t, ...e, children: o });
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
g.displayName = "Panel.Body";
|
|
17
19
|
export {
|
|
18
|
-
|
|
20
|
+
g as Body
|
|
19
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("@floating-ui/react"),F=require("../../../chunks/classNames.DC8Ra4sw.js");require("../../../chunks/constants.CgMu0_1M.js");const R=require("./Panel.context.cjs.js"),h=require("../../FloatingUI/FloatingUI.root.cjs.js"),w=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),j=require("./Panel.Divider.cjs.js"),U=require("./Panel.ResizeHandle.cjs.js"),N=require("./Panel.useResize.cjs.js"),y=require("../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("@floating-ui/react"),F=require("../../../chunks/classNames.DC8Ra4sw.js");require("../../../chunks/constants.CgMu0_1M.js");const R=require("./Panel.context.cjs.js"),h=require("../../FloatingUI/FloatingUI.root.cjs.js"),w=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),j=require("./Panel.Divider.cjs.js"),U=require("./Panel.ResizeHandle.cjs.js"),N=require("./Panel.useResize.cjs.js"),y=require("../../../chunks/panel.module.BzLGa7GY.js"),{baseClassNamePrefix:v}=F.getBEMClassNames("panel"),C=({children:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,alwaysVisible:i,skipMountAnimation:_,dividerColor:t,resizeConfig:s,cssVarStyle:x,...d})=>{const{context:p,transitionConfig:g,refs:I}=w.useBmFloatingUIContext(),{isMounted:f,status:P}=b.useTransitionStatus(p,g),m=(i||_)&&P==="initial"?"open":P,{handleRef:q}=N.usePanelResize({resizeConfig:s,position:n,floatingRef:I.floating});return f?e.jsxs(e.Fragment,{children:[o&&e.jsx(j.InlineDivider,{position:n,dividerColor:t}),e.jsx("div",{ref:I.setFloating,className:r,"data-position":n,"data-status":m,style:x,children:e.jsxs("div",{className:y.styles[`${v}__inline-wrapper-content`],children:[c&&e.jsx(j.InlineDivider,{position:n,dividerColor:t}),e.jsxs("aside",{...d,className:l,children:[a,s&&e.jsx(U.PanelResizeHandle,{ref:q})]})]})}),u&&e.jsx(j.InlineDivider,{position:n,dividerColor:t})]}):null},D=({contextValue:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,open:i,transitionConfig:_,dividerColor:t,children:s,resizeConfig:x,cssVarStyle:d,skipMountAnimation:p,...g})=>e.jsx(R.PanelContext.Provider,{value:a,children:e.jsx(h.FloatingUIRoot,{open:i??!0,portalled:!1,transitionConfig:_,children:e.jsx(C,{panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,dividerColor:t,alwaysVisible:i===void 0,skipMountAnimation:p,resizeConfig:x,cssVarStyle:d,...g,children:s})})});exports.InlinePanel=D;
|
|
@@ -14,10 +14,10 @@ type InlinePanelProps = {
|
|
|
14
14
|
children: React.ReactNode;
|
|
15
15
|
dividerColor?: PanelDividerColor;
|
|
16
16
|
resizeConfig?: PanelResizeConfig;
|
|
17
|
-
/** Forwarded from Panel: CSS custom-property
|
|
18
|
-
|
|
17
|
+
/** Forwarded from Panel: CSS custom-property overrides (`--bm-comp-panel-width` / `-height`). */
|
|
18
|
+
cssVarStyle?: React.CSSProperties;
|
|
19
19
|
/** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
|
|
20
20
|
skipMountAnimation?: boolean;
|
|
21
21
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
22
|
-
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig,
|
|
22
|
+
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig, cssVarStyle, skipMountAnimation, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export {};
|
|
@@ -8,7 +8,7 @@ import { a as j } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
|
8
8
|
import { InlineDivider as h } from "./Panel.Divider.es.js";
|
|
9
9
|
import { PanelResizeHandle as B } from "./Panel.ResizeHandle.es.js";
|
|
10
10
|
import { usePanelResize as M } from "./Panel.useResize.es.js";
|
|
11
|
-
import { s as S } from "../../../chunks/panel.module.
|
|
11
|
+
import { s as S } from "../../../chunks/panel.module.CgFBtvbR.js";
|
|
12
12
|
const { baseClassNamePrefix: _ } = P("panel"), z = ({
|
|
13
13
|
children: i,
|
|
14
14
|
panelClassName: o,
|
|
@@ -21,7 +21,7 @@ const { baseClassNamePrefix: _ } = P("panel"), z = ({
|
|
|
21
21
|
skipMountAnimation: f,
|
|
22
22
|
dividerColor: a,
|
|
23
23
|
resizeConfig: s,
|
|
24
|
-
|
|
24
|
+
cssVarStyle: c,
|
|
25
25
|
...u
|
|
26
26
|
}) => {
|
|
27
27
|
const {
|
|
@@ -70,7 +70,7 @@ const { baseClassNamePrefix: _ } = P("panel"), z = ({
|
|
|
70
70
|
dividerColor: a,
|
|
71
71
|
children: s,
|
|
72
72
|
resizeConfig: c,
|
|
73
|
-
|
|
73
|
+
cssVarStyle: u,
|
|
74
74
|
skipMountAnimation: d,
|
|
75
75
|
...g
|
|
76
76
|
}) => /* @__PURE__ */ t(U.Provider, { value: i, children: /* @__PURE__ */ t(
|
|
@@ -92,7 +92,7 @@ const { baseClassNamePrefix: _ } = P("panel"), z = ({
|
|
|
92
92
|
alwaysVisible: e === void 0,
|
|
93
93
|
skipMountAnimation: d,
|
|
94
94
|
resizeConfig: c,
|
|
95
|
-
|
|
95
|
+
cssVarStyle: u,
|
|
96
96
|
...g,
|
|
97
97
|
children: s
|
|
98
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),N=require("clsx"),I=require("react"),S=require("../../../chunks/classNames.DC8Ra4sw.js");require("../../../chunks/constants.CgMu0_1M.js");const h=require("./Panel.context.cjs.js"),w=require("./Panel.helpers.cjs.js"),k=require("../../FloatingUI/FloatingUI.root.cjs.js"),D=require("../../FloatingUI/FloatingUI.content.cjs.js"),z=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),$=require("./Panel.Divider.cjs.js"),A=require("./Panel.ResizeHandle.cjs.js"),B=require("./Panel.useResize.cjs.js"),f=require("../../../chunks/panel.module.BzLGa7GY.js"),{baseClassNamePrefix:g,variable:j}=S.getBEMClassNames("panel");function H(s,n,e){if(!(!s&&!n&&!e))return{...s,...n,...e?{[j("offset-x")]:e.x,[j("offset-y")]:e.y}:null}}const R=({children:s,panelClassName:n,resolvedPosition:e,showDivider:_,dividerColor:l,resizeConfig:o,floatingOffset:d,overlayDividerClassName:P,isBlocking:c,cssVarStyle:v,skipMountAnimation:x,container:r,style:q,...b})=>{const{refs:y}=z.useBmFloatingUIContext(),{handleRef:i}=B.usePanelResize({resizeConfig:o,position:e,floatingRef:y.floating,requireMount:!0,container:r}),t=H(q,v,d),m=I.useMemo(()=>c?r?{lockScroll:!1}:!0:{lockScroll:!1},[c,r]);return a.jsxs(D.Content,{className:n,skipFloatingStyles:!0,overlay:m,...b,style:t,"data-position":e,...x?{"data-status":"open"}:{},children:[s,_&&a.jsx($.InlineDivider,{position:e,className:P,dividerColor:l}),o&&a.jsx(A.PanelResizeHandle,{ref:i})]})},E=({contextValue:s,panelClassName:n,resolvedPosition:e,showDivider:_,modalType:l,closeOnOutsidePress:o,floatingOffset:d,open:P,onOpenChange:c,transitionConfig:v,dividerColor:x,children:r,resizeConfig:q,cssVarStyle:b,skipMountAnimation:y,container:i,triggerRef:t,...m})=>{const p=l==="isModal"||l==="alert",C=I.useCallback(u=>{const F=(t==null?void 0:t.current)??null;return!(F&&u.target instanceof Node&&F.contains(u.target))},[t]),U=I.useMemo(()=>{const u=w.getPanelDismissConfig(l,o);return!t||!(l==="isModal"||l!=="alert"&&(o??!0))?u:{...u??{},outsidePress:C}},[l,o,t,C]),M=N(f.styles[`${g}__overlay-divider`],f.styles[`${g}__overlay-divider--${e}`]);return a.jsx(h.PanelContext.Provider,{value:s,children:a.jsx(k.FloatingUIRoot,{open:P,onOpenChange:c,portalled:i?{root:i}:!0,transitionConfig:v,dismiss:U,focusConfiguration:p?!0:{modal:!1,closeOnFocusOut:!1},children:a.jsx(R,{panelClassName:n,resolvedPosition:e,showDivider:_,dividerColor:x,floatingOffset:d,overlayDividerClassName:M,isBlocking:p,resizeConfig:q,cssVarStyle:b,skipMountAnimation:y,container:i,...m,role:l==="alert"?"alertdialog":"dialog","aria-modal":p||void 0,children:r})})})};exports.OverlayPanel=E;
|
|
@@ -17,8 +17,8 @@ type OverlayPanelProps = {
|
|
|
17
17
|
children: React.ReactNode;
|
|
18
18
|
dividerColor?: PanelDividerColor;
|
|
19
19
|
resizeConfig?: PanelResizeConfig;
|
|
20
|
-
/** Forwarded from Panel: CSS custom-property
|
|
21
|
-
|
|
20
|
+
/** Forwarded from Panel: CSS custom-property overrides (`--bm-comp-panel-width` / `-height`). */
|
|
21
|
+
cssVarStyle?: CSSProperties;
|
|
22
22
|
/** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
|
|
23
23
|
skipMountAnimation?: boolean;
|
|
24
24
|
/**
|
|
@@ -35,5 +35,5 @@ type OverlayPanelProps = {
|
|
|
35
35
|
*/
|
|
36
36
|
triggerRef?: RefObject<HTMLElement | null>;
|
|
37
37
|
} & ComponentPropsWithoutRef<'aside'>;
|
|
38
|
-
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, floatingOffset, open, onOpenChange, transitionConfig, dividerColor, children, resizeConfig,
|
|
38
|
+
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, floatingOffset, open, onOpenChange, transitionConfig, dividerColor, children, resizeConfig, cssVarStyle, skipMountAnimation, container, triggerRef, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
export {};
|
|
@@ -1,141 +1,144 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useCallback as
|
|
4
|
-
import { g } from "../../../chunks/classNames.ZWNk1hey.js";
|
|
1
|
+
import { jsx as m, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import $ from "clsx";
|
|
3
|
+
import { useCallback as j, useMemo as S } from "react";
|
|
4
|
+
import { g as A } from "../../../chunks/classNames.ZWNk1hey.js";
|
|
5
5
|
import "../../../chunks/constants.Cruz2A1w.js";
|
|
6
|
-
import { PanelContext as
|
|
7
|
-
import { getPanelDismissConfig as
|
|
8
|
-
import { FloatingUIRoot as
|
|
6
|
+
import { PanelContext as B } from "./Panel.context.es.js";
|
|
7
|
+
import { getPanelDismissConfig as U } from "./Panel.helpers.es.js";
|
|
8
|
+
import { FloatingUIRoot as g } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
9
9
|
import { Content as q } from "../../FloatingUI/FloatingUI.content.es.js";
|
|
10
|
-
import { a as
|
|
11
|
-
import { InlineDivider as
|
|
12
|
-
import { PanelResizeHandle as
|
|
13
|
-
import { usePanelResize as
|
|
14
|
-
import { s as
|
|
15
|
-
const { baseClassNamePrefix:
|
|
16
|
-
function G(
|
|
17
|
-
if (!(!
|
|
10
|
+
import { a as z } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
11
|
+
import { InlineDivider as E } from "./Panel.Divider.es.js";
|
|
12
|
+
import { PanelResizeHandle as H } from "./Panel.ResizeHandle.es.js";
|
|
13
|
+
import { usePanelResize as w } from "./Panel.useResize.es.js";
|
|
14
|
+
import { s as k } from "../../../chunks/panel.module.CgFBtvbR.js";
|
|
15
|
+
const { baseClassNamePrefix: F, variable: I } = A("panel");
|
|
16
|
+
function G(e, s, o) {
|
|
17
|
+
if (!(!e && !s && !o))
|
|
18
18
|
return {
|
|
19
|
-
...s,
|
|
20
19
|
...e,
|
|
20
|
+
...s,
|
|
21
21
|
...o ? {
|
|
22
|
-
[
|
|
23
|
-
[
|
|
22
|
+
[I("offset-x")]: o.x,
|
|
23
|
+
[I("offset-y")]: o.y
|
|
24
24
|
} : null
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
const J = ({
|
|
28
|
-
children:
|
|
29
|
-
panelClassName:
|
|
28
|
+
children: e,
|
|
29
|
+
panelClassName: s,
|
|
30
30
|
resolvedPosition: o,
|
|
31
|
-
showDivider:
|
|
31
|
+
showDivider: c,
|
|
32
32
|
dividerColor: t,
|
|
33
|
-
resizeConfig:
|
|
34
|
-
floatingOffset:
|
|
35
|
-
overlayDividerClassName:
|
|
36
|
-
isBlocking:
|
|
37
|
-
|
|
33
|
+
resizeConfig: l,
|
|
34
|
+
floatingOffset: f,
|
|
35
|
+
overlayDividerClassName: d,
|
|
36
|
+
isBlocking: u,
|
|
37
|
+
cssVarStyle: p,
|
|
38
38
|
skipMountAnimation: v,
|
|
39
|
-
container:
|
|
39
|
+
container: a,
|
|
40
40
|
style: x,
|
|
41
|
-
...
|
|
41
|
+
...y
|
|
42
42
|
}) => {
|
|
43
|
-
const { refs:
|
|
44
|
-
resizeConfig:
|
|
43
|
+
const { refs: C } = z(), { handleRef: i } = w({
|
|
44
|
+
resizeConfig: l,
|
|
45
45
|
position: o,
|
|
46
|
-
floatingRef:
|
|
46
|
+
floatingRef: C.floating,
|
|
47
47
|
requireMount: !0,
|
|
48
|
-
container:
|
|
49
|
-
}), r = G(x, p,
|
|
50
|
-
|
|
48
|
+
container: a
|
|
49
|
+
}), r = G(x, p, f), P = S(
|
|
50
|
+
() => u ? a ? { lockScroll: !1 } : !0 : { lockScroll: !1 },
|
|
51
|
+
[u, a]
|
|
52
|
+
);
|
|
53
|
+
return /* @__PURE__ */ D(
|
|
51
54
|
q,
|
|
52
55
|
{
|
|
53
|
-
className:
|
|
56
|
+
className: s,
|
|
54
57
|
skipFloatingStyles: !0,
|
|
55
|
-
overlay:
|
|
56
|
-
...
|
|
58
|
+
overlay: P,
|
|
59
|
+
...y,
|
|
57
60
|
style: r,
|
|
58
61
|
"data-position": o,
|
|
59
62
|
...v ? { "data-status": "open" } : {},
|
|
60
63
|
children: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
e,
|
|
65
|
+
c && /* @__PURE__ */ m(
|
|
66
|
+
E,
|
|
64
67
|
{
|
|
65
68
|
position: o,
|
|
66
|
-
className:
|
|
69
|
+
className: d,
|
|
67
70
|
dividerColor: t
|
|
68
71
|
}
|
|
69
72
|
),
|
|
70
|
-
|
|
73
|
+
l && /* @__PURE__ */ m(H, { ref: i })
|
|
71
74
|
]
|
|
72
75
|
}
|
|
73
76
|
);
|
|
74
|
-
},
|
|
75
|
-
contextValue:
|
|
76
|
-
panelClassName:
|
|
77
|
+
}, eo = ({
|
|
78
|
+
contextValue: e,
|
|
79
|
+
panelClassName: s,
|
|
77
80
|
resolvedPosition: o,
|
|
78
|
-
showDivider:
|
|
81
|
+
showDivider: c,
|
|
79
82
|
modalType: t,
|
|
80
|
-
closeOnOutsidePress:
|
|
81
|
-
floatingOffset:
|
|
82
|
-
open:
|
|
83
|
-
onOpenChange:
|
|
83
|
+
closeOnOutsidePress: l,
|
|
84
|
+
floatingOffset: f,
|
|
85
|
+
open: d,
|
|
86
|
+
onOpenChange: u,
|
|
84
87
|
transitionConfig: p,
|
|
85
88
|
dividerColor: v,
|
|
86
|
-
children:
|
|
89
|
+
children: a,
|
|
87
90
|
resizeConfig: x,
|
|
88
|
-
|
|
89
|
-
skipMountAnimation:
|
|
90
|
-
container:
|
|
91
|
+
cssVarStyle: y,
|
|
92
|
+
skipMountAnimation: C,
|
|
93
|
+
container: i,
|
|
91
94
|
triggerRef: r,
|
|
92
|
-
...
|
|
95
|
+
...P
|
|
93
96
|
}) => {
|
|
94
|
-
const N = t === "isModal" || t === "alert",
|
|
95
|
-
(
|
|
96
|
-
const
|
|
97
|
-
return !(
|
|
97
|
+
const N = t === "isModal" || t === "alert", h = j(
|
|
98
|
+
(n) => {
|
|
99
|
+
const M = (r == null ? void 0 : r.current) ?? null;
|
|
100
|
+
return !(M && n.target instanceof Node && M.contains(n.target));
|
|
98
101
|
},
|
|
99
102
|
[r]
|
|
100
|
-
), _ =
|
|
101
|
-
const
|
|
102
|
-
return !r || !(t === "isModal" || t !== "alert" &&
|
|
103
|
-
}, [t,
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
), _ = S(() => {
|
|
104
|
+
const n = U(t, l);
|
|
105
|
+
return !r || !(t === "isModal" || t !== "alert" && (l ?? !0)) ? n : { ...n ?? {}, outsidePress: h };
|
|
106
|
+
}, [t, l, r, h]), b = $(
|
|
107
|
+
k[`${F}__overlay-divider`],
|
|
108
|
+
k[`${F}__overlay-divider--${o}`]
|
|
106
109
|
);
|
|
107
|
-
return /* @__PURE__ */
|
|
108
|
-
|
|
110
|
+
return /* @__PURE__ */ m(B.Provider, { value: e, children: /* @__PURE__ */ m(
|
|
111
|
+
g,
|
|
109
112
|
{
|
|
110
|
-
open:
|
|
111
|
-
onOpenChange:
|
|
112
|
-
portalled:
|
|
113
|
+
open: d,
|
|
114
|
+
onOpenChange: u,
|
|
115
|
+
portalled: i ? { root: i } : !0,
|
|
113
116
|
transitionConfig: p,
|
|
114
117
|
dismiss: _,
|
|
115
118
|
focusConfiguration: N ? !0 : { modal: !1, closeOnFocusOut: !1 },
|
|
116
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ m(
|
|
117
120
|
J,
|
|
118
121
|
{
|
|
119
|
-
panelClassName:
|
|
122
|
+
panelClassName: s,
|
|
120
123
|
resolvedPosition: o,
|
|
121
|
-
showDivider:
|
|
124
|
+
showDivider: c,
|
|
122
125
|
dividerColor: v,
|
|
123
|
-
floatingOffset:
|
|
126
|
+
floatingOffset: f,
|
|
124
127
|
overlayDividerClassName: b,
|
|
125
128
|
isBlocking: N,
|
|
126
129
|
resizeConfig: x,
|
|
127
|
-
|
|
128
|
-
skipMountAnimation:
|
|
129
|
-
container:
|
|
130
|
-
...
|
|
130
|
+
cssVarStyle: y,
|
|
131
|
+
skipMountAnimation: C,
|
|
132
|
+
container: i,
|
|
133
|
+
...P,
|
|
131
134
|
role: t === "alert" ? "alertdialog" : "dialog",
|
|
132
135
|
"aria-modal": N || void 0,
|
|
133
|
-
children:
|
|
136
|
+
children: a
|
|
134
137
|
}
|
|
135
138
|
)
|
|
136
139
|
}
|
|
137
140
|
) });
|
|
138
141
|
};
|
|
139
142
|
export {
|
|
140
|
-
|
|
143
|
+
eo as OverlayPanel
|
|
141
144
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("react"),n=require("../../../chunks/classNames.DC8Ra4sw.js");require("../../../chunks/constants.CgMu0_1M.js");const l=require("../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),r=require("react"),n=require("../../../chunks/classNames.DC8Ra4sw.js");require("../../../chunks/constants.CgMu0_1M.js");const l=require("../../../chunks/panel.module.BzLGa7GY.js"),{baseClassNamePrefix:i}=n.getBEMClassNames("panel"),e=r.forwardRef((t,s)=>a.jsx("div",{ref:s,className:l.styles[`${i}__resize-handle`],"aria-hidden":!0,tabIndex:-1}));e.displayName="PanelResizeHandle";exports.PanelResizeHandle=e;
|
|
@@ -2,7 +2,7 @@ import { jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as s } from "react";
|
|
3
3
|
import { g as r } from "../../../chunks/classNames.ZWNk1hey.js";
|
|
4
4
|
import "../../../chunks/constants.Cruz2A1w.js";
|
|
5
|
-
import { s as o } from "../../../chunks/panel.module.
|
|
5
|
+
import { s as o } from "../../../chunks/panel.module.CgFBtvbR.js";
|
|
6
6
|
const { baseClassNamePrefix: i } = r("panel"), m = s((t, e) => /* @__PURE__ */ a(
|
|
7
7
|
"div",
|
|
8
8
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react/jsx-runtime"),F=require("clsx"),K=require("react"),re=require("../../../chunks/classNames.DC8Ra4sw.js");require("../../../chunks/constants.CgMu0_1M.js");const V=require("../../../utils/hooks/usePrevious.cjs.js"),ae=require("./Header/Panel.Header.cjs.js"),ce=require("./Panel.Body.cjs.js"),ue=require("./Footer/Panel.Footer.cjs.js"),c=require("./Panel.helpers.cjs.js"),de=require("./Panel.Inline.cjs.js"),ve=require("./Panel.Overlay.cjs.js"),n=require("../../../chunks/panel.module.BzLGa7GY.js"),fe=165,ye=100,_e=(e,i)=>{if(!e)return;const l=i==="bottom",u=typeof e=="object"?e:{},a=u.minSize??(l?ye:fe),_=u.maxSize??1/0,P=u.storageKey??"";return{minSize:a,maxSize:_,storageKey:P}},{baseClassNamePrefix:t,variable:L}=re.getBEMClassNames("panel");function Pe(e,i){const l={overlayWidthClass:void 0,inlineWidthClass:void 0,widthStyle:void 0};return i==="bottom"?l:c.isPresetWidth(e)?{overlayWidthClass:n.styles[`${t}--width-${e}`],inlineWidthClass:n.styles[`${t}__inline-wrapper--width-${e}`],widthStyle:void 0}:e!==void 0?{...l,widthStyle:{[L("width")]:e}}:l}function pe(e,i){if(!(i!=="bottom"||e===void 0))return{[L("height")]:e}}const f=({children:e,className:i,padding:l="md",onOpenChange:u,open:a,width:_,height:P,dismissible:g=!0,closeButtonAriaLabel:w="Close panel",kind:s="overlay",position:p,divider:G=!0,dividerColor:y,backgroundColor:b,isAnimated:N=!0,onBeforeClose:U,modalType:d,offset:O,resizable:X,id:S,...C})=>{const o=c.getResolvedPanelPosition(p),v=_e(X,o),Y=!!v,{container:q,triggerRef:J,...$}=C,r=s==="overlay"?q:void 0;if(process.env.NODE_ENV!=="production"){v&&!v.storageKey&&console.warn("Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."),d==="alert"&&g&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');const{closeOnOutsidePress:le}=C;if(le&&d!=="nonModal"&&d!==void 0&&console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'),q&&s==="inline"&&console.warn('Panel: `container` has no effect when `kind="inline"`.'),r)try{if(typeof getComputedStyle=="function"){const h=getComputedStyle(r);h.position==="static"&&console.warn("Panel: container element should have `position: relative` (or another non-static value) for proper scoping.");const m=o==="bottom"?h.overflowY:h.overflowX;(m==="visible"||m==="auto"||m==="scroll")&&console.warn("Panel: container element should use `overflow: hidden` (or `clip`) so the slide-in/out transform does not trigger a transient scrollbar.")}}catch{}}const I=d==="alert"?!1:g,{overlayWidthClass:Q,inlineWidthClass:Z,widthStyle:M}=Pe(_,o),W=pe(P,o),x=M||W?{...M,...W}:void 0,E=s==="overlay"&&O?c.resolveOffset(O):void 0,z=!!E,H=F(n.styles[t],n.styles[`${t}--${s}`],s==="overlay"&&Q,n.styles[`${t}--padding-${l}`],n.styles[`${t}--position-${o}`],z&&n.styles[`${t}--floating`],Y&&n.styles[`${t}--resizable`],s==="overlay"&&r&&n.styles[`${t}--contained`],i),k=F(n.styles[`${t}__inline-wrapper`],Z),{requestClose:B,handleOverlayOpenChange:ee}=c.usePanelClose(U,u),D=K.useMemo(()=>({kind:s,dismissible:I,closeButtonAriaLabel:w,position:p,requestClose:B,backgroundColor:b,dividerColor:y}),[s,I,w,p,B,b,y]),{showDivider:se,dividerBefore:ne,dividerInner:te,dividerAfter:oe}=c.getPanelDividerState(G&&!z,o),R=K.useMemo(()=>({duration:N?c.PANEL_TRANSITION_DURATION_MS:0}),[N]),T=V.usePrevious(s),ie=V.usePrevious(r),j=T!==void 0&&T!==s&&a===!0||ie===null&&r!=null&&a===!0;return r===null?null:s==="inline"?A.jsx(de.InlinePanel,{contextValue:D,panelClassName:H,inlineWrapperClassName:k,resolvedPosition:o,dividerBefore:ne,dividerInner:te,dividerAfter:oe,dividerColor:y,open:a,transitionConfig:R,resizeConfig:v,skipMountAnimation:j,cssVarStyle:x,id:S,...$,children:e}):A.jsx(ve.OverlayPanel,{contextValue:D,panelClassName:H,resolvedPosition:o,showDivider:se,dividerColor:y,modalType:d,floatingOffset:E,open:a,onOpenChange:ee,transitionConfig:R,resizeConfig:v,skipMountAnimation:j,cssVarStyle:x,id:S,...$,container:r,triggerRef:J,children:e})};f.displayName="Panel";f.Header=ae.Header;f.Body=ce.Body;f.Footer=ue.Footer;exports.Panel=f;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BoxBackgroundColor } from '@viasat/beam-shared/components/box';
|
|
2
|
+
import { PanelCloseReason, PanelDividerColor, PanelKind, PanelPosition } from './Panel.types';
|
|
2
3
|
export interface PanelContextValue {
|
|
3
4
|
/**
|
|
4
5
|
* The panel kind — used by sub-components to vary behaviour per kind.
|
|
@@ -21,6 +22,16 @@ export interface PanelContextValue {
|
|
|
21
22
|
* provided and only calls `onOpenChange(false)` when the guard returns `true`.
|
|
22
23
|
*/
|
|
23
24
|
requestClose: (reason: PanelCloseReason) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Default background color for all panel surfaces (Header, Body, Footer).
|
|
27
|
+
* Subcomponent-level backgroundColor props take priority.
|
|
28
|
+
*/
|
|
29
|
+
backgroundColor?: BoxBackgroundColor;
|
|
30
|
+
/**
|
|
31
|
+
* Default divider color for all panel dividers (Header, Footer).
|
|
32
|
+
* Subcomponent-level dividerColor props take priority.
|
|
33
|
+
*/
|
|
34
|
+
dividerColor?: PanelDividerColor;
|
|
24
35
|
}
|
|
25
36
|
export declare const PanelContext: import('react').Context<PanelContextValue | undefined>;
|
|
26
37
|
export declare const usePanelContext: () => PanelContextValue;
|
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,
|
|
3
|
+
({ children, className: _className, padding, onOpenChange, open, width, height, dismissible, closeButtonAriaLabel, kind, position, divider, dividerColor, backgroundColor, isAnimated, onBeforeClose, modalType, offset, resizable, id, ...panelProps }: PanelProps): JSX.Element | null;
|
|
4
4
|
displayName: string;
|
|
5
5
|
Header: {
|
|
6
6
|
({ children, className: _className, divider, dividerColor, backgroundColor, ...props }: import('./Panel.types').PanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -31,7 +31,7 @@ export declare const Panel: {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
Body: {
|
|
34
|
-
({ children, className: _className, backgroundColor, ...props }: import('./Panel.Body').PanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
({ children, className: _className, backgroundColor, tabIndex, ...props }: import('./Panel.Body').PanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
displayName: string;
|
|
36
36
|
};
|
|
37
37
|
Footer: {
|