@viasat/beam-react 2.10.1 → 2.11.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.
Files changed (43) hide show
  1. package/chunks/{FloatingUI.context.2kPXcTvi.js → FloatingUI.context.DtJA57si.js} +123 -109
  2. package/chunks/FloatingUI.context.Du9g2lSg.js +1 -0
  3. package/lib/Dialog/Dialog.Header.cjs.js +1 -1
  4. package/lib/Dialog/Dialog.Header.es.js +1 -1
  5. package/lib/Dialog/Dialog.Trigger.cjs.js +1 -1
  6. package/lib/Dialog/Dialog.Trigger.es.js +1 -1
  7. package/lib/Dialog/Dialog.d.ts +1 -1
  8. package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
  9. package/lib/FloatingUI/FloatingUI.content.es.js +1 -2
  10. package/lib/FloatingUI/FloatingUI.context.cjs.js +1 -1
  11. package/lib/FloatingUI/FloatingUI.context.d.ts +7 -2
  12. package/lib/FloatingUI/FloatingUI.context.es.js +1 -1
  13. package/lib/FloatingUI/FloatingUI.root.cjs.js +1 -1
  14. package/lib/FloatingUI/FloatingUI.root.es.js +1 -1
  15. package/lib/FloatingUI/FloatingUI.trigger.cjs.js +1 -1
  16. package/lib/FloatingUI/FloatingUI.trigger.close.cjs.js +1 -1
  17. package/lib/FloatingUI/FloatingUI.trigger.close.es.js +1 -1
  18. package/lib/FloatingUI/FloatingUI.trigger.es.js +1 -1
  19. package/lib/Menu/ActionListContextWrapper.cjs.js +1 -1
  20. package/lib/Menu/ActionListContextWrapper.es.js +1 -1
  21. package/lib/Menu/Menu.cjs.js +1 -1
  22. package/lib/Menu/Menu.d.ts +1 -1
  23. package/lib/Menu/Menu.es.js +42 -40
  24. package/lib/Popover/Popover.content.cjs.js +1 -1
  25. package/lib/Popover/Popover.content.es.js +1 -1
  26. package/lib/Popover/Popover.d.ts +6 -1
  27. package/lib/Popover/Popover.trigger.cjs.js +1 -1
  28. package/lib/Popover/Popover.trigger.es.js +1 -1
  29. package/lib/Tooltip/Tooltip.cjs.js +1 -1
  30. package/lib/Tooltip/Tooltip.es.js +1 -1
  31. package/lib/wip/Panel/Panel.Header.Row.cjs.js +1 -1
  32. package/lib/wip/Panel/Panel.Header.Row.es.js +17 -17
  33. package/lib/wip/Panel/Panel.cjs.js +1 -1
  34. package/lib/wip/Panel/Panel.context.d.ts +6 -5
  35. package/lib/wip/Panel/Panel.d.ts +1 -1
  36. package/lib/wip/Panel/Panel.es.js +69 -68
  37. package/lib/wip/Panel/Panel.helpers.cjs.js +1 -1
  38. package/lib/wip/Panel/Panel.helpers.d.ts +6 -1
  39. package/lib/wip/Panel/Panel.helpers.es.js +49 -27
  40. package/lib/wip/Panel/Panel.types.d.ts +34 -0
  41. package/lib/wip/Panel/index.d.ts +1 -1
  42. package/package.json +6 -6
  43. package/chunks/FloatingUI.context.BULqADss.js +0 -1
@@ -1,41 +1,41 @@
1
1
  import h from "react";
