@godxjp/ui 6.7.0 → 6.9.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 (76) hide show
  1. package/dist/app/index.js +4 -4
  2. package/dist/{checkbox-CNP1MnPn.d.ts → checkbox-BKIGsv3G.d.ts} +1 -1
  3. package/dist/{chunk-LQGSZODY.js → chunk-2HLWHQJA.js} +1 -1
  4. package/dist/{chunk-WM5MKEOD.js → chunk-2QG3OVAD.js} +2 -2
  5. package/dist/{chunk-QT3T2HEI.js → chunk-43QSNZS3.js} +2 -2
  6. package/dist/{chunk-CJVXTCYD.js → chunk-4R7QL3MW.js} +1 -1
  7. package/dist/{chunk-RP3NH5QJ.js → chunk-6PWNLR2F.js} +1 -1
  8. package/dist/{chunk-Z33J65PB.js → chunk-6UFKWOEW.js} +2 -2
  9. package/dist/{chunk-NXUY7FO2.js → chunk-BBXDT2P2.js} +3 -3
  10. package/dist/{chunk-HGRRL34G.js → chunk-BEQDDDT7.js} +1 -1
  11. package/dist/{chunk-WMGG43RL.js → chunk-DOVA5SWV.js} +2 -2
  12. package/dist/{chunk-TRVOPU4U.js → chunk-FXFJF4YA.js} +21 -0
  13. package/dist/{chunk-K6D7LQWC.js → chunk-GH7E5N6F.js} +2 -2
  14. package/dist/{chunk-BCY4GMJV.js → chunk-ICQGSUTC.js} +3 -3
  15. package/dist/{chunk-GT2OGI2S.js → chunk-PE2QZHY2.js} +3 -3
  16. package/dist/{chunk-ZQUQLYCI.js → chunk-PWFFEMYI.js} +4 -4
  17. package/dist/{chunk-NHD5XDMX.js → chunk-RLGHEV4A.js} +1 -1
  18. package/dist/{chunk-3KYMBIKV.js → chunk-VV3M6PXD.js} +51 -30
  19. package/dist/{chunk-EXK2TN64.js → chunk-YVBZ37ZE.js} +2 -2
  20. package/dist/{chunk-NKQKCA5W.js → chunk-Z5D4E73N.js} +3 -3
  21. package/dist/{chunk-I2SHXSYY.js → chunk-ZTYEH3UW.js} +1 -1
  22. package/dist/components/admin/index.d.ts +5 -5
  23. package/dist/components/admin/index.js +23 -23
  24. package/dist/components/data-display/index.js +7 -7
  25. package/dist/components/data-entry/autocomplete.d.ts +1 -1
  26. package/dist/components/data-entry/autocomplete.js +4 -4
  27. package/dist/components/data-entry/calendar.d.ts +1 -1
  28. package/dist/components/data-entry/calendar.js +2 -2
  29. package/dist/components/data-entry/cascader.d.ts +1 -1
  30. package/dist/components/data-entry/cascader.js +6 -6
  31. package/dist/components/data-entry/checkbox.d.ts +2 -2
  32. package/dist/components/data-entry/color-picker.d.ts +1 -1
  33. package/dist/components/data-entry/color-picker.js +3 -3
  34. package/dist/components/data-entry/command.d.ts +5 -5
  35. package/dist/components/data-entry/date-picker.d.ts +1 -1
  36. package/dist/components/data-entry/date-picker.js +5 -5
  37. package/dist/components/data-entry/date-range-picker.d.ts +1 -1
  38. package/dist/components/data-entry/date-range-picker.js +5 -5
  39. package/dist/components/data-entry/index.d.ts +14 -5
  40. package/dist/components/data-entry/index.js +219 -22
  41. package/dist/components/data-entry/radio.d.ts +1 -1
  42. package/dist/components/data-entry/slider.d.ts +1 -1
  43. package/dist/components/data-entry/switch.d.ts +1 -1
  44. package/dist/components/data-entry/time-picker.d.ts +1 -1
  45. package/dist/components/data-entry/time-picker.js +3 -3
  46. package/dist/components/data-entry/transfer.d.ts +2 -2
  47. package/dist/components/data-entry/transfer.js +4 -4
  48. package/dist/components/data-entry/tree-select.d.ts +1 -1
  49. package/dist/components/data-entry/tree-select.js +6 -6
  50. package/dist/components/data-entry/upload.d.ts +2 -2
  51. package/dist/components/data-entry/upload.js +6 -6
  52. package/dist/components/feedback/alert.js +4 -4
  53. package/dist/components/feedback/dialog.js +3 -3
  54. package/dist/components/feedback/index.js +7 -7
  55. package/dist/components/layout/index.d.ts +4 -4
  56. package/dist/components/layout/index.js +5 -4
  57. package/dist/components/navigation/index.d.ts +2 -2
  58. package/dist/components/navigation/index.js +6 -6
  59. package/dist/components/navigation/pagination.js +4 -4
  60. package/dist/components/query/index.js +5 -5
  61. package/dist/components/ui/index.d.ts +2 -2
  62. package/dist/components/ui/index.js +23 -23
  63. package/dist/{data-entry.prop-I3mgmdGm.d.ts → data-entry.prop-CzBVxZ2F.d.ts} +42 -1
  64. package/dist/{filter-bar-CNEdQB7i.d.ts → filter-bar-DNDVhpCE.d.ts} +1 -1
  65. package/dist/i18n/index.d.ts +7 -0
  66. package/dist/i18n/index.js +2 -2
  67. package/dist/index.d.ts +5 -5
  68. package/dist/index.js +23 -23
  69. package/dist/{inline-BuyFYZah.d.ts → inline-Bu_syXvi.d.ts} +1 -1
  70. package/dist/{layout.prop-CjlAEWgr.d.ts → layout.prop-D3rD3uZq.d.ts} +6 -0
  71. package/dist/lib/datetime/index.js +1 -1
  72. package/dist/props/components/index.d.ts +2 -2
  73. package/dist/props/index.d.ts +2 -2
  74. package/dist/{search-input-JWJMFVqC.d.ts → search-input-Br_LCi4p.d.ts} +1 -1
  75. package/package.json +1 -1
  76. package/dist/{chunk-IK7I3ABN.js → chunk-I2V4Y2VF.js} +1 -1
