@teja-app/ui 0.0.2 → 0.0.3

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.
Files changed (32) hide show
  1. package/dist/components/Sidebar/Sidebar.d.ts +36 -0
  2. package/dist/components/Sidebar/Sidebar.d.ts.map +1 -0
  3. package/dist/components/Sidebar/Sidebar.types.d.ts +196 -0
  4. package/dist/components/Sidebar/Sidebar.types.d.ts.map +1 -0
  5. package/dist/components/Sidebar/SidebarDivider.d.ts +12 -0
  6. package/dist/components/Sidebar/SidebarDivider.d.ts.map +1 -0
  7. package/dist/components/Sidebar/SidebarGroup.d.ts +26 -0
  8. package/dist/components/Sidebar/SidebarGroup.d.ts.map +1 -0
  9. package/dist/components/Sidebar/SidebarItem.d.ts +23 -0
  10. package/dist/components/Sidebar/SidebarItem.d.ts.map +1 -0
  11. package/dist/components/Sidebar/index.d.ts +9 -0
  12. package/dist/components/Sidebar/index.d.ts.map +1 -0
  13. package/dist/components/index.d.ts +1 -0
  14. package/dist/components/index.d.ts.map +1 -1
  15. package/dist/hooks/index.cjs +7 -6
  16. package/dist/hooks/index.cjs.map +1 -1
  17. package/dist/hooks/index.d.ts +2 -0
  18. package/dist/hooks/index.d.ts.map +1 -1
  19. package/dist/hooks/index.js +3 -2
  20. package/dist/hooks/useSidebar.d.ts +39 -0
  21. package/dist/hooks/useSidebar.d.ts.map +1 -0
  22. package/dist/index.cjs +482 -37
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.js +1323 -878
  25. package/dist/index.js.map +1 -1
  26. package/dist/{useSelection-BK6u5Ezx.js → useSidebar-BWe09WbE.js} +109 -2
  27. package/dist/useSidebar-BWe09WbE.js.map +1 -0
  28. package/dist/{useSelection-DyXUWnGK.cjs → useSidebar-d1VZFhxd.cjs} +108 -1
  29. package/dist/useSidebar-d1VZFhxd.cjs.map +1 -0
  30. package/package.json +1 -1
  31. package/dist/useSelection-BK6u5Ezx.js.map +0 -1
  32. package/dist/useSelection-DyXUWnGK.cjs.map +0 -1
