@grupor5/raya 0.2.21 → 0.2.23
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/atoms/logo/index.d.mts +32 -0
- package/dist/atoms/logo/index.d.ts +32 -0
- package/dist/atoms/logo/index.js +90 -0
- package/dist/atoms/logo/index.mjs +88 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +219 -159
- package/dist/index.mjs +209 -152
- package/dist/logo-N622EUTF.png +0 -0
- package/dist/organisms/sidebar/index.js +73 -16
- package/dist/organisms/sidebar/index.mjs +69 -12
- package/dist/tailwind.css +1 -1
- package/package.json +1 -1
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React4 = require('react');
|
|
4
4
|
var clsx = require('clsx');
|
|
5
5
|
var tailwindMerge = require('tailwind-merge');
|
|
6
6
|
var classVarianceAuthority = require('class-variance-authority');
|
|
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
|
|
|
27
27
|
return Object.freeze(n);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var React4__namespace = /*#__PURE__*/_interopNamespace(React4);
|
|
31
31
|
|
|
32
32
|
var __defProp = Object.defineProperty;
|
|
33
33
|
var __defProps = Object.defineProperties;
|
|
@@ -89,7 +89,7 @@ var typographyVariants = classVarianceAuthority.cva("font-primary", {
|
|
|
89
89
|
variant: "body-md"
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
|
-
var Typography =
|
|
92
|
+
var Typography = React4__namespace.forwardRef(
|
|
93
93
|
(_a, ref) => {
|
|
94
94
|
var _b = _a, { className, variant, as: Component = "p" } = _b, props = __objRest(_b, ["className", "variant", "as"]);
|
|
95
95
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -205,7 +205,7 @@ var LoadingSpinner = ({
|
|
|
205
205
|
)
|
|
206
206
|
] }) });
|
|
207
207
|
};
|
|
208
|
-
var Button =
|
|
208
|
+
var Button = React4.forwardRef((_a, ref) => {
|
|
209
209
|
var _b = _a, {
|
|
210
210
|
variant = defaultButtonConfig.variant,
|
|
211
211
|
size = defaultButtonConfig.size,
|
|
@@ -242,7 +242,7 @@ var Button = React3.forwardRef((_a, ref) => {
|
|
|
242
242
|
"onClick"
|
|
243
243
|
]);
|
|
244
244
|
const isIconOnly = variant === "icon" || !!(!children && (icon || iconLeft || iconRight));
|
|
245
|
-
const buttonClasses =
|
|
245
|
+
const buttonClasses = React4.useMemo(() => {
|
|
246
246
|
const sizeClasses = getButtonSizeClasses(size, isIconOnly);
|
|
247
247
|
const variantClasses = getButtonVariantClasses(variant, color);
|
|
248
248
|
return cn(
|
|
@@ -252,7 +252,7 @@ var Button = React3.forwardRef((_a, ref) => {
|
|
|
252
252
|
className
|
|
253
253
|
);
|
|
254
254
|
}, [variant, size, color, isIconOnly, className]);
|
|
255
|
-
const buttonContent =
|
|
255
|
+
const buttonContent = React4.useMemo(() => {
|
|
256
256
|
if (loading) {
|
|
257
257
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: buttonLoadingClasses.container, children: [
|
|
258
258
|
/* @__PURE__ */ jsxRuntime.jsx(LoadingSpinner, { size }),
|
|
@@ -261,8 +261,8 @@ var Button = React3.forwardRef((_a, ref) => {
|
|
|
261
261
|
}
|
|
262
262
|
const iconSizeClass = getButtonIconSize(size);
|
|
263
263
|
const renderIcon = (iconNode) => {
|
|
264
|
-
if (
|
|
265
|
-
return
|
|
264
|
+
if (React4__namespace.default.isValidElement(iconNode)) {
|
|
265
|
+
return React4__namespace.default.cloneElement(iconNode, {
|
|
266
266
|
className: cn(iconSizeClass, iconNode.props.className),
|
|
267
267
|
"aria-hidden": true
|
|
268
268
|
});
|
|
@@ -278,7 +278,7 @@ var Button = React3.forwardRef((_a, ref) => {
|
|
|
278
278
|
iconRight && renderIcon(iconRight)
|
|
279
279
|
] });
|
|
280
280
|
}, [loading, loadingText, isIconOnly, icon, iconLeft, iconRight, children, size]);
|
|
281
|
-
const accessibilityProps =
|
|
281
|
+
const accessibilityProps = React4.useMemo(() => {
|
|
282
282
|
const props2 = {};
|
|
283
283
|
if (isIconOnly && !ariaLabel) {
|
|
284
284
|
console.warn("Icon-only buttons should have an aria-label for accessibility");
|
|
@@ -361,11 +361,61 @@ var Button = React3.forwardRef((_a, ref) => {
|
|
|
361
361
|
);
|
|
362
362
|
});
|
|
363
363
|
Button.displayName = "Button";
|
|
364
|
+
|
|
365
|
+
// src/atoms/logo/logo.png
|
|
366
|
+
var logo_default = "../../logo-N622EUTF.png";
|
|
367
|
+
var Logo = React4.forwardRef((_a, ref) => {
|
|
368
|
+
var _b = _a, {
|
|
369
|
+
size = 120,
|
|
370
|
+
variant = "default",
|
|
371
|
+
wordmarkOnly = false,
|
|
372
|
+
className,
|
|
373
|
+
alt = "Manta Seguros Logo",
|
|
374
|
+
src
|
|
375
|
+
} = _b, props = __objRest(_b, [
|
|
376
|
+
"size",
|
|
377
|
+
"variant",
|
|
378
|
+
"wordmarkOnly",
|
|
379
|
+
"className",
|
|
380
|
+
"alt",
|
|
381
|
+
"src"
|
|
382
|
+
]);
|
|
383
|
+
const getVariantFilter = () => {
|
|
384
|
+
switch (variant) {
|
|
385
|
+
case "white":
|
|
386
|
+
return "brightness(0) invert(1)";
|
|
387
|
+
// Convert to white
|
|
388
|
+
case "dark":
|
|
389
|
+
return "brightness(0) saturate(100%)";
|
|
390
|
+
// Convert to black
|
|
391
|
+
default:
|
|
392
|
+
return "none";
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
const logoStyles = __spreadValues({
|
|
396
|
+
width: typeof size === "number" ? `${size}px` : size,
|
|
397
|
+
height: "auto",
|
|
398
|
+
filter: getVariantFilter(),
|
|
399
|
+
maxWidth: "100%"
|
|
400
|
+
}, props.style);
|
|
401
|
+
const logoSrc = src || logo_default;
|
|
402
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
403
|
+
"img",
|
|
404
|
+
__spreadValues({
|
|
405
|
+
ref,
|
|
406
|
+
src: logoSrc,
|
|
407
|
+
alt,
|
|
408
|
+
className: cn("logo", className),
|
|
409
|
+
style: logoStyles
|
|
410
|
+
}, props)
|
|
411
|
+
);
|
|
412
|
+
});
|
|
413
|
+
Logo.displayName = "Logo";
|
|
364
414
|
var MainNavigationItemComponent = ({ item, isActive, hasActiveSubItem, onNavigate, collapsed = false, currentPath }) => {
|
|
365
415
|
var _a;
|
|
366
|
-
const [isExpanded, setIsExpanded] =
|
|
416
|
+
const [isExpanded, setIsExpanded] = React4__namespace.default.useState(hasActiveSubItem);
|
|
367
417
|
const hasSubItems = item.subItems && item.subItems.length > 0;
|
|
368
|
-
|
|
418
|
+
React4__namespace.default.useEffect(() => {
|
|
369
419
|
if (hasActiveSubItem) {
|
|
370
420
|
setIsExpanded(true);
|
|
371
421
|
}
|
|
@@ -471,7 +521,7 @@ var FooterMenuItemComponent = ({ item, isActive, onNavigate, collapsed = false }
|
|
|
471
521
|
}
|
|
472
522
|
);
|
|
473
523
|
};
|
|
474
|
-
var Sidebar =
|
|
524
|
+
var Sidebar = React4__namespace.default.forwardRef(
|
|
475
525
|
(_a, ref) => {
|
|
476
526
|
var _b = _a, {
|
|
477
527
|
brand,
|
|
@@ -514,12 +564,19 @@ var Sidebar = React3__namespace.default.forwardRef(
|
|
|
514
564
|
}, props), {
|
|
515
565
|
children: [
|
|
516
566
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn(
|
|
517
|
-
"p-4
|
|
567
|
+
"p-4 overflow-hidden",
|
|
518
568
|
collapsed && "px-2"
|
|
519
569
|
), children: [
|
|
520
570
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
521
|
-
|
|
522
|
-
|
|
571
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-shrink-0 mx-auto", children: brand.logo ? brand.logo : /* @__PURE__ */ jsxRuntime.jsx(
|
|
572
|
+
Logo,
|
|
573
|
+
{
|
|
574
|
+
size: collapsed ? 32 : 180,
|
|
575
|
+
variant: "default",
|
|
576
|
+
className: "transition-all duration-300"
|
|
577
|
+
}
|
|
578
|
+
) }),
|
|
579
|
+
!collapsed && brand.logo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1 overflow-hidden", children: [
|
|
523
580
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "subheading-md", className: "text-gray-900 font-bold truncate block", children: brand.name }),
|
|
524
581
|
brand.tagline && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body-xs", className: "text-gray-500 truncate block", children: brand.tagline })
|
|
525
582
|
] })
|
|
@@ -558,7 +615,7 @@ var Sidebar = React3__namespace.default.forwardRef(
|
|
|
558
615
|
item.id
|
|
559
616
|
)) }),
|
|
560
617
|
showFooterMenu && footerMenu.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
|
|
561
|
-
"p-4
|
|
618
|
+
"p-4 space-y-2 overflow-hidden",
|
|
562
619
|
collapsed && "px-2"
|
|
563
620
|
), children: footerMenu.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
564
621
|
FooterMenuItemComponent,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React4 from 'react';
|
|
2
|
+
import React4__default, { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import { twMerge } from 'tailwind-merge';
|
|
5
5
|
import { cva } from 'class-variance-authority';
|
|
@@ -68,7 +68,7 @@ var typographyVariants = cva("font-primary", {
|
|
|
68
68
|
variant: "body-md"
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
|
-
var Typography =
|
|
71
|
+
var Typography = React4.forwardRef(
|
|
72
72
|
(_a, ref) => {
|
|
73
73
|
var _b = _a, { className, variant, as: Component = "p" } = _b, props = __objRest(_b, ["className", "variant", "as"]);
|
|
74
74
|
return /* @__PURE__ */ jsx(
|
|
@@ -240,8 +240,8 @@ var Button = forwardRef((_a, ref) => {
|
|
|
240
240
|
}
|
|
241
241
|
const iconSizeClass = getButtonIconSize(size);
|
|
242
242
|
const renderIcon = (iconNode) => {
|
|
243
|
-
if (
|
|
244
|
-
return
|
|
243
|
+
if (React4__default.isValidElement(iconNode)) {
|
|
244
|
+
return React4__default.cloneElement(iconNode, {
|
|
245
245
|
className: cn(iconSizeClass, iconNode.props.className),
|
|
246
246
|
"aria-hidden": true
|
|
247
247
|
});
|
|
@@ -340,11 +340,61 @@ var Button = forwardRef((_a, ref) => {
|
|
|
340
340
|
);
|
|
341
341
|
});
|
|
342
342
|
Button.displayName = "Button";
|
|
343
|
+
|
|
344
|
+
// src/atoms/logo/logo.png
|
|
345
|
+
var logo_default = "../../logo-N622EUTF.png";
|
|
346
|
+
var Logo = forwardRef((_a, ref) => {
|
|
347
|
+
var _b = _a, {
|
|
348
|
+
size = 120,
|
|
349
|
+
variant = "default",
|
|
350
|
+
wordmarkOnly = false,
|
|
351
|
+
className,
|
|
352
|
+
alt = "Manta Seguros Logo",
|
|
353
|
+
src
|
|
354
|
+
} = _b, props = __objRest(_b, [
|
|
355
|
+
"size",
|
|
356
|
+
"variant",
|
|
357
|
+
"wordmarkOnly",
|
|
358
|
+
"className",
|
|
359
|
+
"alt",
|
|
360
|
+
"src"
|
|
361
|
+
]);
|
|
362
|
+
const getVariantFilter = () => {
|
|
363
|
+
switch (variant) {
|
|
364
|
+
case "white":
|
|
365
|
+
return "brightness(0) invert(1)";
|
|
366
|
+
// Convert to white
|
|
367
|
+
case "dark":
|
|
368
|
+
return "brightness(0) saturate(100%)";
|
|
369
|
+
// Convert to black
|
|
370
|
+
default:
|
|
371
|
+
return "none";
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
const logoStyles = __spreadValues({
|
|
375
|
+
width: typeof size === "number" ? `${size}px` : size,
|
|
376
|
+
height: "auto",
|
|
377
|
+
filter: getVariantFilter(),
|
|
378
|
+
maxWidth: "100%"
|
|
379
|
+
}, props.style);
|
|
380
|
+
const logoSrc = src || logo_default;
|
|
381
|
+
return /* @__PURE__ */ jsx(
|
|
382
|
+
"img",
|
|
383
|
+
__spreadValues({
|
|
384
|
+
ref,
|
|
385
|
+
src: logoSrc,
|
|
386
|
+
alt,
|
|
387
|
+
className: cn("logo", className),
|
|
388
|
+
style: logoStyles
|
|
389
|
+
}, props)
|
|
390
|
+
);
|
|
391
|
+
});
|
|
392
|
+
Logo.displayName = "Logo";
|
|
343
393
|
var MainNavigationItemComponent = ({ item, isActive, hasActiveSubItem, onNavigate, collapsed = false, currentPath }) => {
|
|
344
394
|
var _a;
|
|
345
|
-
const [isExpanded, setIsExpanded] =
|
|
395
|
+
const [isExpanded, setIsExpanded] = React4__default.useState(hasActiveSubItem);
|
|
346
396
|
const hasSubItems = item.subItems && item.subItems.length > 0;
|
|
347
|
-
|
|
397
|
+
React4__default.useEffect(() => {
|
|
348
398
|
if (hasActiveSubItem) {
|
|
349
399
|
setIsExpanded(true);
|
|
350
400
|
}
|
|
@@ -450,7 +500,7 @@ var FooterMenuItemComponent = ({ item, isActive, onNavigate, collapsed = false }
|
|
|
450
500
|
}
|
|
451
501
|
);
|
|
452
502
|
};
|
|
453
|
-
var Sidebar =
|
|
503
|
+
var Sidebar = React4__default.forwardRef(
|
|
454
504
|
(_a, ref) => {
|
|
455
505
|
var _b = _a, {
|
|
456
506
|
brand,
|
|
@@ -493,12 +543,19 @@ var Sidebar = React3__default.forwardRef(
|
|
|
493
543
|
}, props), {
|
|
494
544
|
children: [
|
|
495
545
|
/* @__PURE__ */ jsxs("div", { className: cn(
|
|
496
|
-
"p-4
|
|
546
|
+
"p-4 overflow-hidden",
|
|
497
547
|
collapsed && "px-2"
|
|
498
548
|
), children: [
|
|
499
549
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
500
|
-
|
|
501
|
-
|
|
550
|
+
/* @__PURE__ */ jsx("div", { className: "flex-shrink-0 mx-auto", children: brand.logo ? brand.logo : /* @__PURE__ */ jsx(
|
|
551
|
+
Logo,
|
|
552
|
+
{
|
|
553
|
+
size: collapsed ? 32 : 180,
|
|
554
|
+
variant: "default",
|
|
555
|
+
className: "transition-all duration-300"
|
|
556
|
+
}
|
|
557
|
+
) }),
|
|
558
|
+
!collapsed && brand.logo && /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 overflow-hidden", children: [
|
|
502
559
|
/* @__PURE__ */ jsx(Typography, { variant: "subheading-md", className: "text-gray-900 font-bold truncate block", children: brand.name }),
|
|
503
560
|
brand.tagline && /* @__PURE__ */ jsx(Typography, { variant: "body-xs", className: "text-gray-500 truncate block", children: brand.tagline })
|
|
504
561
|
] })
|
|
@@ -537,7 +594,7 @@ var Sidebar = React3__default.forwardRef(
|
|
|
537
594
|
item.id
|
|
538
595
|
)) }),
|
|
539
596
|
showFooterMenu && footerMenu.length > 0 && /* @__PURE__ */ jsx("div", { className: cn(
|
|
540
|
-
"p-4
|
|
597
|
+
"p-4 space-y-2 overflow-hidden",
|
|
541
598
|
collapsed && "px-2"
|
|
542
599
|
), children: footerMenu.map((item) => /* @__PURE__ */ jsx(
|
|
543
600
|
FooterMenuItemComponent,
|