@@ -6,7 +6,7 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
6
6
  ref?: React.Ref<HTMLDivElement>;
7
7
  } & {
8
8
  asChild?: boolean;
9
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
9
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
10
10
  label?: string;
11
11
  shouldFilter?: boolean;
12
12
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -31,7 +31,7 @@ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
31
31
  ref?: React.Ref<HTMLDivElement>;
32
32
  } & {
33
33
  asChild?: boolean;
34
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
34
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & {
35
35
  label?: string;
36
36
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
37
37
  declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
@@ -40,14 +40,14 @@ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
40
40
  ref?: React.Ref<HTMLDivElement>;
41
41
  } & {
42
42
  asChild?: boolean;
43
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
43
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
44
44
  declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
45
45
  children?: React.ReactNode;
46
46
  } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
47
47
  ref?: React.Ref<HTMLDivElement>;
48
48
  } & {
49
49
  asChild?: boolean;
50
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "heading" | "value"> & {
50
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
51
51
  heading?: React.ReactNode;
52
52
  value?: string;
53
53
  forceMount?: boolean;
@@ -58,7 +58,7 @@ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
58
58
  ref?: React.Ref<HTMLDivElement>;
59
59
  } & {
60
60
  asChild?: boolean;
61
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
61
+ }, "key" | "asChild" | keyof React.HTMLAttributes<HTMLDivElement>>, "onSelect" | "disabled" | "value"> & {
62
62
  disabled?: boolean;
63
63
  onSelect?: (value: string) => void;
64
64
  value?: string;
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { D as DatePickerProp } from '../../data-entry.prop-I3mgmdGm.js';
2
+ import { D as DatePickerProp } from '../../data-entry.prop-CzBVxZ2F.js';
3
3
  import '@radix-ui/react-checkbox';
4
4
  import '@radix-ui/react-radio-group';
5
5
  import '@radix-ui/react-slider';
@@ -1,9 +1,9 @@
1
- export { DatePicker } from '../../chunk-NKQKCA5W.js';
2
- import '../../chunk-IK7I3ABN.js';
1
+ export { DatePicker } from '../../chunk-Z5D4E73N.js';
2
+ import '../../chunk-I2V4Y2VF.js';
3
3
  import '../../chunk-VOHTRR5X.js';
4
4
  import '../../chunk-DY5C44UP.js';
5
- import '../../chunk-ICM6XBST.js';
6
5
  import '../../chunk-HJEBRCXL.js';
7
- import '../../chunk-NHD5XDMX.js';
8
- import '../../chunk-TRVOPU4U.js';
6
+ import '../../chunk-ICM6XBST.js';
7
+ import '../../chunk-RLGHEV4A.js';
8
+ import '../../chunk-FXFJF4YA.js';
9
9
  import '../../chunk-U7N2A7A3.js';
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { j as DateRangePickerProp } from '../../data-entry.prop-I3mgmdGm.js';
2
+ import { j as DateRangePickerProp } from '../../data-entry.prop-CzBVxZ2F.js';
3
3
  import '@radix-ui/react-checkbox';
4
4
  import '@radix-ui/react-radio-group';
5
5
  import '@radix-ui/react-slider';
@@ -1,9 +1,9 @@
1
- export { DateRangePicker } from '../../chunk-GT2OGI2S.js';
2
- import '../../chunk-IK7I3ABN.js';
1
+ export { DateRangePicker } from '../../chunk-PE2QZHY2.js';
2
+ import '../../chunk-I2V4Y2VF.js';
3
3
  import '../../chunk-VOHTRR5X.js';
4
4
  import '../../chunk-DY5C44UP.js';
5
- import '../../chunk-ICM6XBST.js';
6
5
  import '../../chunk-HJEBRCXL.js';
7
- import '../../chunk-NHD5XDMX.js';
8
- import '../../chunk-TRVOPU4U.js';
6
+ import '../../chunk-ICM6XBST.js';
7
+ import '../../chunk-RLGHEV4A.js';
8
+ import '../../chunk-FXFJF4YA.js';
9
9
  import '../../chunk-U7N2A7A3.js';
@@ -1,13 +1,13 @@
1
1
  export { Input, InputProps } from './input.js';
2
2
  export { Label } from './label.js';
3
3
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from './select.js';
4
- export { C as Checkbox, a as CheckboxGroup } from '../../checkbox-CNP1MnPn.js';
4
+ export { C as Checkbox, a as CheckboxGroup } from '../../checkbox-BKIGsv3G.js';
5
5
  export { Radio, RadioGroup, RadioGroupRoot, RadioItem } from './radio.js';
6
6
  export { Textarea, TextareaProps } from './textarea.js';
7
- export { F as FormField, S as SearchInput } from '../../search-input-JWJMFVqC.js';
7
+ export { F as FormField, S as SearchInput } from '../../search-input-Br_LCi4p.js';
8
8
  import * as react_jsx_runtime from 'react/jsx-runtime';
9
- import { n as SwitchFieldProp, g as CountryOptionLabelProp, i as CountrySelectProp } from '../../data-entry.prop-I3mgmdGm.js';
10
- export { a as AutocompleteProps, C as CalendarProps, b as CascaderProps, f as ColorPickerProps, h as CountryOptionProp, D as DatePickerProps, j as DateRangePickerProps, m as SliderProps, o as SwitchProps, p as TimePickerProps, q as TransferItemProp, r as TransferProps, u as TreeSelectProps, U as UploadCommitAction, v as UploadFileItem, x as UploadProps, y as UploadVariant, B as collectUploadCommitActions, E as createUploadItem } from '../../data-entry.prop-I3mgmdGm.js';
9
+ import { r as SwitchFieldProp, g as CountryOptionLabelProp, i as CountrySelectProp, o as SearchSelectProp } from '../../data-entry.prop-CzBVxZ2F.js';
10
+ export { a as AutocompleteProps, C as CalendarProps, b as CascaderProps, f as ColorPickerProps, h as CountryOptionProp, D as DatePickerProps, j as DateRangePickerProps, l as SearchSelectLoadParamsProp, m as SearchSelectLoadResultProp, n as SearchSelectOption, q as SliderProps, s as SwitchProps, t as TimePickerProps, u as TransferItemProp, v as TransferProps, y as TreeSelectProps, U as UploadCommitAction, z as UploadFileItem, E as UploadProps, G as UploadVariant, J as collectUploadCommitActions, K as createUploadItem } from '../../data-entry.prop-CzBVxZ2F.js';
11
11
  export { Switch } from './switch.js';
12
12
  export { Slider } from './slider.js';
13
13
  export { Calendar } from './calendar.js';
@@ -50,4 +50,13 @@ declare function CountryOptionLabel({ country, showCode, className, }: CountryOp
50
50
  /** Country picker on top of Select; submits the country code via a hidden form value. */
51
51
  declare function CountrySelect({ id, name, options, defaultValue, required, allowEmpty, emptyLabel, placeholder, invalid, }: CountrySelectProp): react_jsx_runtime.JSX.Element;
52
52
 
53
- export { CountryOptionLabel, CountryOptionLabelProp, CountrySelect, CountrySelectProp as CountrySelectProps, SwitchField, SwitchFieldProp as SwitchFieldProps };
53
+ /**
54
+ * SearchSelect — an async, searchable single-select combobox. Unlike `Autocomplete` (static
55
+ * options) this loads options REMOTELY via `loadOptions({ query, page })`, with a debounced
56
+ * search box, infinite-scroll pagination, and loading/empty states. Data-agnostic: pass any
57
+ * fetcher (REST, GraphQL, a cached query client…). Form-submittable via `name`; e2e-testable
58
+ * by the trigger's `data-testid` and each option's `${data-testid}-option-${value}` handle.
59
+ */
60
+ declare function SearchSelect({ value, onChange, loadOptions, selectedLabel, placeholder, searchPlaceholder, emptyMessage, loadingMessage, clearLabel, clearable, disabled, name, id, className, "data-testid": dataTestId, }: SearchSelectProp): react_jsx_runtime.JSX.Element;
61
+
62
+ export { CountryOptionLabel, CountryOptionLabelProp, CountrySelect, CountrySelectProp as CountrySelectProps, SearchSelect, SearchSelectProp as SearchSelectProps, SwitchField, SwitchFieldProp as SwitchFieldProps };
@@ -1,40 +1,44 @@
1
- export { Radio, RadioGroupOptions as RadioGroup, RadioGroupRoot, RadioItem } from '../../chunk-3UGU5TYP.js';
2
1
  import { Switch } from '../../chunk-WXW43RK5.js';
3
2
  export { Switch } from '../../chunk-WXW43RK5.js';
4
3
  export { Textarea } from '../../chunk-ZLK5SPT6.js';
5
- export { TimePicker } from '../../chunk-K6D7LQWC.js';
6
- export { ColorPicker } from '../../chunk-I2SHXSYY.js';
7
- export { DatePicker } from '../../chunk-NKQKCA5W.js';
8
- export { DateRangePicker } from '../../chunk-GT2OGI2S.js';
9
- export { Calendar } from '../../chunk-IK7I3ABN.js';
10
- export { Autocomplete } from '../../chunk-HGRRL34G.js';
11
- export { SearchInput, Transfer } from '../../chunk-EXK2TN64.js';
12
- export { SHOW_ALL, SHOW_CHILD, SHOW_PARENT, TreeSelect } from '../../chunk-NXUY7FO2.js';
13
- export { Upload, collectUploadCommitActions, createUploadItem, useUploadDraft } from '../../chunk-ZQUQLYCI.js';
4
+ export { TimePicker } from '../../chunk-GH7E5N6F.js';
5
+ export { DatePicker } from '../../chunk-Z5D4E73N.js';
6
+ export { DateRangePicker } from '../../chunk-PE2QZHY2.js';
7
+ export { Radio, RadioGroupOptions as RadioGroup, RadioGroupRoot, RadioItem } from '../../chunk-3UGU5TYP.js';
8
+ export { Autocomplete } from '../../chunk-BEQDDDT7.js';
9
+ export { Calendar } from '../../chunk-I2V4Y2VF.js';
10
+ export { ColorPicker } from '../../chunk-ZTYEH3UW.js';
11
+ export { SearchInput, Transfer } from '../../chunk-YVBZ37ZE.js';
12
+ export { SHOW_ALL, SHOW_CHILD, SHOW_PARENT, TreeSelect } from '../../chunk-BBXDT2P2.js';
13
+ export { Upload, collectUploadCommitActions, createUploadItem, useUploadDraft } from '../../chunk-PWFFEMYI.js';
14
+ export { Slider } from '../../chunk-CRERCLIZ.js';
14
15
  import { Select, SelectTrigger, SelectValue, SelectContent, SelectGroup, SelectItem } from '../../chunk-UX634MYF.js';
15
16
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue } from '../../chunk-UX634MYF.js';
16
- export { Slider } from '../../chunk-CRERCLIZ.js';
17
- export { Cascader } from '../../chunk-BCY4GMJV.js';
17
+ export { Cascader } from '../../chunk-ICQGSUTC.js';
18
18
  import '../../chunk-SMLKNECP.js';
19
- import '../../chunk-3KPEZ5CF.js';
19
+ import { Command, CommandList, CommandItem, CommandGroup } from '../../chunk-V6UWJKZF.js';
20
+ export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../../chunk-V6UWJKZF.js';
20
21
  export { Checkbox, CheckboxGroup } from '../../chunk-E76QIYSY.js';
21
22
  import '../../chunk-CQBADMFG.js';
22
- import '../../chunk-CJVXTCYD.js';
23
- import { Inline } from '../../chunk-S66TJXJU.js';
24
- import '../../chunk-LQGSZODY.js';
23
+ import '../../chunk-4R7QL3MW.js';
24
+ import '../../chunk-2HLWHQJA.js';
25
+ import { Input } from '../../chunk-VOHTRR5X.js';
25
26
  export { Input } from '../../chunk-VOHTRR5X.js';
26
- export { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from '../../chunk-V6UWJKZF.js';
27
- import '../../chunk-DY5C44UP.js';
27
+ import '../../chunk-3KPEZ5CF.js';
28
+ import { Popover, PopoverTrigger, PopoverContent } from '../../chunk-DY5C44UP.js';
29
+ import { Inline } from '../../chunk-S66TJXJU.js';
30
+ import { Button } from '../../chunk-HJEBRCXL.js';
28
31
  import '../../chunk-ICM6XBST.js';
29
- import '../../chunk-HJEBRCXL.js';
30
32
  export { FormField } from '../../chunk-F7PG4OEV.js';
31
33
  import { Label } from '../../chunk-7PWBC4BY.js';
32
34
  export { Label } from '../../chunk-7PWBC4BY.js';
33
- import '../../chunk-NHD5XDMX.js';
34
- import '../../chunk-TRVOPU4U.js';
35
+ import { useTranslation } from '../../chunk-RLGHEV4A.js';
36
+ import '../../chunk-FXFJF4YA.js';
35
37
  import { cn } from '../../chunk-U7N2A7A3.js';
38
+ import * as React from 'react';
36
39
  import { useId, useState } from 'react';
37
40
  import { jsxs, jsx } from 'react/jsx-runtime';
41
+ import { ChevronsUpDown, Check, Loader2 } from 'lucide-react';
38
42
 
39
43
  function SwitchField({
40
44
  id,
@@ -148,5 +152,198 @@ function CountrySelect({
148
152
  }
149
153
  );
150
154
  }
155
+ var DEBOUNCE_MS = 250;
156
+ function SearchSelect({
157
+ value = "",
158
+ onChange,
159
+ loadOptions,
160
+ selectedLabel,
161
+ placeholder,
162
+ searchPlaceholder,
163
+ emptyMessage,
164
+ loadingMessage,
165
+ clearLabel,
166
+ clearable = true,
167
+ disabled = false,
168
+ name,
169
+ id,
170
+ className,
171
+ "data-testid": dataTestId
172
+ }) {
173
+ const { t } = useTranslation();
174
+ const [open, setOpen] = React.useState(false);
175
+ const [query, setQuery] = React.useState("");
176
+ const [debouncedQuery, setDebouncedQuery] = React.useState("");
177
+ const [options, setOptions] = React.useState([]);
178
+ const [page, setPage] = React.useState(1);
179
+ const [hasMore, setHasMore] = React.useState(false);
180
+ const [loading, setLoading] = React.useState(false);
181
+ const [activeIndex, setActiveIndex] = React.useState(0);
182
+ const [picked, setPicked] = React.useState(null);
183
+ const reqId = React.useRef(0);
184
+ React.useEffect(() => {
185
+ const handle = window.setTimeout(() => setDebouncedQuery(query.trim()), DEBOUNCE_MS);
186
+ return () => window.clearTimeout(handle);
187
+ }, [query]);
188
+ const fetchPage = React.useCallback(
189
+ async (nextPage, search, append) => {
190
+ const ticket = ++reqId.current;
191
+ setLoading(true);
192
+ try {
193
+ const result = await loadOptions({ query: search, page: nextPage });
194
+ if (ticket !== reqId.current) return;
195
+ setOptions((prev) => append ? [...prev, ...result.options] : result.options);
196
+ setHasMore(Boolean(result.hasMore));
197
+ setPage(nextPage);
198
+ } finally {
199
+ if (ticket === reqId.current) setLoading(false);
200
+ }
201
+ },
202
+ [loadOptions]
203
+ );
204
+ React.useEffect(() => {
205
+ if (!open) return;
206
+ setActiveIndex(0);
207
+ void fetchPage(1, debouncedQuery, false);
208
+ }, [open, debouncedQuery, fetchPage]);
209
+ const grouped = React.useMemo(() => {
210
+ const order = [];
211
+ const buckets = /* @__PURE__ */ new Map();
212
+ for (const option of options) {
213
+ const key = option.group ?? "";
214
+ if (!buckets.has(key)) {
215
+ buckets.set(key, []);
216
+ order.push(key);
217
+ }
218
+ buckets.get(key).push(option);
219
+ }
220
+ let flatIndex = 0;
221
+ return order.map((key) => ({
222
+ heading: key || void 0,
223
+ items: (buckets.get(key) ?? []).map((option) => ({ option, index: flatIndex++ }))
224
+ }));
225
+ }, [options]);
226
+ const flatOrdered = React.useMemo(
227
+ () => grouped.flatMap((group) => group.items.map((entry) => entry.option)),
228
+ [grouped]
229
+ );
230
+ const resolvedPlaceholder = placeholder ?? t("dataEntry.searchSelect.placeholder");
231
+ const currentLabel = value ? picked?.label ?? selectedLabel ?? resolvedPlaceholder : resolvedPlaceholder;
232
+ const select = (option) => {
233
+ if (option.disabled) return;
234
+ setPicked(option);
235
+ onChange?.(option.value, option);
236
+ setOpen(false);
237
+ };
238
+ const clear = () => {
239
+ setPicked(null);
240
+ onChange?.("", void 0);
241
+ setOpen(false);
242
+ };
243
+ const onScroll = (event) => {
244
+ const el = event.currentTarget;
245
+ if (el.scrollHeight - el.scrollTop - el.clientHeight < 48 && hasMore && !loading) {
246
+ void fetchPage(page + 1, debouncedQuery, true);
247
+ }
248
+ };
249
+ const onKeyDown = (event) => {
250
+ if (event.key === "ArrowDown") {
251
+ event.preventDefault();
252
+ setActiveIndex((i) => Math.min(i + 1, Math.max(flatOrdered.length - 1, 0)));
253
+ } else if (event.key === "ArrowUp") {
254
+ event.preventDefault();
255
+ setActiveIndex((i) => Math.max(i - 1, 0));
256
+ } else if (event.key === "Enter" && flatOrdered[activeIndex]) {
257
+ event.preventDefault();
258
+ select(flatOrdered[activeIndex]);
259
+ } else if (event.key === "Escape") {
260
+ event.preventDefault();
261
+ setOpen(false);
262
+ }
263
+ };
264
+ const optionTestId = (optionValue) => dataTestId ? `${dataTestId}-option-${optionValue}` : void 0;
265
+ return /* @__PURE__ */ jsxs(
266
+ Popover,
267
+ {
268
+ open,
269
+ onOpenChange: (next) => {
270
+ setOpen(next);
271
+ if (!next) setQuery("");
272
+ },
273
+ children: [
274
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
275
+ Button,
276
+ {
277
+ id,
278
+ type: "button",
279
+ variant: "outline",
280
+ role: "combobox",
281
+ "aria-expanded": open,
282
+ disabled,
283
+ "data-testid": dataTestId,
284
+ className: cn("w-full justify-between font-normal", className),
285
+ children: [
286
+ /* @__PURE__ */ jsx("span", { className: cn("truncate text-left", !value && "text-muted-foreground"), children: currentLabel }),
287
+ /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 size-4 shrink-0 opacity-50", "aria-hidden": "true" })
288
+ ]
289
+ }
290
+ ) }),
291
+ name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value }) : null,
292
+ /* @__PURE__ */ jsx(
293
+ PopoverContent,
294
+ {
295
+ align: "start",
296
+ sideOffset: 4,
297
+ collisionPadding: 12,
298
+ className: "flex max-h-[min(24rem,var(--radix-popover-content-available-height))] w-max max-w-[min(32rem,calc(100vw-1.5rem))] min-w-[var(--radix-popover-trigger-width)] flex-col p-0",
299
+ children: /* @__PURE__ */ jsxs(Command, { shouldFilter: false, className: "flex min-h-0 flex-col", children: [
300
+ /* @__PURE__ */ jsx("div", { className: "border-border shrink-0 border-b p-2", children: /* @__PURE__ */ jsx(
301
+ Input,
302
+ {
303
+ autoFocus: true,
304
+ value: query,
305
+ onChange: (event) => setQuery(event.target.value),
306
+ onKeyDown,
307
+ placeholder: searchPlaceholder ?? t("dataEntry.searchSelect.search")
308
+ }
309
+ ) }),
310
+ /* @__PURE__ */ jsxs(CommandList, { className: "min-h-0 flex-1 overflow-y-auto p-1", onScroll, children: [
311
+ clearable && value ? /* @__PURE__ */ jsx(CommandItem, { value: "", "data-testid": optionTestId("none"), onSelect: clear, children: /* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-sm", children: clearLabel ?? t("dataEntry.searchSelect.clear") }) }) : null,
312
+ grouped.map((group) => {
313
+ const rows = group.items.map(({ option, index }) => /* @__PURE__ */ jsxs(
314
+ CommandItem,
315
+ {
316
+ value: option.value,
317
+ "data-testid": optionTestId(option.value),
318
+ "aria-selected": activeIndex === index,
319
+ disabled: option.disabled,
320
+ className: activeIndex === index ? "bg-accent text-accent-foreground" : void 0,
321
+ onMouseEnter: () => setActiveIndex(index),
322
+ onSelect: () => select(option),
323
+ children: [
324
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
325
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm font-medium", children: option.label }),
326
+ option.sublabel ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground truncate text-xs", children: option.sublabel }) : null
327
+ ] }),
328
+ value === option.value ? /* @__PURE__ */ jsx(Check, { className: "text-primary size-4 shrink-0", "aria-hidden": "true" }) : null
329
+ ]
330
+ },
331
+ option.value
332
+ ));
333
+ return group.heading ? /* @__PURE__ */ jsx(CommandGroup, { heading: group.heading, children: rows }, group.heading) : /* @__PURE__ */ jsx(React.Fragment, { children: rows }, "__ungrouped");
334
+ }),
335
+ loading ? /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-center gap-2 px-2 py-3 text-sm", children: [
336
+ /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }),
337
+ loadingMessage ?? t("dataEntry.searchSelect.loading")
338
+ ] }) : null,
339
+ !loading && options.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground px-2 py-6 text-center text-sm", children: emptyMessage ?? t("dataEntry.searchSelect.empty") }) : null
340
+ ] })
341
+ ] })
342
+ }
343
+ )
344
+ ]
345
+ }
346
+ );
347
+ }
151
348
 
