@motor-hero/ui-kit 0.48.1 → 0.49.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/components/app-shell.d.ts +9 -1
- package/dist/components/app-shell.d.ts.map +1 -1
- package/dist/index.cjs +38 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/app-shell.tsx +31 -7
|
@@ -24,7 +24,15 @@ export interface AppShellProps {
|
|
|
24
24
|
sidebarFooter?: ReactNode | ((collapsed: boolean) => ReactNode);
|
|
25
25
|
/** Above the header, full width of the content column — `UpdateBanner` goes here. */
|
|
26
26
|
banner?: ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Merged into the sidebar (desktop and mobile drawer), e.g.
|
|
29
|
+
* `bg-sidebar text-sidebar-foreground border-sidebar-border`. Inner dividers
|
|
30
|
+
* follow the sidebar's border color.
|
|
31
|
+
*/
|
|
32
|
+
sidebarClassName?: string;
|
|
33
|
+
/** Merged into the top header bar. */
|
|
34
|
+
headerClassName?: string;
|
|
27
35
|
children: ReactNode;
|
|
28
36
|
}
|
|
29
|
-
export declare function AppShell({ brand, brandCollapsed, navItems, activePath, isActive, isAdmin, user, userMenuItems, onLogout, renderLink, headerActions, collapsible, defaultCollapsed, sidebarFooter, banner, children, }: AppShellProps): import("react").JSX.Element;
|
|
37
|
+
export declare function AppShell({ brand, brandCollapsed, navItems, activePath, isActive, isAdmin, user, userMenuItems, onLogout, renderLink, headerActions, collapsible, defaultCollapsed, sidebarFooter, banner, sidebarClassName, headerClassName, children, }: AppShellProps): import("react").JSX.Element;
|
|
30
38
|
//# sourceMappingURL=app-shell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell.d.ts","sourceRoot":"","sources":["../../src/components/app-shell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAY,MAAM,OAAO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,aAAa,EACb,QAAQ,EACR,UAA8B,EAC9B,aAAa,EACb,WAAkB,EAClB,gBAAwB,EACxB,aAAa,EACb,MAAM,EACN,gBAAgB,EAChB,eAAe,EACf,QAAQ,GACT,EAAE,aAAa,+BA0Gf"}
|
package/dist/index.cjs
CHANGED
|
@@ -345,6 +345,8 @@ function AppShell({
|
|
|
345
345
|
defaultCollapsed = false,
|
|
346
346
|
sidebarFooter,
|
|
347
347
|
banner,
|
|
348
|
+
sidebarClassName,
|
|
349
|
+
headerClassName,
|
|
348
350
|
children
|
|
349
351
|
}) {
|
|
350
352
|
const [collapsed, setCollapsed] = (0, import_react3.useState)(defaultCollapsed);
|
|
@@ -365,18 +367,21 @@ function AppShell({
|
|
|
365
367
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
366
368
|
"aside",
|
|
367
369
|
{
|
|
370
|
+
"data-slot": "sidebar",
|
|
368
371
|
className: cn(
|
|
369
372
|
"hidden shrink-0 flex-col border-r bg-card transition-all duration-300 md:flex",
|
|
370
|
-
collapsed ? "w-16" : "w-60"
|
|
373
|
+
collapsed ? "w-16" : "w-60",
|
|
374
|
+
sidebarClassName
|
|
371
375
|
),
|
|
372
376
|
children: [
|
|
373
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
374
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(collapsed) }),
|
|
375
|
-
sidebarFooter && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-t px-3 py-2", "data-slot": "sidebar-footer", children: typeof sidebarFooter === "function" ? sidebarFooter(collapsed) : sidebarFooter }),
|
|
376
|
-
collapsible && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-t p-2", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
377
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b border-inherit px-4", "data-slot": "sidebar-brand", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
378
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", "data-slot": "sidebar-content", children: nav(collapsed) }),
|
|
379
|
+
sidebarFooter && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-t border-inherit px-3 py-2", "data-slot": "sidebar-footer", children: typeof sidebarFooter === "function" ? sidebarFooter(collapsed) : sidebarFooter }),
|
|
380
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-t border-inherit p-2", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
377
381
|
"button",
|
|
378
382
|
{
|
|
379
383
|
type: "button",
|
|
384
|
+
"data-slot": "sidebar-toggle",
|
|
380
385
|
onClick: () => setCollapsed((v) => !v),
|
|
381
386
|
className: "flex w-full items-center justify-center rounded-md px-2 py-2 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
382
387
|
"aria-label": collapsed ? "Expandir menu" : "Recolher menu",
|
|
@@ -399,14 +404,16 @@ function AppShell({
|
|
|
399
404
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
400
405
|
"div",
|
|
401
406
|
{
|
|
407
|
+
"data-slot": "sidebar-drawer",
|
|
402
408
|
className: cn(
|
|
403
409
|
"absolute left-0 top-0 flex h-full w-64 flex-col border-r bg-card transition-transform duration-300",
|
|
404
|
-
mobileOpen ? "translate-x-0" : "-translate-x-full"
|
|
410
|
+
mobileOpen ? "translate-x-0" : "-translate-x-full",
|
|
411
|
+
sidebarClassName
|
|
405
412
|
),
|
|
406
413
|
onClick: (e) => e.stopPropagation(),
|
|
407
414
|
children: [
|
|
408
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: brand }),
|
|
409
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(false, () => setMobileOpen(false)) })
|
|
415
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex h-14 shrink-0 items-center border-b border-inherit px-4", "data-slot": "sidebar-brand", children: brand }),
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex-1 overflow-y-auto px-2 py-4", "data-slot": "sidebar-content", children: nav(false, () => setMobileOpen(false)) })
|
|
410
417
|
]
|
|
411
418
|
}
|
|
412
419
|
)
|
|
@@ -415,22 +422,29 @@ function AppShell({
|
|
|
415
422
|
),
|
|
416
423
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
417
424
|
banner,
|
|
418
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
425
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
426
|
+
"header",
|
|
427
|
+
{
|
|
428
|
+
"data-slot": "header",
|
|
429
|
+
className: cn("flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4", headerClassName),
|
|
430
|
+
children: [
|
|
431
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
432
|
+
"button",
|
|
433
|
+
{
|
|
434
|
+
type: "button",
|
|
435
|
+
onClick: () => setMobileOpen(true),
|
|
436
|
+
className: "inline-flex h-9 w-9 max-sm:h-10 max-sm:w-10 items-center justify-center rounded-md border border-input bg-background shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground md:hidden",
|
|
437
|
+
"aria-label": "Abrir menu",
|
|
438
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react2.Menu, { className: "h-4 w-4" })
|
|
439
|
+
}
|
|
440
|
+
),
|
|
441
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
442
|
+
headerActions,
|
|
443
|
+
(user || onLogout) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(UserMenu, { user, items: userMenuItems, onLogout, renderLink })
|
|
444
|
+
] })
|
|
445
|
+
]
|
|
446
|
+
}
|
|
447
|
+
),
|
|
434
448
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("main", { className: "flex-1 overflow-y-auto", children })
|
|
435
449
|
] })
|
|
436
450
|
] });
|