@pactor-app/ui 1.3.0 → 1.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.
- package/dist/{chunk-P54Y23AP.js → chunk-7YOIAVV6.js} +587 -282
- package/dist/{chunk-EVGIS2ZE.js → chunk-PECP7DJB.js} +120 -7
- package/dist/{chunk-TDVG7MZ5.js → chunk-TAJXMOEX.js} +2 -2
- package/dist/{chunk-L4Z7MNYY.js → chunk-VM4FESQB.js} +16 -2
- package/dist/{chunk-UKA7C3JP.js → chunk-XUIXZJDQ.js} +4 -4
- package/dist/components/index.cjs +1024 -605
- package/dist/components/index.d.cts +91 -5
- package/dist/components/index.d.ts +91 -5
- package/dist/components/index.js +6 -4
- package/dist/index.cjs +1177 -758
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -5
- package/dist/layout/index.cjs +138 -12
- package/dist/layout/index.js +3 -3
- package/dist/{typography-DsGdDBc2.d.cts → typography-BYDh5oku.d.cts} +14 -1
- package/dist/{typography-DsGdDBc2.d.ts → typography-BYDh5oku.d.ts} +14 -1
- package/dist/ui/index.cjs +19 -5
- package/dist/ui/index.d.cts +3 -12
- package/dist/ui/index.d.ts +3 -12
- package/dist/ui/index.js +2 -2
- package/package.json +5 -5
- package/styles.css +58 -29
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
Icon,
|
|
3
3
|
Menu,
|
|
4
4
|
Sidebar
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-PECP7DJB.js";
|
|
6
6
|
import {
|
|
7
7
|
Alert,
|
|
8
8
|
AlertDescription,
|
|
@@ -141,7 +141,7 @@ import {
|
|
|
141
141
|
chartColor,
|
|
142
142
|
navigationMenuTriggerStyle,
|
|
143
143
|
toast
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-XUIXZJDQ.js";
|
|
145
145
|
import {
|
|
146
146
|
Dialog,
|
|
147
147
|
DialogContent,
|
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
Tooltip,
|
|
177
177
|
TooltipContent,
|
|
178
178
|
TooltipTrigger
|
|
179
|
-
} from "./chunk-
|
|
179
|
+
} from "./chunk-VM4FESQB.js";
|
|
180
180
|
import {
|
|
181
181
|
Button,
|
|
182
182
|
cn
|
|
@@ -467,10 +467,11 @@ function Calendar2({
|
|
|
467
467
|
|
|
468
468
|
// src/components/components/Card/index.tsx
|
|
469
469
|
import { jsx as jsx12, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
470
|
-
function Card2({ title, bordered = true, className, style, children }) {
|
|
470
|
+
function Card2({ title, bordered = true, rounded, className, style, children }) {
|
|
471
471
|
return /* @__PURE__ */ jsxs8(
|
|
472
472
|
Card,
|
|
473
473
|
{
|
|
474
|
+
rounded,
|
|
474
475
|
className: cn("gap-4 py-4", !bordered && "border-transparent shadow-none", className),
|
|
475
476
|
style,
|
|
476
477
|
children: [
|
|
@@ -1164,10 +1165,312 @@ function DataTable({
|
|
|
1164
1165
|
] });
|
|
1165
1166
|
}
|
|
1166
1167
|
|
|
1168
|
+
// src/components/components/DatePicker/index.tsx
|
|
1169
|
+
import { useI18n as useI18n4 } from "@pactor-app/runtime";
|
|
1170
|
+
import {
|
|
1171
|
+
addMonths,
|
|
1172
|
+
endOfMonth,
|
|
1173
|
+
endOfWeek,
|
|
1174
|
+
format as format2,
|
|
1175
|
+
isBefore,
|
|
1176
|
+
isValid as isValid2,
|
|
1177
|
+
parseISO as parseISO2,
|
|
1178
|
+
startOfDay,
|
|
1179
|
+
startOfMonth,
|
|
1180
|
+
startOfWeek,
|
|
1181
|
+
subDays,
|
|
1182
|
+
subMonths
|
|
1183
|
+
} from "date-fns";
|
|
1184
|
+
import { enUS, zhCN } from "date-fns/locale";
|
|
1185
|
+
import { Calendar as CalendarIcon } from "lucide-react";
|
|
1186
|
+
import { useEffect as useEffect5, useId as useId3, useState as useState7 } from "react";
|
|
1187
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1188
|
+
function toDateFnsLocale(locale) {
|
|
1189
|
+
switch (locale) {
|
|
1190
|
+
case "zh-CN":
|
|
1191
|
+
return zhCN;
|
|
1192
|
+
case "en-US":
|
|
1193
|
+
return enUS;
|
|
1194
|
+
default:
|
|
1195
|
+
return enUS;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
function parseDate(value) {
|
|
1199
|
+
if (typeof value !== "string" || value === "") return void 0;
|
|
1200
|
+
const date = parseISO2(value);
|
|
1201
|
+
return isValid2(date) ? date : void 0;
|
|
1202
|
+
}
|
|
1203
|
+
function parseRange(value) {
|
|
1204
|
+
if (typeof value !== "object" || value === null) return void 0;
|
|
1205
|
+
const { start, end } = value;
|
|
1206
|
+
const from = parseDate(start);
|
|
1207
|
+
const to = parseDate(end);
|
|
1208
|
+
return from && to ? { from, to } : void 0;
|
|
1209
|
+
}
|
|
1210
|
+
var RANGE_ENDPOINT_CLASSES = "[&>button]:bg-(--calendar-selected-background) [&>button]:text-(--calendar-selected-foreground) [&>button]:hover:bg-(--calendar-selected-background) [&>button]:hover:text-(--calendar-selected-foreground)";
|
|
1211
|
+
var IN_RANGE_CLASSES = "[&>button]:bg-(--calendar-range-background) [&>button]:text-(--calendar-range-foreground) [&>button]:rounded-none";
|
|
1212
|
+
function DatePicker(props) {
|
|
1213
|
+
const {
|
|
1214
|
+
name,
|
|
1215
|
+
label,
|
|
1216
|
+
rules,
|
|
1217
|
+
placeholder,
|
|
1218
|
+
disabled,
|
|
1219
|
+
presets,
|
|
1220
|
+
className,
|
|
1221
|
+
style
|
|
1222
|
+
} = props;
|
|
1223
|
+
const mode = props.mode ?? "single";
|
|
1224
|
+
const isRange = mode === "range";
|
|
1225
|
+
const value = props.value;
|
|
1226
|
+
const onChange = props.onChange;
|
|
1227
|
+
const form = useFormContext();
|
|
1228
|
+
const { locale, t } = useI18n4();
|
|
1229
|
+
const dfLocale = toDateFnsLocale(locale);
|
|
1230
|
+
const controlId = useId3();
|
|
1231
|
+
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
1232
|
+
const [open, setOpen] = useState7(false);
|
|
1233
|
+
useEffect5(() => {
|
|
1234
|
+
if (inForm && form && name) {
|
|
1235
|
+
form.registerField(name, rules, value);
|
|
1236
|
+
return () => form.unregisterField(name);
|
|
1237
|
+
}
|
|
1238
|
+
return void 0;
|
|
1239
|
+
});
|
|
1240
|
+
const [innerValue, setInnerValue] = useState7(value);
|
|
1241
|
+
useEffect5(() => {
|
|
1242
|
+
if (!inForm) setInnerValue(value);
|
|
1243
|
+
}, [inForm, value]);
|
|
1244
|
+
const [pendingStart, setPendingStart] = useState7();
|
|
1245
|
+
const [startMonth, setStartMonth] = useState7(
|
|
1246
|
+
() => startOfMonth(/* @__PURE__ */ new Date())
|
|
1247
|
+
);
|
|
1248
|
+
const [endMonth, setEndMonth] = useState7(
|
|
1249
|
+
() => startOfMonth(addMonths(/* @__PURE__ */ new Date(), 1))
|
|
1250
|
+
);
|
|
1251
|
+
const current = inForm && form && name ? form.values[name] : innerValue;
|
|
1252
|
+
const setPanelMonths = (start, end) => {
|
|
1253
|
+
const s = startOfMonth(start);
|
|
1254
|
+
const e = startOfMonth(end);
|
|
1255
|
+
setStartMonth(s);
|
|
1256
|
+
setEndMonth(isBefore(e, addMonths(s, 1)) ? addMonths(s, 1) : e);
|
|
1257
|
+
};
|
|
1258
|
+
const handleStartMonthChange = (month) => {
|
|
1259
|
+
const s = startOfMonth(month);
|
|
1260
|
+
setStartMonth(s);
|
|
1261
|
+
setEndMonth((prev) => isBefore(s, prev) ? prev : addMonths(s, 1));
|
|
1262
|
+
};
|
|
1263
|
+
const handleEndMonthChange = (month) => {
|
|
1264
|
+
const e = startOfMonth(month);
|
|
1265
|
+
setEndMonth(e);
|
|
1266
|
+
setStartMonth((prev) => isBefore(prev, e) ? prev : subMonths(e, 1));
|
|
1267
|
+
};
|
|
1268
|
+
useEffect5(() => {
|
|
1269
|
+
if (!isRange) return;
|
|
1270
|
+
const parsed = parseRange(current);
|
|
1271
|
+
setPendingStart(void 0);
|
|
1272
|
+
setPanelMonths(
|
|
1273
|
+
parsed?.from ?? /* @__PURE__ */ new Date(),
|
|
1274
|
+
parsed?.to ?? addMonths(/* @__PURE__ */ new Date(), 1)
|
|
1275
|
+
);
|
|
1276
|
+
}, [isRange, current]);
|
|
1277
|
+
const commit = (next) => {
|
|
1278
|
+
if (inForm && form && name) {
|
|
1279
|
+
form.setValue(name, next);
|
|
1280
|
+
} else {
|
|
1281
|
+
setInnerValue(next);
|
|
1282
|
+
}
|
|
1283
|
+
onChange?.(next);
|
|
1284
|
+
};
|
|
1285
|
+
const commitRange = (from, to) => {
|
|
1286
|
+
commit({ start: format2(from, "yyyy-MM-dd"), end: format2(to, "yyyy-MM-dd") });
|
|
1287
|
+
};
|
|
1288
|
+
const handleSingleSelect = (date) => {
|
|
1289
|
+
commit(date ? format2(date, "yyyy-MM-dd") : void 0);
|
|
1290
|
+
};
|
|
1291
|
+
const parsedRange = isRange ? parseRange(current) : void 0;
|
|
1292
|
+
const rangeStart = pendingStart ?? parsedRange?.from;
|
|
1293
|
+
const rangeEnd = pendingStart !== void 0 ? void 0 : parsedRange?.to;
|
|
1294
|
+
const handleRangeDaySelect = (date) => {
|
|
1295
|
+
if (!date) return;
|
|
1296
|
+
const day = startOfDay(date);
|
|
1297
|
+
if (pendingStart) {
|
|
1298
|
+
if (isBefore(day, pendingStart)) {
|
|
1299
|
+
setPendingStart(day);
|
|
1300
|
+
} else {
|
|
1301
|
+
commitRange(pendingStart, day);
|
|
1302
|
+
}
|
|
1303
|
+
} else {
|
|
1304
|
+
setPendingStart(day);
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
const presetList = presets === false ? [] : presets ?? (isRange ? [{ key: "today" }, { key: "thisWeek" }, { key: "thisMonth" }] : []);
|
|
1308
|
+
const resolvePreset = (preset) => {
|
|
1309
|
+
const now = /* @__PURE__ */ new Date();
|
|
1310
|
+
if ("key" in preset) {
|
|
1311
|
+
const key = preset.key;
|
|
1312
|
+
const label2 = preset.label ?? t(`pactor.datePicker.${key}`);
|
|
1313
|
+
if (key === "today") return { label: label2, from: now, to: now };
|
|
1314
|
+
if (key === "thisWeek") {
|
|
1315
|
+
return {
|
|
1316
|
+
label: label2,
|
|
1317
|
+
from: startOfWeek(now, { locale: dfLocale }),
|
|
1318
|
+
to: endOfWeek(now, { locale: dfLocale })
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
return { label: label2, from: startOfMonth(now), to: endOfMonth(now) };
|
|
1322
|
+
}
|
|
1323
|
+
if ("days" in preset) {
|
|
1324
|
+
return { label: preset.label, from: subDays(now, preset.days - 1), to: now };
|
|
1325
|
+
}
|
|
1326
|
+
return {
|
|
1327
|
+
label: preset.label,
|
|
1328
|
+
from: parseDate(preset.range.start) ?? now,
|
|
1329
|
+
to: parseDate(preset.range.end) ?? now
|
|
1330
|
+
};
|
|
1331
|
+
};
|
|
1332
|
+
const handlePresetClick = (preset, from, to) => {
|
|
1333
|
+
if ("key" in preset && preset.key === "today") {
|
|
1334
|
+
const today = startOfDay(/* @__PURE__ */ new Date());
|
|
1335
|
+
if (isRange) {
|
|
1336
|
+
setPendingStart(today);
|
|
1337
|
+
setPanelMonths(today, addMonths(today, 1));
|
|
1338
|
+
} else {
|
|
1339
|
+
commit(format2(today, "yyyy-MM-dd"));
|
|
1340
|
+
}
|
|
1341
|
+
return;
|
|
1342
|
+
}
|
|
1343
|
+
commitRange(from, to);
|
|
1344
|
+
};
|
|
1345
|
+
const singleDate = isRange ? void 0 : parseDate(current);
|
|
1346
|
+
const hasInnerRange = isRange && rangeStart !== void 0 && rangeEnd !== void 0 && isBefore(startOfDay(rangeStart), startOfDay(rangeEnd));
|
|
1347
|
+
const rangeModifiers = isRange ? {
|
|
1348
|
+
...rangeStart ? { rangeStart } : {},
|
|
1349
|
+
...rangeEnd ? { rangeEnd } : {},
|
|
1350
|
+
...hasInnerRange ? { inRange: { after: rangeStart, before: rangeEnd } } : {}
|
|
1351
|
+
} : void 0;
|
|
1352
|
+
const rangeModifierClassNames = rangeModifiers ? {
|
|
1353
|
+
...rangeStart ? { rangeStart: RANGE_ENDPOINT_CLASSES } : {},
|
|
1354
|
+
...rangeEnd ? { rangeEnd: RANGE_ENDPOINT_CLASSES } : {},
|
|
1355
|
+
...hasInnerRange ? { inRange: IN_RANGE_CLASSES } : {}
|
|
1356
|
+
} : void 0;
|
|
1357
|
+
const displayText = isRange ? typeof current === "object" && current !== null ? `${current.start} ~ ${current.end}` : "" : typeof current === "string" ? current : "";
|
|
1358
|
+
const placeholderText = placeholder ?? t(isRange ? "pactor.datePicker.placeholderRange" : "pactor.datePicker.placeholder");
|
|
1359
|
+
const calendar = isRange ? /* @__PURE__ */ jsxs18("div", { className: "flex", children: [
|
|
1360
|
+
/* @__PURE__ */ jsx23(
|
|
1361
|
+
"div",
|
|
1362
|
+
{
|
|
1363
|
+
"data-slot": "datepicker-start-panel",
|
|
1364
|
+
className: "border-r border-border",
|
|
1365
|
+
children: /* @__PURE__ */ jsx23(
|
|
1366
|
+
Calendar,
|
|
1367
|
+
{
|
|
1368
|
+
mode: "single",
|
|
1369
|
+
month: startMonth,
|
|
1370
|
+
onMonthChange: handleStartMonthChange,
|
|
1371
|
+
onSelect: handleRangeDaySelect,
|
|
1372
|
+
modifiers: rangeModifiers,
|
|
1373
|
+
modifiersClassNames: rangeModifierClassNames,
|
|
1374
|
+
locale: dfLocale
|
|
1375
|
+
}
|
|
1376
|
+
)
|
|
1377
|
+
}
|
|
1378
|
+
),
|
|
1379
|
+
/* @__PURE__ */ jsx23("div", { "data-slot": "datepicker-end-panel", children: /* @__PURE__ */ jsx23(
|
|
1380
|
+
Calendar,
|
|
1381
|
+
{
|
|
1382
|
+
mode: "single",
|
|
1383
|
+
month: endMonth,
|
|
1384
|
+
onMonthChange: handleEndMonthChange,
|
|
1385
|
+
onSelect: handleRangeDaySelect,
|
|
1386
|
+
modifiers: rangeModifiers,
|
|
1387
|
+
modifiersClassNames: rangeModifierClassNames,
|
|
1388
|
+
locale: dfLocale
|
|
1389
|
+
}
|
|
1390
|
+
) })
|
|
1391
|
+
] }) : /* @__PURE__ */ jsx23(
|
|
1392
|
+
Calendar,
|
|
1393
|
+
{
|
|
1394
|
+
mode: "single",
|
|
1395
|
+
selected: singleDate,
|
|
1396
|
+
onSelect: handleSingleSelect,
|
|
1397
|
+
locale: dfLocale
|
|
1398
|
+
}
|
|
1399
|
+
);
|
|
1400
|
+
const control = /* @__PURE__ */ jsxs18(Popover, { open, onOpenChange: setOpen, children: [
|
|
1401
|
+
/* @__PURE__ */ jsxs18(
|
|
1402
|
+
PopoverTrigger,
|
|
1403
|
+
{
|
|
1404
|
+
id: controlId,
|
|
1405
|
+
type: "button",
|
|
1406
|
+
disabled,
|
|
1407
|
+
"data-slot": "datepicker-trigger",
|
|
1408
|
+
className: cn(
|
|
1409
|
+
"flex h-9 w-full min-w-0 cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-colors outline-none hover:bg-accent focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",
|
|
1410
|
+
displayText === "" && "text-muted-foreground",
|
|
1411
|
+
!inForm && className
|
|
1412
|
+
),
|
|
1413
|
+
style: inForm ? void 0 : style,
|
|
1414
|
+
children: [
|
|
1415
|
+
/* @__PURE__ */ jsx23("span", { className: "min-w-0 flex-1 truncate text-left", children: displayText === "" ? placeholderText : displayText }),
|
|
1416
|
+
/* @__PURE__ */ jsx23(CalendarIcon, { className: "size-4 shrink-0 opacity-50" })
|
|
1417
|
+
]
|
|
1418
|
+
}
|
|
1419
|
+
),
|
|
1420
|
+
/* @__PURE__ */ jsx23(PopoverContent, { className: "w-auto p-0", children: presetList.length > 0 ? /* @__PURE__ */ jsxs18("div", { className: "flex", children: [
|
|
1421
|
+
/* @__PURE__ */ jsx23(
|
|
1422
|
+
"div",
|
|
1423
|
+
{
|
|
1424
|
+
"data-slot": "datepicker-presets",
|
|
1425
|
+
className: "flex flex-col gap-1 border-r border-border p-3",
|
|
1426
|
+
children: presetList.map((preset, index) => {
|
|
1427
|
+
const resolved = resolvePreset(preset);
|
|
1428
|
+
return /* @__PURE__ */ jsx23(
|
|
1429
|
+
"button",
|
|
1430
|
+
{
|
|
1431
|
+
type: "button",
|
|
1432
|
+
className: "cursor-pointer rounded-md px-3 py-1.5 text-left text-sm whitespace-nowrap hover:bg-accent hover:text-accent-foreground",
|
|
1433
|
+
onClick: () => handlePresetClick(preset, resolved.from, resolved.to),
|
|
1434
|
+
children: resolved.label
|
|
1435
|
+
},
|
|
1436
|
+
`${resolved.label}-${index}`
|
|
1437
|
+
);
|
|
1438
|
+
})
|
|
1439
|
+
}
|
|
1440
|
+
),
|
|
1441
|
+
calendar
|
|
1442
|
+
] }) : calendar })
|
|
1443
|
+
] });
|
|
1444
|
+
if (inForm && form && name) {
|
|
1445
|
+
const error = form.errors[name];
|
|
1446
|
+
return /* @__PURE__ */ jsxs18(
|
|
1447
|
+
"div",
|
|
1448
|
+
{
|
|
1449
|
+
"data-slot": "form-item",
|
|
1450
|
+
className: cn(formItemClass(form.layout), className),
|
|
1451
|
+
style,
|
|
1452
|
+
children: [
|
|
1453
|
+
label ? /* @__PURE__ */ jsx23(
|
|
1454
|
+
"label",
|
|
1455
|
+
{
|
|
1456
|
+
htmlFor: controlId,
|
|
1457
|
+
className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap",
|
|
1458
|
+
children: label
|
|
1459
|
+
}
|
|
1460
|
+
) : null,
|
|
1461
|
+
control,
|
|
1462
|
+
error ? /* @__PURE__ */ jsx23("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
1463
|
+
]
|
|
1464
|
+
}
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1467
|
+
return control;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1167
1470
|
// src/components/components/Dialog/index.tsx
|
|
1168
1471
|
import { useRenderer as useRenderer6 } from "@pactor-app/runtime";
|
|
1169
|
-
import { useState as
|
|
1170
|
-
import { jsx as
|
|
1472
|
+
import { useState as useState8 } from "react";
|
|
1473
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1171
1474
|
function Dialog2({
|
|
1172
1475
|
title,
|
|
1173
1476
|
description,
|
|
@@ -1179,10 +1482,10 @@ function Dialog2({
|
|
|
1179
1482
|
style
|
|
1180
1483
|
}) {
|
|
1181
1484
|
const { renderChildren } = useRenderer6();
|
|
1182
|
-
const [innerOpen, setInnerOpen] =
|
|
1485
|
+
const [innerOpen, setInnerOpen] = useState8(false);
|
|
1183
1486
|
const controlled = open !== void 0;
|
|
1184
1487
|
const visible = controlled ? open : innerOpen;
|
|
1185
|
-
return /* @__PURE__ */
|
|
1488
|
+
return /* @__PURE__ */ jsxs19(
|
|
1186
1489
|
Dialog,
|
|
1187
1490
|
{
|
|
1188
1491
|
open: visible,
|
|
@@ -1195,7 +1498,7 @@ function Dialog2({
|
|
|
1195
1498
|
}
|
|
1196
1499
|
},
|
|
1197
1500
|
children: [
|
|
1198
|
-
trigger ? /* @__PURE__ */
|
|
1501
|
+
trigger ? /* @__PURE__ */ jsx24(
|
|
1199
1502
|
DialogTrigger,
|
|
1200
1503
|
{
|
|
1201
1504
|
nativeButton: false,
|
|
@@ -1203,10 +1506,10 @@ function Dialog2({
|
|
|
1203
1506
|
children: renderChildren([trigger])
|
|
1204
1507
|
}
|
|
1205
1508
|
) : null,
|
|
1206
|
-
/* @__PURE__ */
|
|
1207
|
-
title || description ? /* @__PURE__ */
|
|
1208
|
-
title ? /* @__PURE__ */
|
|
1209
|
-
description ? /* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ jsxs19(DialogContent, { className, style, children: [
|
|
1510
|
+
title || description ? /* @__PURE__ */ jsxs19(DialogHeader, { children: [
|
|
1511
|
+
title ? /* @__PURE__ */ jsx24(DialogTitle, { children: title }) : null,
|
|
1512
|
+
description ? /* @__PURE__ */ jsx24(DialogDescription, { children: description }) : null
|
|
1210
1513
|
] }) : null,
|
|
1211
1514
|
children
|
|
1212
1515
|
] })
|
|
@@ -1216,7 +1519,7 @@ function Dialog2({
|
|
|
1216
1519
|
}
|
|
1217
1520
|
|
|
1218
1521
|
// src/components/components/Drawer/index.tsx
|
|
1219
|
-
import { jsx as
|
|
1522
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1220
1523
|
function Drawer2({
|
|
1221
1524
|
title,
|
|
1222
1525
|
open,
|
|
@@ -1226,7 +1529,7 @@ function Drawer2({
|
|
|
1226
1529
|
className,
|
|
1227
1530
|
style
|
|
1228
1531
|
}) {
|
|
1229
|
-
return /* @__PURE__ */
|
|
1532
|
+
return /* @__PURE__ */ jsx25(
|
|
1230
1533
|
Drawer,
|
|
1231
1534
|
{
|
|
1232
1535
|
direction: placement,
|
|
@@ -1236,16 +1539,16 @@ function Drawer2({
|
|
|
1236
1539
|
onClose?.();
|
|
1237
1540
|
}
|
|
1238
1541
|
},
|
|
1239
|
-
children: /* @__PURE__ */
|
|
1240
|
-
title ? /* @__PURE__ */
|
|
1241
|
-
/* @__PURE__ */
|
|
1542
|
+
children: /* @__PURE__ */ jsxs20(DrawerContent, { className, style, children: [
|
|
1543
|
+
title ? /* @__PURE__ */ jsx25(DrawerHeader, { children: /* @__PURE__ */ jsx25(DrawerTitle, { children: title }) }) : null,
|
|
1544
|
+
/* @__PURE__ */ jsx25("div", { className: "flex-1 overflow-auto p-4", children })
|
|
1242
1545
|
] })
|
|
1243
1546
|
}
|
|
1244
1547
|
);
|
|
1245
1548
|
}
|
|
1246
1549
|
|
|
1247
1550
|
// src/components/components/DropdownMenu/index.tsx
|
|
1248
|
-
import { jsx as
|
|
1551
|
+
import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1249
1552
|
function DropdownMenu2({
|
|
1250
1553
|
items = [],
|
|
1251
1554
|
onSelect,
|
|
@@ -1253,8 +1556,8 @@ function DropdownMenu2({
|
|
|
1253
1556
|
className,
|
|
1254
1557
|
style
|
|
1255
1558
|
}) {
|
|
1256
|
-
return /* @__PURE__ */
|
|
1257
|
-
/* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ jsxs21(DropdownMenu, { children: [
|
|
1560
|
+
/* @__PURE__ */ jsx26(
|
|
1258
1561
|
DropdownMenuTrigger,
|
|
1259
1562
|
{
|
|
1260
1563
|
nativeButton: false,
|
|
@@ -1262,14 +1565,14 @@ function DropdownMenu2({
|
|
|
1262
1565
|
children
|
|
1263
1566
|
}
|
|
1264
1567
|
),
|
|
1265
|
-
/* @__PURE__ */
|
|
1568
|
+
/* @__PURE__ */ jsx26(DropdownMenuContent, { className, style, children: items.map((item) => /* @__PURE__ */ jsxs21(
|
|
1266
1569
|
DropdownMenuItem,
|
|
1267
1570
|
{
|
|
1268
1571
|
variant: item.danger ? "destructive" : "default",
|
|
1269
1572
|
disabled: item.disabled,
|
|
1270
1573
|
onClick: () => onSelect?.(item.value),
|
|
1271
1574
|
children: [
|
|
1272
|
-
item.icon ? /* @__PURE__ */
|
|
1575
|
+
item.icon ? /* @__PURE__ */ jsx26(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1273
1576
|
item.label
|
|
1274
1577
|
]
|
|
1275
1578
|
},
|
|
@@ -1279,30 +1582,30 @@ function DropdownMenu2({
|
|
|
1279
1582
|
}
|
|
1280
1583
|
|
|
1281
1584
|
// src/components/components/Empty/index.tsx
|
|
1282
|
-
import { jsx as
|
|
1585
|
+
import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1283
1586
|
function Empty2({ title, description, children, className, style }) {
|
|
1284
|
-
return /* @__PURE__ */
|
|
1285
|
-
/* @__PURE__ */
|
|
1286
|
-
title ? /* @__PURE__ */
|
|
1287
|
-
description ? /* @__PURE__ */
|
|
1587
|
+
return /* @__PURE__ */ jsxs22(Empty, { className, style, children: [
|
|
1588
|
+
/* @__PURE__ */ jsxs22(EmptyHeader, { children: [
|
|
1589
|
+
title ? /* @__PURE__ */ jsx27(EmptyTitle, { children: title }) : null,
|
|
1590
|
+
description ? /* @__PURE__ */ jsx27(EmptyDescription, { children: description }) : null
|
|
1288
1591
|
] }),
|
|
1289
|
-
children ? /* @__PURE__ */
|
|
1592
|
+
children ? /* @__PURE__ */ jsx27(EmptyContent, { children }) : null
|
|
1290
1593
|
] });
|
|
1291
1594
|
}
|
|
1292
1595
|
|
|
1293
1596
|
// src/components/components/Field/index.tsx
|
|
1294
|
-
import { jsx as
|
|
1597
|
+
import { jsx as jsx28, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1295
1598
|
function Field2({ label, description, error, children, className, style }) {
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
label ? /* @__PURE__ */
|
|
1599
|
+
return /* @__PURE__ */ jsxs23(Field, { className, style, children: [
|
|
1600
|
+
label ? /* @__PURE__ */ jsx28(FieldLabel, { children: label }) : null,
|
|
1298
1601
|
children,
|
|
1299
|
-
description ? /* @__PURE__ */
|
|
1300
|
-
error ? /* @__PURE__ */
|
|
1602
|
+
description ? /* @__PURE__ */ jsx28(FieldDescription, { children: description }) : null,
|
|
1603
|
+
error ? /* @__PURE__ */ jsx28(FieldError, { match: true, children: error }) : null
|
|
1301
1604
|
] });
|
|
1302
1605
|
}
|
|
1303
1606
|
|
|
1304
1607
|
// src/components/components/Flex/index.tsx
|
|
1305
|
-
import { jsx as
|
|
1608
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1306
1609
|
var gapClass = {
|
|
1307
1610
|
small: "gap-(--flex-gap-sm)",
|
|
1308
1611
|
middle: "gap-(--flex-gap-md)",
|
|
@@ -1332,7 +1635,7 @@ function Flex({
|
|
|
1332
1635
|
style,
|
|
1333
1636
|
children
|
|
1334
1637
|
}) {
|
|
1335
|
-
return /* @__PURE__ */
|
|
1638
|
+
return /* @__PURE__ */ jsx29(
|
|
1336
1639
|
"div",
|
|
1337
1640
|
{
|
|
1338
1641
|
"data-slot": "flex",
|
|
@@ -1352,9 +1655,9 @@ function Flex({
|
|
|
1352
1655
|
}
|
|
1353
1656
|
|
|
1354
1657
|
// src/components/components/Footer/index.tsx
|
|
1355
|
-
import { jsx as
|
|
1658
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1356
1659
|
function Footer({ className, style, children }) {
|
|
1357
|
-
return /* @__PURE__ */
|
|
1660
|
+
return /* @__PURE__ */ jsx30(
|
|
1358
1661
|
"footer",
|
|
1359
1662
|
{
|
|
1360
1663
|
"data-slot": "layout-footer",
|
|
@@ -1372,12 +1675,12 @@ function Footer({ className, style, children }) {
|
|
|
1372
1675
|
import { useRenderer as useRenderer7 } from "@pactor-app/runtime";
|
|
1373
1676
|
import {
|
|
1374
1677
|
useCallback,
|
|
1375
|
-
useEffect as
|
|
1678
|
+
useEffect as useEffect6,
|
|
1376
1679
|
useMemo as useMemo2,
|
|
1377
1680
|
useRef as useRef2,
|
|
1378
|
-
useState as
|
|
1681
|
+
useState as useState9
|
|
1379
1682
|
} from "react";
|
|
1380
|
-
import { jsx as
|
|
1683
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1381
1684
|
function isEmpty(value) {
|
|
1382
1685
|
return value === void 0 || value === null || value === "";
|
|
1383
1686
|
}
|
|
@@ -1392,16 +1695,16 @@ function Form({
|
|
|
1392
1695
|
onValuesChange
|
|
1393
1696
|
}) {
|
|
1394
1697
|
const { context } = useRenderer7();
|
|
1395
|
-
const [values, setValues] =
|
|
1698
|
+
const [values, setValues] = useState9(() => ({
|
|
1396
1699
|
...initialValues
|
|
1397
1700
|
}));
|
|
1398
|
-
const [errors, setErrors] =
|
|
1701
|
+
const [errors, setErrors] = useState9({});
|
|
1399
1702
|
const fieldRulesRef = useRef2(/* @__PURE__ */ new Map());
|
|
1400
1703
|
const mergedInitialFieldsRef = useRef2(/* @__PURE__ */ new Set());
|
|
1401
1704
|
const setValuesBatch = useCallback((partial) => {
|
|
1402
1705
|
setValues((prev) => ({ ...prev, ...partial }));
|
|
1403
1706
|
}, []);
|
|
1404
|
-
|
|
1707
|
+
useEffect6(() => {
|
|
1405
1708
|
context.forms.register(name, { setValues: setValuesBatch });
|
|
1406
1709
|
return () => {
|
|
1407
1710
|
context.forms.unregister(name);
|
|
@@ -1458,7 +1761,7 @@ function Form({
|
|
|
1458
1761
|
context.state.set("form", values);
|
|
1459
1762
|
onSubmit?.(values);
|
|
1460
1763
|
};
|
|
1461
|
-
return /* @__PURE__ */
|
|
1764
|
+
return /* @__PURE__ */ jsx31(FormContextProvider, { value: formContext, children: /* @__PURE__ */ jsx31(
|
|
1462
1765
|
"form",
|
|
1463
1766
|
{
|
|
1464
1767
|
"data-slot": "form",
|
|
@@ -1472,10 +1775,10 @@ function Form({
|
|
|
1472
1775
|
|
|
1473
1776
|
// src/components/components/Grid/index.tsx
|
|
1474
1777
|
import { Children } from "react";
|
|
1475
|
-
import { jsx as
|
|
1778
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
1476
1779
|
function Grid({ columns = 1, gap, className, style, children }) {
|
|
1477
1780
|
const cols = Math.max(1, columns);
|
|
1478
|
-
return /* @__PURE__ */
|
|
1781
|
+
return /* @__PURE__ */ jsx32(
|
|
1479
1782
|
"div",
|
|
1480
1783
|
{
|
|
1481
1784
|
"data-slot": "grid",
|
|
@@ -1486,15 +1789,15 @@ function Grid({ columns = 1, gap, className, style, children }) {
|
|
|
1486
1789
|
...gap !== void 0 ? { gap } : {},
|
|
1487
1790
|
...style
|
|
1488
1791
|
},
|
|
1489
|
-
children: Children.map(children, (child, index) => /* @__PURE__ */
|
|
1792
|
+
children: Children.map(children, (child, index) => /* @__PURE__ */ jsx32("div", { "data-slot": "grid-item", children: child }, index))
|
|
1490
1793
|
}
|
|
1491
1794
|
);
|
|
1492
1795
|
}
|
|
1493
1796
|
|
|
1494
1797
|
// src/components/components/Header/index.tsx
|
|
1495
|
-
import { useI18n as
|
|
1798
|
+
import { useI18n as useI18n5 } from "@pactor-app/runtime";
|
|
1496
1799
|
import { ChevronDownIcon } from "lucide-react";
|
|
1497
|
-
import { Fragment as Fragment2, jsx as
|
|
1800
|
+
import { Fragment as Fragment2, jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1498
1801
|
var menuItemClass = "flex items-center gap-1 rounded-md px-3 py-2 text-sm transition-colors text-muted-foreground hover:bg-accent/50 hover:text-foreground";
|
|
1499
1802
|
function Header({
|
|
1500
1803
|
logo,
|
|
@@ -1525,10 +1828,10 @@ function Header({
|
|
|
1525
1828
|
className
|
|
1526
1829
|
);
|
|
1527
1830
|
if (!hasBrand && !dropdown && !hasMenu && !hasUser && !hasLocales) {
|
|
1528
|
-
return /* @__PURE__ */
|
|
1831
|
+
return /* @__PURE__ */ jsx33("header", { "data-slot": "layout-header", className: rootClass, style, children });
|
|
1529
1832
|
}
|
|
1530
|
-
const brandNode = hasBrand && /* @__PURE__ */
|
|
1531
|
-
logo !== void 0 && /* @__PURE__ */
|
|
1833
|
+
const brandNode = hasBrand && /* @__PURE__ */ jsxs24("div", { "data-slot": "header-brand", className: "flex items-center gap-2", children: [
|
|
1834
|
+
logo !== void 0 && /* @__PURE__ */ jsx33(
|
|
1532
1835
|
"img",
|
|
1533
1836
|
{
|
|
1534
1837
|
"data-slot": "header-brand-logo",
|
|
@@ -1537,23 +1840,23 @@ function Header({
|
|
|
1537
1840
|
className: "h-8 w-8 shrink-0 object-contain"
|
|
1538
1841
|
}
|
|
1539
1842
|
),
|
|
1540
|
-
title !== void 0 && /* @__PURE__ */
|
|
1843
|
+
title !== void 0 && /* @__PURE__ */ jsx33("span", { "data-slot": "header-brand-title", className: "text-base font-semibold", children: title })
|
|
1541
1844
|
] });
|
|
1542
|
-
const dropdownNode = dropdown !== void 0 && /* @__PURE__ */
|
|
1845
|
+
const dropdownNode = dropdown !== void 0 && /* @__PURE__ */ jsx33(HeaderDropdownArea, { dropdown, onSelect: onDropdownSelect });
|
|
1543
1846
|
const showLeft = brandLeft || dropdownLeft || hasMenu;
|
|
1544
1847
|
const showRight = dropdownRight || brandRight || hasLocales || hasUser;
|
|
1545
|
-
return /* @__PURE__ */
|
|
1546
|
-
showLeft && /* @__PURE__ */
|
|
1848
|
+
return /* @__PURE__ */ jsxs24("header", { "data-slot": "layout-header", className: rootClass, style, children: [
|
|
1849
|
+
showLeft && /* @__PURE__ */ jsxs24("div", { "data-slot": "header-left", className: "flex items-center gap-4", children: [
|
|
1547
1850
|
brandLeft && brandNode,
|
|
1548
1851
|
dropdownLeft && dropdownNode,
|
|
1549
|
-
hasMenu && /* @__PURE__ */
|
|
1852
|
+
hasMenu && /* @__PURE__ */ jsx33(HeaderMenuArea, { items: menu, onSelect: onMenuSelect })
|
|
1550
1853
|
] }),
|
|
1551
|
-
/* @__PURE__ */
|
|
1552
|
-
showRight && /* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ jsx33("div", { "data-slot": "header-center", className: "flex flex-1 items-center gap-4", children }),
|
|
1855
|
+
showRight && /* @__PURE__ */ jsxs24("div", { "data-slot": "header-right", className: "flex items-center gap-4", children: [
|
|
1553
1856
|
dropdownRight && dropdownNode,
|
|
1554
1857
|
brandRight && brandNode,
|
|
1555
|
-
hasLocales && /* @__PURE__ */
|
|
1556
|
-
hasUser && /* @__PURE__ */
|
|
1858
|
+
hasLocales && /* @__PURE__ */ jsx33(HeaderLocalesArea, { locales, onSelect: onLocaleChange }),
|
|
1859
|
+
hasUser && /* @__PURE__ */ jsx33(HeaderUserArea, { user, onSelect: onUserSelect })
|
|
1557
1860
|
] })
|
|
1558
1861
|
] });
|
|
1559
1862
|
}
|
|
@@ -1561,25 +1864,25 @@ function HeaderDropdownArea({
|
|
|
1561
1864
|
dropdown,
|
|
1562
1865
|
onSelect
|
|
1563
1866
|
}) {
|
|
1564
|
-
return /* @__PURE__ */
|
|
1565
|
-
/* @__PURE__ */
|
|
1867
|
+
return /* @__PURE__ */ jsxs24(DropdownMenu, { children: [
|
|
1868
|
+
/* @__PURE__ */ jsxs24(
|
|
1566
1869
|
DropdownMenuTrigger,
|
|
1567
1870
|
{
|
|
1568
1871
|
"data-slot": "header-dropdown",
|
|
1569
1872
|
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
1570
1873
|
children: [
|
|
1571
1874
|
dropdown.label,
|
|
1572
|
-
/* @__PURE__ */
|
|
1875
|
+
/* @__PURE__ */ jsx33(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
1573
1876
|
]
|
|
1574
1877
|
}
|
|
1575
1878
|
),
|
|
1576
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ jsx33(DropdownMenuContent, { children: dropdown.items.map((item) => /* @__PURE__ */ jsxs24(
|
|
1577
1880
|
DropdownMenuItem,
|
|
1578
1881
|
{
|
|
1579
1882
|
disabled: item.disabled,
|
|
1580
1883
|
onClick: () => onSelect?.(item.value),
|
|
1581
1884
|
children: [
|
|
1582
|
-
item.icon ? /* @__PURE__ */
|
|
1885
|
+
item.icon ? /* @__PURE__ */ jsx33(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1583
1886
|
item.label
|
|
1584
1887
|
]
|
|
1585
1888
|
},
|
|
@@ -1591,23 +1894,23 @@ function HeaderMenuArea({
|
|
|
1591
1894
|
items,
|
|
1592
1895
|
onSelect
|
|
1593
1896
|
}) {
|
|
1594
|
-
return /* @__PURE__ */
|
|
1595
|
-
(item) => item.children !== void 0 && item.children.length > 0 ? /* @__PURE__ */
|
|
1596
|
-
/* @__PURE__ */
|
|
1897
|
+
return /* @__PURE__ */ jsx33("nav", { "data-slot": "header-menu", className: "flex items-center gap-1", children: items.map(
|
|
1898
|
+
(item) => item.children !== void 0 && item.children.length > 0 ? /* @__PURE__ */ jsxs24(DropdownMenu, { children: [
|
|
1899
|
+
/* @__PURE__ */ jsxs24(
|
|
1597
1900
|
DropdownMenuTrigger,
|
|
1598
1901
|
{
|
|
1599
1902
|
"data-slot": "header-menu-item",
|
|
1600
1903
|
"data-key": item.key,
|
|
1601
1904
|
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
1602
1905
|
children: [
|
|
1603
|
-
item.icon ? /* @__PURE__ */
|
|
1906
|
+
item.icon ? /* @__PURE__ */ jsx33(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1604
1907
|
item.label,
|
|
1605
|
-
/* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ jsx33(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
1606
1909
|
]
|
|
1607
1910
|
}
|
|
1608
1911
|
),
|
|
1609
|
-
/* @__PURE__ */
|
|
1610
|
-
] }, item.key) : /* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ jsx33(DropdownMenuContent, { children: item.children.map((child) => /* @__PURE__ */ jsx33(HeaderMenuEntry, { item: child, onSelect }, child.key)) })
|
|
1913
|
+
] }, item.key) : /* @__PURE__ */ jsxs24(
|
|
1611
1914
|
"button",
|
|
1612
1915
|
{
|
|
1613
1916
|
type: "button",
|
|
@@ -1616,7 +1919,7 @@ function HeaderMenuArea({
|
|
|
1616
1919
|
className: menuItemClass,
|
|
1617
1920
|
onClick: () => onSelect?.(item.key),
|
|
1618
1921
|
children: [
|
|
1619
|
-
item.icon ? /* @__PURE__ */
|
|
1922
|
+
item.icon ? /* @__PURE__ */ jsx33(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1620
1923
|
item.label
|
|
1621
1924
|
]
|
|
1622
1925
|
},
|
|
@@ -1629,16 +1932,16 @@ function HeaderMenuEntry({
|
|
|
1629
1932
|
onSelect
|
|
1630
1933
|
}) {
|
|
1631
1934
|
if (item.children !== void 0 && item.children.length > 0) {
|
|
1632
|
-
return /* @__PURE__ */
|
|
1633
|
-
/* @__PURE__ */
|
|
1634
|
-
item.icon ? /* @__PURE__ */
|
|
1935
|
+
return /* @__PURE__ */ jsxs24(DropdownMenuSub, { children: [
|
|
1936
|
+
/* @__PURE__ */ jsxs24(DropdownMenuSubTrigger, { "data-key": item.key, className: "cursor-pointer", children: [
|
|
1937
|
+
item.icon ? /* @__PURE__ */ jsx33(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1635
1938
|
item.label
|
|
1636
1939
|
] }),
|
|
1637
|
-
/* @__PURE__ */
|
|
1940
|
+
/* @__PURE__ */ jsx33(DropdownMenuSubContent, { children: item.children.map((child) => /* @__PURE__ */ jsx33(HeaderMenuEntry, { item: child, onSelect }, child.key)) })
|
|
1638
1941
|
] });
|
|
1639
1942
|
}
|
|
1640
|
-
return /* @__PURE__ */
|
|
1641
|
-
item.icon ? /* @__PURE__ */
|
|
1943
|
+
return /* @__PURE__ */ jsxs24(DropdownMenuItem, { "data-key": item.key, onClick: () => onSelect?.(item.key), children: [
|
|
1944
|
+
item.icon ? /* @__PURE__ */ jsx33(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1642
1945
|
item.label
|
|
1643
1946
|
] });
|
|
1644
1947
|
}
|
|
@@ -1646,18 +1949,18 @@ function HeaderUserArea({
|
|
|
1646
1949
|
user,
|
|
1647
1950
|
onSelect
|
|
1648
1951
|
}) {
|
|
1649
|
-
const identity = /* @__PURE__ */
|
|
1650
|
-
/* @__PURE__ */
|
|
1651
|
-
user.avatar !== void 0 && /* @__PURE__ */
|
|
1652
|
-
/* @__PURE__ */
|
|
1952
|
+
const identity = /* @__PURE__ */ jsxs24(Fragment2, { children: [
|
|
1953
|
+
/* @__PURE__ */ jsxs24(Avatar, { className: "size-7", children: [
|
|
1954
|
+
user.avatar !== void 0 && /* @__PURE__ */ jsx33(AvatarImage, { src: user.avatar, alt: user.name }),
|
|
1955
|
+
/* @__PURE__ */ jsx33(AvatarFallback, { children: user.name.charAt(0) })
|
|
1653
1956
|
] }),
|
|
1654
|
-
/* @__PURE__ */
|
|
1957
|
+
/* @__PURE__ */ jsx33("span", { className: "text-sm", children: user.name })
|
|
1655
1958
|
] });
|
|
1656
1959
|
if (user.items === void 0 || user.items.length === 0) {
|
|
1657
|
-
return /* @__PURE__ */
|
|
1960
|
+
return /* @__PURE__ */ jsx33("div", { "data-slot": "header-user", className: "flex items-center gap-2", children: identity });
|
|
1658
1961
|
}
|
|
1659
|
-
return /* @__PURE__ */
|
|
1660
|
-
/* @__PURE__ */
|
|
1962
|
+
return /* @__PURE__ */ jsxs24(DropdownMenu, { children: [
|
|
1963
|
+
/* @__PURE__ */ jsx33(
|
|
1661
1964
|
DropdownMenuTrigger,
|
|
1662
1965
|
{
|
|
1663
1966
|
"data-slot": "header-user",
|
|
@@ -1665,8 +1968,8 @@ function HeaderUserArea({
|
|
|
1665
1968
|
children: identity
|
|
1666
1969
|
}
|
|
1667
1970
|
),
|
|
1668
|
-
/* @__PURE__ */
|
|
1669
|
-
item.icon ? /* @__PURE__ */
|
|
1971
|
+
/* @__PURE__ */ jsx33(DropdownMenuContent, { align: "end", children: user.items.map((item) => /* @__PURE__ */ jsxs24(DropdownMenuItem, { onClick: () => onSelect?.(item.value), children: [
|
|
1972
|
+
item.icon ? /* @__PURE__ */ jsx33(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1670
1973
|
item.label
|
|
1671
1974
|
] }, item.value)) })
|
|
1672
1975
|
] });
|
|
@@ -1675,21 +1978,21 @@ function HeaderLocalesArea({
|
|
|
1675
1978
|
locales,
|
|
1676
1979
|
onSelect
|
|
1677
1980
|
}) {
|
|
1678
|
-
const { locale } =
|
|
1981
|
+
const { locale } = useI18n5();
|
|
1679
1982
|
const current = locales.find((option) => option.value === locale);
|
|
1680
|
-
return /* @__PURE__ */
|
|
1681
|
-
/* @__PURE__ */
|
|
1983
|
+
return /* @__PURE__ */ jsxs24(DropdownMenu, { children: [
|
|
1984
|
+
/* @__PURE__ */ jsxs24(
|
|
1682
1985
|
DropdownMenuTrigger,
|
|
1683
1986
|
{
|
|
1684
1987
|
"data-slot": "header-locales",
|
|
1685
1988
|
className: cn(menuItemClass, "outline-hidden cursor-pointer"),
|
|
1686
1989
|
children: [
|
|
1687
1990
|
current?.label ?? locale,
|
|
1688
|
-
/* @__PURE__ */
|
|
1991
|
+
/* @__PURE__ */ jsx33(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
1689
1992
|
]
|
|
1690
1993
|
}
|
|
1691
1994
|
),
|
|
1692
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ jsx33(DropdownMenuContent, { align: "end", children: locales.map((option) => /* @__PURE__ */ jsx33(
|
|
1693
1996
|
DropdownMenuItem,
|
|
1694
1997
|
{
|
|
1695
1998
|
onClick: () => onSelect?.(option.value),
|
|
@@ -1702,21 +2005,21 @@ function HeaderLocalesArea({
|
|
|
1702
2005
|
|
|
1703
2006
|
// src/components/components/HoverCard/index.tsx
|
|
1704
2007
|
import { useRenderer as useRenderer8 } from "@pactor-app/runtime";
|
|
1705
|
-
import { jsx as
|
|
2008
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1706
2009
|
function isDslNode2(value) {
|
|
1707
2010
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
1708
2011
|
}
|
|
1709
2012
|
function HoverCard2({ content, children, className, style }) {
|
|
1710
2013
|
const { renderChildren } = useRenderer8();
|
|
1711
|
-
return /* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
2014
|
+
return /* @__PURE__ */ jsxs25(HoverCard, { children: [
|
|
2015
|
+
/* @__PURE__ */ jsx34(HoverCardTrigger, { render: triggerWrapper("hover-card-trigger-wrap"), children }),
|
|
2016
|
+
/* @__PURE__ */ jsx34(HoverCardContent, { className, style, children: isDslNode2(content) ? renderChildren([content]) : content })
|
|
1714
2017
|
] });
|
|
1715
2018
|
}
|
|
1716
2019
|
|
|
1717
2020
|
// src/components/components/Input/index.tsx
|
|
1718
|
-
import { useEffect as
|
|
1719
|
-
import { jsx as
|
|
2021
|
+
import { useEffect as useEffect7, useId as useId4 } from "react";
|
|
2022
|
+
import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1720
2023
|
function Input2({
|
|
1721
2024
|
name,
|
|
1722
2025
|
label,
|
|
@@ -1730,9 +2033,9 @@ function Input2({
|
|
|
1730
2033
|
style
|
|
1731
2034
|
}) {
|
|
1732
2035
|
const form = useFormContext();
|
|
1733
|
-
const controlId =
|
|
2036
|
+
const controlId = useId4();
|
|
1734
2037
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
1735
|
-
|
|
2038
|
+
useEffect7(() => {
|
|
1736
2039
|
if (inForm && form && name) {
|
|
1737
2040
|
form.registerField(name, rules, value);
|
|
1738
2041
|
return () => form.unregisterField(name);
|
|
@@ -1742,14 +2045,14 @@ function Input2({
|
|
|
1742
2045
|
if (inForm && form && name) {
|
|
1743
2046
|
const fieldValue = form.values[name];
|
|
1744
2047
|
const error = form.errors[name];
|
|
1745
|
-
return /* @__PURE__ */
|
|
2048
|
+
return /* @__PURE__ */ jsxs26(
|
|
1746
2049
|
"div",
|
|
1747
2050
|
{
|
|
1748
2051
|
"data-slot": "form-item",
|
|
1749
2052
|
className: cn(formItemClass(form.layout), className),
|
|
1750
2053
|
style,
|
|
1751
2054
|
children: [
|
|
1752
|
-
label ? /* @__PURE__ */
|
|
2055
|
+
label ? /* @__PURE__ */ jsx35(
|
|
1753
2056
|
"label",
|
|
1754
2057
|
{
|
|
1755
2058
|
htmlFor: controlId,
|
|
@@ -1757,7 +2060,7 @@ function Input2({
|
|
|
1757
2060
|
children: label
|
|
1758
2061
|
}
|
|
1759
2062
|
) : null,
|
|
1760
|
-
/* @__PURE__ */
|
|
2063
|
+
/* @__PURE__ */ jsx35(
|
|
1761
2064
|
Input,
|
|
1762
2065
|
{
|
|
1763
2066
|
id: controlId,
|
|
@@ -1771,12 +2074,12 @@ function Input2({
|
|
|
1771
2074
|
}
|
|
1772
2075
|
}
|
|
1773
2076
|
),
|
|
1774
|
-
error ? /* @__PURE__ */
|
|
2077
|
+
error ? /* @__PURE__ */ jsx35("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
1775
2078
|
]
|
|
1776
2079
|
}
|
|
1777
2080
|
);
|
|
1778
2081
|
}
|
|
1779
|
-
return /* @__PURE__ */
|
|
2082
|
+
return /* @__PURE__ */ jsx35(
|
|
1780
2083
|
Input,
|
|
1781
2084
|
{
|
|
1782
2085
|
type,
|
|
@@ -1791,14 +2094,14 @@ function Input2({
|
|
|
1791
2094
|
}
|
|
1792
2095
|
|
|
1793
2096
|
// src/components/components/InputGroup/index.tsx
|
|
1794
|
-
import { jsx as
|
|
2097
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
1795
2098
|
function InputGroup2({ className, style, children }) {
|
|
1796
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ jsx36(InputGroup, { className, style, children });
|
|
1797
2100
|
}
|
|
1798
2101
|
|
|
1799
2102
|
// src/components/components/InputOTP/index.tsx
|
|
1800
|
-
import { useEffect as
|
|
1801
|
-
import { jsx as
|
|
2103
|
+
import { useEffect as useEffect8, useState as useState10 } from "react";
|
|
2104
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1802
2105
|
function InputOTP2({
|
|
1803
2106
|
name,
|
|
1804
2107
|
label,
|
|
@@ -1813,15 +2116,15 @@ function InputOTP2({
|
|
|
1813
2116
|
}) {
|
|
1814
2117
|
const form = useFormContext();
|
|
1815
2118
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
1816
|
-
|
|
2119
|
+
useEffect8(() => {
|
|
1817
2120
|
if (inForm && form && name) {
|
|
1818
2121
|
form.registerField(name, rules, value);
|
|
1819
2122
|
return () => form.unregisterField(name);
|
|
1820
2123
|
}
|
|
1821
2124
|
return void 0;
|
|
1822
2125
|
});
|
|
1823
|
-
const [innerValue, setInnerValue] =
|
|
1824
|
-
|
|
2126
|
+
const [innerValue, setInnerValue] = useState10(typeof value === "string" ? value : "");
|
|
2127
|
+
useEffect8(() => {
|
|
1825
2128
|
if (!inForm) setInnerValue(typeof value === "string" ? value : "");
|
|
1826
2129
|
}, [inForm, value]);
|
|
1827
2130
|
const current = inForm && form && name ? typeof form.values[name] === "string" ? form.values[name] : "" : innerValue;
|
|
@@ -1836,38 +2139,38 @@ function InputOTP2({
|
|
|
1836
2139
|
onComplete?.(next);
|
|
1837
2140
|
}
|
|
1838
2141
|
};
|
|
1839
|
-
const control = /* @__PURE__ */
|
|
2142
|
+
const control = /* @__PURE__ */ jsx37(
|
|
1840
2143
|
InputOTP,
|
|
1841
2144
|
{
|
|
1842
2145
|
maxLength: length,
|
|
1843
2146
|
value: current,
|
|
1844
2147
|
onChange: handleChange,
|
|
1845
2148
|
disabled,
|
|
1846
|
-
children: /* @__PURE__ */
|
|
2149
|
+
children: /* @__PURE__ */ jsx37(InputOTPGroup, { children: Array.from({ length }, (_, index) => /* @__PURE__ */ jsx37(InputOTPSlot, { index }, index)) })
|
|
1847
2150
|
}
|
|
1848
2151
|
);
|
|
1849
2152
|
if (inForm && form && name) {
|
|
1850
2153
|
const error = form.errors[name];
|
|
1851
|
-
return /* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ jsxs27(
|
|
1852
2155
|
"div",
|
|
1853
2156
|
{
|
|
1854
2157
|
"data-slot": "form-item",
|
|
1855
2158
|
className: cn(formItemClass(form.layout), className),
|
|
1856
2159
|
style,
|
|
1857
2160
|
children: [
|
|
1858
|
-
label ? /* @__PURE__ */
|
|
2161
|
+
label ? /* @__PURE__ */ jsx37("label", { className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap", children: label }) : null,
|
|
1859
2162
|
control,
|
|
1860
|
-
error ? /* @__PURE__ */
|
|
2163
|
+
error ? /* @__PURE__ */ jsx37("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
1861
2164
|
]
|
|
1862
2165
|
}
|
|
1863
2166
|
);
|
|
1864
2167
|
}
|
|
1865
|
-
return /* @__PURE__ */
|
|
2168
|
+
return /* @__PURE__ */ jsx37("div", { "data-slot": "input-otp-field", className: cn("inline-block", className), style, children: control });
|
|
1866
2169
|
}
|
|
1867
2170
|
|
|
1868
2171
|
// src/components/components/Item/index.tsx
|
|
1869
2172
|
import { useRenderer as useRenderer9 } from "@pactor-app/runtime";
|
|
1870
|
-
import { jsx as
|
|
2173
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1871
2174
|
function Item2({
|
|
1872
2175
|
title,
|
|
1873
2176
|
description,
|
|
@@ -1878,39 +2181,39 @@ function Item2({
|
|
|
1878
2181
|
}) {
|
|
1879
2182
|
const { renderChildren } = useRenderer9();
|
|
1880
2183
|
const mediaNodes = media === void 0 ? [] : Array.isArray(media) ? media : [media];
|
|
1881
|
-
return /* @__PURE__ */
|
|
1882
|
-
mediaNodes.length > 0 ? /* @__PURE__ */
|
|
1883
|
-
/* @__PURE__ */
|
|
1884
|
-
title ? /* @__PURE__ */
|
|
1885
|
-
description ? /* @__PURE__ */
|
|
2184
|
+
return /* @__PURE__ */ jsxs28(Item, { className, style, children: [
|
|
2185
|
+
mediaNodes.length > 0 ? /* @__PURE__ */ jsx38(ItemMedia, { children: renderChildren(mediaNodes) }) : null,
|
|
2186
|
+
/* @__PURE__ */ jsxs28(ItemContent, { children: [
|
|
2187
|
+
title ? /* @__PURE__ */ jsx38(ItemTitle, { children: title }) : null,
|
|
2188
|
+
description ? /* @__PURE__ */ jsx38(ItemDescription, { children: description }) : null
|
|
1886
2189
|
] }),
|
|
1887
|
-
actions && actions.length > 0 ? /* @__PURE__ */
|
|
2190
|
+
actions && actions.length > 0 ? /* @__PURE__ */ jsx38(ItemActions, { children: renderChildren(actions) }) : null
|
|
1888
2191
|
] });
|
|
1889
2192
|
}
|
|
1890
2193
|
|
|
1891
2194
|
// src/components/components/Kbd/index.tsx
|
|
1892
|
-
import { jsx as
|
|
2195
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1893
2196
|
function Kbd2({ text, className, style }) {
|
|
1894
|
-
return /* @__PURE__ */
|
|
2197
|
+
return /* @__PURE__ */ jsx39(Kbd, { className, style, children: text });
|
|
1895
2198
|
}
|
|
1896
2199
|
|
|
1897
2200
|
// src/components/components/Label/index.tsx
|
|
1898
|
-
import { jsx as
|
|
2201
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1899
2202
|
function Label2({ text, htmlFor, className, style }) {
|
|
1900
|
-
return /* @__PURE__ */
|
|
2203
|
+
return /* @__PURE__ */ jsx40(Label, { htmlFor, className, style, children: text });
|
|
1901
2204
|
}
|
|
1902
2205
|
|
|
1903
2206
|
// src/components/components/Layout/index.tsx
|
|
1904
2207
|
import { isDslSourceRef } from "@pactor-app/core";
|
|
1905
2208
|
import { useRenderer as useRenderer10 } from "@pactor-app/runtime";
|
|
1906
|
-
import { jsx as
|
|
2209
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1907
2210
|
function Layout({ direction, className, style, dslChildren }) {
|
|
1908
2211
|
const { renderChildren, context } = useRenderer10();
|
|
1909
2212
|
const hasSider = Array.isArray(dslChildren) ? dslChildren.some(
|
|
1910
2213
|
(child) => !isDslSourceRef(child) && resolveRootType(child, context) === "Sider"
|
|
1911
2214
|
) : false;
|
|
1912
2215
|
const dir = direction ?? (hasSider ? "horizontal" : "vertical");
|
|
1913
|
-
return /* @__PURE__ */
|
|
2216
|
+
return /* @__PURE__ */ jsx41(
|
|
1914
2217
|
"div",
|
|
1915
2218
|
{
|
|
1916
2219
|
"data-slot": "layout",
|
|
@@ -1934,9 +2237,9 @@ function resolveRootType(node, context) {
|
|
|
1934
2237
|
}
|
|
1935
2238
|
|
|
1936
2239
|
// src/components/components/Link/index.tsx
|
|
1937
|
-
import { jsx as
|
|
2240
|
+
import { jsx as jsx42 } from "react/jsx-runtime";
|
|
1938
2241
|
function Link({ href, text, target, className, style, children }) {
|
|
1939
|
-
return /* @__PURE__ */
|
|
2242
|
+
return /* @__PURE__ */ jsx42(
|
|
1940
2243
|
"a",
|
|
1941
2244
|
{
|
|
1942
2245
|
"data-slot": "link",
|
|
@@ -1951,17 +2254,17 @@ function Link({ href, text, target, className, style, children }) {
|
|
|
1951
2254
|
}
|
|
1952
2255
|
|
|
1953
2256
|
// src/components/components/Menubar/index.tsx
|
|
1954
|
-
import { jsx as
|
|
2257
|
+
import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1955
2258
|
function Menubar2({ menus = [], onSelect, className, style }) {
|
|
1956
|
-
return /* @__PURE__ */
|
|
1957
|
-
/* @__PURE__ */
|
|
1958
|
-
/* @__PURE__ */
|
|
2259
|
+
return /* @__PURE__ */ jsx43(Menubar, { className, style, children: menus.map((menu) => /* @__PURE__ */ jsxs29(MenubarMenu, { children: [
|
|
2260
|
+
/* @__PURE__ */ jsx43(MenubarTrigger, { children: menu.label }),
|
|
2261
|
+
/* @__PURE__ */ jsx43(MenubarContent, { children: menu.items.map((item) => /* @__PURE__ */ jsxs29(
|
|
1959
2262
|
MenubarItem,
|
|
1960
2263
|
{
|
|
1961
2264
|
disabled: item.disabled,
|
|
1962
2265
|
onClick: () => onSelect?.(item.value),
|
|
1963
2266
|
children: [
|
|
1964
|
-
item.icon ? /* @__PURE__ */
|
|
2267
|
+
item.icon ? /* @__PURE__ */ jsx43(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1965
2268
|
item.label
|
|
1966
2269
|
]
|
|
1967
2270
|
},
|
|
@@ -1971,33 +2274,33 @@ function Menubar2({ menus = [], onSelect, className, style }) {
|
|
|
1971
2274
|
}
|
|
1972
2275
|
|
|
1973
2276
|
// src/components/components/NavigationMenu/index.tsx
|
|
1974
|
-
import { Fragment as Fragment3, jsx as
|
|
2277
|
+
import { Fragment as Fragment3, jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
1975
2278
|
function NavigationMenu2({ items = [], className, style }) {
|
|
1976
|
-
return /* @__PURE__ */
|
|
1977
|
-
/* @__PURE__ */
|
|
2279
|
+
return /* @__PURE__ */ jsx44(NavigationMenu, { className, style, children: /* @__PURE__ */ jsx44(NavigationMenuList, { children: items.map((item, index) => /* @__PURE__ */ jsx44(NavigationMenuItem, { value: `item-${index}`, children: item.children && item.children.length > 0 ? /* @__PURE__ */ jsxs30(Fragment3, { children: [
|
|
2280
|
+
/* @__PURE__ */ jsxs30(
|
|
1978
2281
|
NavigationMenuTrigger,
|
|
1979
2282
|
{
|
|
1980
2283
|
className: item.icon !== void 0 ? "gap-2" : void 0,
|
|
1981
2284
|
children: [
|
|
1982
|
-
item.icon ? /* @__PURE__ */
|
|
2285
|
+
item.icon ? /* @__PURE__ */ jsx44(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1983
2286
|
item.label
|
|
1984
2287
|
]
|
|
1985
2288
|
}
|
|
1986
2289
|
),
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
2290
|
+
/* @__PURE__ */ jsx44(NavigationMenuContent, { children: /* @__PURE__ */ jsx44("ul", { className: "grid w-64 gap-1", children: item.children.map((child) => /* @__PURE__ */ jsx44("li", { children: /* @__PURE__ */ jsxs30(NavigationMenuLink, { href: child.href, children: [
|
|
2291
|
+
/* @__PURE__ */ jsxs30(
|
|
1989
2292
|
"span",
|
|
1990
2293
|
{
|
|
1991
2294
|
className: child.icon !== void 0 ? "flex items-center gap-2 font-medium" : "font-medium",
|
|
1992
2295
|
children: [
|
|
1993
|
-
child.icon ? /* @__PURE__ */
|
|
2296
|
+
child.icon ? /* @__PURE__ */ jsx44(Icon, { name: child.icon, size: "sm" }) : null,
|
|
1994
2297
|
child.label
|
|
1995
2298
|
]
|
|
1996
2299
|
}
|
|
1997
2300
|
),
|
|
1998
|
-
child.description ? /* @__PURE__ */
|
|
2301
|
+
child.description ? /* @__PURE__ */ jsx44("span", { className: "text-muted-foreground", children: child.description }) : null
|
|
1999
2302
|
] }) }, child.href)) }) })
|
|
2000
|
-
] }) : /* @__PURE__ */
|
|
2303
|
+
] }) : /* @__PURE__ */ jsxs30(
|
|
2001
2304
|
NavigationMenuLink,
|
|
2002
2305
|
{
|
|
2003
2306
|
href: item.href,
|
|
@@ -2006,7 +2309,7 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
2006
2309
|
item.icon !== void 0 && "gap-2"
|
|
2007
2310
|
),
|
|
2008
2311
|
children: [
|
|
2009
|
-
item.icon ? /* @__PURE__ */
|
|
2312
|
+
item.icon ? /* @__PURE__ */ jsx44(Icon, { name: item.icon, size: "sm" }) : null,
|
|
2010
2313
|
item.label
|
|
2011
2314
|
]
|
|
2012
2315
|
}
|
|
@@ -2014,17 +2317,17 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
2014
2317
|
}
|
|
2015
2318
|
|
|
2016
2319
|
// src/components/components/Page/index.tsx
|
|
2017
|
-
import { jsx as
|
|
2320
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2018
2321
|
function Page({ title, className, style, children }) {
|
|
2019
|
-
return /* @__PURE__ */
|
|
2020
|
-
title ? /* @__PURE__ */
|
|
2021
|
-
/* @__PURE__ */
|
|
2322
|
+
return /* @__PURE__ */ jsxs31("div", { "data-slot": "page", className: cn("p-6", className), style, children: [
|
|
2323
|
+
title ? /* @__PURE__ */ jsx45("h2", { "data-slot": "page-title", className: "mb-5 text-xl font-semibold", children: title }) : null,
|
|
2324
|
+
/* @__PURE__ */ jsx45("div", { "data-slot": "page-content", className: "space-y-5", children })
|
|
2022
2325
|
] });
|
|
2023
2326
|
}
|
|
2024
2327
|
|
|
2025
2328
|
// src/components/components/Pagination/index.tsx
|
|
2026
|
-
import { useState as
|
|
2027
|
-
import { jsx as
|
|
2329
|
+
import { useState as useState11 } from "react";
|
|
2330
|
+
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2028
2331
|
function pageItems(current, count) {
|
|
2029
2332
|
if (count <= 7) {
|
|
2030
2333
|
return Array.from({ length: count }, (_, i) => i + 1);
|
|
@@ -2045,7 +2348,7 @@ function Pagination2({
|
|
|
2045
2348
|
className,
|
|
2046
2349
|
style
|
|
2047
2350
|
}) {
|
|
2048
|
-
const [innerPage, setInnerPage] =
|
|
2351
|
+
const [innerPage, setInnerPage] = useState11(1);
|
|
2049
2352
|
const pageCount = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
|
|
2050
2353
|
const current = Math.min(Math.max(1, page ?? innerPage), pageCount);
|
|
2051
2354
|
const goTo = (next) => {
|
|
@@ -2058,8 +2361,8 @@ function Pagination2({
|
|
|
2058
2361
|
}
|
|
2059
2362
|
onChange?.(target);
|
|
2060
2363
|
};
|
|
2061
|
-
return /* @__PURE__ */
|
|
2062
|
-
/* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ jsx46(Pagination, { className, style, children: /* @__PURE__ */ jsxs32(PaginationContent, { children: [
|
|
2365
|
+
/* @__PURE__ */ jsx46(PaginationItem, { children: /* @__PURE__ */ jsx46(
|
|
2063
2366
|
PaginationPrevious,
|
|
2064
2367
|
{
|
|
2065
2368
|
href: "#",
|
|
@@ -2070,7 +2373,7 @@ function Pagination2({
|
|
|
2070
2373
|
}
|
|
2071
2374
|
}
|
|
2072
2375
|
) }),
|
|
2073
|
-
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */
|
|
2376
|
+
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */ jsx46(PaginationItem, { children: item === "ellipsis" ? /* @__PURE__ */ jsx46(PaginationEllipsis, {}) : /* @__PURE__ */ jsx46(
|
|
2074
2377
|
PaginationLink,
|
|
2075
2378
|
{
|
|
2076
2379
|
href: "#",
|
|
@@ -2082,7 +2385,7 @@ function Pagination2({
|
|
|
2082
2385
|
children: item
|
|
2083
2386
|
}
|
|
2084
2387
|
) }, item === "ellipsis" ? `ellipsis-${index}` : item)),
|
|
2085
|
-
/* @__PURE__ */
|
|
2388
|
+
/* @__PURE__ */ jsx46(PaginationItem, { children: /* @__PURE__ */ jsx46(
|
|
2086
2389
|
PaginationNext,
|
|
2087
2390
|
{
|
|
2088
2391
|
href: "#",
|
|
@@ -2098,14 +2401,14 @@ function Pagination2({
|
|
|
2098
2401
|
|
|
2099
2402
|
// src/components/components/Popover/index.tsx
|
|
2100
2403
|
import { useRenderer as useRenderer11 } from "@pactor-app/runtime";
|
|
2101
|
-
import { jsx as
|
|
2404
|
+
import { jsx as jsx47, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2102
2405
|
function isDslNode3(value) {
|
|
2103
2406
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
2104
2407
|
}
|
|
2105
2408
|
function Popover2({ content, children, className, style }) {
|
|
2106
2409
|
const { renderChildren } = useRenderer11();
|
|
2107
|
-
return /* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2410
|
+
return /* @__PURE__ */ jsxs33(Popover, { children: [
|
|
2411
|
+
/* @__PURE__ */ jsx47(
|
|
2109
2412
|
PopoverTrigger,
|
|
2110
2413
|
{
|
|
2111
2414
|
nativeButton: false,
|
|
@@ -2113,22 +2416,22 @@ function Popover2({ content, children, className, style }) {
|
|
|
2113
2416
|
children
|
|
2114
2417
|
}
|
|
2115
2418
|
),
|
|
2116
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ jsx47(PopoverContent, { className, style, children: isDslNode3(content) ? renderChildren([content]) : content })
|
|
2117
2420
|
] });
|
|
2118
2421
|
}
|
|
2119
2422
|
|
|
2120
2423
|
// src/components/components/Progress/index.tsx
|
|
2121
|
-
import { jsx as
|
|
2424
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
2122
2425
|
function Progress2({ value, className, style }) {
|
|
2123
2426
|
const resolved = typeof value === "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : null;
|
|
2124
|
-
return /* @__PURE__ */
|
|
2427
|
+
return /* @__PURE__ */ jsx48(Progress, { value: resolved, className, style, children: /* @__PURE__ */ jsx48(ProgressTrack, { children: /* @__PURE__ */ jsx48(ProgressIndicator, {}) }) });
|
|
2125
2428
|
}
|
|
2126
2429
|
|
|
2127
2430
|
// src/components/components/RadioGroup/index.tsx
|
|
2128
|
-
import { useEffect as
|
|
2431
|
+
import { useEffect as useEffect9, useId as useId5 } from "react";
|
|
2129
2432
|
|
|
2130
2433
|
// src/components/components/Form/form-item.tsx
|
|
2131
|
-
import { jsx as
|
|
2434
|
+
import { jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2132
2435
|
function FieldShell({
|
|
2133
2436
|
layout,
|
|
2134
2437
|
label,
|
|
@@ -2138,14 +2441,14 @@ function FieldShell({
|
|
|
2138
2441
|
style,
|
|
2139
2442
|
children
|
|
2140
2443
|
}) {
|
|
2141
|
-
return /* @__PURE__ */
|
|
2444
|
+
return /* @__PURE__ */ jsxs34(
|
|
2142
2445
|
"div",
|
|
2143
2446
|
{
|
|
2144
2447
|
"data-slot": "form-item",
|
|
2145
2448
|
className: cn(formItemClass(layout), className),
|
|
2146
2449
|
style,
|
|
2147
2450
|
children: [
|
|
2148
|
-
label ? /* @__PURE__ */
|
|
2451
|
+
label ? /* @__PURE__ */ jsx49(
|
|
2149
2452
|
"label",
|
|
2150
2453
|
{
|
|
2151
2454
|
htmlFor,
|
|
@@ -2154,14 +2457,14 @@ function FieldShell({
|
|
|
2154
2457
|
}
|
|
2155
2458
|
) : null,
|
|
2156
2459
|
children,
|
|
2157
|
-
error ? /* @__PURE__ */
|
|
2460
|
+
error ? /* @__PURE__ */ jsx49("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
2158
2461
|
]
|
|
2159
2462
|
}
|
|
2160
2463
|
);
|
|
2161
2464
|
}
|
|
2162
2465
|
|
|
2163
2466
|
// src/components/components/RadioGroup/index.tsx
|
|
2164
|
-
import { jsx as
|
|
2467
|
+
import { jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2165
2468
|
function RadioGroup2({
|
|
2166
2469
|
name,
|
|
2167
2470
|
label,
|
|
@@ -2174,9 +2477,9 @@ function RadioGroup2({
|
|
|
2174
2477
|
style
|
|
2175
2478
|
}) {
|
|
2176
2479
|
const form = useFormContext();
|
|
2177
|
-
const controlId =
|
|
2480
|
+
const controlId = useId5();
|
|
2178
2481
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2179
|
-
|
|
2482
|
+
useEffect9(() => {
|
|
2180
2483
|
if (inForm && form && name) {
|
|
2181
2484
|
form.registerField(name, rules, value);
|
|
2182
2485
|
return () => form.unregisterField(name);
|
|
@@ -2191,7 +2494,7 @@ function RadioGroup2({
|
|
|
2191
2494
|
onChange?.(next);
|
|
2192
2495
|
};
|
|
2193
2496
|
const groupValue = current ?? "";
|
|
2194
|
-
const group = /* @__PURE__ */
|
|
2497
|
+
const group = /* @__PURE__ */ jsx50(
|
|
2195
2498
|
RadioGroup,
|
|
2196
2499
|
{
|
|
2197
2500
|
value: groupValue,
|
|
@@ -2202,8 +2505,8 @@ function RadioGroup2({
|
|
|
2202
2505
|
style: inForm ? void 0 : style,
|
|
2203
2506
|
children: options.map((option, index) => {
|
|
2204
2507
|
const optionId = `${controlId}-${index}`;
|
|
2205
|
-
return /* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2508
|
+
return /* @__PURE__ */ jsxs35("span", { className: "inline-flex items-center gap-2", children: [
|
|
2509
|
+
/* @__PURE__ */ jsx50(
|
|
2207
2510
|
RadioGroupItem,
|
|
2208
2511
|
{
|
|
2209
2512
|
id: optionId,
|
|
@@ -2211,13 +2514,13 @@ function RadioGroup2({
|
|
|
2211
2514
|
disabled: option.disabled
|
|
2212
2515
|
}
|
|
2213
2516
|
),
|
|
2214
|
-
/* @__PURE__ */
|
|
2517
|
+
/* @__PURE__ */ jsx50("label", { htmlFor: optionId, className: "text-sm leading-none font-medium", children: option.label })
|
|
2215
2518
|
] }, String(option.value));
|
|
2216
2519
|
})
|
|
2217
2520
|
}
|
|
2218
2521
|
);
|
|
2219
2522
|
if (inForm && form && name) {
|
|
2220
|
-
return /* @__PURE__ */
|
|
2523
|
+
return /* @__PURE__ */ jsx50(
|
|
2221
2524
|
FieldShell,
|
|
2222
2525
|
{
|
|
2223
2526
|
layout: form.layout,
|
|
@@ -2235,7 +2538,7 @@ function RadioGroup2({
|
|
|
2235
2538
|
// src/components/components/Resizable/index.tsx
|
|
2236
2539
|
import { useRenderer as useRenderer12 } from "@pactor-app/runtime";
|
|
2237
2540
|
import { Fragment as Fragment4 } from "react";
|
|
2238
|
-
import { jsx as
|
|
2541
|
+
import { jsx as jsx51, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2239
2542
|
function Resizable({
|
|
2240
2543
|
panels = [],
|
|
2241
2544
|
direction = "horizontal",
|
|
@@ -2243,9 +2546,9 @@ function Resizable({
|
|
|
2243
2546
|
style
|
|
2244
2547
|
}) {
|
|
2245
2548
|
const { renderChildren } = useRenderer12();
|
|
2246
|
-
return /* @__PURE__ */
|
|
2247
|
-
index > 0 ? /* @__PURE__ */
|
|
2248
|
-
/* @__PURE__ */
|
|
2549
|
+
return /* @__PURE__ */ jsx51(PanelGroup, { orientation: direction, className, style, children: panels.map((panel, index) => /* @__PURE__ */ jsxs36(Fragment4, { children: [
|
|
2550
|
+
index > 0 ? /* @__PURE__ */ jsx51(ResizableHandle, { withHandle: true }) : null,
|
|
2551
|
+
/* @__PURE__ */ jsx51(
|
|
2249
2552
|
Panel,
|
|
2250
2553
|
{
|
|
2251
2554
|
defaultSize: typeof panel.defaultSizePx === "number" ? `${panel.defaultSizePx}px` : typeof panel.defaultSize === "number" ? `${panel.defaultSize}%` : void 0,
|
|
@@ -2258,7 +2561,7 @@ function Resizable({
|
|
|
2258
2561
|
}
|
|
2259
2562
|
|
|
2260
2563
|
// src/components/components/ScrollArea/index.tsx
|
|
2261
|
-
import { jsx as
|
|
2564
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
2262
2565
|
function ScrollArea2({
|
|
2263
2566
|
maxHeight,
|
|
2264
2567
|
maxWidth,
|
|
@@ -2266,7 +2569,7 @@ function ScrollArea2({
|
|
|
2266
2569
|
style,
|
|
2267
2570
|
children
|
|
2268
2571
|
}) {
|
|
2269
|
-
return /* @__PURE__ */
|
|
2572
|
+
return /* @__PURE__ */ jsx52(
|
|
2270
2573
|
ScrollArea,
|
|
2271
2574
|
{
|
|
2272
2575
|
className,
|
|
@@ -2277,9 +2580,9 @@ function ScrollArea2({
|
|
|
2277
2580
|
}
|
|
2278
2581
|
|
|
2279
2582
|
// src/components/components/Select/index.tsx
|
|
2280
|
-
import { useI18n as
|
|
2281
|
-
import { useEffect as
|
|
2282
|
-
import { jsx as
|
|
2583
|
+
import { useI18n as useI18n6 } from "@pactor-app/runtime";
|
|
2584
|
+
import { useEffect as useEffect10, useId as useId6 } from "react";
|
|
2585
|
+
import { jsx as jsx53, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2283
2586
|
function Select2({
|
|
2284
2587
|
name,
|
|
2285
2588
|
label,
|
|
@@ -2294,10 +2597,10 @@ function Select2({
|
|
|
2294
2597
|
style
|
|
2295
2598
|
}) {
|
|
2296
2599
|
const form = useFormContext();
|
|
2297
|
-
const { t } =
|
|
2298
|
-
const controlId =
|
|
2600
|
+
const { t } = useI18n6();
|
|
2601
|
+
const controlId = useId6();
|
|
2299
2602
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2300
|
-
|
|
2603
|
+
useEffect10(() => {
|
|
2301
2604
|
if (inForm && form && name) {
|
|
2302
2605
|
form.registerField(name, rules, value);
|
|
2303
2606
|
return () => form.unregisterField(name);
|
|
@@ -2313,13 +2616,13 @@ function Select2({
|
|
|
2313
2616
|
onChange?.(next ?? void 0);
|
|
2314
2617
|
};
|
|
2315
2618
|
const inFormRoot = inForm === true;
|
|
2316
|
-
const select = /* @__PURE__ */
|
|
2619
|
+
const select = /* @__PURE__ */ jsxs37(
|
|
2317
2620
|
"span",
|
|
2318
2621
|
{
|
|
2319
2622
|
className: cn("inline-flex items-center gap-1", !inFormRoot && className),
|
|
2320
2623
|
style: inFormRoot ? void 0 : style,
|
|
2321
2624
|
children: [
|
|
2322
|
-
/* @__PURE__ */
|
|
2625
|
+
/* @__PURE__ */ jsxs37(
|
|
2323
2626
|
Select,
|
|
2324
2627
|
{
|
|
2325
2628
|
items: options,
|
|
@@ -2328,8 +2631,8 @@ function Select2({
|
|
|
2328
2631
|
disabled,
|
|
2329
2632
|
name: inForm ? name : void 0,
|
|
2330
2633
|
children: [
|
|
2331
|
-
/* @__PURE__ */
|
|
2332
|
-
/* @__PURE__ */
|
|
2634
|
+
/* @__PURE__ */ jsx53(SelectTrigger, { id: controlId, children: /* @__PURE__ */ jsx53(SelectValue, { placeholder }) }),
|
|
2635
|
+
/* @__PURE__ */ jsx53(SelectContent, { children: options.map((option) => /* @__PURE__ */ jsx53(
|
|
2333
2636
|
SelectItem,
|
|
2334
2637
|
{
|
|
2335
2638
|
value: option.value,
|
|
@@ -2341,7 +2644,7 @@ function Select2({
|
|
|
2341
2644
|
]
|
|
2342
2645
|
}
|
|
2343
2646
|
),
|
|
2344
|
-
allowClear && selectedValue !== null && !disabled ? /* @__PURE__ */
|
|
2647
|
+
allowClear && selectedValue !== null && !disabled ? /* @__PURE__ */ jsx53(
|
|
2345
2648
|
"button",
|
|
2346
2649
|
{
|
|
2347
2650
|
type: "button",
|
|
@@ -2361,14 +2664,14 @@ function Select2({
|
|
|
2361
2664
|
);
|
|
2362
2665
|
if (inForm && form && name) {
|
|
2363
2666
|
const error = form.errors[name];
|
|
2364
|
-
return /* @__PURE__ */
|
|
2667
|
+
return /* @__PURE__ */ jsxs37(
|
|
2365
2668
|
"div",
|
|
2366
2669
|
{
|
|
2367
2670
|
"data-slot": "form-item",
|
|
2368
2671
|
className: cn(formItemClass(form.layout), className),
|
|
2369
2672
|
style,
|
|
2370
2673
|
children: [
|
|
2371
|
-
label ? /* @__PURE__ */
|
|
2674
|
+
label ? /* @__PURE__ */ jsx53(
|
|
2372
2675
|
"label",
|
|
2373
2676
|
{
|
|
2374
2677
|
htmlFor: controlId,
|
|
@@ -2377,7 +2680,7 @@ function Select2({
|
|
|
2377
2680
|
}
|
|
2378
2681
|
) : null,
|
|
2379
2682
|
select,
|
|
2380
|
-
error ? /* @__PURE__ */
|
|
2683
|
+
error ? /* @__PURE__ */ jsx53("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
2381
2684
|
]
|
|
2382
2685
|
}
|
|
2383
2686
|
);
|
|
@@ -2386,13 +2689,13 @@ function Select2({
|
|
|
2386
2689
|
}
|
|
2387
2690
|
|
|
2388
2691
|
// src/components/components/Separator/index.tsx
|
|
2389
|
-
import { jsx as
|
|
2692
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
2390
2693
|
function Separator2({ orientation = "horizontal", className, style }) {
|
|
2391
|
-
return /* @__PURE__ */
|
|
2694
|
+
return /* @__PURE__ */ jsx54(Separator, { orientation, className, style });
|
|
2392
2695
|
}
|
|
2393
2696
|
|
|
2394
2697
|
// src/components/components/Sheet/index.tsx
|
|
2395
|
-
import { jsx as
|
|
2698
|
+
import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
2396
2699
|
function Sheet2({
|
|
2397
2700
|
title,
|
|
2398
2701
|
open,
|
|
@@ -2402,7 +2705,7 @@ function Sheet2({
|
|
|
2402
2705
|
className,
|
|
2403
2706
|
style
|
|
2404
2707
|
}) {
|
|
2405
|
-
return /* @__PURE__ */
|
|
2708
|
+
return /* @__PURE__ */ jsx55(
|
|
2406
2709
|
Sheet,
|
|
2407
2710
|
{
|
|
2408
2711
|
open: open ?? false,
|
|
@@ -2411,9 +2714,9 @@ function Sheet2({
|
|
|
2411
2714
|
onClose?.();
|
|
2412
2715
|
}
|
|
2413
2716
|
},
|
|
2414
|
-
children: /* @__PURE__ */
|
|
2415
|
-
title ? /* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2717
|
+
children: /* @__PURE__ */ jsxs38(SheetContent, { side, className, style, children: [
|
|
2718
|
+
title ? /* @__PURE__ */ jsx55(SheetHeader, { children: /* @__PURE__ */ jsx55(SheetTitle, { children: title }) }) : null,
|
|
2719
|
+
/* @__PURE__ */ jsx55("div", { className: "flex-1 overflow-auto px-4", children })
|
|
2417
2720
|
] })
|
|
2418
2721
|
}
|
|
2419
2722
|
);
|
|
@@ -2421,7 +2724,7 @@ function Sheet2({
|
|
|
2421
2724
|
|
|
2422
2725
|
// src/components/components/Sider/index.tsx
|
|
2423
2726
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
2424
|
-
import { jsx as
|
|
2727
|
+
import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
2425
2728
|
function Sider({
|
|
2426
2729
|
width = 200,
|
|
2427
2730
|
collapsible,
|
|
@@ -2433,7 +2736,7 @@ function Sider({
|
|
|
2433
2736
|
children
|
|
2434
2737
|
}) {
|
|
2435
2738
|
const current = collapsed ? collapsedWidth : width;
|
|
2436
|
-
return /* @__PURE__ */
|
|
2739
|
+
return /* @__PURE__ */ jsxs39(
|
|
2437
2740
|
"aside",
|
|
2438
2741
|
{
|
|
2439
2742
|
"data-slot": "layout-sider",
|
|
@@ -2444,15 +2747,15 @@ function Sider({
|
|
|
2444
2747
|
),
|
|
2445
2748
|
style: { width: current, ...style },
|
|
2446
2749
|
children: [
|
|
2447
|
-
/* @__PURE__ */
|
|
2448
|
-
collapsible ? /* @__PURE__ */
|
|
2750
|
+
/* @__PURE__ */ jsx56("div", { className: "min-h-0 flex-1 overflow-auto", children }),
|
|
2751
|
+
collapsible ? /* @__PURE__ */ jsx56(
|
|
2449
2752
|
"button",
|
|
2450
2753
|
{
|
|
2451
2754
|
type: "button",
|
|
2452
2755
|
"aria-label": collapsed ? "expand sider" : "collapse sider",
|
|
2453
2756
|
className: "flex h-10 shrink-0 items-center justify-center border-t text-muted-foreground hover:text-foreground",
|
|
2454
2757
|
onClick: () => onCollapse?.(!collapsed),
|
|
2455
|
-
children: collapsed ? /* @__PURE__ */
|
|
2758
|
+
children: collapsed ? /* @__PURE__ */ jsx56(ChevronRight, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ jsx56(ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
2456
2759
|
}
|
|
2457
2760
|
) : null
|
|
2458
2761
|
]
|
|
@@ -2461,7 +2764,7 @@ function Sider({
|
|
|
2461
2764
|
}
|
|
2462
2765
|
|
|
2463
2766
|
// src/components/components/Skeleton/index.tsx
|
|
2464
|
-
import { jsx as
|
|
2767
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
2465
2768
|
var shapeDefaults = {
|
|
2466
2769
|
line: { className: "h-4 w-full", style: {} },
|
|
2467
2770
|
circle: { className: "rounded-full", style: { width: 40, height: 40 } },
|
|
@@ -2472,7 +2775,7 @@ function toSize(value) {
|
|
|
2472
2775
|
}
|
|
2473
2776
|
function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
2474
2777
|
const defaults = shapeDefaults[shape];
|
|
2475
|
-
return /* @__PURE__ */
|
|
2778
|
+
return /* @__PURE__ */ jsx57(
|
|
2476
2779
|
Skeleton,
|
|
2477
2780
|
{
|
|
2478
2781
|
className: cn(defaults.className, className),
|
|
@@ -2487,8 +2790,8 @@ function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
|
2487
2790
|
}
|
|
2488
2791
|
|
|
2489
2792
|
// src/components/components/Slider/index.tsx
|
|
2490
|
-
import { useEffect as
|
|
2491
|
-
import { jsx as
|
|
2793
|
+
import { useEffect as useEffect11 } from "react";
|
|
2794
|
+
import { jsx as jsx58, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
2492
2795
|
function Slider2({
|
|
2493
2796
|
name,
|
|
2494
2797
|
label,
|
|
@@ -2504,7 +2807,7 @@ function Slider2({
|
|
|
2504
2807
|
}) {
|
|
2505
2808
|
const form = useFormContext();
|
|
2506
2809
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2507
|
-
|
|
2810
|
+
useEffect11(() => {
|
|
2508
2811
|
if (inForm && form && name) {
|
|
2509
2812
|
form.registerField(name, rules, value);
|
|
2510
2813
|
return () => form.unregisterField(name);
|
|
@@ -2519,7 +2822,7 @@ function Slider2({
|
|
|
2519
2822
|
}
|
|
2520
2823
|
onChange?.(next);
|
|
2521
2824
|
};
|
|
2522
|
-
const slider = /* @__PURE__ */
|
|
2825
|
+
const slider = /* @__PURE__ */ jsx58(
|
|
2523
2826
|
Slider,
|
|
2524
2827
|
{
|
|
2525
2828
|
value: numberValue,
|
|
@@ -2531,14 +2834,14 @@ function Slider2({
|
|
|
2531
2834
|
onValueChange: handleChange,
|
|
2532
2835
|
className: inForm ? void 0 : className,
|
|
2533
2836
|
style: inForm ? void 0 : style,
|
|
2534
|
-
children: /* @__PURE__ */
|
|
2535
|
-
/* @__PURE__ */
|
|
2536
|
-
/* @__PURE__ */
|
|
2837
|
+
children: /* @__PURE__ */ jsxs40(SliderControl, { children: [
|
|
2838
|
+
/* @__PURE__ */ jsx58(SliderTrack, { children: /* @__PURE__ */ jsx58(SliderIndicator, {}) }),
|
|
2839
|
+
/* @__PURE__ */ jsx58(SliderThumb, {})
|
|
2537
2840
|
] })
|
|
2538
2841
|
}
|
|
2539
2842
|
);
|
|
2540
2843
|
if (inForm && form && name) {
|
|
2541
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ jsx58(
|
|
2542
2845
|
FieldShell,
|
|
2543
2846
|
{
|
|
2544
2847
|
layout: form.layout,
|
|
@@ -2555,11 +2858,11 @@ function Slider2({
|
|
|
2555
2858
|
|
|
2556
2859
|
// src/components/components/Sonner/index.tsx
|
|
2557
2860
|
import { useRenderer as useRenderer13 } from "@pactor-app/runtime";
|
|
2558
|
-
import { useEffect as
|
|
2559
|
-
import { jsx as
|
|
2861
|
+
import { useEffect as useEffect12 } from "react";
|
|
2862
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2560
2863
|
function Sonner({ className, style }) {
|
|
2561
2864
|
const { context } = useRenderer13();
|
|
2562
|
-
|
|
2865
|
+
useEffect12(() => {
|
|
2563
2866
|
const { actions } = context;
|
|
2564
2867
|
if (actions.has("toast")) {
|
|
2565
2868
|
return;
|
|
@@ -2573,36 +2876,36 @@ function Sonner({ className, style }) {
|
|
|
2573
2876
|
return { ok: true };
|
|
2574
2877
|
});
|
|
2575
2878
|
}, [context]);
|
|
2576
|
-
return /* @__PURE__ */
|
|
2879
|
+
return /* @__PURE__ */ jsx59("div", { "data-slot": "sonner", className, style, children: /* @__PURE__ */ jsx59(Toaster, {}) });
|
|
2577
2880
|
}
|
|
2578
2881
|
|
|
2579
2882
|
// src/components/components/Spinner/index.tsx
|
|
2580
|
-
import { jsx as
|
|
2883
|
+
import { jsx as jsx60 } from "react/jsx-runtime";
|
|
2581
2884
|
var sizeClass = {
|
|
2582
2885
|
sm: "size-3",
|
|
2583
2886
|
default: "size-4",
|
|
2584
2887
|
lg: "size-6"
|
|
2585
2888
|
};
|
|
2586
2889
|
function Spinner2({ size = "default", className, style }) {
|
|
2587
|
-
return /* @__PURE__ */
|
|
2890
|
+
return /* @__PURE__ */ jsx60(Spinner, { className: cn(sizeClass[size], className), style });
|
|
2588
2891
|
}
|
|
2589
2892
|
|
|
2590
2893
|
// src/components/components/Statistic/index.tsx
|
|
2591
|
-
import { jsx as
|
|
2894
|
+
import { jsx as jsx61, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
2592
2895
|
function Statistic({ title, value, precision, suffix, className, style }) {
|
|
2593
2896
|
const display = typeof value === "number" && precision !== void 0 ? value.toFixed(precision) : value;
|
|
2594
|
-
return /* @__PURE__ */
|
|
2595
|
-
title ? /* @__PURE__ */
|
|
2596
|
-
/* @__PURE__ */
|
|
2897
|
+
return /* @__PURE__ */ jsxs41("div", { "data-slot": "statistic", className: cn(className), style, children: [
|
|
2898
|
+
title ? /* @__PURE__ */ jsx61("div", { "data-slot": "statistic-title", className: "text-sm text-muted-foreground", children: title }) : null,
|
|
2899
|
+
/* @__PURE__ */ jsxs41("div", { "data-slot": "statistic-value", className: "text-2xl font-bold tabular-nums", children: [
|
|
2597
2900
|
display,
|
|
2598
|
-
suffix ? /* @__PURE__ */
|
|
2901
|
+
suffix ? /* @__PURE__ */ jsx61("span", { className: "ml-1 text-sm font-normal text-muted-foreground", children: suffix }) : null
|
|
2599
2902
|
] })
|
|
2600
2903
|
] });
|
|
2601
2904
|
}
|
|
2602
2905
|
|
|
2603
2906
|
// src/components/components/Switch/index.tsx
|
|
2604
|
-
import { useEffect as
|
|
2605
|
-
import { jsx as
|
|
2907
|
+
import { useEffect as useEffect13, useId as useId7 } from "react";
|
|
2908
|
+
import { jsx as jsx62, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
2606
2909
|
function Switch2({
|
|
2607
2910
|
name,
|
|
2608
2911
|
label,
|
|
@@ -2614,9 +2917,9 @@ function Switch2({
|
|
|
2614
2917
|
style
|
|
2615
2918
|
}) {
|
|
2616
2919
|
const form = useFormContext();
|
|
2617
|
-
const controlId =
|
|
2920
|
+
const controlId = useId7();
|
|
2618
2921
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2619
|
-
|
|
2922
|
+
useEffect13(() => {
|
|
2620
2923
|
if (inForm && form && name) {
|
|
2621
2924
|
form.registerField(name, rules, value);
|
|
2622
2925
|
return () => form.unregisterField(name);
|
|
@@ -2631,13 +2934,13 @@ function Switch2({
|
|
|
2631
2934
|
}
|
|
2632
2935
|
onChange?.(next);
|
|
2633
2936
|
};
|
|
2634
|
-
const control = /* @__PURE__ */
|
|
2937
|
+
const control = /* @__PURE__ */ jsxs42(
|
|
2635
2938
|
"span",
|
|
2636
2939
|
{
|
|
2637
2940
|
className: cn("inline-flex items-center gap-2", !inForm && className),
|
|
2638
2941
|
style: inForm ? void 0 : style,
|
|
2639
2942
|
children: [
|
|
2640
|
-
/* @__PURE__ */
|
|
2943
|
+
/* @__PURE__ */ jsx62(
|
|
2641
2944
|
Switch,
|
|
2642
2945
|
{
|
|
2643
2946
|
id: controlId,
|
|
@@ -2647,12 +2950,12 @@ function Switch2({
|
|
|
2647
2950
|
onCheckedChange: handleChange
|
|
2648
2951
|
}
|
|
2649
2952
|
),
|
|
2650
|
-
label ? /* @__PURE__ */
|
|
2953
|
+
label ? /* @__PURE__ */ jsx62("label", { htmlFor: controlId, className: "text-sm leading-none font-medium", children: label }) : null
|
|
2651
2954
|
]
|
|
2652
2955
|
}
|
|
2653
2956
|
);
|
|
2654
2957
|
if (inForm && form && name) {
|
|
2655
|
-
return /* @__PURE__ */
|
|
2958
|
+
return /* @__PURE__ */ jsxs42(
|
|
2656
2959
|
"div",
|
|
2657
2960
|
{
|
|
2658
2961
|
"data-slot": "form-item",
|
|
@@ -2660,7 +2963,7 @@ function Switch2({
|
|
|
2660
2963
|
style,
|
|
2661
2964
|
children: [
|
|
2662
2965
|
control,
|
|
2663
|
-
form.errors[name] ? /* @__PURE__ */
|
|
2966
|
+
form.errors[name] ? /* @__PURE__ */ jsx62("div", { "data-slot": "form-error", className: "mt-1.5 text-sm text-destructive", children: form.errors[name] }) : null
|
|
2664
2967
|
]
|
|
2665
2968
|
}
|
|
2666
2969
|
);
|
|
@@ -2669,9 +2972,9 @@ function Switch2({
|
|
|
2669
2972
|
}
|
|
2670
2973
|
|
|
2671
2974
|
// src/components/components/Table/index.tsx
|
|
2672
|
-
import { useI18n as
|
|
2673
|
-
import { useState as
|
|
2674
|
-
import { jsx as
|
|
2975
|
+
import { useI18n as useI18n7, useRenderer as useRenderer14 } from "@pactor-app/runtime";
|
|
2976
|
+
import { useState as useState12 } from "react";
|
|
2977
|
+
import { jsx as jsx63, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
2675
2978
|
function renderCellValue2(value) {
|
|
2676
2979
|
if (value === void 0 || value === null) {
|
|
2677
2980
|
return "";
|
|
@@ -2692,8 +2995,8 @@ function Table2({
|
|
|
2692
2995
|
style
|
|
2693
2996
|
}) {
|
|
2694
2997
|
const { renderChildren } = useRenderer14();
|
|
2695
|
-
const { t } =
|
|
2696
|
-
const [current, setCurrent] =
|
|
2998
|
+
const { t } = useI18n7();
|
|
2999
|
+
const [current, setCurrent] = useState12(1);
|
|
2697
3000
|
const pageSize = pagination === false ? void 0 : pagination?.pageSize;
|
|
2698
3001
|
const total = dataSource.length;
|
|
2699
3002
|
const pageCount = pageSize !== void 0 && pageSize > 0 ? Math.max(1, Math.ceil(total / pageSize)) : 1;
|
|
@@ -2702,8 +3005,8 @@ function Table2({
|
|
|
2702
3005
|
setCurrent(page);
|
|
2703
3006
|
onChange?.({ current: page, pageSize, total });
|
|
2704
3007
|
};
|
|
2705
|
-
return /* @__PURE__ */
|
|
2706
|
-
loading ? /* @__PURE__ */
|
|
3008
|
+
return /* @__PURE__ */ jsxs43("div", { "data-slot": "dsl-table", className: cn("relative", className), style, children: [
|
|
3009
|
+
loading ? /* @__PURE__ */ jsx63(
|
|
2707
3010
|
"div",
|
|
2708
3011
|
{
|
|
2709
3012
|
"data-slot": "table-loading",
|
|
@@ -2711,8 +3014,8 @@ function Table2({
|
|
|
2711
3014
|
children: t("pactor.table.loading")
|
|
2712
3015
|
}
|
|
2713
3016
|
) : null,
|
|
2714
|
-
/* @__PURE__ */
|
|
2715
|
-
/* @__PURE__ */
|
|
3017
|
+
/* @__PURE__ */ jsxs43(Table, { children: [
|
|
3018
|
+
/* @__PURE__ */ jsx63(TableHeader, { children: /* @__PURE__ */ jsx63(TableRow, { className: "hover:bg-transparent", children: columns.map((column, index) => /* @__PURE__ */ jsx63(
|
|
2716
3019
|
TableHead,
|
|
2717
3020
|
{
|
|
2718
3021
|
style: column.width !== void 0 ? { width: column.width } : void 0,
|
|
@@ -2720,7 +3023,7 @@ function Table2({
|
|
|
2720
3023
|
},
|
|
2721
3024
|
column.dataIndex ?? String(index)
|
|
2722
3025
|
)) }) }),
|
|
2723
|
-
/* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ jsx63(TableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ jsx63(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx63(TableCell, { colSpan: Math.max(1, columns.length), children: /* @__PURE__ */ jsx63(
|
|
2724
3027
|
"div",
|
|
2725
3028
|
{
|
|
2726
3029
|
"data-slot": "table-empty",
|
|
@@ -2729,10 +3032,10 @@ function Table2({
|
|
|
2729
3032
|
}
|
|
2730
3033
|
) }) }) : pageRows.map((row, rowIndex) => {
|
|
2731
3034
|
const key = row[rowKey];
|
|
2732
|
-
return /* @__PURE__ */
|
|
3035
|
+
return /* @__PURE__ */ jsx63(
|
|
2733
3036
|
TableRow,
|
|
2734
3037
|
{
|
|
2735
|
-
children: columns.map((column, columnIndex) => /* @__PURE__ */
|
|
3038
|
+
children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx63(TableCell, { children: column.cell ? renderChildren([column.cell], { row, rowIndex }) : renderCellValue2(
|
|
2736
3039
|
column.dataIndex === void 0 ? void 0 : row[column.dataIndex]
|
|
2737
3040
|
) }, column.dataIndex ?? String(columnIndex)))
|
|
2738
3041
|
},
|
|
@@ -2740,8 +3043,8 @@ function Table2({
|
|
|
2740
3043
|
);
|
|
2741
3044
|
}) })
|
|
2742
3045
|
] }),
|
|
2743
|
-
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */
|
|
2744
|
-
(page) => /* @__PURE__ */
|
|
3046
|
+
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */ jsx63("div", { "data-slot": "table-pagination", className: "mt-3 flex justify-end gap-1", children: Array.from({ length: pageCount }, (_, index) => index + 1).map(
|
|
3047
|
+
(page) => /* @__PURE__ */ jsx63(
|
|
2745
3048
|
Button,
|
|
2746
3049
|
{
|
|
2747
3050
|
type: "button",
|
|
@@ -2759,10 +3062,10 @@ function Table2({
|
|
|
2759
3062
|
|
|
2760
3063
|
// src/components/components/Tabs/index.tsx
|
|
2761
3064
|
import { useRenderer as useRenderer15 } from "@pactor-app/runtime";
|
|
2762
|
-
import { jsx as
|
|
3065
|
+
import { jsx as jsx64, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
2763
3066
|
function Tabs2({ items = [], activeKey, onChange, className, style }) {
|
|
2764
3067
|
const { renderChildren } = useRenderer15();
|
|
2765
|
-
return /* @__PURE__ */
|
|
3068
|
+
return /* @__PURE__ */ jsxs44(
|
|
2766
3069
|
Tabs,
|
|
2767
3070
|
{
|
|
2768
3071
|
value: activeKey,
|
|
@@ -2771,15 +3074,15 @@ function Tabs2({ items = [], activeKey, onChange, className, style }) {
|
|
|
2771
3074
|
className,
|
|
2772
3075
|
style,
|
|
2773
3076
|
children: [
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
items.map((item) => /* @__PURE__ */
|
|
3077
|
+
/* @__PURE__ */ jsx64(TabsList, { children: items.map((item) => /* @__PURE__ */ jsx64(TabsTrigger, { value: item.key, children: item.label }, item.key)) }),
|
|
3078
|
+
items.map((item) => /* @__PURE__ */ jsx64(TabsContent, { value: item.key, children: renderChildren(item.children) }, item.key))
|
|
2776
3079
|
]
|
|
2777
3080
|
}
|
|
2778
3081
|
);
|
|
2779
3082
|
}
|
|
2780
3083
|
|
|
2781
3084
|
// src/components/components/Text/index.tsx
|
|
2782
|
-
import { jsx as
|
|
3085
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
2783
3086
|
var typeClassMap = {
|
|
2784
3087
|
default: "",
|
|
2785
3088
|
secondary: "text-muted-foreground",
|
|
@@ -2798,7 +3101,7 @@ function Text({
|
|
|
2798
3101
|
style,
|
|
2799
3102
|
children
|
|
2800
3103
|
}) {
|
|
2801
|
-
return /* @__PURE__ */
|
|
3104
|
+
return /* @__PURE__ */ jsx65(
|
|
2802
3105
|
"span",
|
|
2803
3106
|
{
|
|
2804
3107
|
"data-slot": "text",
|
|
@@ -2818,8 +3121,8 @@ function Text({
|
|
|
2818
3121
|
}
|
|
2819
3122
|
|
|
2820
3123
|
// src/components/components/Textarea/index.tsx
|
|
2821
|
-
import { useEffect as
|
|
2822
|
-
import { jsx as
|
|
3124
|
+
import { useEffect as useEffect14, useId as useId8 } from "react";
|
|
3125
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
2823
3126
|
function Textarea2({
|
|
2824
3127
|
name,
|
|
2825
3128
|
label,
|
|
@@ -2833,9 +3136,9 @@ function Textarea2({
|
|
|
2833
3136
|
style
|
|
2834
3137
|
}) {
|
|
2835
3138
|
const form = useFormContext();
|
|
2836
|
-
const controlId =
|
|
3139
|
+
const controlId = useId8();
|
|
2837
3140
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2838
|
-
|
|
3141
|
+
useEffect14(() => {
|
|
2839
3142
|
if (inForm && form && name) {
|
|
2840
3143
|
form.registerField(name, rules, value);
|
|
2841
3144
|
return () => form.unregisterField(name);
|
|
@@ -2844,7 +3147,7 @@ function Textarea2({
|
|
|
2844
3147
|
});
|
|
2845
3148
|
if (inForm && form && name) {
|
|
2846
3149
|
const fieldValue = form.values[name];
|
|
2847
|
-
return /* @__PURE__ */
|
|
3150
|
+
return /* @__PURE__ */ jsx66(
|
|
2848
3151
|
FieldShell,
|
|
2849
3152
|
{
|
|
2850
3153
|
layout: form.layout,
|
|
@@ -2853,7 +3156,7 @@ function Textarea2({
|
|
|
2853
3156
|
error: form.errors[name],
|
|
2854
3157
|
className,
|
|
2855
3158
|
style,
|
|
2856
|
-
children: /* @__PURE__ */
|
|
3159
|
+
children: /* @__PURE__ */ jsx66(
|
|
2857
3160
|
Textarea,
|
|
2858
3161
|
{
|
|
2859
3162
|
id: controlId,
|
|
@@ -2870,7 +3173,7 @@ function Textarea2({
|
|
|
2870
3173
|
}
|
|
2871
3174
|
);
|
|
2872
3175
|
}
|
|
2873
|
-
return /* @__PURE__ */
|
|
3176
|
+
return /* @__PURE__ */ jsx66(
|
|
2874
3177
|
Textarea,
|
|
2875
3178
|
{
|
|
2876
3179
|
value: value ?? "",
|
|
@@ -2885,7 +3188,7 @@ function Textarea2({
|
|
|
2885
3188
|
}
|
|
2886
3189
|
|
|
2887
3190
|
// src/components/components/Toggle/index.tsx
|
|
2888
|
-
import { jsx as
|
|
3191
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
2889
3192
|
function Toggle2({
|
|
2890
3193
|
text,
|
|
2891
3194
|
pressed,
|
|
@@ -2896,7 +3199,7 @@ function Toggle2({
|
|
|
2896
3199
|
className,
|
|
2897
3200
|
style
|
|
2898
3201
|
}) {
|
|
2899
|
-
return /* @__PURE__ */
|
|
3202
|
+
return /* @__PURE__ */ jsx67(
|
|
2900
3203
|
Toggle,
|
|
2901
3204
|
{
|
|
2902
3205
|
pressed,
|
|
@@ -2912,7 +3215,7 @@ function Toggle2({
|
|
|
2912
3215
|
}
|
|
2913
3216
|
|
|
2914
3217
|
// src/components/components/ToggleGroup/index.tsx
|
|
2915
|
-
import { jsx as
|
|
3218
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
2916
3219
|
function ToggleGroup2({
|
|
2917
3220
|
options = [],
|
|
2918
3221
|
value,
|
|
@@ -2932,7 +3235,7 @@ function ToggleGroup2({
|
|
|
2932
3235
|
onChange?.(added ?? void 0);
|
|
2933
3236
|
}
|
|
2934
3237
|
};
|
|
2935
|
-
return /* @__PURE__ */
|
|
3238
|
+
return /* @__PURE__ */ jsx68(
|
|
2936
3239
|
ToggleGroup,
|
|
2937
3240
|
{
|
|
2938
3241
|
value: groupValue,
|
|
@@ -2941,7 +3244,7 @@ function ToggleGroup2({
|
|
|
2941
3244
|
onValueChange: (next) => handleChange(next),
|
|
2942
3245
|
className,
|
|
2943
3246
|
style,
|
|
2944
|
-
children: options.map((option) => /* @__PURE__ */
|
|
3247
|
+
children: options.map((option) => /* @__PURE__ */ jsx68(
|
|
2945
3248
|
ToggleGroupItem,
|
|
2946
3249
|
{
|
|
2947
3250
|
value: option.value,
|
|
@@ -2955,23 +3258,23 @@ function ToggleGroup2({
|
|
|
2955
3258
|
}
|
|
2956
3259
|
|
|
2957
3260
|
// src/components/components/Tooltip/index.tsx
|
|
2958
|
-
import { jsx as
|
|
3261
|
+
import { jsx as jsx69, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
2959
3262
|
function Tooltip3({ content, children, className, style }) {
|
|
2960
|
-
return /* @__PURE__ */
|
|
2961
|
-
/* @__PURE__ */
|
|
2962
|
-
/* @__PURE__ */
|
|
3263
|
+
return /* @__PURE__ */ jsxs45(Tooltip, { children: [
|
|
3264
|
+
/* @__PURE__ */ jsx69(TooltipTrigger, { render: triggerWrapper("tooltip-trigger-wrap"), children }),
|
|
3265
|
+
/* @__PURE__ */ jsx69(TooltipContent, { className, style, children: content })
|
|
2963
3266
|
] });
|
|
2964
3267
|
}
|
|
2965
3268
|
|
|
2966
3269
|
// src/components/components/Typography/index.tsx
|
|
2967
|
-
import { jsx as
|
|
3270
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
2968
3271
|
function Typography2({
|
|
2969
3272
|
variant = "p",
|
|
2970
3273
|
text,
|
|
2971
3274
|
className,
|
|
2972
3275
|
style
|
|
2973
3276
|
}) {
|
|
2974
|
-
return /* @__PURE__ */
|
|
3277
|
+
return /* @__PURE__ */ jsx70(Typography, { variant, className, style, children: text });
|
|
2975
3278
|
}
|
|
2976
3279
|
|
|
2977
3280
|
// src/components/register.ts
|
|
@@ -3036,6 +3339,7 @@ var builtinComponents = {
|
|
|
3036
3339
|
HoverCard: HoverCard2,
|
|
3037
3340
|
// 复合类扩展组件(第三批)
|
|
3038
3341
|
Calendar: Calendar2,
|
|
3342
|
+
DatePicker,
|
|
3039
3343
|
InputOTP: InputOTP2,
|
|
3040
3344
|
Combobox: Combobox2,
|
|
3041
3345
|
Carousel: Carousel2,
|
|
@@ -3089,6 +3393,7 @@ export {
|
|
|
3089
3393
|
Content,
|
|
3090
3394
|
ContextMenu2 as ContextMenu,
|
|
3091
3395
|
DataTable,
|
|
3396
|
+
DatePicker,
|
|
3092
3397
|
Dialog2 as Dialog,
|
|
3093
3398
|
Drawer2 as Drawer,
|
|
3094
3399
|
DropdownMenu2 as DropdownMenu,
|