@godxjp/ui 6.9.0 → 6.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/dist/{checkbox-BKIGsv3G.d.ts → checkbox-9w-eF8sM.d.ts} +1 -1
  2. package/dist/{chunk-PE2QZHY2.js → chunk-25ZZ2W3M.js} +2 -2
  3. package/dist/{chunk-UX634MYF.js → chunk-ARDVPIF4.js} +99 -0
  4. package/dist/{chunk-6RA3KSVK.js → chunk-BM5LIDCS.js} +57 -1
  5. package/dist/{chunk-Z5D4E73N.js → chunk-EXBWDW5E.js} +2 -2
  6. package/dist/{chunk-6PWNLR2F.js → chunk-FBHN6OO4.js} +1 -1
  7. package/dist/chunk-OXKY5QMK.js +220 -0
  8. package/dist/{chunk-43QSNZS3.js → chunk-PFOBVLF3.js} +1 -1
  9. package/dist/chunk-Y3XBNUTD.js +32 -0
  10. package/dist/components/admin/index.d.ts +10 -10
  11. package/dist/components/admin/index.js +21 -20
  12. package/dist/components/data-display/index.d.ts +3 -3
  13. package/dist/components/data-display/index.js +6 -6
  14. package/dist/components/data-entry/autocomplete.d.ts +10 -2
  15. package/dist/components/data-entry/autocomplete.js +4 -2
  16. package/dist/components/data-entry/calendar.d.ts +2 -1
  17. package/dist/components/data-entry/calendar.js +2 -2
  18. package/dist/components/data-entry/cascader.d.ts +2 -1
  19. package/dist/components/data-entry/cascader.js +3 -3
  20. package/dist/components/data-entry/checkbox.d.ts +3 -2
  21. package/dist/components/data-entry/color-picker.d.ts +2 -1
  22. package/dist/components/data-entry/color-picker.js +2 -2
  23. package/dist/components/data-entry/date-picker.d.ts +2 -1
  24. package/dist/components/data-entry/date-picker.js +4 -4
  25. package/dist/components/data-entry/date-range-picker.d.ts +2 -1
  26. package/dist/components/data-entry/date-range-picker.js +4 -4
  27. package/dist/components/data-entry/index.d.ts +12 -10
  28. package/dist/components/data-entry/index.js +20 -216
  29. package/dist/components/data-entry/radio.d.ts +2 -1
  30. package/dist/components/data-entry/select.d.ts +21 -2
  31. package/dist/components/data-entry/select.js +8 -1
  32. package/dist/components/data-entry/slider.d.ts +2 -1
  33. package/dist/components/data-entry/switch.d.ts +2 -1
  34. package/dist/components/data-entry/time-picker.d.ts +2 -1
  35. package/dist/components/data-entry/time-picker.js +2 -2
  36. package/dist/components/data-entry/transfer.d.ts +3 -2
  37. package/dist/components/data-entry/transfer.js +2 -2
  38. package/dist/components/data-entry/tree-select.d.ts +2 -1
  39. package/dist/components/data-entry/tree-select.js +3 -3
  40. package/dist/components/data-entry/upload.d.ts +3 -2
  41. package/dist/components/data-entry/upload.js +2 -2
  42. package/dist/components/feedback/alert.d.ts +3 -3
  43. package/dist/components/feedback/dialog.d.ts +2 -2
  44. package/dist/components/feedback/index.d.ts +2 -2
  45. package/dist/components/feedback/index.js +3 -3
  46. package/dist/components/feedback/sheet.d.ts +1 -1
  47. package/dist/components/layout/index.d.ts +6 -6
  48. package/dist/components/layout/index.js +3 -3
  49. package/dist/components/navigation/index.d.ts +4 -4
  50. package/dist/components/navigation/index.js +8 -4
  51. package/dist/components/navigation/pagination.js +7 -3
  52. package/dist/components/ui/index.d.ts +5 -5
  53. package/dist/components/ui/index.js +17 -16
  54. package/dist/{content.prop-D1Dd3TAc.d.ts → content.prop-DrV_zDy-.d.ts} +3 -1
  55. package/dist/{data-display.prop-Cvi2Mrfw.d.ts → data-display.prop-i0iaSwMV.d.ts} +1 -1
  56. package/dist/{data-entry.prop-CzBVxZ2F.d.ts → data-entry.prop-Cjidhei7.d.ts} +39 -16
  57. package/dist/{data-table-CnRksymA.d.ts → data-table-Bg7fPpXy.d.ts} +1 -1
  58. package/dist/{feedback.prop-BmxUlpAW.d.ts → feedback.prop-BnBpUzNK.d.ts} +1 -1
  59. package/dist/{filter-bar-DNDVhpCE.d.ts → filter-bar-BpUvE_yO.d.ts} +1 -1
  60. package/dist/index.d.ts +10 -10
  61. package/dist/index.js +21 -20
  62. package/dist/{inline-Bu_syXvi.d.ts → inline-CV3A46np.d.ts} +1 -1
  63. package/dist/{layout.prop-D3rD3uZq.d.ts → layout.prop-MwHm4-Zl.d.ts} +2 -2
  64. package/dist/{navigation.prop-DxBiClEH.d.ts → navigation.prop-Hu7s7MJa.d.ts} +1 -1
  65. package/dist/props/components/index.d.ts +6 -6
  66. package/dist/props/index.d.ts +6 -6
  67. package/dist/props/index.js +1 -1
  68. package/dist/props/registry.d.ts +34 -1
  69. package/dist/props/registry.js +1 -1
  70. package/dist/props/vocabulary/index.d.ts +2 -2
  71. package/dist/{search-input-Br_LCi4p.d.ts → search-input-mAZy3Den.d.ts} +1 -1
  72. package/package.json +1 -1
  73. package/dist/chunk-BEQDDDT7.js +0 -81
  74. package/dist/{chunk-I2V4Y2VF.js → chunk-IK7I3ABN.js} +1 -1
  75. package/dist/{chunk-PWFFEMYI.js → chunk-NTUHJ37K.js} +1 -1
  76. package/dist/{chunk-DOVA5SWV.js → chunk-OI7TDPEJ.js} +1 -1
  77. package/dist/{chunk-ZTYEH3UW.js → chunk-TT2L7JM6.js} +1 -1
  78. package/dist/{chunk-BBXDT2P2.js → chunk-V7RC4PBY.js} +1 -1
  79. package/dist/{chunk-ICQGSUTC.js → chunk-VRSHUKDF.js} +1 -1
  80. package/dist/{chunk-VV3M6PXD.js → chunk-X3OSXYAB.js} +1 -1
  81. package/dist/{chunk-GH7E5N6F.js → chunk-ZKIAZDVU.js} +1 -1
  82. package/dist/{chunk-YVBZ37ZE.js → chunk-ZR2TIBPG.js} +1 -1
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { c as CheckboxGroupProp } from './data-entry.prop-CzBVxZ2F.js';
4
+ import { c as CheckboxGroupProp } from './data-entry.prop-Cjidhei7.js';
5
5
 
