@caratlogic/design-system 0.0.9 → 0.0.10

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.
@@ -0,0 +1,84 @@
1
+ import type { LucideIcon } from 'lucide-react';
2
+ import type { ReactNode } from 'react';
3
+ /** One breadcrumb segment. When `href` is set the crumb renders as a link. */
4
+ export interface PageBreadcrumbCrumb {
5
+ label: string;
6
+ href?: string;
7
+ }
8
+ /** Page heading/breadcrumb metadata — the consuming app computes this
9
+ * (e.g. via its own `usePageMeta`) and passes it in. */
10
+ export interface PageMeta {
11
+ title?: string;
12
+ subtitle?: string;
13
+ breadcrumb?: PageBreadcrumbCrumb[];
14
+ }
15
+ export interface AppShellNavSubItem {
16
+ path: string;
17
+ label: string;
18
+ icon?: LucideIcon;
19
+ /** `false` hides the item. The app resolves permission/role gating to this. */
20
+ visible?: boolean;
21
+ }
22
+ export interface AppShellNavItem {
23
+ label: string;
24
+ /** Leaf items have a `path`; parent items have `children`. */
25
+ path?: string;
26
+ icon?: LucideIcon;
27
+ badge?: ReactNode;
28
+ /** `false` hides the item. The app resolves permission/role gating to this. */
29
+ visible?: boolean;
30
+ children?: AppShellNavSubItem[];
31
+ }
32
+ export interface AppShellNavGroup {
33
+ /** Optional section label rendered above the group. */
34
+ label?: string;
35
+ items: AppShellNavItem[];
36
+ }
37
+ export interface AppShellBrand {
38
+ /** Logo shown when the sidebar is expanded. */
39
+ full: ReactNode;
40
+ /** Compact mark shown when the sidebar is collapsed to icons. */
41
+ compact: ReactNode;
42
+ }
43
+ export interface AppShellUser {
44
+ name: string;
45
+ email?: string;
46
+ avatarSrc?: string;
47
+ showStatusDot?: boolean;
48
+ }
49
+ export interface AppShellMenuAction {
50
+ label: string;
51
+ icon?: LucideIcon;
52
+ onClick: () => void;
53
+ destructive?: boolean;
54
+ }
55
+ export type AppShellNotificationsIndicator = 'destructive' | 'success' | 'warning' | false;
56
+ export interface DashboardShellProps {
57
+ brand: AppShellBrand;
58
+ /** Pre-gated, pre-grouped navigation. The app resolves `visible` + sections. */
59
+ navGroups: AppShellNavGroup[];
60
+ /** Current route path (app passes `location.pathname`) — drives active state. */
61
+ currentPath: string;
62
+ /** Called with an item's `path` on click. The app wires this to its router. */
63
+ onNavigate: (path: string) => void;
64
+ /** Header title/breadcrumb — the app computes it (route tables stay app-local). */
65
+ pageMeta?: PageMeta;
66
+ /** Overrides the last breadcrumb crumb's label (e.g. a dynamic entity name). */
67
+ breadcrumbLeafOverride?: string;
68
+ user: AppShellUser;
69
+ profileMenuItems?: AppShellMenuAction[];
70
+ onLogout: () => void;
71
+ showThemeToggle?: boolean;
72
+ isDark?: boolean;
73
+ onToggleTheme?: () => void;
74
+ showNotifications?: boolean;
75
+ notificationsIndicator?: AppShellNotificationsIndicator;
76
+ onNotificationsClick?: () => void;
77
+ /** App-specific header actions (e.g. a barcode scanner), rendered leftmost. */
78
+ headerActionsSlot?: ReactNode;
79
+ /** Sidebar width CSS value. @default '248px' */
80
+ sidebarWidth?: string;
81
+ /** Page content. Apps using nested routing pass their `<Outlet />` here. */
82
+ children: ReactNode;
83
+ }
84
+ //# sourceMappingURL=AppShell.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppShell.types.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/AppShell/AppShell.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,8EAA8E;AAC9E,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;yDACyD;AACzD,MAAM,WAAW,QAAQ;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACpC;AAED,M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AAW,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,mFAAmF;IACnF,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,gFAAgF;IAChF,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC,IAAI,EAAE,YAAY,CAAC;IACnB,gBAAgB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACxC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAErB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAE3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,8BAA8B,CAAC;IACxD,oBAAoB,CAAC,EAAE,MAAM,IAAI,CAAC;IAElC,+EAA+E;IAC/E,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAE9B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,4EAA4E;IAC5E,QAAQ,EAAE,SAAS,CAAC;CACrB"}
@@ -0,0 +1,5 @@
1
+ /** Active when the current path equals the target or is nested under it. */
2
+ export declare function isPathActive(currentPath: string, target?: string): boolean;
3
+ /** Up-to-two-letter initials from a name, for the profile-menu avatar. */
4
+ export declare function getInitials(name: string): string;
5
+ //# sourceMappingURL=AppShell.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppShell.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/AppShell/AppShell.utils.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAG1E;AAED,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAUhD"}
@@ -0,0 +1,4 @@
1
+ import type { FC } from 'react';
2
+ import type { DashboardShellProps } from './AppShell.types';
3
+ export declare const DashboardShell: FC<DashboardShellProps>;
4
+ //# sourceMappingURL=DashboardShell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DashboardShell.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/AppShell/DashboardShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,EAAE,EAAE,MAAM,OAAO,CAAC;AAsC/C,OAAO,KAAK,EAMV,mBAAmB,EAEpB,MAAM,kBAAkB,CAAC;AA6S1B,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAkDlD,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { DashboardShell } from './DashboardShell';
2
+ export { isPathActive, getInitials } from './AppShell.utils';
3
+ export type { PageBreadcrumbCrumb, PageMeta, AppShellNavSubItem, AppShellNavItem, AppShellNavGroup, AppShellBrand, AppShellUser, AppShellMenuAction, AppShellNotificationsIndicator, DashboardShellProps, } from './AppShell.types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/AppShell/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC7D,YAAY,EACV,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,8BAA8B,EAC9B,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}