anima-ds-nucleus 1.0.3 → 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.
Files changed (37) hide show
  1. package/dist/anima-ds-nucleus.css +1 -1
  2. package/dist/anima-ds.cjs.js +123 -57
  3. package/dist/anima-ds.esm.js +6590 -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 +61 -0
  15. package/src/components/DataDisplay/Card/CardTituloCortoMasEstado.jsx +79 -0
  16. package/src/components/DataDisplay/Card/CardTituloLargo.jsx +61 -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 +7 -0
  20. package/src/components/Layout/Header/HeaderCore.jsx +313 -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anima-ds-nucleus",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Anima Design System - A comprehensive React component library",
5
5
  "author": "Nucleus Labs <ipvasallo@nucleus.com.ar>",
6
6
  "license": "UNLICENSED",
@@ -8,6 +8,10 @@
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/NucleusNova/anima-ds.git"
10
10
  },
11
+ "homepage": "https://github.com/NucleusNova/anima-ds#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/NucleusNova/anima-ds/issues"
14
+ },
11
15
  "keywords": [
12
16
  "react",
13
17
  "design system",
@@ -36,7 +40,11 @@
36
40
  "build:app": "vite build --config vite.app.config.js",
37
41
  "preview": "vite preview",
38
42
  "storybook": "storybook dev -p 6006",
39
- "build-storybook": "storybook build"
43
+ "build-storybook": "storybook build",
44
+ "prepublishOnly": "npm run build",
45
+ "publish:patch": "npm version patch && npm publish",
46
+ "publish:minor": "npm version minor && npm publish",
47
+ "publish:major": "npm version major && npm publish"
40
48
  },