6
6
  declare function CheckboxGroup({ value: controlledValue, defaultValue, onChange, options, orientation, disabled, name, className, children, }: CheckboxGroupProp): react_jsx_runtime.JSX.Element;
7
7
 
@@ -1,6 +1,6 @@
1
- import { Calendar } from './chunk-I2V4Y2VF.js';
2
- import { Input } from './chunk-VOHTRR5X.js';
1
+ import { Calendar } from './chunk-IK7I3ABN.js';
3
2
  import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
3
+ import { Input } from './chunk-VOHTRR5X.js';
4
4
  import { Button } from './chunk-HJEBRCXL.js';
5
5
  import { useTranslation, usePickerLocales } from './chunk-RLGHEV4A.js';
6
6
  import { toIsoDate, parseDateInput } from './chunk-FXFJF4YA.js';
@@ -1,3 +1,4 @@
1
+ import { SearchSelect } from './chunk-OXKY5QMK.js';
1
2
  import { controlTriggerClass } from './chunk-ICM6XBST.js';
2
3
  import { cn } from './chunk-U7N2A7A3.js';
3
4
  import * as React from 'react';
@@ -5,7 +6,13 @@ import * as SelectPrimitive from '@radix-ui/react-select';
5
6
  import { ChevronDown, ChevronUp } from 'lucide-react';
6
7
  import { jsxs, jsx } from 'react/jsx-runtime';
7
8
 
9
+ function isDataSelect(props) {
10
+ return "options" in props || "loadOptions" in props;
11
+ }
8
12
  function Select(props) {
13
+ if (isDataSelect(props)) {
14
+ return /* @__PURE__ */ jsx(DataSelect, { ...props });
15
+ }
9
16
  return /* @__PURE__ */ jsx(SelectPrimitive.Root, { "data-slot": "select", ...props });
10
17
  }
