@viasat/beam-react 2.29.0 → 2.30.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.
@@ -1,109 +1,123 @@
1
- import q, { useRef as h, useState as D, useEffect as L, useCallback as f, useMemo as O } from "react";
2
- import { useUniversalRef as G } from "../Form/hooks/useUniversalRef.hook.es.js";
1
+ import q, { useRef as V, useState as G, useEffect as T, useCallback as f, useMemo as I } from "react";
2
+ import { useUniversalRef as H } from "../Form/hooks/useUniversalRef.hook.es.js";
3
3
  import "../../chunks/constants.CKKGf1-i.js";
4
4
  import "react/jsx-runtime";
5
- import { F as H } from "../../chunks/form.context.D7b4066_.js";
5
+ import { F as J } from "../../chunks/form.context.D7b4066_.js";
6
6
  import "../Form/contexts/label.context.es.js";
7
7
  import "../Form/contexts/helperText.context.es.js";
8
- const _ = ({
8
+ const ee = ({
9
9
  value: e,
10
10
  defaultValue: b,
11
- onChange: u,
11
+ onChange: l,
12
12
  name: d,
13
- multiple: A = !1
14
- }, P) => {
15
- const { refFn: g, ref: l } = G(P), { ctxInitialValues: T } = q.useContext(H), i = b || T[d], V = h(i);
16
- V.current = i;
17
- const [k, p] = D(i), y = e !== void 0, a = h(y);
13
+ multiple: x = !1
14
+ }, k) => {
15
+ const { refFn: C, ref: c } = H(k), { ctxInitialValues: D } = q.useContext(J), i = b || D[d], F = V(i);
16
+ F.current = i;
17
+ const [U, v] = G(i), y = e !== void 0, a = V(y);
18
18
  a.current = y;
19
- const R = y ? e : k, n = h(u);
20
- n.current = u, L(() => {
21
- a.current || p(i);
19
+ const M = y ? e : U, s = V(l);
20
+ s.current = l, T(() => {
21
+ a.current || v(i);
22
22
  }, [i]);
23
- const x = f(
24
- (t) => {
25
- var S;
26
- const s = Array.isArray(t) ? t : t !== void 0 && t !== "" && t !== null ? [t] : [], r = l.current;
27
- if (!r) {
23
+ const p = f(
24
+ (r) => {
25
+ var L;
26
+ const n = P(r), t = c.current;
27
+ if (!t) {
28
28
  console.warn(
29
29
  "Component is controlled but selectRef is not set. This may lead to unexpected behavior."
30
- ), (S = n.current) == null || S.call(n, {
31
- target: { value: t }
30
+ ), (L = s.current) == null || L.call(s, {
31
+ target: { value: r }
32
32
  });
33
33
  return;
34
34
  }
35
- const c = Array.from(r.options), U = Array.from(r.selectedOptions);
36
- c.forEach((o) => {
37
- o.selected = s.includes(o.value);
38
- }), s.forEach((o) => {
39
- const B = c.find((j) => j.value === o);
40
- B && r.appendChild(B);
35
+ const u = Array.from(t.options), h = Array.from(t.selectedOptions);
36
+ u.forEach((o) => {
37
+ o.selected = n.includes(o.value);
38
+ }), n.forEach((o) => {
39
+ const O = u.find((j) => j.value === o);
40
+ O && t.appendChild(O);
41
41
  });
42
- const w = new Event("change", { bubbles: !0 });
43
- if (r.dispatchEvent(w), w.defaultPrevented) {
44
- Array.from(r.options).forEach((o) => {
45
- o.selected = U.includes(o);
46
- }), c.reverse().forEach((o) => {
47
- r.appendChild(o);
42
+ const B = new Event("change", { bubbles: !0 });
43
+ if (t.dispatchEvent(B), B.defaultPrevented) {
44
+ Array.from(t.options).forEach((o) => {
45
+ o.selected = h.includes(o);
46
+ }), u.reverse().forEach((o) => {
47
+ t.appendChild(o);
48
48
  });
49
49
  return;
50
50
  }
51
51
  },
52
- [l]
52
+ [c]
53
53
  );
54
- L(() => {
55
- a.current && p(e);
54
+ T(() => {
55
+ a.current && v(e);
56
56
  }, [e]);
57
- const C = f((t) => {
58
- var s;
59
- a.current ? (s = n.current) == null || s.call(n, t) : p(
60
- Array.from(t.target.selectedOptions).filter((r) => r.selected && r.value !== "").map((r) => r.value)
57
+ const S = f((r) => {
58
+ var n;
59
+ a.current ? (n = s.current) == null || n.call(s, r) : v(
60
+ Array.from(r.target.selectedOptions).filter((t) => t.selected && t.value !== "").map((t) => t.value)
61
61
  );
62
- }, []), F = f(() => {
63
- var r, c;
64
- const t = new FocusEvent("blur", { bubbles: !1 }), s = new FocusEvent("focusout", { bubbles: !0 });
65
- (r = l.current) == null || r.dispatchEvent(t), (c = l.current) == null || c.dispatchEvent(s);
66
- }, [l]), v = f(() => {
62
+ }, []), w = f(() => {
63
+ var t, u;
64
+ const r = new FocusEvent("blur", { bubbles: !1 }), n = new FocusEvent("focusout", { bubbles: !0 });
65
+ (t = c.current) == null || t.dispatchEvent(r), (u = c.current) == null || u.dispatchEvent(n);
66
+ }, [c]), A = f(() => {
67
67
  var t;
68
- a.current ? (t = n.current) == null || t.call(n, {
69
- target: { value: V.current }
70
- }) : p(V.current);
71
- }, []), m = h(null), M = f(
72
- (t) => {
73
- var s, r;
74
- g(t), t ? (m.current = t.form, (r = m.current) == null || r.addEventListener("reset", v)) : ((s = m.current) == null || s.removeEventListener("reset", v), m.current = null);
68
+ const r = c.current, n = F.current;
69
+ if (r) {
70
+ const u = P(n);
71
+ Array.from(r.options).forEach((h) => {
72
+ h.defaultSelected = u.includes(h.value);
73
+ });
74
+ }
75
+ if (a.current) {
76
+ (t = s.current) == null || t.call(s, {
77
+ target: { value: n }
78
+ });
79
+ return;
80
+ }
81
+ r && p(n);
82
+ }, [p, c]), m = V(null), z = f(
83
+ (r) => {
84
+ var n, t;
85
+ C(r), r ? (m.current = r.form, (t = m.current) == null || t.addEventListener("reset", A)) : ((n = m.current) == null || n.removeEventListener("reset", A), m.current = null);
75
86
  },
76
- [v, g]
77
- ), E = O(() => ({
78
- ref: M,
79
- value: J(R, A),
80
- onChange: C,
87
+ [A, C]
88
+ ), E = I(() => ({
89
+ ref: z,
90
+ value: K(M, x),
91
+ onChange: S,
81
92
  name: d
82
- }), [M, A, R, C, d]);
83
- return O(
93
+ }), [z, x, M, S, d]);
94
+ return I(
84
95
  () => ({
85
96
  selectProps: E,
86
97
  value: E.value,
87
- singleValue: K(E.value),
88
- setValue: x,
89
- handleBlur: F
98
+ singleValue: N(E.value),
99
+ setValue: p,
100
+ handleBlur: w
90
101
  }),
91
- [E, x, F]
102
+ [E, p, w]
92
103
  );
93
104
  };
94
- function z(e) {
105
+ function g(e) {
95
106
  return e == null || e === "" || Array.isArray(e) && e.length === 0;
96
107
  }
97
- function I(e) {
108
+ function R(e) {
98
109
  return Array.isArray(e);
99
110
  }
100
- function J(e, b) {
101
- const u = I(e);
102
- return b ? u ? e : z(e) ? [] : [e] : u ? z(e) ? "" : e[0] ?? "" : e ?? "";
111
+ function P(e) {
112
+ return R(e) ? e : g(e) ? [] : [e];
113
+ }
114
+ function K(e, b) {
115
+ const l = R(e);
116
+ return b ? l ? e : g(e) ? [] : [e] : l ? g(e) ? "" : e[0] ?? "" : e ?? "";
103
117
  }
104
- function K(e) {
105
- return I(e) ? e.length > 0 ? e[e.length - 1] : void 0 : e;
118
+ function N(e) {
119
+ return R(e) ? e.length > 0 ? e[e.length - 1] : void 0 : e;
106
120
  }
107
121
  export {
108
- _ as useSelectValue
122
+ ee as useSelectValue
109
123
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("@floating-ui/react"),q=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const b=require("./Panel.context.cjs.js"),F=require("../../FloatingUI/FloatingUI.root.cjs.js"),R=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),p=require("./Panel.Divider.cjs.js"),h=require("./Panel.ResizeHandle.cjs.js"),w=require("./Panel.useResize.cjs.js"),U=require("../../../chunks/panel.module.CVyUzyCZ.js"),{baseClassNamePrefix:N}=q.getBEMClassNames("panel"),v=({children:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,alwaysVisible:i,dividerColor:t,resizeConfig:s,..._})=>{const{context:x,transitionConfig:d,refs:g}=R.useBmFloatingUIContext(),{isMounted:I,status:j}=m.useTransitionStatus(x,d),P=i&&j==="initial"?"open":j,{handleRef:f}=w.usePanelResize({resizeConfig:s,position:n,floatingRef:g.floating});return I?e.jsxs(e.Fragment,{children:[o&&e.jsx(p.InlineDivider,{position:n,dividerColor:t}),e.jsx("div",{ref:g.setFloating,className:r,"data-position":n,"data-status":P,children:e.jsxs("div",{className:U.styles[`${N}__inline-wrapper-content`],children:[c&&e.jsx(p.InlineDivider,{position:n,dividerColor:t}),e.jsxs("aside",{..._,className:l,children:[a,s&&e.jsx(h.PanelResizeHandle,{ref:f})]})]})}),u&&e.jsx(p.InlineDivider,{position:n,dividerColor:t})]}):null},y=({contextValue:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,open:i,transitionConfig:t,dividerColor:s,children:_,resizeConfig:x,...d})=>e.jsx(b.PanelContext.Provider,{value:a,children:e.jsx(F.FloatingUIRoot,{open:i??!0,portalled:!1,transitionConfig:t,children:e.jsx(v,{panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,dividerColor:s,alwaysVisible:i===void 0,resizeConfig:x,...d,children:_})})});exports.InlinePanel=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),q=require("@floating-ui/react"),b=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const F=require("./Panel.context.cjs.js"),R=require("../../FloatingUI/FloatingUI.root.cjs.js"),h=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),g=require("./Panel.Divider.cjs.js"),w=require("./Panel.ResizeHandle.cjs.js"),U=require("./Panel.useResize.cjs.js"),N=require("../../../chunks/panel.module.CVyUzyCZ.js"),{baseClassNamePrefix:v}=b.getBEMClassNames("panel"),y=({children:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,alwaysVisible:i,skipMountAnimation:_,dividerColor:t,resizeConfig:s,...x})=>{const{context:d,transitionConfig:p,refs:j}=h.useBmFloatingUIContext(),{isMounted:P,status:I}=q.useTransitionStatus(d,p),f=(i||_)&&I==="initial"?"open":I,{handleRef:m}=U.usePanelResize({resizeConfig:s,position:n,floatingRef:j.floating});return P?e.jsxs(e.Fragment,{children:[o&&e.jsx(g.InlineDivider,{position:n,dividerColor:t}),e.jsx("div",{ref:j.setFloating,className:r,"data-position":n,"data-status":f,children:e.jsxs("div",{className:N.styles[`${v}__inline-wrapper-content`],children:[c&&e.jsx(g.InlineDivider,{position:n,dividerColor:t}),e.jsxs("aside",{...x,className:l,children:[a,s&&e.jsx(w.PanelResizeHandle,{ref:m})]})]})}),u&&e.jsx(g.InlineDivider,{position:n,dividerColor:t})]}):null},C=({contextValue:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,open:i,transitionConfig:_,dividerColor:t,children:s,resizeConfig:x,skipMountAnimation:d,...p})=>e.jsx(F.PanelContext.Provider,{value:a,children:e.jsx(R.FloatingUIRoot,{open:i??!0,portalled:!1,transitionConfig:_,children:e.jsx(y,{panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,dividerColor:t,alwaysVisible:i===void 0,skipMountAnimation:d,resizeConfig:x,...p,children:s})})});exports.InlinePanel=C;
@@ -14,6 +14,8 @@ type InlinePanelProps = {
14
14
  children: React.ReactNode;
15
15
  dividerColor?: PanelDividerColor;
16
16
  resizeConfig?: PanelResizeConfig;
17
+ /** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
18
+ skipMountAnimation?: boolean;
17
19
  } & 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;
20
+ export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig, skipMountAnimation, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
19
21
  export {};
@@ -1,15 +1,15 @@
1
- import { jsx as t, jsxs as d, Fragment as C } from "react/jsx-runtime";
2
- import { useTransitionStatus as F } from "@floating-ui/react";
3
- import { g as w } from "../../../chunks/classNames.BTJmrO_L.js";
1
+ import { jsx as t, jsxs as g, Fragment as F } from "react/jsx-runtime";
2
+ import { useTransitionStatus as w } 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 P } from "./Panel.context.es.js";
6
- import { FloatingUIRoot as U } from "../../FloatingUI/FloatingUI.root.es.js";
7
- import { a as b } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
8
- import { InlineDivider as g } from "./Panel.Divider.es.js";
9
- import { PanelResizeHandle as j } from "./Panel.ResizeHandle.es.js";
10
- import { usePanelResize as y } from "./Panel.useResize.es.js";
11
- import { s as B } from "../../../chunks/panel.module.BblnuBjO.js";
12
- const { baseClassNamePrefix: M } = w("panel"), S = ({
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 x } from "./Panel.Divider.es.js";
9
+ import { PanelResizeHandle as y } from "./Panel.ResizeHandle.es.js";
10
+ import { usePanelResize as B } from "./Panel.useResize.es.js";
11
+ import { s as M } from "../../../chunks/panel.module.BblnuBjO.js";
12
+ const { baseClassNamePrefix: S } = P("panel"), _ = ({
13
13
  children: s,
14
14
  panelClassName: o,
15
15
  inlineWrapperClassName: r,
@@ -18,43 +18,44 @@ 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
23
  resizeConfig: i,
23
- ...f
24
+ ...c
24
25
  }) => {
25
26
  const {
26
- context: c,
27
- transitionConfig: u,
28
- refs: x
29
- } = b(), { isMounted: I, status: h } = F(
30
- c,
31
- u
32
- ), N = e && h === "initial" ? "open" : h, { handleRef: R } = y({
27
+ context: u,
28
+ transitionConfig: d,
29
+ refs: h
30
+ } = j(), { isMounted: N, status: I } = w(
31
+ u,
32
+ d
33
+ ), R = (e || f) && I === "initial" ? "open" : I, { handleRef: C } = B({
33
34
  resizeConfig: i,
34
35
  position: n,
35
- floatingRef: x.floating
36
+ floatingRef: h.floating
36
37
  });
37
- return I ? /* @__PURE__ */ d(C, { children: [
38
- l && /* @__PURE__ */ t(g, { position: n, dividerColor: a }),
38
+ return N ? /* @__PURE__ */ g(F, { children: [
39
+ l && /* @__PURE__ */ t(x, { position: n, dividerColor: a }),
39
40
  /* @__PURE__ */ t(
40
41
  "div",
41
42
  {
42
- ref: x.setFloating,
43
+ ref: h.setFloating,
43
44
  className: r,
44
45
  "data-position": n,
45
- "data-status": N,
46
- children: /* @__PURE__ */ d("div", { className: B[`${M}__inline-wrapper-content`], children: [
47
- m && /* @__PURE__ */ t(g, { position: n, dividerColor: a }),
48
- /* @__PURE__ */ d("aside", { ...f, className: o, children: [
46
+ "data-status": R,
47
+ children: /* @__PURE__ */ g("div", { className: M[`${S}__inline-wrapper-content`], children: [
48
+ m && /* @__PURE__ */ t(x, { position: n, dividerColor: a }),
49
+ /* @__PURE__ */ g("aside", { ...c, className: o, children: [
49
50
  s,
50
- i && /* @__PURE__ */ t(j, { ref: R })
51
+ i && /* @__PURE__ */ t(y, { ref: C })
51
52
  ] })
52
53
  ] })
53
54
  }
54
55
  ),
55
- p && /* @__PURE__ */ t(g, { position: n, dividerColor: a })
56
+ p && /* @__PURE__ */ t(x, { position: n, dividerColor: a })
56
57
  ] }) : null;
57
- }, A = ({
58
+ }, G = ({
58
59
  contextValue: s,
59
60
  panelClassName: o,
60
61
  inlineWrapperClassName: r,
@@ -63,19 +64,20 @@ const { baseClassNamePrefix: M } = w("panel"), S = ({
63
64
  dividerInner: m,
64
65
  dividerAfter: p,
65
66
  open: e,
66
- transitionConfig: a,
67
- dividerColor: i,
68
- children: f,
67
+ transitionConfig: f,
68
+ dividerColor: a,
69
+ children: i,
69
70
  resizeConfig: c,
70
- ...u
71
- }) => /* @__PURE__ */ t(P.Provider, { value: s, children: /* @__PURE__ */ t(
72
- U,
71
+ skipMountAnimation: u,
72
+ ...d
73
+ }) => /* @__PURE__ */ t(U.Provider, { value: s, children: /* @__PURE__ */ t(
74
+ b,
73
75
  {
74
76
  open: e ?? !0,
75
77
  portalled: !1,
76
- transitionConfig: a,
78
+ transitionConfig: f,
77
79
  children: /* @__PURE__ */ t(
78
- S,
80
+ _,
79
81
  {
80
82
  panelClassName: o,
81
83
  inlineWrapperClassName: r,
@@ -83,15 +85,16 @@ const { baseClassNamePrefix: M } = w("panel"), S = ({
83
85
  dividerBefore: l,
84
86
  dividerInner: m,
85
87
  dividerAfter: p,
86
- dividerColor: i,
88
+ dividerColor: a,
87
89
  alwaysVisible: e === void 0,
90
+ skipMountAnimation: u,
88
91
  resizeConfig: c,
89
- ...u,
90
- children: f
92
+ ...d,
93
+ children: i
91
94
  }
92
95
  )
93
96
  }
94
97
  ) });
95
98
  export {
96
- A as InlinePanel
99
+ G as InlinePanel
97
100
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),m=require("clsx"),p=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const F=require("./Panel.context.cjs.js"),I=require("./Panel.helpers.cjs.js"),j=require("../../FloatingUI/FloatingUI.root.cjs.js"),C=require("../../FloatingUI/FloatingUI.content.cjs.js"),R=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),U=require("./Panel.Divider.cjs.js"),N=require("./Panel.ResizeHandle.cjs.js"),h=require("./Panel.useResize.cjs.js"),q=require("../../../chunks/panel.module.CVyUzyCZ.js"),{baseClassNamePrefix:v,variable:y}=p.getBEMClassNames("panel"),w=({children:a,panelClassName:r,resolvedPosition:e,showDivider:o,dividerColor:l,resizeConfig:s,floatingOffset:i,overlayDividerClassName:c,isBlocking:u,style:t,..._})=>{const{refs:d}=R.useBmFloatingUIContext(),{handleRef:g}=h.usePanelResize({resizeConfig:s,position:e,floatingRef:d.floating,requireMount:!0}),P=i?{...t,[y("offset-x")]:i.x,[y("offset-y")]:i.y}:t;return n.jsxs(C.Content,{className:r,skipFloatingStyles:!0,overlay:u,..._,style:P,"data-position":e,children:[a,o&&n.jsx(U.InlineDivider,{position:e,className:c,dividerColor:l}),s&&n.jsx(N.PanelResizeHandle,{ref:g})]})},D=({contextValue:a,panelClassName:r,resolvedPosition:e,showDivider:o,modalType:l,closeOnOutsidePress:s,floatingOffset:i,open:c,onOpenChange:u,transitionConfig:t,dividerColor:_,children:d,resizeConfig:g,...P})=>{const x=l==="isModal"||l==="alert",b=I.getPanelDismissConfig(l,s),f=m(q.styles[`${v}__overlay-divider`],q.styles[`${v}__overlay-divider--${e}`]);return n.jsx(F.PanelContext.Provider,{value:a,children:n.jsx(j.FloatingUIRoot,{open:c,onOpenChange:u,portalled:!0,transitionConfig:t,dismiss:b,focusConfiguration:x?!0:{modal:!1,closeOnFocusOut:!1},children:n.jsx(w,{panelClassName:r,resolvedPosition:e,showDivider:o,dividerColor:_,floatingOffset:i,overlayDividerClassName:f,isBlocking:x,resizeConfig:g,...P,role:l==="alert"?"alertdialog":"dialog","aria-modal":x||void 0,children:d})})})};exports.OverlayPanel=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),p=require("clsx"),F=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const I=require("./Panel.context.cjs.js"),j=require("./Panel.helpers.cjs.js"),C=require("../../FloatingUI/FloatingUI.root.cjs.js"),R=require("../../FloatingUI/FloatingUI.content.cjs.js"),U=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),N=require("./Panel.Divider.cjs.js"),h=require("./Panel.ResizeHandle.cjs.js"),w=require("./Panel.useResize.cjs.js"),v=require("../../../chunks/panel.module.CVyUzyCZ.js"),{baseClassNamePrefix:y,variable:b}=F.getBEMClassNames("panel"),D=({children:a,panelClassName:r,resolvedPosition:e,showDivider:o,dividerColor:n,resizeConfig:s,floatingOffset:i,overlayDividerClassName:c,isBlocking:u,skipMountAnimation:_,style:t,...d})=>{const{refs:g}=U.useBmFloatingUIContext(),{handleRef:P}=w.usePanelResize({resizeConfig:s,position:e,floatingRef:g.floating,requireMount:!0}),x=i?{...t,[b("offset-x")]:i.x,[b("offset-y")]:i.y}:t;return l.jsxs(R.Content,{className:r,skipFloatingStyles:!0,overlay:u,...d,style:x,"data-position":e,..._?{"data-status":"open"}:{},children:[a,o&&l.jsx(N.InlineDivider,{position:e,className:c,dividerColor:n}),s&&l.jsx(h.PanelResizeHandle,{ref:P})]})},M=({contextValue:a,panelClassName:r,resolvedPosition:e,showDivider:o,modalType:n,closeOnOutsidePress:s,floatingOffset:i,open:c,onOpenChange:u,transitionConfig:_,dividerColor:t,children:d,resizeConfig:g,skipMountAnimation:P,...x})=>{const q=n==="isModal"||n==="alert",f=j.getPanelDismissConfig(n,s),m=p(v.styles[`${y}__overlay-divider`],v.styles[`${y}__overlay-divider--${e}`]);return l.jsx(I.PanelContext.Provider,{value:a,children:l.jsx(C.FloatingUIRoot,{open:c,onOpenChange:u,portalled:!0,transitionConfig:_,dismiss:f,focusConfiguration:q?!0:{modal:!1,closeOnFocusOut:!1},children:l.jsx(D,{panelClassName:r,resolvedPosition:e,showDivider:o,dividerColor:t,floatingOffset:i,overlayDividerClassName:m,isBlocking:q,resizeConfig:g,skipMountAnimation:P,...x,role:n==="alert"?"alertdialog":"dialog","aria-modal":q||void 0,children:d})})})};exports.OverlayPanel=M;
@@ -16,6 +16,8 @@ type OverlayPanelProps = {
16
16
  children: React.ReactNode;
17
17
  dividerColor?: PanelDividerColor;
18
18
  resizeConfig?: PanelResizeConfig;
19
+ /** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
20
+ skipMountAnimation?: boolean;
19
21
  } & React.ComponentPropsWithoutRef<'aside'>;
20
- export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, floatingOffset, open, onOpenChange, transitionConfig, dividerColor, children, resizeConfig, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, floatingOffset, open, onOpenChange, transitionConfig, dividerColor, children, resizeConfig, skipMountAnimation, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
21
23
  export {};
@@ -1,98 +1,109 @@
1
- import { jsx as t, jsxs as P } from "react/jsx-runtime";
2
- import R from "clsx";
3
- import { g as h } from "../../../chunks/classNames.BTJmrO_L.js";
1
+ import { jsx as t, jsxs as R } from "react/jsx-runtime";
2
+ import h from "clsx";
3
+ import { g as F } from "../../../chunks/classNames.BTJmrO_L.js";
4
4
  import "../../../chunks/constants.CKKGf1-i.js";
5
- import { PanelContext as F } from "./Panel.context.es.js";
6
- import { getPanelDismissConfig as I } from "./Panel.helpers.es.js";
7
- import { FloatingUIRoot as B } from "../../FloatingUI/FloatingUI.root.es.js";
8
- import { Content as D } from "../../FloatingUI/FloatingUI.content.es.js";
9
- import { a as M } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
10
- import { InlineDivider as _ } from "./Panel.Divider.es.js";
11
- import { PanelResizeHandle as $ } from "./Panel.ResizeHandle.es.js";
12
- import { usePanelResize as b } from "./Panel.useResize.es.js";
13
- import { s as v } from "../../../chunks/panel.module.BblnuBjO.js";
14
- const { baseClassNamePrefix: x, variable: y } = h("panel"), j = ({
15
- children: a,
5
+ import { PanelContext as I } from "./Panel.context.es.js";
6
+ import { getPanelDismissConfig as B } from "./Panel.helpers.es.js";
7
+ import { FloatingUIRoot as D } from "../../FloatingUI/FloatingUI.root.es.js";
8
+ import { Content as M } from "../../FloatingUI/FloatingUI.content.es.js";
9
+ import { a as _ } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
10
+ import { InlineDivider as $ } from "./Panel.Divider.es.js";
11
+ import { PanelResizeHandle as b } from "./Panel.ResizeHandle.es.js";
12
+ import { usePanelResize as j } from "./Panel.useResize.es.js";
13
+ import { s as x } from "../../../chunks/panel.module.BblnuBjO.js";
14
+ const { baseClassNamePrefix: y, variable: C } = F("panel"), k = ({
15
+ children: i,
16
16
  panelClassName: l,
17
17
  resolvedPosition: o,
18
18
  showDivider: n,
19
19
  dividerColor: e,
20
- resizeConfig: i,
20
+ resizeConfig: a,
21
21
  floatingOffset: r,
22
22
  overlayDividerClassName: m,
23
23
  isBlocking: f,
24
+ skipMountAnimation: c,
24
25
  style: s,
25
- ...c
26
+ ...p
26
27
  }) => {
27
- const { refs: p } = M(), { handleRef: d } = b({
28
- resizeConfig: i,
28
+ const { refs: d } = _(), { handleRef: u } = j({
29
+ resizeConfig: a,
29
30
  position: o,
30
- floatingRef: p.floating,
31
+ floatingRef: d.floating,
31
32
  requireMount: !0
32
- }), u = r ? {
33
+ }), g = r ? {
33
34
  ...s,
34
- [y("offset-x")]: r.x,
35
- [y("offset-y")]: r.y
35
+ [C("offset-x")]: r.x,
36
+ [C("offset-y")]: r.y
36
37
  } : s;
37
- return /* @__PURE__ */ P(
38
- D,
38
+ return /* @__PURE__ */ R(
39
+ M,
39
40
  {
40
41
  className: l,
41
42
  skipFloatingStyles: !0,
42
43
  overlay: f,
43
- ...c,
44
- style: u,
44
+ ...p,
45
+ style: g,
45
46
  "data-position": o,
47
+ ...c ? { "data-status": "open" } : {},
46
48
  children: [
47
- a,
48
- n && /* @__PURE__ */ t(_, { position: o, className: m, dividerColor: e }),
49
- i && /* @__PURE__ */ t($, { ref: d })
49
+ i,
50
+ n && /* @__PURE__ */ t(
51
+ $,
52
+ {
53
+ position: o,
54
+ className: m,
55
+ dividerColor: e
56
+ }
57
+ ),
58
+ a && /* @__PURE__ */ t(b, { ref: u })
50
59
  ]
51
60
  }
52
61
  );
53
- }, L = ({
54
- contextValue: a,
62
+ }, Q = ({
63
+ contextValue: i,
55
64
  panelClassName: l,
56
65
  resolvedPosition: o,
57
66
  showDivider: n,
58
67
  modalType: e,
59
- closeOnOutsidePress: i,
68
+ closeOnOutsidePress: a,
60
69
  floatingOffset: r,
61
70
  open: m,
62
71
  onOpenChange: f,
63
- transitionConfig: s,
64
- dividerColor: c,
72
+ transitionConfig: c,
73
+ dividerColor: s,
65
74
  children: p,
66
75
  resizeConfig: d,
67
- ...u
76
+ skipMountAnimation: u,
77
+ ...g
68
78
  }) => {
69
- const g = e === "isModal" || e === "alert", C = I(e, i), N = R(
70
- v[`${x}__overlay-divider`],
71
- v[`${x}__overlay-divider--${o}`]
79
+ const v = e === "isModal" || e === "alert", N = B(e, a), P = h(
80
+ x[`${y}__overlay-divider`],
81
+ x[`${y}__overlay-divider--${o}`]
72
82
  );
73
- return /* @__PURE__ */ t(F.Provider, { value: a, children: /* @__PURE__ */ t(
74
- B,
83
+ return /* @__PURE__ */ t(I.Provider, { value: i, children: /* @__PURE__ */ t(
84
+ D,
75
85
  {
76
86
  open: m,
77
87
  onOpenChange: f,
78
88
  portalled: !0,
79
- transitionConfig: s,
80
- dismiss: C,
81
- focusConfiguration: g ? !0 : { modal: !1, closeOnFocusOut: !1 },
89
+ transitionConfig: c,
90
+ dismiss: N,
91
+ focusConfiguration: v ? !0 : { modal: !1, closeOnFocusOut: !1 },
82
92
  children: /* @__PURE__ */ t(
83
- j,
93
+ k,
84
94
  {
85
95
  panelClassName: l,
86
96
  resolvedPosition: o,
87
97
  showDivider: n,
88
- dividerColor: c,
98
+ dividerColor: s,
89
99
  floatingOffset: r,
90
- overlayDividerClassName: N,
91
- isBlocking: g,
100
+ overlayDividerClassName: P,
101
+ isBlocking: v,
92
102
  resizeConfig: d,
93
- ...u,
103
+ skipMountAnimation: u,
104
+ ...g,
94
105
  role: e === "alert" ? "alertdialog" : "dialog",
95
- "aria-modal": g || void 0,
106
+ "aria-modal": v || void 0,
96
107
  children: p
97
108
  }
98
109
  )
@@ -100,5 +111,5 @@ const { baseClassNamePrefix: x, variable: y } = h("panel"), j = ({
100
111
  ) });
101
112
  };
102
113
  export {
103
- L as OverlayPanel
114
+ Q as OverlayPanel
104
115
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),M=require("clsx"),E=require("react"),V=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const W=require("./Header/Panel.Header.cjs.js"),G=require("./Panel.Body.cjs.js"),U=require("./Footer/Panel.Footer.cjs.js"),c=require("./Panel.helpers.cjs.js"),J=require("./Panel.Inline.cjs.js"),Q=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.CVyUzyCZ.js"),X=165,Y=100,Z=(n,u)=>{if(!n||u==="full")return;const f=u==="bottom",l=typeof n=="object"?n:{},d=l.minSize??(f?Y:X),o=l.maxSize??1/0,P=l.storageKey??"";return{minSize:d,maxSize:o,storageKey:P}},{baseClassNamePrefix:s}=V.getBEMClassNames("panel"),_=({children:n,className:u,padding:f="md",onOpenChange:l,open:d,size:o="md",dismissible:P=!0,closeButtonAriaLabel:m="Close panel",kind:a="inline",position:y,divider:x=!0,dividerColor:g,isAnimated:v=!0,onBeforeClose:z,modalType:i,offset:N,resizable:B,id:O,...p})=>{const t=c.getResolvedPanelPosition(y),r=Z(B,t),D=!!r;if(process.env.NODE_ENV!=="production"){r&&!r.storageKey&&console.warn("Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."),i==="alert"&&P&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');const{closeOnOutsidePress:L}=p;L&&i!=="nonModal"&&i!==void 0&&console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.')}const b=i==="alert"?!1:P,H=o&&(t!=="bottom"||o==="full"),w=a==="overlay"&&N?c.resolveOffset(N):void 0,q=!!w,$=M(e.styles[s],e.styles[`${s}--${a}`],H&&e.styles[`${s}--size-${o}`],e.styles[`${s}--padding-${f}`],e.styles[`${s}--position-${t}`],q&&e.styles[`${s}--floating`],D&&e.styles[`${s}--resizable`],u),T=M(e.styles[`${s}__inline-wrapper`],e.styles[`${s}__inline-wrapper--size-${o}`]),{requestClose:C,handleOverlayOpenChange:R}=c.usePanelClose(z,l),I=E.useMemo(()=>({kind:a,dismissible:b,closeButtonAriaLabel:m,position:y,requestClose:C}),[a,b,m,y,C]),{showDivider:j,dividerBefore:A,dividerInner:F,dividerAfter:K}=c.getPanelDividerState(x&&!q,t),h=E.useMemo(()=>({duration:v?c.PANEL_TRANSITION_DURATION_MS:0}),[v]);return a==="inline"?S.jsx(J.InlinePanel,{contextValue:I,panelClassName:$,inlineWrapperClassName:T,resolvedPosition:t,dividerBefore:A,dividerInner:F,dividerAfter:K,dividerColor:g,open:d,transitionConfig:h,resizeConfig:r,id:O,...p,children:n}):S.jsx(Q.OverlayPanel,{contextValue:I,panelClassName:$,resolvedPosition:t,showDivider:j,dividerColor:g,modalType:i,floatingOffset:w,open:d,onOpenChange:R,transitionConfig:h,resizeConfig:r,id:O,...p,children:n})};_.displayName="Panel";_.Header=W.Header;_.Body=G.Body;_.Footer=U.Footer;exports.Panel=_;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),z=require("clsx"),g=require("react"),W=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const G=require("./Header/Panel.Header.cjs.js"),U=require("./Panel.Body.cjs.js"),Q=require("./Footer/Panel.Footer.cjs.js"),u=require("./Panel.helpers.cjs.js"),X=require("./Panel.Inline.cjs.js"),Y=require("./Panel.Overlay.cjs.js"),e=require("../../../chunks/panel.module.CVyUzyCZ.js"),Z=165,k=100,ee=(t,d)=>{if(!t||d==="full")return;const f=d==="bottom",i=typeof t=="object"?t:{},r=i.minSize??(f?k:Z),o=i.maxSize??1/0,P=i.storageKey??"";return{minSize:r,maxSize:o,storageKey:P}},{baseClassNamePrefix:s}=W.getBEMClassNames("panel"),_=({children:t,className:d,padding:f="md",onOpenChange:i,open:r,size:o="md",dismissible:P=!0,closeButtonAriaLabel:v="Close panel",kind:n="inline",position:y,divider:R=!0,dividerColor:N,isAnimated:O=!0,onBeforeClose:B,modalType:a,offset:b,resizable:D,id:w,...p})=>{const l=u.getResolvedPanelPosition(y),c=ee(D,l),H=!!c;if(process.env.NODE_ENV!=="production"){c&&!c.storageKey&&console.warn("Panel: provide a `storageKey` in the `resizable` config to persist panel size across sessions."),a==="alert"&&P&&console.warn('Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.');const{closeOnOutsidePress:V}=p;V&&a!=="nonModal"&&a!==void 0&&console.warn('Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.')}const C=a==="alert"?!1:P,T=o&&(l!=="bottom"||o==="full"),h=n==="overlay"&&b?u.resolveOffset(b):void 0,q=!!h,$=z(e.styles[s],e.styles[`${s}--${n}`],T&&e.styles[`${s}--size-${o}`],e.styles[`${s}--padding-${f}`],e.styles[`${s}--position-${l}`],q&&e.styles[`${s}--floating`],H&&e.styles[`${s}--resizable`],d),A=z(e.styles[`${s}__inline-wrapper`],e.styles[`${s}__inline-wrapper--size-${o}`]),{requestClose:I,handleOverlayOpenChange:j}=u.usePanelClose(B,i),M=g.useMemo(()=>({kind:n,dismissible:C,closeButtonAriaLabel:v,position:y,requestClose:I}),[n,C,v,y,I]),{showDivider:F,dividerBefore:K,dividerInner:J,dividerAfter:L}=u.getPanelDividerState(R&&!q,l),S=g.useMemo(()=>({duration:O?u.PANEL_TRANSITION_DURATION_MS:0}),[O]),m=g.useRef(void 0),E=m.current!==void 0&&m.current!==n&&r===!0;return m.current=n,n==="inline"?x.jsx(X.InlinePanel,{contextValue:M,panelClassName:$,inlineWrapperClassName:A,resolvedPosition:l,dividerBefore:K,dividerInner:J,dividerAfter:L,dividerColor:N,open:r,transitionConfig:S,resizeConfig:c,skipMountAnimation:E,id:w,...p,children:t}):x.jsx(Y.OverlayPanel,{contextValue:M,panelClassName:$,resolvedPosition:l,showDivider:F,dividerColor:N,modalType:a,floatingOffset:h,open:r,onOpenChange:j,transitionConfig:S,resizeConfig:c,skipMountAnimation:E,id:w,...p,children:t})};_.displayName="Panel";_.Header=G.Header;_.Body=U.Body;_.Footer=Q.Footer;exports.Panel=_;