@@ -0,0 +1,36 @@
1
+ import type { SidebarProps } from './Sidebar.types';
2
+ /**
3
+ * Sidebar component provides a responsive navigation container with support
4
+ * for multiple navigation zones, mobile overlay, and collapsible desktop mode.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * <Sidebar
9
+ * navigation={{
10
+ * primary: [{
11
+ * key: 'main',
12
+ * items: [
13
+ * { key: 'home', label: 'Home', href: '/dashboard', icon: <HomeIcon /> },
14
+ * { key: 'calendar', label: 'Calendar', href: '/calendar', icon: <CalendarIcon /> },
15
+ * ],
16
+ * }],
17
+ * secondary: [{
18
+ * key: 'tools',
19
+ * items: [
20
+ * { key: 'admin', label: 'Admin', href: '/admin', visible: hasAdminAccess },
21
+ * ],
22
+ * }],
23
+ * bottom: [{
24
+ * key: 'settings',
25
+ * items: [
26
+ * { key: 'settings', label: 'Settings', href: '/settings', icon: <CogIcon /> },
27
+ * ],
28
+ * }],
29
+ * }}
30
+ * currentPath={pathname}
31
+ * LinkComponent={Link}
32
+ * />
33
+ * ```
34
+ */
35
+ export declare const Sidebar: import("react").ForwardRefExoticComponent<SidebarProps & import("react").RefAttributes<HTMLElement>>;
36
+ //# sourceMappingURL=Sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/Sidebar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,iBAAiB,CAAC;AAepE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,OAAO,sGAkQnB,CAAC"}
@@ -0,0 +1,196 @@
1
+ import type { HTMLAttributes, ReactNode, ComponentType } from 'react';
2
+ /**
3
+ * Active state matcher type
4
+ * - 'exact': path === href
5
+ * - 'startsWith': path.startsWith(href)
6
+ * - function: custom matching logic
7
+ */
8
+ export type ActiveMatcher = 'exact' | 'startsWith' | ((currentPath: string, href: string) => boolean);
9
+ /**
10
+ * Permission check function type
11
+ */
12
+ export type PermissionCheck = () => boolean;
13
+ /**
14
+ * Individual navigation item configuration
15
+ */
16
+ export interface SidebarNavItem {
17
+ /** Unique identifier for the item */
18
+ key: string;
19
+ /** Display label (the sidebar name) */
20
+ label: string;
21
+ /** Navigation href/path */
22
+ href: string;
23
+ /** Icon element to display */
24
+ icon?: ReactNode;
25
+ /** Badge count or text (e.g., notifications) */
26
+ badge?: number | string;
27
+ /** Whether item is disabled */
28
+ disabled?: boolean;
29
+ /** Visibility control - item hidden if false or returns false */
30
+ visible?: boolean | PermissionCheck;
31
+ /** How to determine active state (default: 'exact') */
32
+ activeMatch?: ActiveMatcher;
33
+ /** Nested items for expandable sections */
34
+ children?: SidebarNavItem[];
35
+ /** Click handler for non-navigation actions */
36
+ onClick?: () => void;
37
+ /** Accessibility label override */
38
+ 'aria-label'?: string;
39
+ }
40
+ /**
41
+ * Navigation group configuration
42
+ */
43
+ export interface SidebarNavGroup {
44
+ /** Unique identifier for the group */
45
+ key: string;
46
+ /** Optional group label/heading */
47
+ label?: string;
48
+ /** Navigation items in this group */
49
+ items: SidebarNavItem[];
50
+ /** Visibility control for entire group */
51
+ visible?: boolean | PermissionCheck;
52
+ }
53
+ /**
54
+ * Sidebar size variant
55
+ */
56
+ export type SidebarSize = 'sm' | 'md' | 'lg';
57
+ /**
58
+ * Sidebar visual variant
59
+ */
60
+ export type SidebarVariant = 'default' | 'minimal';
61
+ /**
62
+ * Link component props for router integration
63
+ */
64
+ export interface SidebarLinkProps {
65
+ to: string;
66
+ className?: string;
67
+ children: ReactNode;
68
+ onClick?: () => void;
69
+ title?: string;
70
+ 'aria-current'?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
71
+ 'aria-label'?: string;
72
+ }
73
+ /**
74
+ * Props for SidebarItem component
75
+ */
76
+ export interface SidebarItemProps extends Omit<HTMLAttributes<HTMLElement>, 'onClick'> {
77
+ /** Navigation item configuration */
78
+ item: SidebarNavItem;
79
+ /** Current router path for active detection */
80
+ currentPath?: string;
81
+ /** Size variant */
82
+ size?: SidebarSize;
83
+ /** Whether sidebar is collapsed (icon-only mode) */
84
+ collapsed?: boolean;
85
+ /** Callback when item is clicked */
86
+ onNavigate?: (href: string) => void;
87
+ /** Custom link component (e.g., TanStack Router Link) */
88
+ LinkComponent?: ComponentType<SidebarLinkProps>;
89
+ }
90
+ /**
91
+ * Props for SidebarGroup component
92
+ */
93
+ export interface SidebarGroupProps extends HTMLAttributes<HTMLElement> {
94
+ /** Group configuration */
95
+ group: SidebarNavGroup;
96
+ /** Current router path */
97
+ currentPath?: string;
98
+ /** Size variant */
99
+ size?: SidebarSize;
100
+ /** Whether sidebar is collapsed */
101
+ collapsed?: boolean;
102
+ /** Link component */
103
+ LinkComponent?: ComponentType<SidebarLinkProps>;
104
+ /** Navigation callback */
105
+ onNavigate?: (href: string) => void;
106
+ }
107
+ /**
108
+ * Props for SidebarDivider component
109
+ */
110
+ export interface SidebarDividerProps extends HTMLAttributes<HTMLHRElement> {
111
+ /** Optional label for the divider */
112
+ label?: string;
113
+ }
114
+ /**
115
+ * Props for main Sidebar component
116
+ */
117
+ export interface SidebarProps extends HTMLAttributes<HTMLElement> {
118
+ /** Navigation groups organized by position */
119
+ navigation: {
120
+ /** Featured items at the very top (e.g., AI Assistant button) */
121
+ featured?: SidebarNavGroup[];
122
+ /** Primary navigation items */
123
+ primary?: SidebarNavGroup[];
124
+ /** Secondary navigation items (below divider) */
125
+ secondary?: SidebarNavGroup[];
126
+ /** Bottom navigation items (e.g., Settings) */
127
+ bottom?: SidebarNavGroup[];
128
+ };
129
+ /** Current router path for active detection */
130
+ currentPath?: string;
131
+ /** Whether sidebar is open (for mobile) */
132
+ isOpen?: boolean;
133
+ /** Callback when sidebar should close (mobile) */
134
+ onClose?: () => void;
135
+ /** Whether sidebar is collapsed (desktop) */
136
+ collapsed?: boolean;
137
+ /** Callback when collapse state changes */
138
+ onCollapsedChange?: (collapsed: boolean) => void;
139
+ /** Visual variant */
140
+ variant?: SidebarVariant;
141
+ /** Size of nav items */
142
+ size?: SidebarSize;
143
+ /** Header content (logo, search, etc.) */
144
+ header?: ReactNode;
145
+ /** Footer content (user profile, etc.) */
146
+ footer?: ReactNode;
147
+ /** Custom link component for router integration */
148
+ LinkComponent?: ComponentType<SidebarLinkProps>;
149
+ /** Navigation callback */
150
+ onNavigate?: (href: string) => void;
151
+ /** Whether to show mobile overlay */
152
+ showMobileOverlay?: boolean;
153
+ /** Width when expanded (default: 16rem) */
154
+ width?: string;
155
+ /** Width when collapsed (default: 4rem) */
156
+ collapsedWidth?: string;
157
+ }
158
+ /**
159
+ * Options for useSidebar hook
160
+ */
161
+ export interface UseSidebarOptions {
162
+ /** Initial open state (mobile) */
163
+ defaultOpen?: boolean;
164
+ /** Initial collapsed state (desktop) */
165
+ defaultCollapsed?: boolean;
166
+ /** localStorage key for persisting collapsed state */
167
+ storageKey?: string;
168
+ /** Breakpoint for mobile/desktop switch in pixels (default: 1024) */
169
+ mobileBreakpoint?: number;
170
+ /** Auto-close on mobile navigation */
171
+ autoCloseOnMobile?: boolean;
172
+ }
173
+ /**
174
+ * Return value from useSidebar hook
175
+ */
176
+ export interface UseSidebarReturn {
177
+ /** Whether sidebar is open (mobile) */
178
+ isOpen: boolean;
179
+ /** Toggle open state */
180
+ toggle: () => void;
181
+ /** Open sidebar */
182
+ open: () => void;
183
+ /** Close sidebar */
184
+ close: () => void;
185
+ /** Whether sidebar is collapsed (desktop) */
186
+ collapsed: boolean;
187
+ /** Toggle collapsed state */
188
+ toggleCollapsed: () => void;
189
+ /** Set collapsed state */
190
+ setCollapsed: (collapsed: boolean) => void;
191
+ /** Whether currently in mobile view */
192
+ isMobile: boolean;
193
+ /** Handler for navigation (auto-closes on mobile) */
194
+ handleNavigate: (href: string) => void;
195
+ }
196
+ //# sourceMappingURL=Sidebar.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sidebar.types.d.ts","sourceRoot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,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,kCAAkC;IAClC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,MAAM,EAAE,OAAO,CAAC;IAChB,wBAAwB;IACxB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,mBAAmB;IACnB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,oBAAoB;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,6CAA6C;IAC7C,SAAS,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,0BAA0B;IAC1B,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,uCAAuC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,qDAAqD;IACrD,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC"}
@@ -0,0 +1,12 @@
1
+ import type { SidebarDividerProps } from './Sidebar.types';
2
+ /**
3
+ * SidebarDivider component provides a visual separator between navigation sections.
4
+ *
5
+ * @example
6
+ * ```tsx
7
+ * <SidebarDivider />
8
+ * <SidebarDivider label="More" />
9
+ * ```
10
+ */
11
+ export declare const SidebarDivider: import("react").ForwardRefExoticComponent<SidebarDividerProps & import("react").RefAttributes<HTMLHRElement>>;
12
+ //# sourceMappingURL=SidebarDivider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarDivider.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarDivider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,+GAgC1B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { SidebarGroupProps, SidebarNavGroup } from './Sidebar.types';
2
+ /**
3
+ * Check if a group should be visible based on its visible prop
4
+ */
5
+ declare function shouldShowGroup(group: SidebarNavGroup): boolean;
6
+ /**
7
+ * SidebarGroup component wraps a set of navigation items with an optional heading.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <SidebarGroup
12
+ * group={{
13
+ * key: 'main',
14
+ * label: 'Navigation',
15
+ * items: [
16
+ * { key: 'home', label: 'Home', href: '/dashboard' },
17
+ * { key: 'settings', label: 'Settings', href: '/settings' },
18
+ * ],
19
+ * }}
20
+ * currentPath="/dashboard"
21
+ * />
22
+ * ```
23
+ */
24
+ export declare const SidebarGroup: import("react").ForwardRefExoticComponent<SidebarGroupProps & import("react").RefAttributes<HTMLDivElement>>;
25
+ export { shouldShowGroup };
26
+ //# sourceMappingURL=SidebarGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarGroup.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAG1E;;GAEG;AACH,iBAAS,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAKxD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,8GA6DxB,CAAC;AAIF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { SidebarItemProps, SidebarNavItem, ActiveMatcher } from './Sidebar.types';
2
+ /**
3
+ * Check if an item should be visible based on its visible prop
4
+ */
5
+ declare function shouldShowItem(item: SidebarNavItem): boolean;
6
+ /**
7
+ * Check if an item is active based on current path and matcher
8
+ */
9
+ declare function isItemActive(currentPath: string | undefined, href: string, matcher?: ActiveMatcher): boolean;
10
+ /**
11
+ * SidebarItem component renders an individual navigation item.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * <SidebarItem
16
+ * item={{ key: 'home', label: 'Home', href: '/dashboard', icon: <HomeIcon /> }}
17
+ * currentPath="/dashboard"
18
+ * />
19
+ * ```
20
+ */
21
+ export declare function SidebarItem({ item, currentPath, size, collapsed, onNavigate, LinkComponent, className, ...props }: SidebarItemProps): import("react/jsx-runtime").JSX.Element | null;
22
+ export { shouldShowItem, isItemActive };
23
+ //# sourceMappingURL=SidebarItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarItem.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAiC,MAAM,iBAAiB,CAAC;AAEtH;;GAEG;AACH,iBAAS,cAAc,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAKrD;AAED;;GAEG;AACH,iBAAS,YAAY,CACnB,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,aAAuB,GAC/B,OAAO,CAeT;AAsCD;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,WAAW,EACX,IAAW,EACX,SAAiB,EACjB,UAAU,EACV,aAAa,EACb,SAAS,EACT,GAAG,KAAK,EACT,EAAE,gBAAgB,kDA2HlB;AAED,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Sidebar component exports
3
+ */
4
+ export { Sidebar } from './Sidebar';
5
+ export { SidebarItem } from './SidebarItem';
6
+ export { SidebarGroup } from './SidebarGroup';
7
+ export { SidebarDivider } from './SidebarDivider';
8
+ export type { SidebarProps, SidebarItemProps, SidebarGroupProps, SidebarDividerProps, SidebarNavItem, SidebarNavGroup, SidebarSize, SidebarVariant, SidebarLinkProps, ActiveMatcher, PermissionCheck, UseSidebarOptions, UseSidebarReturn, } from './Sidebar.types';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC"}
@@ -23,4 +23,5 @@ export * from './Skeleton';
23
23
  export * from './EmptyState';