152
- export { CountryOptionLabel, CountrySelect, SwitchField };
349
+ export { CountryOptionLabel, CountrySelect, SearchSelect, SwitchField };
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
4
- import { R as RadioGroupProp } from '../../data-entry.prop-I3mgmdGm.js';
4
+ import { R as RadioGroupProp } from '../../data-entry.prop-CzBVxZ2F.js';
5
5
  import '@radix-ui/react-checkbox';
6
6
  import '@radix-ui/react-slider';
7
7
  import '@radix-ui/react-switch';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as SliderPrimitive from '@radix-ui/react-slider';
3
- export { m as SliderProp, m as SliderProps } from '../../data-entry.prop-I3mgmdGm.js';
3
+ export { q as SliderProp, q as SliderProps } from '../../data-entry.prop-CzBVxZ2F.js';
4
4
  import '@radix-ui/react-checkbox';
5
5
  import '@radix-ui/react-radio-group';
6
6
  import '@radix-ui/react-switch';
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import * as SwitchPrimitive from '@radix-ui/react-switch';
3
- export { o as SwitchProp, o as SwitchProps } from '../../data-entry.prop-I3mgmdGm.js';
3
+ export { s as SwitchProp, s as SwitchProps } from '../../data-entry.prop-CzBVxZ2F.js';
4
4
  import '@radix-ui/react-checkbox';
