@godxjp/ui 13.5.1 → 13.7.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 (99) hide show
  1. package/dist/app/index.js +4 -4
  2. package/dist/{checkbox-iicX1PfF.d.ts → checkbox-ChJ2PyIz.d.ts} +1 -1
  3. package/dist/{chunk-HOQSAUHZ.js → chunk-2FJ5TMQU.js} +1 -1
  4. package/dist/{chunk-LIOHE3RU.js → chunk-3JQDPNTA.js} +1 -1
  5. package/dist/{chunk-IYSGELQC.js → chunk-3ZNSR2NL.js} +3 -3
  6. package/dist/{chunk-CA247VOA.js → chunk-5L77S5CL.js} +31 -1
  7. package/dist/chunk-6AIYMYSG.js +98 -0
  8. package/dist/{chunk-QHS4U3SS.js → chunk-6EKAEN6T.js} +3 -3
  9. package/dist/{chunk-RR2SSSQS.js → chunk-B23A5CPA.js} +2 -2
  10. package/dist/{chunk-DKW3XS2A.js → chunk-B7R7DHZF.js} +1 -1
  11. package/dist/{chunk-ITOHGSPS.js → chunk-C7W5BO7R.js} +3 -0
  12. package/dist/{chunk-QEHMSZBQ.js → chunk-CSTUENE6.js} +27 -7
  13. package/dist/{chunk-PXOPMYPJ.js → chunk-G7A6SUIN.js} +28 -7
  14. package/dist/{chunk-CLEBTIY3.js → chunk-GOJQHYED.js} +141 -101
  15. package/dist/{chunk-4GHHVXUR.js → chunk-I472SSN2.js} +2 -2
  16. package/dist/{chunk-BIC6D4EL.js → chunk-JXGDDD46.js} +2 -2
  17. package/dist/{chunk-LCKET5WL.js → chunk-KW54IV4X.js} +3 -3
  18. package/dist/{chunk-3JIPRB2T.js → chunk-LFO5BJ4H.js} +2 -2
  19. package/dist/{chunk-46UVXYPU.js → chunk-LTKHPOE3.js} +1 -1
  20. package/dist/{chunk-2XH6QAOC.js → chunk-MUUO7SPN.js} +1 -1
  21. package/dist/{chunk-WW47N4ID.js → chunk-O3F3KF2B.js} +3 -3
  22. package/dist/{chunk-IHNZCBES.js → chunk-QMGNMDQG.js} +28 -8
  23. package/dist/{chunk-QVLCFPKF.js → chunk-QPRBPE4S.js} +3 -3
  24. package/dist/{chunk-6EBULOWM.js → chunk-QTEPKNQE.js} +1 -1
  25. package/dist/{chunk-E2CTBKYL.js → chunk-RBXVCWXL.js} +2 -2
  26. package/dist/{chunk-XBFXYKJS.js → chunk-SXECWZZV.js} +4 -4
  27. package/dist/{chunk-YY5PUFBL.js → chunk-TNFAUPEV.js} +4 -4
  28. package/dist/{chunk-JCDLEXBB.js → chunk-W3AS2GEC.js} +2 -2
  29. package/dist/chunk-ZOMIELKI.js +86 -0
  30. package/dist/{chunk-BTTKHJMC.js → chunk-ZYJRZLMZ.js} +1 -1
  31. package/dist/components/admin/index.d.ts +2 -2
  32. package/dist/components/admin/index.js +27 -27
  33. package/dist/components/data-display/badge.js +3 -3
  34. package/dist/components/data-display/card.d.ts +2 -2
  35. package/dist/components/data-display/carousel.js +3 -3
  36. package/dist/components/data-display/index.js +8 -8
  37. package/dist/components/data-entry/calendar.d.ts +1 -1
  38. package/dist/components/data-entry/calendar.js +4 -2
  39. package/dist/components/data-entry/cascader.d.ts +1 -1
  40. package/dist/components/data-entry/cascader.js +4 -4
  41. package/dist/components/data-entry/checkbox.d.ts +2 -2
  42. package/dist/components/data-entry/color-picker.d.ts +1 -1
  43. package/dist/components/data-entry/color-picker.js +4 -4
  44. package/dist/components/data-entry/date-picker.d.ts +2 -2
  45. package/dist/components/data-entry/date-picker.js +6 -6
  46. package/dist/components/data-entry/date-range-picker.d.ts +2 -2
  47. package/dist/components/data-entry/date-range-picker.js +6 -6
  48. package/dist/components/data-entry/index.d.ts +4 -4
  49. package/dist/components/data-entry/index.js +22 -22
  50. package/dist/components/data-entry/input.d.ts +12 -2
  51. package/dist/components/data-entry/input.js +3 -1
  52. package/dist/components/data-entry/radio.d.ts +1 -1
  53. package/dist/components/data-entry/select.d.ts +1 -1
  54. package/dist/components/data-entry/select.js +5 -5
  55. package/dist/components/data-entry/slider.d.ts +1 -1
  56. package/dist/components/data-entry/switch.d.ts +1 -1
  57. package/dist/components/data-entry/textarea.d.ts +12 -2
  58. package/dist/components/data-entry/textarea.js +3 -1
  59. package/dist/components/data-entry/time-input.js +2 -2
  60. package/dist/components/data-entry/time-picker.d.ts +2 -2
  61. package/dist/components/data-entry/time-picker.js +5 -5
  62. package/dist/components/data-entry/transfer.d.ts +2 -2
  63. package/dist/components/data-entry/transfer.js +6 -6
  64. package/dist/components/data-entry/tree-select.d.ts +1 -1
  65. package/dist/components/data-entry/tree-select.js +4 -4
  66. package/dist/components/data-entry/upload.d.ts +2 -2
  67. package/dist/components/data-entry/upload.js +7 -7
  68. package/dist/components/data-grid/index.js +6 -6
  69. package/dist/components/feedback/alert.js +5 -5
  70. package/dist/components/feedback/dialog.js +5 -5
  71. package/dist/components/feedback/index.js +9 -9
  72. package/dist/components/general/button.d.ts +4 -1
  73. package/dist/components/general/button.js +3 -1
  74. package/dist/components/general/index.d.ts +1 -1
  75. package/dist/components/general/index.js +3 -1
  76. package/dist/components/layout/index.js +4 -4
  77. package/dist/components/navigation/index.js +8 -8
  78. package/dist/components/navigation/pagination.js +6 -6
  79. package/dist/components/navigation/steps.js +3 -3
  80. package/dist/components/query/index.d.ts +2 -2
  81. package/dist/components/query/index.js +5 -5
  82. package/dist/components/ui/index.d.ts +3 -3
  83. package/dist/components/ui/index.js +29 -29
  84. package/dist/{data-entry.prop-D92hPBuo.d.ts → data-entry.prop-CyiZuEI8.d.ts} +39 -2
  85. package/dist/{general.prop-CBQ_KVtR.d.ts → general.prop-CzlQin6v.d.ts} +18 -0
  86. package/dist/i18n/index.d.ts +1 -0
  87. package/dist/i18n/index.js +2 -2
  88. package/dist/index.d.ts +2 -2
  89. package/dist/index.js +40 -40
  90. package/dist/lib/datetime/index.js +1 -1
  91. package/dist/props/components/index.d.ts +3 -3
  92. package/dist/props/index.d.ts +3 -3
  93. package/dist/props/index.js +1 -1
  94. package/dist/{query.prop-CsRuaXNb.d.ts → query.prop-CT2gFtr4.d.ts} +1 -1
  95. package/dist/{search-input-D29GSk0W.d.ts → search-input--ui38eQV.d.ts} +1 -1
  96. package/dist/styles/control.css +24 -1
  97. package/package.json +3 -2
  98. package/dist/chunk-BNXPDUO4.js +0 -28
  99. package/dist/chunk-HCCID4YY.js +0 -11
