@ogcio/design-system-react 1.24.0 → 1.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **This library should only be imported for departments actively working with the core design system team during its development. Do not use this library if you are not part of this development process, and contact the design system team instead if you interested in its use.**
4
4
 
5
- Welcome to the GOV IE React component library, a collection of reusable React components designed to help you build modern React web applications utilising the GOV IE design system.
5
+ Welcome to the Government of Ireland Design System React component library, a collection of reusable React components designed to help you build modern React web applications utilising the Government of Ireland Design System.
6
6
 
7
7
  ## Getting Started
8
8
 
@@ -14,7 +14,7 @@ npm install @ogcio/design-system-react @ogcio/theme-govie
14
14
 
15
15
  ### Pinning packages
16
16
 
17
- We **strongly recommend** that you pin the GOV IE design system packages, so that any regressions are not automatically introduced during development. Regressions that will only be discoverable at runtime.
17
+ We **strongly recommend** that you pin the Government of Ireland Design System packages, so that any regressions are not automatically introduced during development. Regressions that will only be discoverable at runtime.
18
18
 
19
19
  **Upgrades should be explicit version updates** in the `package.json` and then your application should be regression tested:
20
20
 
@@ -28,7 +28,7 @@ We **strongly recommend** that you pin the GOV IE design system packages, so tha
28
28
 
29
29
  ### Usage
30
30
 
31
- Import the GOV IE `theme.css` from the `@ogcio/theme-govie` theme package at the entry point of your application, for example:
31
+ Import the Government of Ireland `theme.css` from the `@ogcio/theme-govie` theme package at the entry point of your application, for example:
32
32
 
33
33
  ```diff
34
34
  +import '@ogcio/theme-govie/theme.css'
@@ -58,7 +58,7 @@ export function MyComponent() {
58
58
 
59
59
  ### Typography
60
60
 
61
- The `@ogcio/design-system-react` package contains `Heading` and `Paragraph` components that implement the GOV IE design system responsive text guidelines:
61
+ The `@ogcio/design-system-react` package contains `Heading` and `Paragraph` components that implement the Government of Ireland Design System responsive text guidelines:
62
62
 
63
63
  ```jsx
64
64
  import { Heading, Paragraph } from '@ogcio/design-system-react';
@@ -73,7 +73,7 @@ function MyComponent() {
73
73
  }