5
5
  import '@radix-ui/react-radio-group';
6
6
  import '@radix-ui/react-slider';
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { p as TimePickerProp } from '../../data-entry.prop-I3mgmdGm.js';
2
+ import { t as TimePickerProp } from '../../data-entry.prop-CzBVxZ2F.js';
3
3
  import '@radix-ui/react-checkbox';
4
4
  import '@radix-ui/react-radio-group';
5
5
  import '@radix-ui/react-slider';
@@ -1,7 +1,7 @@
1
- export { TimePicker } from '../../chunk-K6D7LQWC.js';
1
+ export { TimePicker } from '../../chunk-GH7E5N6F.js';
2
2
  import '../../chunk-VOHTRR5X.js';
3
3
  import '../../chunk-DY5C44UP.js';
4
4
  import '../../chunk-HJEBRCXL.js';
5
- import '../../chunk-NHD5XDMX.js';
6
- import '../../chunk-TRVOPU4U.js';
5
+ import '../../chunk-RLGHEV4A.js';
6
+ import '../../chunk-FXFJF4YA.js';
7
7
  import '../../chunk-U7N2A7A3.js';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { r as TransferProp } from '../../data-entry.prop-I3mgmdGm.js';
3
- export { q as TransferItemProp } from '../../data-entry.prop-I3mgmdGm.js';
2
+ import { v as TransferProp } from '../../data-entry.prop-CzBVxZ2F.js';
3
+ export { u as TransferItemProp } from '../../data-entry.prop-CzBVxZ2F.js';
4
4
  import '@radix-ui/react-checkbox';