11
18
  function SelectGroup(props) {
@@ -119,5 +126,97 @@ var SelectSeparator = React.forwardRef(({ className, ...props }, ref) => /* @__P
119
126
  }
120
127
  ));
121
128
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
129
+ function groupDataOptions(options) {
130
+ const order = [];
131
+ const buckets = /* @__PURE__ */ new Map();
132
+ for (const option of options) {
133
+ const key = option.group ?? "";
134
+ if (!buckets.has(key)) {
135
+ buckets.set(key, []);
136
+ order.push(key);
137
+ }
138
+ buckets.get(key).push(option);
139
+ }
140
+ return order.map((key) => ({ heading: key || void 0, items: buckets.get(key) ?? [] }));
141
+ }
142
+ function DataSelect({
143
+ options = [],
144
+ loadOptions,
145
+ showSearch,
146
+ value = "",
147
+ onChange,
148
+ renderOption,
149
+ selectedLabel,
150
+ placeholder,
151
+ searchPlaceholder,
152
+ emptyMessage,
153
+ loadingMessage,
154
+ clearLabel,
155
+ clearable,
156
+ disabled,
157
+ name,
158
+ id,
159
+ className,
160
+ "data-testid": dataTestId
161
+ }) {
162
+ const searchable = showSearch ?? Boolean(loadOptions);
163
+ if (searchable) {
164
+ return /* @__PURE__ */ jsx(
165
+ SearchSelect,
166
+ {
167
+ value,
168
+ onChange,
169
+ options,
170
+ loadOptions,
171
+ renderOption,
172
+ selectedLabel,
173
+ placeholder,
174
+ searchPlaceholder,
175
+ emptyMessage,
176
+ loadingMessage,
177
+ clearLabel,
178
+ clearable,
179
+ disabled,
180
+ name,
181
+ id,
182
+ className,
183
+ "data-testid": dataTestId
184
+ }
185
+ );
186
+ }
187
+ const optionTestId = (optionValue) => dataTestId ? `${dataTestId}-option-${optionValue}` : void 0;
188
+ const renderItem = (option) => /* @__PURE__ */ jsx(
189
+ SelectItem,
190
+ {
191
+ value: option.value,
192
+ disabled: option.disabled,
193
+ "data-testid": optionTestId(option.value),
194
+ children: renderOption ? renderOption(option) : option.label
195
+ },
196
+ option.value
197
+ );
198
+ return /* @__PURE__ */ jsxs(
199
+ SelectPrimitive.Root,
200
+ {
201
+ "data-slot": "select",
202
+ value: value || void 0,
203
+ onValueChange: (next) => onChange?.(
204
+ next,
205
+ options.find((option) => option.value === next)
206
+ ),
207
+ disabled,
208
+ name,
209
+ children: [
210
+ /* @__PURE__ */ jsx(SelectTrigger, { id, "data-testid": dataTestId, className, children: /* @__PURE__ */ jsx(SelectValue, { placeholder }) }),
211
+ /* @__PURE__ */ jsx(SelectContent, { children: groupDataOptions(options).map(
212
+ (group) => group.heading ? /* @__PURE__ */ jsxs(SelectGroup, { children: [
213
+ /* @__PURE__ */ jsx(SelectLabel, { children: group.heading }),
214
+ group.items.map(renderItem)
215
+ ] }, group.heading) : /* @__PURE__ */ jsx(React.Fragment, { children: group.items.map(renderItem) }, "__ungrouped")
216
+ ) })
217
+ ]
218
+ }
219
+ );
220
+ }
122
221
 
123
222
  export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
@@ -138,6 +138,11 @@ var VOCABULARY_REGISTRY = {
138
138
  category: "content",
139
139
  description: "Toolbar actions slot"
140
140
  },
141
+ EmptyMessageProp: {
142
+ file: "vocabulary/content.prop.ts",
143
+ category: "content",
144
+ description: "No-results / no-data message in lists, selects, empty states"
145
+ },
141
146
  // layout.prop.ts
142
147
  PageDensityProp: {
143
148
  file: "vocabulary/layout.prop.ts",
@@ -411,7 +416,58 @@ var COMPONENT_PROP_REGISTRY = {
411
416
  AutocompleteProp: {
412
417
  group: "data-entry",
413
418
  file: "components/data-entry.prop.ts",
414
- vocabulary: ["PlaceholderProp", "ValueProp", "DisabledProp", "IdProp"]
419
+ vocabulary: [
420
+ "PlaceholderProp",
421
+ "ValueProp",
422
+ "DisabledProp",
423
+ "IdProp",
424
+ "EmptyMessageProp",
425
+ "ClassNameProp"
426
+ ],
427
+ note: "Deprecated \u2014 a thin wrapper over SearchSelect (static options)."
428
+ },
429
+ SearchSelectProp: {
430
+ group: "data-entry",
431
+ file: "components/data-entry.prop.ts",
432
+ vocabulary: [
433
+ "ValueProp",
434
+ "PlaceholderProp",
435
+ "EmptyMessageProp",
436
+ "DisabledProp",
437
+ "NameProp",
438
+ "IdProp",
439
+ "ClassNameProp"
440
+ ],
441
+ note: "Deprecated \u2014 the searchable engine behind `<Select options showSearch>`; prefer Select."
442
+ },
443
+ SelectDataProp: {
444
+ group: "data-entry",
445
+ file: "components/data-entry.prop.ts",
446
+ vocabulary: [
447
+ "ValueProp",
448
+ "PlaceholderProp",
449
+ "EmptyMessageProp",
450
+ "DisabledProp",
451
+ "NameProp",
452
+ "IdProp",
453
+ "ClassNameProp"
454
+ ],
455
+ note: "Ant-style data-driven form of Select (options|loadOptions + showSearch). One Select for all single-selects."
456
+ },
457
+ SearchSelectOptionProp: {
458
+ group: "data-entry",
459
+ file: "components/data-entry.prop.ts",
460
+ vocabulary: []
461
+ },
462
+ SearchSelectLoadParamsProp: {
463
+ group: "data-entry",
464
+ file: "components/data-entry.prop.ts",
465
+ vocabulary: []
466
+ },
467
+ SearchSelectLoadResultProp: {
468
+ group: "data-entry",
469
+ file: "components/data-entry.prop.ts",
470
+ vocabulary: []
415
471
  },
416
472
  UploadProp: {
417
473
  group: "data-entry",
@@ -1,6 +1,6 @@
1
- import { Calendar } from './chunk-I2V4Y2VF.js';
2
- import { Input } from './chunk-VOHTRR5X.js';
1
+ import { Calendar } from './chunk-IK7I3ABN.js';
3
2
  import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
3
+ import { Input } from './chunk-VOHTRR5X.js';
4
4
  import { Button } from './chunk-HJEBRCXL.js';
5
5
  import { useTranslation, usePickerLocales } from './chunk-RLGHEV4A.js';
6
6
  import { toIsoDate, parseDateInput } from './chunk-FXFJF4YA.js';
@@ -1,4 +1,4 @@
1
- import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-UX634MYF.js';
1
+ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-ARDVPIF4.js';
2
2
  import { Button } from './chunk-HJEBRCXL.js';
3
3
  import { useTranslation } from './chunk-RLGHEV4A.js';
4
4
  import { cn } from './chunk-U7N2A7A3.js';
@@ -0,0 +1,220 @@
1
+ import { Command, CommandList, CommandItem, CommandGroup } from './chunk-V6UWJKZF.js';
2
+ import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
3
+ import { Input } from './chunk-VOHTRR5X.js';
4
+ import { Button } from './chunk-HJEBRCXL.js';
5
+ import { useTranslation } from './chunk-RLGHEV4A.js';
6
+ import { cn } from './chunk-U7N2A7A3.js';
7
+ import * as React from 'react';
8
+ import { ChevronsUpDown, Check, Loader2 } from 'lucide-react';
9
+ import { jsxs, jsx } from 'react/jsx-runtime';
10
+
11
+ var DEBOUNCE_MS = 250;
12
+ function SearchSelect({
13
+ value = "",
14
+ onChange,
15
+ options: staticOptions,
16
+ loadOptions,
17
+ renderOption,
18
+ selectedLabel,
19
+ placeholder,
20
+ searchPlaceholder,
21
+ emptyMessage,
22
+ loadingMessage,
23
+ clearLabel,
24
+ clearable = true,
25
+ disabled = false,
26
+ name,
27
+ id,
28
+ className,
29
+ "data-testid": dataTestId
30
+ }) {
31
+ const { t } = useTranslation();
32
+ const [open, setOpen] = React.useState(false);
33
+ const [query, setQuery] = React.useState("");
34
+ const [debouncedQuery, setDebouncedQuery] = React.useState("");
35
+ const [loaded, setLoaded] = React.useState([]);
36
+ const [page, setPage] = React.useState(1);
37
+ const [hasMore, setHasMore] = React.useState(false);
38
+ const [loading, setLoading] = React.useState(false);
39
+ const [activeIndex, setActiveIndex] = React.useState(0);
40
+ const [picked, setPicked] = React.useState(null);
41
+ const reqId = React.useRef(0);
42
+ const resolvedLoad = React.useMemo(
43
+ () => loadOptions ?? (async ({ query: search }) => {
44
+ const needle = search.trim().toLowerCase();
45
+ const list = staticOptions ?? [];
46
+ return {
47
+ options: needle ? list.filter(
48
+ (option) => option.label.toLowerCase().includes(needle) || option.value.toLowerCase().includes(needle)
49
+ ) : list,
50
+ hasMore: false
51
+ };
52
+ }),
53
+ [loadOptions, staticOptions]
54
+ );
55
+ React.useEffect(() => {
56
+ const handle = window.setTimeout(() => setDebouncedQuery(query.trim()), DEBOUNCE_MS);
57
+ return () => window.clearTimeout(handle);
58
+ }, [query]);
59
+ const fetchPage = React.useCallback(
60
+ async (nextPage, search, append) => {
61
+ const ticket = ++reqId.current;
62
+ setLoading(true);
63
+ try {
64
+ const result = await resolvedLoad({ query: search, page: nextPage });
65
+ if (ticket !== reqId.current) return;
66
+ setLoaded((prev) => append ? [...prev, ...result.options] : result.options);
67
+ setHasMore(Boolean(result.hasMore));
68
+ setPage(nextPage);
69
+ } finally {
70
+ if (ticket === reqId.current) setLoading(false);
71
+ }
72
+ },
73
+ [resolvedLoad]
74
+ );
75
+ React.useEffect(() => {
76
+ if (!open) return;
77
+ setActiveIndex(0);
78
+ void fetchPage(1, debouncedQuery, false);
79
+ }, [open, debouncedQuery, fetchPage]);
80
+ const grouped = React.useMemo(() => {
81
+ const order = [];
82
+ const buckets = /* @__PURE__ */ new Map();
83
+ for (const option of loaded) {
84
+ const key = option.group ?? "";
85
+ if (!buckets.has(key)) {
86
+ buckets.set(key, []);
87
+ order.push(key);
88
+ }
89
+ buckets.get(key).push(option);
90
+ }
91
+ let flatIndex = 0;
92
+ return order.map((key) => ({
93
+ heading: key || void 0,
94
+ items: (buckets.get(key) ?? []).map((option) => ({ option, index: flatIndex++ }))
95
+ }));
96
+ }, [loaded]);
97
+ const flatOrdered = React.useMemo(
98
+ () => grouped.flatMap((group) => group.items.map((entry) => entry.option)),
99
+ [grouped]
100
+ );
101
+ const resolvedPlaceholder = placeholder ?? t("dataEntry.searchSelect.placeholder");
102
+ const currentLabel = value ? picked?.label ?? selectedLabel ?? resolvedPlaceholder : resolvedPlaceholder;
103
+ const select = (option) => {
104
+ if (option.disabled) return;
105
+ setPicked(option);
106
+ onChange?.(option.value, option);
107
+ setOpen(false);
108
+ };
109
+ const clear = () => {
110
+ setPicked(null);
111
+ onChange?.("", void 0);
112
+ setOpen(false);
113
+ };
114
+ const onScroll = (event) => {
115
+ const el = event.currentTarget;
116
+ if (el.scrollHeight - el.scrollTop - el.clientHeight < 48 && hasMore && !loading) {
117
+ void fetchPage(page + 1, debouncedQuery, true);
118
+ }
119
+ };
120
+ const onKeyDown = (event) => {
121
+ if (event.key === "ArrowDown") {
122
+ event.preventDefault();
123
+ setActiveIndex((i) => Math.min(i + 1, Math.max(flatOrdered.length - 1, 0)));
124
+ } else if (event.key === "ArrowUp") {
125
+ event.preventDefault();
126
+ setActiveIndex((i) => Math.max(i - 1, 0));
127
+ } else if (event.key === "Enter" && flatOrdered[activeIndex]) {
128
+ event.preventDefault();
129
+ select(flatOrdered[activeIndex]);
130
+ } else if (event.key === "Escape") {
131
+ event.preventDefault();
132
+ setOpen(false);
133
+ }
134
+ };
135
+ const optionTestId = (optionValue) => dataTestId ? `${dataTestId}-option-${optionValue}` : void 0;
136
+ return /* @__PURE__ */ jsxs(
137
+ Popover,
138
+ {
139
+ open,
140
+ onOpenChange: (next) => {
141
+ setOpen(next);
142
+ if (!next) setQuery("");
143
+ },
144
+ children: [
145
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
146
+ Button,
147
+ {
148
+ id,
149
+ type: "button",
150
+ variant: "outline",
151
+ role: "combobox",
152
+ "aria-expanded": open,
153
+ disabled,
154
+ "data-testid": dataTestId,
155
+ className: cn("w-full justify-between font-normal", className),
156
+ children: [
157
+ /* @__PURE__ */ jsx("span", { className: cn("truncate text-left", !value && "text-muted-foreground"), children: currentLabel }),
158
+ /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ml-2 size-4 shrink-0 opacity-50", "aria-hidden": "true" })
159
+ ]
160
+ }
161
+ ) }),
162
+ name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value }) : null,
163
+ /* @__PURE__ */ jsx(
164
+ PopoverContent,
165
+ {
166
+ align: "start",
167
+ sideOffset: 4,
168
+ collisionPadding: 12,
169
+ 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",
170
+ children: /* @__PURE__ */ jsxs(Command, { shouldFilter: false, className: "flex min-h-0 flex-col", children: [
171
+ /* @__PURE__ */ jsx("div", { className: "border-border shrink-0 border-b p-2", children: /* @__PURE__ */ jsx(
172
+ Input,
173
+ {
174
+ autoFocus: true,
175
+ value: query,
176
+ onChange: (event) => setQuery(event.target.value),
177
+ onKeyDown,
178
+ placeholder: searchPlaceholder ?? t("dataEntry.searchSelect.search")
179
+ }
180
+ ) }),
181
+ /* @__PURE__ */ jsxs(CommandList, { className: "min-h-0 flex-1 overflow-y-auto p-1", onScroll, children: [
182
+ 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,
183
+ grouped.map((group) => {
184
+ const rows = group.items.map(({ option, index }) => /* @__PURE__ */ jsxs(
185
+ CommandItem,
186
+ {
187
+ value: option.value,
188
+ "data-testid": optionTestId(option.value),
189
+ "aria-selected": activeIndex === index,
190
+ disabled: option.disabled,
191
+ className: activeIndex === index ? "bg-accent text-accent-foreground" : void 0,
192
+ onMouseEnter: () => setActiveIndex(index),
193
+ onSelect: () => select(option),
194
+ children: [
195
+ renderOption ? /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: renderOption(option) }) : /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [
196
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: option.label }),
197
+ option.sublabel ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground truncate text-xs", children: option.sublabel }) : null
198
+ ] }),
199
+ value === option.value ? /* @__PURE__ */ jsx(Check, { className: "text-primary size-4 shrink-0", "aria-hidden": "true" }) : null
200
+ ]
201
+ },
202
+ option.value
203
+ ));
204
+ return group.heading ? /* @__PURE__ */ jsx(CommandGroup, { heading: group.heading, children: rows }, group.heading) : /* @__PURE__ */ jsx(React.Fragment, { children: rows }, "__ungrouped");
205
+ }),
206
+ loading ? /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-center gap-2 px-2 py-3 text-sm", children: [
207
+ /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }),
208
+ loadingMessage ?? t("dataEntry.searchSelect.loading")
209
+ ] }) : null,
210
+ !loading && loaded.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground px-2 py-6 text-center text-sm", children: emptyMessage ?? t("dataEntry.searchSelect.empty") }) : null
211
+ ] })
212
+ ] })
213
+ }
214
+ )
215
+ ]
216
+ }
217
+ );
218
+ }
219
+
220
+ export { SearchSelect };
@@ -1,4 +1,4 @@
1
- import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-UX634MYF.js';
1
+ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-ARDVPIF4.js';
2
2
  import { Button } from './chunk-HJEBRCXL.js';
