@rakeyshgidwani/roger-ui-bank-theme-stan-design 0.1.3 → 0.1.5

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 (164) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/index.d.ts +131 -131
  3. package/dist/index.esm.js +148 -148
  4. package/dist/index.js +148 -148
  5. package/dist/styles.css +1 -1
  6. package/package.json +1 -1
  7. package/src/components/ui/accessibility-demo.tsx +271 -0
  8. package/src/components/ui/advanced-component-architecture-demo.tsx +916 -0
  9. package/src/components/ui/advanced-transition-system-demo.tsx +670 -0
  10. package/src/components/ui/advanced-transition-system.tsx +395 -0
  11. package/src/components/ui/animation/animated-container.tsx +166 -0
  12. package/src/components/ui/animation/index.ts +19 -0
  13. package/src/components/ui/animation/staggered-container.tsx +68 -0
  14. package/src/components/ui/animation-demo.tsx +250 -0
  15. package/src/components/ui/badge.tsx +33 -0
  16. package/src/components/ui/battery-conscious-animation-demo.tsx +568 -0
  17. package/src/components/ui/border-radius-shadow-demo.tsx +187 -0
  18. package/src/components/ui/button.tsx +36 -0
  19. package/src/components/ui/card.tsx +207 -0
  20. package/src/components/ui/checkbox.tsx +30 -0
  21. package/src/components/ui/color-preview.tsx +411 -0
  22. package/src/components/ui/data-display/chart.tsx +653 -0
  23. package/src/components/ui/data-display/data-grid-simple.tsx +76 -0
  24. package/src/components/ui/data-display/data-grid.tsx +680 -0
  25. package/src/components/ui/data-display/list.tsx +456 -0
  26. package/src/components/ui/data-display/table.tsx +482 -0
  27. package/src/components/ui/data-display/timeline.tsx +441 -0
  28. package/src/components/ui/data-display/tree.tsx +602 -0
  29. package/src/components/ui/data-display/types.ts +536 -0
  30. package/src/components/ui/enterprise-mobile-experience-demo.tsx +749 -0
  31. package/src/components/ui/enterprise-mobile-experience.tsx +464 -0
  32. package/src/components/ui/feedback/alert.tsx +157 -0
  33. package/src/components/ui/feedback/progress.tsx +292 -0
  34. package/src/components/ui/feedback/skeleton.tsx +185 -0
  35. package/src/components/ui/feedback/toast.tsx +280 -0
  36. package/src/components/ui/feedback/types.ts +125 -0
  37. package/src/components/ui/font-preview.tsx +288 -0
  38. package/src/components/ui/form-demo.tsx +553 -0
  39. package/src/components/ui/hardware-acceleration-demo.tsx +547 -0
  40. package/src/components/ui/input.tsx +35 -0
  41. package/src/components/ui/label.tsx +16 -0
  42. package/src/components/ui/layout-demo.tsx +367 -0
  43. package/src/components/ui/layouts/adaptive-layout.tsx +139 -0
  44. package/src/components/ui/layouts/desktop-layout.tsx +224 -0
  45. package/src/components/ui/layouts/index.ts +10 -0
  46. package/src/components/ui/layouts/mobile-layout.tsx +162 -0
  47. package/src/components/ui/layouts/tablet-layout.tsx +197 -0
  48. package/src/components/ui/mobile-form-validation.tsx +451 -0
  49. package/src/components/ui/mobile-input-demo.tsx +201 -0
  50. package/src/components/ui/mobile-input.tsx +281 -0
  51. package/src/components/ui/mobile-skeleton-loading-demo.tsx +638 -0
  52. package/src/components/ui/navigation/breadcrumb.tsx +158 -0
  53. package/src/components/ui/navigation/index.ts +36 -0
  54. package/src/components/ui/navigation/menu.tsx +374 -0
  55. package/src/components/ui/navigation/navigation-demo.tsx +324 -0
  56. package/src/components/ui/navigation/pagination.tsx +272 -0
  57. package/src/components/ui/navigation/sidebar.tsx +383 -0
  58. package/src/components/ui/navigation/stepper.tsx +303 -0
  59. package/src/components/ui/navigation/tabs.tsx +205 -0
  60. package/src/components/ui/navigation/types.ts +299 -0
  61. package/src/components/ui/overlay/backdrop.tsx +81 -0
  62. package/src/components/ui/overlay/focus-manager.tsx +143 -0
  63. package/src/components/ui/overlay/index.ts +36 -0
  64. package/src/components/ui/overlay/modal.tsx +270 -0
  65. package/src/components/ui/overlay/overlay-manager.tsx +110 -0
  66. package/src/components/ui/overlay/popover.tsx +462 -0
  67. package/src/components/ui/overlay/portal.tsx +79 -0
  68. package/src/components/ui/overlay/tooltip.tsx +303 -0
  69. package/src/components/ui/overlay/types.ts +196 -0
  70. package/src/components/ui/performance-demo.tsx +596 -0
  71. package/src/components/ui/semantic-input-system-demo.tsx +502 -0
  72. package/src/components/ui/semantic-input-system-demo.tsx.disabled +873 -0
  73. package/src/components/ui/tablet-layout.tsx +192 -0
  74. package/src/components/ui/theme-customizer.tsx +386 -0
  75. package/src/components/ui/theme-preview.tsx +310 -0
  76. package/src/components/ui/theme-switcher.tsx +264 -0
  77. package/src/components/ui/theme-toggle.tsx +38 -0
  78. package/src/components/ui/token-demo.tsx +195 -0
  79. package/src/components/ui/touch-demo.tsx +462 -0
  80. package/src/components/ui/touch-friendly-interface-demo.tsx +519 -0
  81. package/src/components/ui/touch-friendly-interface.tsx +296 -0
  82. package/src/hooks/index.ts +190 -0
  83. package/src/hooks/use-accessibility-support.ts +518 -0
  84. package/src/hooks/use-adaptive-layout.ts +289 -0
  85. package/src/hooks/use-advanced-patterns.ts +294 -0
  86. package/src/hooks/use-advanced-transition-system.ts +393 -0
  87. package/src/hooks/use-animation-profile.ts +288 -0
  88. package/src/hooks/use-battery-animations.ts +384 -0
  89. package/src/hooks/use-battery-conscious-loading.ts +475 -0
  90. package/src/hooks/use-battery-optimization.ts +330 -0
  91. package/src/hooks/use-battery-status.ts +299 -0
  92. package/src/hooks/use-component-performance.ts +344 -0
  93. package/src/hooks/use-device-loading-states.ts +459 -0
  94. package/src/hooks/use-device.tsx +110 -0
  95. package/src/hooks/use-enterprise-mobile-experience.ts +488 -0
  96. package/src/hooks/use-form-feedback.ts +403 -0
  97. package/src/hooks/use-form-performance.ts +513 -0
  98. package/src/hooks/use-frame-rate.ts +251 -0
  99. package/src/hooks/use-gestures.ts +338 -0
  100. package/src/hooks/use-hardware-acceleration.ts +341 -0
  101. package/src/hooks/use-input-accessibility.ts +455 -0
  102. package/src/hooks/use-input-performance.ts +506 -0
  103. package/src/hooks/use-layout-performance.ts +319 -0
  104. package/src/hooks/use-loading-accessibility.ts +535 -0
  105. package/src/hooks/use-loading-performance.ts +473 -0
  106. package/src/hooks/use-memory-usage.ts +287 -0
  107. package/src/hooks/use-mobile-form-layout.ts +464 -0
  108. package/src/hooks/use-mobile-form-validation.ts +518 -0
  109. package/src/hooks/use-mobile-keyboard-optimization.ts +472 -0
  110. package/src/hooks/use-mobile-layout.ts +302 -0
  111. package/src/hooks/use-mobile-optimization.ts +406 -0
  112. package/src/hooks/use-mobile-skeleton.ts +402 -0
  113. package/src/hooks/use-mobile-touch.ts +414 -0
  114. package/src/hooks/use-performance-throttling.ts +348 -0
  115. package/src/hooks/use-performance.ts +316 -0
  116. package/src/hooks/use-reusable-architecture.ts +414 -0
  117. package/src/hooks/use-semantic-input-types.ts +357 -0
  118. package/src/hooks/use-semantic-input.ts +565 -0
  119. package/src/hooks/use-tablet-layout.ts +384 -0
  120. package/src/hooks/use-touch-friendly-input.ts +524 -0
  121. package/src/hooks/use-touch-friendly-interface.ts +331 -0
  122. package/src/hooks/use-touch-optimization.ts +375 -0
  123. package/src/index.ts +279 -279
  124. package/src/lib/utils.ts +6 -0
  125. package/src/themes/README.md +272 -0
  126. package/src/themes/ThemeContext.tsx +31 -0
  127. package/src/themes/ThemeProvider.tsx +232 -0
  128. package/src/themes/accessibility/index.ts +27 -0
  129. package/src/themes/accessibility.ts +259 -0
  130. package/src/themes/aria-patterns.ts +420 -0
  131. package/src/themes/base-themes.ts +55 -0
  132. package/src/themes/colorManager.ts +380 -0
  133. package/src/themes/examples/dark-theme.ts +154 -0
  134. package/src/themes/examples/minimal-theme.ts +108 -0
  135. package/src/themes/focus-management.ts +701 -0
  136. package/src/themes/fontLoader.ts +201 -0
  137. package/src/themes/high-contrast.ts +621 -0
  138. package/src/themes/index.ts +19 -0
  139. package/src/themes/inheritance.ts +227 -0
  140. package/src/themes/keyboard-navigation.ts +550 -0
  141. package/src/themes/motion-reduction.ts +662 -0
  142. package/src/themes/navigation.ts +238 -0
  143. package/src/themes/screen-reader.ts +645 -0
  144. package/src/themes/systemThemeDetector.ts +182 -0
  145. package/src/themes/themeCSSUpdater.ts +262 -0
  146. package/src/themes/themePersistence.ts +238 -0
  147. package/src/themes/themes/default.ts +586 -0
  148. package/src/themes/themes/harvey.ts +554 -0
  149. package/src/themes/themes/stan-design.ts +683 -0
  150. package/src/themes/types.ts +460 -0
  151. package/src/themes/useSystemTheme.ts +48 -0
  152. package/src/themes/useTheme.ts +87 -0
  153. package/src/themes/validation.ts +462 -0
  154. package/src/tokens/index.ts +34 -0
  155. package/src/tokens/tokenExporter.ts +397 -0
  156. package/src/tokens/tokenGenerator.ts +276 -0
  157. package/src/tokens/tokenManager.ts +248 -0
  158. package/src/tokens/tokenValidator.ts +543 -0
  159. package/src/tokens/types.ts +78 -0
  160. package/src/utils/bundle-analyzer.ts +260 -0
  161. package/src/utils/bundle-splitting.ts +483 -0
  162. package/src/utils/lazy-loading.ts +441 -0
  163. package/src/utils/performance-monitor.ts +513 -0
  164. package/src/utils/tree-shaking.ts +274 -0
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Tabs Component
3
+ * Provides comprehensive tab functionality with theme support and multiple variants
4
+ */
5
+
6
+ import * as React from 'react';
7
+ import { useState, useCallback, useMemo } from 'react';
8
+ import { XMarkIcon } from '@heroicons/react/24/outline';
9
+ import { TabsProps, TabItem } from './types';
10
+
11
+ // Simple icon components
12
+ const PlusIcon: React.FC<{ className?: string }> = ({ className = '' }) => (
13
+ <svg className={className} fill="none" viewBox="0 0 24 24" stroke="currentColor">
14
+ <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 4v16m8-8H4" />
15
+ </svg>
16
+ );
17
+
18
+ export const Tabs: React.FC<TabsProps> = ({
19
+ tabs,
20
+ activeTab,
21
+ defaultActiveTab,
22
+ onTabChange,
23
+ variant = 'default',
24
+ size = 'md',
25
+ orientation = 'horizontal',
26
+ fullWidth = false,
27
+ centered = false,
28
+ disabled = false,
29
+ loading = false,
30
+ closable = false,
31
+ onTabClose,
32
+ addable = false,
33
+ onTabAdd,
34
+ // TODO: Implement draggable functionality in future version
35
+ // draggable = false,
36
+ // onTabsReorder,
37
+ className = '',
38
+ 'data-testid': testId = 'tabs',
39
+ }) => {
40
+ const [internalActiveTab, setInternalActiveTab] = useState<string>(
41
+ activeTab || defaultActiveTab || (tabs.length > 0 ? tabs[0].id : '')
42
+ );
43
+
44
+ // Use controlled or uncontrolled active tab
45
+ const currentActiveTab = activeTab !== undefined ? activeTab : internalActiveTab;
46
+
47
+ const handleTabChange = useCallback((tabId: string) => {
48
+ if (disabled || loading) return;
49
+
50
+ if (activeTab === undefined) {
51
+ setInternalActiveTab(tabId);
52
+ }
53
+
54
+ if (onTabChange) {
55
+ onTabChange(tabId);
56
+ }
57
+ }, [activeTab, onTabChange, disabled, loading]);
58
+
59
+ const handleTabClose = useCallback((tabId: string, event: React.MouseEvent) => {
60
+ event.stopPropagation();
61
+ if (onTabClose) {
62
+ onTabClose(tabId);
63
+ }
64
+ }, [onTabClose]);
65
+
66
+ const handleTabAdd = useCallback(() => {
67
+ if (onTabAdd) {
68
+ onTabAdd();
69
+ }
70
+ }, [onTabAdd]);
71
+
72
+ // Memoize current tab content
73
+ const currentTabContent = useMemo(() => {
74
+ return tabs.find(tab => tab.id === currentActiveTab)?.content || null;
75
+ }, [tabs, currentActiveTab]);
76
+
77
+ const getSizeClasses = () => {
78
+ switch (size) {
79
+ case 'sm':
80
+ return 'tabs__item--small';
81
+ case 'lg':
82
+ return 'tabs__item--large';
83
+ default: // md
84
+ return 'tabs__item--medium';
85
+ }
86
+ };
87
+
88
+ const getVariantClasses = (isActive: boolean, isDisabled: boolean) => {
89
+ if (isDisabled) {
90
+ return 'tabs__item--disabled';
91
+ }
92
+
93
+ switch (variant) {
94
+ case 'pills':
95
+ return isActive ? 'tabs__item--pills tabs__item--active' : 'tabs__item--pills';
96
+ case 'underline':
97
+ return isActive ? 'tabs__item--underline tabs__item--active' : 'tabs__item--underline';
98
+ case 'cards':
99
+ return isActive ? 'tabs__item--cards tabs__item--active' : 'tabs__item--cards';
100
+ case 'minimal':
101
+ return isActive ? 'tabs__item--minimal tabs__item--active' : 'tabs__item--minimal';
102
+ default: // default
103
+ return isActive ? 'tabs__item--default tabs__item--active' : 'tabs__item--default';
104
+ }
105
+ };
106
+
107
+ const getTabListClasses = () => {
108
+ const baseClasses = 'tabs__list tabs__list--semantic';
109
+
110
+ if (orientation === 'vertical') {
111
+ return `${baseClasses} tabs__list--vertical`;
112
+ }
113
+
114
+ if (fullWidth) {
115
+ return `${baseClasses} tabs__list--full-width`;
116
+ }
117
+
118
+ if (centered) {
119
+ return `${baseClasses} tabs__list--centered`;
120
+ }
121
+
122
+ return baseClasses;
123
+ };
124
+
125
+ const getTabClasses = (tab: TabItem) => {
126
+ const isActive = tab.id === currentActiveTab;
127
+ const isDisabled = tab.disabled || disabled;
128
+
129
+ const baseClasses = `tabs__item ${getSizeClasses()} ${getVariantClasses(isActive, isDisabled)}`;
130
+
131
+ if (orientation === 'vertical') {
132
+ return `${baseClasses} tabs__item--vertical`;
133
+ }
134
+
135
+ if (fullWidth) {
136
+ return `${baseClasses} tabs__item--full-width`;
137
+ }
138
+
139
+ return baseClasses;
140
+ };
141
+
142
+ if (tabs.length === 0) {
143
+ return null;
144
+ }
145
+
146
+ return (
147
+ <div className={`tabs ${orientation === 'vertical' ? 'tabs--vertical' : ''} ${className}`} data-testid={testId}>
148
+ {/* Tab List */}
149
+ <div className={getTabListClasses()}>
150
+ {tabs.map((tab) => (
151
+ <button
152
+ key={tab.id}
153
+ onClick={() => handleTabChange(tab.id)}
154
+ disabled={tab.disabled || disabled}
155
+ className={getTabClasses(tab)}
156
+ aria-selected={tab.id === currentActiveTab}
157
+ aria-controls={`panel-${tab.id}`}
158
+ role="tab"
159
+ >
160
+ {tab.icon && <span className="tabs__item-icon">{tab.icon}</span>}
161
+ <span className="tabs__item-label">{tab.label}</span>
162
+ {tab.badge && <span className="tabs__item-badge">{tab.badge}</span>}
163
+ {closable && tab.closable && (
164
+ <button
165
+ onClick={(e) => handleTabClose(tab.id, e)}
166
+ className="tabs__close-button"
167
+ aria-label={`Close ${tab.label} tab`}
168
+ >
169
+ <XMarkIcon className="tabs__close-icon" />
170
+ </button>
171
+ )}
172
+ </button>
173
+ ))}
174
+
175
+ {addable && (
176
+ <button
177
+ onClick={handleTabAdd}
178
+ disabled={disabled || loading}
179
+ className={`tabs__add-button ${getSizeClasses()}`}
180
+ aria-label="Add new tab"
181
+ >
182
+ <PlusIcon className="tabs__add-icon" />
183
+ </button>
184
+ )}
185
+ </div>
186
+
187
+ {/* Tab Panels */}
188
+ <div
189
+ className={`tabs__content ${orientation === 'vertical' ? 'tabs__content--vertical' : ''}`}
190
+ role="tabpanel"
191
+ aria-labelledby={`tab-${currentActiveTab}`}
192
+ >
193
+ {loading ? (
194
+ <div className="tabs__loading">
195
+ <div className="tabs__loading-spinner"></div>
196
+ </div>
197
+ ) : (
198
+ currentTabContent
199
+ )}
200
+ </div>
201
+ </div>
202
+ );
203
+ };
204
+
205
+ export default Tabs;
@@ -0,0 +1,299 @@
1
+ /**
2
+ * Advanced Navigation Components - Type Definitions
3
+ * Provides comprehensive type definitions for all navigation components
4
+ */
5
+
6
+ import { ReactNode } from 'react';
7
+
8
+ // ============================================================================
9
+ // COMMON NAVIGATION TYPES
10
+ // ============================================================================
11
+
12
+ export interface NavigationBaseProps {
13
+ className?: string;
14
+ 'data-testid'?: string;
15
+ theme?: 'stan-design' | 'enterprise' | 'harvey';
16
+ }
17
+
18
+ export interface NavigationItem {
19
+ id: string;
20
+ label: string;
21
+ href?: string;
22
+ icon?: ReactNode;
23
+ disabled?: boolean;
24
+ active?: boolean;
25
+ children?: NavigationItem[];
26
+ onClick?: () => void;
27
+ badge?: ReactNode;
28
+ description?: string;
29
+ }
30
+
31
+ export interface NavigationGroup {
32
+ id: string;
33
+ title?: string;
34
+ items: NavigationItem[];
35
+ divider?: boolean;
36
+ }
37
+
38
+ // ============================================================================
39
+ // BREADCRUMB COMPONENT TYPES
40
+ // ============================================================================
41
+
42
+ export interface BreadcrumbProps extends NavigationBaseProps {
43
+ items: BreadcrumbItem[];
44
+ separator?: ReactNode;
45
+ maxItems?: number;
46
+ showHome?: boolean;
47
+ homeIcon?: ReactNode;
48
+ onItemClick?: (item: BreadcrumbItem) => void;
49
+ truncate?: boolean;
50
+ responsive?: boolean;
51
+ }
52
+
53
+ export interface BreadcrumbItem {
54
+ id: string;
55
+ label: string;
56
+ href?: string;
57
+ icon?: ReactNode;
58
+ onClick?: () => void;
59
+ disabled?: boolean;
60
+ }
61
+
62
+ // ============================================================================
63
+ // PAGINATION COMPONENT TYPES
64
+ // ============================================================================
65
+
66
+ export interface PaginationProps extends NavigationBaseProps {
67
+ currentPage: number;
68
+ totalPages: number;
69
+ totalItems?: number;
70
+ itemsPerPage?: number;
71
+ showFirstLast?: boolean;
72
+ showPrevNext?: boolean;
73
+ showPageNumbers?: boolean;
74
+ maxPageNumbers?: number;
75
+ size?: 'sm' | 'md' | 'lg';
76
+ variant?: 'default' | 'outlined' | 'minimal';
77
+ onPageChange: (page: number) => void;
78
+ onItemsPerPageChange?: (itemsPerPage: number) => void;
79
+ itemsPerPageOptions?: number[];
80
+ showItemsPerPage?: boolean;
81
+ showTotal?: boolean;
82
+ totalLabel?: string;
83
+ disabled?: boolean;
84
+ loading?: boolean;
85
+ }
86
+
87
+ export interface PaginationItem {
88
+ type: 'page' | 'ellipsis' | 'previous' | 'next' | 'first' | 'last';
89
+ page?: number;
90
+ disabled?: boolean;
91
+ active?: boolean;
92
+ label: string;
93
+ onClick?: () => void;
94
+ }
95
+
96
+ // ============================================================================
97
+ // TABS COMPONENT TYPES
98
+ // ============================================================================
99
+
100
+ export interface TabsProps extends NavigationBaseProps {
101
+ tabs: TabItem[];
102
+ activeTab?: string;
103
+ defaultActiveTab?: string;
104
+ onTabChange?: (tabId: string) => void;
105
+ variant?: 'default' | 'pills' | 'underline' | 'cards' | 'minimal';
106
+ size?: 'sm' | 'md' | 'lg';
107
+ orientation?: 'horizontal' | 'vertical';
108
+ fullWidth?: boolean;
109
+ centered?: boolean;
110
+ disabled?: boolean;
111
+ loading?: boolean;
112
+ closable?: boolean;
113
+ onTabClose?: (tabId: string) => void;
114
+ addable?: boolean;
115
+ onTabAdd?: () => void;
116
+ draggable?: boolean;
117
+ onTabsReorder?: (tabs: TabItem[]) => void;
118
+ }
119
+
120
+ export interface TabItem {
121
+ id: string;
122
+ label: string;
123
+ content: ReactNode;
124
+ icon?: ReactNode;
125
+ disabled?: boolean;
126
+ closable?: boolean;
127
+ badge?: ReactNode;
128
+ description?: string;
129
+ }
130
+
131
+ // ============================================================================
132
+ // STEPPER COMPONENT TYPES
133
+ // ============================================================================
134
+
135
+ export interface StepperProps extends NavigationBaseProps {
136
+ steps: StepItem[];
137
+ currentStep?: number;
138
+ defaultCurrentStep?: number;
139
+ onStepChange?: (stepIndex: number) => void;
140
+ variant?: 'default' | 'vertical' | 'horizontal' | 'wizard';
141
+ size?: 'sm' | 'md' | 'lg';
142
+ showStepNumbers?: boolean;
143
+ showStepLabels?: boolean;
144
+ showStepDescriptions?: boolean;
145
+ showStepIcons?: boolean;
146
+ allowStepClick?: boolean;
147
+ allowStepNavigation?: boolean;
148
+ showProgress?: boolean;
149
+ showStepStatus?: boolean;
150
+ onStepComplete?: (stepIndex: number) => void;
151
+ onStepError?: (stepIndex: number) => void;
152
+ onFinish?: () => void;
153
+ onCancel?: () => void;
154
+ }
155
+
156
+ export interface StepItem {
157
+ id: string;
158
+ label: string;
159
+ description?: string;
160
+ icon?: ReactNode;
161
+ status?: 'pending' | 'active' | 'completed' | 'error' | 'warning';
162
+ disabled?: boolean;
163
+ required?: boolean;
164
+ validation?: () => boolean | Promise<boolean>;
165
+ content?: ReactNode;
166
+ actions?: StepAction[];
167
+ }
168
+
169
+ export interface StepAction {
170
+ label: string;
171
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
172
+ onClick: () => void;
173
+ disabled?: boolean;
174
+ loading?: boolean;
175
+ }
176
+
177
+ // ============================================================================
178
+ // MENU COMPONENT TYPES
179
+ // ============================================================================
180
+
181
+ export interface MenuProps extends NavigationBaseProps {
182
+ items: NavigationItem[];
183
+ groups?: NavigationGroup[];
184
+ variant?: 'default' | 'dropdown' | 'context' | 'command';
185
+ size?: 'sm' | 'md' | 'lg';
186
+ orientation?: 'horizontal' | 'vertical';
187
+ trigger?: 'click' | 'hover' | 'focus';
188
+ placement?: 'top' | 'bottom' | 'left' | 'right';
189
+ offset?: number;
190
+ showArrow?: boolean;
191
+ fullWidth?: boolean;
192
+ disabled?: boolean;
193
+ loading?: boolean;
194
+ searchable?: boolean;
195
+ onSearch?: (query: string) => void;
196
+ filterable?: boolean;
197
+ onFilter?: (filter: string) => void;
198
+ selectable?: boolean;
199
+ multiSelect?: boolean;
200
+ selectedItems?: string[];
201
+ onSelectionChange?: (selectedItems: string[]) => void;
202
+ }
203
+
204
+ // ============================================================================
205
+ // SIDEBAR COMPONENT TYPES
206
+ // ============================================================================
207
+
208
+ export interface SidebarProps extends NavigationBaseProps {
209
+ items: NavigationItem[];
210
+ groups?: NavigationGroup[];
211
+ variant?: 'default' | 'collapsible' | 'overlay' | 'drawer';
212
+ size?: 'sm' | 'md' | 'lg' | 'xl';
213
+ position?: 'left' | 'right';
214
+ collapsed?: boolean;
215
+ defaultCollapsed?: boolean;
216
+ onCollapseChange?: (collapsed: boolean) => void;
217
+ collapsible?: boolean;
218
+ showToggle?: boolean;
219
+ toggleIcon?: ReactNode;
220
+ header?: ReactNode;
221
+ footer?: ReactNode;
222
+ overlay?: boolean;
223
+ overlayCloseOnClick?: boolean;
224
+ overlayCloseOnEscape?: boolean;
225
+ overlayCloseOnOutsideClick?: boolean;
226
+ responsive?: boolean;
227
+ breakpoint?: 'sm' | 'md' | 'lg' | 'xl';
228
+ onItemClick?: (item: NavigationItem) => void;
229
+ onGroupToggle?: (groupId: string, expanded: boolean) => void;
230
+ expandedGroups?: string[];
231
+ defaultExpandedGroups?: string[];
232
+ showGroupIcons?: boolean;
233
+ showItemIcons?: boolean;
234
+ showItemBadges?: boolean;
235
+ showItemDescriptions?: boolean;
236
+ sticky?: boolean;
237
+ zIndex?: number;
238
+ }
239
+
240
+ // ============================================================================
241
+ // NAVIGATION STATE TYPES
242
+ // ============================================================================
243
+
244
+ export interface NavigationState {
245
+ activeItem?: string;
246
+ expandedGroups: string[];
247
+ collapsed: boolean;
248
+ searchQuery: string;
249
+ filterValue: string;
250
+ selectedItems: string[];
251
+ }
252
+
253
+ export interface NavigationContextValue {
254
+ state: NavigationState;
255
+ dispatch: React.Dispatch<NavigationAction>;
256
+ theme: string;
257
+ }
258
+
259
+ export type NavigationAction =
260
+ | { type: 'SET_ACTIVE_ITEM'; payload: string }
261
+ | { type: 'TOGGLE_GROUP'; payload: string }
262
+ | { type: 'SET_COLLAPSED'; payload: boolean }
263
+ | { type: 'SET_SEARCH_QUERY'; payload: string }
264
+ | { type: 'SET_FILTER_VALUE'; payload: string }
265
+ | { type: 'SET_SELECTED_ITEMS'; payload: string[] }
266
+ | { type: 'RESET_STATE' };
267
+
268
+ // ============================================================================
269
+ // NAVIGATION UTILITY TYPES
270
+ // ============================================================================
271
+
272
+ export interface NavigationBreakpoint {
273
+ sm: string;
274
+ md: string;
275
+ lg: string;
276
+ xl: string;
277
+ }
278
+
279
+ export interface NavigationSpacing {
280
+ xs: string;
281
+ sm: string;
282
+ md: string;
283
+ lg: string;
284
+ xl: string;
285
+ }
286
+
287
+ export interface NavigationAnimation {
288
+ duration: string;
289
+ easing: string;
290
+ delay?: string;
291
+ }
292
+
293
+ export interface NavigationAccessibility {
294
+ ariaLabel?: string;
295
+ ariaDescribedBy?: string;
296
+ ariaLabelledBy?: string;
297
+ role?: string;
298
+ tabIndex?: number;
299
+ }
@@ -0,0 +1,81 @@
1
+ import React from 'react';
2
+
3
+ export interface BackdropProps {
4
+ isVisible: boolean;
5
+ onClick?: () => void;
6
+ className?: string;
7
+ blur?: boolean;
8
+ opacity?: number;
9
+ zIndex?: number;
10
+ children?: React.ReactNode;
11
+ theme?: 'light' | 'dark' | 'primary' | 'success' | 'warning' | 'error';
12
+ animation?: boolean;
13
+ }
14
+
15
+ export const Backdrop: React.FC<BackdropProps> = ({
16
+ isVisible,
17
+ onClick,
18
+ className = '',
19
+ blur = false,
20
+ opacity = 0.5,
21
+ zIndex = 1000,
22
+ children,
23
+ theme = 'dark',
24
+ animation = true
25
+ }) => {
26
+ if (!isVisible) {
27
+ return null;
28
+ }
29
+
30
+ const handleClick = (event: React.MouseEvent) => {
31
+ // Only trigger onClick if clicking directly on the backdrop
32
+ if (event.target === event.currentTarget && onClick) {
33
+ onClick();
34
+ }
35
+ };
36
+
37
+ // Convert opacity to nearest 10% for CSS class
38
+ const getOpacityClass = () => {
39
+ const rounded = Math.round(opacity * 10) * 10;
40
+ return `backdrop__container--opacity-${rounded}`;
41
+ };
42
+
43
+ const getZIndexClass = () => {
44
+ if (zIndex >= 1040) return 'backdrop__container--z-toast';
45
+ if (zIndex >= 1030) return 'backdrop__container--z-tooltip';
46
+ if (zIndex >= 1020) return 'backdrop__container--z-popover';
47
+ if (zIndex >= 1010) return 'backdrop__container--z-dropdown';
48
+ return 'backdrop__container--z-modal';
49
+ };
50
+
51
+ const containerClasses = [
52
+ 'backdrop__container',
53
+ blur ? 'backdrop__container--blur' : '',
54
+ theme ? `backdrop__container--theme-${theme}` : '',
55
+ getOpacityClass(),
56
+ getZIndexClass(),
57
+ animation ? 'backdrop__container--enter' : '',
58
+ className
59
+ ].filter(Boolean).join(' ');
60
+
61
+ return (
62
+ <div
63
+ className={containerClasses}
64
+ style={{
65
+ '--backdrop-z-index': zIndex,
66
+ '--backdrop-opacity': opacity
67
+ } as React.CSSProperties}
68
+ onClick={handleClick}
69
+ role="presentation"
70
+ aria-hidden="true"
71
+ >
72
+ {children && (
73
+ <div className="backdrop__content">
74
+ {children}
75
+ </div>
76
+ )}
77
+ </div>
78
+ );
79
+ };
80
+
81
+ export default Backdrop;