5
5
  import '@radix-ui/react-radio-group';
6
6
  import '@radix-ui/react-slider';
@@ -1,11 +1,11 @@
1
- export { Transfer } from '../../chunk-EXK2TN64.js';
1
+ export { Transfer } from '../../chunk-YVBZ37ZE.js';
2
2
  import '../../chunk-SMLKNECP.js';
3
- import '../../chunk-3KPEZ5CF.js';
4
3
  import '../../chunk-E76QIYSY.js';
5
4
  import '../../chunk-CQBADMFG.js';
6
5
  import '../../chunk-VOHTRR5X.js';
6
+ import '../../chunk-3KPEZ5CF.js';
7
7
  import '../../chunk-HJEBRCXL.js';
8
8
  import '../../chunk-7PWBC4BY.js';
9
- import '../../chunk-NHD5XDMX.js';
10
- import '../../chunk-TRVOPU4U.js';
9
+ import '../../chunk-RLGHEV4A.js';
10
+ import '../../chunk-FXFJF4YA.js';
11
11
  import '../../chunk-U7N2A7A3.js';
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { u as TreeSelectProp } from '../../data-entry.prop-I3mgmdGm.js';
2
+ import { y as TreeSelectProp } from '../../data-entry.prop-CzBVxZ2F.js';
3
3
  import '@radix-ui/react-checkbox';
