@godxjp/ui 13.5.1 → 13.6.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 (98) hide show
  1. package/dist/app/index.js +4 -4
  2. package/dist/{checkbox-iicX1PfF.d.ts → checkbox-DAIwpMHO.d.ts} +1 -1
  3. package/dist/{chunk-HOQSAUHZ.js → chunk-2FJ5TMQU.js} +1 -1
  4. package/dist/{chunk-LCKET5WL.js → chunk-2JW2QLUU.js} +3 -3
  5. package/dist/{chunk-LIOHE3RU.js → chunk-3JQDPNTA.js} +1 -1
  6. package/dist/{chunk-BIC6D4EL.js → chunk-5XFFEW2P.js} +2 -2
  7. package/dist/chunk-6AIYMYSG.js +98 -0
  8. package/dist/{chunk-IHNZCBES.js → chunk-6MZMMMHV.js} +28 -8
  9. package/dist/{chunk-RR2SSSQS.js → chunk-6VUW6EKH.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-QVLCFPKF.js → chunk-DVV6UYVS.js} +3 -3
  13. package/dist/{chunk-IYSGELQC.js → chunk-GFDKJY63.js} +3 -3
  14. package/dist/{chunk-2XH6QAOC.js → chunk-HS73G2C3.js} +1 -1
  15. package/dist/{chunk-4GHHVXUR.js → chunk-I472SSN2.js} +2 -2
  16. package/dist/{chunk-XBFXYKJS.js → chunk-J254ZX3A.js} +4 -4
  17. package/dist/{chunk-JCDLEXBB.js → chunk-KNI7QI4J.js} +2 -2
  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-PXOPMYPJ.js → chunk-OIAT773P.js} +28 -7
  21. package/dist/{chunk-CLEBTIY3.js → chunk-PKSHDFKP.js} +121 -103
  22. package/dist/{chunk-6EBULOWM.js → chunk-QTEPKNQE.js} +1 -1
  23. package/dist/{chunk-E2CTBKYL.js → chunk-RBXVCWXL.js} +2 -2
  24. package/dist/{chunk-WW47N4ID.js → chunk-UDMFKYZG.js} +3 -3
  25. package/dist/{chunk-QEHMSZBQ.js → chunk-UKTVFPRV.js} +27 -7
  26. package/dist/{chunk-YY5PUFBL.js → chunk-UVGI2RPC.js} +4 -4
  27. package/dist/{chunk-QHS4U3SS.js → chunk-W2RYT6NT.js} +3 -3
  28. package/dist/{chunk-CA247VOA.js → chunk-XZH3URGD.js} +28 -1
  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 +26 -26
  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 +7 -7
  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 +20 -20
  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 +8 -8
  72. package/dist/components/general/button.d.ts +2 -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 +10 -10
  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 +25 -25
  84. package/dist/{data-entry.prop-D92hPBuo.d.ts → data-entry.prop-vn5VGnwY.d.ts} +18 -2
  85. package/dist/{general.prop-CBQ_KVtR.d.ts → general.prop-CzcLDzMw.d.ts} +8 -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 +34 -34
  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/{query.prop-CsRuaXNb.d.ts → query.prop-DAILZ0x5.d.ts} +1 -1
  94. package/dist/{search-input-D29GSk0W.d.ts → search-input-Oxwpv_s9.d.ts} +1 -1
  95. package/dist/styles/control.css +24 -1
  96. package/package.json +1 -1
  97. package/dist/chunk-BNXPDUO4.js +0 -28
  98. package/dist/chunk-HCCID4YY.js +0 -11
