anima-ds-nucleus 1.0.10 → 1.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anima-ds-nucleus",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Anima Design System - A comprehensive React component library",
5
5
  "author": "Nucleus Labs <ipvasallo@nucleus.com.ar>",
6
6
  "license": "UNLICENSED",
@@ -12,6 +12,43 @@ export const HeaderCore = ({
12
12
  onSearch,
13
13
  onNotificationClick,
14
14
  onUserClick,
15
+ // Overrides de estilo/clases para poder ajustar layout desde el proyecto consumidor
16
+ desktopLayoutClassName = '',
17
+ desktopLayoutStyle,
18
+ desktopSearchContainerClassName = '',
19
+ desktopSearchContainerStyle,
20
+ desktopRightContainerClassName = '',
21
+ desktopRightContainerStyle,
22
+ notificationButtonClassName = '',
23
+ notificationButtonStyle,
24
+ notificationIconClassName = '',
25
+ notificationIconStyle,
26
+ notificationBadgeClassName = '',
27
+ notificationBadgeStyle,
28
+ // Overrides específicos de medidas/posiciones (Desktop / Mobile)
29
+ notificationDesktopButtonStyle,
30
+ notificationDesktopIconWrapperClassName = '',
31
+ notificationDesktopIconWrapperStyle,
32
+ notificationDesktopIconSize = 18,
33
+ notificationDesktopIconStrokeWidth = 1.5,
34
+ notificationDesktopIconStyle,
35
+ notificationDesktopBadgeStyle,
36
+ notificationMobileButtonClassName = '',
37
+ notificationMobileButtonStyle,
38
+ notificationMobileIconWrapperClassName = '',
39
+ notificationMobileIconWrapperStyle,
40
+ notificationMobileIconSize = 24,
41
+ notificationMobileIconStrokeWidth = 1.5,
42
+ notificationMobileIconStyle,
43
+ showNotificationBadgeOnMobile = false,
44
+ notificationMobileBadgeStyle,
45
+ // Desktop avatar / nombre (overrides)
46
+ desktopUserAvatarClassName = '',
47
+ desktopUserAvatarStyle,
48
+ desktopUserNameStyle,
49
+ // Mobile avatar (overrides)
50
+ mobileUserAvatarClassName = '',
51
+ mobileUserAvatarStyle,
15
52
  sidebarSections,
16
53
  sidebarActiveItem,
17
54
  onSidebarItemClick,
@@ -103,9 +140,15 @@ export const HeaderCore = ({
103
140
 
104
141
  <div className="w-full" style={{ paddingLeft: '4px', paddingRight: '4px' }}>
105
142
  {/* Layout Desktop (más de 768px) */}
106
- <div className="header-desktop-layout flex items-center justify-between h-16">
143
+ <div
144
+ className={`header-desktop-layout flex items-center justify-between h-16 ${desktopLayoutClassName}`}
145
+ style={desktopLayoutStyle}
146
+ >
107
147
  {/* Barra de búsqueda con icono a la derecha */}
108
- <div className="flex-1 mr-2 md:mr-4" style={{ maxWidth: 'none', minWidth: '0' }}>
148
+ <div
149
+ className={`flex-1 mr-2 md:mr-4 ${desktopSearchContainerClassName}`}
150
+ style={{ maxWidth: 'none', minWidth: '0', ...(desktopSearchContainerStyle || {}) }}
151
+ >
109
152
  <form onSubmit={handleSearchSubmit} className="header-search-form flex items-center w-full">
110
153
  {/* Input de búsqueda */}
111
154
  <input
@@ -151,28 +194,71 @@ export const HeaderCore = ({
151
194
  </div>
152
195
 
153
196
  {/* Notificaciones y Perfil */}
154
- <div className="flex items-center space-x-3 md:space-x-6 flex-shrink-0" style={{ marginLeft: 'auto', paddingRight: '0px' }}>
197
+ <div
198
+ className={`flex items-center space-x-3 md:space-x-6 flex-shrink-0 ${desktopRightContainerClassName}`}
199
+ style={{ marginLeft: 'auto', paddingRight: '0px', ...(desktopRightContainerStyle || {}) }}
200
+ >
155
201
  {/* Icono de notificaciones */}
156
202
  {notificationCount !== undefined && (
157
203
  <button
158
204
  onClick={onNotificationClick}
159
- className="relative p-2 hover:bg-gray-100 rounded-lg transition-colors"
205
+ className={`ml-3 p-2 hover:bg-gray-100 rounded-lg transition-colors flex items-center gap-2 ${notificationButtonClassName}`}
160
206
  aria-label="Notificaciones"
207
+ style={{
208
+ // Nota: en desktop el contenedor derecho está anclado a la derecha (marginLeft: auto).
209
+ // Un ml-* en el primer hijo no “mueve” visualmente, porque ensancha el contenedor hacia la izquierda.
210
+ // Por eso usamos translateX por defecto (overrideable por props).
211
+ transform: 'translateX(12px)',
212
+ ...(notificationButtonStyle || {}),
213
+ ...(notificationDesktopButtonStyle || {}),
214
+ }}
161
215
  >
162
- <Icon
163
- name="BellIcon"
164
- variant="24-outline"
165
- size={24}
166
- className="color-gray-600"
167
- />
216
+ {/* Contenedor 24x24 + icono posicionado (Figma) */}
217
+ <span
218
+ className={`relative inline-block ${notificationDesktopIconWrapperClassName}`}
219
+ style={{
220
+ width: '24px',
221
+ height: '24px',
222
+ opacity: 1,
223
+ ...(notificationDesktopIconWrapperStyle || {}),
224
+ }}
225
+ >
226
+ <Icon
227
+ name="BellAlertIcon"
228
+ variant="24-outline"
229
+ size={notificationDesktopIconSize}
230
+ strokeWidth={notificationDesktopIconStrokeWidth}
231
+ className={`color-gray-600 ${notificationIconClassName}`}
232
+ style={{
233
+ width: '17.75112533569336px',
234
+ height: '18px',
235
+ position: 'absolute',
236
+ top: '3px',
237
+ left: '3.12px',
238
+ opacity: 1,
239
+ transform: 'rotate(0deg)',
240
+ ...(notificationIconStyle || {}),
241
+ ...(notificationDesktopIconStyle || {}),
242
+ }}
243
+ />
244
+ </span>
168
245
  {notificationCount > 0 && (
169
246
  <span
170
- className="absolute -top-1 -right-1 px-1.5 py-0.5 min-w-[20px] h-5
171
- text-white rounded-full flex items-center justify-center
172
- text-body-sm font-medium"
247
+ className={`h-5 text-white flex items-center justify-center text-body-sm font-medium ${notificationBadgeClassName}`}
173
248
  style={{
174
249
  backgroundColor: '#6D3856',
175
- borderRadius: '12px'
250
+ minWidth: '24px',
251
+ width: 'fit-content',
252
+ height: '20px',
253
+ paddingTop: '2px',
254
+ paddingRight: '8px',
255
+ paddingBottom: '2px',
256
+ paddingLeft: '8px',
257
+ borderRadius: '8px',
258
+ opacity: 1,
259
+ transform: 'rotate(0deg)',
260
+ ...(notificationBadgeStyle || {}),
261
+ ...(notificationDesktopBadgeStyle || {}),
176
262
  }}
177
263
  >
178
264
  {notificationCount > 9 ? '9+' : notificationCount}
@@ -194,6 +280,15 @@ export const HeaderCore = ({
194
280
  name={userName}
195
281
  size="medium"
196
282
  variant="circle"
283
+ className={desktopUserAvatarClassName}
284
+ style={{
285
+ width: '36px',
286
+ height: '36px',
287
+ opacity: 1,
288
+ borderRadius: '16777200px',
289
+ transform: 'rotate(0deg)',
290
+ ...(desktopUserAvatarStyle || {}),
291
+ }}
197
292
  />
198
293
  <Typography
199
294
  variant="body-lg"
@@ -206,6 +301,7 @@ export const HeaderCore = ({
206
301
  lineHeight: '24px',
207
302
  letterSpacing: '0%',
208
303
  verticalAlign: 'middle'
304
+ ,...(desktopUserNameStyle || {})
209
305
  }}
210
306
  >
211
307
  {userName}
@@ -263,23 +359,66 @@ export const HeaderCore = ({
263
359
  {notificationCount !== undefined && (
264
360
  <button
265
361
  onClick={onNotificationClick}
266
- className="relative p-2 hover:bg-gray-100 rounded-lg transition-colors"
362
+ className={`ml-2 hover:bg-gray-100 transition-colors flex items-center justify-center ${notificationButtonClassName} ${notificationMobileButtonClassName}`}
267
363
  aria-label="Notificaciones"
364
+ style={{
365
+ width: '48px',
366
+ height: '48px',
367
+ paddingRight: '0px',
368
+ borderRadius: '8px',
369
+ opacity: 1,
370
+ transform: 'rotate(0deg)',
371
+ ...(notificationButtonStyle || {}),
372
+ ...(notificationMobileButtonStyle || {}),
373
+ }}
268
374
  >
269
- <Icon
270
- name="BellIcon"
271
- variant="24-outline"
272
- size={24}
273
- className="color-gray-600"
274
- />
275
- {notificationCount > 0 && (
375
+ {/* Contenedor 32x32 implícito dentro del botón 48x48 + icono posicionado (Figma) */}
376
+ <span
377
+ className={`relative inline-block ${notificationMobileIconWrapperClassName}`}
378
+ style={{
379
+ width: '32px',
380
+ height: '32px',
381
+ opacity: 1,
382
+ ...(notificationMobileIconWrapperStyle || {}),
383
+ }}
384
+ >
385
+ <Icon
386
+ name="BellAlertIcon"
387
+ variant="24-outline"
388
+ size={notificationMobileIconSize}
389
+ strokeWidth={notificationMobileIconStrokeWidth}
390
+ className={`color-gray-600 ${notificationIconClassName}`}
391
+ style={{
392
+ width: '22.163536071777344px',
393
+ height: '24px',
394
+ position: 'absolute',
395
+ top: '4px',
396
+ left: '4.92px',
397
+ opacity: 1,
398
+ transform: 'rotate(0deg)',
399
+ ...(notificationIconStyle || {}),
400
+ ...(notificationMobileIconStyle || {}),
401
+ }}
402
+ />
403
+ </span>
404
+ {showNotificationBadgeOnMobile && notificationCount > 0 && (
276
405
  <span
277
- className="absolute -top-1 -right-1 px-1.5 py-0.5 min-w-[20px] h-5
278
- text-white rounded-full flex items-center justify-center
279
- text-body-sm font-medium"
280
- style={{
406
+ className={`h-5 text-white flex items-center justify-center text-body-sm font-medium ${notificationBadgeClassName}`}
407
+ style={{
281
408
  backgroundColor: '#6D3856',
282
- borderRadius: '12px'
409
+ minWidth: '24px',
410
+ width: 'fit-content',
411
+ height: '20px',
412
+ paddingTop: '2px',
413
+ paddingRight: '8px',
414
+ paddingBottom: '2px',
415
+ paddingLeft: '8px',
416
+ borderRadius: '8px',
417
+ marginLeft: '6px',
418
+ opacity: 1,
419
+ transform: 'rotate(0deg)',
420
+ ...(notificationBadgeStyle || {}),
421
+ ...(notificationMobileBadgeStyle || {}),
283
422
  }}
284
423
  >
285
424
  {notificationCount > 9 ? '9+' : notificationCount}
@@ -300,6 +439,8 @@ export const HeaderCore = ({
300
439
  name={userName || ''}
301
440
  size="medium"
302
441
  variant="circle"
442
+ className={mobileUserAvatarClassName}
443
+ style={mobileUserAvatarStyle}
303
444
  />
304
445
  </button>
305
446
  )}
@@ -386,6 +386,9 @@ export const SidebarCore = ({
386
386
  companyName = 'HEXA Core',
387
387
  companyLogo,
388
388
  onCompanyClick,
389
+ // Overrides desktop para el header "HEXA Core"
390
+ desktopCompanyNameClassName = '',
391
+ desktopCompanyNameStyle,
389
392
  nucleusName = 'Nucleus AR',
390
393
  nucleusLogo,
391
394
  onNucleusClick,
@@ -495,7 +498,18 @@ export const SidebarCore = ({
495
498
  {/* Nombre de la empresa */}
496
499
  <Typography
497
500
  variant="body-md"
498
- className="color-gray-900 font-medium"
501
+ className={`color-gray-900 ${desktopCompanyNameClassName}`}
502
+ style={{
503
+ fontFamily: 'IBM Plex Sans',
504
+ fontWeight: 600,
505
+ fontStyle: 'normal',
506
+ fontSize: '18px',
507
+ lineHeight: '28px',
508
+ letterSpacing: '0px',
509
+ opacity: 1,
510
+ transform: 'rotate(0deg)',
511
+ ...(desktopCompanyNameStyle || {}),
512
+ }}
499
513
  >
500
514
  {companyName}
501
515
  </Typography>