74
74
  ```
75
75
 
76
- The GOV IE design system uses the [Lato](https://fonts.google.com/specimen/Lato) Google font. The font should be added to your application, e.g. via [next/font](https://nextjs.org/docs/app/building-your-application/optimizing/fonts), [Fontsource](https://fontsource.org/docs/getting-started/install) or embed code.
76
+ The Government of Ireland Design System uses the [Lato](https://fonts.google.com/specimen/Lato) Google font. The font should be added to your application, e.g. via [next/font](https://nextjs.org/docs/app/building-your-application/optimizing/fonts), [Fontsource](https://fontsource.org/docs/getting-started/install) or embed code.
77
77
 
78
78
  ### Internationalization (i18n) Guidelines
79
79
 
@@ -1,24 +1,24 @@
1
1
  "use client";
2
- import { jsxs as q, jsx as f } from "react/jsx-runtime";
3
- import { forwardRef as z, useRef as N, useImperativeHandle as J, useEffect as Q, useCallback as W, createElement as Y, Children as Z, isValidElement as ee } from "react";
4
- import { cn as D } from "../cn.js";
2
+ import { jsxs as z, jsx as h } from "react/jsx-runtime";
3
+ import { forwardRef as J, useRef as N, useImperativeHandle as Q, useEffect as W, useCallback as D, createElement as Y, Children as Z, isValidElement as ee } from "react";
4
+ import { cn as P } from "../cn.js";
5
5
  import { useDomId as te } from "../hooks/use-dom-id.js";
6
- import { translate as P } from "../i18n/utility.js";
6
+ import { translate as G } from "../i18n/utility.js";
7
7
  import { InputText as oe } from "../input-text/input-text.js";
8
8
  import { Popover as ne } from "../popover/popover.js";
9
- import { SelectMenu as ae, SelectMenuOption as G, SelectMenuGroupItem as re } from "../select/select-menu.js";
9
+ import { SelectMenu as ae, SelectMenuOption as L, SelectMenuGroupItem as re } from "../select/select-menu.js";
10
10
  import { cycleEnabledIndex as le } from "../utilities.js";
11
11
  import { AUTOCOMPLETE_ACTIONS as pe } from "./types.js";
12
12
  import { useAutocompleteController as ie } from "./use-autocomplete-controller.js";
13
13
  const {
14
14
  ON_RESET: se,
15
15
  ON_SELECT_ITEM: ce,
16
- SET_INPUT_VALUE: L,
17
- SET_IS_OPEN: s,
16
+ SET_INPUT_VALUE: R,
17
+ SET_IS_OPEN: i,
18
18
  TOGGLE_CLEAR_BUTTON: C,
19
19
  SET_HIGHLIGHTED_INDEX: ue,
20
20
  SET_VALUE: de
21
- } = pe, me = (a) => a ? "keyboard_arrow_up" : "keyboard_arrow_down", O = (a, r) => (p) => {
21
+ } = pe, me = (a) => a ? "keyboard_arrow_up" : "keyboard_arrow_down", T = (a, r) => (p) => {
22
22
  a && a({
23
23
  target: { name: r, value: p },
24
24
  currentTarget: { name: r, value: p },
@@ -34,155 +34,159 @@ const {
34
34
  bubbles: !0,
35
35
  isTrusted: !0
36
36
  });
37
- }, xe = z(
37
+ }, ke = J(
38
38
  (a, r) => {
39
39
  var x;
40
40
  const p = N(null), {
41
41
  disabled: l,
42
- children: u,
43
- placeholder: h,
44
- onSelectItem: y,
42
+ children: c,
43
+ placeholder: y,
44
+ onSelectItem: m,
45
45
  isLoading: g,
46
- freeSolo: i = !1,
46
+ freeSolo: s = !1,
47
47
  onChange: b,
48
- onBlur: R,
49
- name: d,
48
+ onBlur: B,
49
+ name: u,
50
50
  value: E,
51
- id: B
51
+ id: M
52
52
  } = a, v = N(!1), {
53
53
  state: t,
54
54
  dispatch: o,
55
- inputRef: m,
55
+ inputRef: f,
56
56
  getOptionLabelByValue: S,
57
57
  listRef: A,
58
- debouncedFilter: M
58
+ debouncedFilter: U,
59
+ validChildren: be
59
60
  } = ie({
60
61
  ...a,
61
- onChange: O(b, d)
62
+ onChange: T(b, u)
62
63
  }), _ = te();
63
- J(r, () => m.current), Q(() => {
64
+ Q(r, () => f.current), W(() => {
64
65
  E !== void 0 && (o({ type: de, payload: E }), o({
65
- type: L,
66
- payload: S(u, E)
66
+ type: R,
67
+ payload: S(c, E)
67
68
  }), o({ type: C }));
68
69
  }, [E]);
69
- const w = a["aria-label"] ?? P("autocomplete.placeholder", { defaultValue: "Type to Search" }), U = (e) => {
70
- o({ type: s, payload: e }), e || o({ type: C, payload: !1 });
71
- }, V = () => {
72
- o({ type: se }), o({ type: s, payload: !1 }), O(b, d)("");
73
- }, H = (e) => {
74
- o({ type: L, payload: e }), i && O(b, d)(e), e && o({ type: s, payload: !0 }), M(e);
70
+ const w = a["aria-label"] ?? G("autocomplete.placeholder", { defaultValue: "Type to Search" }), V = (e) => {
71
+ o({ type: i, payload: e }), e || o({ type: C, payload: !1 });
72
+ }, H = () => {
73
+ o({ type: se }), o({ type: i, payload: !1 }), T(b, u)("");
75
74
  }, j = (e) => {
75
+ o({ type: R, payload: e }), s && T(b, u)(e), e && o({ type: i, payload: !0 }), U(e);
76
+ }, $ = (e) => {
76
77
  const {
77
78
  target: { value: n }
78
79
  } = e;
79
- e.__origin === "clear_button" ? V() : H(n), o({ type: C }), setTimeout(() => {
80
- var c;
81
- return (c = m.current) == null ? void 0 : c.focus();
82
- });
83
- }, $ = () => {
84
- var e;
85
- o({ type: s, payload: !t.isOpen }), (e = m.current) == null || e.focus();
80
+ e.__origin === "clear_button" && H(), !/^\s/.test(n) && (j(n), o({ type: C }), setTimeout(() => {
81
+ var d;
82
+ return (d = f.current) == null ? void 0 : d.focus();
83
+ }));
86
84
  }, K = () => {
85
+ var e;
86
+ o({ type: i, payload: !t.isOpen }), (e = f.current) == null || e.focus();
87
+ }, F = () => {
87
88
  t.isOpen || o({
88
- type: s,
89
+ type: i,
89
90
  payload: !0
90
91
  });
91
- }, T = (e) => {
92
- o({
93
- type: ce,
94
- payload: {
95
- inputValue: S(u, e),
96
- value: e
97
- }
98
- }), O(b, d)(e), setTimeout(() => {
99
- var n;
100
- (n = m.current) == null || n.focus();
101
- }, 0), y == null || y(e);
102
- }, F = (e) => {
103
- var I, k;
92
+ }, I = D(
93
+ (e) => {
94
+ o({
95
+ type: ce,
96
+ payload: {
97
+ inputValue: S(c, e),
98
+ value: e
99
+ }
100
+ }), T(b, u)(e), setTimeout(() => {
101
+ var n;
102
+ (n = f.current) == null || n.focus();
103
+ }, 0), m == null || m(e);
104
+ },
105
+ [c, o, u, b, m]
106
+ ), X = (e) => {
107
+ var O, k;
104
108
  const { relatedTarget: n } = e;
105
- if (n && ((I = A.current) != null && I.contains(n) || (k = p.current) != null && k.contains(n)) || v.current) {
109
+ if (n && ((O = A.current) != null && O.contains(n) || (k = p.current) != null && k.contains(n)) || v.current) {
106
110
  setTimeout(() => v.current = !1, 0);
107
111
  return;
108
112
  }
109
- const c = t.value ?? t.inputValue ?? "";
110
- fe(R, d)(c);
111
- }, X = W(
113
+ const d = t.value ?? t.inputValue ?? "";
114
+ fe(B, u)(d);
115
+ }, q = D(
112
116
  (e) => {
113
117
  switch (e.key) {
114
118
  case "ArrowDown":
115
119
  case "ArrowUp": {
116
120
  e.preventDefault();
117
- const n = () => t.highlightedIndex === -1 ? c === -1 ? 0 : -1 : t.highlightedIndex, c = e.key === "ArrowDown" ? 1 : -1, I = le(
121
+ const n = () => t.highlightedIndex === -1 ? d === -1 ? 0 : -1 : t.highlightedIndex, d = e.key === "ArrowDown" ? 1 : -1, O = le(
118
122
  t.autocompleteOptions,
119
123
  n(),
120
- c
124
+ d
121
125
  );
122
- o({ type: ue, payload: I }), o({ type: s, payload: !0 });
126
+ o({ type: ue, payload: O }), o({ type: i, payload: !0 });
123
127
  break;
124
128
  }
125
129
  case "Enter":
126
130
  case "NumpadEnter": {
127
- if (e.preventDefault(), t.highlightedIndex >= 0) {
131
+ if (e.preventDefault(), o({ type: i, payload: !0 }), t.highlightedIndex >= 0) {
128
132
  const n = t.autocompleteOptions[t.highlightedIndex];
129
- n && n.props.value && !n.props.disabled && T(n.props.value);
133
+ n && n.props.value && !n.props.disabled && I(n.props.value);
130
134
  }
131
135
  break;
132
136
  }
133
137
  case "Tab": {
134
- o({ type: s, payload: !1 });
138
+ o({ type: i, payload: !1 });
135
139
  break;
136
140
  }
137
141
  case "Escape": {
138
- o({ type: s, payload: !1 });
142
+ o({ type: i, payload: !1 });
139
143
  break;
140
144
  }
141
145
  }
142
146
  },
143
- [t.highlightedIndex]
147
+ [t.highlightedIndex, t.autocompleteOptions, I]
144
148
  );
145
- return /* @__PURE__ */ q(
149
+ return /* @__PURE__ */ z(
146
150
  "div",
147
151
  {
148
152
  "aria-disabled": l,
149
- className: D("gi-autocomplete gi-not-prose", a.className),
153
+ className: P("gi-autocomplete gi-not-prose", a.className),
150
154
  children: [
151
- /* @__PURE__ */ f("span", { id: _, className: "gi-sr-only", children: w }),
152
- /* @__PURE__ */ f(
155
+ /* @__PURE__ */ h("span", { id: _, className: "gi-sr-only", children: w }),
156
+ /* @__PURE__ */ h(
153
157
  oe,
154
158
  {
155
159
  autoComplete: "off",
156
- id: B,
157
- name: d,
158
- onKeyDown: X,
159
- onIconEndClick: $,
160
- onChange: j,
161
- onClick: K,
162
- onBlur: F,
160
+ id: M,
161
+ name: u,
162
+ onKeyDown: q,
163
+ onIconEndClick: K,
164
+ onChange: $,
165
+ onClick: F,
166
+ onBlur: X,
163
167
  clearButtonEnabled: t.isClearButtonEnabled,
164
168
  inputActionPosition: "beforeSuffix",
165
169
  "aria-label": w,
166
170
  "aria-labelledby": _,
167
171
  "aria-disabled": l,
168
172
  disabled: l,
169
- placeholder: h ?? P("autocomplete.placeholder", { defaultValue: "Type to Search" }),
170
- iconEndClassName: D({
171
- "gi-cursor-pointer": !l && !i,
172
- "gi-cursor-not-allowed gi-pointer-events-none": l && !i
173
+ placeholder: y ?? G("autocomplete.placeholder", { defaultValue: "Type to Search" }),
174
+ iconEndClassName: P({
175
+ "gi-cursor-pointer": !l && !s,
176
+ "gi-cursor-not-allowed gi-pointer-events-none": l && !s
173
177
  }),
174
- iconEnd: i ? void 0 : me(t.isOpen),
175
- ref: m,
178
+ iconEnd: s ? void 0 : me(t.isOpen),
179
+ ref: f,
176
180
  iconEndRef: p,
177
181
  value: t.inputValue,
178
182
  "data-highlighted-index": t.highlightedIndex
179
183
  }
180
184
  ),
181
- /* @__PURE__ */ f(
185
+ /* @__PURE__ */ h(
182
186
  ne,
183
187
  {
184
- onOpenChange: U,
185
- triggerRef: m,
188
+ onOpenChange: V,
189
+ triggerRef: f,
186
190
  extraRefs: [p],
187
191
  open: t.isOpen,
188
192
  maxHeight: 304,
@@ -197,17 +201,17 @@ const {
197
201
  }
198
202
  ]
199
203
  },
200
- children: /* @__PURE__ */ f(
204
+ children: /* @__PURE__ */ h(
201
205
  ae,
202
206
  {
203
- onChange: T,
207
+ onChange: I,
204
208
  isLoading: g,
205
209
  showNoData: !((x = t.autocompleteOptions) != null && x.length),
206
210
  ref: A,
207
211
  children: he(
208
212
  t.autocompleteOptions,
209
213
  t,
210
- T
214
+ I
211
215
  )
212
216
  }
213
217
  )
@@ -217,39 +221,39 @@ const {
217
221
  }
218
222
  );
219
223
  }
220
- ), he = (a, r, p) => a.map((l, u) => {
224
+ ), he = (a, r, p) => a.map((l, c) => {
221
225
  if (r.optionType === "AutocompleteItem")
222
226
  return /* @__PURE__ */ Y(
223
- G,
227
+ L,
224
228
  {
225
229
  ...l.props,
226
230
  key: `AutocompleteItem-${l.props.value}`,
227
231
  selected: r.value === l.props.value,
228
- isHighlighted: u === r.highlightedIndex,
229
- index: u
232
+ isHighlighted: c === r.highlightedIndex,
233
+ index: c
230
234
  }
231
235
  );
232
236
  if (r.optionType === "AutocompleteGroupItem") {
233
- const h = l, y = Z.toArray(h.props.children).filter((g) => ee(g)).map((g) => {
234
- const i = g.props;
235
- return /* @__PURE__ */ f(
236
- G,
237
+ const y = l, m = Z.toArray(y.props.children).filter((g) => ee(g)).map((g) => {
238
+ const s = g.props;
239
+ return /* @__PURE__ */ h(
240
+ L,
237
241
  {
238
- ...i,
239
- selected: r.value.toString() === i.value.toString(),
242
+ ...s,
243
+ selected: r.value.toString() === s.value.toString(),
240
244
  onChange: p,
241
- index: u
245
+ index: c
242
246
  },
243
- `SelectGroupItemNext-SelectItemNext-${i.value.toString()}`
247
+ `SelectGroupItemNext-SelectItemNext-${s.value.toString()}`
244
248
  );
245
249
  });
246
- return /* @__PURE__ */ f(
250
+ return /* @__PURE__ */ h(
247
251
  re,
248
252
  {
249
- label: h.props.label,
250
- children: y
253
+ label: y.props.label,
254
+ children: m
251
255
  },
252
- `Group-${h.props.label}`
256
+ `Group-${y.props.label}`
253
257
  );
254
258
  }
255
259
  return null;
@@ -266,7 +270,7 @@ Object.defineProperty(ge, "componentType", {
266
270
  enumerable: !1
267
271
  });
268
272
  export {
269
- xe as Autocomplete,
273
+ ke as Autocomplete,
270
274
  ge as AutocompleteGroupItem,
271
275
  ye as AutocompleteItem,
272
276
  he as renderSelectMenuOptions
@@ -4,7 +4,7 @@ import { useScrollHighlightedItem as Y } from "../hooks/use-scroll-highlighted-i
4
4
  import { safeCloneElement as j } from "../utils/utilities.js";
5
5
  import { AUTOCOMPLETE_ACTIONS as k } from "./types.js";
6
6
  const {
7
- ON_RESET: x,
7
+ ON_RESET: R,
8
8
  ON_SELECT_ITEM: q,
9
9
  SET_INPUT_VALUE: P,
10
10
  SET_IS_OPEN: v,
@@ -31,7 +31,7 @@ const {
31
31
  ...e,
32
32
  isClearButtonEnabled: t.payload || !!e.inputValue
33
33
  };
34
- case x:
34
+ case R:
35
35
  return {
36
36
  ...e,
37
37
  value: "",
@@ -45,7 +45,8 @@ const {
45
45
  inputValue: t.payload.inputValue,
46
46
  value: t.payload.value,
47
47
  isOpen: !1,
48
- isClearButtonEnabled: !0
48
+ isClearButtonEnabled: !0,
49
+ highlightedIndex: -1
49
50
  };
50
51
  case S:
51
52
  return { ...e, highlightedIndex: t.payload };
@@ -55,25 +56,25 @@ const {
55
56
  return e;
56
57
  }
57
58
  }, J = (e) => {
58
- var n, p;
59
- const t = ((n = e == null ? void 0 : e.type) == null ? void 0 : n.componentType) || ((p = e == null ? void 0 : e.props) == null ? void 0 : p.__type);
60
- return h(e) && (t === "AutocompleteItem" || t === "AutocompleteGroupItem");
59
+ var s, l, o;
60
+ const t = ((s = e == null ? void 0 : e.type) == null ? void 0 : s.componentType) || ((l = e == null ? void 0 : e.props) == null ? void 0 : l.__type);
61
+ return h(e) && !((o = e == null ? void 0 : e.props) != null && o.hidden) && (t === "AutocompleteItem" || t === "AutocompleteGroupItem");
61
62
  }, B = (e, t) => {
62
- var s, a;
63
- const n = ((s = e.props.children) == null ? void 0 : s.toString().toLowerCase()) || "", p = (a = e.props.value) == null ? void 0 : a.toLowerCase(), l = t.toLowerCase();
64
- return n.includes(l) || p.includes(l);
65
- }, V = (e) => C.toArray(e).filter((t) => J(t)) || [], R = (e, t) => {
66
- var p, l, s, a, I, f;
67
- const n = V(e);
68
- for (const y of n) {
69
- const T = ((p = y.type) == null ? void 0 : p.componentType) || ((l = y.props) == null ? void 0 : l.__type);
70
- if (((s = y.props) == null ? void 0 : s.value) === t)
71
- return ((a = y.props.children) == null ? void 0 : a.toString()) || "";
63
+ var a, i;
64
+ const s = ((a = e.props.children) == null ? void 0 : a.toString().toLowerCase()) || "", l = (i = e.props.value) == null ? void 0 : i.toLowerCase(), o = t.toLowerCase();
65
+ return s.includes(o) || l.includes(o);
66
+ }, V = (e) => C.toArray(e).filter((t) => J(t)) || [], x = (e, t) => {
67
+ var l, o, a, i, I, f;
68
+ const s = V(e);
69
+ for (const y of s) {
70
+ const T = ((l = y.type) == null ? void 0 : l.componentType) || ((o = y.props) == null ? void 0 : o.__type);
71
+ if (((a = y.props) == null ? void 0 : a.value) === t)
72
+ return ((i = y.props.children) == null ? void 0 : i.toString()) || "";
72
73
  if (T === "AutocompleteGroupItem") {
73
- const u = C.toArray(y.props.children).filter(
74
+ const n = C.toArray(y.props.children).filter(
74
75
  (c) => h(c)
75
76
  );
76
- for (const c of u)
77
+ for (const c of n)
77
78
  if (((I = c.props) == null ? void 0 : I.value) === t)
78
79
  return ((f = c.props.children) == null ? void 0 : f.toString()) || "";
79
80
  }
@@ -82,88 +83,89 @@ const {
82
83
  }, K = (e) => {
83
84
  const t = V(e);
84
85
  return t != null && t.length && t.every(
85
- (p) => {
86
- var l;
87
- return p.props.__type === "AutocompleteGroupItem" || ((l = p.type) == null ? void 0 : l.componentType) === "AutocompleteGroupItem";
86
+ (l) => {
87
+ var o;
88
+ return l.props.__type === "AutocompleteGroupItem" || ((o = l.type) == null ? void 0 : o.componentType) === "AutocompleteGroupItem";
88
89
  }
89
90
  ) ? "AutocompleteGroupItem" : "AutocompleteItem";
90
91
  }, pe = ({
91
92
  children: e,
92
93
  defaultValue: t = "",
93
- isOpen: n = !1,
94
- freeSolo: p = !1,
95
- onOpen: l,
96
- onClose: s,
97
- onChange: a,
94
+ isOpen: s = !1,
95
+ freeSolo: l = !1,
96
+ onOpen: o,
97
+ onClose: a,
98
+ onChange: i,
98
99
  value: I
99
100
  }) => {
100
- const f = g(null), y = g(null), T = g(!1), u = G(
101
+ const f = g(null), y = g(null), T = g(!1), n = G(
101
102
  () => V(e || []),
102
103
  [e]
103
104
  ), c = () => {
104
- var i;
105
- return (i = f.current) == null ? void 0 : i.focus();
106
- }, d = G(() => K(e), [e]), [r, o] = X(z, null, () => ({
107
- isOpen: !!n,
105
+ var u;
106
+ return (u = f.current) == null ? void 0 : u.focus();
107
+ }, d = G(() => K(e), [e]), [p, r] = X(z, null, () => ({
108
+ isOpen: !!s,
108
109
  value: I,
109
110
  inputValue: t,
110
- autocompleteOptions: u,
111
+ autocompleteOptions: n,
111
112
  isClearButtonEnabled: !1,
112
113
  highlightedIndex: -1,
113
114
  optionType: d
114
115
  }));
115
- Y(y, r.highlightedIndex), A(() => {
116
- o({ type: E, payload: u });
117
- }, [u]), A(() => {
118
- o({ type: H, payload: d });
116
+ Y(y, p.highlightedIndex), A(() => {
117
+ r({ type: E, payload: n });
118
+ }, [n]), A(() => {
119
+ r({ type: H, payload: d });
119
120
  }, [d]), A(() => {
121
+ var u;
120
122
  if (!T.current) {
121
123
  T.current = !0;
122
124
  return;
123
125
  }
124
- r.inputValue === "" && r.value === "" && c();
125
- }, [r.isClearButtonEnabled]), A(() => {
126
- if (r.isOpen)
127
- l == null || l(), c(), o({ type: E, payload: u });
126
+ p.inputValue === "" && p.value === "" && ((u = p.autocompleteOptions) != null && u.length) && c();
127
+ }, [p.isClearButtonEnabled]), A(() => {
128
+ if (p.isOpen)
129
+ o == null || o(), c(), r({ type: E, payload: n });
128
130
  else {
129
- s == null || s();
130
- const i = R(e, r.value);
131
- i && r.value ? (o({
131
+ a == null || a();
132
+ const u = x(e, p.value);
133
+ u && p.value ? (r({
132
134
  type: P,
133
- payload: i
134
- }), o({ type: v, payload: !1 })) : p || (o({ type: x }), a == null || a("")), o({ type: U });
135
+ payload: u
136
+ }), r({ type: v, payload: !1 })) : l || (r({ type: R }), i == null || i("")), r({ type: U });
135
137
  }
136
- }, [r.isOpen]);
138
+ }, [p.isOpen]);
137
139
  const M = G(
138
- () => F.debounce((i) => {
139
- if (i) {
140
- const _ = u.map((m) => {
140
+ () => F.debounce((u) => {
141
+ if (u) {
142
+ const _ = n.map((m) => {
141
143
  var L, b;
142
144
  const D = ((L = m.type) == null ? void 0 : L.componentType) || ((b = m.props) == null ? void 0 : b.__type);
143
145
  if (d === "AutocompleteGroupItem" && D === "AutocompleteGroupItem") {
144
146
  const N = C.toArray(
145
147
  m.props.children
146
148
  ).filter((O) => h(O)).filter(
147
- (O) => B(O, i)
149
+ (O) => B(O, u)
148
150
  );
149
151
  return N.length > 0 ? j(m, { children: N }) : null;
150
152
  } else if (d === "AutocompleteItem")
151
- return B(m, i) ? m : null;
153
+ return B(m, u) ? m : null;
152
154
  return null;
153
155
  }).filter(Boolean);
154
- o({ type: E, payload: _ }), o({ type: S, payload: -1 }), (!r.isOpen && !r.value || (_ == null ? void 0 : _.length) === 0) && o({ type: v, payload: !0 });
156
+ r({ type: E, payload: _ }), r({ type: S, payload: -1 }), (!p.isOpen && !p.value || (_ == null ? void 0 : _.length) === 0) && r({ type: v, payload: !0 });
155
157
  } else
156
- o({ type: w, payload: "" }), o({ type: E, payload: u }), o({ type: S, payload: -1 });
158
+ r({ type: w, payload: "" }), r({ type: E, payload: n }), r({ type: S, payload: -1 });
157
159
  }, 500),
158
- [u, r.isOpen, r.value, p]
160
+ [n, p.isOpen, p.value, l]
159
161
  );
160
162
  return {
161
- state: r,
162
- dispatch: o,
163
+ state: p,
164
+ dispatch: r,
163
165
  inputRef: f,
164
166
  listRef: y,
165
- validChildren: u,
166
- getOptionLabelByValue: R,
167
+ validChildren: n,
168
+ getOptionLabelByValue: x,
167
169
  debouncedFilter: M
168
170
  };
169
171
  };
@@ -0,0 +1,6 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ export type BrowserSupportProps = {
3
+ onClose?: () => void;
4
+ className?: string;
5
+ } & ComponentPropsWithoutRef<'div'>;
6
+ export declare const BrowserSupport: ({ className, ...props }: BrowserSupportProps) => import("react/jsx-runtime").JSX.Element | null;