3
3
  import { useTranslation, useOptionalAppContext, APP_LOCALES, resolveTimezonePickerOptions, getTimezoneLabel, APP_TIME_FORMAT_OPTIONS, getTimeFormatLabel } from './chunk-RLGHEV4A.js';
4
4
  import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from './chunk-FXFJF4YA.js';
@@ -0,0 +1,32 @@
1
+ import { SearchSelect } from './chunk-OXKY5QMK.js';
2
+ import { jsx } from 'react/jsx-runtime';
3
+
4
+ function Autocomplete({
5
+ options,
6
+ value,
7
+ onValueChange,
8
+ placeholder,
9
+ searchPlaceholder,
10
+ emptyMessage,
11
+ disabled,
12
+ className,
13
+ id
14
+ }) {
15
+ return /* @__PURE__ */ jsx(
16
+ SearchSelect,
17
+ {
18
+ id,
19
+ value,
20
+ onChange: (next) => onValueChange?.(next),
21
+ options,
22
+ clearable: false,
23
+ placeholder,
24
+ searchPlaceholder,
25
+ emptyMessage,
26
+ disabled,
27
+ className
28
+ }
29
+ );
30
+ }
31
+
32
+ export { Autocomplete };
@@ -1,9 +1,9 @@
1
- export { B as BreadcrumbItem } from '../../navigation.prop-DxBiClEH.js';
2
- export { I as InlineProp, P as PageContainerProp, P as PageContainerProps, a as PageHeaderProp, f as StackProp } from '../../layout.prop-D3rD3uZq.js';
3
- export { F as FilterBar, a as FilterGroup, P as PageHeader } from '../../filter-bar-DNDVhpCE.js';
4
- export { I as Inline, P as PageContainer, S as Stack } from '../../inline-Bu_syXvi.js';
5
- export { C as ColumnDef, D as DataTable, a as Density, E as EmptyState, K as KeyValueGrid, S as StatusBadge } from '../../data-table-CnRksymA.js';
6
- export { F as FormField, S as SearchInput } from '../../search-input-Br_LCi4p.js';
1
+ export { B as BreadcrumbItem } from '../../navigation.prop-Hu7s7MJa.js';
2
+ export { I as InlineProp, P as PageContainerProp, P as PageContainerProps, a as PageHeaderProp, f as StackProp } from '../../layout.prop-MwHm4-Zl.js';
3
+ export { F as FilterBar, a as FilterGroup, P as PageHeader } from '../../filter-bar-BpUvE_yO.js';
4
+ export { I as Inline, P as PageContainer, S as Stack } from '../../inline-CV3A46np.js';
5
+ export { C as ColumnDef, D as DataTable, a as Density, E as EmptyState, K as KeyValueGrid, S as StatusBadge } from '../../data-table-Bg7fPpXy.js';
6
+ export { F as FormField, S as SearchInput } from '../../search-input-mAZy3Den.js';
7
7
  export { L as LegacyToastOptions, S as SkeletonCard, a as SkeletonDetail, b as SkeletonRows, c as SkeletonTable, t as toast, u as useToast } from '../../use-toast-Dol5bdY3.js';
