@viasat/beam-react 2.30.0 → 2.37.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 +1 -0
- 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/dialog.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.BK0jH2ge.js +1 -0
- package/chunks/FloatingUI.arrow.BXR2atOC.js +28 -0
- package/chunks/dialog.module.Djvqgz-x.js +1 -0
- package/chunks/{dialog.module.TRHzVysh.js → dialog.module.vokt9Lwb.js} +2 -1
- package/chunks/panel.module.BVmRxZHo.js +1 -0
- package/chunks/{panel.module.BblnuBjO.js → panel.module.CnHWv4EZ.js} +1 -3
- 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/Breadcrumbs/BreadcrumbsItem.d.ts +1 -1
- package/lib/Dialog/Dialog.Body.cjs.js +1 -1
- package/lib/Dialog/Dialog.Body.es.js +1 -1
- package/lib/Dialog/Dialog.Content.cjs.js +1 -1
- package/lib/Dialog/Dialog.Content.es.js +1 -1
- package/lib/Dialog/Dialog.Footer.cjs.js +1 -1
- package/lib/Dialog/Dialog.Footer.es.js +1 -1
- package/lib/Dialog/Dialog.Header.cjs.js +1 -1
- package/lib/Dialog/Dialog.Header.es.js +1 -1
- package/lib/Dialog/Dialog.cjs.js +1 -1
- package/lib/Dialog/Dialog.es.js +1 -1
- 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 +31 -32
- 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/SideNav/SideNavActionList.es.js +1 -0
- package/lib/SideNav/SideNavActionListItemLabel.d.ts +1 -1
- package/lib/Slider/DualSlider.cjs.js +1 -1
- package/lib/Slider/DualSlider.es.js +28 -27
- package/lib/Slider/SingleSlider.cjs.js +1 -1
- package/lib/Slider/SingleSlider.es.js +1 -1
- package/lib/Slider/Slider.es.js +17 -17
- package/lib/Slider/hooks/useDualSliderLogic.cjs.js +1 -1
- package/lib/Slider/hooks/useDualSliderLogic.es.js +14 -14
- package/lib/Slider/hooks/useSingleSliderLogic.cjs.js +1 -1
- package/lib/Slider/hooks/useSingleSliderLogic.es.js +17 -17
- package/lib/Tabs/Tabs.Group.d.ts +2 -2
- package/lib/Tabs/Tabs.Item.d.ts +2 -2
- package/lib/Tabs/Tabs.Panel.d.ts +2 -2
- package/lib/Text/Text.d.ts +2 -2
- package/lib/Text/Text.es.js +12 -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/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 +3 -1
- package/lib/wip/Panel/Panel.Inline.es.js +44 -40
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +18 -2
- package/lib/wip/Panel/Panel.Overlay.es.js +110 -84
- 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 +125 -94
- 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/lib/wip/index.cjs.js +1 -1
- package/lib/wip/index.d.ts +1 -0
- package/lib/wip/index.es.js +4 -2
- 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/assets/floatingui.css +0 -1
- package/chunks/dialog.module.C_6Qrg4w.js +0 -1
- 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
|
@@ -1,115 +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:
|
|
31
|
+
showDivider: u,
|
|
32
|
+
dividerColor: t,
|
|
20
33
|
resizeConfig: a,
|
|
21
|
-
floatingOffset:
|
|
22
|
-
overlayDividerClassName:
|
|
23
|
-
isBlocking:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
34
|
+
floatingOffset: c,
|
|
35
|
+
overlayDividerClassName: f,
|
|
36
|
+
isBlocking: d,
|
|
37
|
+
sizeStyle: p,
|
|
38
|
+
skipMountAnimation: v,
|
|
39
|
+
container: m,
|
|
40
|
+
style: x,
|
|
41
|
+
...C
|
|
27
42
|
}) => {
|
|
28
|
-
const { refs:
|
|
43
|
+
const { refs: y } = E(), { handleRef: l } = z({
|
|
29
44
|
resizeConfig: a,
|
|
30
45
|
position: o,
|
|
31
|
-
floatingRef:
|
|
32
|
-
requireMount: !0
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} : s;
|
|
38
|
-
return /* @__PURE__ */ R(
|
|
39
|
-
M,
|
|
46
|
+
floatingRef: y.floating,
|
|
47
|
+
requireMount: !0,
|
|
48
|
+
container: m
|
|
49
|
+
}), r = G(x, p, c);
|
|
50
|
+
return /* @__PURE__ */ B(
|
|
51
|
+
q,
|
|
40
52
|
{
|
|
41
|
-
className:
|
|
53
|
+
className: e,
|
|
42
54
|
skipFloatingStyles: !0,
|
|
43
|
-
overlay:
|
|
44
|
-
...
|
|
45
|
-
style:
|
|
55
|
+
overlay: d ? m ? { lockScroll: !1 } : !0 : !1,
|
|
56
|
+
...C,
|
|
57
|
+
style: r,
|
|
46
58
|
"data-position": o,
|
|
47
|
-
...
|
|
59
|
+
...v ? { "data-status": "open" } : {},
|
|
48
60
|
children: [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
s,
|
|
62
|
+
u && /* @__PURE__ */ n(
|
|
63
|
+
H,
|
|
52
64
|
{
|
|
53
65
|
position: o,
|
|
54
|
-
className:
|
|
55
|
-
dividerColor:
|
|
66
|
+
className: f,
|
|
67
|
+
dividerColor: t
|
|
56
68
|
}
|
|
57
69
|
),
|
|
58
|
-
a && /* @__PURE__ */
|
|
70
|
+
a && /* @__PURE__ */ n(w, { ref: l })
|
|
59
71
|
]
|
|
60
72
|
}
|
|
61
73
|
);
|
|
62
|
-
},
|
|
63
|
-
contextValue:
|
|
64
|
-
panelClassName:
|
|
74
|
+
}, so = ({
|
|
75
|
+
contextValue: s,
|
|
76
|
+
panelClassName: e,
|
|
65
77
|
resolvedPosition: o,
|
|
66
|
-
showDivider:
|
|
67
|
-
modalType:
|
|
78
|
+
showDivider: u,
|
|
79
|
+
modalType: t,
|
|
68
80
|
closeOnOutsidePress: a,
|
|
69
|
-
floatingOffset:
|
|
70
|
-
open:
|
|
71
|
-
onOpenChange:
|
|
72
|
-
transitionConfig:
|
|
73
|
-
dividerColor:
|
|
74
|
-
children:
|
|
75
|
-
resizeConfig:
|
|
76
|
-
|
|
77
|
-
|
|
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
|
|
78
93
|
}) => {
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
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}`]
|
|
82
106
|
);
|
|
83
|
-
return /* @__PURE__ */
|
|
84
|
-
|
|
107
|
+
return /* @__PURE__ */ n(j.Provider, { value: s, children: /* @__PURE__ */ n(
|
|
108
|
+
U,
|
|
85
109
|
{
|
|
86
|
-
open:
|
|
87
|
-
onOpenChange:
|
|
88
|
-
portalled: !0,
|
|
89
|
-
transitionConfig:
|
|
90
|
-
dismiss:
|
|
91
|
-
focusConfiguration:
|
|
92
|
-
children: /* @__PURE__ */
|
|
93
|
-
|
|
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,
|
|
94
118
|
{
|
|
95
|
-
panelClassName:
|
|
119
|
+
panelClassName: e,
|
|
96
120
|
resolvedPosition: o,
|
|
97
|
-
showDivider:
|
|
98
|
-
dividerColor:
|
|
99
|
-
floatingOffset:
|
|
100
|
-
overlayDividerClassName:
|
|
101
|
-
isBlocking:
|
|
102
|
-
resizeConfig:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
|
108
134
|
}
|
|
109
135
|
)
|
|
110
136
|
}
|
|
111
137
|
) });
|
|
112
138
|
};
|
|
113
139
|
export {
|
|
114
|
-
|
|
140
|
+
so as OverlayPanel
|
|
115
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;
|
|
@@ -1,124 +1,155 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { g as
|
|
1
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import H from "clsx";
|
|
3
|
+
import { useMemo as K } from "react";
|
|
4
|
+
import { g as oe } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
5
5
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
import { usePrevious as R } from "../../../utils/hooks/usePrevious.es.js";
|
|
7
|
+
import { Header as ne } from "./Header/Panel.Header.es.js";
|
|
8
|
+
import { Body as se } from "./Panel.Body.es.js";
|
|
9
|
+
import { Footer as ie } from "./Footer/Panel.Footer.es.js";
|
|
10
|
+
import { resolveOffset as te, usePanelClose as re, getPanelDividerState as ae, PANEL_TRANSITION_DURATION_MS as le, getResolvedPanelPosition as ce, isPresetSize as fe } from "./Panel.helpers.es.js";
|
|
11
|
+
import { InlinePanel as me } from "./Panel.Inline.es.js";
|
|
12
|
+
import { OverlayPanel as ve } from "./Panel.Overlay.es.js";
|
|
13
|
+
import { s as n } from "../../../chunks/panel.module.CnHWv4EZ.js";
|
|
14
|
+
const pe = 165, de = 100, ue = (e, v) => {
|
|
15
|
+
if (!e) return;
|
|
16
|
+
const p = v === "bottom", a = typeof e == "object" ? e : {}, t = a.minSize ?? (p ? de : pe), d = a.maxSize ?? 1 / 0, f = a.storageKey ?? "";
|
|
17
|
+
return { minSize: t, maxSize: d, storageKey: f };
|
|
18
|
+
}, { baseClassNamePrefix: s, variable: ye } = oe("panel");
|
|
19
|
+
function ge(e) {
|
|
20
|
+
return fe(e) ? {
|
|
21
|
+
overlaySizeClass: n[`${s}--size-${e}`],
|
|
22
|
+
inlineSizeClass: n[`${s}__inline-wrapper--size-${e}`],
|
|
23
|
+
sizeStyle: void 0
|
|
24
|
+
} : e !== void 0 ? {
|
|
25
|
+
overlaySizeClass: void 0,
|
|
26
|
+
inlineSizeClass: void 0,
|
|
27
|
+
sizeStyle: { [ye("size")]: e }
|
|
28
|
+
} : { overlaySizeClass: void 0, inlineSizeClass: void 0, sizeStyle: void 0 };
|
|
29
|
+
}
|
|
30
|
+
const m = ({
|
|
31
|
+
children: e,
|
|
32
|
+
className: v,
|
|
20
33
|
padding: p = "md",
|
|
21
|
-
onOpenChange:
|
|
22
|
-
open:
|
|
23
|
-
size:
|
|
34
|
+
onOpenChange: a,
|
|
35
|
+
open: t,
|
|
36
|
+
size: d,
|
|
24
37
|
dismissible: f = !0,
|
|
25
|
-
closeButtonAriaLabel:
|
|
26
|
-
kind:
|
|
38
|
+
closeButtonAriaLabel: P = "Close panel",
|
|
39
|
+
kind: o = "inline",
|
|
27
40
|
position: u,
|
|
28
|
-
divider:
|
|
29
|
-
dividerColor:
|
|
30
|
-
isAnimated:
|
|
31
|
-
onBeforeClose:
|
|
41
|
+
divider: F = !0,
|
|
42
|
+
dividerColor: S,
|
|
43
|
+
isAnimated: C = !0,
|
|
44
|
+
onBeforeClose: j,
|
|
32
45
|
modalType: l,
|
|
33
|
-
offset:
|
|
34
|
-
resizable:
|
|
35
|
-
id:
|
|
36
|
-
...
|
|
46
|
+
offset: z,
|
|
47
|
+
resizable: L,
|
|
48
|
+
id: h,
|
|
49
|
+
...N
|
|
37
50
|
}) => {
|
|
38
|
-
const r =
|
|
51
|
+
const r = ce(u), c = ue(L, r), V = !!c, { container: O, triggerRef: W, ...w } = N, i = o === "overlay" ? O : void 0;
|
|
39
52
|
if (process.env.NODE_ENV !== "production") {
|
|
40
53
|
c && !c.storageKey && console.warn(
|
|
41
54
|
"Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."
|
|
42
55
|
), l === "alert" && f && console.warn(
|
|
43
56
|
'Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'
|
|
44
57
|
);
|
|
45
|
-
const { closeOnOutsidePress:
|
|
46
|
-
|
|
58
|
+
const { closeOnOutsidePress: ee } = N;
|
|
59
|
+
if (ee && l !== "nonModal" && l !== void 0 && console.warn(
|
|
47
60
|
'Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'
|
|
48
|
-
)
|
|
61
|
+
), O && o === "inline" && console.warn('Panel: `container` has no effect when `kind="inline"`.'), i)
|
|
62
|
+
try {
|
|
63
|
+
if (typeof getComputedStyle == "function") {
|
|
64
|
+
const y = getComputedStyle(i);
|
|
65
|
+
y.position === "static" && console.warn(
|
|
66
|
+
"Panel: container element should have `position: relative` (or another non-static value) for proper scoping."
|
|
67
|
+
);
|
|
68
|
+
const g = r === "bottom" ? y.overflowY : y.overflowX;
|
|
69
|
+
(g === "visible" || g === "auto" || g === "scroll") && console.warn(
|
|
70
|
+
"Panel: container element should use `overflow: hidden` (or `clip`) so the slide-in/out transform does not trigger a transient scrollbar."
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
} catch {
|
|
74
|
+
}
|
|
49
75
|
}
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
const _ = l === "alert" ? !1 : f, { overlaySizeClass: q, inlineSizeClass: G, sizeStyle: $ } = ge(d), b = o === "overlay" && z ? te(z) : void 0, I = !!b, E = H(
|
|
77
|
+
n[s],
|
|
78
|
+
n[`${s}--${o}`],
|
|
79
|
+
o === "overlay" && q,
|
|
80
|
+
n[`${s}--padding-${p}`],
|
|
81
|
+
n[`${s}--position-${r}`],
|
|
82
|
+
I && n[`${s}--floating`],
|
|
83
|
+
V && n[`${s}--resizable`],
|
|
84
|
+
o === "overlay" && i && n[`${s}--contained`],
|
|
85
|
+
v
|
|
86
|
+
), U = H(
|
|
87
|
+
n[`${s}__inline-wrapper`],
|
|
88
|
+
G
|
|
89
|
+
), { requestClose: M, handleOverlayOpenChange: X } = re(
|
|
90
|
+
j,
|
|
91
|
+
a
|
|
92
|
+
), x = K(
|
|
66
93
|
() => ({
|
|
67
|
-
kind:
|
|
68
|
-
dismissible:
|
|
69
|
-
closeButtonAriaLabel:
|
|
94
|
+
kind: o,
|
|
95
|
+
dismissible: _,
|
|
96
|
+
closeButtonAriaLabel: P,
|
|
70
97
|
position: u,
|
|
71
|
-
requestClose:
|
|
98
|
+
requestClose: M
|
|
72
99
|
}),
|
|
73
|
-
[
|
|
74
|
-
), { showDivider:
|
|
75
|
-
() => ({ duration:
|
|
76
|
-
[
|
|
77
|
-
),
|
|
78
|
-
return
|
|
79
|
-
|
|
100
|
+
[o, _, P, u, M]
|
|
101
|
+
), { showDivider: Y, dividerBefore: J, dividerInner: Q, dividerAfter: Z } = ae(F && !I, r), D = K(
|
|
102
|
+
() => ({ duration: C ? le : 0 }),
|
|
103
|
+
[C]
|
|
104
|
+
), B = R(o), k = R(i), T = B !== void 0 && B !== o && t === !0 || k === null && i != null && t === !0;
|
|
105
|
+
return i === null ? null : o === "inline" ? /* @__PURE__ */ A(
|
|
106
|
+
me,
|
|
80
107
|
{
|
|
81
|
-
contextValue:
|
|
82
|
-
panelClassName:
|
|
83
|
-
inlineWrapperClassName:
|
|
108
|
+
contextValue: x,
|
|
109
|
+
panelClassName: E,
|
|
110
|
+
inlineWrapperClassName: U,
|
|
84
111
|
resolvedPosition: r,
|
|
85
|
-
dividerBefore:
|
|
86
|
-
dividerInner:
|
|
87
|
-
dividerAfter:
|
|
88
|
-
dividerColor:
|
|
89
|
-
open:
|
|
90
|
-
transitionConfig:
|
|
112
|
+
dividerBefore: J,
|
|
113
|
+
dividerInner: Q,
|
|
114
|
+
dividerAfter: Z,
|
|
115
|
+
dividerColor: S,
|
|
116
|
+
open: t,
|
|
117
|
+
transitionConfig: D,
|
|
91
118
|
resizeConfig: c,
|
|
92
|
-
skipMountAnimation:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
119
|
+
skipMountAnimation: T,
|
|
120
|
+
sizeStyle: $,
|
|
121
|
+
id: h,
|
|
122
|
+
...w,
|
|
123
|
+
children: e
|
|
96
124
|
}
|
|
97
|
-
) : /* @__PURE__ */
|
|
98
|
-
|
|
125
|
+
) : /* @__PURE__ */ A(
|
|
126
|
+
ve,
|
|
99
127
|
{
|
|
100
|
-
contextValue:
|
|
101
|
-
panelClassName:
|
|
128
|
+
contextValue: x,
|
|
129
|
+
panelClassName: E,
|
|
102
130
|
resolvedPosition: r,
|
|
103
|
-
showDivider:
|
|
104
|
-
dividerColor:
|
|
131
|
+
showDivider: Y,
|
|
132
|
+
dividerColor: S,
|
|
105
133
|
modalType: l,
|
|
106
|
-
floatingOffset:
|
|
107
|
-
open:
|
|
108
|
-
onOpenChange:
|
|
109
|
-
transitionConfig:
|
|
134
|
+
floatingOffset: b,
|
|
135
|
+
open: t,
|
|
136
|
+
onOpenChange: X,
|
|
137
|
+
transitionConfig: D,
|
|
110
138
|
resizeConfig: c,
|
|
111
|
-
skipMountAnimation:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
139
|
+
skipMountAnimation: T,
|
|
140
|
+
sizeStyle: $,
|
|
141
|
+
id: h,
|
|
142
|
+
...w,
|
|
143
|
+
container: i,
|
|
144
|
+
triggerRef: W,
|
|
145
|
+
children: e
|
|
115
146
|
}
|
|
116
147
|
);
|
|
117
148
|
};
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
149
|
+
m.displayName = "Panel";
|
|
150
|
+
m.Header = ne;
|
|
151
|
+
m.Body = se;
|
|
152
|
+
m.Footer = ie;
|
|
122
153
|
export {
|
|
123
|
-
|
|
154
|
+
m as Panel
|
|
124
155
|
};
|
|
@@ -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"),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||"end",D=(e,s)=>({showDivider:e,dividerBefore:e&&s!=="start"&&s!=="bottom",dividerInner:e&&s==="bottom",dividerAfter:e&&s==="start"}),_=(e,s)=>{if(e!=="isModal")return e==="alert"?{escapeKey:!1,outsidePress:!1}:{escapeKey:!0,outsidePress:s??!1}},v=e=>e==="escape-key"?"escapeKey":e==="outside-press"?"outsidePress":"programmatic",y=(e,s)=>{const i=c.useCallback(l=>{if(!e){s==null||s(!1);return}const r=e(l);r instanceof Promise?r.then(t=>{t&&(s==null||s(!1))}).catch(t=>{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`.",t)}):r&&(s==null||s(!1))},[e,s]),u=c.useCallback((l,r,t)=>{l?s==null||s(!0):i(v(t))},[s,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.isPresetSize=o;exports.resolveOffset=P;exports.usePanelClose=y;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { OpenChangeReason } from '@floating-ui/react';
|
|
2
|
-
import { OverlayPanelProps, PanelCloseReason, PanelDividerColor, PanelModalType, PanelPosition, PanelProps, ResolvedPanelOffset } from './Panel.types';
|
|
2
|
+
import { OverlayPanelProps, PanelCloseReason, PanelDividerColor, PanelModalType, PanelPosition, PanelProps, PanelSize, ResolvedPanelOffset } from './Panel.types';
|
|
3
|
+
export declare const isPresetSize: (s: PanelSize | undefined) => s is "sm" | "md" | "lg";
|
|
3
4
|
export declare const PANEL_TRANSITION_DURATION_MS = 400;
|
|
4
5
|
export declare function resolveOffset(offset: Exclude<OverlayPanelProps['offset'], false | undefined>): ResolvedPanelOffset;
|
|
5
6
|
export declare const DEFAULT_PANEL_DIVIDER_COLOR: PanelDividerColor;
|