@godxjp/ui 13.7.0 → 13.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/app/index.js +4 -4
  2. package/dist/{checkbox-ChJ2PyIz.d.ts → checkbox-bBfLARyF.d.ts} +1 -1
  3. package/dist/{chunk-CSTUENE6.js → chunk-2JOJYHG2.js} +4 -4
  4. package/dist/{chunk-TNFAUPEV.js → chunk-3UTHNXKB.js} +4 -4
  5. package/dist/{chunk-IRPZJKLU.js → chunk-4FGE5XVC.js} +10 -0
  6. package/dist/{chunk-C7W5BO7R.js → chunk-5732TWQF.js} +22 -1
  7. package/dist/{chunk-IMERLXSC.js → chunk-5LTW2LWF.js} +6 -1
  8. package/dist/{chunk-SXECWZZV.js → chunk-6SZKFJYY.js} +8 -8
  9. package/dist/{chunk-QMGNMDQG.js → chunk-76YSDJDP.js} +5 -5
  10. package/dist/chunk-7PBKPDBJ.js +881 -0
  11. package/dist/{chunk-QTEPKNQE.js → chunk-B6S6LTWT.js} +1 -1
  12. package/dist/{chunk-GOJQHYED.js → chunk-DBVZ73ML.js} +9 -5
  13. package/dist/{chunk-I472SSN2.js → chunk-E3Z3XCQR.js} +4 -3
  14. package/dist/{chunk-ZYJRZLMZ.js → chunk-HIEGUYPP.js} +1 -1
  15. package/dist/{chunk-W3AS2GEC.js → chunk-HNL7CJFO.js} +5 -5
  16. package/dist/{chunk-76S3TQFH.js → chunk-IAJOP2Z3.js} +31 -13
  17. package/dist/{chunk-RBXVCWXL.js → chunk-IESBK6XZ.js} +2 -2
  18. package/dist/{chunk-LFO5BJ4H.js → chunk-ION2KFXK.js} +2 -2
  19. package/dist/{chunk-QPRBPE4S.js → chunk-IRBI2EZ2.js} +4 -4
  20. package/dist/{chunk-3KPEZ5CF.js → chunk-J2DEWIYY.js} +1 -1
  21. package/dist/{chunk-6AIYMYSG.js → chunk-K24AQV4R.js} +1 -1
  22. package/dist/{chunk-B23A5CPA.js → chunk-KZ7ZDNUN.js} +3 -3
  23. package/dist/{chunk-6EKAEN6T.js → chunk-MSRJC3RT.js} +3 -3
  24. package/dist/{chunk-O3F3KF2B.js → chunk-N2WBUCVY.js} +4 -4
  25. package/dist/{chunk-MUUO7SPN.js → chunk-NU2SOVTU.js} +9 -3
  26. package/dist/{chunk-B7R7DHZF.js → chunk-NZBAFFWP.js} +1 -1
  27. package/dist/{chunk-ZOMIELKI.js → chunk-Q3KUZG4P.js} +1 -1
  28. package/dist/{chunk-LTKHPOE3.js → chunk-QROC2RMH.js} +2 -2
  29. package/dist/{chunk-P5KPCT6R.js → chunk-QVBOICFU.js} +2 -0
  30. package/dist/{chunk-3JQDPNTA.js → chunk-R2TXLS7S.js} +1 -1
  31. package/dist/{chunk-JXGDDD46.js → chunk-TRBD4RXJ.js} +4 -4
  32. package/dist/{chunk-KW54IV4X.js → chunk-UT6DAJUL.js} +3 -3
  33. package/dist/{chunk-2FJ5TMQU.js → chunk-X6AJ5HEI.js} +1 -1
  34. package/dist/{chunk-5L77S5CL.js → chunk-XBFUROAY.js} +1 -1
  35. package/dist/chunk-YXVJFYQE.js +191 -0
  36. package/dist/components/admin/index.d.ts +4 -4
  37. package/dist/components/admin/index.js +30 -30
  38. package/dist/components/data-display/badge.js +3 -3
  39. package/dist/components/data-display/card.d.ts +6 -4
  40. package/dist/components/data-display/card.js +1 -1
  41. package/dist/components/data-display/carousel.js +3 -3
  42. package/dist/components/data-display/index.js +11 -11
  43. package/dist/components/data-display/scroll-area.js +1 -1
  44. package/dist/components/data-entry/calendar.d.ts +2 -2
  45. package/dist/components/data-entry/calendar.js +4 -4
  46. package/dist/components/data-entry/cascader.d.ts +2 -2
  47. package/dist/components/data-entry/cascader.js +5 -5
  48. package/dist/components/data-entry/checkbox.d.ts +3 -3
  49. package/dist/components/data-entry/color-picker.d.ts +2 -2
  50. package/dist/components/data-entry/color-picker.js +4 -4
  51. package/dist/components/data-entry/date-picker.d.ts +2 -2
  52. package/dist/components/data-entry/date-picker.js +6 -6
  53. package/dist/components/data-entry/date-range-picker.d.ts +7 -5
  54. package/dist/components/data-entry/date-range-picker.js +5 -6
  55. package/dist/components/data-entry/index.d.ts +25 -7
  56. package/dist/components/data-entry/index.js +25 -25
  57. package/dist/components/data-entry/input.js +3 -3
  58. package/dist/components/data-entry/radio.d.ts +2 -2
  59. package/dist/components/data-entry/select.d.ts +2 -2
  60. package/dist/components/data-entry/select.js +5 -5
  61. package/dist/components/data-entry/slider.d.ts +2 -2
  62. package/dist/components/data-entry/switch.d.ts +2 -2
  63. package/dist/components/data-entry/textarea.js +3 -3
  64. package/dist/components/data-entry/time-input.js +2 -2
  65. package/dist/components/data-entry/time-picker.d.ts +2 -2
  66. package/dist/components/data-entry/time-picker.js +5 -5
  67. package/dist/components/data-entry/transfer.d.ts +3 -3
  68. package/dist/components/data-entry/transfer.js +7 -7
  69. package/dist/components/data-entry/tree-select.d.ts +2 -2
  70. package/dist/components/data-entry/tree-select.js +6 -6
  71. package/dist/components/data-entry/upload.d.ts +3 -3
  72. package/dist/components/data-entry/upload.js +7 -7
  73. package/dist/components/data-grid/index.js +9 -9
  74. package/dist/components/feedback/alert.js +5 -5
  75. package/dist/components/feedback/dialog.js +5 -5
  76. package/dist/components/feedback/index.js +10 -10
  77. package/dist/components/feedback/sheet.d.ts +1 -1
  78. package/dist/components/feedback/sheet.js +1 -1
  79. package/dist/components/general/button.js +3 -3
  80. package/dist/components/general/index.js +3 -3
  81. package/dist/components/layout/index.d.ts +4 -4
  82. package/dist/components/layout/index.js +5 -5
  83. package/dist/components/navigation/index.js +9 -9
  84. package/dist/components/navigation/pagination.js +6 -6
  85. package/dist/components/navigation/steps.js +3 -3
  86. package/dist/components/query/index.js +5 -5
  87. package/dist/components/ui/index.d.ts +3 -3
  88. package/dist/components/ui/index.js +32 -32
  89. package/dist/{data-entry.prop-CyiZuEI8.d.ts → data-entry.prop-BSUaseKh.d.ts} +41 -3
  90. package/dist/{flex-X2EFU1d5.d.ts → flex-1Cy46L0M.d.ts} +1 -1
  91. package/dist/form/index.js +1 -1
  92. package/dist/i18n/index.d.ts +6 -0
  93. package/dist/i18n/index.js +2 -2
  94. package/dist/index.d.ts +4 -4
  95. package/dist/index.js +43 -43
  96. package/dist/{layout.prop-D2be7gOo.d.ts → layout.prop-fCz-Vlie.d.ts} +2 -0
  97. package/dist/lib/datetime/index.js +1 -1
  98. package/dist/props/components/index.d.ts +2 -2
  99. package/dist/props/index.d.ts +2 -2
  100. package/dist/props/index.js +1 -1
  101. package/dist/props/registry.d.ts +10 -0
  102. package/dist/props/registry.js +1 -1
  103. package/dist/{search-input--ui38eQV.d.ts → search-input-D4v1JGOA.d.ts} +1 -1
  104. package/dist/styles/alert-layout.css +2 -2
  105. package/dist/styles/card-layout.css +10 -10
  106. package/dist/styles/control.css +8 -8
  107. package/dist/styles/data-display-layout.css +7 -7
  108. package/dist/styles/data-entry-layout.css +2 -2
  109. package/dist/styles/dialog-layout.css +1 -1
  110. package/dist/styles/form-layout.css +5 -5
  111. package/dist/styles/index.css +1 -1
  112. package/dist/styles/layout.css +10 -10
  113. package/dist/styles/navigation-layout.css +5 -5
  114. package/dist/styles/shell-layout.css +10 -10
  115. package/dist/styles/table-layout.css +6 -6
  116. package/dist/tokens/base.css +1 -0
  117. package/dist/tokens/components/card.css +4 -0
  118. package/dist/tokens/components/form.css +11 -0
  119. package/dist/tokens/semantic/layout.css +11 -0
  120. package/package.json +5 -3
  121. package/dist/chunk-3ZNSR2NL.js +0 -467
  122. 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 };