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.
Files changed (37) hide show
  1. package/dist/anima-ds-nucleus.css +1 -1
  2. package/dist/anima-ds.cjs.js +124 -57
  3. package/dist/anima-ds.esm.js +6591 -5067
  4. package/package.json +10 -2
  5. package/src/assets/nucleus-logo.svg +3 -0
  6. package/src/components/Atoms/LogoHexa/LogoHexa.jsx +34 -0
  7. package/src/components/Atoms/LogoHexa/LogoHexa.stories.jsx +36 -0
  8. package/src/components/Atoms/Typography/Typography.jsx +4 -0
  9. package/src/components/Atoms/Typography/Typography.stories.jsx +37 -1
  10. package/src/components/DataDisplay/Card/Card.jsx +117 -24
  11. package/src/components/DataDisplay/Card/Card.stories.jsx +119 -35
  12. package/src/components/DataDisplay/Card/CardError.jsx +142 -0
  13. package/src/components/DataDisplay/Card/CardSkeleton.jsx +96 -0
  14. package/src/components/DataDisplay/Card/CardTituloCorto.jsx +62 -0
  15. package/src/components/DataDisplay/Card/CardTituloCortoMasEstado.jsx +80 -0
  16. package/src/components/DataDisplay/Card/CardTituloLargo.jsx +62 -0
  17. package/src/components/DataDisplay/Card/CardTituloLargoMasEstado.jsx +77 -0
  18. package/src/components/DataDisplay/Card/CardVacia.jsx +111 -0
  19. package/src/components/Layout/Header/HeaderConBuscador.stories.jsx +8 -0
  20. package/src/components/Layout/Header/HeaderCore.jsx +314 -85
  21. package/src/components/Layout/Header/HeaderCore.stories.jsx +25 -21
  22. package/src/components/Layout/Header/HeaderGeneral.jsx +92 -0
  23. package/src/components/Layout/Header/HeaderGeneral.stories.jsx +64 -0
  24. package/src/components/Layout/Header/HeaderPoint.jsx +120 -0
  25. package/src/components/Layout/Header/HeaderPoint.stories.jsx +110 -0
  26. package/src/components/Layout/NavPoint/NavPoint.jsx +64 -0
  27. package/src/components/Layout/NavPoint/NavPoint.stories.jsx +52 -0
  28. package/src/components/Layout/Sidebar/SidebarCore.jsx +524 -91
  29. package/src/components/Layout/Sidebar/SidebarCore.stories.jsx +76 -1
  30. package/src/components/Layout/Sidebar/SidebarPoint.jsx +264 -59
  31. package/src/components/Layout/Sidebar/SidebarPoint.stories.jsx +69 -0
  32. package/src/index.js +12 -3
  33. package/src/style.css +25 -0
  34. package/src/components/Layout/Header/Header.jsx +0 -50
  35. package/src/components/Layout/Header/Header.stories.jsx +0 -36
  36. package/src/components/Layout/Sidebar/Sidebar.jsx +0 -230
  37. package/src/components/Layout/Sidebar/Sidebar.stories.jsx +0 -90
@@ -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
+ };