package/dist/app/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { useAppContext } from '../chunk-6EBULOWM.js';
2
- export { APP_LOCALES, APP_REQUEST_HEADER_LOCALE, APP_REQUEST_HEADER_TIMEZONE, APP_TIMEZONE_PRESET, APP_TIME_FORMAT_OPTIONS, AppProvider, DEFAULT_STORAGE_KEY, TIMEZONE_ALIASES, formatTimezoneDisplayLabel, getAllIanaTimezones, getAppRequestHeaders, getBrowserTimezone, getTimeFormatLabel, getTimezoneCityName, getTimezoneLabel, getTimezoneOffsetLabel, isValidIanaTimezone, readStoredPreferences, resetAppRequestHeaders, resetIanaTimezoneCacheForTests, resolveDefaultTimeFormat, resolveDefaultTimezone, resolveTimezoneForIntl, resolveTimezonePickerOptions, syncAppRequestHeaders, useAppContext, useAppDateFormat, useAppLocale, useAppTimeFormat, useAppTimezone, useOptionalAppContext, usePickerLocales, useTranslation, writeStoredPreferences } from '../chunk-6EBULOWM.js';
3
- import { formatDate } from '../chunk-ITOHGSPS.js';
4
- export { APP_DATE_FORMATS, APP_DATE_FORMAT_OPTIONS, APP_LOCALE_CONFIG, APP_REQUEST_HEADER_DATE_FORMAT, APP_REQUEST_HEADER_TIME_FORMAT, APP_TIME_FORMATS, detectFormatDateKind, formatAppDate, formatAppDateLong, formatAppDateTime, formatAppRelative, formatAppTime, formatCalendarDate, formatDate, formatTimeOfDay, getDateFnsLocale, getDateFormatLabel, getDatePattern, getDateTimePattern, getDatetimeContext, getDayPickerLocale, getTimePattern, isAppDateFormat, isAppLocale, isAppTimeFormat, isFormatDateValue, isValidHhmm, normalizeHhmm, parseDateInput, resolveDefaultDateFormat, syncDatetimeContext } from '../chunk-ITOHGSPS.js';
1
+ import { useAppContext } from '../chunk-QTEPKNQE.js';
2
+ export { APP_LOCALES, APP_REQUEST_HEADER_LOCALE, APP_REQUEST_HEADER_TIMEZONE, APP_TIMEZONE_PRESET, APP_TIME_FORMAT_OPTIONS, AppProvider, DEFAULT_STORAGE_KEY, TIMEZONE_ALIASES, formatTimezoneDisplayLabel, getAllIanaTimezones, getAppRequestHeaders, getBrowserTimezone, getTimeFormatLabel, getTimezoneCityName, getTimezoneLabel, getTimezoneOffsetLabel, isValidIanaTimezone, readStoredPreferences, resetAppRequestHeaders, resetIanaTimezoneCacheForTests, resolveDefaultTimeFormat, resolveDefaultTimezone, resolveTimezoneForIntl, resolveTimezonePickerOptions, syncAppRequestHeaders, useAppContext, useAppDateFormat, useAppLocale, useAppTimeFormat, useAppTimezone, useOptionalAppContext, usePickerLocales, useTranslation, writeStoredPreferences } from '../chunk-QTEPKNQE.js';
3
+ import { formatDate } from '../chunk-C7W5BO7R.js';
4
+ export { APP_DATE_FORMATS, APP_DATE_FORMAT_OPTIONS, APP_LOCALE_CONFIG, APP_REQUEST_HEADER_DATE_FORMAT, APP_REQUEST_HEADER_TIME_FORMAT, APP_TIME_FORMATS, detectFormatDateKind, formatAppDate, formatAppDateLong, formatAppDateTime, formatAppRelative, formatAppTime, formatCalendarDate, formatDate, formatTimeOfDay, getDateFnsLocale, getDateFormatLabel, getDatePattern, getDateTimePattern, getDatetimeContext, getDayPickerLocale, getTimePattern, isAppDateFormat, isAppLocale, isAppTimeFormat, isFormatDateValue, isValidHhmm, normalizeHhmm, parseDateInput, resolveDefaultDateFormat, syncDatetimeContext } from '../chunk-C7W5BO7R.js';
5
5
  import { useMemo } from 'react';
6
6
 