4
4
  import '@radix-ui/react-radio-group';
5
5
  import '@radix-ui/react-slider';
@@ -1,13 +1,13 @@
1
- export { SHOW_ALL, SHOW_CHILD, SHOW_PARENT, TreeSelect } from '../../chunk-NXUY7FO2.js';
1
+ export { SHOW_ALL, SHOW_CHILD, SHOW_PARENT, TreeSelect } from '../../chunk-BBXDT2P2.js';
2
2
  import '../../chunk-SMLKNECP.js';
3
- import '../../chunk-3KPEZ5CF.js';
3
+ import '../../chunk-V6UWJKZF.js';
4
4
  import '../../chunk-E76QIYSY.js';
5
5
  import '../../chunk-CQBADMFG.js';
6
- import '../../chunk-V6UWJKZF.js';
6
+ import '../../chunk-3KPEZ5CF.js';
7
7
  import '../../chunk-DY5C44UP.js';
8
- import '../../chunk-ICM6XBST.js';
9
8
  import '../../chunk-HJEBRCXL.js';
9
+ import '../../chunk-ICM6XBST.js';
10
10
  import '../../chunk-7PWBC4BY.js';
11
- import '../../chunk-NHD5XDMX.js';
12
- import '../../chunk-TRVOPU4U.js';
11
+ import '../../chunk-RLGHEV4A.js';
12
+ import '../../chunk-FXFJF4YA.js';
13
13
  import '../../chunk-U7N2A7A3.js';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { v as UploadFileItem, U as UploadCommitAction, x as UploadProp } from '../../data-entry.prop-I3mgmdGm.js';
