@viasat/beam-react 2.42.0 → 2.43.1
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/Search.css +1 -1
- package/assets/TextField.css +1 -1
- package/assets/combobox.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/_Options/OptionChips.cjs.js +1 -1
- package/lib/_Options/OptionChips.es.js +3 -2
- 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,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: {
|
|
@@ -1,71 +1,81 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { g as
|
|
1
|
+
import { jsx as R } from "react/jsx-runtime";
|
|
2
|
+
import F from "clsx";
|
|
3
|
+
import { useMemo as V } from "react";
|
|
4
|
+
import { g as re } from "../../../chunks/classNames.ZWNk1hey.js";
|
|
5
5
|
import "../../../chunks/constants.Cruz2A1w.js";
|
|
6
|
-
import { usePrevious as
|
|
7
|
-
import { Header as
|
|
8
|
-
import { Body as
|
|
9
|
-
import { Footer as
|
|
10
|
-
import { resolveOffset as
|
|
11
|
-
import { InlinePanel as
|
|
12
|
-
import { OverlayPanel as
|
|
13
|
-
import { s as
|
|
14
|
-
const
|
|
6
|
+
import { usePrevious as j } from "../../../utils/hooks/usePrevious.es.js";
|
|
7
|
+
import { Header as ae } from "./Header/Panel.Header.es.js";
|
|
8
|
+
import { Body as le } from "./Panel.Body.es.js";
|
|
9
|
+
import { Footer as ce } from "./Footer/Panel.Footer.es.js";
|
|
10
|
+
import { resolveOffset as fe, usePanelClose as me, getPanelDividerState as ve, PANEL_TRANSITION_DURATION_MS as de, getResolvedPanelPosition as pe, isPresetWidth as ue } from "./Panel.helpers.es.js";
|
|
11
|
+
import { InlinePanel as ye } from "./Panel.Inline.es.js";
|
|
12
|
+
import { OverlayPanel as he } from "./Panel.Overlay.es.js";
|
|
13
|
+
import { s as t } from "../../../chunks/panel.module.CgFBtvbR.js";
|
|
14
|
+
const ge = 165, Pe = 100, we = (e, i) => {
|
|
15
15
|
if (!e) return;
|
|
16
|
-
const
|
|
17
|
-
return { minSize:
|
|
18
|
-
}, { baseClassNamePrefix:
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
const r = i === "bottom", c = typeof e == "object" ? e : {}, l = c.minSize ?? (r ? Pe : ge), p = c.maxSize ?? 1 / 0, u = c.storageKey ?? "";
|
|
17
|
+
return { minSize: l, maxSize: p, storageKey: u };
|
|
18
|
+
}, { baseClassNamePrefix: n, variable: L } = re("panel");
|
|
19
|
+
function Ce(e, i) {
|
|
20
|
+
const r = {
|
|
21
|
+
overlayWidthClass: void 0,
|
|
22
|
+
inlineWidthClass: void 0,
|
|
23
|
+
widthStyle: void 0
|
|
24
|
+
};
|
|
25
|
+
return i === "bottom" ? r : ue(e) ? {
|
|
26
|
+
overlayWidthClass: t[`${n}--width-${e}`],
|
|
27
|
+
inlineWidthClass: t[`${n}__inline-wrapper--width-${e}`],
|
|
28
|
+
widthStyle: void 0
|
|
24
29
|
} : e !== void 0 ? {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} : { overlaySizeClass: void 0, inlineSizeClass: void 0, sizeStyle: void 0 };
|
|
30
|
+
...r,
|
|
31
|
+
widthStyle: { [L("width")]: e }
|
|
32
|
+
} : r;
|
|
29
33
|
}
|
|
30
|
-
|
|
34
|
+
function Ne(e, i) {
|
|
35
|
+
if (!(i !== "bottom" || e === void 0))
|
|
36
|
+
return { [L("height")]: e };
|
|
37
|
+
}
|
|
38
|
+
const d = ({
|
|
31
39
|
children: e,
|
|
32
|
-
className:
|
|
33
|
-
padding:
|
|
34
|
-
onOpenChange:
|
|
35
|
-
open:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
className: i,
|
|
41
|
+
padding: r = "md",
|
|
42
|
+
onOpenChange: c,
|
|
43
|
+
open: l,
|
|
44
|
+
width: p,
|
|
45
|
+
height: u,
|
|
46
|
+
dismissible: P = !0,
|
|
47
|
+
closeButtonAriaLabel: w = "Close panel",
|
|
48
|
+
kind: o = "overlay",
|
|
49
|
+
position: y,
|
|
50
|
+
divider: q = !0,
|
|
51
|
+
dividerColor: v,
|
|
52
|
+
backgroundColor: C,
|
|
53
|
+
isAnimated: N = !0,
|
|
54
|
+
onBeforeClose: G,
|
|
55
|
+
modalType: f,
|
|
56
|
+
offset: O,
|
|
57
|
+
resizable: U,
|
|
58
|
+
id: S,
|
|
59
|
+
..._
|
|
50
60
|
}) => {
|
|
51
|
-
const
|
|
61
|
+
const s = pe(y), m = we(U, s), X = !!m, { container: $, triggerRef: Y, ...b } = _, a = o === "overlay" ? $ : void 0;
|
|
52
62
|
if (process.env.NODE_ENV !== "production") {
|
|
53
|
-
|
|
63
|
+
m && !m.storageKey && console.warn(
|
|
54
64
|
"Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."
|
|
55
|
-
),
|
|
65
|
+
), f === "alert" && P && console.warn(
|
|
56
66
|
'Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'
|
|
57
67
|
);
|
|
58
|
-
const { closeOnOutsidePress:
|
|
59
|
-
if (
|
|
68
|
+
const { closeOnOutsidePress: ie } = _;
|
|
69
|
+
if (ie && f !== "nonModal" && f !== void 0 && console.warn(
|
|
60
70
|
'Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'
|
|
61
|
-
),
|
|
71
|
+
), $ && o === "inline" && console.warn('Panel: `container` has no effect when `kind="inline"`.'), a)
|
|
62
72
|
try {
|
|
63
73
|
if (typeof getComputedStyle == "function") {
|
|
64
|
-
const
|
|
65
|
-
|
|
74
|
+
const h = getComputedStyle(a);
|
|
75
|
+
h.position === "static" && console.warn(
|
|
66
76
|
"Panel: container element should have `position: relative` (or another non-static value) for proper scoping."
|
|
67
77
|
);
|
|
68
|
-
const g =
|
|
78
|
+
const g = s === "bottom" ? h.overflowY : h.overflowX;
|
|
69
79
|
(g === "visible" || g === "auto" || g === "scroll") && console.warn(
|
|
70
80
|
"Panel: container element should use `overflow: hidden` (or `clip`) so the slide-in/out transform does not trigger a transient scrollbar."
|
|
71
81
|
);
|
|
@@ -73,83 +83,88 @@ const m = ({
|
|
|
73
83
|
} catch {
|
|
74
84
|
}
|
|
75
85
|
}
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
n
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
),
|
|
86
|
+
const I = f === "alert" ? !1 : P, { overlayWidthClass: J, inlineWidthClass: Q, widthStyle: W } = Ce(
|
|
87
|
+
p,
|
|
88
|
+
s
|
|
89
|
+
), E = Ne(u, s), M = W || E ? { ...W, ...E } : void 0, x = o === "overlay" && O ? fe(O) : void 0, z = !!x, D = F(
|
|
90
|
+
t[n],
|
|
91
|
+
t[`${n}--${o}`],
|
|
92
|
+
o === "overlay" && J,
|
|
93
|
+
t[`${n}--padding-${r}`],
|
|
94
|
+
t[`${n}--position-${s}`],
|
|
95
|
+
z && t[`${n}--floating`],
|
|
96
|
+
X && t[`${n}--resizable`],
|
|
97
|
+
o === "overlay" && a && t[`${n}--contained`],
|
|
98
|
+
i
|
|
99
|
+
), Z = F(
|
|
100
|
+
t[`${n}__inline-wrapper`],
|
|
101
|
+
Q
|
|
102
|
+
), { requestClose: B, handleOverlayOpenChange: k } = me(
|
|
103
|
+
G,
|
|
104
|
+
c
|
|
105
|
+
), H = V(
|
|
93
106
|
() => ({
|
|
94
107
|
kind: o,
|
|
95
|
-
dismissible:
|
|
96
|
-
closeButtonAriaLabel:
|
|
97
|
-
position:
|
|
98
|
-
requestClose:
|
|
108
|
+
dismissible: I,
|
|
109
|
+
closeButtonAriaLabel: w,
|
|
110
|
+
position: y,
|
|
111
|
+
requestClose: B,
|
|
112
|
+
backgroundColor: C,
|
|
113
|
+
dividerColor: v
|
|
99
114
|
}),
|
|
100
|
-
[o,
|
|
101
|
-
), { showDivider:
|
|
102
|
-
() => ({ duration:
|
|
103
|
-
[
|
|
104
|
-
),
|
|
105
|
-
return
|
|
106
|
-
|
|
115
|
+
[o, I, w, y, B, C, v]
|
|
116
|
+
), { showDivider: ee, dividerBefore: oe, dividerInner: te, dividerAfter: ne } = ve(q && !z, s), T = V(
|
|
117
|
+
() => ({ duration: N ? de : 0 }),
|
|
118
|
+
[N]
|
|
119
|
+
), A = j(o), se = j(a), K = A !== void 0 && A !== o && l === !0 || se === null && a != null && l === !0;
|
|
120
|
+
return a === null ? null : o === "inline" ? /* @__PURE__ */ R(
|
|
121
|
+
ye,
|
|
107
122
|
{
|
|
108
|
-
contextValue:
|
|
109
|
-
panelClassName:
|
|
110
|
-
inlineWrapperClassName:
|
|
111
|
-
resolvedPosition:
|
|
112
|
-
dividerBefore:
|
|
113
|
-
dividerInner:
|
|
114
|
-
dividerAfter:
|
|
115
|
-
dividerColor:
|
|
116
|
-
open:
|
|
117
|
-
transitionConfig:
|
|
118
|
-
resizeConfig:
|
|
119
|
-
skipMountAnimation:
|
|
120
|
-
|
|
121
|
-
id:
|
|
122
|
-
...
|
|
123
|
+
contextValue: H,
|
|
124
|
+
panelClassName: D,
|
|
125
|
+
inlineWrapperClassName: Z,
|
|
126
|
+
resolvedPosition: s,
|
|
127
|
+
dividerBefore: oe,
|
|
128
|
+
dividerInner: te,
|
|
129
|
+
dividerAfter: ne,
|
|
130
|
+
dividerColor: v,
|
|
131
|
+
open: l,
|
|
132
|
+
transitionConfig: T,
|
|
133
|
+
resizeConfig: m,
|
|
134
|
+
skipMountAnimation: K,
|
|
135
|
+
cssVarStyle: M,
|
|
136
|
+
id: S,
|
|
137
|
+
...b,
|
|
123
138
|
children: e
|
|
124
139
|
}
|
|
125
|
-
) : /* @__PURE__ */
|
|
126
|
-
|
|
140
|
+
) : /* @__PURE__ */ R(
|
|
141
|
+
he,
|
|
127
142
|
{
|
|
128
|
-
contextValue:
|
|
129
|
-
panelClassName:
|
|
130
|
-
resolvedPosition:
|
|
131
|
-
showDivider:
|
|
132
|
-
dividerColor:
|
|
133
|
-
modalType:
|
|
134
|
-
floatingOffset:
|
|
135
|
-
open:
|
|
136
|
-
onOpenChange:
|
|
137
|
-
transitionConfig:
|
|
138
|
-
resizeConfig:
|
|
139
|
-
skipMountAnimation:
|
|
140
|
-
|
|
141
|
-
id:
|
|
142
|
-
...
|
|
143
|
-
container:
|
|
144
|
-
triggerRef:
|
|
143
|
+
contextValue: H,
|
|
144
|
+
panelClassName: D,
|
|
145
|
+
resolvedPosition: s,
|
|
146
|
+
showDivider: ee,
|
|
147
|
+
dividerColor: v,
|
|
148
|
+
modalType: f,
|
|
149
|
+
floatingOffset: x,
|
|
150
|
+
open: l,
|
|
151
|
+
onOpenChange: k,
|
|
152
|
+
transitionConfig: T,
|
|
153
|
+
resizeConfig: m,
|
|
154
|
+
skipMountAnimation: K,
|
|
155
|
+
cssVarStyle: M,
|
|
156
|
+
id: S,
|
|
157
|
+
...b,
|
|
158
|
+
container: a,
|
|
159
|
+
triggerRef: Y,
|
|
145
160
|
children: e
|
|
146
161
|
}
|
|
147
162
|
);
|
|
148
163
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
164
|
+
d.displayName = "Panel";
|
|
165
|
+
d.Header = ae;
|
|
166
|
+
d.Body = le;
|
|
167
|
+
d.Footer = ce;
|
|
153
168
|
export {
|
|
154
|
-
|
|
169
|
+
d as Panel
|
|
155
170
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),o=e=>e==="sm"||e==="md"||e==="lg",a=400;function P(e){return e===!0?{x:"1rem",y:"1rem"}:typeof e=="string"?{x:e,y:e}:{x:e.x,y:e.y}}const d="01",f=e=>e||"
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),o=e=>e==="sm"||e==="md"||e==="lg",a=400;function P(e){return e===!0?{x:"1rem",y:"1rem"}:typeof e=="string"?{x:e,y:e}:{x:e.x,y:e.y}}const d="01",f=e=>e||"start",D=(e,t)=>({showDivider:e,dividerBefore:e&&t!=="start"&&t!=="bottom",dividerInner:e&&t==="bottom",dividerAfter:e&&t==="start"}),_=(e,t)=>{if(e!=="isModal")return e==="alert"?{escapeKey:!1,outsidePress:!1}:{escapeKey:!0,outsidePress:t??!0}},v=e=>e==="escape-key"?"escapeKey":e==="outside-press"?"outsidePress":"programmatic",y=(e,t)=>{const i=c.useCallback(l=>{if(!e){t==null||t(!1);return}const r=e(l);r instanceof Promise?r.then(s=>{s&&(t==null||t(!1))}).catch(s=>{process.env.NODE_ENV!=="production"&&console.warn("Panel: `onBeforeClose` rejected; close cancelled (panel stays open). If this was not intentional, handle the error inside `onBeforeClose`.",s)}):r&&(t==null||t(!1))},[e,t]),u=c.useCallback((l,r,s)=>{l?t==null||t(!0):i(v(s))},[t,i]);return{requestClose:i,handleOverlayOpenChange:u}};exports.DEFAULT_PANEL_DIVIDER_COLOR=d;exports.PANEL_TRANSITION_DURATION_MS=a;exports.getPanelDismissConfig=_;exports.getPanelDividerState=D;exports.getResolvedPanelPosition=f;exports.isPresetWidth=o;exports.resolveOffset=P;exports.usePanelClose=y;
|