24
24
  export * from './Pagination';
25
25
  export * from './MultiSelect';
26
+ export * from './Sidebar';
26
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const useSelection = require("../useSelection-DyXUWnGK.cjs");
4
- exports.useDebounce = useSelection.useDebounce;
5
- exports.useDebouncedCallback = useSelection.useDebouncedCallback;
6
- exports.useDebouncedCallbackWithControl = useSelection.useDebouncedCallbackWithControl;
7
- exports.useSelection = useSelection.useSelection;
8
- exports.useTable = useSelection.useTable;
3
+ const useSidebar = require("../useSidebar-d1VZFhxd.cjs");
4
+ exports.useDebounce = useSidebar.useDebounce;
5
+ exports.useDebouncedCallback = useSidebar.useDebouncedCallback;
6
+ exports.useDebouncedCallbackWithControl = useSidebar.useDebouncedCallbackWithControl;
7
+ exports.useSelection = useSidebar.useSelection;
8
+ exports.useSidebar = useSidebar.useSidebar;
9
+ exports.useTable = useSidebar.useTable;
9
10
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -4,4 +4,6 @@ export type { UseTableOptions, UseTableReturn, SortState } from './useTable';
4
4
  export type { SortDirection as TableSortDirection } from './useTable';
5
5
  export { useSelection } from './useSelection';