3
- export { w as UploadFileItemProp, y as UploadVariant, z as UploadVariantProp, B as collectUploadCommitActions, E as createUploadItem } from '../../data-entry.prop-I3mgmdGm.js';
2
+ import { z as UploadFileItem, U as UploadCommitAction, E as UploadProp } from '../../data-entry.prop-CzBVxZ2F.js';
3
+ export { B as UploadFileItemProp, G as UploadVariant, H as UploadVariantProp, J as collectUploadCommitActions, K as createUploadItem } from '../../data-entry.prop-CzBVxZ2F.js';
4
4
  import '@radix-ui/react-checkbox';
5
5
  import '@radix-ui/react-radio-group';
6
6
  import '@radix-ui/react-slider';
@@ -1,11 +1,11 @@
1
- export { Upload, collectUploadCommitActions, createUploadItem, useUploadDraft } from '../../chunk-ZQUQLYCI.js';
1
+ export { Upload, collectUploadCommitActions, createUploadItem, useUploadDraft } from '../../chunk-PWFFEMYI.js';
2
2
  import '../../chunk-CRERCLIZ.js';
3
- import '../../chunk-CJVXTCYD.js';
4
- import '../../chunk-LQGSZODY.js';
3
+ import '../../chunk-4R7QL3MW.js';
4
+ import '../../chunk-2HLWHQJA.js';
5
5
  import '../../chunk-VOHTRR5X.js';
6
- import '../../chunk-ICM6XBST.js';
7
6
  import '../../chunk-HJEBRCXL.js';
7
+ import '../../chunk-ICM6XBST.js';
8
8
  import '../../chunk-7PWBC4BY.js';
9
- import '../../chunk-NHD5XDMX.js';
10
- import '../../chunk-TRVOPU4U.js';
9
+ import '../../chunk-RLGHEV4A.js';
10
+ import '../../chunk-FXFJF4YA.js';
11
11
  import '../../chunk-U7N2A7A3.js';
@@ -1,7 +1,7 @@
1
- export { Alert, AlertActions, AlertBase, AlertContent, AlertDescription, AlertQueryError, AlertTitle } from '../../chunk-Z33J65PB.js';
2
- import '../../chunk-CJVXTCYD.js';
1
+ export { Alert, AlertActions, AlertBase, AlertContent, AlertDescription, AlertQueryError, AlertTitle } from '../../chunk-6UFKWOEW.js';
2
+ import '../../chunk-4R7QL3MW.js';
3
3
  import '../../chunk-S66TJXJU.js';
4
4
  import '../../chunk-HJEBRCXL.js';
5
- import '../../chunk-NHD5XDMX.js';
6
- import '../../chunk-TRVOPU4U.js';
5
+ import '../../chunk-RLGHEV4A.js';
6
+ import '../../chunk-FXFJF4YA.js';
7
7
  import '../../chunk-U7N2A7A3.js';
@@ -1,7 +1,7 @@
1
- export { Dialog, DialogAction, DialogCancel, DialogClose, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger } from '../../chunk-LQGSZODY.js';
1
+ export { Dialog, DialogAction, DialogCancel, DialogClose, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger } from '../../chunk-2HLWHQJA.js';
2
2
  import '../../chunk-VOHTRR5X.js';
3
3
  import '../../chunk-HJEBRCXL.js';
4
4
  import '../../chunk-7PWBC4BY.js';
5
- import '../../chunk-NHD5XDMX.js';
6
- import '../../chunk-TRVOPU4U.js';
5
+ import '../../chunk-RLGHEV4A.js';
6
+ import '../../chunk-FXFJF4YA.js';
7
7
  import '../../chunk-U7N2A7A3.js';
