@viasat/beam-react 2.15.0 → 2.16.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.
@@ -0,0 +1,4 @@
1
+ const o = "var(--bm-combobox-dropdown-max-items, 8)", e = "var(--bm-comp-actionlist-size-height, 2.5rem)", c = "var(--bm-sem-space-50, 0.5rem)", t = "var(--bm-sem-space-100, 1rem)", a = (m) => `min(calc(${m}px - ${t}), calc(${o} * ${e} + 2 * ${c}))`;
2
+ export {
3
+ a as g
4
+ };
@@ -0,0 +1 @@
1
+ "use strict";const o="var(--bm-combobox-dropdown-max-items, 8)",e="var(--bm-comp-actionlist-size-height, 2.5rem)",t="var(--bm-sem-space-50, 0.5rem)",c="var(--bm-sem-space-100, 1rem)",s=m=>`min(calc(${m}px - ${c}), calc(${o} * ${e} + 2 * ${t}))`;exports.getDropdownMaxHeight=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("../../chunks/constants.hwjHOsvT.js"),ne=require("../../chunks/dom.zgzOBFUw.js"),r=require("@floating-ui/react"),t=require("react"),se=`${te.prefix}combobox__field__chevron`,oe=j=>{const{disabled:x,readOnly:F,lastSelectedOptionIndex:l,fieldRef:p}=j,[n,$]=t.useState(!1),o=t.useRef(null),E=t.useRef(n);E.current=n;const R=r.useFloatingNodeId(),[I,z]=t.useState(null),[g,v]=t.useState(!0),[P,S]=t.useState(!1),b=t.useRef(!1),V=t.useCallback(e=>{I!==e&&(P?(S(!1),l===void 0&&v(!0)):v(!0),z(e))},[I,P,l]),f=t.useCallback((e,s,a)=>{var i;const u=l===void 0&&((i=o.current)==null?void 0:i.value)==="";!e&&a==="click"&&s instanceof MouseEvent&&!u&&!(s.target instanceof HTMLElement&&s.target.classList.contains(se))||($(e),e&&a==="click"&&(s instanceof MouseEvent||s instanceof PointerEvent)&&(S(!0),v(!1)))},[l,o]),{context:d,refs:c,floatingStyles:D}=r.useFloating({placement:"bottom-start",middleware:[{name:"overrideReference",fn:({rects:e})=>({reset:{rects:{...e,reference:ne.getElementScrollBoundingClientRect(p.current)??e.reference}}})},r.flip(),r.size({apply({elements:e,rects:s}){Object.assign(e.floating.style,{width:`${s.reference.width}px`})}})],whileElementsMounted:r.autoUpdate,open:n,onOpenChange:f,nodeId:R});o.current=c.domReference.current;const k=t.useCallback(e=>{b.current=!0,e.target!==o.current&&e.preventDefault()},[o]),y=t.useCallback(e=>{b.current=!1,e.target!==o.current&&e.preventDefault()},[o]),m=t.useRef([]),G=t.useRef([]),J=r.useClick(d,{enabled:!x&&!F,keyboardHandlers:!1}),Q=r.useRole(d,{role:"listbox"}),W=r.useDismiss(d,{outsidePress:!1}),O=m.current.length===0?null:I??null,M=t.useRef(l??null),X=t.useMemo(()=>n?M.current:(M.current=l??null,m.current.length===0?null:l??null),[l,n]),Y=r.useListNavigation(d,{enabled:!x&&!F,listRef:m,activeIndex:O,selectedIndex:X,onNavigate:V,focusItemOnHover:!1,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,nested:!1,loop:!0,virtual:!0,scrollItemIntoView:!0}),{getReferenceProps:h,getFloatingProps:A,getItemProps:K}=r.useInteractions([Q,W,Y]),{getReferenceProps:_}=r.useInteractions([J]),[T,Z]=t.useState(n);t.useEffect(()=>Z(n),[n]);const C=n?"open":"closed",w=t.useCallback(e=>{var i;if(!n)return;const s=e.type==="focus"?e.target:e.relatedTarget,a=c.floating.current,u=p.current;if(a!=null&&a.contains(s)||u!=null&&u.contains(s)||b.current){e.preventDefault(),e.stopPropagation(),(i=o.current)==null||i.focus();return}f(!1,e.nativeEvent,"focus-out")},[p,n,o,c.floating,f]),q=t.useRef(n);t.useEffect(()=>{var e;q.current&&!n&&((e=o.current)==null||e.focus()),q.current=n},[n,o]);const N=t.useCallback((e={})=>({ref:c.setReference,...h({...e})}),[c.setReference,h]),B=t.useCallback((e={})=>({ref:p,onKeyDownCapture:s=>{var U;const a=E.current,u=o.current,i=u==null?void 0:u.getAttribute("aria-activedescendant"),L=i?document.getElementById(i):null;if(s.key==="Enter"&&a){if(s.preventDefault(),s.stopPropagation(),g&&L){const ee=new KeyboardEvent("keydown",s.nativeEvent);L.dispatchEvent(ee)}return}(U=e.onKeyDownCapture)==null||U.call(e,s)},onFocusCapture:w,onBlurCapture:w,..._({...e,onMouseDownCapture:k,onMouseUpCapture:y,onPointerDownCapture:k,onPointerUpCapture:y})}),[p,w,_,k,y,o,g]),H=t.useMemo(()=>({isMounted:T,status:C,getFloatingProps:A,getItemProps:K,floatingStyles:D,setOpen:f,nodeId:R,context:d,labelsRef:G,elementsRef:m,setFloating:c.setFloating,activeIndex:g?O:null}),[T,C,A,K,D,f,R,d,c.setFloating,O,g]);return t.useMemo(()=>({getFieldProps:B,getInputProps:N,dropdownProps:H,refs:c,open:n,setOpen:f,status:C,setDisplayActiveIndex:v}),[H,B,N,n,c,f,C])};exports.useAutocompleteDropdown=oe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("../../chunks/constants.hwjHOsvT.js"),ne=require("../../chunks/dom.zgzOBFUw.js"),u=require("@floating-ui/react"),t=require("react"),se=require("../../chunks/combobox.9scnST_n.js"),oe=`${te.prefix}combobox__field__chevron`,re=u.flip({crossAxis:!1,mainAxis:!0,flipAlignment:!1}),ce=U=>{const{disabled:O,readOnly:F,lastSelectedOptionIndex:i,fieldRef:p}=U,[s,$]=t.useState(!1),r=t.useRef(null),P=t.useRef(s);P.current=s;const C=u.useFloatingNodeId(),[b,z]=t.useState(null),[g,m]=t.useState(!0),[D,E]=t.useState(!1),I=t.useRef(!1),V=t.useCallback(e=>{b!==e&&(D?(E(!1),i===void 0&&m(!0)):m(!0),z(e))},[b,D,i]),f=t.useCallback((e,n,o)=>{var l;const c=i===void 0&&((l=r.current)==null?void 0:l.value)==="";!e&&o==="click"&&n instanceof MouseEvent&&!c&&!(n.target instanceof HTMLElement&&n.target.classList.contains(oe))||($(e),e&&o==="click"&&(n instanceof MouseEvent||n instanceof PointerEvent)&&(E(!0),m(!1)))},[i,r]),{context:d,refs:a,floatingStyles:S}=u.useFloating({placement:"bottom-start",middleware:[{name:"overrideReference",fn:async e=>{const n=ne.getElementScrollBoundingClientRect(p.current),o=n?{...e.rects,reference:n}:e.rects,c=await re.fn({...e,rects:o}),l=typeof c.reset=="object"?c.reset.placement:void 0;return l?{reset:{placement:l,rects:o}}:n?{reset:{rects:o}}:{}}},u.size({apply({elements:e,rects:n,availableHeight:o}){Object.assign(e.floating.style,{width:`${n.reference.width}px`,maxHeight:se.getDropdownMaxHeight(o)})}})],whileElementsMounted:u.autoUpdate,open:s,onOpenChange:f,nodeId:C});r.current=a.domReference.current;const y=t.useCallback(e=>{I.current=!0,e.target!==r.current&&e.preventDefault()},[r]),k=t.useCallback(e=>{I.current=!1,e.target!==r.current&&e.preventDefault()},[r]),v=t.useRef([]),G=t.useRef([]),J=u.useClick(d,{enabled:!O&&!F,keyboardHandlers:!1}),Q=u.useRole(d,{role:"listbox"}),W=u.useDismiss(d,{outsidePress:!1}),x=v.current.length===0?null:b??null,M=t.useRef(i??null),X=t.useMemo(()=>s?M.current:(M.current=i??null,v.current.length===0?null:i??null),[i,s]),Y=u.useListNavigation(d,{enabled:!O&&!F,listRef:v,activeIndex:x,selectedIndex:X,onNavigate:V,focusItemOnHover:!1,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,nested:!1,loop:!0,virtual:!0,scrollItemIntoView:!0}),{getReferenceProps:h,getFloatingProps:A,getItemProps:K}=u.useInteractions([Q,W,Y]),{getReferenceProps:_}=u.useInteractions([J]),[q,Z]=t.useState(s);t.useEffect(()=>Z(s),[s]);const R=s?"open":"closed",w=t.useCallback(e=>{var l;if(!s)return;const n=e.type==="focus"?e.target:e.relatedTarget,o=a.floating.current,c=p.current;if(o!=null&&o.contains(n)||c!=null&&c.contains(n)||I.current){e.preventDefault(),e.stopPropagation(),(l=r.current)==null||l.focus();return}f(!1,e.nativeEvent,"focus-out")},[p,s,r,a.floating,f]),H=t.useRef(s);t.useEffect(()=>{var e;H.current&&!s&&((e=r.current)==null||e.focus()),H.current=s},[s,r]);const T=t.useCallback((e={})=>({ref:a.setReference,...h({...e})}),[a.setReference,h]),N=t.useCallback((e={})=>({ref:p,onKeyDownCapture:n=>{var L;const o=P.current,c=r.current,l=c==null?void 0:c.getAttribute("aria-activedescendant"),B=l?document.getElementById(l):null;if(n.key==="Enter"&&o){if(n.preventDefault(),n.stopPropagation(),g&&B){const ee=new KeyboardEvent("keydown",n.nativeEvent);B.dispatchEvent(ee)}return}(L=e.onKeyDownCapture)==null||L.call(e,n)},onFocusCapture:w,onBlurCapture:w,..._({...e,onMouseDownCapture:y,onMouseUpCapture:k,onPointerDownCapture:y,onPointerUpCapture:k})}),[p,w,_,y,k,r,g]),j=t.useMemo(()=>({isMounted:q,status:R,getFloatingProps:A,getItemProps:K,floatingStyles:S,setOpen:f,nodeId:C,context:d,labelsRef:G,elementsRef:v,setFloating:a.setFloating,activeIndex:g?x:null}),[q,R,A,K,S,f,C,d,a.setFloating,x,g]);return t.useMemo(()=>({getFieldProps:N,getInputProps:T,dropdownProps:j,refs:a,open:s,setOpen:f,status:R,setDisplayActiveIndex:m}),[j,N,T,s,a,f,R])};exports.useAutocompleteDropdown=ce;
@@ -1,51 +1,59 @@
1
1
  import { p as re } from "../../chunks/constants.CKKGf1-i.js";
