@godxjp/ui 13.7.0 → 13.8.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 (101) hide show
  1. package/dist/app/index.js +4 -4
  2. package/dist/{checkbox-ChJ2PyIz.d.ts → checkbox-BpnDa6_M.d.ts} +1 -1
  3. package/dist/{chunk-KW54IV4X.js → chunk-2MRAHKOD.js} +3 -3
  4. package/dist/{chunk-QMGNMDQG.js → chunk-3VFNWVR7.js} +5 -5
  5. package/dist/{chunk-IRPZJKLU.js → chunk-4FGE5XVC.js} +10 -0
  6. package/dist/{chunk-SXECWZZV.js → chunk-4SSJ54R2.js} +4 -4
  7. package/dist/{chunk-C7W5BO7R.js → chunk-5732TWQF.js} +22 -1
  8. package/dist/chunk-57VDEN64.js +881 -0
  9. package/dist/{chunk-CSTUENE6.js → chunk-65RWSIZF.js} +4 -4
  10. package/dist/{chunk-JXGDDD46.js → chunk-A3J2G2ZA.js} +2 -2
  11. package/dist/{chunk-QTEPKNQE.js → chunk-B6S6LTWT.js} +1 -1
  12. package/dist/{chunk-GOJQHYED.js → chunk-BJTNKNMY.js} +9 -5
  13. package/dist/{chunk-6EKAEN6T.js → chunk-D4JX6O2W.js} +3 -3
  14. package/dist/{chunk-W3AS2GEC.js → chunk-FLY23H4G.js} +2 -2
  15. package/dist/{chunk-ZYJRZLMZ.js → chunk-HIEGUYPP.js} +1 -1
  16. package/dist/{chunk-TNFAUPEV.js → chunk-HRW7JDUJ.js} +4 -4
  17. package/dist/{chunk-O3F3KF2B.js → chunk-I5D4QYZI.js} +3 -3
  18. package/dist/{chunk-76S3TQFH.js → chunk-IAJOP2Z3.js} +31 -13
  19. package/dist/{chunk-LFO5BJ4H.js → chunk-ION2KFXK.js} +2 -2
  20. package/dist/{chunk-6AIYMYSG.js → chunk-K24AQV4R.js} +1 -1
  21. package/dist/{chunk-B23A5CPA.js → chunk-L6NMIUKC.js} +2 -2
  22. package/dist/{chunk-RBXVCWXL.js → chunk-LVLPNKJP.js} +2 -2
  23. package/dist/{chunk-MUUO7SPN.js → chunk-NU2SOVTU.js} +9 -3
  24. package/dist/{chunk-B7R7DHZF.js → chunk-NZBAFFWP.js} +1 -1
  25. package/dist/{chunk-LTKHPOE3.js → chunk-PL4NEIVO.js} +1 -1
  26. package/dist/{chunk-ZOMIELKI.js → chunk-Q3KUZG4P.js} +1 -1
  27. package/dist/{chunk-QPRBPE4S.js → chunk-QE4IYHJU.js} +3 -3
  28. package/dist/{chunk-3JQDPNTA.js → chunk-R2TXLS7S.js} +1 -1
  29. package/dist/{chunk-2FJ5TMQU.js → chunk-X6AJ5HEI.js} +1 -1
  30. package/dist/{chunk-5L77S5CL.js → chunk-XBFUROAY.js} +1 -1
  31. package/dist/{chunk-I472SSN2.js → chunk-YLRCDJMR.js} +1 -1
  32. package/dist/chunk-YXVJFYQE.js +191 -0
  33. package/dist/components/admin/index.d.ts +2 -2
  34. package/dist/components/admin/index.js +23 -23
  35. package/dist/components/data-display/badge.js +3 -3
  36. package/dist/components/data-display/card.d.ts +2 -2
  37. package/dist/components/data-display/carousel.js +3 -3
  38. package/dist/components/data-display/index.js +8 -8
  39. package/dist/components/data-entry/calendar.d.ts +1 -1
  40. package/dist/components/data-entry/calendar.js +4 -4
  41. package/dist/components/data-entry/cascader.d.ts +1 -1
  42. package/dist/components/data-entry/cascader.js +4 -4
  43. package/dist/components/data-entry/checkbox.d.ts +2 -2
  44. package/dist/components/data-entry/color-picker.d.ts +1 -1
  45. package/dist/components/data-entry/color-picker.js +4 -4
  46. package/dist/components/data-entry/date-picker.d.ts +1 -1
  47. package/dist/components/data-entry/date-picker.js +6 -6
  48. package/dist/components/data-entry/date-range-picker.d.ts +6 -4
  49. package/dist/components/data-entry/date-range-picker.js +5 -6
  50. package/dist/components/data-entry/index.d.ts +24 -6
  51. package/dist/components/data-entry/index.js +23 -23
  52. package/dist/components/data-entry/input.js +3 -3
  53. package/dist/components/data-entry/radio.d.ts +1 -1
  54. package/dist/components/data-entry/select.d.ts +1 -1
  55. package/dist/components/data-entry/select.js +5 -5
  56. package/dist/components/data-entry/slider.d.ts +1 -1
  57. package/dist/components/data-entry/switch.d.ts +1 -1
  58. package/dist/components/data-entry/textarea.js +3 -3
  59. package/dist/components/data-entry/time-input.js +2 -2
  60. package/dist/components/data-entry/time-picker.d.ts +1 -1
  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.js +3 -3
  73. package/dist/components/general/index.js +3 -3
  74. package/dist/components/layout/index.js +4 -4
  75. package/dist/components/navigation/index.js +9 -9
  76. package/dist/components/navigation/pagination.js +6 -6
  77. package/dist/components/navigation/steps.js +3 -3
  78. package/dist/components/query/index.js +5 -5
  79. package/dist/components/ui/index.d.ts +2 -2
  80. package/dist/components/ui/index.js +25 -25
  81. package/dist/{data-entry.prop-CyiZuEI8.d.ts → data-entry.prop-C9QWj5Kl.d.ts} +40 -2
  82. package/dist/form/index.js +1 -1
  83. package/dist/i18n/index.d.ts +6 -0
  84. package/dist/i18n/index.js +2 -2
  85. package/dist/index.d.ts +2 -2
  86. package/dist/index.js +36 -36
  87. package/dist/lib/datetime/index.js +1 -1
  88. package/dist/props/components/index.d.ts +1 -1
  89. package/dist/props/index.d.ts +1 -1
  90. package/dist/props/index.js +2 -2
  91. package/dist/props/registry.d.ts +10 -0
  92. package/dist/props/registry.js +1 -1
  93. package/dist/{search-input--ui38eQV.d.ts → search-input-d1g8eW9z.d.ts} +1 -1
  94. package/dist/styles/form-layout.css +5 -5
  95. package/dist/styles/layout.css +2 -2
  96. package/dist/tokens/base.css +1 -0
  97. package/dist/tokens/components/form.css +11 -0
  98. package/dist/tokens/semantic/layout.css +11 -0
  99. package/package.json +2 -1
  100. package/dist/chunk-3ZNSR2NL.js +0 -467
  101. package/dist/chunk-G7A6SUIN.js +0 -183
