@pactor-app/ui 1.10.0 → 1.11.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-M4PHRT2N.js → chunk-HW6M3BEF.js} +81 -34
- package/dist/{chunk-VT5XP4U4.js → chunk-NVORKHWX.js} +34 -18
- package/dist/components/index.cjs +138 -77
- package/dist/components/index.d.cts +23 -9
- package/dist/components/index.d.ts +23 -9
- package/dist/components/index.js +2 -2
- package/dist/index.cjs +150 -89
- package/dist/index.js +2 -2
- package/dist/ui/index.cjs +49 -33
- package/dist/ui/index.d.cts +7 -1
- package/dist/ui/index.d.ts +7 -1
- package/dist/ui/index.js +1 -1
- package/package.json +5 -5
|
@@ -861,6 +861,7 @@ var import_react2 = require("react");
|
|
|
861
861
|
|
|
862
862
|
// src/ui/breadcrumb.tsx
|
|
863
863
|
var import_lucide_react3 = require("lucide-react");
|
|
864
|
+
var React2 = __toESM(require("react"), 1);
|
|
864
865
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
865
866
|
function Breadcrumb({ ...props }) {
|
|
866
867
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
|
|
@@ -888,12 +889,27 @@ function BreadcrumbItem({ className, ...props }) {
|
|
|
888
889
|
}
|
|
889
890
|
);
|
|
890
891
|
}
|
|
891
|
-
function BreadcrumbLink({
|
|
892
|
+
function BreadcrumbLink({
|
|
893
|
+
className,
|
|
894
|
+
render,
|
|
895
|
+
...props
|
|
896
|
+
}) {
|
|
897
|
+
const linkClassName = cn("transition-colors hover:text-foreground", className);
|
|
898
|
+
if (render) {
|
|
899
|
+
return React2.cloneElement(render, {
|
|
900
|
+
"data-slot": "breadcrumb-link",
|
|
901
|
+
...props,
|
|
902
|
+
className: cn(
|
|
903
|
+
linkClassName,
|
|
904
|
+
render.props.className
|
|
905
|
+
)
|
|
906
|
+
});
|
|
907
|
+
}
|
|
892
908
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
893
909
|
"a",
|
|
894
910
|
{
|
|
895
911
|
"data-slot": "breadcrumb-link",
|
|
896
|
-
className:
|
|
912
|
+
className: linkClassName,
|
|
897
913
|
...props
|
|
898
914
|
}
|
|
899
915
|
);
|
|
@@ -929,14 +945,37 @@ function BreadcrumbSeparator({
|
|
|
929
945
|
);
|
|
930
946
|
}
|
|
931
947
|
|
|
948
|
+
// src/components/spa-link.ts
|
|
949
|
+
var import_runtime3 = require("@pactor-app/runtime");
|
|
950
|
+
function shouldInterceptLinkClick(event, href, target) {
|
|
951
|
+
return typeof href === "string" && href.startsWith("/") && (target === void 0 || target === "_self") && event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey;
|
|
952
|
+
}
|
|
953
|
+
function useSpaLinkClick() {
|
|
954
|
+
const { context } = (0, import_runtime3.useRenderer)();
|
|
955
|
+
return (event, href, target) => {
|
|
956
|
+
if (shouldInterceptLinkClick(event, href, target)) {
|
|
957
|
+
event.preventDefault();
|
|
958
|
+
context.route.navigate(href);
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
|
|
932
963
|
// src/components/components/Breadcrumb/index.tsx
|
|
933
964
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
934
965
|
function Breadcrumb2({ items = [], className, style }) {
|
|
966
|
+
const handleSpaClick = useSpaLinkClick();
|
|
935
967
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Breadcrumb, { className, style, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BreadcrumbList, { children: items.map((item, index) => {
|
|
936
968
|
const isLast = index === items.length - 1;
|
|
937
969
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react2.Fragment, { children: [
|
|
938
970
|
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BreadcrumbSeparator, {}) : null,
|
|
939
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BreadcrumbItem, { children: isLast || !item.href ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
971
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BreadcrumbItem, { children: isLast || !item.href ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BreadcrumbPage, { children: item.label }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
972
|
+
BreadcrumbLink,
|
|
973
|
+
{
|
|
974
|
+
href: item.href,
|
|
975
|
+
onClick: (event) => handleSpaClick(event, item.href),
|
|
976
|
+
children: item.label
|
|
977
|
+
}
|
|
978
|
+
) })
|
|
940
979
|
] }, `${item.label}-${index}`);
|
|
941
980
|
}) }) });
|
|
942
981
|
}
|
|
@@ -958,6 +997,7 @@ var sizeMap = {
|
|
|
958
997
|
};
|
|
959
998
|
function Button2({
|
|
960
999
|
text,
|
|
1000
|
+
icon,
|
|
961
1001
|
variant = "default",
|
|
962
1002
|
danger,
|
|
963
1003
|
size = "middle",
|
|
@@ -986,7 +1026,7 @@ function Button2({
|
|
|
986
1026
|
className
|
|
987
1027
|
),
|
|
988
1028
|
children: [
|
|
989
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react4.Loader2, { "aria-hidden": true, className: "animate-spin" }) : null,
|
|
1029
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react4.Loader2, { "aria-hidden": true, className: "animate-spin" }) : icon ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Icon, { name: icon, size: "sm" }) : null,
|
|
990
1030
|
text ?? children
|
|
991
1031
|
]
|
|
992
1032
|
}
|
|
@@ -1259,17 +1299,17 @@ function Card2({ title, bordered = true, rounded, className, style, children })
|
|
|
1259
1299
|
}
|
|
1260
1300
|
|
|
1261
1301
|
// src/components/components/Carousel/index.tsx
|
|
1262
|
-
var
|
|
1302
|
+
var import_runtime4 = require("@pactor-app/runtime");
|
|
1263
1303
|
var import_react5 = require("react");
|
|
1264
1304
|
|
|
1265
1305
|
// src/ui/carousel.tsx
|
|
1266
1306
|
var import_embla_carousel_react = __toESM(require("embla-carousel-react"), 1);
|
|
1267
1307
|
var import_lucide_react6 = require("lucide-react");
|
|
1268
|
-
var
|
|
1308
|
+
var React3 = __toESM(require("react"), 1);
|
|
1269
1309
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1270
|
-
var CarouselContext =
|
|
1310
|
+
var CarouselContext = React3.createContext(null);
|
|
1271
1311
|
function useCarousel() {
|
|
1272
|
-
const context =
|
|
1312
|
+
const context = React3.useContext(CarouselContext);
|
|
1273
1313
|
if (!context) {
|
|
1274
1314
|
throw new Error("useCarousel must be used within a <Carousel />");
|
|
1275
1315
|
}
|
|
@@ -1288,16 +1328,16 @@ function Carousel({
|
|
|
1288
1328
|
{ ...opts, axis: orientation === "horizontal" ? "x" : "y" },
|
|
1289
1329
|
plugins
|
|
1290
1330
|
);
|
|
1291
|
-
const [canScrollPrev, setCanScrollPrev] =
|
|
1292
|
-
const [canScrollNext, setCanScrollNext] =
|
|
1293
|
-
const onSelect =
|
|
1331
|
+
const [canScrollPrev, setCanScrollPrev] = React3.useState(false);
|
|
1332
|
+
const [canScrollNext, setCanScrollNext] = React3.useState(false);
|
|
1333
|
+
const onSelect = React3.useCallback((carouselApi) => {
|
|
1294
1334
|
if (!carouselApi) return;
|
|
1295
1335
|
setCanScrollPrev(carouselApi.canScrollPrev());
|
|
1296
1336
|
setCanScrollNext(carouselApi.canScrollNext());
|
|
1297
1337
|
}, []);
|
|
1298
|
-
const scrollPrev =
|
|
1299
|
-
const scrollNext =
|
|
1300
|
-
const handleKeyDown =
|
|
1338
|
+
const scrollPrev = React3.useCallback(() => api?.scrollPrev(), [api]);
|
|
1339
|
+
const scrollNext = React3.useCallback(() => api?.scrollNext(), [api]);
|
|
1340
|
+
const handleKeyDown = React3.useCallback(
|
|
1301
1341
|
(event) => {
|
|
1302
1342
|
if (event.key === "ArrowLeft") {
|
|
1303
1343
|
event.preventDefault();
|
|
@@ -1309,10 +1349,10 @@ function Carousel({
|
|
|
1309
1349
|
},
|
|
1310
1350
|
[scrollPrev, scrollNext]
|
|
1311
1351
|
);
|
|
1312
|
-
|
|
1352
|
+
React3.useEffect(() => {
|
|
1313
1353
|
if (api && setApi) setApi(api);
|
|
1314
1354
|
}, [api, setApi]);
|
|
1315
|
-
|
|
1355
|
+
React3.useEffect(() => {
|
|
1316
1356
|
if (!api) return;
|
|
1317
1357
|
onSelect(api);
|
|
1318
1358
|
api.on("reInit", onSelect);
|
|
@@ -1449,7 +1489,7 @@ function Carousel2({
|
|
|
1449
1489
|
className,
|
|
1450
1490
|
style
|
|
1451
1491
|
}) {
|
|
1452
|
-
const { renderChildren } = (0,
|
|
1492
|
+
const { renderChildren } = (0, import_runtime4.useRenderer)();
|
|
1453
1493
|
const [api, setApi] = (0, import_react5.useState)();
|
|
1454
1494
|
(0, import_react5.useEffect)(() => {
|
|
1455
1495
|
if (!api || !autoplay) return;
|
|
@@ -1965,7 +2005,7 @@ function Combobox2({
|
|
|
1965
2005
|
}
|
|
1966
2006
|
|
|
1967
2007
|
// src/components/components/Command/index.tsx
|
|
1968
|
-
var
|
|
2008
|
+
var import_runtime5 = require("@pactor-app/runtime");
|
|
1969
2009
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1970
2010
|
function Command2({
|
|
1971
2011
|
groups = [],
|
|
@@ -1975,7 +2015,7 @@ function Command2({
|
|
|
1975
2015
|
className,
|
|
1976
2016
|
style
|
|
1977
2017
|
}) {
|
|
1978
|
-
const { t } = (0,
|
|
2018
|
+
const { t } = (0, import_runtime5.useI18n)();
|
|
1979
2019
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Command, { className, style, children: [
|
|
1980
2020
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CommandInput, { placeholder }),
|
|
1981
2021
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(CommandList, { children: [
|
|
@@ -2125,7 +2165,7 @@ function Chart({
|
|
|
2125
2165
|
}
|
|
2126
2166
|
|
|
2127
2167
|
// src/components/components/ChatInput/index.tsx
|
|
2128
|
-
var
|
|
2168
|
+
var import_runtime6 = require("@pactor-app/runtime");
|
|
2129
2169
|
var import_lucide_react11 = require("lucide-react");
|
|
2130
2170
|
var import_react9 = require("react");
|
|
2131
2171
|
|
|
@@ -2165,7 +2205,7 @@ function ChatInput({
|
|
|
2165
2205
|
className,
|
|
2166
2206
|
style
|
|
2167
2207
|
}) {
|
|
2168
|
-
const { renderChildren } = (0,
|
|
2208
|
+
const { renderChildren } = (0, import_runtime6.useRenderer)();
|
|
2169
2209
|
const controlled = value !== void 0;
|
|
2170
2210
|
const [draft, setDraft] = (0, import_react9.useState)("");
|
|
2171
2211
|
const text = controlled ? value : draft;
|
|
@@ -2333,7 +2373,7 @@ function ContextMenu2({
|
|
|
2333
2373
|
}
|
|
2334
2374
|
|
|
2335
2375
|
// src/components/components/DataTable/index.tsx
|
|
2336
|
-
var
|
|
2376
|
+
var import_runtime7 = require("@pactor-app/runtime");
|
|
2337
2377
|
var import_lucide_react12 = require("lucide-react");
|
|
2338
2378
|
var import_react10 = require("react");
|
|
2339
2379
|
|
|
@@ -2461,8 +2501,8 @@ function DataTable({
|
|
|
2461
2501
|
className,
|
|
2462
2502
|
style
|
|
2463
2503
|
}) {
|
|
2464
|
-
const { renderChildren } = (0,
|
|
2465
|
-
const { t } = (0,
|
|
2504
|
+
const { renderChildren } = (0, import_runtime7.useRenderer)();
|
|
2505
|
+
const { t } = (0, import_runtime7.useI18n)();
|
|
2466
2506
|
const [sortState, setSortState] = (0, import_react10.useState)(sort);
|
|
2467
2507
|
const [filters, setFilters] = (0, import_react10.useState)({});
|
|
2468
2508
|
const [current, setCurrent] = (0, import_react10.useState)(1);
|
|
@@ -2581,7 +2621,7 @@ function DataTable({
|
|
|
2581
2621
|
}
|
|
2582
2622
|
|
|
2583
2623
|
// src/components/components/DatePicker/index.tsx
|
|
2584
|
-
var
|
|
2624
|
+
var import_runtime8 = require("@pactor-app/runtime");
|
|
2585
2625
|
var import_date_fns2 = require("date-fns");
|
|
2586
2626
|
var import_locale = require("date-fns/locale");
|
|
2587
2627
|
var import_lucide_react13 = require("lucide-react");
|
|
@@ -2627,7 +2667,7 @@ function DatePicker(props) {
|
|
|
2627
2667
|
const value = props.value;
|
|
2628
2668
|
const onChange = props.onChange;
|
|
2629
2669
|
const form = useFormContext();
|
|
2630
|
-
const { locale, t } = (0,
|
|
2670
|
+
const { locale, t } = (0, import_runtime8.useI18n)();
|
|
2631
2671
|
const dfLocale = toDateFnsLocale(locale);
|
|
2632
2672
|
const controlId = (0, import_react11.useId)();
|
|
2633
2673
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
@@ -2870,7 +2910,7 @@ function DatePicker(props) {
|
|
|
2870
2910
|
}
|
|
2871
2911
|
|
|
2872
2912
|
// src/components/components/Dialog/index.tsx
|
|
2873
|
-
var
|
|
2913
|
+
var import_runtime9 = require("@pactor-app/runtime");
|
|
2874
2914
|
var import_react12 = require("react");
|
|
2875
2915
|
|
|
2876
2916
|
// src/ui/dialog.tsx
|
|
@@ -2998,7 +3038,7 @@ function Dialog2({
|
|
|
2998
3038
|
className,
|
|
2999
3039
|
style
|
|
3000
3040
|
}) {
|
|
3001
|
-
const { renderChildren } = (0,
|
|
3041
|
+
const { renderChildren } = (0, import_runtime9.useRenderer)();
|
|
3002
3042
|
const [innerOpen, setInnerOpen] = (0, import_react12.useState)(false);
|
|
3003
3043
|
const controlled = open !== void 0;
|
|
3004
3044
|
const visible = controlled ? open : innerOpen;
|
|
@@ -3397,9 +3437,15 @@ function FieldError({ className, ...props }) {
|
|
|
3397
3437
|
|
|
3398
3438
|
// src/components/components/Field/index.tsx
|
|
3399
3439
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3400
|
-
function Field2({ label, description, error, children, className, style }) {
|
|
3440
|
+
function Field2({ label, required, description, error, children, className, style }) {
|
|
3401
3441
|
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Field, { className, style, children: [
|
|
3402
|
-
label ? /* @__PURE__ */ (0, import_jsx_runtime56.
|
|
3442
|
+
label ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(FieldLabel, { children: [
|
|
3443
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("span", { "aria-hidden": true, className: "text-destructive", children: [
|
|
3444
|
+
"*",
|
|
3445
|
+
" "
|
|
3446
|
+
] }) : null,
|
|
3447
|
+
label
|
|
3448
|
+
] }) : null,
|
|
3403
3449
|
children,
|
|
3404
3450
|
description ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FieldDescription, { children: description }) : null,
|
|
3405
3451
|
error ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FieldError, { match: true, children: error }) : null
|
|
@@ -3474,7 +3520,7 @@ function Footer({ className, style, children }) {
|
|
|
3474
3520
|
}
|
|
3475
3521
|
|
|
3476
3522
|
// src/components/components/Form/index.tsx
|
|
3477
|
-
var
|
|
3523
|
+
var import_runtime10 = require("@pactor-app/runtime");
|
|
3478
3524
|
var import_react13 = require("react");
|
|
3479
3525
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3480
3526
|
function isEmpty(value) {
|
|
@@ -3490,7 +3536,7 @@ function Form({
|
|
|
3490
3536
|
onSubmit,
|
|
3491
3537
|
onValuesChange
|
|
3492
3538
|
}) {
|
|
3493
|
-
const { context } = (0,
|
|
3539
|
+
const { context } = (0, import_runtime10.useRenderer)();
|
|
3494
3540
|
const [values, setValues] = (0, import_react13.useState)(() => ({
|
|
3495
3541
|
...initialValues
|
|
3496
3542
|
}));
|
|
@@ -3591,7 +3637,7 @@ function Grid({ columns = 1, gap, className, style, children }) {
|
|
|
3591
3637
|
}
|
|
3592
3638
|
|
|
3593
3639
|
// src/components/components/Header/index.tsx
|
|
3594
|
-
var
|
|
3640
|
+
var import_runtime11 = require("@pactor-app/runtime");
|
|
3595
3641
|
var import_lucide_react16 = require("lucide-react");
|
|
3596
3642
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3597
3643
|
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";
|
|
@@ -3774,7 +3820,7 @@ function HeaderLocalesArea({
|
|
|
3774
3820
|
locales,
|
|
3775
3821
|
onSelect
|
|
3776
3822
|
}) {
|
|
3777
|
-
const { locale } = (0,
|
|
3823
|
+
const { locale } = (0, import_runtime11.useI18n)();
|
|
3778
3824
|
const current = locales.find((option) => option.value === locale);
|
|
3779
3825
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(DropdownMenu, { children: [
|
|
3780
3826
|
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
@@ -3800,7 +3846,7 @@ function HeaderLocalesArea({
|
|
|
3800
3846
|
}
|
|
3801
3847
|
|
|
3802
3848
|
// src/components/components/HoverCard/index.tsx
|
|
3803
|
-
var
|
|
3849
|
+
var import_runtime12 = require("@pactor-app/runtime");
|
|
3804
3850
|
|
|
3805
3851
|
// src/ui/hover-card.tsx
|
|
3806
3852
|
var import_preview_card = require("@base-ui/react/preview-card");
|
|
@@ -3850,7 +3896,7 @@ function isDslNode2(value) {
|
|
|
3850
3896
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
3851
3897
|
}
|
|
3852
3898
|
function HoverCard2({ content, children, className, style }) {
|
|
3853
|
-
const { renderChildren } = (0,
|
|
3899
|
+
const { renderChildren } = (0, import_runtime12.useRenderer)();
|
|
3854
3900
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(HoverCard, { children: [
|
|
3855
3901
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(HoverCardTrigger, { render: triggerWrapper("hover-card-trigger-wrap"), children }),
|
|
3856
3902
|
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(HoverCardContent, { className, style, children: isDslNode2(content) ? renderChildren([content]) : content })
|
|
@@ -3858,7 +3904,7 @@ function HoverCard2({ content, children, className, style }) {
|
|
|
3858
3904
|
}
|
|
3859
3905
|
|
|
3860
3906
|
// src/components/components/Input/index.tsx
|
|
3861
|
-
var
|
|
3907
|
+
var import_runtime13 = require("@pactor-app/runtime");
|
|
3862
3908
|
var import_react15 = require("react");
|
|
3863
3909
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
3864
3910
|
function Input2({
|
|
@@ -3872,10 +3918,11 @@ function Input2({
|
|
|
3872
3918
|
allowClear,
|
|
3873
3919
|
onChange,
|
|
3874
3920
|
className,
|
|
3921
|
+
controlClassName,
|
|
3875
3922
|
style
|
|
3876
3923
|
}) {
|
|
3877
3924
|
const form = useFormContext();
|
|
3878
|
-
const { t } = (0,
|
|
3925
|
+
const { t } = (0, import_runtime13.useI18n)();
|
|
3879
3926
|
const controlId = (0, import_react15.useId)();
|
|
3880
3927
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
3881
3928
|
(0, import_react15.useEffect)(() => {
|
|
@@ -3903,7 +3950,10 @@ function Input2({
|
|
|
3903
3950
|
value: currentValue,
|
|
3904
3951
|
placeholder,
|
|
3905
3952
|
disabled,
|
|
3906
|
-
className:
|
|
3953
|
+
className: cn(
|
|
3954
|
+
!inFormRoot && allowClear !== true && className,
|
|
3955
|
+
allowClear !== true && controlClassName
|
|
3956
|
+
),
|
|
3907
3957
|
style: !inFormRoot && allowClear !== true ? style : void 0,
|
|
3908
3958
|
onChange: (event) => {
|
|
3909
3959
|
if (inForm && form && name) {
|
|
@@ -3926,7 +3976,11 @@ function Input2({
|
|
|
3926
3976
|
const control = allowClear === true ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
|
|
3927
3977
|
"span",
|
|
3928
3978
|
{
|
|
3929
|
-
className: cn(
|
|
3979
|
+
className: cn(
|
|
3980
|
+
"flex items-center gap-1",
|
|
3981
|
+
!inFormRoot && className,
|
|
3982
|
+
controlClassName
|
|
3983
|
+
),
|
|
3930
3984
|
style: inFormRoot ? void 0 : style,
|
|
3931
3985
|
children: [
|
|
3932
3986
|
input,
|
|
@@ -3993,7 +4047,7 @@ var import_react16 = require("react");
|
|
|
3993
4047
|
// src/ui/input-otp.tsx
|
|
3994
4048
|
var import_input_otp = require("input-otp");
|
|
3995
4049
|
var import_lucide_react17 = require("lucide-react");
|
|
3996
|
-
var
|
|
4050
|
+
var React4 = __toESM(require("react"), 1);
|
|
3997
4051
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3998
4052
|
function InputOTP({
|
|
3999
4053
|
className,
|
|
@@ -4028,7 +4082,7 @@ function InputOTPSlot({
|
|
|
4028
4082
|
className,
|
|
4029
4083
|
...props
|
|
4030
4084
|
}) {
|
|
4031
|
-
const inputOTPContext =
|
|
4085
|
+
const inputOTPContext = React4.useContext(import_input_otp.OTPInputContext);
|
|
4032
4086
|
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {};
|
|
4033
4087
|
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
4034
4088
|
"div",
|
|
@@ -4117,7 +4171,7 @@ function InputOTP2({
|
|
|
4117
4171
|
}
|
|
4118
4172
|
|
|
4119
4173
|
// src/components/components/Item/index.tsx
|
|
4120
|
-
var
|
|
4174
|
+
var import_runtime14 = require("@pactor-app/runtime");
|
|
4121
4175
|
|
|
4122
4176
|
// src/ui/item.tsx
|
|
4123
4177
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
@@ -4198,7 +4252,7 @@ function Item2({
|
|
|
4198
4252
|
className,
|
|
4199
4253
|
style
|
|
4200
4254
|
}) {
|
|
4201
|
-
const { renderChildren } = (0,
|
|
4255
|
+
const { renderChildren } = (0, import_runtime14.useRenderer)();
|
|
4202
4256
|
const mediaNodes = media === void 0 ? [] : Array.isArray(media) ? media : [media];
|
|
4203
4257
|
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(Item, { className, style, children: [
|
|
4204
4258
|
mediaNodes.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(ItemMedia, { children: renderChildren(mediaNodes) }) : null,
|
|
@@ -4259,10 +4313,10 @@ function Label2({ text, htmlFor, className, style }) {
|
|
|
4259
4313
|
|
|
4260
4314
|
// src/components/components/Layout/index.tsx
|
|
4261
4315
|
var import_core = require("@pactor-app/core");
|
|
4262
|
-
var
|
|
4316
|
+
var import_runtime15 = require("@pactor-app/runtime");
|
|
4263
4317
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
4264
4318
|
function Layout({ direction, className, style, dslChildren }) {
|
|
4265
|
-
const { renderChildren, context } = (0,
|
|
4319
|
+
const { renderChildren, context } = (0, import_runtime15.useRenderer)();
|
|
4266
4320
|
const hasSider = Array.isArray(dslChildren) ? dslChildren.some(
|
|
4267
4321
|
(child) => !(0, import_core.isDslSourceRef)(child) && resolveRootType(child, context) === "Sider"
|
|
4268
4322
|
) : false;
|
|
@@ -4293,6 +4347,7 @@ function resolveRootType(node, context) {
|
|
|
4293
4347
|
// src/components/components/Link/index.tsx
|
|
4294
4348
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
4295
4349
|
function Link2({ href, text, target, className, style, children }) {
|
|
4350
|
+
const handleSpaClick = useSpaLinkClick();
|
|
4296
4351
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
4297
4352
|
"a",
|
|
4298
4353
|
{
|
|
@@ -4302,6 +4357,7 @@ function Link2({ href, text, target, className, style, children }) {
|
|
|
4302
4357
|
rel: target === "_blank" ? "noreferrer" : void 0,
|
|
4303
4358
|
className: cn("text-primary underline-offset-4 hover:underline", className),
|
|
4304
4359
|
style,
|
|
4360
|
+
onClick: (event) => handleSpaClick(event, href, target),
|
|
4305
4361
|
children: text ?? children
|
|
4306
4362
|
}
|
|
4307
4363
|
);
|
|
@@ -4383,11 +4439,11 @@ function RailTooltip({
|
|
|
4383
4439
|
}
|
|
4384
4440
|
|
|
4385
4441
|
// src/components/components/Sidebar/index.tsx
|
|
4386
|
-
var
|
|
4442
|
+
var import_runtime16 = require("@pactor-app/runtime");
|
|
4387
4443
|
var import_react18 = require("react");
|
|
4388
4444
|
|
|
4389
4445
|
// src/ui/sidebar.tsx
|
|
4390
|
-
var
|
|
4446
|
+
var React5 = __toESM(require("react"), 1);
|
|
4391
4447
|
var import_class_variance_authority5 = require("class-variance-authority");
|
|
4392
4448
|
var import_lucide_react19 = require("lucide-react");
|
|
4393
4449
|
|
|
@@ -4579,9 +4635,9 @@ var SIDEBAR_WIDTH = "16rem";
|
|
|
4579
4635
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
4580
4636
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
4581
4637
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
4582
|
-
var SidebarContext =
|
|
4638
|
+
var SidebarContext = React5.createContext(null);
|
|
4583
4639
|
function useSidebar() {
|
|
4584
|
-
const context =
|
|
4640
|
+
const context = React5.useContext(SidebarContext);
|
|
4585
4641
|
if (!context) {
|
|
4586
4642
|
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
4587
4643
|
}
|
|
@@ -4597,10 +4653,10 @@ function SidebarProvider({
|
|
|
4597
4653
|
...props
|
|
4598
4654
|
}) {
|
|
4599
4655
|
const isMobile = useIsMobile();
|
|
4600
|
-
const [openMobile, setOpenMobile] =
|
|
4601
|
-
const [_open, _setOpen] =
|
|
4656
|
+
const [openMobile, setOpenMobile] = React5.useState(false);
|
|
4657
|
+
const [_open, _setOpen] = React5.useState(defaultOpen);
|
|
4602
4658
|
const open = openProp ?? _open;
|
|
4603
|
-
const setOpen =
|
|
4659
|
+
const setOpen = React5.useCallback(
|
|
4604
4660
|
(value) => {
|
|
4605
4661
|
const openState = typeof value === "function" ? value(open) : value;
|
|
4606
4662
|
if (setOpenProp) {
|
|
@@ -4612,10 +4668,10 @@ function SidebarProvider({
|
|
|
4612
4668
|
},
|
|
4613
4669
|
[setOpenProp, open]
|
|
4614
4670
|
);
|
|
4615
|
-
const toggleSidebar =
|
|
4671
|
+
const toggleSidebar = React5.useCallback(() => {
|
|
4616
4672
|
return isMobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
4617
4673
|
}, [isMobile, setOpen, setOpenMobile]);
|
|
4618
|
-
|
|
4674
|
+
React5.useEffect(() => {
|
|
4619
4675
|
const handleKeyDown = (event) => {
|
|
4620
4676
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
4621
4677
|
event.preventDefault();
|
|
@@ -4626,7 +4682,7 @@ function SidebarProvider({
|
|
|
4626
4682
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
4627
4683
|
}, [toggleSidebar]);
|
|
4628
4684
|
const state = open ? "expanded" : "collapsed";
|
|
4629
|
-
const contextValue =
|
|
4685
|
+
const contextValue = React5.useMemo(
|
|
4630
4686
|
() => ({
|
|
4631
4687
|
state,
|
|
4632
4688
|
open,
|
|
@@ -4800,10 +4856,10 @@ function SidebarContent({ className, ...props }) {
|
|
|
4800
4856
|
);
|
|
4801
4857
|
}
|
|
4802
4858
|
function renderAsChild(children, dataSlot, className, rest) {
|
|
4803
|
-
if (!
|
|
4859
|
+
if (!React5.isValidElement(children)) {
|
|
4804
4860
|
return null;
|
|
4805
4861
|
}
|
|
4806
|
-
return
|
|
4862
|
+
return React5.cloneElement(children, {
|
|
4807
4863
|
"data-slot": dataSlot,
|
|
4808
4864
|
className: cn(
|
|
4809
4865
|
className,
|
|
@@ -4920,7 +4976,7 @@ function useSidebarDrawer() {
|
|
|
4920
4976
|
}
|
|
4921
4977
|
function useOptionalRenderer() {
|
|
4922
4978
|
try {
|
|
4923
|
-
return (0,
|
|
4979
|
+
return (0, import_runtime16.useRenderer)();
|
|
4924
4980
|
} catch {
|
|
4925
4981
|
return null;
|
|
4926
4982
|
}
|
|
@@ -5027,7 +5083,7 @@ function SidebarInner({
|
|
|
5027
5083
|
drawer = true,
|
|
5028
5084
|
children
|
|
5029
5085
|
}) {
|
|
5030
|
-
const { t } = (0,
|
|
5086
|
+
const { t } = (0, import_runtime16.useI18n)();
|
|
5031
5087
|
const isMobile = useIsMobile();
|
|
5032
5088
|
const { state, setOpenMobile, toggleSidebar } = useSidebar();
|
|
5033
5089
|
const collapsed = state === "collapsed";
|
|
@@ -5805,13 +5861,13 @@ function Pagination2({
|
|
|
5805
5861
|
}
|
|
5806
5862
|
|
|
5807
5863
|
// src/components/components/Popover/index.tsx
|
|
5808
|
-
var
|
|
5864
|
+
var import_runtime17 = require("@pactor-app/runtime");
|
|
5809
5865
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
5810
5866
|
function isDslNode3(value) {
|
|
5811
5867
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
5812
5868
|
}
|
|
5813
5869
|
function Popover2({ content, children, className, style }) {
|
|
5814
|
-
const { renderChildren } = (0,
|
|
5870
|
+
const { renderChildren } = (0, import_runtime17.useRenderer)();
|
|
5815
5871
|
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Popover, { children: [
|
|
5816
5872
|
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
|
|
5817
5873
|
PopoverTrigger,
|
|
@@ -6032,7 +6088,7 @@ function RadioGroup2({
|
|
|
6032
6088
|
}
|
|
6033
6089
|
|
|
6034
6090
|
// src/components/components/Resizable/index.tsx
|
|
6035
|
-
var
|
|
6091
|
+
var import_runtime18 = require("@pactor-app/runtime");
|
|
6036
6092
|
var import_react22 = require("react");
|
|
6037
6093
|
|
|
6038
6094
|
// src/ui/resizable.tsx
|
|
@@ -6085,7 +6141,7 @@ function Resizable({
|
|
|
6085
6141
|
className,
|
|
6086
6142
|
style
|
|
6087
6143
|
}) {
|
|
6088
|
-
const { renderChildren } = (0,
|
|
6144
|
+
const { renderChildren } = (0, import_runtime18.useRenderer)();
|
|
6089
6145
|
return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(PanelGroup, { orientation: direction, className, style, children: panels.map((panel, index) => /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(import_react22.Fragment, { children: [
|
|
6090
6146
|
index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ResizableHandle, { withHandle: true }) : null,
|
|
6091
6147
|
/* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
|
|
@@ -6177,7 +6233,7 @@ function ScrollArea2({
|
|
|
6177
6233
|
}
|
|
6178
6234
|
|
|
6179
6235
|
// src/components/components/Select/index.tsx
|
|
6180
|
-
var
|
|
6236
|
+
var import_runtime19 = require("@pactor-app/runtime");
|
|
6181
6237
|
var import_react23 = require("react");
|
|
6182
6238
|
|
|
6183
6239
|
// src/ui/select.tsx
|
|
@@ -6323,10 +6379,11 @@ function Select2({
|
|
|
6323
6379
|
allowClear,
|
|
6324
6380
|
onChange,
|
|
6325
6381
|
className,
|
|
6382
|
+
controlClassName,
|
|
6326
6383
|
style
|
|
6327
6384
|
}) {
|
|
6328
6385
|
const form = useFormContext();
|
|
6329
|
-
const { t } = (0,
|
|
6386
|
+
const { t } = (0, import_runtime19.useI18n)();
|
|
6330
6387
|
const controlId = (0, import_react23.useId)();
|
|
6331
6388
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
6332
6389
|
(0, import_react23.useEffect)(() => {
|
|
@@ -6348,7 +6405,11 @@ function Select2({
|
|
|
6348
6405
|
const select = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
6349
6406
|
"span",
|
|
6350
6407
|
{
|
|
6351
|
-
className: cn(
|
|
6408
|
+
className: cn(
|
|
6409
|
+
"inline-flex items-center gap-1",
|
|
6410
|
+
!inFormRoot && className,
|
|
6411
|
+
controlClassName
|
|
6412
|
+
),
|
|
6352
6413
|
style: inFormRoot ? void 0 : style,
|
|
6353
6414
|
children: [
|
|
6354
6415
|
/* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(
|
|
@@ -6651,7 +6712,7 @@ function Slider2({
|
|
|
6651
6712
|
}
|
|
6652
6713
|
|
|
6653
6714
|
// src/components/components/Sonner/index.tsx
|
|
6654
|
-
var
|
|
6715
|
+
var import_runtime20 = require("@pactor-app/runtime");
|
|
6655
6716
|
var import_react25 = require("react");
|
|
6656
6717
|
|
|
6657
6718
|
// src/ui/toast.tsx
|
|
@@ -6731,7 +6792,7 @@ function Toaster({ className }) {
|
|
|
6731
6792
|
// src/components/components/Sonner/index.tsx
|
|
6732
6793
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
6733
6794
|
function Sonner({ className, style }) {
|
|
6734
|
-
const { context } = (0,
|
|
6795
|
+
const { context } = (0, import_runtime20.useRenderer)();
|
|
6735
6796
|
(0, import_react25.useEffect)(() => {
|
|
6736
6797
|
const { actions } = context;
|
|
6737
6798
|
if (actions.has("toast")) {
|
|
@@ -6884,7 +6945,7 @@ function Switch2({
|
|
|
6884
6945
|
}
|
|
6885
6946
|
|
|
6886
6947
|
// src/components/components/Table/index.tsx
|
|
6887
|
-
var
|
|
6948
|
+
var import_runtime21 = require("@pactor-app/runtime");
|
|
6888
6949
|
var import_react27 = require("react");
|
|
6889
6950
|
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
6890
6951
|
function renderCellValue2(value) {
|
|
@@ -6906,8 +6967,8 @@ function Table3({
|
|
|
6906
6967
|
className,
|
|
6907
6968
|
style
|
|
6908
6969
|
}) {
|
|
6909
|
-
const { renderChildren } = (0,
|
|
6910
|
-
const { t } = (0,
|
|
6970
|
+
const { renderChildren } = (0, import_runtime21.useRenderer)();
|
|
6971
|
+
const { t } = (0, import_runtime21.useI18n)();
|
|
6911
6972
|
const [current, setCurrent] = (0, import_react27.useState)(1);
|
|
6912
6973
|
const pageSize = pagination === false ? void 0 : pagination?.pageSize;
|
|
6913
6974
|
const total = dataSource.length;
|
|
@@ -6973,7 +7034,7 @@ function Table3({
|
|
|
6973
7034
|
}
|
|
6974
7035
|
|
|
6975
7036
|
// src/components/components/Tabs/index.tsx
|
|
6976
|
-
var
|
|
7037
|
+
var import_runtime22 = require("@pactor-app/runtime");
|
|
6977
7038
|
|
|
6978
7039
|
// src/ui/tabs.tsx
|
|
6979
7040
|
var import_tabs = require("@base-ui/react/tabs");
|
|
@@ -7059,7 +7120,7 @@ function TabsContent({
|
|
|
7059
7120
|
// src/components/components/Tabs/index.tsx
|
|
7060
7121
|
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
7061
7122
|
function Tabs2({ items = [], activeKey, variant, onChange, className, style }) {
|
|
7062
|
-
const { renderChildren } = (0,
|
|
7123
|
+
const { renderChildren } = (0, import_runtime22.useRenderer)();
|
|
7063
7124
|
return /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(
|
|
7064
7125
|
Tabs,
|
|
7065
7126
|
{
|
|
@@ -7252,9 +7313,9 @@ function Toggle2({
|
|
|
7252
7313
|
// src/ui/toggle-group.tsx
|
|
7253
7314
|
var import_toggle3 = require("@base-ui/react/toggle");
|
|
7254
7315
|
var import_toggle_group = require("@base-ui/react/toggle-group");
|
|
7255
|
-
var
|
|
7316
|
+
var React6 = __toESM(require("react"), 1);
|
|
7256
7317
|
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
7257
|
-
var ToggleGroupContext =
|
|
7318
|
+
var ToggleGroupContext = React6.createContext({
|
|
7258
7319
|
size: "default",
|
|
7259
7320
|
variant: "default"
|
|
7260
7321
|
});
|
|
@@ -7287,7 +7348,7 @@ function ToggleGroupItem({
|
|
|
7287
7348
|
size,
|
|
7288
7349
|
...props
|
|
7289
7350
|
}) {
|
|
7290
|
-
const context =
|
|
7351
|
+
const context = React6.useContext(ToggleGroupContext);
|
|
7291
7352
|
return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
7292
7353
|
import_toggle3.Toggle,
|
|
7293
7354
|
{
|