2
2
  import { g as ce } from "../../chunks/dom.DGM-dxLe.js";
3
- import { useFloatingNodeId as le, useFloating as ie, autoUpdate as ae, flip as ue, size as fe, useClick as de, useRole as pe, useDismiss as ge, useListNavigation as me, useInteractions as V } from "@floating-ui/react";
4
- import { useState as g, useRef as u, useCallback as f, useMemo as E, useEffect as q } from "react";
5
- const ve = `${re}combobox__field__chevron`, Oe = (G) => {
6
- const { disabled: P, readOnly: b, lastSelectedOptionIndex: c, fieldRef: p } = G, [t, J] = g(!1), o = u(null), D = u(t);
7
- D.current = t;
8
- const y = le(), [R, Q] = g(null), [m, v] = g(!0), [h, A] = g(!1), x = u(!1), W = f((e) => {
9
- R !== e && (h ? (A(!1), c === void 0 && v(!0)) : v(!0), Q(e));
10
- }, [R, h, c]), a = f((e, n, l) => {
11
- var i;
12
- const r = c === void 0 && ((i = o.current) == null ? void 0 : i.value) === "";
13
- !e && l === "click" && n instanceof MouseEvent && !r && !(n.target instanceof HTMLElement && n.target.classList.contains(ve)) || (J(e), e && l === "click" && (n instanceof MouseEvent || n instanceof PointerEvent) && (A(!0), v(!1)));
14
- }, [c, o]), { context: d, refs: s, floatingStyles: M } = ie({
3
+ import { flip as ie, useFloatingNodeId as le, useFloating as ae, autoUpdate as ue, size as fe, useClick as de, useRole as pe, useDismiss as ge, useListNavigation as me, useInteractions as V } from "@floating-ui/react";
4
+ import { useState as g, useRef as u, useCallback as f, useMemo as P, useEffect as q } from "react";
5
+ import { g as ve } from "../../chunks/combobox.--djB8BC.js";
6
+ const Ie = `${re}combobox__field__chevron`, xe = ie({ crossAxis: !1, mainAxis: !0, flipAlignment: !1 }), ke = (G) => {
7
+ const { disabled: b, readOnly: D, lastSelectedOptionIndex: l, fieldRef: p } = G, [n, J] = g(!1), s = u(null), E = u(n);
8
+ E.current = n;
9
+ const y = le(), [w, Q] = g(null), [m, v] = g(!0), [h, A] = g(!1), C = u(!1), W = f((e) => {
10
+ w !== e && (h ? (A(!1), l === void 0 && v(!0)) : v(!0), Q(e));
11
+ }, [w, h, l]), a = f((e, t, o) => {
12
+ var c;
13
+ const r = l === void 0 && ((c = s.current) == null ? void 0 : c.value) === "";
14
+ !e && o === "click" && t instanceof MouseEvent && !r && !(t.target instanceof HTMLElement && t.target.classList.contains(Ie)) || (J(e), e && o === "click" && (t instanceof MouseEvent || t instanceof PointerEvent) && (A(!0), v(!1)));
15
+ }, [l, s]), { context: d, refs: i, floatingStyles: M } = ae({
15
16
  placement: "bottom-start",
16
17
  middleware: [
18
+ // Floating UI does not re-run flip() after a middleware returns `reset` with
19
+ // overridden rects, so we manually invoke flip inside this custom middleware
20
+ // to ensure the dropdown flips correctly when the reference rect is replaced.
17
21
  {
18
22
  name: "overrideReference",
19
- fn: ({ rects: e }) => ({
20
- reset: {
21
- rects: {
22
- ...e,
23
- reference: ce(p.current) ?? e.reference
23
+ fn: async (e) => {
24
+ const t = ce(p.current), o = t ? {
25
+ ...e.rects,
26
+ reference: t
27
+ } : e.rects, r = await xe.fn({ ...e, rects: o }), c = typeof r.reset == "object" ? r.reset.placement : void 0;
28
+ return c ? {
29
+ reset: {
30
+ placement: c,
31
+ rects: o
24
32
  }
25
- }
26
- })
33
+ } : t ? { reset: { rects: o } } : {};
34
+ }
27
35
  },
28
- ue(),
29
36
  fe({
30
- apply({ elements: e, rects: n }) {
37
+ apply({ elements: e, rects: t, availableHeight: o }) {
31
38
  Object.assign(e.floating.style, {
32
- width: `${n.reference.width}px`
39
+ width: `${t.reference.width}px`,
40
+ maxHeight: ve(o)
33
41
  });
34
42
  }
35
43
  })
36
44
  ],
37
- whileElementsMounted: ae,
38
- open: t,
45
+ whileElementsMounted: ue,
46
+ open: n,
39
47
  onOpenChange: a,
40
48
  nodeId: y
41
49
  });
42
- o.current = s.domReference.current;
43
- const O = f((e) => {
44
- x.current = !0, e.target !== o.current && e.preventDefault();
45
- }, [o]), w = f((e) => {
46
- x.current = !1, e.target !== o.current && e.preventDefault();
47
- }, [o]), I = u([]), X = u([]), Y = de(d, { enabled: !P && !b, keyboardHandlers: !1 }), Z = pe(d, { role: "listbox" }), ee = ge(d, { outsidePress: !1 }), F = I.current.length === 0 ? null : R ?? null, S = u(c ?? null), te = E(() => t ? S.current : (S.current = c ?? null, I.current.length === 0 ? null : c ?? null), [c, t]), ne = me(d, {
48
- enabled: !P && !b,
50
+ s.current = i.domReference.current;
51
+ const R = f((e) => {
52
+ C.current = !0, e.target !== s.current && e.preventDefault();
53
+ }, [s]), O = f((e) => {
54
+ C.current = !1, e.target !== s.current && e.preventDefault();
55
+ }, [s]), I = u([]), X = u([]), Y = de(d, { enabled: !b && !D, keyboardHandlers: !1 }), Z = pe(d, { role: "listbox" }), ee = ge(d, { outsidePress: !1 }), F = I.current.length === 0 ? null : w ?? null, S = u(l ?? null), te = P(() => n ? S.current : (S.current = l ?? null, I.current.length === 0 ? null : l ?? null), [l, n]), ne = me(d, {
56
+ enabled: !b && !D,
49
57
  listRef: I,
50
58
  activeIndex: F,
51
59
  selectedIndex: te,
@@ -57,95 +65,95 @@ const ve = `${re}combobox__field__chevron`, Oe = (G) => {
57
65
  loop: !0,
58
66
  virtual: !0,
59
67
  scrollItemIntoView: !0
60
- }), { getReferenceProps: K, getFloatingProps: _, getItemProps: N } = V([
68
+ }), { getReferenceProps: K, getFloatingProps: _, getItemProps: H } = V([
61
69
  Z,
62
70
  ee,
63
71
  ne
64
- ]), { getReferenceProps: T } = V([Y]), [B, oe] = g(t);
65
- q(() => oe(t), [t]);
66
- const C = t ? "open" : "closed", k = f(
72
+ ]), { getReferenceProps: N } = V([Y]), [T, oe] = g(n);
73
+ q(() => oe(n), [n]);
74
+ const x = n ? "open" : "closed", k = f(
67
75
  (e) => {
68
- var i;
69
- if (!t)
76
+ var c;
77
+ if (!n)
70
78
  return;
71
- const n = e.type === "focus" ? e.target : e.relatedTarget, l = s.floating.current, r = p.current;
72
- if (l != null && l.contains(n) || r != null && r.contains(n) || x.current) {
73
- e.preventDefault(), e.stopPropagation(), (i = o.current) == null || i.focus();
79
+ const t = e.type === "focus" ? e.target : e.relatedTarget, o = i.floating.current, r = p.current;
80
+ if (o != null && o.contains(t) || r != null && r.contains(t) || C.current) {
81
+ e.preventDefault(), e.stopPropagation(), (c = s.current) == null || c.focus();
74
82
  return;
75
83
  }
76
84
  a(!1, e.nativeEvent, "focus-out");
77
85
  },
78
- [p, t, o, s.floating, a]
79
- ), H = u(t);
86
+ [p, n, s, i.floating, a]
87
+ ), B = u(n);
80
88
  q(() => {
81
89
  var e;
82
- H.current && !t && ((e = o.current) == null || e.focus()), H.current = t;
83
- }, [t, o]);
90
+ B.current && !n && ((e = s.current) == null || e.focus()), B.current = n;
91
+ }, [n, s]);
84
92
  const L = f(
85
93
  (e = {}) => ({
86
- ref: s.setReference,
94
+ ref: i.setReference,
87
95
  ...K({
88
96
  ...e
89
97
  })
90
98
  }),
91
- [s.setReference, K]
99
+ [i.setReference, K]
92
100
  ), U = f(
93
101
  (e = {}) => ({
94
102
  ref: p,
95
- onKeyDownCapture: (n) => {
103
+ onKeyDownCapture: (t) => {
96
104
  var z;
97
- const l = D.current, r = o.current, i = r == null ? void 0 : r.getAttribute("aria-activedescendant"), j = i ? document.getElementById(i) : null;
98
- if (n.key === "Enter" && l) {
99
- if (n.preventDefault(), n.stopPropagation(), m && j) {
100
- const se = new KeyboardEvent("keydown", n.nativeEvent);
101
- j.dispatchEvent(se);
105
+ const o = E.current, r = s.current, c = r == null ? void 0 : r.getAttribute("aria-activedescendant"), $ = c ? document.getElementById(c) : null;
106
+ if (t.key === "Enter" && o) {
107
+ if (t.preventDefault(), t.stopPropagation(), m && $) {
108
+ const se = new KeyboardEvent("keydown", t.nativeEvent);
109
+ $.dispatchEvent(se);
102
110
  }
103
111
  return;
104
112
  }
105
- (z = e.onKeyDownCapture) == null || z.call(e, n);
113
+ (z = e.onKeyDownCapture) == null || z.call(e, t);
106
114
  },
107
115
  onFocusCapture: k,
108
116
  onBlurCapture: k,
109
- ...T({
117
+ ...N({
110
118
  ...e,
111
- onMouseDownCapture: O,
112
- onMouseUpCapture: w,
113
- onPointerDownCapture: O,
114
- onPointerUpCapture: w
119
+ onMouseDownCapture: R,
120
+ onMouseUpCapture: O,
121
+ onPointerDownCapture: R,
122
+ onPointerUpCapture: O
115
123
  })
116
124
  }),
117
- [p, k, T, O, w, o, m]
118
- ), $ = E(
125
+ [p, k, N, R, O, s, m]
126
+ ), j = P(
119
127
  () => ({
120
- isMounted: B,
121
- status: C,
128
+ isMounted: T,
129
+ status: x,
122
130
  getFloatingProps: _,
123
- getItemProps: N,
131
+ getItemProps: H,
124
132
  floatingStyles: M,
125
133
  setOpen: a,
126
134
  nodeId: y,
127
135
  context: d,
128
136
  labelsRef: X,
129
137
  elementsRef: I,
130
- setFloating: s.setFloating,
138
+ setFloating: i.setFloating,
131
139
  activeIndex: m ? F : null
132
140
  }),
133
- [B, C, _, N, M, a, y, d, s.setFloating, F, m]
141
+ [T, x, _, H, M, a, y, d, i.setFloating, F, m]
134
142
  );
135
- return E(
143
+ return P(
136
144
  () => ({
137
145
  getFieldProps: U,
138
146
  getInputProps: L,
139
- dropdownProps: $,
140
- refs: s,
141
- open: t,
147
+ dropdownProps: j,
148
+ refs: i,
149
+ open: n,
142
150
  setOpen: a,
143
- status: C,
151
+ status: x,
144
152
  setDisplayActiveIndex: v
145
153
  }),
146
- [$, U, L, t, s, a, C]
154
+ [j, U, L, n, i, a, x]
147
155
  );
148
156
  };
149
157
  export {
150
- Oe as useAutocompleteDropdown
158
+ ke as useAutocompleteDropdown
151
159
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@floating-ui/react"),t=require("react"),Q=B=>{const{disabled:v,readOnly:m,lastSelectedOptionIndex:i}=B,[n,H]=t.useState(!1),x=t.useRef(n);x.current=n;const I=c.useFloatingNodeId(),[R,z]=t.useState(null),[d,y]=t.useState(!0),[S,k]=t.useState(!1),w=t.useCallback(e=>{R!==e&&(S?(k(!1),i===void 0&&y(!0)):y(!0),z(e))},[R,S,i]),r=t.useCallback((e,o,u)=>{H(e),e&&u==="click"&&o instanceof PointerEvent&&(k(!0),y(!1))},[]),{context:l,refs:s,floatingStyles:O}=c.useFloating({placement:"bottom-start",middleware:[c.flip(),c.size({apply({rects:e,elements:o}){Object.assign(o.floating.style,{width:`${e.reference.width}px`})}})],whileElementsMounted:c.autoUpdate,open:n,onOpenChange:r,nodeId:I}),f=t.useRef([]),C=t.useRef([]),L=c.useClick(l,{enabled:!v&&!m,keyboardHandlers:!0}),U=c.useRole(l,{role:"listbox"}),V=c.useDismiss(l),p=f.current.length===0?null:R??null,h=t.useRef(i??null),F=t.useMemo(()=>n?h.current:(h.current=i??null,f.current.length===0?null:i??null),[i,n]),_=c.useListNavigation(l,{enabled:!v&&!m,listRef:f,activeIndex:p,selectedIndex:F,onNavigate:w,focusItemOnHover:!1,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,nested:!1,loop:!0,virtual:!0,scrollItemIntoView:!0}),$=c.useTypeahead(l,{enabled:!v&&!m,listRef:C,activeIndex:p,selectedIndex:F,onMatch:w}),{getReferenceProps:D,getFloatingProps:E,getItemProps:P}=c.useInteractions([L,U,V,_,$]),[A,G]=t.useState(n);t.useEffect(()=>G(n),[n]);const g=n?"open":"closed",b=t.useCallback(e=>{if(!n)return;const o=e.type==="focus"?e.target:e.relatedTarget,u=s.floating.current,a=s.domReference.current;if(u!=null&&u.contains(o)||a!=null&&a.contains(o)){e.preventDefault(),e.stopPropagation(),a==null||a.focus();return}r(!1,e.nativeEvent,"focus-out")},[n,s.domReference,s.floating,r]),M=t.useRef(n);t.useEffect(()=>{var e;M.current&&!n&&((e=s.domReference.current)==null||e.focus()),M.current=n},[n,s.domReference]);const K=t.useCallback((e={})=>({ref:s.setReference,...D({...e,onKeyDownCapture:o=>{var q;const u=x.current,a=s.domReference.current,N=a==null?void 0:a.getAttribute("aria-activedescendant"),j=N?document.getElementById(N):null;if((o.key==="Enter"||o.key===" ")&&u){if(o.preventDefault(),o.stopPropagation(),d&&j){const J=new KeyboardEvent("keydown",o.nativeEvent);j.dispatchEvent(J)}return}(q=e.onKeyDownCapture)==null||q.call(e,o)},onFocusCapture:b,onBlurCapture:b})}),[s.setReference,s.domReference,D,b,d]),T=t.useMemo(()=>({isMounted:A,status:g,getFloatingProps:E,getItemProps:P,floatingStyles:O,setOpen:r,nodeId:I,context:l,labelsRef:C,elementsRef:f,setFloating:s.setFloating,activeIndex:d?p:null}),[A,g,E,P,O,r,I,l,s.setFloating,p,d]);return t.useMemo(()=>({getFieldProps:K,dropdownProps:T,refs:s,open:n,setOpen:r,status:g}),[T,K,n,s,r,g])};exports.useSelectDropdown=Q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@floating-ui/react"),t=require("react"),Q=require("../../chunks/combobox.9scnST_n.js"),W=j=>{const{disabled:v,readOnly:m,lastSelectedOptionIndex:i}=j,[n,B]=t.useState(!1),x=t.useRef(n);x.current=n;const I=c.useFloatingNodeId(),[R,z]=t.useState(null),[d,y]=t.useState(!0),[w,S]=t.useState(!1),k=t.useCallback(e=>{R!==e&&(w?(S(!1),i===void 0&&y(!0)):y(!0),z(e))},[R,w,i]),l=t.useCallback((e,o,a)=>{B(e),e&&a==="click"&&o instanceof PointerEvent&&(S(!0),y(!1))},[]),{context:u,refs:s,floatingStyles:O}=c.useFloating({placement:"bottom-start",middleware:[c.flip(),c.size({apply({rects:e,elements:o,availableHeight:a}){Object.assign(o.floating.style,{width:`${e.reference.width}px`,maxHeight:Q.getDropdownMaxHeight(a)})}})],whileElementsMounted:c.autoUpdate,open:n,onOpenChange:l,nodeId:I}),f=t.useRef([]),h=t.useRef([]),L=c.useClick(u,{enabled:!v&&!m,keyboardHandlers:!0}),U=c.useRole(u,{role:"listbox"}),V=c.useDismiss(u),g=f.current.length===0?null:R??null,C=t.useRef(i??null),D=t.useMemo(()=>n?C.current:(C.current=i??null,f.current.length===0?null:i??null),[i,n]),_=c.useListNavigation(u,{enabled:!v&&!m,listRef:f,activeIndex:g,selectedIndex:D,onNavigate:k,focusItemOnHover:!1,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,nested:!1,loop:!0,virtual:!0,scrollItemIntoView:!0}),$=c.useTypeahead(u,{enabled:!v&&!m,listRef:h,activeIndex:g,selectedIndex:D,onMatch:k}),{getReferenceProps:F,getFloatingProps:E,getItemProps:M}=c.useInteractions([L,U,V,_,$]),[P,G]=t.useState(n);t.useEffect(()=>G(n),[n]);const p=n?"open":"closed",b=t.useCallback(e=>{if(!n)return;const o=e.type==="focus"?e.target:e.relatedTarget,a=s.floating.current,r=s.domReference.current;if(a!=null&&a.contains(o)||r!=null&&r.contains(o)){e.preventDefault(),e.stopPropagation(),r==null||r.focus();return}l(!1,e.nativeEvent,"focus-out")},[n,s.domReference,s.floating,l]),A=t.useRef(n);t.useEffect(()=>{var e;A.current&&!n&&((e=s.domReference.current)==null||e.focus()),A.current=n},[n,s.domReference]);const K=t.useCallback((e={})=>({ref:s.setReference,...F({...e,onKeyDownCapture:o=>{var q;const a=x.current,r=s.domReference.current,H=r==null?void 0:r.getAttribute("aria-activedescendant"),N=H?document.getElementById(H):null;if((o.key==="Enter"||o.key===" ")&&a){if(o.preventDefault(),o.stopPropagation(),d&&N){const J=new KeyboardEvent("keydown",o.nativeEvent);N.dispatchEvent(J)}return}(q=e.onKeyDownCapture)==null||q.call(e,o)},onFocusCapture:b,onBlurCapture:b})}),[s.setReference,s.domReference,F,b,d]),T=t.useMemo(()=>({isMounted:P,status:p,getFloatingProps:E,getItemProps:M,floatingStyles:O,setOpen:l,nodeId:I,context:u,labelsRef:h,elementsRef:f,setFloating:s.setFloating,activeIndex:d?g:null}),[P,p,E,M,O,l,I,u,s.setFloating,g,d]);return t.useMemo(()=>({getFieldProps:K,dropdownProps:T,refs:s,open:n,setOpen:l,status:p}),[T,K,n,s,l,p])};exports.useSelectDropdown=W;
@@ -1,30 +1,32 @@
1
- import { useFloatingNodeId as Y, useFloating as Z, autoUpdate as ee, flip as te, size as ne, useClick as oe, useRole as se, useDismiss as ce, useListNavigation as re, useTypeahead as le, useInteractions as ae } from "@floating-ui/react";
2
- import { useState as i, useRef as u, useCallback as v, useMemo as O, useEffect as L } from "react";
3
- const fe = (U) => {
4
- const { disabled: m, readOnly: I, lastSelectedOptionIndex: a } = U, [t, V] = i(!1), b = u(t);
5
- b.current = t;
6
- const y = Y(), [R, _] = i(null), [d, x] = i(!0), [h, k] = i(!1), F = v((e) => {
7
- R !== e && (h ? (k(!1), a === void 0 && x(!0)) : x(!0), _(e));
8
- }, [R, h, a]), c = v((e, o, l) => {
9
- V(e), e && l === "click" && o instanceof PointerEvent && (k(!0), x(!1));
10
- }, []), { context: r, refs: n, floatingStyles: C } = Z({
1
+ import { useFloatingNodeId as Y, useFloating as Z, autoUpdate as ee, flip as te, size as ne, useClick as oe, useRole as se, useDismiss as ce, useListNavigation as re, useTypeahead as ae, useInteractions as le } from "@floating-ui/react";
2
+ import { useState as i, useRef as u, useCallback as m, useMemo as h, useEffect as L } from "react";
3
+ import { g as ie } from "../../chunks/combobox.--djB8BC.js";
4
+ const ge = (U) => {
5
+ const { disabled: v, readOnly: I, lastSelectedOptionIndex: l } = U, [t, V] = i(!1), O = u(t);
6
+ O.current = t;
7
+ const y = Y(), [x, _] = i(null), [d, R] = i(!0), [b, k] = i(!1), F = m((e) => {
8
+ x !== e && (b ? (k(!1), l === void 0 && R(!0)) : R(!0), _(e));
9
+ }, [x, b, l]), r = m((e, o, c) => {
10
+ V(e), e && c === "click" && o instanceof PointerEvent && (k(!0), R(!1));
11
+ }, []), { context: a, refs: n, floatingStyles: C } = Z({
11
12
  placement: "bottom-start",
12
13
  middleware: [
13
14
  te(),
14
15
  ne({
15
- apply({ rects: e, elements: o }) {
16
+ apply({ rects: e, elements: o, availableHeight: c }) {
16
17
  Object.assign(o.floating.style, {
17
- width: `${e.reference.width}px`
18
+ width: `${e.reference.width}px`,
19
+ maxHeight: ie(c)
18
20
  });
19
21
  }
20
22
  })
21
23
  ],
22
24
  whileElementsMounted: ee,
23
25
  open: t,
24
- onOpenChange: c,
26
+ onOpenChange: r,
25
27
  nodeId: y
26
- }), f = u([]), D = u([]), $ = oe(r, { enabled: !m && !I, keyboardHandlers: !0 }), q = se(r, { role: "listbox" }), G = ce(r), p = f.current.length === 0 ? null : R ?? null, E = u(a ?? null), S = O(() => t ? E.current : (E.current = a ?? null, f.current.length === 0 ? null : a ?? null), [a, t]), J = re(r, {
27
- enabled: !m && !I,
28
+ }), f = u([]), D = u([]), $ = oe(a, { enabled: !v && !I, keyboardHandlers: !0 }), q = se(a, { role: "listbox" }), G = ce(a), p = f.current.length === 0 ? null : x ?? null, E = u(l ?? null), S = h(() => t ? E.current : (E.current = l ?? null, f.current.length === 0 ? null : l ?? null), [l, t]), J = re(a, {
29
+ enabled: !v && !I,
28
30
  listRef: f,
29
31
  activeIndex: p,
30
32
  selectedIndex: S,
@@ -36,13 +38,13 @@ const fe = (U) => {
36
38
  loop: !0,
37
39
  virtual: !0,
38
40
  scrollItemIntoView: !0
39
- }), Q = le(r, {
40
- enabled: !m && !I,
41
+ }), Q = ae(a, {
42
+ enabled: !v && !I,
41
43
  listRef: D,
42
44
  activeIndex: p,
43
45
  selectedIndex: S,
44
46
  onMatch: F
45
- }), { getReferenceProps: A, getFloatingProps: P, getItemProps: K } = ae([
47
+ }), { getReferenceProps: A, getFloatingProps: P, getItemProps: K } = le([
46
48
  $,
47
49
  q,
48
50
  G,
@@ -50,32 +52,32 @@ const fe = (U) => {
50
52
  Q
51
53
  ]), [M, W] = i(t);
52
54
  L(() => W(t), [t]);
53
- const g = t ? "open" : "closed", w = v(
55
+ const g = t ? "open" : "closed", w = m(
54
56
  (e) => {
55
57
  if (!t)
56
58
  return;
57
- const o = e.type === "focus" ? e.target : e.relatedTarget, l = n.floating.current, s = n.domReference.current;
58
- if (l != null && l.contains(o) || s != null && s.contains(o)) {
59
+ const o = e.type === "focus" ? e.target : e.relatedTarget, c = n.floating.current, s = n.domReference.current;
60
+ if (c != null && c.contains(o) || s != null && s.contains(o)) {
59
61
  e.preventDefault(), e.stopPropagation(), s == null || s.focus();
60
62
  return;
61
63
  }
62
- c(!1, e.nativeEvent, "focus-out");
64
+ r(!1, e.nativeEvent, "focus-out");
63
65
  },
64
- [t, n.domReference, n.floating, c]
65
- ), N = u(t);
66
+ [t, n.domReference, n.floating, r]
67
+ ), H = u(t);
66
68
  L(() => {
67
69
  var e;
68
- N.current && !t && ((e = n.domReference.current) == null || e.focus()), N.current = t;
70
+ H.current && !t && ((e = n.domReference.current) == null || e.focus()), H.current = t;
69
71
  }, [t, n.domReference]);
70
- const T = v(
72
+ const N = m(
71
73
  (e = {}) => ({
72
74
  ref: n.setReference,
73
75
  ...A({
74
76
  ...e,
75
77
  onKeyDownCapture: (o) => {
76
78
  var z;
77
- const l = b.current, s = n.domReference.current, H = s == null ? void 0 : s.getAttribute("aria-activedescendant"), j = H ? document.getElementById(H) : null;
78
- if ((o.key === "Enter" || o.key === " ") && l) {
79
+ const c = O.current, s = n.domReference.current, B = s == null ? void 0 : s.getAttribute("aria-activedescendant"), j = B ? document.getElementById(B) : null;
80
+ if ((o.key === "Enter" || o.key === " ") && c) {
79
81
  if (o.preventDefault(), o.stopPropagation(), d && j) {
80
82
  const X = new KeyboardEvent("keydown", o.nativeEvent);
81
83
  j.dispatchEvent(X);
@@ -89,35 +91,35 @@ const fe = (U) => {
89
91
  })
90
92
  }),
91
93
  [n.setReference, n.domReference, A, w, d]
92
- ), B = O(
94
+ ), T = h(
93
95
  () => ({
94
96
  isMounted: M,
95
97
  status: g,
96
98
  getFloatingProps: P,
97
99
  getItemProps: K,
98
100
  floatingStyles: C,
99
- setOpen: c,
101
+ setOpen: r,
100
102
  nodeId: y,
101
- context: r,
103
+ context: a,
102
104
  labelsRef: D,
103
105
  elementsRef: f,
104
106
  setFloating: n.setFloating,
105
107
  activeIndex: d ? p : null
106
108
  }),
107
- [M, g, P, K, C, c, y, r, n.setFloating, p, d]
109
+ [M, g, P, K, C, r, y, a, n.setFloating, p, d]
108
110
  );
109
- return O(
111
+ return h(
110
112
  () => ({
111
- getFieldProps: T,
112
- dropdownProps: B,
113
+ getFieldProps: N,
114
+ dropdownProps: T,
113
115
  refs: n,
114
116
  open: t,
115
- setOpen: c,
117
+ setOpen: r,
116
118
  status: g
117
119
  }),
118
- [B, T, t, n, c, g]
120
+ [T, N, t, n, r, g]
119
121
  );
120
122
  };
121
123
  export {
122
- fe as useSelectDropdown
124
+ ge as useSelectDropdown
123
125
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@floating-ui/react"),n=require("react"),_=require("../../FloatingUI/useTyping.cjs.js"),N=require("../../FloatingUI/useBlur.cjs.js"),T=S=>{const{disabled:r,readOnly:l,enabled:e=!0}=S,[s,i]=n.useState(!1),d=n.useRef(s);d.current=s;const[f,g]=n.useState(null);n.useEffect(()=>s?void 0:g(null),[s]);const{context:c,refs:a,floatingStyles:p}=t.useFloating({placement:"bottom-start",middleware:[t.flip(),t.size({apply({elements:o,rects:u}){Object.assign(o.floating.style,{width:`${u.reference.width}px`})}})],whileElementsMounted:t.autoUpdate,open:s,onOpenChange:i}),b=n.useRef([]),k=n.useRef([]),h=t.useClick(c,{enabled:!s&&e&&!r&&!l,toggle:!1,stickIfOpen:!1,keyboardHandlers:!1}),x=t.useRole(c,{enabled:e,role:"listbox"}),E=_.default(c,{enabled:!s&&e&&!r&&!l,event:"keyboard"}),M=t.useFocus(c,{enabled:!s&&e&&!r&&!l,visibleOnly:!0}),q=t.useDismiss(c,{enabled:s&&e&&!r&&!l,escapeKey:!0,outsidePress:!0,referencePress:!1}),C=N.useBlur(c,{enabled:e&&!r&&!l}),D=t.useListNavigation(c,{enabled:e&&!r&&!l,listRef:b,activeIndex:f,onNavigate:g,focusItemOnHover:!1,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,nested:!1,loop:!0,virtual:!0,scrollItemIntoView:!0}),{getReferenceProps:m,getFloatingProps:R,getItemProps:y}=t.useInteractions([x,E,D]),{getReferenceProps:I}=t.useInteractions([h,M,q,C]),{isMounted:v,styles:P}=t.useTransitionStyles(c,{duration:50});n.useEffect(()=>{if(!e||r||l||d.current)return;const o=a.domReference.current,u=document.activeElement;o&&u&&o.contains(u)&&i(!0)},[e,r,l,i,a.domReference]);const O=n.useCallback((o={})=>e?m(o):o,[m,e]),w=n.useCallback((o={})=>e?{ref:a.setReference,...I(o)}:o,[e,a.setReference,I]),F=n.useMemo(()=>({isMounted:v,getFloatingProps:R,getItemProps:y,floatingStyles:{...p,...P},setOpen:i,labelsRef:k,elementsRef:b,setFloating:a.setFloating,activeIndex:f,open:s}),[v,R,y,p,P,a.setFloating,f,s]);return n.useMemo(()=>({getFieldProps:w,getInputProps:O,dropdownProps:F,refs:a}),[F,w,O,a])};exports.useSearchDropdown=T;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@floating-ui/react"),o=require("react"),H=require("../../FloatingUI/useTyping.cjs.js"),_=require("../../FloatingUI/useBlur.cjs.js"),N=h=>{const{disabled:r,readOnly:l,enabled:e=!0}=h,[n,i]=o.useState(!1),d=o.useRef(n);d.current=n;const[f,g]=o.useState(null);o.useEffect(()=>n?void 0:g(null),[n]);const{context:c,refs:a,floatingStyles:p}=s.useFloating({placement:"bottom-start",middleware:[s.flip(),s.size({apply({elements:t,rects:u,availableHeight:S}){Object.assign(t.floating.style,{width:`${u.reference.width}px`}),S<t.floating.scrollHeight?Object.assign(t.floating.style,{maxHeight:`${S}px`,overflowY:"auto"}):Object.assign(t.floating.style,{maxHeight:""})}})],whileElementsMounted:s.autoUpdate,open:n,onOpenChange:i}),b=o.useRef([]),x=o.useRef([]),k=s.useClick(c,{enabled:!n&&e&&!r&&!l,toggle:!1,stickIfOpen:!1,keyboardHandlers:!1}),E=s.useRole(c,{enabled:e,role:"listbox"}),M=H.default(c,{enabled:!n&&e&&!r&&!l,event:"keyboard"}),j=s.useFocus(c,{enabled:!n&&e&&!r&&!l,visibleOnly:!0}),q=s.useDismiss(c,{enabled:n&&e&&!r&&!l,escapeKey:!0,outsidePress:!0,referencePress:!1}),C=_.useBlur(c,{enabled:e&&!r&&!l}),D=s.useListNavigation(c,{enabled:e&&!r&&!l,listRef:b,activeIndex:f,onNavigate:g,focusItemOnHover:!1,focusItemOnOpen:"auto",openOnArrowKeyDown:!0,nested:!1,loop:!0,virtual:!0,scrollItemIntoView:!0}),{getReferenceProps:m,getFloatingProps:y,getItemProps:R}=s.useInteractions([E,M,D]),{getReferenceProps:I}=s.useInteractions([k,j,q,C]),{isMounted:v,styles:O}=s.useTransitionStyles(c,{duration:50});o.useEffect(()=>{if(!e||r||l||d.current)return;const t=a.domReference.current,u=document.activeElement;t&&u&&t.contains(u)&&i(!0)},[e,r,l,i,a.domReference]);const P=o.useCallback((t={})=>e?m(t):t,[m,e]),w=o.useCallback((t={})=>e?{ref:a.setReference,...I(t)}:t,[e,a.setReference,I]),F=o.useMemo(()=>({isMounted:v,getFloatingProps:y,getItemProps:R,floatingStyles:{...p,...O},setOpen:i,labelsRef:x,elementsRef:b,setFloating:a.setFloating,activeIndex:f,open:n}),[v,y,R,p,O,a.setFloating,f,n]);return o.useMemo(()=>({getFieldProps:w,getInputProps:P,dropdownProps:F,refs:a}),[F,w,P,a])};exports.useSearchDropdown=N;
@@ -1,35 +1,42 @@
1
- import { useFloating as j, autoUpdate as z, flip as B, size as L, useClick as U, useRole as V, useFocus as $, useDismiss as q, useListNavigation as G, useInteractions as F, useTransitionStyles as J } from "@floating-ui/react";
2
- import { useState as k, useRef as u, useEffect as x, useCallback as h, useMemo as S } from "react";
1
+ import { useFloating as $, autoUpdate as z, flip as B, size as L, useClick as U, useRole as V, useFocus as Y, useDismiss as q, useListNavigation as G, useInteractions as F, useTransitionStyles as J } from "@floating-ui/react";
2
+ import { useState as h, useRef as u, useEffect as k, useCallback as S, useMemo as E } from "react";
3
3
  import Q from "../../FloatingUI/useTyping.es.js";
4
4
  import { useBlur as W } from "../../FloatingUI/useBlur.es.js";
5
- const ee = (E) => {
6
- const { disabled: n, readOnly: o, enabled: e = !0 } = E, [t, c] = k(!1), f = u(t);
7
- f.current = t;
8
- const [a, d] = k(null);
9
- x(() => t ? void 0 : d(null), [t]);
10
- const { context: r, refs: l, floatingStyles: p } = j({
5
+ const te = (H) => {
6
+ const { disabled: n, readOnly: o, enabled: e = !0 } = H, [s, i] = h(!1), f = u(s);
7
+ f.current = s;
8
+ const [a, d] = h(null);
9
+ k(() => s ? void 0 : d(null), [s]);
10
+ const { context: r, refs: l, floatingStyles: g } = $({
11
11
  placement: "bottom-start",
12
12
  middleware: [
13
13
  B(),
14
+ // Search does not cap the dropdown to a fixed number of items like Select
15
+ // and Autocomplete — it shows all results and only constrains to viewport.
14
16
  L({
15
- apply({ elements: s, rects: i }) {
16
- Object.assign(s.floating.style, {
17
- width: `${i.reference.width}px`
17
+ apply({ elements: t, rects: c, availableHeight: x }) {
18
+ Object.assign(t.floating.style, {
19
+ width: `${c.reference.width}px`
20
+ }), x < t.floating.scrollHeight ? Object.assign(t.floating.style, {
21
+ maxHeight: `${x}px`,
22
+ overflowY: "auto"
23
+ }) : Object.assign(t.floating.style, {
24
+ maxHeight: ""
18
25
  });
19
26
  }
20
27
  })
21
28
  ],
22
29
  whileElementsMounted: z,
23
- open: t,
24
- onOpenChange: c
25
- }), g = u([]), C = u([]), D = U(r, {
26
- enabled: !t && e && !n && !o,
30
+ open: s,
31
+ onOpenChange: i
32
+ }), p = u([]), j = u([]), C = U(r, {
33
+ enabled: !s && e && !n && !o,
27
34
  toggle: !1,
28
35
  stickIfOpen: !1,
29
36
  keyboardHandlers: !1
30
- }), M = V(r, { enabled: e, role: "listbox" }), N = Q(r, { enabled: !t && e && !n && !o, event: "keyboard" }), A = $(r, { enabled: !t && e && !n && !o, visibleOnly: !0 }), H = q(r, { enabled: t && e && !n && !o, escapeKey: !0, outsidePress: !0, referencePress: !1 }), K = W(r, { enabled: e && !n && !o }), T = G(r, {
37
+ }), D = V(r, { enabled: e, role: "listbox" }), M = Q(r, { enabled: !s && e && !n && !o, event: "keyboard" }), N = Y(r, { enabled: !s && e && !n && !o, visibleOnly: !0 }), A = q(r, { enabled: s && e && !n && !o, escapeKey: !0, outsidePress: !0, referencePress: !1 }), K = W(r, { enabled: e && !n && !o }), T = G(r, {
31
38
  enabled: e && !n && !o,
32
- listRef: g,
39
+ listRef: p,
33
40
  activeIndex: a,
34
41
  onNavigate: d,
35
42
  focusItemOnHover: !1,
@@ -40,53 +47,53 @@ const ee = (E) => {
40
47
  virtual: !0,
41
48
  scrollItemIntoView: !0
42
49
  }), { getReferenceProps: m, getFloatingProps: b, getItemProps: y } = F([
50
+ D,
43
51
  M,
44
- N,
45
52
  T
46
- ]), { getReferenceProps: R } = F([D, A, H, K]), { isMounted: v, styles: I } = J(r, { duration: 50 });
47
- x(() => {
53
+ ]), { getReferenceProps: R } = F([C, N, A, K]), { isMounted: v, styles: O } = J(r, { duration: 50 });
54
+ k(() => {
48
55
  if (!e || n || o || f.current)
49
56
  return;
50
- const s = l.domReference.current, i = document.activeElement;
51
- s && i && s.contains(i) && c(!0);
52
- }, [e, n, o, c, l.domReference]);
53
- const P = h(
54
- (s = {}) => e ? m(s) : s,
57
+ const t = l.domReference.current, c = document.activeElement;
58
+ t && c && t.contains(c) && i(!0);
59
+ }, [e, n, o, i, l.domReference]);
60
+ const I = S(
61
+ (t = {}) => e ? m(t) : t,
55
62
  [m, e]
56
- ), O = h(
57
- (s = {}) => e ? {
63
+ ), P = S(
64
+ (t = {}) => e ? {
58
65
  ref: l.setReference,
59
- ...R(s)
60
- } : s,
66
+ ...R(t)
67
+ } : t,
61
68
  [e, l.setReference, R]
62
- ), w = S(
69
+ ), w = E(
63
70
  () => ({
64
71
  isMounted: v,
65
72
  getFloatingProps: b,
66
73
  getItemProps: y,
67
74
  floatingStyles: {
68
- ...p,
69
- ...I
75
+ ...g,
76
+ ...O
70
77
  },
71
- setOpen: c,
72
- labelsRef: C,
73
- elementsRef: g,
78
+ setOpen: i,
79
+ labelsRef: j,
80
+ elementsRef: p,
74
81
  setFloating: l.setFloating,
75
82
  activeIndex: a,
76
- open: t
83
+ open: s
77
84
  }),
78
- [v, b, y, p, I, l.setFloating, a, t]
85
+ [v, b, y, g, O, l.setFloating, a, s]
79
86
  );
80
- return S(
87
+ return E(
81
88
  () => ({
82
- getFieldProps: O,
83
- getInputProps: P,
89
+ getFieldProps: P,
90
+ getInputProps: I,
84
91
  dropdownProps: w,
85
92
  refs: l
86
93
  }),
87
- [w, O, P, l]
94
+ [w, P, I, l]
88
95
  );
89
96
  };
90
97
  export {
91
- ee as useSearchDropdown
98
+ te as useSearchDropdown
92
99
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viasat/beam-react",
3
- "version": "2.15.0",
3
+ "version": "2.16.0",
4
4
  "description": "React component library for the Beam design system",
5
5
  "license": "MIT",
6
6
  "author": "Viasat",
@@ -59,11 +59,11 @@
59
59
  "access": "public"
60
60
  },
61
61
  "dependencies": {
62
- "@viasat/beam-fonts": "2.15.0",
63
- "@viasat/beam-shared": "2.15.0",
64
- "@viasat/beam-styles": "2.15.0",
65
- "@viasat/beam-tokens": "2.15.0",
66
- "@viasat/beam-icons": "2.15.0",
62
+ "@viasat/beam-fonts": "2.16.0",
63
+ "@viasat/beam-shared": "2.16.0",
64
+ "@viasat/beam-styles": "2.16.0",
65
+ "@viasat/beam-tokens": "2.16.0",
66
+ "@viasat/beam-icons": "2.16.0",
67
67
  "clsx": "^1.2.1",
68
68
  "@floating-ui/react": "^0.26.18",
69
69
  "@stepperize/react": "^5.1.5",