anima-ds-nucleus 1.0.3 → 1.0.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.
- package/dist/anima-ds-nucleus.css +1 -1
- package/dist/anima-ds.cjs.js +124 -57
- package/dist/anima-ds.esm.js +6591 -5067
- package/package.json +10 -2
- package/src/assets/nucleus-logo.svg +3 -0
- package/src/components/Atoms/LogoHexa/LogoHexa.jsx +34 -0
- package/src/components/Atoms/LogoHexa/LogoHexa.stories.jsx +36 -0
- package/src/components/Atoms/Typography/Typography.jsx +4 -0
- package/src/components/Atoms/Typography/Typography.stories.jsx +37 -1
- package/src/components/DataDisplay/Card/Card.jsx +117 -24
- package/src/components/DataDisplay/Card/Card.stories.jsx +119 -35
- package/src/components/DataDisplay/Card/CardError.jsx +142 -0
- package/src/components/DataDisplay/Card/CardSkeleton.jsx +96 -0
- package/src/components/DataDisplay/Card/CardTituloCorto.jsx +62 -0
- package/src/components/DataDisplay/Card/CardTituloCortoMasEstado.jsx +80 -0
- package/src/components/DataDisplay/Card/CardTituloLargo.jsx +62 -0
- package/src/components/DataDisplay/Card/CardTituloLargoMasEstado.jsx +77 -0
- package/src/components/DataDisplay/Card/CardVacia.jsx +111 -0
- package/src/components/Layout/Header/HeaderConBuscador.stories.jsx +8 -0
- package/src/components/Layout/Header/HeaderCore.jsx +314 -85
- package/src/components/Layout/Header/HeaderCore.stories.jsx +25 -21
- package/src/components/Layout/Header/HeaderGeneral.jsx +92 -0
- package/src/components/Layout/Header/HeaderGeneral.stories.jsx +64 -0
- package/src/components/Layout/Header/HeaderPoint.jsx +120 -0
- package/src/components/Layout/Header/HeaderPoint.stories.jsx +110 -0
- package/src/components/Layout/NavPoint/NavPoint.jsx +64 -0
- package/src/components/Layout/NavPoint/NavPoint.stories.jsx +52 -0
- package/src/components/Layout/Sidebar/SidebarCore.jsx +524 -91
- package/src/components/Layout/Sidebar/SidebarCore.stories.jsx +76 -1
- package/src/components/Layout/Sidebar/SidebarPoint.jsx +264 -59
- package/src/components/Layout/Sidebar/SidebarPoint.stories.jsx +69 -0
- package/src/index.js +12 -3
- package/src/style.css +25 -0
- package/src/components/Layout/Header/Header.jsx +0 -50
- package/src/components/Layout/Header/Header.stories.jsx +0 -36
- package/src/components/Layout/Sidebar/Sidebar.jsx +0 -230
- package/src/components/Layout/Sidebar/Sidebar.stories.jsx +0 -90
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
|
-
import { SidebarCore } from './SidebarCore';
|
|
2
|
+
import { SidebarCore, SidebarCoreMobile } from './SidebarCore';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
title: 'Layout/SidebarCore',
|
|
@@ -36,6 +36,8 @@ export const Default = {
|
|
|
36
36
|
onItemClick={setActiveItem}
|
|
37
37
|
companyName="HEXA Core"
|
|
38
38
|
onCompanyClick={() => console.log('Company clicked')}
|
|
39
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
40
|
+
footerCollapsedContent="v1.0"
|
|
39
41
|
/>
|
|
40
42
|
</div>
|
|
41
43
|
);
|
|
@@ -52,6 +54,8 @@ export const Colapsado = {
|
|
|
52
54
|
activeItem={activeItem}
|
|
53
55
|
onItemClick={setActiveItem}
|
|
54
56
|
defaultCollapsed={true}
|
|
57
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
58
|
+
footerCollapsedContent="v1.0"
|
|
55
59
|
/>
|
|
56
60
|
</div>
|
|
57
61
|
);
|
|
@@ -89,4 +93,75 @@ export const ConSeccionesPersonalizadas = {
|
|
|
89
93
|
},
|
|
90
94
|
};
|
|
91
95
|
|
|
96
|
+
export const ConFooter = {
|
|
97
|
+
render: () => {
|
|
98
|
+
const [activeItem, setActiveItem] = useState('inicio');
|
|
99
|
+
return (
|
|
100
|
+
<div className="h-screen bg-gray-100">
|
|
101
|
+
<SidebarCore
|
|
102
|
+
sections={mockSections}
|
|
103
|
+
activeItem={activeItem}
|
|
104
|
+
onItemClick={setActiveItem}
|
|
105
|
+
companyName="HEXA Core"
|
|
106
|
+
onCompanyClick={() => console.log('Company clicked')}
|
|
107
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
108
|
+
/>
|
|
109
|
+
</div>
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export const ConFooterPersonalizado = {
|
|
115
|
+
render: () => {
|
|
116
|
+
const [activeItem, setActiveItem] = useState('inicio');
|
|
117
|
+
return (
|
|
118
|
+
<div className="h-screen bg-gray-100">
|
|
119
|
+
<SidebarCore
|
|
120
|
+
sections={mockSections}
|
|
121
|
+
activeItem={activeItem}
|
|
122
|
+
onItemClick={setActiveItem}
|
|
123
|
+
companyName="HEXA Core"
|
|
124
|
+
onCompanyClick={() => console.log('Company clicked')}
|
|
125
|
+
footerText={{
|
|
126
|
+
version: 'v2.1',
|
|
127
|
+
poweredBy: 'Powered by',
|
|
128
|
+
brand: 'Nucleus'
|
|
129
|
+
}}
|
|
130
|
+
footerCollapsedContent={{
|
|
131
|
+
icon: 'InformationCircleIcon',
|
|
132
|
+
text: 'v2.1'
|
|
133
|
+
}}
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
);
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const Mobile = {
|
|
141
|
+
render: () => {
|
|
142
|
+
const [activeItem, setActiveItem] = useState('inicio');
|
|
143
|
+
return (
|
|
144
|
+
<div className="h-screen bg-gray-100 relative">
|
|
145
|
+
<SidebarCoreMobile
|
|
146
|
+
sections={mockSections}
|
|
147
|
+
activeItem={activeItem}
|
|
148
|
+
onItemClick={setActiveItem}
|
|
149
|
+
companyName="HEXA Core"
|
|
150
|
+
companyLogo="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0iIiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ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PmUctbN4dmPjWpvpemo+hh8L/Wub9j/Uamr4ds8+rcyz3V6/kMWjKhjW2qN09dMdPvt6R8zeRxMHXvVyi35RXdv8CFzf8TYX8r9bPfP4WXXyUeRopV8El+y49Wteq9Bd3z0mufc+3U9VawuSxM5tY1vVKK24taaRtkTg87BzL3KvGjj5fQ1KMeyktrevx0WzWb3Hfi39892gANOgAAIeRxWTZ4hhnRUPYxlBvcu+ku/YufAAkzIxjjznvr9czy/hyy3JdmB7NQn3cJS10v5fIqcvxr5Dj40xlGNsNOLflvWmikDP0jE+Pid+PbnIcfzduG8S66uumMdLT7zXwW/Q3OG4yzG4+/FzVB+1k9qMt9taK4LMRM/Hzm9uaq4rluMtn9HWwnVL4Tet/an8fmjfqxuTtwM2vOnXK26txrjF9o7RWAmOjPBmer4SeE42eLx92NmqElZJ7UZb7NJf2NKnjOW4u2a42yuymT2ozevzXbv9h0YFxC8GepJ+JnH0cm8n2/I319Ci1GmtdvtJ9nE8jh8jZk8ZKDjY22ptdtvbTTOjA+i3glklt8Oalw3JT5KjLvtqtcZQlY+rWtPyS18Fo38+vmI5crcCyuVLS/dzfkVgT6SJPj5kvVvlD4fisqrkLc/OdaslvUK/Lb+JcANSSOnHxzjnUAAVsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/9k="
|
|
151
|
+
onCompanyClick={() => console.log('Company clicked')}
|
|
152
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
153
|
+
/>
|
|
154
|
+
<div className="p-4">
|
|
155
|
+
<p className="text-sm text-gray-600">
|
|
156
|
+
Haz clic en el botón hamburguesa (esquina superior izquierda) para abrir el menú mobile.
|
|
157
|
+
</p>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
);
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
92
167
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import { Icon } from '../../Atoms/Icon/Icon';
|
|
3
3
|
import { Typography } from '../../Atoms/Typography/Typography';
|
|
4
|
+
import { LogoHexa } from '../../Atoms/LogoHexa/LogoHexa';
|
|
4
5
|
|
|
5
6
|
// Mock data con 2 títulos y 2 secciones
|
|
6
7
|
const MOCK_SECTIONS = [
|
|
@@ -29,6 +30,9 @@ export const SidebarPoint = ({
|
|
|
29
30
|
companyLogo,
|
|
30
31
|
onCompanyClick,
|
|
31
32
|
itemBadges = {}, // Objeto con { itemId: number } para los badges
|
|
33
|
+
footerText, // Texto del footer: puede ser string "v1.0 | Powered by Nucleus" o objeto { version: "v1.0", poweredBy: "Powered by", brand: "Nucleus" }
|
|
34
|
+
footerCollapsedContent, // Contenido a mostrar en el footer cuando está colapsado (puede ser string, ReactNode, o objeto con icon y text)
|
|
35
|
+
Client = false, // Propiedad booleana para mostrar el logo de la empresa en la parte superior
|
|
32
36
|
className = '',
|
|
33
37
|
...props
|
|
34
38
|
}) => {
|
|
@@ -39,42 +43,118 @@ export const SidebarPoint = ({
|
|
|
39
43
|
};
|
|
40
44
|
|
|
41
45
|
return (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
46
|
+
<aside
|
|
47
|
+
className={`bg-white border-r border-gray-200 transition-all duration-300 ease-in-out h-full ${
|
|
48
|
+
isCollapsed ? 'w-20' : 'w-64'
|
|
49
|
+
} ${className}`}
|
|
50
|
+
{...props}
|
|
51
|
+
>
|
|
52
|
+
<nav className="h-full flex flex-col" style={{ overflow: 'hidden' }}>
|
|
53
|
+
{/* Barra superior con HEXA Point */}
|
|
54
|
+
{!isCollapsed && (
|
|
55
|
+
<div className="p-4 border-b border-gray-200 flex-shrink-0">
|
|
56
|
+
<button
|
|
57
|
+
onClick={onCompanyClick}
|
|
58
|
+
className="w-full bg-white rounded-lg px-3 py-2.5
|
|
59
|
+
flex items-center justify-between hover:bg-gray-50 transition-colors"
|
|
60
|
+
>
|
|
61
|
+
<div className="flex items-center space-x-3">
|
|
62
|
+
{/* Logo hexagonal */}
|
|
63
|
+
{companyLogo ? (
|
|
64
|
+
<img
|
|
65
|
+
src={companyLogo}
|
|
66
|
+
alt={companyName}
|
|
67
|
+
className="w-8 h-8 rounded"
|
|
68
|
+
/>
|
|
69
|
+
) : (
|
|
70
|
+
<LogoHexa width={36} height={40} />
|
|
71
|
+
)}
|
|
72
|
+
{/* Nombre de la empresa */}
|
|
73
|
+
<Typography
|
|
74
|
+
variant="body-md"
|
|
75
|
+
className="color-gray-900 font-medium"
|
|
76
|
+
>
|
|
77
|
+
{companyName}
|
|
78
|
+
</Typography>
|
|
79
|
+
</div>
|
|
80
|
+
</button>
|
|
81
|
+
</div>
|
|
82
|
+
)}
|
|
83
|
+
|
|
84
|
+
{/* Botón de colapsar/expandir - Solo visible cuando está expandido */}
|
|
85
|
+
{!isCollapsed && (
|
|
86
|
+
<div className="px-4 pt-2 pb-2 flex justify-end flex-shrink-0">
|
|
87
|
+
<button
|
|
88
|
+
onClick={toggleCollapse}
|
|
89
|
+
className="p-1.5 hover:bg-gray-100 rounded-lg transition-colors"
|
|
90
|
+
aria-label="Colapsar sidebar"
|
|
91
|
+
style={{ marginRight: '10px' }}
|
|
92
|
+
>
|
|
93
|
+
<Icon
|
|
94
|
+
name="ChevronDoubleLeftIcon"
|
|
95
|
+
variant="24-outline"
|
|
96
|
+
size={20}
|
|
97
|
+
className="color-teal"
|
|
98
|
+
/>
|
|
99
|
+
</button>
|
|
100
|
+
</div>
|
|
101
|
+
)}
|
|
102
|
+
|
|
103
|
+
{/* Header con logo de empresa cuando Client es true - entre botón colapsar y botón Inicio */}
|
|
104
|
+
{Client && companyLogo && !isCollapsed && (
|
|
105
|
+
<div className="flex-shrink-0 border-b border-gray-200" style={{ borderStyle: 'dashed' }}>
|
|
106
|
+
<div className="px-4 py-6 flex flex-col items-center justify-center">
|
|
107
|
+
<img
|
|
108
|
+
src={companyLogo}
|
|
109
|
+
alt={companyName || 'Company Logo'}
|
|
110
|
+
className="max-w-[200px] max-h-[80px] object-contain"
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
)}
|
|
115
|
+
|
|
116
|
+
{/* Logo cuando está colapsado */}
|
|
117
|
+
{isCollapsed && (
|
|
118
|
+
<div className="p-4 border-b border-gray-200 flex justify-center flex-shrink-0">
|
|
119
|
+
{companyLogo ? (
|
|
120
|
+
<img
|
|
121
|
+
src={companyLogo}
|
|
122
|
+
alt={companyName}
|
|
123
|
+
className="w-8 h-8 rounded"
|
|
124
|
+
/>
|
|
125
|
+
) : (
|
|
126
|
+
<LogoHexa width={36} height={40} />
|
|
127
|
+
)}
|
|
128
|
+
</div>
|
|
129
|
+
)}
|
|
130
|
+
|
|
131
|
+
{/* Botón para expandir - Solo visible cuando está colapsado */}
|
|
132
|
+
{isCollapsed && (
|
|
133
|
+
<div className="px-4 pt-2 pb-2 flex justify-center flex-shrink-0">
|
|
134
|
+
<button
|
|
135
|
+
onClick={toggleCollapse}
|
|
136
|
+
className="p-1.5 hover:bg-gray-100 rounded-lg transition-colors"
|
|
137
|
+
aria-label="Expandir sidebar"
|
|
138
|
+
>
|
|
139
|
+
<Icon
|
|
140
|
+
name="ChevronDoubleRightIcon"
|
|
141
|
+
variant="24-outline"
|
|
142
|
+
size={20}
|
|
143
|
+
className="color-teal"
|
|
144
|
+
/>
|
|
145
|
+
</button>
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
69
148
|
|
|
70
|
-
{/* Contenido del sidebar */}
|
|
71
|
-
<div className="flex-1
|
|
149
|
+
{/* Contenido del sidebar - Wrapper para controlar el espacio */}
|
|
150
|
+
<div className="flex-1 min-h-0 flex flex-col overflow-hidden">
|
|
151
|
+
<div className={`flex-1 overflow-y-auto ${isCollapsed ? 'py-2' : 'py-4'}`} style={{ overflowX: 'hidden' }}>
|
|
72
152
|
{/* Item "Inicio" destacado */}
|
|
73
153
|
<div className="px-4 mb-4">
|
|
74
154
|
<button
|
|
75
155
|
onClick={() => onItemClick && onItemClick('inicio')}
|
|
76
|
-
className={`w-full flex items-center ${
|
|
77
|
-
isCollapsed ? 'justify-center px-2' : 'px-4'
|
|
156
|
+
className={`w-full flex items-center cursor-pointer ${
|
|
157
|
+
isCollapsed ? 'justify-center px-2' : 'px-4 justify-between'
|
|
78
158
|
} py-2.5 rounded-lg transition-all duration-200 ${
|
|
79
159
|
activeItem === 'inicio'
|
|
80
160
|
? ''
|
|
@@ -95,29 +175,27 @@ export const SidebarPoint = ({
|
|
|
95
175
|
}`}
|
|
96
176
|
/>
|
|
97
177
|
{!isCollapsed && (
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
)}
|
|
120
|
-
</>
|
|
178
|
+
<Typography
|
|
179
|
+
variant="body-md"
|
|
180
|
+
className={`font-medium ${
|
|
181
|
+
activeItem === 'inicio' ? 'color-white' : 'color-gray-700'
|
|
182
|
+
}`}
|
|
183
|
+
>
|
|
184
|
+
Inicio
|
|
185
|
+
</Typography>
|
|
186
|
+
)}
|
|
187
|
+
{!isCollapsed && itemBadges['inicio'] !== undefined && itemBadges['inicio'] > 0 && (
|
|
188
|
+
<span
|
|
189
|
+
className="px-2 py-0.5 min-w-[20px] h-5
|
|
190
|
+
text-white rounded-full flex items-center justify-center
|
|
191
|
+
text-body-sm font-medium"
|
|
192
|
+
style={{
|
|
193
|
+
backgroundColor: '#6D3856',
|
|
194
|
+
borderRadius: '12px'
|
|
195
|
+
}}
|
|
196
|
+
>
|
|
197
|
+
{itemBadges['inicio'] > 9 ? '9+' : itemBadges['inicio']}
|
|
198
|
+
</span>
|
|
121
199
|
)}
|
|
122
200
|
</button>
|
|
123
201
|
</div>
|
|
@@ -125,7 +203,14 @@ export const SidebarPoint = ({
|
|
|
125
203
|
{/* Secciones */}
|
|
126
204
|
{sections.map((section, sectionIndex) => (
|
|
127
205
|
<div key={sectionIndex} className="mb-6">
|
|
128
|
-
{/*
|
|
206
|
+
{/* Línea separadora cuando está colapsado - antes de cada sección */}
|
|
207
|
+
{isCollapsed && (
|
|
208
|
+
<div className="px-4 mb-4">
|
|
209
|
+
<div className="border-t" style={{ borderColor: '#2D5C63' }}></div>
|
|
210
|
+
</div>
|
|
211
|
+
)}
|
|
212
|
+
|
|
213
|
+
{/* Título de la sección - solo visible cuando NO está colapsado */}
|
|
129
214
|
{!isCollapsed && (
|
|
130
215
|
<div className="px-4 mb-2">
|
|
131
216
|
<Typography
|
|
@@ -143,7 +228,7 @@ export const SidebarPoint = ({
|
|
|
143
228
|
<div key={item.id} className="px-4">
|
|
144
229
|
<button
|
|
145
230
|
onClick={() => onItemClick && onItemClick(item.id)}
|
|
146
|
-
className={`w-full flex items-center ${
|
|
231
|
+
className={`w-full flex items-center cursor-pointer ${
|
|
147
232
|
isCollapsed ? 'justify-center px-2' : 'px-4 justify-between'
|
|
148
233
|
} py-2.5 rounded-lg transition-all duration-200 ${
|
|
149
234
|
activeItem === item.id
|
|
@@ -196,10 +281,120 @@ export const SidebarPoint = ({
|
|
|
196
281
|
</div>
|
|
197
282
|
</div>
|
|
198
283
|
))}
|
|
284
|
+
</div>
|
|
199
285
|
</div>
|
|
286
|
+
|
|
287
|
+
{/* Footer con texto configurable - cuando está expandido */}
|
|
288
|
+
{footerText && !isCollapsed && (
|
|
289
|
+
<div className="px-4 pb-4 flex-shrink-0">
|
|
290
|
+
<div
|
|
291
|
+
className="bg-white border rounded-lg px-3 py-2 flex items-center justify-center"
|
|
292
|
+
style={{
|
|
293
|
+
borderColor: '#2D5C63',
|
|
294
|
+
borderRadius: '8px'
|
|
295
|
+
}}
|
|
296
|
+
>
|
|
297
|
+
{typeof footerText === 'string' ? (
|
|
298
|
+
<Typography
|
|
299
|
+
variant="body-sm"
|
|
300
|
+
style={{ color: '#2D5C63' }}
|
|
301
|
+
className="text-center"
|
|
302
|
+
>
|
|
303
|
+
{(() => {
|
|
304
|
+
const parts = footerText.split('|');
|
|
305
|
+
if (parts.length === 2) {
|
|
306
|
+
const leftPart = parts[0].trim();
|
|
307
|
+
const rightPart = parts[1].trim();
|
|
308
|
+
// Si contiene "Powered by", separar y poner la marca en bold
|
|
309
|
+
if (rightPart.includes('Powered by')) {
|
|
310
|
+
const poweredByMatch = rightPart.match(/Powered by (.+)/);
|
|
311
|
+
if (poweredByMatch) {
|
|
312
|
+
return (
|
|
313
|
+
<>
|
|
314
|
+
{leftPart} | Powered by <span className="font-bold">{poweredByMatch[1]}</span>
|
|
315
|
+
</>
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
return `${leftPart} | ${rightPart}`;
|
|
320
|
+
}
|
|
321
|
+
return footerText;
|
|
322
|
+
})()}
|
|
323
|
+
</Typography>
|
|
324
|
+
) : (
|
|
325
|
+
<Typography
|
|
326
|
+
variant="body-sm"
|
|
327
|
+
style={{ color: '#2D5C63' }}
|
|
328
|
+
className="text-center"
|
|
329
|
+
>
|
|
330
|
+
{footerText.version && `${footerText.version}`}
|
|
331
|
+
{footerText.version && (footerText.poweredBy || footerText.brand) && ' | '}
|
|
332
|
+
{footerText.poweredBy && `${footerText.poweredBy} `}
|
|
333
|
+
{footerText.brand && <span className="font-bold">{footerText.brand}</span>}
|
|
334
|
+
</Typography>
|
|
335
|
+
)}
|
|
336
|
+
</div>
|
|
337
|
+
</div>
|
|
338
|
+
)}
|
|
339
|
+
|
|
340
|
+
{/* Footer cuando está colapsado */}
|
|
341
|
+
{footerCollapsedContent && isCollapsed && (
|
|
342
|
+
<div className="px-1 pt-2 pb-2 flex justify-center flex-shrink-0" style={{ zIndex: 10 }}>
|
|
343
|
+
<div
|
|
344
|
+
className="bg-white border rounded px-1 py-0.5 flex items-center justify-center"
|
|
345
|
+
style={{
|
|
346
|
+
borderColor: '#2D5C63',
|
|
347
|
+
borderRadius: '4px',
|
|
348
|
+
width: 'calc(100% - 8px)',
|
|
349
|
+
minHeight: '20px'
|
|
350
|
+
}}
|
|
351
|
+
>
|
|
352
|
+
{typeof footerCollapsedContent === 'string' ? (
|
|
353
|
+
<span
|
|
354
|
+
style={{
|
|
355
|
+
color: '#2D5C63',
|
|
356
|
+
fontSize: '9px',
|
|
357
|
+
lineHeight: '1.2',
|
|
358
|
+
fontWeight: '600',
|
|
359
|
+
textAlign: 'center',
|
|
360
|
+
whiteSpace: 'nowrap',
|
|
361
|
+
overflow: 'hidden',
|
|
362
|
+
textOverflow: 'ellipsis',
|
|
363
|
+
maxWidth: '100%'
|
|
364
|
+
}}
|
|
365
|
+
>
|
|
366
|
+
{footerCollapsedContent}
|
|
367
|
+
</span>
|
|
368
|
+
) : typeof footerCollapsedContent === 'object' && footerCollapsedContent.icon ? (
|
|
369
|
+
<div className="flex items-center justify-center">
|
|
370
|
+
{footerCollapsedContent.icon && (
|
|
371
|
+
<Icon
|
|
372
|
+
name={footerCollapsedContent.icon}
|
|
373
|
+
variant="24-outline"
|
|
374
|
+
size={14}
|
|
375
|
+
style={{ color: '#2D5C63' }}
|
|
376
|
+
/>
|
|
377
|
+
)}
|
|
378
|
+
{footerCollapsedContent.text && (
|
|
379
|
+
<span
|
|
380
|
+
style={{
|
|
381
|
+
color: '#2D5C63',
|
|
382
|
+
fontSize: '10px',
|
|
383
|
+
marginLeft: footerCollapsedContent.icon ? '4px' : '0'
|
|
384
|
+
}}
|
|
385
|
+
>
|
|
386
|
+
{footerCollapsedContent.text}
|
|
387
|
+
</span>
|
|
388
|
+
)}
|
|
389
|
+
</div>
|
|
390
|
+
) : (
|
|
391
|
+
footerCollapsedContent
|
|
392
|
+
)}
|
|
393
|
+
</div>
|
|
394
|
+
</div>
|
|
395
|
+
)}
|
|
200
396
|
</nav>
|
|
201
397
|
</aside>
|
|
202
|
-
</>
|
|
203
398
|
);
|
|
204
399
|
};
|
|
205
400
|
|
|
@@ -302,6 +497,16 @@ const SidebarPointMobile = ({
|
|
|
302
497
|
{capitalizedDate}
|
|
303
498
|
</Typography>
|
|
304
499
|
</div>
|
|
500
|
+
{/* Logo de empresa (si se proporciona) */}
|
|
501
|
+
{companyLogo && (
|
|
502
|
+
<div className="bg-gray-100 px-4 py-6 flex justify-center border-b border-gray-200">
|
|
503
|
+
<img
|
|
504
|
+
src={companyLogo}
|
|
505
|
+
alt={companyName || 'Company Logo'}
|
|
506
|
+
className="max-w-[120px] max-h-[120px] object-contain"
|
|
507
|
+
/>
|
|
508
|
+
</div>
|
|
509
|
+
)}
|
|
305
510
|
{/* Contenido del sidebar mobile */}
|
|
306
511
|
<div className="flex-1 overflow-y-auto py-4">
|
|
307
512
|
{/* Item "Inicio" destacado */}
|
|
@@ -311,7 +516,7 @@ const SidebarPointMobile = ({
|
|
|
311
516
|
onItemClick && onItemClick('inicio');
|
|
312
517
|
toggleMobileMenu();
|
|
313
518
|
}}
|
|
314
|
-
className={`w-full flex items-center px-4 justify-between py-2.5 rounded-lg transition-all duration-200 ${
|
|
519
|
+
className={`w-full flex items-center cursor-pointer px-4 justify-between py-2.5 rounded-lg transition-all duration-200 ${
|
|
315
520
|
activeItem === 'inicio'
|
|
316
521
|
? ''
|
|
317
522
|
: 'color-gray-700 hover:bg-gray-100'
|
|
@@ -378,7 +583,7 @@ const SidebarPointMobile = ({
|
|
|
378
583
|
onItemClick && onItemClick(item.id);
|
|
379
584
|
toggleMobileMenu();
|
|
380
585
|
}}
|
|
381
|
-
className={`w-full flex items-center px-4 justify-between py-2.5 rounded-lg transition-all duration-200 ${
|
|
586
|
+
className={`w-full flex items-center cursor-pointer px-4 justify-between py-2.5 rounded-lg transition-all duration-200 ${
|
|
382
587
|
activeItem === item.id
|
|
383
588
|
? ''
|
|
384
589
|
: 'color-gray-700 hover:bg-gray-100'
|
|
@@ -36,6 +36,8 @@ export const Default = {
|
|
|
36
36
|
onItemClick={setActiveItem}
|
|
37
37
|
companyName="HEXA Point"
|
|
38
38
|
onCompanyClick={() => console.log('Company clicked')}
|
|
39
|
+
Client={false}
|
|
40
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
39
41
|
/>
|
|
40
42
|
</div>
|
|
41
43
|
);
|
|
@@ -52,6 +54,8 @@ export const Colapsado = {
|
|
|
52
54
|
activeItem={activeItem}
|
|
53
55
|
onItemClick={setActiveItem}
|
|
54
56
|
defaultCollapsed={true}
|
|
57
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
58
|
+
footerCollapsedContent="v1.0"
|
|
55
59
|
/>
|
|
56
60
|
</div>
|
|
57
61
|
);
|
|
@@ -83,6 +87,7 @@ export const ConSeccionesPersonalizadas = {
|
|
|
83
87
|
sections={customSections}
|
|
84
88
|
activeItem={activeItem}
|
|
85
89
|
onItemClick={setActiveItem}
|
|
90
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
86
91
|
/>
|
|
87
92
|
</div>
|
|
88
93
|
);
|
|
@@ -99,6 +104,7 @@ export const Mobile = {
|
|
|
99
104
|
activeItem={activeItem}
|
|
100
105
|
onItemClick={setActiveItem}
|
|
101
106
|
companyName="HEXA Point"
|
|
107
|
+
companyLogo="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBwgHBgkIBwgKCgk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vlpmZrqSOOOa5xnM/x1WLk0ZdftMe2Nkd63H4GPF5DFy7Z1UW9c4Lclp9u+iPwOPmUctbN4dmPjWpvpemo+hh8L/Wub9j/Uamr4ds8+rcyz3V6/kMWjKhjW2qN09dMdPvt6R8zeRxMHXvVyi35RXdv8CFzf8TYX8r9bPfP4WXXyUeRopV8El+y49Wteq9Bd3z0mufc+3U9VawuSxM5tY1vVKK24taaRtkTg87BzL3KvGjj5fQ1KMeyktrevx0WzWb3Hfi39892gANOgAAIeRxWTZ4hhnRUPYxlBvcu+ku/YufAAkzIxjjznvr9czy/hyy3JdmB7NQn3cJS10v5fIqcvxr5Dj40xlGNsNOLflvWmikDP0jE+Pid+PbnIcfzduG8S66uumMdLT7zXwW/Q3OG4yzG4+/FzVB+1k9qMt9taK4LMRM/Hzm9uaq4rluMtn9HWwnVL4Tet/an8fmjfqxuTtwM2vOnXK26txrjF9o7RWAmOjPBmer4SeE42eLx92NmqElZJ7UZb7NJf2NKnjOW4u2a42yuymT2ozevzXbv9h0YFxC8GepJ+JnH0cm8n2/I319Ci1GmtdvtJ9nE8jh8jZk8ZKDjY22ptdtvbTTOjA+i3glklt8Oalw3JT5KjLvtqtcZQlY+rWtPyS18Fo38+vmI5crcCyuVLS/dzfkVgT6SJPj5kvVvlD4fisqrkLc/OdaslvUK/Lb+JcANSSOnHxzjnUAAVsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/9k="
|
|
102
108
|
onCompanyClick={() => console.log('Company clicked')}
|
|
103
109
|
/>
|
|
104
110
|
<div className="p-4">
|
|
@@ -111,4 +117,67 @@ export const Mobile = {
|
|
|
111
117
|
},
|
|
112
118
|
};
|
|
113
119
|
|
|
120
|
+
export const ConFooter = {
|
|
121
|
+
render: () => {
|
|
122
|
+
const [activeItem, setActiveItem] = useState('inicio');
|
|
123
|
+
return (
|
|
124
|
+
<div className="h-screen bg-gray-100">
|
|
125
|
+
<SidebarPoint
|
|
126
|
+
sections={mockSections}
|
|
127
|
+
activeItem={activeItem}
|
|
128
|
+
onItemClick={setActiveItem}
|
|
129
|
+
companyName="HEXA Point"
|
|
130
|
+
onCompanyClick={() => console.log('Company clicked')}
|
|
131
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
);
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
export const ConFooterPersonalizado = {
|
|
139
|
+
render: () => {
|
|
140
|
+
const [activeItem, setActiveItem] = useState('inicio');
|
|
141
|
+
return (
|
|
142
|
+
<div className="h-screen bg-gray-100">
|
|
143
|
+
<SidebarPoint
|
|
144
|
+
sections={mockSections}
|
|
145
|
+
activeItem={activeItem}
|
|
146
|
+
onItemClick={setActiveItem}
|
|
147
|
+
companyName="HEXA Point"
|
|
148
|
+
onCompanyClick={() => console.log('Company clicked')}
|
|
149
|
+
footerText={{
|
|
150
|
+
version: 'v2.1',
|
|
151
|
+
poweredBy: 'Powered by',
|
|
152
|
+
brand: 'Nucleus'
|
|
153
|
+
}}
|
|
154
|
+
footerCollapsedContent={{
|
|
155
|
+
icon: 'InformationCircleIcon',
|
|
156
|
+
text: 'v2.1'
|
|
157
|
+
}}
|
|
158
|
+
/>
|
|
159
|
+
</div>
|
|
160
|
+
);
|
|
161
|
+
},
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const Client = {
|
|
165
|
+
render: () => {
|
|
166
|
+
const [activeItem, setActiveItem] = useState('inicio');
|
|
167
|
+
return (
|
|
168
|
+
<div className="h-screen bg-gray-100">
|
|
169
|
+
<SidebarPoint
|
|
170
|
+
sections={mockSections}
|
|
171
|
+
activeItem={activeItem}
|
|
172
|
+
onItemClick={setActiveItem}
|
|
173
|
+
companyName="HEXA Point"
|
|
174
|
+
onCompanyClick={() => console.log('Company clicked')}
|
|
175
|
+
Client={false}
|
|
176
|
+
footerText="v1.0 | Powered by Nucleus"
|
|
177
|
+
/>
|
|
178
|
+
</div>
|
|
179
|
+
);
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
|
|
114
183
|
|
package/src/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { Divider } from './components/Atoms/Divider/Divider';
|
|
|
14
14
|
export { Skeleton } from './components/Atoms/Skeleton/Skeleton';
|
|
15
15
|
export { Toast } from './components/Atoms/Toast/Toast';
|
|
16
16
|
export { Tooltip } from './components/Atoms/Tooltip/Tooltip';
|
|
17
|
+
export { LogoHexa } from './components/Atoms/LogoHexa/LogoHexa';
|
|
17
18
|
|
|
18
19
|
// Inputs
|
|
19
20
|
export { Input } from './components/Inputs/Input/Input';
|
|
@@ -27,12 +28,13 @@ export { FileUpload } from './components/Inputs/FileUpload/FileUpload';
|
|
|
27
28
|
|
|
28
29
|
// Layout
|
|
29
30
|
export { Layout } from './components/Layout/Layout/Layout';
|
|
30
|
-
export { Header } from './components/Layout/Header/Header';
|
|
31
31
|
export { HeaderConBuscador } from './components/Layout/Header/HeaderConBuscador';
|
|
32
32
|
export { HeaderCore } from './components/Layout/Header/HeaderCore';
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
33
|
+
export { HeaderPoint } from './components/Layout/Header/HeaderPoint';
|
|
34
|
+
export { HeaderGeneral } from './components/Layout/Header/HeaderGeneral';
|
|
35
|
+
export { SidebarCore, SidebarCoreMobile } from './components/Layout/Sidebar/SidebarCore';
|
|
35
36
|
export { SidebarPoint, SidebarPointMobile } from './components/Layout/Sidebar/SidebarPoint';
|
|
37
|
+
export { NavPoint } from './components/Layout/NavPoint/NavPoint';
|
|
36
38
|
export { Modal } from './components/Layout/Modal/Modal';
|
|
37
39
|
export { Tabs } from './components/Layout/Tabs/Tabs';
|
|
38
40
|
export { Accordion } from './components/Layout/Accordion/Accordion';
|
|
@@ -44,6 +46,13 @@ export { Stepper } from './components/Layout/Stepper/Stepper';
|
|
|
44
46
|
|
|
45
47
|
// DataDisplay
|
|
46
48
|
export { Card } from './components/DataDisplay/Card/Card';
|
|
49
|
+
export { CardTituloCorto } from './components/DataDisplay/Card/CardTituloCorto';
|
|
50
|
+
export { CardTituloLargo } from './components/DataDisplay/Card/CardTituloLargo';
|
|
51
|
+
export { CardTituloCortoMasEstado } from './components/DataDisplay/Card/CardTituloCortoMasEstado';
|
|
52
|
+
export { CardTituloLargoMasEstado } from './components/DataDisplay/Card/CardTituloLargoMasEstado';
|
|
53
|
+
export { CardSkeleton } from './components/DataDisplay/Card/CardSkeleton';
|
|
54
|
+
export { CardVacia } from './components/DataDisplay/Card/CardVacia';
|
|
55
|
+
export { CardError } from './components/DataDisplay/Card/CardError';
|
|
47
56
|
export { DBGrid } from './components/DataDisplay/DBGrid/DBGrid';
|
|
48
57
|
export { LineChart } from './components/DataDisplay/LineChart/LineChart';
|
|
49
58
|
export { BarChart } from './components/DataDisplay/BarChart/BarChart';
|
package/src/style.css
CHANGED
|
@@ -104,6 +104,31 @@
|
|
|
104
104
|
font-family: 'IBM Plex Mono', monospace;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
/* --- MONO TEXT - IBM Plex Mono --- */
|
|
108
|
+
.text-mono-lg {
|
|
109
|
+
font-family: 'IBM Plex Mono', monospace;
|
|
110
|
+
font-size: 1rem; /* 16px */
|
|
111
|
+
line-height: 1.5rem; /* 24px */
|
|
112
|
+
font-weight: 400; /* Regular */
|
|
113
|
+
letter-spacing: 0;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.text-mono-md {
|
|
117
|
+
font-family: 'IBM Plex Mono', monospace;
|
|
118
|
+
font-size: 0.875rem; /* 14px */
|
|
119
|
+
line-height: 1.3125rem; /* 21px */
|
|
120
|
+
font-weight: 400; /* Regular */
|
|
121
|
+
letter-spacing: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.text-mono-sm {
|
|
125
|
+
font-family: 'IBM Plex Mono', monospace;
|
|
126
|
+
font-size: 0.75rem; /* 12px */
|
|
127
|
+
line-height: 1.125rem; /* 18px */
|
|
128
|
+
font-weight: 400; /* Regular */
|
|
129
|
+
letter-spacing: 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
107
132
|
/* --- COLORS GENÉRICOS (Clases utilitarias) --- */
|
|
108
133
|
.color-black {
|
|
109
134
|
color: #111827; /* gray-900 */
|