@@ -1,14 +1,14 @@
1
1
  import { Command, CommandList, CommandItem, CommandGroup } from './chunk-3R3QVJCB.js';
2
- import { Input } from './chunk-BNXPDUO4.js';
3
- import { Button } from './chunk-CA247VOA.js';
2
+ import { Input } from './chunk-6AIYMYSG.js';
4
3
  import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
4
+ import { Button } from './chunk-5L77S5CL.js';
5
5
  import { controlTriggerClass, controlOpenRingClass } from './chunk-B4K4BXEF.js';
6
- import { useTranslation } from './chunk-6EBULOWM.js';
6
+ import { useTranslation } from './chunk-QTEPKNQE.js';
7
7
  import { cn } from './chunk-U7N2A7A3.js';
8
8
  import * as React from 'react';
9
9
  import * as SelectPrimitive from '@radix-ui/react-select';
10
- import { ChevronDown, ChevronUp, ChevronsUpDown, Loader2 } from 'lucide-react';
11
- import { jsxs, jsx } from 'react/jsx-runtime';
10
+ import { ChevronDown, ChevronUp, Loader2, X, ChevronsUpDown } from 'lucide-react';
11
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
12
12
 
13
13
  var DEBOUNCE_MS = 250;
14
14
  function SearchSelect({
@@ -18,7 +18,9 @@ function SearchSelect({
18
18
  options: staticOptions,
19
19
  loadOptions,
20
20
  renderOption,
21
+ labelRender,
21
22
  selectedLabel,
23
+ selectedIcon,
22
24
  placeholder,
23
25
  searchPlaceholder,
24
26
  emptyMessage,
@@ -110,6 +112,7 @@ function SearchSelect({
110
112
  const resolvedPlaceholder = placeholder ?? t("dataEntry.searchSelect.placeholder");
111
113
  const selectedOption = value ? [picked, ...staticOptions ?? [], ...loaded].find((option) => option?.value === value) ?? null : null;
112
114
  const currentLabel = value ? selectedOption?.label ?? selectedLabel ?? value : resolvedPlaceholder;
115
+ const currentIcon = value ? selectedOption?.icon ?? selectedIcon : null;
113
116
  const select = (option) => {
114
117
  if (option.disabled) return;
115
118
  setPicked(option);
@@ -147,105 +150,138 @@ function SearchSelect({
147
150
  const optionTestId = (optionValue) => dataTestId ? `${dataTestId}-option-${optionValue}` : void 0;
148
151
  const activeOption = flatOrdered[activeIndex];
149
152
  const activeOptionId = activeOption ? optionDomId(activeOption.value) : void 0;
150
- return /* @__PURE__ */ jsxs(
151
- Popover,
152
- {
153
- open,
154
- onOpenChange: (next) => {
155
- setOpen(next);
156
- if (!next) setQuery("");
157
- },
158
- children: [
159
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
160
- Button,
161
- {
162
- id,
163
- type: "button",
164
- variant: "outline",
165
- role: "combobox",
166
- "aria-expanded": open,
167
- disabled,
168
- "data-testid": dataTestId,
169
- className: cn("w-full justify-between font-normal", controlOpenRingClass, className),
170
- children: [
171
- /* @__PURE__ */ jsx("span", { className: cn("truncate text-start", !value && "text-muted-foreground"), children: currentLabel }),
172
- /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ms-2 size-4 shrink-0 opacity-50", "aria-hidden": "true" })
173
- ]
174
- }
175
- ) }),
176
- name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value }) : null,
177
- /* @__PURE__ */ jsx(
178
- PopoverContent,
179
- {
180
- align: "start",
181
- sideOffset: 4,
182
- collisionPadding: 12,
183
- 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",
184
- children: /* @__PURE__ */ jsxs(Command, { shouldFilter: false, className: "flex min-h-0 flex-col", children: [
185
- /* @__PURE__ */ jsx("div", { className: "border-border shrink-0 border-b p-2", children: /* @__PURE__ */ jsx(
186
- Input,
187
- {
188
- autoFocus: true,
189
- "aria-controls": listId,
190
- "aria-autocomplete": "list",
191
- "aria-activedescendant": activeOptionId,
192
- value: query,
193
- onChange: (event) => setQuery(event.target.value),
194
- onKeyDown,
195
- placeholder: searchPlaceholder ?? t("dataEntry.searchSelect.search")
196
- }
197
- ) }),
198
- /* @__PURE__ */ jsxs(
199
- CommandList,
153
+ const showClear = clearable && Boolean(value) && !disabled;
154
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
155
+ /* @__PURE__ */ jsxs(
156
+ Popover,
157
+ {
158
+ open,
159
+ onOpenChange: (next) => {
160
+ setOpen(next);
161
+ if (!next) setQuery("");
162
+ },
163
+ children: [
164
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
165
+ Button,
166
+ {
167
+ id,
168
+ type: "button",
169
+ variant: "outline",
170
+ role: "combobox",
171
+ "aria-expanded": open,
172
+ disabled,
173
+ "data-testid": dataTestId,
174
+ className: cn(
175
+ "w-full justify-start font-normal",
176
+ controlOpenRingClass,
177
+ // Reserve trailing room for the clear + chevron overlay rendered below.
178
+ showClear ? "pe-14" : "pe-9"
179
+ ),
180
+ children: /* @__PURE__ */ jsx(
181
+ "span",
200
182
  {
201
- id: listId,
202
- role: "listbox",
203
- className: "min-h-0 flex-1 overflow-y-auto p-1",
204
- onScroll,
205
- children: [
206
- 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,
207
- grouped.map((group) => {
208
- const rows = group.items.map(({ option, index }) => /* @__PURE__ */ jsx(
209
- CommandItem,
210
- {
211
- id: optionDomId(option.value),
212
- role: "option",
213
- value: option.value,
214
- "data-testid": optionTestId(option.value),
215
- "aria-selected": activeIndex === index,
216
- disabled: option.disabled,
217
- className: cn(
218
- // Selected = persistent bg-accent + medium weight (NO check icon — saves width),
219
- // matching the plain SelectItem's `data-[state=checked]` convention; active =
220
- // hover/keyboard accent. Same bg so selection stays coherent across both Selects.
221
- value === option.value && "bg-accent text-foreground font-medium",
222
- activeIndex === index && "bg-accent text-accent-foreground"
223
- ),
224
- onMouseEnter: () => setActiveIndex(index),
225
- onSelect: () => select(option),
226
- children: 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: [
227
- /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: option.label }),
228
- option.sublabel ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground truncate text-xs", children: option.sublabel }) : null
229
- ] })
230
- },
231
- option.value
232
- ));
233
- return group.heading ? /* @__PURE__ */ jsx(CommandGroup, { heading: group.heading, children: rows }, group.heading) : /* @__PURE__ */ jsx(React.Fragment, { children: rows }, "__ungrouped");
234
- }),
235
- loading ? /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-center gap-2 px-2 py-3 text-sm", children: [
236
- /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }),
237
- loadingMessage ?? t("dataEntry.searchSelect.loading")
238
- ] }) : null,
239
- !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
240
- ]
183
+ className: cn(
184
+ "flex min-w-0 items-center gap-2 text-start",
185
+ !value && "text-muted-foreground"
186
+ ),
187
+ children: value && labelRender ? labelRender({ value, label: currentLabel, option: selectedOption ?? void 0 }) : /* @__PURE__ */ jsxs(Fragment, { children: [
188
+ currentIcon ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", "aria-hidden": "true", children: currentIcon }) : null,
189
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: currentLabel })
190
+ ] })
241
191
  }
242
192
  )
243
- ] })
244
- }
245
- )
246
- ]
247
- }
248
- );
193
+ }
194
+ ) }),
195
+ name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value }) : null,
196
+ /* @__PURE__ */ jsx(
197
+ PopoverContent,
198
+ {
199
+ align: "start",
200
+ sideOffset: 4,
201
+ collisionPadding: 12,
202
+ 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",
203
+ children: /* @__PURE__ */ jsxs(Command, { shouldFilter: false, className: "flex min-h-0 flex-col", children: [
204
+ /* @__PURE__ */ jsx("div", { className: "border-border shrink-0 border-b p-2", children: /* @__PURE__ */ jsx(
205
+ Input,
206
+ {
207
+ autoFocus: true,
208
+ "aria-controls": listId,
209
+ "aria-autocomplete": "list",
210
+ "aria-activedescendant": activeOptionId,
211
+ value: query,
212
+ onChange: (event) => setQuery(event.target.value),
213
+ onKeyDown,
214
+ placeholder: searchPlaceholder ?? t("dataEntry.searchSelect.search")
215
+ }
216
+ ) }),
217
+ /* @__PURE__ */ jsxs(
218
+ CommandList,
219
+ {
220
+ id: listId,
221
+ role: "listbox",
222
+ className: "min-h-0 flex-1 overflow-y-auto p-1",
223
+ onScroll,
224
+ children: [
225
+ grouped.map((group) => {
226
+ const rows = group.items.map(({ option, index }) => /* @__PURE__ */ jsx(
227
+ CommandItem,
228
+ {
229
+ id: optionDomId(option.value),
230
+ role: "option",
231
+ value: option.value,
232
+ "data-testid": optionTestId(option.value),
233
+ "aria-selected": activeIndex === index,
234
+ disabled: option.disabled,
235
+ className: cn(
236
+ // Selected = persistent bg-accent + medium weight (NO check icon — saves width),
237
+ // matching the plain SelectItem's `data-[state=checked]` convention; active =
238
+ // hover/keyboard accent. Same bg so selection stays coherent across both Selects.
239
+ value === option.value && "bg-accent text-foreground font-medium",
240
+ activeIndex === index && "bg-accent text-accent-foreground"
241
+ ),
242
+ onMouseEnter: () => setActiveIndex(index),
243
+ onSelect: () => select(option),
244
+ children: renderOption ? /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: renderOption(option) }) : /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
245
+ option.icon ? /* @__PURE__ */ jsx("span", { className: "flex shrink-0 items-center", "aria-hidden": "true", children: option.icon }) : null,
246
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
247
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm", children: option.label }),
248
+ option.sublabel ? /* @__PURE__ */ jsx("span", { className: "text-muted-foreground truncate text-xs", children: option.sublabel }) : null
249
+ ] })
250
+ ] })
251
+ },
252
+ option.value
253
+ ));
254
+ return group.heading ? /* @__PURE__ */ jsx(CommandGroup, { heading: group.heading, children: rows }, group.heading) : /* @__PURE__ */ jsx(React.Fragment, { children: rows }, "__ungrouped");
255
+ }),
256
+ loading ? /* @__PURE__ */ jsxs("div", { className: "text-muted-foreground flex items-center gap-2 px-2 py-3 text-sm", children: [
257
+ /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" }),
258
+ loadingMessage ?? t("dataEntry.searchSelect.loading")
259
+ ] }) : null,
260
+ !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
261
+ ]
262
+ }
263
+ )
264
+ ] })
265
+ }
266
+ )
267
+ ]
268
+ }
269
+ ),
270
+ /* @__PURE__ */ jsxs("div", { className: "pointer-events-none absolute inset-y-0 end-3 flex items-center gap-1", children: [
271
+ showClear ? /* @__PURE__ */ jsx(
272
+ "button",
273
+ {
274
+ type: "button",
275
+ "aria-label": clearLabel ?? t("dataEntry.searchSelect.clear"),
276
+ "data-testid": optionTestId("clear"),
277
+ className: "pointer-events-auto flex size-4 items-center justify-center rounded-sm opacity-50 hover:opacity-100 focus-visible:opacity-100",
278
+ onClick: clear,
279
+ children: /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" })
280
+ }
281
+ ) : null,
282
+ /* @__PURE__ */ jsx(ChevronsUpDown, { className: "size-4 shrink-0 opacity-50", "aria-hidden": "true" })
283
+ ] })
284
+ ] });
249
285
  }
