@pactor-app/ui 0.1.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-6B5ZX7L3.js +3537 -0
- package/dist/chunk-6JNCDPGS.js +257 -0
- package/dist/chunk-BVHAP22U.js +3085 -0
- package/dist/{chunk-OH3U6PCM.js → chunk-BZSRLTQQ.js} +60 -66
- package/dist/chunk-F3H23KYG.js +330 -0
- package/dist/{chunk-SNFDI77B.js → chunk-GL7IO22L.js} +94 -5
- package/dist/{chunk-DMK6RSTK.js → chunk-GV5R6TUT.js} +18 -11
- package/dist/components/index.cjs +6134 -471
- package/dist/components/index.d.cts +1561 -30
- package/dist/components/index.d.ts +1561 -30
- package/dist/components/index.js +130 -6
- package/dist/index.cjs +6410 -979
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +132 -10
- package/dist/interaction/index.cjs +152 -77
- package/dist/interaction/index.d.cts +7 -5
- package/dist/interaction/index.d.ts +7 -5
- package/dist/interaction/index.js +2 -3
- package/dist/layout/index.cjs +229 -71
- package/dist/layout/index.js +3 -3
- package/dist/typography-DsGdDBc2.d.cts +24 -0
- package/dist/typography-DsGdDBc2.d.ts +24 -0
- package/dist/ui/index.cjs +2969 -172
- package/dist/ui/index.d.cts +416 -14
- package/dist/ui/index.d.ts +416 -14
- package/dist/ui/index.js +330 -126
- package/package.json +13 -5
- package/styles.css +1202 -6
- package/dist/chunk-57NRUZ5G.js +0 -95
- package/dist/chunk-OUTSIJMO.js +0 -442
- package/dist/chunk-QDTVOJ5P.js +0 -147
- package/dist/chunk-QWZ23QLS.js +0 -68
- package/dist/chunk-XGOTHOI6.js +0 -619
|
@@ -5,9 +5,8 @@ import {
|
|
|
5
5
|
ShadcnOverlayHost,
|
|
6
6
|
createUiBridge,
|
|
7
7
|
registerInteractionActions
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-QWZ23QLS.js";
|
|
8
|
+
} from "../chunk-BZSRLTQQ.js";
|
|
9
|
+
import "../chunk-F3H23KYG.js";
|
|
11
10
|
import "../chunk-RQHJBTEU.js";
|
|
12
11
|
export {
|
|
13
12
|
OVERLAY_CANCEL_PAYLOAD,
|
package/dist/layout/index.cjs
CHANGED
|
@@ -212,6 +212,158 @@ function PopoverContent({
|
|
|
212
212
|
) });
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
+
// src/components/components/Icon/index.tsx
|
|
216
|
+
var import_lucide_react2 = require("lucide-react");
|
|
217
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
218
|
+
var ICONS = {
|
|
219
|
+
"arrow-left": import_lucide_react2.ArrowLeft,
|
|
220
|
+
"arrow-right": import_lucide_react2.ArrowRight,
|
|
221
|
+
"arrow-up": import_lucide_react2.ArrowUp,
|
|
222
|
+
"arrow-down": import_lucide_react2.ArrowDown,
|
|
223
|
+
"chevron-left": import_lucide_react2.ChevronLeft,
|
|
224
|
+
"chevron-right": import_lucide_react2.ChevronRight,
|
|
225
|
+
"chevron-up": import_lucide_react2.ChevronUp,
|
|
226
|
+
"chevron-down": import_lucide_react2.ChevronDown,
|
|
227
|
+
check: import_lucide_react2.Check,
|
|
228
|
+
x: import_lucide_react2.X,
|
|
229
|
+
plus: import_lucide_react2.Plus,
|
|
230
|
+
minus: import_lucide_react2.Minus,
|
|
231
|
+
search: import_lucide_react2.Search,
|
|
232
|
+
settings: import_lucide_react2.Settings,
|
|
233
|
+
user: import_lucide_react2.User,
|
|
234
|
+
users: import_lucide_react2.Users,
|
|
235
|
+
home: import_lucide_react2.House,
|
|
236
|
+
menu: import_lucide_react2.Menu,
|
|
237
|
+
bell: import_lucide_react2.Bell,
|
|
238
|
+
calendar: import_lucide_react2.Calendar,
|
|
239
|
+
clock: import_lucide_react2.Clock,
|
|
240
|
+
download: import_lucide_react2.Download,
|
|
241
|
+
upload: import_lucide_react2.Upload,
|
|
242
|
+
pencil: import_lucide_react2.Pencil,
|
|
243
|
+
edit: import_lucide_react2.SquarePen,
|
|
244
|
+
trash: import_lucide_react2.Trash2,
|
|
245
|
+
eye: import_lucide_react2.Eye,
|
|
246
|
+
info: import_lucide_react2.Info,
|
|
247
|
+
warning: import_lucide_react2.TriangleAlert,
|
|
248
|
+
error: import_lucide_react2.CircleAlert,
|
|
249
|
+
"check-circle": import_lucide_react2.CircleCheck,
|
|
250
|
+
"x-circle": import_lucide_react2.CircleX,
|
|
251
|
+
"help-circle": import_lucide_react2.CircleQuestionMark,
|
|
252
|
+
loading: import_lucide_react2.LoaderCircle,
|
|
253
|
+
spinner: import_lucide_react2.LoaderCircle,
|
|
254
|
+
star: import_lucide_react2.Star,
|
|
255
|
+
heart: import_lucide_react2.Heart,
|
|
256
|
+
bookmark: import_lucide_react2.Bookmark,
|
|
257
|
+
share: import_lucide_react2.Share2,
|
|
258
|
+
copy: import_lucide_react2.Copy,
|
|
259
|
+
"external-link": import_lucide_react2.ExternalLink,
|
|
260
|
+
link: import_lucide_react2.Link,
|
|
261
|
+
mail: import_lucide_react2.Mail,
|
|
262
|
+
phone: import_lucide_react2.Phone,
|
|
263
|
+
lock: import_lucide_react2.Lock,
|
|
264
|
+
unlock: import_lucide_react2.LockOpen,
|
|
265
|
+
"log-in": import_lucide_react2.LogIn,
|
|
266
|
+
"log-out": import_lucide_react2.LogOut,
|
|
267
|
+
sun: import_lucide_react2.Sun,
|
|
268
|
+
moon: import_lucide_react2.Moon,
|
|
269
|
+
globe: import_lucide_react2.Globe,
|
|
270
|
+
filter: import_lucide_react2.Funnel,
|
|
271
|
+
"list-filter": import_lucide_react2.ListFilter,
|
|
272
|
+
"more-horizontal": import_lucide_react2.Ellipsis,
|
|
273
|
+
"more-vertical": import_lucide_react2.EllipsisVertical,
|
|
274
|
+
refresh: import_lucide_react2.RefreshCcw,
|
|
275
|
+
save: import_lucide_react2.Save,
|
|
276
|
+
file: import_lucide_react2.File,
|
|
277
|
+
folder: import_lucide_react2.Folder,
|
|
278
|
+
image: import_lucide_react2.Image,
|
|
279
|
+
camera: import_lucide_react2.Camera,
|
|
280
|
+
chart: import_lucide_react2.ChartColumn,
|
|
281
|
+
table: import_lucide_react2.Table,
|
|
282
|
+
list: import_lucide_react2.List,
|
|
283
|
+
grid: import_lucide_react2.LayoutGrid,
|
|
284
|
+
tag: import_lucide_react2.Tag,
|
|
285
|
+
"shopping-cart": import_lucide_react2.ShoppingCart,
|
|
286
|
+
"credit-card": import_lucide_react2.CreditCard,
|
|
287
|
+
package: import_lucide_react2.Package,
|
|
288
|
+
"map-pin": import_lucide_react2.MapPin,
|
|
289
|
+
building: import_lucide_react2.Building2,
|
|
290
|
+
briefcase: import_lucide_react2.Briefcase,
|
|
291
|
+
send: import_lucide_react2.Send,
|
|
292
|
+
message: import_lucide_react2.MessageCircle,
|
|
293
|
+
"message-square": import_lucide_react2.MessageSquare,
|
|
294
|
+
paperclip: import_lucide_react2.Paperclip,
|
|
295
|
+
"thumbs-up": import_lucide_react2.ThumbsUp,
|
|
296
|
+
"thumbs-down": import_lucide_react2.ThumbsDown,
|
|
297
|
+
zap: import_lucide_react2.Zap,
|
|
298
|
+
flag: import_lucide_react2.Flag,
|
|
299
|
+
key: import_lucide_react2.Key,
|
|
300
|
+
shield: import_lucide_react2.Shield,
|
|
301
|
+
terminal: import_lucide_react2.Terminal,
|
|
302
|
+
code: import_lucide_react2.Code,
|
|
303
|
+
database: import_lucide_react2.Database,
|
|
304
|
+
cloud: import_lucide_react2.Cloud,
|
|
305
|
+
languages: import_lucide_react2.Languages,
|
|
306
|
+
// @pactor-app/chat 收敛(spec: chat-icon-convergence):chat 既有图标与
|
|
307
|
+
// 契约图标名(menu.icon / messageActions[].icon 的既有取值)直通
|
|
308
|
+
"chevrons-up-down": import_lucide_react2.ChevronsUpDown,
|
|
309
|
+
"file-text": import_lucide_react2.FileText,
|
|
310
|
+
"panel-left": import_lucide_react2.PanelLeft,
|
|
311
|
+
"panel-right-open": import_lucide_react2.PanelRightOpen,
|
|
312
|
+
square: import_lucide_react2.Square,
|
|
313
|
+
history: import_lucide_react2.History,
|
|
314
|
+
"rotate-ccw": import_lucide_react2.RotateCcw,
|
|
315
|
+
quote: import_lucide_react2.Quote,
|
|
316
|
+
chat: import_lucide_react2.MessageSquare,
|
|
317
|
+
brain: import_lucide_react2.Brain
|
|
318
|
+
};
|
|
319
|
+
function normalizeIconName(name) {
|
|
320
|
+
return name.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[_\s]+/g, "-").toLowerCase();
|
|
321
|
+
}
|
|
322
|
+
var sizePx = {
|
|
323
|
+
sm: 16,
|
|
324
|
+
default: 20,
|
|
325
|
+
lg: 24
|
|
326
|
+
};
|
|
327
|
+
function Icon({
|
|
328
|
+
name,
|
|
329
|
+
size = "default",
|
|
330
|
+
color,
|
|
331
|
+
strokeWidth,
|
|
332
|
+
className,
|
|
333
|
+
style
|
|
334
|
+
}) {
|
|
335
|
+
const key = name ? normalizeIconName(name) : "";
|
|
336
|
+
const Lucide = ICONS[key];
|
|
337
|
+
const px = typeof size === "number" ? size : sizePx[size];
|
|
338
|
+
if (!Lucide) {
|
|
339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
340
|
+
import_lucide_react2.CircleQuestionMark,
|
|
341
|
+
{
|
|
342
|
+
"data-slot": "icon",
|
|
343
|
+
"data-unknown": name,
|
|
344
|
+
size: px,
|
|
345
|
+
color,
|
|
346
|
+
strokeWidth,
|
|
347
|
+
className: cn("shrink-0 text-muted-foreground", className),
|
|
348
|
+
style,
|
|
349
|
+
"aria-hidden": "true"
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
354
|
+
Lucide,
|
|
355
|
+
{
|
|
356
|
+
"data-slot": "icon",
|
|
357
|
+
size: px,
|
|
358
|
+
color,
|
|
359
|
+
strokeWidth,
|
|
360
|
+
className: cn("shrink-0", className),
|
|
361
|
+
style,
|
|
362
|
+
"aria-hidden": "true"
|
|
363
|
+
}
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
|
|
215
367
|
// src/layout/admin/use-media-query.ts
|
|
216
368
|
var import_react = require("react");
|
|
217
369
|
var BREAKPOINT_PX = {
|
|
@@ -246,7 +398,7 @@ function useBreakpointBelow(breakpoint) {
|
|
|
246
398
|
}
|
|
247
399
|
|
|
248
400
|
// src/layout/admin/ShadcnAdminLayout.tsx
|
|
249
|
-
var
|
|
401
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
250
402
|
function buildVisibleMenuTree(registry, permissionChecker) {
|
|
251
403
|
const tree = registry.tree();
|
|
252
404
|
return permissionChecker === void 0 ? [...tree] : (0, import_permission.filterMenusByPermission)(tree, permissionChecker);
|
|
@@ -261,7 +413,7 @@ function navigateMenuItem(menu, bridge) {
|
|
|
261
413
|
}
|
|
262
414
|
bridge.push(menu.path);
|
|
263
415
|
}
|
|
264
|
-
var menuItemClass = "flex w-full cursor-pointer items-center rounded-md px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50";
|
|
416
|
+
var menuItemClass = "flex w-full cursor-pointer items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground disabled:pointer-events-none disabled:opacity-50";
|
|
265
417
|
function CollapsedGroupFlyout({
|
|
266
418
|
menu,
|
|
267
419
|
registry,
|
|
@@ -280,11 +432,11 @@ function CollapsedGroupFlyout({
|
|
|
280
432
|
closeTimer.current = window.setTimeout(() => setOpen(false), 200);
|
|
281
433
|
};
|
|
282
434
|
(0, import_react2.useEffect)(() => () => window.clearTimeout(closeTimer.current), []);
|
|
283
|
-
return /* @__PURE__ */ (0,
|
|
284
|
-
/* @__PURE__ */ (0,
|
|
435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
436
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
285
437
|
PopoverTrigger,
|
|
286
438
|
{
|
|
287
|
-
render: /* @__PURE__ */ (0,
|
|
439
|
+
render: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
288
440
|
"button",
|
|
289
441
|
{
|
|
290
442
|
type: "button",
|
|
@@ -302,7 +454,7 @@ function CollapsedGroupFlyout({
|
|
|
302
454
|
)
|
|
303
455
|
}
|
|
304
456
|
),
|
|
305
|
-
/* @__PURE__ */ (0,
|
|
457
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
306
458
|
PopoverContent,
|
|
307
459
|
{
|
|
308
460
|
"data-slot": "menu-flyout",
|
|
@@ -319,8 +471,8 @@ function CollapsedGroupFlyout({
|
|
|
319
471
|
}
|
|
320
472
|
},
|
|
321
473
|
children: [
|
|
322
|
-
/* @__PURE__ */ (0,
|
|
323
|
-
/* @__PURE__ */ (0,
|
|
474
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "px-3 pt-2 pb-1 text-xs font-semibold text-muted-foreground", children: menu.title }),
|
|
475
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
324
476
|
MenuTree,
|
|
325
477
|
{
|
|
326
478
|
menus: menu.children ?? [],
|
|
@@ -344,9 +496,9 @@ function MenuTree({
|
|
|
344
496
|
collapsed = false
|
|
345
497
|
}) {
|
|
346
498
|
if (collapsed) {
|
|
347
|
-
return /* @__PURE__ */ (0,
|
|
499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "menu", "data-collapsed": "true", className: "flex flex-col gap-1", children: menus.map((menu) => {
|
|
348
500
|
if (menu.type === "group") {
|
|
349
|
-
return /* @__PURE__ */ (0,
|
|
501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
350
502
|
CollapsedGroupFlyout,
|
|
351
503
|
{
|
|
352
504
|
menu,
|
|
@@ -358,7 +510,7 @@ function MenuTree({
|
|
|
358
510
|
menu.id
|
|
359
511
|
);
|
|
360
512
|
}
|
|
361
|
-
return /* @__PURE__ */ (0,
|
|
513
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
362
514
|
"button",
|
|
363
515
|
{
|
|
364
516
|
type: "button",
|
|
@@ -378,7 +530,7 @@ function MenuTree({
|
|
|
378
530
|
);
|
|
379
531
|
}) });
|
|
380
532
|
}
|
|
381
|
-
return /* @__PURE__ */ (0,
|
|
533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
382
534
|
Accordion,
|
|
383
535
|
{
|
|
384
536
|
type: "multiple",
|
|
@@ -387,24 +539,27 @@ function MenuTree({
|
|
|
387
539
|
className: "flex flex-col gap-0.5 px-2",
|
|
388
540
|
children: menus.map((menu) => {
|
|
389
541
|
if (menu.type === "group") {
|
|
390
|
-
return /* @__PURE__ */ (0,
|
|
542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
391
543
|
AccordionItem,
|
|
392
544
|
{
|
|
393
545
|
value: menu.id,
|
|
394
546
|
"data-slot": "menu-group",
|
|
395
547
|
className: "border-b-0",
|
|
396
548
|
children: [
|
|
397
|
-
/* @__PURE__ */ (0,
|
|
549
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
398
550
|
AccordionTrigger,
|
|
399
551
|
{
|
|
400
552
|
"data-slot": "menu-group-trigger",
|
|
401
553
|
className: cn(menuItemClass, "py-2 font-medium"),
|
|
402
554
|
disabled: menu.disabled,
|
|
403
555
|
title: menu.title,
|
|
404
|
-
children:
|
|
556
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "inline-flex items-center gap-2", children: [
|
|
557
|
+
menu.icon ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: menu.icon, size: "sm" }) : null,
|
|
558
|
+
menu.title
|
|
559
|
+
] })
|
|
405
560
|
}
|
|
406
561
|
),
|
|
407
|
-
/* @__PURE__ */ (0,
|
|
562
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(AccordionContent, { "data-slot": "menu-group-content", className: "pb-1", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex flex-col gap-0.5 pl-3", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
408
563
|
MenuTree,
|
|
409
564
|
{
|
|
410
565
|
menus: menu.children ?? [],
|
|
@@ -419,7 +574,7 @@ function MenuTree({
|
|
|
419
574
|
menu.id
|
|
420
575
|
);
|
|
421
576
|
}
|
|
422
|
-
return /* @__PURE__ */ (0,
|
|
577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
423
578
|
"button",
|
|
424
579
|
{
|
|
425
580
|
type: "button",
|
|
@@ -432,7 +587,10 @@ function MenuTree({
|
|
|
432
587
|
disabled: menu.disabled,
|
|
433
588
|
title: menu.title,
|
|
434
589
|
onClick: () => navigateMenuItem(registry.findById(menu.id), bridge),
|
|
435
|
-
children:
|
|
590
|
+
children: [
|
|
591
|
+
menu.icon ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { name: menu.icon, size: "sm" }) : null,
|
|
592
|
+
menu.title
|
|
593
|
+
]
|
|
436
594
|
},
|
|
437
595
|
menu.id
|
|
438
596
|
);
|
|
@@ -525,7 +683,7 @@ function ShadcnAdminLayout({
|
|
|
525
683
|
};
|
|
526
684
|
const fixedHeader = config.fixedHeader ?? true;
|
|
527
685
|
const fixedSider = config.fixedSider ?? true;
|
|
528
|
-
const header = showHeader ? /* @__PURE__ */ (0,
|
|
686
|
+
const header = showHeader ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
529
687
|
"header",
|
|
530
688
|
{
|
|
531
689
|
"data-slot": "admin-header",
|
|
@@ -534,21 +692,21 @@ function ShadcnAdminLayout({
|
|
|
534
692
|
fixedHeader && "sticky top-0 z-20"
|
|
535
693
|
),
|
|
536
694
|
children: [
|
|
537
|
-
mode !== "side-full" && /* @__PURE__ */ (0,
|
|
695
|
+
mode !== "side-full" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
538
696
|
brand.logo,
|
|
539
|
-
/* @__PURE__ */ (0,
|
|
697
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "data-slot": "admin-brand", className: "text-lg font-semibold", children: brand.title })
|
|
540
698
|
] }),
|
|
541
|
-
/* @__PURE__ */ (0,
|
|
699
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-1" }),
|
|
542
700
|
headerExtra
|
|
543
701
|
]
|
|
544
702
|
}
|
|
545
703
|
) : null;
|
|
546
|
-
const primaryColumn = /* @__PURE__ */ (0,
|
|
704
|
+
const primaryColumn = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
547
705
|
"div",
|
|
548
706
|
{
|
|
549
707
|
"data-slot": "admin-primary-col",
|
|
550
708
|
className: "flex w-12 shrink-0 flex-col items-center gap-1 border-r border-border py-2",
|
|
551
|
-
children: visibleMenus.map((menu) => /* @__PURE__ */ (0,
|
|
709
|
+
children: visibleMenus.map((menu) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
552
710
|
"button",
|
|
553
711
|
{
|
|
554
712
|
type: "button",
|
|
@@ -575,7 +733,7 @@ function ShadcnAdminLayout({
|
|
|
575
733
|
}
|
|
576
734
|
);
|
|
577
735
|
const showTrigger = config.collapsible && mode !== "two-column";
|
|
578
|
-
const sidebar = showSidebar ? /* @__PURE__ */ (0,
|
|
736
|
+
const sidebar = showSidebar ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
579
737
|
"aside",
|
|
580
738
|
{
|
|
581
739
|
"data-slot": "admin-sidebar",
|
|
@@ -587,20 +745,20 @@ function ShadcnAdminLayout({
|
|
|
587
745
|
),
|
|
588
746
|
style: mode === "two-column" && !hasSecondary ? { width: 56 } : void 0,
|
|
589
747
|
children: [
|
|
590
|
-
mode === "side-full" && /* @__PURE__ */ (0,
|
|
748
|
+
mode === "side-full" && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
591
749
|
"div",
|
|
592
750
|
{
|
|
593
751
|
"data-slot": "admin-sidebar-brand",
|
|
594
752
|
className: "flex items-center gap-2 border-b border-border px-4 py-4 font-semibold",
|
|
595
753
|
children: [
|
|
596
754
|
brand.logo,
|
|
597
|
-
/* @__PURE__ */ (0,
|
|
755
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: brand.title })
|
|
598
756
|
]
|
|
599
757
|
}
|
|
600
758
|
),
|
|
601
|
-
mode === "two-column" ? /* @__PURE__ */ (0,
|
|
759
|
+
mode === "two-column" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { "data-slot": "admin-two-col", className: "flex h-full", children: [
|
|
602
760
|
primaryColumn,
|
|
603
|
-
hasSecondary && /* @__PURE__ */ (0,
|
|
761
|
+
hasSecondary && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { "data-slot": "admin-secondary-col", className: "min-w-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
604
762
|
MenuTree,
|
|
605
763
|
{
|
|
606
764
|
menus: secondaryTop?.children ?? [],
|
|
@@ -610,7 +768,7 @@ function ShadcnAdminLayout({
|
|
|
610
768
|
defaultOpenKeys
|
|
611
769
|
}
|
|
612
770
|
) })
|
|
613
|
-
] }) : /* @__PURE__ */ (0,
|
|
771
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
614
772
|
MenuTree,
|
|
615
773
|
{
|
|
616
774
|
menus: visibleMenus,
|
|
@@ -621,7 +779,7 @@ function ShadcnAdminLayout({
|
|
|
621
779
|
collapsed: effectiveCollapsed
|
|
622
780
|
}
|
|
623
781
|
),
|
|
624
|
-
showTrigger && /* @__PURE__ */ (0,
|
|
782
|
+
showTrigger && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
625
783
|
"button",
|
|
626
784
|
{
|
|
627
785
|
type: "button",
|
|
@@ -636,14 +794,14 @@ function ShadcnAdminLayout({
|
|
|
636
794
|
]
|
|
637
795
|
}
|
|
638
796
|
) : null;
|
|
639
|
-
const body = /* @__PURE__ */ (0,
|
|
640
|
-
showTabs && /* @__PURE__ */ (0,
|
|
797
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { "data-slot": "admin-body", className: "flex min-w-0 flex-1 flex-col", children: [
|
|
798
|
+
showTabs && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
641
799
|
"div",
|
|
642
800
|
{
|
|
643
801
|
"data-slot": "admin-tabs",
|
|
644
802
|
role: "tablist",
|
|
645
803
|
className: "flex items-center gap-1 border-b border-border bg-background px-4 pt-2",
|
|
646
|
-
children: tabs.map((tab, index) => /* @__PURE__ */ (0,
|
|
804
|
+
children: tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
647
805
|
"div",
|
|
648
806
|
{
|
|
649
807
|
"data-slot": "admin-tab",
|
|
@@ -654,7 +812,7 @@ function ShadcnAdminLayout({
|
|
|
654
812
|
tab.key === currentPath ? "bg-background font-medium text-foreground" : "bg-muted text-muted-foreground"
|
|
655
813
|
),
|
|
656
814
|
children: [
|
|
657
|
-
/* @__PURE__ */ (0,
|
|
815
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
658
816
|
"button",
|
|
659
817
|
{
|
|
660
818
|
type: "button",
|
|
@@ -665,7 +823,7 @@ function ShadcnAdminLayout({
|
|
|
665
823
|
children: tab.title
|
|
666
824
|
}
|
|
667
825
|
),
|
|
668
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
826
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
669
827
|
"button",
|
|
670
828
|
{
|
|
671
829
|
type: "button",
|
|
@@ -682,21 +840,21 @@ function ShadcnAdminLayout({
|
|
|
682
840
|
))
|
|
683
841
|
}
|
|
684
842
|
),
|
|
685
|
-
/* @__PURE__ */ (0,
|
|
843
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
686
844
|
"main",
|
|
687
845
|
{
|
|
688
846
|
"data-slot": "admin-content",
|
|
689
847
|
className: "flex-1 bg-muted/40 p-6",
|
|
690
848
|
children: [
|
|
691
|
-
showBreadcrumb && breadcrumbItems.length > 0 && /* @__PURE__ */ (0,
|
|
849
|
+
showBreadcrumb && breadcrumbItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
692
850
|
"nav",
|
|
693
851
|
{
|
|
694
852
|
"data-slot": "admin-breadcrumb",
|
|
695
853
|
"aria-label": t("pactor.layout.breadcrumb"),
|
|
696
854
|
className: "mb-4",
|
|
697
|
-
children: /* @__PURE__ */ (0,
|
|
698
|
-
index > 0 && /* @__PURE__ */ (0,
|
|
699
|
-
/* @__PURE__ */ (0,
|
|
855
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("ol", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: breadcrumbItems.map((title, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("li", { className: "flex items-center gap-2", children: [
|
|
856
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": true, children: "/" }),
|
|
857
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "data-slot": "breadcrumb-link", children: title })
|
|
700
858
|
] }, index)) })
|
|
701
859
|
}
|
|
702
860
|
),
|
|
@@ -705,7 +863,7 @@ function ShadcnAdminLayout({
|
|
|
705
863
|
}
|
|
706
864
|
)
|
|
707
865
|
] });
|
|
708
|
-
const footer = showFooter ? /* @__PURE__ */ (0,
|
|
866
|
+
const footer = showFooter ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
709
867
|
"footer",
|
|
710
868
|
{
|
|
711
869
|
"data-slot": "admin-footer",
|
|
@@ -713,7 +871,7 @@ function ShadcnAdminLayout({
|
|
|
713
871
|
children: brand.title
|
|
714
872
|
}
|
|
715
873
|
) : null;
|
|
716
|
-
return /* @__PURE__ */ (0,
|
|
874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
717
875
|
"div",
|
|
718
876
|
{
|
|
719
877
|
"data-slot": "admin-layout",
|
|
@@ -721,9 +879,9 @@ function ShadcnAdminLayout({
|
|
|
721
879
|
"data-fixed-header": fixedHeader || void 0,
|
|
722
880
|
"data-fixed-sider": fixedSider || void 0,
|
|
723
881
|
className: "flex min-h-screen flex-col bg-background text-foreground",
|
|
724
|
-
children: mode === "side-full" ? /* @__PURE__ */ (0,
|
|
882
|
+
children: mode === "side-full" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { "data-slot": "admin-side-full", className: "flex min-h-screen flex-1", children: [
|
|
725
883
|
sidebar,
|
|
726
|
-
/* @__PURE__ */ (0,
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
727
885
|
"div",
|
|
728
886
|
{
|
|
729
887
|
"data-slot": "admin-side-full-main",
|
|
@@ -735,9 +893,9 @@ function ShadcnAdminLayout({
|
|
|
735
893
|
]
|
|
736
894
|
}
|
|
737
895
|
)
|
|
738
|
-
] }) : /* @__PURE__ */ (0,
|
|
896
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
739
897
|
header,
|
|
740
|
-
/* @__PURE__ */ (0,
|
|
898
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { "data-slot": "admin-main", className: "flex min-h-0 flex-1", children: [
|
|
741
899
|
sidebar,
|
|
742
900
|
body
|
|
743
901
|
] }),
|
|
@@ -748,9 +906,9 @@ function ShadcnAdminLayout({
|
|
|
748
906
|
}
|
|
749
907
|
|
|
750
908
|
// src/layout/basic/ShadcnBlankLayout.tsx
|
|
751
|
-
var
|
|
909
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
752
910
|
function ShadcnBlankLayout({ children }) {
|
|
753
|
-
return /* @__PURE__ */ (0,
|
|
911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
754
912
|
"div",
|
|
755
913
|
{
|
|
756
914
|
"data-slot": "blank-layout",
|
|
@@ -761,9 +919,9 @@ function ShadcnBlankLayout({ children }) {
|
|
|
761
919
|
}
|
|
762
920
|
|
|
763
921
|
// src/ui/card.tsx
|
|
764
|
-
var
|
|
922
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
765
923
|
function Card({ className, ...props }) {
|
|
766
|
-
return /* @__PURE__ */ (0,
|
|
924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
767
925
|
"div",
|
|
768
926
|
{
|
|
769
927
|
"data-slot": "card",
|
|
@@ -776,7 +934,7 @@ function Card({ className, ...props }) {
|
|
|
776
934
|
);
|
|
777
935
|
}
|
|
778
936
|
function CardHeader({ className, ...props }) {
|
|
779
|
-
return /* @__PURE__ */ (0,
|
|
937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
780
938
|
"div",
|
|
781
939
|
{
|
|
782
940
|
"data-slot": "card-header",
|
|
@@ -789,7 +947,7 @@ function CardHeader({ className, ...props }) {
|
|
|
789
947
|
);
|
|
790
948
|
}
|
|
791
949
|
function CardTitle({ className, ...props }) {
|
|
792
|
-
return /* @__PURE__ */ (0,
|
|
950
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
793
951
|
"div",
|
|
794
952
|
{
|
|
795
953
|
"data-slot": "card-title",
|
|
@@ -799,7 +957,7 @@ function CardTitle({ className, ...props }) {
|
|
|
799
957
|
);
|
|
800
958
|
}
|
|
801
959
|
function CardContent({ className, ...props }) {
|
|
802
|
-
return /* @__PURE__ */ (0,
|
|
960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
803
961
|
"div",
|
|
804
962
|
{
|
|
805
963
|
"data-slot": "card-content",
|
|
@@ -810,26 +968,26 @@ function CardContent({ className, ...props }) {
|
|
|
810
968
|
}
|
|
811
969
|
|
|
812
970
|
// src/layout/basic/ShadcnLoginLayout.tsx
|
|
813
|
-
var
|
|
971
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
814
972
|
function ShadcnLoginLayout({
|
|
815
973
|
variant = "center",
|
|
816
974
|
brand,
|
|
817
975
|
children
|
|
818
976
|
}) {
|
|
819
|
-
const brandBlock = /* @__PURE__ */ (0,
|
|
977
|
+
const brandBlock = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { "data-slot": "login-brand", className: "flex flex-col items-center gap-2", children: [
|
|
820
978
|
brand.logo,
|
|
821
|
-
/* @__PURE__ */ (0,
|
|
822
|
-
brand.description !== void 0 && /* @__PURE__ */ (0,
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "text-xl font-semibold", children: brand.title }),
|
|
980
|
+
brand.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-sm text-muted-foreground", children: brand.description })
|
|
823
981
|
] });
|
|
824
982
|
if (variant === "split") {
|
|
825
|
-
return /* @__PURE__ */ (0,
|
|
983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
826
984
|
"div",
|
|
827
985
|
{
|
|
828
986
|
"data-slot": "login-layout",
|
|
829
987
|
"data-variant": "split",
|
|
830
988
|
className: "grid min-h-screen grid-cols-2 bg-background text-foreground",
|
|
831
989
|
children: [
|
|
832
|
-
/* @__PURE__ */ (0,
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
833
991
|
"div",
|
|
834
992
|
{
|
|
835
993
|
"data-slot": "login-brand-panel",
|
|
@@ -837,7 +995,7 @@ function ShadcnLoginLayout({
|
|
|
837
995
|
children: brandBlock
|
|
838
996
|
}
|
|
839
997
|
),
|
|
840
|
-
/* @__PURE__ */ (0,
|
|
998
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
841
999
|
"div",
|
|
842
1000
|
{
|
|
843
1001
|
"data-slot": "login-form-panel",
|
|
@@ -849,37 +1007,37 @@ function ShadcnLoginLayout({
|
|
|
849
1007
|
}
|
|
850
1008
|
);
|
|
851
1009
|
}
|
|
852
|
-
return /* @__PURE__ */ (0,
|
|
1010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
853
1011
|
"div",
|
|
854
1012
|
{
|
|
855
1013
|
"data-slot": "login-layout",
|
|
856
1014
|
"data-variant": "center",
|
|
857
1015
|
className: "flex min-h-screen items-center justify-center bg-muted/40 text-foreground",
|
|
858
|
-
children: /* @__PURE__ */ (0,
|
|
859
|
-
/* @__PURE__ */ (0,
|
|
860
|
-
/* @__PURE__ */ (0,
|
|
1016
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Card, { "data-slot": "login-card", className: "w-full max-w-sm gap-4 py-6", children: [
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(CardHeader, { className: "px-6", children: [
|
|
1018
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardTitle, { className: "sr-only", children: brand.title }),
|
|
861
1019
|
brandBlock
|
|
862
1020
|
] }),
|
|
863
|
-
/* @__PURE__ */ (0,
|
|
1021
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CardContent, { className: "flex flex-col gap-4 px-6", children })
|
|
864
1022
|
] })
|
|
865
1023
|
}
|
|
866
1024
|
);
|
|
867
1025
|
}
|
|
868
1026
|
|
|
869
1027
|
// src/layout/basic/ShadcnLandingLayout.tsx
|
|
870
|
-
var
|
|
1028
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
871
1029
|
function ShadcnLandingLayout({
|
|
872
1030
|
navbar,
|
|
873
1031
|
footer,
|
|
874
1032
|
children
|
|
875
1033
|
}) {
|
|
876
|
-
return /* @__PURE__ */ (0,
|
|
1034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
877
1035
|
"div",
|
|
878
1036
|
{
|
|
879
1037
|
"data-slot": "landing-layout",
|
|
880
1038
|
className: "flex min-h-screen flex-col bg-background text-foreground",
|
|
881
1039
|
children: [
|
|
882
|
-
navbar !== void 0 && /* @__PURE__ */ (0,
|
|
1040
|
+
navbar !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
883
1041
|
"header",
|
|
884
1042
|
{
|
|
885
1043
|
"data-slot": "landing-navbar",
|
|
@@ -887,8 +1045,8 @@ function ShadcnLandingLayout({
|
|
|
887
1045
|
children: navbar
|
|
888
1046
|
}
|
|
889
1047
|
),
|
|
890
|
-
/* @__PURE__ */ (0,
|
|
891
|
-
footer !== void 0 && /* @__PURE__ */ (0,
|
|
1048
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("main", { "data-slot": "landing-content", className: "flex-1", children }),
|
|
1049
|
+
footer !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
892
1050
|
"footer",
|
|
893
1051
|
{
|
|
894
1052
|
"data-slot": "landing-footer",
|
package/dist/layout/index.js
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
findMenuChain,
|
|
9
9
|
registerShadcnLayouts,
|
|
10
10
|
resolveLayout
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-GV5R6TUT.js";
|
|
12
|
+
import "../chunk-6JNCDPGS.js";
|
|
13
|
+
import "../chunk-GL7IO22L.js";
|
|
14
14
|
import "../chunk-RQHJBTEU.js";
|
|
15
15
|
export {
|
|
16
16
|
ShadcnAdminLayout,
|