2
- import { offset as G, autoPlacement as H, shift as J, flip as K, hide as Q } from "@floating-ui/dom";
3
- import { useFloatingNodeId as V, useFloating as Z, autoUpdate as w } from "@floating-ui/react";
4
- import { useConfigurableInteractions as tt } from "../lib/FloatingUI/FloatingUI.interactions.es.js";
5
- const N = Math.min, et = Math.max, nt = {
2
+ import { offset as Y, size as k, autoPlacement as q, flip as J, shift as K, hide as Q } from "@floating-ui/dom";
3
+ import { useFloatingNodeId as Z, useFloating as w, autoUpdate as tt } from "@floating-ui/react";
4
+ import { useConfigurableInteractions as et } from "../lib/FloatingUI/FloatingUI.interactions.es.js";
5
+ const _ = Math.min, nt = Math.max, ot = {
6
6
  left: "right",
7
7
  right: "left",
8
8
  bottom: "top",
9
9
  top: "bottom"
10
10
  };
11
- function ot(t, e, i) {
12
- return et(t, N(e, i));
11
+ function st(t, e, i) {
12
+ return nt(t, _(e, i));
13
13
  }
14
- function st(t, e) {
14
+ function it(t, e) {
15
15
  return typeof t == "function" ? t(e) : t;
16
16
  }
17
- function T(t) {
17
+ function G(t) {
18
18
  return t.split("-")[0];
19
19
  }
20
- function it(t) {
20
+ function ct(t) {
21
21
  return t.split("-")[1];
22
22
  }
23
- function k(t) {
23
+ function W(t) {
24
24
  return t === "x" ? "y" : "x";
25
25
  }
26
- function ct(t) {
27
- return t === "y" ? "height" : "width";
28
- }
29
26
  function rt(t) {
30
- return ["top", "bottom"].includes(T(t)) ? "y" : "x";
27
+ return t === "y" ? "height" : "width";
31
28
  }
32
29
  function lt(t) {
33
- return k(rt(t));
30
+ return ["top", "bottom"].includes(G(t)) ? "y" : "x";
34
31
  }
35
32
  function ft(t) {
36
- return t.replace(/left|right|bottom|top/g, (e) => nt[e]);
33
+ return W(lt(t));
37
34
  }
38
35
  function ut(t) {
36
+ return t.replace(/left|right|bottom|top/g, (e) => ot[e]);
37
+ }
38
+ function at(t) {
39
39
  return {
40
40
  top: 0,
41
41
  right: 0,
@@ -44,53 +44,53 @@ function ut(t) {
44
44
  ...t
45
45
  };
46
46
  }
47
- function at(t) {
48
- return typeof t != "number" ? ut(t) : {
47
+ function pt(t) {
48
+ return typeof t != "number" ? at(t) : {
49
49
  top: t,
50
50
  right: t,
51
51
  bottom: t,
52
52
  left: t
53
53
  };
54
54
  }
55
- const Pt = (t) => {
55
+ const dt = 16, At = (t) => {
56
56
  var e;
57
57
  return {
58
58
  visibility: (e = t.hide) != null && e.referenceHidden ? "hidden" : "visible"
59
59
  };
60
- }, dt = (t) => ({
60
+ }, gt = (t) => ({
61
61
  name: "arrowStyles",
62
62
  options: t,
63
63
  async fn(e) {
64
- var Y, _;
65
- const { x: i, y: c, placement: l, rects: s, platform: n, elements: a, middlewareData: P } = e, { element: d, padding: p = 0 } = st(t, e) || {};
66
- if (d == null)
64
+ var T, V;
65
+ const { x: i, y: c, placement: l, rects: s, platform: n, elements: d, middlewareData: g } = e, { element: u, padding: a = 0 } = it(t, e) || {};
66
+ if (u == null)
67
67
  return {};
68
- const y = at(p), m = { x: i, y: c }, r = lt(l), A = k(r), x = ct(r), u = await n.getDimensions(d), o = r === "y", U = o ? "top" : "left", D = o ? "bottom" : "right", M = o ? "clientHeight" : "clientWidth", j = s.reference[x] + s.reference[r] - m[r] - s.floating[x], X = m[r] - s.reference[r], I = await ((Y = n.getOffsetParent) == null ? void 0 : Y.call(n, d));
69
- let g = I ? I[M] : 0;
70
- (!g || !await ((_ = n.isElement) == null ? void 0 : _.call(n, I))) && (g = a.floating[M] || s.floating[x]);
71
- const z = j / 2 - X / 2, C = g / 2 - u.width / 2 - 1, v = N(y[U], C), $ = N(y[D], C), S = v, b = g - u.width - $, f = g / 2 - u.width / 2 + z, O = ot(S, f, b), B = !P.arrow && it(l) != null && f !== O && s.reference[x] / 2 - (f < S ? v : $) - u.width / 2 < 0, F = B ? f < S ? f - S : f - b : 0, E = T(l), R = ["top", "left"].includes(E) ? -1 : 1, W = u.height * R, q = gt({
72
- placement: E,
73
- arrowHeight: u.height,
74
- arrowWidth: u.width,
68
+ const A = pt(a), m = { x: i, y: c }, r = ft(l), C = W(r), x = rt(r), p = await n.getDimensions(u), I = r === "y", o = I ? "top" : "left", U = I ? "bottom" : "right", $ = I ? "clientHeight" : "clientWidth", L = s.reference[x] + s.reference[r] - m[r] - s.floating[x], j = m[r] - s.reference[r], D = await ((T = n.getOffsetParent) == null ? void 0 : T.call(n, u));
69
+ let b = D ? D[$] : 0;
70
+ (!b || !await ((V = n.isElement) == null ? void 0 : V.call(n, D))) && (b = d.floating[$] || s.floating[x]);
71
+ const M = L / 2 - j / 2, v = b / 2 - p.width / 2 - 1, F = _(A[o], v), E = _(A[U], v), O = F, z = b - p.width - E, f = b / 2 - p.width / 2 + M, P = st(O, f, z), y = !g.arrow && ct(l) != null && f !== P && s.reference[x] / 2 - (f < O ? F : E) - p.width / 2 < 0, N = y ? f < O ? f - O : f - z : 0, S = G(l), X = ["top", "left"].includes(S) ? -1 : 1, B = p.height * X, H = mt({
72
+ placement: S,
73
+ arrowHeight: p.height,
74
+ arrowWidth: p.width,
75
75
  // pass arrow middleware
76
- [r]: O
76
+ [r]: P
77
77
  // for posterity, this is what the floating-ui arrow middleware returns
78
78
  // centerOffset: center - offset - alignmentOffset,
79
79
  // ...(shouldAddOffset && { alignmentOffset }),
80
80
  });
81
81
  return {
82
- [r]: m[r] + F,
83
- [A]: m[A] + W,
84
- data: q,
85
- reset: B
82
+ [r]: m[r] + N,
83
+ [C]: m[C] + B,
84
+ data: H,
85
+ reset: y
86
86
  };
87
87
  }
88
- }), L = (t, e, i, c) => {
88
+ }), R = (t, e, i, c) => {
89
89
  if (c) {
90
90
  const l = c === !0 ? i() : i(c);
91
91
  t[e](l);
92
92
  }
93
- }, pt = ({
93
+ }, ht = ({
94
94
  baseConfig: t,
95
95
  middleware: e,
96
96
  offset: i,
@@ -100,25 +100,36 @@ const Pt = (t) => {
100
100
  const s = { ...t, placement: l };
101
101
  let n = [];
102
102
  if (typeof e.overrides != "object") {
103
- n.push(G(i));
104
- let a = e.flip ?? !0;
105
- e.autoPlacement && (a = !1), L(
103
+ n.push(Y(i));
104
+ let d = e.flip ?? !0;
105
+ if (e.autoPlacement && (d = !1), R(
106
106
  n,
107
107
  "unshift",
108
- H,
108
+ q,
109
109
  e.autoPlacement
110
- ), L(n, "push", J, e.shift ?? !0), L(n, "unshift", K, a), L(n, "push", Q, e.hide ?? !0);
110
+ ), R(n, "unshift", J, d), e.size) {
111
+ const g = e.size === !0 ? {
112
+ padding: dt,
113
+ apply({ availableHeight: u, elements: a }) {
114
+ Object.assign(a.floating.style, {
115
+ maxHeight: `${u}px`
116
+ });
117
+ }
118
+ } : e.size;
119
+ n.push(k(g));
120
+ }
121
+ R(n, "push", K, e.shift ?? !0), R(n, "push", Q, e.hide ?? !0);
111
122
  } else
112
123
  n.push(...e.overrides);
113
- return c.hide || n.push(dt(c.options)), typeof e.overrides == "function" && (n = e.overrides(n)), s.middleware = n, s;
114
- }, gt = ({
124
+ return c.hide || n.push(gt(c.options)), typeof e.overrides == "function" && (n = e.overrides(n)), s.middleware = n, s;
125
+ }, mt = ({
115
126
  placement: t,
116
127
  arrowHeight: e,
117
128
  arrowWidth: i,
118
129
  x: c,
119
130
  y: l
120
131
  }) => {
121
- const s = T(t), n = i / 2 - e, a = {
132
+ const s = G(t), n = i / 2 - e, d = {
122
133
  /* since the default orientation is pointing down, we don't need to rotate the arrow
123
134
  if the tooltip is on top of the reference element
124
135
  */
@@ -146,7 +157,7 @@ const Pt = (t) => {
146
157
  */
147
158
  left: `rotate(-90deg) translateX(${-n}px)`,
148
159
  right: `rotate(90deg) translateX(${n}px)`
149
- }[s], P = -i / 2 - e, d = {
160
+ }[s], g = -i / 2 - e, u = {
150
161
  /*
151
162
  * If the tooltip is at the top of the anchor, place the arrow at the bottom of
152
163
  * the tooltip with bottom: 0. The bottom of the arrow will be flush with the bottom
@@ -188,16 +199,16 @@ const Pt = (t) => {
188
199
  * | .. | | *
189
200
  * | | |/
190
201
  */
191
- left: `${P}px`,
202
+ left: `${g}px`,
192
203
  // similarly for the right side
193
- right: `${P}px`
194
- }[s], p = {
195
- transform: a
204
+ right: `${g}px`
205
+ }[s], a = {
206
+ transform: d
196
207
  };
197
- p.left = c != null ? `${c}px` : "", p.top = l != null ? `${l}px` : "";
198
- const y = ft(s);
199
- return p[y] = d, p;
200
- }, yt = ({
208
+ a.left = c != null ? `${c}px` : "", a.top = l != null ? `${l}px` : "";
209
+ const A = ut(s);
210
+ return a[A] = u, a;
211
+ }, It = ({
201
212
  defaultOpen: t = !1,
202
213
  open: e,
203
214
  placement: i = "top",
@@ -206,44 +217,46 @@ const Pt = (t) => {
206
217
  onOpenChange: l,
207
218
  openOnClick: s,
208
219
  openOnHover: n,
209
- openOnFocus: a,
210
- openOnSelected: P,
211
- focusConfiguration: d,
212
- listNavigation: p,
213
- typeahead: y,
220
+ openOnFocus: d,
221
+ openOnSelected: g,
222
+ focusConfiguration: u,
223
+ listNavigation: a,
224
+ typeahead: A,
214
225
  // Floating UI Middlewares
215
226
  middleware: m,
216
227
  autoPlacement: r,
217
- flip: A = !0,
228
+ flip: C = !0,
218
229
  shift: x = !0,
219
- autoHiding: u,
230
+ autoHiding: p,
231
+ size: I,
220
232
  // Floating UI Arrow
221
233
  arrow: o,
222
234
  transitionConfig: U,
223
- portalled: D,
224
- role: M,
235
+ portalled: $,
236
+ role: L,
225
237
  rootContext: j
226
238
  }) => {
227
- const [X, I] = h.useState(t), [g, z] = h.useState(), [C, v] = h.useState(), [$, S] = h.useState(null), b = e ?? X, f = l ?? I, O = V(), B = h.useMemo(() => ({
228
- ...pt({
239
+ const [D, b] = h.useState(t), [M, v] = h.useState(), [F, E] = h.useState(), [O, z] = h.useState(null), f = e ?? D, P = l ?? b, y = Z(), N = h.useMemo(() => ({
240
+ ...ht({
229
241
  baseConfig: {
230
- open: b,
231
- onOpenChange: f,
232
- whileElementsMounted: w,
233
- nodeId: O,
242
+ open: f,
243
+ onOpenChange: P,
244
+ whileElementsMounted: tt,
245
+ nodeId: y,
234
246
  rootContext: j
235
247
  },
236
248
  middleware: {
237
249
  overrides: m,
238
250
  autoPlacement: r,
239
- flip: A,
251
+ flip: C,
240
252
  shift: x,
241
- hide: u
253
+ hide: p,
254
+ size: I
242
255
  },
243
256
  arrow: {
244
257
  hide: (o == null ? void 0 : o.hide) ?? !1,
245
258
  options: {
246
- element: $ || null,
259
+ element: O || null,
247
260
  padding: o == null ? void 0 : o.edgePadding
248
261
  }
249
262
  },
@@ -251,70 +264,71 @@ const Pt = (t) => {
251
264
  offset: c ?? 0
252
265
  })
253
266
  }), [
254
- O,
255
- b,
267
+ y,
256
268
  f,
269
+ P,
257
270
  m,
258
271
  r,
259
- A,
272
+ C,
260
273
  x,
261
- u,
274
+ p,
275
+ I,
262
276
  o == null ? void 0 : o.hide,
263
277
  o == null ? void 0 : o.edgePadding,
264
- $,
278
+ O,
265
279
  i,
266
280
  c,
267
281
  j
268
- ]), F = Z(B), E = F.context, R = tt({
269
- context: E,
282
+ ]), S = w(N), X = S.context, B = et({
283
+ context: X,
270
284
  openOnClick: s,
271
285
  openOnHover: n,
272
- openOnFocus: a,
273
- openOnSelected: P,
274
- role: M,
275
- listNavigation: p,
276
- typeahead: y
286
+ openOnFocus: d,
287
+ openOnSelected: g,
288
+ role: L,
289
+ listNavigation: a,
290
+ typeahead: A
277
291
  });
278
292
  return h.useMemo(
279
293
  () => ({
280
- open: b,
281
- setOpen: f,
282
- ...R,
283
- ...F,
284
- portalled: D,
285
- focusConfiguration: d,
294
+ open: f,
295
+ setOpen: P,
296
+ ...B,
297
+ ...S,
298
+ portalled: $,
299
+ focusConfiguration: u,
286
300
  transitionConfig: U,
287
- labelId: g,
288
- descriptionId: C,
301
+ labelId: M,
302
+ descriptionId: F,
289
303
  arrow: o,
290
- setLabelId: z,
291
- setDescriptionId: v,
292
- setArrowEl: S,
293
- nodeId: O
304
+ setLabelId: v,
305
+ setDescriptionId: E,
306
+ setArrowEl: z,
307
+ nodeId: y
294
308
  }),
295
309
  [
296
- b,
297
310
  f,
298
- R,
299
- F,
300
- D,
301
- d,
311
+ P,
312
+ B,
313
+ S,
314
+ $,
315
+ u,
302
316
  U,
303
- g,
304
- C,
317
+ M,
318
+ F,
305
319
  o,
306
- O
320
+ y
307
321
  ]
308
322
  );
309
- }, ht = h.createContext(null), St = () => {
310
- const t = h.useContext(ht);
323
+ }, xt = h.createContext(null), St = () => {
324
+ const t = h.useContext(xt);
311
325
  if (t == null)
312
326
  throw new Error("FloatingUI components must be wrapped in <FloatingUI />");
313
327
  return t;
314
328
  };
315
329
  export {
316
- ht as B,
330
+ xt as B,
317
331
  St as a,
318
- yt as u,
319
- Pt as v
332
+ It as u,
333
+ At as v
320
334
  };
@@ -0,0 +1 @@
1
+ "use strict";const h=require("react"),F=require("@floating-ui/dom"),X=require("@floating-ui/react"),J=require("../lib/FloatingUI/FloatingUI.interactions.cjs.js"),G=Math.min,K=Math.max,Q={left:"right",right:"left",bottom:"top",top:"bottom"};function Z(t,e,i){return K(t,G(e,i))}function w(t,e){return typeof t=="function"?t(e):t}function T(t){return t.split("-")[0]}function tt(t){return t.split("-")[1]}function Y(t){return t==="x"?"y":"x"}function et(t){return t==="y"?"height":"width"}function nt(t){return["top","bottom"].includes(T(t))?"y":"x"}function ot(t){return Y(nt(t))}function st(t){return t.replace(/left|right|bottom|top/g,e=>Q[e])}function it(t){return{top:0,right:0,bottom:0,left:0,...t}}function ct(t){return typeof t!="number"?it(t):{top:t,right:t,bottom:t,left:t}}const lt=16,rt=t=>{var e;return{visibility:(e=t.hide)!=null&&e.referenceHidden?"hidden":"visible"}},ut=t=>({name:"arrowStyles",options:t,async fn(e){var V,W;const{x:i,y:c,placement:r,rects:s,platform:n,elements:g,middlewareData:p}=e,{element:f,padding:a=0}=w(t,e)||{};if(f==null)return{};const y=ct(a),m={x:i,y:c},l=ot(r),U=Y(l),x=et(l),d=await n.getDimensions(f),A=l==="y",o=A?"top":"left",j=A?"bottom":"right",C=A?"clientHeight":"clientWidth",_=s.reference[x]+s.reference[l]-m[l]-s.floating[x],B=m[l]-s.reference[l],$=await((V=n.getOffsetParent)==null?void 0:V.call(n,f));let b=$?$[C]:0;(!b||!await((W=n.isElement)==null?void 0:W.call(n,$)))&&(b=g.floating[C]||s.floating[x]);const M=_/2-B/2,v=b/2-d.width/2-1,D=G(y[o],v),E=G(y[j],v),O=D,z=b-d.width-E,u=b/2-d.width/2+M,P=Z(O,u,z),I=!p.arrow&&tt(r)!=null&&u!==P&&s.reference[x]/2-(u<O?D:E)-d.width/2<0,H=I?u<O?u-O:u-z:0,S=T(r),L=["top","left"].includes(S)?-1:1,q=d.height*L,N=at({placement:S,arrowHeight:d.height,arrowWidth:d.width,[l]:P});return{[l]:m[l]+H,[U]:m[U]+q,data:N,reset:I}}}),R=(t,e,i,c)=>{if(c){const r=c===!0?i():i(c);t[e](r)}},ft=({baseConfig:t,middleware:e,offset:i,arrow:c,placement:r="top"})=>{const s={...t,placement:r};let n=[];if(typeof e.overrides!="object"){n.push(F.offset(i));let g=e.flip??!0;if(e.autoPlacement&&(g=!1),R(n,"unshift",F.autoPlacement,e.autoPlacement),R(n,"unshift",F.flip,g),e.size){const p=e.size===!0?{padding:lt,apply({availableHeight:f,elements:a}){Object.assign(a.floating.style,{maxHeight:`${f}px`})}}:e.size;n.push(F.size(p))}R(n,"push",F.shift,e.shift??!0),R(n,"push",F.hide,e.hide??!0)}else n.push(...e.overrides);return c.hide||n.push(ut(c.options)),typeof e.overrides=="function"&&(n=e.overrides(n)),s.middleware=n,s},at=({placement:t,arrowHeight:e,arrowWidth:i,x:c,y:r})=>{const s=T(t),n=i/2-e,g={top:"rotate(0deg)",bottom:"rotate(180deg)",left:`rotate(-90deg) translateX(${-n}px)`,right:`rotate(90deg) translateX(${n}px)`}[s],p=-i/2-e,f={top:`${-e}px`,bottom:`${-e*2}px`,left:`${p}px`,right:`${p}px`}[s],a={transform:g};a.left=c!=null?`${c}px`:"",a.top=r!=null?`${r}px`:"";const y=st(s);return a[y]=f,a},dt=({defaultOpen:t=!1,open:e,placement:i="top",offset:c,onOpenChange:r,openOnClick:s,openOnHover:n,openOnFocus:g,openOnSelected:p,focusConfiguration:f,listNavigation:a,typeahead:y,middleware:m,autoPlacement:l,flip:U=!0,shift:x=!0,autoHiding:d,size:A,arrow:o,transitionConfig:j,portalled:C,role:_,rootContext:B})=>{const[$,b]=h.useState(t),[M,v]=h.useState(),[D,E]=h.useState(),[O,z]=h.useState(null),u=e??$,P=r??b,I=X.useFloatingNodeId(),H=h.useMemo(()=>{const N={open:u,onOpenChange:P,whileElementsMounted:X.autoUpdate,nodeId:I,rootContext:B};return{...ft({baseConfig:N,middleware:{overrides:m,autoPlacement:l,flip:U,shift:x,hide:d,size:A},arrow:{hide:(o==null?void 0:o.hide)??!1,options:{element:O||null,padding:o==null?void 0:o.edgePadding}},placement:i,offset:c??0})}},[I,u,P,m,l,U,x,d,A,o==null?void 0:o.hide,o==null?void 0:o.edgePadding,O,i,c,B]),S=X.useFloating(H),L=S.context,q=J.useConfigurableInteractions({context:L,openOnClick:s,openOnHover:n,openOnFocus:g,openOnSelected:p,role:_,listNavigation:a,typeahead:y});return h.useMemo(()=>({open:u,setOpen:P,...q,...S,portalled:C,focusConfiguration:f,transitionConfig:j,labelId:M,descriptionId:D,arrow:o,setLabelId:v,setDescriptionId:E,setArrowEl:z,nodeId:I}),[u,P,q,S,C,f,j,M,D,o,I])},k=h.createContext(null),gt=()=>{const t=h.useContext(k);if(t==null)throw new Error("FloatingUI components must be wrapped in <FloatingUI />");return t};exports.BmFloatingUIContext=k;exports.useBmFloatingUI=dt;exports.useBmFloatingUIContext=gt;exports.visibilityHandler=rt;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("clsx"),x=require("react"),q=require("../../chunks/CheckCircleOutline.iRHrT_Eb.js"),y=require("../../chunks/ErrorOutline.Cb78OesH.js"),E=require("../../chunks/InfoOutline.Gr8gkm5N.js"),I=require("../../chunks/WarningOutlined.BPePPeyt.js"),u=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const i=require("../../chunks/dialog.module.COfowyPc.js"),$=require("../Tooltip/Tooltip.cjs.js"),B=require("../CloseButton/CloseButton.cjs.js"),O=require("../../chunks/FloatingUI.context.BULqADss.js"),S=require("./Dialog.context.cjs.js"),c={positive:"Success",warning:"Warning",negative:"Error",information:"Information"},k=({icon:t,appearance:l,iconAriaLabel:s})=>{const o=x.useMemo(()=>({positive:e.jsx(q.SvgCheckCircleOutline,{role:"img","aria-label":s||c.positive}),warning:e.jsx(I.SvgWarningOutlined,{role:"img","aria-label":s||c.warning}),negative:e.jsx(y.SvgErrorOutline,{role:"img","aria-label":s||c.negative}),information:e.jsx(E.SvgInfoOutline,{role:"img","aria-label":s||c.information})}),[s]),{subElementClassPrefix:r}=u.getBEMClassNames("dialog__header"),a=m(i.styles[`${r}icon`],l&&i.styles[`${r}icon--${l}`]);return!t&&!l?null:e.jsx("div",{className:a,children:t||(l?o[l]:null)})},w=({ariaLabel:t="Close dialog"})=>{const{subElementClassPrefix:l}=u.getBEMClassNames("dialog__header"),{setOpen:s}=O.useBmFloatingUIContext(),o=x.useCallback(r=>{s==null||s(!1,r,"click")},[s]);return e.jsx("div",{className:i.styles[`${l}close-trigger`],children:e.jsx($.Tooltip,{text:t,children:e.jsx(B.CloseButton,{"aria-label":t,size:"lg",onClick:o})})})},C=({children:t,className:l,dismissible:s=!0,appearance:o,closeButtonAriaLabel:r="Close dialog",heading:a,description:g,icon:f,iconAriaLabel:h,divider:d=!0,disableDividerOnOverflow:j=!1,...v})=>{const{baseClassNamePrefix:_,subElementClassPrefix:n}=u.getBEMClassNames("dialog__header"),{overflowing:N}=S.useDialogContext(),b=d===!0||d===!1&&!j&&N;return e.jsxs("div",{className:m(i.styles[_],l),...v,children:[e.jsxs("div",{className:i.styles[`${n}row`],children:[e.jsx(k,{icon:f,appearance:o,iconAriaLabel:h}),a&&e.jsx("h2",{className:i.styles[`${n}heading`],children:a}),s&&e.jsx(w,{ariaLabel:r})]}),g&&e.jsx("p",{className:i.styles[`${n}description`],children:g}),t&&e.jsx("div",{className:i.styles[`${n}children`],children:t}),b&&e.jsx("hr",{"aria-hidden":"true",className:i.styles[`${n}divider`]})]})};C.displayName="Dialog.Header";exports.Header=C;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("clsx"),x=require("react"),q=require("../../chunks/CheckCircleOutline.iRHrT_Eb.js"),y=require("../../chunks/ErrorOutline.Cb78OesH.js"),E=require("../../chunks/InfoOutline.Gr8gkm5N.js"),I=require("../../chunks/WarningOutlined.BPePPeyt.js"),u=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const i=require("../../chunks/dialog.module.COfowyPc.js"),$=require("../Tooltip/Tooltip.cjs.js"),B=require("../CloseButton/CloseButton.cjs.js"),O=require("../../chunks/FloatingUI.context.Du9g2lSg.js"),S=require("./Dialog.context.cjs.js"),c={positive:"Success",warning:"Warning",negative:"Error",information:"Information"},k=({icon:t,appearance:l,iconAriaLabel:s})=>{const o=x.useMemo(()=>({positive:e.jsx(q.SvgCheckCircleOutline,{role:"img","aria-label":s||c.positive}),warning:e.jsx(I.SvgWarningOutlined,{role:"img","aria-label":s||c.warning}),negative:e.jsx(y.SvgErrorOutline,{role:"img","aria-label":s||c.negative}),information:e.jsx(E.SvgInfoOutline,{role:"img","aria-label":s||c.information})}),[s]),{subElementClassPrefix:r}=u.getBEMClassNames("dialog__header"),a=m(i.styles[`${r}icon`],l&&i.styles[`${r}icon--${l}`]);return!t&&!l?null:e.jsx("div",{className:a,children:t||(l?o[l]:null)})},w=({ariaLabel:t="Close dialog"})=>{const{subElementClassPrefix:l}=u.getBEMClassNames("dialog__header"),{setOpen:s}=O.useBmFloatingUIContext(),o=x.useCallback(r=>{s==null||s(!1,r,"click")},[s]);return e.jsx("div",{className:i.styles[`${l}close-trigger`],children:e.jsx($.Tooltip,{text:t,children:e.jsx(B.CloseButton,{"aria-label":t,size:"lg",onClick:o})})})},C=({children:t,className:l,dismissible:s=!0,appearance:o,closeButtonAriaLabel:r="Close dialog",heading:a,description:g,icon:f,iconAriaLabel:h,divider:d=!0,disableDividerOnOverflow:j=!1,...v})=>{const{baseClassNamePrefix:_,subElementClassPrefix:n}=u.getBEMClassNames("dialog__header"),{overflowing:N}=S.useDialogContext(),b=d===!0||d===!1&&!j&&N;return e.jsxs("div",{className:m(i.styles[_],l),...v,children:[e.jsxs("div",{className:i.styles[`${n}row`],children:[e.jsx(k,{icon:f,appearance:o,iconAriaLabel:h}),a&&e.jsx("h2",{className:i.styles[`${n}heading`],children:a}),s&&e.jsx(w,{ariaLabel:r})]}),g&&e.jsx("p",{className:i.styles[`${n}description`],children:g}),t&&e.jsx("div",{className:i.styles[`${n}children`],children:t}),b&&e.jsx("hr",{"aria-hidden":"true",className:i.styles[`${n}divider`]})]})};C.displayName="Dialog.Header";exports.Header=C;
@@ -10,7 +10,7 @@ import "../../chunks/constants.CKKGf1-i.js";
10
10
  import { s as r } from "../../chunks/dialog.module.D6BI3ubv.js";
11
11
  import { Tooltip as k } from "../Tooltip/Tooltip.es.js";
12
12
  import { CloseButton as B } from "../CloseButton/CloseButton.es.js";
13
- import { a as P } from "../../chunks/FloatingUI.context.2kPXcTvi.js";
13
+ import { a as P } from "../../chunks/FloatingUI.context.DtJA57si.js";
14
14
  import { useDialogContext as D } from "./Dialog.context.es.js";
15
15
  const m = {
16
16
  positive: "Success",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("../../chunks/FloatingUI.context.BULqADss.js");const l=require("../FloatingUI/FloatingUI.trigger.cjs.js"),t=require("../FloatingUI/FloatingUI.trigger.close.cjs.js");require("../FloatingUI/FloatingUI.content.cjs.js");require("react");const g=({children:e,...r})=>i.jsx(l.Trigger,{...r,children:e});g.displayName="Dialog.Trigger";const o=({children:e,...r})=>i.jsx(t.CloseTrigger,{...r,children:e});o.displayName="Dialog.CloseTrigger";exports.CloseTrigger=o;exports.Trigger=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");require("../../chunks/FloatingUI.context.Du9g2lSg.js");const l=require("../FloatingUI/FloatingUI.trigger.cjs.js"),t=require("../FloatingUI/FloatingUI.trigger.close.cjs.js");require("../FloatingUI/FloatingUI.content.cjs.js");require("react");const g=({children:e,...r})=>i.jsx(l.Trigger,{...r,children:e});g.displayName="Dialog.Trigger";const o=({children:e,...r})=>i.jsx(t.CloseTrigger,{...r,children:e});o.displayName="Dialog.CloseTrigger";exports.CloseTrigger=o;exports.Trigger=g;
@@ -1,5 +1,5 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import "../../chunks/FloatingUI.context.2kPXcTvi.js";
2
+ import "../../chunks/FloatingUI.context.DtJA57si.js";
3
3
  import { Trigger as o } from "../FloatingUI/FloatingUI.trigger.es.js";
4
4
  import { CloseTrigger as e } from "../FloatingUI/FloatingUI.trigger.close.es.js";
5
5
  import "../FloatingUI/FloatingUI.content.es.js";
@@ -3,7 +3,7 @@ import { FloatingPortalProps, UseFloatingOptions, UseRoleProps } from '@floating
3
3
  import { ThemeTypes } from '@viasat/beam-shared/utils';
4
4
  import { DialogSize } from '@viasat/beam-shared/components/dialog';
5
5
  import { FloatingUIProps } from '../FloatingUI/FloatingUI.context';
6
- export interface DialogProps extends Omit<FloatingUIProps, 'arrow' | 'offset' | 'autoHiding' | 'autoPlacement' | 'flip' | 'listNavigation' | 'middleware' | 'openOnClick' | 'openOnFocus' | 'openOnHover' | 'placement' | 'rootContext' | 'shift' | 'transitionConfig' | 'typeahead'> {
6
+ export interface DialogProps extends Omit<FloatingUIProps, 'arrow' | 'offset' | 'autoHiding' | 'autoPlacement' | 'flip' | 'listNavigation' | 'middleware' | 'openOnClick' | 'openOnFocus' | 'openOnHover' | 'placement' | 'rootContext' | 'shift' | 'size' | 'transitionConfig' | 'typeahead'> {
7
7
  /**
8
8
  * Specify the theme of the Dialog. By default it inherits the theme from the parent
9
9
  */
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),x=require("../../chunks/FloatingUI.context.BULqADss.js"),f=require("react"),i=require("@floating-ui/react"),m=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const b=require("clsx"),d=require("../../chunks/floatingui.module.D3Aw_aYe.js"),w=require("../Box/Box.cjs.js"),N=require("./FloatingUI.arrow.cjs.js");function S({children:o,props:e}){if(!e)return o;const t=typeof e=="boolean"?{}:e;return a.jsx(i.FloatingPortal,{...t,children:o})}function v({children:o,props:e}){if(!e)return o;const t=typeof e=="boolean",r=e==="transparent",{baseClassNamePrefix:l,classModifierPrefix:c}=m.getBEMClassNames("floatingui__overlay"),u={className:b(d.floatinguiStyles[l],r&&d.floatinguiStyles[`${c}transparent`]),lockScroll:!0},s=t||r?u:{...u,...e};return a.jsx(i.FloatingOverlay,{...s,children:o})}function B({children:o,context:e,props:t}){const r=f.useMemo(()=>({context:e,...typeof t=="boolean"?{}:t}),[e,t]);return t?a.jsx(i.FloatingFocusManager,{...r,children:o}):o}const y=f.forwardRef(({children:o,className:e,style:t,overlay:r,skipFloatingStyles:l=!1,...c},u)=>{const{context:s,nodeId:C,arrow:g,...n}=x.useBmFloatingUIContext(),P=i.useMergeRefs([n.refs.setFloating,u]),{isMounted:_,status:j}=i.useTransitionStatus(s,n.transitionConfig),{baseClassNamePrefix:F}=m.getBEMClassNames("floatingui"),q=l?e:b(d.floatinguiStyles[F],e),I=f.useMemo(()=>({...l?{}:s.floatingStyles,...x.visibilityHandler(s.middlewareData),...t}),[s.floatingStyles,s.middlewareData,l,t]);return _?a.jsx(i.FloatingNode,{id:C,children:a.jsx(S,{props:n.portalled,children:a.jsx(v,{props:r,children:a.jsx(B,{context:s,props:n.focusConfiguration,children:a.jsxs(w.Box,{"data-status":j,ref:P,style:I,className:q,"aria-labelledby":n.labelId,"aria-describedby":n.descriptionId,...n.getFloatingProps(c),children:[o,g&&a.jsx(N.Arrow,{options:g,middleware:n.middlewareData,ref:M=>n.setArrowEl(M)})]})})})})}):null});exports.Content=y;exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),x=require("../../chunks/FloatingUI.context.Du9g2lSg.js"),f=require("react"),i=require("@floating-ui/react"),m=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const b=require("clsx"),d=require("../../chunks/floatingui.module.D3Aw_aYe.js"),w=require("../Box/Box.cjs.js"),N=require("./FloatingUI.arrow.cjs.js");function S({children:o,props:e}){if(!e)return o;const t=typeof e=="boolean"?{}:e;return a.jsx(i.FloatingPortal,{...t,children:o})}function v({children:o,props:e}){if(!e)return o;const t=typeof e=="boolean",r=e==="transparent",{baseClassNamePrefix:l,classModifierPrefix:c}=m.getBEMClassNames("floatingui__overlay"),u={className:b(d.floatinguiStyles[l],r&&d.floatinguiStyles[`${c}transparent`]),lockScroll:!0},s=t||r?u:{...u,...e};return a.jsx(i.FloatingOverlay,{...s,children:o})}function B({children:o,context:e,props:t}){const r=f.useMemo(()=>({context:e,...typeof t=="boolean"?{}:t}),[e,t]);return t?a.jsx(i.FloatingFocusManager,{...r,children:o}):o}const y=f.forwardRef(({children:o,className:e,style:t,overlay:r,skipFloatingStyles:l=!1,...c},u)=>{const{context:s,nodeId:C,arrow:g,...n}=x.useBmFloatingUIContext(),P=i.useMergeRefs([n.refs.setFloating,u]),{isMounted:_,status:j}=i.useTransitionStatus(s,n.transitionConfig),{baseClassNamePrefix:F}=m.getBEMClassNames("floatingui"),q=l?e:b(d.floatinguiStyles[F],e),I=f.useMemo(()=>({...l?{}:s.floatingStyles,...x.visibilityHandler(s.middlewareData),...t}),[s.floatingStyles,s.middlewareData,l,t]);return _?a.jsx(i.FloatingNode,{id:C,children:a.jsx(S,{props:n.portalled,children:a.jsx(v,{props:r,children:a.jsx(B,{context:s,props:n.focusConfiguration,children:a.jsxs(w.Box,{"data-status":j,ref:P,style:I,className:q,"aria-labelledby":n.labelId,"aria-describedby":n.descriptionId,...n.getFloatingProps(c),children:[o,g&&a.jsx(N.Arrow,{options:g,middleware:n.middlewareData,ref:M=>n.setArrowEl(M)})]})})})})}):null});exports.Content=y;exports.default=y;
@@ -1,5 +1,5 @@
1
1
  import { jsx as n, jsxs as M } from "react/jsx-runtime";
2
- import { a as v, v as I } from "../../chunks/FloatingUI.context.2kPXcTvi.js";
2
+ import { a as v, v as I } from "../../chunks/FloatingUI.context.DtJA57si.js";
3
3
  import c, { useMemo as N } from "react";
4
4
  import { useMergeRefs as B, useTransitionStatus as R, FloatingNode as S, FloatingPortal as D, FloatingOverlay as O, FloatingFocusManager as U } from "@floating-ui/react";
5
5
  import { g as u } from "../../chunks/classNames.BTJmrO_L.js";
@@ -60,7 +60,6 @@ const V = c.forwardRef(
60
60
  ), { baseClassNamePrefix: y } = u("floatingui"), C = s ? t : g(d[y], t), w = N(
61
61
  () => ({
62
62
  ...s ? {} : r.floatingStyles,
63
- // Use floatingStyles for non-dialog content
64
63
  ...I(r.middlewareData),
65
64
  ...e
66
65
  }),
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const t=require("../../chunks/FloatingUI.context.BULqADss.js");require("@floating-ui/react");require("./FloatingUI.interactions.cjs.js");exports.BmFloatingUIContext=t.BmFloatingUIContext;exports.useBmFloatingUI=t.useBmFloatingUI;exports.useBmFloatingUIContext=t.useBmFloatingUIContext;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react");const t=require("../../chunks/FloatingUI.context.Du9g2lSg.js");require("@floating-ui/react");require("./FloatingUI.interactions.cjs.js");exports.BmFloatingUIContext=t.BmFloatingUIContext;exports.useBmFloatingUI=t.useBmFloatingUI;exports.useBmFloatingUIContext=t.useBmFloatingUIContext;
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { MiddlewareModifier } from '@viasat/beam-shared/components/floatingui';
3
- import { Placement, AutoPlacementOptions, FlipOptions, ShiftOptions, HideOptions, OffsetOptions, UseHoverProps, UseClickProps, UseFocusProps, FloatingPortalProps, UseTransitionStylesProps, UseFloatingOptions, UseRoleProps, FloatingRootContext, UseListNavigationProps, UseTypeaheadProps } from '@floating-ui/react';
3
+ import { Placement, AutoPlacementOptions, FlipOptions, ShiftOptions, HideOptions, OffsetOptions, UseHoverProps, UseClickProps, UseFocusProps, FloatingPortalProps, UseTransitionStylesProps, UseFloatingOptions, UseRoleProps, FloatingRootContext, UseListNavigationProps, UseTypeaheadProps, SizeOptions } from '@floating-ui/react';
4
4
  import { FocusManagerProps } from '../FloatingUI/FloatingUI.content';
5
5
  import { ArrowOptions } from '../FloatingUI/FloatingUI.arrow';
6
6
  import { UseSelectedProps } from './useSelected';
@@ -36,6 +36,11 @@ export interface FloatingUIProps {
36
36
  * [HideOptions](https://floating-ui.com/docs/hide#options)
37
37
  */
38
38
  autoHiding?: boolean | HideOptions;
39
+ /**
40
+ * Constrain the floating element's size to fit within available space.
41
+ * [SizeOptions](https://floating-ui.com/docs/size#options)
42
+ */
43
+ size?: boolean | SizeOptions;
39
44
  /**
40
45
  * Middleware functions to modify the behavior of the floating element
41
46
  */
@@ -116,7 +121,7 @@ export interface FloatingUIProps {
116
121
  */
117
122
  typeahead?: UseTypeaheadProps;
118
123
  }
119
- export declare const useBmFloatingUI: ({ defaultOpen, open: controlledOpen, placement, offset: _offset, onOpenChange: setControlledOpen, openOnClick, openOnHover, openOnFocus, openOnSelected, focusConfiguration, listNavigation, typeahead, middleware, autoPlacement, flip, shift, autoHiding, arrow, transitionConfig, portalled, role, rootContext, }: FloatingUIProps) => {
124
+ export declare const useBmFloatingUI: ({ defaultOpen, open: controlledOpen, placement, offset: _offset, onOpenChange: setControlledOpen, openOnClick, openOnHover, openOnFocus, openOnSelected, focusConfiguration, listNavigation, typeahead, middleware, autoPlacement, flip, shift, autoHiding, size, arrow, transitionConfig, portalled, role, rootContext, }: FloatingUIProps) => {
120
125
  portalled: boolean | FloatingPortalProps | undefined;
121
126
  focusConfiguration: boolean | FocusManagerProps | undefined;
122
127
  transitionConfig: UseTransitionStylesProps | undefined;
@@ -1,5 +1,5 @@
1
1
  import "react";
2
- import { B as e, u as n, a as r } from "../../chunks/FloatingUI.context.2kPXcTvi.js";
2
+ import { B as e, u as n, a as r } from "../../chunks/FloatingUI.context.DtJA57si.js";
3
3
  import "@floating-ui/react";
4
4
  import "./FloatingUI.interactions.es.js";
5
5
  export {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),t=require("../../chunks/FloatingUI.context.BULqADss.js");function e({children:o,...i}){const n=t.useBmFloatingUI({...i});return l.jsx(t.BmFloatingUIContext.Provider,{value:n,children:o})}exports.FloatingUIRoot=e;exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),t=require("../../chunks/FloatingUI.context.Du9g2lSg.js");function e({children:o,...i}){const n=t.useBmFloatingUI({...i});return l.jsx(t.BmFloatingUIContext.Provider,{value:n,children:o})}exports.FloatingUIRoot=e;exports.default=e;
@@ -1,5 +1,5 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
- import { u as n, B as r } from "../../chunks/FloatingUI.context.2kPXcTvi.js";
2
+ import { u as n, B as r } from "../../chunks/FloatingUI.context.DtJA57si.js";
3
3
  function m({
4
4
  children: o,
5
5
  ...t
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),u=require("../../chunks/FloatingUI.context.BULqADss.js"),l=require("@floating-ui/react"),g=require("../../utils/functions.cjs.js"),n=({children:t,...s})=>{try{const r=u.useBmFloatingUIContext(),e=o.useMemo(()=>g.ensureSingularRef(t),[t]),c=l.useMergeRefs([r.refs.setReference,e.props.ref??e.ref]),i=r.getReferenceProps({...s,...e.props,ref:c});return o.cloneElement(e,i)}catch{throw new Error("Expected a single child element with a ref for the FloatingUI trigger")}};exports.Trigger=n;exports.default=n;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react"),u=require("../../chunks/FloatingUI.context.Du9g2lSg.js"),l=require("@floating-ui/react"),g=require("../../utils/functions.cjs.js"),n=({children:t,...s})=>{try{const r=u.useBmFloatingUIContext(),e=o.useMemo(()=>g.ensureSingularRef(t),[t]),c=l.useMergeRefs([r.refs.setReference,e.props.ref??e.ref]),i=r.getReferenceProps({...s,...e.props,ref:c});return o.cloneElement(e,i)}catch{throw new Error("Expected a single child element with a ref for the FloatingUI trigger")}};exports.Trigger=n;exports.default=n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),o=require("react"),d=require("../../utils/functions.cjs.js"),m=require("../../chunks/FloatingUI.context.BULqADss.js"),g=({children:l,...n})=>{const{setOpen:s}=m.useBmFloatingUIContext(),e=o.useMemo(()=>d.ensureSingularRef(l),[l]),r=o.useCallback(t=>{s==null||s(!1,t,"click")},[s]),c=o.useCallback(t=>{var i,u;r(t),(u=(i=e.props).onClick)==null||u.call(i,t)},[r,e.props]),C=o.useMemo(()=>({...n,...e.props,onClick:c}),[c,n,e.props]);return a.jsx(a.Fragment,{children:o.cloneElement(e,C)})};exports.CloseTrigger=g;exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),o=require("react"),d=require("../../utils/functions.cjs.js"),m=require("../../chunks/FloatingUI.context.Du9g2lSg.js"),g=({children:l,...n})=>{const{setOpen:s}=m.useBmFloatingUIContext(),e=o.useMemo(()=>d.ensureSingularRef(l),[l]),r=o.useCallback(t=>{s==null||s(!1,t,"click")},[s]),c=o.useCallback(t=>{var i,u;r(t),(u=(i=e.props).onClick)==null||u.call(i,t)},[r,e.props]),C=o.useMemo(()=>({...n,...e.props,onClick:c}),[c,n,e.props]);return a.jsx(a.Fragment,{children:o.cloneElement(e,C)})};exports.CloseTrigger=g;exports.default=g;
@@ -1,7 +1,7 @@
1
1
  import { jsx as f, Fragment as u } from "react/jsx-runtime";
2
2
  import { useMemo as a, useCallback as m, cloneElement as C } from "react";
3
3
  import { ensureSingularRef as d } from "../../utils/functions.es.js";
4
- import { a as g } from "../../chunks/FloatingUI.context.2kPXcTvi.js";
4
+ import { a as g } from "../../chunks/FloatingUI.context.DtJA57si.js";
5
5
  const b = ({ children: e, ...l }) => {
6
6
  const { setOpen: r } = g(), o = a(() => d(e), [e]), n = m(
7
7
  (s) => {
@@ -1,5 +1,5 @@
1
1
  import f, { useMemo as c } from "react";
2
- import { a } from "../../chunks/FloatingUI.context.2kPXcTvi.js";
2
+ import { a } from "../../chunks/FloatingUI.context.DtJA57si.js";
3
3
  import { useMergeRefs as i } from "@floating-ui/react";
4
4
  import { ensureSingularRef as m } from "../../utils/functions.es.js";
5
5
  const h = ({ children: r, ...o }) => {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("../ActionList/ActionList.context.cjs.js"),r=require("../../chunks/FloatingUI.context.BULqADss.js"),s=({children:t,...e})=>{const{getItemProps:o}=r.useBmFloatingUIContext();return i.jsx(n.ActionListContextProvider,{getItemProps:o,...e,children:t})};exports.ActionListContextWrapper=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("../ActionList/ActionList.context.cjs.js"),r=require("../../chunks/FloatingUI.context.Du9g2lSg.js"),s=({children:t,...e})=>{const{getItemProps:o}=r.useBmFloatingUIContext();return i.jsx(n.ActionListContextProvider,{getItemProps:o,...e,children:t})};exports.ActionListContextWrapper=s;
@@ -1,6 +1,6 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
2
  import { ActionListContextProvider as i } from "../ActionList/ActionList.context.es.js";
3
- import { a as n } from "../../chunks/FloatingUI.context.2kPXcTvi.js";
3
+ import { a as n } from "../../chunks/FloatingUI.context.DtJA57si.js";
4
4
  const x = ({
5
5
  children: t,
6
6
  ...o
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),t=require("react"),T=require("../Popover/Popover.cjs.js"),C=require("./Menu.context.cjs.js"),k=require("./Menu.PopoverContent.cjs.js"),F=require("./Menu.Trigger.cjs.js"),j=require("@floating-ui/react"),w=require("./ActionListContextWrapper.cjs.js"),H=require("../ActionList/ActionList.context.cjs.js"),N="12rem",r=({children:O,open:M,onOpenChange:x,maxHeight:d,minWidth:f,maxWidth:m,...o})=>{const e=C.useMenuContext(),[b,g]=t.useState(null),v=t.useRef([]),h=t.useRef([]),n=e===void 0,s=!n,[y,A]=t.useState(o.defaultOpen??!1),P=M??y,i=x??A,_=t.useCallback(l=>{i(!1,l,"click"),e==null||e.close()},[i,e]),p=t.useCallback(l=>{e==null||e.open(l),i(!0)},[i,e]),c=t.useMemo(()=>({parentMenuContext:e,minWidth:f??(e==null?void 0:e.minWidth)??N,maxWidth:m??(e==null?void 0:e.maxWidth),maxHeight:d??(e==null?void 0:e.maxHeight),close:_,open:p}),[_,d,m,f,p,e]),q=t.useCallback((l,u,L)=>{u!=="checkbox"&&u!=="radio"&&u!=="flyout"&&c.close(L)},[c]),I=t.useMemo(()=>[r],[]),R=H.useActionListContext();return a.jsx(C.MenuContext.Provider,{value:c,children:a.jsx(T.Popover,{open:P,onOpenChange:i,placement:n?"bottom-start":"right-start",openOnClick:n,openOnHover:{enabled:s,mouseOnly:!0,move:s,handleClose:j.safePolygon({blockPointerEvents:!0})},openOnFocus:s,flip:!0,hideArrow:!0,portalled:o.portalled??!0,autoHiding:!1,...o,focusConfiguration:{modal:!1,initialFocus:s?-1:0,returnFocus:n,restoreFocus:n,order:["content","reference"],...o.focusConfiguration},listNavigation:{enabled:!0,listRef:v,activeIndex:b,onNavigate:g,loop:!0,focusItemOnHover:!1,focusItemOnOpen:!0,openOnArrowKeyDown:!0,nested:s,...o.listNavigation},typeahead:{enabled:!0,listRef:h,activeIndex:b,onMatch:g,...o.typeahead},role:{enabled:!0,role:"menu",...o.role},children:a.jsx(w.ActionListContextWrapper,{elementsRef:v,labelsRef:h,itemsFocusable:!1,onItemClick:q,insideMenu:!0,allowChildrenTypes:I,parentContext:R,children:O})})})};r.Trigger=F.MenuTrigger;r.PopoverContent=k.MenuPopoverContent;exports.Menu=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),t=require("react"),k=require("../Popover/Popover.cjs.js"),C=require("./Menu.context.cjs.js"),F=require("./Menu.PopoverContent.cjs.js"),j=require("./Menu.Trigger.cjs.js"),w=require("@floating-ui/react"),N=require("./ActionListContextWrapper.cjs.js"),W=require("../ActionList/ActionList.context.cjs.js"),H="12rem",r=({children:O,open:M,onOpenChange:x,maxHeight:c,minWidth:f,maxWidth:b,size:y,...o})=>{const e=C.useMenuContext(),[m,v]=t.useState(null),g=t.useRef([]),_=t.useRef([]),n=e===void 0,s=!n,[A,P]=t.useState(o.defaultOpen??!1),q=M??A,i=x??P,h=t.useCallback(l=>{i(!1,l,"click"),e==null||e.close()},[i,e]),p=t.useCallback(l=>{e==null||e.open(l),i(!0)},[i,e]),u=t.useMemo(()=>({parentMenuContext:e,minWidth:f??(e==null?void 0:e.minWidth)??H,maxWidth:b??(e==null?void 0:e.maxWidth),maxHeight:c??(e==null?void 0:e.maxHeight),close:h,open:p}),[h,c,b,f,p,e]),I=t.useCallback((l,a,T)=>{a!=="checkbox"&&a!=="radio"&&a!=="flyout"&&u.close(T)},[u]),R=t.useMemo(()=>[r],[]),L=W.useActionListContext();return d.jsx(C.MenuContext.Provider,{value:u,children:d.jsx(k.Popover,{open:q,onOpenChange:i,placement:n?"bottom-start":"right-start",openOnClick:n,openOnHover:{enabled:s,mouseOnly:!0,move:s,handleClose:w.safePolygon({blockPointerEvents:!0})},openOnFocus:s,size:y??!c,flip:!0,hideArrow:!0,portalled:o.portalled??!0,autoHiding:!1,...o,focusConfiguration:{modal:!1,initialFocus:s?-1:0,returnFocus:n,restoreFocus:n,order:["content","reference"],...o.focusConfiguration},listNavigation:{enabled:!0,listRef:g,activeIndex:m,onNavigate:v,loop:!0,focusItemOnHover:!1,focusItemOnOpen:!0,openOnArrowKeyDown:!0,nested:s,...o.listNavigation},typeahead:{enabled:!0,listRef:_,activeIndex:m,onMatch:v,...o.typeahead},role:{enabled:!0,role:"menu",...o.role},children:d.jsx(N.ActionListContextWrapper,{elementsRef:g,labelsRef:_,itemsFocusable:!1,onItemClick:I,insideMenu:!0,allowChildrenTypes:R,parentContext:L,children:O})})})};r.Trigger=j.MenuTrigger;r.PopoverContent=F.MenuPopoverContent;exports.Menu=r;
@@ -33,7 +33,7 @@ export interface MenuProps extends Omit<PopoverProps, 'listNavigation'> {
33
33
  listNavigation?: Partial<PopoverProps['listNavigation']>;
34
34
  }
35
35
  export declare const Menu: {
36
- ({ children, open, onOpenChange, maxHeight, minWidth, maxWidth, ...props }: MenuProps): import("react/jsx-runtime").JSX.Element;
36
+ ({ children, open, onOpenChange, maxHeight, minWidth, maxWidth, size: sizeProp, ...props }: MenuProps): import("react/jsx-runtime").JSX.Element;
37
37
  Trigger: ({ children, ...props }: import('./Menu.Trigger').MenuTriggerProps) => import("react/jsx-runtime").JSX.Element;
38
38
  PopoverContent: ({ children, style, className: _className, ...props }: import('./Menu.PopoverContent').MenuPopoverContentProps) => import("react/jsx-runtime").JSX.Element;
39
39
  };