@beweco/aurora-ui 1.0.0-beta.112 → 1.0.0-beta.113
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/README.md +17 -4
- package/dist/assets/css/styles.css +1 -1
- package/dist/assets/css/theme.css +2 -2441
- package/dist/index.cjs.js +531 -58
- package/dist/index.esm.js +529 -54
- package/dist/types/__smoke__/v2-api-surface.d.ts +20 -2
- package/dist/types/__smoke__/v2-api-surface.d.ts.map +1 -1
- package/dist/types/compat/heroui-v2-shims.d.ts +4 -26
- package/dist/types/compat/heroui-v2-shims.d.ts.map +1 -1
- package/dist/types/components/alert/Alert.d.ts +14 -0
- package/dist/types/components/alert/Alert.d.ts.map +1 -0
- package/dist/types/components/alert/Alert.types.d.ts +100 -0
- package/dist/types/components/alert/Alert.types.d.ts.map +1 -0
- package/dist/types/components/alert/index.d.ts +3 -0
- package/dist/types/components/alert/index.d.ts.map +1 -0
- package/dist/types/components/checkbox/Checkbox.d.ts +22 -0
- package/dist/types/components/checkbox/Checkbox.d.ts.map +1 -0
- package/dist/types/components/checkbox/Checkbox.types.d.ts +69 -0
- package/dist/types/components/checkbox/Checkbox.types.d.ts.map +1 -0
- package/dist/types/components/checkbox/index.d.ts +3 -0
- package/dist/types/components/checkbox/index.d.ts.map +1 -0
- package/dist/types/components/icon/Icon.d.ts.map +1 -1
- package/dist/types/components/icon/Icon.types.d.ts +8 -2
- package/dist/types/components/icon/Icon.types.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/providers/theme/force-light-only-theme.d.ts +14 -3
- package/dist/types/providers/theme/force-light-only-theme.d.ts.map +1 -1
- package/package.json +4 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Card as Card$1, Breadcrumbs, ListBoxSection, ListBoxItem, Separator, ProgressBar, useOverlayState, Spinner, Button as Button$1, Chip as Chip$1, cn, CloseButton, Pagination as Pagination$1, Skeleton, Accordion, DatePicker as DatePicker$1, Label, DateField, Description, Calendar, FieldError, DateRangePicker as DateRangePicker$1, RangeCalendar, TextField, InputGroup, RadioGroup, Radio, Tabs, Dropdown, ComboBox, Input as Input$1, ListBox, Tooltip as Tooltip$2, DropdownTrigger, DropdownPopover, DropdownMenu, DropdownSection, DropdownItem, Badge as Badge$1, Popover, PopoverTrigger, PopoverContent, Header, Avatar, Link, Switch as Switch$1, TimeField, Select as Select$1, Table, TextArea, toastVariants, Modal as Modal$1, Slider, Drawer, Checkbox, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, ModalFooter as ModalFooter$1 } from '@heroui/react';
|
|
2
|
-
export { Accordion, AccordionItem,
|
|
1
|
+
import { Card as Card$1, Breadcrumbs, ListBoxSection, ListBoxItem, Separator, ProgressBar, useOverlayState, Spinner, Button as Button$1, Chip as Chip$1, cn, CloseButton, Pagination as Pagination$1, Skeleton, Accordion, DatePicker as DatePicker$1, Label, DateField, Description, Calendar, FieldError, DateRangePicker as DateRangePicker$1, RangeCalendar, TextField, InputGroup, RadioGroup, Radio, Tabs, Dropdown, ComboBox, Input as Input$1, ListBox, Tooltip as Tooltip$2, DropdownTrigger, DropdownPopover, DropdownMenu, DropdownSection, DropdownItem, Badge as Badge$1, Popover, PopoverTrigger, PopoverContent, Header, Avatar, Link, Switch as Switch$1, TimeField, Select as Select$1, Table, TextArea, toastVariants, Modal as Modal$1, Slider, Drawer, Checkbox as Checkbox$1, ModalHeader as ModalHeader$1, ModalBody as ModalBody$1, ModalFooter as ModalFooter$1, Alert as Alert$1 } from '@heroui/react';
|
|
2
|
+
export { Accordion, AccordionItem, Avatar, Breadcrumbs, CardFooter, CardHeader, CheckboxGroup, CloseButton, Drawer, DrawerBody, DrawerContent, DrawerFooter, DrawerHeader, Dropdown, DropdownItem, DropdownMenu, DropdownSection, DropdownTrigger, Link, Popover, PopoverContent, PopoverTrigger, Radio, RadioGroup, Skeleton, Slider, Spinner, Switch, Tab, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, Tabs, cn } from '@heroui/react';
|
|
3
3
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import $8WNJc$react, { useState, useRef, useCallback, useEffect, useId, useMemo, isValidElement, cloneElement, forwardRef, useImperativeHandle, createContext, useContext, useLayoutEffect, memo, useReducer, Fragment as Fragment$1 } from 'react';
|
|
4
|
+
import $8WNJc$react, { useState, useRef, useCallback, useEffect, useId, useMemo, isValidElement, cloneElement, forwardRef, useImperativeHandle, createContext, useContext, useLayoutEffect, memo, useReducer, Fragment as Fragment$1, Children } from 'react';
|
|
5
5
|
import { Icon } from '@iconify/react';
|
|
6
6
|
export { loadIcons } from '@iconify/react';
|
|
7
7
|
import { ResponsiveContainer, AreaChart, CartesianGrid, XAxis, Tooltip as Tooltip$1, Area, LineChart, YAxis, Line, PieChart, Pie, Cell } from 'recharts';
|
|
@@ -363,7 +363,7 @@ const CLASE_AURA = {
|
|
|
363
363
|
ring: "linda-aura-ring",
|
|
364
364
|
surface: "linda-aura",
|
|
365
365
|
};
|
|
366
|
-
const RADIUS_CLASS$
|
|
366
|
+
const RADIUS_CLASS$a = {
|
|
367
367
|
none: "rounded-none",
|
|
368
368
|
sm: "rounded-[8px]",
|
|
369
369
|
md: "rounded-[12px]",
|
|
@@ -432,7 +432,7 @@ const Button = ({ color = "primary", size = "md", variant = "solid", radius = "s
|
|
|
432
432
|
const contenido = ai ? (jsx("span", { className: "linda-aura-content", children: children })) : (children);
|
|
433
433
|
return (jsxs(Button$1, { ...rest, variant: v3Variant, size: size, isIconOnly: isIconOnly, isPending: isLoading, isDisabled: isDisabled || isLoading, onPress: alPulsar, className: [
|
|
434
434
|
SHAPE_CLASS[shape],
|
|
435
|
-
RADIUS_CLASS$
|
|
435
|
+
RADIUS_CLASS$a[radius],
|
|
436
436
|
ai ? CLASE_AURA[ai] : "",
|
|
437
437
|
// P-05: v2 apagaba transición + hundido con esta prop; v3 no tiene la prop, así
|
|
438
438
|
// que el interruptor es una clase propia (`Button.css`).
|
|
@@ -672,7 +672,7 @@ const CUSTOM_COLOR_CLASSES = {
|
|
|
672
672
|
// v3 usa `rounded-2xl` (16px) por defecto; v2/Aurora forzaba `full`. `neutralize-v3.css` ya
|
|
673
673
|
// neutraliza el default global (`.chip { border-radius: 9999px }`); aquí se cubren el resto de
|
|
674
674
|
// valores explícitos con el valor EXACTO de v2 (rounded-md/lg de Tailwind no coinciden).
|
|
675
|
-
const RADIUS_CLASS$
|
|
675
|
+
const RADIUS_CLASS$9 = {
|
|
676
676
|
none: "rounded-none",
|
|
677
677
|
sm: "rounded-[8px]",
|
|
678
678
|
md: "rounded-[12px]",
|
|
@@ -764,7 +764,7 @@ const Chip = ({ color = "default", variant = "solid", size = "md", radius = "ful
|
|
|
764
764
|
className: cn(SIZE_CLASS$7[size],
|
|
765
765
|
// Después de `SIZE_CLASS` a propósito: el cuadrado de un carácter ENCOGE la caja
|
|
766
766
|
// respecto al tamaño normal y tiene que ganar en tailwind-merge.
|
|
767
|
-
isSquare ? ONE_CHAR_CLASS[size] : "", RADIUS_CLASS$
|
|
767
|
+
isSquare ? ONE_CHAR_CLASS[size] : "", RADIUS_CLASS$9[radius], outlineClass, flatDarkFgClass, customClass, isDisabled ? "opacity-50 pointer-events-none" : "", classNames?.base, className), style: style, "aria-disabled": isDisabled || undefined, children: [startContent, jsx("span", { className: cn("flex-1 text-inherit font-normal", startContent
|
|
768
768
|
? CONTENT_PADDING[size].leftWithContent
|
|
769
769
|
: CONTENT_PADDING[size].left, hasEndContent
|
|
770
770
|
? CONTENT_PADDING[size].rightWithContent
|
|
@@ -785,7 +785,9 @@ const sizeMap = {
|
|
|
785
785
|
xl: "32px",
|
|
786
786
|
};
|
|
787
787
|
const IconComponent = ({ icon, size = "md", className, style, color, hFlip, vFlip, flip, rotate, ...nativeProps }) => {
|
|
788
|
-
|
|
788
|
+
// Un número son píxeles tal cual (p. ej. 64): la escala con nombre se queda en 32 y
|
|
789
|
+
// `width`/`height` no son props del componente (caerían en el <span>, sin efecto).
|
|
790
|
+
const iconSize = typeof size === "number" ? `${size}px` : (sizeMap[size] ?? sizeMap.md);
|
|
789
791
|
return (jsx("span", { ...nativeProps, children: jsx(Icon, { icon: icon, width: iconSize, height: iconSize, className: className, style: style, color: color, hFlip: hFlip, vFlip: vFlip, flip: flip, rotate: rotate }) }));
|
|
790
792
|
};
|
|
791
793
|
|
|
@@ -1104,7 +1106,7 @@ const SIZE_TEXT_CLASS$3 = {
|
|
|
1104
1106
|
md: "text-sm",
|
|
1105
1107
|
lg: "text-base",
|
|
1106
1108
|
};
|
|
1107
|
-
const RADIUS_CLASS$
|
|
1109
|
+
const RADIUS_CLASS$8 = {
|
|
1108
1110
|
none: "rounded-none",
|
|
1109
1111
|
sm: "rounded-[8px]",
|
|
1110
1112
|
md: "rounded-[12px]",
|
|
@@ -1173,7 +1175,7 @@ function DatePicker({ label, description, errorMessage, id, size = "md", variant
|
|
|
1173
1175
|
.filter(Boolean)
|
|
1174
1176
|
.join(" "), children: [label && (jsx(Label, { className: "text-default-600 text-xs font-medium", children: label })), jsxs(DateField.Group, { fullWidth: fullWidth, className: [
|
|
1175
1177
|
SIZE_CLASS$6[size],
|
|
1176
|
-
RADIUS_CLASS$
|
|
1178
|
+
RADIUS_CLASS$8[radius],
|
|
1177
1179
|
VARIANT_CLASS$5[variant],
|
|
1178
1180
|
FIELD_FOCUS_CLASS$5,
|
|
1179
1181
|
]
|
|
@@ -1193,7 +1195,7 @@ const SIZE_TEXT_CLASS$2 = {
|
|
|
1193
1195
|
md: "text-sm",
|
|
1194
1196
|
lg: "text-base",
|
|
1195
1197
|
};
|
|
1196
|
-
const RADIUS_CLASS$
|
|
1198
|
+
const RADIUS_CLASS$7 = {
|
|
1197
1199
|
none: "rounded-none",
|
|
1198
1200
|
sm: "rounded-[8px]",
|
|
1199
1201
|
md: "rounded-[12px]",
|
|
@@ -1265,7 +1267,7 @@ function DateRangePicker({ label, description, errorMessage, id, size = "md", va
|
|
|
1265
1267
|
.filter(Boolean)
|
|
1266
1268
|
.join(" "), children: [label && (jsx(Label, { className: "text-default-600 text-xs font-medium", children: label })), jsxs(DateField.Group, { fullWidth: fullWidth, className: [
|
|
1267
1269
|
SIZE_CLASS$5[size],
|
|
1268
|
-
RADIUS_CLASS$
|
|
1270
|
+
RADIUS_CLASS$7[radius],
|
|
1269
1271
|
VARIANT_CLASS$4[variant],
|
|
1270
1272
|
FIELD_FOCUS_CLASS$4,
|
|
1271
1273
|
]
|
|
@@ -1330,7 +1332,7 @@ const SIZE_TEXT_CLASS$1 = {
|
|
|
1330
1332
|
// v3 usa `--field-radius` (12px, ya coincide con el "md" de v2) para el radio por defecto —
|
|
1331
1333
|
// neutralize-v3.css no toca fields. Para el resto de valores explícitos, clases arbitrarias con
|
|
1332
1334
|
// el valor EXACTO de v2 (rounded-md/lg de Tailwind no coinciden: 6/8px en vez de 12/14px).
|
|
1333
|
-
const RADIUS_CLASS$
|
|
1335
|
+
const RADIUS_CLASS$6 = {
|
|
1334
1336
|
none: "rounded-none",
|
|
1335
1337
|
sm: "rounded-[8px]",
|
|
1336
1338
|
md: "rounded-[12px]",
|
|
@@ -1600,7 +1602,7 @@ fullWidth = true, value, defaultValue, onChange, onValueChange, className, class
|
|
|
1600
1602
|
SIZE_CLASS$4[size],
|
|
1601
1603
|
radius === "full" ? PADDING_FULL_CLASS$1[size] : PADDING_CLASS$2[size],
|
|
1602
1604
|
variant === "underlined" ? UNDERLINED_INNER_CLASS$1[size] : "",
|
|
1603
|
-
RADIUS_CLASS$
|
|
1605
|
+
RADIUS_CLASS$6[radius],
|
|
1604
1606
|
VARIANT_CLASS$3[variant],
|
|
1605
1607
|
FIELD_FOCUS_CLASS$3,
|
|
1606
1608
|
FIELD_SHADOW_CLASS$2,
|
|
@@ -1719,7 +1721,7 @@ const paddingClasses = {
|
|
|
1719
1721
|
// `src/styles/neutralize-v3.css` (`.card { border-radius: 8px }`, el "sm" de v2). Para el resto de
|
|
1720
1722
|
// valores explícitos, clases arbitrarias con el valor EXACTO de v2 (`rounded-md`/`rounded-lg` de
|
|
1721
1723
|
// Tailwind no coinciden: 6px/8px en vez de 12px/14px — ver findings/tabla-mapeo-tokens.md §4).
|
|
1722
|
-
const RADIUS_CLASS$
|
|
1724
|
+
const RADIUS_CLASS$5 = {
|
|
1723
1725
|
none: "rounded-none",
|
|
1724
1726
|
sm: "rounded-[8px]",
|
|
1725
1727
|
md: "rounded-[12px]",
|
|
@@ -1751,7 +1753,7 @@ const SHADOW_CLASS = {
|
|
|
1751
1753
|
const Card = ({ children, className = "", shadow = "sm", radius = "sm", padding = "md", ...props }) => {
|
|
1752
1754
|
const combinedClassName = [
|
|
1753
1755
|
paddingClasses[padding],
|
|
1754
|
-
RADIUS_CLASS$
|
|
1756
|
+
RADIUS_CLASS$5[radius],
|
|
1755
1757
|
SHADOW_CLASS[shadow],
|
|
1756
1758
|
className,
|
|
1757
1759
|
]
|
|
@@ -4723,7 +4725,7 @@ function computeSlices(data, palette = DEFAULT_DONUT_COLORS) {
|
|
|
4723
4725
|
});
|
|
4724
4726
|
}
|
|
4725
4727
|
|
|
4726
|
-
const DEFAULT_TRANSLATIONS$
|
|
4728
|
+
const DEFAULT_TRANSLATIONS$d = {
|
|
4727
4729
|
emptyState: "Sin datos para mostrar",
|
|
4728
4730
|
totalLabel: "Total",
|
|
4729
4731
|
};
|
|
@@ -4733,7 +4735,7 @@ const DEFAULT_TRANSLATIONS$c = {
|
|
|
4733
4735
|
* para que sean estables independientemente del tamaño medido del contenedor.
|
|
4734
4736
|
*/
|
|
4735
4737
|
const DonutChart = ({ data, height = 220, innerRadiusRatio = 0.65, showLegend = true, showTotal = true, colors, formatValue, animated = true, translations = {}, className, }) => {
|
|
4736
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
4738
|
+
const t = { ...DEFAULT_TRANSLATIONS$d, ...translations };
|
|
4737
4739
|
if (isDonutEmpty(data)) {
|
|
4738
4740
|
return (jsx("div", { className: className, children: jsx(P, { children: t.emptyState }) }));
|
|
4739
4741
|
}
|
|
@@ -4922,11 +4924,11 @@ const NotificationButton = ({ notificationCount = 0, onPress, color = "secondary
|
|
|
4922
4924
|
};
|
|
4923
4925
|
NotificationButton.displayName = "NotificationButton";
|
|
4924
4926
|
|
|
4925
|
-
const DEFAULT_TRANSLATIONS$
|
|
4927
|
+
const DEFAULT_TRANSLATIONS$c = {
|
|
4926
4928
|
logout: "Cerrar sesión",
|
|
4927
4929
|
};
|
|
4928
4930
|
const HeaderComponent = ({ notificationCount, options, onMenuClick, onLogout, translations = {}, breadcrumbs, extraContent, showMenuButton = true, onNotificationClick, onOptionSelect, onBreadcrumbClick, notificationButtonColor, }) => {
|
|
4929
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
4931
|
+
const t = { ...DEFAULT_TRANSLATIONS$c, ...translations };
|
|
4930
4932
|
return (jsx("header", { className: "header__container", children: jsxs("div", { className: "flex items-center justify-between w-full", children: [jsxs("div", { className: "flex items-center gap-4", children: [showMenuButton && (jsx(Button, { className: "sm:hidden", isIconOnly: true,
|
|
4931
4933
|
// Fachada propia por defecto pinta color="primary" (D-G4-1); el crudo
|
|
4932
4934
|
// de v2 pintaba "default" (gris) — se fija explícito.
|
|
@@ -5182,7 +5184,7 @@ KanbanColumn.displayName = "KanbanColumn";
|
|
|
5182
5184
|
* Traducciones por defecto en español.
|
|
5183
5185
|
* Se mezclan con las traducciones proporcionadas por el usuario.
|
|
5184
5186
|
*/
|
|
5185
|
-
const DEFAULT_TRANSLATIONS$
|
|
5187
|
+
const DEFAULT_TRANSLATIONS$b = {
|
|
5186
5188
|
dropHere: "Soltar aquí",
|
|
5187
5189
|
emptyMessage: "No hay elementos",
|
|
5188
5190
|
itemsLabel: "elementos",
|
|
@@ -5216,7 +5218,7 @@ const columnGapClasses = {
|
|
|
5216
5218
|
*/
|
|
5217
5219
|
const KanbanComponent = ({ columns, renderItem, onCardClick, onItemMove, isDraggable, cardClassName, isCardClickable, className, columnWidth = "280px", columnGap = "md", horizontalScroll = true, columnMaxHeight, renderColumnHeader, renderEmptyState, translations = {}, onLoadMore, showItemCount = false, }) => {
|
|
5218
5220
|
// Mezclar traducciones del usuario con las por defecto
|
|
5219
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
5221
|
+
const t = { ...DEFAULT_TRANSLATIONS$b, ...translations };
|
|
5220
5222
|
// Determinar si drag está habilitado
|
|
5221
5223
|
const dragEnabled = isDraggable ?? !!onItemMove;
|
|
5222
5224
|
// Estado del drag actual
|
|
@@ -5601,7 +5603,7 @@ const MenuNavList = $8WNJc$react.forwardRef(({ items, isCollapsed, defaultSelect
|
|
|
5601
5603
|
});
|
|
5602
5604
|
MenuNavList.displayName = "MenuNavList";
|
|
5603
5605
|
|
|
5604
|
-
const DEFAULT_TRANSLATIONS$
|
|
5606
|
+
const DEFAULT_TRANSLATIONS$a = {
|
|
5605
5607
|
menuLabel: "Menú",
|
|
5606
5608
|
closeSidebarAriaLabel: "Cerrar menú lateral",
|
|
5607
5609
|
mobileNavAriaLabel: "Navegación móvil",
|
|
@@ -5617,7 +5619,7 @@ const DEFAULT_TRANSLATIONS$9 = {
|
|
|
5617
5619
|
const MenuComponent = $8WNJc$react.memo(function Menu({ commerceInfo, userInfo, helpButton, isOpenSidebar, onOpenSidebarChange, menuItems, mobileBottomBarGroupKey, showNativeMenu = true, onUserInfoClick, translations = {}, }) {
|
|
5618
5620
|
const [isCollapsed, setIsCollapsed] = $8WNJc$react.useState(false);
|
|
5619
5621
|
const [logoError, setLogoError] = $8WNJc$react.useState(false);
|
|
5620
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
5622
|
+
const t = { ...DEFAULT_TRANSLATIONS$a, ...translations };
|
|
5621
5623
|
const selectedKey = $8WNJc$react.useMemo(() => {
|
|
5622
5624
|
if (menuItems.selectedPath) {
|
|
5623
5625
|
return (getSelectedKeyFromPath(menuItems.selectedPath, menuItems.items) ??
|
|
@@ -5895,7 +5897,7 @@ const MenuClawNavItem = ({ item, selectedKey, isCollapsed, onSelect, depth = 0,
|
|
|
5895
5897
|
};
|
|
5896
5898
|
MenuClawNavItem.displayName = "MenuClawNavItem";
|
|
5897
5899
|
|
|
5898
|
-
const DEFAULT_TRANSLATIONS$
|
|
5900
|
+
const DEFAULT_TRANSLATIONS$9 = {
|
|
5899
5901
|
menuLabel: "Menú",
|
|
5900
5902
|
closeSidebarAriaLabel: "Cerrar menú lateral",
|
|
5901
5903
|
mobileNavAriaLabel: "Navegación móvil",
|
|
@@ -5933,7 +5935,7 @@ const MenuClaw = $8WNJc$react.memo(function MenuClaw({ userInfo, helpButton, men
|
|
|
5933
5935
|
const isControlled = isCollapsedProp !== undefined;
|
|
5934
5936
|
const [internalCollapsed, setInternalCollapsed] = $8WNJc$react.useState(defaultCollapsed ?? false);
|
|
5935
5937
|
const collapsed = isCollapsedProp ?? internalCollapsed;
|
|
5936
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
5938
|
+
const t = { ...DEFAULT_TRANSLATIONS$9, ...translations };
|
|
5937
5939
|
const selectedKey = useMemo(() => {
|
|
5938
5940
|
if (menuItems.selectedPath) {
|
|
5939
5941
|
return (getSelectedKeyFromPath(menuItems.selectedPath, menuItems.items) ??
|
|
@@ -6783,7 +6785,7 @@ function computeBars(data, palette = DEFAULT_RANKED_BAR_COLORS) {
|
|
|
6783
6785
|
});
|
|
6784
6786
|
}
|
|
6785
6787
|
|
|
6786
|
-
const DEFAULT_TRANSLATIONS$
|
|
6788
|
+
const DEFAULT_TRANSLATIONS$8 = {
|
|
6787
6789
|
emptyState: "Sin datos para mostrar",
|
|
6788
6790
|
};
|
|
6789
6791
|
/**
|
|
@@ -6793,7 +6795,7 @@ const DEFAULT_TRANSLATIONS$7 = {
|
|
|
6793
6795
|
* etapa del funnel, etc.).
|
|
6794
6796
|
*/
|
|
6795
6797
|
const RankedBarList = ({ data, colors, formatValue, showValue = true, barHeight = 8, translations = {}, className, }) => {
|
|
6796
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
6798
|
+
const t = { ...DEFAULT_TRANSLATIONS$8, ...translations };
|
|
6797
6799
|
if (isRankedBarListEmpty(data)) {
|
|
6798
6800
|
return (jsx("div", { className: className, children: jsx(P, { children: t.emptyState }) }));
|
|
6799
6801
|
}
|
|
@@ -8182,7 +8184,7 @@ const SIZE_TEXT_CLASS = {
|
|
|
8182
8184
|
// `min-w-0` es obligatorio: un ítem flex tiene `min-width: auto`, o sea no baja de su `min-content`,
|
|
8183
8185
|
// y sin eso el texto desborda el trigger en vez de truncar con elipsis.
|
|
8184
8186
|
const VALUE_ROOM_CLASS = "me-6 min-w-0 truncate";
|
|
8185
|
-
const RADIUS_CLASS$
|
|
8187
|
+
const RADIUS_CLASS$4 = {
|
|
8186
8188
|
none: "rounded-none",
|
|
8187
8189
|
sm: "rounded-[8px]",
|
|
8188
8190
|
md: "rounded-[12px]",
|
|
@@ -8405,7 +8407,7 @@ fullWidth = true, isOpen, defaultOpen, onOpenChange, className, classNames, }) =
|
|
|
8405
8407
|
SIZE_CLASS$1[size],
|
|
8406
8408
|
radius === "full" ? PADDING_FULL_CLASS[size] : PADDING_CLASS[size],
|
|
8407
8409
|
TRIGGER_ALIGN_CLASS,
|
|
8408
|
-
RADIUS_CLASS$
|
|
8410
|
+
RADIUS_CLASS$4[radius],
|
|
8409
8411
|
VARIANT_CLASS$1[variant],
|
|
8410
8412
|
// En v2 el estado inválido MANDABA también con el campo enfocado
|
|
8411
8413
|
// (`group-data-[focus=true]:!border-danger`), así que el borde de foco no se aplica cuando
|
|
@@ -8559,7 +8561,7 @@ const SocialMediaPreview = ({ platform, imageUrl, caption, variant = "full", pos
|
|
|
8559
8561
|
}
|
|
8560
8562
|
};
|
|
8561
8563
|
|
|
8562
|
-
const DEFAULT_TRANSLATIONS$
|
|
8564
|
+
const DEFAULT_TRANSLATIONS$7 = {
|
|
8563
8565
|
trendUpAriaLabel: "Tendencia al alza",
|
|
8564
8566
|
trendDownAriaLabel: "Tendencia a la baja",
|
|
8565
8567
|
trendNeutralAriaLabel: "Sin variación",
|
|
@@ -8581,7 +8583,7 @@ const TREND_ARIA_KEY = {
|
|
|
8581
8583
|
* varios dashboards de estadísticas y no encajaba en ningún chart existente de AuraUI.
|
|
8582
8584
|
*/
|
|
8583
8585
|
const StatTile = ({ title, value, icon, trend, translations = {}, className, padding = "md", ...cardProps }) => {
|
|
8584
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
8586
|
+
const t = { ...DEFAULT_TRANSLATIONS$7, ...translations };
|
|
8585
8587
|
const direction = trend?.direction ?? "neutral";
|
|
8586
8588
|
return (jsxs(Card, { padding: padding, className: ["flex flex-row items-center gap-3", className]
|
|
8587
8589
|
.filter(Boolean)
|
|
@@ -8631,7 +8633,7 @@ const SIZE_CLASS = {
|
|
|
8631
8633
|
// esquina. Es el único resto que quedaba entre `textarea--default` y su referencia: 12 píxeles en
|
|
8632
8634
|
// x[780..786] y[407..413], gris `102,102,102` donde v2 tiene el fondo.
|
|
8633
8635
|
const RESIZE_CLASS = "resize-none";
|
|
8634
|
-
const RADIUS_CLASS$
|
|
8636
|
+
const RADIUS_CLASS$3 = {
|
|
8635
8637
|
none: "rounded-none",
|
|
8636
8638
|
sm: "rounded-[8px]",
|
|
8637
8639
|
md: "rounded-[12px]",
|
|
@@ -8739,7 +8741,7 @@ fullWidth = true, value, defaultValue, onChange, onValueChange, className, class
|
|
|
8739
8741
|
.join(" "), children: label })), jsx(TextArea, { ...rest, placeholder: placeholder, value: value, defaultValue: defaultValue, onChange: handleChange, className: [
|
|
8740
8742
|
SIZE_CLASS[size],
|
|
8741
8743
|
RESIZE_CLASS,
|
|
8742
|
-
RADIUS_CLASS$
|
|
8744
|
+
RADIUS_CLASS$3[radius],
|
|
8743
8745
|
VARIANT_CLASS[variant],
|
|
8744
8746
|
isInvalid ? INVALID_TEXT_CLASS : "",
|
|
8745
8747
|
FIELD_FOCUS_CLASS,
|
|
@@ -8850,12 +8852,12 @@ const CLOSE_BY_COLOR = {
|
|
|
8850
8852
|
danger: "text-danger-500 hover:bg-danger-200",
|
|
8851
8853
|
default: "text-default-400 hover:bg-default-200",
|
|
8852
8854
|
};
|
|
8853
|
-
const DEFAULT_TRANSLATIONS$
|
|
8855
|
+
const DEFAULT_TRANSLATIONS$6 = {
|
|
8854
8856
|
closeButtonAriaLabel: "Cerrar notificación",
|
|
8855
8857
|
};
|
|
8856
8858
|
function GlobalToast({ translations = {} } = {}) {
|
|
8857
8859
|
const { toast, hideToast } = useAuraToast();
|
|
8858
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
8860
|
+
const t = { ...DEFAULT_TRANSLATIONS$6, ...translations };
|
|
8859
8861
|
if (!toast.isVisible) {
|
|
8860
8862
|
return null;
|
|
8861
8863
|
}
|
|
@@ -9205,7 +9207,7 @@ const AURORAS = [
|
|
|
9205
9207
|
duration: 55,
|
|
9206
9208
|
},
|
|
9207
9209
|
];
|
|
9208
|
-
const DEFAULT_TRANSLATIONS$
|
|
9210
|
+
const DEFAULT_TRANSLATIONS$5 = {
|
|
9209
9211
|
backButtonLabel: "Atras",
|
|
9210
9212
|
};
|
|
9211
9213
|
const BackButton = ({ onPress, visible = true, className = "", label }) => {
|
|
@@ -9237,7 +9239,7 @@ const AnimatedBackground = ({ className = "", }) => {
|
|
|
9237
9239
|
const TwoColumnLayoutAgent = ({ assistantState = "happy", assistantSpeech, assistantSize = "xl", assistantHint, enableSequence = true, children, showBackButton = false, onBack, translations = {}, className = "", }) => {
|
|
9238
9240
|
const [showRightContent, setShowRightContent] = useState(!enableSequence);
|
|
9239
9241
|
const isDesktop = useMediaQuery(`(min-width: ${DESKTOP_BREAKPOINT_PX}px)`);
|
|
9240
|
-
const t = useMemo(() => ({ ...DEFAULT_TRANSLATIONS$
|
|
9242
|
+
const t = useMemo(() => ({ ...DEFAULT_TRANSLATIONS$5, ...translations }), [translations]);
|
|
9241
9243
|
const handleBackPress = onBack ?? (() => undefined);
|
|
9242
9244
|
useEffect(() => {
|
|
9243
9245
|
if (enableSequence && !showRightContent) {
|
|
@@ -10052,7 +10054,7 @@ const ListMessageSheet = ({ action, onClose, onPick, translations, }) => {
|
|
|
10052
10054
|
const footerHint = action.listFooterHint ?? translations.listSelectHintDefault;
|
|
10053
10055
|
return (jsxs("div", { className: "absolute inset-0 z-40 flex flex-col justify-end pointer-events-auto", role: "presentation", children: [jsx("button", { type: "button", className: "absolute inset-0 z-40 bg-black/45 dark:bg-black/60 border-0 cursor-pointer p-0 m-0", onClick: onClose, "aria-label": translations.listCloseAriaLabel }), jsxs("div", { className: "relative z-50 mx-1 mb-1 rounded-2xl bg-white dark:bg-[#1f1f1f] shadow-2xl flex flex-col max-h-[min(52vh,420px)] overflow-hidden ring-1 ring-black/5 dark:ring-white/10", children: [jsxs("div", { className: "flex items-center justify-center relative shrink-0 px-10 pt-3 pb-2.5 border-b border-black/[0.08] dark:border-white/[0.12]", children: [jsx("span", { className: "text-[15px] font-semibold text-gray-900 dark:text-gray-100 text-center", children: headerTitle }), jsx("button", { type: "button", onClick: onClose, className: "absolute right-2 top-1.5 p-1.5 rounded-full text-gray-500 hover:bg-black/[0.06] dark:text-gray-400 dark:hover:bg-white/[0.08]", "aria-label": translations.listCloseAriaLabel, children: jsx(IconComponent, { icon: "solar:close-circle-bold", className: "text-current", size: "lg" }) })] }), jsx("div", { className: "overflow-y-auto flex-1 min-h-0", children: items.map((item, rowIndex) => (jsxs("button", { type: "button", onClick: () => onPick(item), className: "w-full text-left flex gap-3 px-4 py-3 border-t border-black/[0.06] dark:border-white/[0.08] first:border-t-0 hover:bg-black/[0.04] dark:hover:bg-white/[0.05] transition-colors", children: [item.emoji || item.icon ? (jsx("div", { className: "shrink-0 w-9 inline-flex items-center justify-center self-start", children: item.emoji ? (jsx("span", { className: "text-xl leading-none", "aria-hidden": true, children: item.emoji })) : item.icon ? (jsx("span", { className: "inline-flex h-6 w-6 items-center justify-center [&>span]:flex [&>span]:size-full [&>span]:items-center [&>span]:justify-center", children: jsx(IconComponent, { icon: item.icon, className: "text-gray-600 dark:text-gray-300 [&_svg]:block", size: "sm" }) })) : null })) : null, jsxs("div", { className: "min-w-0 flex-1", children: [jsx("p", { className: "text-[15px] font-semibold text-gray-900 dark:text-gray-100 leading-snug", children: item.title }), item.description ? (jsx("p", { className: "text-[13px] text-gray-600 dark:text-gray-400 mt-0.5 leading-snug", children: item.description })) : null] })] }, item.id ?? `${item.title}-${rowIndex}`))) }), footerHint ? (jsx("p", { className: "shrink-0 text-center text-[11px] text-gray-500 dark:text-gray-500 px-4 py-2.5 border-t border-black/[0.06] dark:border-white/[0.08]", children: footerHint })) : null] })] }));
|
|
10054
10056
|
};
|
|
10055
|
-
const DEFAULT_TRANSLATIONS$
|
|
10057
|
+
const DEFAULT_TRANSLATIONS$4 = {
|
|
10056
10058
|
businessName: "Tu Negocio",
|
|
10057
10059
|
businessInitials: "TN",
|
|
10058
10060
|
onlineStatus: "en linea",
|
|
@@ -10078,7 +10080,7 @@ const DEFAULT_TRANSLATIONS$3 = {
|
|
|
10078
10080
|
* ```
|
|
10079
10081
|
*/
|
|
10080
10082
|
const WhatsAppPreview = ({ imageUrl, caption, variant = "compact", showHeader = false, maxCaptionLength, onToggleCaption, showFullCaption = false, ctaType, ctaLabel, ctaValue, previewAction, campaignView = false, translations = {}, className = "", timeLocale = "es-ES", onListItemPick, }) => {
|
|
10081
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
10083
|
+
const t = { ...DEFAULT_TRANSLATIONS$4, ...translations };
|
|
10082
10084
|
const [openListSheetIndex, setOpenListSheetIndex] = useState(null);
|
|
10083
10085
|
const closeListSheet = useCallback(() => {
|
|
10084
10086
|
setOpenListSheetIndex(null);
|
|
@@ -11237,7 +11239,7 @@ const DrawerFilters = ({ isOpen, onOpenChange, config, onApplyFilters, onClearFi
|
|
|
11237
11239
|
};
|
|
11238
11240
|
DrawerFilters.displayName = "DrawerFilters";
|
|
11239
11241
|
|
|
11240
|
-
const DEFAULT_TRANSLATIONS$
|
|
11242
|
+
const DEFAULT_TRANSLATIONS$3 = {
|
|
11241
11243
|
subjectLabel: "Asunto",
|
|
11242
11244
|
fromLabel: "De",
|
|
11243
11245
|
toLabel: "Para",
|
|
@@ -11269,7 +11271,7 @@ const DEFAULT_TRANSLATIONS$2 = {
|
|
|
11269
11271
|
* ```
|
|
11270
11272
|
*/
|
|
11271
11273
|
const EmailPreview = ({ htmlContent, subject, from, to, iframeHeight = 480, translations = {}, className = "", showEmailHeader = true, deviceColor = "black", }) => {
|
|
11272
|
-
const t = { ...DEFAULT_TRANSLATIONS$
|
|
11274
|
+
const t = { ...DEFAULT_TRANSLATIONS$3, ...translations };
|
|
11273
11275
|
const displayFrom = from || t.fromEmail;
|
|
11274
11276
|
const displayTo = to || t.toEmail;
|
|
11275
11277
|
const deviceFrameColor = deviceColor === "white"
|
|
@@ -12239,7 +12241,7 @@ const DEFAULT_OPERATOR_LABELS = {
|
|
|
12239
12241
|
withinLastDays: "en los ultimos (dias)",
|
|
12240
12242
|
beforeDays: "hace mas de (dias)",
|
|
12241
12243
|
};
|
|
12242
|
-
const DEFAULT_TRANSLATIONS$
|
|
12244
|
+
const DEFAULT_TRANSLATIONS$2 = {
|
|
12243
12245
|
includeItemsText: "Incluir los que cumplan",
|
|
12244
12246
|
allConditionsLabel: "Y todas",
|
|
12245
12247
|
anyConditionLabel: "O alguna",
|
|
@@ -12412,7 +12414,7 @@ const ChipMultiSelect = ({ options, value, onChange, placeholder = "Seleccionar.
|
|
|
12412
12414
|
e.preventDefault();
|
|
12413
12415
|
toggleValue(opt.v);
|
|
12414
12416
|
}
|
|
12415
|
-
}, role: "option", "aria-selected": value.includes(opt.v), tabIndex: 0, children: jsxs(Checkbox, { isSelected: value.includes(opt.v), onChange: () => toggleValue(opt.v), children: [jsx(Checkbox.Control, { children: jsx(Checkbox.Indicator, {}) }), jsx(Checkbox.Content, { className: "text-sm", children: opt.l })] }) }, opt.v))) }), jsxs("div", { className: "px-3 py-1.5 text-xs text-default-400 border-t border-default-100", children: [value.length, " ", value.length === 1
|
|
12417
|
+
}, role: "option", "aria-selected": value.includes(opt.v), tabIndex: 0, children: jsxs(Checkbox$1, { isSelected: value.includes(opt.v), onChange: () => toggleValue(opt.v), children: [jsx(Checkbox$1.Control, { children: jsx(Checkbox$1.Indicator, {}) }), jsx(Checkbox$1.Content, { className: "text-sm", children: opt.l })] }) }, opt.v))) }), jsxs("div", { className: "px-3 py-1.5 text-xs text-default-400 border-t border-default-100", children: [value.length, " ", value.length === 1
|
|
12416
12418
|
? selectedCountSingular
|
|
12417
12419
|
: selectedCountPlural] })] }))] }));
|
|
12418
12420
|
};
|
|
@@ -12651,7 +12653,7 @@ const FilterSummary = ({ group, fieldMap, tagMap, translations: t, }) => {
|
|
|
12651
12653
|
// ─── Main Component ────────────────────────────────────────────────
|
|
12652
12654
|
const SegmentationBuilder = forwardRef(({ fields, tags = [], value, onChange, maxDepth = 5, showSummary = true, showJsonPreview = false, translations, className = "", isDisabled = false, }, ref) => {
|
|
12653
12655
|
const t = useMemo(() => ({
|
|
12654
|
-
...DEFAULT_TRANSLATIONS$
|
|
12656
|
+
...DEFAULT_TRANSLATIONS$2,
|
|
12655
12657
|
...translations,
|
|
12656
12658
|
operatorLabels: {
|
|
12657
12659
|
...DEFAULT_OPERATOR_LABELS,
|
|
@@ -12758,7 +12760,7 @@ const FIELD_ICON_CLASS = "pointer-events-none absolute end-0 top-1/2 flex h-full
|
|
|
12758
12760
|
const SEARCH_ICON = (jsx(IconComponent, { icon: "solar:magnifer-outline", className: "text-default-400 pointer-events-none shrink-0", size: "sm", "aria-hidden": true }));
|
|
12759
12761
|
const SENTINEL_KEY = "__tags-filter-sentinel__";
|
|
12760
12762
|
const EMPTY_KEY = "__tags-filter-empty__";
|
|
12761
|
-
const DEFAULT_TRANSLATIONS = {
|
|
12763
|
+
const DEFAULT_TRANSLATIONS$1 = {
|
|
12762
12764
|
placeholder: "Nombre de la etiqueta",
|
|
12763
12765
|
labelSelect: "Selecciona etiqueta",
|
|
12764
12766
|
labelSelected: "Etiquetas actuales",
|
|
@@ -12786,7 +12788,7 @@ const defaultGetTagKey = (tag) => tag.id ?? tag.value;
|
|
|
12786
12788
|
* Cumple con i18n mediante la prop `translations`.
|
|
12787
12789
|
*/
|
|
12788
12790
|
function TagsFilter({ items, value, onChange, translations = {}, error, isLoading = false, className = "", "aria-label": ariaLabel, required = false, compareTags = defaultCompareTags, getTagKey = defaultGetTagKey, onInputChange, hasMore = false, isLoadingMore = false, onLoadMore, loadMoreRootMargin = "0px", }) {
|
|
12789
|
-
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
12791
|
+
const t = { ...DEFAULT_TRANSLATIONS$1, ...translations };
|
|
12790
12792
|
const [inputValue, setInputValue] = useState("");
|
|
12791
12793
|
const [autocompleteKey, setAutocompleteKey] = useState(0);
|
|
12792
12794
|
const selectedList = value ?? [];
|
|
@@ -12938,7 +12940,7 @@ const createCurrencyFormatter = (locale, currency, fractionDigits = 0) => {
|
|
|
12938
12940
|
// v2 no tiene prop `radius` en el diálogo del modal: v3 tampoco (eliminada, "usar Tailwind"), así
|
|
12939
12941
|
// que se reimplementa vía className arbitrario — mismo criterio y mismos valores exactos que
|
|
12940
12942
|
// Button/Card de F3.0 (RADIUS_CLASS).
|
|
12941
|
-
const RADIUS_CLASS = {
|
|
12943
|
+
const RADIUS_CLASS$2 = {
|
|
12942
12944
|
none: "rounded-none",
|
|
12943
12945
|
sm: "rounded-[8px]",
|
|
12944
12946
|
md: "rounded-[12px]",
|
|
@@ -12980,7 +12982,7 @@ const ModalCloseContext = createContext(() => { });
|
|
|
12980
12982
|
* gestiona react-aria-components internamente (`ModalOverlay`/`Dialog`), sin código propio.
|
|
12981
12983
|
*/
|
|
12982
12984
|
const Modal = ({ isOpen, defaultOpen, onOpenChange, size = "md", radius = "lg", backdrop = "opaque", scrollBehavior = "normal", placement, isDismissable = true, isKeyboardDismissDisabled = false, hideCloseButton = false, className, children, }) => {
|
|
12983
|
-
return (jsx(Modal$1, { children: jsx(Modal$1.Backdrop, { isOpen: isOpen, defaultOpen: defaultOpen, onOpenChange: onOpenChange, variant: backdrop, isDismissable: isDismissable, isKeyboardDismissDisabled: isKeyboardDismissDisabled, children: jsx(Modal$1.Container, { size: SIZE_MAP[size], placement: placement, scroll: scrollBehavior === "inside" ? "inside" : undefined, className: className, children: jsx(Modal$1.Dialog, { className: cn(RADIUS_CLASS[radius], "px-6 py-9"), children: ({ close }) => (jsxs(ModalCloseContext.Provider, { value: close, children: [!hideCloseButton && jsx(Modal$1.CloseTrigger, {}), children] })) }) }) }) }));
|
|
12985
|
+
return (jsx(Modal$1, { children: jsx(Modal$1.Backdrop, { isOpen: isOpen, defaultOpen: defaultOpen, onOpenChange: onOpenChange, variant: backdrop, isDismissable: isDismissable, isKeyboardDismissDisabled: isKeyboardDismissDisabled, children: jsx(Modal$1.Container, { size: SIZE_MAP[size], placement: placement, scroll: scrollBehavior === "inside" ? "inside" : undefined, className: className, children: jsx(Modal$1.Dialog, { className: cn(RADIUS_CLASS$2[radius], "px-6 py-9"), children: ({ close }) => (jsxs(ModalCloseContext.Provider, { value: close, children: [!hideCloseButton && jsx(Modal$1.CloseTrigger, {}), children] })) }) }) }) }));
|
|
12984
12986
|
};
|
|
12985
12987
|
|
|
12986
12988
|
/**
|
|
@@ -13187,6 +13189,469 @@ ModalBody.displayName = "ModalBody";
|
|
|
13187
13189
|
const ModalFooter = ({ className, ...props }) => (jsx(ModalFooter$1, { ...props, className: cn("mt-0 px-6 py-4", className) }));
|
|
13188
13190
|
ModalFooter.displayName = "ModalFooter";
|
|
13189
13191
|
|
|
13192
|
+
// TECH-2459 — Fachada `Alert` (hallazgo loginos 07-sep: `index.tsx` reexportaba el `Alert` CRUDO de
|
|
13193
|
+
// v3 y solo shimeaba el TIPO `AlertProps` v2 → el JSX v2 compilaba pero el componente era v3).
|
|
13194
|
+
//
|
|
13195
|
+
// HeroUI v3 convierte el Alert en compound (`Alert.Indicator`/`Content`/`Title`/`Description`),
|
|
13196
|
+
// cambia `color` por `status` (`primary`→`accent`, `secondary`→`default`) y ELIMINA `variant`,
|
|
13197
|
+
// `radius`, `title`/`description`, `icon`/`hideIcon`/`hideIconWrapper`, `isClosable`/`onClose`,
|
|
13198
|
+
// `isVisible`/`onVisibleChange`, `startContent`/`endContent` y `classNames` (guía oficial
|
|
13199
|
+
// `alert`). Además `.alert` de v3 es SIEMPRE `bg-surface`: el fondo teñido por estado que daba
|
|
13200
|
+
// `variant="flat"` en v2 desapareció (`@heroui/styles/dist/components/alert.css:4`).
|
|
13201
|
+
//
|
|
13202
|
+
// Esta fachada compone el compound de v3 por dentro y repone cada prop v2 con los literales del
|
|
13203
|
+
// `tv` de v2 (`@heroui/theme@2.4.15` → `dist/components/alert.js`, leído, no deducido),
|
|
13204
|
+
// traducidos al vocabulario de Tailwind 4 sobre los tokens de Aurora (que emite toda la escala
|
|
13205
|
+
// 50-900, así que `bg-danger-50` sigue siendo una utilidad válida). Todo va como utilidades
|
|
13206
|
+
// (capa `utilities`), que ganan a las reglas de `alert.css` (capa `components`) — mismo mecanismo
|
|
13207
|
+
// que Badge/Card/Chip.
|
|
13208
|
+
//
|
|
13209
|
+
// ⚠️ Ni una clase v2 muerta (`text-small`, `rounded-medium`, `border-small`, `shadow-small`):
|
|
13210
|
+
// `cn` (tailwind-merge 3) las BORRA del DOM cuando compiten con otra del mismo prefijo (ver
|
|
13211
|
+
// skill `auraui-components`, "La trampa de las clases v2 muertas + cn").
|
|
13212
|
+
const DEFAULT_TRANSLATIONS = {
|
|
13213
|
+
closeButtonAriaLabel: "Cerrar",
|
|
13214
|
+
};
|
|
13215
|
+
/** `color` v2 → `status` v3 (tabla de la guía oficial de migración). */
|
|
13216
|
+
const STATUS_BY_COLOR = {
|
|
13217
|
+
default: "default",
|
|
13218
|
+
primary: "accent",
|
|
13219
|
+
secondary: "default",
|
|
13220
|
+
success: "success",
|
|
13221
|
+
warning: "warning",
|
|
13222
|
+
danger: "danger",
|
|
13223
|
+
};
|
|
13224
|
+
/** Inverso: si el consumidor pasa `status` (v3) sin `color`, las utilidades siguen ese color. */
|
|
13225
|
+
const COLOR_BY_STATUS = {
|
|
13226
|
+
default: "default",
|
|
13227
|
+
accent: "primary",
|
|
13228
|
+
success: "success",
|
|
13229
|
+
warning: "warning",
|
|
13230
|
+
danger: "danger",
|
|
13231
|
+
};
|
|
13232
|
+
// v3 usa `min(32px, var(--radius-3xl))`; v2 `radius="md"` = `rounded-medium` = 12px. Mismos
|
|
13233
|
+
// valores EXACTOS que Button/Card/Chip (los `rounded-md`/`lg` de Tailwind son 6/8px, no 12/14).
|
|
13234
|
+
const RADIUS_CLASS$1 = {
|
|
13235
|
+
none: "rounded-none",
|
|
13236
|
+
sm: "rounded-[8px]",
|
|
13237
|
+
md: "rounded-[12px]",
|
|
13238
|
+
lg: "rounded-[14px]",
|
|
13239
|
+
full: "rounded-full",
|
|
13240
|
+
};
|
|
13241
|
+
// ---------------------------------------------------------------------------------------------
|
|
13242
|
+
// Matriz variant × color — literales de v2 (`alert.js`, `compoundVariants`), por slot.
|
|
13243
|
+
// ---------------------------------------------------------------------------------------------
|
|
13244
|
+
/**
|
|
13245
|
+
* `flat` (y base de `faded`): `colorVariants.flat.<color>` + `bg-<color>-50 dark:bg-<color>-50/50`.
|
|
13246
|
+
* El `bg-<color>/20` de `colorVariants.flat` lo pisaba el `bg-<color>-50` posterior (tailwind-merge
|
|
13247
|
+
* dentro del `tv` de v2), así que el fondo REAL era el paso 50 — que es lo que se repone aquí.
|
|
13248
|
+
*/
|
|
13249
|
+
const FLAT_BASE = {
|
|
13250
|
+
default: "bg-default-100 text-default-foreground dark:bg-default-50/50",
|
|
13251
|
+
primary: "bg-primary-50 text-primary-600 dark:bg-primary-50/50",
|
|
13252
|
+
secondary: "bg-secondary-50 text-secondary-600 dark:bg-secondary-50/50",
|
|
13253
|
+
success: "bg-success-50 text-success-700 dark:bg-success-50/50 dark:text-success",
|
|
13254
|
+
warning: "bg-warning-50 text-warning-700 dark:bg-warning-50/50 dark:text-warning",
|
|
13255
|
+
danger: "bg-danger-50 text-danger-600 dark:bg-danger-50/50 dark:text-danger-500",
|
|
13256
|
+
};
|
|
13257
|
+
/** `faded` = `flat` + `border-small` (1px) con este color de borde. */
|
|
13258
|
+
const FADED_BORDER = {
|
|
13259
|
+
default: "border-default-300 dark:border-default-200",
|
|
13260
|
+
primary: "border-primary-200 dark:border-primary-100",
|
|
13261
|
+
secondary: "border-secondary-200",
|
|
13262
|
+
success: "border-success-300 dark:border-success-100",
|
|
13263
|
+
warning: "border-warning-300 dark:border-warning-100",
|
|
13264
|
+
danger: "border-danger-200 dark:border-danger-100",
|
|
13265
|
+
};
|
|
13266
|
+
/** `bordered`: `colorVariants.bordered.<color>` (+ `border-small`, sin fondo). */
|
|
13267
|
+
const BORDERED_BASE = {
|
|
13268
|
+
default: "bg-transparent border-default text-foreground",
|
|
13269
|
+
primary: "bg-transparent border-primary text-primary",
|
|
13270
|
+
secondary: "bg-transparent border-secondary text-secondary",
|
|
13271
|
+
success: "bg-transparent border-success text-success",
|
|
13272
|
+
warning: "bg-transparent border-warning text-warning",
|
|
13273
|
+
danger: "bg-transparent border-danger text-danger",
|
|
13274
|
+
};
|
|
13275
|
+
/** `solid`: `colorVariants.solid.<color>`. `default` usa el gris de Aurora (`--color-default`). */
|
|
13276
|
+
const SOLID_BASE = {
|
|
13277
|
+
default: "bg-default text-default-foreground",
|
|
13278
|
+
primary: "bg-primary text-primary-foreground",
|
|
13279
|
+
secondary: "bg-secondary text-secondary-foreground",
|
|
13280
|
+
success: "bg-success text-success-foreground",
|
|
13281
|
+
warning: "bg-warning text-warning-foreground",
|
|
13282
|
+
danger: "bg-danger text-danger-foreground",
|
|
13283
|
+
};
|
|
13284
|
+
/**
|
|
13285
|
+
* Círculo del icono (slot `iconWrapper` de v2). `flat`/`faded`: `bg-<color>-50 dark:bg-<color>-100
|
|
13286
|
+
* border-<color>-100` (+ `border-1 shadow-small`, ver `ICON_WRAPPER_TINTED`); `bordered`:
|
|
13287
|
+
* `bg-<color>-100 dark:bg-<color>-50` (+ `shadow-small`); `solid`: sin fondo.
|
|
13288
|
+
*/
|
|
13289
|
+
const FLAT_ICON_WRAPPER = {
|
|
13290
|
+
default: "bg-default-50 border-default-200 dark:bg-default-100",
|
|
13291
|
+
primary: "bg-primary-50 border-primary-100 dark:bg-primary-100",
|
|
13292
|
+
secondary: "bg-secondary-50 border-secondary-100 dark:bg-secondary-100",
|
|
13293
|
+
success: "bg-success-50 border-success-100 dark:bg-success-100",
|
|
13294
|
+
warning: "bg-warning-50 border-warning-100 dark:bg-warning-100",
|
|
13295
|
+
danger: "bg-danger-50 border-danger-100 dark:bg-danger-100",
|
|
13296
|
+
};
|
|
13297
|
+
const BORDERED_ICON_WRAPPER = {
|
|
13298
|
+
default: "bg-default-200 dark:bg-default-100",
|
|
13299
|
+
primary: "bg-primary-100 dark:bg-primary-50",
|
|
13300
|
+
secondary: "bg-secondary-100 dark:bg-secondary-50",
|
|
13301
|
+
success: "bg-success-100 dark:bg-success-50",
|
|
13302
|
+
warning: "bg-warning-100 dark:bg-warning-50",
|
|
13303
|
+
danger: "bg-danger-100 dark:bg-danger-50",
|
|
13304
|
+
};
|
|
13305
|
+
/**
|
|
13306
|
+
* La `x` (slot `closeButton` de v2): `text-<color>-500 data-[hover]:bg-<color>-200` en
|
|
13307
|
+
* `flat`/`faded`; `data-[hover]:bg-<color>-50` en `bordered` (texto heredado del alert);
|
|
13308
|
+
* `data-[hover]:bg-default-100` en `solid default`. En `solid` de color el botón de v2 era un
|
|
13309
|
+
* `Button variant="light"` sin color: hover `bg-default/40`.
|
|
13310
|
+
*
|
|
13311
|
+
* `hover:` y no `data-[hover=true]:` — react-aria emite `data-hovered`, y `:hover` cubre igual el
|
|
13312
|
+
* ratón (trampa 3 de la skill). `bg-transparent` anula el `bg-default` de `.close-button--default`
|
|
13313
|
+
* de v3, que sobre un fondo teñido canta como una píldora gris (mismo arreglo que GlobalToast).
|
|
13314
|
+
*/
|
|
13315
|
+
const FLAT_CLOSE = {
|
|
13316
|
+
default: "text-default-400 hover:bg-default-200",
|
|
13317
|
+
primary: "text-primary-500 hover:bg-primary-200",
|
|
13318
|
+
secondary: "text-secondary-500 hover:bg-secondary-200",
|
|
13319
|
+
success: "text-success-500 hover:bg-success-200",
|
|
13320
|
+
warning: "text-warning-500 hover:bg-warning-200",
|
|
13321
|
+
danger: "text-danger-500 hover:bg-danger-200",
|
|
13322
|
+
};
|
|
13323
|
+
const BORDERED_CLOSE = {
|
|
13324
|
+
default: "text-default-400 hover:bg-default-100",
|
|
13325
|
+
primary: "text-inherit hover:bg-primary-50",
|
|
13326
|
+
secondary: "text-inherit hover:bg-secondary-50",
|
|
13327
|
+
success: "text-inherit hover:bg-success-50",
|
|
13328
|
+
warning: "text-inherit hover:bg-warning-100",
|
|
13329
|
+
danger: "text-inherit hover:bg-danger-50",
|
|
13330
|
+
};
|
|
13331
|
+
const SOLID_CLOSE = {
|
|
13332
|
+
default: "text-inherit hover:bg-default-100",
|
|
13333
|
+
primary: "text-inherit hover:bg-default/40",
|
|
13334
|
+
secondary: "text-inherit hover:bg-default/40",
|
|
13335
|
+
success: "text-inherit hover:bg-default/40",
|
|
13336
|
+
warning: "text-inherit hover:bg-default/40",
|
|
13337
|
+
danger: "text-inherit hover:bg-default/40",
|
|
13338
|
+
};
|
|
13339
|
+
// Base v2 del círculo del icono: `flex-none relative w-9 h-9 rounded-full grid place-items-center`
|
|
13340
|
+
// + `alertIcon: fill-current w-6` (24px). v3 (`.alert__indicator`): `flex items-center
|
|
13341
|
+
// justify-center p-1`, con el icono por defecto a `size-4` (16px) — se repone el tamaño de v2.
|
|
13342
|
+
// `text-inherit`: `.alert--<status> .alert__indicator` de v3 pinta el icono con
|
|
13343
|
+
// `--<status>-soft-foreground`, que sobre un `solid` sería rojo sobre rojo.
|
|
13344
|
+
const ICON_WRAPPER_BASE = "relative size-9 shrink-0 rounded-full p-0 text-inherit [&_svg]:size-6 [&_svg]:fill-current";
|
|
13345
|
+
/** `flat`/`bordered`/`faded`: `shadow-small`; `flat`/`faded` además `border-1`. */
|
|
13346
|
+
const ICON_WRAPPER_SHADOW = "shadow-[var(--aurora-shadow-small)]";
|
|
13347
|
+
const ICON_WRAPPER_TINTED = `${ICON_WRAPPER_SHADOW} border`;
|
|
13348
|
+
// Base v2 del botón de cierre: `Button isIconOnly size="sm" radius="full" variant="light"` (32px,
|
|
13349
|
+
// icono de 20px) + slot `relative text-inherit translate-x-1 -translate-y-1`. v3
|
|
13350
|
+
// (`.close-button`): 24px, `rounded-xl`, svg a 16px con `-mx-0.5 my-0.5`.
|
|
13351
|
+
const CLOSE_BASE = "relative size-8 min-w-8 shrink-0 translate-x-1 -translate-y-1 rounded-full bg-transparent p-0 [&_svg]:m-0 [&_svg]:size-5";
|
|
13352
|
+
function slotClasses(variant, color) {
|
|
13353
|
+
// v2: `description: text-default-600` solo para `default` en flat/faded/bordered; el resto
|
|
13354
|
+
// heredaba el color del base (`text-inherit`).
|
|
13355
|
+
const defaultDescription = color === "default" ? "text-default-600" : "";
|
|
13356
|
+
switch (variant) {
|
|
13357
|
+
case "solid":
|
|
13358
|
+
return {
|
|
13359
|
+
base: SOLID_BASE[color],
|
|
13360
|
+
description: "",
|
|
13361
|
+
iconWrapper: "",
|
|
13362
|
+
closeButton: SOLID_CLOSE[color],
|
|
13363
|
+
};
|
|
13364
|
+
case "bordered":
|
|
13365
|
+
return {
|
|
13366
|
+
base: `border ${BORDERED_BASE[color]}`,
|
|
13367
|
+
description: defaultDescription,
|
|
13368
|
+
iconWrapper: `${ICON_WRAPPER_SHADOW} ${BORDERED_ICON_WRAPPER[color]}`,
|
|
13369
|
+
closeButton: BORDERED_CLOSE[color],
|
|
13370
|
+
};
|
|
13371
|
+
case "faded":
|
|
13372
|
+
return {
|
|
13373
|
+
base: `border ${FLAT_BASE[color]} ${FADED_BORDER[color]}`,
|
|
13374
|
+
description: defaultDescription,
|
|
13375
|
+
iconWrapper: `${ICON_WRAPPER_TINTED} ${FLAT_ICON_WRAPPER[color]}`,
|
|
13376
|
+
closeButton: FLAT_CLOSE[color],
|
|
13377
|
+
};
|
|
13378
|
+
default:
|
|
13379
|
+
return {
|
|
13380
|
+
base: FLAT_BASE[color],
|
|
13381
|
+
description: defaultDescription,
|
|
13382
|
+
iconWrapper: `${ICON_WRAPPER_TINTED} ${FLAT_ICON_WRAPPER[color]}`,
|
|
13383
|
+
closeButton: FLAT_CLOSE[color],
|
|
13384
|
+
};
|
|
13385
|
+
}
|
|
13386
|
+
}
|
|
13387
|
+
// Los subcomponentes compound de v3, adjuntos como estáticos (`Alert.Indicator`…) para que el JSX
|
|
13388
|
+
// v3 (loginos ya migró el suyo) siga compilando y renderizando IGUAL que contra el `Alert` crudo.
|
|
13389
|
+
const COMPOUND_PARTS$1 = new Set([
|
|
13390
|
+
Alert$1.Indicator,
|
|
13391
|
+
Alert$1.Content,
|
|
13392
|
+
Alert$1.Title,
|
|
13393
|
+
Alert$1.Description,
|
|
13394
|
+
]);
|
|
13395
|
+
/**
|
|
13396
|
+
* Detecta la API compound de v3: si algún hijo directo es `Alert.Indicator`/`Content`/`Title`/
|
|
13397
|
+
* `Description`, el consumidor ya compone la estructura y la fachada NO debe envolver nada (si lo
|
|
13398
|
+
* hiciera, saldrían dos indicadores). `<Alert>Texto</Alert>` (sin partes compound) sigue siendo
|
|
13399
|
+
* API v2: children bajo la descripción, con icono y círculo, como en v2.
|
|
13400
|
+
*/
|
|
13401
|
+
function hasCompoundChildren$1(children) {
|
|
13402
|
+
return Children.toArray(children).some((child) => isValidElement(child) && COMPOUND_PARTS$1.has(child.type));
|
|
13403
|
+
}
|
|
13404
|
+
/** `isEmpty` de v2 (`@heroui/shared-utils`): null/undefined/"" no cuentan como contenido. */
|
|
13405
|
+
function hasValue(node) {
|
|
13406
|
+
return node !== null && node !== undefined && node !== "" && node !== false;
|
|
13407
|
+
}
|
|
13408
|
+
/**
|
|
13409
|
+
* Alert - Aviso contextual basado en HeroUI v3 con la API pública de v2 intacta (TECH-2459).
|
|
13410
|
+
*
|
|
13411
|
+
* Dos modos, decididos por los `children`:
|
|
13412
|
+
* - **API v2** (`color`/`variant`/`title`/`description`/`isClosable`…): la fachada compone el
|
|
13413
|
+
* compound de v3 y repone `variant` (fondo teñido en `flat`), `radius`, el círculo del icono,
|
|
13414
|
+
* el botón de cerrar (`CloseButton` de v3 con `aria-label` traducido) y la visibilidad.
|
|
13415
|
+
* - **API compound v3** (`<Alert status="danger"><Alert.Indicator/><Alert.Content>…`): pasa tal
|
|
13416
|
+
* cual al `Alert` de HeroUI; `color`, si viene, se traduce a `status`.
|
|
13417
|
+
*/
|
|
13418
|
+
const AlertFacade = ({ color, status, variant = "flat", radius = "md", title, description, icon, hideIcon = false, hideIconWrapper = false, isClosable = false, onClose, isVisible: isVisibleProp, isDefaultVisible, onVisibleChange, startContent, endContent, classNames, className, children, translations = {}, ...rest }) => {
|
|
13419
|
+
// `useControlledState` de v2 (`use-alert.ts`): controlado si llega `isVisible`; si no, estado
|
|
13420
|
+
// propio que arranca en `isDefaultVisible ?? true` y se apaga al cerrar.
|
|
13421
|
+
const [uncontrolledVisible, setUncontrolledVisible] = useState(isDefaultVisible ?? true);
|
|
13422
|
+
const isControlled = isVisibleProp !== undefined;
|
|
13423
|
+
const isVisible = isControlled ? isVisibleProp : uncontrolledVisible;
|
|
13424
|
+
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
13425
|
+
// `status` (v3) gana sobre `color` (v2) para la clase de estado de HeroUI; y si SOLO llega
|
|
13426
|
+
// `status`, las utilidades de Aurora siguen el color equivalente (`accent` → `primary`).
|
|
13427
|
+
const effectiveColor = color ?? (status ? COLOR_BY_STATUS[status] : "default");
|
|
13428
|
+
const effectiveStatus = status ?? STATUS_BY_COLOR[effectiveColor];
|
|
13429
|
+
if (!isVisible) {
|
|
13430
|
+
return null;
|
|
13431
|
+
}
|
|
13432
|
+
if (hasCompoundChildren$1(children)) {
|
|
13433
|
+
return (jsx(Alert$1, { ...rest, status: effectiveStatus, className: cn(classNames?.base, className), children: children }));
|
|
13434
|
+
}
|
|
13435
|
+
const handleClose = () => {
|
|
13436
|
+
if (!isControlled) {
|
|
13437
|
+
setUncontrolledVisible(false);
|
|
13438
|
+
}
|
|
13439
|
+
onVisibleChange?.(false);
|
|
13440
|
+
onClose?.();
|
|
13441
|
+
};
|
|
13442
|
+
const slots = slotClasses(variant, effectiveColor);
|
|
13443
|
+
const hasTitle = hasValue(title);
|
|
13444
|
+
const hasDescription = hasValue(description);
|
|
13445
|
+
// `hasContent` de v2: sin descripción ni children, el título se centra verticalmente con el icono.
|
|
13446
|
+
const hasContent = hasDescription || hasValue(children);
|
|
13447
|
+
const showClose = isClosable || Boolean(onClose);
|
|
13448
|
+
return (jsxs(Alert$1, { role: "alert", "data-visible": "true", "data-closeable": showClose ? "true" : undefined, "data-has-title": hasTitle ? "true" : undefined, "data-has-description": hasDescription ? "true" : undefined, ...rest, status: effectiveStatus,
|
|
13449
|
+
// Base v2: `flex flex-grow flex-row w-full items-start py-3 px-4 gap-x-1`. v3 ya trae
|
|
13450
|
+
// flex/w-full/items-start/px-4/py-3; se repone el `gap-x-1` (v3: `gap-4`), se quita el
|
|
13451
|
+
// `shadow-surface` (v2 no tenía sombra en el base) y se aplica variant/radius.
|
|
13452
|
+
className: cn("grow gap-x-1 shadow-none", slots.base, RADIUS_CLASS$1[radius], hideIconWrapper && "gap-x-0", classNames?.base, className), children: [startContent, !hideIcon && (jsx(Alert$1.Indicator, { className: cn(ICON_WRAPPER_BASE,
|
|
13453
|
+
// v2 `hideIconWrapper`: `!bg-transparent !shadow-none !border-none` — se omiten
|
|
13454
|
+
// las clases teñidas en vez de pisarlas, porque `bg-transparent` no borraría el
|
|
13455
|
+
// `dark:bg-*` (grupo distinto para tailwind-merge).
|
|
13456
|
+
hideIconWrapper ? "bg-transparent" : slots.iconWrapper, classNames?.iconWrapper), children: icon !== undefined && icon !== null ? (classNames?.alertIcon ? (
|
|
13457
|
+
// `alertIcon` de v2 se aplicaba al propio SVG; aquí solo alcanza al icono
|
|
13458
|
+
// personalizado (el de v3 por defecto se renderiza dentro del indicador).
|
|
13459
|
+
jsx("span", { className: classNames.alertIcon, children: icon })) : (icon)) : undefined })), jsxs(Alert$1.Content, { className: cn("ms-2 box-border min-h-10 justify-center text-inherit", !hasContent && "items-center", classNames?.mainWrapper), children: [hasTitle && (
|
|
13460
|
+
// v2: `text-small w-full font-medium block text-inherit leading-5`; v3 (`.alert__title`)
|
|
13461
|
+
// pone `leading-6` y el color del estado — `text-inherit` devuelve el de v2.
|
|
13462
|
+
jsx(Alert$1.Title, { className: cn("w-full leading-5 text-inherit", classNames?.title), children: title })), hasDescription && (
|
|
13463
|
+
// v2: `pl-[1px] text-small font-normal text-inherit`; v3 (`.alert__description`) pone
|
|
13464
|
+
// `text-muted`.
|
|
13465
|
+
jsx(Alert$1.Description, { className: cn("pl-px font-normal text-inherit", slots.description, classNames?.description), children: description })), children] }), endContent, showClose && (jsx(CloseButton, { "aria-label": t.closeButtonAriaLabel, className: cn(CLOSE_BASE, slots.closeButton, classNames?.closeButton), onPress: handleClose }))] }));
|
|
13466
|
+
};
|
|
13467
|
+
AlertFacade.displayName = "Aurora.Alert";
|
|
13468
|
+
/**
|
|
13469
|
+
* `Alert` de Aurora: fachada v2 + estáticos compound de v3 (`Alert.Indicator`, `Alert.Content`,
|
|
13470
|
+
* `Alert.Title`, `Alert.Description`), los mismos objetos que exporta `@heroui/react`.
|
|
13471
|
+
*/
|
|
13472
|
+
const Alert = Object.assign(AlertFacade, {
|
|
13473
|
+
Indicator: Alert$1.Indicator,
|
|
13474
|
+
Content: Alert$1.Content,
|
|
13475
|
+
Title: Alert$1.Title,
|
|
13476
|
+
Description: Alert$1.Description,
|
|
13477
|
+
});
|
|
13478
|
+
|
|
13479
|
+
// TECH-2459 — Fachada `Checkbox` (hallazgo loginos 07-sep: `index.tsx` reexportaba el `Checkbox`
|
|
13480
|
+
// CRUDO de v3, así que el JSX v2 de las apps — `isSelected` + `onValueChange` dentro de `Controller`
|
|
13481
|
+
// de RHF en backoffice ×12, smbs ×23, agency ×5 — no compilaba pese a existir el símbolo).
|
|
13482
|
+
//
|
|
13483
|
+
// HeroUI v3 convierte el Checkbox en compound (`Checkbox.Content` > `Checkbox.Control` >
|
|
13484
|
+
// `Checkbox.Indicator` + la etiqueta como children de `Content`), renombra `onValueChange` →
|
|
13485
|
+
// `onChange` y ELIMINA `color`, `size`, `radius`, `lineThrough`, `icon`, `classNames` y
|
|
13486
|
+
// `disableAnimation` (guía oficial `checkbox`). Su único eje propio es `variant`
|
|
13487
|
+
// (`primary`/`secondary`), que NO es un color: `secondary` es un tratamiento gris de menor énfasis
|
|
13488
|
+
// — el falso amigo de siempre (skill `auraui-design-tokens`).
|
|
13489
|
+
//
|
|
13490
|
+
// Esta fachada compone el compound por dentro y repone cada prop v2 con los literales del `tv`
|
|
13491
|
+
// de v2 (`@heroui/theme@2.4.15` → `dist/components/checkbox.js`), traducidos a utilidades de
|
|
13492
|
+
// Tailwind 4 sobre los tokens de Aurora. El relleno del estado marcado en v3 es el `::before` del
|
|
13493
|
+
// control (`bg-accent`, = `--color-primary` vía F1), así que `color` se reimplementa pisando ese
|
|
13494
|
+
// pseudo-elemento con `before:bg-<color>` — utilidad (capa `utilities`) que gana a la regla de
|
|
13495
|
+
// `checkbox.css` (capa `components`), incluida la de hover (`bg-accent-hover`).
|
|
13496
|
+
//
|
|
13497
|
+
// ⚠️ Estados de react-aria, verificados en el navegador contra `checkbox.css`: `data-selected`/
|
|
13498
|
+
// `data-indeterminate`/`data-invalid`/`data-disabled` viven en la RAÍZ (`.checkbox`);
|
|
13499
|
+
// `data-hovered`/`data-pressed`/`data-focus-visible` en `[data-slot="checkbox-content"]`. Por
|
|
13500
|
+
// eso hay dos grupos con nombre (`group/checkbox`, `group/content`) y NUNCA `data-[hover=true]`
|
|
13501
|
+
// (trampa 3 de la skill: v2 escribía `data-hover`; react-aria escribe `data-hovered`).
|
|
13502
|
+
/**
|
|
13503
|
+
* Relleno del estado marcado (`::before` del control) y del indeterminado (fondo del control)
|
|
13504
|
+
* por color. `primary` no pisa nada: el `bg-accent` de v3 YA es `--color-primary`. `default`
|
|
13505
|
+
* usa el gris de Aurora (`--color-default`, = v2), nunca el `--default` crudo de v3 (D-F1-3).
|
|
13506
|
+
*
|
|
13507
|
+
* Literal v2: `after:bg-<color> after:text-<color>-foreground text-<color>-foreground`.
|
|
13508
|
+
*/
|
|
13509
|
+
const CONTROL_COLOR = {
|
|
13510
|
+
primary: "",
|
|
13511
|
+
default: "before:bg-default group-data-[indeterminate=true]/checkbox:bg-default",
|
|
13512
|
+
secondary: "before:bg-secondary group-data-[indeterminate=true]/checkbox:bg-secondary",
|
|
13513
|
+
success: "before:bg-success group-data-[indeterminate=true]/checkbox:bg-success",
|
|
13514
|
+
warning: "before:bg-warning group-data-[indeterminate=true]/checkbox:bg-warning",
|
|
13515
|
+
danger: "before:bg-danger group-data-[indeterminate=true]/checkbox:bg-danger",
|
|
13516
|
+
};
|
|
13517
|
+
/**
|
|
13518
|
+
* Color del glifo (check / línea). v3 lo fija en el SVG (`[data-slot="checkbox-default-indicator--
|
|
13519
|
+
* checkmark"] { text-accent-foreground }`), así que hay que alcanzar al SVG, no al indicador.
|
|
13520
|
+
*/
|
|
13521
|
+
const INDICATOR_COLOR = {
|
|
13522
|
+
primary: "",
|
|
13523
|
+
default: "[&_svg]:text-default-foreground",
|
|
13524
|
+
secondary: "[&_svg]:text-secondary-foreground",
|
|
13525
|
+
success: "[&_svg]:text-success-foreground",
|
|
13526
|
+
warning: "[&_svg]:text-warning-foreground",
|
|
13527
|
+
danger: "[&_svg]:text-danger-foreground",
|
|
13528
|
+
};
|
|
13529
|
+
// v2 (`checkbox.js`, variante `size`): wrapper `w-4/w-5/w-6` (16/20/24px), label
|
|
13530
|
+
// `text-small/medium/large`, icon `w-3 h-2` / `w-4 h-3` / `w-5 h-4`. v3: control `size-4`, glifo
|
|
13531
|
+
// `size-2.5`, texto `text-sm`, para todos.
|
|
13532
|
+
const CONTROL_SIZE = {
|
|
13533
|
+
sm: "size-4",
|
|
13534
|
+
md: "size-5",
|
|
13535
|
+
lg: "size-6",
|
|
13536
|
+
};
|
|
13537
|
+
const INDICATOR_SIZE = {
|
|
13538
|
+
sm: "size-3 [&_svg]:size-2.5",
|
|
13539
|
+
md: "size-3.5 [&_svg]:size-3",
|
|
13540
|
+
lg: "size-4 [&_svg]:size-3.5",
|
|
13541
|
+
};
|
|
13542
|
+
const LABEL_SIZE = {
|
|
13543
|
+
sm: "text-sm",
|
|
13544
|
+
md: "text-base",
|
|
13545
|
+
lg: "text-lg",
|
|
13546
|
+
};
|
|
13547
|
+
// v2: `rounded-[calc(theme(borderRadius.medium)*K)]` con `medium` = 12px → 6 / 7.2 / 8.4 px, y por
|
|
13548
|
+
// defecto el radio lo decidía `size` (sm→0.5, md→0.6, lg→0.7). El `::before` (relleno) lleva el
|
|
13549
|
+
// mismo radio porque aquí cubre el border-box completo (ver `CONTROL_BASE`).
|
|
13550
|
+
const RADIUS_CLASS = {
|
|
13551
|
+
none: "rounded-none before:rounded-none",
|
|
13552
|
+
sm: "rounded-[6px] before:rounded-[6px]",
|
|
13553
|
+
md: "rounded-[7.2px] before:rounded-[7.2px]",
|
|
13554
|
+
lg: "rounded-[8.4px] before:rounded-[8.4px]",
|
|
13555
|
+
full: "rounded-full before:rounded-full",
|
|
13556
|
+
};
|
|
13557
|
+
const RADIUS_BY_SIZE = {
|
|
13558
|
+
sm: "sm",
|
|
13559
|
+
md: "md",
|
|
13560
|
+
lg: "lg",
|
|
13561
|
+
};
|
|
13562
|
+
/**
|
|
13563
|
+
* Caja del control (slot `wrapper` de v2): borde de 2px en `--color-default` sin sombra
|
|
13564
|
+
* (`before:border-2 before:border-default`), y el relleno cubriendo la caja ENTERA al marcarse.
|
|
13565
|
+
*
|
|
13566
|
+
* En v3 el borde vive en el propio control (1px, `border-field-border`, `shadow-field`) y el
|
|
13567
|
+
* relleno es un `::before` a `inset-0`, que solo alcanza al padding-box: por eso v3 pone
|
|
13568
|
+
* `border-transparent` al marcarse y el relleno queda 1px por dentro. Con el borde de 2px de v2
|
|
13569
|
+
* eso dejaría un anillo de 2px: se lleva el `::before` al border-box (`-inset-0.5` = −2px) y se
|
|
13570
|
+
* quita el `overflow-hidden` de v3 para que no lo recorte. El `::before` es un descendiente
|
|
13571
|
+
* posicionado, así que pinta ENCIMA del borde y lo tapa, como el `after` de v2.
|
|
13572
|
+
*
|
|
13573
|
+
* Hover v2: `group-data-[hover=true]:before:bg-default-100` — tinte suave de la caja sin marcar
|
|
13574
|
+
* (en v3 la caja es el fondo del control, no un pseudo). `data-hovered` lo emite `Checkbox.Content`.
|
|
13575
|
+
*
|
|
13576
|
+
* Indeterminado: v3 pinta el fondo del control (dentro del borde). Se enciende también el
|
|
13577
|
+
* `::before` para que el relleno cubra la caja entera, igual que al marcar.
|
|
13578
|
+
*/
|
|
13579
|
+
const CONTROL_BASE = [
|
|
13580
|
+
"border-2 border-default shadow-none overflow-visible",
|
|
13581
|
+
"before:-inset-0.5",
|
|
13582
|
+
"group-data-[hovered=true]/content:bg-default-100",
|
|
13583
|
+
"group-data-[indeterminate=true]/checkbox:before:scale-100",
|
|
13584
|
+
"group-data-[indeterminate=true]/checkbox:before:opacity-100",
|
|
13585
|
+
].join(" ");
|
|
13586
|
+
// v2 (`lineThrough: true`, slot `label`): la raya crece de 0 al 100% al marcarse y la etiqueta se
|
|
13587
|
+
// atenúa al 60%. `data-selected` está en la raíz → `group-data-[…]/checkbox`.
|
|
13588
|
+
const LINE_THROUGH = [
|
|
13589
|
+
"inline-flex items-center justify-center",
|
|
13590
|
+
"before:absolute before:h-0.5 before:w-0 before:bg-foreground before:content-['']",
|
|
13591
|
+
"group-data-[selected=true]/checkbox:opacity-60",
|
|
13592
|
+
"group-data-[selected=true]/checkbox:before:w-full",
|
|
13593
|
+
].join(" ");
|
|
13594
|
+
// Los subcomponentes compound de v3, adjuntos como estáticos para que la API v3 siga funcionando
|
|
13595
|
+
// a través de la fachada (`<Checkbox><Checkbox.Control>…`).
|
|
13596
|
+
const COMPOUND_PARTS = new Set([
|
|
13597
|
+
Checkbox$1.Control,
|
|
13598
|
+
Checkbox$1.Indicator,
|
|
13599
|
+
Checkbox$1.Content,
|
|
13600
|
+
]);
|
|
13601
|
+
/** API compound de v3 detectada por hijos directos: la fachada no envuelve nada. */
|
|
13602
|
+
function hasCompoundChildren(children) {
|
|
13603
|
+
return Children.toArray(children).some((child) => isValidElement(child) && COMPOUND_PARTS.has(child.type));
|
|
13604
|
+
}
|
|
13605
|
+
/**
|
|
13606
|
+
* Checkbox - Casilla basada en HeroUI v3 con la API pública de v2 intacta (TECH-2459).
|
|
13607
|
+
*
|
|
13608
|
+
* - **API v2**: `children` como etiqueta, `isSelected`/`defaultSelected` + `onValueChange`
|
|
13609
|
+
* (también `onChange`), `color`, `size`, `radius`, `lineThrough`, `icon`, `classNames`. Funciona
|
|
13610
|
+
* dentro de `Controller` de react-hook-form (`isSelected={value} onValueChange={onChange}`).
|
|
13611
|
+
* - **API compound v3**: si los children traen `Checkbox.Control`/`Indicator`/`Content`, pasa tal
|
|
13612
|
+
* cual a la raíz de HeroUI (con `onValueChange` seguido igualmente).
|
|
13613
|
+
*/
|
|
13614
|
+
const CheckboxFacade = ({ children, onChange, onValueChange, color = "primary", size = "md", radius, lineThrough = false, icon, disableAnimation = false, isInvalid, classNames, className, ...rest }) => {
|
|
13615
|
+
const handleChange = (isSelected) => {
|
|
13616
|
+
onChange?.(isSelected);
|
|
13617
|
+
onValueChange?.(isSelected);
|
|
13618
|
+
};
|
|
13619
|
+
if (hasCompoundChildren(children)) {
|
|
13620
|
+
return (jsx(Checkbox$1, { ...rest, isInvalid: isInvalid, onChange: handleChange, className: cn(classNames?.base, className), children: children }));
|
|
13621
|
+
}
|
|
13622
|
+
const indicatorContent = typeof icon === "function"
|
|
13623
|
+
? (state) => icon({
|
|
13624
|
+
isSelected: state.isSelected,
|
|
13625
|
+
isIndeterminate: state.isIndeterminate,
|
|
13626
|
+
isDisabled: state.isDisabled,
|
|
13627
|
+
})
|
|
13628
|
+
: icon;
|
|
13629
|
+
const hasLabel = children !== undefined && children !== null && children !== false;
|
|
13630
|
+
return (jsx(Checkbox$1, { ...rest, isInvalid: isInvalid, onChange: handleChange,
|
|
13631
|
+
// Base v2: `group relative max-w-fit inline-flex items-center justify-start cursor-pointer
|
|
13632
|
+
// p-2 -m-2 select-none` (el `p-2 -m-2` es el área de pulsado ampliada de v2). v3
|
|
13633
|
+
// (`.checkbox`) usa `flex flex-col items-start` para apilar `Description`/`FieldError`,
|
|
13634
|
+
// slots que esta fachada no renderiza; en **inline** la caja participa de la línea de
|
|
13635
|
+
// texto, donde la esperan los consumidores (mismo criterio que la fachada `Switch`).
|
|
13636
|
+
className: cn("group/checkbox relative -m-2 inline-flex max-w-fit flex-row items-center p-2", classNames?.base, className), children: jsxs(Checkbox$1.Content, { className: "group/content gap-2 font-normal", children: [jsx(Checkbox$1.Control, { className: cn(CONTROL_BASE, CONTROL_SIZE[size], RADIUS_CLASS[radius ?? RADIUS_BY_SIZE[size]], CONTROL_COLOR[color],
|
|
13637
|
+
// v2 `isInvalid`: `before:border-danger` (el borde vivía en el pseudo).
|
|
13638
|
+
isInvalid && "border-danger", disableAnimation && "transition-none before:transition-none", classNames?.wrapper), children: jsx(Checkbox$1.Indicator, { className: cn(INDICATOR_SIZE[size], INDICATOR_COLOR[color], disableAnimation && "[&_svg]:transition-none", classNames?.icon), children: indicatorContent }) }), hasLabel && (
|
|
13639
|
+
// Slot `label` de v2: `relative text-foreground select-none` + tamaño de texto.
|
|
13640
|
+
// `data-slot="label"` para que las reglas de cursor/selección de `.checkbox` de v3
|
|
13641
|
+
// le alcancen igual que a un `<Label>`.
|
|
13642
|
+
jsx("span", { "data-slot": "label", className: cn("relative select-none text-foreground", LABEL_SIZE[size], lineThrough && LINE_THROUGH, isInvalid && "text-danger", classNames?.label), children: children }))] }) }));
|
|
13643
|
+
};
|
|
13644
|
+
CheckboxFacade.displayName = "Aurora.Checkbox";
|
|
13645
|
+
/**
|
|
13646
|
+
* `Checkbox` de Aurora: fachada v2 + estáticos compound de v3 (`Checkbox.Control`,
|
|
13647
|
+
* `Checkbox.Indicator`, `Checkbox.Content`), los mismos objetos que exporta `@heroui/react`.
|
|
13648
|
+
*/
|
|
13649
|
+
const Checkbox = Object.assign(CheckboxFacade, {
|
|
13650
|
+
Control: Checkbox$1.Control,
|
|
13651
|
+
Indicator: Checkbox$1.Indicator,
|
|
13652
|
+
Content: Checkbox$1.Content,
|
|
13653
|
+
});
|
|
13654
|
+
|
|
13190
13655
|
/**
|
|
13191
13656
|
* Tooltip - Componente BeweOS basado en HeroUI.
|
|
13192
13657
|
*
|
|
@@ -13321,7 +13786,15 @@ function formatAuroraThemeTooltip(entry) {
|
|
|
13321
13786
|
}
|
|
13322
13787
|
|
|
13323
13788
|
const HEROUI_THEME_STORAGE_KEY = "heroui-theme";
|
|
13324
|
-
/**
|
|
13789
|
+
/**
|
|
13790
|
+
* Nombre de la cookie con la que BeweOS SMBs guarda el modo de apariencia del usuario. Debe
|
|
13791
|
+
* coincidir con `THEME_MODE_COOKIE_NAME` en SMBs (`apply-initial-session-theme`).
|
|
13792
|
+
*
|
|
13793
|
+
* Se exporta solo como constante compartida: esta librería NO la lee ni la escribe. Hasta el
|
|
13794
|
+
* 08-sep-2026 `forceLightOnlyThemeBeforeReact()` la borraba, y como `useThemeManager` llama a
|
|
13795
|
+
* esa función al montar `ThemeProvider`, toda app que montara el provider perdía la
|
|
13796
|
+
* preferencia del usuario (medido en loginos, ver runbook-apps.md).
|
|
13797
|
+
*/
|
|
13325
13798
|
const BEWEOS_THEME_MODE_COOKIE_NAME = "beweos_theme_mode";
|
|
13326
13799
|
const normalizeStoredHeroUiTheme = (raw) => {
|
|
13327
13800
|
const t = raw.trim();
|
|
@@ -13334,8 +13807,11 @@ const normalizeStoredHeroUiTheme = (raw) => {
|
|
|
13334
13807
|
return t;
|
|
13335
13808
|
};
|
|
13336
13809
|
/**
|
|
13337
|
-
* Asegura apariencia solo clara antes de montar React: corrige `localStorage`
|
|
13338
|
-
*
|
|
13810
|
+
* Asegura apariencia solo clara antes de montar React: corrige `localStorage["heroui-theme"]`
|
|
13811
|
+
* (`dark`/`system` → `light`, `<pack>-dark` → `<pack>-light`), sustituye las clases `dark` /
|
|
13812
|
+
* `*-dark` de `<html>` por su pack claro y fija `color-scheme: light`.
|
|
13813
|
+
*
|
|
13814
|
+
* No toca ninguna cookie: `beweos_theme_mode` es de la app (BeweOS SMBs), no de la librería.
|
|
13339
13815
|
* Debe ejecutarse lo antes posible en el entry (p. ej. justo antes de `createRoot`).
|
|
13340
13816
|
*/
|
|
13341
13817
|
function forceLightOnlyThemeBeforeReact() {
|
|
@@ -13361,7 +13837,6 @@ function forceLightOnlyThemeBeforeReact() {
|
|
|
13361
13837
|
}
|
|
13362
13838
|
}
|
|
13363
13839
|
}
|
|
13364
|
-
document.cookie = `${BEWEOS_THEME_MODE_COOKIE_NAME}=; Max-Age=0; path=/`;
|
|
13365
13840
|
}
|
|
13366
13841
|
catch {
|
|
13367
13842
|
// ignore
|
|
@@ -13959,4 +14434,4 @@ const NavigationLoadingProvider = ({ children, }) => {
|
|
|
13959
14434
|
return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
|
|
13960
14435
|
};
|
|
13961
14436
|
|
|
13962
|
-
export { ALL_THEMES, AURORA_THEME_FAMILIES, AURORA_THEME_REGISTRY, AccordionList, AddHolidayForm, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, AuraAutocomplete as Autocomplete, AutocompleteItem, BEWEOS_THEME_MODE_COOKIE_NAME, Badge, BreadcrumbItem, BreadcrumbsComponent, Button, CONTAINER_ATTRIBUTE, Card, CardBody, Chip, ColorPicker, ColorSelector, ContentCarousel, Currency, DEFAULT_DONUT_COLORS, DEFAULT_PREDEFINED_COLORS, DEFAULT_RANKED_BAR_COLORS, DISMISS_CONTROL_ATTRIBUTE, DatePicker, DateRangePicker, DateSelector, Divider, DonutChart, DrawerFilters, EmailPreview, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HeroUIProvider, HolidayType, IconComponent, Image$1 as Image, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, LINDA_TONE_PROPERTIES, LindaIcon, MenuClaw, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, Progress, PromotionalBanner, REGISTERED_THEME_COLORS, RangeFilter, RankedBarList, RowSteps, DEFAULT_TRANSLATIONS$
|
|
14437
|
+
export { ALL_THEMES, AURORA_THEME_FAMILIES, AURORA_THEME_REGISTRY, AccordionList, AddHolidayForm, Alert, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, AuraAutocomplete as Autocomplete, AutocompleteItem, BEWEOS_THEME_MODE_COOKIE_NAME, Badge, BreadcrumbItem, BreadcrumbsComponent, Button, CONTAINER_ATTRIBUTE, Card, CardBody, Checkbox, Chip, ColorPicker, ColorSelector, ContentCarousel, Currency, DEFAULT_DONUT_COLORS, DEFAULT_PREDEFINED_COLORS, DEFAULT_RANKED_BAR_COLORS, DISMISS_CONTROL_ATTRIBUTE, DatePicker, DateRangePicker, DateSelector, Divider, DonutChart, DrawerFilters, EmailPreview, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HeroUIProvider, HolidayType, IconComponent, Image$1 as Image, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, LINDA_TONE_PROPERTIES, LindaIcon, MenuClaw, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, Progress, PromotionalBanner, REGISTERED_THEME_COLORS, RangeFilter, RankedBarList, RowSteps, DEFAULT_TRANSLATIONS$2 as SEGMENTATION_DEFAULT_TRANSLATIONS, ScheduleRow, SearchInput, SegmentationBuilder, Select, SelectItem, SelectSection, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StatTile, StepIndicator, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput, TimeInput as TimeInputComponent, ToastContext, Tooltip, TwoColumnLayoutAgent, UploadFile, VerticalSteps, ViolinPlot, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, applyLindaTones, computeBars, computeMax, computeSlices, computeTotal, containerProps, createCurrencyFormatter, uniqueCountries as defaultCountries, defaultCurrencyOptions, defaultTranslations$5 as defaultTranslations, deriveLindaTones, dismissControlProps, forceLightOnlyThemeBeforeReact, formatAuroraThemeTooltip, generateThemeColorScale, getContrastForeground, getRegisteredThemeColorBases, getSelectedKeyFromPath, hexToHsl, hexToThemeColor, hslToCssValue, isAuroraFullThemeId, isDismissControl, isDonutEmpty, isExactThemeColor, isGroupState, isHexColor, isRankedBarListEmpty, isSegmentationGroup, parseColorToHsl, removeCustomPrimaryColor, removeLindaTones, shouldClosePopoverOnInteractOutside, sizeMap, themeColors, useAuraToast, useCloseOnAncestorScroll, useDisclosure, useMediaQuery, useNavigationLoading, useThemeContext };
|