41
49
  "devDependencies": {
42
50
  "react": "^18.3.1",
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="200" height="80" viewBox="0 0 200 80">
2
+ <text x="50%" y="50%" font-family="-apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif" font-size="48" font-weight="bold" fill="#5a9c5e" text-anchor="middle" dominant-baseline="middle">Nucleus</text>
3
+ </svg>
@@ -0,0 +1,34 @@
1
+ export const LogoHexa = ({
2
+ width = 36,
3
+ height = 40,
4
+ backgroundColor = '#2D5C63',
5
+ textColor = '#ffffff',
6
+ className = '',
7
+ ...props
8
+ }) => {
9
+ return (
10
+ <div
11
+ className={`relative flex items-center justify-center ${className}`}
12
+ style={{
13
+ width: `${width}px`,
14
+ height: `${height}px`,
15
+ backgroundColor: backgroundColor,
16
+ borderRadius: '16px',
17
+ clipPath: 'polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%)'
18
+ }}
19
+ {...props}
20
+ >
21
+ <span
22
+ className="text-white font-bold text-lg"
23
+ style={{
24
+ color: textColor
25
+ }}
26
+ >
27
+ H
28
+ </span>
29
+ </div>
30
+ );
31
+ };
32
+
33
+ export default LogoHexa;
34
+
@@ -0,0 +1,36 @@
1
+ import { LogoHexa } from './LogoHexa';
2
+
3
+ export default {
4
+ title: 'Atoms/LogoHexa',
5
+ component: LogoHexa,
6
+ tags: ['autodocs'],
7
+ };
8
+
9
+ export const Default = {
10
+ render: () => (
11
+ <LogoHexa width={36} height={40} />
12
+ ),
13
+ };
14
+
15
+ export const TamañoGrande = {
16
+ render: () => (
17
+ <LogoHexa width={36} height={40} />
18
+ ),
19
+ };
20
+
21
+ export const TamañoPequeño = {
22
+ render: () => (
23
+ <LogoHexa width={36} height={40} />
24
+ ),
25
+ };
26
+
27
+ export const ConColoresPersonalizados = {
28
+ render: () => (
29
+ <div className="flex items-center gap-4">
30
+ <LogoHexa width={36} height={40} backgroundColor="#2D5C63" textColor="#ffffff" />
31
+ <LogoHexa width={36} height={40} backgroundColor="#56B676" textColor="#ffffff" />
32
+ <LogoHexa width={36} height={40} backgroundColor="#6D3856" textColor="#ffffff" />
33
+ </div>
34
+ ),
35
+ };
36
+
@@ -50,6 +50,10 @@ export const Typography = ({
50
50
  body2: 'text-body-md', // Alias de body-md
51
51
  caption: 'text-body-sm color-gray-600', // Body small con color gris por defecto
52
52
  overline: 'text-body-sm uppercase tracking-wide',
53
+ 'mono-lg': 'text-mono-lg',
54
+ 'mono-md': 'text-mono-md',
55
+ 'mono-sm': 'text-mono-sm',
56
+ mono: 'text-mono-md', // Alias por defecto de mono-md
53
57
  };
54
58
 
55
59
  const Component = component || (variant.startsWith('h') ? variant : 'p');
@@ -7,7 +7,7 @@ export default {
7
7
  argTypes: {
8
8
  variant: {
9
9
  control: 'select',
10
- options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'body-lg', 'body-md', 'body-sm', 'body1', 'body2', 'caption', 'overline'],
10
+ options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'body-lg', 'body-md', 'body-sm', 'body1', 'body2', 'caption', 'overline', 'mono', 'mono-lg', 'mono-md', 'mono-sm'],
11
11
  },
12
12
  weight: {
13
13
  control: 'select',
@@ -113,6 +113,34 @@ export const Overline = {
113
113
  },
114
114
  };
115
115
 
116
+ export const MonoLarge = {
117
+ args: {
118
+ variant: 'mono-lg',
119
+ children: 'Mono Large - IBM Plex Mono 16/24 Regular. Código: const x = 42;',
120
+ },
121
+ };
122
+
123
+ export const MonoMedium = {
124
+ args: {
125
+ variant: 'mono-md',
126
+ children: 'Mono Medium - IBM Plex Mono 14/21 Regular. Código: function test() {}',
127
+ },
128
+ };
129
+
130
+ export const MonoSmall = {
131
+ args: {
132
+ variant: 'mono-sm',
133
+ children: 'Mono Small - IBM Plex Mono 12/18 Regular. Código: let y = 10;',
134
+ },
135
+ };
136
+
137
+ export const Mono = {
138
+ args: {
139
+ variant: 'mono',
140
+ children: 'Mono (default, alias de mono-md) - IBM Plex Mono 14/21 Regular',
141
+ },
142
+ };
143
+
116
144
  // Ejemplos con clases genéricas directamente (sin componente)
117
145
  export const ClasesGenericasHeadings = () => (
118
146
  <div className="space-y-4">
@@ -133,6 +161,14 @@ export const ClasesGenericasBody = () => (
133
161
  </div>
134
162
  );
135
163
 
164
+ export const ClasesGenericasMono = () => (
165
+ <div className="space-y-4">
166
+ <p className="text-mono-lg">Clase text-mono-lg - IBM Plex Mono 16/24 Regular</p>
167
+ <p className="text-mono-md">Clase text-mono-md - IBM Plex Mono 14/21 Regular</p>
168
+ <p className="text-mono-sm">Clase text-mono-sm - IBM Plex Mono 12/18 Regular</p>
169
+ </div>
170
+ );
171
+
136
172
  export const ClasesDeColores = () => (
137
173
  <div className="space-y-3 bg-gray-50 p-6 rounded-lg">
138
174
  <p className="text-body-lg color-black">Color black - color-black</p>
@@ -1,31 +1,124 @@
1
+ import { CardSkeleton } from './CardSkeleton';
2
+ import { CardVacia } from './CardVacia';
3
+ import { CardError } from './CardError';
4
+ import { CardTituloCorto } from './CardTituloCorto';
5
+ import { CardTituloLargo } from './CardTituloLargo';
6
+ import { CardTituloCortoMasEstado } from './CardTituloCortoMasEstado';
7
+ import { CardTituloLargoMasEstado } from './CardTituloLargoMasEstado';
8
+
9
+ /**
10
+ * Componente Card inteligente que maneja automáticamente los estados:
11
+ * - loading: muestra CardSkeleton
12
+ * - error: muestra CardError
13
+ * - sin datos: muestra CardVacia
14
+ * - con datos: muestra la variante especificada
15
+ *
16
+ * @param {boolean} loading - Si está cargando, muestra el skeleton
17
+ * @param {string|null} error - Si hay error, muestra CardError con este mensaje
18
+ * @param {boolean} hasData - Si tiene datos para mostrar
19
+ * @param {any} data - Los datos a mostrar (opcional, se usa para detectar si hay datos)
20
+ * @param {string} variant - Variante de card: 'corto' | 'largo' | 'cortoMasEstado' | 'largoMasEstado'
21
+ * @param {string} title - Título de la card
22
+ * @param {string} status - Badge de estado (solo para variantes con estado)
23
+ * @param {string} errorMessage - Mensaje personalizado para el error
24
+ * @param {ReactNode} children - Contenido de la card
25
+ */
1
26
  export const Card = ({
2
- title,
3
- children,
4
- footer,
27
+ loading = false,
28
+ error = null,
29
+ hasData = null,
30
+ data = null,
31
+ variant = 'corto',
32
+ title = 'Notificaciones',
33
+ status = null,
34
+ errorMessage = null,
35
+ children = null,
5
36
  className = '',
6
- headerClassName = '',
7
- bodyClassName = '',
8
- footerClassName = '',
9
37
  ...props
10
38
  }) => {
11
- return (
12
- <div className={`bg-white rounded-lg shadow-md border border-gray-200 ${className}`} {...props}>
13
- {title && (
14
- <div className={`px-6 py-4 border-b border-gray-200 ${headerClassName}`}>
15
- <h3 className="text-lg font-semibold text-gray-900">{title}</h3>
16
- </div>
17
- )}
18
- <div className={`px-6 py-4 ${bodyClassName}`}>
19
- {children}
20
- </div>
21
- {footer && (
22
- <div className={`px-6 py-4 border-t border-gray-200 bg-gray-50 ${footerClassName}`}>
23
- {footer}
24
- </div>
25
- )}
26
- </div>
27
- );
39
+ // 1. Prioridad: Si está cargando, muestra skeleton
40
+ if (loading) {
41
+ return <CardSkeleton className={className} {...props} />;
42
+ }
43
+
44
+ // 2. Prioridad: Si hay error, muestra error
45
+ if (error) {
46
+ return (
47
+ <CardError
48
+ title={title}
49
+ errorMessage={errorMessage || error}
50
+ className={className}
51
+ {...props}
52
+ />
53
+ );
54
+ }
55
+
56
+ // 3. Determinar si tiene datos
57
+ // Si hasData es explícitamente false, o si data es null/undefined/empty
58
+ const hasDataToShow = hasData !== null
59
+ ? hasData
60
+ : data !== null && data !== undefined && data !== '';
61
+
62
+ // 4. Si no tiene datos, muestra vacía
63
+ if (!hasDataToShow) {
64
+ return (
65
+ <CardVacia
66
+ title={title}
67
+ className={className}
68
+ {...props}
69
+ />
70
+ );
71
+ }
72
+
73
+ // 5. Si tiene datos, muestra la variante correspondiente
74
+ switch (variant) {
75
+ case 'largo':
76
+ return (
77
+ <CardTituloLargo
78
+ title={title}
79
+ className={className}
80
+ {...props}
81
+ >
82
+ {children}
83
+ </CardTituloLargo>
84
+ );
85
+
86
+ case 'cortoMasEstado':
87
+ return (
88
+ <CardTituloCortoMasEstado
89
+ title={title}
90
+ status={status}
91
+ className={className}
92
+ {...props}
93
+ >
94
+ {children}
95
+ </CardTituloCortoMasEstado>
96
+ );
97
+
98
+ case 'largoMasEstado':
99
+ return (
100
+ <CardTituloLargoMasEstado
101
+ title={title}
102
+ status={status}
103
+ className={className}
104
+ {...props}
105
+ >
106
+ {children}
107
+ </CardTituloLargoMasEstado>
108
+ );
109
+
110
+ case 'corto':
111
+ default:
112
+ return (
113
+ <CardTituloCorto
114
+ title={title}
115
+ className={className}
116
+ {...props}
117
+ >
118
+ {children}
119
+ </CardTituloCorto>
120
+ );
121
+ }
28
122
  };
29
123
 
30
124
  export default Card;
31
-
@@ -1,50 +1,134 @@
1
1
  import { Card } from './Card';
2
- import { Button } from '../../Atoms/Button/Button';
2
+ import { CardTituloCorto } from './CardTituloCorto';
3
+ import { CardTituloLargo } from './CardTituloLargo';
4
+ import { CardTituloCortoMasEstado } from './CardTituloCortoMasEstado';
5
+ import { CardTituloLargoMasEstado } from './CardTituloLargoMasEstado';
6
+ import { CardSkeleton } from './CardSkeleton';
7
+ import { CardVacia } from './CardVacia';
8
+ import { CardError } from './CardError';
3
9
 
4
10
  export default {
5
11
  title: 'DataDisplay/Card',
6
- component: Card,
7
12
  tags: ['autodocs'],
8
13
  };
9
14
 
10
- export const Default = {
11
- args: {
12
- title: 'Card Title',
13
- children: 'This is the card content. It can contain any React elements.',
14
- },
15
+ // Ejemplos del componente Card inteligente
16
+ export const CardInteligenteCargando = {
17
+ render: () => (
18
+ <div className="p-4">
19
+ <Card loading={true} title="Notificaciones" />
20
+ </div>
21
+ ),
15
22
  };
16
23
 
17
- export const WithFooter = {
18
- args: {
19
- title: 'Card with Footer',
20
- children: 'This card has a footer section.',
21
- footer: (
22
- <div className="flex justify-end">
23
- <Button size="small">Action</Button>
24
- </div>
25
- ),
26
- },
24
+ export const CardInteligenteConDatos = {
25
+ render: () => (
26
+ <div className="p-4">
27
+ <Card
28
+ loading={false}
29
+ hasData={true}
30
+ variant="corto"
31
+ title="Notificaciones"
32
+ >
33
+ <p>Contenido de la card con datos</p>
34
+ </Card>
35
+ </div>
36
+ ),
27
37
  };
28
38
 
29
- export const WithoutTitle = {
30
- args: {
31
- children: 'This card does not have a title.',
32
- },
39
+ export const CardInteligenteSinDatos = {
40
+ render: () => (
41
+ <div className="p-4">
42
+ <Card
43
+ loading={false}
44
+ hasData={false}
45
+ title="Notificaciones"
46
+ />
47
+ </div>
48
+ ),
33
49
  };
34
50
 
35
- export const ComplexContent = {
36
- args: {
37
- title: 'Complex Card',
38
- children: (
39
- <div>
40
- <p className="mb-4">This card contains more complex content.</p>
41
- <ul className="list-disc list-inside space-y-2">
42
- <li>Item 1</li>
43
- <li>Item 2</li>
44
- <li>Item 3</li>
45
- </ul>
46
- </div>
47
- ),
48
- },
51
+ export const CardInteligenteConError = {
52
+ render: () => (
53
+ <div className="p-4">
54
+ <Card
55
+ loading={false}
56
+ error="Error al cargar los datos"
57
+ title="Notificaciones"
58
+ />
59
+ </div>
60
+ ),
49
61
  };
50
62
 
63
+ export const CardInteligenteConEstado = {
64
+ render: () => (
65
+ <div className="p-4">
66
+ <Card
67
+ loading={false}
68
+ hasData={true}
69
+ variant="cortoMasEstado"
70
+ title="Notificaciones"
71
+ status="3 nuevas"
72
+ >
73
+ <p>Contenido de la card</p>
74
+ </Card>
75
+ </div>
76
+ ),
77
+ };
78
+
79
+ // Componentes individuales (para casos específicos)
80
+ export const TituloCorto = {
81
+ render: () => (
82
+ <div className="p-4">
83
+ <CardTituloCorto />
84
+ </div>
85
+ ),
86
+ };
87
+
88
+ export const TituloLargo = {
89
+ render: () => (
90
+ <div className="p-4">
91
+ <CardTituloLargo />
92
+ </div>
93
+ ),
94
+ };
95
+
96
+ export const TituloCortoMasEstado = {
97
+ render: () => (
98
+ <div className="p-4">
99
+ <CardTituloCortoMasEstado />
100
+ </div>
101
+ ),
102
+ };
103
+
104
+ export const TituloLargoMasEstado = {
105
+ render: () => (
106
+ <div className="p-4">
107
+ <CardTituloLargoMasEstado />
108
+ </div>
109
+ ),
110
+ };
111
+
112
+ export const Skeleton = {
113
+ render: () => (
114
+ <div className="p-4">
115
+ <CardSkeleton />
116
+ </div>
117
+ ),
118
+ };
119
+
120
+ export const Vacia = {
121
+ render: () => (
122
+ <div className="p-4">
123
+ <CardVacia />
124
+ </div>
125
+ ),
126
+ };
127
+
128
+ export const Error = {
129
+ render: () => (
130
+ <div className="p-4">
131
+ <CardError />
132
+ </div>
133
+ ),
134
+ };
@@ -0,0 +1,142 @@
1
+ import { Icon } from '../../Atoms/Icon/Icon';
2
+ import { Typography } from '../../Atoms/Typography/Typography';
3
+
4
+ export const CardError = ({
5
+ title = "Notificaciones",
6
+ errorMessage = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed porta elementum neque, vel vehicula nulla pharetra id.",
7
+ className = '',
8
+ ...props
9
+ }) => {
10
+ return (
11
+ <div
12
+ className={`bg-white ${className}`}
13
+ style={{
14
+ width: '379.5px',
15
+ height: '476px',
16
+ borderRadius: '14px',
17
+ border: '1px solid #0000001A',
18
+ boxShadow: '0px 4px 6px -2px #0000001A, 0px 10px 15px -3px #0000001A',
19
+ opacity: 1
20
+ }}
21
+ {...props}
22
+ >
23
+ <div
24
+ style={{
25
+ width: '379.5px',
26
+ height: '60px',
27
+ paddingTop: '24px',
28
+ paddingRight: '24px',
29
+ paddingBottom: '6px',
30
+ paddingLeft: '24px',
31
+ opacity: 1
32
+ }}
33
+ className="flex items-start justify-between"
34
+ >
35
+ <div
36
+ style={{
37
+ width: '331.5px',
38
+ height: '30px',
39
+ opacity: 1
40
+ }}
41
+ >
42
+ <Typography
43
+ variant="body-md"
44
+ className="color-gray-700"
45
+ >
46
+ {title}
47
+ </Typography>
48
+ </div>
49
+ </div>
50
+ <div
51
+ className="flex flex-col items-center justify-center"
52
+ style={{
53
+ paddingTop: '80px',
54
+ paddingBottom: '24px',
55
+ minHeight: 'calc(476px - 60px)',
56
+ display: 'flex',
57
+ justifyContent: 'flex-start'
58
+ }}
59
+ >
60
+ <div
61
+ className="mb-4 flex items-center justify-center border-2 rounded-full"
62
+ style={{
63
+ borderColor: '#374151',
64
+ width: '48px',
65
+ height: '48px',
66
+ opacity: 1
67
+ }}
68
+ >
69
+ <Icon
70
+ name="XMarkIcon"
71
+ variant="24-outline"
72
+ size={32}
73
+ className="color-gray-900"
74
+ />
75
+ </div>
76
+ <div
77
+ style={{
78
+ width: '331.5px',
79
+ height: '48px',
80
+ opacity: 1,
81
+ display: 'flex',
82
+ alignItems: 'center',
83
+ justifyContent: 'center',
84
+ marginBottom: '16px'
85
+ }}
86
+ >
87
+ <Typography
88
+ variant="h3"
89
+ style={{
90
+ fontFamily: 'IBM Plex Sans',
91
+ fontWeight: 600,
92
+ fontStyle: 'normal',
93
+ fontSize: '32px',
94
+ lineHeight: '48px',
95
+ letterSpacing: '0px',
96
+ textAlign: 'center',
97
+ color: '#2D5C63'
98
+ }}
99
+ >
100
+ ERROR
101
+ </Typography>
102
+ </div>
103
+ <div
104
+ className="border flex items-center justify-center"
105
+ style={{
106
+ width: '331.5px',
107
+ height: '128px',
108
+ borderRadius: '10px',
109
+ borderWidth: '1px',
110
+ borderColor: '#EF4444',
111
+ backgroundColor: '#FEE2E2',
112
+ paddingTop: '16px',
113
+ paddingRight: '16px',
114
+ paddingBottom: '8px',
115
+ paddingLeft: '16px',
116
+ opacity: 1
117
+ }}
118
+ >
119
+ <div
120
+ style={{
121
+ width: '298px',
122
+ height: '96px',
123
+ opacity: 1
124
+ }}
125
+ >
126
+ <Typography
127
+ variant="mono-md"
128
+ style={{
129
+ color: '#991B1B'
130
+ }}
131
+ >
132
+ {errorMessage}
133
+ </Typography>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ );
139
+ };
140
+
141
+ export default CardError;
142
+