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