anima-ds-nucleus 1.0.2 → 1.0.4
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 +152 -34
- package/dist/anima-ds.esm.js +10124 -7528
- 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 +53 -18
- package/src/components/Atoms/Typography/Typography.stories.jsx +40 -4
- 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 +61 -0
- package/src/components/DataDisplay/Card/CardTituloCortoMasEstado.jsx +79 -0
- package/src/components/DataDisplay/Card/CardTituloLargo.jsx +61 -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.jsx +136 -0
- package/src/components/Layout/Header/HeaderConBuscador.stories.jsx +86 -0
- package/src/components/Layout/Header/HeaderCore.jsx +347 -0
- package/src/components/Layout/Header/HeaderCore.stories.jsx +59 -0
- 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 +779 -0
- package/src/components/Layout/Sidebar/SidebarCore.stories.jsx +167 -0
- package/src/components/Layout/Sidebar/SidebarPoint.jsx +645 -0
- package/src/components/Layout/Sidebar/SidebarPoint.stories.jsx +183 -0
- package/src/index.js +15 -2
- package/src/style.css +37 -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 -57
- package/src/components/Layout/Sidebar/Sidebar.stories.jsx +0 -51
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Icon } from '../../Atoms/Icon/Icon';
|
|
3
|
+
import { Typography } from '../../Atoms/Typography/Typography';
|
|
4
|
+
import { LogoHexa } from '../../Atoms/LogoHexa/LogoHexa';
|
|
5
|
+
|
|
6
|
+
export const HeaderGeneral = ({
|
|
7
|
+
logoText = 'HEXA',
|
|
8
|
+
suiteText = 'Suite',
|
|
9
|
+
languages = [
|
|
10
|
+
{ code: 'es-AR', name: 'Español' },
|
|
11
|
+
{ code: 'en', name: 'English' },
|
|
12
|
+
],
|
|
13
|
+
currentLanguageCode = 'es-AR',
|
|
14
|
+
onLanguageChange,
|
|
15
|
+
className = '',
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
const [isLanguageOpen, setIsLanguageOpen] = useState(false);
|
|
19
|
+
|
|
20
|
+
const currentLanguage = languages.find(lang => lang.code === currentLanguageCode) || languages[0];
|
|
21
|
+
|
|
22
|
+
const handleLanguageChange = (langCode) => {
|
|
23
|
+
if (onLanguageChange) {
|
|
24
|
+
onLanguageChange(langCode);
|
|
25
|
+
}
|
|
26
|
+
setIsLanguageOpen(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<header className={`w-full flex justify-between items-center bg-white ${className}`} style={{ paddingTop: '4px', paddingBottom: '4px', paddingLeft: '8px', paddingRight: '12px' }} {...props}>
|
|
31
|
+
{/* Logo */}
|
|
32
|
+
<div className="flex items-center gap-2">
|
|
33
|
+
<LogoHexa width={32} height={36} />
|
|
34
|
+
<div className="flex items-center" style={{ gap: '4px' }}>
|
|
35
|
+
<Typography variant="h6" className="font-normal" style={{ color: '#2D5C63', margin: 0 }}>
|
|
36
|
+
{logoText}
|
|
37
|
+
</Typography>
|
|
38
|
+
<Typography variant="h6" className="font-normal" style={{ color: '#2D5C63', margin: 0 }}>
|
|
39
|
+
{suiteText}
|
|
40
|
+
</Typography>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
{/* Language Selector - Solo se muestra si hay idiomas */}
|
|
45
|
+
{languages && languages.length > 0 && (
|
|
46
|
+
<div className="relative flex items-center gap-2">
|
|
47
|
+
<Icon name="LanguageIcon" variant="24-outline" size={18} style={{ color: '#374151' }} />
|
|
48
|
+
<button
|
|
49
|
+
onClick={() => setIsLanguageOpen(!isLanguageOpen)}
|
|
50
|
+
className="flex items-center gap-2 px-3 py-2 text-body-md color-gray-700 bg-white hover:bg-gray-50 rounded-lg transition-colors"
|
|
51
|
+
style={{ border: '1px solid #2D5C63' }}
|
|
52
|
+
>
|
|
53
|
+
<span>{currentLanguage.name}</span>
|
|
54
|
+
<Icon
|
|
55
|
+
name="ChevronDownIcon"
|
|
56
|
+
variant="24-outline"
|
|
57
|
+
size={16}
|
|
58
|
+
className={`transition-transform ${isLanguageOpen ? 'rotate-180' : ''}`}
|
|
59
|
+
/>
|
|
60
|
+
</button>
|
|
61
|
+
|
|
62
|
+
{isLanguageOpen && (
|
|
63
|
+
<>
|
|
64
|
+
<div
|
|
65
|
+
className="fixed inset-0 z-10"
|
|
66
|
+
onClick={() => setIsLanguageOpen(false)}
|
|
67
|
+
/>
|
|
68
|
+
<div className="absolute right-0 mt-2 w-40 bg-white rounded-lg shadow-lg z-20 py-1" style={{ border: '1px solid #2D5C63' }}>
|
|
69
|
+
{languages.map((lang) => (
|
|
70
|
+
<button
|
|
71
|
+
key={lang.code}
|
|
72
|
+
onClick={() => handleLanguageChange(lang.code)}
|
|
73
|
+
className={`w-full text-left px-4 py-2 text-body-md hover:bg-gray-50 transition-colors ${
|
|
74
|
+
currentLanguage.code === lang.code
|
|
75
|
+
? 'bg-gray-50 color-brand font-medium'
|
|
76
|
+
: 'color-gray-700'
|
|
77
|
+
}`}
|
|
78
|
+
>
|
|
79
|
+
{lang.name}
|
|
80
|
+
</button>
|
|
81
|
+
))}
|
|
82
|
+
</div>
|
|
83
|
+
</>
|
|
84
|
+
)}
|
|
85
|
+
</div>
|
|
86
|
+
)}
|
|
87
|
+
</header>
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default HeaderGeneral;
|
|
92
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { HeaderGeneral } from './HeaderGeneral';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/HeaderGeneral',
|
|
5
|
+
component: HeaderGeneral,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Default = {
|
|
10
|
+
render: () => (
|
|
11
|
+
<HeaderGeneral
|
|
12
|
+
logoText="HEXA"
|
|
13
|
+
suiteText="Suite"
|
|
14
|
+
languages={[
|
|
15
|
+
{ code: 'es-AR', name: 'Español' },
|
|
16
|
+
{ code: 'en', name: 'English' },
|
|
17
|
+
]}
|
|
18
|
+
currentLanguageCode="es-AR"
|
|
19
|
+
onLanguageChange={(langCode) => console.log('Idioma cambiado:', langCode)}
|
|
20
|
+
/>
|
|
21
|
+
),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const ConIdiomaIngles = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<HeaderGeneral
|
|
27
|
+
logoText="HEXA"
|
|
28
|
+
suiteText="Suite"
|
|
29
|
+
languages={[
|
|
30
|
+
{ code: 'es-AR', name: 'Español' },
|
|
31
|
+
{ code: 'en', name: 'English' },
|
|
32
|
+
]}
|
|
33
|
+
currentLanguageCode="en"
|
|
34
|
+
onLanguageChange={(langCode) => console.log('Idioma cambiado:', langCode)}
|
|
35
|
+
/>
|
|
36
|
+
),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const ConTextosPersonalizados = {
|
|
40
|
+
render: () => (
|
|
41
|
+
<HeaderGeneral
|
|
42
|
+
logoText="MI"
|
|
43
|
+
suiteText="EMPRESA"
|
|
44
|
+
languages={[
|
|
45
|
+
{ code: 'es-AR', name: 'Español' },
|
|
46
|
+
{ code: 'en', name: 'English' },
|
|
47
|
+
{ code: 'pt', name: 'Português' },
|
|
48
|
+
]}
|
|
49
|
+
currentLanguageCode="es-AR"
|
|
50
|
+
onLanguageChange={(langCode) => console.log('Idioma cambiado:', langCode)}
|
|
51
|
+
/>
|
|
52
|
+
),
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const SinIdiomas = {
|
|
56
|
+
render: () => (
|
|
57
|
+
<HeaderGeneral
|
|
58
|
+
logoText="HEXA"
|
|
59
|
+
suiteText="Suite"
|
|
60
|
+
languages={[]}
|
|
61
|
+
/>
|
|
62
|
+
),
|
|
63
|
+
};
|
|
64
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Typography } from '../../Atoms/Typography/Typography';
|
|
2
|
+
import { Icon } from '../../Atoms/Icon/Icon';
|
|
3
|
+
import { LogoHexa } from '../../Atoms/LogoHexa/LogoHexa';
|
|
4
|
+
|
|
5
|
+
export const HeaderPoint = ({
|
|
6
|
+
logo,
|
|
7
|
+
companyName = 'Point',
|
|
8
|
+
date,
|
|
9
|
+
pointLabel = 'HEXA Core',
|
|
10
|
+
onPointClick,
|
|
11
|
+
backgroundColor,
|
|
12
|
+
borderColor,
|
|
13
|
+
verticalLineColor = '#9CA3AF',
|
|
14
|
+
logoBackgroundColor = '#FFFFFF',
|
|
15
|
+
logoIconColor,
|
|
16
|
+
companyNameColor,
|
|
17
|
+
dateColor = '#6B7280',
|
|
18
|
+
buttonBackgroundColor = '#000000',
|
|
19
|
+
buttonBorderColor = '#FFFFFF',
|
|
20
|
+
buttonTextColor = '#FFFFFF',
|
|
21
|
+
className = '',
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
// Formatear fecha si no se proporciona
|
|
25
|
+
const formattedDate = date || new Date().toLocaleDateString('es-AR', {
|
|
26
|
+
weekday: 'long',
|
|
27
|
+
year: 'numeric',
|
|
28
|
+
month: 'long',
|
|
29
|
+
day: 'numeric',
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Capitalizar primera letra de la fecha
|
|
33
|
+
const capitalizedDate = formattedDate.charAt(0).toUpperCase() + formattedDate.slice(1);
|
|
34
|
+
|
|
35
|
+
// Determinar colores del logo
|
|
36
|
+
const logoBgColor = logoBackgroundColor;
|
|
37
|
+
const logoIconStrokeColor = logoIconColor || backgroundColor || '#2D5C63';
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<header
|
|
41
|
+
className={`${className}`}
|
|
42
|
+
style={{
|
|
43
|
+
backgroundColor: backgroundColor || '#FFFFFF',
|
|
44
|
+
borderBottom: borderColor ? `1px solid ${borderColor}` : '1px solid #E5E7EB'
|
|
45
|
+
}}
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
<div className="w-full">
|
|
49
|
+
<div className="flex items-center justify-between h-16 px-4 sm:px-6 lg:px-8">
|
|
50
|
+
{/* Lado izquierdo: logo y nombre */}
|
|
51
|
+
<div className="flex items-center space-x-2">
|
|
52
|
+
{/* Logo hexagonal */}
|
|
53
|
+
{logo ? (
|
|
54
|
+
<img
|
|
55
|
+
src={logo}
|
|
56
|
+
alt={companyName}
|
|
57
|
+
className="w-8 h-8"
|
|
58
|
+
/>
|
|
59
|
+
) : (
|
|
60
|
+
<LogoHexa
|
|
61
|
+
width={36}
|
|
62
|
+
height={40}
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
{/* Nombre de la empresa */}
|
|
67
|
+
<Typography
|
|
68
|
+
variant="body-md"
|
|
69
|
+
className="font-bold"
|
|
70
|
+
style={{ color: companyNameColor }}
|
|
71
|
+
>
|
|
72
|
+
{companyName}
|
|
73
|
+
</Typography>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
{/* Centro: Fecha */}
|
|
77
|
+
<div className="flex-1 flex justify-center">
|
|
78
|
+
<Typography
|
|
79
|
+
variant="body-md"
|
|
80
|
+
style={{ color: dateColor }}
|
|
81
|
+
>
|
|
82
|
+
{capitalizedDate}
|
|
83
|
+
</Typography>
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
{/* Lado derecho: Botón HEXA Core */}
|
|
87
|
+
<div className="flex items-center">
|
|
88
|
+
<button
|
|
89
|
+
onClick={onPointClick}
|
|
90
|
+
className="px-4 py-2 border rounded-lg
|
|
91
|
+
transition-colors flex items-center space-x-2"
|
|
92
|
+
style={{
|
|
93
|
+
borderColor: buttonBorderColor,
|
|
94
|
+
backgroundColor: buttonBackgroundColor,
|
|
95
|
+
color: buttonTextColor
|
|
96
|
+
}}
|
|
97
|
+
>
|
|
98
|
+
<Typography
|
|
99
|
+
variant="body-md"
|
|
100
|
+
style={{ color: buttonTextColor }}
|
|
101
|
+
>
|
|
102
|
+
{pointLabel}
|
|
103
|
+
</Typography>
|
|
104
|
+
<Icon
|
|
105
|
+
name="ArrowUpRightIcon"
|
|
106
|
+
variant="24-outline"
|
|
107
|
+
size={16}
|
|
108
|
+
style={{ color: buttonTextColor }}
|
|
109
|
+
/>
|
|
110
|
+
</button>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
</header>
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export default HeaderPoint;
|
|
119
|
+
|
|
120
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { HeaderPoint } from './HeaderPoint';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Layout/HeaderPoint',
|
|
5
|
+
component: HeaderPoint,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Default = {
|
|
10
|
+
render: () => (
|
|
11
|
+
<HeaderPoint
|
|
12
|
+
backgroundColor="#2D5C63"
|
|
13
|
+
borderColor="#1F4549"
|
|
14
|
+
verticalLineColor="#4A8A92"
|
|
15
|
+
logoIconColor="#2D5C63"
|
|
16
|
+
companyNameColor="#FFFFFF"
|
|
17
|
+
dateColor="#E5E7EB"
|
|
18
|
+
buttonBackgroundColor="#2D5C63"
|
|
19
|
+
buttonBorderColor="#FFFFFF"
|
|
20
|
+
buttonTextColor="#FFFFFF"
|
|
21
|
+
date="Martes, 20 de octubre de 2023"
|
|
22
|
+
onPointClick={() => console.log('HEXA Core clickeado')}
|
|
23
|
+
/>
|
|
24
|
+
),
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const ConFechaAutomatica = {
|
|
28
|
+
render: () => (
|
|
29
|
+
<HeaderPoint
|
|
30
|
+
backgroundColor="#2D5C63"
|
|
31
|
+
borderColor="#1F4549"
|
|
32
|
+
verticalLineColor="#4A8A92"
|
|
33
|
+
logoIconColor="#2D5C63"
|
|
34
|
+
companyNameColor="#FFFFFF"
|
|
35
|
+
dateColor="#E5E7EB"
|
|
36
|
+
buttonBackgroundColor="#2D5C63"
|
|
37
|
+
buttonBorderColor="#FFFFFF"
|
|
38
|
+
buttonTextColor="#FFFFFF"
|
|
39
|
+
/>
|
|
40
|
+
),
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const ConLogoPersonalizado = {
|
|
44
|
+
render: () => (
|
|
45
|
+
<HeaderPoint
|
|
46
|
+
companyName="Mi Empresa"
|
|
47
|
+
logo="https://via.placeholder.com/32"
|
|
48
|
+
date="Lunes, 15 de enero de 2024"
|
|
49
|
+
pointLabel="Mi Punto"
|
|
50
|
+
/>
|
|
51
|
+
),
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const ConLabelsPersonalizados = {
|
|
55
|
+
render: () => (
|
|
56
|
+
<HeaderPoint
|
|
57
|
+
companyName="ACME Corp"
|
|
58
|
+
date="Viernes, 25 de diciembre de 2024"
|
|
59
|
+
pointLabel="ACME Hub"
|
|
60
|
+
/>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const ConFondoNegro = {
|
|
65
|
+
render: () => (
|
|
66
|
+
<HeaderPoint
|
|
67
|
+
backgroundColor="#000000"
|
|
68
|
+
borderColor="#333333"
|
|
69
|
+
verticalLineColor="#666666"
|
|
70
|
+
logoIconColor="#000000"
|
|
71
|
+
companyNameColor="#FFFFFF"
|
|
72
|
+
dateColor="#CCCCCC"
|
|
73
|
+
date="Martes, 20 de octubre de 2023"
|
|
74
|
+
onPointClick={() => console.log('HEXA Core clickeado')}
|
|
75
|
+
/>
|
|
76
|
+
),
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const ConBotonesPersonalizados = {
|
|
80
|
+
render: () => (
|
|
81
|
+
<HeaderPoint
|
|
82
|
+
backgroundColor="#000000"
|
|
83
|
+
buttonBackgroundColor="#FF5733"
|
|
84
|
+
buttonBorderColor="#FFFFFF"
|
|
85
|
+
buttonTextColor="#FFFFFF"
|
|
86
|
+
date="Martes, 20 de octubre de 2023"
|
|
87
|
+
onPointClick={() => console.log('HEXA Core clickeado')}
|
|
88
|
+
/>
|
|
89
|
+
),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const ConTodosLosColoresPersonalizados = {
|
|
93
|
+
render: () => (
|
|
94
|
+
<HeaderPoint
|
|
95
|
+
backgroundColor="#1A1A1A"
|
|
96
|
+
borderColor="#333333"
|
|
97
|
+
verticalLineColor="#666666"
|
|
98
|
+
logoBackgroundColor="#FFFFFF"
|
|
99
|
+
logoIconColor="#1A1A1A"
|
|
100
|
+
companyNameColor="#FFFFFF"
|
|
101
|
+
dateColor="#CCCCCC"
|
|
102
|
+
buttonBackgroundColor="#FF5733"
|
|
103
|
+
buttonBorderColor="#FFFFFF"
|
|
104
|
+
buttonTextColor="#FFFFFF"
|
|
105
|
+
date="Martes, 20 de octubre de 2023"
|
|
106
|
+
onPointClick={() => console.log('HEXA Core clickeado')}
|
|
107
|
+
/>
|
|
108
|
+
),
|
|
109
|
+
};
|
|
110
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Icon } from '../../Atoms/Icon/Icon';
|
|
2
|
+
import { Typography } from '../../Atoms/Typography/Typography';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_ITEMS = [
|
|
5
|
+
{ id: 'inicio', label: 'Inicio', icon: 'Squares2X2Icon' },
|
|
6
|
+
{ id: 'docs', label: 'Docs', icon: 'DocumentTextIcon' },
|
|
7
|
+
{ id: 'equipo', label: 'Equipo', icon: 'UserGroupIcon' },
|
|
8
|
+
{ id: 'perfil', label: 'Mi perfil', icon: 'UserIcon' },
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
export const NavPoint = ({
|
|
12
|
+
items = DEFAULT_ITEMS,
|
|
13
|
+
activeItem,
|
|
14
|
+
onItemClick,
|
|
15
|
+
className = '',
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
return (
|
|
19
|
+
<nav
|
|
20
|
+
className={`fixed bottom-0 left-0 right-0 z-50 md:hidden bg-white rounded-t-lg shadow-md overflow-hidden ${className}`}
|
|
21
|
+
style={{
|
|
22
|
+
boxShadow: '0 -2px 8px rgba(0, 0, 0, 0.1)'
|
|
23
|
+
}}
|
|
24
|
+
{...props}
|
|
25
|
+
>
|
|
26
|
+
<div className="flex items-stretch">
|
|
27
|
+
{items.map((item, index) => {
|
|
28
|
+
const isActive = activeItem === item.id;
|
|
29
|
+
const isFirst = index === 0;
|
|
30
|
+
const isLast = index === items.length - 1;
|
|
31
|
+
return (
|
|
32
|
+
<button
|
|
33
|
+
key={item.id}
|
|
34
|
+
onClick={() => onItemClick && onItemClick(item.id)}
|
|
35
|
+
className="flex flex-col items-center justify-center px-4 py-3 transition-all duration-200 cursor-pointer flex-1 relative"
|
|
36
|
+
style={{
|
|
37
|
+
backgroundColor: isActive ? '#2D5C63' : 'transparent',
|
|
38
|
+
borderRadius: isActive
|
|
39
|
+
? (isFirst ? '16px 0 0 0' : isLast ? '0 16px 0 0' : '0')
|
|
40
|
+
: '0',
|
|
41
|
+
}}
|
|
42
|
+
>
|
|
43
|
+
<Icon
|
|
44
|
+
name={item.icon}
|
|
45
|
+
variant="24-outline"
|
|
46
|
+
size={24}
|
|
47
|
+
style={{ color: isActive ? '#FFFFFF' : '#374151' }}
|
|
48
|
+
/>
|
|
49
|
+
<Typography
|
|
50
|
+
variant="body-sm"
|
|
51
|
+
className="mt-1 font-medium"
|
|
52
|
+
style={{ color: isActive ? '#FFFFFF' : '#374151' }}
|
|
53
|
+
>
|
|
54
|
+
{item.label}
|
|
55
|
+
</Typography>
|
|
56
|
+
</button>
|
|
57
|
+
);
|
|
58
|
+
})}
|
|
59
|
+
</div>
|
|
60
|
+
</nav>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export default NavPoint;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { NavPoint } from './NavPoint';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Layout/NavPoint',
|
|
6
|
+
component: NavPoint,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: () => {
|
|
12
|
+
const [activeItem, setActiveItem] = useState('inicio');
|
|
13
|
+
return (
|
|
14
|
+
<div className="h-screen bg-gray-100 relative pb-20">
|
|
15
|
+
<div className="p-4">
|
|
16
|
+
<p className="text-gray-600">Contenido de la aplicación</p>
|
|
17
|
+
<p className="text-gray-600 mt-4">
|
|
18
|
+
El NavPoint está fijo en la parte inferior
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
<NavPoint
|
|
22
|
+
activeItem={activeItem}
|
|
23
|
+
onItemClick={setActiveItem}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const ConItemsPersonalizados = {
|
|
31
|
+
render: () => {
|
|
32
|
+
const [activeItem, setActiveItem] = useState('dashboard');
|
|
33
|
+
const customItems = [
|
|
34
|
+
{ id: 'dashboard', label: 'Dashboard', icon: 'ChartBarIcon' },
|
|
35
|
+
{ id: 'mensajes', label: 'Mensajes', icon: 'ChatBubbleLeftRightIcon' },
|
|
36
|
+
{ id: 'notificaciones', label: 'Notificaciones', icon: 'BellIcon' },
|
|
37
|
+
{ id: 'configuracion', label: 'Config', icon: 'Cog6ToothIcon' },
|
|
38
|
+
];
|
|
39
|
+
return (
|
|
40
|
+
<div className="h-screen bg-gray-100 relative pb-20">
|
|
41
|
+
<div className="p-4">
|
|
42
|
+
<p className="text-gray-600">Contenido con items personalizados</p>
|
|
43
|
+
</div>
|
|
44
|
+
<NavPoint
|
|
45
|
+
items={customItems}
|
|
46
|
+
activeItem={activeItem}
|
|
47
|
+
onItemClick={setActiveItem}
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
},
|
|
52
|
+
};
|