@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.mjs CHANGED
@@ -541,7 +541,7 @@ var useSidebar = () => {
541
541
  };
542
542
 
543
543
  // src/components/AppShell.tsx
544
- import { useState as useState4 } from "react";
544
+ import { useState as useState4, createContext as createContext3, useContext as useContext3 } from "react";
545
545
 
546
546
  // src/icons/icon-utils.tsx
547
547
  import { jsx as jsx8 } from "react/jsx-runtime";
@@ -1086,172 +1086,321 @@ var SlackIcon = createIcon(
1086
1086
 
1087
1087
  // src/components/AppShell.tsx
1088
1088
  import { Fragment as Fragment11, jsx as jsx78, jsxs as jsxs9 } from "react/jsx-runtime";
1089
+ var AppShellContext = createContext3(null);
1090
+ var useAppShell = () => {
1091
+ const context = useContext3(AppShellContext);
1092
+ if (!context) {
1093
+ throw new Error("useAppShell must be used within AppShell");
1094
+ }
1095
+ return context;
1096
+ };
1097
+ var heightClasses = {
1098
+ sm: "h-12",
1099
+ // 48px
1100
+ md: "h-16",
1101
+ // 64px
1102
+ lg: "h-20"
1103
+ // 80px
1104
+ };
1089
1105
  var widthClasses2 = {
1090
1106
  sm: "w-48",
1107
+ // 192px
1091
1108
  md: "w-64",
1109
+ // 256px
1092
1110
  lg: "w-80"
1111
+ // 320px
1093
1112
  };
1094
- var breakpointClasses = {
1095
- sm: "sm",
1096
- md: "md",
1097
- lg: "lg",
1098
- xl: "xl"
1113
+ var paddingClasses = {
1114
+ none: "p-0",
1115
+ sm: "p-2",
1116
+ md: "p-4",
1117
+ lg: "p-6"
1099
1118
  };
1100
- var getVariantClasses = (variant) => {
1119
+ var getVariantClasses = (variant, withBorder = true) => {
1120
+ const borderClass = withBorder ? "border-[hsl(var(--border))]" : "border-transparent";
1101
1121
  switch (variant) {
1102
1122
  case "glass":
1103
- return "bg-[hsl(var(--background))]/80 backdrop-blur-xl";
1123
+ return `bg-[hsl(var(--background))]/80 backdrop-blur-xl ${borderClass}`;
1104
1124
  case "transparent":
1105
- return "bg-transparent";
1125
+ return `bg-transparent ${borderClass}`;
1106
1126
  case "solid":
1107
1127
  default:
1108
- return "bg-[hsl(var(--background))] border-b border-[hsl(var(--border))]";
1128
+ return `bg-[hsl(var(--card))] ${borderClass}`;
1109
1129
  }
1110
1130
  };
1111
- var AppShell = ({
1112
- children,
1113
- navbar,
1114
- header,
1115
- navbarTitle,
1116
- navbarLogo,
1117
- defaultNavbarOpen = false,
1118
- responsive = true,
1119
- className = ""
1120
- }) => {
1121
- const [isMobileNavbarOpen, setIsMobileNavbarOpen] = useState4(defaultNavbarOpen);
1122
- const navbarWidth = navbar?.width || "md";
1123
- const navbarBreakpoint = navbar?.breakpoint || "md";
1124
- const navbarPosition = navbar?.position || "side";
1125
- const widthClass = widthClasses2[navbarWidth];
1126
- const breakpoint = breakpointClasses[navbarBreakpoint];
1127
- if (!responsive && navbar) {
1128
- return /* @__PURE__ */ jsxs9("div", { className: `min-h-screen flex flex-col ${className}`, children: [
1129
- header && /* @__PURE__ */ jsx78("div", { className: "w-full", children: header }),
1130
- /* @__PURE__ */ jsxs9("div", { className: "flex flex-1", children: [
1131
- /* @__PURE__ */ jsx78("aside", { className: `${widthClass} bg-[hsl(var(--card))] border-r border-[hsl(var(--border))] h-full overflow-y-auto`, children: navbar.content }),
1132
- /* @__PURE__ */ jsx78("main", { className: "flex-1 overflow-y-auto", children })
1133
- ] })
1134
- ] });
1131
+ var getBreakpointHideClass = (breakpoint) => {
1132
+ switch (breakpoint) {
1133
+ case "sm":
1134
+ return "sm:hidden";
1135
+ case "md":
1136
+ return "md:hidden";
1137
+ case "lg":
1138
+ return "lg:hidden";
1139
+ case "xl":
1140
+ return "xl:hidden";
1135
1141
  }
1136
- if (!responsive) {
1137
- return /* @__PURE__ */ jsxs9("div", { className: `min-h-screen flex flex-col ${className}`, children: [
1138
- header && /* @__PURE__ */ jsx78("div", { className: "w-full", children: header }),
1139
- /* @__PURE__ */ jsx78("main", { className: "flex-1 overflow-y-auto", children })
1140
- ] });
1142
+ };
1143
+ var getBreakpointShowClass = (breakpoint) => {
1144
+ switch (breakpoint) {
1145
+ case "sm":
1146
+ return "hidden sm:flex";
1147
+ case "md":
1148
+ return "hidden md:flex";
1149
+ case "lg":
1150
+ return "hidden lg:flex";
1151
+ case "xl":
1152
+ return "hidden xl:flex";
1141
1153
  }
1142
- if (navbar && navbarPosition === "top") {
1143
- const mobileMenuClass = navbarBreakpoint === "sm" ? "sm:hidden" : navbarBreakpoint === "md" ? "md:hidden" : navbarBreakpoint === "lg" ? "lg:hidden" : "xl:hidden";
1144
- const desktopNavClass = navbarBreakpoint === "sm" ? "sm:flex" : navbarBreakpoint === "md" ? "md:flex" : navbarBreakpoint === "lg" ? "lg:flex" : "xl:flex";
1145
- return /* @__PURE__ */ jsxs9("div", { className: `min-h-screen flex flex-col bg-[hsl(var(--background))] ${className}`, children: [
1146
- /* @__PURE__ */ jsx78("nav", { className: `sticky top-0 z-30 ${getVariantClasses(navbar.variant)}`, children: /* @__PURE__ */ jsx78("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: /* @__PURE__ */ jsxs9("div", { className: "flex justify-between items-center h-16", children: [
1147
- /* @__PURE__ */ jsx78("div", { className: "flex items-center", children: navbarLogo ? /* @__PURE__ */ jsx78("div", { children: navbarLogo }) : navbarTitle ? /* @__PURE__ */ jsx78("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: navbarTitle }) : null }),
1148
- /* @__PURE__ */ jsx78("div", { className: `hidden ${desktopNavClass} items-center gap-6`, children: navbar.content }),
1149
- /* @__PURE__ */ jsx78(
1150
- "button",
1151
- {
1152
- className: `${mobileMenuClass} p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors`,
1153
- onClick: () => setIsMobileNavbarOpen(!isMobileNavbarOpen),
1154
- "aria-label": "Toggle menu",
1155
- children: /* @__PURE__ */ jsx78(MenuIcon, { size: "md" })
1156
- }
1157
- )
1158
- ] }) }) }),
1159
- header && /* @__PURE__ */ jsx78("div", { className: "w-full", children: header }),
1160
- isMobileNavbarOpen && /* @__PURE__ */ jsxs9(Fragment11, { children: [
1161
- /* @__PURE__ */ jsx78(
1162
- "div",
1163
- {
1164
- className: `${mobileMenuClass} fixed inset-0 z-40 bg-black/60 backdrop-blur-sm animate-in fade-in duration-200`,
1165
- onClick: () => setIsMobileNavbarOpen(false)
1166
- }
1167
- ),
1168
- /* @__PURE__ */ jsxs9("div", { className: `${mobileMenuClass} 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: [
1169
- /* @__PURE__ */ jsxs9("div", { className: "p-4 border-b border-[hsl(var(--border))] flex items-center justify-between", children: [
1170
- navbarLogo ? /* @__PURE__ */ jsx78("div", { children: navbarLogo }) : navbarTitle ? /* @__PURE__ */ jsx78("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: navbarTitle }) : null,
1154
+ };
1155
+ var MobileDrawer = ({
1156
+ isOpen,
1157
+ onClose,
1158
+ position,
1159
+ breakpoint,
1160
+ title,
1161
+ logo,
1162
+ children,
1163
+ headerContent
1164
+ }) => {
1165
+ if (!isOpen) return null;
1166
+ const hideClass = getBreakpointHideClass(breakpoint);
1167
+ const slideClass = position === "left" ? "left-0 animate-in slide-in-from-left" : "right-0 animate-in slide-in-from-right";
1168
+ return /* @__PURE__ */ jsxs9(Fragment11, { children: [
1169
+ /* @__PURE__ */ jsx78(
1170
+ "div",
1171
+ {
1172
+ className: `${hideClass} fixed inset-0 z-40 bg-black/60 backdrop-blur-sm animate-in fade-in duration-200`,
1173
+ onClick: onClose
1174
+ }
1175
+ ),
1176
+ /* @__PURE__ */ jsxs9(
1177
+ "div",
1178
+ {
1179
+ className: `${hideClass} fixed ${slideClass} top-0 bottom-0 z-50 w-72 bg-[hsl(var(--card))] shadow-2xl duration-300 flex flex-col`,
1180
+ children: [
1181
+ /* @__PURE__ */ jsxs9("div", { className: "p-4 border-b border-[hsl(var(--border))] flex items-center justify-between shrink-0", children: [
1182
+ logo ? /* @__PURE__ */ jsx78("div", { children: logo }) : title ? /* @__PURE__ */ jsx78("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: title }) : /* @__PURE__ */ jsx78("div", {}),
1171
1183
  /* @__PURE__ */ jsx78(
1172
1184
  "button",
1173
1185
  {
1174
1186
  className: "p-1 rounded hover:bg-[hsl(var(--accent))] transition-colors",
1175
- onClick: () => setIsMobileNavbarOpen(false),
1187
+ onClick: onClose,
1176
1188
  "aria-label": "Close menu",
1177
1189
  children: /* @__PURE__ */ jsx78("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx78("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
1178
1190
  }
1179
1191
  )
1180
1192
  ] }),
1181
- /* @__PURE__ */ jsx78(
1182
- "div",
1193
+ headerContent && /* @__PURE__ */ jsx78("div", { className: "p-3 border-b border-[hsl(var(--border))] shrink-0", children: headerContent }),
1194
+ /* @__PURE__ */ jsx78("div", { className: "flex-1 overflow-y-auto", onClick: onClose, children })
1195
+ ]
1196
+ }
1197
+ )
1198
+ ] });
1199
+ };
1200
+ var AppShell = ({
1201
+ children,
1202
+ header,
1203
+ navbar,
1204
+ aside,
1205
+ footer,
1206
+ logo,
1207
+ title,
1208
+ layout = "default",
1209
+ padding = "none",
1210
+ className = ""
1211
+ }) => {
1212
+ const [navbarOpen, setNavbarOpen] = useState4(false);
1213
+ const [asideOpen, setAsideOpen] = useState4(false);
1214
+ const navbarWidth = navbar?.width || "md";
1215
+ const navbarBreakpoint = navbar?.breakpoint || "md";
1216
+ const navbarCollapsedMobile = navbar?.collapsed?.mobile ?? false;
1217
+ const navbarCollapsedDesktop = navbar?.collapsed?.desktop ?? false;
1218
+ const navbarVariant = navbar?.variant || "solid";
1219
+ const navbarWithBorder = navbar?.withBorder ?? true;
1220
+ const asideWidth = aside?.width || "md";
1221
+ const asideBreakpoint = aside?.breakpoint || "md";
1222
+ const asideCollapsedMobile = aside?.collapsed?.mobile ?? true;
1223
+ const asideCollapsedDesktop = aside?.collapsed?.desktop ?? false;
1224
+ const asideVariant = aside?.variant || "solid";
1225
+ const asideWithBorder = aside?.withBorder ?? true;
1226
+ const headerHeight = header?.height || "md";
1227
+ const headerVariant = header?.variant || "solid";
1228
+ const headerWithBorder = header?.withBorder ?? true;
1229
+ const headerCollapsed = header?.collapsed ?? false;
1230
+ const headerMobileActions = header?.mobileActions;
1231
+ const footerHeight = footer?.height || "md";
1232
+ const footerVariant = footer?.variant || "solid";
1233
+ const footerWithBorder = footer?.withBorder ?? true;
1234
+ const footerCollapsed = footer?.collapsed ?? false;
1235
+ const showNavbarHamburger = navbar && !navbarCollapsedMobile;
1236
+ const showAsideHamburger = aside && !asideCollapsedMobile;
1237
+ const needsMobileHeader = showNavbarHamburger || showAsideHamburger;
1238
+ const mobileBreakpoint = navbarBreakpoint;
1239
+ const navbarDesktopShowClass = getBreakpointShowClass(navbarBreakpoint);
1240
+ const mobileHideClass = getBreakpointHideClass(mobileBreakpoint);
1241
+ const desktopShowClass = getBreakpointShowClass(mobileBreakpoint);
1242
+ const asideDesktopShowClass = getBreakpointShowClass(asideBreakpoint);
1243
+ const contextValue = {
1244
+ navbarOpen,
1245
+ setNavbarOpen,
1246
+ asideOpen,
1247
+ setAsideOpen
1248
+ };
1249
+ if (layout === "alt") {
1250
+ return /* @__PURE__ */ jsx78(AppShellContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs9("div", { className: `min-h-screen flex bg-[hsl(var(--background))] ${className}`, children: [
1251
+ navbar && !navbarCollapsedDesktop && /* @__PURE__ */ jsxs9(
1252
+ "aside",
1253
+ {
1254
+ className: `${navbarDesktopShowClass} ${widthClasses2[navbarWidth]} ${getVariantClasses(navbarVariant, navbarWithBorder)} ${navbarWithBorder ? "border-r" : ""} flex-col shrink-0`,
1255
+ children: [
1256
+ (logo || title) && /* @__PURE__ */ jsx78("div", { className: `${heightClasses[headerHeight]} px-4 flex items-center border-b border-[hsl(var(--border))] shrink-0`, children: logo || /* @__PURE__ */ jsx78("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: title }) }),
1257
+ /* @__PURE__ */ jsx78("nav", { className: "flex-1 overflow-y-auto", children: navbar.content })
1258
+ ]
1259
+ }
1260
+ ),
1261
+ /* @__PURE__ */ jsxs9("div", { className: "flex-1 flex flex-col min-w-0", children: [
1262
+ needsMobileHeader && /* @__PURE__ */ jsxs9("div", { className: `${mobileHideClass} sticky top-0 z-30 ${heightClasses[headerHeight]} px-4 flex items-center justify-between ${getVariantClasses(headerVariant, headerWithBorder)} ${headerWithBorder ? "border-b" : ""}`, children: [
1263
+ showNavbarHamburger && /* @__PURE__ */ jsx78(
1264
+ "button",
1183
1265
  {
1184
- className: "p-4 flex flex-col gap-4",
1185
- onClick: () => setIsMobileNavbarOpen(false),
1186
- children: navbar.content
1266
+ className: "p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors shrink-0",
1267
+ onClick: () => setNavbarOpen(true),
1268
+ "aria-label": "Open navigation",
1269
+ children: /* @__PURE__ */ jsx78(MenuIcon, { size: "md" })
1187
1270
  }
1188
- )
1189
- ] })
1271
+ ),
1272
+ (logo || title) && /* @__PURE__ */ jsx78("div", { className: "flex-1 flex items-center justify-center min-w-0", children: logo || /* @__PURE__ */ jsx78("span", { className: "text-lg font-bold text-[hsl(var(--foreground))] truncate", children: title }) }),
1273
+ /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1 shrink-0", children: [
1274
+ headerMobileActions,
1275
+ showAsideHamburger && /* @__PURE__ */ jsx78(
1276
+ "button",
1277
+ {
1278
+ className: "p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors",
1279
+ onClick: () => setAsideOpen(true),
1280
+ "aria-label": "Open sidebar",
1281
+ children: /* @__PURE__ */ jsx78(MenuIcon, { size: "md" })
1282
+ }
1283
+ )
1284
+ ] })
1285
+ ] }),
1286
+ header && !headerCollapsed && /* @__PURE__ */ jsx78("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 }),
1287
+ /* @__PURE__ */ jsx78("main", { className: `flex-1 overflow-y-auto ${paddingClasses[padding]}`, children }),
1288
+ footer && !footerCollapsed && /* @__PURE__ */ jsx78("footer", { className: `${heightClasses[footerHeight]} ${getVariantClasses(footerVariant, footerWithBorder)} ${footerWithBorder ? "border-t" : ""} px-4 flex items-center shrink-0`, children: footer.content })
1190
1289
  ] }),
1191
- /* @__PURE__ */ jsx78("main", { className: "flex-1 overflow-y-auto", children })
1192
- ] });
1290
+ aside && !asideCollapsedDesktop && /* @__PURE__ */ jsx78(
1291
+ "aside",
1292
+ {
1293
+ className: `${asideDesktopShowClass} ${widthClasses2[asideWidth]} ${getVariantClasses(asideVariant, asideWithBorder)} ${asideWithBorder ? "border-l" : ""} flex-col shrink-0 overflow-y-auto`,
1294
+ children: aside.content
1295
+ }
1296
+ ),
1297
+ navbar && !navbarCollapsedMobile && /* @__PURE__ */ jsx78(
1298
+ MobileDrawer,
1299
+ {
1300
+ isOpen: navbarOpen,
1301
+ onClose: () => setNavbarOpen(false),
1302
+ position: "left",
1303
+ breakpoint: navbarBreakpoint,
1304
+ title,
1305
+ logo,
1306
+ headerContent: header?.content,
1307
+ children: navbar.content
1308
+ }
1309
+ ),
1310
+ aside && !asideCollapsedMobile && /* @__PURE__ */ jsx78(
1311
+ MobileDrawer,
1312
+ {
1313
+ isOpen: asideOpen,
1314
+ onClose: () => setAsideOpen(false),
1315
+ position: "right",
1316
+ breakpoint: asideBreakpoint,
1317
+ title: "Sidebar",
1318
+ children: aside.content
1319
+ }
1320
+ )
1321
+ ] }) });
1193
1322
  }
1194
- if (navbar) {
1195
- const mobileHeaderClass = navbarBreakpoint === "sm" ? "sm:hidden" : navbarBreakpoint === "md" ? "md:hidden" : navbarBreakpoint === "lg" ? "lg:hidden" : "xl:hidden";
1196
- const desktopNavbarClass = navbarBreakpoint === "sm" ? "sm:block" : navbarBreakpoint === "md" ? "md:block" : navbarBreakpoint === "lg" ? "lg:block" : "xl:block";
1197
- const mobileDrawerClass = navbarBreakpoint === "sm" ? "sm:hidden" : navbarBreakpoint === "md" ? "md:hidden" : navbarBreakpoint === "lg" ? "lg:hidden" : "xl:hidden";
1198
- const sidebarWidthClass = navbarWidth === "sm" ? "w-48" : navbarWidth === "lg" ? "w-80" : "w-64";
1199
- return /* @__PURE__ */ jsxs9("div", { className: `min-h-screen flex flex-col bg-[hsl(var(--background))] ${className}`, children: [
1200
- /* @__PURE__ */ jsxs9("div", { className: `${mobileHeaderClass} sticky top-0 z-30 ${getVariantClasses(navbar.variant)} px-4 py-3 flex items-center justify-between`, children: [
1201
- navbarLogo ? /* @__PURE__ */ jsx78("div", { children: navbarLogo }) : navbarTitle ? /* @__PURE__ */ jsx78("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: navbarTitle }) : null,
1202
- /* @__PURE__ */ jsx78(
1323
+ return /* @__PURE__ */ jsx78(AppShellContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs9("div", { className: `min-h-screen flex flex-col bg-[hsl(var(--background))] ${className}`, children: [
1324
+ needsMobileHeader && /* @__PURE__ */ jsxs9("div", { className: `${mobileHideClass} sticky top-0 z-30 ${heightClasses[headerHeight]} px-4 flex items-center justify-between ${getVariantClasses(headerVariant, headerWithBorder)} ${headerWithBorder ? "border-b" : ""}`, children: [
1325
+ showNavbarHamburger && /* @__PURE__ */ jsx78(
1326
+ "button",
1327
+ {
1328
+ className: "p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors shrink-0",
1329
+ onClick: () => setNavbarOpen(true),
1330
+ "aria-label": "Open navigation",
1331
+ children: /* @__PURE__ */ jsx78(MenuIcon, { size: "md" })
1332
+ }
1333
+ ),
1334
+ (logo || title) && /* @__PURE__ */ jsx78("div", { className: "flex-1 flex items-center justify-center min-w-0", children: logo || /* @__PURE__ */ jsx78("span", { className: "text-lg font-bold text-[hsl(var(--foreground))] truncate", children: title }) }),
1335
+ /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-1 shrink-0", children: [
1336
+ headerMobileActions,
1337
+ showAsideHamburger && /* @__PURE__ */ jsx78(
1203
1338
  "button",
1204
1339
  {
1205
1340
  className: "p-2 rounded-lg hover:bg-[hsl(var(--accent))] transition-colors",
1206
- onClick: () => setIsMobileNavbarOpen(!isMobileNavbarOpen),
1207
- "aria-label": "Toggle menu",
1341
+ onClick: () => setAsideOpen(true),
1342
+ "aria-label": "Open sidebar",
1208
1343
  children: /* @__PURE__ */ jsx78(MenuIcon, { size: "md" })
1209
1344
  }
1210
1345
  )
1211
- ] }),
1212
- header && /* @__PURE__ */ jsx78("div", { className: "w-full", children: header }),
1213
- /* @__PURE__ */ jsxs9("div", { className: "flex flex-1 min-h-0", children: [
1214
- /* @__PURE__ */ jsx78("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 }),
1215
- isMobileNavbarOpen && /* @__PURE__ */ jsxs9(Fragment11, { children: [
1216
- /* @__PURE__ */ jsx78(
1217
- "div",
1218
- {
1219
- className: `${mobileDrawerClass} fixed inset-0 z-40 bg-black/60 backdrop-blur-sm animate-in fade-in duration-200`,
1220
- onClick: () => setIsMobileNavbarOpen(false)
1221
- }
1222
- ),
1223
- /* @__PURE__ */ jsxs9("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: [
1224
- /* @__PURE__ */ jsxs9("div", { className: "p-4 border-b border-[hsl(var(--border))] flex items-center justify-between", children: [
1225
- navbarLogo ? /* @__PURE__ */ jsx78("div", { children: navbarLogo }) : navbarTitle ? /* @__PURE__ */ jsx78("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: navbarTitle }) : null,
1226
- /* @__PURE__ */ jsx78(
1227
- "button",
1228
- {
1229
- className: "p-1 rounded hover:bg-[hsl(var(--accent))] transition-colors",
1230
- onClick: () => setIsMobileNavbarOpen(false),
1231
- "aria-label": "Close menu",
1232
- children: /* @__PURE__ */ jsx78("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx78("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
1233
- }
1234
- )
1235
- ] }),
1236
- /* @__PURE__ */ jsx78(
1237
- "div",
1238
- {
1239
- className: "overflow-y-auto h-[calc(100vh-73px)]",
1240
- onClick: () => setIsMobileNavbarOpen(false),
1241
- children: navbar.content
1242
- }
1243
- )
1244
- ] })
1245
- ] }),
1246
- /* @__PURE__ */ jsx78("main", { className: "flex-1 overflow-y-auto min-h-screen", children })
1247
1346
  ] })
1248
- ] });
1249
- }
1250
- return /* @__PURE__ */ jsxs9("div", { className: `min-h-screen flex flex-col ${className}`, children: [
1251
- header && /* @__PURE__ */ jsx78("div", { className: "w-full", children: header }),
1252
- /* @__PURE__ */ jsx78("main", { className: "flex-1 overflow-y-auto", children })
1253
- ] });
1347
+ ] }),
1348
+ header && !headerCollapsed && /* @__PURE__ */ jsxs9("header", { className: `${needsMobileHeader ? desktopShowClass : ""} sticky top-0 z-20 ${heightClasses[headerHeight]} ${getVariantClasses(headerVariant, headerWithBorder)} ${headerWithBorder ? "border-b" : ""} px-4 items-center`, children: [
1349
+ (logo || title) && /* @__PURE__ */ jsx78("div", { className: "mr-4 shrink-0", children: logo || /* @__PURE__ */ jsx78("span", { className: "text-xl font-bold text-[hsl(var(--foreground))]", children: title }) }),
1350
+ /* @__PURE__ */ jsx78("div", { className: "flex-1", children: header.content })
1351
+ ] }),
1352
+ /* @__PURE__ */ jsxs9("div", { className: "flex flex-1 min-h-0", children: [
1353
+ navbar && !navbarCollapsedDesktop && /* @__PURE__ */ jsx78(
1354
+ "nav",
1355
+ {
1356
+ className: `${navbarDesktopShowClass} ${widthClasses2[navbarWidth]} ${getVariantClasses(navbarVariant, navbarWithBorder)} ${navbarWithBorder ? "border-r" : ""} flex-col shrink-0 overflow-y-auto`,
1357
+ children: navbar.content
1358
+ }
1359
+ ),
1360
+ /* @__PURE__ */ jsx78("main", { className: `flex-1 overflow-y-auto min-w-0 ${paddingClasses[padding]}`, children }),
1361
+ aside && !asideCollapsedDesktop && /* @__PURE__ */ jsx78(
1362
+ "aside",
1363
+ {
1364
+ className: `${asideDesktopShowClass} ${widthClasses2[asideWidth]} ${getVariantClasses(asideVariant, asideWithBorder)} ${asideWithBorder ? "border-l" : ""} flex-col shrink-0 overflow-y-auto`,
1365
+ children: aside.content
1366
+ }
1367
+ )
1368
+ ] }),
1369
+ footer && !footerCollapsed && /* @__PURE__ */ jsx78("footer", { className: `${heightClasses[footerHeight]} ${getVariantClasses(footerVariant, footerWithBorder)} ${footerWithBorder ? "border-t" : ""} px-4 flex items-center shrink-0`, children: footer.content }),
1370
+ navbar && !navbarCollapsedMobile && /* @__PURE__ */ jsx78(
1371
+ MobileDrawer,
1372
+ {
1373
+ isOpen: navbarOpen,
1374
+ onClose: () => setNavbarOpen(false),
1375
+ position: "left",
1376
+ breakpoint: navbarBreakpoint,
1377
+ title,
1378
+ logo,
1379
+ headerContent: header?.content,
1380
+ children: navbar.content
1381
+ }
1382
+ ),
1383
+ aside && !asideCollapsedMobile && /* @__PURE__ */ jsx78(
1384
+ MobileDrawer,
1385
+ {
1386
+ isOpen: asideOpen,
1387
+ onClose: () => setAsideOpen(false),
1388
+ position: "right",
1389
+ breakpoint: asideBreakpoint,
1390
+ title: "Sidebar",
1391
+ children: aside.content
1392
+ }
1393
+ )
1394
+ ] }) });
1395
+ };
1396
+ var AppShellSection = ({
1397
+ children,
1398
+ grow = false,
1399
+ className = ""
1400
+ }) => {
1401
+ return /* @__PURE__ */ jsx78("div", { className: `${grow ? "flex-1" : ""} ${className}`, children });
1254
1402
  };
1403
+ AppShell.Section = AppShellSection;
1255
1404
 
1256
1405
  // src/components/Drawer.tsx
1257
1406
  import { useEffect as useEffect4 } from "react";
@@ -1649,7 +1798,7 @@ var ActionMenu = ({
1649
1798
 
1650
1799
  // src/components/Card.tsx
1651
1800
  import { jsx as jsx83 } from "react/jsx-runtime";
1652
- var paddingClasses = {
1801
+ var paddingClasses2 = {
1653
1802
  none: "",
1654
1803
  sm: "p-4",
1655
1804
  md: "p-6",
@@ -1662,7 +1811,7 @@ var Card = ({
1662
1811
  hover = false,
1663
1812
  ...props
1664
1813
  }) => {
1665
- const paddingClass = paddingClasses[padding];
1814
+ const paddingClass = paddingClasses2[padding];
1666
1815
  const hoverClass = hover ? "hover:shadow-lg hover:border-[hsl(var(--ring))]/50 cursor-pointer transition-all duration-200 ease-in-out" : "";
1667
1816
  return /* @__PURE__ */ jsx83(
1668
1817
  "div",
@@ -1776,7 +1925,10 @@ Checkbox.displayName = "Checkbox";
1776
1925
  import { forwardRef as forwardRef3 } from "react";
1777
1926
  import { jsx as jsx86, jsxs as jsxs16 } from "react/jsx-runtime";
1778
1927
  var Toggle = forwardRef3(
1779
- ({ label, size = "md", className = "", disabled, checked, ...props }, ref) => {
1928
+ ({ label, size = "md", className = "", disabled, checked, onChange, ...props }, ref) => {
1929
+ const handleChange = (e) => {
1930
+ onChange?.(e.target.checked);
1931
+ };
1780
1932
  const toggleClasses = {
1781
1933
  sm: {
1782
1934
  switch: "w-9 h-5",
@@ -1802,6 +1954,7 @@ var Toggle = forwardRef3(
1802
1954
  className: "sr-only peer",
1803
1955
  disabled,
1804
1956
  checked,
1957
+ onChange: handleChange,
1805
1958
  ...props
1806
1959
  }
1807
1960
  ),
@@ -3847,11 +4000,11 @@ var RichTextEditor = ({
3847
4000
  };
3848
4001
 
3849
4002
  // src/components/Toast.tsx
3850
- import { createContext as createContext3, useContext as useContext3, useState as useState13, useCallback as useCallback2 } from "react";
4003
+ import { createContext as createContext4, useContext as useContext4, useState as useState13, useCallback as useCallback2 } from "react";
3851
4004
  import { jsx as jsx102, jsxs as jsxs29 } from "react/jsx-runtime";
3852
- var ToastContext = createContext3(void 0);
4005
+ var ToastContext = createContext4(void 0);
3853
4006
  var useToast = () => {
3854
- const context = useContext3(ToastContext);
4007
+ const context = useContext4(ToastContext);
3855
4008
  if (!context) {
3856
4009
  throw new Error("useToast must be used within a ToastProvider");
3857
4010
  }
@@ -8721,6 +8874,7 @@ export {
8721
8874
  Alert,
8722
8875
  AlertCircleIcon,
8723
8876
  AppShell,
8877
+ AppShellSection,
8724
8878
  AppleIcon,
8725
8879
  AreaChart,
8726
8880
  ArrowDownIcon,
@@ -8841,6 +8995,7 @@ export {
8841
8995
  themeScript,
8842
8996
  themes,
8843
8997
  toast,
8998
+ useAppShell,
8844
8999
  useSidebar,
8845
9000
  useTheme,
8846
9001
  useToast,