8
8
  export { DataState, InfiniteQueryState, MutationFeedback, PrefetchLink, QueryRefetchButton, flattenItemPages } from '../query/index.js';
9
9
  export { Alert, AlertActions, AlertContent, AlertDescription, AlertQueryError, AlertTitle } from '../feedback/alert.js';
@@ -19,23 +19,23 @@ export { Dialog, DialogConfirm, DialogContent, DialogDescription, DialogFooter,
19
19
  export { Toaster } from '../feedback/sonner.js';
20
20
  import { b as FormatDatetimeOptions, a as FormatDateOptions } from '../../format-date-ByyZoqI5.js';
21
21
  export { j as formatDate } from '../../format-date-ByyZoqI5.js';
22
- export { J as collectUploadCommitActions, K as createUploadItem } from '../../data-entry.prop-CzBVxZ2F.js';
22
+ export { K as collectUploadCommitActions, L as createUploadItem } from '../../data-entry.prop-Cjidhei7.js';
23
23
  import '../../shared.prop-BNRJc9K0.js';
24
24
  import 'react';
25
- import '../../content.prop-D1Dd3TAc.js';
25
+ import '../../content.prop-DrV_zDy-.js';
26
26
  import '../../layout.prop-4TCNvyQZ.js';
27
27
  import 'react/jsx-runtime';
28
28
  import '../../navigation.prop-Ck5_gSfs.js';
29
29
  import '../../data.prop-BmLaGLb7.js';
30
30
  import '../../interaction.prop-Cdn7wOtq.js';
31
- import '../../data-display.prop-Cvi2Mrfw.js';
31
+ import '../../data-display.prop-i0iaSwMV.js';
32
32
  import 'lucide-react';
33
33
  import 'sonner';
34
34
  import '../../query.prop-hIPrk2zI.js';
35
35
  import '@tanstack/react-query';
36
36
  import 'react-router-dom';
37
37
  import '../../general.prop-D7brMPNL.js';
38
- import '../../feedback.prop-BmxUlpAW.js';
38
+ import '../../feedback.prop-BnBpUzNK.js';
39
39
  import '@radix-ui/react-checkbox';
40
40
  import '@radix-ui/react-radio-group';
41
41
  import '@radix-ui/react-slider';
@@ -1,38 +1,39 @@
1
1
  import '../../chunk-LDSLS6HE.js';
2
- export { DataState, InfiniteQueryState, MutationFeedback, PrefetchLink, QueryRefetchButton, flattenItemPages } from '../../chunk-2QG3OVAD.js';
3
- export { FilterBar, FilterGroup, PageHeader } from '../../chunk-43QSNZS3.js';
4
- export { Pagination } from '../../chunk-6PWNLR2F.js';
2
+ export { FilterBar, FilterGroup, PageHeader } from '../../chunk-PFOBVLF3.js';
3
+ export { Pagination } from '../../chunk-FBHN6OO4.js';
5
4
  export { Steps } from '../../chunk-L6J44O74.js';
6
5
  export { TabsItems } from '../../chunk-BPSKQUL2.js';
7
6
  export { Tabs, TabsContent, TabsList, TabsTrigger } from '../../chunk-XG7XDYIM.js';
8
- export { PageContainer, Stack } from '../../chunk-VV3M6PXD.js';
7
+ export { DataState, InfiniteQueryState, MutationFeedback, PrefetchLink, QueryRefetchButton, flattenItemPages } from '../../chunk-2QG3OVAD.js';
8
+ export { PageContainer, Stack } from '../../chunk-X3OSXYAB.js';
9
9
  import '../../chunk-TO33OY4L.js';
10
- export { SearchInput, Transfer, useDebouncedValue, useTimeoutFlag } from '../../chunk-YVBZ37ZE.js';
11
- export { TreeSelect } from '../../chunk-BBXDT2P2.js';
12
- export { Upload, collectUploadCommitActions, createUploadItem, useUploadDraft } from '../../chunk-PWFFEMYI.js';
10
+ export { SearchInput, Transfer, useDebouncedValue, useTimeoutFlag } from '../../chunk-ZR2TIBPG.js';
11
+ export { TreeSelect } from '../../chunk-V7RC4PBY.js';
12
+ export { Upload, collectUploadCommitActions, createUploadItem, useUploadDraft } from '../../chunk-NTUHJ37K.js';
13
13
  import '../../chunk-CRERCLIZ.js';
14
- import '../../chunk-UX634MYF.js';
15
- export { Cascader } from '../../chunk-ICQGSUTC.js';
14
+ import '../../chunk-ARDVPIF4.js';
15
+ export { SkeletonCard, SkeletonDetail, SkeletonRows, SkeletonTable, toast, useToast } from '../../chunk-M64MVRLS.js';
16
+ import '../../chunk-32WO3YLB.js';
17
+ export { Toaster } from '../../chunk-TO7URV7U.js';
18
+ import '../../chunk-OXKY5QMK.js';
19
+ export { Cascader } from '../../chunk-VRSHUKDF.js';
16
20
  import '../../chunk-SMLKNECP.js';
17
21
  import '../../chunk-V6UWJKZF.js';
18
22
  import '../../chunk-E76QIYSY.js';
19
23
  import '../../chunk-CQBADMFG.js';
20
- export { SkeletonCard, SkeletonDetail, SkeletonRows, SkeletonTable, toast, useToast } from '../../chunk-M64MVRLS.js';
21
- import '../../chunk-32WO3YLB.js';
24
+ export { DataTable, EmptyState, KeyValueGrid, StatusBadge } from '../../chunk-OI7TDPEJ.js';
25
+ import '../../chunk-DV52WNXO.js';
26
+ import '../../chunk-PIIRNAXA.js';
27
+ import '../../chunk-DY5C44UP.js';
28
+ import '../../chunk-3KPEZ5CF.js';
29
+ import '../../chunk-ZS6DTAM2.js';
30
+ import '../../chunk-ICM6XBST.js';
22
31
  export { Alert, AlertActions, AlertContent, AlertDescription, AlertQueryError, AlertTitle } from '../../chunk-6UFKWOEW.js';
23
32
  export { formatBytes, formatCurrency, formatDateLong, formatDateTime, formatRelative, humanError, shortId } from '../../chunk-4R7QL3MW.js';
33
+ export { Inline } from '../../chunk-S66TJXJU.js';
24
34
  export { Dialog, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '../../chunk-2HLWHQJA.js';
25
35
  import '../../chunk-VOHTRR5X.js';
26
- export { Toaster } from '../../chunk-TO7URV7U.js';
27
- export { DataTable, EmptyState, KeyValueGrid, StatusBadge } from '../../chunk-DOVA5SWV.js';
28
- import '../../chunk-DV52WNXO.js';
29
- import '../../chunk-ZS6DTAM2.js';
30
- import '../../chunk-3KPEZ5CF.js';
31
- import '../../chunk-DY5C44UP.js';
32
- export { Inline } from '../../chunk-S66TJXJU.js';
33
36
  import '../../chunk-HJEBRCXL.js';
34
- import '../../chunk-PIIRNAXA.js';
35
- import '../../chunk-ICM6XBST.js';
36
37
  export { FormField } from '../../chunk-F7PG4OEV.js';
37
38
  import '../../chunk-7PWBC4BY.js';
38
39
  import '../../chunk-RLGHEV4A.js';
@@ -1,7 +1,7 @@
1
1
  export { Badge, BadgeProps } from './badge.js';
2
2
  export { Card, CardAction, CardContent, CardCover, CardDescription, CardFooter, CardHeader, CardStat, CardStatProps, CardTitle } from './card.js';
3
3
  export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from './table.js';
4
- export { C as ColumnDef, D as DataTable, E as EmptyState, K as KeyValueGrid, S as StatusBadge, b as StatusBadgeTone, a as TableDensity } from '../../data-table-CnRksymA.js';
4
+ export { C as ColumnDef, D as DataTable, E as EmptyState, K as KeyValueGrid, S as StatusBadge, b as StatusBadgeTone, a as TableDensity } from '../../data-table-Bg7fPpXy.js';
5
5
  export { c as SortStateProp } from '../../interaction.prop-Cdn7wOtq.js';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import * as React from 'react';
@@ -11,9 +11,9 @@ export { ScrollArea, ScrollBar } from './scroll-area.js';
11
11
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
12
12
  import 'class-variance-authority/types';
13
13
  import 'class-variance-authority';
14
- import '../../data-display.prop-Cvi2Mrfw.js';
14
+ import '../../data-display.prop-i0iaSwMV.js';
15
15
  import '../../shared.prop-BNRJc9K0.js';
16
- import '../../content.prop-D1Dd3TAc.js';
16
+ import '../../content.prop-DrV_zDy-.js';
17
17
  import '../../layout.prop-4TCNvyQZ.js';
18
18
  import '../../data.prop-BmLaGLb7.js';
19
19
  import 'lucide-react';
@@ -1,14 +1,14 @@
1
1
  export { Card, CardAction, CardContent, CardCover, CardDescription, CardFooter, CardHeader, CardStat, CardTitle } from '../../chunk-GXHZAJUA.js';
2
- export { DataTable, EmptyState, KeyValueGrid, StatusBadge } from '../../chunk-DOVA5SWV.js';
2
+ export { DataTable, EmptyState, KeyValueGrid, StatusBadge } from '../../chunk-OI7TDPEJ.js';
3
3
  export { Collapsible, CollapsibleContent, CollapsibleTrigger } from '../../chunk-DV52WNXO.js';
4
- export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../chunk-ZS6DTAM2.js';
5
- export { ScrollArea, ScrollBar } from '../../chunk-3KPEZ5CF.js';
6
- export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from '../../chunk-DY5C44UP.js';
7
- import '../../chunk-S66TJXJU.js';
8
- import '../../chunk-HJEBRCXL.js';
9
4
  import { Badge } from '../../chunk-PIIRNAXA.js';
10
5
  export { Badge } from '../../chunk-PIIRNAXA.js';
6
+ export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from '../../chunk-DY5C44UP.js';
7
+ export { ScrollArea, ScrollBar } from '../../chunk-3KPEZ5CF.js';
8
+ export { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../../chunk-ZS6DTAM2.js';
11
9
  import '../../chunk-ICM6XBST.js';
10
+ import '../../chunk-S66TJXJU.js';
11
+ import '../../chunk-HJEBRCXL.js';
12
12
  import '../../chunk-RLGHEV4A.js';
13
13
  import '../../chunk-FXFJF4YA.js';
14
14
  import '../../chunk-U7N2A7A3.js';
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { a as AutocompleteProp } from '../../data-entry.prop-CzBVxZ2F.js';
2
+ import { a as AutocompleteProp } from '../../data-entry.prop-Cjidhei7.js';
3
3
  import '@radix-ui/react-checkbox';
4
4
  import '@radix-ui/react-radio-group';
5
5
  import '@radix-ui/react-slider';
@@ -7,10 +7,18 @@ import '@radix-ui/react-switch';
7
7
  import 'react-day-picker';
8
8
  import 'react';
9
9
  import '../../shared.prop-BNRJc9K0.js';
10
+ import '../../content.prop-DrV_zDy-.js';
10
11
  import '../../data.prop-BmLaGLb7.js';
11
12
  import '../../interaction.prop-Cdn7wOtq.js';
12
13
  import '../../layout.prop-4TCNvyQZ.js';
13
14
 
14
- declare function Autocomplete({ options, value, onValueChange, placeholder, emptyMessage, disabled, className, id, searchPlaceholder, }: AutocompleteProp): react_jsx_runtime.JSX.Element;
15
+ /**
16
+ * Searchable combobox over a static list.
17
+ *
18
+ * @deprecated Prefer {@link SearchSelect} with a static `options` array — it is a strict superset
19
+ * (optgroup grouping, sublabels, async `loadOptions`, custom `renderOption`). `Autocomplete` is
20
+ * now a thin wrapper kept for backward compatibility.
21
+ */
22
+ declare function Autocomplete({ options, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, disabled, className, id, }: AutocompleteProp): react_jsx_runtime.JSX.Element;
15
23
 
16
24
  export { Autocomplete, AutocompleteProp, AutocompleteProp as AutocompleteProps };