@viasat/beam-react 2.29.1 → 2.36.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/ActionList.css +1 -1
- package/assets/Avatar.css +1 -1
- package/assets/Badge.css +1 -1
- package/assets/Button.css +1 -1
- package/assets/Checkbox.css +1 -1
- package/assets/Chip.css +1 -1
- package/assets/ChipGroup.css +1 -1
- package/assets/CloseButton.css +1 -1
- package/assets/DateField.css +1 -0
- package/assets/EmptyState.css +1 -1
- package/assets/{floatingui.css → FloatingUI.css} +1 -1
- package/assets/InputChoiceGroup.css +1 -1
- package/assets/Link.css +1 -1
- package/assets/NativeSelect.css +1 -1
- package/assets/Pagination.css +1 -1
- package/assets/ProgressBar.css +1 -1
- package/assets/RadioButton.css +1 -1
- package/assets/Search.css +1 -1
- package/assets/SpinnerWrap.css +1 -1
- package/assets/Switch.css +1 -1
- package/assets/TextArea.css +1 -1
- package/assets/TextField.css +1 -1
- package/assets/card.css +1 -1
- package/assets/combobox.css +1 -1
- package/assets/fileUpload.css +1 -1
- package/assets/header.css +1 -1
- package/assets/index.css +1 -1
- package/assets/panel.css +1 -1
- package/assets/segmentedControl.css +1 -1
- package/assets/slider.css +1 -1
- package/assets/stepper.css +1 -1
- package/chunks/DateField.Segment.7oCeBSNo.js +1 -0
- package/chunks/DateField.Segment.DbjGMAPP.js +99 -0
- package/chunks/FloatingUI.arrow.DFhYQv_F.js +1 -0
- package/chunks/FloatingUI.arrow.tN5_IctZ.js +27 -0
- package/chunks/panel.module.BVmRxZHo.js +1 -0
- package/chunks/{panel.module.BblnuBjO.js → panel.module.CnHWv4EZ.js} +1 -3
- package/index.cjs.js +1 -1
- package/index.es.js +35 -33
- package/lib/ActionList/ActionList.Group.d.ts +1 -1
- package/lib/Autocomplete/Autocomplete.cjs.js +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +5 -5
- package/lib/Autocomplete/Autocomplete.es.js +296 -268
- package/lib/Autocomplete/AutocompleteDropdown.cjs.js +1 -1
- package/lib/Autocomplete/AutocompleteDropdown.es.js +15 -12
- package/lib/FloatingUI/FloatingUI.arrow.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.arrow.es.js +6 -17
- package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.es.js +17 -18
- package/lib/Search/SearchDropdown.cjs.js +1 -1
- package/lib/Search/SearchDropdown.es.js +1 -1
- package/lib/Select/Select.cjs.js +1 -1
- package/lib/Select/Select.d.ts +3 -2
- package/lib/Select/Select.es.js +208 -195
- package/lib/Select/SelectDropdown.cjs.js +1 -1
- package/lib/Select/SelectDropdown.es.js +15 -12
- package/lib/_Options/Option.cjs.js +1 -1
- package/lib/_Options/Option.context.cjs.js +1 -1
- package/lib/_Options/Option.context.d.ts +31 -13
- package/lib/_Options/Option.context.es.js +133 -88
- package/lib/_Options/Option.es.js +23 -21
- package/lib/_Options/Option.types.d.ts +23 -0
- package/lib/_Options/OptionGroup.cjs.js +1 -0
- package/lib/_Options/OptionGroup.context.cjs.js +1 -0
- package/lib/_Options/OptionGroup.context.d.ts +6 -0
- package/lib/_Options/OptionGroup.context.es.js +6 -0
- package/lib/_Options/OptionGroup.d.ts +3 -0
- package/lib/_Options/OptionGroup.es.js +22 -0
- package/lib/_Options/getLastVisibleStructureIndex.cjs.js +1 -0
- package/lib/_Options/getLastVisibleStructureIndex.d.ts +15 -0
- package/lib/_Options/getLastVisibleStructureIndex.es.js +14 -0
- package/lib/_Options/index.cjs.js +1 -1
- package/lib/_Options/index.d.ts +4 -0
- package/lib/_Options/index.es.js +13 -4
- package/lib/_Options/useRenderOption.cjs.js +1 -0
- package/lib/_Options/useRenderOption.d.ts +30 -0
- package/lib/_Options/useRenderOption.es.js +43 -0
- package/lib/index.cjs.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.es.js +27 -25
- package/lib/wip/DateField/DateField.Segment.cjs.js +1 -0
- package/lib/wip/DateField/DateField.Segment.d.ts +2 -0
- package/lib/wip/DateField/DateField.Segment.es.js +8 -0
- package/lib/wip/DateField/DateField.Segments.cjs.js +1 -0
- package/lib/wip/DateField/DateField.Segments.d.ts +17 -0
- package/lib/wip/DateField/DateField.Segments.es.js +61 -0
- package/lib/wip/DateField/DateField.cjs.js +1 -0
- package/lib/wip/DateField/DateField.d.ts +3 -0
- package/lib/wip/DateField/DateField.es.js +191 -0
- package/lib/wip/DateField/DateField.types.cjs.js +1 -0
- package/lib/wip/DateField/DateField.types.d.ts +118 -0
- package/lib/wip/DateField/DateField.types.es.js +1 -0
- package/lib/wip/DateField/DateField.utils.cjs.js +1 -0
- package/lib/wip/DateField/DateField.utils.d.ts +26 -0
- package/lib/wip/DateField/DateField.utils.es.js +45 -0
- package/lib/wip/DateField/DateField.validation.cjs.js +1 -0
- package/lib/wip/DateField/DateField.validation.d.ts +26 -0
- package/lib/wip/DateField/DateField.validation.es.js +24 -0
- package/lib/wip/DateField/index.cjs.js +1 -0
- package/lib/wip/DateField/index.d.ts +2 -0
- package/lib/wip/DateField/index.es.js +4 -0
- package/lib/wip/DateField/useDateFieldFocus.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldFocus.d.ts +23 -0
- package/lib/wip/DateField/useDateFieldFocus.es.js +65 -0
- package/lib/wip/DateField/useDateFieldForm.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldForm.d.ts +32 -0
- package/lib/wip/DateField/useDateFieldForm.es.js +51 -0
- package/lib/wip/DateField/useDateFieldSegments.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldSegments.d.ts +7 -0
- package/lib/wip/DateField/useDateFieldSegments.es.js +13 -0
- package/lib/wip/DateField/useDateFieldValidity.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldValidity.d.ts +23 -0
- package/lib/wip/DateField/useDateFieldValidity.es.js +19 -0
- package/lib/wip/DateField/useDateFieldValue.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldValue.d.ts +19 -0
- package/lib/wip/DateField/useDateFieldValue.es.js +62 -0
- package/lib/wip/DateField/useInvalidState.cjs.js +1 -0
- package/lib/wip/DateField/useInvalidState.d.ts +13 -0
- package/lib/wip/DateField/useInvalidState.es.js +8 -0
- package/lib/wip/Panel/Footer/Panel.Footer.Actions.cjs.js +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.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentAfter.cjs.js +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.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Description.cjs.js +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.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.es.js +1 -1
- package/lib/wip/Panel/Panel.Body.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Body.es.js +1 -1
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.d.ts +5 -1
- package/lib/wip/Panel/Panel.Inline.es.js +54 -47
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +20 -2
- package/lib/wip/Panel/Panel.Overlay.es.js +117 -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.d.ts +1 -1
- package/lib/wip/Panel/Panel.es.js +139 -100
- 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 +37 -35
- package/lib/wip/Panel/Panel.types.d.ts +64 -10
- package/lib/wip/Panel/Panel.useResize.cjs.js +1 -1
- package/lib/wip/Panel/Panel.useResize.d.ts +3 -1
- package/lib/wip/Panel/Panel.useResize.es.js +34 -30
- package/package.json +6 -6
- package/utils/hooks/index.cjs.js +1 -1
- package/utils/hooks/index.d.ts +1 -0
- package/utils/hooks/index.es.js +12 -10
- package/utils/hooks/useElementResize.cjs.js +1 -1
- package/utils/hooks/useElementResize.d.ts +1 -1
- package/utils/hooks/useElementResize.es.js +33 -33
- package/utils/hooks/usePrevious.cjs.js +1 -0
- package/utils/hooks/usePrevious.d.ts +5 -0
- package/utils/hooks/usePrevious.es.js +10 -0
- package/chunks/floatingui.module.BcBFebz0.js +0 -10
- package/chunks/floatingui.module.D3Aw_aYe.js +0 -1
- package/chunks/panel.module.CVyUzyCZ.js +0 -1
|
@@ -3,7 +3,7 @@ import e from "clsx";
|
|
|
3
3
|
import { g as l } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
5
|
import { Box as p } from "../../Box/Box.es.js";
|
|
6
|
-
import { s as i } from "../../../chunks/panel.module.
|
|
6
|
+
import { s as i } from "../../../chunks/panel.module.CnHWv4EZ.js";
|
|
7
7
|
const { subElementClassPrefix: n } = l("panel"), c = `${n}body`, f = ({
|
|
8
8
|
children: s,
|
|
9
9
|
className: o,
|
|
@@ -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"),b=require("@floating-ui/react"),F=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.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.BVmRxZHo.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,sizeStyle: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,sizeStyle: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,sizeStyle:d,...g,children:s})})});exports.InlinePanel=D;
|
|
@@ -14,6 +14,10 @@ type InlinePanelProps = {
|
|
|
14
14
|
children: React.ReactNode;
|
|
15
15
|
dividerColor?: PanelDividerColor;
|
|
16
16
|
resizeConfig?: PanelResizeConfig;
|
|
17
|
+
/** Forwarded from Panel: CSS custom-property override for the panel size. */
|
|
18
|
+
sizeStyle?: React.CSSProperties;
|
|
19
|
+
/** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
|
|
20
|
+
skipMountAnimation?: boolean;
|
|
17
21
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
18
|
-
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig, sizeStyle, skipMountAnimation, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
23
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTransitionStatus as
|
|
3
|
-
import { g as
|
|
1
|
+
import { jsx as t, jsxs as x, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { useTransitionStatus as y } from "@floating-ui/react";
|
|
3
|
+
import { g as P } 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 { InlineDivider as
|
|
9
|
-
import { PanelResizeHandle as
|
|
10
|
-
import { usePanelResize as
|
|
11
|
-
import { s as
|
|
12
|
-
const { baseClassNamePrefix:
|
|
13
|
-
children:
|
|
5
|
+
import { PanelContext as U } from "./Panel.context.es.js";
|
|
6
|
+
import { FloatingUIRoot as b } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
7
|
+
import { a as j } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
8
|
+
import { InlineDivider as h } from "./Panel.Divider.es.js";
|
|
9
|
+
import { PanelResizeHandle as B } from "./Panel.ResizeHandle.es.js";
|
|
10
|
+
import { usePanelResize as M } from "./Panel.useResize.es.js";
|
|
11
|
+
import { s as S } from "../../../chunks/panel.module.CnHWv4EZ.js";
|
|
12
|
+
const { baseClassNamePrefix: _ } = P("panel"), z = ({
|
|
13
|
+
children: i,
|
|
14
14
|
panelClassName: o,
|
|
15
15
|
inlineWrapperClassName: r,
|
|
16
16
|
resolvedPosition: n,
|
|
@@ -18,44 +18,47 @@ const { baseClassNamePrefix: M } = w("panel"), S = ({
|
|
|
18
18
|
dividerInner: m,
|
|
19
19
|
dividerAfter: p,
|
|
20
20
|
alwaysVisible: e,
|
|
21
|
+
skipMountAnimation: f,
|
|
21
22
|
dividerColor: a,
|
|
22
|
-
resizeConfig:
|
|
23
|
-
|
|
23
|
+
resizeConfig: s,
|
|
24
|
+
sizeStyle: c,
|
|
25
|
+
...u
|
|
24
26
|
}) => {
|
|
25
27
|
const {
|
|
26
|
-
context:
|
|
27
|
-
transitionConfig:
|
|
28
|
-
refs:
|
|
29
|
-
} =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
),
|
|
33
|
-
resizeConfig:
|
|
28
|
+
context: d,
|
|
29
|
+
transitionConfig: g,
|
|
30
|
+
refs: I
|
|
31
|
+
} = j(), { isMounted: R, status: N } = y(
|
|
32
|
+
d,
|
|
33
|
+
g
|
|
34
|
+
), C = (e || f) && N === "initial" ? "open" : N, { handleRef: F } = M({
|
|
35
|
+
resizeConfig: s,
|
|
34
36
|
position: n,
|
|
35
|
-
floatingRef:
|
|
37
|
+
floatingRef: I.floating
|
|
36
38
|
});
|
|
37
|
-
return
|
|
38
|
-
l && /* @__PURE__ */ t(
|
|
39
|
+
return R ? /* @__PURE__ */ x(w, { children: [
|
|
40
|
+
l && /* @__PURE__ */ t(h, { position: n, dividerColor: a }),
|
|
39
41
|
/* @__PURE__ */ t(
|
|
40
42
|
"div",
|
|
41
43
|
{
|
|
42
|
-
ref:
|
|
44
|
+
ref: I.setFloating,
|
|
43
45
|
className: r,
|
|
44
46
|
"data-position": n,
|
|
45
|
-
"data-status":
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
i
|
|
47
|
+
"data-status": C,
|
|
48
|
+
style: c,
|
|
49
|
+
children: /* @__PURE__ */ x("div", { className: S[`${_}__inline-wrapper-content`], children: [
|
|
50
|
+
m && /* @__PURE__ */ t(h, { position: n, dividerColor: a }),
|
|
51
|
+
/* @__PURE__ */ x("aside", { ...u, className: o, children: [
|
|
52
|
+
i,
|
|
53
|
+
s && /* @__PURE__ */ t(B, { ref: F })
|
|
51
54
|
] })
|
|
52
55
|
] })
|
|
53
56
|
}
|
|
54
57
|
),
|
|
55
|
-
p && /* @__PURE__ */ t(
|
|
58
|
+
p && /* @__PURE__ */ t(h, { position: n, dividerColor: a })
|
|
56
59
|
] }) : null;
|
|
57
|
-
},
|
|
58
|
-
contextValue:
|
|
60
|
+
}, J = ({
|
|
61
|
+
contextValue: i,
|
|
59
62
|
panelClassName: o,
|
|
60
63
|
inlineWrapperClassName: r,
|
|
61
64
|
resolvedPosition: n,
|
|
@@ -63,19 +66,21 @@ const { baseClassNamePrefix: M } = w("panel"), S = ({
|
|
|
63
66
|
dividerInner: m,
|
|
64
67
|
dividerAfter: p,
|
|
65
68
|
open: e,
|
|
66
|
-
transitionConfig:
|
|
67
|
-
dividerColor:
|
|
68
|
-
children:
|
|
69
|
+
transitionConfig: f,
|
|
70
|
+
dividerColor: a,
|
|
71
|
+
children: s,
|
|
69
72
|
resizeConfig: c,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
sizeStyle: u,
|
|
74
|
+
skipMountAnimation: d,
|
|
75
|
+
...g
|
|
76
|
+
}) => /* @__PURE__ */ t(U.Provider, { value: i, children: /* @__PURE__ */ t(
|
|
77
|
+
b,
|
|
73
78
|
{
|
|
74
79
|
open: e ?? !0,
|
|
75
80
|
portalled: !1,
|
|
76
|
-
transitionConfig:
|
|
81
|
+
transitionConfig: f,
|
|
77
82
|
children: /* @__PURE__ */ t(
|
|
78
|
-
|
|
83
|
+
z,
|
|
79
84
|
{
|
|
80
85
|
panelClassName: o,
|
|
81
86
|
inlineWrapperClassName: r,
|
|
@@ -83,15 +88,17 @@ const { baseClassNamePrefix: M } = w("panel"), S = ({
|
|
|
83
88
|
dividerBefore: l,
|
|
84
89
|
dividerInner: m,
|
|
85
90
|
dividerAfter: p,
|
|
86
|
-
dividerColor:
|
|
91
|
+
dividerColor: a,
|
|
87
92
|
alwaysVisible: e === void 0,
|
|
93
|
+
skipMountAnimation: d,
|
|
88
94
|
resizeConfig: c,
|
|
89
|
-
|
|
90
|
-
|
|
95
|
+
sizeStyle: u,
|
|
96
|
+
...g,
|
|
97
|
+
children: s
|
|
91
98
|
}
|
|
92
99
|
)
|
|
93
100
|
}
|
|
94
101
|
) });
|
|
95
102
|
export {
|
|
96
|
-
|
|
103
|
+
J as InlinePanel
|
|
97
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),M=require("clsx"),g=require("react"),h=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const w=require("./Panel.context.cjs.js"),S=require("./Panel.helpers.cjs.js"),k=require("../../FloatingUI/FloatingUI.root.cjs.js"),D=require("../../FloatingUI/FloatingUI.content.cjs.js"),B=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),$=require("./Panel.Divider.cjs.js"),z=require("./Panel.ResizeHandle.cjs.js"),A=require("./Panel.useResize.cjs.js"),p=require("../../../chunks/panel.module.BVmRxZHo.js"),{baseClassNamePrefix:C,variable:f}=h.getBEMClassNames("panel");function H(s,t,e){if(!(!s&&!t&&!e))return{...s,...t,...e?{[f("offset-x")]:e.x,[f("offset-y")]:e.y}:null}}const R=({children:s,panelClassName:t,resolvedPosition:e,showDivider:c,dividerColor:l,resizeConfig:a,floatingOffset:_,overlayDividerClassName:d,isBlocking:P,sizeStyle:v,skipMountAnimation:x,container:u,style:q,...b})=>{const{refs:y}=B.useBmFloatingUIContext(),{handleRef:r}=A.usePanelResize({resizeConfig:a,position:e,floatingRef:y.floating,requireMount:!0,container:u}),n=H(q,v,_);return i.jsxs(D.Content,{className:t,skipFloatingStyles:!0,overlay:P?u?{lockScroll:!1}:!0:!1,...b,style:n,"data-position":e,...x?{"data-status":"open"}:{},children:[s,c&&i.jsx($.InlineDivider,{position:e,className:d,dividerColor:l}),a&&i.jsx(z.PanelResizeHandle,{ref:r})]})},E=({contextValue:s,panelClassName:t,resolvedPosition:e,showDivider:c,modalType:l,closeOnOutsidePress:a,floatingOffset:_,open:d,onOpenChange:P,transitionConfig:v,dividerColor:x,children:u,resizeConfig:q,sizeStyle:b,skipMountAnimation:y,container:r,triggerRef:n,...j})=>{const m=l==="isModal"||l==="alert",I=g.useCallback(o=>{const F=(n==null?void 0:n.current)??null;return!(F&&o.target instanceof Node&&F.contains(o.target))},[n]),U=g.useMemo(()=>{const o=S.getPanelDismissConfig(l,a);return!n||!(l==="isModal"||l!=="alert"&&!!a)?o:{...o??{},outsidePress:I}},[l,a,n,I]),N=M(p.styles[`${C}__overlay-divider`],p.styles[`${C}__overlay-divider--${e}`]);return i.jsx(w.PanelContext.Provider,{value:s,children:i.jsx(k.FloatingUIRoot,{open:d,onOpenChange:P,portalled:r?{root:r}:!0,transitionConfig:v,dismiss:U,focusConfiguration:m?!0:{modal:!1,closeOnFocusOut:!1},children:i.jsx(R,{panelClassName:t,resolvedPosition:e,showDivider:c,dividerColor:x,floatingOffset:_,overlayDividerClassName:N,isBlocking:m,resizeConfig:q,sizeStyle:b,skipMountAnimation:y,container:r,...j,role:l==="alert"?"alertdialog":"dialog","aria-modal":m||void 0,children:u})})})};exports.OverlayPanel=E;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UseTransitionStylesProps } from '@floating-ui/react';
|
|
2
|
+
import { ComponentPropsWithoutRef, CSSProperties, RefObject } from 'react';
|
|
2
3
|
import { PanelDividerColor, PanelModalType, PanelPosition, PanelResizeConfig, ResolvedPanelOffset } from './Panel.types';
|
|
3
4
|
import { PanelContextValue } from './Panel.context';
|
|
4
5
|
import { FloatingUIProps } from '../../FloatingUI/FloatingUI.context';
|
|
@@ -16,6 +17,23 @@ type OverlayPanelProps = {
|
|
|
16
17
|
children: React.ReactNode;
|
|
17
18
|
dividerColor?: PanelDividerColor;
|
|
18
19
|
resizeConfig?: PanelResizeConfig;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
/** Forwarded from Panel: CSS custom-property override for the panel size. */
|
|
21
|
+
sizeStyle?: CSSProperties;
|
|
22
|
+
/** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
|
|
23
|
+
skipMountAnimation?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Portal target; when set, panel renders inside this element using position: absolute.
|
|
26
|
+
* `undefined` means no container (full-screen). A pending container is handled upstream:
|
|
27
|
+
* Panel returns null before reaching here, so this is never `null`.
|
|
28
|
+
*/
|
|
29
|
+
container?: HTMLElement;
|
|
30
|
+
/**
|
|
31
|
+
* The element that opens the panel; clicks on it are excluded from outside-press
|
|
32
|
+
* dismissal so it can toggle the panel without the close immediately re-firing.
|
|
33
|
+
* Focus returns to the previously-focused element (typically this trigger) on close.
|
|
34
|
+
* No effect on `kind="inline"`.
|
|
35
|
+
*/
|
|
36
|
+
triggerRef?: RefObject<HTMLElement | null>;
|
|
37
|
+
} & ComponentPropsWithoutRef<'aside'>;
|
|
38
|
+
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, floatingOffset, open, onOpenChange, transitionConfig, dividerColor, children, resizeConfig, sizeStyle, skipMountAnimation, container, triggerRef, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
39
|
export {};
|
|
@@ -1,104 +1,141 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as n, jsxs as B } from "react/jsx-runtime";
|
|
2
|
+
import D from "clsx";
|
|
3
|
+
import { useCallback as S, useMemo as $ } from "react";
|
|
4
|
+
import { g } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
5
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { PanelContext as
|
|
6
|
-
import { getPanelDismissConfig as
|
|
7
|
-
import { FloatingUIRoot as
|
|
8
|
-
import { Content as
|
|
9
|
-
import { a as
|
|
10
|
-
import { InlineDivider as
|
|
11
|
-
import { PanelResizeHandle as
|
|
12
|
-
import { usePanelResize as
|
|
13
|
-
import { s as
|
|
14
|
-
const { baseClassNamePrefix:
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
import { PanelContext as j } from "./Panel.context.es.js";
|
|
7
|
+
import { getPanelDismissConfig as A } from "./Panel.helpers.es.js";
|
|
8
|
+
import { FloatingUIRoot as U } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
9
|
+
import { Content as q } from "../../FloatingUI/FloatingUI.content.es.js";
|
|
10
|
+
import { a as E } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
11
|
+
import { InlineDivider as H } from "./Panel.Divider.es.js";
|
|
12
|
+
import { PanelResizeHandle as w } from "./Panel.ResizeHandle.es.js";
|
|
13
|
+
import { usePanelResize as z } from "./Panel.useResize.es.js";
|
|
14
|
+
import { s as h } from "../../../chunks/panel.module.CnHWv4EZ.js";
|
|
15
|
+
const { baseClassNamePrefix: k, variable: F } = g("panel");
|
|
16
|
+
function G(s, e, o) {
|
|
17
|
+
if (!(!s && !e && !o))
|
|
18
|
+
return {
|
|
19
|
+
...s,
|
|
20
|
+
...e,
|
|
21
|
+
...o ? {
|
|
22
|
+
[F("offset-x")]: o.x,
|
|
23
|
+
[F("offset-y")]: o.y
|
|
24
|
+
} : null
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const J = ({
|
|
28
|
+
children: s,
|
|
29
|
+
panelClassName: e,
|
|
17
30
|
resolvedPosition: o,
|
|
18
|
-
showDivider:
|
|
19
|
-
dividerColor:
|
|
20
|
-
resizeConfig:
|
|
21
|
-
floatingOffset:
|
|
22
|
-
overlayDividerClassName:
|
|
23
|
-
isBlocking:
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
showDivider: u,
|
|
32
|
+
dividerColor: t,
|
|
33
|
+
resizeConfig: a,
|
|
34
|
+
floatingOffset: c,
|
|
35
|
+
overlayDividerClassName: f,
|
|
36
|
+
isBlocking: d,
|
|
37
|
+
sizeStyle: p,
|
|
38
|
+
skipMountAnimation: v,
|
|
39
|
+
container: m,
|
|
40
|
+
style: x,
|
|
41
|
+
...C
|
|
26
42
|
}) => {
|
|
27
|
-
const { refs:
|
|
28
|
-
resizeConfig:
|
|
43
|
+
const { refs: y } = E(), { handleRef: l } = z({
|
|
44
|
+
resizeConfig: a,
|
|
29
45
|
position: o,
|
|
30
|
-
floatingRef:
|
|
31
|
-
requireMount: !0
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} : s;
|
|
37
|
-
return /* @__PURE__ */ P(
|
|
38
|
-
D,
|
|
46
|
+
floatingRef: y.floating,
|
|
47
|
+
requireMount: !0,
|
|
48
|
+
container: m
|
|
49
|
+
}), r = G(x, p, c);
|
|
50
|
+
return /* @__PURE__ */ B(
|
|
51
|
+
q,
|
|
39
52
|
{
|
|
40
|
-
className:
|
|
53
|
+
className: e,
|
|
41
54
|
skipFloatingStyles: !0,
|
|
42
|
-
overlay:
|
|
43
|
-
...
|
|
44
|
-
style:
|
|
55
|
+
overlay: d ? m ? { lockScroll: !1 } : !0 : !1,
|
|
56
|
+
...C,
|
|
57
|
+
style: r,
|
|
45
58
|
"data-position": o,
|
|
59
|
+
...v ? { "data-status": "open" } : {},
|
|
46
60
|
children: [
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
s,
|
|
62
|
+
u && /* @__PURE__ */ n(
|
|
63
|
+
H,
|
|
64
|
+
{
|
|
65
|
+
position: o,
|
|
66
|
+
className: f,
|
|
67
|
+
dividerColor: t
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
a && /* @__PURE__ */ n(w, { ref: l })
|
|
50
71
|
]
|
|
51
72
|
}
|
|
52
73
|
);
|
|
53
|
-
},
|
|
54
|
-
contextValue:
|
|
55
|
-
panelClassName:
|
|
74
|
+
}, so = ({
|
|
75
|
+
contextValue: s,
|
|
76
|
+
panelClassName: e,
|
|
56
77
|
resolvedPosition: o,
|
|
57
|
-
showDivider:
|
|
58
|
-
modalType:
|
|
59
|
-
closeOnOutsidePress:
|
|
60
|
-
floatingOffset:
|
|
61
|
-
open:
|
|
62
|
-
onOpenChange:
|
|
63
|
-
transitionConfig:
|
|
64
|
-
dividerColor:
|
|
65
|
-
children:
|
|
66
|
-
resizeConfig:
|
|
67
|
-
|
|
78
|
+
showDivider: u,
|
|
79
|
+
modalType: t,
|
|
80
|
+
closeOnOutsidePress: a,
|
|
81
|
+
floatingOffset: c,
|
|
82
|
+
open: f,
|
|
83
|
+
onOpenChange: d,
|
|
84
|
+
transitionConfig: p,
|
|
85
|
+
dividerColor: v,
|
|
86
|
+
children: m,
|
|
87
|
+
resizeConfig: x,
|
|
88
|
+
sizeStyle: C,
|
|
89
|
+
skipMountAnimation: y,
|
|
90
|
+
container: l,
|
|
91
|
+
triggerRef: r,
|
|
92
|
+
...I
|
|
68
93
|
}) => {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
94
|
+
const N = t === "isModal" || t === "alert", M = S(
|
|
95
|
+
(i) => {
|
|
96
|
+
const P = (r == null ? void 0 : r.current) ?? null;
|
|
97
|
+
return !(P && i.target instanceof Node && P.contains(i.target));
|
|
98
|
+
},
|
|
99
|
+
[r]
|
|
100
|
+
), _ = $(() => {
|
|
101
|
+
const i = A(t, a);
|
|
102
|
+
return !r || !(t === "isModal" || t !== "alert" && !!a) ? i : { ...i ?? {}, outsidePress: M };
|
|
103
|
+
}, [t, a, r, M]), b = D(
|
|
104
|
+
h[`${k}__overlay-divider`],
|
|
105
|
+
h[`${k}__overlay-divider--${o}`]
|
|
72
106
|
);
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
|
|
107
|
+
return /* @__PURE__ */ n(j.Provider, { value: s, children: /* @__PURE__ */ n(
|
|
108
|
+
U,
|
|
75
109
|
{
|
|
76
|
-
open:
|
|
77
|
-
onOpenChange:
|
|
78
|
-
portalled: !0,
|
|
79
|
-
transitionConfig:
|
|
80
|
-
dismiss:
|
|
81
|
-
focusConfiguration:
|
|
82
|
-
children: /* @__PURE__ */
|
|
83
|
-
|
|
110
|
+
open: f,
|
|
111
|
+
onOpenChange: d,
|
|
112
|
+
portalled: l ? { root: l } : !0,
|
|
113
|
+
transitionConfig: p,
|
|
114
|
+
dismiss: _,
|
|
115
|
+
focusConfiguration: N ? !0 : { modal: !1, closeOnFocusOut: !1 },
|
|
116
|
+
children: /* @__PURE__ */ n(
|
|
117
|
+
J,
|
|
84
118
|
{
|
|
85
|
-
panelClassName:
|
|
119
|
+
panelClassName: e,
|
|
86
120
|
resolvedPosition: o,
|
|
87
|
-
showDivider:
|
|
88
|
-
dividerColor:
|
|
89
|
-
floatingOffset:
|
|
90
|
-
overlayDividerClassName:
|
|
91
|
-
isBlocking:
|
|
92
|
-
resizeConfig:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
121
|
+
showDivider: u,
|
|
122
|
+
dividerColor: v,
|
|
123
|
+
floatingOffset: c,
|
|
124
|
+
overlayDividerClassName: b,
|
|
125
|
+
isBlocking: N,
|
|
126
|
+
resizeConfig: x,
|
|
127
|
+
sizeStyle: C,
|
|
128
|
+
skipMountAnimation: y,
|
|
129
|
+
container: l,
|
|
130
|
+
...I,
|
|
131
|
+
role: t === "alert" ? "alertdialog" : "dialog",
|
|
132
|
+
"aria-modal": N || void 0,
|
|
133
|
+
children: m
|
|
97
134
|
}
|
|
98
135
|
)
|
|
99
136
|
}
|
|
100
137
|
) });
|
|
101
138
|
};
|
|
102
139
|
export {
|
|
103
|
-
|
|
140
|
+
so as OverlayPanel
|
|
104
141
|
};
|
|
@@ -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.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.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.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const l=require("../../../chunks/panel.module.BVmRxZHo.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.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { s as o } from "../../../chunks/panel.module.
|
|
5
|
+
import { s as o } from "../../../chunks/panel.module.CnHWv4EZ.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 R=require("react/jsx-runtime"),T=require("clsx"),j=require("react"),ne=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const A=require("../../../utils/hooks/usePrevious.cjs.js"),oe=require("./Header/Panel.Header.cjs.js"),ie=require("./Panel.Body.cjs.js"),te=require("./Footer/Panel.Footer.cjs.js"),r=require("./Panel.helpers.cjs.js"),le=require("./Panel.Inline.cjs.js"),re=require("./Panel.Overlay.cjs.js"),n=require("../../../chunks/panel.module.BVmRxZHo.js"),ae=165,ce=100,ue=(e,f)=>{if(!e)return;const _=f==="bottom",a=typeof e=="object"?e:{},t=a.minSize??(_?ce:ae),y=a.maxSize??1/0,d=a.storageKey??"";return{minSize:t,maxSize:y,storageKey:d}},{baseClassNamePrefix:o,variable:ve}=ne.getBEMClassNames("panel");function de(e){return r.isPresetSize(e)?{overlaySizeClass:n.styles[`${o}--size-${e}`],inlineSizeClass:n.styles[`${o}__inline-wrapper--size-${e}`],sizeStyle:void 0}:e!==void 0?{overlaySizeClass:void 0,inlineSizeClass:void 0,sizeStyle:{[ve("size")]:e}}:{overlaySizeClass:void 0,inlineSizeClass:void 0,sizeStyle:void 0}}const v=({children:e,className:f,padding:_="md",onOpenChange:a,open:t,size:y,dismissible:d=!0,closeButtonAriaLabel:m="Close panel",kind:s="inline",position:P,divider:F=!0,dividerColor:S,isAnimated:C=!0,onBeforeClose:K,modalType:c,offset:w,resizable:L,id:z,...b})=>{const l=r.getResolvedPanelPosition(P),u=ue(L,l),V=!!u,{container:h,triggerRef:W,...N}=b,i=s==="overlay"?h:void 0;if(process.env.NODE_ENV!=="production"){u&&!u.storageKey&&console.warn("Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."),c==="alert"&&d&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');const{closeOnOutsidePress:se}=b;if(se&&c!=="nonModal"&&c!==void 0&&console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'),h&&s==="inline"&&console.warn('Panel: `container` has no effect when `kind="inline"`.'),i)try{if(typeof getComputedStyle=="function"){const p=getComputedStyle(i);p.position==="static"&&console.warn("Panel: container element should have `position: relative` (or another non-static value) for proper scoping.");const g=l==="bottom"?p.overflowY:p.overflowX;(g==="visible"||g==="auto"||g==="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 O=c==="alert"?!1:d,{overlaySizeClass:G,inlineSizeClass:U,sizeStyle:q}=de(y),$=s==="overlay"&&w?r.resolveOffset(w):void 0,I=!!$,M=T(n.styles[o],n.styles[`${o}--${s}`],s==="overlay"&&G,n.styles[`${o}--padding-${_}`],n.styles[`${o}--position-${l}`],I&&n.styles[`${o}--floating`],V&&n.styles[`${o}--resizable`],s==="overlay"&&i&&n.styles[`${o}--contained`],f),X=T(n.styles[`${o}__inline-wrapper`],U),{requestClose:x,handleOverlayOpenChange:Y}=r.usePanelClose(K,a),E=j.useMemo(()=>({kind:s,dismissible:O,closeButtonAriaLabel:m,position:P,requestClose:x}),[s,O,m,P,x]),{showDivider:J,dividerBefore:Q,dividerInner:Z,dividerAfter:k}=r.getPanelDividerState(F&&!I,l),B=j.useMemo(()=>({duration:C?r.PANEL_TRANSITION_DURATION_MS:0}),[C]),D=A.usePrevious(s),ee=A.usePrevious(i),H=D!==void 0&&D!==s&&t===!0||ee===null&&i!=null&&t===!0;return i===null?null:s==="inline"?R.jsx(le.InlinePanel,{contextValue:E,panelClassName:M,inlineWrapperClassName:X,resolvedPosition:l,dividerBefore:Q,dividerInner:Z,dividerAfter:k,dividerColor:S,open:t,transitionConfig:B,resizeConfig:u,skipMountAnimation:H,sizeStyle:q,id:z,...N,children:e}):R.jsx(re.OverlayPanel,{contextValue:E,panelClassName:M,resolvedPosition:l,showDivider:J,dividerColor:S,modalType:c,floatingOffset:$,open:t,onOpenChange:Y,transitionConfig:B,resizeConfig:u,skipMountAnimation:H,sizeStyle:q,id:z,...N,container:i,triggerRef:W,children:e})};v.displayName="Panel";v.Header=oe.Header;v.Body=ie.Body;v.Footer=te.Footer;exports.Panel=v;
|
package/lib/wip/Panel/Panel.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PanelProps } from './Panel.types';
|
|
2
2
|
export declare const Panel: {
|
|
3
|
-
({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, dividerColor, isAnimated, onBeforeClose, modalType, offset, resizable, id, ...panelProps }: PanelProps): JSX.Element;
|
|
3
|
+
({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, dividerColor, 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;
|