@viasat/beam-react 2.21.1 → 2.23.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/Search.css +1 -1
- package/assets/panel.css +1 -1
- package/chunks/Search.Results.BM9NkYBp.js +1 -0
- package/chunks/Search.Results.wKBufUSo.js +64 -0
- package/chunks/{panel.module.a_gaicKX.js → panel.module.DCpj0tSX.js} +1 -1
- package/lib/Alert/Alert.figma.d.ts +1 -0
- package/lib/Switch/Switch.figma.d.ts +1 -0
- package/lib/Tooltip/Tooltip.figma.d.ts +1 -0
- package/lib/wip/Panel/Panel.Body.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Body.d.ts +6 -1
- package/lib/wip/Panel/Panel.Body.es.js +11 -9
- package/lib/wip/Panel/Panel.Divider.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Divider.d.ts +6 -0
- package/lib/wip/Panel/Panel.Divider.es.js +18 -0
- package/lib/wip/Panel/Panel.Footer.Actions.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Footer.Actions.es.js +1 -1
- package/lib/wip/Panel/Panel.Footer.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Footer.d.ts +12 -1
- package/lib/wip/Panel/Panel.Footer.es.js +28 -15
- package/lib/wip/Panel/Panel.Header.ContentAfter.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.ContentAfter.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.ContentBefore.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.ContentBefore.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.Description.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Description.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.Heading.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Heading.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.Row.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Row.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.Subheader.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Subheader.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.d.ts +12 -1
- package/lib/wip/Panel/Panel.Header.es.js +37 -24
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.d.ts +3 -6
- package/lib/wip/Panel/Panel.Inline.es.js +62 -70
- 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 +23 -22
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.d.ts +4 -4
- package/lib/wip/Panel/Panel.es.js +69 -60
- package/lib/wip/Panel/Panel.helpers.cjs.js +1 -1
- package/lib/wip/Panel/Panel.helpers.d.ts +2 -1
- package/lib/wip/Panel/Panel.helpers.es.js +8 -7
- package/lib/wip/Panel/Panel.types.cjs.js +1 -1
- package/lib/wip/Panel/Panel.types.d.ts +11 -1
- package/lib/wip/Panel/Panel.types.es.js +5 -1
- package/lib/wip/Search/Search.Results.Item.cjs.js +1 -1
- package/lib/wip/Search/Search.Results.Item.d.ts +6 -6
- package/lib/wip/Search/Search.Results.Item.es.js +5 -6
- package/lib/wip/Search/Search.Results.ViewAll.cjs.js +1 -1
- package/lib/wip/Search/Search.Results.ViewAll.d.ts +7 -7
- package/lib/wip/Search/Search.Results.ViewAll.es.js +2 -2
- package/lib/wip/Search/Search.Results.cjs.js +1 -1
- package/lib/wip/Search/Search.Results.es.js +3 -5
- package/lib/wip/Search/Search.cjs.js +1 -1
- package/lib/wip/Search/Search.d.ts +17 -8
- package/lib/wip/Search/Search.es.js +175 -157
- package/lib/wip/Search/SearchDropdown.cjs.js +1 -1
- package/lib/wip/Search/SearchDropdown.es.js +25 -24
- package/lib/wip/Search/index.d.ts +4 -1
- package/package.json +6 -6
- package/chunks/Search.Results.CFA_KEdP.js +0 -1
- package/chunks/Search.Results.DVf6WKnI.js +0 -68
- package/lib/wip/Search/Search.Results.d.ts +0 -15
- package/chunks/{panel.module.DGxSyRdA.js → panel.module.DJLJpnm_.js} +2 -2
|
@@ -1,34 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsxs as p, Fragment as f, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import l from "clsx";
|
|
3
|
+
import { g as d } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { Divider as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
import { Divider as c } from "../../Divider/Divider.es.js";
|
|
6
|
+
import { Box as C } from "../../Box/Box.es.js";
|
|
7
|
+
import { DEFAULT_PANEL_DIVIDER_COLOR as x } from "./Panel.helpers.es.js";
|
|
8
|
+
import { Row as D } from "./Panel.Header.Row.es.js";
|
|
9
|
+
import { ContentBefore as b } from "./Panel.Header.ContentBefore.es.js";
|
|
10
|
+
import { Heading as g } from "./Panel.Header.Heading.es.js";
|
|
11
|
+
import { ContentAfter as h } from "./Panel.Header.ContentAfter.es.js";
|
|
12
|
+
import { Description as u } from "./Panel.Header.Description.es.js";
|
|
13
|
+
import { Subheader as E } from "./Panel.Header.Subheader.es.js";
|
|
14
|
+
import { s as N } from "../../../chunks/panel.module.DJLJpnm_.js";
|
|
15
|
+
const { subElementClassPrefix: A } = d("panel"), B = `${A}header`, r = ({
|
|
16
|
+
children: e,
|
|
15
17
|
className: t,
|
|
16
18
|
divider: m = !0,
|
|
17
|
-
|
|
19
|
+
dividerColor: s = x,
|
|
20
|
+
backgroundColor: a,
|
|
21
|
+
...i
|
|
18
22
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
23
|
+
const n = l(N[B], t);
|
|
24
|
+
return /* @__PURE__ */ p(f, { children: [
|
|
25
|
+
/* @__PURE__ */ o(
|
|
26
|
+
C,
|
|
27
|
+
{
|
|
28
|
+
as: "header",
|
|
29
|
+
className: n,
|
|
30
|
+
backgroundColor: a,
|
|
31
|
+
...i,
|
|
32
|
+
children: e
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
m && /* @__PURE__ */ o(c, { borderColor: s })
|
|
23
36
|
] });
|
|
24
37
|
};
|
|
25
38
|
r.displayName = "Panel.Header";
|
|
26
|
-
r.Row =
|
|
27
|
-
r.ContentBefore =
|
|
28
|
-
r.Heading =
|
|
29
|
-
r.Description =
|
|
30
|
-
r.ContentAfter =
|
|
31
|
-
r.Subheader =
|
|
39
|
+
r.Row = D;
|
|
40
|
+
r.ContentBefore = b;
|
|
41
|
+
r.Heading = g;
|
|
42
|
+
r.Description = u;
|
|
43
|
+
r.ContentAfter = h;
|
|
44
|
+
r.Subheader = E;
|
|
32
45
|
export {
|
|
33
46
|
r as Header
|
|
34
47
|
};
|
|
@@ -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"),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"),F=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),d=require("./Panel.Divider.cjs.js"),P=require("../../../chunks/panel.module.DCpj0tSX.js"),{baseClassNamePrefix:U}=q.getBEMClassNames("panel"),N=({children:s,panelClassName:a,inlineWrapperClassName:l,resolvedPosition:n,dividerBefore:r,dividerInner:o,dividerAfter:c,alwaysVisible:i,dividerColor:t,...u})=>{const{context:x,transitionConfig:_,refs:p}=F.useBmFloatingUIContext(),{isMounted:I,status:g}=m.useTransitionStatus(x,_),j=i&&g==="initial"?"open":g;return I?e.jsxs(e.Fragment,{children:[r&&e.jsx(d.InlineDivider,{position:n,dividerColor:t}),e.jsx("div",{ref:p.setFloating,className:l,"data-position":n,"data-status":j,children:e.jsxs("div",{className:P.styles[`${U}__inline-wrapper-content`],children:[o&&e.jsx(d.InlineDivider,{position:n,dividerColor:t}),e.jsx("aside",{...u,className:a,children:s})]})}),c&&e.jsx(d.InlineDivider,{position:n,dividerColor:t})]}):null},h=({contextValue:s,panelClassName:a,inlineWrapperClassName:l,resolvedPosition:n,dividerBefore:r,dividerInner:o,dividerAfter:c,open:i,transitionConfig:t,dividerColor:u,children:x,..._})=>e.jsx(b.PanelContext.Provider,{value:s,children:e.jsx(f.FloatingUIRoot,{open:i??!0,portalled:!1,transitionConfig:t,children:e.jsx(N,{panelClassName:a,inlineWrapperClassName:l,resolvedPosition:n,dividerBefore:r,dividerInner:o,dividerAfter:c,dividerColor:u,alwaysVisible:i===void 0,..._,children:x})})});exports.InlinePanel=h;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { UseTransitionStylesProps } from '@floating-ui/react';
|
|
2
|
-
import { PanelPosition } from './Panel.types';
|
|
2
|
+
import { PanelDividerColor, PanelPosition } from './Panel.types';
|
|
3
3
|
import { PanelContextValue } from './Panel.context';
|
|
4
|
-
export declare const InlineDivider: ({ position, className, }: {
|
|
5
|
-
position?: PanelPosition;
|
|
6
|
-
className?: string;
|
|
7
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
4
|
type InlinePanelProps = {
|
|
9
5
|
contextValue: PanelContextValue;
|
|
10
6
|
panelClassName: string;
|
|
@@ -16,6 +12,7 @@ type InlinePanelProps = {
|
|
|
16
12
|
open?: boolean;
|
|
17
13
|
transitionConfig: UseTransitionStylesProps;
|
|
18
14
|
children: React.ReactNode;
|
|
15
|
+
dividerColor?: PanelDividerColor;
|
|
19
16
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
20
|
-
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, children, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
18
|
export {};
|
|
@@ -1,93 +1,85 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTransitionStatus as
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as t, jsxs as g, Fragment as C } from "react/jsx-runtime";
|
|
2
|
+
import { useTransitionStatus as N } from "@floating-ui/react";
|
|
3
|
+
import { g as F } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { PanelContext as
|
|
6
|
-
import { FloatingUIRoot as
|
|
7
|
-
import { a as
|
|
8
|
-
import {
|
|
9
|
-
import { s as
|
|
10
|
-
const { baseClassNamePrefix:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
borderColor: "01",
|
|
17
|
-
orientation: n === "bottom" ? "horizontal" : "vertical",
|
|
18
|
-
className: i
|
|
19
|
-
}
|
|
20
|
-
), y = ({
|
|
21
|
-
children: n,
|
|
22
|
-
panelClassName: i,
|
|
23
|
-
inlineWrapperClassName: e,
|
|
24
|
-
resolvedPosition: o,
|
|
5
|
+
import { PanelContext as w } 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 u } from "./Panel.Divider.es.js";
|
|
9
|
+
import { s as j } from "../../../chunks/panel.module.DJLJpnm_.js";
|
|
10
|
+
const { baseClassNamePrefix: y } = F("panel"), B = ({
|
|
11
|
+
children: i,
|
|
12
|
+
panelClassName: e,
|
|
13
|
+
inlineWrapperClassName: o,
|
|
14
|
+
resolvedPosition: n,
|
|
25
15
|
dividerBefore: r,
|
|
26
|
-
dividerInner:
|
|
27
|
-
dividerAfter:
|
|
28
|
-
alwaysVisible:
|
|
29
|
-
|
|
16
|
+
dividerInner: l,
|
|
17
|
+
dividerAfter: m,
|
|
18
|
+
alwaysVisible: s,
|
|
19
|
+
dividerColor: a,
|
|
20
|
+
...p
|
|
30
21
|
}) => {
|
|
31
22
|
const {
|
|
32
|
-
context:
|
|
33
|
-
transitionConfig:
|
|
34
|
-
refs:
|
|
35
|
-
} =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
),
|
|
39
|
-
return
|
|
40
|
-
r && /* @__PURE__ */ t(
|
|
23
|
+
context: c,
|
|
24
|
+
transitionConfig: f,
|
|
25
|
+
refs: x
|
|
26
|
+
} = b(), { isMounted: I, status: d } = N(
|
|
27
|
+
c,
|
|
28
|
+
f
|
|
29
|
+
), h = s && d === "initial" ? "open" : d;
|
|
30
|
+
return I ? /* @__PURE__ */ g(C, { children: [
|
|
31
|
+
r && /* @__PURE__ */ t(u, { position: n, dividerColor: a }),
|
|
41
32
|
/* @__PURE__ */ t(
|
|
42
33
|
"div",
|
|
43
34
|
{
|
|
44
|
-
ref:
|
|
45
|
-
className:
|
|
46
|
-
"data-position":
|
|
47
|
-
"data-status":
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
/* @__PURE__ */ t("aside", { ...
|
|
35
|
+
ref: x.setFloating,
|
|
36
|
+
className: o,
|
|
37
|
+
"data-position": n,
|
|
38
|
+
"data-status": h,
|
|
39
|
+
children: /* @__PURE__ */ g("div", { className: j[`${y}__inline-wrapper-content`], children: [
|
|
40
|
+
l && /* @__PURE__ */ t(u, { position: n, dividerColor: a }),
|
|
41
|
+
/* @__PURE__ */ t("aside", { ...p, className: e, children: i })
|
|
51
42
|
] })
|
|
52
43
|
}
|
|
53
44
|
),
|
|
54
|
-
|
|
45
|
+
m && /* @__PURE__ */ t(u, { position: n, dividerColor: a })
|
|
55
46
|
] }) : null;
|
|
56
|
-
},
|
|
57
|
-
contextValue:
|
|
58
|
-
panelClassName:
|
|
59
|
-
inlineWrapperClassName:
|
|
60
|
-
resolvedPosition:
|
|
47
|
+
}, V = ({
|
|
48
|
+
contextValue: i,
|
|
49
|
+
panelClassName: e,
|
|
50
|
+
inlineWrapperClassName: o,
|
|
51
|
+
resolvedPosition: n,
|
|
61
52
|
dividerBefore: r,
|
|
62
|
-
dividerInner:
|
|
63
|
-
dividerAfter:
|
|
64
|
-
open:
|
|
65
|
-
transitionConfig:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
dividerInner: l,
|
|
54
|
+
dividerAfter: m,
|
|
55
|
+
open: s,
|
|
56
|
+
transitionConfig: a,
|
|
57
|
+
dividerColor: p,
|
|
58
|
+
children: c,
|
|
59
|
+
...f
|
|
60
|
+
}) => /* @__PURE__ */ t(w.Provider, { value: i, children: /* @__PURE__ */ t(
|
|
61
|
+
U,
|
|
70
62
|
{
|
|
71
|
-
open:
|
|
63
|
+
open: s ?? !0,
|
|
72
64
|
portalled: !1,
|
|
73
|
-
transitionConfig:
|
|
65
|
+
transitionConfig: a,
|
|
74
66
|
children: /* @__PURE__ */ t(
|
|
75
|
-
|
|
67
|
+
B,
|
|
76
68
|
{
|
|
77
|
-
panelClassName:
|
|
78
|
-
inlineWrapperClassName:
|
|
79
|
-
resolvedPosition:
|
|
69
|
+
panelClassName: e,
|
|
70
|
+
inlineWrapperClassName: o,
|
|
71
|
+
resolvedPosition: n,
|
|
80
72
|
dividerBefore: r,
|
|
81
|
-
dividerInner:
|
|
82
|
-
dividerAfter:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
73
|
+
dividerInner: l,
|
|
74
|
+
dividerAfter: m,
|
|
75
|
+
dividerColor: p,
|
|
76
|
+
alwaysVisible: s === void 0,
|
|
77
|
+
...f,
|
|
78
|
+
children: c
|
|
86
79
|
}
|
|
87
80
|
)
|
|
88
81
|
}
|
|
89
82
|
) });
|
|
90
83
|
export {
|
|
91
|
-
|
|
92
|
-
T as InlinePanel
|
|
84
|
+
V as InlinePanel
|
|
93
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),x=require("clsx"),b=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const f=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"),F=require("./Panel.Divider.cjs.js"),a=require("../../../chunks/panel.module.DCpj0tSX.js"),{baseClassNamePrefix:n}=b.getBEMClassNames("panel"),j=({contextValue:r,panelClassName:t,resolvedPosition:l,showDivider:o,modalType:e,closeOnOutsidePress:c,open:u,onOpenChange:_,transitionConfig:d,dividerColor:g,children:v,...m})=>{const s=e==="isModal"||e==="alert",P=p.getPanelDismissConfig(e,c),q=x(a.styles[`${n}__overlay-divider`],a.styles[`${n}__overlay-divider--${l}`]);return i.jsx(f.PanelContext.Provider,{value:r,children:i.jsx(y.FloatingUIRoot,{open:u,onOpenChange:_,portalled:!0,transitionConfig:d,dismiss:P,focusConfiguration:s?!0:{modal:!1,closeOnFocusOut:!1},children:i.jsxs(C.Content,{className:t,skipFloatingStyles:!0,overlay:s,...m,role:e==="alert"?"alertdialog":"dialog","aria-modal":s||void 0,"data-position":l,children:[v,o&&i.jsx(F.InlineDivider,{position:l,className:q,dividerColor:g})]})})})};exports.OverlayPanel=j;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseTransitionStylesProps } from '@floating-ui/react';
|
|
2
|
-
import { PanelModalType, PanelPosition } from './Panel.types';
|
|
2
|
+
import { PanelDividerColor, PanelModalType, PanelPosition } from './Panel.types';
|
|
3
3
|
import { PanelContextValue } from './Panel.context';
|
|
4
4
|
import { FloatingUIProps } from '../../FloatingUI/FloatingUI.context';
|
|
5
5
|
type OverlayPanelProps = {
|
|
@@ -13,6 +13,7 @@ type OverlayPanelProps = {
|
|
|
13
13
|
onOpenChange?: FloatingUIProps['onOpenChange'];
|
|
14
14
|
transitionConfig: UseTransitionStylesProps;
|
|
15
15
|
children: React.ReactNode;
|
|
16
|
+
dividerColor?: PanelDividerColor;
|
|
16
17
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
17
|
-
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, open, onOpenChange, transitionConfig, children, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, open, onOpenChange, transitionConfig, dividerColor, children, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
19
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as s, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import N from "clsx";
|
|
3
|
+
import { g as y } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { PanelContext as
|
|
6
|
-
import { getPanelDismissConfig as
|
|
7
|
-
import { FloatingUIRoot as
|
|
8
|
-
import { Content as
|
|
9
|
-
import { InlineDivider as
|
|
10
|
-
import { s as a } from "../../../chunks/panel.module.
|
|
11
|
-
const { baseClassNamePrefix: e } =
|
|
5
|
+
import { PanelContext as _ } from "./Panel.context.es.js";
|
|
6
|
+
import { getPanelDismissConfig as h } from "./Panel.helpers.es.js";
|
|
7
|
+
import { FloatingUIRoot as D } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
8
|
+
import { Content as F } from "../../FloatingUI/FloatingUI.content.es.js";
|
|
9
|
+
import { InlineDivider as O } from "./Panel.Divider.es.js";
|
|
10
|
+
import { s as a } from "../../../chunks/panel.module.DJLJpnm_.js";
|
|
11
|
+
const { baseClassNamePrefix: e } = y("panel"), S = ({
|
|
12
12
|
contextValue: t,
|
|
13
13
|
panelClassName: l,
|
|
14
14
|
resolvedPosition: r,
|
|
@@ -18,35 +18,36 @@ const { baseClassNamePrefix: e } = N("panel"), R = ({
|
|
|
18
18
|
open: f,
|
|
19
19
|
onOpenChange: c,
|
|
20
20
|
transitionConfig: d,
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
dividerColor: p,
|
|
22
|
+
children: g,
|
|
23
|
+
...v
|
|
23
24
|
}) => {
|
|
24
|
-
const i = o === "isModal" || o === "alert",
|
|
25
|
+
const i = o === "isModal" || o === "alert", u = h(o, n), C = N(
|
|
25
26
|
a[`${e}__overlay-divider`],
|
|
26
27
|
a[`${e}__overlay-divider--${r}`]
|
|
27
28
|
);
|
|
28
|
-
return /* @__PURE__ */ s(
|
|
29
|
-
|
|
29
|
+
return /* @__PURE__ */ s(_.Provider, { value: t, children: /* @__PURE__ */ s(
|
|
30
|
+
D,
|
|
30
31
|
{
|
|
31
32
|
open: f,
|
|
32
33
|
onOpenChange: c,
|
|
33
34
|
portalled: !0,
|
|
34
35
|
transitionConfig: d,
|
|
35
|
-
dismiss:
|
|
36
|
+
dismiss: u,
|
|
36
37
|
focusConfiguration: i ? !0 : { modal: !1, closeOnFocusOut: !1 },
|
|
37
|
-
children: /* @__PURE__ */
|
|
38
|
-
|
|
38
|
+
children: /* @__PURE__ */ x(
|
|
39
|
+
F,
|
|
39
40
|
{
|
|
40
41
|
className: l,
|
|
41
42
|
skipFloatingStyles: !0,
|
|
42
43
|
overlay: i,
|
|
43
|
-
...
|
|
44
|
+
...v,
|
|
44
45
|
role: o === "alert" ? "alertdialog" : "dialog",
|
|
45
46
|
"aria-modal": i || void 0,
|
|
46
47
|
"data-position": r,
|
|
47
48
|
children: [
|
|
48
|
-
|
|
49
|
-
m && /* @__PURE__ */ s(
|
|
49
|
+
g,
|
|
50
|
+
m && /* @__PURE__ */ s(O, { position: r, className: C, dividerColor: p })
|
|
50
51
|
]
|
|
51
52
|
}
|
|
52
53
|
)
|
|
@@ -54,5 +55,5 @@ const { baseClassNamePrefix: e } = N("panel"), R = ({
|
|
|
54
55
|
) });
|
|
55
56
|
};
|
|
56
57
|
export {
|
|
57
|
-
|
|
58
|
+
S as OverlayPanel
|
|
58
59
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react/jsx-runtime"),q=require("clsx"),b=require("react"),B=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const A=require("./Panel.Header.cjs.js"),F=require("./Panel.Body.cjs.js"),H=require("./Panel.Footer.cjs.js"),i=require("./Panel.helpers.cjs.js"),T=require("./Panel.Inline.cjs.js"),V=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.DCpj0tSX.js"),{baseClassNamePrefix:s}=B.getBEMClassNames("panel"),a=({children:u,className:C,padding:g="md",onOpenChange:h,open:_,size:r,dismissible:d=!0,closeButtonAriaLabel:P="Close panel",kind:o="inline",position:t,divider:$=!0,dividerColor:p,isAnimated:N=!0,onBeforeClose:M,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 y=n==="alert"?!1:d,l=i.getResolvedPanelPosition(t),x=r&&(l!=="bottom"||r==="full"),m=q(e.styles[s],e.styles[`${s}--${o}`],x&&e.styles[`${s}--size-${r}`],e.styles[`${s}--padding-${g}`],e.styles[`${s}--position-${l}`],C),D=q(e.styles[`${s}__inline-wrapper`],r==="full"&&e.styles[`${s}__inline-wrapper--full`]),{requestClose:f,handleOverlayOpenChange:E}=i.usePanelClose(M,h),v=b.useMemo(()=>({kind:o,dismissible:y,closeButtonAriaLabel:P,position:t,requestClose:f}),[o,y,P,t,f]),{showDivider:I,dividerBefore:S,dividerInner:R,dividerAfter:j}=i.getPanelDividerState($,l),w=b.useMemo(()=>({duration:N?i.PANEL_TRANSITION_DURATION_MS:0}),[N]);return o==="inline"?O.jsx(T.InlinePanel,{contextValue:v,panelClassName:m,inlineWrapperClassName:D,resolvedPosition:l,dividerBefore:S,dividerInner:R,dividerAfter:j,dividerColor:p,open:_,transitionConfig:w,...c,children:u}):O.jsx(V.OverlayPanel,{contextValue:v,panelClassName:m,resolvedPosition:l,showDivider:I,dividerColor:p,modalType:n,open:_,onOpenChange:E,transitionConfig:w,...c,children:u})};a.displayName="Panel";a.Header=A.Header;a.Body=F.Body;a.Footer=H.Footer;exports.Panel=a;
|
package/lib/wip/Panel/Panel.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
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, modalType, ...panelProps }: PanelProps): JSX.Element;
|
|
3
|
+
({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, dividerColor, isAnimated, onBeforeClose, modalType, ...panelProps }: PanelProps): JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
Header: {
|
|
6
|
-
({ children, className: _className, divider, ...props }: import('./Panel.Header').PanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
({ children, className: _className, divider, dividerColor, backgroundColor, ...props }: import('./Panel.Header').PanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
Row: {
|
|
9
9
|
({ children, className: _className, ...props }: import('./Panel.Header.Row').PanelHeaderRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -31,11 +31,11 @@ export declare const Panel: {
|
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
Body: {
|
|
34
|
-
({ children, className: _className, ...props }: import('./Panel.Body').PanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
({ children, className: _className, backgroundColor, ...props }: import('./Panel.Body').PanelBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
35
35
|
displayName: string;
|
|
36
36
|
};
|
|
37
37
|
Footer: {
|
|
38
|
-
({ children, className: _className, divider, ...props }: import('./Panel.Footer').PanelFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
({ children, className: _className, divider, dividerColor, backgroundColor, ...props }: import('./Panel.Footer').PanelFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
displayName: string;
|
|
40
40
|
Actions: {
|
|
41
41
|
({ layout, children, className: _className, ...props }: import('./Panel.Footer.Actions').PanelFooterActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,92 +1,101 @@
|
|
|
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 h } from "react";
|
|
4
4
|
import { g as R } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
5
5
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
6
|
-
import { Header as
|
|
7
|
-
import { Body as
|
|
8
|
-
import { Footer as
|
|
9
|
-
import { usePanelClose as
|
|
10
|
-
import { InlinePanel as
|
|
11
|
-
import { OverlayPanel as
|
|
12
|
-
import { s as e } from "../../../chunks/panel.module.
|
|
13
|
-
const { baseClassNamePrefix: o } = R("panel"),
|
|
6
|
+
import { Header as V } from "./Panel.Header.es.js";
|
|
7
|
+
import { Body as F } from "./Panel.Body.es.js";
|
|
8
|
+
import { Footer as H } from "./Panel.Footer.es.js";
|
|
9
|
+
import { usePanelClose as T, getPanelDividerState as j, PANEL_TRANSITION_DURATION_MS as q, getResolvedPanelPosition as U } from "./Panel.helpers.es.js";
|
|
10
|
+
import { InlinePanel as W } from "./Panel.Inline.es.js";
|
|
11
|
+
import { OverlayPanel as G } from "./Panel.Overlay.es.js";
|
|
12
|
+
import { s as e } from "../../../chunks/panel.module.DJLJpnm_.js";
|
|
13
|
+
const { baseClassNamePrefix: o } = R("panel"), l = ({
|
|
14
14
|
children: m,
|
|
15
15
|
className: _,
|
|
16
|
-
padding:
|
|
17
|
-
onOpenChange:
|
|
18
|
-
open:
|
|
19
|
-
size:
|
|
20
|
-
dismissible:
|
|
21
|
-
closeButtonAriaLabel:
|
|
22
|
-
kind:
|
|
16
|
+
padding: w = "md",
|
|
17
|
+
onOpenChange: y,
|
|
18
|
+
open: p,
|
|
19
|
+
size: r,
|
|
20
|
+
dismissible: d = !0,
|
|
21
|
+
closeButtonAriaLabel: f = "Close panel",
|
|
22
|
+
kind: t = "inline",
|
|
23
23
|
position: a,
|
|
24
24
|
divider: D = !0,
|
|
25
|
-
|
|
25
|
+
dividerColor: c,
|
|
26
|
+
isAnimated: u = !0,
|
|
26
27
|
onBeforeClose: E,
|
|
27
28
|
modalType: s,
|
|
28
|
-
...
|
|
29
|
+
...i
|
|
29
30
|
}) => {
|
|
30
|
-
process.env.NODE_ENV !== "production" && s === "alert" &&
|
|
31
|
+
process.env.NODE_ENV !== "production" && s === "alert" && d && console.warn(
|
|
31
32
|
'Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'
|
|
32
|
-
), process.env.NODE_ENV !== "production" &&
|
|
33
|
+
), process.env.NODE_ENV !== "production" && i.closeOnOutsidePress && s !== "nonModal" && s !== void 0 && console.warn(
|
|
33
34
|
'Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'
|
|
34
35
|
);
|
|
35
|
-
const
|
|
36
|
+
const N = s === "alert" ? !1 : d, n = U(a), x = r && (n !== "bottom" || r === "full"), P = g(
|
|
36
37
|
e[o],
|
|
37
|
-
e[`${o}--${
|
|
38
|
-
|
|
39
|
-
e[`${o}--padding-${
|
|
38
|
+
e[`${o}--${t}`],
|
|
39
|
+
x && e[`${o}--size-${r}`],
|
|
40
|
+
e[`${o}--padding-${w}`],
|
|
40
41
|
e[`${o}--position-${n}`],
|
|
41
42
|
_
|
|
42
|
-
),
|
|
43
|
+
), I = g(
|
|
43
44
|
e[`${o}__inline-wrapper`],
|
|
44
|
-
|
|
45
|
-
), { requestClose: v, handleOverlayOpenChange:
|
|
45
|
+
r === "full" && e[`${o}__inline-wrapper--full`]
|
|
46
|
+
), { requestClose: v, handleOverlayOpenChange: M } = T(
|
|
46
47
|
E,
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
() => ({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
y
|
|
49
|
+
), O = h(
|
|
50
|
+
() => ({
|
|
51
|
+
kind: t,
|
|
52
|
+
dismissible: N,
|
|
53
|
+
closeButtonAriaLabel: f,
|
|
54
|
+
position: a,
|
|
55
|
+
requestClose: v
|
|
56
|
+
}),
|
|
57
|
+
[t, N, f, a, v]
|
|
58
|
+
), { showDivider: b, dividerBefore: S, dividerInner: A, dividerAfter: B } = j(D, n), C = h(
|
|
59
|
+
() => ({ duration: u ? q : 0 }),
|
|
60
|
+
[u]
|
|
54
61
|
);
|
|
55
|
-
return
|
|
56
|
-
|
|
62
|
+
return t === "inline" ? /* @__PURE__ */ $(
|
|
63
|
+
W,
|
|
57
64
|
{
|
|
58
|
-
contextValue:
|
|
59
|
-
panelClassName:
|
|
60
|
-
inlineWrapperClassName:
|
|
65
|
+
contextValue: O,
|
|
66
|
+
panelClassName: P,
|
|
67
|
+
inlineWrapperClassName: I,
|
|
61
68
|
resolvedPosition: n,
|
|
62
|
-
dividerBefore:
|
|
63
|
-
dividerInner:
|
|
69
|
+
dividerBefore: S,
|
|
70
|
+
dividerInner: A,
|
|
64
71
|
dividerAfter: B,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
dividerColor: c,
|
|
73
|
+
open: p,
|
|
74
|
+
transitionConfig: C,
|
|
75
|
+
...i,
|
|
68
76
|
children: m
|
|
69
77
|
}
|
|
70
|
-
) : /* @__PURE__ */
|
|
71
|
-
|
|
78
|
+
) : /* @__PURE__ */ $(
|
|
79
|
+
G,
|
|
72
80
|
{
|
|
73
|
-
contextValue:
|
|
74
|
-
panelClassName:
|
|
81
|
+
contextValue: O,
|
|
82
|
+
panelClassName: P,
|
|
75
83
|
resolvedPosition: n,
|
|
76
|
-
showDivider:
|
|
84
|
+
showDivider: b,
|
|
85
|
+
dividerColor: c,
|
|
77
86
|
modalType: s,
|
|
78
|
-
open:
|
|
79
|
-
onOpenChange:
|
|
80
|
-
transitionConfig:
|
|
81
|
-
...
|
|
87
|
+
open: p,
|
|
88
|
+
onOpenChange: M,
|
|
89
|
+
transitionConfig: C,
|
|
90
|
+
...i,
|
|
82
91
|
children: m
|
|
83
92
|
}
|
|
84
93
|
);
|
|
85
94
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
l.displayName = "Panel";
|
|
96
|
+
l.Header = V;
|
|
97
|
+
l.Body = F;
|
|
98
|
+
l.Footer = H;
|
|
90
99
|
export {
|
|
91
|
-
|
|
100
|
+
l as Panel
|
|
92
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),d=400,f="01",P=t=>t||"end",a=(t,s)=>{const e=t&&s!=="full";return{showDivider:e,dividerBefore:e&&s!=="start"&&s!=="bottom",dividerInner:e&&s==="bottom",dividerAfter:e&&s==="start"}},D=(t,s)=>{if(t!=="isModal")return t==="alert"?{escapeKey:!1,outsidePress:!1}:{escapeKey:!1,outsidePress:s??!1}},_=t=>t==="escape-key"?"escapeKey":t==="outside-press"?"outsidePress":"programmatic",v=(t,s)=>{const e=c.useCallback(i=>{if(!t){s==null||s(!1);return}const r=t(i);r instanceof Promise?r.then(l=>{l&&(s==null||s(!1))}).catch(()=>{}):r&&(s==null||s(!1))},[t,s]),u=c.useCallback((i,r,l)=>{i?s==null||s(!0):e(_(l))},[s,e]);return{requestClose:e,handleOverlayOpenChange:u}};exports.DEFAULT_PANEL_DIVIDER_COLOR=f;exports.PANEL_TRANSITION_DURATION_MS=d;exports.getPanelDismissConfig=D;exports.getPanelDividerState=a;exports.getResolvedPanelPosition=P;exports.usePanelClose=v;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OpenChangeReason } from '@floating-ui/react';
|
|
2
|
-
import { PanelCloseReason, PanelModalType, PanelPosition, PanelProps } from './Panel.types';
|
|
2
|
+
import { PanelCloseReason, PanelDividerColor, PanelModalType, PanelPosition, PanelProps } from './Panel.types';
|
|
3
3
|
export declare const PANEL_TRANSITION_DURATION_MS = 400;
|
|
4
|
+
export declare const DEFAULT_PANEL_DIVIDER_COLOR: PanelDividerColor;
|
|
4
5
|
export declare const getResolvedPanelPosition: (position?: PanelPosition) => PanelPosition;
|
|
5
6
|
export declare const getPanelDividerState: (divider: boolean, position?: PanelPosition) => {
|
|
6
7
|
showDivider: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as c } from "react";
|
|
2
|
-
const P = 400, v = (t) => t || "end",
|
|
2
|
+
const P = 400, v = "01", m = (t) => t || "end", D = (t, s) => {
|
|
3
3
|
const r = t && s !== "full";
|
|
4
4
|
return {
|
|
5
5
|
showDivider: r,
|
|
@@ -9,10 +9,10 @@ const P = 400, v = (t) => t || "end", m = (t, s) => {
|
|
|
9
9
|
dividerInner: r && s === "bottom",
|
|
10
10
|
dividerAfter: r && s === "start"
|
|
11
11
|
};
|
|
12
|
-
},
|
|
12
|
+
}, _ = (t, s) => {
|
|
13
13
|
if (t !== "isModal")
|
|
14
14
|
return t === "alert" ? { escapeKey: !1, outsidePress: !1 } : { escapeKey: !1, outsidePress: s ?? !1 };
|
|
15
|
-
}, u = (t) => t === "escape-key" ? "escapeKey" : t === "outside-press" ? "outsidePress" : "programmatic",
|
|
15
|
+
}, u = (t) => t === "escape-key" ? "escapeKey" : t === "outside-press" ? "outsidePress" : "programmatic", a = (t, s) => {
|
|
16
16
|
const r = c(
|
|
17
17
|
(i) => {
|
|
18
18
|
if (!t) {
|
|
@@ -35,9 +35,10 @@ const P = 400, v = (t) => t || "end", m = (t, s) => {
|
|
|
35
35
|
return { requestClose: r, handleOverlayOpenChange: f };
|
|
36
36
|
};
|
|
37
37
|
export {
|
|
38
|
+
v as DEFAULT_PANEL_DIVIDER_COLOR,
|
|
38
39
|
P as PANEL_TRANSITION_DURATION_MS,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
_ as getPanelDismissConfig,
|
|
41
|
+
D as getPanelDividerState,
|
|
42
|
+
m as getResolvedPanelPosition,
|
|
43
|
+
a as usePanelClose
|
|
43
44
|
};
|