7
7
  function useFormatting() {
@@ -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 { b as CheckboxGroupProp } from './data-entry.prop-D92hPBuo.js';
4
+ import { b as CheckboxGroupProp } from './data-entry.prop-vn5VGnwY.js';
5
5
 
6
6
  declare function CheckboxGroup({ value: controlledValue, defaultValue, onValueChange, options, orientation, disabled, name, className, children, }: CheckboxGroupProp): react_jsx_runtime.JSX.Element;
7
7
 
@@ -1,4 +1,4 @@
1
- import { getSyncedLocale, translateCurrent } from './chunk-ITOHGSPS.js';
1
+ import { getSyncedLocale, translateCurrent } from './chunk-C7W5BO7R.js';
2
2
 
3
3
  // src/lib/format.ts
4
4
  function formatBytes(n, locale = getSyncedLocale()) {
@@ -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-PKSHDFKP.js';
2
+ import { Button } from './chunk-XZH3URGD.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,4 +1,4 @@
1
- import { normalizeHhmm, isValidHhmm } from './chunk-ITOHGSPS.js';
1
+ import { normalizeHhmm, isValidHhmm } from './chunk-C7W5BO7R.js';
2
2
  import { cn } from './chunk-U7N2A7A3.js';
3
3
  import * as React from 'react';
4
4
  import { jsx } 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';
4
+ import { Button } from './chunk-XZH3URGD.js';
5
5
  import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
6
6
  import { ScrollArea } from './chunk-3KPEZ5CF.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';
@@ -0,0 +1,98 @@
1
+ import { useTranslation } from './chunk-QTEPKNQE.js';
2
+ import { cn } from './chunk-U7N2A7A3.js';
3
+ import * as React from 'react';
4
+ import { X } from 'lucide-react';
5
+ import { jsx, jsxs } from 'react/jsx-runtime';
6
+
7
+ var inputBaseClass = [
8
+ "ui-control border-input bg-background w-full min-w-0 rounded-md border px-3 py-1 text-sm shadow-xs transition-[color,box-shadow] outline-none",
9
+ "selection:bg-primary selection:text-primary-foreground",
10
+ "file:text-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium",
11
+ "placeholder:text-muted-foreground",
12
+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
13
+ "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
14
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20"
15
+ ];
16
+ var Input = React.forwardRef(
17
+ ({ className, type, allowClear = false, onClear, value, defaultValue, onChange, ...props }, ref) => {
18
+ const { t } = useTranslation();
19
+ const innerRef = React.useRef(null);
20
+ const setRefs = React.useCallback(
21
+ (node) => {
22
+ innerRef.current = node;
23
+ if (typeof ref === "function") ref(node);
24
+ else if (ref) ref.current = node;
25
+ },
26
+ [ref]
27
+ );
28
+ const [hasText, setHasText] = React.useState(
29
+ () => String(value ?? defaultValue ?? "").length > 0
30
+ );
31
+ React.useEffect(() => {
32
+ if (value !== void 0) setHasText(String(value).length > 0);
33
+ }, [value]);
34
+ const handleChange = (event) => {
35
+ if (value === void 0) setHasText(event.target.value.length > 0);
36
+ onChange?.(event);
37
+ };
38
+ const clear = () => {
39
+ const el = innerRef.current;
40
+ if (el) {
41
+ const setter = Object.getOwnPropertyDescriptor(
42
+ window.HTMLInputElement.prototype,
43
+ "value"
44
+ )?.set;
45
+ setter?.call(el, "");
46
+ el.dispatchEvent(new Event("input", { bubbles: true }));
47
+ el.focus();
48
+ }
49
+ setHasText(false);
50
+ onClear?.();
51
+ };
52
+ if (!allowClear) {
53
+ return /* @__PURE__ */ jsx(
54
+ "input",
55
+ {
56
+ type,
57
+ "data-slot": "input",
58
+ ref: setRefs,
59
+ value,
60
+ defaultValue,
61
+ onChange,
62
+ className: cn(inputBaseClass, className),
63
+ ...props
64
+ }
65
+ );
66
+ }
67
+ const showClear = hasText && !props.disabled && !props.readOnly;
68
+ return /* @__PURE__ */ jsxs("span", { "data-slot": "input-affix-wrapper", className: "relative inline-flex w-full items-center", children: [
69
+ /* @__PURE__ */ jsx(
70
+ "input",
71
+ {
72
+ type,
73
+ "data-slot": "input",
74
+ ref: setRefs,
75
+ value,
76
+ defaultValue,
77
+ onChange: handleChange,
78
+ className: cn(inputBaseClass, showClear && "pe-9", className),
79
+ ...props
80
+ }
81
+ ),
82
+ showClear ? /* @__PURE__ */ jsx(
83
+ "button",
84
+ {
85
+ type: "button",
86
+ tabIndex: -1,
87
+ "aria-label": t("common.clear") ?? "Clear",
88
+ onClick: clear,
89
+ className: "text-muted-foreground hover:text-foreground absolute end-2 inline-flex size-5 items-center justify-center rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:opacity-100",
90
+ children: /* @__PURE__ */ jsx(X, { className: "size-4", "aria-hidden": "true" })
91
+ }
92
+ ) : null
93
+ ] });
94
+ }
95
+ );
96
+ Input.displayName = "Input";
97
+
98
+ export { Input };
@@ -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 { Calendar } from './chunk-HS73G2C3.js';
2
+ import { Input } from './chunk-6AIYMYSG.js';
3
+ import { Button } from './chunk-XZH3URGD.js';
4
4
  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';
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,10 +1,10 @@
1
1
  import { normalizeTreeOptions, formatPathLabels, getNodeByPath, filterTreeOptions, pathsEqual, pathKey } from './chunk-SMLKNECP.js';
2
2
  import { Command, CommandInput } from './chunk-3R3QVJCB.js';
3
- import { Button } from './chunk-CA247VOA.js';
3
+ import { Button } from './chunk-XZH3URGD.js';
4
4
  import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
5
5
  import { ScrollArea, ScrollBar } from './chunk-3KPEZ5CF.js';
6
6
  import { controlOpenRingClass } 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 * as React from 'react';
10
10
  import { Check, X, ChevronsUpDown, ChevronRight, Minus } from 'lucide-react';
@@ -1,4 +1,4 @@
1
- import { useTranslation } from './chunk-6EBULOWM.js';
1
+ import { useTranslation } from './chunk-QTEPKNQE.js';
2
2
  import { cn } from './chunk-U7N2A7A3.js';
3
3
  import * as React from 'react';
4
4
  import useEmblaCarousel from 'embla-carousel-react';
@@ -62,6 +62,7 @@ var en_default = {
62
62
  search: "Search",
63
63
  clearSearch: "Clear search",
64
64
  clearFilters: "Clear filters",
65
+ clear: "Clear",
65
66
  first: "First",
66
67
  previous: "Previous",
67
68
  next: "Next",
@@ -333,6 +334,7 @@ var ja_default = {
333
334
  search: "\u691C\u7D22",
334
335
  clearSearch: "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
335
336
  clearFilters: "\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u30AF\u30EA\u30A2",
337
+ clear: "\u30AF\u30EA\u30A2",
336
338
  first: "\u6700\u521D",
337
339
  previous: "\u524D\u3078",
338
340
  next: "\u6B21\u3078",
@@ -604,6 +606,7 @@ var vi_default = {
604
606
  search: "T\xECm ki\u1EBFm",
605
607
  clearSearch: "X\xF3a t\xECm ki\u1EBFm",
606
608
  clearFilters: "X\xF3a b\u1ED9 l\u1ECDc",
609
+ clear: "X\xF3a",
607
610
  first: "\u0110\u1EA7u",
608
611
  previous: "Tr\u01B0\u1EDBc",
609
612
  next: "Ti\u1EBFp",
@@ -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';
4
+ import { Button } from './chunk-XZH3URGD.js';
5
5
  import { ScrollArea } from './chunk-3KPEZ5CF.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 { ChevronRight, ChevronLeft } from 'lucide-react';
@@ -1,6 +1,6 @@
1
- import { Input } from './chunk-BNXPDUO4.js';
2
- import { Button } from './chunk-CA247VOA.js';
3
- import { useTranslation } from './chunk-6EBULOWM.js';
1
+ import { Input } from './chunk-6AIYMYSG.js';
2
+ import { Button } from './chunk-XZH3URGD.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 { ChevronUp, ChevronDown, EyeOff, Eye, Minus, Star, X } from 'lucide-react';
@@ -1,4 +1,4 @@
1
- import { buttonVariants } from './chunk-CA247VOA.js';
1
+ import { buttonVariants } from './chunk-XZH3URGD.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,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,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-UDMFKYZG.js';
3
3
  import { Slider } from './chunk-TBJBVEIP.js';
4
- import { Button } from './chunk-CA247VOA.js';
4
+ import { Button } from './chunk-XZH3URGD.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,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';
4
+ import { Button } from './chunk-XZH3URGD.js';
5
5
  import { Table, TableHeader, TableRow, TableHead, TableBody, TableCell } from './chunk-IJ5ALJGA.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';
@@ -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,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 { Calendar } from './chunk-HS73G2C3.js';
2
+ import { Input } from './chunk-6AIYMYSG.js';
3
+ import { Button } from './chunk-XZH3URGD.js';
4
4
  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';
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 DateRangePicker({
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);
@@ -40,6 +41,12 @@ function DateRangePicker({
40
41
  if (!isControlled) setInternalValue(next);
41
42
  onValueChange?.(next);
42
43
  };
44
+ const showClear = allowClear && Boolean(value?.from || value?.to) && !disabled;
45
+ const clear = () => {
46
+ emit(void 0);
47
+ setFromText("");
48
+ setToText("");
49
+ };
43
50
  const commitEdge = (edge, raw) => {
44
51
  const trimmed = raw.trim();
45
52
  if (trimmed !== "" && !/^\d{4}-\d{2}-\d{2}$/.test(trimmed)) return;
@@ -114,6 +121,20 @@ function DateRangePicker({
114
121
  }
115
122
  }
116
123
  ),
124
+ showClear ? /* @__PURE__ */ jsx(
125
+ Button,
126
+ {
127
+ type: "button",
128
+ variant: "ghost",
129
+ size: "icon",
130
+ disabled,
131
+ tabIndex: -1,
132
+ "aria-label": t("common.clear") ?? "Clear",
133
+ className: "text-muted-foreground shrink-0 hover:bg-transparent",
134
+ onClick: clear,
135
+ children: /* @__PURE__ */ jsx(X, { className: "size-4 shrink-0", "aria-hidden": "true" })
136
+ }
137
+ ) : null,
117
138
  /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
118
139
  Button,
119
140
  {