@yomologic/react-ui 0.2.6 → 0.2.7
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/README.md +2 -1
- package/dist/index.d.mts +45 -5
- package/dist/index.d.ts +45 -5
- package/dist/index.js +203 -37
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +199 -34
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +77 -50
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,7 +60,8 @@ function App() {
|
|
|
60
60
|
|
|
61
61
|
- **Container** - Responsive page container
|
|
62
62
|
- **SectionLayout** - Layout wrapper for sections
|
|
63
|
-
- **
|
|
63
|
+
- **Drawer** - Navigation drawer/sidebar
|
|
64
|
+
- **SidebarNav** - (Deprecated, use Drawer instead)
|
|
64
65
|
|
|
65
66
|
### Shared Components
|
|
66
67
|
|
package/dist/index.d.mts
CHANGED
|
@@ -186,7 +186,7 @@ interface SectionLayoutProps {
|
|
|
186
186
|
*/
|
|
187
187
|
declare function SectionLayout({ children, hasStickyPreview, }: SectionLayoutProps): react_jsx_runtime.JSX.Element | null;
|
|
188
188
|
|
|
189
|
-
interface NavItem$
|
|
189
|
+
interface NavItem$2 {
|
|
190
190
|
id: string;
|
|
191
191
|
label?: string;
|
|
192
192
|
type?: "link" | "button" | "dropdown" | "divider" | "custom";
|
|
@@ -196,23 +196,45 @@ interface NavItem$1 {
|
|
|
196
196
|
badge?: string | number;
|
|
197
197
|
disabled?: boolean;
|
|
198
198
|
target?: "_blank" | "_self";
|
|
199
|
-
children?: NavItem$
|
|
199
|
+
children?: NavItem$2[];
|
|
200
200
|
render?: () => React.ReactNode;
|
|
201
201
|
}
|
|
202
202
|
interface NavProps extends React.HTMLAttributes<HTMLElement> {
|
|
203
|
-
items: NavItem$
|
|
203
|
+
items: NavItem$2[];
|
|
204
204
|
variant?: "primary" | "secondary" | "outline" | "ghost";
|
|
205
205
|
orientation?: "horizontal" | "vertical";
|
|
206
206
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
207
207
|
mobileBreakpoint?: "sm" | "md" | "lg";
|
|
208
|
+
mobileMenuDirection?: "top" | "left" | "right";
|
|
208
209
|
logo?: React.ReactNode;
|
|
209
210
|
actions?: React.ReactNode;
|
|
210
211
|
sticky?: boolean;
|
|
211
212
|
activeId?: string;
|
|
212
|
-
onItemClick?: (item: NavItem$
|
|
213
|
+
onItemClick?: (item: NavItem$2) => void;
|
|
213
214
|
}
|
|
214
215
|
declare const Nav: React.ForwardRefExoticComponent<NavProps & React.RefAttributes<HTMLElement>>;
|
|
215
216
|
|
|
217
|
+
interface NavItem$1 {
|
|
218
|
+
id: string;
|
|
219
|
+
label: string;
|
|
220
|
+
icon?: React.ReactNode;
|
|
221
|
+
}
|
|
222
|
+
interface NavSection$1 {
|
|
223
|
+
title: string;
|
|
224
|
+
items: NavItem$1[];
|
|
225
|
+
}
|
|
226
|
+
interface DrawerProps {
|
|
227
|
+
title: string;
|
|
228
|
+
subtitle?: string;
|
|
229
|
+
items?: NavItem$1[];
|
|
230
|
+
sections?: NavSection$1[];
|
|
231
|
+
activeItem: string;
|
|
232
|
+
onItemClick: (itemId: string) => void;
|
|
233
|
+
footer?: React.ReactNode;
|
|
234
|
+
position?: "left" | "right";
|
|
235
|
+
}
|
|
236
|
+
declare function Drawer({ title, subtitle, items, sections, activeItem, onItemClick, footer, position, }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
237
|
+
|
|
216
238
|
interface NavItem {
|
|
217
239
|
id: string;
|
|
218
240
|
label: string;
|
|
@@ -525,6 +547,23 @@ interface NavTheme {
|
|
|
525
547
|
borderRadius: string;
|
|
526
548
|
gap: string;
|
|
527
549
|
}
|
|
550
|
+
interface ZIndexScale {
|
|
551
|
+
dropdown: number;
|
|
552
|
+
popover: number;
|
|
553
|
+
tooltip: number;
|
|
554
|
+
overlay: number;
|
|
555
|
+
nav: number;
|
|
556
|
+
navMobileOverlay: number;
|
|
557
|
+
navMobileMenu: number;
|
|
558
|
+
drawerHeader: number;
|
|
559
|
+
drawerButton: number;
|
|
560
|
+
drawerOverlay: number;
|
|
561
|
+
drawerPanel: number;
|
|
562
|
+
modalBackdrop: number;
|
|
563
|
+
modal: number;
|
|
564
|
+
snackbar: number;
|
|
565
|
+
toast: number;
|
|
566
|
+
}
|
|
528
567
|
interface ComponentThemes {
|
|
529
568
|
button: ButtonTheme;
|
|
530
569
|
card: CardTheme;
|
|
@@ -541,6 +580,7 @@ interface Theme {
|
|
|
541
580
|
spacing: ThemeSpacing;
|
|
542
581
|
borderRadius: ThemeBorderRadius;
|
|
543
582
|
typography: ThemeTypography;
|
|
583
|
+
zIndex: ZIndexScale;
|
|
544
584
|
components: ComponentThemes;
|
|
545
585
|
}
|
|
546
586
|
|
|
@@ -557,4 +597,4 @@ declare function useTheme(): ThemeContextType;
|
|
|
557
597
|
|
|
558
598
|
declare function cn(...inputs: ClassValue[]): string;
|
|
559
599
|
|
|
560
|
-
export { Alert, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Dropdown, EmptyState, Input, Nav, type NavItem$
|
|
600
|
+
export { Alert, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Drawer, type NavItem$1 as DrawerNavItem, type NavSection$1 as DrawerNavSection, type DrawerProps, Dropdown, EmptyState, Input, Nav, type NavItem$2 as NavItem, type NavProps, type NavSection, RadioGroup, SectionLayout, SidebarNav, type NavItem as SidebarNavItem, Spinner, type Theme, ThemeProvider, cn, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -186,7 +186,7 @@ interface SectionLayoutProps {
|
|
|
186
186
|
*/
|
|
187
187
|
declare function SectionLayout({ children, hasStickyPreview, }: SectionLayoutProps): react_jsx_runtime.JSX.Element | null;
|
|
188
188
|
|
|
189
|
-
interface NavItem$
|
|
189
|
+
interface NavItem$2 {
|
|
190
190
|
id: string;
|
|
191
191
|
label?: string;
|
|
192
192
|
type?: "link" | "button" | "dropdown" | "divider" | "custom";
|
|
@@ -196,23 +196,45 @@ interface NavItem$1 {
|
|
|
196
196
|
badge?: string | number;
|
|
197
197
|
disabled?: boolean;
|
|
198
198
|
target?: "_blank" | "_self";
|
|
199
|
-
children?: NavItem$
|
|
199
|
+
children?: NavItem$2[];
|
|
200
200
|
render?: () => React.ReactNode;
|
|
201
201
|
}
|
|
202
202
|
interface NavProps extends React.HTMLAttributes<HTMLElement> {
|
|
203
|
-
items: NavItem$
|
|
203
|
+
items: NavItem$2[];
|
|
204
204
|
variant?: "primary" | "secondary" | "outline" | "ghost";
|
|
205
205
|
orientation?: "horizontal" | "vertical";
|
|
206
206
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
207
207
|
mobileBreakpoint?: "sm" | "md" | "lg";
|
|
208
|
+
mobileMenuDirection?: "top" | "left" | "right";
|
|
208
209
|
logo?: React.ReactNode;
|
|
209
210
|
actions?: React.ReactNode;
|
|
210
211
|
sticky?: boolean;
|
|
211
212
|
activeId?: string;
|
|
212
|
-
onItemClick?: (item: NavItem$
|
|
213
|
+
onItemClick?: (item: NavItem$2) => void;
|
|
213
214
|
}
|
|
214
215
|
declare const Nav: React.ForwardRefExoticComponent<NavProps & React.RefAttributes<HTMLElement>>;
|
|
215
216
|
|
|
217
|
+
interface NavItem$1 {
|
|
218
|
+
id: string;
|
|
219
|
+
label: string;
|
|
220
|
+
icon?: React.ReactNode;
|
|
221
|
+
}
|
|
222
|
+
interface NavSection$1 {
|
|
223
|
+
title: string;
|
|
224
|
+
items: NavItem$1[];
|
|
225
|
+
}
|
|
226
|
+
interface DrawerProps {
|
|
227
|
+
title: string;
|
|
228
|
+
subtitle?: string;
|
|
229
|
+
items?: NavItem$1[];
|
|
230
|
+
sections?: NavSection$1[];
|
|
231
|
+
activeItem: string;
|
|
232
|
+
onItemClick: (itemId: string) => void;
|
|
233
|
+
footer?: React.ReactNode;
|
|
234
|
+
position?: "left" | "right";
|
|
235
|
+
}
|
|
236
|
+
declare function Drawer({ title, subtitle, items, sections, activeItem, onItemClick, footer, position, }: DrawerProps): react_jsx_runtime.JSX.Element;
|
|
237
|
+
|
|
216
238
|
interface NavItem {
|
|
217
239
|
id: string;
|
|
218
240
|
label: string;
|
|
@@ -525,6 +547,23 @@ interface NavTheme {
|
|
|
525
547
|
borderRadius: string;
|
|
526
548
|
gap: string;
|
|
527
549
|
}
|
|
550
|
+
interface ZIndexScale {
|
|
551
|
+
dropdown: number;
|
|
552
|
+
popover: number;
|
|
553
|
+
tooltip: number;
|
|
554
|
+
overlay: number;
|
|
555
|
+
nav: number;
|
|
556
|
+
navMobileOverlay: number;
|
|
557
|
+
navMobileMenu: number;
|
|
558
|
+
drawerHeader: number;
|
|
559
|
+
drawerButton: number;
|
|
560
|
+
drawerOverlay: number;
|
|
561
|
+
drawerPanel: number;
|
|
562
|
+
modalBackdrop: number;
|
|
563
|
+
modal: number;
|
|
564
|
+
snackbar: number;
|
|
565
|
+
toast: number;
|
|
566
|
+
}
|
|
528
567
|
interface ComponentThemes {
|
|
529
568
|
button: ButtonTheme;
|
|
530
569
|
card: CardTheme;
|
|
@@ -541,6 +580,7 @@ interface Theme {
|
|
|
541
580
|
spacing: ThemeSpacing;
|
|
542
581
|
borderRadius: ThemeBorderRadius;
|
|
543
582
|
typography: ThemeTypography;
|
|
583
|
+
zIndex: ZIndexScale;
|
|
544
584
|
components: ComponentThemes;
|
|
545
585
|
}
|
|
546
586
|
|
|
@@ -557,4 +597,4 @@ declare function useTheme(): ThemeContextType;
|
|
|
557
597
|
|
|
558
598
|
declare function cn(...inputs: ClassValue[]): string;
|
|
559
599
|
|
|
560
|
-
export { Alert, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Dropdown, EmptyState, Input, Nav, type NavItem$
|
|
600
|
+
export { Alert, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CheckboxGroup, CodeSnippet, Container, Drawer, type NavItem$1 as DrawerNavItem, type NavSection$1 as DrawerNavSection, type DrawerProps, Dropdown, EmptyState, Input, Nav, type NavItem$2 as NavItem, type NavProps, type NavSection, RadioGroup, SectionLayout, SidebarNav, type NavItem as SidebarNavItem, Spinner, type Theme, ThemeProvider, cn, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
CheckboxGroup: () => CheckboxGroup,
|
|
45
45
|
CodeSnippet: () => CodeSnippet,
|
|
46
46
|
Container: () => Container,
|
|
47
|
+
Drawer: () => Drawer,
|
|
47
48
|
Dropdown: () => Dropdown,
|
|
48
49
|
EmptyState: () => EmptyState,
|
|
49
50
|
Input: () => Input,
|
|
@@ -1086,6 +1087,7 @@ var Nav = import_react12.default.forwardRef(
|
|
|
1086
1087
|
orientation = "horizontal",
|
|
1087
1088
|
size = "md",
|
|
1088
1089
|
mobileBreakpoint = "md",
|
|
1090
|
+
mobileMenuDirection = "top",
|
|
1089
1091
|
logo,
|
|
1090
1092
|
actions,
|
|
1091
1093
|
sticky = false,
|
|
@@ -1119,9 +1121,12 @@ var Nav = import_react12.default.forwardRef(
|
|
|
1119
1121
|
document.removeEventListener("keydown", handleEscape);
|
|
1120
1122
|
};
|
|
1121
1123
|
}, []);
|
|
1124
|
+
(0, import_react12.useEffect)(() => {
|
|
1125
|
+
setIsMobileMenuOpen(false);
|
|
1126
|
+
}, [mobileMenuDirection]);
|
|
1122
1127
|
const baseStyles = cn(
|
|
1123
1128
|
"bg-[var(--color-background)] border-b border-[var(--color-border)]",
|
|
1124
|
-
sticky && "sticky top-0 z-
|
|
1129
|
+
sticky && "sticky top-0 [z-index:var(--z-index-nav)]"
|
|
1125
1130
|
);
|
|
1126
1131
|
const containerStyles = cn(
|
|
1127
1132
|
"[min-height:var(--nav-height)]",
|
|
@@ -1311,32 +1316,66 @@ var Nav = import_react12.default.forwardRef(
|
|
|
1311
1316
|
children: isMobileMenuOpen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react2.X, { className: "w-6 h-6" }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react2.Menu, { className: "w-6 h-6" })
|
|
1312
1317
|
}
|
|
1313
1318
|
),
|
|
1314
|
-
isMobileMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime13.
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1319
|
+
isMobileMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1320
|
+
"div",
|
|
1321
|
+
{
|
|
1322
|
+
className: cn(
|
|
1323
|
+
"fixed inset-0 bg-black/50 [z-index:var(--z-index-nav-mobile-overlay)]",
|
|
1324
|
+
breakpointClasses[mobileBreakpoint]
|
|
1325
|
+
),
|
|
1326
|
+
onClick: () => setIsMobileMenuOpen(false)
|
|
1327
|
+
}
|
|
1328
|
+
),
|
|
1329
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1330
|
+
"div",
|
|
1331
|
+
{
|
|
1332
|
+
className: cn(
|
|
1333
|
+
"fixed bg-[var(--color-background)] shadow-lg [z-index:var(--z-index-nav-mobile-menu)] overflow-y-auto transition-transform duration-300 ease-in-out",
|
|
1334
|
+
breakpointClasses[mobileBreakpoint],
|
|
1335
|
+
// Always hide when closed
|
|
1336
|
+
!isMobileMenuOpen && "invisible",
|
|
1337
|
+
// Direction-specific positioning and animation
|
|
1338
|
+
mobileMenuDirection === "top" && [
|
|
1339
|
+
"top-0 left-0 right-0 border-b border-[var(--color-border)] max-h-screen",
|
|
1340
|
+
isMobileMenuOpen ? "translate-y-0" : "-translate-y-full"
|
|
1341
|
+
],
|
|
1342
|
+
mobileMenuDirection === "left" && [
|
|
1343
|
+
"top-0 left-0 bottom-0 w-64 border-r border-[var(--color-border)]",
|
|
1344
|
+
isMobileMenuOpen ? "translate-x-0" : "-translate-x-full"
|
|
1345
|
+
],
|
|
1346
|
+
mobileMenuDirection === "right" && [
|
|
1347
|
+
"top-0 right-0 bottom-0 w-64 border-l border-[var(--color-border)]",
|
|
1348
|
+
isMobileMenuOpen ? "translate-x-0" : "translate-x-full"
|
|
1349
|
+
]
|
|
1350
|
+
),
|
|
1351
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1352
|
+
"div",
|
|
1353
|
+
{
|
|
1354
|
+
className: cn(
|
|
1355
|
+
"flex flex-col",
|
|
1356
|
+
mobileMenuDirection === "top" ? "py-2" : "space-y-1 px-2 pt-2"
|
|
1357
|
+
),
|
|
1358
|
+
children: items.map((item) => renderNavItem(item, true))
|
|
1359
|
+
}
|
|
1360
|
+
)
|
|
1361
|
+
}
|
|
1362
|
+
)
|
|
1324
1363
|
] });
|
|
1325
1364
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("nav", { ref, className: cn(baseStyles, className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: containerStyles, children: [
|
|
1326
|
-
logo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "
|
|
1365
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "shrink-0", children: logo }),
|
|
1327
1366
|
desktopNav,
|
|
1328
|
-
actions && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "
|
|
1367
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "shrink-0 flex items-center gap-2", children: actions }),
|
|
1329
1368
|
mobileNav
|
|
1330
1369
|
] }) });
|
|
1331
1370
|
}
|
|
1332
1371
|
);
|
|
1333
1372
|
Nav.displayName = "Nav";
|
|
1334
1373
|
|
|
1335
|
-
// src/layout/
|
|
1374
|
+
// src/layout/drawer.tsx
|
|
1336
1375
|
var import_react13 = require("react");
|
|
1337
1376
|
var import_lucide_react3 = require("lucide-react");
|
|
1338
1377
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1339
|
-
function
|
|
1378
|
+
function Drawer({
|
|
1340
1379
|
title,
|
|
1341
1380
|
subtitle,
|
|
1342
1381
|
items,
|
|
@@ -1354,7 +1393,7 @@ function SidebarNav({
|
|
|
1354
1393
|
};
|
|
1355
1394
|
const useSections = sections || (items ? [{ title: "", items }] : []);
|
|
1356
1395
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
1357
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "lg:hidden fixed top-0 left-0 right-0
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "lg:hidden fixed top-0 left-0 right-0 bg-white border-b border-gray-200 px-4 py-3 [z-index:var(--z-index-drawer-header)]", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1358
1397
|
"div",
|
|
1359
1398
|
{
|
|
1360
1399
|
className: `flex items-center ${isLeft ? "justify-between" : "justify-between flex-row-reverse"}`,
|
|
@@ -1363,7 +1402,7 @@ function SidebarNav({
|
|
|
1363
1402
|
"button",
|
|
1364
1403
|
{
|
|
1365
1404
|
onClick: () => setMobileMenuOpen(!mobileMenuOpen),
|
|
1366
|
-
className: "p-2 rounded-lg hover:bg-gray-100 transition-colors",
|
|
1405
|
+
className: "p-2 rounded-lg hover:bg-gray-100 transition-colors relative [z-index:var(--z-index-drawer-button)]",
|
|
1367
1406
|
"aria-label": "Toggle menu",
|
|
1368
1407
|
children: mobileMenuOpen ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react3.X, { className: "w-6 h-6 text-gray-700" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react3.Menu, { className: "w-6 h-6 text-gray-700" })
|
|
1369
1408
|
}
|
|
@@ -1379,7 +1418,7 @@ function SidebarNav({
|
|
|
1379
1418
|
"div",
|
|
1380
1419
|
{
|
|
1381
1420
|
className: "fixed inset-0 bg-black/50 lg:hidden",
|
|
1382
|
-
style: { zIndex:
|
|
1421
|
+
style: { zIndex: 9998 },
|
|
1383
1422
|
onClick: () => setMobileMenuOpen(false)
|
|
1384
1423
|
}
|
|
1385
1424
|
),
|
|
@@ -1387,18 +1426,33 @@ function SidebarNav({
|
|
|
1387
1426
|
"aside",
|
|
1388
1427
|
{
|
|
1389
1428
|
className: `
|
|
1390
|
-
fixed top-0
|
|
1429
|
+
fixed top-0 bottom-0 w-64 bg-white
|
|
1391
1430
|
transition-transform duration-300 ease-in-out overflow-y-auto
|
|
1392
1431
|
${isLeft ? "left-0 border-r" : "right-0 border-l"} border-gray-200
|
|
1393
|
-
lg:translate-x-0
|
|
1394
|
-
${mobileMenuOpen ? "translate-x-0" : `${isLeft ? "-translate-x-full" : "translate-x-full"}
|
|
1432
|
+
lg:translate-x-0 lg:top-0
|
|
1433
|
+
${mobileMenuOpen ? "translate-x-0 top-0" : `${isLeft ? "-translate-x-full" : "translate-x-full"} top-0`}
|
|
1395
1434
|
`,
|
|
1435
|
+
style: mobileMenuOpen && typeof window !== "undefined" && window.innerWidth < 1024 ? { zIndex: 9999 } : void 0,
|
|
1396
1436
|
children: [
|
|
1397
1437
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "hidden lg:block p-6 border-b border-gray-200", children: [
|
|
1398
1438
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h1", { className: "text-xl font-bold text-gray-900", children: title }),
|
|
1399
1439
|
subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs text-gray-500 mt-1", children: subtitle })
|
|
1400
1440
|
] }),
|
|
1401
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.
|
|
1441
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "lg:hidden p-4 border-b border-gray-200 flex items-center justify-between", children: [
|
|
1442
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
|
|
1443
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h1", { className: "text-lg font-bold text-gray-900", children: title }),
|
|
1444
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-xs text-gray-500 mt-1", children: subtitle })
|
|
1445
|
+
] }),
|
|
1446
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1447
|
+
"button",
|
|
1448
|
+
{
|
|
1449
|
+
onClick: () => setMobileMenuOpen(false),
|
|
1450
|
+
className: "p-2 rounded-lg hover:bg-gray-100 transition-colors",
|
|
1451
|
+
"aria-label": "Close menu",
|
|
1452
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react3.X, { className: "w-5 h-5 text-gray-700" })
|
|
1453
|
+
}
|
|
1454
|
+
)
|
|
1455
|
+
] }),
|
|
1402
1456
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("nav", { className: "p-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: sectionIndex > 0 ? "mt-6" : "", children: [
|
|
1403
1457
|
section.title && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "px-4 mb-2 text-xs font-semibold text-gray-500 uppercase tracking-wider", children: section.title }),
|
|
1404
1458
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "space-y-1", children: section.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
@@ -1423,12 +1477,103 @@ function SidebarNav({
|
|
|
1423
1477
|
] });
|
|
1424
1478
|
}
|
|
1425
1479
|
|
|
1426
|
-
// src/
|
|
1427
|
-
var import_react14 =
|
|
1480
|
+
// src/layout/sidebar-nav.tsx
|
|
1481
|
+
var import_react14 = require("react");
|
|
1482
|
+
var import_lucide_react4 = require("lucide-react");
|
|
1428
1483
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1429
|
-
|
|
1484
|
+
function SidebarNav({
|
|
1485
|
+
title,
|
|
1486
|
+
subtitle,
|
|
1487
|
+
items,
|
|
1488
|
+
sections,
|
|
1489
|
+
activeItem,
|
|
1490
|
+
onItemClick,
|
|
1491
|
+
footer,
|
|
1492
|
+
position = "right"
|
|
1493
|
+
}) {
|
|
1494
|
+
const [mobileMenuOpen, setMobileMenuOpen] = (0, import_react14.useState)(false);
|
|
1495
|
+
const isLeft = position === "left";
|
|
1496
|
+
const handleItemClick = (itemId) => {
|
|
1497
|
+
onItemClick(itemId);
|
|
1498
|
+
setMobileMenuOpen(false);
|
|
1499
|
+
};
|
|
1500
|
+
const useSections = sections || (items ? [{ title: "", items }] : []);
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "lg:hidden fixed top-0 left-0 right-0 z-50 bg-white border-b border-gray-200 px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1503
|
+
"div",
|
|
1504
|
+
{
|
|
1505
|
+
className: `flex items-center ${isLeft ? "justify-between" : "justify-between flex-row-reverse"}`,
|
|
1506
|
+
children: [
|
|
1507
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1508
|
+
"button",
|
|
1509
|
+
{
|
|
1510
|
+
onClick: () => setMobileMenuOpen(!mobileMenuOpen),
|
|
1511
|
+
className: "p-2 rounded-lg hover:bg-gray-100 transition-colors",
|
|
1512
|
+
"aria-label": "Toggle menu",
|
|
1513
|
+
children: mobileMenuOpen ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.X, { className: "w-6 h-6 text-gray-700" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react4.Menu, { className: "w-6 h-6 text-gray-700" })
|
|
1514
|
+
}
|
|
1515
|
+
),
|
|
1516
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
|
|
1517
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h1", { className: "text-lg font-bold text-gray-900", children: title }),
|
|
1518
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-gray-500", children: subtitle })
|
|
1519
|
+
] })
|
|
1520
|
+
]
|
|
1521
|
+
}
|
|
1522
|
+
) }),
|
|
1523
|
+
mobileMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1524
|
+
"div",
|
|
1525
|
+
{
|
|
1526
|
+
className: "fixed inset-0 bg-black/50 lg:hidden",
|
|
1527
|
+
style: { zIndex: 35 },
|
|
1528
|
+
onClick: () => setMobileMenuOpen(false)
|
|
1529
|
+
}
|
|
1530
|
+
),
|
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1532
|
+
"aside",
|
|
1533
|
+
{
|
|
1534
|
+
className: `
|
|
1535
|
+
fixed top-0 h-screen w-64 bg-white z-40
|
|
1536
|
+
transition-transform duration-300 ease-in-out overflow-y-auto
|
|
1537
|
+
${isLeft ? "left-0 border-r" : "right-0 border-l"} border-gray-200
|
|
1538
|
+
lg:translate-x-0
|
|
1539
|
+
${mobileMenuOpen ? "translate-x-0" : `${isLeft ? "-translate-x-full" : "translate-x-full"} lg:translate-x-0`}
|
|
1540
|
+
`,
|
|
1541
|
+
children: [
|
|
1542
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "hidden lg:block p-6 border-b border-gray-200", children: [
|
|
1543
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h1", { className: "text-xl font-bold text-gray-900", children: title }),
|
|
1544
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "text-xs text-gray-500 mt-1", children: subtitle })
|
|
1545
|
+
] }),
|
|
1546
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "lg:hidden h-[57px]", "aria-hidden": "true" }),
|
|
1547
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("nav", { className: "p-4", children: useSections.map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: sectionIndex > 0 ? "mt-6" : "", children: [
|
|
1548
|
+
section.title && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h3", { className: "px-4 mb-2 text-xs font-semibold text-gray-500 uppercase tracking-wider", children: section.title }),
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("ul", { className: "space-y-1", children: section.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
1550
|
+
"button",
|
|
1551
|
+
{
|
|
1552
|
+
onClick: () => handleItemClick(item.id),
|
|
1553
|
+
className: `
|
|
1554
|
+
w-full flex items-center gap-3 px-4 py-3 rounded-lg text-sm font-medium transition-colors
|
|
1555
|
+
${activeItem === item.id ? "bg-blue-50 text-blue-700" : "text-gray-700 hover:bg-gray-50"}
|
|
1556
|
+
`,
|
|
1557
|
+
children: [
|
|
1558
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "shrink-0", children: item.icon }),
|
|
1559
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: item.label })
|
|
1560
|
+
]
|
|
1561
|
+
}
|
|
1562
|
+
) }, item.id)) })
|
|
1563
|
+
] }, sectionIndex)) }),
|
|
1564
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "p-4 border-t border-gray-200 mt-auto", children: footer })
|
|
1565
|
+
]
|
|
1566
|
+
}
|
|
1567
|
+
)
|
|
1568
|
+
] });
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
// src/shared/empty-state.tsx
|
|
1572
|
+
var import_react15 = __toESM(require("react"));
|
|
1573
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1574
|
+
var EmptyState = import_react15.default.forwardRef(
|
|
1430
1575
|
({ className, icon, title, description, action, ...props }, ref) => {
|
|
1431
|
-
return /* @__PURE__ */ (0,
|
|
1576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
1432
1577
|
"div",
|
|
1433
1578
|
{
|
|
1434
1579
|
ref,
|
|
@@ -1438,10 +1583,10 @@ var EmptyState = import_react14.default.forwardRef(
|
|
|
1438
1583
|
),
|
|
1439
1584
|
...props,
|
|
1440
1585
|
children: [
|
|
1441
|
-
icon && /* @__PURE__ */ (0,
|
|
1442
|
-
/* @__PURE__ */ (0,
|
|
1443
|
-
description && /* @__PURE__ */ (0,
|
|
1444
|
-
action && /* @__PURE__ */ (0,
|
|
1586
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "mb-4 text-gray-400", children: icon }),
|
|
1587
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-2", children: title }),
|
|
1588
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-sm text-gray-500 mb-6 max-w-sm", children: description }),
|
|
1589
|
+
action && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: action })
|
|
1445
1590
|
]
|
|
1446
1591
|
}
|
|
1447
1592
|
);
|
|
@@ -1450,7 +1595,7 @@ var EmptyState = import_react14.default.forwardRef(
|
|
|
1450
1595
|
EmptyState.displayName = "EmptyState";
|
|
1451
1596
|
|
|
1452
1597
|
// src/shared/contexts/ThemeContext.tsx
|
|
1453
|
-
var
|
|
1598
|
+
var import_react16 = require("react");
|
|
1454
1599
|
|
|
1455
1600
|
// src/styles/themes/default.json
|
|
1456
1601
|
var default_default = {
|
|
@@ -1555,6 +1700,23 @@ var default_default = {
|
|
|
1555
1700
|
bold: "700"
|
|
1556
1701
|
}
|
|
1557
1702
|
},
|
|
1703
|
+
zIndex: {
|
|
1704
|
+
dropdown: 1e3,
|
|
1705
|
+
popover: 1100,
|
|
1706
|
+
tooltip: 1500,
|
|
1707
|
+
overlay: 1200,
|
|
1708
|
+
nav: 50,
|
|
1709
|
+
navMobileOverlay: 60,
|
|
1710
|
+
navMobileMenu: 70,
|
|
1711
|
+
drawerHeader: 100,
|
|
1712
|
+
drawerButton: 101,
|
|
1713
|
+
drawerOverlay: 90,
|
|
1714
|
+
drawerPanel: 95,
|
|
1715
|
+
modalBackdrop: 1300,
|
|
1716
|
+
modal: 1400,
|
|
1717
|
+
snackbar: 1600,
|
|
1718
|
+
toast: 1700
|
|
1719
|
+
},
|
|
1558
1720
|
components: {
|
|
1559
1721
|
button: {
|
|
1560
1722
|
padding: {
|
|
@@ -1715,10 +1877,10 @@ var default_default = {
|
|
|
1715
1877
|
};
|
|
1716
1878
|
|
|
1717
1879
|
// src/shared/contexts/ThemeContext.tsx
|
|
1718
|
-
var
|
|
1719
|
-
var ThemeContext = (0,
|
|
1880
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1881
|
+
var ThemeContext = (0, import_react16.createContext)(void 0);
|
|
1720
1882
|
function ThemeProvider({ children }) {
|
|
1721
|
-
const [theme, setThemeState] = (0,
|
|
1883
|
+
const [theme, setThemeState] = (0, import_react16.useState)(default_default);
|
|
1722
1884
|
const applyTheme = (newTheme) => {
|
|
1723
1885
|
const root = document.documentElement;
|
|
1724
1886
|
const colors = newTheme.colors;
|
|
@@ -1845,6 +2007,9 @@ function ThemeProvider({ children }) {
|
|
|
1845
2007
|
});
|
|
1846
2008
|
root.style.setProperty("--nav-border-radius", nav.borderRadius);
|
|
1847
2009
|
root.style.setProperty("--nav-gap", nav.gap);
|
|
2010
|
+
Object.entries(newTheme.zIndex).forEach(([key, value]) => {
|
|
2011
|
+
root.style.setProperty(`--z-index-${key}`, value.toString());
|
|
2012
|
+
});
|
|
1848
2013
|
setThemeState(newTheme);
|
|
1849
2014
|
};
|
|
1850
2015
|
const setTheme = (newTheme) => {
|
|
@@ -1859,7 +2024,7 @@ function ThemeProvider({ children }) {
|
|
|
1859
2024
|
localStorage.removeItem("theme");
|
|
1860
2025
|
}
|
|
1861
2026
|
};
|
|
1862
|
-
(0,
|
|
2027
|
+
(0, import_react16.useEffect)(() => {
|
|
1863
2028
|
if (typeof window !== "undefined") {
|
|
1864
2029
|
const savedTheme = localStorage.getItem("theme");
|
|
1865
2030
|
if (savedTheme) {
|
|
@@ -1875,10 +2040,10 @@ function ThemeProvider({ children }) {
|
|
|
1875
2040
|
}
|
|
1876
2041
|
}
|
|
1877
2042
|
}, []);
|
|
1878
|
-
return /* @__PURE__ */ (0,
|
|
2043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ThemeContext.Provider, { value: { theme, setTheme, applyTheme, resetTheme }, children });
|
|
1879
2044
|
}
|
|
1880
2045
|
function useTheme() {
|
|
1881
|
-
const context = (0,
|
|
2046
|
+
const context = (0, import_react16.useContext)(ThemeContext);
|
|
1882
2047
|
if (context === void 0) {
|
|
1883
2048
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
1884
2049
|
}
|
|
@@ -1899,6 +2064,7 @@ function useTheme() {
|
|
|
1899
2064
|
CheckboxGroup,
|
|
1900
2065
|
CodeSnippet,
|
|
1901
2066
|
Container,
|
|
2067
|
+
Drawer,
|
|
1902
2068
|
Dropdown,
|
|
1903
2069
|
EmptyState,
|
|
1904
2070
|
Input,
|