@marcoschwartz/lite-ui 0.23.5 → 0.24.1
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/index.d.mts +68 -14
- package/dist/index.d.ts +68 -14
- package/dist/index.js +290 -133
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +292 -137
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
Alert: () => Alert,
|
|
36
36
|
AlertCircleIcon: () => AlertCircleIcon,
|
|
37
37
|
AppShell: () => AppShell,
|
|
38
|
+
AppShellSection: () => AppShellSection,
|
|
38
39
|
AppleIcon: () => AppleIcon,
|
|
39
40
|
AreaChart: () => AreaChart,
|
|
40
41
|
ArrowDownIcon: () => ArrowDownIcon,
|
|
@@ -155,6 +156,7 @@ __export(index_exports, {
|
|
|
155
156
|
themeScript: () => themeScript,
|
|
156
157
|
themes: () => themes,
|
|
157
158
|
toast: () => toast,
|
|
159
|
+
useAppShell: () => useAppShell,
|
|
158
160
|
useSidebar: () => useSidebar,
|
|
159
161
|
useTheme: () => useTheme,
|
|
160
162
|
useToast: () => useToast,
|
|
@@ -1248,172 +1250,321 @@ var SlackIcon = createIcon(
|
|
|
1248
1250
|
|
|
1249
1251
|
// src/components/AppShell.tsx
|
|
1250
1252
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
1253
|
+
var AppShellContext = (0, import_react5.createContext)(null);
|
|
1254
|
+
var useAppShell = () => {
|
|
1255
|
+
const context = (0, import_react5.useContext)(AppShellContext);
|
|
1256
|
+
if (!context) {
|
|
1257
|
+
throw new Error("useAppShell must be used within AppShell");
|
|
1258
|
+
}
|
|
1259
|
+
return context;
|
|
1260
|
+
};
|
|
1261
|
+
var heightClasses = {
|
|
1262
|
+
sm: "h-12",
|
|
1263
|
+
// 48px
|
|
1264
|
+
md: "h-16",
|
|
1265
|
+
// 64px
|
|
1266
|
+
lg: "h-20"
|
|
1267
|
+
// 80px
|
|
1268
|
+
};
|
|
1251
1269
|
var widthClasses2 = {
|
|
1252
1270
|
sm: "w-48",
|
|
1271
|
+
// 192px
|
|
1253
1272
|
md: "w-64",
|
|
1273
|
+
// 256px
|
|
1254
1274
|
lg: "w-80"
|
|
1275
|
+
// 320px
|
|
1255
1276
|
};
|
|
1256
|
-
var
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1277
|
+
var paddingClasses = {
|
|
1278
|
+
none: "p-0",
|
|
1279
|
+
sm: "p-2",
|
|
1280
|
+
md: "p-4",
|
|
1281
|
+
lg: "p-6"
|
|
1261
1282
|
};
|
|
1262
|
-
var getVariantClasses = (variant) => {
|
|
1283
|
+
var getVariantClasses = (variant, withBorder = true) => {
|
|
1284
|
+
const borderClass = withBorder ? "border-[hsl(var(--border))]" : "border-transparent";
|
|
1263
1285
|
switch (variant) {
|
|
1264
1286
|
case "glass":
|
|
1265
|
-
return
|
|
1287
|
+
return `bg-[hsl(var(--background))]/80 backdrop-blur-xl ${borderClass}`;
|
|
1266
1288
|
case "transparent":
|
|
1267
|
-
return
|
|
1289
|
+
return `bg-transparent ${borderClass}`;
|
|
1268
1290
|
case "solid":
|
|
1269
1291
|
default:
|
|
1270
|
-
return
|
|
1292
|
+
return `bg-[hsl(var(--card))] ${borderClass}`;
|
|
1271
1293
|
}
|
|
1272
1294
|
};
|
|
1273
|
-
var
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
const [isMobileNavbarOpen, setIsMobileNavbarOpen] = (0, import_react5.useState)(defaultNavbarOpen);
|
|
1284
|
-
const navbarWidth = navbar?.width || "md";
|
|
1285
|
-
const navbarBreakpoint = navbar?.breakpoint || "md";
|
|
1286
|
-
const navbarPosition = navbar?.position || "side";
|
|
1287
|
-
const widthClass = widthClasses2[navbarWidth];
|
|
1288
|
-
const breakpoint = breakpointClasses[navbarBreakpoint];
|
|
1289
|
-
if (!responsive && navbar) {
|
|
1290
|
-
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `min-h-screen flex flex-col ${className}`, children: [
|
|
1291
|
-
header && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "w-full", children: header }),
|
|
1292
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-1", children: [
|
|
1293
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("aside", { className: `${widthClass} bg-[hsl(var(--card))] border-r border-[hsl(var(--border))] h-full overflow-y-auto`, children: navbar.content }),
|
|
1294
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("main", { className: "flex-1 overflow-y-auto", children })
|
|
1295
|
-
] })
|
|
1296
|
-
] });
|
|
1295
|
+
var getBreakpointHideClass = (breakpoint) => {
|
|
1296
|
+
switch (breakpoint) {
|
|
1297
|
+
case "sm":
|
|
1298
|
+
return "sm:hidden";
|
|
1299
|
+
case "md":
|
|
1300
|
+
return "md:hidden";
|
|
1301
|
+
case "lg":
|
|
1302
|
+
return "lg:hidden";
|
|
1303
|
+
case "xl":
|
|
1304
|
+
return "xl:hidden";
|
|
1297
1305
|
}
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1306
|
+
};
|
|
1307
|
+
var getBreakpointShowClass = (breakpoint) => {
|
|
1308
|
+
switch (breakpoint) {
|
|
1309
|
+
case "sm":
|
|
1310
|
+
return "hidden sm:flex";
|
|
1311
|
+
case "md":
|
|
1312
|
+
return "hidden md:flex";
|
|
1313
|
+
case "lg":
|
|
1314
|
+
return "hidden lg:flex";
|
|
1315
|
+
case "xl":
|
|
1316
|
+
return "hidden xl:flex";
|
|
1303
1317
|
}
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
)
|
|
1330
|
-
|
|
1331
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "p-4 border-b border-[hsl(var(--border))] flex items-center justify-between", children: [
|
|
1332
|
-
|
|
1318
|
+
};
|
|
1319
|
+
var MobileDrawer = ({
|
|
1320
|
+
isOpen,
|
|
1321
|
+
onClose,
|
|
1322
|
+
position,
|
|
1323
|
+
breakpoint,
|
|
1324
|
+
title,
|
|
1325
|
+
logo,
|
|
1326
|
+
children,
|
|
1327
|
+
headerContent
|
|
1328
|
+
}) => {
|
|
1329
|
+
if (!isOpen) return null;
|
|
1330
|
+
const hideClass = getBreakpointHideClass(breakpoint);
|
|
1331
|
+
const slideClass = position === "left" ? "left-0 animate-in slide-in-from-left" : "right-0 animate-in slide-in-from-right";
|
|
1332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1334
|
+
"div",
|
|
1335
|
+
{
|
|
1336
|
+
className: `${hideClass} fixed inset-0 z-40 bg-black/60 backdrop-blur-sm animate-in fade-in duration-200`,
|
|
1337
|
+
onClick: onClose
|
|
1338
|
+
}
|
|
1339
|
+
),
|
|
1340
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
1341
|
+
"div",
|
|
1342
|
+
{
|
|
1343
|
+
className: `${hideClass} fixed ${slideClass} top-0 bottom-0 z-50 w-72 bg-[hsl(var(--card))] shadow-2xl duration-300 flex flex-col`,
|
|
1344
|
+
children: [
|
|
1345
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "p-4 border-b border-[hsl(var(--border))] flex items-center justify-between shrink-0", children: [
|
|
1346
|
+
logo ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: logo }) : title ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: title }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", {}),
|
|
1333
1347
|
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1334
1348
|
"button",
|
|
1335
1349
|
{
|
|
1336
1350
|
className: "p-1 rounded hover:bg-[hsl(var(--accent))] transition-colors",
|
|
1337
|
-
onClick:
|
|
1351
|
+
onClick: onClose,
|
|
1338
1352
|
"aria-label": "Close menu",
|
|
1339
1353
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1340
1354
|
}
|
|
1341
1355
|
)
|
|
1342
1356
|
] }),
|
|
1343
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1344
|
-
|
|
1357
|
+
headerContent && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "p-3 border-b border-[hsl(var(--border))] shrink-0", children: headerContent }),
|
|
1358
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex-1 overflow-y-auto", onClick: onClose, children })
|
|
1359
|
+
]
|
|
1360
|
+
}
|
|
1361
|
+
)
|
|
1362
|
+
] });
|
|
1363
|
+
};
|
|
1364
|
+
var AppShell = ({
|
|
1365
|
+
children,
|
|
1366
|
+
header,
|
|
1367
|
+
navbar,
|
|
1368
|
+
aside,
|
|
1369
|
+
footer,
|
|
1370
|
+
logo,
|
|
1371
|
+
title,
|
|
1372
|
+
layout = "default",
|
|
1373
|
+
padding = "none",
|
|
1374
|
+
className = ""
|
|
1375
|
+
}) => {
|
|
1376
|
+
const [navbarOpen, setNavbarOpen] = (0, import_react5.useState)(false);
|
|
1377
|
+
const [asideOpen, setAsideOpen] = (0, import_react5.useState)(false);
|
|
1378
|
+
const navbarWidth = navbar?.width || "md";
|
|
1379
|
+
const navbarBreakpoint = navbar?.breakpoint || "md";
|
|
1380
|
+
const navbarCollapsedMobile = navbar?.collapsed?.mobile ?? false;
|
|
1381
|
+
const navbarCollapsedDesktop = navbar?.collapsed?.desktop ?? false;
|
|
1382
|
+
const navbarVariant = navbar?.variant || "solid";
|
|
1383
|
+
const navbarWithBorder = navbar?.withBorder ?? true;
|
|
1384
|
+
const asideWidth = aside?.width || "md";
|
|
1385
|
+
const asideBreakpoint = aside?.breakpoint || "md";
|
|
1386
|
+
const asideCollapsedMobile = aside?.collapsed?.mobile ?? true;
|
|
1387
|
+
const asideCollapsedDesktop = aside?.collapsed?.desktop ?? false;
|
|
1388
|
+
const asideVariant = aside?.variant || "solid";
|
|
1389
|
+
const asideWithBorder = aside?.withBorder ?? true;
|
|
1390
|
+
const headerHeight = header?.height || "md";
|
|
1391
|
+
const headerVariant = header?.variant || "solid";
|
|
1392
|
+
const headerWithBorder = header?.withBorder ?? true;
|
|
1393
|
+
const headerCollapsed = header?.collapsed ?? false;
|
|
1394
|
+
const headerMobileActions = header?.mobileActions;
|
|
1395
|
+
const footerHeight = footer?.height || "md";
|
|
1396
|
+
const footerVariant = footer?.variant || "solid";
|
|
1397
|
+
const footerWithBorder = footer?.withBorder ?? true;
|
|
1398
|
+
const footerCollapsed = footer?.collapsed ?? false;
|
|
1399
|
+
const showNavbarHamburger = navbar && !navbarCollapsedMobile;
|
|
1400
|
+
const showAsideHamburger = aside && !asideCollapsedMobile;
|
|
1401
|
+
const needsMobileHeader = showNavbarHamburger || showAsideHamburger;
|
|
1402
|
+
const mobileBreakpoint = navbarBreakpoint;
|
|
1403
|
+
const navbarDesktopShowClass = getBreakpointShowClass(navbarBreakpoint);
|
|
1404
|
+
const mobileHideClass = getBreakpointHideClass(mobileBreakpoint);
|
|
1405
|
+
const desktopShowClass = getBreakpointShowClass(mobileBreakpoint);
|
|
1406
|
+
const asideDesktopShowClass = getBreakpointShowClass(asideBreakpoint);
|
|
1407
|
+
const contextValue = {
|
|
1408
|
+
navbarOpen,
|
|
1409
|
+
setNavbarOpen,
|
|
1410
|
+
asideOpen,
|
|
1411
|
+
setAsideOpen
|
|
1412
|
+
};
|
|
1413
|
+
if (layout === "alt") {
|
|
1414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(AppShellContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `min-h-screen flex bg-[hsl(var(--background))] ${className}`, children: [
|
|
1415
|
+
navbar && !navbarCollapsedDesktop && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
1416
|
+
"aside",
|
|
1417
|
+
{
|
|
1418
|
+
className: `${navbarDesktopShowClass} ${widthClasses2[navbarWidth]} ${getVariantClasses(navbarVariant, navbarWithBorder)} ${navbarWithBorder ? "border-r" : ""} flex-col shrink-0`,
|
|
1419
|
+
children: [
|
|
1420
|
+
(logo || title) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: `${heightClasses[headerHeight]} px-4 flex items-center border-b border-[hsl(var(--border))] shrink-0`, children: logo || /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: title }) }),
|
|
1421
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("nav", { className: "flex-1 overflow-y-auto", children: navbar.content })
|
|
1422
|
+
]
|
|
1423
|
+
}
|
|
1424
|
+
),
|
|
1425
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex-1 flex flex-col min-w-0", children: [
|
|
1426
|
+
needsMobileHeader && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `${mobileHideClass} sticky top-0 z-30 ${heightClasses[headerHeight]} px-4 flex items-center justify-between ${getVariantClasses(headerVariant, headerWithBorder)} ${headerWithBorder ? "border-b" : ""}`, children: [
|
|
1427
|
+
showNavbarHamburger && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1428
|
+
"button",
|
|
1345
1429
|
{
|
|
1346
|
-
className: "p-
|
|
1347
|
-
onClick: () =>
|
|
1348
|
-
|
|
1430
|
+
className: "p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors shrink-0",
|
|
1431
|
+
onClick: () => setNavbarOpen(true),
|
|
1432
|
+
"aria-label": "Open navigation",
|
|
1433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(MenuIcon, { size: "md" })
|
|
1349
1434
|
}
|
|
1350
|
-
)
|
|
1351
|
-
|
|
1435
|
+
),
|
|
1436
|
+
(logo || title) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex-1 flex items-center justify-center min-w-0", children: logo || /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-lg font-bold text-[hsl(var(--foreground))] truncate", children: title }) }),
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
1438
|
+
headerMobileActions,
|
|
1439
|
+
showAsideHamburger && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1440
|
+
"button",
|
|
1441
|
+
{
|
|
1442
|
+
className: "p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors",
|
|
1443
|
+
onClick: () => setAsideOpen(true),
|
|
1444
|
+
"aria-label": "Open sidebar",
|
|
1445
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(MenuIcon, { size: "md" })
|
|
1446
|
+
}
|
|
1447
|
+
)
|
|
1448
|
+
] })
|
|
1449
|
+
] }),
|
|
1450
|
+
header && !headerCollapsed && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("header", { className: `${needsMobileHeader ? desktopShowClass : ""} sticky top-0 z-20 ${heightClasses[headerHeight]} ${getVariantClasses(headerVariant, headerWithBorder)} ${headerWithBorder ? "border-b" : ""} px-4 items-center shrink-0`, children: header.content }),
|
|
1451
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("main", { className: `flex-1 overflow-y-auto ${paddingClasses[padding]}`, children }),
|
|
1452
|
+
footer && !footerCollapsed && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("footer", { className: `${heightClasses[footerHeight]} ${getVariantClasses(footerVariant, footerWithBorder)} ${footerWithBorder ? "border-t" : ""} px-4 flex items-center shrink-0`, children: footer.content })
|
|
1352
1453
|
] }),
|
|
1353
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1354
|
-
|
|
1454
|
+
aside && !asideCollapsedDesktop && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1455
|
+
"aside",
|
|
1456
|
+
{
|
|
1457
|
+
className: `${asideDesktopShowClass} ${widthClasses2[asideWidth]} ${getVariantClasses(asideVariant, asideWithBorder)} ${asideWithBorder ? "border-l" : ""} flex-col shrink-0 overflow-y-auto`,
|
|
1458
|
+
children: aside.content
|
|
1459
|
+
}
|
|
1460
|
+
),
|
|
1461
|
+
navbar && !navbarCollapsedMobile && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1462
|
+
MobileDrawer,
|
|
1463
|
+
{
|
|
1464
|
+
isOpen: navbarOpen,
|
|
1465
|
+
onClose: () => setNavbarOpen(false),
|
|
1466
|
+
position: "left",
|
|
1467
|
+
breakpoint: navbarBreakpoint,
|
|
1468
|
+
title,
|
|
1469
|
+
logo,
|
|
1470
|
+
headerContent: header?.content,
|
|
1471
|
+
children: navbar.content
|
|
1472
|
+
}
|
|
1473
|
+
),
|
|
1474
|
+
aside && !asideCollapsedMobile && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1475
|
+
MobileDrawer,
|
|
1476
|
+
{
|
|
1477
|
+
isOpen: asideOpen,
|
|
1478
|
+
onClose: () => setAsideOpen(false),
|
|
1479
|
+
position: "right",
|
|
1480
|
+
breakpoint: asideBreakpoint,
|
|
1481
|
+
title: "Sidebar",
|
|
1482
|
+
children: aside.content
|
|
1483
|
+
}
|
|
1484
|
+
)
|
|
1485
|
+
] }) });
|
|
1355
1486
|
}
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(AppShellContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `min-h-screen flex flex-col bg-[hsl(var(--background))] ${className}`, children: [
|
|
1488
|
+
needsMobileHeader && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `${mobileHideClass} sticky top-0 z-30 ${heightClasses[headerHeight]} px-4 flex items-center justify-between ${getVariantClasses(headerVariant, headerWithBorder)} ${headerWithBorder ? "border-b" : ""}`, children: [
|
|
1489
|
+
showNavbarHamburger && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1490
|
+
"button",
|
|
1491
|
+
{
|
|
1492
|
+
className: "p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors shrink-0",
|
|
1493
|
+
onClick: () => setNavbarOpen(true),
|
|
1494
|
+
"aria-label": "Open navigation",
|
|
1495
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(MenuIcon, { size: "md" })
|
|
1496
|
+
}
|
|
1497
|
+
),
|
|
1498
|
+
(logo || title) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex-1 flex items-center justify-center min-w-0", children: logo || /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-lg font-bold text-[hsl(var(--foreground))] truncate", children: title }) }),
|
|
1499
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
1500
|
+
headerMobileActions,
|
|
1501
|
+
showAsideHamburger && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1365
1502
|
"button",
|
|
1366
1503
|
{
|
|
1367
1504
|
className: "p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors",
|
|
1368
|
-
onClick: () =>
|
|
1369
|
-
"aria-label": "
|
|
1505
|
+
onClick: () => setAsideOpen(true),
|
|
1506
|
+
"aria-label": "Open sidebar",
|
|
1370
1507
|
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(MenuIcon, { size: "md" })
|
|
1371
1508
|
}
|
|
1372
1509
|
)
|
|
1373
|
-
] }),
|
|
1374
|
-
header && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "w-full", children: header }),
|
|
1375
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-1 min-h-0", children: [
|
|
1376
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("aside", { className: `hidden ${desktopNavbarClass} ${sidebarWidthClass} ${navbar.variant === "glass" ? "bg-[hsl(var(--background))]/80 backdrop-blur-xl" : navbar.variant === "transparent" ? "bg-transparent" : "bg-[hsl(var(--card))] border-r border-[hsl(var(--border))]"} overflow-y-auto shrink-0`, children: navbar.content }),
|
|
1377
|
-
isMobileNavbarOpen && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
1378
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1379
|
-
"div",
|
|
1380
|
-
{
|
|
1381
|
-
className: `${mobileDrawerClass} fixed inset-0 z-40 bg-black/60 backdrop-blur-sm animate-in fade-in duration-200`,
|
|
1382
|
-
onClick: () => setIsMobileNavbarOpen(false)
|
|
1383
|
-
}
|
|
1384
|
-
),
|
|
1385
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `${mobileDrawerClass} fixed left-0 top-0 bottom-0 z-50 w-64 bg-[hsl(var(--card))] shadow-2xl animate-in slide-in-from-left duration-300`, children: [
|
|
1386
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "p-4 border-b border-[hsl(var(--border))] flex items-center justify-between", children: [
|
|
1387
|
-
navbarLogo ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { children: navbarLogo }) : navbarTitle ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: navbarTitle }) : null,
|
|
1388
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1389
|
-
"button",
|
|
1390
|
-
{
|
|
1391
|
-
className: "p-1 rounded hover:bg-[hsl(var(--accent))] transition-colors",
|
|
1392
|
-
onClick: () => setIsMobileNavbarOpen(false),
|
|
1393
|
-
"aria-label": "Close menu",
|
|
1394
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1395
|
-
}
|
|
1396
|
-
)
|
|
1397
|
-
] }),
|
|
1398
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1399
|
-
"div",
|
|
1400
|
-
{
|
|
1401
|
-
className: "overflow-y-auto h-[calc(100vh-73px)]",
|
|
1402
|
-
onClick: () => setIsMobileNavbarOpen(false),
|
|
1403
|
-
children: navbar.content
|
|
1404
|
-
}
|
|
1405
|
-
)
|
|
1406
|
-
] })
|
|
1407
|
-
] }),
|
|
1408
|
-
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("main", { className: "flex-1 overflow-y-auto min-h-screen", children })
|
|
1409
1510
|
] })
|
|
1410
|
-
] })
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1511
|
+
] }),
|
|
1512
|
+
header && !headerCollapsed && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("header", { className: `${needsMobileHeader ? desktopShowClass : ""} sticky top-0 z-20 ${heightClasses[headerHeight]} ${getVariantClasses(headerVariant, headerWithBorder)} ${headerWithBorder ? "border-b" : ""} px-4 items-center`, children: [
|
|
1513
|
+
(logo || title) && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "mr-4 shrink-0", children: logo || /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: title }) }),
|
|
1514
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex-1", children: header.content })
|
|
1515
|
+
] }),
|
|
1516
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex flex-1 min-h-0", children: [
|
|
1517
|
+
navbar && !navbarCollapsedDesktop && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1518
|
+
"nav",
|
|
1519
|
+
{
|
|
1520
|
+
className: `${navbarDesktopShowClass} ${widthClasses2[navbarWidth]} ${getVariantClasses(navbarVariant, navbarWithBorder)} ${navbarWithBorder ? "border-r" : ""} flex-col shrink-0 overflow-y-auto`,
|
|
1521
|
+
children: navbar.content
|
|
1522
|
+
}
|
|
1523
|
+
),
|
|
1524
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("main", { className: `flex-1 overflow-y-auto min-w-0 ${paddingClasses[padding]}`, children }),
|
|
1525
|
+
aside && !asideCollapsedDesktop && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1526
|
+
"aside",
|
|
1527
|
+
{
|
|
1528
|
+
className: `${asideDesktopShowClass} ${widthClasses2[asideWidth]} ${getVariantClasses(asideVariant, asideWithBorder)} ${asideWithBorder ? "border-l" : ""} flex-col shrink-0 overflow-y-auto`,
|
|
1529
|
+
children: aside.content
|
|
1530
|
+
}
|
|
1531
|
+
)
|
|
1532
|
+
] }),
|
|
1533
|
+
footer && !footerCollapsed && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("footer", { className: `${heightClasses[footerHeight]} ${getVariantClasses(footerVariant, footerWithBorder)} ${footerWithBorder ? "border-t" : ""} px-4 flex items-center shrink-0`, children: footer.content }),
|
|
1534
|
+
navbar && !navbarCollapsedMobile && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1535
|
+
MobileDrawer,
|
|
1536
|
+
{
|
|
1537
|
+
isOpen: navbarOpen,
|
|
1538
|
+
onClose: () => setNavbarOpen(false),
|
|
1539
|
+
position: "left",
|
|
1540
|
+
breakpoint: navbarBreakpoint,
|
|
1541
|
+
title,
|
|
1542
|
+
logo,
|
|
1543
|
+
headerContent: header?.content,
|
|
1544
|
+
children: navbar.content
|
|
1545
|
+
}
|
|
1546
|
+
),
|
|
1547
|
+
aside && !asideCollapsedMobile && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
1548
|
+
MobileDrawer,
|
|
1549
|
+
{
|
|
1550
|
+
isOpen: asideOpen,
|
|
1551
|
+
onClose: () => setAsideOpen(false),
|
|
1552
|
+
position: "right",
|
|
1553
|
+
breakpoint: asideBreakpoint,
|
|
1554
|
+
title: "Sidebar",
|
|
1555
|
+
children: aside.content
|
|
1556
|
+
}
|
|
1557
|
+
)
|
|
1558
|
+
] }) });
|
|
1559
|
+
};
|
|
1560
|
+
var AppShellSection = ({
|
|
1561
|
+
children,
|
|
1562
|
+
grow = false,
|
|
1563
|
+
className = ""
|
|
1564
|
+
}) => {
|
|
1565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: `${grow ? "flex-1" : ""} ${className}`, children });
|
|
1416
1566
|
};
|
|
1567
|
+
AppShell.Section = AppShellSection;
|
|
1417
1568
|
|
|
1418
1569
|
// src/components/Drawer.tsx
|
|
1419
1570
|
var import_react6 = require("react");
|
|
@@ -1811,7 +1962,7 @@ var ActionMenu = ({
|
|
|
1811
1962
|
|
|
1812
1963
|
// src/components/Card.tsx
|
|
1813
1964
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
1814
|
-
var
|
|
1965
|
+
var paddingClasses2 = {
|
|
1815
1966
|
none: "",
|
|
1816
1967
|
sm: "p-4",
|
|
1817
1968
|
md: "p-6",
|
|
@@ -1824,7 +1975,7 @@ var Card = ({
|
|
|
1824
1975
|
hover = false,
|
|
1825
1976
|
...props
|
|
1826
1977
|
}) => {
|
|
1827
|
-
const paddingClass =
|
|
1978
|
+
const paddingClass = paddingClasses2[padding];
|
|
1828
1979
|
const hoverClass = hover ? "hover:shadow-lg hover:border-[hsl(var(--ring))]/50 cursor-pointer transition-all duration-200 ease-in-out" : "";
|
|
1829
1980
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
1830
1981
|
"div",
|
|
@@ -1938,7 +2089,10 @@ Checkbox.displayName = "Checkbox";
|
|
|
1938
2089
|
var import_react11 = require("react");
|
|
1939
2090
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
1940
2091
|
var Toggle = (0, import_react11.forwardRef)(
|
|
1941
|
-
({ label, size = "md", className = "", disabled, checked, ...props }, ref) => {
|
|
2092
|
+
({ label, size = "md", className = "", disabled, checked, onChange, ...props }, ref) => {
|
|
2093
|
+
const handleChange = (e) => {
|
|
2094
|
+
onChange?.(e.target.checked);
|
|
2095
|
+
};
|
|
1942
2096
|
const toggleClasses = {
|
|
1943
2097
|
sm: {
|
|
1944
2098
|
switch: "w-9 h-5",
|
|
@@ -1964,6 +2118,7 @@ var Toggle = (0, import_react11.forwardRef)(
|
|
|
1964
2118
|
className: "sr-only peer",
|
|
1965
2119
|
disabled,
|
|
1966
2120
|
checked,
|
|
2121
|
+
onChange: handleChange,
|
|
1967
2122
|
...props
|
|
1968
2123
|
}
|
|
1969
2124
|
),
|
|
@@ -8884,6 +9039,7 @@ function getThemeScript() {
|
|
|
8884
9039
|
Alert,
|
|
8885
9040
|
AlertCircleIcon,
|
|
8886
9041
|
AppShell,
|
|
9042
|
+
AppShellSection,
|
|
8887
9043
|
AppleIcon,
|
|
8888
9044
|
AreaChart,
|
|
8889
9045
|
ArrowDownIcon,
|
|
@@ -9004,6 +9160,7 @@ function getThemeScript() {
|
|
|
9004
9160
|
themeScript,
|
|
9005
9161
|
themes,
|
|
9006
9162
|
toast,
|
|
9163
|
+
useAppShell,
|
|
9007
9164
|
useSidebar,
|
|
9008
9165
|
useTheme,
|
|
9009
9166
|
useToast,
|