@godxjp/ui 18.15.4 → 19.1.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/app-provider.d.ts +1 -1
- package/dist/app/app-provider.js +3 -0
- package/dist/app/date-format-labels.d.ts +1 -1
- package/dist/app/time-format-labels.d.ts +1 -1
- package/dist/components/data-display/badge.d.ts +1 -1
- package/dist/components/data-display/card.d.ts +4 -13
- package/dist/components/data-display/card.js +2 -15
- package/dist/components/data-display/data-table.d.ts +3 -8
- package/dist/components/data-display/data-table.js +106 -68
- package/dist/components/data-display/descriptions.js +34 -5
- package/dist/components/data-display/empty-state.js +1 -1
- package/dist/components/data-display/permission-matrix.js +7 -7
- package/dist/components/data-display/popover.js +2 -9
- package/dist/components/data-display/qr-code.d.ts +1 -1
- package/dist/components/data-display/scroll-area.d.ts +3 -1
- package/dist/components/data-display/scroll-area.js +150 -16
- package/dist/components/data-display/table.js +12 -3
- package/dist/components/data-entry/branch-scope-picker.js +4 -4
- package/dist/components/data-entry/calendar.js +15 -24
- package/dist/components/data-entry/cascader.js +70 -72
- package/dist/components/data-entry/checkbox-group.js +12 -5
- package/dist/components/data-entry/checkbox.js +30 -13
- package/dist/components/data-entry/command.d.ts +6 -6
- package/dist/components/data-entry/date-picker.js +34 -17
- package/dist/components/data-entry/date-range-picker.js +19 -13
- package/dist/components/data-entry/form-field.d.ts +1 -1
- package/dist/components/data-entry/form-field.js +22 -5
- package/dist/components/data-entry/index.d.ts +2 -1
- package/dist/components/data-entry/input.js +18 -22
- package/dist/components/data-entry/label.js +4 -2
- package/dist/components/data-entry/month-picker.js +20 -17
- package/dist/components/data-entry/month-range-picker.js +26 -19
- package/dist/components/data-entry/radio.js +25 -6
- package/dist/components/data-entry/search-select.d.ts +1 -1
- package/dist/components/data-entry/search-select.js +37 -31
- package/dist/components/data-entry/select.d.ts +8 -0
- package/dist/components/data-entry/select.js +68 -26
- package/dist/components/data-entry/switch.js +16 -2
- package/dist/components/data-entry/textarea.d.ts +56 -0
- package/dist/components/data-entry/textarea.js +110 -40
- package/dist/components/data-entry/time-picker.js +52 -52
- package/dist/components/data-entry/toggle-group.d.ts +1 -0
- package/dist/components/data-entry/toggle.d.ts +1 -1
- package/dist/components/data-entry/transfer.js +14 -15
- package/dist/components/data-entry/tree-select.js +19 -23
- package/dist/components/data-entry/upload-crop-dialog.js +4 -4
- package/dist/components/data-entry/upload.d.ts +1 -1
- package/dist/components/data-entry/upload.js +46 -46
- package/dist/components/feedback/alert.js +7 -14
- package/dist/components/feedback/dialog.d.ts +23 -32
- package/dist/components/feedback/dialog.js +16 -13
- package/dist/components/feedback/sheet.d.ts +1 -1
- package/dist/components/feedback/sheet.js +14 -14
- package/dist/components/feedback/skeleton.js +13 -10
- package/dist/components/feedback/sonner.d.ts +1 -1
- package/dist/components/feedback/sonner.js +17 -8
- package/dist/components/feedback/tooltip.js +1 -1
- package/dist/components/general/activity.d.ts +44 -0
- package/dist/components/general/activity.js +65 -0
- package/dist/components/general/button.d.ts +2 -2
- package/dist/components/general/button.js +11 -24
- package/dist/components/general/index.d.ts +2 -0
- package/dist/components/general/index.js +2 -0
- package/dist/components/layout/app-shell.js +5 -3
- package/dist/components/layout/auth-divider.d.ts +9 -2
- package/dist/components/layout/auth-divider.js +7 -11
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/layout/page-container.d.ts +1 -1
- package/dist/components/layout/page-container.js +32 -20
- package/dist/components/layout/resizable.d.ts +12 -12
- package/dist/components/layout/separator.d.ts +1 -0
- package/dist/components/layout/service-role-panel.js +47 -42
- package/dist/components/layout/sidebar.js +13 -1
- package/dist/components/layout/split-pane.d.ts +12 -1
- package/dist/components/layout/split-pane.js +13 -4
- package/dist/components/navigation/app-setting-picker.js +5 -14
- package/dist/components/navigation/dropdown-menu.js +10 -16
- package/dist/components/navigation/menubar.d.ts +3 -6
- package/dist/components/navigation/pagination-utils.d.ts +15 -2
- package/dist/components/navigation/pagination-utils.js +27 -21
- package/dist/components/navigation/pagination.d.ts +4 -4
- package/dist/components/navigation/pagination.js +2 -2
- package/dist/components/navigation/steps.js +31 -67
- package/dist/components/navigation/tabs.js +17 -5
- package/dist/components/query/infinite-query-state.js +2 -2
- package/dist/components/ui/accordion.d.ts +1 -1
- package/dist/components/ui/avatar.d.ts +1 -1
- package/dist/components/ui/avatar.js +29 -10
- package/dist/components/ui/input-otp.d.ts +8 -6
- package/dist/components/ui/rating.js +1 -1
- package/dist/components/ui/separator.d.ts +27 -2
- package/dist/components/ui/separator.js +42 -11
- package/dist/components/ui/toggle-group.d.ts +15 -5
- package/dist/components/ui/toggle-group.js +43 -18
- package/dist/components/ui/toggle.d.ts +66 -5
- package/dist/components/ui/toggle.js +64 -9
- package/dist/i18n/messages/en.json +8 -0
- package/dist/i18n/messages/ja.json +8 -0
- package/dist/i18n/messages/vi.json +8 -0
- package/dist/lib/control-styles.d.ts +14 -0
- package/dist/lib/control-styles.js +2 -0
- package/dist/lib/field-a11y.d.ts +52 -0
- package/dist/lib/field-a11y.js +17 -2
- package/dist/props/components/app.prop.d.ts +15 -0
- package/dist/props/components/data-display.prop.d.ts +85 -3
- package/dist/props/components/data-entry.prop.d.ts +35 -2
- package/dist/props/components/general.prop.d.ts +52 -1
- package/dist/props/components/layout.prop.d.ts +137 -2
- package/dist/props/registry.d.ts +116 -5
- package/dist/props/registry.js +165 -4
- package/dist/props/vocabulary/index.d.ts +2 -2
- package/dist/props/vocabulary/interaction.prop.d.ts +15 -0
- package/dist/props/vocabulary/layout.prop.d.ts +8 -0
- package/dist/styles/alert-layout.css +69 -3
- package/dist/styles/badge-layout.css +2 -2
- package/dist/styles/base.css +6 -0
- package/dist/styles/card-layout.css +25 -8
- package/dist/styles/control.css +1150 -29
- package/dist/styles/data-display-layout.css +185 -11
- package/dist/styles/data-entry-layout.css +352 -1
- package/dist/styles/density.css +2 -2
- package/dist/styles/dialog-layout.css +203 -4
- package/dist/styles/focus-ring.css +155 -0
- package/dist/styles/form-layout.css +50 -5
- package/dist/styles/index.css +1 -0
- package/dist/styles/layout.css +412 -23
- package/dist/styles/motion.css +178 -0
- package/dist/styles/navigation-layout.css +398 -22
- package/dist/styles/shell-layout.css +137 -39
- package/dist/styles/table-layout.css +153 -22
- package/dist/styles/toggle.css +59 -0
- package/dist/tokens/base.css +5 -0
- package/dist/tokens/components/activity.css +64 -0
- package/dist/tokens/components/badge.css +7 -0
- package/dist/tokens/components/card.css +14 -10
- package/dist/tokens/components/chart.css +1 -1
- package/dist/tokens/components/control.css +358 -8
- package/dist/tokens/components/data-display.css +75 -0
- package/dist/tokens/components/data-entry.css +25 -0
- package/dist/tokens/components/descriptions.css +22 -0
- package/dist/tokens/components/feedback.css +143 -4
- package/dist/tokens/components/form.css +16 -0
- package/dist/tokens/components/legal-document.css +5 -1
- package/dist/tokens/components/navigation.css +109 -0
- package/dist/tokens/components/scroll-area.css +21 -0
- package/dist/tokens/components/separator.css +52 -0
- package/dist/tokens/components/shell.css +132 -20
- package/dist/tokens/components/table.css +52 -3
- package/dist/tokens/components/toggle.css +82 -0
- package/dist/tokens/components/upload.css +107 -0
- package/dist/tokens/foundation.css +171 -10
- package/dist/tokens/semantic/layout.css +120 -1
- package/package.json +85 -68
- package/scripts/ui-audit.mjs +51 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { Clock } from "lucide-react";
|
|
4
|
+
import { Clock, X } from "lucide-react";
|
|
5
5
|
import { usePickerLocales, useTranslation } from "../../i18n/use-translation.js";
|
|
6
6
|
import { isValidHhmm, normalizeHhmm } from "../../lib/datetime/index.js";
|
|
7
7
|
import { pickFieldA11y } from "../../lib/field-a11y.js";
|
|
@@ -73,40 +73,28 @@ function TimeColumn({
|
|
|
73
73
|
break;
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
77
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
78
|
-
/* @__PURE__ */ jsx(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
),
|
|
99
|
-
onClick: () => {
|
|
100
|
-
onSelect(item);
|
|
101
|
-
},
|
|
102
|
-
onKeyDown: (e) => onKeyDown(e, index),
|
|
103
|
-
children: formatItem(item)
|
|
104
|
-
},
|
|
105
|
-
item
|
|
106
|
-
);
|
|
107
|
-
})
|
|
108
|
-
}
|
|
109
|
-
)
|
|
76
|
+
return /* @__PURE__ */ jsxs("div", { className: "ui-time-picker-column", children: [
|
|
77
|
+
/* @__PURE__ */ jsx("div", { className: "ui-time-picker-column-heading", children: label }),
|
|
78
|
+
/* @__PURE__ */ jsx("div", { ref: listRef, role: "listbox", "aria-label": label, className: "ui-time-picker-column-scroll", children: items.map((item, index) => {
|
|
79
|
+
const isSelected = item === selected;
|
|
80
|
+
return /* @__PURE__ */ jsx(
|
|
81
|
+
"button",
|
|
82
|
+
{
|
|
83
|
+
type: "button",
|
|
84
|
+
role: "option",
|
|
85
|
+
"aria-selected": isSelected,
|
|
86
|
+
"data-selected": isSelected,
|
|
87
|
+
tabIndex: isSelected ? 0 : -1,
|
|
88
|
+
className: "ui-time-picker-option",
|
|
89
|
+
onClick: () => {
|
|
90
|
+
onSelect(item);
|
|
91
|
+
},
|
|
92
|
+
onKeyDown: (e) => onKeyDown(e, index),
|
|
93
|
+
children: formatItem(item)
|
|
94
|
+
},
|
|
95
|
+
item
|
|
96
|
+
);
|
|
97
|
+
}) })
|
|
110
98
|
] });
|
|
111
99
|
}
|
|
112
100
|
function TimePickerPanel({ value, minuteStep, use12h, onChange, onDone }) {
|
|
@@ -132,7 +120,7 @@ function TimePickerPanel({ value, minuteStep, use12h, onChange, onDone }) {
|
|
|
132
120
|
};
|
|
133
121
|
const hourItems = use12h ? Array.from({ length: 12 }, (_, i) => i + 1) : Array.from({ length: 24 }, (_, i) => i);
|
|
134
122
|
const selectedHourItem = use12h ? to12h(hour) : hour;
|
|
135
|
-
return /* @__PURE__ */ jsxs("div", { className: use12h ? "
|
|
123
|
+
return /* @__PURE__ */ jsxs("div", { className: "ui-time-picker-panel", "data-hour-cycle": use12h ? "h12" : "h23", children: [
|
|
136
124
|
/* @__PURE__ */ jsxs("div", { className: "divide-border flex divide-x", children: [
|
|
137
125
|
/* @__PURE__ */ jsx(
|
|
138
126
|
TimeColumn,
|
|
@@ -174,7 +162,7 @@ function TimePickerPanel({ value, minuteStep, use12h, onChange, onDone }) {
|
|
|
174
162
|
}
|
|
175
163
|
)
|
|
176
164
|
] }),
|
|
177
|
-
/* @__PURE__ */ jsx("div", { className: "
|
|
165
|
+
/* @__PURE__ */ jsx("div", { className: "ui-time-picker-footer", children: /* @__PURE__ */ jsx(
|
|
178
166
|
Input,
|
|
179
167
|
{
|
|
180
168
|
id: draftId,
|
|
@@ -237,6 +225,7 @@ function TimePicker({
|
|
|
237
225
|
setValue("");
|
|
238
226
|
setText("");
|
|
239
227
|
};
|
|
228
|
+
const showClear = allowClear && text !== "" && !disabled;
|
|
240
229
|
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
241
230
|
/* @__PURE__ */ jsx(PopoverAnchor, { asChild: true, children: /* @__PURE__ */ jsx("div", { className: cn("relative", className), children: /* @__PURE__ */ jsx(
|
|
242
231
|
Input,
|
|
@@ -253,20 +242,31 @@ function TimePicker({
|
|
|
253
242
|
"aria-haspopup": "dialog",
|
|
254
243
|
"aria-controls": open ? dialogId : void 0,
|
|
255
244
|
...fieldA11y,
|
|
256
|
-
className: "tabular-nums",
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
245
|
+
className: cn("tabular-nums", showClear && "ui-control-inline-affix-pair-affixed"),
|
|
246
|
+
trailingIcon: /* @__PURE__ */ jsxs("span", { className: "ui-time-picker-affix", children: [
|
|
247
|
+
showClear ? /* @__PURE__ */ jsx(
|
|
248
|
+
"button",
|
|
249
|
+
{
|
|
250
|
+
type: "button",
|
|
251
|
+
tabIndex: -1,
|
|
252
|
+
"aria-label": t("common.clear") ?? "Clear",
|
|
253
|
+
onClick: clear,
|
|
254
|
+
className: "ui-control-inline-affix-action",
|
|
255
|
+
children: /* @__PURE__ */ jsx(X, { className: "ui-control-inline-affix-icon", "aria-hidden": "true" })
|
|
256
|
+
}
|
|
257
|
+
) : null,
|
|
258
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
259
|
+
"button",
|
|
260
|
+
{
|
|
261
|
+
type: "button",
|
|
262
|
+
disabled,
|
|
263
|
+
tabIndex: -1,
|
|
264
|
+
"aria-label": t("dataEntry.timePicker.openPicker") ?? "Open time picker",
|
|
265
|
+
className: "ui-control-inline-affix-action",
|
|
266
|
+
children: /* @__PURE__ */ jsx(Clock, { className: "ui-control-inline-affix-icon", "aria-hidden": "true" })
|
|
267
|
+
}
|
|
268
|
+
) })
|
|
269
|
+
] }),
|
|
270
270
|
onClick: () => {
|
|
271
271
|
if (!disabled) setOpen(true);
|
|
272
272
|
},
|
|
@@ -295,7 +295,7 @@ function TimePicker({
|
|
|
295
295
|
id: dialogId,
|
|
296
296
|
role: "dialog",
|
|
297
297
|
"aria-label": t("dataEntry.timePicker.openPicker") ?? "Time picker",
|
|
298
|
-
className: "
|
|
298
|
+
className: "ui-time-picker-popover",
|
|
299
299
|
align: "end",
|
|
300
300
|
onOpenAutoFocus: (event) => event.preventDefault(),
|
|
301
301
|
children: /* @__PURE__ */ jsx(
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Toggle } from "../ui/toggle.js";
|
|
2
|
-
export type { ToggleProps } from "../ui/toggle.js";
|
|
2
|
+
export type { ToggleProp, ToggleProps } from "../ui/toggle.js";
|
|
@@ -40,9 +40,9 @@ function TransferPanel({
|
|
|
40
40
|
const toggleKey = (key, checked) => {
|
|
41
41
|
onSelectChange(checked ? [...selectedKeys, key] : selectedKeys.filter((k) => k !== key));
|
|
42
42
|
};
|
|
43
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
44
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
45
|
-
/* @__PURE__ */ jsxs("label", { className: "
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { className: "ui-transfer-pane", children: [
|
|
44
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-transfer-pane-header", children: [
|
|
45
|
+
/* @__PURE__ */ jsxs("label", { className: "ui-transfer-pane-check", children: [
|
|
46
46
|
/* @__PURE__ */ jsx(
|
|
47
47
|
Checkbox,
|
|
48
48
|
{
|
|
@@ -60,21 +60,20 @@ function TransferPanel({
|
|
|
60
60
|
filtered.length
|
|
61
61
|
] })
|
|
62
62
|
] }),
|
|
63
|
-
showSearch && /* @__PURE__ */ jsx("div", { className: "
|
|
63
|
+
showSearch && /* @__PURE__ */ jsx("div", { className: "ui-transfer-search", "data-disabled": disabled ? "" : void 0, children: /* @__PURE__ */ jsx(
|
|
64
64
|
SearchInput,
|
|
65
65
|
{
|
|
66
66
|
onSearch: setQuery,
|
|
67
67
|
placeholder: searchPlaceholder,
|
|
68
68
|
ariaLabel: searchPlaceholder,
|
|
69
|
-
debounce: 0
|
|
70
|
-
className: disabled ? "pointer-events-none opacity-50" : void 0
|
|
69
|
+
debounce: 0
|
|
71
70
|
}
|
|
72
71
|
) }),
|
|
73
|
-
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx("ul", { className: "
|
|
72
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx("ul", { className: "ui-transfer-list", "aria-labelledby": titleId, children: filtered.length === 0 ? /* @__PURE__ */ jsx("li", { className: "ui-transfer-empty", children: emptyText }) : filtered.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
74
73
|
"label",
|
|
75
74
|
{
|
|
76
75
|
className: cn(
|
|
77
|
-
"
|
|
76
|
+
"ui-transfer-row",
|
|
78
77
|
"hover:bg-accent hover:text-accent-foreground",
|
|
79
78
|
item.disabled && "bg-muted/40 text-muted-foreground pointer-events-none"
|
|
80
79
|
),
|
|
@@ -85,12 +84,12 @@ function TransferPanel({
|
|
|
85
84
|
checked: selectedKeys.includes(item.key),
|
|
86
85
|
disabled: Boolean(disabled) || Boolean(item.disabled),
|
|
87
86
|
onCheckedChange: (v) => toggleKey(item.key, v === true),
|
|
88
|
-
className: "
|
|
87
|
+
className: "ui-transfer-row-check"
|
|
89
88
|
}
|
|
90
89
|
),
|
|
91
|
-
/* @__PURE__ */ jsxs("span", { className: "
|
|
90
|
+
/* @__PURE__ */ jsxs("span", { className: "ui-transfer-row-body", children: [
|
|
92
91
|
/* @__PURE__ */ jsx("span", { className: "block truncate font-medium", children: item.title }),
|
|
93
|
-
item.description && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground block truncate
|
|
92
|
+
item.description && /* @__PURE__ */ jsx("span", { className: "ui-transfer-row-description text-muted-foreground block truncate", children: item.description })
|
|
94
93
|
] })
|
|
95
94
|
]
|
|
96
95
|
}
|
|
@@ -141,7 +140,7 @@ function Transfer({
|
|
|
141
140
|
id,
|
|
142
141
|
...groupA11y,
|
|
143
142
|
"aria-disabled": disabled ? true : void 0,
|
|
144
|
-
className: cn("
|
|
143
|
+
className: cn("ui-transfer", className),
|
|
145
144
|
children: [
|
|
146
145
|
/* @__PURE__ */ jsx(
|
|
147
146
|
TransferPanel,
|
|
@@ -158,7 +157,7 @@ function Transfer({
|
|
|
158
157
|
emptyText: t("dataEntry.transfer.empty")
|
|
159
158
|
}
|
|
160
159
|
),
|
|
161
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
160
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-transfer-actions", children: [
|
|
162
161
|
/* @__PURE__ */ jsx(
|
|
163
162
|
Button,
|
|
164
163
|
{
|
|
@@ -168,7 +167,7 @@ function Transfer({
|
|
|
168
167
|
disabled: Boolean(disabled) || selected[0].length === 0,
|
|
169
168
|
"aria-label": t("dataEntry.transfer.moveRight"),
|
|
170
169
|
onClick: () => move("right"),
|
|
171
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "
|
|
170
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "ui-transfer-action-icon", "aria-hidden": "true" })
|
|
172
171
|
}
|
|
173
172
|
),
|
|
174
173
|
!oneWay && /* @__PURE__ */ jsx(
|
|
@@ -180,7 +179,7 @@ function Transfer({
|
|
|
180
179
|
disabled: Boolean(disabled) || selected[1].length === 0,
|
|
181
180
|
"aria-label": t("dataEntry.transfer.moveLeft"),
|
|
182
181
|
onClick: () => move("left"),
|
|
183
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "
|
|
182
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "ui-transfer-action-icon", "aria-hidden": "true" })
|
|
184
183
|
}
|
|
185
184
|
)
|
|
186
185
|
] }),
|
|
@@ -4,7 +4,7 @@ import * as React from "react";
|
|
|
4
4
|
import { ChevronDown, ChevronRight, ChevronsUpDown, X } from "lucide-react";
|
|
5
5
|
import { useTranslation } from "../../i18n/use-translation.js";
|
|
6
6
|
import { cn } from "../../lib/utils.js";
|
|
7
|
-
import { pickFieldA11y } from "../../lib/field-a11y.js";
|
|
7
|
+
import { pickFieldA11y, useFieldIdentity } from "../../lib/field-a11y.js";
|
|
8
8
|
import { controlOpenRingClass } from "../../lib/control-styles.js";
|
|
9
9
|
import { Button } from "../general/button.js";
|
|
10
10
|
import { Popover, PopoverContent, PopoverTrigger } from "../data-display/popover.js";
|
|
@@ -63,6 +63,7 @@ function TreeSelectRoot({
|
|
|
63
63
|
}) {
|
|
64
64
|
const { t } = useTranslation();
|
|
65
65
|
const fieldA11y = pickFieldA11y(ariaProps);
|
|
66
|
+
const identity = useFieldIdentity({ id, "data-field": fieldA11y["data-field"] });
|
|
66
67
|
const reactId = React.useId();
|
|
67
68
|
const treeId = `${id ?? reactId}-tree`;
|
|
68
69
|
const options = React.useMemo(
|
|
@@ -179,6 +180,7 @@ function TreeSelectRoot({
|
|
|
179
180
|
Button,
|
|
180
181
|
{
|
|
181
182
|
id,
|
|
183
|
+
"data-field": fieldA11y["data-field"] ?? identity["data-field"],
|
|
182
184
|
type: "button",
|
|
183
185
|
variant: "outline",
|
|
184
186
|
role: "combobox",
|
|
@@ -189,14 +191,14 @@ function TreeSelectRoot({
|
|
|
189
191
|
disabled,
|
|
190
192
|
className: cn(
|
|
191
193
|
"w-full justify-between font-normal",
|
|
192
|
-
allowClear && displayKeys.length > 0 && !disabled && "
|
|
194
|
+
allowClear && displayKeys.length > 0 && !disabled && "ui-tree-select-trigger-affixed",
|
|
193
195
|
controlOpenRingClass,
|
|
194
196
|
!displayKeys.length && "text-muted-foreground",
|
|
195
197
|
className
|
|
196
198
|
),
|
|
197
199
|
children: [
|
|
198
200
|
/* @__PURE__ */ jsx("span", { className: "truncate", children: displayKeys.length ? displayLabel : resolvedPlaceholder }),
|
|
199
|
-
/* @__PURE__ */ jsx("span", { className: "ms-2 flex shrink-0 items-center", children: !(allowClear && displayKeys.length > 0 && !disabled) && /* @__PURE__ */ jsx(ChevronsUpDown, { className: "
|
|
201
|
+
/* @__PURE__ */ jsx("span", { className: "ms-2 flex shrink-0 items-center", children: !(allowClear && displayKeys.length > 0 && !disabled) && /* @__PURE__ */ jsx(ChevronsUpDown, { className: "ui-tree-select-chevron", "aria-hidden": "true" }) })
|
|
200
202
|
]
|
|
201
203
|
}
|
|
202
204
|
) }),
|
|
@@ -205,13 +207,13 @@ function TreeSelectRoot({
|
|
|
205
207
|
{
|
|
206
208
|
type: "button",
|
|
207
209
|
"aria-label": t("dataEntry.treeSelect.clear"),
|
|
208
|
-
className: "
|
|
210
|
+
className: "ui-tree-select-clear",
|
|
209
211
|
onClick: clearValue,
|
|
210
|
-
children: /* @__PURE__ */ jsx(X, { className: "
|
|
212
|
+
children: /* @__PURE__ */ jsx(X, { className: "ui-control-affix-icon", "aria-hidden": "true" })
|
|
211
213
|
}
|
|
212
214
|
)
|
|
213
215
|
] }),
|
|
214
|
-
/* @__PURE__ */ jsxs(PopoverContent, { className: "
|
|
216
|
+
/* @__PURE__ */ jsxs(PopoverContent, { className: "ui-tree-select-popover", align: "start", children: [
|
|
215
217
|
showSearch && /* @__PURE__ */ jsx(Command, { shouldFilter: false, children: /* @__PURE__ */ jsx(
|
|
216
218
|
CommandInput,
|
|
217
219
|
{
|
|
@@ -220,14 +222,14 @@ function TreeSelectRoot({
|
|
|
220
222
|
onValueChange: setSearch
|
|
221
223
|
}
|
|
222
224
|
) }),
|
|
223
|
-
/* @__PURE__ */ jsx(ScrollArea, { className: "
|
|
225
|
+
/* @__PURE__ */ jsx(ScrollArea, { className: "ui-tree-select-list", children: /* @__PURE__ */ jsx(
|
|
224
226
|
"div",
|
|
225
227
|
{
|
|
226
228
|
id: treeId,
|
|
227
229
|
role: "tree",
|
|
228
230
|
"aria-multiselectable": Boolean(checkable) || Boolean(multiple),
|
|
229
|
-
className: "
|
|
230
|
-
children: visible.length === 0 ? /* @__PURE__ */ jsx("p", { className: "
|
|
231
|
+
className: "ui-tree-select-panel",
|
|
232
|
+
children: visible.length === 0 ? /* @__PURE__ */ jsx("p", { className: "ui-tree-select-empty", children: t("dataEntry.treeSelect.empty") }) : visible.map(({ node, depth, hasChildren }) => {
|
|
231
233
|
const expanded = expandedKeys.has(node.value);
|
|
232
234
|
const isSelected = selected.includes(node.value);
|
|
233
235
|
return /* @__PURE__ */ jsxs(
|
|
@@ -242,14 +244,10 @@ function TreeSelectRoot({
|
|
|
242
244
|
"aria-selected": isSelected,
|
|
243
245
|
onFocus: () => setActiveKey(node.value),
|
|
244
246
|
onKeyDown: (event) => onTreeItemKeyDown(event, node, hasChildren, expanded),
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
isSelected && "bg-accent/60",
|
|
250
|
-
node.disabled && "pointer-events-none opacity-50"
|
|
251
|
-
),
|
|
252
|
-
style: { paddingInlineStart: `${depth * 1.25 + 0.5}rem` },
|
|
247
|
+
"data-selected": isSelected ? "true" : "false",
|
|
248
|
+
"data-disabled": node.disabled ? "" : void 0,
|
|
249
|
+
className: "ui-tree-select-row ui-focus-ring",
|
|
250
|
+
style: { "--tree-select-depth": depth },
|
|
253
251
|
children: [
|
|
254
252
|
/* @__PURE__ */ jsx(
|
|
255
253
|
"button",
|
|
@@ -257,15 +255,13 @@ function TreeSelectRoot({
|
|
|
257
255
|
type: "button",
|
|
258
256
|
tabIndex: -1,
|
|
259
257
|
"aria-label": expanded ? t("dataEntry.treeSelect.collapse") : t("dataEntry.treeSelect.expand"),
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
!hasChildren && "invisible"
|
|
263
|
-
),
|
|
258
|
+
"data-leaf": hasChildren ? void 0 : "",
|
|
259
|
+
className: "ui-tree-select-toggle",
|
|
264
260
|
onClick: () => toggleExpand(node.value),
|
|
265
|
-
children: expanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "
|
|
261
|
+
children: expanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "ui-tree-select-toggle-icon", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "ui-tree-select-toggle-icon", "aria-hidden": "true" })
|
|
266
262
|
}
|
|
267
263
|
),
|
|
268
|
-
checkable ? /* @__PURE__ */ jsxs("label", { className: "
|
|
264
|
+
checkable ? /* @__PURE__ */ jsxs("label", { className: "ui-tree-select-label", children: [
|
|
269
265
|
/* @__PURE__ */ jsx(
|
|
270
266
|
Checkbox,
|
|
271
267
|
{
|
|
@@ -52,7 +52,7 @@ function UploadCropDialog({ open, onOpenChange, file, onConfirm }) {
|
|
|
52
52
|
onConfirm(cropped);
|
|
53
53
|
onOpenChange(false);
|
|
54
54
|
};
|
|
55
|
-
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-
|
|
55
|
+
return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "max-w-[var(--upload-crop-dialog-max-width)]", children: [
|
|
56
56
|
/* @__PURE__ */ jsxs(DialogHeader, { children: [
|
|
57
57
|
/* @__PURE__ */ jsx(DialogTitle, { children: t("dataEntry.upload.cropTitle") }),
|
|
58
58
|
/* @__PURE__ */ jsx(DialogDescription, { children: t("dataEntry.upload.cropDescription") })
|
|
@@ -62,7 +62,7 @@ function UploadCropDialog({ open, onOpenChange, file, onConfirm }) {
|
|
|
62
62
|
"div",
|
|
63
63
|
{
|
|
64
64
|
className: cn(
|
|
65
|
-
"bg-muted relative mx-auto size-
|
|
65
|
+
"bg-muted relative mx-auto size-[var(--upload-crop-preview-size)] overflow-hidden rounded-[var(--upload-crop-preview-radius)] border",
|
|
66
66
|
"flex items-center justify-center"
|
|
67
67
|
),
|
|
68
68
|
children: src ? /* @__PURE__ */ jsx(
|
|
@@ -71,13 +71,13 @@ function UploadCropDialog({ open, onOpenChange, file, onConfirm }) {
|
|
|
71
71
|
ref: imgRef,
|
|
72
72
|
src,
|
|
73
73
|
alt: "",
|
|
74
|
-
className: "size-full object-cover transition-transform duration-
|
|
74
|
+
className: "size-full object-cover transition-transform duration-[var(--duration-fast)]",
|
|
75
75
|
style: { transform: `scale(${scale})` }
|
|
76
76
|
}
|
|
77
77
|
) : null
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
|
-
/* @__PURE__ */ jsxs("div", { className: "ui-stack-xs px-
|
|
80
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-stack-xs px-[var(--upload-crop-zoom-space-inline)]", children: [
|
|
81
81
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground text-xs", children: t("dataEntry.upload.cropZoom") }),
|
|
82
82
|
/* @__PURE__ */ jsx(
|
|
83
83
|
Slider,
|
|
@@ -4,4 +4,4 @@ export type { UploadProp, UploadProp as UploadProps, UploadFileItemProp, UploadV
|
|
|
4
4
|
export type { UploadFileItem, UploadVariant, UploadCommitAction } from "./upload-types.js";
|
|
5
5
|
export { collectUploadCommitActions, createUploadItem } from "./upload-types.js";
|
|
6
6
|
export { useUploadDraft } from "./use-upload-draft.js";
|
|
7
|
-
export declare function Upload({ variant, triggerSize, value, defaultValue, onValueChange, accept: acceptProp, multiple: multipleProp, maxCount: maxCountProp, maxSizeBytes, disabled, removable, onUpload, id, className, children, ...ariaProps }: UploadProp): React.JSX.Element;
|
|
7
|
+
export declare function Upload({ variant, triggerSize, triggerVariant, value, defaultValue, onValueChange, accept: acceptProp, multiple: multipleProp, maxCount: maxCountProp, maxSizeBytes, disabled, removable, onUpload, id, className, children, ...ariaProps }: UploadProp): React.JSX.Element;
|
|
@@ -76,6 +76,7 @@ async function runUpload(file, item, onUpload, setItems) {
|
|
|
76
76
|
function Upload({
|
|
77
77
|
variant = "dropzone",
|
|
78
78
|
triggerSize,
|
|
79
|
+
triggerVariant = "outline",
|
|
79
80
|
value,
|
|
80
81
|
defaultValue,
|
|
81
82
|
onValueChange,
|
|
@@ -197,15 +198,13 @@ function Upload({
|
|
|
197
198
|
setDragActive(false);
|
|
198
199
|
pickFiles(e.dataTransfer.files);
|
|
199
200
|
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
disabled && "pointer-events-none opacity-50"
|
|
204
|
-
),
|
|
201
|
+
"data-drag-active": dragActive ? "" : void 0,
|
|
202
|
+
"data-disabled": disabled ? "" : void 0,
|
|
203
|
+
className: "ui-upload-dropzone",
|
|
205
204
|
children: [
|
|
206
|
-
/* @__PURE__ */ jsx(UploadIcon, { className: "
|
|
207
|
-
/* @__PURE__ */ jsx("p", { className: "
|
|
208
|
-
/* @__PURE__ */ jsx("p", { className: "
|
|
205
|
+
/* @__PURE__ */ jsx(UploadIcon, { className: "ui-upload-dropzone-icon", "aria-hidden": "true" }),
|
|
206
|
+
/* @__PURE__ */ jsx("p", { className: "ui-upload-dropzone-hint", children: t("dataEntry.upload.dropzoneHint") }),
|
|
207
|
+
/* @__PURE__ */ jsx("p", { className: "ui-upload-dropzone-meta", children: t("dataEntry.upload.dropzoneMeta") })
|
|
209
208
|
]
|
|
210
209
|
}
|
|
211
210
|
),
|
|
@@ -222,13 +221,20 @@ function Upload({
|
|
|
222
221
|
Button,
|
|
223
222
|
{
|
|
224
223
|
type: "button",
|
|
225
|
-
variant:
|
|
224
|
+
variant: triggerVariant,
|
|
226
225
|
size: triggerSize,
|
|
227
226
|
disabled,
|
|
228
227
|
onClick: openPicker,
|
|
229
228
|
"aria-label": iconOnly ? typeof label === "string" ? label : void 0 : void 0,
|
|
230
229
|
children: [
|
|
231
|
-
/* @__PURE__ */ jsx(
|
|
230
|
+
/* @__PURE__ */ jsx(
|
|
231
|
+
UploadIcon,
|
|
232
|
+
{
|
|
233
|
+
className: "ui-upload-trigger-icon",
|
|
234
|
+
"data-with-label": iconOnly ? void 0 : "",
|
|
235
|
+
"aria-hidden": "true"
|
|
236
|
+
}
|
|
237
|
+
),
|
|
232
238
|
iconOnly ? null : label
|
|
233
239
|
]
|
|
234
240
|
}
|
|
@@ -238,7 +244,7 @@ function Upload({
|
|
|
238
244
|
}
|
|
239
245
|
if (variant === "picture-card") {
|
|
240
246
|
const canAdd = maxCount == null || items.length < maxCount;
|
|
241
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("
|
|
247
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ui-upload-grid", className), children: [
|
|
242
248
|
hiddenInput,
|
|
243
249
|
liveRegion,
|
|
244
250
|
items.map((item2) => /* @__PURE__ */ jsx(
|
|
@@ -255,15 +261,12 @@ function Upload({
|
|
|
255
261
|
type: "button",
|
|
256
262
|
disabled,
|
|
257
263
|
onClick: openPicker,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
"text-muted-foreground hover:border-primary hover:text-primary transition-colors",
|
|
261
|
-
disabled && "pointer-events-none opacity-50"
|
|
262
|
-
),
|
|
264
|
+
"data-disabled": disabled ? "" : void 0,
|
|
265
|
+
className: "ui-upload-tile-add",
|
|
263
266
|
"aria-label": t("dataEntry.upload.addImage"),
|
|
264
267
|
children: [
|
|
265
|
-
/* @__PURE__ */ jsx(ImagePlus, { className: "
|
|
266
|
-
/* @__PURE__ */ jsx("span", { className: "
|
|
268
|
+
/* @__PURE__ */ jsx(ImagePlus, { className: "ui-upload-tile-add-icon", "aria-hidden": "true" }),
|
|
269
|
+
/* @__PURE__ */ jsx("span", { className: "ui-upload-tile-add-label", children: t("dataEntry.upload.addImage") })
|
|
267
270
|
]
|
|
268
271
|
}
|
|
269
272
|
)
|
|
@@ -271,23 +274,23 @@ function Upload({
|
|
|
271
274
|
}
|
|
272
275
|
if (variant === "picture") {
|
|
273
276
|
const item2 = draft.state.display;
|
|
274
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("ui-stack-sm
|
|
277
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("ui-stack-sm ui-upload-picture", className), children: [
|
|
275
278
|
hiddenInput,
|
|
276
279
|
liveRegion,
|
|
277
|
-
item2?.previewUrl && !item2.pendingDelete ? /* @__PURE__ */ jsxs("div", { className: "
|
|
278
|
-
/* @__PURE__ */ jsx("img", { src: item2.previewUrl, alt: "", className: "
|
|
279
|
-
item2.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "
|
|
280
|
-
item2.pendingReplace && /* @__PURE__ */ jsx("div", { className: "
|
|
280
|
+
item2?.previewUrl && !item2.pendingDelete ? /* @__PURE__ */ jsxs("div", { className: "ui-upload-picture-frame", children: [
|
|
281
|
+
/* @__PURE__ */ jsx("img", { src: item2.previewUrl, alt: "", className: "ui-upload-picture-img" }),
|
|
282
|
+
item2.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "ui-upload-overlay ui-upload-picture-overlay", children: t("dataEntry.upload.uploading") }),
|
|
283
|
+
item2.pendingReplace && /* @__PURE__ */ jsx("div", { className: "ui-upload-picture-badge", children: t("dataEntry.upload.pendingReplace") })
|
|
281
284
|
] }) : /* @__PURE__ */ jsxs(
|
|
282
285
|
"button",
|
|
283
286
|
{
|
|
284
287
|
type: "button",
|
|
285
288
|
disabled,
|
|
286
289
|
onClick: openPicker,
|
|
287
|
-
className: "
|
|
290
|
+
className: "ui-upload-picture-empty",
|
|
288
291
|
children: [
|
|
289
292
|
/* @__PURE__ */ jsx(ImagePlus, { className: controlIconClass, "aria-hidden": "true" }),
|
|
290
|
-
/* @__PURE__ */ jsx("span", { className: "
|
|
293
|
+
/* @__PURE__ */ jsx("span", { className: "ui-upload-picture-empty-label", children: t("dataEntry.upload.addImage") })
|
|
291
294
|
]
|
|
292
295
|
}
|
|
293
296
|
),
|
|
@@ -324,16 +327,13 @@ function Upload({
|
|
|
324
327
|
type: "button",
|
|
325
328
|
disabled,
|
|
326
329
|
onClick: openPicker,
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
item?.pendingDelete && "opacity-40",
|
|
331
|
-
disabled && "pointer-events-none opacity-50"
|
|
332
|
-
),
|
|
330
|
+
"data-pending-delete": item?.pendingDelete ? "" : void 0,
|
|
331
|
+
"data-disabled": disabled ? "" : void 0,
|
|
332
|
+
className: "ui-upload-avatar ui-focus-ring",
|
|
333
333
|
"aria-label": t("dataEntry.upload.avatarLabel"),
|
|
334
334
|
children: [
|
|
335
|
-
!showPlaceholder && item?.previewUrl ? /* @__PURE__ */ jsx("img", { src: item.previewUrl, alt: "", className: "
|
|
336
|
-
!disabled && /* @__PURE__ */ jsx("span", { className: "
|
|
335
|
+
!showPlaceholder && item?.previewUrl ? /* @__PURE__ */ jsx("img", { src: item.previewUrl, alt: "", className: "ui-upload-avatar-image" }) : /* @__PURE__ */ jsx("span", { className: "ui-upload-avatar-placeholder", children: /* @__PURE__ */ jsx(Camera, { className: controlIconClass, "aria-hidden": "true" }) }),
|
|
336
|
+
!disabled && /* @__PURE__ */ jsx("span", { className: "ui-upload-avatar-change", children: t("dataEntry.upload.change") })
|
|
337
337
|
]
|
|
338
338
|
}
|
|
339
339
|
),
|
|
@@ -343,9 +343,9 @@ function Upload({
|
|
|
343
343
|
type: "button",
|
|
344
344
|
disabled,
|
|
345
345
|
onClick: () => draft.markRemove(),
|
|
346
|
-
className: "
|
|
346
|
+
className: "ui-upload-avatar-remove",
|
|
347
347
|
"aria-label": t("dataEntry.upload.removeAvatar"),
|
|
348
|
-
children: /* @__PURE__ */ jsx(Trash2, { className: "
|
|
348
|
+
children: /* @__PURE__ */ jsx(Trash2, { className: "ui-upload-remove-icon", "aria-hidden": "true" })
|
|
349
349
|
}
|
|
350
350
|
)
|
|
351
351
|
] }),
|
|
@@ -360,16 +360,16 @@ function UploadDraftActions({
|
|
|
360
360
|
const { t } = useTranslation();
|
|
361
361
|
const { state, undoRemove, undoReplace } = draft;
|
|
362
362
|
if (state.canUndoRemove) {
|
|
363
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
363
|
+
return /* @__PURE__ */ jsxs("div", { className: "ui-upload-draft-undo", children: [
|
|
364
364
|
/* @__PURE__ */ jsx("span", { className: "text-destructive", children: t("dataEntry.upload.markedForDelete") }),
|
|
365
365
|
/* @__PURE__ */ jsxs(Button, { type: "button", size: "sm", variant: "outline", disabled, onClick: undoRemove, children: [
|
|
366
|
-
/* @__PURE__ */ jsx(RotateCcw, { className: "
|
|
366
|
+
/* @__PURE__ */ jsx(RotateCcw, { className: "ui-upload-draft-icon", "aria-hidden": "true" }),
|
|
367
367
|
t("dataEntry.upload.undo")
|
|
368
368
|
] })
|
|
369
369
|
] });
|
|
370
370
|
}
|
|
371
371
|
if (state.canUndoReplace) {
|
|
372
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
372
|
+
return /* @__PURE__ */ jsxs("div", { className: "ui-upload-draft-hint", children: [
|
|
373
373
|
/* @__PURE__ */ jsx("span", { children: t("dataEntry.upload.pendingReplaceHint") }),
|
|
374
374
|
/* @__PURE__ */ jsx(Button, { type: "button", size: "sm", variant: "ghost", disabled, onClick: undoReplace, children: t("dataEntry.upload.undo") }),
|
|
375
375
|
/* @__PURE__ */ jsx(Button, { type: "button", size: "sm", variant: "outline", disabled, onClick: onPick, children: t("dataEntry.upload.change") })
|
|
@@ -379,17 +379,17 @@ function UploadDraftActions({
|
|
|
379
379
|
}
|
|
380
380
|
function UploadPictureCard({ item, onRemove }) {
|
|
381
381
|
const { t } = useTranslation();
|
|
382
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
383
|
-
item.previewUrl ? /* @__PURE__ */ jsx("img", { src: item.previewUrl, alt: "", className: "
|
|
384
|
-
item.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "
|
|
382
|
+
return /* @__PURE__ */ jsxs("div", { className: "ui-upload-tile", children: [
|
|
383
|
+
item.previewUrl ? /* @__PURE__ */ jsx("img", { src: item.previewUrl, alt: "", className: "ui-upload-avatar-image" }) : /* @__PURE__ */ jsx("div", { className: "ui-upload-tile-placeholder", children: "\u2026" }),
|
|
384
|
+
item.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "ui-upload-overlay", children: "\u2026" }),
|
|
385
385
|
onRemove && /* @__PURE__ */ jsx(
|
|
386
386
|
"button",
|
|
387
387
|
{
|
|
388
388
|
type: "button",
|
|
389
389
|
onClick: onRemove,
|
|
390
|
-
className: "
|
|
390
|
+
className: "ui-upload-tile-remove",
|
|
391
391
|
"aria-label": t("dataEntry.upload.removeImage"),
|
|
392
|
-
children: /* @__PURE__ */ jsx(X, { className: "
|
|
392
|
+
children: /* @__PURE__ */ jsx(X, { className: "ui-upload-remove-icon", "aria-hidden": "true" })
|
|
393
393
|
}
|
|
394
394
|
)
|
|
395
395
|
] });
|
|
@@ -399,8 +399,8 @@ function UploadFileList({
|
|
|
399
399
|
onRemove
|
|
400
400
|
}) {
|
|
401
401
|
const { t } = useTranslation();
|
|
402
|
-
return /* @__PURE__ */ jsx("ul", { className: "ui-stack-xs", children: items.map((item) => /* @__PURE__ */ jsxs("li", { className: "
|
|
403
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
402
|
+
return /* @__PURE__ */ jsx("ul", { className: "ui-stack-xs", children: items.map((item) => /* @__PURE__ */ jsxs("li", { className: "ui-upload-row", children: [
|
|
403
|
+
/* @__PURE__ */ jsxs("div", { className: "ui-upload-row-main", children: [
|
|
404
404
|
/* @__PURE__ */ jsx("div", { className: "truncate font-medium", children: item.name }),
|
|
405
405
|
/* @__PURE__ */ jsxs("div", { className: "text-muted-foreground text-xs", children: [
|
|
406
406
|
formatBytes(item.size),
|
|
@@ -424,7 +424,7 @@ function UploadFileList({
|
|
|
424
424
|
variant: "ghost",
|
|
425
425
|
"aria-label": t("dataEntry.upload.removeFile", { name: item.name }),
|
|
426
426
|
onClick: () => onRemove(item.uid),
|
|
427
|
-
children: /* @__PURE__ */ jsx(X, { className: "
|
|
427
|
+
children: /* @__PURE__ */ jsx(X, { className: "ui-upload-row-icon", "aria-hidden": "true" })
|
|
428
428
|
}
|
|
429
429
|
)
|
|
430
430
|
] }, item.uid)) });
|