@pactor-app/ui 1.1.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-GV5R6TUT.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-6B5ZX7L3.js → chunk-LMEJ242M.js} +170 -570
- package/dist/{chunk-BVHAP22U.js → chunk-Q5NUGUJG.js} +131 -195
- package/dist/components/index.cjs +44 -37
- package/dist/components/index.d.cts +8 -8
- package/dist/components/index.d.ts +8 -8
- package/dist/components/index.js +16 -16
- package/dist/index.cjs +273 -148
- package/dist/index.d.cts +3 -36
- package/dist/index.d.ts +3 -36
- package/dist/index.js +36 -45
- 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 +642 -51
- 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.js +7 -7
- package/package.json +5 -5
- package/dist/chunk-6JNCDPGS.js +0 -257
|
@@ -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";
|
|
@@ -1947,416 +1949,18 @@ function Link({ href, text, target, className, style, children }) {
|
|
|
1947
1949
|
);
|
|
1948
1950
|
}
|
|
1949
1951
|
|
|
1950
|
-
// src/components/components/Sidebar/rail-tooltip.tsx
|
|
1951
|
-
import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1952
|
-
function RailTooltip({
|
|
1953
|
-
label,
|
|
1954
|
-
children
|
|
1955
|
-
}) {
|
|
1956
|
-
return /* @__PURE__ */ jsxs28(Tooltip, { children: [
|
|
1957
|
-
/* @__PURE__ */ jsx42(TooltipTrigger, { render: children }),
|
|
1958
|
-
/* @__PURE__ */ jsx42(TooltipContent, { side: "right", sideOffset: 8, children: label })
|
|
1959
|
-
] });
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
// src/components/components/Sidebar/index.tsx
|
|
1963
|
-
import { useI18n as useI18n5, useRenderer as useRenderer11 } from "@pactor-app/runtime";
|
|
1964
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
1965
|
-
import {
|
|
1966
|
-
createContext as createContext2,
|
|
1967
|
-
useCallback as useCallback2,
|
|
1968
|
-
useContext as useContext2,
|
|
1969
|
-
useEffect as useEffect8,
|
|
1970
|
-
useState as useState10
|
|
1971
|
-
} from "react";
|
|
1972
|
-
import { Fragment as Fragment3, jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
1973
|
-
var SidebarDrawerContext = createContext2(null);
|
|
1974
|
-
function useSidebarDrawer() {
|
|
1975
|
-
return useContext2(SidebarDrawerContext);
|
|
1976
|
-
}
|
|
1977
|
-
var MOBILE_MEDIA_QUERY = "(max-width: 767px)";
|
|
1978
|
-
function useIsMobileViewport() {
|
|
1979
|
-
const [isMobile, setIsMobile] = useState10(
|
|
1980
|
-
() => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(MOBILE_MEDIA_QUERY).matches
|
|
1981
|
-
);
|
|
1982
|
-
useEffect8(() => {
|
|
1983
|
-
if (typeof window.matchMedia !== "function") {
|
|
1984
|
-
return;
|
|
1985
|
-
}
|
|
1986
|
-
const media = window.matchMedia(MOBILE_MEDIA_QUERY);
|
|
1987
|
-
const onChange = (event) => {
|
|
1988
|
-
setIsMobile(event.matches);
|
|
1989
|
-
};
|
|
1990
|
-
setIsMobile(media.matches);
|
|
1991
|
-
media.addEventListener("change", onChange);
|
|
1992
|
-
return () => media.removeEventListener("change", onChange);
|
|
1993
|
-
}, []);
|
|
1994
|
-
return isMobile;
|
|
1995
|
-
}
|
|
1996
|
-
function useOptionalRenderer() {
|
|
1997
|
-
try {
|
|
1998
|
-
return useRenderer11();
|
|
1999
|
-
} catch {
|
|
2000
|
-
return null;
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
function SidebarContent({ content }) {
|
|
2004
|
-
const renderer = useOptionalRenderer();
|
|
2005
|
-
if (renderer !== null && typeof content === "object" && content !== null && !("$$typeof" in content) && "type" in content) {
|
|
2006
|
-
return /* @__PURE__ */ jsx43(Fragment3, { children: renderer.renderChildren([content]) });
|
|
2007
|
-
}
|
|
2008
|
-
return /* @__PURE__ */ jsx43(Fragment3, { children: content });
|
|
2009
|
-
}
|
|
2010
|
-
function isBrandObject(brand) {
|
|
2011
|
-
return typeof brand === "object" && brand !== null && !("$$typeof" in brand) && "title" in brand;
|
|
2012
|
-
}
|
|
2013
|
-
function Sidebar({
|
|
2014
|
-
brand,
|
|
2015
|
-
items = [],
|
|
2016
|
-
content,
|
|
2017
|
-
sidebarFooter,
|
|
2018
|
-
collapsible,
|
|
2019
|
-
onCollapse,
|
|
2020
|
-
locationKey,
|
|
2021
|
-
drawer = true,
|
|
2022
|
-
className,
|
|
2023
|
-
style,
|
|
2024
|
-
children
|
|
2025
|
-
}) {
|
|
2026
|
-
const { t } = useI18n5();
|
|
2027
|
-
const isMobile = useIsMobileViewport();
|
|
2028
|
-
const [drawerOpen, setDrawerOpen] = useState10(false);
|
|
2029
|
-
const [collapsed, setCollapsed] = useState10(false);
|
|
2030
|
-
const collapsedEffective = collapsible === true && collapsed && !isMobile;
|
|
2031
|
-
const close = useCallback2(() => setDrawerOpen(false), []);
|
|
2032
|
-
const toggleCollapsed = () => {
|
|
2033
|
-
const next = !collapsed;
|
|
2034
|
-
setCollapsed(next);
|
|
2035
|
-
onCollapse?.(next);
|
|
2036
|
-
};
|
|
2037
|
-
const [trackedLocationKey, setTrackedLocationKey] = useState10(locationKey);
|
|
2038
|
-
if (trackedLocationKey !== locationKey) {
|
|
2039
|
-
setTrackedLocationKey(locationKey);
|
|
2040
|
-
setDrawerOpen(false);
|
|
2041
|
-
}
|
|
2042
|
-
useEffect8(() => {
|
|
2043
|
-
if (!drawerOpen) {
|
|
2044
|
-
return;
|
|
2045
|
-
}
|
|
2046
|
-
const onKeyDown = (event) => {
|
|
2047
|
-
if (event.key === "Escape") {
|
|
2048
|
-
setDrawerOpen(false);
|
|
2049
|
-
}
|
|
2050
|
-
};
|
|
2051
|
-
window.addEventListener("keydown", onKeyDown);
|
|
2052
|
-
return () => window.removeEventListener("keydown", onKeyDown);
|
|
2053
|
-
}, [drawerOpen]);
|
|
2054
|
-
const brandNode = isBrandObject(brand) ? /* @__PURE__ */ jsxs29(Fragment3, { children: [
|
|
2055
|
-
brand.logo ? /* @__PURE__ */ jsx43(
|
|
2056
|
-
"img",
|
|
2057
|
-
{
|
|
2058
|
-
"data-slot": "sidebar-brand-logo",
|
|
2059
|
-
src: brand.logo,
|
|
2060
|
-
alt: brand.title,
|
|
2061
|
-
className: "size-6 shrink-0"
|
|
2062
|
-
}
|
|
2063
|
-
) : null,
|
|
2064
|
-
collapsedEffective ? null : /* @__PURE__ */ jsx43("span", { className: "truncate text-sm font-semibold", children: brand.title })
|
|
2065
|
-
] }) : brand;
|
|
2066
|
-
const collapseTrigger = collapsible && !isMobile ? /* @__PURE__ */ jsx43(
|
|
2067
|
-
"button",
|
|
2068
|
-
{
|
|
2069
|
-
type: "button",
|
|
2070
|
-
"data-slot": "sidebar-collapse-trigger",
|
|
2071
|
-
"aria-label": collapsedEffective ? t("pactor.layout.expandSidebar") : t("pactor.layout.collapseSidebar"),
|
|
2072
|
-
"aria-expanded": !collapsedEffective,
|
|
2073
|
-
title: collapsedEffective ? t("pactor.layout.expandSidebar") : t("pactor.layout.collapseSidebar"),
|
|
2074
|
-
className: cn(
|
|
2075
|
-
"cursor-pointer flex size-8 shrink-0 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
|
2076
|
-
),
|
|
2077
|
-
onClick: toggleCollapsed,
|
|
2078
|
-
children: collapsedEffective ? /* @__PURE__ */ jsx43(ChevronRight, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ jsx43(ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
2079
|
-
}
|
|
2080
|
-
) : null;
|
|
2081
|
-
return /* @__PURE__ */ jsx43(
|
|
2082
|
-
SidebarDrawerContext.Provider,
|
|
2083
|
-
{
|
|
2084
|
-
value: { close, collapsed: collapsedEffective },
|
|
2085
|
-
children: /* @__PURE__ */ jsxs29(
|
|
2086
|
-
"div",
|
|
2087
|
-
{
|
|
2088
|
-
"data-slot": "sidebar-layout",
|
|
2089
|
-
className: cn("flex min-h-screen w-full", className),
|
|
2090
|
-
style,
|
|
2091
|
-
children: [
|
|
2092
|
-
drawer && drawerOpen ? /* @__PURE__ */ jsx43(
|
|
2093
|
-
"div",
|
|
2094
|
-
{
|
|
2095
|
-
"data-slot": "sidebar-scrim",
|
|
2096
|
-
"aria-hidden": true,
|
|
2097
|
-
className: "fixed inset-0 z-40 bg-black/40 md:hidden",
|
|
2098
|
-
onClick: close
|
|
2099
|
-
}
|
|
2100
|
-
) : null,
|
|
2101
|
-
/* @__PURE__ */ jsxs29(
|
|
2102
|
-
"aside",
|
|
2103
|
-
{
|
|
2104
|
-
"data-slot": "sidebar",
|
|
2105
|
-
"data-collapsed": collapsedEffective || void 0,
|
|
2106
|
-
"data-open": drawerOpen ? "true" : "false",
|
|
2107
|
-
inert: drawer && isMobile && !drawerOpen ? true : void 0,
|
|
2108
|
-
className: cn(
|
|
2109
|
-
"flex shrink-0 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-[width,transform]",
|
|
2110
|
-
collapsedEffective ? "w-16" : "w-60",
|
|
2111
|
-
// 移动端覆盖抽屉:退出文档流,关闭时移出屏幕
|
|
2112
|
-
drawer && "max-md:fixed max-md:inset-y-0 max-md:left-0 max-md:z-50 max-md:w-60 max-md:-translate-x-full max-md:data-[open=true]:translate-x-0"
|
|
2113
|
-
),
|
|
2114
|
-
children: [
|
|
2115
|
-
brand !== void 0 || collapseTrigger !== null ? /* @__PURE__ */ jsxs29(
|
|
2116
|
-
"div",
|
|
2117
|
-
{
|
|
2118
|
-
"data-slot": "sidebar-brand",
|
|
2119
|
-
className: cn(
|
|
2120
|
-
"flex h-14 shrink-0 items-center gap-2 border-b border-sidebar-border px-4",
|
|
2121
|
-
// 移动端品牌维持顶栏现状:抽屉内不重复渲染品牌行
|
|
2122
|
-
"max-md:hidden",
|
|
2123
|
-
collapsedEffective && "justify-center px-2"
|
|
2124
|
-
),
|
|
2125
|
-
children: [
|
|
2126
|
-
collapsedEffective ? null : /* @__PURE__ */ jsx43("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: brandNode }),
|
|
2127
|
-
collapseTrigger
|
|
2128
|
-
]
|
|
2129
|
-
}
|
|
2130
|
-
) : null,
|
|
2131
|
-
/* @__PURE__ */ jsx43(
|
|
2132
|
-
"nav",
|
|
2133
|
-
{
|
|
2134
|
-
"data-slot": "sidebar-nav",
|
|
2135
|
-
className: "min-h-0 flex-1 overflow-auto p-2",
|
|
2136
|
-
children: content !== void 0 && content !== null ? /* @__PURE__ */ jsx43(SidebarContent, { content }) : items.map((item, index) => /* @__PURE__ */ jsx43(
|
|
2137
|
-
SidebarEntry,
|
|
2138
|
-
{
|
|
2139
|
-
item,
|
|
2140
|
-
depth: 0,
|
|
2141
|
-
collapsed: collapsedEffective
|
|
2142
|
-
},
|
|
2143
|
-
item.href ?? item.label ?? index
|
|
2144
|
-
))
|
|
2145
|
-
}
|
|
2146
|
-
),
|
|
2147
|
-
sidebarFooter !== void 0 && sidebarFooter !== null && !collapsedEffective ? /* @__PURE__ */ jsx43(
|
|
2148
|
-
"div",
|
|
2149
|
-
{
|
|
2150
|
-
"data-slot": "sidebar-footer",
|
|
2151
|
-
className: "shrink-0 border-t border-sidebar-border p-2",
|
|
2152
|
-
children: sidebarFooter
|
|
2153
|
-
}
|
|
2154
|
-
) : null
|
|
2155
|
-
]
|
|
2156
|
-
}
|
|
2157
|
-
),
|
|
2158
|
-
/* @__PURE__ */ jsxs29("main", { "data-slot": "sidebar-content", className: "min-w-0 flex-1", children: [
|
|
2159
|
-
drawer ? /* @__PURE__ */ jsxs29(
|
|
2160
|
-
"div",
|
|
2161
|
-
{
|
|
2162
|
-
"data-slot": "sidebar-topbar",
|
|
2163
|
-
className: "flex h-14 items-center gap-2 border-b border-sidebar-border bg-sidebar px-3 md:hidden",
|
|
2164
|
-
children: [
|
|
2165
|
-
/* @__PURE__ */ jsx43(
|
|
2166
|
-
"button",
|
|
2167
|
-
{
|
|
2168
|
-
type: "button",
|
|
2169
|
-
"data-slot": "sidebar-menu-trigger",
|
|
2170
|
-
"aria-label": t("pactor.layout.openNavigation"),
|
|
2171
|
-
"aria-expanded": drawerOpen,
|
|
2172
|
-
className: "flex size-8 items-center justify-center rounded-md text-sidebar-foreground/60 transition-colors hover:bg-sidebar-accent hover:text-sidebar-foreground",
|
|
2173
|
-
onClick: () => setDrawerOpen(true),
|
|
2174
|
-
children: /* @__PURE__ */ jsx43(Icon, { name: "menu", size: 18 })
|
|
2175
|
-
}
|
|
2176
|
-
),
|
|
2177
|
-
brandNode
|
|
2178
|
-
]
|
|
2179
|
-
}
|
|
2180
|
-
) : null,
|
|
2181
|
-
children
|
|
2182
|
-
] })
|
|
2183
|
-
]
|
|
2184
|
-
}
|
|
2185
|
-
)
|
|
2186
|
-
}
|
|
2187
|
-
);
|
|
2188
|
-
}
|
|
2189
|
-
function SidebarEntry({
|
|
2190
|
-
item,
|
|
2191
|
-
depth,
|
|
2192
|
-
collapsed
|
|
2193
|
-
}) {
|
|
2194
|
-
const entryClass = cn(
|
|
2195
|
-
"flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm transition-colors",
|
|
2196
|
-
"text-sidebar-foreground/70 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
2197
|
-
collapsed && "justify-center px-0"
|
|
2198
|
-
);
|
|
2199
|
-
const indentStyle = !collapsed && depth > 0 ? { paddingLeft: 12 + depth * 16 } : void 0;
|
|
2200
|
-
const labelNode = collapsed ? null : item.label;
|
|
2201
|
-
const iconNode = item.icon ? /* @__PURE__ */ jsx43(Icon, { name: item.icon, size: "sm" }) : null;
|
|
2202
|
-
const entry = item.href ? /* @__PURE__ */ jsxs29(
|
|
2203
|
-
"a",
|
|
2204
|
-
{
|
|
2205
|
-
"data-slot": "sidebar-item",
|
|
2206
|
-
href: item.href,
|
|
2207
|
-
className: entryClass,
|
|
2208
|
-
style: indentStyle,
|
|
2209
|
-
children: [
|
|
2210
|
-
iconNode,
|
|
2211
|
-
labelNode
|
|
2212
|
-
]
|
|
2213
|
-
}
|
|
2214
|
-
) : /* @__PURE__ */ jsxs29("span", { "data-slot": "sidebar-item", className: entryClass, style: indentStyle, children: [
|
|
2215
|
-
iconNode,
|
|
2216
|
-
labelNode
|
|
2217
|
-
] });
|
|
2218
|
-
return /* @__PURE__ */ jsxs29("div", { "data-slot": "sidebar-entry", children: [
|
|
2219
|
-
collapsed ? /* @__PURE__ */ jsx43(RailTooltip, { label: item.label, children: entry }) : entry,
|
|
2220
|
-
item.children?.map((child, index) => /* @__PURE__ */ jsx43(
|
|
2221
|
-
SidebarEntry,
|
|
2222
|
-
{
|
|
2223
|
-
item: child,
|
|
2224
|
-
depth: depth + 1,
|
|
2225
|
-
collapsed
|
|
2226
|
-
},
|
|
2227
|
-
child.href ?? child.label ?? index
|
|
2228
|
-
))
|
|
2229
|
-
] });
|
|
2230
|
-
}
|
|
2231
|
-
|
|
2232
|
-
// src/components/components/Menu/index.tsx
|
|
2233
|
-
import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2234
|
-
function Menu({
|
|
2235
|
-
items = [],
|
|
2236
|
-
mode = "inline",
|
|
2237
|
-
selectedKey,
|
|
2238
|
-
onSelect,
|
|
2239
|
-
className,
|
|
2240
|
-
style
|
|
2241
|
-
}) {
|
|
2242
|
-
const drawer = useSidebarDrawer();
|
|
2243
|
-
const collapsed = mode === "inline" && drawer?.collapsed === true;
|
|
2244
|
-
let previousGroup;
|
|
2245
|
-
return /* @__PURE__ */ jsx44(
|
|
2246
|
-
"nav",
|
|
2247
|
-
{
|
|
2248
|
-
"data-slot": "menu",
|
|
2249
|
-
"data-mode": mode,
|
|
2250
|
-
"data-collapsed": collapsed || void 0,
|
|
2251
|
-
className: cn(
|
|
2252
|
-
mode === "horizontal" ? "flex items-center gap-1" : "flex flex-col gap-0.5 p-2",
|
|
2253
|
-
className
|
|
2254
|
-
),
|
|
2255
|
-
style,
|
|
2256
|
-
children: items.map((item) => {
|
|
2257
|
-
let groupLabel;
|
|
2258
|
-
if (!collapsed && mode === "inline" && item.group !== void 0 && item.group !== previousGroup) {
|
|
2259
|
-
groupLabel = item.group;
|
|
2260
|
-
}
|
|
2261
|
-
previousGroup = item.group;
|
|
2262
|
-
return /* @__PURE__ */ jsxs30("div", { "data-slot": "menu-group-entry", children: [
|
|
2263
|
-
groupLabel !== void 0 && /* @__PURE__ */ jsx44(
|
|
2264
|
-
"div",
|
|
2265
|
-
{
|
|
2266
|
-
"data-slot": "menu-group",
|
|
2267
|
-
className: "px-3 pb-1 pt-3 text-xs font-medium text-muted-foreground first:pt-1",
|
|
2268
|
-
children: groupLabel
|
|
2269
|
-
}
|
|
2270
|
-
),
|
|
2271
|
-
/* @__PURE__ */ jsx44(
|
|
2272
|
-
MenuEntry,
|
|
2273
|
-
{
|
|
2274
|
-
item,
|
|
2275
|
-
mode,
|
|
2276
|
-
depth: 0,
|
|
2277
|
-
selectedKey,
|
|
2278
|
-
onSelect,
|
|
2279
|
-
collapsed
|
|
2280
|
-
}
|
|
2281
|
-
)
|
|
2282
|
-
] }, item.key);
|
|
2283
|
-
})
|
|
2284
|
-
}
|
|
2285
|
-
);
|
|
2286
|
-
}
|
|
2287
|
-
function MenuEntry({
|
|
2288
|
-
item,
|
|
2289
|
-
mode,
|
|
2290
|
-
depth,
|
|
2291
|
-
selectedKey,
|
|
2292
|
-
onSelect,
|
|
2293
|
-
collapsed = false
|
|
2294
|
-
}) {
|
|
2295
|
-
const selected = item.key === selectedKey;
|
|
2296
|
-
const button = /* @__PURE__ */ jsxs30(
|
|
2297
|
-
"button",
|
|
2298
|
-
{
|
|
2299
|
-
type: "button",
|
|
2300
|
-
"data-slot": "menu-item",
|
|
2301
|
-
"aria-current": selected ? "page" : void 0,
|
|
2302
|
-
disabled: item.disabled,
|
|
2303
|
-
className: cn(
|
|
2304
|
-
"flex w-full items-center gap-2 rounded-md text-sm transition-colors",
|
|
2305
|
-
mode === "horizontal" ? "px-3 py-2" : "px-3 py-2 text-left",
|
|
2306
|
-
collapsed && "justify-center px-0",
|
|
2307
|
-
selected ? "bg-accent font-medium text-accent-foreground" : "text-muted-foreground hover:bg-accent/50 hover:text-foreground",
|
|
2308
|
-
item.disabled && "cursor-not-allowed opacity-50 hover:bg-transparent hover:text-muted-foreground"
|
|
2309
|
-
),
|
|
2310
|
-
style: mode === "inline" && depth > 0 && !collapsed ? { paddingLeft: 12 + depth * 16 } : void 0,
|
|
2311
|
-
onClick: () => {
|
|
2312
|
-
if (!item.disabled) {
|
|
2313
|
-
onSelect?.(item.key);
|
|
2314
|
-
}
|
|
2315
|
-
},
|
|
2316
|
-
children: [
|
|
2317
|
-
item.icon ? /* @__PURE__ */ jsx44(Icon, { name: item.icon, size: "sm" }) : null,
|
|
2318
|
-
collapsed ? null : /* @__PURE__ */ jsx44("span", { className: "min-w-0 flex-1 truncate text-left", children: item.label }),
|
|
2319
|
-
item.dot && !collapsed ? /* @__PURE__ */ jsx44("span", { "data-slot": "menu-item-dot", className: "size-1.5 shrink-0 rounded-full bg-destructive" }) : null,
|
|
2320
|
-
item.badge !== void 0 && !collapsed ? /* @__PURE__ */ jsx44(
|
|
2321
|
-
"span",
|
|
2322
|
-
{
|
|
2323
|
-
"data-slot": "menu-item-badge",
|
|
2324
|
-
className: "shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-xs text-muted-foreground",
|
|
2325
|
-
children: item.badge
|
|
2326
|
-
}
|
|
2327
|
-
) : null
|
|
2328
|
-
]
|
|
2329
|
-
}
|
|
2330
|
-
);
|
|
2331
|
-
return /* @__PURE__ */ jsxs30("div", { "data-slot": "menu-entry", "data-key": item.key, children: [
|
|
2332
|
-
collapsed ? /* @__PURE__ */ jsx44(RailTooltip, { label: item.label, children: button }) : button,
|
|
2333
|
-
item.children?.map((child) => /* @__PURE__ */ jsx44(
|
|
2334
|
-
MenuEntry,
|
|
2335
|
-
{
|
|
2336
|
-
item: child,
|
|
2337
|
-
mode,
|
|
2338
|
-
depth: depth + 1,
|
|
2339
|
-
selectedKey,
|
|
2340
|
-
onSelect,
|
|
2341
|
-
collapsed
|
|
2342
|
-
},
|
|
2343
|
-
child.key
|
|
2344
|
-
))
|
|
2345
|
-
] });
|
|
2346
|
-
}
|
|
2347
|
-
|
|
2348
1952
|
// src/components/components/Menubar/index.tsx
|
|
2349
|
-
import { jsx as
|
|
1953
|
+
import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2350
1954
|
function Menubar2({ menus = [], onSelect, className, style }) {
|
|
2351
|
-
return /* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2353
|
-
/* @__PURE__ */
|
|
1955
|
+
return /* @__PURE__ */ jsx42(Menubar, { className, style, children: menus.map((menu) => /* @__PURE__ */ jsxs28(MenubarMenu, { children: [
|
|
1956
|
+
/* @__PURE__ */ jsx42(MenubarTrigger, { children: menu.label }),
|
|
1957
|
+
/* @__PURE__ */ jsx42(MenubarContent, { children: menu.items.map((item) => /* @__PURE__ */ jsxs28(
|
|
2354
1958
|
MenubarItem,
|
|
2355
1959
|
{
|
|
2356
1960
|
disabled: item.disabled,
|
|
2357
1961
|
onClick: () => onSelect?.(item.value),
|
|
2358
1962
|
children: [
|
|
2359
|
-
item.icon ? /* @__PURE__ */
|
|
1963
|
+
item.icon ? /* @__PURE__ */ jsx42(Icon, { name: item.icon, size: "sm" }) : null,
|
|
2360
1964
|
item.label
|
|
2361
1965
|
]
|
|
2362
1966
|
},
|
|
@@ -2366,33 +1970,33 @@ function Menubar2({ menus = [], onSelect, className, style }) {
|
|
|
2366
1970
|
}
|
|
2367
1971
|
|
|
2368
1972
|
// src/components/components/NavigationMenu/index.tsx
|
|
2369
|
-
import { Fragment as
|
|
1973
|
+
import { Fragment as Fragment3, jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2370
1974
|
function NavigationMenu2({ items = [], className, style }) {
|
|
2371
|
-
return /* @__PURE__ */
|
|
2372
|
-
/* @__PURE__ */
|
|
1975
|
+
return /* @__PURE__ */ jsx43(NavigationMenu, { className, style, children: /* @__PURE__ */ jsx43(NavigationMenuList, { children: items.map((item, index) => /* @__PURE__ */ jsx43(NavigationMenuItem, { value: `item-${index}`, children: item.children && item.children.length > 0 ? /* @__PURE__ */ jsxs29(Fragment3, { children: [
|
|
1976
|
+
/* @__PURE__ */ jsxs29(
|
|
2373
1977
|
NavigationMenuTrigger,
|
|
2374
1978
|
{
|
|
2375
1979
|
className: item.icon !== void 0 ? "gap-2" : void 0,
|
|
2376
1980
|
children: [
|
|
2377
|
-
item.icon ? /* @__PURE__ */
|
|
1981
|
+
item.icon ? /* @__PURE__ */ jsx43(Icon, { name: item.icon, size: "sm" }) : null,
|
|
2378
1982
|
item.label
|
|
2379
1983
|
]
|
|
2380
1984
|
}
|
|
2381
1985
|
),
|
|
2382
|
-
/* @__PURE__ */
|
|
2383
|
-
/* @__PURE__ */
|
|
1986
|
+
/* @__PURE__ */ jsx43(NavigationMenuContent, { children: /* @__PURE__ */ jsx43("ul", { className: "grid w-64 gap-1", children: item.children.map((child) => /* @__PURE__ */ jsx43("li", { children: /* @__PURE__ */ jsxs29(NavigationMenuLink, { href: child.href, children: [
|
|
1987
|
+
/* @__PURE__ */ jsxs29(
|
|
2384
1988
|
"span",
|
|
2385
1989
|
{
|
|
2386
1990
|
className: child.icon !== void 0 ? "flex items-center gap-2 font-medium" : "font-medium",
|
|
2387
1991
|
children: [
|
|
2388
|
-
child.icon ? /* @__PURE__ */
|
|
1992
|
+
child.icon ? /* @__PURE__ */ jsx43(Icon, { name: child.icon, size: "sm" }) : null,
|
|
2389
1993
|
child.label
|
|
2390
1994
|
]
|
|
2391
1995
|
}
|
|
2392
1996
|
),
|
|
2393
|
-
child.description ? /* @__PURE__ */
|
|
1997
|
+
child.description ? /* @__PURE__ */ jsx43("span", { className: "text-muted-foreground", children: child.description }) : null
|
|
2394
1998
|
] }) }, child.href)) }) })
|
|
2395
|
-
] }) : /* @__PURE__ */
|
|
1999
|
+
] }) : /* @__PURE__ */ jsxs29(
|
|
2396
2000
|
NavigationMenuLink,
|
|
2397
2001
|
{
|
|
2398
2002
|
href: item.href,
|
|
@@ -2401,7 +2005,7 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
2401
2005
|
item.icon !== void 0 && "gap-2"
|
|
2402
2006
|
),
|
|
2403
2007
|
children: [
|
|
2404
|
-
item.icon ? /* @__PURE__ */
|
|
2008
|
+
item.icon ? /* @__PURE__ */ jsx43(Icon, { name: item.icon, size: "sm" }) : null,
|
|
2405
2009
|
item.label
|
|
2406
2010
|
]
|
|
2407
2011
|
}
|
|
@@ -2409,17 +2013,17 @@ function NavigationMenu2({ items = [], className, style }) {
|
|
|
2409
2013
|
}
|
|
2410
2014
|
|
|
2411
2015
|
// src/components/components/Page/index.tsx
|
|
2412
|
-
import { jsx as
|
|
2016
|
+
import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2413
2017
|
function Page({ title, className, style, children }) {
|
|
2414
|
-
return /* @__PURE__ */
|
|
2415
|
-
title ? /* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2018
|
+
return /* @__PURE__ */ jsxs30("div", { "data-slot": "page", className: cn("p-6", className), style, children: [
|
|
2019
|
+
title ? /* @__PURE__ */ jsx44("h2", { "data-slot": "page-title", className: "mb-5 text-xl font-semibold", children: title }) : null,
|
|
2020
|
+
/* @__PURE__ */ jsx44("div", { "data-slot": "page-content", className: "space-y-5", children })
|
|
2417
2021
|
] });
|
|
2418
2022
|
}
|
|
2419
2023
|
|
|
2420
2024
|
// src/components/components/Pagination/index.tsx
|
|
2421
|
-
import { useState as
|
|
2422
|
-
import { jsx as
|
|
2025
|
+
import { useState as useState10 } from "react";
|
|
2026
|
+
import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2423
2027
|
function pageItems(current, count) {
|
|
2424
2028
|
if (count <= 7) {
|
|
2425
2029
|
return Array.from({ length: count }, (_, i) => i + 1);
|
|
@@ -2440,7 +2044,7 @@ function Pagination2({
|
|
|
2440
2044
|
className,
|
|
2441
2045
|
style
|
|
2442
2046
|
}) {
|
|
2443
|
-
const [innerPage, setInnerPage] =
|
|
2047
|
+
const [innerPage, setInnerPage] = useState10(1);
|
|
2444
2048
|
const pageCount = Math.max(1, Math.ceil(total / Math.max(1, pageSize)));
|
|
2445
2049
|
const current = Math.min(Math.max(1, page ?? innerPage), pageCount);
|
|
2446
2050
|
const goTo = (next) => {
|
|
@@ -2453,8 +2057,8 @@ function Pagination2({
|
|
|
2453
2057
|
}
|
|
2454
2058
|
onChange?.(target);
|
|
2455
2059
|
};
|
|
2456
|
-
return /* @__PURE__ */
|
|
2457
|
-
/* @__PURE__ */
|
|
2060
|
+
return /* @__PURE__ */ jsx45(Pagination, { className, style, children: /* @__PURE__ */ jsxs31(PaginationContent, { children: [
|
|
2061
|
+
/* @__PURE__ */ jsx45(PaginationItem, { children: /* @__PURE__ */ jsx45(
|
|
2458
2062
|
PaginationPrevious,
|
|
2459
2063
|
{
|
|
2460
2064
|
href: "#",
|
|
@@ -2465,7 +2069,7 @@ function Pagination2({
|
|
|
2465
2069
|
}
|
|
2466
2070
|
}
|
|
2467
2071
|
) }),
|
|
2468
|
-
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */
|
|
2072
|
+
pageItems(current, pageCount).map((item, index) => /* @__PURE__ */ jsx45(PaginationItem, { children: item === "ellipsis" ? /* @__PURE__ */ jsx45(PaginationEllipsis, {}) : /* @__PURE__ */ jsx45(
|
|
2469
2073
|
PaginationLink,
|
|
2470
2074
|
{
|
|
2471
2075
|
href: "#",
|
|
@@ -2477,7 +2081,7 @@ function Pagination2({
|
|
|
2477
2081
|
children: item
|
|
2478
2082
|
}
|
|
2479
2083
|
) }, item === "ellipsis" ? `ellipsis-${index}` : item)),
|
|
2480
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ jsx45(PaginationItem, { children: /* @__PURE__ */ jsx45(
|
|
2481
2085
|
PaginationNext,
|
|
2482
2086
|
{
|
|
2483
2087
|
href: "#",
|
|
@@ -2492,15 +2096,15 @@ function Pagination2({
|
|
|
2492
2096
|
}
|
|
2493
2097
|
|
|
2494
2098
|
// src/components/components/Popover/index.tsx
|
|
2495
|
-
import { useRenderer as
|
|
2496
|
-
import { jsx as
|
|
2099
|
+
import { useRenderer as useRenderer11 } from "@pactor-app/runtime";
|
|
2100
|
+
import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2497
2101
|
function isDslNode3(value) {
|
|
2498
2102
|
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
2499
2103
|
}
|
|
2500
2104
|
function Popover2({ content, children, className, style }) {
|
|
2501
|
-
const { renderChildren } =
|
|
2502
|
-
return /* @__PURE__ */
|
|
2503
|
-
/* @__PURE__ */
|
|
2105
|
+
const { renderChildren } = useRenderer11();
|
|
2106
|
+
return /* @__PURE__ */ jsxs32(Popover, { children: [
|
|
2107
|
+
/* @__PURE__ */ jsx46(
|
|
2504
2108
|
PopoverTrigger,
|
|
2505
2109
|
{
|
|
2506
2110
|
nativeButton: false,
|
|
@@ -2508,22 +2112,22 @@ function Popover2({ content, children, className, style }) {
|
|
|
2508
2112
|
children
|
|
2509
2113
|
}
|
|
2510
2114
|
),
|
|
2511
|
-
/* @__PURE__ */
|
|
2115
|
+
/* @__PURE__ */ jsx46(PopoverContent, { className, style, children: isDslNode3(content) ? renderChildren([content]) : content })
|
|
2512
2116
|
] });
|
|
2513
2117
|
}
|
|
2514
2118
|
|
|
2515
2119
|
// src/components/components/Progress/index.tsx
|
|
2516
|
-
import { jsx as
|
|
2120
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
2517
2121
|
function Progress2({ value, className, style }) {
|
|
2518
2122
|
const resolved = typeof value === "number" && Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : null;
|
|
2519
|
-
return /* @__PURE__ */
|
|
2123
|
+
return /* @__PURE__ */ jsx47(Progress, { value: resolved, className, style, children: /* @__PURE__ */ jsx47(ProgressTrack, { children: /* @__PURE__ */ jsx47(ProgressIndicator, {}) }) });
|
|
2520
2124
|
}
|
|
2521
2125
|
|
|
2522
2126
|
// src/components/components/RadioGroup/index.tsx
|
|
2523
|
-
import { useEffect as
|
|
2127
|
+
import { useEffect as useEffect8, useId as useId4 } from "react";
|
|
2524
2128
|
|
|
2525
2129
|
// src/components/components/Form/form-item.tsx
|
|
2526
|
-
import { jsx as
|
|
2130
|
+
import { jsx as jsx48, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2527
2131
|
function FieldShell({
|
|
2528
2132
|
layout,
|
|
2529
2133
|
label,
|
|
@@ -2533,14 +2137,14 @@ function FieldShell({
|
|
|
2533
2137
|
style,
|
|
2534
2138
|
children
|
|
2535
2139
|
}) {
|
|
2536
|
-
return /* @__PURE__ */
|
|
2140
|
+
return /* @__PURE__ */ jsxs33(
|
|
2537
2141
|
"div",
|
|
2538
2142
|
{
|
|
2539
2143
|
"data-slot": "form-item",
|
|
2540
2144
|
className: cn(formItemClass(layout), className),
|
|
2541
2145
|
style,
|
|
2542
2146
|
children: [
|
|
2543
|
-
label ? /* @__PURE__ */
|
|
2147
|
+
label ? /* @__PURE__ */ jsx48(
|
|
2544
2148
|
"label",
|
|
2545
2149
|
{
|
|
2546
2150
|
htmlFor,
|
|
@@ -2549,14 +2153,14 @@ function FieldShell({
|
|
|
2549
2153
|
}
|
|
2550
2154
|
) : null,
|
|
2551
2155
|
children,
|
|
2552
|
-
error ? /* @__PURE__ */
|
|
2156
|
+
error ? /* @__PURE__ */ jsx48("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
2553
2157
|
]
|
|
2554
2158
|
}
|
|
2555
2159
|
);
|
|
2556
2160
|
}
|
|
2557
2161
|
|
|
2558
2162
|
// src/components/components/RadioGroup/index.tsx
|
|
2559
|
-
import { jsx as
|
|
2163
|
+
import { jsx as jsx49, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2560
2164
|
function RadioGroup2({
|
|
2561
2165
|
name,
|
|
2562
2166
|
label,
|
|
@@ -2571,7 +2175,7 @@ function RadioGroup2({
|
|
|
2571
2175
|
const form = useFormContext();
|
|
2572
2176
|
const controlId = useId4();
|
|
2573
2177
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2574
|
-
|
|
2178
|
+
useEffect8(() => {
|
|
2575
2179
|
if (inForm && form && name) {
|
|
2576
2180
|
form.registerField(name, rules, value);
|
|
2577
2181
|
return () => form.unregisterField(name);
|
|
@@ -2586,7 +2190,7 @@ function RadioGroup2({
|
|
|
2586
2190
|
onChange?.(next);
|
|
2587
2191
|
};
|
|
2588
2192
|
const groupValue = current ?? "";
|
|
2589
|
-
const group = /* @__PURE__ */
|
|
2193
|
+
const group = /* @__PURE__ */ jsx49(
|
|
2590
2194
|
RadioGroup,
|
|
2591
2195
|
{
|
|
2592
2196
|
value: groupValue,
|
|
@@ -2597,8 +2201,8 @@ function RadioGroup2({
|
|
|
2597
2201
|
style: inForm ? void 0 : style,
|
|
2598
2202
|
children: options.map((option, index) => {
|
|
2599
2203
|
const optionId = `${controlId}-${index}`;
|
|
2600
|
-
return /* @__PURE__ */
|
|
2601
|
-
/* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ jsxs34("span", { className: "inline-flex items-center gap-2", children: [
|
|
2205
|
+
/* @__PURE__ */ jsx49(
|
|
2602
2206
|
RadioGroupItem,
|
|
2603
2207
|
{
|
|
2604
2208
|
id: optionId,
|
|
@@ -2606,13 +2210,13 @@ function RadioGroup2({
|
|
|
2606
2210
|
disabled: option.disabled
|
|
2607
2211
|
}
|
|
2608
2212
|
),
|
|
2609
|
-
/* @__PURE__ */
|
|
2213
|
+
/* @__PURE__ */ jsx49("label", { htmlFor: optionId, className: "text-sm leading-none font-medium", children: option.label })
|
|
2610
2214
|
] }, String(option.value));
|
|
2611
2215
|
})
|
|
2612
2216
|
}
|
|
2613
2217
|
);
|
|
2614
2218
|
if (inForm && form && name) {
|
|
2615
|
-
return /* @__PURE__ */
|
|
2219
|
+
return /* @__PURE__ */ jsx49(
|
|
2616
2220
|
FieldShell,
|
|
2617
2221
|
{
|
|
2618
2222
|
layout: form.layout,
|
|
@@ -2628,19 +2232,19 @@ function RadioGroup2({
|
|
|
2628
2232
|
}
|
|
2629
2233
|
|
|
2630
2234
|
// src/components/components/Resizable/index.tsx
|
|
2631
|
-
import { useRenderer as
|
|
2632
|
-
import { Fragment as
|
|
2633
|
-
import { jsx as
|
|
2235
|
+
import { useRenderer as useRenderer12 } from "@pactor-app/runtime";
|
|
2236
|
+
import { Fragment as Fragment4 } from "react";
|
|
2237
|
+
import { jsx as jsx50, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2634
2238
|
function Resizable({
|
|
2635
2239
|
panels = [],
|
|
2636
2240
|
direction = "horizontal",
|
|
2637
2241
|
className,
|
|
2638
2242
|
style
|
|
2639
2243
|
}) {
|
|
2640
|
-
const { renderChildren } =
|
|
2641
|
-
return /* @__PURE__ */
|
|
2642
|
-
index > 0 ? /* @__PURE__ */
|
|
2643
|
-
/* @__PURE__ */
|
|
2244
|
+
const { renderChildren } = useRenderer12();
|
|
2245
|
+
return /* @__PURE__ */ jsx50(PanelGroup, { orientation: direction, className, style, children: panels.map((panel, index) => /* @__PURE__ */ jsxs35(Fragment4, { children: [
|
|
2246
|
+
index > 0 ? /* @__PURE__ */ jsx50(ResizableHandle, { withHandle: true }) : null,
|
|
2247
|
+
/* @__PURE__ */ jsx50(
|
|
2644
2248
|
Panel,
|
|
2645
2249
|
{
|
|
2646
2250
|
defaultSize: typeof panel.defaultSize === "number" ? `${panel.defaultSize}%` : void 0,
|
|
@@ -2651,7 +2255,7 @@ function Resizable({
|
|
|
2651
2255
|
}
|
|
2652
2256
|
|
|
2653
2257
|
// src/components/components/ScrollArea/index.tsx
|
|
2654
|
-
import { jsx as
|
|
2258
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
2655
2259
|
function ScrollArea2({
|
|
2656
2260
|
maxHeight,
|
|
2657
2261
|
maxWidth,
|
|
@@ -2659,7 +2263,7 @@ function ScrollArea2({
|
|
|
2659
2263
|
style,
|
|
2660
2264
|
children
|
|
2661
2265
|
}) {
|
|
2662
|
-
return /* @__PURE__ */
|
|
2266
|
+
return /* @__PURE__ */ jsx51(
|
|
2663
2267
|
ScrollArea,
|
|
2664
2268
|
{
|
|
2665
2269
|
className,
|
|
@@ -2670,9 +2274,9 @@ function ScrollArea2({
|
|
|
2670
2274
|
}
|
|
2671
2275
|
|
|
2672
2276
|
// src/components/components/Select/index.tsx
|
|
2673
|
-
import { useI18n as
|
|
2674
|
-
import { useEffect as
|
|
2675
|
-
import { jsx as
|
|
2277
|
+
import { useI18n as useI18n5 } from "@pactor-app/runtime";
|
|
2278
|
+
import { useEffect as useEffect9, useId as useId5 } from "react";
|
|
2279
|
+
import { jsx as jsx52, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2676
2280
|
function Select2({
|
|
2677
2281
|
name,
|
|
2678
2282
|
label,
|
|
@@ -2687,10 +2291,10 @@ function Select2({
|
|
|
2687
2291
|
style
|
|
2688
2292
|
}) {
|
|
2689
2293
|
const form = useFormContext();
|
|
2690
|
-
const { t } =
|
|
2294
|
+
const { t } = useI18n5();
|
|
2691
2295
|
const controlId = useId5();
|
|
2692
2296
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2693
|
-
|
|
2297
|
+
useEffect9(() => {
|
|
2694
2298
|
if (inForm && form && name) {
|
|
2695
2299
|
form.registerField(name, rules, value);
|
|
2696
2300
|
return () => form.unregisterField(name);
|
|
@@ -2706,13 +2310,13 @@ function Select2({
|
|
|
2706
2310
|
onChange?.(next ?? void 0);
|
|
2707
2311
|
};
|
|
2708
2312
|
const inFormRoot = inForm === true;
|
|
2709
|
-
const select = /* @__PURE__ */
|
|
2313
|
+
const select = /* @__PURE__ */ jsxs36(
|
|
2710
2314
|
"span",
|
|
2711
2315
|
{
|
|
2712
2316
|
className: cn("inline-flex items-center gap-1", !inFormRoot && className),
|
|
2713
2317
|
style: inFormRoot ? void 0 : style,
|
|
2714
2318
|
children: [
|
|
2715
|
-
/* @__PURE__ */
|
|
2319
|
+
/* @__PURE__ */ jsxs36(
|
|
2716
2320
|
Select,
|
|
2717
2321
|
{
|
|
2718
2322
|
items: options,
|
|
@@ -2721,8 +2325,8 @@ function Select2({
|
|
|
2721
2325
|
disabled,
|
|
2722
2326
|
name: inForm ? name : void 0,
|
|
2723
2327
|
children: [
|
|
2724
|
-
/* @__PURE__ */
|
|
2725
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ jsx52(SelectTrigger, { id: controlId, children: /* @__PURE__ */ jsx52(SelectValue, { placeholder }) }),
|
|
2329
|
+
/* @__PURE__ */ jsx52(SelectContent, { children: options.map((option) => /* @__PURE__ */ jsx52(
|
|
2726
2330
|
SelectItem,
|
|
2727
2331
|
{
|
|
2728
2332
|
value: option.value,
|
|
@@ -2734,7 +2338,7 @@ function Select2({
|
|
|
2734
2338
|
]
|
|
2735
2339
|
}
|
|
2736
2340
|
),
|
|
2737
|
-
allowClear && selectedValue !== null && !disabled ? /* @__PURE__ */
|
|
2341
|
+
allowClear && selectedValue !== null && !disabled ? /* @__PURE__ */ jsx52(
|
|
2738
2342
|
"button",
|
|
2739
2343
|
{
|
|
2740
2344
|
type: "button",
|
|
@@ -2754,14 +2358,14 @@ function Select2({
|
|
|
2754
2358
|
);
|
|
2755
2359
|
if (inForm && form && name) {
|
|
2756
2360
|
const error = form.errors[name];
|
|
2757
|
-
return /* @__PURE__ */
|
|
2361
|
+
return /* @__PURE__ */ jsxs36(
|
|
2758
2362
|
"div",
|
|
2759
2363
|
{
|
|
2760
2364
|
"data-slot": "form-item",
|
|
2761
2365
|
className: cn(formItemClass(form.layout), className),
|
|
2762
2366
|
style,
|
|
2763
2367
|
children: [
|
|
2764
|
-
label ? /* @__PURE__ */
|
|
2368
|
+
label ? /* @__PURE__ */ jsx52(
|
|
2765
2369
|
"label",
|
|
2766
2370
|
{
|
|
2767
2371
|
htmlFor: controlId,
|
|
@@ -2770,7 +2374,7 @@ function Select2({
|
|
|
2770
2374
|
}
|
|
2771
2375
|
) : null,
|
|
2772
2376
|
select,
|
|
2773
|
-
error ? /* @__PURE__ */
|
|
2377
|
+
error ? /* @__PURE__ */ jsx52("div", { "data-slot": "form-error", className: "text-sm text-destructive", children: error }) : null
|
|
2774
2378
|
]
|
|
2775
2379
|
}
|
|
2776
2380
|
);
|
|
@@ -2779,13 +2383,13 @@ function Select2({
|
|
|
2779
2383
|
}
|
|
2780
2384
|
|
|
2781
2385
|
// src/components/components/Separator/index.tsx
|
|
2782
|
-
import { jsx as
|
|
2386
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
2783
2387
|
function Separator2({ orientation = "horizontal", className, style }) {
|
|
2784
|
-
return /* @__PURE__ */
|
|
2388
|
+
return /* @__PURE__ */ jsx53(Separator, { orientation, className, style });
|
|
2785
2389
|
}
|
|
2786
2390
|
|
|
2787
2391
|
// src/components/components/Sheet/index.tsx
|
|
2788
|
-
import { jsx as
|
|
2392
|
+
import { jsx as jsx54, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2789
2393
|
function Sheet2({
|
|
2790
2394
|
title,
|
|
2791
2395
|
open,
|
|
@@ -2795,7 +2399,7 @@ function Sheet2({
|
|
|
2795
2399
|
className,
|
|
2796
2400
|
style
|
|
2797
2401
|
}) {
|
|
2798
|
-
return /* @__PURE__ */
|
|
2402
|
+
return /* @__PURE__ */ jsx54(
|
|
2799
2403
|
Sheet,
|
|
2800
2404
|
{
|
|
2801
2405
|
open: open ?? false,
|
|
@@ -2804,17 +2408,17 @@ function Sheet2({
|
|
|
2804
2408
|
onClose?.();
|
|
2805
2409
|
}
|
|
2806
2410
|
},
|
|
2807
|
-
children: /* @__PURE__ */
|
|
2808
|
-
title ? /* @__PURE__ */
|
|
2809
|
-
/* @__PURE__ */
|
|
2411
|
+
children: /* @__PURE__ */ jsxs37(SheetContent, { side, className, style, children: [
|
|
2412
|
+
title ? /* @__PURE__ */ jsx54(SheetHeader, { children: /* @__PURE__ */ jsx54(SheetTitle, { children: title }) }) : null,
|
|
2413
|
+
/* @__PURE__ */ jsx54("div", { className: "flex-1 overflow-auto px-4", children })
|
|
2810
2414
|
] })
|
|
2811
2415
|
}
|
|
2812
2416
|
);
|
|
2813
2417
|
}
|
|
2814
2418
|
|
|
2815
2419
|
// src/components/components/Sider/index.tsx
|
|
2816
|
-
import { ChevronLeft
|
|
2817
|
-
import { jsx as
|
|
2420
|
+
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
2421
|
+
import { jsx as jsx55, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
2818
2422
|
function Sider({
|
|
2819
2423
|
width = 200,
|
|
2820
2424
|
collapsible,
|
|
@@ -2826,7 +2430,7 @@ function Sider({
|
|
|
2826
2430
|
children
|
|
2827
2431
|
}) {
|
|
2828
2432
|
const current = collapsed ? collapsedWidth : width;
|
|
2829
|
-
return /* @__PURE__ */
|
|
2433
|
+
return /* @__PURE__ */ jsxs38(
|
|
2830
2434
|
"aside",
|
|
2831
2435
|
{
|
|
2832
2436
|
"data-slot": "layout-sider",
|
|
@@ -2837,15 +2441,15 @@ function Sider({
|
|
|
2837
2441
|
),
|
|
2838
2442
|
style: { width: current, ...style },
|
|
2839
2443
|
children: [
|
|
2840
|
-
/* @__PURE__ */
|
|
2841
|
-
collapsible ? /* @__PURE__ */
|
|
2444
|
+
/* @__PURE__ */ jsx55("div", { className: "min-h-0 flex-1 overflow-auto", children }),
|
|
2445
|
+
collapsible ? /* @__PURE__ */ jsx55(
|
|
2842
2446
|
"button",
|
|
2843
2447
|
{
|
|
2844
2448
|
type: "button",
|
|
2845
2449
|
"aria-label": collapsed ? "expand sider" : "collapse sider",
|
|
2846
2450
|
className: "flex h-10 shrink-0 items-center justify-center border-t text-muted-foreground hover:text-foreground",
|
|
2847
2451
|
onClick: () => onCollapse?.(!collapsed),
|
|
2848
|
-
children: collapsed ? /* @__PURE__ */
|
|
2452
|
+
children: collapsed ? /* @__PURE__ */ jsx55(ChevronRight, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ jsx55(ChevronLeft, { "aria-hidden": true, className: "size-4" })
|
|
2849
2453
|
}
|
|
2850
2454
|
) : null
|
|
2851
2455
|
]
|
|
@@ -2854,7 +2458,7 @@ function Sider({
|
|
|
2854
2458
|
}
|
|
2855
2459
|
|
|
2856
2460
|
// src/components/components/Skeleton/index.tsx
|
|
2857
|
-
import { jsx as
|
|
2461
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
2858
2462
|
var shapeDefaults = {
|
|
2859
2463
|
line: { className: "h-4 w-full", style: {} },
|
|
2860
2464
|
circle: { className: "rounded-full", style: { width: 40, height: 40 } },
|
|
@@ -2865,7 +2469,7 @@ function toSize(value) {
|
|
|
2865
2469
|
}
|
|
2866
2470
|
function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
2867
2471
|
const defaults = shapeDefaults[shape];
|
|
2868
|
-
return /* @__PURE__ */
|
|
2472
|
+
return /* @__PURE__ */ jsx56(
|
|
2869
2473
|
Skeleton,
|
|
2870
2474
|
{
|
|
2871
2475
|
className: cn(defaults.className, className),
|
|
@@ -2880,8 +2484,8 @@ function Skeleton2({ shape = "line", width, height, className, style }) {
|
|
|
2880
2484
|
}
|
|
2881
2485
|
|
|
2882
2486
|
// src/components/components/Slider/index.tsx
|
|
2883
|
-
import { useEffect as
|
|
2884
|
-
import { jsx as
|
|
2487
|
+
import { useEffect as useEffect10 } from "react";
|
|
2488
|
+
import { jsx as jsx57, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
2885
2489
|
function Slider2({
|
|
2886
2490
|
name,
|
|
2887
2491
|
label,
|
|
@@ -2897,7 +2501,7 @@ function Slider2({
|
|
|
2897
2501
|
}) {
|
|
2898
2502
|
const form = useFormContext();
|
|
2899
2503
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
2900
|
-
|
|
2504
|
+
useEffect10(() => {
|
|
2901
2505
|
if (inForm && form && name) {
|
|
2902
2506
|
form.registerField(name, rules, value);
|
|
2903
2507
|
return () => form.unregisterField(name);
|
|
@@ -2912,7 +2516,7 @@ function Slider2({
|
|
|
2912
2516
|
}
|
|
2913
2517
|
onChange?.(next);
|
|
2914
2518
|
};
|
|
2915
|
-
const slider = /* @__PURE__ */
|
|
2519
|
+
const slider = /* @__PURE__ */ jsx57(
|
|
2916
2520
|
Slider,
|
|
2917
2521
|
{
|
|
2918
2522
|
value: numberValue,
|
|
@@ -2924,14 +2528,14 @@ function Slider2({
|
|
|
2924
2528
|
onValueChange: handleChange,
|
|
2925
2529
|
className: inForm ? void 0 : className,
|
|
2926
2530
|
style: inForm ? void 0 : style,
|
|
2927
|
-
children: /* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
2929
|
-
/* @__PURE__ */
|
|
2531
|
+
children: /* @__PURE__ */ jsx57(SliderControl, { children: /* @__PURE__ */ jsxs39(SliderTrack, { children: [
|
|
2532
|
+
/* @__PURE__ */ jsx57(SliderIndicator, {}),
|
|
2533
|
+
/* @__PURE__ */ jsx57(SliderThumb, {})
|
|
2930
2534
|
] }) })
|
|
2931
2535
|
}
|
|
2932
2536
|
);
|
|
2933
2537
|
if (inForm && form && name) {
|
|
2934
|
-
return /* @__PURE__ */
|
|
2538
|
+
return /* @__PURE__ */ jsx57(
|
|
2935
2539
|
FieldShell,
|
|
2936
2540
|
{
|
|
2937
2541
|
layout: form.layout,
|
|
@@ -2947,12 +2551,12 @@ function Slider2({
|
|
|
2947
2551
|
}
|
|
2948
2552
|
|
|
2949
2553
|
// src/components/components/Sonner/index.tsx
|
|
2950
|
-
import { useRenderer as
|
|
2951
|
-
import { useEffect as
|
|
2952
|
-
import { jsx as
|
|
2554
|
+
import { useRenderer as useRenderer13 } from "@pactor-app/runtime";
|
|
2555
|
+
import { useEffect as useEffect11 } from "react";
|
|
2556
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
2953
2557
|
function Sonner({ className, style }) {
|
|
2954
|
-
const { context } =
|
|
2955
|
-
|
|
2558
|
+
const { context } = useRenderer13();
|
|
2559
|
+
useEffect11(() => {
|
|
2956
2560
|
const { actions } = context;
|
|
2957
2561
|
if (actions.has("toast")) {
|
|
2958
2562
|
return;
|
|
@@ -2966,36 +2570,36 @@ function Sonner({ className, style }) {
|
|
|
2966
2570
|
return { ok: true };
|
|
2967
2571
|
});
|
|
2968
2572
|
}, [context]);
|
|
2969
|
-
return /* @__PURE__ */
|
|
2573
|
+
return /* @__PURE__ */ jsx58("div", { "data-slot": "sonner", className, style, children: /* @__PURE__ */ jsx58(Toaster, {}) });
|
|
2970
2574
|
}
|
|
2971
2575
|
|
|
2972
2576
|
// src/components/components/Spinner/index.tsx
|
|
2973
|
-
import { jsx as
|
|
2577
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
2974
2578
|
var sizeClass = {
|
|
2975
2579
|
sm: "size-3",
|
|
2976
2580
|
default: "size-4",
|
|
2977
2581
|
lg: "size-6"
|
|
2978
2582
|
};
|
|
2979
2583
|
function Spinner2({ size = "default", className, style }) {
|
|
2980
|
-
return /* @__PURE__ */
|
|
2584
|
+
return /* @__PURE__ */ jsx59(Spinner, { className: cn(sizeClass[size], className), style });
|
|
2981
2585
|
}
|
|
2982
2586
|
|
|
2983
2587
|
// src/components/components/Statistic/index.tsx
|
|
2984
|
-
import { jsx as
|
|
2588
|
+
import { jsx as jsx60, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
2985
2589
|
function Statistic({ title, value, precision, suffix, className, style }) {
|
|
2986
2590
|
const display = typeof value === "number" && precision !== void 0 ? value.toFixed(precision) : value;
|
|
2987
|
-
return /* @__PURE__ */
|
|
2988
|
-
title ? /* @__PURE__ */
|
|
2989
|
-
/* @__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: [
|
|
2990
2594
|
display,
|
|
2991
|
-
suffix ? /* @__PURE__ */
|
|
2595
|
+
suffix ? /* @__PURE__ */ jsx60("span", { className: "ml-1 text-sm font-normal text-muted-foreground", children: suffix }) : null
|
|
2992
2596
|
] })
|
|
2993
2597
|
] });
|
|
2994
2598
|
}
|
|
2995
2599
|
|
|
2996
2600
|
// src/components/components/Switch/index.tsx
|
|
2997
|
-
import { useEffect as
|
|
2998
|
-
import { jsx as
|
|
2601
|
+
import { useEffect as useEffect12, useId as useId6 } from "react";
|
|
2602
|
+
import { jsx as jsx61, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
2999
2603
|
function Switch2({
|
|
3000
2604
|
name,
|
|
3001
2605
|
label,
|
|
@@ -3009,7 +2613,7 @@ function Switch2({
|
|
|
3009
2613
|
const form = useFormContext();
|
|
3010
2614
|
const controlId = useId6();
|
|
3011
2615
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
3012
|
-
|
|
2616
|
+
useEffect12(() => {
|
|
3013
2617
|
if (inForm && form && name) {
|
|
3014
2618
|
form.registerField(name, rules, value);
|
|
3015
2619
|
return () => form.unregisterField(name);
|
|
@@ -3024,13 +2628,13 @@ function Switch2({
|
|
|
3024
2628
|
}
|
|
3025
2629
|
onChange?.(next);
|
|
3026
2630
|
};
|
|
3027
|
-
const control = /* @__PURE__ */
|
|
2631
|
+
const control = /* @__PURE__ */ jsxs41(
|
|
3028
2632
|
"span",
|
|
3029
2633
|
{
|
|
3030
2634
|
className: cn("inline-flex items-center gap-2", !inForm && className),
|
|
3031
2635
|
style: inForm ? void 0 : style,
|
|
3032
2636
|
children: [
|
|
3033
|
-
/* @__PURE__ */
|
|
2637
|
+
/* @__PURE__ */ jsx61(
|
|
3034
2638
|
Switch,
|
|
3035
2639
|
{
|
|
3036
2640
|
id: controlId,
|
|
@@ -3040,12 +2644,12 @@ function Switch2({
|
|
|
3040
2644
|
onCheckedChange: handleChange
|
|
3041
2645
|
}
|
|
3042
2646
|
),
|
|
3043
|
-
label ? /* @__PURE__ */
|
|
2647
|
+
label ? /* @__PURE__ */ jsx61("label", { htmlFor: controlId, className: "text-sm leading-none font-medium", children: label }) : null
|
|
3044
2648
|
]
|
|
3045
2649
|
}
|
|
3046
2650
|
);
|
|
3047
2651
|
if (inForm && form && name) {
|
|
3048
|
-
return /* @__PURE__ */
|
|
2652
|
+
return /* @__PURE__ */ jsxs41(
|
|
3049
2653
|
"div",
|
|
3050
2654
|
{
|
|
3051
2655
|
"data-slot": "form-item",
|
|
@@ -3053,7 +2657,7 @@ function Switch2({
|
|
|
3053
2657
|
style,
|
|
3054
2658
|
children: [
|
|
3055
2659
|
control,
|
|
3056
|
-
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
|
|
3057
2661
|
]
|
|
3058
2662
|
}
|
|
3059
2663
|
);
|
|
@@ -3062,9 +2666,9 @@ function Switch2({
|
|
|
3062
2666
|
}
|
|
3063
2667
|
|
|
3064
2668
|
// src/components/components/Table/index.tsx
|
|
3065
|
-
import { useI18n as
|
|
3066
|
-
import { useState as
|
|
3067
|
-
import { jsx as
|
|
2669
|
+
import { useI18n as useI18n6, useRenderer as useRenderer14 } from "@pactor-app/runtime";
|
|
2670
|
+
import { useState as useState11 } from "react";
|
|
2671
|
+
import { jsx as jsx62, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3068
2672
|
function renderCellValue2(value) {
|
|
3069
2673
|
if (value === void 0 || value === null) {
|
|
3070
2674
|
return "";
|
|
@@ -3084,9 +2688,9 @@ function Table2({
|
|
|
3084
2688
|
className,
|
|
3085
2689
|
style
|
|
3086
2690
|
}) {
|
|
3087
|
-
const { renderChildren } =
|
|
3088
|
-
const { t } =
|
|
3089
|
-
const [current, setCurrent] =
|
|
2691
|
+
const { renderChildren } = useRenderer14();
|
|
2692
|
+
const { t } = useI18n6();
|
|
2693
|
+
const [current, setCurrent] = useState11(1);
|
|
3090
2694
|
const pageSize = pagination === false ? void 0 : pagination?.pageSize;
|
|
3091
2695
|
const total = dataSource.length;
|
|
3092
2696
|
const pageCount = pageSize !== void 0 && pageSize > 0 ? Math.max(1, Math.ceil(total / pageSize)) : 1;
|
|
@@ -3095,8 +2699,8 @@ function Table2({
|
|
|
3095
2699
|
setCurrent(page);
|
|
3096
2700
|
onChange?.({ current: page, pageSize, total });
|
|
3097
2701
|
};
|
|
3098
|
-
return /* @__PURE__ */
|
|
3099
|
-
loading ? /* @__PURE__ */
|
|
2702
|
+
return /* @__PURE__ */ jsxs42("div", { "data-slot": "dsl-table", className: cn("relative", className), style, children: [
|
|
2703
|
+
loading ? /* @__PURE__ */ jsx62(
|
|
3100
2704
|
"div",
|
|
3101
2705
|
{
|
|
3102
2706
|
"data-slot": "table-loading",
|
|
@@ -3104,8 +2708,8 @@ function Table2({
|
|
|
3104
2708
|
children: t("pactor.table.loading")
|
|
3105
2709
|
}
|
|
3106
2710
|
) : null,
|
|
3107
|
-
/* @__PURE__ */
|
|
3108
|
-
/* @__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(
|
|
3109
2713
|
TableHead,
|
|
3110
2714
|
{
|
|
3111
2715
|
style: column.width !== void 0 ? { width: column.width } : void 0,
|
|
@@ -3113,7 +2717,7 @@ function Table2({
|
|
|
3113
2717
|
},
|
|
3114
2718
|
column.dataIndex ?? String(index)
|
|
3115
2719
|
)) }) }),
|
|
3116
|
-
/* @__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(
|
|
3117
2721
|
"div",
|
|
3118
2722
|
{
|
|
3119
2723
|
"data-slot": "table-empty",
|
|
@@ -3122,10 +2726,10 @@ function Table2({
|
|
|
3122
2726
|
}
|
|
3123
2727
|
) }) }) : pageRows.map((row, rowIndex) => {
|
|
3124
2728
|
const key = row[rowKey];
|
|
3125
|
-
return /* @__PURE__ */
|
|
2729
|
+
return /* @__PURE__ */ jsx62(
|
|
3126
2730
|
TableRow,
|
|
3127
2731
|
{
|
|
3128
|
-
children: columns.map((column, columnIndex) => /* @__PURE__ */
|
|
2732
|
+
children: columns.map((column, columnIndex) => /* @__PURE__ */ jsx62(TableCell, { children: column.cell ? renderChildren([column.cell], { row, rowIndex }) : renderCellValue2(
|
|
3129
2733
|
column.dataIndex === void 0 ? void 0 : row[column.dataIndex]
|
|
3130
2734
|
) }, column.dataIndex ?? String(columnIndex)))
|
|
3131
2735
|
},
|
|
@@ -3133,8 +2737,8 @@ function Table2({
|
|
|
3133
2737
|
);
|
|
3134
2738
|
}) })
|
|
3135
2739
|
] }),
|
|
3136
|
-
pageSize !== void 0 && pageSize > 0 ? /* @__PURE__ */
|
|
3137
|
-
(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(
|
|
3138
2742
|
Button,
|
|
3139
2743
|
{
|
|
3140
2744
|
type: "button",
|
|
@@ -3151,11 +2755,11 @@ function Table2({
|
|
|
3151
2755
|
}
|
|
3152
2756
|
|
|
3153
2757
|
// src/components/components/Tabs/index.tsx
|
|
3154
|
-
import { useRenderer as
|
|
3155
|
-
import { jsx as
|
|
2758
|
+
import { useRenderer as useRenderer15 } from "@pactor-app/runtime";
|
|
2759
|
+
import { jsx as jsx63, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3156
2760
|
function Tabs2({ items = [], activeKey, onChange, className, style }) {
|
|
3157
|
-
const { renderChildren } =
|
|
3158
|
-
return /* @__PURE__ */
|
|
2761
|
+
const { renderChildren } = useRenderer15();
|
|
2762
|
+
return /* @__PURE__ */ jsxs43(
|
|
3159
2763
|
Tabs,
|
|
3160
2764
|
{
|
|
3161
2765
|
value: activeKey,
|
|
@@ -3164,15 +2768,15 @@ function Tabs2({ items = [], activeKey, onChange, className, style }) {
|
|
|
3164
2768
|
className,
|
|
3165
2769
|
style,
|
|
3166
2770
|
children: [
|
|
3167
|
-
/* @__PURE__ */
|
|
3168
|
-
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))
|
|
3169
2773
|
]
|
|
3170
2774
|
}
|
|
3171
2775
|
);
|
|
3172
2776
|
}
|
|
3173
2777
|
|
|
3174
2778
|
// src/components/components/Text/index.tsx
|
|
3175
|
-
import { jsx as
|
|
2779
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
3176
2780
|
var typeClassMap = {
|
|
3177
2781
|
default: "",
|
|
3178
2782
|
secondary: "text-muted-foreground",
|
|
@@ -3191,7 +2795,7 @@ function Text({
|
|
|
3191
2795
|
style,
|
|
3192
2796
|
children
|
|
3193
2797
|
}) {
|
|
3194
|
-
return /* @__PURE__ */
|
|
2798
|
+
return /* @__PURE__ */ jsx64(
|
|
3195
2799
|
"span",
|
|
3196
2800
|
{
|
|
3197
2801
|
"data-slot": "text",
|
|
@@ -3211,8 +2815,8 @@ function Text({
|
|
|
3211
2815
|
}
|
|
3212
2816
|
|
|
3213
2817
|
// src/components/components/Textarea/index.tsx
|
|
3214
|
-
import { useEffect as
|
|
3215
|
-
import { jsx as
|
|
2818
|
+
import { useEffect as useEffect13, useId as useId7 } from "react";
|
|
2819
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
3216
2820
|
function Textarea2({
|
|
3217
2821
|
name,
|
|
3218
2822
|
label,
|
|
@@ -3228,7 +2832,7 @@ function Textarea2({
|
|
|
3228
2832
|
const form = useFormContext();
|
|
3229
2833
|
const controlId = useId7();
|
|
3230
2834
|
const inForm = form?.inForm === true && typeof name === "string" && name !== "";
|
|
3231
|
-
|
|
2835
|
+
useEffect13(() => {
|
|
3232
2836
|
if (inForm && form && name) {
|
|
3233
2837
|
form.registerField(name, rules, value);
|
|
3234
2838
|
return () => form.unregisterField(name);
|
|
@@ -3237,7 +2841,7 @@ function Textarea2({
|
|
|
3237
2841
|
});
|
|
3238
2842
|
if (inForm && form && name) {
|
|
3239
2843
|
const fieldValue = form.values[name];
|
|
3240
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ jsx65(
|
|
3241
2845
|
FieldShell,
|
|
3242
2846
|
{
|
|
3243
2847
|
layout: form.layout,
|
|
@@ -3246,7 +2850,7 @@ function Textarea2({
|
|
|
3246
2850
|
error: form.errors[name],
|
|
3247
2851
|
className,
|
|
3248
2852
|
style,
|
|
3249
|
-
children: /* @__PURE__ */
|
|
2853
|
+
children: /* @__PURE__ */ jsx65(
|
|
3250
2854
|
Textarea,
|
|
3251
2855
|
{
|
|
3252
2856
|
id: controlId,
|
|
@@ -3263,7 +2867,7 @@ function Textarea2({
|
|
|
3263
2867
|
}
|
|
3264
2868
|
);
|
|
3265
2869
|
}
|
|
3266
|
-
return /* @__PURE__ */
|
|
2870
|
+
return /* @__PURE__ */ jsx65(
|
|
3267
2871
|
Textarea,
|
|
3268
2872
|
{
|
|
3269
2873
|
value: value ?? "",
|
|
@@ -3278,7 +2882,7 @@ function Textarea2({
|
|
|
3278
2882
|
}
|
|
3279
2883
|
|
|
3280
2884
|
// src/components/components/Toggle/index.tsx
|
|
3281
|
-
import { jsx as
|
|
2885
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
3282
2886
|
function Toggle2({
|
|
3283
2887
|
text,
|
|
3284
2888
|
pressed,
|
|
@@ -3289,7 +2893,7 @@ function Toggle2({
|
|
|
3289
2893
|
className,
|
|
3290
2894
|
style
|
|
3291
2895
|
}) {
|
|
3292
|
-
return /* @__PURE__ */
|
|
2896
|
+
return /* @__PURE__ */ jsx66(
|
|
3293
2897
|
Toggle,
|
|
3294
2898
|
{
|
|
3295
2899
|
pressed,
|
|
@@ -3305,7 +2909,7 @@ function Toggle2({
|
|
|
3305
2909
|
}
|
|
3306
2910
|
|
|
3307
2911
|
// src/components/components/ToggleGroup/index.tsx
|
|
3308
|
-
import { jsx as
|
|
2912
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
3309
2913
|
function ToggleGroup2({
|
|
3310
2914
|
options = [],
|
|
3311
2915
|
value,
|
|
@@ -3325,7 +2929,7 @@ function ToggleGroup2({
|
|
|
3325
2929
|
onChange?.(added ?? void 0);
|
|
3326
2930
|
}
|
|
3327
2931
|
};
|
|
3328
|
-
return /* @__PURE__ */
|
|
2932
|
+
return /* @__PURE__ */ jsx67(
|
|
3329
2933
|
ToggleGroup,
|
|
3330
2934
|
{
|
|
3331
2935
|
value: groupValue,
|
|
@@ -3334,7 +2938,7 @@ function ToggleGroup2({
|
|
|
3334
2938
|
onValueChange: (next) => handleChange(next),
|
|
3335
2939
|
className,
|
|
3336
2940
|
style,
|
|
3337
|
-
children: options.map((option) => /* @__PURE__ */
|
|
2941
|
+
children: options.map((option) => /* @__PURE__ */ jsx67(
|
|
3338
2942
|
ToggleGroupItem,
|
|
3339
2943
|
{
|
|
3340
2944
|
value: option.value,
|
|
@@ -3348,27 +2952,27 @@ function ToggleGroup2({
|
|
|
3348
2952
|
}
|
|
3349
2953
|
|
|
3350
2954
|
// src/components/components/Tooltip/index.tsx
|
|
3351
|
-
import { jsx as
|
|
2955
|
+
import { jsx as jsx68, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3352
2956
|
function Tooltip3({ content, children, className, style }) {
|
|
3353
|
-
return /* @__PURE__ */
|
|
3354
|
-
/* @__PURE__ */
|
|
3355
|
-
/* @__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 })
|
|
3356
2960
|
] });
|
|
3357
2961
|
}
|
|
3358
2962
|
|
|
3359
2963
|
// src/components/components/Typography/index.tsx
|
|
3360
|
-
import { jsx as
|
|
2964
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
3361
2965
|
function Typography2({
|
|
3362
2966
|
variant = "p",
|
|
3363
2967
|
text,
|
|
3364
2968
|
className,
|
|
3365
2969
|
style
|
|
3366
2970
|
}) {
|
|
3367
|
-
return /* @__PURE__ */
|
|
2971
|
+
return /* @__PURE__ */ jsx69(Typography, { variant, className, style, children: text });
|
|
3368
2972
|
}
|
|
3369
2973
|
|
|
3370
2974
|
// src/components/register.ts
|
|
3371
|
-
var
|
|
2975
|
+
var builtinComponents = {
|
|
3372
2976
|
Page,
|
|
3373
2977
|
Grid,
|
|
3374
2978
|
Flex,
|
|
@@ -3448,14 +3052,14 @@ var shadcnComponents = {
|
|
|
3448
3052
|
// 图标(lucide 白名单)
|
|
3449
3053
|
Icon
|
|
3450
3054
|
};
|
|
3451
|
-
function
|
|
3452
|
-
for (const [type, component] of Object.entries(
|
|
3055
|
+
function registerBuiltinComponents(registry) {
|
|
3056
|
+
for (const [type, component] of Object.entries(builtinComponents)) {
|
|
3453
3057
|
registry.register(type, component);
|
|
3454
3058
|
}
|
|
3455
3059
|
}
|
|
3456
|
-
function
|
|
3060
|
+
function createComponentRegistry() {
|
|
3457
3061
|
const registry = new Registry("ComponentRegistry");
|
|
3458
|
-
|
|
3062
|
+
registerBuiltinComponents(registry);
|
|
3459
3063
|
return registry;
|
|
3460
3064
|
}
|
|
3461
3065
|
|
|
@@ -3500,10 +3104,6 @@ export {
|
|
|
3500
3104
|
Label2 as Label,
|
|
3501
3105
|
Layout,
|
|
3502
3106
|
Link,
|
|
3503
|
-
RailTooltip,
|
|
3504
|
-
useSidebarDrawer,
|
|
3505
|
-
Sidebar,
|
|
3506
|
-
Menu,
|
|
3507
3107
|
Menubar2 as Menubar,
|
|
3508
3108
|
NavigationMenu2 as NavigationMenu,
|
|
3509
3109
|
Page,
|
|
@@ -3531,7 +3131,7 @@ export {
|
|
|
3531
3131
|
ToggleGroup2 as ToggleGroup,
|
|
3532
3132
|
Tooltip3 as Tooltip,
|
|
3533
3133
|
Typography2 as Typography,
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3134
|
+
builtinComponents,
|
|
3135
|
+
registerBuiltinComponents,
|
|
3136
|
+
createComponentRegistry
|
|
3537
3137
|
};
|