250
286
  function isDataSelect(props) {
251
287
  return "options" in props || "loadOptions" in props;
@@ -388,7 +424,9 @@ function DataSelect({
388
424
  defaultValue,
389
425
  onValueChange,
390
426
  renderOption,
427
+ labelRender,
391
428
  selectedLabel,
429
+ selectedIcon,
392
430
  placeholder,
393
431
  searchPlaceholder,
394
432
  emptyMessage,
@@ -412,7 +450,9 @@ function DataSelect({
412
450
  options,
413
451
  loadOptions,
414
452
  renderOption,
453
+ labelRender,
415
454
  selectedLabel,
455
+ selectedIcon,
416
456
  placeholder,
417
457
  searchPlaceholder,
418
458
  emptyMessage,
@@ -1,9 +1,9 @@
1
- import { Tooltip, TooltipTrigger, TooltipContent } from './chunk-32WO3YLB.js';
2
1
  import { DropdownMenu, DropdownMenuTrigger } from './chunk-LMKUKCTN.js';
2
+ import { Tooltip, TooltipTrigger, TooltipContent } from './chunk-32WO3YLB.js';
3
3
  import { Collapsible, CollapsibleTrigger, CollapsibleContent } from './chunk-DV52WNXO.js';
4
4
  import { densityClass, pageContainerVariantClass } from './chunk-INIIF7F7.js';
5
5
  import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
6
- import { useTranslation } from './chunk-6EBULOWM.js';
6
+ import { useTranslation } from './chunk-QTEPKNQE.js';
7
7
  import { cn } from './chunk-U7N2A7A3.js';
8
8
  import { ChevronRight, ChevronDown, PanelLeftOpen, PanelLeftClose, Search, Bell, SlidersHorizontal } from 'lucide-react';
9
9
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -1,11 +1,11 @@
1
1
  import { normalizeTreeOptions, collectAllExpandableKeys, filterVisibleTree, flattenVisibleTree, findNodeByValue, reactNodeText, getDescendantValues } from './chunk-SMLKNECP.js';
2
2
  import { Command, CommandInput } from './chunk-3R3QVJCB.js';
3
3
  import { Checkbox } from './chunk-BE6GJGKJ.js';
4
- import { Button } from './chunk-CA247VOA.js';
5
4
  import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
6
5
  import { ScrollArea } from './chunk-3KPEZ5CF.js';
6
+ import { Button } from './chunk-5L77S5CL.js';
7
7
  import { controlOpenRingClass } from './chunk-B4K4BXEF.js';
8
- import { useTranslation } from './chunk-6EBULOWM.js';
8
+ import { useTranslation } from './chunk-QTEPKNQE.js';
9
9
  import { cn } from './chunk-U7N2A7A3.js';
10
10
  import * as React from 'react';
11
11
  import { X, ChevronsUpDown, ChevronDown, ChevronRight } from 'lucide-react';
@@ -1,6 +1,6 @@
1
- import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-CLEBTIY3.js';
2
- import { Button } from './chunk-CA247VOA.js';
3
- import { useTranslation } from './chunk-6EBULOWM.js';
1
+ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-GOJQHYED.js';
2
+ import { Button } from './chunk-5L77S5CL.js';
3
+ import { useTranslation } from './chunk-QTEPKNQE.js';
4
4
  import { cn } from './chunk-U7N2A7A3.js';
5
5
  import * as React from 'react';
6
6
  import { MoreHorizontal, ChevronLeft, ChevronRight } from 'lucide-react';
@@ -1,6 +1,6 @@
1
- import { Input } from './chunk-BNXPDUO4.js';
1
+ import { Input } from './chunk-6AIYMYSG.js';
2
2
  import { controlIconClass } from './chunk-B4K4BXEF.js';
3
- import { useTranslation } from './chunk-6EBULOWM.js';
3
+ import { useTranslation } from './chunk-QTEPKNQE.js';
4
4
  import { cn } from './chunk-U7N2A7A3.js';
5
5
  import * as React from 'react';
6
6
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -1,5 +1,5 @@
1
1
  import { controlIconClass } from './chunk-B4K4BXEF.js';
2
- import { useTranslation } from './chunk-6EBULOWM.js';
2
+ import { useTranslation } from './chunk-QTEPKNQE.js';
3
3
  import { cn } from './chunk-U7N2A7A3.js';
4
4
  import { Check, Loader2, X, Circle } from 'lucide-react';
5
5
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1,4 +1,4 @@
1
- import { buttonVariants } from './chunk-CA247VOA.js';
1
+ import { buttonVariants } from './chunk-5L77S5CL.js';
2
2
  import { controlIconSmClass } from './chunk-B4K4BXEF.js';
3
3
  import { cn } from './chunk-U7N2A7A3.js';
4
4
  import { ChevronLeft, ChevronRight } from 'lucide-react';
@@ -1,8 +1,8 @@
1
1
  import { overlayHeaderToneClass } from './chunk-VU4GFGDG.js';
2
- import { Input } from './chunk-BNXPDUO4.js';
3
- import { buttonVariants, Button } from './chunk-CA247VOA.js';
2
+ import { Input } from './chunk-6AIYMYSG.js';
3
+ import { buttonVariants, Button } from './chunk-5L77S5CL.js';
4
4
  import { Label } from './chunk-7PWBC4BY.js';
5
- import { useTranslation } from './chunk-6EBULOWM.js';
5
+ import { useTranslation } from './chunk-QTEPKNQE.js';
6
6
  import { cn } from './chunk-U7N2A7A3.js';
7
7
  import * as React from 'react';
8
8
  import * as DialogPrimitive from '@radix-ui/react-dialog';
@@ -1,12 +1,12 @@
1
- import { Calendar } from './chunk-2XH6QAOC.js';
2
- import { Input } from './chunk-BNXPDUO4.js';
3
- import { Button } from './chunk-CA247VOA.js';
1
+ import { Input } from './chunk-6AIYMYSG.js';
4
2
  import { Popover, PopoverAnchor, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
5
- import { useTranslation, usePickerLocales } from './chunk-6EBULOWM.js';
6
- import { toIsoDate, parseDateInput } from './chunk-ITOHGSPS.js';
3
+ import { Calendar } from './chunk-MUUO7SPN.js';
4
+ import { Button } from './chunk-5L77S5CL.js';
5
+ import { useTranslation, usePickerLocales } from './chunk-QTEPKNQE.js';
6
+ import { toIsoDate, parseDateInput } from './chunk-C7W5BO7R.js';
7
7
  import { cn } from './chunk-U7N2A7A3.js';
8
8
  import * as React from 'react';
9
- import { CalendarIcon } from 'lucide-react';
9
+ import { X, CalendarIcon } from 'lucide-react';
10
10
  import { jsx, jsxs } from 'react/jsx-runtime';
11
11
 
12
12
  var ISO_HINT = "yyyy-mm-dd";
@@ -21,7 +21,8 @@ function DatePicker({
21
21
  name,
22
22
  locale: localeProp,
23
23
  fromDate,
24
- toDate
24
+ toDate,
25
+ allowClear = true
25
26
  }) {
26
27
  const { t } = useTranslation();
27
28
  const { dayPickerLocale } = usePickerLocales(localeProp);
@@ -38,6 +39,11 @@ function DatePicker({
38
39
  setText(toIsoDate(value));
39
40
  }, [value]);
40
41
  const resolvedPlaceholder = placeholder ?? t("dataEntry.datePicker.placeholder") ?? ISO_HINT;
42
+ const showClear = allowClear && Boolean(value) && !disabled;
43
+ const clear = () => {
44
+ emit(void 0);
45
+ setText("");
46
+ };
41
47
  const commit = (raw) => {
42
48
  const trimmed = raw.trim();
43
49
  if (trimmed === "") {
@@ -64,7 +70,7 @@ function DatePicker({
64
70
  role: "combobox",
65
71
  "aria-expanded": open,
66
72
  "aria-haspopup": "dialog",
67
- className: "pe-10",
73
+ className: cn("pe-10", showClear && "pe-16"),
68
74
  onClick: () => {
69
75
  if (!disabled) setOpen(true);
70
76
  },
@@ -86,6 +92,20 @@ function DatePicker({
86
92
  }
87
93
  }
88
94
  ),
95
+ showClear ? /* @__PURE__ */ jsx(
96
+ Button,
97
+ {
98
+ type: "button",
99
+ variant: "ghost",
100
+ size: "icon",
101
+ disabled,
102
+ tabIndex: -1,
103
+ "aria-label": t("common.clear") ?? "Clear",
104
+ className: "text-muted-foreground absolute inset-y-0 end-8 h-full px-2 hover:bg-transparent",
105
+ onClick: clear,
106
+ children: /* @__PURE__ */ jsx(X, { className: "size-4 shrink-0", "aria-hidden": "true" })
107
+ }
108
+ ) : null,
89
109
  /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
90
110
  Button,
91
111
  {
@@ -1,9 +1,9 @@
1
- import { SearchInput } from './chunk-E2CTBKYL.js';
1
+ import { SearchInput } from './chunk-RBXVCWXL.js';
2
2
  import { reactNodeText } from './chunk-SMLKNECP.js';
3
3
  import { Checkbox } from './chunk-BE6GJGKJ.js';
4
- import { Button } from './chunk-CA247VOA.js';
5
4
  import { ScrollArea } from './chunk-3KPEZ5CF.js';
6
- import { useTranslation } from './chunk-6EBULOWM.js';
5
+ import { Button } from './chunk-5L77S5CL.js';
6
+ import { useTranslation } from './chunk-QTEPKNQE.js';
7
7
  import { cn } from './chunk-U7N2A7A3.js';
8
8
  import * as React from 'react';
9
9
  import { ChevronRight, ChevronLeft } from 'lucide-react';
@@ -1,4 +1,4 @@
1
- import { APP_TIME_FORMATS, isAppDateFormat, isAppTimeFormat, isAppLocale, translate, getDateFnsLocale, syncI18nLocale, syncDatetimeContext, disableLiveRelativeFormatting, enableLiveRelativeFormatting, getDayPickerLocale, APP_REQUEST_HEADER_DATE_FORMAT, APP_REQUEST_HEADER_TIME_FORMAT, resolveDefaultDateFormat } from './chunk-ITOHGSPS.js';
1
+ import { APP_TIME_FORMATS, isAppDateFormat, isAppTimeFormat, isAppLocale, translate, getDateFnsLocale, syncI18nLocale, syncDatetimeContext, disableLiveRelativeFormatting, enableLiveRelativeFormatting, getDayPickerLocale, APP_REQUEST_HEADER_DATE_FORMAT, APP_REQUEST_HEADER_TIME_FORMAT, resolveDefaultDateFormat } from './chunk-C7W5BO7R.js';
2
2
  import * as React from 'react';
3
3
  import { useMemo } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -1,6 +1,6 @@
1
- import { Input } from './chunk-BNXPDUO4.js';
1
+ import { Input } from './chunk-6AIYMYSG.js';
2
2
  import { Label } from './chunk-7PWBC4BY.js';
3
- import { useTranslation } from './chunk-6EBULOWM.js';
3
+ import { useTranslation } from './chunk-QTEPKNQE.js';
4
4
  import { useDebouncedValue } from './chunk-LFW37FGG.js';
5
5
  import { cn } from './chunk-U7N2A7A3.js';
6
6
  import * as React from 'react';
@@ -1,9 +1,9 @@
1
- import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from './chunk-WW47N4ID.js';
2
- import { formatBytes } from './chunk-HOQSAUHZ.js';
1
+ import { formatBytes } from './chunk-2FJ5TMQU.js';
2
+ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogFooter } from './chunk-O3F3KF2B.js';
3
3
  import { Slider } from './chunk-TBJBVEIP.js';
4
- import { Button } from './chunk-CA247VOA.js';
4
+ import { Button } from './chunk-5L77S5CL.js';
5
5
  import { controlIconClass } from './chunk-B4K4BXEF.js';
6
- import { useTranslation } from './chunk-6EBULOWM.js';
6
+ import { useTranslation } from './chunk-QTEPKNQE.js';
7
7
  import { cn } from './chunk-U7N2A7A3.js';
8
8
  import * as React2 from 'react';
9
9
  import { Upload as Upload$1, ImagePlus, Camera, Trash2, RotateCcw, X } from 'lucide-react';
@@ -1,7 +1,7 @@
1
- import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-CLEBTIY3.js';
2
- import { Button } from './chunk-CA247VOA.js';
3
- import { useOptionalAppContext, useTranslation, APP_TIME_FORMAT_OPTIONS, getTimeFormatLabel, resolveTimezonePickerOptions, getTimezoneLabel, APP_LOCALES } from './chunk-6EBULOWM.js';
4
- import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from './chunk-ITOHGSPS.js';
1
+ import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-GOJQHYED.js';
2
+ import { Button } from './chunk-5L77S5CL.js';
3
+ import { useOptionalAppContext, useTranslation, APP_TIME_FORMAT_OPTIONS, getTimeFormatLabel, resolveTimezonePickerOptions, getTimezoneLabel, APP_LOCALES } from './chunk-QTEPKNQE.js';
4
+ import { APP_DATE_FORMAT_OPTIONS, getDateFormatLabel } from './chunk-C7W5BO7R.js';
5
5
  import { cn } from './chunk-U7N2A7A3.js';
6
6
  import * as React from 'react';
7
7
  import { useId } from 'react';
@@ -1,10 +1,10 @@
1
1
  import { EmptyState } from './chunk-YD7V2HGZ.js';
2
2
  import { Flex, densityClass } from './chunk-INIIF7F7.js';
3
3
  import { Checkbox } from './chunk-BE6GJGKJ.js';
4
- import { Button } from './chunk-CA247VOA.js';
5
4
  import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from './chunk-IJ5ALJGA.js';
5
+ import { Button } from './chunk-5L77S5CL.js';
6
6
  import { tableCellPaddingClass, tableRowHeightClass, controlIconSmClass } from './chunk-B4K4BXEF.js';
7
- import { useTranslation } from './chunk-6EBULOWM.js';
7
+ import { useTranslation } from './chunk-QTEPKNQE.js';
8
8
  import { cn } from './chunk-U7N2A7A3.js';
9
9
  import { jsx, jsxs } from 'react/jsx-runtime';
10
10
  import * as React from 'react';
@@ -0,0 +1,86 @@
1
+ import { controlMultilineClass } from './chunk-B4K4BXEF.js';
2
+ import { useTranslation } from './chunk-QTEPKNQE.js';
3
+ import { cn } from './chunk-U7N2A7A3.js';
4
+ import * as React from 'react';
5
+ import { X } from 'lucide-react';
6
+ import { jsx, jsxs } from 'react/jsx-runtime';
7
+
8
+ var Textarea = React.forwardRef(
9
+ ({ className, allowClear = false, onClear, value, defaultValue, onChange, ...props }, ref) => {
10
+ const { t } = useTranslation();
11
+ const innerRef = React.useRef(null);
12
+ const setRefs = React.useCallback(
13
+ (node) => {
14
+ innerRef.current = node;
15
+ if (typeof ref === "function") ref(node);
16
+ else if (ref) ref.current = node;
17
+ },
18
+ [ref]
19
+ );
20
+ const [hasText, setHasText] = React.useState(
21
+ () => String(value ?? defaultValue ?? "").length > 0
22
+ );
23
+ React.useEffect(() => {
24
+ if (value !== void 0) setHasText(String(value).length > 0);
25
+ }, [value]);
26
+ const handleChange = (event) => {
27
+ if (value === void 0) setHasText(event.target.value.length > 0);
28
+ onChange?.(event);
29
+ };
30
+ const clear = () => {
31
+ const el = innerRef.current;
32
+ if (el) {
33
+ const setter = Object.getOwnPropertyDescriptor(
34
+ window.HTMLTextAreaElement.prototype,
35
+ "value"
36
+ )?.set;
37
+ setter?.call(el, "");
38
+ el.dispatchEvent(new Event("input", { bubbles: true }));
39
+ el.focus();
40
+ }
41
+ setHasText(false);
42
+ onClear?.();
43
+ };
44
+ if (!allowClear) {
45
+ return /* @__PURE__ */ jsx(
46
+ "textarea",
47
+ {
48
+ ref: setRefs,
49
+ value,
50
+ defaultValue,
51
+ onChange,
52
+ className: cn(controlMultilineClass, className),
53
+ ...props
54
+ }
55
+ );
56
+ }
57
+ const showClear = hasText && !props.disabled && !props.readOnly;
58
+ return /* @__PURE__ */ jsxs("span", { "data-slot": "textarea-affix-wrapper", className: "relative block w-full", children: [
59
+ /* @__PURE__ */ jsx(
60
+ "textarea",
61
+ {
62
+ ref: setRefs,
63
+ value,
64
+ defaultValue,
65
+ onChange: handleChange,
66
+ className: cn(controlMultilineClass, showClear && "pe-9", className),
67
+ ...props
68
+ }
69
+ ),
70
+ showClear ? /* @__PURE__ */ jsx(
71
+ "button",
72
+ {
73
+ type: "button",
74
+ tabIndex: -1,
75
+ "aria-label": t("common.clear") ?? "Clear",
76
+ onClick: clear,
77
+ className: "text-muted-foreground hover:text-foreground absolute end-2 top-2 inline-flex size-5 items-center justify-center rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:opacity-100",
78
+ children: /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" })
79
+ }
80
+ ) : null
81
+ ] });
82
+ }
83
+ );
84
+ Textarea.displayName = "Textarea";
85
+
86
+ export { Textarea };
@@ -1,5 +1,5 @@
1
1
  import { toneNeutralClass, toneMutedClass, toneInfoClass, toneDestructiveClass, toneWarningClass, toneSuccessClass } from './chunk-B4K4BXEF.js';
2
- import { useTranslation } from './chunk-6EBULOWM.js';
2
+ import { useTranslation } from './chunk-QTEPKNQE.js';
3
3
  import { cn } from './chunk-U7N2A7A3.js';
4
4
  import { cva } from 'class-variance-authority';
5
5
  import { XCircle, Pause, CheckCircle2, Circle, Trash2, AlertCircle, Clock, Play } from 'lucide-react';
@@ -3,7 +3,7 @@ export { c as FlexProp, P as PageContainerProp, P as PageContainerProps } from '
3
3
  export { F as Flex, P as PageContainer } from '../../flex-X2EFU1d5.js';
4
4
  export { C as ColumnDef, D as DataTable, a as Density, b as Descriptions, E as EmptyState } from '../../data-table-DRr70ULe.js';
5
5
  export { Badge } from '../data-display/badge.js';
6
- export { F as Field, a as FormField, S as SearchInput } from '../../search-input-D29GSk0W.js';
6
+ export { F as Field, a as FormField, S as SearchInput } from '../../search-input--ui38eQV.js';
7
7
  export { a as SkeletonDetail, c as SkeletonRows, d as SkeletonStat, e as SkeletonTable } from '../../skeleton-cj9kh5wo.js';
8
8
  export { Alert, AlertActions, AlertContent, AlertDescription, AlertQueryError, AlertTitle } from '../feedback/alert.js';
9
9
  export { Upload, useUploadDraft } from '../data-entry/upload.js';
@@ -18,7 +18,7 @@ export { AlertDialog, Dialog, DialogContent, DialogDescription, DialogFooter, Di
18
18
  export { Toaster } from '../feedback/sonner.js';
19
19
  export { toast } from 'sonner';
20
20
  export { useDebouncedValue, useTimeoutFlag } from '../../lib/hooks.js';
21
- export { B as collectUploadCommitActions, E as createUploadItem } from '../../data-entry.prop-D92hPBuo.js';
21
+ export { B as collectUploadCommitActions, E as createUploadItem } from '../../data-entry.prop-CyiZuEI8.js';
22
22
  export { j as formatDate } from '../../format-date-ByyZoqI5.js';
23
23
  import '../../shared.prop-BvMSLFJ6.js';
24
24
  import 'react';