6
6
  export type { UseSelectionOptions, UseSelectionReturn } from './useSelection';
7
+ export { useSidebar } from './useSidebar';
8
+ export type { UseSidebarOptions, UseSidebarReturn } from '../components/Sidebar/Sidebar.types';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7E,YAAY,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC7E,YAAY,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC"}
@@ -1,9 +1,10 @@
1
- import { u, a, b, c, d } from "../useSelection-BK6u5Ezx.js";
1
+ import { u, a, b, c, d, e } from "../useSidebar-BWe09WbE.js";
2
2
  export {
3
3
  u as useDebounce,
4
4
  a as useDebouncedCallback,
5
5
  b as useDebouncedCallbackWithControl,
6
6
  c as useSelection,
7
- d as useTable
7
+ d as useSidebar,
8
+ e as useTable
8
9
  };
9
10
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,39 @@
1
+ import type { UseSidebarOptions, UseSidebarReturn } from '../components/Sidebar/Sidebar.types';
2
+ /**
3
+ * useSidebar hook manages sidebar state including open/collapsed states,
4
+ * localStorage persistence, and responsive behavior.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * function Layout() {
9
+ * const {
10
+ * isOpen,
11
+ * toggle,
12
+ * close,
13
+ * collapsed,
14
+ * toggleCollapsed,
15
+ * isMobile,
16
+ * handleNavigate,
17
+ * } = useSidebar({
18
+ * storageKey: 'sidebar-collapsed',
19
+ * autoCloseOnMobile: true,
20
+ * });
21
+ *
22
+ * return (
23
+ * <>
24
+ * <button onClick={toggle}>Toggle Menu</button>
25
+ * <Sidebar
26
+ * isOpen={isOpen}
27
+ * onClose={close}
28
+ * collapsed={collapsed}
29
+ * onCollapsedChange={setCollapsed}
30
+ * onNavigate={handleNavigate}
31
+ * // ...
32
+ * />
33
+ * </>
34
+ * );
35
+ * }
36
+ * ```
37
+ */
38
+ export declare function useSidebar(options?: UseSidebarOptions): UseSidebarReturn;
39
+ //# sourceMappingURL=useSidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAyB/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CA4H5E"}