@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
package/dist/index.js
CHANGED
|
@@ -261,6 +261,8 @@ function AppShell({
|
|
|
261
261
|
defaultCollapsed = false,
|
|
262
262
|
sidebarFooter,
|
|
263
263
|
banner,
|
|
264
|
+
sidebarClassName,
|
|
265
|
+
headerClassName,
|
|
264
266
|
children
|
|
265
267
|
}) {
|
|
266
268
|
const [collapsed, setCollapsed] = useState3(defaultCollapsed);
|
|
@@ -281,18 +283,21 @@ function AppShell({
|
|
|
281
283
|
/* @__PURE__ */ jsxs3(
|
|
282
284
|
"aside",
|
|
283
285
|
{
|
|
286
|
+
"data-slot": "sidebar",
|
|
284
287
|
className: cn(
|
|
285
288
|
"hidden shrink-0 flex-col border-r bg-card transition-all duration-300 md:flex",
|
|
286
|
-
collapsed ? "w-16" : "w-60"
|
|
289
|
+
collapsed ? "w-16" : "w-60",
|
|
290
|
+
sidebarClassName
|
|
287
291
|
),
|
|
288
292
|
children: [
|
|
289
|
-
/* @__PURE__ */ jsx4("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
290
|
-
/* @__PURE__ */ jsx4("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(collapsed) }),
|
|
291
|
-
sidebarFooter && /* @__PURE__ */ jsx4("div", { className: "border-t px-3 py-2", "data-slot": "sidebar-footer", children: typeof sidebarFooter === "function" ? sidebarFooter(collapsed) : sidebarFooter }),
|
|
292
|
-
collapsible && /* @__PURE__ */ jsx4("div", { className: "border-t p-2", children: /* @__PURE__ */ jsx4(
|
|
293
|
+
/* @__PURE__ */ jsx4("div", { className: "flex h-14 shrink-0 items-center border-b border-inherit px-4", "data-slot": "sidebar-brand", children: collapsed ? brandCollapsed ?? brand : brand }),
|
|
294
|
+
/* @__PURE__ */ jsx4("div", { className: "flex-1 overflow-y-auto px-2 py-4", "data-slot": "sidebar-content", children: nav(collapsed) }),
|
|
295
|
+
sidebarFooter && /* @__PURE__ */ jsx4("div", { className: "border-t border-inherit px-3 py-2", "data-slot": "sidebar-footer", children: typeof sidebarFooter === "function" ? sidebarFooter(collapsed) : sidebarFooter }),
|
|
296
|
+
collapsible && /* @__PURE__ */ jsx4("div", { className: "border-t border-inherit p-2", children: /* @__PURE__ */ jsx4(
|
|
293
297
|
"button",
|
|
294
298
|
{
|
|
295
299
|
type: "button",
|
|
300
|
+
"data-slot": "sidebar-toggle",
|
|
296
301
|
onClick: () => setCollapsed((v) => !v),
|
|
297
302
|
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",
|
|
298
303
|
"aria-label": collapsed ? "Expandir menu" : "Recolher menu",
|
|
@@ -315,14 +320,16 @@ function AppShell({
|
|
|
315
320
|
/* @__PURE__ */ jsxs3(
|
|
316
321
|
"div",
|
|
317
322
|
{
|
|
323
|
+
"data-slot": "sidebar-drawer",
|
|
318
324
|
className: cn(
|
|
319
325
|
"absolute left-0 top-0 flex h-full w-64 flex-col border-r bg-card transition-transform duration-300",
|
|
320
|
-
mobileOpen ? "translate-x-0" : "-translate-x-full"
|
|
326
|
+
mobileOpen ? "translate-x-0" : "-translate-x-full",
|
|
327
|
+
sidebarClassName
|
|
321
328
|
),
|
|
322
329
|
onClick: (e) => e.stopPropagation(),
|
|
323
330
|
children: [
|
|
324
|
-
/* @__PURE__ */ jsx4("div", { className: "flex h-14 shrink-0 items-center border-b px-4", children: brand }),
|
|
325
|
-
/* @__PURE__ */ jsx4("div", { className: "flex-1 overflow-y-auto px-2 py-4", children: nav(false, () => setMobileOpen(false)) })
|
|
331
|
+
/* @__PURE__ */ jsx4("div", { className: "flex h-14 shrink-0 items-center border-b border-inherit px-4", "data-slot": "sidebar-brand", children: brand }),
|
|
332
|
+
/* @__PURE__ */ jsx4("div", { className: "flex-1 overflow-y-auto px-2 py-4", "data-slot": "sidebar-content", children: nav(false, () => setMobileOpen(false)) })
|
|
326
333
|
]
|
|
327
334
|
}
|
|
328
335
|
)
|
|
@@ -331,22 +338,29 @@ function AppShell({
|
|
|
331
338
|
),
|
|
332
339
|
/* @__PURE__ */ jsxs3("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
|
|
333
340
|
banner,
|
|
334
|
-
/* @__PURE__ */ jsxs3(
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
341
|
+
/* @__PURE__ */ jsxs3(
|
|
342
|
+
"header",
|
|
343
|
+
{
|
|
344
|
+
"data-slot": "header",
|
|
345
|
+
className: cn("flex h-14 shrink-0 items-center gap-2 border-b bg-background px-4", headerClassName),
|
|
346
|
+
children: [
|
|
347
|
+
/* @__PURE__ */ jsx4(
|
|
348
|
+
"button",
|
|
349
|
+
{
|
|
350
|
+
type: "button",
|
|
351
|
+
onClick: () => setMobileOpen(true),
|
|
352
|
+
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",
|
|
353
|
+
"aria-label": "Abrir menu",
|
|
354
|
+
children: /* @__PURE__ */ jsx4(Menu, { className: "h-4 w-4" })
|
|
355
|
+
}
|
|
356
|
+
),
|
|
357
|
+
/* @__PURE__ */ jsxs3("div", { className: "ml-auto flex items-center gap-2", children: [
|
|
358
|
+
headerActions,
|
|
359
|
+
(user || onLogout) && /* @__PURE__ */ jsx4(UserMenu, { user, items: userMenuItems, onLogout, renderLink })
|
|
360
|
+
] })
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
),
|
|
350
364
|
/* @__PURE__ */ jsx4("main", { className: "flex-1 overflow-y-auto", children })
|
|
351
365
|
] })
|
|
352
366
|
] });
|