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,50 +0,0 @@
|
|
|
1
|
-
import { useTranslation } from 'react-i18next';
|
|
2
|
-
import { Select } from '../../Inputs/Select/Select';
|
|
3
|
-
|
|
4
|
-
export const Header = ({
|
|
5
|
-
title = 'Anima DS',
|
|
6
|
-
onLanguageChange,
|
|
7
|
-
currentLanguage = 'es-AR',
|
|
8
|
-
className = '',
|
|
9
|
-
...props
|
|
10
|
-
}) => {
|
|
11
|
-
const { t, i18n } = useTranslation();
|
|
12
|
-
|
|
13
|
-
const languageOptions = [
|
|
14
|
-
{ value: 'es-AR', label: 'Español (AR)' },
|
|
15
|
-
{ value: 'pt-BR', label: 'Português (BR)' },
|
|
16
|
-
];
|
|
17
|
-
|
|
18
|
-
const handleLanguageChange = (e) => {
|
|
19
|
-
const lang = e.target.value;
|
|
20
|
-
i18n.changeLanguage(lang);
|
|
21
|
-
if (onLanguageChange) {
|
|
22
|
-
onLanguageChange(lang);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<header className={`bg-white shadow-sm border-b border-gray-200 ${className}`} {...props}>
|
|
28
|
-
<div className="container mx-auto px-4 sm:px-6 lg:px-8">
|
|
29
|
-
<div className="flex items-center justify-between h-16">
|
|
30
|
-
<div className="flex items-center">
|
|
31
|
-
<h1 className="text-xl font-bold text-gray-900">{title}</h1>
|
|
32
|
-
</div>
|
|
33
|
-
<div className="flex items-center space-x-4">
|
|
34
|
-
<div className="w-48">
|
|
35
|
-
<Select
|
|
36
|
-
value={currentLanguage}
|
|
37
|
-
options={languageOptions}
|
|
38
|
-
onChange={handleLanguageChange}
|
|
39
|
-
className="w-full"
|
|
40
|
-
/>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
</header>
|
|
46
|
-
);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export default Header;
|
|
50
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { Header } from './Header';
|
|
3
|
-
import { I18nProvider } from '../../../providers/I18nProvider';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Layout/Header',
|
|
7
|
-
component: Header,
|
|
8
|
-
tags: ['autodocs'],
|
|
9
|
-
decorators: [
|
|
10
|
-
(Story) => (
|
|
11
|
-
<I18nProvider>
|
|
12
|
-
<Story />
|
|
13
|
-
</I18nProvider>
|
|
14
|
-
),
|
|
15
|
-
],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const Default = {
|
|
19
|
-
render: () => {
|
|
20
|
-
const [language, setLanguage] = useState('es-AR');
|
|
21
|
-
return (
|
|
22
|
-
<Header
|
|
23
|
-
title="Anima Design System"
|
|
24
|
-
currentLanguage={language}
|
|
25
|
-
onLanguageChange={setLanguage}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const WithCustomTitle = {
|
|
32
|
-
args: {
|
|
33
|
-
title: 'My Application',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { Icon } from '../../Atoms/Icon/Icon';
|
|
3
|
-
import { Typography } from '../../Atoms/Typography/Typography';
|
|
4
|
-
|
|
5
|
-
// Mock data con 2 títulos y 2 secciones
|
|
6
|
-
const MOCK_SECTIONS = [
|
|
7
|
-
{
|
|
8
|
-
title: 'PERSONAS',
|
|
9
|
-
items: [
|
|
10
|
-
{ id: 'empleados', label: 'Empleados', icon: 'UserGroupIcon' },
|
|
11
|
-
{ id: 'organizacion', label: 'Organización', icon: 'BuildingOfficeIcon' },
|
|
12
|
-
],
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
title: 'TALENTO',
|
|
16
|
-
items: [
|
|
17
|
-
{ id: 'reclutamiento', label: 'Reclutamiento', icon: 'UserPlusIcon' },
|
|
18
|
-
{ id: 'desarrollo', label: 'Desarrollo', icon: 'AcademicCapIcon' },
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
export const Sidebar = ({
|
|
24
|
-
sections = MOCK_SECTIONS,
|
|
25
|
-
activeItem,
|
|
26
|
-
onItemClick,
|
|
27
|
-
defaultCollapsed = false,
|
|
28
|
-
companyName = 'Nucleus AR',
|
|
29
|
-
companyLogo,
|
|
30
|
-
onCompanyClick,
|
|
31
|
-
className = '',
|
|
32
|
-
...props
|
|
33
|
-
}) => {
|
|
34
|
-
const [isCollapsed, setIsCollapsed] = useState(defaultCollapsed);
|
|
35
|
-
|
|
36
|
-
const toggleCollapse = () => {
|
|
37
|
-
setIsCollapsed(!isCollapsed);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<aside
|
|
42
|
-
className={`bg-white border-r border-gray-200 transition-all duration-300 ease-in-out ${
|
|
43
|
-
isCollapsed ? 'w-20' : 'w-64'
|
|
44
|
-
} ${className}`}
|
|
45
|
-
{...props}
|
|
46
|
-
>
|
|
47
|
-
<nav className="h-full flex flex-col">
|
|
48
|
-
{/* Barra superior con Nucleus AR */}
|
|
49
|
-
{!isCollapsed && (
|
|
50
|
-
<div className="p-4 border-b border-gray-200">
|
|
51
|
-
<button
|
|
52
|
-
onClick={onCompanyClick}
|
|
53
|
-
className="w-full bg-white rounded-lg border px-3 py-2.5
|
|
54
|
-
flex items-center justify-between hover:bg-gray-50 transition-colors"
|
|
55
|
-
style={{ borderColor: '#2D5C63' }}
|
|
56
|
-
>
|
|
57
|
-
<div className="flex items-center space-x-3">
|
|
58
|
-
{/* Icono cuadrado oscuro con N */}
|
|
59
|
-
{companyLogo ? (
|
|
60
|
-
<img
|
|
61
|
-
src={companyLogo}
|
|
62
|
-
alt={companyName}
|
|
63
|
-
className="w-8 h-8 rounded"
|
|
64
|
-
/>
|
|
65
|
-
) : (
|
|
66
|
-
<div className="w-8 h-8 bg-gray-700 rounded flex items-center justify-center">
|
|
67
|
-
<Typography
|
|
68
|
-
variant="body-md"
|
|
69
|
-
className="color-white font-bold"
|
|
70
|
-
>
|
|
71
|
-
N
|
|
72
|
-
</Typography>
|
|
73
|
-
</div>
|
|
74
|
-
)}
|
|
75
|
-
{/* Nombre de la empresa */}
|
|
76
|
-
<Typography
|
|
77
|
-
variant="body-md"
|
|
78
|
-
className="color-gray-900 font-medium"
|
|
79
|
-
>
|
|
80
|
-
{companyName}
|
|
81
|
-
</Typography>
|
|
82
|
-
</div>
|
|
83
|
-
{/* Chevron hacia abajo */}
|
|
84
|
-
<Icon
|
|
85
|
-
name="ChevronDownIcon"
|
|
86
|
-
variant="24-outline"
|
|
87
|
-
size={16}
|
|
88
|
-
className="color-gray-500"
|
|
89
|
-
/>
|
|
90
|
-
</button>
|
|
91
|
-
</div>
|
|
92
|
-
)}
|
|
93
|
-
{/* Botón de colapsar/expandir - Solo visible cuando está expandido */}
|
|
94
|
-
{!isCollapsed && (
|
|
95
|
-
<div className="px-4 pb-2 flex justify-end">
|
|
96
|
-
<button
|
|
97
|
-
onClick={toggleCollapse}
|
|
98
|
-
className="p-1.5 hover:bg-gray-100 rounded-lg transition-colors"
|
|
99
|
-
aria-label="Colapsar sidebar"
|
|
100
|
-
>
|
|
101
|
-
<Icon
|
|
102
|
-
name="XMarkIcon"
|
|
103
|
-
variant="24-outline"
|
|
104
|
-
size={20}
|
|
105
|
-
className="color-gray-400"
|
|
106
|
-
/>
|
|
107
|
-
</button>
|
|
108
|
-
</div>
|
|
109
|
-
)}
|
|
110
|
-
|
|
111
|
-
{/* Botón para expandir - Solo visible cuando está colapsado */}
|
|
112
|
-
{isCollapsed && (
|
|
113
|
-
<div className="p-4 border-b border-gray-200 flex justify-center">
|
|
114
|
-
<button
|
|
115
|
-
onClick={toggleCollapse}
|
|
116
|
-
className="p-1.5 hover:bg-gray-100 rounded-lg transition-colors"
|
|
117
|
-
aria-label="Expandir sidebar"
|
|
118
|
-
>
|
|
119
|
-
<Icon
|
|
120
|
-
name="Bars3Icon"
|
|
121
|
-
variant="24-outline"
|
|
122
|
-
size={20}
|
|
123
|
-
className="color-gray-400"
|
|
124
|
-
/>
|
|
125
|
-
</button>
|
|
126
|
-
</div>
|
|
127
|
-
)}
|
|
128
|
-
|
|
129
|
-
{/* Contenido del sidebar */}
|
|
130
|
-
<div className="flex-1 overflow-y-auto py-4">
|
|
131
|
-
{/* Item "Inicio" destacado */}
|
|
132
|
-
<div className="px-4 mb-4">
|
|
133
|
-
<button
|
|
134
|
-
onClick={() => onItemClick && onItemClick('inicio')}
|
|
135
|
-
className={`w-full flex items-center ${
|
|
136
|
-
isCollapsed ? 'justify-center px-2' : 'px-4'
|
|
137
|
-
} py-2.5 rounded-lg transition-all duration-200 ${
|
|
138
|
-
activeItem === 'inicio'
|
|
139
|
-
? ''
|
|
140
|
-
: 'color-gray-700 hover:bg-gray-100'
|
|
141
|
-
}`}
|
|
142
|
-
style={
|
|
143
|
-
activeItem === 'inicio'
|
|
144
|
-
? { backgroundColor: '#2D5C63' }
|
|
145
|
-
: {}
|
|
146
|
-
}
|
|
147
|
-
>
|
|
148
|
-
<Icon
|
|
149
|
-
name="HomeIcon"
|
|
150
|
-
variant="24-outline"
|
|
151
|
-
size={20}
|
|
152
|
-
className={isCollapsed ? '' : 'mr-3'}
|
|
153
|
-
/>
|
|
154
|
-
{!isCollapsed && (
|
|
155
|
-
<Typography
|
|
156
|
-
variant="body-md"
|
|
157
|
-
className={`font-medium ${
|
|
158
|
-
activeItem === 'inicio' ? 'color-white' : 'color-gray-700'
|
|
159
|
-
}`}
|
|
160
|
-
>
|
|
161
|
-
Inicio
|
|
162
|
-
</Typography>
|
|
163
|
-
)}
|
|
164
|
-
</button>
|
|
165
|
-
</div>
|
|
166
|
-
|
|
167
|
-
{/* Secciones */}
|
|
168
|
-
{sections.map((section, sectionIndex) => (
|
|
169
|
-
<div key={sectionIndex} className="mb-6">
|
|
170
|
-
{/* Título de la sección */}
|
|
171
|
-
{!isCollapsed && (
|
|
172
|
-
<div className="px-4 mb-2">
|
|
173
|
-
<Typography
|
|
174
|
-
variant="body-sm"
|
|
175
|
-
className="color-gray-500 uppercase font-medium tracking-wider"
|
|
176
|
-
>
|
|
177
|
-
{section.title}
|
|
178
|
-
</Typography>
|
|
179
|
-
</div>
|
|
180
|
-
)}
|
|
181
|
-
|
|
182
|
-
{/* Items de la sección */}
|
|
183
|
-
<div className="space-y-1">
|
|
184
|
-
{section.items.map((item) => (
|
|
185
|
-
<div key={item.id} className="px-4">
|
|
186
|
-
<button
|
|
187
|
-
onClick={() => onItemClick && onItemClick(item.id)}
|
|
188
|
-
className={`w-full flex items-center ${
|
|
189
|
-
isCollapsed ? 'justify-center px-2' : 'px-4'
|
|
190
|
-
} py-2.5 rounded-lg transition-all duration-200 ${
|
|
191
|
-
activeItem === item.id
|
|
192
|
-
? ''
|
|
193
|
-
: 'color-gray-700 hover:bg-gray-100'
|
|
194
|
-
}`}
|
|
195
|
-
style={
|
|
196
|
-
activeItem === item.id
|
|
197
|
-
? { backgroundColor: '#2D5C63' }
|
|
198
|
-
: {}
|
|
199
|
-
}
|
|
200
|
-
title={isCollapsed ? item.label : ''}
|
|
201
|
-
>
|
|
202
|
-
<Icon
|
|
203
|
-
name={item.icon}
|
|
204
|
-
variant="24-outline"
|
|
205
|
-
size={20}
|
|
206
|
-
className={isCollapsed ? '' : 'mr-3'}
|
|
207
|
-
/>
|
|
208
|
-
{!isCollapsed && (
|
|
209
|
-
<Typography
|
|
210
|
-
variant="body-md"
|
|
211
|
-
className={`font-medium ${
|
|
212
|
-
activeItem === item.id ? 'color-white' : 'color-gray-700'
|
|
213
|
-
}`}
|
|
214
|
-
>
|
|
215
|
-
{item.label}
|
|
216
|
-
</Typography>
|
|
217
|
-
)}
|
|
218
|
-
</button>
|
|
219
|
-
</div>
|
|
220
|
-
))}
|
|
221
|
-
</div>
|
|
222
|
-
</div>
|
|
223
|
-
))}
|
|
224
|
-
</div>
|
|
225
|
-
</nav>
|
|
226
|
-
</aside>
|
|
227
|
-
);
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
export default Sidebar;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { Sidebar } from './Sidebar';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Layout/Sidebar',
|
|
6
|
-
component: Sidebar,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// Mock data con 2 títulos y 2 secciones
|
|
11
|
-
const mockSections = [
|
|
12
|
-
{
|
|
13
|
-
title: 'PERSONAS',
|
|
14
|
-
items: [
|
|
15
|
-
{ id: 'empleados', label: 'Empleados', icon: 'UserGroupIcon' },
|
|
16
|
-
{ id: 'organizacion', label: 'Organización', icon: 'BuildingOfficeIcon' },
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
title: 'TALENTO',
|
|
21
|
-
items: [
|
|
22
|
-
{ id: 'reclutamiento', label: 'Reclutamiento', icon: 'UserPlusIcon' },
|
|
23
|
-
{ id: 'desarrollo', label: 'Desarrollo', icon: 'AcademicCapIcon' },
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
|
|
28
|
-
export const Default = {
|
|
29
|
-
render: () => {
|
|
30
|
-
const [activeItem, setActiveItem] = useState('inicio');
|
|
31
|
-
return (
|
|
32
|
-
<div className="h-screen bg-gray-100">
|
|
33
|
-
<Sidebar
|
|
34
|
-
sections={mockSections}
|
|
35
|
-
activeItem={activeItem}
|
|
36
|
-
onItemClick={setActiveItem}
|
|
37
|
-
companyName="Nucleus AR"
|
|
38
|
-
onCompanyClick={() => console.log('Company clicked')}
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
);
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const Colapsado = {
|
|
46
|
-
render: () => {
|
|
47
|
-
const [activeItem, setActiveItem] = useState('inicio');
|
|
48
|
-
return (
|
|
49
|
-
<div className="h-screen bg-gray-100">
|
|
50
|
-
<Sidebar
|
|
51
|
-
sections={mockSections}
|
|
52
|
-
activeItem={activeItem}
|
|
53
|
-
onItemClick={setActiveItem}
|
|
54
|
-
defaultCollapsed={true}
|
|
55
|
-
/>
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const ConSeccionesPersonalizadas = {
|
|
62
|
-
render: () => {
|
|
63
|
-
const [activeItem, setActiveItem] = useState('item1');
|
|
64
|
-
const customSections = [
|
|
65
|
-
{
|
|
66
|
-
title: 'ADMINISTRACIÓN',
|
|
67
|
-
items: [
|
|
68
|
-
{ id: 'item1', label: 'Usuarios', icon: 'UserIcon' },
|
|
69
|
-
{ id: 'item2', label: 'Roles', icon: 'ShieldCheckIcon' },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
title: 'REPORTES',
|
|
74
|
-
items: [
|
|
75
|
-
{ id: 'item3', label: 'Analíticas', icon: 'ChartBarIcon' },
|
|
76
|
-
{ id: 'item4', label: 'Exportar', icon: 'ArrowDownTrayIcon' },
|
|
77
|
-
],
|
|
78
|
-
},
|
|
79
|
-
];
|
|
80
|
-
return (
|
|
81
|
-
<div className="h-screen bg-gray-100">
|
|
82
|
-
<Sidebar
|
|
83
|
-
sections={customSections}
|
|
84
|
-
activeItem={activeItem}
|
|
85
|
-
onItemClick={setActiveItem}
|
|
86
|
-
/>
|
|
87
|
-
</div>
|
|
88
|
-
);
|
|
89
|
-
},
|
|
90
|
-
};
|