@@ -1,15 +1,15 @@
1
1
  export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger } from '../../chunk-BHV2FUOA.js';
2
2
  export { SkeletonCard, SkeletonDetail, SkeletonRows, SkeletonTable, toast, useToast } from '../../chunk-M64MVRLS.js';
3
3
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../chunk-32WO3YLB.js';
4
- export { Alert, AlertActions, AlertContent, AlertDescription, AlertQueryError, AlertTitle } from '../../chunk-Z33J65PB.js';
5
- import '../../chunk-CJVXTCYD.js';
6
- import '../../chunk-S66TJXJU.js';
7
- export { Dialog, DialogAction, DialogCancel, DialogClose, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from '../../chunk-LQGSZODY.js';
4
+ export { Alert, AlertActions, AlertContent, AlertDescription, AlertQueryError, AlertTitle } from '../../chunk-6UFKWOEW.js';
5
+ import '../../chunk-4R7QL3MW.js';
6
+ export { Dialog, DialogAction, DialogCancel, DialogClose, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger } from '../../chunk-2HLWHQJA.js';
8
7
  import '../../chunk-VOHTRR5X.js';
9
8
  export { Toaster } from '../../chunk-TO7URV7U.js';
10
- import '../../chunk-ICM6XBST.js';
9
+ import '../../chunk-S66TJXJU.js';
11
10
  import '../../chunk-HJEBRCXL.js';
11
+ import '../../chunk-ICM6XBST.js';
12
12
  import '../../chunk-7PWBC4BY.js';
13
- import '../../chunk-NHD5XDMX.js';
14
- import '../../chunk-TRVOPU4U.js';
13
+ import '../../chunk-RLGHEV4A.js';
14
+ import '../../chunk-FXFJF4YA.js';
15
15
  import '../../chunk-U7N2A7A3.js';
@@ -1,7 +1,7 @@
1
- export { I as Inline, P as PageContainer, S as Stack } from '../../inline-BuyFYZah.js';
1
+ export { I as Inline, P as PageContainer, S as Stack } from '../../inline-Bu_syXvi.js';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import { b as PageInsetProp, A as AppShellProp, d as SidebarProp, S as SidebarItemProp, h as TopbarProp } from '../../layout.prop-CjlAEWgr.js';
4
- export { I as InlineProp, I as InlineProps, P as PageContainerProp, P as PageContainerProps, c as SidebarProduct, e as SidebarSection, f as StackProp, f as StackProps, T as TopbarProduct, g as TopbarProject } from '../../layout.prop-CjlAEWgr.js';
3
+ import { b as PageInsetProp, A as AppShellProp, d as SidebarProp, S as SidebarItemProp, h as TopbarProp } from '../../layout.prop-D3rD3uZq.js';
4
+ export { I as InlineProp, I as InlineProps, P as PageContainerProp, P as PageContainerProps, c as SidebarProduct, e as SidebarSection, f as StackProp, f as StackProps, T as TopbarProduct, g as TopbarProject } from '../../layout.prop-D3rD3uZq.js';
5
5
  import { ReactNode, ComponentType, SVGProps } from 'react';
6
6
  import { a as BreadcrumbProp } from '../../navigation.prop-DxBiClEH.js';
7
7
  export { B as BreadcrumbItem, B as BreadcrumbItemProp } from '../../navigation.prop-DxBiClEH.js';
@@ -39,7 +39,7 @@ type BreadcrumbProps = {
39
39
  };
40
40
  declare function Breadcrumb({ items }: BreadcrumbProps): react_jsx_runtime.JSX.Element;
41
41
 
42
- declare function Topbar({ product, project, onProductOpen, onProjectOpen, onSearchOpen, onTweaksOpen, collapsed, onToggleCollapsed, rightSlot, unread, onNotificationsOpen, user, }: TopbarProp): react_jsx_runtime.JSX.Element;
42
+ declare function Topbar({ product, project, productMenu, projectMenu, onProductOpen, onProjectOpen, onSearchOpen, onTweaksOpen, collapsed, onToggleCollapsed, rightSlot, unread, onNotificationsOpen, user, }: TopbarProp): react_jsx_runtime.JSX.Element;
43
43
 
44
44
  type ResponsiveGridProps = {
45
45
  columns?: 2 | 3 | 4;
@@ -1,8 +1,9 @@
1
- export { AppShell, Breadcrumb, Menu, MobileFrame, PageContainer, PageInset, ResponsiveGrid, ShellApp, Sidebar, SplitPane, Stack, Topbar } from '../../chunk-3KYMBIKV.js';
2
- import '../../chunk-DV52WNXO.js';
3
- import '../../chunk-PIIRNAXA.js';
1
+ export { AppShell, Breadcrumb, Menu, MobileFrame, PageContainer, PageInset, ResponsiveGrid, ShellApp, Sidebar, SplitPane, Stack, Topbar } from '../../chunk-VV3M6PXD.js';
2
+ import '../../chunk-TO33OY4L.js';
4
3
  import '../../chunk-32WO3YLB.js';
5
- export { Inline } from '../../chunk-S66TJXJU.js';
4
+ import '../../chunk-DV52WNXO.js';
6
5
  import '../../chunk-DY5C44UP.js';
6
+ export { Inline } from '../../chunk-S66TJXJU.js';
7
+ import '../../chunk-PIIRNAXA.js';
7
8
  import '../../chunk-ICM6XBST.js';
8
9
  import '../../chunk-U7N2A7A3.js';