@@ -1,183 +0,0 @@
1
- import { Input } from './chunk-6AIYMYSG.js';
2
- import { Popover, PopoverAnchor, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.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
- import { cn } from './chunk-U7N2A7A3.js';
8
- import * as React from 'react';
9
- import { X, CalendarIcon } from 'lucide-react';
10
- import { jsx, jsxs } from 'react/jsx-runtime';
11
-
12
- var ISO_HINT = "yyyy-mm-dd";
13
- function DateRangePicker({
14
- value: valueProp,
15
- defaultValue,
16
- onValueChange,
17
- placeholder,
18
- disabled,
19
- className,
20
- id,
21
- name,
22
- locale: localeProp,
23
- fromDate,
24
- toDate,
25
- allowClear = true
26
- }) {
27
- const { t } = useTranslation();
28
- const { dayPickerLocale } = usePickerLocales(localeProp);
29
- const [open, setOpen] = React.useState(false);
30
- const isControlled = React.useRef(valueProp !== void 0).current;
31
- const [internalValue, setInternalValue] = React.useState(defaultValue);
32
- const value = isControlled ? valueProp : internalValue;
33
- const [fromText, setFromText] = React.useState(() => toIsoDate(value?.from));
34
- const [toText, setToText] = React.useState(() => toIsoDate(value?.to));
35
- React.useEffect(() => {
36
- setFromText(toIsoDate(value?.from));
37
- setToText(toIsoDate(value?.to));
38
- }, [value?.from, value?.to]);
39
- const resolvedPlaceholder = placeholder ?? t("dataEntry.dateRangePicker.placeholder") ?? ISO_HINT;
40
- const emit = (next) => {
41
- if (!isControlled) setInternalValue(next);
42
- onValueChange?.(next);
43
- };
44
- const showClear = allowClear && Boolean(value?.from || value?.to) && !disabled;
45
- const clear = () => {
46
- emit(void 0);
47
- setFromText("");
48
- setToText("");
49
- };
50
- const commitEdge = (edge, raw) => {
51
- const trimmed = raw.trim();
52
- if (trimmed !== "" && !/^\d{4}-\d{2}-\d{2}$/.test(trimmed)) return;
53
- const parsed = trimmed === "" ? void 0 : parseDateInput(trimmed) ?? void 0;
54
- const next = { from: value?.from, to: value?.to, [edge]: parsed };
55
- emit(next.from || next.to ? next : void 0);
56
- };
57
- return /* @__PURE__ */ jsx(Popover, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1", className), children: [
58
- /* @__PURE__ */ jsx(
59
- Input,
60
- {
61
- id,
62
- name: name ? `${name}_from` : void 0,
63
- value: fromText,
64
- disabled,
65
- placeholder: resolvedPlaceholder,
66
- inputMode: "numeric",
67
- autoComplete: "off",
68
- "aria-label": t("dataEntry.dateRangePicker.from") ?? "From",
69
- className: "tabular-nums",
70
- onClick: () => {
71
- if (!disabled) setOpen(true);
72
- },
73
- onKeyDown: (event) => {
74
- if (event.key === "ArrowDown") {
75
- event.preventDefault();
76
- setOpen(true);
77
- } else if (event.key === "Escape" && open) {
78
- setOpen(false);
79
- }
80
- },
81
- onChange: (event) => {
82
- setFromText(event.target.value);
83
- commitEdge("from", event.target.value);
84
- },
85
- onBlur: (event) => {
86
- const parsed = parseDateInput(event.target.value.trim());
87
- setFromText(parsed ? toIsoDate(parsed) : toIsoDate(value?.from));
88
- }
89
- }
90
- ),
91
- /* @__PURE__ */ jsx("span", { className: "text-muted-foreground shrink-0", "aria-hidden": "true", children: "\u2013" }),
92
- /* @__PURE__ */ jsx(
93
- Input,
94
- {
95
- name: name ? `${name}_to` : void 0,
96
- value: toText,
97
- disabled,
98
- placeholder: resolvedPlaceholder,
99
- inputMode: "numeric",
100
- autoComplete: "off",
101
- "aria-label": t("dataEntry.dateRangePicker.to") ?? "To",
102
- className: "tabular-nums",
103
- onClick: () => {
104
- if (!disabled) setOpen(true);
105
- },
106
- onKeyDown: (event) => {
107
- if (event.key === "ArrowDown") {
108
- event.preventDefault();
109
- setOpen(true);
110
- } else if (event.key === "Escape" && open) {
111
- setOpen(false);
112
- }
113
- },
114
- onChange: (event) => {
115
- setToText(event.target.value);
116
- commitEdge("to", event.target.value);
117
- },
118
- onBlur: (event) => {
119
- const parsed = parseDateInput(event.target.value.trim());
120
- setToText(parsed ? toIsoDate(parsed) : toIsoDate(value?.to));
121
- }
122
- }
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,
138
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
139
- Button,
140
- {
141
- type: "button",
142
- variant: "ghost",
143
- size: "icon",
144
- disabled,
145
- tabIndex: -1,
146
- "aria-label": t("dataEntry.dateRangePicker.openCalendar") ?? "Open calendar",
147
- className: "text-muted-foreground shrink-0 hover:bg-transparent",
148
- children: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-4 shrink-0", "aria-hidden": "true" })
149
- }
150
- ) }),
151
- /* @__PURE__ */ jsx(
152
- PopoverContent,
153
- {
154
- className: "w-auto p-0",
155
- align: "start",
156
- onOpenAutoFocus: (event) => event.preventDefault(),
157
- children: /* @__PURE__ */ jsx(
158
- Calendar,
159
- {
160
- mode: "range",
161
- selected: value,
162
- defaultMonth: value?.from,
163
- numberOfMonths: 2,
164
- onSelect: (range) => {
165
- emit(range);
166
- setFromText(toIsoDate(range?.from));
167
- setToText(toIsoDate(range?.to));
168
- },
169
- locale: dayPickerLocale,
170
- disabled: [
171
- ...fromDate ? [{ before: fromDate }] : [],
172
- ...toDate ? [{ after: toDate }] : []
173
- ],
174
- startMonth: fromDate,
175
- endMonth: toDate
176
- }
177
- )
178
- }
179
- )
180
- ] }) }) });
181
- }
182
-
183
- export { DateRangePicker };