@godxjp/ui 7.0.0 → 8.0.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.
- package/dist/app/index.d.ts +2 -2
- package/dist/{app.prop-IobwLwaM.d.ts → app.prop-DnIXFzLi.d.ts} +9 -9
- package/dist/{checkbox-CK2mYEpD.d.ts → checkbox-ChRsR7Nk.d.ts} +2 -2
- package/dist/{chunk-3UGU5TYP.js → chunk-25RYBC5T.js} +2 -2
- package/dist/{chunk-CQBADMFG.js → chunk-26CPAKUP.js} +3 -2
- package/dist/{chunk-TT2L7JM6.js → chunk-3TS3G4U3.js} +3 -3
- package/dist/{chunk-ZS6DTAM2.js → chunk-4MMIMZMK.js} +1 -1
- package/dist/{chunk-6TSU4IHV.js → chunk-4R7RQDXI.js} +23 -21
- package/dist/{chunk-OXKY5QMK.js → chunk-6QXQQAOQ.js} +6 -6
- package/dist/{chunk-JJCGMCTL.js → chunk-A22MCA3X.js} +6 -6
- package/dist/{chunk-VXXKR5U4.js → chunk-A7PKMT7Y.js} +4 -4
- package/dist/{chunk-HKQITNB3.js → chunk-AINW5WYN.js} +5 -4
- package/dist/{chunk-OGFWIXRO.js → chunk-C5H655GK.js} +218 -53
- package/dist/{chunk-ZLK5SPT6.js → chunk-EOTOCNT7.js} +1 -1
- package/dist/{chunk-ARDVPIF4.js → chunk-G2WYOCDL.js} +5 -5
- package/dist/chunk-HKD6ERY7.js +1 -0
- package/dist/{chunk-V6UWJKZF.js → chunk-HTEL5DQI.js} +1 -1
- package/dist/{chunk-ICM6XBST.js → chunk-IBK5D2Q6.js} +2 -1
- package/dist/{chunk-IK7I3ABN.js → chunk-IOGU3ZWF.js} +2 -2
- package/dist/{chunk-HJEBRCXL.js → chunk-M4PZNAMV.js} +1 -0
- package/dist/{chunk-2QG3OVAD.js → chunk-N43OKOFT.js} +7 -5
- package/dist/{chunk-ZR2TIBPG.js → chunk-NG23LVTM.js} +4 -4
- package/dist/{chunk-E76QIYSY.js → chunk-O24Z3ULJ.js} +4 -4
- package/dist/{chunk-L6J44O74.js → chunk-OJZ6C2HM.js} +2 -2
- package/dist/{chunk-2HLWHQJA.js → chunk-P4HFJQID.js} +5 -4
- package/dist/{chunk-EXBWDW5E.js → chunk-RGIYKJPW.js} +7 -7
- package/dist/{chunk-ZKIAZDVU.js → chunk-RGPF3HU6.js} +4 -4
- package/dist/{chunk-FBHN6OO4.js → chunk-SKIRU7GC.js} +2 -2
- package/dist/chunk-TILFZBTE.js +50 -0
- package/dist/{chunk-6UFKWOEW.js → chunk-TMDGV4CN.js} +15 -11
- package/dist/{chunk-7AMHT5Z5.js → chunk-UIYEAUWA.js} +30 -13
- package/dist/{chunk-25ZZ2W3M.js → chunk-WN52SCGE.js} +5 -5
- package/dist/{chunk-EQRQM6RF.js → chunk-WTVLZVBA.js} +28 -8
- package/dist/{chunk-Y3XBNUTD.js → chunk-XDUZ7JJL.js} +2 -2
- package/dist/chunk-XMBCNMJI.js +61 -0
- package/dist/{chunk-RVY4F7LK.js → chunk-XZM2GNAY.js} +7 -7
- package/dist/{chunk-NTUHJ37K.js → chunk-Z6HNY2PL.js} +9 -9
- package/dist/components/admin/index.d.ts +19 -19
- package/dist/components/admin/index.js +30 -30
- package/dist/components/data-display/badge.d.ts +7 -4
- package/dist/components/data-display/badge.js +2 -2
- package/dist/components/data-display/card.d.ts +2 -2
- package/dist/components/data-display/index.d.ts +6 -6
- package/dist/components/data-display/index.js +8 -8
- package/dist/components/data-display/table.js +2 -2
- package/dist/components/data-entry/autocomplete.d.ts +5 -5
- package/dist/components/data-entry/autocomplete.js +6 -6
- package/dist/components/data-entry/calendar.d.ts +5 -5
- package/dist/components/data-entry/calendar.js +3 -3
- package/dist/components/data-entry/cascader.d.ts +6 -6
- package/dist/components/data-entry/cascader.js +7 -7
- package/dist/components/data-entry/checkbox.d.ts +6 -6
- package/dist/components/data-entry/checkbox.js +2 -2
- package/dist/components/data-entry/color-picker.d.ts +6 -6
- package/dist/components/data-entry/color-picker.js +2 -2
- package/dist/components/data-entry/command.d.ts +11 -11
- package/dist/components/data-entry/command.js +2 -2
- package/dist/components/data-entry/date-picker.d.ts +6 -6
- package/dist/components/data-entry/date-picker.js +5 -5
- package/dist/components/data-entry/date-range-picker.d.ts +6 -6
- package/dist/components/data-entry/date-range-picker.js +5 -5
- package/dist/components/data-entry/index.d.ts +11 -21
- package/dist/components/data-entry/index.js +25 -83
- package/dist/components/data-entry/radio.d.ts +5 -5
- package/dist/components/data-entry/radio.js +2 -2
- package/dist/components/data-entry/select.d.ts +5 -5
- package/dist/components/data-entry/select.js +6 -6
- package/dist/components/data-entry/slider.d.ts +5 -5
- package/dist/components/data-entry/switch.d.ts +5 -5
- package/dist/components/data-entry/textarea.js +2 -2
- package/dist/components/data-entry/time-picker.d.ts +6 -6
- package/dist/components/data-entry/time-picker.js +3 -3
- package/dist/components/data-entry/transfer.d.ts +7 -7
- package/dist/components/data-entry/transfer.js +4 -4
- package/dist/components/data-entry/tree-select.d.ts +6 -6
- package/dist/components/data-entry/tree-select.js +7 -7
- package/dist/components/data-entry/upload.d.ts +7 -7
- package/dist/components/data-entry/upload.js +5 -5
- package/dist/components/feedback/alert.d.ts +7 -5
- package/dist/components/feedback/alert.js +3 -3
- package/dist/components/feedback/dialog.d.ts +9 -6
- package/dist/components/feedback/dialog.js +2 -2
- package/dist/components/feedback/index.d.ts +6 -6
- package/dist/components/feedback/index.js +7 -6
- package/dist/components/general/button.d.ts +4 -4
- package/dist/components/general/button.js +1 -1
- package/dist/components/general/index.d.ts +3 -3
- package/dist/components/general/index.js +1 -1
- package/dist/components/layout/index.d.ts +10 -9
- package/dist/components/layout/index.js +3 -3
- package/dist/components/navigation/index.d.ts +13 -13
- package/dist/components/navigation/index.js +10 -10
- package/dist/components/navigation/pagination.d.ts +5 -5
- package/dist/components/navigation/pagination.js +7 -7
- package/dist/components/navigation/steps.d.ts +6 -6
- package/dist/components/navigation/steps.js +2 -2
- package/dist/components/query/index.d.ts +12 -7
- package/dist/components/query/index.js +4 -4
- package/dist/components/ui/index.d.ts +12 -12
- package/dist/components/ui/index.js +30 -30
- package/dist/{data-display.prop-CXP9Jfdn.d.ts → data-display.prop-Cf2p9QC4.d.ts} +6 -5
- package/dist/{data-entry.prop-CpSx5dX6.d.ts → data-entry.prop-CDkOajPj.d.ts} +38 -28
- package/dist/{data-table-C5lcmAwE.d.ts → data-table-B_q7j992.d.ts} +4 -4
- package/dist/{data.prop-BmLaGLb7.d.ts → data.prop-DMYMNl6L.d.ts} +2 -2
- package/dist/{feedback.prop-BnBpUzNK.d.ts → feedback.prop-BR5JOpPl.d.ts} +8 -5
- package/dist/filter-bar-DvVXm_d1.d.ts +14 -0
- package/dist/form/index.d.ts +3 -3
- package/dist/{form.prop-BHgpuFFm.d.ts → form.prop-Bc6r6JJW.d.ts} +1 -1
- package/dist/{general.prop-D7brMPNL.d.ts → general.prop-DoHDCRmL.d.ts} +2 -2
- package/dist/index.d.ts +22 -22
- package/dist/index.js +43 -30
- package/dist/inline-DqfYlGKj.d.ts +18 -0
- package/dist/{interaction.prop-Cdn7wOtq.d.ts → interaction.prop-DSFizzP6.d.ts} +8 -6
- package/dist/{layout.prop-MwHm4-Zl.d.ts → layout.prop-Baq9muDN.d.ts} +27 -13
- package/dist/layout.prop-CXvl2rVR.d.ts +16 -0
- package/dist/{navigation.prop-DAH4ysXj.d.ts → navigation.prop-8DgElO0c.d.ts} +12 -8
- package/dist/{navigation.prop-Hu7s7MJa.d.ts → navigation.prop-BKlxd-j7.d.ts} +2 -5
- package/dist/props/components/index.d.ts +14 -14
- package/dist/props/index.d.ts +14 -14
- package/dist/props/index.js +2 -2
- package/dist/props/registry.d.ts +251 -56
- package/dist/props/registry.js +1 -1
- package/dist/props/vocabulary/index.d.ts +5 -5
- package/dist/{query.prop-hIPrk2zI.d.ts → query.prop-DuODxsiU.d.ts} +12 -8
- package/dist/{search-input-rR2XDrjv.d.ts → search-input-cezAxpgb.d.ts} +7 -2
- package/dist/{shared.prop-BNRJc9K0.d.ts → shared.prop-BsNSXeqD.d.ts} +9 -3
- package/dist/{skeleton-CqFO4dRc.d.ts → skeleton-uWAjSacg.d.ts} +4 -2
- package/dist/styles/alert-layout.css +38 -18
- package/dist/styles/badge-layout.css +2 -2
- package/dist/styles/card-layout.css +5 -5
- package/dist/styles/density.css +10 -10
- package/dist/styles/dialog-layout.css +4 -4
- package/dist/styles/index.css +6 -9
- package/dist/styles/layout.css +95 -14
- package/dist/styles/table-layout.css +3 -3
- package/dist/theme/example.service.css +0 -5
- package/dist/tokens/base.css +7 -7
- package/dist/tokens/components/badge.css +7 -0
- package/dist/tokens/{primitives → components}/card.css +2 -3
- package/dist/tokens/{primitives → components}/control.css +10 -0
- package/dist/tokens/components/feedback.css +17 -0
- package/dist/tokens/{primitives → components}/table.css +2 -2
- package/dist/tokens/foundation.css +7 -22
- package/package.json +5 -3
- package/scripts/ui-audit.mjs +22 -0
- package/dist/chunk-S66TJXJU.js +0 -33
- package/dist/filter-bar-zSKz7YCR.d.ts +0 -10
- package/dist/inline-CV3A46np.d.ts +0 -10
- package/dist/layout.prop-4TCNvyQZ.d.ts +0 -20
- package/dist/tokens/primitives/badge.css +0 -13
- package/dist/tokens/primitives/feedback.css +0 -17
- /package/dist/{chunk-LDSLS6HE.js → chunk-2H65B4JA.js} +0 -0
- /package/dist/tokens/{primitives → components}/navigation.css +0 -0
- /package/dist/tokens/{primitives → semantic}/layout.css +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { reactNodeText } from './chunk-SMLKNECP.js';
|
|
2
|
-
import { Checkbox } from './chunk-
|
|
2
|
+
import { Checkbox } from './chunk-O24Z3ULJ.js';
|
|
3
3
|
import { ScrollArea } from './chunk-3KPEZ5CF.js';
|
|
4
4
|
import { Input } from './chunk-VOHTRR5X.js';
|
|
5
|
-
import { Button } from './chunk-
|
|
5
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
6
6
|
import { Label } from './chunk-7PWBC4BY.js';
|
|
7
7
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
8
8
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
@@ -205,7 +205,7 @@ function TransferPanel({
|
|
|
205
205
|
function Transfer({
|
|
206
206
|
dataSource,
|
|
207
207
|
targetKeys,
|
|
208
|
-
|
|
208
|
+
onValueChange,
|
|
209
209
|
titles,
|
|
210
210
|
showSearch,
|
|
211
211
|
oneWay,
|
|
@@ -229,7 +229,7 @@ function Transfer({
|
|
|
229
229
|
const keys = selected[fromSide];
|
|
230
230
|
if (!keys.length) return;
|
|
231
231
|
const nextTarget = direction === "right" ? [...targetKeys, ...keys.filter((k) => !targetKeys.includes(k))] : targetKeys.filter((k) => !keys.includes(k));
|
|
232
|
-
|
|
232
|
+
onValueChange?.(nextTarget, direction, keys);
|
|
233
233
|
const cleared = fromSide === 0 ? [[], selected[1]] : [selected[0], []];
|
|
234
234
|
if (selectedKeysProp) onSelectChange?.(cleared[0], cleared[1]);
|
|
235
235
|
else setInternalSelected(cleared);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Field, choiceGroupClassName } from './chunk-26CPAKUP.js';
|
|
2
2
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
@@ -19,7 +19,7 @@ function useControllableArray(controlled, defaultValue) {
|
|
|
19
19
|
function CheckboxGroup({
|
|
20
20
|
value: controlledValue,
|
|
21
21
|
defaultValue = [],
|
|
22
|
-
|
|
22
|
+
onValueChange,
|
|
23
23
|
options,
|
|
24
24
|
orientation = "vertical",
|
|
25
25
|
disabled,
|
|
@@ -32,7 +32,7 @@ function CheckboxGroup({
|
|
|
32
32
|
const toggle = (optionValue) => {
|
|
33
33
|
const next = value.includes(optionValue) ? value.filter((v) => v !== optionValue) : [...value, optionValue];
|
|
34
34
|
setValue(next);
|
|
35
|
-
|
|
35
|
+
onValueChange?.(next);
|
|
36
36
|
};
|
|
37
37
|
if (options && options.length > 0) {
|
|
38
38
|
return /* @__PURE__ */ jsx(
|
|
@@ -45,7 +45,7 @@ function CheckboxGroup({
|
|
|
45
45
|
children: options.map((opt, index) => {
|
|
46
46
|
const id = `${reactId}-${opt.value}-${index}`;
|
|
47
47
|
const checked = value.includes(opt.value);
|
|
48
|
-
return /* @__PURE__ */ jsx(
|
|
48
|
+
return /* @__PURE__ */ jsx(Field, { id, label: opt.label, description: opt.description, children: /* @__PURE__ */ jsx(
|
|
49
49
|
Checkbox,
|
|
50
50
|
{
|
|
51
51
|
id,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { controlIconClass } from './chunk-
|
|
1
|
+
import { controlIconClass } from './chunk-IBK5D2Q6.js';
|
|
2
2
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
3
3
|
import { Check, Loader2, X, Circle } from 'lucide-react';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
@@ -65,7 +65,7 @@ function Steps({
|
|
|
65
65
|
}) {
|
|
66
66
|
const base = initial;
|
|
67
67
|
const isVertical = orientation === "vertical";
|
|
68
|
-
const compact = size === "
|
|
68
|
+
const compact = size === "sm";
|
|
69
69
|
return /* @__PURE__ */ jsx(
|
|
70
70
|
"ol",
|
|
71
71
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Input } from './chunk-VOHTRR5X.js';
|
|
2
|
-
import { buttonVariants, Button } from './chunk-
|
|
2
|
+
import { buttonVariants, Button } from './chunk-M4PZNAMV.js';
|
|
3
3
|
import { Label } from './chunk-7PWBC4BY.js';
|
|
4
4
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
5
5
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
@@ -152,7 +152,7 @@ var DialogCancel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
152
152
|
}
|
|
153
153
|
));
|
|
154
154
|
DialogCancel.displayName = "DialogCancel";
|
|
155
|
-
function
|
|
155
|
+
function AlertDialog({
|
|
156
156
|
open,
|
|
157
157
|
onOpenChange,
|
|
158
158
|
title,
|
|
@@ -232,7 +232,8 @@ var Dialog = Object.assign(DialogRoot, {
|
|
|
232
232
|
Close: DialogClose,
|
|
233
233
|
Action: DialogAction,
|
|
234
234
|
Cancel: DialogCancel,
|
|
235
|
-
Confirm:
|
|
235
|
+
Confirm: AlertDialog
|
|
236
236
|
});
|
|
237
|
+
var DialogConfirm = AlertDialog;
|
|
237
238
|
|
|
238
|
-
export { Dialog, DialogAction, DialogCancel, DialogClose, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger };
|
|
239
|
+
export { AlertDialog, Dialog, DialogAction, DialogCancel, DialogClose, DialogConfirm, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Calendar } from './chunk-
|
|
2
|
-
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
1
|
+
import { Calendar } from './chunk-IOGU3ZWF.js';
|
|
3
2
|
import { Input } from './chunk-VOHTRR5X.js';
|
|
4
|
-
import {
|
|
3
|
+
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
4
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
5
5
|
import { useTranslation, usePickerLocales } from './chunk-RLGHEV4A.js';
|
|
6
6
|
import { toIsoDate, parseDateInput } from './chunk-FXFJF4YA.js';
|
|
7
7
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
@@ -12,7 +12,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
12
12
|
var ISO_HINT = "yyyy-mm-dd";
|
|
13
13
|
function DatePicker({
|
|
14
14
|
value,
|
|
15
|
-
|
|
15
|
+
onValueChange,
|
|
16
16
|
placeholder,
|
|
17
17
|
disabled,
|
|
18
18
|
className,
|
|
@@ -33,12 +33,12 @@ function DatePicker({
|
|
|
33
33
|
const commit = (raw) => {
|
|
34
34
|
const trimmed = raw.trim();
|
|
35
35
|
if (trimmed === "") {
|
|
36
|
-
|
|
36
|
+
onValueChange?.(void 0);
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
const parsed = parseDateInput(trimmed);
|
|
40
40
|
if (parsed) {
|
|
41
|
-
|
|
41
|
+
onValueChange?.(parsed);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
@@ -86,7 +86,7 @@ function DatePicker({
|
|
|
86
86
|
mode: "single",
|
|
87
87
|
selected: value,
|
|
88
88
|
onSelect: (date) => {
|
|
89
|
-
|
|
89
|
+
onValueChange?.(date);
|
|
90
90
|
setText(toIsoDate(date));
|
|
91
91
|
setOpen(false);
|
|
92
92
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
2
1
|
import { Input } from './chunk-VOHTRR5X.js';
|
|
3
|
-
import {
|
|
2
|
+
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
3
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
4
4
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
5
5
|
import { normalizeHhmm, isValidHhmm } from './chunk-FXFJF4YA.js';
|
|
6
6
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
@@ -133,7 +133,7 @@ function TimePickerPanel({ value, minuteStep, onChange, onDone }) {
|
|
|
133
133
|
function TimePicker({
|
|
134
134
|
value: controlledValue,
|
|
135
135
|
defaultValue,
|
|
136
|
-
|
|
136
|
+
onValueChange,
|
|
137
137
|
placeholder,
|
|
138
138
|
disabled,
|
|
139
139
|
className,
|
|
@@ -153,7 +153,7 @@ function TimePicker({
|
|
|
153
153
|
}, [value]);
|
|
154
154
|
const setValue = (next) => {
|
|
155
155
|
if (!isControlled) setInternal(next);
|
|
156
|
-
|
|
156
|
+
onValueChange?.(next);
|
|
157
157
|
};
|
|
158
158
|
return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
|
|
159
159
|
/* @__PURE__ */ jsx(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-
|
|
2
|
-
import { Button } from './chunk-
|
|
1
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from './chunk-G2WYOCDL.js';
|
|
2
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
3
3
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
4
4
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
5
5
|
import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/lib/variants.ts
|
|
5
|
+
var densityClass = {
|
|
6
|
+
compact: "ui-density-compact",
|
|
7
|
+
default: "ui-density-default",
|
|
8
|
+
comfortable: "ui-density-comfortable"
|
|
9
|
+
};
|
|
10
|
+
var pageContainerVariantClass = {
|
|
11
|
+
default: void 0,
|
|
12
|
+
narrow: "ui-page-container--narrow",
|
|
13
|
+
flush: "ui-page-container--flush",
|
|
14
|
+
ghost: "ui-page-container--ghost"
|
|
15
|
+
};
|
|
16
|
+
var flexGapClass = {
|
|
17
|
+
xs: "ui-flex-gap-xs",
|
|
18
|
+
sm: "ui-flex-gap-sm",
|
|
19
|
+
md: "ui-flex-gap-md",
|
|
20
|
+
lg: "ui-flex-gap-lg",
|
|
21
|
+
xl: "ui-flex-gap-xl"
|
|
22
|
+
};
|
|
23
|
+
function Flex({
|
|
24
|
+
direction = "col",
|
|
25
|
+
gap = "md",
|
|
26
|
+
align,
|
|
27
|
+
justify,
|
|
28
|
+
wrap = false,
|
|
29
|
+
className,
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
|
+
}) {
|
|
33
|
+
return /* @__PURE__ */ jsx(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
"data-direction": direction,
|
|
37
|
+
"data-align": align,
|
|
38
|
+
"data-justify": justify,
|
|
39
|
+
"data-wrap": wrap ? "true" : void 0,
|
|
40
|
+
className: cn("ui-flex", flexGapClass[gap], className),
|
|
41
|
+
...props,
|
|
42
|
+
children
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function Inline({ gap = "sm", ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(Flex, { direction: "row", wrap: true, gap, align: "center", ...props });
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { Flex, Inline, densityClass, pageContainerVariantClass };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { humanError } from './chunk-4R7QL3MW.js';
|
|
2
|
-
import { Inline } from './chunk-
|
|
3
|
-
import { Button } from './chunk-
|
|
2
|
+
import { Inline } from './chunk-TILFZBTE.js';
|
|
3
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
4
4
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
5
5
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import { CheckCircle2, TriangleAlert, AlertCircle,
|
|
7
|
+
import { Info, CheckCircle2, TriangleAlert, AlertCircle, X, RefreshCw } from 'lucide-react';
|
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
|
|
10
10
|
var AlertContext = React.createContext("default");
|
|
@@ -12,23 +12,27 @@ var DEFAULT_ICONS = {
|
|
|
12
12
|
default: Info,
|
|
13
13
|
destructive: AlertCircle,
|
|
14
14
|
warning: TriangleAlert,
|
|
15
|
-
success: CheckCircle2
|
|
15
|
+
success: CheckCircle2,
|
|
16
|
+
info: Info,
|
|
17
|
+
muted: Info,
|
|
18
|
+
neutral: Info
|
|
16
19
|
};
|
|
17
20
|
var AlertBase = React.forwardRef(
|
|
18
|
-
({ variant = "default", icon, onDismiss, className, children, ...props }, ref) => {
|
|
19
|
-
const IconComponent = icon === false ? null : icon ?? DEFAULT_ICONS[
|
|
20
|
-
return /* @__PURE__ */ jsx(AlertContext.Provider, { value:
|
|
21
|
+
({ variant = "default", tone = "default", icon, onDismiss, className, children, ...props }, ref) => {
|
|
22
|
+
const IconComponent = icon === false ? null : icon ?? DEFAULT_ICONS[tone];
|
|
23
|
+
return /* @__PURE__ */ jsx(AlertContext.Provider, { value: tone, children: /* @__PURE__ */ jsxs(
|
|
21
24
|
"div",
|
|
22
25
|
{
|
|
23
26
|
ref,
|
|
24
27
|
role: "alert",
|
|
25
28
|
"data-slot": "alert",
|
|
26
29
|
"data-variant": variant,
|
|
30
|
+
"data-tone": tone,
|
|
27
31
|
"data-dismissible": onDismiss ? "" : void 0,
|
|
28
32
|
className,
|
|
29
33
|
...props,
|
|
30
34
|
children: [
|
|
31
|
-
IconComponent && /* @__PURE__ */ jsx(IconComponent, { "data-slot": "alert-icon", "data-
|
|
35
|
+
IconComponent && /* @__PURE__ */ jsx(IconComponent, { "data-slot": "alert-icon", "data-tone": tone, "aria-hidden": "true" }),
|
|
32
36
|
/* @__PURE__ */ jsx("div", { "data-slot": "alert-body", children }),
|
|
33
37
|
onDismiss && /* @__PURE__ */ jsx(
|
|
34
38
|
"button",
|
|
@@ -51,13 +55,13 @@ var AlertBase = React.forwardRef(
|
|
|
51
55
|
AlertBase.displayName = "Alert";
|
|
52
56
|
var AlertTitle = React.forwardRef(
|
|
53
57
|
({ className, ...props }, ref) => {
|
|
54
|
-
const
|
|
58
|
+
const tone = React.useContext(AlertContext);
|
|
55
59
|
return /* @__PURE__ */ jsx(
|
|
56
60
|
"p",
|
|
57
61
|
{
|
|
58
62
|
ref,
|
|
59
63
|
"data-slot": "alert-title",
|
|
60
|
-
"data-
|
|
64
|
+
"data-tone": tone,
|
|
61
65
|
className,
|
|
62
66
|
...props
|
|
63
67
|
}
|
|
@@ -87,7 +91,7 @@ var AlertActions = React.forwardRef(
|
|
|
87
91
|
AlertActions.displayName = "AlertActions";
|
|
88
92
|
function AlertQueryError({ error, onRetry, className }) {
|
|
89
93
|
const { t } = useTranslation();
|
|
90
|
-
return /* @__PURE__ */ jsxs(Alert, {
|
|
94
|
+
return /* @__PURE__ */ jsxs(Alert, { tone: "destructive", className, children: [
|
|
91
95
|
/* @__PURE__ */ jsx(AlertTitle, { children: t("common.error") }),
|
|
92
96
|
/* @__PURE__ */ jsx(AlertDescription, { children: humanError(error) }),
|
|
93
97
|
onRetry && /* @__PURE__ */ jsx(AlertActions, { children: /* @__PURE__ */ jsx(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toneNeutralClass, toneInfoClass, toneWarningClass, toneSuccessClass
|
|
1
|
+
import { toneNeutralClass, toneMutedClass, toneInfoClass, toneDestructiveClass, toneWarningClass, toneSuccessClass } from './chunk-IBK5D2Q6.js';
|
|
2
2
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
3
3
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
4
4
|
import { cva } from 'class-variance-authority';
|
|
@@ -35,27 +35,44 @@ var badgeVariants = cva(
|
|
|
35
35
|
variant: {
|
|
36
36
|
default: "border-transparent bg-primary text-primary-foreground",
|
|
37
37
|
secondary: "border-transparent bg-secondary text-secondary-foreground",
|
|
38
|
-
|
|
39
|
-
outline: "text-foreground",
|
|
40
|
-
success: cn("border-transparent", toneSuccessClass),
|
|
41
|
-
warning: cn("border-transparent", toneWarningClass),
|
|
42
|
-
info: cn("border-transparent", toneInfoClass),
|
|
43
|
-
neutral: cn("border-transparent", toneNeutralClass)
|
|
38
|
+
outline: "text-foreground"
|
|
44
39
|
}
|
|
45
40
|
},
|
|
46
41
|
defaultVariants: { variant: "default" }
|
|
47
42
|
}
|
|
48
43
|
);
|
|
49
|
-
|
|
44
|
+
var badgeToneClass = {
|
|
45
|
+
default: void 0,
|
|
46
|
+
success: cn("border-transparent", toneSuccessClass),
|
|
47
|
+
warning: cn("border-transparent", toneWarningClass),
|
|
48
|
+
destructive: cn("border-transparent", toneDestructiveClass),
|
|
49
|
+
info: cn("border-transparent", toneInfoClass),
|
|
50
|
+
muted: cn("border-transparent", toneMutedClass),
|
|
51
|
+
neutral: cn("border-transparent", toneNeutralClass)
|
|
52
|
+
};
|
|
53
|
+
function Badge({ className, variant, tone, icon, status, children, ...props }) {
|
|
50
54
|
const { t } = useTranslation();
|
|
51
55
|
const statusDef = status ? STATUS_MAP[status] ?? { tone: "neutral", icon: Circle } : null;
|
|
52
|
-
const
|
|
56
|
+
const resolvedTone = tone ?? statusDef?.tone ?? "default";
|
|
53
57
|
const ResolvedIcon = icon === void 0 ? statusDef?.icon : icon;
|
|
54
58
|
const resolvedChildren = children ?? (status ? status in STATUS_MAP ? t(`status.${status}`) : status : void 0);
|
|
55
|
-
return /* @__PURE__ */ jsxs(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
return /* @__PURE__ */ jsxs(
|
|
60
|
+
"div",
|
|
61
|
+
{
|
|
62
|
+
"data-slot": "badge",
|
|
63
|
+
"data-tone": resolvedTone,
|
|
64
|
+
className: cn(
|
|
65
|
+
badgeVariants({ variant: variant ?? "default" }),
|
|
66
|
+
badgeToneClass[resolvedTone],
|
|
67
|
+
className
|
|
68
|
+
),
|
|
69
|
+
...props,
|
|
70
|
+
children: [
|
|
71
|
+
ResolvedIcon ? /* @__PURE__ */ jsx(ResolvedIcon, { "data-slot": "badge-icon", "aria-hidden": "true" }) : null,
|
|
72
|
+
resolvedChildren
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
59
76
|
}
|
|
60
77
|
|
|
61
78
|
export { Badge };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Calendar } from './chunk-
|
|
2
|
-
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
1
|
+
import { Calendar } from './chunk-IOGU3ZWF.js';
|
|
3
2
|
import { Input } from './chunk-VOHTRR5X.js';
|
|
4
|
-
import {
|
|
3
|
+
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
4
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
5
5
|
import { useTranslation, usePickerLocales } from './chunk-RLGHEV4A.js';
|
|
6
6
|
import { toIsoDate, parseDateInput } from './chunk-FXFJF4YA.js';
|
|
7
7
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
@@ -12,7 +12,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
12
12
|
var ISO_HINT = "yyyy-mm-dd";
|
|
13
13
|
function DateRangePicker({
|
|
14
14
|
value,
|
|
15
|
-
|
|
15
|
+
onValueChange,
|
|
16
16
|
placeholder,
|
|
17
17
|
disabled,
|
|
18
18
|
className,
|
|
@@ -32,7 +32,7 @@ function DateRangePicker({
|
|
|
32
32
|
setToText(toIsoDate(value?.to));
|
|
33
33
|
}, [value?.from, value?.to]);
|
|
34
34
|
const resolvedPlaceholder = placeholder ?? t("dataEntry.dateRangePicker.placeholder") ?? ISO_HINT;
|
|
35
|
-
const emit = (next) =>
|
|
35
|
+
const emit = (next) => onValueChange?.(next);
|
|
36
36
|
const commitEdge = (edge, raw) => {
|
|
37
37
|
const parsed = raw.trim() === "" ? void 0 : parseDateInput(raw.trim()) ?? void 0;
|
|
38
38
|
const next = { from: value?.from, to: value?.to, [edge]: parsed };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DropdownMenu, DropdownMenuTrigger } from './chunk-TO33OY4L.js';
|
|
2
1
|
import { Tooltip, TooltipTrigger, TooltipContent } from './chunk-32WO3YLB.js';
|
|
2
|
+
import { DropdownMenu, DropdownMenuTrigger } from './chunk-TO33OY4L.js';
|
|
3
3
|
import { Collapsible, CollapsibleTrigger, CollapsibleContent } from './chunk-DV52WNXO.js';
|
|
4
|
+
import { densityClass, pageContainerVariantClass, Flex } from './chunk-TILFZBTE.js';
|
|
4
5
|
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
5
|
-
import { densityClass, pageContainerVariantClass, stackGapClass } from './chunk-S66TJXJU.js';
|
|
6
6
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
7
7
|
import { Link } from 'react-router-dom';
|
|
8
8
|
import { ChevronRight, ChevronDown, PanelLeftOpen, PanelLeftClose, Search, Bell, SlidersHorizontal } from 'lucide-react';
|
|
@@ -10,7 +10,10 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
10
10
|
import * as React from 'react';
|
|
11
11
|
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
12
12
|
|
|
13
|
-
function
|
|
13
|
+
function PageContainerInset({ className, children, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx("div", { className: cn("ui-page-container-inset", className), ...props, children });
|
|
15
|
+
}
|
|
16
|
+
function PageContainerRoot({
|
|
14
17
|
title,
|
|
15
18
|
subtitle,
|
|
16
19
|
extra,
|
|
@@ -62,11 +65,14 @@ function PageContainer({
|
|
|
62
65
|
}
|
|
63
66
|
);
|
|
64
67
|
}
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
var PageContainer = Object.assign(PageContainerRoot, {
|
|
69
|
+
Inset: PageContainerInset
|
|
70
|
+
});
|
|
71
|
+
function PageInset(props) {
|
|
72
|
+
return /* @__PURE__ */ jsx(PageContainerInset, { ...props });
|
|
67
73
|
}
|
|
68
|
-
function Stack(
|
|
69
|
-
return /* @__PURE__ */ jsx(
|
|
74
|
+
function Stack(props) {
|
|
75
|
+
return /* @__PURE__ */ jsx(Flex, { direction: "col", ...props });
|
|
70
76
|
}
|
|
71
77
|
function AppShell({
|
|
72
78
|
sidebar,
|
|
@@ -365,8 +371,22 @@ function Topbar({
|
|
|
365
371
|
) : null
|
|
366
372
|
] });
|
|
367
373
|
}
|
|
374
|
+
function resolveColumns(columns) {
|
|
375
|
+
if (typeof columns === "number") {
|
|
376
|
+
return {
|
|
377
|
+
"--responsive-grid-sm": Math.min(columns, 2),
|
|
378
|
+
"--responsive-grid-md": Math.min(columns, 3),
|
|
379
|
+
"--responsive-grid-lg": columns
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
return {
|
|
383
|
+
"--responsive-grid-sm": columns.sm ?? 1,
|
|
384
|
+
"--responsive-grid-md": columns.md ?? columns.sm ?? 1,
|
|
385
|
+
"--responsive-grid-lg": columns.lg ?? columns.md ?? columns.sm ?? 1
|
|
386
|
+
};
|
|
387
|
+
}
|
|
368
388
|
function ResponsiveGrid({ columns = 4, children }) {
|
|
369
|
-
return /* @__PURE__ */ jsx("div", { className: "ui-responsive-grid",
|
|
389
|
+
return /* @__PURE__ */ jsx("div", { className: "ui-responsive-grid", style: resolveColumns(columns), children });
|
|
370
390
|
}
|
|
371
391
|
function SplitPane({ children, aside, asideWidth = "md" }) {
|
|
372
392
|
return /* @__PURE__ */ jsxs("div", { className: "ui-split-pane", "data-aside-width": asideWidth, children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SearchSelect } from './chunk-
|
|
1
|
+
import { SearchSelect } from './chunk-6QXQQAOQ.js';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
|
|
4
4
|
function Autocomplete({
|
|
@@ -17,7 +17,7 @@ function Autocomplete({
|
|
|
17
17
|
{
|
|
18
18
|
id,
|
|
19
19
|
value,
|
|
20
|
-
|
|
20
|
+
onValueChange: (next) => onValueChange?.(next),
|
|
21
21
|
options,
|
|
22
22
|
clearable: false,
|
|
23
23
|
placeholder,
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Select, SelectTrigger, SelectValue, SelectContent, SelectGroup, SelectItem } from './chunk-G2WYOCDL.js';
|
|
2
|
+
import { Inline } from './chunk-TILFZBTE.js';
|
|
3
|
+
import { cn } from './chunk-U7N2A7A3.js';
|
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
function CountryOptionLabel({
|
|
7
|
+
country,
|
|
8
|
+
showCode = false,
|
|
9
|
+
className
|
|
10
|
+
}) {
|
|
11
|
+
const code = country.value ?? country.code ?? "";
|
|
12
|
+
const text = country.nativeName != null && country.nativeName !== "" ? `${country.name} (${country.nativeName})` : country.name;
|
|
13
|
+
return /* @__PURE__ */ jsxs(Inline, { gap: "xs", className: cn("items-center", className), children: [
|
|
14
|
+
country.flagSvgPath != null && country.flagSvgPath !== "" && /* @__PURE__ */ jsx(
|
|
15
|
+
"img",
|
|
16
|
+
{
|
|
17
|
+
src: country.flagSvgPath,
|
|
18
|
+
alt: "",
|
|
19
|
+
className: "h-3 w-5 shrink-0 rounded-sm object-cover",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}
|
|
22
|
+
),
|
|
23
|
+
/* @__PURE__ */ jsxs("span", { className: "truncate", children: [
|
|
24
|
+
text,
|
|
25
|
+
showCode && code !== "" && /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
|
|
26
|
+
" \xB7 ",
|
|
27
|
+
code
|
|
28
|
+
] })
|
|
29
|
+
] })
|
|
30
|
+
] });
|
|
31
|
+
}
|
|
32
|
+
function CountrySelect({
|
|
33
|
+
id,
|
|
34
|
+
name,
|
|
35
|
+
options,
|
|
36
|
+
defaultValue,
|
|
37
|
+
required = false,
|
|
38
|
+
allowEmpty = false,
|
|
39
|
+
emptyLabel = "\u2014",
|
|
40
|
+
placeholder,
|
|
41
|
+
invalid = false
|
|
42
|
+
}) {
|
|
43
|
+
const emptyValue = "0";
|
|
44
|
+
const resolvedDefault = defaultValue && defaultValue !== "" ? defaultValue : emptyValue;
|
|
45
|
+
return /* @__PURE__ */ jsxs(
|
|
46
|
+
Select,
|
|
47
|
+
{
|
|
48
|
+
name,
|
|
49
|
+
defaultValue: allowEmpty ? resolvedDefault : defaultValue ?? options[0]?.value,
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ jsx(SelectTrigger, { id, className: "w-full", "aria-invalid": invalid, "aria-required": required, children: /* @__PURE__ */ jsx(SelectValue, { placeholder }) }),
|
|
52
|
+
/* @__PURE__ */ jsx(SelectContent, { children: /* @__PURE__ */ jsxs(SelectGroup, { children: [
|
|
53
|
+
allowEmpty && /* @__PURE__ */ jsx(SelectItem, { value: emptyValue, children: emptyLabel }),
|
|
54
|
+
options.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value ?? "", children: /* @__PURE__ */ jsx(CountryOptionLabel, { country: option }) }, option.value))
|
|
55
|
+
] }) })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { CountryOptionLabel, CountrySelect };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { normalizeTreeOptions, formatPathLabels, getNodeByPath, filterTreeOptions, pathsEqual, pathKey } from './chunk-SMLKNECP.js';
|
|
2
|
-
import { Checkbox } from './chunk-
|
|
3
|
-
import { Command, CommandInput } from './chunk-V6UWJKZF.js';
|
|
4
|
-
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
2
|
+
import { Checkbox } from './chunk-O24Z3ULJ.js';
|
|
5
3
|
import { ScrollArea, ScrollBar } from './chunk-3KPEZ5CF.js';
|
|
6
|
-
import {
|
|
4
|
+
import { Command, CommandInput } from './chunk-HTEL5DQI.js';
|
|
5
|
+
import { Popover, PopoverTrigger, PopoverContent } from './chunk-DY5C44UP.js';
|
|
6
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
7
7
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
8
8
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
9
9
|
import * as React from 'react';
|
|
@@ -21,7 +21,7 @@ function Cascader({
|
|
|
21
21
|
options: optionsProp,
|
|
22
22
|
value,
|
|
23
23
|
defaultValue,
|
|
24
|
-
|
|
24
|
+
onValueChange,
|
|
25
25
|
multiple,
|
|
26
26
|
changeOnSelect,
|
|
27
27
|
showSearch,
|
|
@@ -62,14 +62,14 @@ function Cascader({
|
|
|
62
62
|
}, [multiple, multiValue, singleValue, options]);
|
|
63
63
|
const commitSingle = (path) => {
|
|
64
64
|
if (!isControlledSingle) setInternalSingle(path);
|
|
65
|
-
|
|
65
|
+
onValueChange?.(path, getNodeByPath(options, path));
|
|
66
66
|
setOpen(false);
|
|
67
67
|
setActivePath([]);
|
|
68
68
|
setSearch("");
|
|
69
69
|
};
|
|
70
70
|
const commitMulti = (paths) => {
|
|
71
71
|
if (!isControlledMulti) setInternalMulti(paths);
|
|
72
|
-
|
|
72
|
+
onValueChange?.(
|
|
73
73
|
paths,
|
|
74
74
|
paths.map((p) => getNodeByPath(options, p))
|
|
75
75
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Slider } from './chunk-CRERCLIZ.js';
|
|
2
|
-
import { controlIconClass } from './chunk-ICM6XBST.js';
|
|
3
1
|
import { formatBytes } from './chunk-4R7QL3MW.js';
|
|
4
|
-
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from './chunk-
|
|
5
|
-
import {
|
|
2
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from './chunk-P4HFJQID.js';
|
|
3
|
+
import { Slider } from './chunk-CRERCLIZ.js';
|
|
4
|
+
import { Button } from './chunk-M4PZNAMV.js';
|
|
5
|
+
import { controlIconClass } from './chunk-IBK5D2Q6.js';
|
|
6
6
|
import { useTranslation } from './chunk-RLGHEV4A.js';
|
|
7
7
|
import { cn } from './chunk-U7N2A7A3.js';
|
|
8
8
|
import * as React2 from 'react';
|
|
@@ -203,16 +203,16 @@ function fileMatchesAccept(file, accept) {
|
|
|
203
203
|
return file.type === trimmed || file.name.endsWith(trimmed);
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
|
-
function useUploadList(controlled, defaultValue,
|
|
206
|
+
function useUploadList(controlled, defaultValue, onValueChange) {
|
|
207
207
|
const [internal, setInternal] = React2.useState(defaultValue ?? []);
|
|
208
208
|
const items = controlled ?? internal;
|
|
209
209
|
const setItems = React2.useCallback(
|
|
210
210
|
(next) => {
|
|
211
211
|
const resolved = typeof next === "function" ? next(items) : next;
|
|
212
212
|
if (controlled === void 0) setInternal(resolved);
|
|
213
|
-
|
|
213
|
+
onValueChange?.(resolved);
|
|
214
214
|
},
|
|
215
|
-
[controlled, items,
|
|
215
|
+
[controlled, items, onValueChange]
|
|
216
216
|
);
|
|
217
217
|
return [items, setItems];
|
|
218
218
|
}
|
|
@@ -243,7 +243,7 @@ function Upload({
|
|
|
243
243
|
variant = "dropzone",
|
|
244
244
|
value,
|
|
245
245
|
defaultValue,
|
|
246
|
-
|
|
246
|
+
onValueChange,
|
|
247
247
|
accept: acceptProp,
|
|
248
248
|
multiple: multipleProp,
|
|
249
249
|
maxCount: maxCountProp,
|
|
@@ -261,7 +261,7 @@ function Upload({
|
|
|
261
261
|
const inputRef = React2.useRef(null);
|
|
262
262
|
const [dragActive, setDragActive] = React2.useState(false);
|
|
263
263
|
const [cropFile, setCropFile] = React2.useState(null);
|
|
264
|
-
const [items, setItems] = useUploadList(value, defaultValue,
|
|
264
|
+
const [items, setItems] = useUploadList(value, defaultValue, onValueChange);
|
|
265
265
|
const isSingleAvatar = variant === "avatar" || variant === "avatar-crop" || variant === "picture" && maxCount === 1;
|
|
266
266
|
const singleItem = isSingleAvatar ? items[0] ?? null : null;
|
|
267
267
|
const draft = useUploadDraft({
|