@grupor5/raya 0.2.12 → 0.2.14
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.d.mts +4 -273
- package/dist/index.d.ts +4 -273
- package/dist/organisms/sidebar/index.d.mts +151 -0
- package/dist/organisms/sidebar/index.d.ts +151 -0
- package/dist/organisms/sidebar/index.js +570 -0
- package/dist/organisms/sidebar/index.mjs +549 -0
- package/dist/organisms/topnavbar/index.d.mts +126 -0
- package/dist/organisms/topnavbar/index.d.ts +126 -0
- package/dist/organisms/topnavbar/index.js +646 -0
- package/dist/organisms/topnavbar/index.mjs +624 -0
- package/dist/tailwind.css +1 -1
- package/package.json +6 -1
- package/tailwind.config.js +13 -0
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ export { Breakpoint, ColumnSpan, ContainerSize, GridGap, GridSpec, breakpoints,
|
|
|
11
11
|
export { IconAnimation, IconCategory, IconColor, IconSize, IconState, IconVariant, defaultIconConfig, iconAnimations, iconCategories, iconColors, iconSizeClasses, iconSizes, iconStates, iconTheme, iconTokens, iconVariants } from './tokens/icons.mjs';
|
|
12
12
|
export { ButtonColor, ButtonSize, ButtonState, ButtonTokenProps, ButtonVariant, buttonAnimations, buttonBaseClasses, buttonColors, buttonIconClasses, buttonLoadingClasses, buttonSizeClasses, buttonSizes, buttonStates, buttonTheme, buttonTokens, buttonVariantClasses, buttonVariants, defaultButtonConfig, getButtonIconSize, getButtonSizeClasses, getButtonVariantClasses, loadingSpinnerSVG } from './tokens/buttons.mjs';
|
|
13
13
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
14
|
-
import
|
|
14
|
+
import { ReactNode } from 'react';
|
|
15
15
|
export { classNames } from './utils/classNames.mjs';
|
|
16
16
|
export { cn } from './utils/cn.mjs';
|
|
17
17
|
export { Badge, BadgeProps, badgeVariants } from './atoms/badge/index.mjs';
|
|
@@ -34,6 +34,8 @@ export { Dropdown, DropdownProps } from './molecules/dropdown/index.mjs';
|
|
|
34
34
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './molecules/accordion/index.mjs';
|
|
35
35
|
export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from './molecules/chart/index.mjs';
|
|
36
36
|
export { Grid, GridItem, GridItemProps, GridProps, ResponsiveValue } from './molecules/grid/index.mjs';
|
|
37
|
+
export { BrandInfo, FooterMenuItem, MainNavigationItem, Sidebar, SidebarProps, SubNavigationItem } from './organisms/sidebar/index.mjs';
|
|
38
|
+
export { NotificationItem, TopNavbar, TopNavbarProps, UserMenuOption, UserProfile } from './organisms/topnavbar/index.mjs';
|
|
37
39
|
export { useModal } from './hooks/useModal.mjs';
|
|
38
40
|
import 'clsx';
|
|
39
41
|
import 'class-variance-authority/types';
|
|
@@ -72,277 +74,6 @@ interface ModalProps {
|
|
|
72
74
|
}
|
|
73
75
|
declare function Modal({ open, onClose, children }: ModalProps): react_jsx_runtime.JSX.Element | null;
|
|
74
76
|
|
|
75
|
-
/**
|
|
76
|
-
* Navigation item interface for main menu items
|
|
77
|
-
*/
|
|
78
|
-
interface MainNavigationItem {
|
|
79
|
-
id: string;
|
|
80
|
-
label: string;
|
|
81
|
-
icon?: React__default.ReactNode;
|
|
82
|
-
path: string;
|
|
83
|
-
badge?: string | number;
|
|
84
|
-
subItems?: SubNavigationItem[];
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Navigation item interface for submenu items
|
|
88
|
-
*/
|
|
89
|
-
interface SubNavigationItem {
|
|
90
|
-
id: string;
|
|
91
|
-
label: string;
|
|
92
|
-
path: string;
|
|
93
|
-
badge?: string | number;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Footer menu item interface
|
|
97
|
-
*/
|
|
98
|
-
interface FooterMenuItem {
|
|
99
|
-
id: string;
|
|
100
|
-
label: string;
|
|
101
|
-
icon?: React__default.ReactNode;
|
|
102
|
-
path: string;
|
|
103
|
-
badge?: string | number;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Brand information interface
|
|
107
|
-
*/
|
|
108
|
-
interface BrandInfo {
|
|
109
|
-
logo?: React__default.ReactNode;
|
|
110
|
-
name: string;
|
|
111
|
-
tagline?: string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Sidebar component props
|
|
115
|
-
*/
|
|
116
|
-
interface SidebarProps {
|
|
117
|
-
/** Brand information displayed at the top */
|
|
118
|
-
brand: BrandInfo;
|
|
119
|
-
/** Main navigation items with optional submenus */
|
|
120
|
-
mainNavigation: MainNavigationItem[];
|
|
121
|
-
/** Footer menu items (optional) */
|
|
122
|
-
footerMenu?: FooterMenuItem[];
|
|
123
|
-
/** Whether to show footer menu */
|
|
124
|
-
showFooterMenu?: boolean;
|
|
125
|
-
/** Current active path */
|
|
126
|
-
currentPath?: string;
|
|
127
|
-
/** Whether the sidebar is collapsed */
|
|
128
|
-
collapsed?: boolean;
|
|
129
|
-
/** Callback when navigation item is clicked */
|
|
130
|
-
onNavigate?: (path: string, item: MainNavigationItem | SubNavigationItem | FooterMenuItem) => void;
|
|
131
|
-
/** Callback when collapse toggle is clicked */
|
|
132
|
-
onToggleCollapse?: () => void;
|
|
133
|
-
/** Custom className */
|
|
134
|
-
className?: string;
|
|
135
|
-
/** Data test id for testing */
|
|
136
|
-
'data-testid'?: string;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* # Sidebar - Navigation Organism
|
|
140
|
-
*
|
|
141
|
-
* ## 🚨 GRID SYSTEM COMPLIANCE
|
|
142
|
-
*
|
|
143
|
-
* Este componente está diseñado para ocupar **exactamente 2 columnas** en el grid system del Raya Design System.
|
|
144
|
-
* Debe usarse dentro de un Grid container para mantener la consistencia de layouts.
|
|
145
|
-
*
|
|
146
|
-
* ### Features
|
|
147
|
-
* - **Fixed Width**: Ocupa exactamente 2 columnas del sistema de grid (max-width: 200px)
|
|
148
|
-
* - **Main Navigation**: Elementos principales con iconos opcionales (sin chevron, sin fondo cuando submenu activo)
|
|
149
|
-
* - **Submenus**: Subitems con RightIcon, ancho completo respetando posición
|
|
150
|
-
* - **Clean Active States**: Solo el item directamente seleccionado tiene fondo oscuro
|
|
151
|
-
* - **Footer Menu**: Menu inferior opcional (configurable)
|
|
152
|
-
* - **Dynamic Content**: Navegación completamente dinámica via props
|
|
153
|
-
* - **Real Icons**: Usa iconos de la librería @grupor5/raya-icons (NO emojis)
|
|
154
|
-
* - **Smart Spacing**: Spacing optimizado entre texto y badges
|
|
155
|
-
* - **Text Ellipsis**: Texto se trunca con ellipsis si excede el ancho disponible
|
|
156
|
-
* - **Overflow Control**: Sin desbordamiento horizontal, respeta límites del grid
|
|
157
|
-
* - **Brand Display**: Logo y información de marca
|
|
158
|
-
* - **Collapsible**: Opción de colapsar para ahorrar espacio
|
|
159
|
-
* - **Accessibility**: ARIA labels y navegación por teclado
|
|
160
|
-
*
|
|
161
|
-
* ### Grid Usage
|
|
162
|
-
* ```tsx
|
|
163
|
-
* <Grid cols={12} margin>
|
|
164
|
-
* <GridItem span={{ mobile: 12, desktop: 2 }}>
|
|
165
|
-
* <Sidebar {...props} />
|
|
166
|
-
* </GridItem>
|
|
167
|
-
* <GridItem span={{ mobile: 12, desktop: 10 }}>
|
|
168
|
-
* <MainContent />
|
|
169
|
-
* </GridItem>
|
|
170
|
-
* </Grid>
|
|
171
|
-
* ```
|
|
172
|
-
*
|
|
173
|
-
* @example
|
|
174
|
-
* ```tsx
|
|
175
|
-
* // Import icons from raya-icons library
|
|
176
|
-
* import { HomeIcon } from '@grupor5/raya-icons/icons/HomeIcon';
|
|
177
|
-
* import { CategoryIcon } from '@grupor5/raya-icons/icons/CategoryIcon';
|
|
178
|
-
* import { DocumentIcon } from '@grupor5/raya-icons/icons/DocumentIcon';
|
|
179
|
-
* import { SettingIcon } from '@grupor5/raya-icons/icons/SettingIcon';
|
|
180
|
-
*
|
|
181
|
-
* // Sidebar with main navigation and submenus
|
|
182
|
-
* <Sidebar
|
|
183
|
-
* brand={{ name: "Manta Seguros" }}
|
|
184
|
-
* mainNavigation={[
|
|
185
|
-
* {
|
|
186
|
-
* id: "dashboard",
|
|
187
|
-
* label: "Dashboard",
|
|
188
|
-
* icon: <HomeIcon className="w-5 h-5" />,
|
|
189
|
-
* path: "/dashboard"
|
|
190
|
-
* },
|
|
191
|
-
* {
|
|
192
|
-
* id: "products",
|
|
193
|
-
* label: "Productos",
|
|
194
|
-
* icon: <CategoryIcon className="w-5 h-5" />,
|
|
195
|
-
* path: "/products",
|
|
196
|
-
* subItems: [
|
|
197
|
-
* { id: "tables", label: "Table's name", path: "/products/tables" }
|
|
198
|
-
* ]
|
|
199
|
-
* },
|
|
200
|
-
* {
|
|
201
|
-
* id: "policies",
|
|
202
|
-
* label: "Pólizas",
|
|
203
|
-
* icon: <DocumentIcon className="w-5 h-5" />,
|
|
204
|
-
* path: "/policies",
|
|
205
|
-
* subItems: [
|
|
206
|
-
* { id: "quote", label: "Cotizar", path: "/policies/quote" },
|
|
207
|
-
* { id: "issue", label: "Emitir", path: "/policies/issue" },
|
|
208
|
-
* { id: "modify", label: "Modificar", path: "/policies/modify" }
|
|
209
|
-
* ]
|
|
210
|
-
* }
|
|
211
|
-
* ]}
|
|
212
|
-
* footerMenu={[
|
|
213
|
-
* { id: "settings", label: "Configuración", icon: <SettingIcon className="w-5 h-5" />, path: "/settings" }
|
|
214
|
-
* ]}
|
|
215
|
-
* showFooterMenu={true}
|
|
216
|
-
* currentPath="/products/tables"
|
|
217
|
-
* onNavigate={(path, item) => navigate(path)}
|
|
218
|
-
* />
|
|
219
|
-
* ```
|
|
220
|
-
*/
|
|
221
|
-
declare const Sidebar: React__default.ForwardRefExoticComponent<SidebarProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
222
|
-
|
|
223
|
-
interface NotificationItem {
|
|
224
|
-
id: string;
|
|
225
|
-
icon?: React__default.ReactNode;
|
|
226
|
-
badge?: string | number;
|
|
227
|
-
onClick?: () => void;
|
|
228
|
-
}
|
|
229
|
-
interface UserMenuOption {
|
|
230
|
-
id: string;
|
|
231
|
-
label: string;
|
|
232
|
-
icon?: React__default.ReactNode;
|
|
233
|
-
onClick?: () => void;
|
|
234
|
-
separator?: boolean;
|
|
235
|
-
}
|
|
236
|
-
interface UserProfile {
|
|
237
|
-
name: string;
|
|
238
|
-
email?: string;
|
|
239
|
-
avatar?: string;
|
|
240
|
-
role?: string;
|
|
241
|
-
menuOptions?: UserMenuOption[];
|
|
242
|
-
}
|
|
243
|
-
interface TopNavbarProps {
|
|
244
|
-
/** Whether the sidebar is collapsed/hidden */
|
|
245
|
-
sidebarCollapsed?: boolean;
|
|
246
|
-
/** Callback when hamburger menu is clicked */
|
|
247
|
-
onToggleSidebar?: () => void;
|
|
248
|
-
/** Notification items array (extensible for future menus) */
|
|
249
|
-
notifications?: NotificationItem[];
|
|
250
|
-
/** User profile information */
|
|
251
|
-
userProfile: UserProfile;
|
|
252
|
-
/** Callback when user menu actions are triggered */
|
|
253
|
-
onUserMenuClick?: (action: string) => void;
|
|
254
|
-
/** Custom className */
|
|
255
|
-
className?: string;
|
|
256
|
-
/** Data test id for testing */
|
|
257
|
-
'data-testid'?: string;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* # TopNavbar - Application Header Organism
|
|
261
|
-
*
|
|
262
|
-
* ## 🚨 GRID SYSTEM INTEGRATION
|
|
263
|
-
*
|
|
264
|
-
* Este componente está diseñado para integrarse con el sistema de grid dinámico:
|
|
265
|
-
* - **Con Sidebar**: Ocupa 10 columnas del content area
|
|
266
|
-
* - **Sin Sidebar**: Ocupa 12 columnas completas
|
|
267
|
-
* - **Responsive**: Se adapta automáticamente al estado del sidebar
|
|
268
|
-
*
|
|
269
|
-
* ### Features
|
|
270
|
-
* - **Hamburger Menu**: Toggle para mostrar/ocultar sidebar completamente
|
|
271
|
-
* - **Notifications Area**: Extensible para múltiples iconos y menús futuros
|
|
272
|
-
* - **User Profile Dropdown**: Avatar con menú desplegable completo
|
|
273
|
-
* - **Custom Menu Options**: Opciones de menú personalizables con iconos
|
|
274
|
-
* - **User Info Display**: Nombre, email y rol en el header del menú
|
|
275
|
-
* - **Dynamic Layout**: Se adapta de 10 a 12 columnas según estado del sidebar
|
|
276
|
-
* - **Badge System**: Notificaciones con contadores visuales
|
|
277
|
-
* - **Accessibility**: ARIA labels y navegación por teclado
|
|
278
|
-
*
|
|
279
|
-
* ### Grid Usage
|
|
280
|
-
* ```tsx
|
|
281
|
-
* <Grid cols={12} margin>
|
|
282
|
-
* {!sidebarCollapsed && (
|
|
283
|
-
* <GridItem span={{ mobile: 12, desktop: 2 }}>
|
|
284
|
-
* <Sidebar />
|
|
285
|
-
* </GridItem>
|
|
286
|
-
* )}
|
|
287
|
-
* <GridItem span={{
|
|
288
|
-
* mobile: 12,
|
|
289
|
-
* desktop: sidebarCollapsed ? 12 : 10
|
|
290
|
-
* }}>
|
|
291
|
-
* <TopNavbar
|
|
292
|
-
* sidebarCollapsed={sidebarCollapsed}
|
|
293
|
-
* onToggleSidebar={toggleSidebar}
|
|
294
|
-
* userProfile={userProfile}
|
|
295
|
-
* notifications={notifications}
|
|
296
|
-
* />
|
|
297
|
-
* <MainContent />
|
|
298
|
-
* </GridItem>
|
|
299
|
-
* </Grid>
|
|
300
|
-
* ```
|
|
301
|
-
*
|
|
302
|
-
* @example
|
|
303
|
-
* ```tsx
|
|
304
|
-
* // Basic usage with sidebar integration and custom menu
|
|
305
|
-
* <TopNavbar
|
|
306
|
-
* sidebarCollapsed={false}
|
|
307
|
-
* onToggleSidebar={() => setSidebarCollapsed(!sidebarCollapsed)}
|
|
308
|
-
* userProfile={{
|
|
309
|
-
* name: "Ana Rodríguez",
|
|
310
|
-
* email: "ana@mantaseguros.com",
|
|
311
|
-
* role: "Administrator",
|
|
312
|
-
* menuOptions: [
|
|
313
|
-
* {
|
|
314
|
-
* id: "profile",
|
|
315
|
-
* label: "Mi perfil",
|
|
316
|
-
* icon: <UserIcon className="w-4 h-4" />,
|
|
317
|
-
* onClick: () => navigate('/profile')
|
|
318
|
-
* },
|
|
319
|
-
* {
|
|
320
|
-
* id: "settings",
|
|
321
|
-
* label: "Configuración",
|
|
322
|
-
* icon: <SettingIcon className="w-4 h-4" />,
|
|
323
|
-
* onClick: () => navigate('/settings')
|
|
324
|
-
* },
|
|
325
|
-
* {
|
|
326
|
-
* id: "logout",
|
|
327
|
-
* label: "Cerrar sesión",
|
|
328
|
-
* separator: true,
|
|
329
|
-
* onClick: () => handleLogout()
|
|
330
|
-
* }
|
|
331
|
-
* ]
|
|
332
|
-
* }}
|
|
333
|
-
* notifications={[
|
|
334
|
-
* {
|
|
335
|
-
* id: "notifications",
|
|
336
|
-
* badge: "3",
|
|
337
|
-
* onClick: () => showNotifications()
|
|
338
|
-
* }
|
|
339
|
-
* ]}
|
|
340
|
-
* onUserMenuClick={(action) => handleUserAction(action)}
|
|
341
|
-
* />
|
|
342
|
-
* ```
|
|
343
|
-
*/
|
|
344
|
-
declare const TopNavbar: React__default.ForwardRefExoticComponent<TopNavbarProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
345
|
-
|
|
346
77
|
interface AuthLayoutProps {
|
|
347
78
|
children: ReactNode;
|
|
348
79
|
}
|
|
@@ -354,4 +85,4 @@ interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
|
354
85
|
color?: string;
|
|
355
86
|
}
|
|
356
87
|
|
|
357
|
-
export { AuthLayout, type
|
|
88
|
+
export { AuthLayout, type IconProps, Modal, type Size, ThemeProvider, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export { Breakpoint, ColumnSpan, ContainerSize, GridGap, GridSpec, breakpoints,
|
|
|
11
11
|
export { IconAnimation, IconCategory, IconColor, IconSize, IconState, IconVariant, defaultIconConfig, iconAnimations, iconCategories, iconColors, iconSizeClasses, iconSizes, iconStates, iconTheme, iconTokens, iconVariants } from './tokens/icons.js';
|
|
12
12
|
export { ButtonColor, ButtonSize, ButtonState, ButtonTokenProps, ButtonVariant, buttonAnimations, buttonBaseClasses, buttonColors, buttonIconClasses, buttonLoadingClasses, buttonSizeClasses, buttonSizes, buttonStates, buttonTheme, buttonTokens, buttonVariantClasses, buttonVariants, defaultButtonConfig, getButtonIconSize, getButtonSizeClasses, getButtonVariantClasses, loadingSpinnerSVG } from './tokens/buttons.js';
|
|
13
13
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
14
|
-
import
|
|
14
|
+
import { ReactNode } from 'react';
|
|
15
15
|
export { classNames } from './utils/classNames.js';
|
|
16
16
|
export { cn } from './utils/cn.js';
|
|
17
17
|
export { Badge, BadgeProps, badgeVariants } from './atoms/badge/index.js';
|
|
@@ -34,6 +34,8 @@ export { Dropdown, DropdownProps } from './molecules/dropdown/index.js';
|
|
|
34
34
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './molecules/accordion/index.js';
|
|
35
35
|
export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from './molecules/chart/index.js';
|
|
36
36
|
export { Grid, GridItem, GridItemProps, GridProps, ResponsiveValue } from './molecules/grid/index.js';
|
|
37
|
+
export { BrandInfo, FooterMenuItem, MainNavigationItem, Sidebar, SidebarProps, SubNavigationItem } from './organisms/sidebar/index.js';
|
|
38
|
+
export { NotificationItem, TopNavbar, TopNavbarProps, UserMenuOption, UserProfile } from './organisms/topnavbar/index.js';
|
|
37
39
|
export { useModal } from './hooks/useModal.js';
|
|
38
40
|
import 'clsx';
|
|
39
41
|
import 'class-variance-authority/types';
|
|
@@ -72,277 +74,6 @@ interface ModalProps {
|
|
|
72
74
|
}
|
|
73
75
|
declare function Modal({ open, onClose, children }: ModalProps): react_jsx_runtime.JSX.Element | null;
|
|
74
76
|
|
|
75
|
-
/**
|
|
76
|
-
* Navigation item interface for main menu items
|
|
77
|
-
*/
|
|
78
|
-
interface MainNavigationItem {
|
|
79
|
-
id: string;
|
|
80
|
-
label: string;
|
|
81
|
-
icon?: React__default.ReactNode;
|
|
82
|
-
path: string;
|
|
83
|
-
badge?: string | number;
|
|
84
|
-
subItems?: SubNavigationItem[];
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Navigation item interface for submenu items
|
|
88
|
-
*/
|
|
89
|
-
interface SubNavigationItem {
|
|
90
|
-
id: string;
|
|
91
|
-
label: string;
|
|
92
|
-
path: string;
|
|
93
|
-
badge?: string | number;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Footer menu item interface
|
|
97
|
-
*/
|
|
98
|
-
interface FooterMenuItem {
|
|
99
|
-
id: string;
|
|
100
|
-
label: string;
|
|
101
|
-
icon?: React__default.ReactNode;
|
|
102
|
-
path: string;
|
|
103
|
-
badge?: string | number;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Brand information interface
|
|
107
|
-
*/
|
|
108
|
-
interface BrandInfo {
|
|
109
|
-
logo?: React__default.ReactNode;
|
|
110
|
-
name: string;
|
|
111
|
-
tagline?: string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Sidebar component props
|
|
115
|
-
*/
|
|
116
|
-
interface SidebarProps {
|
|
117
|
-
/** Brand information displayed at the top */
|
|
118
|
-
brand: BrandInfo;
|
|
119
|
-
/** Main navigation items with optional submenus */
|
|
120
|
-
mainNavigation: MainNavigationItem[];
|
|
121
|
-
/** Footer menu items (optional) */
|
|
122
|
-
footerMenu?: FooterMenuItem[];
|
|
123
|
-
/** Whether to show footer menu */
|
|
124
|
-
showFooterMenu?: boolean;
|
|
125
|
-
/** Current active path */
|
|
126
|
-
currentPath?: string;
|
|
127
|
-
/** Whether the sidebar is collapsed */
|
|
128
|
-
collapsed?: boolean;
|
|
129
|
-
/** Callback when navigation item is clicked */
|
|
130
|
-
onNavigate?: (path: string, item: MainNavigationItem | SubNavigationItem | FooterMenuItem) => void;
|
|
131
|
-
/** Callback when collapse toggle is clicked */
|
|
132
|
-
onToggleCollapse?: () => void;
|
|
133
|
-
/** Custom className */
|
|
134
|
-
className?: string;
|
|
135
|
-
/** Data test id for testing */
|
|
136
|
-
'data-testid'?: string;
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* # Sidebar - Navigation Organism
|
|
140
|
-
*
|
|
141
|
-
* ## 🚨 GRID SYSTEM COMPLIANCE
|
|
142
|
-
*
|
|
143
|
-
* Este componente está diseñado para ocupar **exactamente 2 columnas** en el grid system del Raya Design System.
|
|
144
|
-
* Debe usarse dentro de un Grid container para mantener la consistencia de layouts.
|
|
145
|
-
*
|
|
146
|
-
* ### Features
|
|
147
|
-
* - **Fixed Width**: Ocupa exactamente 2 columnas del sistema de grid (max-width: 200px)
|
|
148
|
-
* - **Main Navigation**: Elementos principales con iconos opcionales (sin chevron, sin fondo cuando submenu activo)
|
|
149
|
-
* - **Submenus**: Subitems con RightIcon, ancho completo respetando posición
|
|
150
|
-
* - **Clean Active States**: Solo el item directamente seleccionado tiene fondo oscuro
|
|
151
|
-
* - **Footer Menu**: Menu inferior opcional (configurable)
|
|
152
|
-
* - **Dynamic Content**: Navegación completamente dinámica via props
|
|
153
|
-
* - **Real Icons**: Usa iconos de la librería @grupor5/raya-icons (NO emojis)
|
|
154
|
-
* - **Smart Spacing**: Spacing optimizado entre texto y badges
|
|
155
|
-
* - **Text Ellipsis**: Texto se trunca con ellipsis si excede el ancho disponible
|
|
156
|
-
* - **Overflow Control**: Sin desbordamiento horizontal, respeta límites del grid
|
|
157
|
-
* - **Brand Display**: Logo y información de marca
|
|
158
|
-
* - **Collapsible**: Opción de colapsar para ahorrar espacio
|
|
159
|
-
* - **Accessibility**: ARIA labels y navegación por teclado
|
|
160
|
-
*
|
|
161
|
-
* ### Grid Usage
|
|
162
|
-
* ```tsx
|
|
163
|
-
* <Grid cols={12} margin>
|
|
164
|
-
* <GridItem span={{ mobile: 12, desktop: 2 }}>
|
|
165
|
-
* <Sidebar {...props} />
|
|
166
|
-
* </GridItem>
|
|
167
|
-
* <GridItem span={{ mobile: 12, desktop: 10 }}>
|
|
168
|
-
* <MainContent />
|
|
169
|
-
* </GridItem>
|
|
170
|
-
* </Grid>
|
|
171
|
-
* ```
|
|
172
|
-
*
|
|
173
|
-
* @example
|
|
174
|
-
* ```tsx
|
|
175
|
-
* // Import icons from raya-icons library
|
|
176
|
-
* import { HomeIcon } from '@grupor5/raya-icons/icons/HomeIcon';
|
|
177
|
-
* import { CategoryIcon } from '@grupor5/raya-icons/icons/CategoryIcon';
|
|
178
|
-
* import { DocumentIcon } from '@grupor5/raya-icons/icons/DocumentIcon';
|
|
179
|
-
* import { SettingIcon } from '@grupor5/raya-icons/icons/SettingIcon';
|
|
180
|
-
*
|
|
181
|
-
* // Sidebar with main navigation and submenus
|
|
182
|
-
* <Sidebar
|
|
183
|
-
* brand={{ name: "Manta Seguros" }}
|
|
184
|
-
* mainNavigation={[
|
|
185
|
-
* {
|
|
186
|
-
* id: "dashboard",
|
|
187
|
-
* label: "Dashboard",
|
|
188
|
-
* icon: <HomeIcon className="w-5 h-5" />,
|
|
189
|
-
* path: "/dashboard"
|
|
190
|
-
* },
|
|
191
|
-
* {
|
|
192
|
-
* id: "products",
|
|
193
|
-
* label: "Productos",
|
|
194
|
-
* icon: <CategoryIcon className="w-5 h-5" />,
|
|
195
|
-
* path: "/products",
|
|
196
|
-
* subItems: [
|
|
197
|
-
* { id: "tables", label: "Table's name", path: "/products/tables" }
|
|
198
|
-
* ]
|
|
199
|
-
* },
|
|
200
|
-
* {
|
|
201
|
-
* id: "policies",
|
|
202
|
-
* label: "Pólizas",
|
|
203
|
-
* icon: <DocumentIcon className="w-5 h-5" />,
|
|
204
|
-
* path: "/policies",
|
|
205
|
-
* subItems: [
|
|
206
|
-
* { id: "quote", label: "Cotizar", path: "/policies/quote" },
|
|
207
|
-
* { id: "issue", label: "Emitir", path: "/policies/issue" },
|
|
208
|
-
* { id: "modify", label: "Modificar", path: "/policies/modify" }
|
|
209
|
-
* ]
|
|
210
|
-
* }
|
|
211
|
-
* ]}
|
|
212
|
-
* footerMenu={[
|
|
213
|
-
* { id: "settings", label: "Configuración", icon: <SettingIcon className="w-5 h-5" />, path: "/settings" }
|
|
214
|
-
* ]}
|
|
215
|
-
* showFooterMenu={true}
|
|
216
|
-
* currentPath="/products/tables"
|
|
217
|
-
* onNavigate={(path, item) => navigate(path)}
|
|
218
|
-
* />
|
|
219
|
-
* ```
|
|
220
|
-
*/
|
|
221
|
-
declare const Sidebar: React__default.ForwardRefExoticComponent<SidebarProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
222
|
-
|
|
223
|
-
interface NotificationItem {
|
|
224
|
-
id: string;
|
|
225
|
-
icon?: React__default.ReactNode;
|
|
226
|
-
badge?: string | number;
|
|
227
|
-
onClick?: () => void;
|
|
228
|
-
}
|
|
229
|
-
interface UserMenuOption {
|
|
230
|
-
id: string;
|
|
231
|
-
label: string;
|
|
232
|
-
icon?: React__default.ReactNode;
|
|
233
|
-
onClick?: () => void;
|
|
234
|
-
separator?: boolean;
|
|
235
|
-
}
|
|
236
|
-
interface UserProfile {
|
|
237
|
-
name: string;
|
|
238
|
-
email?: string;
|
|
239
|
-
avatar?: string;
|
|
240
|
-
role?: string;
|
|
241
|
-
menuOptions?: UserMenuOption[];
|
|
242
|
-
}
|
|
243
|
-
interface TopNavbarProps {
|
|
244
|
-
/** Whether the sidebar is collapsed/hidden */
|
|
245
|
-
sidebarCollapsed?: boolean;
|
|
246
|
-
/** Callback when hamburger menu is clicked */
|
|
247
|
-
onToggleSidebar?: () => void;
|
|
248
|
-
/** Notification items array (extensible for future menus) */
|
|
249
|
-
notifications?: NotificationItem[];
|
|
250
|
-
/** User profile information */
|
|
251
|
-
userProfile: UserProfile;
|
|
252
|
-
/** Callback when user menu actions are triggered */
|
|
253
|
-
onUserMenuClick?: (action: string) => void;
|
|
254
|
-
/** Custom className */
|
|
255
|
-
className?: string;
|
|
256
|
-
/** Data test id for testing */
|
|
257
|
-
'data-testid'?: string;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* # TopNavbar - Application Header Organism
|
|
261
|
-
*
|
|
262
|
-
* ## 🚨 GRID SYSTEM INTEGRATION
|
|
263
|
-
*
|
|
264
|
-
* Este componente está diseñado para integrarse con el sistema de grid dinámico:
|
|
265
|
-
* - **Con Sidebar**: Ocupa 10 columnas del content area
|
|
266
|
-
* - **Sin Sidebar**: Ocupa 12 columnas completas
|
|
267
|
-
* - **Responsive**: Se adapta automáticamente al estado del sidebar
|
|
268
|
-
*
|
|
269
|
-
* ### Features
|
|
270
|
-
* - **Hamburger Menu**: Toggle para mostrar/ocultar sidebar completamente
|
|
271
|
-
* - **Notifications Area**: Extensible para múltiples iconos y menús futuros
|
|
272
|
-
* - **User Profile Dropdown**: Avatar con menú desplegable completo
|
|
273
|
-
* - **Custom Menu Options**: Opciones de menú personalizables con iconos
|
|
274
|
-
* - **User Info Display**: Nombre, email y rol en el header del menú
|
|
275
|
-
* - **Dynamic Layout**: Se adapta de 10 a 12 columnas según estado del sidebar
|
|
276
|
-
* - **Badge System**: Notificaciones con contadores visuales
|
|
277
|
-
* - **Accessibility**: ARIA labels y navegación por teclado
|
|
278
|
-
*
|
|
279
|
-
* ### Grid Usage
|
|
280
|
-
* ```tsx
|
|
281
|
-
* <Grid cols={12} margin>
|
|
282
|
-
* {!sidebarCollapsed && (
|
|
283
|
-
* <GridItem span={{ mobile: 12, desktop: 2 }}>
|
|
284
|
-
* <Sidebar />
|
|
285
|
-
* </GridItem>
|
|
286
|
-
* )}
|
|
287
|
-
* <GridItem span={{
|
|
288
|
-
* mobile: 12,
|
|
289
|
-
* desktop: sidebarCollapsed ? 12 : 10
|
|
290
|
-
* }}>
|
|
291
|
-
* <TopNavbar
|
|
292
|
-
* sidebarCollapsed={sidebarCollapsed}
|
|
293
|
-
* onToggleSidebar={toggleSidebar}
|
|
294
|
-
* userProfile={userProfile}
|
|
295
|
-
* notifications={notifications}
|
|
296
|
-
* />
|
|
297
|
-
* <MainContent />
|
|
298
|
-
* </GridItem>
|
|
299
|
-
* </Grid>
|
|
300
|
-
* ```
|
|
301
|
-
*
|
|
302
|
-
* @example
|
|
303
|
-
* ```tsx
|
|
304
|
-
* // Basic usage with sidebar integration and custom menu
|
|
305
|
-
* <TopNavbar
|
|
306
|
-
* sidebarCollapsed={false}
|
|
307
|
-
* onToggleSidebar={() => setSidebarCollapsed(!sidebarCollapsed)}
|
|
308
|
-
* userProfile={{
|
|
309
|
-
* name: "Ana Rodríguez",
|
|
310
|
-
* email: "ana@mantaseguros.com",
|
|
311
|
-
* role: "Administrator",
|
|
312
|
-
* menuOptions: [
|
|
313
|
-
* {
|
|
314
|
-
* id: "profile",
|
|
315
|
-
* label: "Mi perfil",
|
|
316
|
-
* icon: <UserIcon className="w-4 h-4" />,
|
|
317
|
-
* onClick: () => navigate('/profile')
|
|
318
|
-
* },
|
|
319
|
-
* {
|
|
320
|
-
* id: "settings",
|
|
321
|
-
* label: "Configuración",
|
|
322
|
-
* icon: <SettingIcon className="w-4 h-4" />,
|
|
323
|
-
* onClick: () => navigate('/settings')
|
|
324
|
-
* },
|
|
325
|
-
* {
|
|
326
|
-
* id: "logout",
|
|
327
|
-
* label: "Cerrar sesión",
|
|
328
|
-
* separator: true,
|
|
329
|
-
* onClick: () => handleLogout()
|
|
330
|
-
* }
|
|
331
|
-
* ]
|
|
332
|
-
* }}
|
|
333
|
-
* notifications={[
|
|
334
|
-
* {
|
|
335
|
-
* id: "notifications",
|
|
336
|
-
* badge: "3",
|
|
337
|
-
* onClick: () => showNotifications()
|
|
338
|
-
* }
|
|
339
|
-
* ]}
|
|
340
|
-
* onUserMenuClick={(action) => handleUserAction(action)}
|
|
341
|
-
* />
|
|
342
|
-
* ```
|
|
343
|
-
*/
|
|
344
|
-
declare const TopNavbar: React__default.ForwardRefExoticComponent<TopNavbarProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
345
|
-
|
|
346
77
|
interface AuthLayoutProps {
|
|
347
78
|
children: ReactNode;
|
|
348
79
|
}
|
|
@@ -354,4 +85,4 @@ interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
|
354
85
|
color?: string;
|
|
355
86
|
}
|
|
356
87
|
|
|
357
|
-
export { AuthLayout, type
|
|
88
|
+
export { AuthLayout, type IconProps, Modal, type Size, ThemeProvider, useTheme };
|