@pactor-app/ui 1.0.0 → 1.2.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/README.md +25 -31
- package/dist/{chunk-D6G4J5XS.js → chunk-22TEN3ER.js} +169 -38
- package/dist/{chunk-GL7IO22L.js → chunk-2LYMCWEJ.js} +65 -1
- package/dist/chunk-HJPHJKVA.js +671 -0
- package/dist/{chunk-BZSRLTQQ.js → chunk-L45CSL6I.js} +5 -5
- package/dist/{chunk-FVZMNP5P.js → chunk-LMEJ242M.js} +357 -442
- package/dist/{chunk-TUXCPXPA.js → chunk-Q5NUGUJG.js} +195 -259
- package/dist/components/index.cjs +1123 -796
- package/dist/components/index.d.cts +105 -21
- package/dist/components/index.d.ts +105 -21
- package/dist/components/index.js +18 -14
- package/dist/index.cjs +1433 -988
- package/dist/index.d.cts +3 -36
- package/dist/index.d.ts +3 -36
- package/dist/index.js +38 -43
- package/dist/interaction/index.cjs +7 -7
- package/dist/interaction/index.d.cts +13 -16
- package/dist/interaction/index.d.ts +13 -16
- package/dist/interaction/index.js +5 -5
- package/dist/layout/index.cjs +655 -52
- package/dist/layout/index.d.cts +97 -19
- package/dist/layout/index.d.ts +97 -19
- package/dist/layout/index.js +17 -15
- package/dist/ui/index.cjs +1 -1
- package/dist/ui/index.js +7 -7
- package/package.json +5 -5
- package/styles.css +88 -7
- package/dist/chunk-UR3I4WXQ.js +0 -236
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Icon
|
|
3
|
-
|
|
2
|
+
Icon,
|
|
3
|
+
Menu,
|
|
4
|
+
Sidebar
|
|
5
|
+
} from "./chunk-HJPHJKVA.js";
|
|
4
6
|
import {
|
|
5
7
|
Alert,
|
|
6
8
|
AlertDescription,
|
|
@@ -142,14 +144,11 @@ import {
|
|
|
142
144
|
Toggle,
|
|
143
145
|
ToggleGroup,
|
|
144
146
|
ToggleGroupItem,
|
|
145
|
-
Tooltip,
|
|
146
|
-
TooltipContent,
|
|
147
|
-
TooltipTrigger,
|
|
148
147
|
Typography,
|
|
149
148
|
chartColor,
|
|
150
149
|
navigationMenuTriggerStyle,
|
|
151
150
|
toast
|
|
152
|
-
} from "./chunk-
|
|
151
|
+
} from "./chunk-Q5NUGUJG.js";
|
|
153
152
|
import {
|
|
154
153
|
Button,
|
|
155
154
|
Dialog,
|
|
@@ -174,8 +173,11 @@ import {
|
|
|
174
173
|
CardTitle,
|
|
175
174
|
Popover,
|
|
176
175
|
PopoverContent,
|
|
177
|
-
PopoverTrigger
|
|
178
|
-
|
|
176
|
+
PopoverTrigger,
|
|
177
|
+
Tooltip,
|
|
178
|
+
TooltipContent,
|
|
179
|
+
TooltipTrigger
|
|
180
|
+
} from "./chunk-2LYMCWEJ.js";
|
|
179
181
|
import {
|
|
180
182
|
cn
|
|
181
183
|
} from "./chunk-RQHJBTEU.js";
|
|
@@ -870,10 +872,111 @@ function Chart({
|
|
|
870
872
|
);
|
|
871
873
|
}
|
|
872
874
|
|
|
875
|
+
// src/components/components/ChatInput/index.tsx
|
|
876
|
+
import { useRenderer as useRenderer4 } from "@pactor-app/runtime";
|
|
877
|
+
import { ArrowUp } from "lucide-react";
|
|
878
|
+
import {
|
|
879
|
+
useRef,
|
|
880
|
+
useState as useState5
|
|
881
|
+
} from "react";
|
|
882
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
883
|
+
function ChatInput({
|
|
884
|
+
value,
|
|
885
|
+
placeholder,
|
|
886
|
+
disabled,
|
|
887
|
+
rows = 3,
|
|
888
|
+
hideSend,
|
|
889
|
+
toolbarStart,
|
|
890
|
+
toolbarEnd,
|
|
891
|
+
header,
|
|
892
|
+
footer,
|
|
893
|
+
onChange,
|
|
894
|
+
onSubmit,
|
|
895
|
+
className,
|
|
896
|
+
style
|
|
897
|
+
}) {
|
|
898
|
+
const { renderChildren } = useRenderer4();
|
|
899
|
+
const controlled = value !== void 0;
|
|
900
|
+
const [draft, setDraft] = useState5("");
|
|
901
|
+
const text = controlled ? value : draft;
|
|
902
|
+
const canSubmit = !disabled && text.trim() !== "";
|
|
903
|
+
const composingRef = useRef(false);
|
|
904
|
+
const handleChange = (next) => {
|
|
905
|
+
if (!controlled) {
|
|
906
|
+
setDraft(next);
|
|
907
|
+
}
|
|
908
|
+
onChange?.(next);
|
|
909
|
+
};
|
|
910
|
+
const submit = () => {
|
|
911
|
+
if (!canSubmit) {
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
onSubmit?.(text);
|
|
915
|
+
if (!controlled) {
|
|
916
|
+
setDraft("");
|
|
917
|
+
}
|
|
918
|
+
};
|
|
919
|
+
const handleKeyDown = (event) => {
|
|
920
|
+
if (event.key === "Enter" && !event.shiftKey && !composingRef.current && !event.nativeEvent.isComposing) {
|
|
921
|
+
event.preventDefault();
|
|
922
|
+
submit();
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
const handleComposition = (event) => {
|
|
926
|
+
composingRef.current = event.type === "compositionstart";
|
|
927
|
+
};
|
|
928
|
+
return /* @__PURE__ */ jsxs15(
|
|
929
|
+
"div",
|
|
930
|
+
{
|
|
931
|
+
"data-slot": "chat-input",
|
|
932
|
+
className: cn(
|
|
933
|
+
"rounded-xl border border-border bg-background transition-shadow focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50",
|
|
934
|
+
className
|
|
935
|
+
),
|
|
936
|
+
style,
|
|
937
|
+
children: [
|
|
938
|
+
header ? /* @__PURE__ */ jsx19("div", { className: "px-3 pt-3", children: renderChildren([header]) }) : null,
|
|
939
|
+
/* @__PURE__ */ jsx19(
|
|
940
|
+
Textarea,
|
|
941
|
+
{
|
|
942
|
+
value: text,
|
|
943
|
+
placeholder,
|
|
944
|
+
disabled,
|
|
945
|
+
rows,
|
|
946
|
+
onChange: (event) => handleChange(event.target.value),
|
|
947
|
+
onKeyDown: handleKeyDown,
|
|
948
|
+
onCompositionStart: handleComposition,
|
|
949
|
+
onCompositionEnd: handleComposition,
|
|
950
|
+
className: "min-h-[60px] resize-none border-0 px-4 pt-3 pb-1 shadow-none focus-visible:border-transparent focus-visible:ring-0"
|
|
951
|
+
}
|
|
952
|
+
),
|
|
953
|
+
toolbarStart || toolbarEnd || !hideSend ? /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1 px-2 pb-2", children: [
|
|
954
|
+
toolbarStart ? renderChildren([toolbarStart]) : null,
|
|
955
|
+
/* @__PURE__ */ jsx19("span", { className: "flex-1" }),
|
|
956
|
+
toolbarEnd ? renderChildren([toolbarEnd]) : null,
|
|
957
|
+
hideSend ? null : /* @__PURE__ */ jsx19(
|
|
958
|
+
Button,
|
|
959
|
+
{
|
|
960
|
+
type: "button",
|
|
961
|
+
size: "icon",
|
|
962
|
+
"aria-label": "\u53D1\u9001",
|
|
963
|
+
disabled: !canSubmit,
|
|
964
|
+
onClick: submit,
|
|
965
|
+
className: "size-8 rounded-full",
|
|
966
|
+
children: /* @__PURE__ */ jsx19(ArrowUp, {})
|
|
967
|
+
}
|
|
968
|
+
)
|
|
969
|
+
] }) : null,
|
|
970
|
+
footer ? /* @__PURE__ */ jsx19("div", { className: "border-t border-border px-3 py-2", children: renderChildren([footer]) }) : null
|
|
971
|
+
]
|
|
972
|
+
}
|
|
973
|
+
);
|
|
974
|
+
}
|
|
975
|
+
|
|
873
976
|
// src/components/components/Content/index.tsx
|
|
874
|
-
import { jsx as
|
|
977
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
875
978
|
function Content({ className, style, children }) {
|
|
876
|
-
return /* @__PURE__ */
|
|
979
|
+
return /* @__PURE__ */ jsx20(
|
|
877
980
|
"main",
|
|
878
981
|
{
|
|
879
982
|
"data-slot": "layout-content",
|
|
@@ -885,7 +988,7 @@ function Content({ className, style, children }) {
|
|
|
885
988
|
}
|
|
886
989
|
|
|
887
990
|
// src/components/components/ContextMenu/index.tsx
|
|
888
|
-
import { jsx as
|
|
991
|
+
import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
889
992
|
function ContextMenu2({
|
|
890
993
|
items = [],
|
|
891
994
|
onSelect,
|
|
@@ -893,16 +996,16 @@ function ContextMenu2({
|
|
|
893
996
|
className,
|
|
894
997
|
style
|
|
895
998
|
}) {
|
|
896
|
-
return /* @__PURE__ */
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
/* @__PURE__ */
|
|
999
|
+
return /* @__PURE__ */ jsxs16(ContextMenu, { children: [
|
|
1000
|
+
/* @__PURE__ */ jsx21(ContextMenuTrigger, { children }),
|
|
1001
|
+
/* @__PURE__ */ jsx21(ContextMenuContent, { className, style, children: items.map((item) => /* @__PURE__ */ jsxs16(
|
|
899
1002
|
ContextMenuItem,
|
|
900
1003
|
{
|
|
901
1004
|
variant: item.danger ? "destructive" : "default",
|
|
902
1005
|
disabled: item.disabled,
|
|
903
1006
|
onClick: () => onSelect?.(item.value),
|
|
904
1007
|
children: [
|
|
905
|
-
item.icon ? /* @__PURE__ */
|
|
1008
|
+
item.icon ? /* @__PURE__ */ jsx21(Icon, { name: item.icon, size: "sm" }) : null,
|
|
906
1009
|
item.label
|
|
907
1010
|
]
|
|
908
1011
|
},
|
|
@@ -912,10 +1015,10 @@ function ContextMenu2({
|
|
|
912
1015
|
}
|
|
913
1016
|
|
|
914
1017
|
// src/components/components/DataTable/index.tsx
|
|
915
|
-
import { useI18n as useI18n3, useRenderer as
|
|
916
|
-
import { ArrowDown, ArrowUp, ArrowUpDown } from "lucide-react";
|
|
917
|
-
import { useMemo, useState as
|
|
918
|
-
import { jsx as
|
|
1018
|
+
import { useI18n as useI18n3, useRenderer as useRenderer5 } from "@pactor-app/runtime";
|
|
1019
|
+
import { ArrowDown, ArrowUp as ArrowUp2, ArrowUpDown } from "lucide-react";
|
|
1020
|
+
import { useMemo, useState as useState6 } from "react";
|
|
1021
|
+
import { jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
919
1022
|
function renderCellValue(value) {
|
|
920
1023
|
if (value === void 0 || value === null) {
|
|
921
1024
|
return "";
|
|
@@ -942,11 +1045,11 @@ function DataTable({
|
|
|
942
1045
|
className,
|
|
943
1046
|
style
|
|
944
1047
|
}) {
|
|
945
|
-
const { renderChildren } =
|
|
1048
|
+
const { renderChildren } = useRenderer5();
|
|
946
1049
|
const { t } = useI18n3();
|
|
947
|
-
const [sortState, setSortState] =
|
|
948
|
-
const [filters, setFilters] =
|
|
949
|
-
const [current, setCurrent] =
|
|
1050
|
+
const [sortState, setSortState] = useState6(sort);
|
|
1051
|
+
const [filters, setFilters] = useState6({});
|
|
1052
|
+
const [current, setCurrent] = useState6(1);
|
|
950
1053
|
const viewRows = useMemo(() => {
|
|
951
1054
|
const activeFilters = Object.entries(filters).filter(
|
|
952
1055
|
([, keyword]) => keyword !== ""
|
|
@@ -984,12 +1087,12 @@ function DataTable({
|
|
|
984
1087
|
setCurrent(page);
|
|
985
1088
|
onPageChange?.(page);
|
|
986
1089
|
};
|
|
987
|
-
return /* @__PURE__ */
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
/* @__PURE__ */
|
|
1090
|
+
return /* @__PURE__ */ jsxs17("div", { "data-slot": "data-table", className: cn("relative", className), style, children: [
|
|
1091
|
+
/* @__PURE__ */ jsxs17(Table, { children: [
|
|
1092
|
+
/* @__PURE__ */ jsx22(TableHeader, { children: /* @__PURE__ */ jsx22(TableRow, { className: "hover:bg-transparent", children: columns.map((column, index) => {
|
|
990
1093
|
const sorted = sortState?.key === column.key;
|
|
991
|
-
return /* @__PURE__ */
|
|
992
|
-
column.sortable ? /* @__PURE__ */
|
|
1094
|
+
return /* @__PURE__ */ jsx22(TableHead, { children: /* @__PURE__ */ jsxs17("div", { className: "flex flex-col gap-1", children: [
|
|
1095
|
+
column.sortable ? /* @__PURE__ */ jsxs17(
|
|
993
1096
|
"button",
|
|
994
1097
|
{
|
|
995
1098
|
type: "button",
|
|
@@ -1000,7 +1103,7 @@ function DataTable({
|
|
|
1000
1103
|
onClick: () => toggleSort(column),
|
|
1001
1104
|
children: [
|
|
1002
1105
|
column.title,
|
|
1003
|
-
sorted ? sortState.order === "asc" ? /* @__PURE__ */
|
|
1106
|
+
sorted ? sortState.order === "asc" ? /* @__PURE__ */ jsx22(ArrowUp2, { "aria-hidden": true, className: "size-3.5" }) : /* @__PURE__ */ jsx22(ArrowDown, { "aria-hidden": true, className: "size-3.5" }) : /* @__PURE__ */ jsx22(
|
|
1004
1107
|
ArrowUpDown,
|
|
1005
1108
|
{
|
|
1006
1109
|
"aria-hidden": true,
|
|
@@ -1009,8 +1112,8 @@ function DataTable({
|
|
|
1009
1112
|
)
|
|
1010
1113
|
]
|
|
1011
1114
|
}
|
|
1012
|
-
) : /* @__PURE__ */
|
|
1013
|
-
column.filterable ? /* @__PURE__ */
|
|
1115
|
+
) : /* @__PURE__ */ jsx22("span", { children: column.title }),
|
|
1116
|
+
column.filterable ? /* @__PURE__ */ jsx22(
|
|
1014
1117
|
Input,
|
|
1015
1118
|
{
|
|
1016
1119
|
"data-slot": "data-table-filter",
|
|
@@ -1023,7 +1126,7 @@ function DataTable({
|
|
|
1023
1126
|
) : null
|
|
1024
1127
|
] }) }, column.key ?? String(index));
|
|
1025
1128
|
}) }) }),
|
|
1026
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ jsx22(TableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ jsx22(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx22(TableCell, { colSpan: Math.max(1, columns.length), children: /* @__PURE__ */ jsx22(
|
|
1027
1130
|
"div",
|
|
1028
1131
|
{
|
|
1029
1132
|
"data-slot": "table-empty",
|
|
@@ -1032,20 +1135,20 @@ function DataTable({
|
|
|
1032
1135
|
}
|
|
1033
1136
|
) }) }) : pageRows.map((row, rowIndex) => {
|
|
1034
1137
|
const key = row[rowKey];
|
|
1035
|
-
return /* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ jsx22(
|
|
1036
1139
|
TableRow,
|
|
1037
1140
|
{
|
|
1038
1141
|
children: columns.map((column, columnIndex) => {
|
|
1039
1142
|
const template = column.children ?? column.renderChildren;
|
|
1040
|
-
return /* @__PURE__ */
|
|
1143
|
+
return /* @__PURE__ */ jsx22(TableCell, { children: template ? renderChildren(template, { row, rowIndex }) : renderCellValue(row[column.key]) }, column.key ?? String(columnIndex));
|
|
1041
1144
|
})
|
|
1042
1145
|
},
|
|
1043
1146
|
key === void 0 || key === null ? rowIndex : String(key)
|
|
1044
1147
|
);
|
|
1045
1148
|
}) })
|
|
1046
1149
|
] }),
|
|
1047
|
-
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */
|
|
1048
|
-
(page) => /* @__PURE__ */
|
|
1150
|
+
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */ jsx22("div", { "data-slot": "table-pagination", className: "mt-3 flex justify-end gap-1", children: Array.from({ length: pageCount }, (_, index) => index + 1).map(
|
|
1151
|
+
(page) => /* @__PURE__ */ jsx22(
|
|
1049
1152
|
Button,
|
|
1050
1153
|
{
|
|
1051
1154
|
type: "button",
|
|
@@ -1062,9 +1165,9 @@ function DataTable({
|
|
|
1062
1165
|
}
|
|
1063
1166
|
|
|
1064
1167
|
// src/components/components/Dialog/index.tsx
|
|
1065
|
-
import { useRenderer as
|
|
1066
|
-
import { useState as
|
|
1067
|
-
import { jsx as
|
|
1168
|
+
import { useRenderer as useRenderer6 } from "@pactor-app/runtime";
|
|
1169
|
+
import { useState as useState7 } from "react";
|
|
1170
|
+
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1068
1171
|
function Dialog2({
|
|
1069
1172
|
title,
|
|
1070
1173
|
description,
|
|
@@ -1075,11 +1178,11 @@ function Dialog2({
|
|
|
1075
1178
|
className,
|
|
1076
1179
|
style
|
|
1077
1180
|
}) {
|
|
1078
|
-
const { renderChildren } =
|
|
1079
|
-
const [innerOpen, setInnerOpen] =
|
|
1181
|
+
const { renderChildren } = useRenderer6();
|
|
1182
|
+
const [innerOpen, setInnerOpen] = useState7(false);
|
|
1080
1183
|
const controlled = open !== void 0;
|
|
1081
1184
|
const visible = controlled ? open : innerOpen;
|
|
1082
|
-
return /* @__PURE__ */
|
|
1185
|
+
return /* @__PURE__ */ jsxs18(
|
|
1083
1186
|
Dialog,
|
|
1084
1187
|
{
|
|
1085
1188
|
open: visible,
|
|
@@ -1092,7 +1195,7 @@ function Dialog2({
|
|
|
1092
1195
|
}
|
|
1093
1196
|
},
|
|
1094
1197
|
children: [
|
|
1095
|
-
trigger ? /* @__PURE__ */
|
|
1198
|
+
trigger ? /* @__PURE__ */ jsx23(
|
|
1096
1199
|
DialogTrigger,
|
|
1097
1200
|
{
|
|
1098
1201
|
nativeButton: false,
|
|
@@ -1100,10 +1203,10 @@ function Dialog2({
|
|
|
1100
1203
|
children: renderChildren([trigger])
|
|
1101
1204
|
}
|
|
1102
1205
|
) : null,
|
|
1103
|
-
/* @__PURE__ */
|
|
1104
|
-
title || description ? /* @__PURE__ */
|
|
1105
|
-
title ? /* @__PURE__ */
|
|
1106
|
-
description ? /* @__PURE__ */
|
|
1206
|
+
/* @__PURE__ */ jsxs18(DialogContent, { className, style, children: [
|
|
1207
|
+
title || description ? /* @__PURE__ */ jsxs18(DialogHeader, { children: [
|
|
1208
|
+
title ? /* @__PURE__ */ jsx23(DialogTitle, { children: title }) : null,
|
|
1209
|
+
description ? /* @__PURE__ */ jsx23(DialogDescription, { children: description }) : null
|
|
1107
1210
|
] }) : null,
|
|
1108
1211
|
children
|
|
1109
1212
|
] })
|
|
@@ -1113,7 +1216,7 @@ function Dialog2({
|
|
|
1113
1216
|
}
|
|
1114
1217
|
|
|
1115
1218
|
// src/components/components/Drawer/index.tsx
|
|
1116
|
-
import { jsx as
|
|
1219
|
+
import { jsx as jsx24, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1117
1220
|
function Drawer2({
|
|
1118
1221
|
title,
|
|
1119
1222
|
open,
|
|
@@ -1123,7 +1226,7 @@ function Drawer2({
|
|
|
1123
1226
|
className,
|
|
1124
1227
|
style
|
|
1125
1228
|
}) {
|
|
1126
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsx24(
|
|
1127
1230
|
Drawer,
|
|
1128
1231
|
{
|
|
1129
1232
|
direction: placement,
|
|
@@ -1133,16 +1236,16 @@ function Drawer2({
|
|
|
1133
1236
|
onClose?.();
|
|
1134
1237
|
}
|
|
1135
1238
|
},
|
|
1136
|
-
children: /* @__PURE__ */
|
|
1137
|
-
title ? /* @__PURE__ */
|
|
1138
|
-
/* @__PURE__ */
|
|
1239
|
+
children: /* @__PURE__ */ jsxs19(DrawerContent, { className, style, children: [
|
|
1240
|
+
title ? /* @__PURE__ */ jsx24(DrawerHeader, { children: /* @__PURE__ */ jsx24(DrawerTitle, { children: title }) }) : null,
|
|
1241
|
+
/* @__PURE__ */ jsx24("div", { className: "flex-1 overflow-auto p-4", children })
|
|
1139
1242
|
] })
|
|
1140
1243
|
}
|
|
1141
1244
|
);
|
|
1142
1245
|
}
|
|
1143
1246
|
|
|
1144
1247
|
// src/components/components/DropdownMenu/index.tsx
|
|
1145
|
-
import { jsx as
|
|
1248
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1146
1249
|
function DropdownMenu2({
|
|
1147
1250
|
items = [],
|
|
1148
1251
|
onSelect,
|
|
@@ -1150,8 +1253,8 @@ function DropdownMenu2({
|
|
|
1150
1253
|
className,
|
|
1151
1254
|
style
|
|
1152
1255
|
}) {
|
|
1153
|
-
return /* @__PURE__ */
|
|
1154
|
-
/* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ jsxs20(DropdownMenu, { children: [
|
|
1257
|
+
/* @__PURE__ */ jsx25(
|
|
1155
1258
|
DropdownMenuTrigger,
|
|
1156
1259
|
{
|
|
1157
1260
|
nativeButton: false,
|
|
@@ -1159,14 +1262,14 @@ function DropdownMenu2({
|
|
|
1159
1262
|
children
|
|
1160
1263
|
}
|
|
1161
1264
|
),
|
|
1162
|
-
/* @__PURE__ */
|
|
1265
|
+
/* @__PURE__ */ jsx25(DropdownMenuContent, { className, style, children: items.map((item) => /* @__PURE__ */ jsxs20(
|
|
1163
1266
|
DropdownMenuItem,
|
|
1164
1267
|
{
|
|
1165
1268
|
variant: item.danger ? "destructive" : "default",
|
|
1166
1269
|
disabled: item.disabled,
|
|
1167
1270
|
onClick: () => onSelect?.(item.value),
|
|
1168
1271
|
children: [
|
|
1169
|
-
item.icon ? /* @__PURE__ */
|
|
1272
|
+
item.icon ? /* @__PURE__ */ jsx25(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1170
1273
|
item.label
|
|
1171
1274
|
]
|
|
1172
1275
|
},
|
|
@@ -1176,30 +1279,30 @@ function DropdownMenu2({
|
|
|
1176
1279
|
}
|
|
1177
1280
|
|
|
1178
1281
|
// src/components/components/Empty/index.tsx
|
|
1179
|
-
import { jsx as
|
|
1282
|
+
import { jsx as jsx26, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1180
1283
|
function Empty2({ title, description, children, className, style }) {
|
|
1181
|
-
return /* @__PURE__ */
|
|
1182
|
-
/* @__PURE__ */
|
|
1183
|
-
title ? /* @__PURE__ */
|
|
1184
|
-
description ? /* @__PURE__ */
|
|
1284
|
+
return /* @__PURE__ */ jsxs21(Empty, { className, style, children: [
|
|
1285
|
+
/* @__PURE__ */ jsxs21(EmptyHeader, { children: [
|
|
1286
|
+
title ? /* @__PURE__ */ jsx26(EmptyTitle, { children: title }) : null,
|
|
1287
|
+
description ? /* @__PURE__ */ jsx26(EmptyDescription, { children: description }) : null
|
|
1185
1288
|
] }),
|
|
1186
|
-
children ? /* @__PURE__ */
|
|
1289
|
+
children ? /* @__PURE__ */ jsx26(EmptyContent, { children }) : null
|
|
1187
1290
|
] });
|
|
1188
1291
|
}
|
|
1189
1292
|
|
|
1190
1293
|
// src/components/components/Field/index.tsx
|
|
1191
|
-
import { jsx as
|
|
1294
|
+
import { jsx as jsx27, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1192
1295
|
function Field2({ label, description, error, children, className, style }) {
|
|
1193
|
-
return /* @__PURE__ */
|
|
1194
|
-
label ? /* @__PURE__ */
|
|
1296
|
+
return /* @__PURE__ */ jsxs22(Field, { className, style, children: [
|
|
1297
|
+
label ? /* @__PURE__ */ jsx27(FieldLabel, { children: label }) : null,
|
|
1195
1298
|
children,
|
|
1196
|
-
description ? /* @__PURE__ */
|
|
1197
|
-
error ? /* @__PURE__ */
|
|
1299
|
+
description ? /* @__PURE__ */ jsx27(FieldDescription, { children: description }) : null,
|
|
1300
|
+
error ? /* @__PURE__ */ jsx27(FieldError, { match: true, children: error }) : null
|
|
1198
1301
|
] });
|
|
1199
1302
|
}
|
|
1200
1303
|
|
|
1201
1304
|
// src/components/components/Flex/index.tsx
|
|
1202
|
-
import { jsx as
|
|
1305
|
+
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1203
1306
|
var gapClass = {
|
|
1204
1307
|
small: "gap-2",
|
|
1205
1308
|
middle: "gap-4",
|
|
@@ -1229,7 +1332,7 @@ function Flex({
|
|
|
1229
1332
|
style,
|
|
1230
1333
|
children
|
|
1231
1334
|
}) {
|
|
1232
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ jsx28(
|
|
1233
1336
|
"div",
|
|
1234
1337
|
{
|
|
1235
1338
|
"data-slot": "flex",
|
|
@@ -1248,9 +1351,9 @@ function Flex({
|
|
|
1248
1351
|
}
|
|
1249
1352
|
|
|
1250
1353
|
// src/components/components/Footer/index.tsx
|
|
1251
|
-
import { jsx as
|
|
1354
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
1252
1355
|
function Footer({ className, style, children }) {
|
|
1253
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ jsx29(
|
|
1254
1357
|
"footer",
|
|
1255
1358
|
{
|
|
1256
1359
|
"data-slot": "layout-footer",
|
|
@@ -1265,15 +1368,15 @@ function Footer({ className, style, children }) {
|
|
|
1265
1368
|
}
|
|
1266
1369
|
|
|
1267
1370
|
// src/components/components/Form/index.tsx
|
|
1268
|
-
import { useRenderer as
|
|
1371
|
+
import { useRenderer as useRenderer7 } from "@pactor-app/runtime";
|
|
1269
1372
|
import {
|
|
1270
1373
|
useCallback,
|
|
1271
1374
|
useEffect as useEffect5,
|
|
1272
1375
|
useMemo as useMemo2,
|
|
1273
|
-
useRef,
|
|
1274
|
-
useState as
|
|
1376
|
+
useRef as useRef2,
|
|
1377
|
+
useState as useState8
|
|
1275
1378
|
} from "react";
|
|
1276
|
-
import { jsx as
|
|
1379
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
1277
1380
|
function isEmpty(value) {
|
|
1278
1381
|
return value === void 0 || value === null || value === "";
|
|
1279
1382
|
}
|
|
@@ -1287,13 +1390,13 @@ function Form({
|
|
|
1287
1390
|
onSubmit,
|
|
1288
1391
|
onValuesChange
|
|
1289
1392
|
}) {
|
|
1290
|
-
const { context } =
|
|
1291
|
-
const [values, setValues] =
|
|
1393
|
+
const { context } = useRenderer7();
|
|
1394
|
+
const [values, setValues] = useState8(() => ({
|
|
1292
1395
|
...initialValues
|
|
1293
1396
|
}));
|
|
1294
|
-
const [errors, setErrors] =
|
|
1295
|
-
const fieldRulesRef =
|
|
1296
|
-
const mergedInitialFieldsRef =
|
|
1397
|
+
const [errors, setErrors] = useState8({});
|
|
1398
|
+
const fieldRulesRef = useRef2(/* @__PURE__ */ new Map());
|
|
1399
|
+
const mergedInitialFieldsRef = useRef2(/* @__PURE__ */ new Set());
|
|
1297
1400
|
const setValuesBatch = useCallback((partial) => {
|
|
1298
1401
|
setValues((prev) => ({ ...prev, ...partial }));
|
|
1299
1402
|
}, []);
|
|
@@ -1354,7 +1457,7 @@ function Form({
|
|
|
1354
1457
|
context.state.set("form", values);
|
|
1355
1458
|
onSubmit?.(values);
|
|
1356
1459
|
};
|
|
1357
|
-
return /* @__PURE__ */
|
|
1460
|
+
return /* @__PURE__ */ jsx30(FormContextProvider, { value: formContext, children: /* @__PURE__ */ jsx30(
|
|
1358
1461
|
"form",
|
|
1359
1462
|
{
|
|
1360
1463
|
"data-slot": "form",
|
|
@@ -1368,10 +1471,10 @@ function Form({
|
|
|
1368
1471
|
|
|
1369
1472
|
// src/components/components/Grid/index.tsx
|
|
1370
1473
|
import { Children } from "react";
|
|
1371
|
-
import { jsx as
|
|
1474
|
+
import { jsx as jsx31 } from "react/jsx-runtime";
|
|
1372
1475
|
function Grid({ columns = 1, gap, className, style, children }) {
|
|
1373
1476
|
const cols = Math.max(1, columns);
|
|
1374
|
-
return /* @__PURE__ */
|
|
1477
|
+
return /* @__PURE__ */ jsx31(
|
|
1375
1478
|
"div",
|
|
1376
1479
|
{
|
|
1377
1480
|
"data-slot": "grid",
|
|
@@ -1382,7 +1485,7 @@ function Grid({ columns = 1, gap, className, style, children }) {
|
|
|
1382
1485
|
...gap !== void 0 ? { gap } : {},
|
|
1383
1486
|
...style
|
|
1384
1487
|
},
|
|
1385
|
-
children: Children.map(children, (child, index) => /* @__PURE__ */
|
|
1488
|
+
children: Children.map(children, (child, index) => /* @__PURE__ */ jsx31("div", { "data-slot": "grid-item", children: child }, index))
|
|
1386
1489
|
}
|
|
1387
1490
|
);
|
|
1388
1491
|
}
|
|
@@ -1390,7 +1493,7 @@ function Grid({ columns = 1, gap, className, style, children }) {
|
|
|
1390
1493
|
// src/components/components/Header/index.tsx
|
|
1391
1494
|
import { useI18n as useI18n4 } from "@pactor-app/runtime";
|
|
1392
1495
|
import { ChevronDownIcon } from "lucide-react";
|
|
1393
|
-
import { Fragment as Fragment2, jsx as
|
|
1496
|
+
import { Fragment as Fragment2, jsx as jsx32, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1394
1497
|
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";
|
|
1395
1498
|
function Header({
|
|
1396
1499
|
logo,
|
|
@@ -1421,10 +1524,10 @@ function Header({
|
|
|
1421
1524
|
className
|
|
1422
1525
|
);
|
|
1423
1526
|
if (!hasBrand && !dropdown && !hasMenu && !hasUser && !hasLocales) {
|
|
1424
|
-
return /* @__PURE__ */
|
|
1527
|
+
return /* @__PURE__ */ jsx32("header", { "data-slot": "layout-header", className: rootClass, style, children });
|
|
1425
1528
|
}
|
|
1426
|
-
const brandNode = hasBrand && /* @__PURE__ */
|
|
1427
|
-
logo !== void 0 && /* @__PURE__ */
|
|
1529
|
+
const brandNode = hasBrand && /* @__PURE__ */ jsxs23("div", { "data-slot": "header-brand", className: "flex items-center gap-2", children: [
|
|
1530
|
+
logo !== void 0 && /* @__PURE__ */ jsx32(
|
|
1428
1531
|
"img",
|
|
1429
1532
|
{
|
|
1430
1533
|
"data-slot": "header-brand-logo",
|
|
@@ -1433,23 +1536,23 @@ function Header({
|
|
|
1433
1536
|
className: "h-8 w-8 shrink-0 object-contain"
|
|
1434
1537
|
}
|
|
1435
1538
|
),
|
|
1436
|
-
title !== void 0 && /* @__PURE__ */
|
|
1539
|
+
title !== void 0 && /* @__PURE__ */ jsx32("span", { "data-slot": "header-brand-title", className: "text-base font-semibold", children: title })
|
|
1437
1540
|
] });
|
|
1438
|
-
const dropdownNode = dropdown !== void 0 && /* @__PURE__ */
|
|
1541
|
+
const dropdownNode = dropdown !== void 0 && /* @__PURE__ */ jsx32(HeaderDropdownArea, { dropdown, onSelect: onDropdownSelect });
|
|
1439
1542
|
const showLeft = brandLeft || dropdownLeft || hasMenu;
|
|
1440
1543
|
const showRight = dropdownRight || brandRight || hasLocales || hasUser;
|
|
1441
|
-
return /* @__PURE__ */
|
|
1442
|
-
showLeft && /* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ jsxs23("header", { "data-slot": "layout-header", className: rootClass, style, children: [
|
|
1545
|
+
showLeft && /* @__PURE__ */ jsxs23("div", { "data-slot": "header-left", className: "flex items-center gap-4", children: [
|
|
1443
1546
|
brandLeft && brandNode,
|
|
1444
1547
|
dropdownLeft && dropdownNode,
|
|
1445
|
-
hasMenu && /* @__PURE__ */
|
|
1548
|
+
hasMenu && /* @__PURE__ */ jsx32(HeaderMenuArea, { items: menu, onSelect: onMenuSelect })
|
|
1446
1549
|
] }),
|
|
1447
|
-
/* @__PURE__ */
|
|
1448
|
-
showRight && /* @__PURE__ */
|
|
1550
|
+
/* @__PURE__ */ jsx32("div", { "data-slot": "header-center", className: "flex flex-1 items-center gap-4", children }),
|
|
1551
|
+
showRight && /* @__PURE__ */ jsxs23("div", { "data-slot": "header-right", className: "flex items-center gap-4", children: [
|
|
1449
1552
|
dropdownRight && dropdownNode,
|
|
1450
1553
|
brandRight && brandNode,
|
|
1451
|
-
hasLocales && /* @__PURE__ */
|
|
1452
|
-
hasUser && /* @__PURE__ */
|
|
1554
|
+
hasLocales && /* @__PURE__ */ jsx32(HeaderLocalesArea, { locales, onSelect: onLocaleChange }),
|
|
1555
|
+
hasUser && /* @__PURE__ */ jsx32(HeaderUserArea, { user, onSelect: onUserSelect })
|
|
1453
1556
|
] })
|
|
1454
1557
|
] });
|
|
1455
1558
|
}
|
|
@@ -1457,25 +1560,25 @@ function HeaderDropdownArea({
|
|
|
1457
1560
|
dropdown,
|
|
1458
1561
|
onSelect
|
|
1459
1562
|
}) {
|
|
1460
|
-
return /* @__PURE__ */
|
|
1461
|
-
/* @__PURE__ */
|
|
1563
|
+
return /* @__PURE__ */ jsxs23(DropdownMenu, { children: [
|
|
1564
|
+
/* @__PURE__ */ jsxs23(
|
|
1462
1565
|
DropdownMenuTrigger,
|
|
1463
1566
|
{
|
|
1464
1567
|
"data-slot": "header-dropdown",
|
|
1465
1568
|
className: cn(menuItemClass, "outline-hidden"),
|
|
1466
1569
|
children: [
|
|
1467
1570
|
dropdown.label,
|
|
1468
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ jsx32(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
1469
1572
|
]
|
|
1470
1573
|
}
|
|
1471
1574
|
),
|
|
1472
|
-
/* @__PURE__ */
|
|
1575
|
+
/* @__PURE__ */ jsx32(DropdownMenuContent, { children: dropdown.items.map((item) => /* @__PURE__ */ jsxs23(
|
|
1473
1576
|
DropdownMenuItem,
|
|
1474
1577
|
{
|
|
1475
1578
|
disabled: item.disabled,
|
|
1476
1579
|
onClick: () => onSelect?.(item.value),
|
|
1477
1580
|
children: [
|
|
1478
|
-
item.icon ? /* @__PURE__ */
|
|
1581
|
+
item.icon ? /* @__PURE__ */ jsx32(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1479
1582
|
item.label
|
|
1480
1583
|
]
|
|
1481
1584
|
},
|
|
@@ -1487,23 +1590,23 @@ function HeaderMenuArea({
|
|
|
1487
1590
|
items,
|
|
1488
1591
|
onSelect
|
|
1489
1592
|
}) {
|
|
1490
|
-
return /* @__PURE__ */
|
|
1491
|
-
(item) => item.children !== void 0 && item.children.length > 0 ? /* @__PURE__ */
|
|
1492
|
-
/* @__PURE__ */
|
|
1593
|
+
return /* @__PURE__ */ jsx32("nav", { "data-slot": "header-menu", className: "flex items-center gap-1", children: items.map(
|
|
1594
|
+
(item) => item.children !== void 0 && item.children.length > 0 ? /* @__PURE__ */ jsxs23(DropdownMenu, { children: [
|
|
1595
|
+
/* @__PURE__ */ jsxs23(
|
|
1493
1596
|
DropdownMenuTrigger,
|
|
1494
1597
|
{
|
|
1495
1598
|
"data-slot": "header-menu-item",
|
|
1496
1599
|
"data-key": item.key,
|
|
1497
1600
|
className: cn(menuItemClass, "outline-hidden"),
|
|
1498
1601
|
children: [
|
|
1499
|
-
item.icon ? /* @__PURE__ */
|
|
1602
|
+
item.icon ? /* @__PURE__ */ jsx32(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1500
1603
|
item.label,
|
|
1501
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ jsx32(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
1502
1605
|
]
|
|
1503
1606
|
}
|
|
1504
1607
|
),
|
|
1505
|
-
/* @__PURE__ */
|
|
1506
|
-
] }, item.key) : /* @__PURE__ */
|
|
1608
|
+
/* @__PURE__ */ jsx32(DropdownMenuContent, { children: item.children.map((child) => /* @__PURE__ */ jsx32(HeaderMenuEntry, { item: child, onSelect }, child.key)) })
|
|
1609
|
+
] }, item.key) : /* @__PURE__ */ jsxs23(
|
|
1507
1610
|
"button",
|
|
1508
1611
|
{
|
|
1509
1612
|
type: "button",
|
|
@@ -1512,7 +1615,7 @@ function HeaderMenuArea({
|
|
|
1512
1615
|
className: menuItemClass,
|
|
1513
1616
|
onClick: () => onSelect?.(item.key),
|
|
1514
1617
|
children: [
|
|
1515
|
-
item.icon ? /* @__PURE__ */
|
|
1618
|
+
item.icon ? /* @__PURE__ */ jsx32(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1516
1619
|
item.label
|
|
1517
1620
|
]
|
|
1518
1621
|
},
|
|
@@ -1525,16 +1628,16 @@ function HeaderMenuEntry({
|
|
|
1525
1628
|
onSelect
|
|
1526
1629
|
}) {
|
|
1527
1630
|
if (item.children !== void 0 && item.children.length > 0) {
|
|
1528
|
-
return /* @__PURE__ */
|
|
1529
|
-
/* @__PURE__ */
|
|
1530
|
-
item.icon ? /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ jsxs23(DropdownMenuSub, { children: [
|
|
1632
|
+
/* @__PURE__ */ jsxs23(DropdownMenuSubTrigger, { "data-key": item.key, children: [
|
|
1633
|
+
item.icon ? /* @__PURE__ */ jsx32(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1531
1634
|
item.label
|
|
1532
1635
|
] }),
|
|
1533
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ jsx32(DropdownMenuSubContent, { children: item.children.map((child) => /* @__PURE__ */ jsx32(HeaderMenuEntry, { item: child, onSelect }, child.key)) })
|
|
1534
1637
|
] });
|
|
1535
1638
|
}
|
|
1536
|
-
return /* @__PURE__ */
|
|
1537
|
-
item.icon ? /* @__PURE__ */
|
|
1639
|
+
return /* @__PURE__ */ jsxs23(DropdownMenuItem, { "data-key": item.key, onClick: () => onSelect?.(item.key), children: [
|
|
1640
|
+
item.icon ? /* @__PURE__ */ jsx32(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1538
1641
|
item.label
|
|
1539
1642
|
] });
|
|
1540
1643
|
}
|
|
@@ -1542,18 +1645,18 @@ function HeaderUserArea({
|
|
|
1542
1645
|
user,
|
|
1543
1646
|
onSelect
|
|
1544
1647
|
}) {
|
|
1545
|
-
const identity = /* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
user.avatar !== void 0 && /* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1648
|
+
const identity = /* @__PURE__ */ jsxs23(Fragment2, { children: [
|
|
1649
|
+
/* @__PURE__ */ jsxs23(Avatar, { className: "size-7", children: [
|
|
1650
|
+
user.avatar !== void 0 && /* @__PURE__ */ jsx32(AvatarImage, { src: user.avatar, alt: user.name }),
|
|
1651
|
+
/* @__PURE__ */ jsx32(AvatarFallback, { children: user.name.charAt(0) })
|
|
1549
1652
|
] }),
|
|
1550
|
-
/* @__PURE__ */
|
|
1653
|
+
/* @__PURE__ */ jsx32("span", { className: "text-sm", children: user.name })
|
|
1551
1654
|
] });
|
|
1552
1655
|
if (user.items === void 0 || user.items.length === 0) {
|
|
1553
|
-
return /* @__PURE__ */
|
|
1656
|
+
return /* @__PURE__ */ jsx32("div", { "data-slot": "header-user", className: "flex items-center gap-2", children: identity });
|
|
1554
1657
|
}
|
|
1555
|
-
return /* @__PURE__ */
|
|
1556
|
-
/* @__PURE__ */
|
|
1658
|
+
return /* @__PURE__ */ jsxs23(DropdownMenu, { children: [
|
|
1659
|
+
/* @__PURE__ */ jsx32(
|
|
1557
1660
|
DropdownMenuTrigger,
|
|
1558
1661
|
{
|
|
1559
1662
|
"data-slot": "header-user",
|
|
@@ -1561,8 +1664,8 @@ function HeaderUserArea({
|
|
|
1561
1664
|
children: identity
|
|
1562
1665
|
}
|
|
1563
1666
|
),
|
|
1564
|
-
/* @__PURE__ */
|
|
1565
|
-
item.icon ? /* @__PURE__ */
|
|
1667
|
+
/* @__PURE__ */ jsx32(DropdownMenuContent, { align: "end", children: user.items.map((item) => /* @__PURE__ */ jsxs23(DropdownMenuItem, { onClick: () => onSelect?.(item.value), children: [
|
|
1668
|
+
item.icon ? /* @__PURE__ */ jsx32(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1566
1669
|
item.label
|
|
1567
1670
|
] }, item.value)) })
|
|
1568
1671
|
] });
|
|
@@ -1573,19 +1676,19 @@ function HeaderLocalesArea({
|
|
|
1573
1676
|
}) {
|
|
1574
1677
|
const { locale } = useI18n4();
|
|
1575
1678
|
const current = locales.find((option) => option.value === locale);
|
|
1576
|
-
return /* @__PURE__ */
|
|
1577
|
-
/* @__PURE__ */
|
|
1679
|
+
return /* @__PURE__ */ jsxs23(DropdownMenu, { children: [
|
|
1680
|
+
/* @__PURE__ */ jsxs23(
|
|
1578
1681
|
DropdownMenuTrigger,
|
|
1579
1682
|
{
|
|
1580
1683
|
"data-slot": "header-locales",
|
|
1581
1684
|
className: cn(menuItemClass, "outline-hidden"),
|
|
1582
1685
|
children: [
|
|
1583
1686
|
current?.label ?? locale,
|
|
1584
|
-
/* @__PURE__ */
|
|
1687
|
+
/* @__PURE__ */ jsx32(ChevronDownIcon, { className: "size-3.5", "aria-hidden": "true" })
|
|
1585
1688
|
]
|
|
1586
1689
|
}
|
|
1587
1690
|
),
|
|
1588
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ jsx32(DropdownMenuContent, { align: "end", children: locales.map((option) => /* @__PURE__ */ jsx32(
|
|
1589
1692
|
DropdownMenuItem,
|
|
1590
1693
|
{
|
|
1591
1694
|
onClick: () => onSelect?.(option.value),
|
|
@@ -1597,22 +1700,22 @@ function HeaderLocalesArea({
|
|
|
1597
1700
|
}
|
|
1598
1701
|
|
|
1599
1702
|
// src/components/components/HoverCard/index.tsx
|
|
1600
|
-
import { useRenderer as
|
|
1601
|
-
import { jsx as
|
|
1703
|
+
import { useRenderer as useRenderer8 } from "@pactor-app/runtime";
|
|
1704
|
+
import { jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1602
1705
|
function isDslNode2(value) {
|
|
1603
1706
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
1604
1707
|
}
|
|
1605
1708
|
function HoverCard2({ content, children, className, style }) {
|
|
1606
|
-
const { renderChildren } =
|
|
1607
|
-
return /* @__PURE__ */
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1709
|
+
const { renderChildren } = useRenderer8();
|
|
1710
|
+
return /* @__PURE__ */ jsxs24(HoverCard, { children: [
|
|
1711
|
+
/* @__PURE__ */ jsx33(HoverCardTrigger, { render: triggerWrapper("hover-card-trigger-wrap"), children }),
|
|
1712
|
+
/* @__PURE__ */ jsx33(HoverCardContent, { className, style, children: isDslNode2(content) ? renderChildren([content]) : content })
|
|
1610
1713
|
] });
|
|
1611
1714
|
}
|
|
1612
1715
|
|
|
1613
1716
|
// src/components/components/Input/index.tsx
|
|
1614
1717
|
import { useEffect as useEffect6, useId as useId3 } from "react";
|
|
1615
|
-
import { jsx as
|
|
1718
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1616
1719
|
function Input2({
|
|
1617
1720
|
name,
|
|
1618
1721
|
label,
|
|
@@ -1638,14 +1741,14 @@ function Input2({
|
|
|
1638
1741
|
if (inForm && form && name) {
|
|
1639
1742
|
const fieldValue = form.values[name];
|
|
1640
1743
|
const error = form.errors[name];
|
|
1641
|
-
return /* @__PURE__ */
|
|
1744
|
+
return /* @__PURE__ */ jsxs25(
|
|
1642
1745
|
"div",
|
|
1643
1746
|
{
|
|
1644
1747
|
"data-slot": "form-item",
|
|
1645
1748
|
className: cn(formItemClass(form.layout), className),
|
|
1646
1749
|
style,
|
|
1647
1750
|
children: [
|
|
1648
|
-
label ? /* @__PURE__ */
|
|
1751
|
+
label ? /* @__PURE__ */ jsx34(
|
|
1649
1752
|
"label",
|
|
1650
1753
|
{
|
|
1651
1754
|
htmlFor: controlId,
|
|
@@ -1653,7 +1756,7 @@ function Input2({
|
|
|
1653
1756
|
children: label
|
|
1654
1757
|
}
|
|
1655
1758
|
) : null,
|
|
1656
|
-
/* @__PURE__ */
|
|
1759
|
+
/* @__PURE__ */ jsx34(
|
|
1657
1760
|
Input,
|
|
1658
1761
|
{
|
|
1659
1762
|
id: controlId,
|
|
@@ -1667,12 +1770,12 @@ function Input2({
|
|
|
1667
1770
|
}
|
|
1668
1771
|
}
|
|
1669
1772
|
),
|
|
1670
|
-
error ? /* @__PURE__ */
|
|
1773
|
+
error ? /* @__PURE__ */ jsx34("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
1671
1774
|
]
|
|
1672
1775
|
}
|
|
1673
1776
|
);
|
|
1674
1777
|
}
|
|
1675
|
-
return /* @__PURE__ */
|
|
1778
|
+
return /* @__PURE__ */ jsx34(
|
|
1676
1779
|
Input,
|
|
1677
1780
|
{
|
|
1678
1781
|
type,
|
|
@@ -1687,14 +1790,14 @@ function Input2({
|
|
|
1687
1790
|
}
|
|
1688
1791
|
|
|
1689
1792
|
// src/components/components/InputGroup/index.tsx
|
|
1690
|
-
import { jsx as
|
|
1793
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
1691
1794
|
function InputGroup2({ className, style, children }) {
|
|
1692
|
-
return /* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ jsx35(InputGroup, { className, style, children });
|
|
1693
1796
|
}
|
|
1694
1797
|
|
|
1695
1798
|
// src/components/components/InputOTP/index.tsx
|
|
1696
|
-
import { useEffect as useEffect7, useState as
|
|
1697
|
-
import { jsx as
|
|
1799
|
+
import { useEffect as useEffect7, useState as useState9 } from "react";
|
|
1800
|
+
import { jsx as jsx36, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1698
1801
|
function InputOTP2({
|
|
1699
1802
|
name,
|
|
1700
1803
|
label,
|
|
@@ -1716,7 +1819,7 @@ function InputOTP2({
|
|
|
1716
1819
|
}
|
|
1717
1820
|
return void 0;
|
|
1718
1821
|
});
|
|
1719
|
-
const [innerValue, setInnerValue] =
|
|
1822
|
+
const [innerValue, setInnerValue] = useState9(typeof value === "string" ? value : "");
|
|
1720
1823
|
useEffect7(() => {
|
|
1721
1824
|
if (!inForm) setInnerValue(typeof value === "string" ? value : "");
|
|
1722
1825
|
}, [inForm, value]);
|
|
@@ -1732,38 +1835,38 @@ function InputOTP2({
|
|
|
1732
1835
|
onComplete?.(next);
|
|
1733
1836
|
}
|
|
1734
1837
|
};
|
|
1735
|
-
const control = /* @__PURE__ */
|
|
1838
|
+
const control = /* @__PURE__ */ jsx36(
|
|
1736
1839
|
InputOTP,
|
|
1737
1840
|
{
|
|
1738
1841
|
maxLength: length,
|
|
1739
1842
|
value: current,
|
|
1740
1843
|
onChange: handleChange,
|
|
1741
1844
|
disabled,
|
|
1742
|
-
children: /* @__PURE__ */
|
|
1845
|
+
children: /* @__PURE__ */ jsx36(InputOTPGroup, { children: Array.from({ length }, (_, index) => /* @__PURE__ */ jsx36(InputOTPSlot, { index }, index)) })
|
|
1743
1846
|
}
|
|
1744
1847
|
);
|
|
1745
1848
|
if (inForm && form && name) {
|
|
1746
1849
|
const error = form.errors[name];
|
|
1747
|
-
return /* @__PURE__ */
|
|
1850
|
+
return /* @__PURE__ */ jsxs26(
|
|
1748
1851
|
"div",
|
|
1749
1852
|
{
|
|
1750
1853
|
"data-slot": "form-item",
|
|
1751
1854
|
className: cn(formItemClass(form.layout), className),
|
|
1752
1855
|
style,
|
|
1753
1856
|
children: [
|
|
1754
|
-
label ? /* @__PURE__ */
|
|
1857
|
+
label ? /* @__PURE__ */ jsx36("label", { className: "shrink-0 text-sm leading-none font-medium whitespace-nowrap", children: label }) : null,
|
|
1755
1858
|
control,
|
|
1756
|
-
error ? /* @__PURE__ */
|
|
1859
|
+
error ? /* @__PURE__ */ jsx36("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
1757
1860
|
]
|
|
1758
1861
|
}
|
|
1759
1862
|
);
|
|
1760
1863
|
}
|
|
1761
|
-
return /* @__PURE__ */
|
|
1864
|
+
return /* @__PURE__ */ jsx36("div", { "data-slot": "input-otp-field", className: cn("inline-block", className), style, children: control });
|
|
1762
1865
|
}
|
|
1763
1866
|
|
|
1764
1867
|
// src/components/components/Item/index.tsx
|
|
1765
|
-
import { useRenderer as
|
|
1766
|
-
import { jsx as
|
|
1868
|
+
import { useRenderer as useRenderer9 } from "@pactor-app/runtime";
|
|
1869
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1767
1870
|
function Item2({
|
|
1768
1871
|
title,
|
|
1769
1872
|
description,
|
|
@@ -1772,41 +1875,41 @@ function Item2({
|
|
|
1772
1875
|
className,
|
|
1773
1876
|
style
|
|
1774
1877
|
}) {
|
|
1775
|
-
const { renderChildren } =
|
|
1878
|
+
const { renderChildren } = useRenderer9();
|
|
1776
1879
|
const mediaNodes = media === void 0 ? [] : Array.isArray(media) ? media : [media];
|
|
1777
|
-
return /* @__PURE__ */
|
|
1778
|
-
mediaNodes.length > 0 ? /* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1780
|
-
title ? /* @__PURE__ */
|
|
1781
|
-
description ? /* @__PURE__ */
|
|
1880
|
+
return /* @__PURE__ */ jsxs27(Item, { className, style, children: [
|
|
1881
|
+
mediaNodes.length > 0 ? /* @__PURE__ */ jsx37(ItemMedia, { children: renderChildren(mediaNodes) }) : null,
|
|
1882
|
+
/* @__PURE__ */ jsxs27(ItemContent, { children: [
|
|
1883
|
+
title ? /* @__PURE__ */ jsx37(ItemTitle, { children: title }) : null,
|
|
1884
|
+
description ? /* @__PURE__ */ jsx37(ItemDescription, { children: description }) : null
|
|
1782
1885
|
] }),
|
|
1783
|
-
actions && actions.length > 0 ? /* @__PURE__ */
|
|
1886
|
+
actions && actions.length > 0 ? /* @__PURE__ */ jsx37(ItemActions, { children: renderChildren(actions) }) : null
|
|
1784
1887
|
] });
|
|
1785
1888
|
}
|
|
1786
1889
|
|
|
1787
1890
|
// src/components/components/Kbd/index.tsx
|
|
1788
|
-
import { jsx as
|
|
1891
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
1789
1892
|
function Kbd2({ text, className, style }) {
|
|
1790
|
-
return /* @__PURE__ */
|
|
1893
|
+
return /* @__PURE__ */ jsx38(Kbd, { className, style, children: text });
|
|
1791
1894
|
}
|
|
1792
1895
|
|
|
1793
1896
|
// src/components/components/Label/index.tsx
|
|
1794
|
-
import { jsx as
|
|
1897
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
1795
1898
|
function Label2({ text, htmlFor, className, style }) {
|
|
1796
|
-
return /* @__PURE__ */
|
|
1899
|
+
return /* @__PURE__ */ jsx39(Label, { htmlFor, className, style, children: text });
|
|
1797
1900
|
}
|
|
1798
1901
|
|
|
1799
1902
|
// src/components/components/Layout/index.tsx
|
|
1800
1903
|
import { isDslSourceRef } from "@pactor-app/core";
|
|
1801
|
-
import { useRenderer as
|
|
1802
|
-
import { jsx as
|
|
1904
|
+
import { useRenderer as useRenderer10 } from "@pactor-app/runtime";
|
|
1905
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
1803
1906
|
function Layout({ direction, className, style, dslChildren }) {
|
|
1804
|
-
const { renderChildren, context } =
|
|
1907
|
+
const { renderChildren, context } = useRenderer10();
|
|
1805
1908
|
const hasSider = Array.isArray(dslChildren) ? dslChildren.some(
|
|
1806
1909
|
(child) => !isDslSourceRef(child) && resolveRootType(child, context) === "Sider"
|
|
1807
1910
|
) : false;
|
|
1808
1911
|
const dir = direction ?? (hasSider ? "horizontal" : "vertical");
|
|
1809
|
-
return /* @__PURE__ */
|
|
1912
|
+
return /* @__PURE__ */ jsx40(
|
|
1810
1913
|
"div",
|
|
1811
1914
|
{
|
|
1812
1915
|
"data-slot": "layout",
|
|
@@ -1830,9 +1933,9 @@ function resolveRootType(node, context) {
|
|
|
1830
1933
|
}
|
|
1831
1934
|
|
|
1832
1935
|
// src/components/components/Link/index.tsx
|
|
1833
|
-
import { jsx as
|
|
1936
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
1834
1937
|
function Link({ href, text, target, className, style, children }) {
|
|
1835
|
-
return /* @__PURE__ */
|
|
1938
|
+
return /* @__PURE__ */ jsx41(
|
|
1836
1939
|
"a",
|
|
1837
1940
|
{
|
|
1838
1941
|
"data-slot": "link",
|
|
@@ -1846,82 +1949,6 @@ function Link({ href, text, target, className, style, children }) {
|
|
|
1846
1949
|
);
|
|
1847
1950
|
}
|
|
1848
1951
|
|
|
1849
|
-
// src/components/components/Menu/index.tsx
|
|
1850
|
-
import { jsx as jsx41, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1851
|
-
function Menu({
|
|
1852
|
-
items = [],
|
|
1853
|
-
mode = "inline",
|
|
1854
|
-
selectedKey,
|
|
1855
|
-
onSelect,
|
|
1856
|
-
className,
|
|
1857
|
-
style
|
|
1858
|
-
}) {
|
|
1859
|
-
return /* @__PURE__ */ jsx41(
|
|
1860
|
-
"nav",
|
|
1861
|
-
{
|
|
1862
|
-
"data-slot": "menu",
|
|
1863
|
-
"data-mode": mode,
|
|
1864
|
-
className: cn(
|
|
1865
|
-
mode === "horizontal" ? "flex items-center gap-1" : "flex flex-col gap-0.5 p-2",
|
|
1866
|
-
className
|
|
1867
|
-
),
|
|
1868
|
-
style,
|
|
1869
|
-
children: items.map((item) => /* @__PURE__ */ jsx41(
|
|
1870
|
-
MenuEntry,
|
|
1871
|
-
{
|
|
1872
|
-
item,
|
|
1873
|
-
mode,
|
|
1874
|
-
depth: 0,
|
|
1875
|
-
selectedKey,
|
|
1876
|
-
onSelect
|
|
1877
|
-
},
|
|
1878
|
-
item.key
|
|
1879
|
-
))
|
|
1880
|
-
}
|
|
1881
|
-
);
|
|
1882
|
-
}
|
|
1883
|
-
function MenuEntry({
|
|
1884
|
-
item,
|
|
1885
|
-
mode,
|
|
1886
|
-
depth,
|
|
1887
|
-
selectedKey,
|
|
1888
|
-
onSelect
|
|
1889
|
-
}) {
|
|
1890
|
-
const selected = item.key === selectedKey;
|
|
1891
|
-
return /* @__PURE__ */ jsxs27("div", { "data-slot": "menu-entry", "data-key": item.key, children: [
|
|
1892
|
-
/* @__PURE__ */ jsxs27(
|
|
1893
|
-
"button",
|
|
1894
|
-
{
|
|
1895
|
-
type: "button",
|
|
1896
|
-
"data-slot": "menu-item",
|
|
1897
|
-
"aria-current": selected ? "page" : void 0,
|
|
1898
|
-
className: cn(
|
|
1899
|
-
"flex w-full items-center gap-2 rounded-md text-sm transition-colors",
|
|
1900
|
-
mode === "horizontal" ? "px-3 py-2" : "px-3 py-2 text-left",
|
|
1901
|
-
selected ? "bg-accent font-medium text-accent-foreground" : "text-muted-foreground hover:bg-accent/50 hover:text-foreground"
|
|
1902
|
-
),
|
|
1903
|
-
style: mode === "inline" && depth > 0 ? { paddingLeft: 12 + depth * 16 } : void 0,
|
|
1904
|
-
onClick: () => onSelect?.(item.key),
|
|
1905
|
-
children: [
|
|
1906
|
-
item.icon ? /* @__PURE__ */ jsx41(Icon, { name: item.icon, size: "sm" }) : null,
|
|
1907
|
-
item.label
|
|
1908
|
-
]
|
|
1909
|
-
}
|
|
1910
|
-
),
|
|
1911
|
-
item.children?.map((child) => /* @__PURE__ */ jsx41(
|
|
1912
|
-
MenuEntry,
|
|
1913
|
-
{
|
|
1914
|
-
item: child,
|
|
1915
|
-
mode,
|
|
1916
|
-
depth: depth + 1,
|
|
1917
|
-
selectedKey,
|
|
1918
|
-
onSelect
|
|
1919
|
-
},
|
|
1920
|
-
child.key
|
|
1921
|
-
))
|
|
1922
|
-
] });
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
1952
|
// src/components/components/Menubar/index.tsx
|
|
1926
1953
|
import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1927
1954
|
function Menubar2({ menus = [], onSelect, className, style }) {
|
|
@@ -1995,7 +2022,7 @@ function Page({ title, className, style, children }) {
|
|
|
1995
2022
|
}
|
|
1996
2023
|
|
|
1997
2024
|
// src/components/components/Pagination/index.tsx
|
|
1998
|
-
import { useState as
|
|
2025
|
+
import { useState as useState10 } from "react";
|
|
1999
2026
|
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2000
2027
|
function pageItems(current, count) {
|
|
2001
2028
|
if (count <= 7) {
|
|
@@ -2017,7 +2044,7 @@ function Pagination2({
|
|
|
2017
2044
|
className,
|
|
2018
2045
|
style
|
|
2019
2046
|
}) {
|
|
2020
|
-
const [innerPage, setInnerPage] =
|
|
2047
|
+
const [innerPage, setInnerPage] = useState10(1);
|
|
2021
2048
|
const pageCount = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
|
|
2022
2049
|
const current = Math.min(Math.max(1, page ?? innerPage), pageCount);
|
|
2023
2050
|
const goTo = (next) => {
|
|
@@ -2069,13 +2096,13 @@ function Pagination2({
|
|
|
2069
2096
|
}
|
|
2070
2097
|
|
|
2071
2098
|
// src/components/components/Popover/index.tsx
|
|
2072
|
-
import { useRenderer as
|
|
2099
|
+
import { useRenderer as useRenderer11 } from "@pactor-app/runtime";
|
|
2073
2100
|
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2074
2101
|
function isDslNode3(value) {
|
|
2075
2102
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
2076
2103
|
}
|
|
2077
2104
|
function Popover2({ content, children, className, style }) {
|
|
2078
|
-
const { renderChildren } =
|
|
2105
|
+
const { renderChildren } = useRenderer11();
|
|
2079
2106
|
return /* @__PURE__ */ jsxs32(Popover, { children: [
|
|
2080
2107
|
/* @__PURE__ */ jsx46(
|
|
2081
2108
|
PopoverTrigger,
|
|
@@ -2205,7 +2232,7 @@ function RadioGroup2({
|
|
|
2205
2232
|
}
|
|
2206
2233
|
|
|
2207
2234
|
// src/components/components/Resizable/index.tsx
|
|
2208
|
-
import { useRenderer as
|
|
2235
|
+
import { useRenderer as useRenderer12 } from "@pactor-app/runtime";
|
|
2209
2236
|
import { Fragment as Fragment4 } from "react";
|
|
2210
2237
|
import { jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2211
2238
|
function Resizable({
|
|
@@ -2214,7 +2241,7 @@ function Resizable({
|
|
|
2214
2241
|
className,
|
|
2215
2242
|
style
|
|
2216
2243
|
}) {
|
|
2217
|
-
const { renderChildren } =
|
|
2244
|
+
const { renderChildren } = useRenderer12();
|
|
2218
2245
|
return /* @__PURE__ */ jsx50(PanelGroup, { orientation: direction, className, style, children: panels.map((panel, index) => /* @__PURE__ */ jsxs35(Fragment4, { children: [
|
|
2219
2246
|
index > 0 ? /* @__PURE__ */ jsx50(ResizableHandle, { withHandle: true }) : null,
|
|
2220
2247
|
/* @__PURE__ */ jsx50(
|
|
@@ -2389,120 +2416,9 @@ function Sheet2({
|
|
|
2389
2416
|
);
|
|
2390
2417
|
}
|
|
2391
2418
|
|
|
2392
|
-
// src/components/components/
|
|
2393
|
-
import { useI18n as useI18n6 } from "@pactor-app/runtime";
|
|
2419
|
+
// src/components/components/Sider/index.tsx
|
|
2394
2420
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
2395
|
-
import { useState as useState10 } from "react";
|
|
2396
2421
|
import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
2397
|
-
function Sidebar({
|
|
2398
|
-
brand,
|
|
2399
|
-
items = [],
|
|
2400
|
-
collapsible,
|
|
2401
|
-
onCollapse,
|
|
2402
|
-
className,
|
|
2403
|
-
style,
|
|
2404
|
-
children
|
|
2405
|
-
}) {
|
|
2406
|
-
const { t } = useI18n6();
|
|
2407
|
-
const [collapsed, setCollapsed] = useState10(false);
|
|
2408
|
-
const toggleCollapsed = () => {
|
|
2409
|
-
const next = !collapsed;
|
|
2410
|
-
setCollapsed(next);
|
|
2411
|
-
onCollapse?.(next);
|
|
2412
|
-
};
|
|
2413
|
-
return /* @__PURE__ */ jsxs38(
|
|
2414
|
-
"div",
|
|
2415
|
-
{
|
|
2416
|
-
"data-slot": "sidebar-layout",
|
|
2417
|
-
className: cn("flex min-h-screen w-full", className),
|
|
2418
|
-
style,
|
|
2419
|
-
children: [
|
|
2420
|
-
/* @__PURE__ */ jsxs38(
|
|
2421
|
-
"aside",
|
|
2422
|
-
{
|
|
2423
|
-
"data-slot": "sidebar",
|
|
2424
|
-
"data-collapsed": collapsed || void 0,
|
|
2425
|
-
className: cn(
|
|
2426
|
-
"flex shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-[width]",
|
|
2427
|
-
collapsed ? "w-14" : "w-60"
|
|
2428
|
-
),
|
|
2429
|
-
children: [
|
|
2430
|
-
brand ? /* @__PURE__ */ jsxs38(
|
|
2431
|
-
"div",
|
|
2432
|
-
{
|
|
2433
|
-
"data-slot": "sidebar-brand",
|
|
2434
|
-
className: "flex h-14 shrink-0 items-center gap-2 border-b border-sidebar-border px-4",
|
|
2435
|
-
children: [
|
|
2436
|
-
brand.logo ? /* @__PURE__ */ jsx55(
|
|
2437
|
-
"img",
|
|
2438
|
-
{
|
|
2439
|
-
"data-slot": "sidebar-brand-logo",
|
|
2440
|
-
src: brand.logo,
|
|
2441
|
-
alt: brand.title,
|
|
2442
|
-
className: "size-6 shrink-0"
|
|
2443
|
-
}
|
|
2444
|
-
) : null,
|
|
2445
|
-
collapsed ? null : /* @__PURE__ */ jsx55("span", { className: "truncate text-sm font-semibold", children: brand.title })
|
|
2446
|
-
]
|
|
2447
|
-
}
|
|
2448
|
-
) : null,
|
|
2449
|
-
collapsed ? null : /* @__PURE__ */ jsx55("nav", { "data-slot": "sidebar-nav", className: "min-h-0 flex-1 overflow-auto p-2", children: items.map((item, index) => /* @__PURE__ */ jsx55(SidebarEntry, { item, depth: 0 }, item.href ?? item.label ?? index)) }),
|
|
2450
|
-
collapsible ? /* @__PURE__ */ jsx55(
|
|
2451
|
-
"button",
|
|
2452
|
-
{
|
|
2453
|
-
type: "button",
|
|
2454
|
-
"data-slot": "sidebar-collapse-trigger",
|
|
2455
|
-
"aria-label": collapsed ? t("pactor.layout.expandSidebar") : t("pactor.layout.collapseSidebar"),
|
|
2456
|
-
className: "flex h-10 shrink-0 items-center justify-center border-t border-sidebar-border text-sidebar-foreground/60 hover:text-sidebar-foreground",
|
|
2457
|
-
onClick: toggleCollapsed,
|
|
2458
|
-
children: collapsed ? /* @__PURE__ */ jsx55(ChevronRight, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ jsx55(ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
2459
|
-
}
|
|
2460
|
-
) : null
|
|
2461
|
-
]
|
|
2462
|
-
}
|
|
2463
|
-
),
|
|
2464
|
-
/* @__PURE__ */ jsx55("main", { "data-slot": "sidebar-content", className: "min-w-0 flex-1", children })
|
|
2465
|
-
]
|
|
2466
|
-
}
|
|
2467
|
-
);
|
|
2468
|
-
}
|
|
2469
|
-
function SidebarEntry({ item, depth }) {
|
|
2470
|
-
const entryClass = cn(
|
|
2471
|
-
"flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors",
|
|
2472
|
-
"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"
|
|
2473
|
-
);
|
|
2474
|
-
const indentStyle = depth > 0 ? { paddingLeft: 12 + depth * 16 } : void 0;
|
|
2475
|
-
return /* @__PURE__ */ jsxs38("div", { "data-slot": "sidebar-entry", children: [
|
|
2476
|
-
item.href ? /* @__PURE__ */ jsxs38(
|
|
2477
|
-
"a",
|
|
2478
|
-
{
|
|
2479
|
-
"data-slot": "sidebar-item",
|
|
2480
|
-
href: item.href,
|
|
2481
|
-
className: entryClass,
|
|
2482
|
-
style: indentStyle,
|
|
2483
|
-
children: [
|
|
2484
|
-
item.icon ? /* @__PURE__ */ jsx55(Icon, { name: item.icon, size: "sm" }) : null,
|
|
2485
|
-
item.label
|
|
2486
|
-
]
|
|
2487
|
-
}
|
|
2488
|
-
) : /* @__PURE__ */ jsxs38("span", { "data-slot": "sidebar-item", className: entryClass, style: indentStyle, children: [
|
|
2489
|
-
item.icon ? /* @__PURE__ */ jsx55(Icon, { name: item.icon, size: "sm" }) : null,
|
|
2490
|
-
item.label
|
|
2491
|
-
] }),
|
|
2492
|
-
item.children?.map((child, index) => /* @__PURE__ */ jsx55(
|
|
2493
|
-
SidebarEntry,
|
|
2494
|
-
{
|
|
2495
|
-
item: child,
|
|
2496
|
-
depth: depth + 1
|
|
2497
|
-
},
|
|
2498
|
-
child.href ?? child.label ?? index
|
|
2499
|
-
))
|
|
2500
|
-
] });
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
// src/components/components/Sider/index.tsx
|
|
2504
|
-
import { ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
2505
|
-
import { jsx as jsx56, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
2506
2422
|
function Sider({
|
|
2507
2423
|
width = 200,
|
|
2508
2424
|
collapsible,
|
|
@@ -2514,7 +2430,7 @@ function Sider({
|
|
|
2514
2430
|
children
|
|
2515
2431
|
}) {
|
|
2516
2432
|
const current = collapsed ? collapsedWidth : width;
|
|
2517
|
-
return /* @__PURE__ */
|
|
2433
|
+
return /* @__PURE__ */ jsxs38(
|
|
2518
2434
|
"aside",
|
|
2519
2435
|
{
|
|
2520
2436
|
"data-slot": "layout-sider",
|
|
@@ -2525,15 +2441,15 @@ function Sider({
|
|
|
2525
2441
|
),
|
|
2526
2442
|
style: { width: current, ...style },
|
|
2527
2443
|
children: [
|
|
2528
|
-
/* @__PURE__ */
|
|
2529
|
-
collapsible ? /* @__PURE__ */
|
|
2444
|
+
/* @__PURE__ */ jsx55("div", { className: "min-h-0 flex-1 overflow-auto", children }),
|
|
2445
|
+
collapsible ? /* @__PURE__ */ jsx55(
|
|
2530
2446
|
"button",
|
|
2531
2447
|
{
|
|
2532
2448
|
type: "button",
|
|
2533
2449
|
"aria-label": collapsed ? "expand sider" : "collapse sider",
|
|
2534
2450
|
className: "flex h-10 shrink-0 items-center justify-center border-t text-muted-foreground hover:text-foreground",
|
|
2535
2451
|
onClick: () => onCollapse?.(!collapsed),
|
|
2536
|
-
children: collapsed ? /* @__PURE__ */
|
|
2452
|
+
children: collapsed ? /* @__PURE__ */ jsx55(ChevronRight, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ jsx55(ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
2537
2453
|
}
|
|
2538
2454
|
) : null
|
|
2539
2455
|
]
|
|
@@ -2542,7 +2458,7 @@ function Sider({
|
|
|
2542
2458
|
}
|
|
2543
2459
|
|
|
2544
2460
|
// src/components/components/Skeleton/index.tsx
|
|
2545
|
-
import { jsx as
|
|
2461
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
2546
2462
|
var shapeDefaults = {
|
|
2547
2463
|
line: { className: "h-4 w-full", style: {} },
|
|
2548
2464
|
circle: { className: "rounded-full", style: { width: 40, height: 40 } },
|
|
@@ -2553,7 +2469,7 @@ function toSize(value) {
|
|
|
2553
2469
|
}
|
|
2554
2470
|
function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
2555
2471
|
const defaults = shapeDefaults[shape];
|
|
2556
|
-
return /* @__PURE__ */
|
|
2472
|
+
return /* @__PURE__ */ jsx56(
|
|
2557
2473
|
Skeleton,
|
|
2558
2474
|
{
|
|
2559
2475
|
className: cn(defaults.className, className),
|
|
@@ -2569,7 +2485,7 @@ function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
|
2569
2485
|
|
|
2570
2486
|
// src/components/components/Slider/index.tsx
|
|
2571
2487
|
import { useEffect as useEffect10 } from "react";
|
|
2572
|
-
import { jsx as
|
|
2488
|
+
import { jsx as jsx57, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
2573
2489
|
function Slider2({
|
|
2574
2490
|
name,
|
|
2575
2491
|
label,
|
|
@@ -2600,7 +2516,7 @@ function Slider2({
|
|
|
2600
2516
|
}
|
|
2601
2517
|
onChange?.(next);
|
|
2602
2518
|
};
|
|
2603
|
-
const slider = /* @__PURE__ */
|
|
2519
|
+
const slider = /* @__PURE__ */ jsx57(
|
|
2604
2520
|
Slider,
|
|
2605
2521
|
{
|
|
2606
2522
|
value: numberValue,
|
|
@@ -2612,14 +2528,14 @@ function Slider2({
|
|
|
2612
2528
|
onValueChange: handleChange,
|
|
2613
2529
|
className: inForm ? void 0 : className,
|
|
2614
2530
|
style: inForm ? void 0 : style,
|
|
2615
|
-
children: /* @__PURE__ */
|
|
2616
|
-
/* @__PURE__ */
|
|
2617
|
-
/* @__PURE__ */
|
|
2531
|
+
children: /* @__PURE__ */ jsx57(SliderControl, { children: /* @__PURE__ */ jsxs39(SliderTrack, { children: [
|
|
2532
|
+
/* @__PURE__ */ jsx57(SliderIndicator, {}),
|
|
2533
|
+
/* @__PURE__ */ jsx57(SliderThumb, {})
|
|
2618
2534
|
] }) })
|
|
2619
2535
|
}
|
|
2620
2536
|
);
|
|
2621
2537
|
if (inForm && form && name) {
|
|
2622
|
-
return /* @__PURE__ */
|
|
2538
|
+
return /* @__PURE__ */ jsx57(
|
|
2623
2539
|
FieldShell,
|
|
2624
2540
|
{
|
|
2625
2541
|
layout: form.layout,
|
|
@@ -2635,11 +2551,11 @@ function Slider2({
|
|
|
2635
2551
|
}
|
|
2636
2552
|
|
|
2637
2553
|
// src/components/components/Sonner/index.tsx
|
|
2638
|
-
import { useRenderer as
|
|
2554
|
+
import { useRenderer as useRenderer13 } from "@pactor-app/runtime";
|
|
2639
2555
|
import { useEffect as useEffect11 } from "react";
|
|
2640
|
-
import { jsx as
|
|
2556
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2641
2557
|
function Sonner({ className, style }) {
|
|
2642
|
-
const { context } =
|
|
2558
|
+
const { context } = useRenderer13();
|
|
2643
2559
|
useEffect11(() => {
|
|
2644
2560
|
const { actions } = context;
|
|
2645
2561
|
if (actions.has("toast")) {
|
|
@@ -2654,36 +2570,36 @@ function Sonner({ className, style }) {
|
|
|
2654
2570
|
return { ok: true };
|
|
2655
2571
|
});
|
|
2656
2572
|
}, [context]);
|
|
2657
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ jsx58("div", { "data-slot": "sonner", className, style, children: /* @__PURE__ */ jsx58(Toaster, {}) });
|
|
2658
2574
|
}
|
|
2659
2575
|
|
|
2660
2576
|
// src/components/components/Spinner/index.tsx
|
|
2661
|
-
import { jsx as
|
|
2577
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2662
2578
|
var sizeClass = {
|
|
2663
2579
|
sm: "size-3",
|
|
2664
2580
|
default: "size-4",
|
|
2665
2581
|
lg: "size-6"
|
|
2666
2582
|
};
|
|
2667
2583
|
function Spinner2({ size = "default", className, style }) {
|
|
2668
|
-
return /* @__PURE__ */
|
|
2584
|
+
return /* @__PURE__ */ jsx59(Spinner, { className: cn(sizeClass[size], className), style });
|
|
2669
2585
|
}
|
|
2670
2586
|
|
|
2671
2587
|
// src/components/components/Statistic/index.tsx
|
|
2672
|
-
import { jsx as
|
|
2588
|
+
import { jsx as jsx60, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
2673
2589
|
function Statistic({ title, value, precision, suffix, className, style }) {
|
|
2674
2590
|
const display = typeof value === "number" && precision !== void 0 ? value.toFixed(precision) : value;
|
|
2675
|
-
return /* @__PURE__ */
|
|
2676
|
-
title ? /* @__PURE__ */
|
|
2677
|
-
/* @__PURE__ */
|
|
2591
|
+
return /* @__PURE__ */ jsxs40("div", { "data-slot": "statistic", className: cn(className), style, children: [
|
|
2592
|
+
title ? /* @__PURE__ */ jsx60("div", { "data-slot": "statistic-title", className: "text-sm text-muted-foreground", children: title }) : null,
|
|
2593
|
+
/* @__PURE__ */ jsxs40("div", { "data-slot": "statistic-value", className: "text-2xl font-bold tabular-nums", children: [
|
|
2678
2594
|
display,
|
|
2679
|
-
suffix ? /* @__PURE__ */
|
|
2595
|
+
suffix ? /* @__PURE__ */ jsx60("span", { className: "ml-1 text-sm font-normal text-muted-foreground", children: suffix }) : null
|
|
2680
2596
|
] })
|
|
2681
2597
|
] });
|
|
2682
2598
|
}
|
|
2683
2599
|
|
|
2684
2600
|
// src/components/components/Switch/index.tsx
|
|
2685
2601
|
import { useEffect as useEffect12, useId as useId6 } from "react";
|
|
2686
|
-
import { jsx as
|
|
2602
|
+
import { jsx as jsx61, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
2687
2603
|
function Switch2({
|
|
2688
2604
|
name,
|
|
2689
2605
|
label,
|
|
@@ -2712,13 +2628,13 @@ function Switch2({
|
|
|
2712
2628
|
}
|
|
2713
2629
|
onChange?.(next);
|
|
2714
2630
|
};
|
|
2715
|
-
const control = /* @__PURE__ */
|
|
2631
|
+
const control = /* @__PURE__ */ jsxs41(
|
|
2716
2632
|
"span",
|
|
2717
2633
|
{
|
|
2718
2634
|
className: cn("inline-flex items-center gap-2", !inForm && className),
|
|
2719
2635
|
style: inForm ? void 0 : style,
|
|
2720
2636
|
children: [
|
|
2721
|
-
/* @__PURE__ */
|
|
2637
|
+
/* @__PURE__ */ jsx61(
|
|
2722
2638
|
Switch,
|
|
2723
2639
|
{
|
|
2724
2640
|
id: controlId,
|
|
@@ -2728,12 +2644,12 @@ function Switch2({
|
|
|
2728
2644
|
onCheckedChange: handleChange
|
|
2729
2645
|
}
|
|
2730
2646
|
),
|
|
2731
|
-
label ? /* @__PURE__ */
|
|
2647
|
+
label ? /* @__PURE__ */ jsx61("label", { htmlFor: controlId, className: "text-sm leading-none font-medium", children: label }) : null
|
|
2732
2648
|
]
|
|
2733
2649
|
}
|
|
2734
2650
|
);
|
|
2735
2651
|
if (inForm && form && name) {
|
|
2736
|
-
return /* @__PURE__ */
|
|
2652
|
+
return /* @__PURE__ */ jsxs41(
|
|
2737
2653
|
"div",
|
|
2738
2654
|
{
|
|
2739
2655
|
"data-slot": "form-item",
|
|
@@ -2741,7 +2657,7 @@ function Switch2({
|
|
|
2741
2657
|
style,
|
|
2742
2658
|
children: [
|
|
2743
2659
|
control,
|
|
2744
|
-
form.errors[name] ? /* @__PURE__ */
|
|
2660
|
+
form.errors[name] ? /* @__PURE__ */ jsx61("div", { "data-slot": "form-error", className: "mt-1.5 text-sm text-destructive", children: form.errors[name] }) : null
|
|
2745
2661
|
]
|
|
2746
2662
|
}
|
|
2747
2663
|
);
|
|
@@ -2750,9 +2666,9 @@ function Switch2({
|
|
|
2750
2666
|
}
|
|
2751
2667
|
|
|
2752
2668
|
// src/components/components/Table/index.tsx
|
|
2753
|
-
import { useI18n as
|
|
2669
|
+
import { useI18n as useI18n6, useRenderer as useRenderer14 } from "@pactor-app/runtime";
|
|
2754
2670
|
import { useState as useState11 } from "react";
|
|
2755
|
-
import { jsx as
|
|
2671
|
+
import { jsx as jsx62, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
2756
2672
|
function renderCellValue2(value) {
|
|
2757
2673
|
if (value === void 0 || value === null) {
|
|
2758
2674
|
return "";
|
|
@@ -2772,8 +2688,8 @@ function Table2({
|
|
|
2772
2688
|
className,
|
|
2773
2689
|
style
|
|
2774
2690
|
}) {
|
|
2775
|
-
const { renderChildren } =
|
|
2776
|
-
const { t } =
|
|
2691
|
+
const { renderChildren } = useRenderer14();
|
|
2692
|
+
const { t } = useI18n6();
|
|
2777
2693
|
const [current, setCurrent] = useState11(1);
|
|
2778
2694
|
const pageSize = pagination === false ? void 0 : pagination?.pageSize;
|
|
2779
2695
|
const total = dataSource.length;
|
|
@@ -2783,8 +2699,8 @@ function Table2({
|
|
|
2783
2699
|
setCurrent(page);
|
|
2784
2700
|
onChange?.({ current: page, pageSize, total });
|
|
2785
2701
|
};
|
|
2786
|
-
return /* @__PURE__ */
|
|
2787
|
-
loading ? /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ jsxs42("div", { "data-slot": "dsl-table", className: cn("relative", className), style, children: [
|
|
2703
|
+
loading ? /* @__PURE__ */ jsx62(
|
|
2788
2704
|
"div",
|
|
2789
2705
|
{
|
|
2790
2706
|
"data-slot": "table-loading",
|
|
@@ -2792,8 +2708,8 @@ function Table2({
|
|
|
2792
2708
|
children: t("pactor.table.loading")
|
|
2793
2709
|
}
|
|
2794
2710
|
) : null,
|
|
2795
|
-
/* @__PURE__ */
|
|
2796
|
-
/* @__PURE__ */
|
|
2711
|
+
/* @__PURE__ */ jsxs42(Table, { children: [
|
|
2712
|
+
/* @__PURE__ */ jsx62(TableHeader, { children: /* @__PURE__ */ jsx62(TableRow, { className: "hover:bg-transparent", children: columns.map((column, index) => /* @__PURE__ */ jsx62(
|
|
2797
2713
|
TableHead,
|
|
2798
2714
|
{
|
|
2799
2715
|
style: column.width !== void 0 ? { width: column.width } : void 0,
|
|
@@ -2801,7 +2717,7 @@ function Table2({
|
|
|
2801
2717
|
},
|
|
2802
2718
|
column.dataIndex ?? String(index)
|
|
2803
2719
|
)) }) }),
|
|
2804
|
-
/* @__PURE__ */
|
|
2720
|
+
/* @__PURE__ */ jsx62(TableBody, { children: pageRows.length === 0 ? /* @__PURE__ */ jsx62(TableRow, { className: "hover:bg-transparent", children: /* @__PURE__ */ jsx62(TableCell, { colSpan: Math.max(1, columns.length), children: /* @__PURE__ */ jsx62(
|
|
2805
2721
|
"div",
|
|
2806
2722
|
{
|
|
2807
2723
|
"data-slot": "table-empty",
|
|
@@ -2810,10 +2726,10 @@ function Table2({
|
|
|
2810
2726
|
}
|
|
2811
2727
|
) }) }) : pageRows.map((row, rowIndex) => {
|
|
2812
2728
|
const key = row[rowKey];
|
|
2813
|
-
return /* @__PURE__ */
|
|
2729
|
+
return /* @__PURE__ */ jsx62(
|
|
2814
2730
|
TableRow,
|
|
2815
2731
|
{
|
|
2816
|
-
children: columns.map((column, columnIndex) => /* @__PURE__ */
|
|
2732
|
+
children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx62(TableCell, { children: column.cell ? renderChildren([column.cell], { row, rowIndex }) : renderCellValue2(
|
|
2817
2733
|
column.dataIndex === void 0 ? void 0 : row[column.dataIndex]
|
|
2818
2734
|
) }, column.dataIndex ?? String(columnIndex)))
|
|
2819
2735
|
},
|
|
@@ -2821,8 +2737,8 @@ function Table2({
|
|
|
2821
2737
|
);
|
|
2822
2738
|
}) })
|
|
2823
2739
|
] }),
|
|
2824
|
-
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */
|
|
2825
|
-
(page) => /* @__PURE__ */
|
|
2740
|
+
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */ jsx62("div", { "data-slot": "table-pagination", className: "mt-3 flex justify-end gap-1", children: Array.from({ length: pageCount }, (_, index) => index + 1).map(
|
|
2741
|
+
(page) => /* @__PURE__ */ jsx62(
|
|
2826
2742
|
Button,
|
|
2827
2743
|
{
|
|
2828
2744
|
type: "button",
|
|
@@ -2839,11 +2755,11 @@ function Table2({
|
|
|
2839
2755
|
}
|
|
2840
2756
|
|
|
2841
2757
|
// src/components/components/Tabs/index.tsx
|
|
2842
|
-
import { useRenderer as
|
|
2843
|
-
import { jsx as
|
|
2758
|
+
import { useRenderer as useRenderer15 } from "@pactor-app/runtime";
|
|
2759
|
+
import { jsx as jsx63, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
2844
2760
|
function Tabs2({ items = [], activeKey, onChange, className, style }) {
|
|
2845
|
-
const { renderChildren } =
|
|
2846
|
-
return /* @__PURE__ */
|
|
2761
|
+
const { renderChildren } = useRenderer15();
|
|
2762
|
+
return /* @__PURE__ */ jsxs43(
|
|
2847
2763
|
Tabs,
|
|
2848
2764
|
{
|
|
2849
2765
|
value: activeKey,
|
|
@@ -2852,15 +2768,15 @@ function Tabs2({ items = [], activeKey, onChange, className, style }) {
|
|
|
2852
2768
|
className,
|
|
2853
2769
|
style,
|
|
2854
2770
|
children: [
|
|
2855
|
-
/* @__PURE__ */
|
|
2856
|
-
items.map((item) => /* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsx63(TabsList, { children: items.map((item) => /* @__PURE__ */ jsx63(TabsTrigger, { value: item.key, children: item.label }, item.key)) }),
|
|
2772
|
+
items.map((item) => /* @__PURE__ */ jsx63(TabsContent, { value: item.key, children: renderChildren(item.children) }, item.key))
|
|
2857
2773
|
]
|
|
2858
2774
|
}
|
|
2859
2775
|
);
|
|
2860
2776
|
}
|
|
2861
2777
|
|
|
2862
2778
|
// src/components/components/Text/index.tsx
|
|
2863
|
-
import { jsx as
|
|
2779
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
2864
2780
|
var typeClassMap = {
|
|
2865
2781
|
default: "",
|
|
2866
2782
|
secondary: "text-muted-foreground",
|
|
@@ -2879,7 +2795,7 @@ function Text({
|
|
|
2879
2795
|
style,
|
|
2880
2796
|
children
|
|
2881
2797
|
}) {
|
|
2882
|
-
return /* @__PURE__ */
|
|
2798
|
+
return /* @__PURE__ */ jsx64(
|
|
2883
2799
|
"span",
|
|
2884
2800
|
{
|
|
2885
2801
|
"data-slot": "text",
|
|
@@ -2900,7 +2816,7 @@ function Text({
|
|
|
2900
2816
|
|
|
2901
2817
|
// src/components/components/Textarea/index.tsx
|
|
2902
2818
|
import { useEffect as useEffect13, useId as useId7 } from "react";
|
|
2903
|
-
import { jsx as
|
|
2819
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
2904
2820
|
function Textarea2({
|
|
2905
2821
|
name,
|
|
2906
2822
|
label,
|
|
@@ -2925,7 +2841,7 @@ function Textarea2({
|
|
|
2925
2841
|
});
|
|
2926
2842
|
if (inForm && form && name) {
|
|
2927
2843
|
const fieldValue = form.values[name];
|
|
2928
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ jsx65(
|
|
2929
2845
|
FieldShell,
|
|
2930
2846
|
{
|
|
2931
2847
|
layout: form.layout,
|
|
@@ -2934,7 +2850,7 @@ function Textarea2({
|
|
|
2934
2850
|
error: form.errors[name],
|
|
2935
2851
|
className,
|
|
2936
2852
|
style,
|
|
2937
|
-
children: /* @__PURE__ */
|
|
2853
|
+
children: /* @__PURE__ */ jsx65(
|
|
2938
2854
|
Textarea,
|
|
2939
2855
|
{
|
|
2940
2856
|
id: controlId,
|
|
@@ -2951,7 +2867,7 @@ function Textarea2({
|
|
|
2951
2867
|
}
|
|
2952
2868
|
);
|
|
2953
2869
|
}
|
|
2954
|
-
return /* @__PURE__ */
|
|
2870
|
+
return /* @__PURE__ */ jsx65(
|
|
2955
2871
|
Textarea,
|
|
2956
2872
|
{
|
|
2957
2873
|
value: value ?? "",
|
|
@@ -2966,7 +2882,7 @@ function Textarea2({
|
|
|
2966
2882
|
}
|
|
2967
2883
|
|
|
2968
2884
|
// src/components/components/Toggle/index.tsx
|
|
2969
|
-
import { jsx as
|
|
2885
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
2970
2886
|
function Toggle2({
|
|
2971
2887
|
text,
|
|
2972
2888
|
pressed,
|
|
@@ -2977,7 +2893,7 @@ function Toggle2({
|
|
|
2977
2893
|
className,
|
|
2978
2894
|
style
|
|
2979
2895
|
}) {
|
|
2980
|
-
return /* @__PURE__ */
|
|
2896
|
+
return /* @__PURE__ */ jsx66(
|
|
2981
2897
|
Toggle,
|
|
2982
2898
|
{
|
|
2983
2899
|
pressed,
|
|
@@ -2993,7 +2909,7 @@ function Toggle2({
|
|
|
2993
2909
|
}
|
|
2994
2910
|
|
|
2995
2911
|
// src/components/components/ToggleGroup/index.tsx
|
|
2996
|
-
import { jsx as
|
|
2912
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
2997
2913
|
function ToggleGroup2({
|
|
2998
2914
|
options = [],
|
|
2999
2915
|
value,
|
|
@@ -3013,7 +2929,7 @@ function ToggleGroup2({
|
|
|
3013
2929
|
onChange?.(added ?? void 0);
|
|
3014
2930
|
}
|
|
3015
2931
|
};
|
|
3016
|
-
return /* @__PURE__ */
|
|
2932
|
+
return /* @__PURE__ */ jsx67(
|
|
3017
2933
|
ToggleGroup,
|
|
3018
2934
|
{
|
|
3019
2935
|
value: groupValue,
|
|
@@ -3022,7 +2938,7 @@ function ToggleGroup2({
|
|
|
3022
2938
|
onValueChange: (next) => handleChange(next),
|
|
3023
2939
|
className,
|
|
3024
2940
|
style,
|
|
3025
|
-
children: options.map((option) => /* @__PURE__ */
|
|
2941
|
+
children: options.map((option) => /* @__PURE__ */ jsx67(
|
|
3026
2942
|
ToggleGroupItem,
|
|
3027
2943
|
{
|
|
3028
2944
|
value: option.value,
|
|
@@ -3036,27 +2952,27 @@ function ToggleGroup2({
|
|
|
3036
2952
|
}
|
|
3037
2953
|
|
|
3038
2954
|
// src/components/components/Tooltip/index.tsx
|
|
3039
|
-
import { jsx as
|
|
2955
|
+
import { jsx as jsx68, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3040
2956
|
function Tooltip3({ content, children, className, style }) {
|
|
3041
|
-
return /* @__PURE__ */
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
/* @__PURE__ */
|
|
2957
|
+
return /* @__PURE__ */ jsxs44(Tooltip, { children: [
|
|
2958
|
+
/* @__PURE__ */ jsx68(TooltipTrigger, { render: triggerWrapper("tooltip-trigger-wrap"), children }),
|
|
2959
|
+
/* @__PURE__ */ jsx68(TooltipContent, { className, style, children: content })
|
|
3044
2960
|
] });
|
|
3045
2961
|
}
|
|
3046
2962
|
|
|
3047
2963
|
// src/components/components/Typography/index.tsx
|
|
3048
|
-
import { jsx as
|
|
2964
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
3049
2965
|
function Typography2({
|
|
3050
2966
|
variant = "p",
|
|
3051
2967
|
text,
|
|
3052
2968
|
className,
|
|
3053
2969
|
style
|
|
3054
2970
|
}) {
|
|
3055
|
-
return /* @__PURE__ */
|
|
2971
|
+
return /* @__PURE__ */ jsx69(Typography, { variant, className, style, children: text });
|
|
3056
2972
|
}
|
|
3057
2973
|
|
|
3058
2974
|
// src/components/register.ts
|
|
3059
|
-
var
|
|
2975
|
+
var builtinComponents = {
|
|
3060
2976
|
Page,
|
|
3061
2977
|
Grid,
|
|
3062
2978
|
Flex,
|
|
@@ -3096,6 +3012,7 @@ var shadcnComponents = {
|
|
|
3096
3012
|
Slider: Slider2,
|
|
3097
3013
|
Label: Label2,
|
|
3098
3014
|
Field: Field2,
|
|
3015
|
+
ChatInput,
|
|
3099
3016
|
// 导航类扩展组件
|
|
3100
3017
|
Breadcrumb: Breadcrumb2,
|
|
3101
3018
|
Pagination: Pagination2,
|
|
@@ -3135,14 +3052,14 @@ var shadcnComponents = {
|
|
|
3135
3052
|
// 图标(lucide 白名单)
|
|
3136
3053
|
Icon
|
|
3137
3054
|
};
|
|
3138
|
-
function
|
|
3139
|
-
for (const [type, component] of Object.entries(
|
|
3055
|
+
function registerBuiltinComponents(registry) {
|
|
3056
|
+
for (const [type, component] of Object.entries(builtinComponents)) {
|
|
3140
3057
|
registry.register(type, component);
|
|
3141
3058
|
}
|
|
3142
3059
|
}
|
|
3143
|
-
function
|
|
3060
|
+
function createComponentRegistry() {
|
|
3144
3061
|
const registry = new Registry("ComponentRegistry");
|
|
3145
|
-
|
|
3062
|
+
registerBuiltinComponents(registry);
|
|
3146
3063
|
return registry;
|
|
3147
3064
|
}
|
|
3148
3065
|
|
|
@@ -3187,7 +3104,6 @@ export {
|
|
|
3187
3104
|
Label2 as Label,
|
|
3188
3105
|
Layout,
|
|
3189
3106
|
Link,
|
|
3190
|
-
Menu,
|
|
3191
3107
|
Menubar2 as Menubar,
|
|
3192
3108
|
NavigationMenu2 as NavigationMenu,
|
|
3193
3109
|
Page,
|
|
@@ -3200,7 +3116,6 @@ export {
|
|
|
3200
3116
|
Select2 as Select,
|
|
3201
3117
|
Separator2 as Separator,
|
|
3202
3118
|
Sheet2 as Sheet,
|
|
3203
|
-
Sidebar,
|
|
3204
3119
|
Sider,
|
|
3205
3120
|
Skeleton2 as Skeleton,
|
|
3206
3121
|
Slider2 as Slider,
|
|
@@ -3216,7 +3131,7 @@ export {
|
|
|
3216
3131
|
ToggleGroup2 as ToggleGroup,
|
|
3217
3132
|
Tooltip3 as Tooltip,
|
|
3218
3133
|
Typography2 as Typography,
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3134
|
+
builtinComponents,
|
|
3135
|
+
registerBuiltinComponents,
|
|
3136
|
+
createComponentRegistry
|
|
3222
3137
|
};
|