@beweco/aurora-ui 0.6.68 → 0.6.69-qa.90
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/assets/css/styles.css +1 -1
- package/dist/index.cjs.js +270 -54
- package/dist/index.esm.js +261 -56
- package/dist/types/components/area-line-chart/AreaLineChart.d.ts +1 -1
- package/dist/types/components/area-line-chart/AreaLineChart.d.ts.map +1 -1
- package/dist/types/components/area-line-chart/AreaLineChart.types.d.ts +8 -0
- package/dist/types/components/area-line-chart/AreaLineChart.types.d.ts.map +1 -1
- package/dist/types/components/donut-chart/DonutChart.d.ts +9 -0
- package/dist/types/components/donut-chart/DonutChart.d.ts.map +1 -0
- package/dist/types/components/donut-chart/DonutChart.types.d.ts +51 -0
- package/dist/types/components/donut-chart/DonutChart.types.d.ts.map +1 -0
- package/dist/types/components/donut-chart/donut-chart.utils.d.ts +15 -0
- package/dist/types/components/donut-chart/donut-chart.utils.d.ts.map +1 -0
- package/dist/types/components/donut-chart/index.d.ts +4 -0
- package/dist/types/components/donut-chart/index.d.ts.map +1 -0
- package/dist/types/components/drawer-filters/DrawerFilters.types.d.ts +13 -0
- package/dist/types/components/drawer-filters/DrawerFilters.types.d.ts.map +1 -1
- package/dist/types/components/drawer-filters/_internal/FilterSection.d.ts.map +1 -1
- package/dist/types/components/menu-claw/MenuClaw.d.ts.map +1 -1
- package/dist/types/components/menu-claw/_internal/menu-claw-nav/MenuClawNavItem.d.ts +17 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-nav/MenuClawNavItem.d.ts.map +1 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-nav/MenuClawNavItem.types.d.ts +18 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-nav/MenuClawNavItem.types.d.ts.map +1 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-nav/index.d.ts +3 -0
- package/dist/types/components/menu-claw/_internal/menu-claw-nav/index.d.ts.map +1 -0
- package/dist/types/components/phone/Phone.d.ts.map +1 -1
- package/dist/types/components/ranked-bar-list/RankedBarList.d.ts +10 -0
- package/dist/types/components/ranked-bar-list/RankedBarList.d.ts.map +1 -0
- package/dist/types/components/ranked-bar-list/RankedBarList.types.d.ts +41 -0
- package/dist/types/components/ranked-bar-list/RankedBarList.types.d.ts.map +1 -0
- package/dist/types/components/ranked-bar-list/index.d.ts +4 -0
- package/dist/types/components/ranked-bar-list/index.d.ts.map +1 -0
- package/dist/types/components/ranked-bar-list/ranked-bar-list.utils.d.ts +16 -0
- package/dist/types/components/ranked-bar-list/ranked-bar-list.utils.d.ts.map +1 -0
- package/dist/types/components/schedule-row/schedule-row.d.ts.map +1 -1
- package/dist/types/components/stat-tile/StatTile.d.ts +10 -0
- package/dist/types/components/stat-tile/StatTile.d.ts.map +1 -0
- package/dist/types/components/stat-tile/StatTile.types.d.ts +40 -0
- package/dist/types/components/stat-tile/StatTile.types.d.ts.map +1 -0
- package/dist/types/components/stat-tile/index.d.ts +3 -0
- package/dist/types/components/stat-tile/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -5,7 +5,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
5
5
|
import { Icon } from '@iconify/react';
|
|
6
6
|
export { loadIcons } from '@iconify/react';
|
|
7
7
|
import React, { useId, useState, useCallback, useMemo, forwardRef, useEffect, useImperativeHandle, createContext, useContext, useRef, useLayoutEffect, memo, createElement, Fragment as Fragment$1 } from 'react';
|
|
8
|
-
import { ResponsiveContainer, AreaChart, CartesianGrid, XAxis, Tooltip as Tooltip$1, Area, LineChart, YAxis, Line } from 'recharts';
|
|
8
|
+
import { ResponsiveContainer, AreaChart, CartesianGrid, XAxis, Tooltip as Tooltip$1, Area, LineChart, YAxis, Line, PieChart, Pie, Cell } from 'recharts';
|
|
9
9
|
import { createPortal } from 'react-dom';
|
|
10
10
|
import { motion, AnimatePresence } from 'framer-motion';
|
|
11
11
|
import { useTheme } from '@heroui/use-theme';
|
|
@@ -582,9 +582,9 @@ function ChartTooltip(_a) {
|
|
|
582
582
|
})] }));
|
|
583
583
|
}
|
|
584
584
|
function AreaLineChart(_a) {
|
|
585
|
-
var data = _a.data, xAxisKey = _a.xAxisKey, series = _a.series, title = _a.title, value = _a.value, trend = _a.trend, _b = _a.height, height = _b === void 0 ? 200 : _b, _c = _a.className, className = _c === void 0 ? "" : _c, _d = _a.wrappedInCard, wrappedInCard = _d === void 0 ? false : _d, formatTooltipValue = _a.formatTooltipValue;
|
|
585
|
+
var data = _a.data, xAxisKey = _a.xAxisKey, series = _a.series, title = _a.title, value = _a.value, trend = _a.trend, _b = _a.height, height = _b === void 0 ? 200 : _b, _c = _a.className, className = _c === void 0 ? "" : _c, _d = _a.wrappedInCard, wrappedInCard = _d === void 0 ? false : _d, formatTooltipValue = _a.formatTooltipValue, _e = _a.yAxisDomain, yAxisDomain = _e === void 0 ? [0, "dataMax + 100"] : _e;
|
|
586
586
|
var hasHeader = title != null || value != null || trend != null || series.length > 0;
|
|
587
|
-
var content = (jsxs(Fragment, { children: [hasHeader && (jsxs("div", { className: "flex items-start justify-between mb-6", children: [jsxs("div", { children: [title != null && (jsx(H3, { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1", children: title })), value != null && (jsxs("div", { className: "flex items-baseline gap-2", children: [jsx("span", { className: "text-2xl font-bold text-gray-900", children: value }), trend != null && (jsx("span", { className: "text-xs font-medium text-yellow-600 bg-yellow-50 px-2 py-1 rounded", children: trend }))] }))] }), series.length > 0 && (jsx("div", { className: "flex items-center gap-4", children: series.map(function (s) { return (jsxs("div", { className: "flex items-center gap-2", children: [jsx("svg", { width: "16", height: "2", viewBox: "0 0 16 2", fill: "none", children: jsx("line", { x1: "0", y1: "1", x2: "16", y2: "1", stroke: s.color, strokeWidth: "2" }) }), jsx("span", { className: "text-xs text-gray-600 font-medium", children: s.label })] }, s.dataKey)); }) }))] })), jsx("div", { className: "w-full", style: { height: "".concat(height, "px") }, children: jsx(ResponsiveContainer, { width: "100%", height: "100%", children: jsxs(LineChart, { data: data, margin: { top: 5, right: 5, left: 5, bottom: 5 }, children: [jsx("defs", { children: series.map(function (s) { return (jsxs("linearGradient", { id: "area-line-chart-".concat(s.dataKey), x1: "0", y1: "0", x2: "0", y2: "1", children: [jsx("stop", { offset: "0%", stopColor: s.color, stopOpacity: 0.3 }), jsx("stop", { offset: "50%", stopColor: s.color, stopOpacity: 0.15 }), jsx("stop", { offset: "100%", stopColor: s.color, stopOpacity: 0 })] }, s.dataKey)); }) }), jsx(XAxis, { dataKey: xAxisKey, axisLine: false, tickLine: false, tick: { fill: "#9ca3af", fontSize: 12 }, dy: 10 }), jsx(YAxis, { axisLine: false, tickLine: false, tick: { fill: "transparent", fontSize: 0 }, width: 0, tickCount: 6, domain:
|
|
587
|
+
var content = (jsxs(Fragment, { children: [hasHeader && (jsxs("div", { className: "flex items-start justify-between mb-6", children: [jsxs("div", { children: [title != null && (jsx(H3, { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1", children: title })), value != null && (jsxs("div", { className: "flex items-baseline gap-2", children: [jsx("span", { className: "text-2xl font-bold text-gray-900", children: value }), trend != null && (jsx("span", { className: "text-xs font-medium text-yellow-600 bg-yellow-50 px-2 py-1 rounded", children: trend }))] }))] }), series.length > 0 && (jsx("div", { className: "flex flex-wrap items-center gap-4", children: series.map(function (s) { return (jsxs("div", { className: "flex items-center gap-2", children: [jsx("svg", { width: "16", height: "2", viewBox: "0 0 16 2", fill: "none", children: jsx("line", { x1: "0", y1: "1", x2: "16", y2: "1", stroke: s.color, strokeWidth: "2" }) }), jsx("span", { className: "text-xs text-gray-600 font-medium", children: s.label })] }, s.dataKey)); }) }))] })), jsx("div", { className: "w-full", style: { height: "".concat(height, "px") }, children: jsx(ResponsiveContainer, { width: "100%", height: "100%", children: jsxs(LineChart, { data: data, margin: { top: 5, right: 5, left: 5, bottom: 5 }, children: [jsx("defs", { children: series.map(function (s) { return (jsxs("linearGradient", { id: "area-line-chart-".concat(s.dataKey), x1: "0", y1: "0", x2: "0", y2: "1", children: [jsx("stop", { offset: "0%", stopColor: s.color, stopOpacity: 0.3 }), jsx("stop", { offset: "50%", stopColor: s.color, stopOpacity: 0.15 }), jsx("stop", { offset: "100%", stopColor: s.color, stopOpacity: 0 })] }, s.dataKey)); }) }), jsx(XAxis, { dataKey: xAxisKey, axisLine: false, tickLine: false, tick: { fill: "#9ca3af", fontSize: 12 }, dy: 10 }), jsx(YAxis, { axisLine: false, tickLine: false, tick: { fill: "transparent", fontSize: 0 }, width: 0, tickCount: 6, domain: yAxisDomain, allowDecimals: false }), jsx(CartesianGrid, { strokeDasharray: "3 3", stroke: "#d1d5db", strokeOpacity: 0.5, vertical: false, horizontal: true }), jsx(Tooltip$1, { content: jsx(ChartTooltip, { series: series, formatValue: formatTooltipValue }) }), series.map(function (s) { return (jsx(Area, { type: "natural", dataKey: s.dataKey, stroke: "none", fill: "url(#area-line-chart-".concat(s.dataKey, ")"), animationDuration: 1500, animationEasing: "ease-in-out" }, "area-".concat(s.dataKey))); }), series.map(function (s) { return (jsx(Line, { type: "natural", dataKey: s.dataKey, name: s.dataKey, stroke: s.color, strokeWidth: 3, dot: false, activeDot: {
|
|
588
588
|
r: 6,
|
|
589
589
|
fill: s.color,
|
|
590
590
|
stroke: "#fff",
|
|
@@ -2947,6 +2947,65 @@ var DateSelector = function (_a) {
|
|
|
2947
2947
|
return (jsxs("div", { className: "w-full flex flex-wrap xs:gap-5 justify-between items-center ".concat(className), children: [jsxs(RadioGroup, __assign({ color: "primary", orientation: "horizontal", size: "sm", value: type, onValueChange: handleTypeChange }, radioGroupProps, { children: [jsx(Radio, __assign({ value: HolidayType.SingleDay }, radioItemProps, { children: t.dayOption })), jsx(Radio, __assign({ value: HolidayType.DateRange }, radioItemProps, { children: t.dateRangeOption }))] })), type === HolidayType.DateRange ? (jsx(DateRangePicker$1, __assign({ className: "xs:w-full md:flex-1 md:max-w-xs", value: dateRange || null, onChange: handleDateRangeChange, "aria-label": t.selectDateRangeAriaLabel, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }) }, dateRangePickerProps))) : (jsx(DatePicker$1, __assign({ className: "xs:w-full md:flex-1 md:max-w-40", value: date || null, onChange: handleDateChange, endContent: jsx(IconComponent, { icon: "solar:calendar-outline" }), "aria-label": t.selectDateAriaLabel }, datePickerProps)))] }));
|
|
2948
2948
|
};
|
|
2949
2949
|
|
|
2950
|
+
/** Paleta categórica por defecto: primary/secondary/success/warning/danger de BeweOS. */
|
|
2951
|
+
var DEFAULT_DONUT_COLORS = [
|
|
2952
|
+
"#006fee",
|
|
2953
|
+
"#7828c8",
|
|
2954
|
+
"#17c964",
|
|
2955
|
+
"#f5a524",
|
|
2956
|
+
"#f31260",
|
|
2957
|
+
];
|
|
2958
|
+
function safeValue$1(value) {
|
|
2959
|
+
return Number.isFinite(value) && value > 0 ? value : 0;
|
|
2960
|
+
}
|
|
2961
|
+
function computeTotal(data) {
|
|
2962
|
+
return data.reduce(function (sum, d) { return sum + safeValue$1(d.value); }, 0);
|
|
2963
|
+
}
|
|
2964
|
+
/**
|
|
2965
|
+
* `true` cuando no hay datos o todos los valores son 0 — mismo criterio que el
|
|
2966
|
+
* `NotData` legacy de Guru.js: un donut sin nada que repartir no aporta información.
|
|
2967
|
+
*/
|
|
2968
|
+
function isDonutEmpty(data) {
|
|
2969
|
+
return data.length === 0 || computeTotal(data) === 0;
|
|
2970
|
+
}
|
|
2971
|
+
/**
|
|
2972
|
+
* Resuelve las proporciones y el color final de cada categoría.
|
|
2973
|
+
* El color propio de cada dato tiene prioridad; si falta, se cicla `palette` por índice.
|
|
2974
|
+
*/
|
|
2975
|
+
function computeSlices(data, palette) {
|
|
2976
|
+
if (palette === void 0) { palette = DEFAULT_DONUT_COLORS; }
|
|
2977
|
+
var total = computeTotal(data);
|
|
2978
|
+
return data.map(function (datum, index) {
|
|
2979
|
+
var _a;
|
|
2980
|
+
var value = safeValue$1(datum.value);
|
|
2981
|
+
return __assign(__assign({}, datum), { value: value, color: (_a = datum.color) !== null && _a !== void 0 ? _a : palette[index % palette.length], percent: total > 0 ? value / total : 0 });
|
|
2982
|
+
});
|
|
2983
|
+
}
|
|
2984
|
+
|
|
2985
|
+
var DEFAULT_TRANSLATIONS$b = {
|
|
2986
|
+
emptyState: "Sin datos para mostrar",
|
|
2987
|
+
totalLabel: "Total",
|
|
2988
|
+
};
|
|
2989
|
+
/**
|
|
2990
|
+
* DonutChart - Gráfico circular (pie o donut, según `innerRadiusRatio`) con
|
|
2991
|
+
* leyenda y total central propios, renderizados fuera del árbol de Recharts
|
|
2992
|
+
* para que sean estables independientemente del tamaño medido del contenedor.
|
|
2993
|
+
*/
|
|
2994
|
+
var DonutChart = function (_a) {
|
|
2995
|
+
var data = _a.data, _b = _a.height, height = _b === void 0 ? 220 : _b, _c = _a.innerRadiusRatio, innerRadiusRatio = _c === void 0 ? 0.65 : _c, _d = _a.showLegend, showLegend = _d === void 0 ? true : _d, _e = _a.showTotal, showTotal = _e === void 0 ? true : _e, colors = _a.colors, formatValue = _a.formatValue, _f = _a.translations, translations = _f === void 0 ? {} : _f, className = _a.className;
|
|
2996
|
+
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$b), translations);
|
|
2997
|
+
if (isDonutEmpty(data)) {
|
|
2998
|
+
return (jsx("div", { className: className, children: jsx(P, { children: t.emptyState }) }));
|
|
2999
|
+
}
|
|
3000
|
+
var slices = computeSlices(data, colors);
|
|
3001
|
+
var total = slices.reduce(function (sum, s) { return sum + s.value; }, 0);
|
|
3002
|
+
var format = function (value) {
|
|
3003
|
+
return formatValue ? formatValue(value) : String(value);
|
|
3004
|
+
};
|
|
3005
|
+
var isDonut = innerRadiusRatio > 0;
|
|
3006
|
+
return (jsxs("div", { className: className, children: [jsxs("div", { className: "relative w-full", style: { height: height }, children: [jsx(ResponsiveContainer, { width: "100%", height: "100%", children: jsxs(PieChart, { children: [jsx(Pie, { data: slices, dataKey: "value", nameKey: "name", innerRadius: isDonut ? "".concat(innerRadiusRatio * 100, "%") : 0, outerRadius: "90%", stroke: "none", children: slices.map(function (slice) { return (jsx(Cell, { fill: slice.color }, slice.name)); }) }), jsx(Tooltip$1, { formatter: function (value) { return format(value); } })] }) }), isDonut && showTotal && (jsxs("div", { className: "aurora-donut-total pointer-events-none absolute inset-0 flex flex-col items-center justify-center", "aria-hidden": "true", children: [jsx("span", { className: "text-xs text-foreground-500", children: t.totalLabel }), jsx("span", { className: "text-xl font-semibold", children: format(total) })] }))] }), showLegend && (jsx("ul", { className: "mt-3 flex flex-wrap gap-3", children: slices.map(function (slice) { return (jsxs("li", { className: "flex items-center gap-1.5 text-xs", children: [jsx("span", { className: "h-2 w-2 rounded-full", style: { backgroundColor: slice.color }, "aria-hidden": "true" }), jsx("span", { children: slice.name }), jsxs("span", { className: "text-foreground-500", children: [Math.round(slice.percent * 100), "%"] })] }, slice.name)); }) }))] }));
|
|
3007
|
+
};
|
|
3008
|
+
|
|
2950
3009
|
var H1 = function (_a) {
|
|
2951
3010
|
var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
|
|
2952
3011
|
return (jsx("h1", __assign({ className: cn("text-xl font-bold", className) }, props, { children: children })));
|
|
@@ -3012,12 +3071,12 @@ var NotificationButton = function (_a) {
|
|
|
3012
3071
|
};
|
|
3013
3072
|
NotificationButton.displayName = "NotificationButton";
|
|
3014
3073
|
|
|
3015
|
-
var DEFAULT_TRANSLATIONS$
|
|
3074
|
+
var DEFAULT_TRANSLATIONS$a = {
|
|
3016
3075
|
logout: "Cerrar sesión",
|
|
3017
3076
|
};
|
|
3018
3077
|
var HeaderComponent = function (_a) {
|
|
3019
3078
|
var notificationCount = _a.notificationCount, options = _a.options, onMenuClick = _a.onMenuClick, onLogout = _a.onLogout, _b = _a.translations, translations = _b === void 0 ? {} : _b, breadcrumbs = _a.breadcrumbs, extraContent = _a.extraContent, _c = _a.showMenuButton, showMenuButton = _c === void 0 ? true : _c, onNotificationClick = _a.onNotificationClick, onOptionSelect = _a.onOptionSelect, onBreadcrumbClick = _a.onBreadcrumbClick;
|
|
3020
|
-
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$
|
|
3079
|
+
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$a), translations);
|
|
3021
3080
|
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$1, { className: "sm:hidden", isIconOnly: true, variant: "light", startContent: jsx(IconComponent, { icon: "solar:hamburger-menu-linear" }), onPress: onMenuClick })), breadcrumbs && breadcrumbs.length > 0 && (jsx(BreadcrumbsComponent, { items: breadcrumbs, onItemClick: onBreadcrumbClick }))] }), jsxs("div", { className: "flex items-center gap-4", children: [extraContent, jsx(NotificationButton, { notificationCount: notificationCount, onPress: onNotificationClick }), jsx(ConfigMenu, { options: options, onLogout: onLogout, onOptionSelect: onOptionSelect, translations: t })] })] }) }));
|
|
3022
3081
|
};
|
|
3023
3082
|
HeaderComponent.displayName = "Header";
|
|
@@ -3141,7 +3200,7 @@ KanbanColumn.displayName = "KanbanColumn";
|
|
|
3141
3200
|
* Traducciones por defecto en español.
|
|
3142
3201
|
* Se mezclan con las traducciones proporcionadas por el usuario.
|
|
3143
3202
|
*/
|
|
3144
|
-
var DEFAULT_TRANSLATIONS$
|
|
3203
|
+
var DEFAULT_TRANSLATIONS$9 = {
|
|
3145
3204
|
dropHere: "Soltar aquí",
|
|
3146
3205
|
emptyMessage: "No hay elementos",
|
|
3147
3206
|
};
|
|
@@ -3175,7 +3234,7 @@ var columnGapClasses = {
|
|
|
3175
3234
|
var KanbanComponent = function (_a) {
|
|
3176
3235
|
var columns = _a.columns, renderItem = _a.renderItem, onCardClick = _a.onCardClick, onItemMove = _a.onItemMove, isDraggable = _a.isDraggable, cardClassName = _a.cardClassName, isCardClickable = _a.isCardClickable, className = _a.className, _b = _a.columnWidth, columnWidth = _b === void 0 ? "280px" : _b, _c = _a.columnGap, columnGap = _c === void 0 ? "md" : _c, _d = _a.horizontalScroll, horizontalScroll = _d === void 0 ? true : _d, columnMaxHeight = _a.columnMaxHeight, renderColumnHeader = _a.renderColumnHeader, renderEmptyState = _a.renderEmptyState, _e = _a.translations, translations = _e === void 0 ? {} : _e, onLoadMore = _a.onLoadMore;
|
|
3177
3236
|
// Mezclar traducciones del usuario con las por defecto
|
|
3178
|
-
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$
|
|
3237
|
+
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$9), translations);
|
|
3179
3238
|
// Determinar si drag está habilitado
|
|
3180
3239
|
var dragEnabled = isDraggable !== null && isDraggable !== void 0 ? isDraggable : !!onItemMove;
|
|
3181
3240
|
// Estado del drag actual
|
|
@@ -3519,7 +3578,7 @@ var MenuNavList = React.forwardRef(function (_a, ref) {
|
|
|
3519
3578
|
});
|
|
3520
3579
|
MenuNavList.displayName = "MenuNavList";
|
|
3521
3580
|
|
|
3522
|
-
var DEFAULT_TRANSLATIONS$
|
|
3581
|
+
var DEFAULT_TRANSLATIONS$8 = {
|
|
3523
3582
|
menuLabel: "Menú",
|
|
3524
3583
|
closeSidebarAriaLabel: "Cerrar menú lateral",
|
|
3525
3584
|
mobileNavAriaLabel: "Navegación móvil",
|
|
@@ -3537,7 +3596,7 @@ var MenuComponent = React.memo(function Menu(_a) {
|
|
|
3537
3596
|
var commerceInfo = _a.commerceInfo, userInfo = _a.userInfo, helpButton = _a.helpButton, isOpenSidebar = _a.isOpenSidebar, onOpenSidebarChange = _a.onOpenSidebarChange, menuItems = _a.menuItems, mobileBottomBarGroupKey = _a.mobileBottomBarGroupKey, _d = _a.showNativeMenu, showNativeMenu = _d === void 0 ? true : _d, onUserInfoClick = _a.onUserInfoClick, _e = _a.translations, translations = _e === void 0 ? {} : _e;
|
|
3538
3597
|
var _f = React.useState(false), isCollapsed = _f[0], setIsCollapsed = _f[1];
|
|
3539
3598
|
var _g = React.useState(false), logoError = _g[0], setLogoError = _g[1];
|
|
3540
|
-
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$
|
|
3599
|
+
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$8), translations);
|
|
3541
3600
|
var selectedKey = React.useMemo(function () {
|
|
3542
3601
|
var _a, _b, _c;
|
|
3543
3602
|
if (menuItems.selectedPath) {
|
|
@@ -3769,7 +3828,59 @@ var MenuClawHistoryPanel = React.memo(function MenuClawHistoryPanel(_a) {
|
|
|
3769
3828
|
: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true }), isExpanded ? showLessLabel : showMoreLabel] })) : null] })) : null] }));
|
|
3770
3829
|
});
|
|
3771
3830
|
|
|
3772
|
-
|
|
3831
|
+
/** ¿Está la key seleccionada en este ítem o en cualquiera de sus descendientes? */
|
|
3832
|
+
var containsKey = function (item, key) {
|
|
3833
|
+
var _a;
|
|
3834
|
+
if (!key) {
|
|
3835
|
+
return false;
|
|
3836
|
+
}
|
|
3837
|
+
if (item.key === key) {
|
|
3838
|
+
return true;
|
|
3839
|
+
}
|
|
3840
|
+
return ((_a = item.items) !== null && _a !== void 0 ? _a : []).some(function (child) { return containsKey(child, key); });
|
|
3841
|
+
};
|
|
3842
|
+
/**
|
|
3843
|
+
* Fila del menú. Si el ítem trae `items`, se pinta como grupo desplegable en vez
|
|
3844
|
+
* de como enlace.
|
|
3845
|
+
*
|
|
3846
|
+
* Existe porque `MenuClaw` no puede reutilizar `MenuNavList` (heredaría sus filas
|
|
3847
|
+
* de 44px) pero sí necesita el mismo dato jerárquico: los consumidores mandan
|
|
3848
|
+
* módulos con hijos —Catálogo › Productos/Servicios— y sin este render se
|
|
3849
|
+
* perderían en silencio, porque `MenuNavListItem.items` es opcional y no falla
|
|
3850
|
+
* al compilar.
|
|
3851
|
+
*
|
|
3852
|
+
* El grupo que contiene la ruta activa se despliega solo y no se puede plegar:
|
|
3853
|
+
* si se pudiera, el ítem activo quedaría oculto.
|
|
3854
|
+
*/
|
|
3855
|
+
var MenuClawNavItem = function (_a) {
|
|
3856
|
+
var _b, _c;
|
|
3857
|
+
var item = _a.item, selectedKey = _a.selectedKey, isCollapsed = _a.isCollapsed, onSelect = _a.onSelect, _d = _a.depth, depth = _d === void 0 ? 0 : _d;
|
|
3858
|
+
var submenuId = useId();
|
|
3859
|
+
var _e = useState(false), isManuallyOpen = _e[0], setIsManuallyOpen = _e[1];
|
|
3860
|
+
var children = (_b = item.items) !== null && _b !== void 0 ? _b : [];
|
|
3861
|
+
// Comprimido no hay sitio para desplegables: la fila vuelve a ser navegable.
|
|
3862
|
+
var isGroup = children.length > 0 && !isCollapsed;
|
|
3863
|
+
var hasSelectedDescendant = useMemo(function () { return children.some(function (child) { return containsKey(child, selectedKey); }); }, [children, selectedKey]);
|
|
3864
|
+
var isOpen = hasSelectedDescendant || isManuallyOpen;
|
|
3865
|
+
var isActive = !!item.key && item.key === selectedKey;
|
|
3866
|
+
var handleClick = useCallback(function () {
|
|
3867
|
+
if (isGroup) {
|
|
3868
|
+
setIsManuallyOpen(function (prev) { return !prev; });
|
|
3869
|
+
return;
|
|
3870
|
+
}
|
|
3871
|
+
onSelect(item.key, item.href);
|
|
3872
|
+
}, [isGroup, onSelect, item.key, item.href]);
|
|
3873
|
+
var icon = item.icon || item.startContent ? (jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-default-500 [&_svg]:h-5 [&_svg]:w-5", children: item.icon ? (jsx(IconComponent, { icon: item.icon, size: "md", "aria-hidden": true })) : (item.startContent) })) : null;
|
|
3874
|
+
return (jsxs("li", { children: [jsxs("button", { type: "button", title: isCollapsed ? item.title : undefined, onClick: handleClick, "aria-expanded": isGroup ? isOpen : undefined, "aria-controls": isGroup ? submenuId : undefined, className: cn("flex w-full items-center rounded-lg px-2 py-1.5 text-left text-small transition-colors", "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", depth === 0 ? "min-h-9" : "min-h-8", isCollapsed ? "justify-center" : "gap-3",
|
|
3875
|
+
// Sangría del hijo: alinea su texto con el del padre (px-2 + icono
|
|
3876
|
+
// de 20px + gap de 12px).
|
|
3877
|
+
!isCollapsed && depth > 0 && !icon ? "pl-10" : undefined, isActive
|
|
3878
|
+
? "bg-default-100 font-medium text-foreground"
|
|
3879
|
+
: "text-default-600 hover:bg-default-100", item.className), children: [icon, !isCollapsed ? (jsxs(Fragment, { children: [jsx("span", { className: "menu-claw-collapsible flex-1 truncate", children: item.title }), (_c = item.endContent) !== null && _c !== void 0 ? _c : null, isGroup ? (jsx(IconComponent, { icon: "solar:alt-arrow-down-linear", size: "sm", "aria-hidden": true, className: cn("shrink-0 text-default-400 transition-transform", isOpen && "rotate-180") })) : null] })) : null] }), isGroup && isOpen ? (jsx("ul", { id: submenuId, className: "mt-0.5 flex flex-col gap-0.5", children: children.map(function (child) { return (jsx(MenuClawNavItem, { item: child, selectedKey: selectedKey, isCollapsed: isCollapsed, onSelect: onSelect, depth: depth + 1 }, child.key)); }) })) : null] }));
|
|
3880
|
+
};
|
|
3881
|
+
MenuClawNavItem.displayName = "MenuClawNavItem";
|
|
3882
|
+
|
|
3883
|
+
var DEFAULT_TRANSLATIONS$7 = {
|
|
3773
3884
|
menuLabel: "Menú",
|
|
3774
3885
|
closeSidebarAriaLabel: "Cerrar menú lateral",
|
|
3775
3886
|
mobileNavAriaLabel: "Navegación móvil",
|
|
@@ -3807,7 +3918,7 @@ var MenuClaw = React.memo(function MenuClaw(_a) {
|
|
|
3807
3918
|
var _b, _c;
|
|
3808
3919
|
var userInfo = _a.userInfo, helpButton = _a.helpButton, menuItems = _a.menuItems, history = _a.history, isOpenSidebar = _a.isOpenSidebar, onOpenSidebarChange = _a.onOpenSidebarChange, mobileBottomBarGroupKey = _a.mobileBottomBarGroupKey, _d = _a.showNativeMenu, showNativeMenu = _d === void 0 ? true : _d, _e = _a.translations, translations = _e === void 0 ? {} : _e;
|
|
3809
3920
|
var _f = React.useState(false), isCollapsed = _f[0], setIsCollapsed = _f[1];
|
|
3810
|
-
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$
|
|
3921
|
+
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$7), translations);
|
|
3811
3922
|
var selectedKey = useMemo(function () {
|
|
3812
3923
|
var _a, _b, _c;
|
|
3813
3924
|
if (menuItems.selectedPath) {
|
|
@@ -3879,13 +3990,7 @@ var MenuClaw = React.memo(function MenuClaw(_a) {
|
|
|
3879
3990
|
? "solar:alt-arrow-right-linear"
|
|
3880
3991
|
: "solar:alt-arrow-left-linear", size: "md", "aria-hidden": true }) })] }), jsxs("div", { className: cn("flex items-center py-3", isCollapsed ? "justify-center gap-0" : "gap-3"), children: [jsx(Avatar, { size: "sm", src: ((_b = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _b === void 0 ? void 0 : _b.trim()) || undefined, color: !((_c = userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) === null || _c === void 0 ? void 0 : _c.trim()) ? "warning" : "default", name: userName, className: "shrink-0" }), !isCollapsed ? (jsxs("div", { className: "menu-claw-collapsible flex min-w-0 flex-col overflow-hidden", children: [jsx("p", { className: "truncate text-small font-semibold text-foreground", children: userName }), jsx("p", { className: "truncate text-tiny text-default-400", children: userRole })] })) : null] }), jsx(MenuClawHistoryPanel, { items: historyConfig.items, initialVisibleCount: historyConfig.initialVisibleCount, onNewConversation: history === null || history === void 0 ? void 0 : history.onNewConversation, isCollapsed: isCollapsed, title: t.historyTitle, newLabel: t.historyNewLabel, showMoreLabel: t.historyShowMoreLabel, showLessLabel: t.historyShowLessLabel, onBeforeSelect: handleSidebarClose }), jsx("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", children: menuItems.items.map(function (group) {
|
|
3881
3992
|
var _a;
|
|
3882
|
-
return (jsxs("div", { className: "mb-2", children: [group.title && !isCollapsed ? (jsx("p", { className: "px-2 pb-1 pt-2 text-tiny font-medium uppercase tracking-wide text-default-400", children: group.title })) : null, jsx("ul", { className: "flex flex-col gap-0.5", children: ((_a = group.items) !== null && _a !== void 0 ? _a : []).map(function (item) {
|
|
3883
|
-
var _a;
|
|
3884
|
-
var isActive = !!item.key && item.key === selectedKey;
|
|
3885
|
-
return (jsx("li", { children: jsxs("button", { type: "button", title: isCollapsed ? item.title : undefined, onClick: function () { return handleMenuSelect(item.key, item.href); }, className: cn("flex min-h-9 w-full items-center rounded-lg px-2 py-1.5 text-left text-small transition-colors", "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus", isCollapsed ? "justify-center" : "gap-3", isActive
|
|
3886
|
-
? "bg-default-100 font-medium text-foreground"
|
|
3887
|
-
: "text-default-600 hover:bg-default-100", item.className), children: [item.icon || item.startContent ? (jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center text-default-500 [&_svg]:h-5 [&_svg]:w-5", children: item.icon ? (jsx(IconComponent, { icon: item.icon, size: "md", "aria-hidden": true })) : (item.startContent) })) : null, !isCollapsed ? (jsxs(Fragment, { children: [jsx("span", { className: "menu-claw-collapsible flex-1 truncate", children: item.title }), (_a = item.endContent) !== null && _a !== void 0 ? _a : null] })) : null] }) }, item.key));
|
|
3888
|
-
}) })] }, group.key));
|
|
3993
|
+
return (jsxs("div", { className: "mb-2", children: [group.title && !isCollapsed ? (jsx("p", { className: "px-2 pb-1 pt-2 text-tiny font-medium uppercase tracking-wide text-default-400", children: group.title })) : null, jsx("ul", { className: "flex flex-col gap-0.5", children: ((_a = group.items) !== null && _a !== void 0 ? _a : []).map(function (item) { return (jsx(MenuClawNavItem, { item: item, selectedKey: selectedKey, isCollapsed: isCollapsed, onSelect: handleMenuSelect }, item.key)); }) })] }, group.key));
|
|
3889
3994
|
}) }), helpSection ? (jsx("div", { className: "mt-auto flex flex-col items-center justify-center", children: jsx(Button$1, { fullWidth: true, className: "text-default-500 data-[hover=true]:text-default-600", startContent: jsx(IconComponent, { className: "text-default-500", icon: "solar:info-circle-line-duotone", size: "md" }), variant: "light", onPress: handleHelpClick, isIconOnly: isCollapsed, children: !isCollapsed ? (jsx("span", { className: "menu-claw-collapsible truncate", children: helpSection.title })) : null }) })) : null] }) })] }));
|
|
3890
3995
|
});
|
|
3891
3996
|
|
|
@@ -4245,13 +4350,6 @@ var Phone = function (_a) {
|
|
|
4245
4350
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
4246
4351
|
};
|
|
4247
4352
|
}, [isDropdownOpen]);
|
|
4248
|
-
// El dropdown se portea a `body` con posición absoluta fija; cerrarlo cuando
|
|
4249
|
-
// un ancestro hace scroll para que no quede flotando fuera de lugar.
|
|
4250
|
-
useCloseOnAncestorScroll({
|
|
4251
|
-
isOpen: isDropdownOpen,
|
|
4252
|
-
onClose: function () { return setIsDropdownOpen(false); },
|
|
4253
|
-
contentRef: portalDropdownRef,
|
|
4254
|
-
});
|
|
4255
4353
|
var handleCountrySelect = function (country) {
|
|
4256
4354
|
setSelectedCountry(country);
|
|
4257
4355
|
setIsDropdownOpen(false);
|
|
@@ -4323,6 +4421,64 @@ var PromotionalBanner = function (_a) {
|
|
|
4323
4421
|
}, variant: "bordered", onClick: handleButtonClick }, buttonProps, { children: finalButtonText })), showCloseButton && (jsx("div", { className: "flex flex-1 justify-end", children: jsx(Button$1, { isIconOnly: true, "aria-label": t.closeButtonLabel, className: "-m-1", size: "lg", variant: "bordered", onClick: handleClose, children: jsx(IconComponent, { "aria-hidden": "true", className: "text-default-500", icon: "lucide:x", size: "md" }) }) }))] }));
|
|
4324
4422
|
};
|
|
4325
4423
|
|
|
4424
|
+
/** Paleta categórica por defecto: primary/secondary/success/warning/danger de BeweOS. */
|
|
4425
|
+
var DEFAULT_RANKED_BAR_COLORS = [
|
|
4426
|
+
"#006fee",
|
|
4427
|
+
"#7828c8",
|
|
4428
|
+
"#17c964",
|
|
4429
|
+
"#f5a524",
|
|
4430
|
+
"#f31260",
|
|
4431
|
+
];
|
|
4432
|
+
function safeValue(value) {
|
|
4433
|
+
return Number.isFinite(value) && value > 0 ? value : 0;
|
|
4434
|
+
}
|
|
4435
|
+
function computeMax(data) {
|
|
4436
|
+
return data.reduce(function (max, d) { return Math.max(max, safeValue(d.value)); }, 0);
|
|
4437
|
+
}
|
|
4438
|
+
/**
|
|
4439
|
+
* `true` cuando no hay datos o todos los valores son 0 — mismo criterio que el
|
|
4440
|
+
* `NotData` legacy de Guru.js.
|
|
4441
|
+
*/
|
|
4442
|
+
function isRankedBarListEmpty(data) {
|
|
4443
|
+
return data.length === 0 || computeMax(data) === 0;
|
|
4444
|
+
}
|
|
4445
|
+
/**
|
|
4446
|
+
* Resuelve el ancho de cada barra como porcentaje del **valor máximo del set**
|
|
4447
|
+
* (no del total) — igual que `BusinessStage.js` legacy (`100 * quantity / max`),
|
|
4448
|
+
* y el color final de cada fila.
|
|
4449
|
+
*/
|
|
4450
|
+
function computeBars(data, palette) {
|
|
4451
|
+
if (palette === void 0) { palette = DEFAULT_RANKED_BAR_COLORS; }
|
|
4452
|
+
var max = computeMax(data);
|
|
4453
|
+
return data.map(function (item, index) {
|
|
4454
|
+
var _a;
|
|
4455
|
+
var value = safeValue(item.value);
|
|
4456
|
+
return __assign(__assign({}, item), { value: value, color: (_a = item.color) !== null && _a !== void 0 ? _a : palette[index % palette.length], percent: max > 0 ? (value / max) * 100 : 0 });
|
|
4457
|
+
});
|
|
4458
|
+
}
|
|
4459
|
+
|
|
4460
|
+
var DEFAULT_TRANSLATIONS$6 = {
|
|
4461
|
+
emptyState: "Sin datos para mostrar",
|
|
4462
|
+
};
|
|
4463
|
+
/**
|
|
4464
|
+
* RankedBarList - Lista de barras horizontales escaladas al valor máximo del
|
|
4465
|
+
* set (no al total) — mismo criterio visual que `BusinessStage.js` legacy.
|
|
4466
|
+
* No reordena las filas: el llamador decide el orden (por relevancia, por
|
|
4467
|
+
* etapa del funnel, etc.).
|
|
4468
|
+
*/
|
|
4469
|
+
var RankedBarList = function (_a) {
|
|
4470
|
+
var data = _a.data, colors = _a.colors, formatValue = _a.formatValue, _b = _a.showValue, showValue = _b === void 0 ? true : _b, _c = _a.barHeight, barHeight = _c === void 0 ? 8 : _c, _d = _a.translations, translations = _d === void 0 ? {} : _d, className = _a.className;
|
|
4471
|
+
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$6), translations);
|
|
4472
|
+
if (isRankedBarListEmpty(data)) {
|
|
4473
|
+
return (jsx("div", { className: className, children: jsx(P, { children: t.emptyState }) }));
|
|
4474
|
+
}
|
|
4475
|
+
var bars = computeBars(data, colors);
|
|
4476
|
+
var format = function (value) {
|
|
4477
|
+
return formatValue ? formatValue(value) : String(value);
|
|
4478
|
+
};
|
|
4479
|
+
return (jsx("div", { className: ["flex flex-col gap-3", className].filter(Boolean).join(" "), children: bars.map(function (bar) { return (jsxs("div", { className: "flex flex-col gap-1", children: [jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [jsx(P, { className: "truncate", children: bar.label }), showValue && (jsx("span", { className: "text-sm font-medium text-foreground", children: format(bar.value) }))] }), jsx("div", { className: "w-full rounded-full bg-default-100", style: { height: barHeight }, children: jsx("div", { className: "h-full rounded-full", style: { width: "".concat(bar.percent, "%"), backgroundColor: bar.color } }) })] }, bar.label)); }) }));
|
|
4480
|
+
};
|
|
4481
|
+
|
|
4326
4482
|
var VALID_STEP_COLORS = [
|
|
4327
4483
|
"primary",
|
|
4328
4484
|
"secondary",
|
|
@@ -5380,7 +5536,7 @@ var ScheduleRow = function (_a) {
|
|
|
5380
5536
|
// Return slots exactly as they are - no automatic additions
|
|
5381
5537
|
return slots;
|
|
5382
5538
|
};
|
|
5383
|
-
return (jsxs("div", { className: "flex flex-col w-full gap-y-4 last:border-b-0 last:mb-0 last:pb-0 border-b border-default-200 xs:py-4 xl:p-4 first:pt-0", children: [jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxs("div", { className: "flex xs:space-x-2 sm:space-x-4", children: [jsx("h3", { className: "text-small font-semibold text-default-900 capitalize", children: day }), jsx(Chip$1, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? t.open : t.closed })] }), jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), showCopyToAll && onCopyToAll && (jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: t.copyToAll }))] })] }), daySchedule.isOpen && (jsx("div", { className: "flex flex-col justify-around gap-y-3 ", children: getSlotsToDisplay().map(function (slot, index) {
|
|
5539
|
+
return (jsxs("div", { className: "flex flex-col w-full gap-y-4 last:border-b-0 last:mb-0 last:pb-0 border-b border-default-200 xs:py-4 xl:p-4 first:pt-0", children: [jsxs("div", { className: "flex w-full items-center justify-between", children: [jsxs("div", { className: "flex items-center xs:space-x-2 sm:space-x-4", children: [jsx("h3", { className: "text-small font-semibold text-default-900 capitalize w-24 shrink-0", children: day }), jsx(Chip$1, { size: "sm", color: daySchedule.isOpen ? "primary" : "default", className: "text-background", children: daySchedule.isOpen ? t.open : t.closed })] }), jsxs("div", { className: "flex xs:gap-2 sm:gap-5", children: [jsx(Switch, { size: "sm", color: "primary", isSelected: daySchedule.isOpen, onValueChange: handleToggleDay }), showCopyToAll && onCopyToAll && (jsx(Button, { size: "sm", variant: "bordered", onPress: function () { return onCopyToAll(day); }, children: t.copyToAll }))] })] }), daySchedule.isOpen && (jsx("div", { className: "flex flex-col justify-around gap-y-3 ", children: getSlotsToDisplay().map(function (slot, index) {
|
|
5384
5540
|
var slotsToDisplay = getSlotsToDisplay();
|
|
5385
5541
|
var isLastSlot = index === slotsToDisplay.length - 1;
|
|
5386
5542
|
var isSlotFilled = slot.from && slot.to;
|
|
@@ -5514,6 +5670,59 @@ var SocialMediaPreview = function (_a) {
|
|
|
5514
5670
|
}
|
|
5515
5671
|
};
|
|
5516
5672
|
|
|
5673
|
+
var paddingClasses = {
|
|
5674
|
+
sm: "p-4",
|
|
5675
|
+
md: "p-6",
|
|
5676
|
+
lg: "p-8",
|
|
5677
|
+
};
|
|
5678
|
+
|
|
5679
|
+
/**
|
|
5680
|
+
* Card genérica siguiendo las reglas de diseño BeweOS basada en HeroUI.
|
|
5681
|
+
*
|
|
5682
|
+
* Reglas aplicadas:
|
|
5683
|
+
* - Shadow: none, sm, md, lg (configurable)
|
|
5684
|
+
* - Radius: sm (por defecto, configurable)
|
|
5685
|
+
* - Padding configurable (sm, md, lg)
|
|
5686
|
+
* - Hereda de HeroUI Card con personalización BeweOS
|
|
5687
|
+
*/
|
|
5688
|
+
var Card = function (_a) {
|
|
5689
|
+
var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.shadow, shadow = _c === void 0 ? "sm" : _c, _d = _a.radius, radius = _d === void 0 ? "sm" : _d, _e = _a.padding, padding = _e === void 0 ? "md" : _e, props = __rest(_a, ["children", "className", "shadow", "radius", "padding"]);
|
|
5690
|
+
var paddingClass = paddingClasses[padding];
|
|
5691
|
+
var combinedClassName = [paddingClass, className].filter(Boolean).join(" ");
|
|
5692
|
+
return (jsx(Card$1, __assign({ shadow: shadow, radius: radius, className: combinedClassName }, props, { children: children })));
|
|
5693
|
+
};
|
|
5694
|
+
|
|
5695
|
+
var DEFAULT_TRANSLATIONS$5 = {
|
|
5696
|
+
trendUpAriaLabel: "Tendencia al alza",
|
|
5697
|
+
trendDownAriaLabel: "Tendencia a la baja",
|
|
5698
|
+
trendNeutralAriaLabel: "Sin variación",
|
|
5699
|
+
};
|
|
5700
|
+
var TREND_COLOR_CLASS = {
|
|
5701
|
+
positive: "text-success",
|
|
5702
|
+
negative: "text-danger",
|
|
5703
|
+
neutral: "text-foreground-500",
|
|
5704
|
+
};
|
|
5705
|
+
var TREND_ARIA_KEY = {
|
|
5706
|
+
positive: "trendUpAriaLabel",
|
|
5707
|
+
negative: "trendDownAriaLabel",
|
|
5708
|
+
neutral: "trendNeutralAriaLabel",
|
|
5709
|
+
};
|
|
5710
|
+
/**
|
|
5711
|
+
* StatTile - Tarjeta KPI compacta: ícono opcional + título + valor + tendencia opcional.
|
|
5712
|
+
*
|
|
5713
|
+
* Cubre el patrón "tile" (título + número, con o sin ícono/variación) que se repite en
|
|
5714
|
+
* varios dashboards de estadísticas y no encajaba en ningún chart existente de AuraUI.
|
|
5715
|
+
*/
|
|
5716
|
+
var StatTile = function (_a) {
|
|
5717
|
+
var _b;
|
|
5718
|
+
var title = _a.title, value = _a.value, icon = _a.icon, trend = _a.trend, _c = _a.translations, translations = _c === void 0 ? {} : _c, className = _a.className, _d = _a.padding, padding = _d === void 0 ? "md" : _d, cardProps = __rest(_a, ["title", "value", "icon", "trend", "translations", "className", "padding"]);
|
|
5719
|
+
var t = __assign(__assign({}, DEFAULT_TRANSLATIONS$5), translations);
|
|
5720
|
+
var direction = (_b = trend === null || trend === void 0 ? void 0 : trend.direction) !== null && _b !== void 0 ? _b : "neutral";
|
|
5721
|
+
return (jsxs(Card, __assign({ padding: padding, className: ["flex flex-row items-center gap-3", className]
|
|
5722
|
+
.filter(Boolean)
|
|
5723
|
+
.join(" ") }, cardProps, { children: [icon && (jsx("span", { className: "shrink-0 text-foreground-600", "aria-hidden": "true", children: icon })), jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [jsx(P, { className: "truncate", children: title }), jsxs("div", { className: "flex items-baseline gap-2", children: [jsx(H3, { className: "text-2xl font-semibold", children: value }), trend && (jsx("span", { className: "text-xs font-medium ".concat(TREND_COLOR_CLASS[direction]), "aria-label": t[TREND_ARIA_KEY[direction]], children: trend.value }))] })] })] })));
|
|
5724
|
+
};
|
|
5725
|
+
|
|
5517
5726
|
function AuraTable(_a) {
|
|
5518
5727
|
var columns = _a.columns, items = _a.items, renderCell = _a.renderCell, children = _a.children, props = __rest(_a, ["columns", "items", "renderCell", "children"]);
|
|
5519
5728
|
return (jsxs(Table, __assign({ removeWrapper: true, radius: "none" }, props, { children: [jsx(TableHeader, { columns: columns, children: function (column) { return jsx(TableColumn, { children: column.label }, column.key); } }), jsx(TableBody, { items: items, children: function (item) { return (jsx(TableRow, { children: function (columnKey) { return (jsx(TableCell, { children: renderCell ? renderCell(item, columnKey) : children })); } }, item.id)); } })] })));
|
|
@@ -7569,18 +7778,19 @@ var SelectFilter = function (_a) {
|
|
|
7569
7778
|
// MULTISELECT FILTER
|
|
7570
7779
|
// =========================================================================
|
|
7571
7780
|
var MultiSelectFilter = function (_a) {
|
|
7572
|
-
var _b, _c, _d, _e;
|
|
7781
|
+
var _b, _c, _d, _e, _f;
|
|
7573
7782
|
var filter = _a.filter, value = _a.value, onChange = _a.onChange, translations = _a.translations;
|
|
7574
7783
|
var triggerRef = useRef(null);
|
|
7575
|
-
var
|
|
7576
|
-
var
|
|
7577
|
-
var
|
|
7784
|
+
var _g = useState(null), triggerWidthPx = _g[0], setTriggerWidthPx = _g[1];
|
|
7785
|
+
var _h = useState(false), isOpen = _h[0], setIsOpen = _h[1];
|
|
7786
|
+
var _j = useState(""), searchQuery = _j[0], setSearchQuery = _j[1];
|
|
7578
7787
|
var currentValues = (value === null || value === void 0 ? void 0 : value.values) || [];
|
|
7579
7788
|
var searchable = filter.searchable === true;
|
|
7580
7789
|
var searchPlaceholder = (_b = translations === null || translations === void 0 ? void 0 : translations.multiselectSearchPlaceholder) !== null && _b !== void 0 ? _b : "Buscar opciones...";
|
|
7581
7790
|
var moreLabelTemplate = (_c = translations === null || translations === void 0 ? void 0 : translations.multiselectMoreLabel) !== null && _c !== void 0 ? _c : "+{more} más";
|
|
7582
7791
|
var noResultsText = (_d = translations === null || translations === void 0 ? void 0 : translations.multiselectNoResults) !== null && _d !== void 0 ? _d : "Sin coincidencias";
|
|
7583
|
-
var
|
|
7792
|
+
var selectPlaceholderTemplate = (_e = translations === null || translations === void 0 ? void 0 : translations.selectPlaceholder) !== null && _e !== void 0 ? _e : "Seleccionar {label}";
|
|
7793
|
+
var triggerPlaceholder = selectPlaceholderTemplate.replace("{label}", filter.title.toLowerCase());
|
|
7584
7794
|
var filteredData = useMemo(function () {
|
|
7585
7795
|
if (!searchable) {
|
|
7586
7796
|
return filter.data;
|
|
@@ -7635,7 +7845,7 @@ var MultiSelectFilter = function (_a) {
|
|
|
7635
7845
|
}
|
|
7636
7846
|
onChange({ values: Array.from(keys) });
|
|
7637
7847
|
}, [filteredData, onChange]);
|
|
7638
|
-
var maxVisibleChips = Math.min(Math.max((
|
|
7848
|
+
var maxVisibleChips = Math.min(Math.max((_f = filter.maxVisibleChips) !== null && _f !== void 0 ? _f : 5, 1), 24);
|
|
7639
7849
|
var triggerSelection = useMemo(function () {
|
|
7640
7850
|
if (currentValues.length === 0) {
|
|
7641
7851
|
return { visible: [], overflow: 0 };
|
|
@@ -7789,7 +7999,24 @@ var DateFilter = function (_a) {
|
|
|
7789
7999
|
}
|
|
7790
8000
|
return undefined;
|
|
7791
8001
|
};
|
|
7792
|
-
|
|
8002
|
+
// Solo se reenvían las claves definidas: pasar `undefined` explícito pisaría
|
|
8003
|
+
// los defaults en español de DateSelector (el spread copia la clave igual).
|
|
8004
|
+
var dateSelectorTranslations = {};
|
|
8005
|
+
if ((translations === null || translations === void 0 ? void 0 : translations.dayOption) !== undefined) {
|
|
8006
|
+
dateSelectorTranslations.dayOption = translations.dayOption;
|
|
8007
|
+
}
|
|
8008
|
+
if ((translations === null || translations === void 0 ? void 0 : translations.dateRangeOption) !== undefined) {
|
|
8009
|
+
dateSelectorTranslations.dateRangeOption = translations.dateRangeOption;
|
|
8010
|
+
}
|
|
8011
|
+
if ((translations === null || translations === void 0 ? void 0 : translations.selectDateAriaLabel) !== undefined) {
|
|
8012
|
+
dateSelectorTranslations.selectDateAriaLabel =
|
|
8013
|
+
translations.selectDateAriaLabel;
|
|
8014
|
+
}
|
|
8015
|
+
if ((translations === null || translations === void 0 ? void 0 : translations.selectDateRangeAriaLabel) !== undefined) {
|
|
8016
|
+
dateSelectorTranslations.selectDateRangeAriaLabel =
|
|
8017
|
+
translations.selectDateRangeAriaLabel;
|
|
8018
|
+
}
|
|
8019
|
+
return (jsx(DateSelector, { initialType: getInitialType(), initialDate: getInitialDate(), initialDateRange: getInitialDateRange(), onChange: handleDateSelectorChange, translations: dateSelectorTranslations, className: "w-full" }));
|
|
7793
8020
|
};
|
|
7794
8021
|
// =========================================================================
|
|
7795
8022
|
// TEXT FILTER
|
|
@@ -8902,28 +9129,6 @@ ModalBody.displayName = "ModalBody";
|
|
|
8902
9129
|
|
|
8903
9130
|
var ModalFooter = ModalFooter$1;
|
|
8904
9131
|
|
|
8905
|
-
var paddingClasses = {
|
|
8906
|
-
sm: "p-4",
|
|
8907
|
-
md: "p-6",
|
|
8908
|
-
lg: "p-8",
|
|
8909
|
-
};
|
|
8910
|
-
|
|
8911
|
-
/**
|
|
8912
|
-
* Card genérica siguiendo las reglas de diseño BeweOS basada en HeroUI.
|
|
8913
|
-
*
|
|
8914
|
-
* Reglas aplicadas:
|
|
8915
|
-
* - Shadow: none, sm, md, lg (configurable)
|
|
8916
|
-
* - Radius: sm (por defecto, configurable)
|
|
8917
|
-
* - Padding configurable (sm, md, lg)
|
|
8918
|
-
* - Hereda de HeroUI Card con personalización BeweOS
|
|
8919
|
-
*/
|
|
8920
|
-
var Card = function (_a) {
|
|
8921
|
-
var children = _a.children, _b = _a.className, className = _b === void 0 ? "" : _b, _c = _a.shadow, shadow = _c === void 0 ? "sm" : _c, _d = _a.radius, radius = _d === void 0 ? "sm" : _d, _e = _a.padding, padding = _e === void 0 ? "md" : _e, props = __rest(_a, ["children", "className", "shadow", "radius", "padding"]);
|
|
8922
|
-
var paddingClass = paddingClasses[padding];
|
|
8923
|
-
var combinedClassName = [paddingClass, className].filter(Boolean).join(" ");
|
|
8924
|
-
return (jsx(Card$1, __assign({ shadow: shadow, radius: radius, className: combinedClassName }, props, { children: children })));
|
|
8925
|
-
};
|
|
8926
|
-
|
|
8927
9132
|
/**
|
|
8928
9133
|
* Tooltip - Componente BeweOS basado en HeroUI.
|
|
8929
9134
|
*
|
|
@@ -9466,4 +9671,4 @@ var NavigationLoadingProvider = function (_a) {
|
|
|
9466
9671
|
return (jsxs(NavigationLoadingContext.Provider, { value: value, children: [children, jsx(NavigationLoadingOverlay, { isVisible: isVisible })] }));
|
|
9467
9672
|
};
|
|
9468
9673
|
|
|
9469
|
-
export { ALL_THEMES, AURORA_THEME_FAMILIES, AURORA_THEME_REGISTRY, AccordionList, AddHolidayForm, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, BEWEOS_THEME_MODE_COOKIE_NAME, BreadcrumbsComponent, Button, Card, Chip, ColorPicker, ColorSelector, ContentCarousel, Currency, DEFAULT_PREDEFINED_COLORS, DatePicker, DateRangePicker, DateSelector, DrawerFilters, EmailPreview, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, MenuClaw, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, REGISTERED_THEME_COLORS, RangeFilter, RowSteps, DEFAULT_TRANSLATIONS$1 as SEGMENTATION_DEFAULT_TRANSLATIONS, ScheduleRow, SearchInput, SegmentationBuilder, Select, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StepIndicator, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, Tooltip, TwoColumnLayoutAgent, UploadFile, VerticalSteps, ViolinPlot, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, createCurrencyFormatter, uniqueCountries as defaultCountries, defaultCurrencyOptions, defaultTranslations$5 as defaultTranslations, forceLightOnlyThemeBeforeReact, formatAuroraThemeTooltip, generateThemeColorScale, getContrastForeground, getRegisteredThemeColorBases, getSelectedKeyFromPath, hexToThemeColor, hslToCssValue, isAuroraFullThemeId, isExactThemeColor, isGroupState, isHexColor, isSegmentationGroup, removeCustomPrimaryColor, sizeMap, themeColors, useAuraToast, useCloseOnAncestorScroll, useMediaQuery, useNavigationLoading, useThemeContext };
|
|
9674
|
+
export { ALL_THEMES, AURORA_THEME_FAMILIES, AURORA_THEME_REGISTRY, AccordionList, AddHolidayForm, AnalyticsCard, AreaLineChart, AuraAutocomplete, AuraTable, AuraToastProvider, BEWEOS_THEME_MODE_COOKIE_NAME, BreadcrumbsComponent, Button, Card, Chip, ColorPicker, ColorSelector, ContentCarousel, Currency, DEFAULT_DONUT_COLORS, DEFAULT_PREDEFINED_COLORS, DEFAULT_RANKED_BAR_COLORS, DatePicker, DateRangePicker, DateSelector, DonutChart, DrawerFilters, EmailPreview, EnumMenuNavListItem, GlobalToast, H1, H2, H3, H4, HeaderComponent, HolidayType, IconComponent, ImagePreview, Input, InputPassword, Kanban, KanbanCard, KanbanColumn, MenuClaw, MenuComponent, Modal, ModalBody, ModalContent, ModalFooter, ModalHeader, MultiStepWizard, NavigationLoadingContext, NavigationLoadingOverlay, NavigationLoadingProvider, P, Pagination, Phone, PromotionalBanner, REGISTERED_THEME_COLORS, RangeFilter, RankedBarList, RowSteps, DEFAULT_TRANSLATIONS$1 as SEGMENTATION_DEFAULT_TRANSLATIONS, ScheduleRow, SearchInput, SegmentationBuilder, Select, SimpleLineChart, SocialMediaBar, SocialMediaCarousel, SocialMediaPreview, StatTile, StepIndicator, Switch as SwitchComponent, THEME_COLOR_HEX_MAP, TagsFilter, Textarea, ThemeContext, ThemePicker, ThemeProvider, TimeInput as TimeInputComponent, ToastContext, Tooltip, TwoColumnLayoutAgent, UploadFile, VerticalSteps, ViolinPlot, WhatsAppPreview, Wizard, WizardNavigation, WizardSidebar, applyCustomPrimaryColor, computeBars, computeMax, computeSlices, computeTotal, createCurrencyFormatter, uniqueCountries as defaultCountries, defaultCurrencyOptions, defaultTranslations$5 as defaultTranslations, forceLightOnlyThemeBeforeReact, formatAuroraThemeTooltip, generateThemeColorScale, getContrastForeground, getRegisteredThemeColorBases, getSelectedKeyFromPath, hexToThemeColor, hslToCssValue, isAuroraFullThemeId, isDonutEmpty, isExactThemeColor, isGroupState, isHexColor, isRankedBarListEmpty, isSegmentationGroup, removeCustomPrimaryColor, sizeMap, themeColors, useAuraToast, useCloseOnAncestorScroll, useMediaQuery, useNavigationLoading, useThemeContext };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AreaLineChartProps } from "./AreaLineChart.types";
|
|
2
|
-
export declare function AreaLineChart<T extends Record<string, unknown>>({ data, xAxisKey, series, title, value, trend, height, className, wrappedInCard, formatTooltipValue, }: AreaLineChartProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function AreaLineChart<T extends Record<string, unknown>>({ data, xAxisKey, series, title, value, trend, height, className, wrappedInCard, formatTooltipValue, yAxisDomain, }: AreaLineChartProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=AreaLineChart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaLineChart.d.ts","sourceRoot":"","sources":["../../../../src/components/area-line-chart/AreaLineChart.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AreaLineChart.d.ts","sourceRoot":"","sources":["../../../../src/components/area-line-chart/AreaLineChart.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACX,kBAAkB,EAElB,MAAM,uBAAuB,CAAC;AAgD/B,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAChE,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAY,EACZ,SAAc,EACd,aAAqB,EACrB,kBAAkB,EAClB,WAAkC,GAClC,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAoJvB"}
|
|
@@ -27,5 +27,13 @@ export interface AreaLineChartProps<T extends Record<string, unknown> = Record<s
|
|
|
27
27
|
wrappedInCard?: boolean;
|
|
28
28
|
/** Formatear valor en tooltip (valor, dataKey) */
|
|
29
29
|
formatTooltipValue?: (value: number, dataKey: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Dominio del eje Y, en el formato de Recharts (acepta números o
|
|
32
|
+
* expresiones como "dataMax + 5"). Si no se envía, se mantiene el
|
|
33
|
+
* comportamiento por defecto del componente (`[0, "dataMax + 100"]`).
|
|
34
|
+
* El cálculo a partir de los datos (ej. máximo real * 1.2) le
|
|
35
|
+
* corresponde a quien consume el componente, no a AreaLineChart.
|
|
36
|
+
*/
|
|
37
|
+
yAxisDomain?: [number | string, number | string];
|
|
30
38
|
}
|
|
31
39
|
//# sourceMappingURL=AreaLineChart.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AreaLineChart.types.d.ts","sourceRoot":"","sources":["../../../../src/components/area-line-chart/AreaLineChart.types.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,WAAW,yBAAyB;IACzC,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AreaLineChart.types.d.ts","sourceRoot":"","sources":["../../../../src/components/area-line-chart/AreaLineChart.types.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,MAAM,WAAW,yBAAyB;IACzC,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB,CAClC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAE3D,gFAAgF;IAChF,IAAI,EAAE,CAAC,EAAE,CAAC;IACV,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,MAAM,EAAE,yBAAyB,EAAE,CAAC;IACpC,yBAAyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kDAAkD;IAClD,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAChE;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACjD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { DonutChartProps } from "./DonutChart.types";
|
|
3
|
+
/**
|
|
4
|
+
* DonutChart - Gráfico circular (pie o donut, según `innerRadiusRatio`) con
|
|
5
|
+
* leyenda y total central propios, renderizados fuera del árbol de Recharts
|
|
6
|
+
* para que sean estables independientemente del tamaño medido del contenedor.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DonutChart: React.FC<DonutChartProps>;
|
|
9
|
+
//# sourceMappingURL=DonutChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.d.ts","sourceRoot":"","sources":["../../../../src/components/donut-chart/DonutChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EACX,eAAe,EAEf,MAAM,oBAAoB,CAAC;AAQ5B;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA4EhD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type DonutChartDatum = {
|
|
2
|
+
/** Nombre de la categoría (se usa como key de React y en la leyenda/tooltip). */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Valor numérico de la categoría. Valores negativos se tratan como 0. */
|
|
5
|
+
value: number;
|
|
6
|
+
/** Color fijo de esta categoría. Si se omite, se resuelve de la paleta por índice. */
|
|
7
|
+
color?: string;
|
|
8
|
+
};
|
|
9
|
+
export type DonutChartSlice = DonutChartDatum & {
|
|
10
|
+
/** Color ya resuelto (propio o de la paleta). */
|
|
11
|
+
color: string;
|
|
12
|
+
/** Proporción sobre el total, entre 0 y 1. */
|
|
13
|
+
percent: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Traducciones disponibles para el componente.
|
|
17
|
+
* Todas las propiedades son opcionales para permitir traducciones parciales.
|
|
18
|
+
*/
|
|
19
|
+
export type DonutChartTranslations = {
|
|
20
|
+
/** Texto cuando no hay datos o todos los valores son 0. */
|
|
21
|
+
emptyState?: string;
|
|
22
|
+
/** Etiqueta sobre el total, en el centro del donut (solo si `innerRadiusRatio > 0`). */
|
|
23
|
+
totalLabel?: string;
|
|
24
|
+
};
|
|
25
|
+
export type DonutChartProps = {
|
|
26
|
+
/** Categorías a graficar. */
|
|
27
|
+
data: DonutChartDatum[];
|
|
28
|
+
/** Alto del gráfico en px (el ancho es 100% del contenedor). @default 220 */
|
|
29
|
+
height?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Radio interior como proporción del radio exterior: 0 dibuja un pie
|
|
32
|
+
* completo, valores > 0 dibujan un donut (más alto = anillo más fino).
|
|
33
|
+
* @default 0.65
|
|
34
|
+
*/
|
|
35
|
+
innerRadiusRatio?: number;
|
|
36
|
+
/** Muestra la leyenda con nombre + porcentaje debajo del gráfico. @default true */
|
|
37
|
+
showLegend?: boolean;
|
|
38
|
+
/** Muestra el total en el centro (solo aplica si `innerRadiusRatio > 0`). @default true */
|
|
39
|
+
showTotal?: boolean;
|
|
40
|
+
/** Paleta de color de respaldo, ciclada por índice para categorías sin `color` propio. */
|
|
41
|
+
colors?: string[];
|
|
42
|
+
/** Formateo a medida del valor mostrado en el tooltip/centro (por defecto, el número tal cual). */
|
|
43
|
+
formatValue?: (value: number) => string;
|
|
44
|
+
/**
|
|
45
|
+
* Traducciones i18n del componente.
|
|
46
|
+
* Si no se proporciona, usa traducciones por defecto en español.
|
|
47
|
+
*/
|
|
48
|
+
translations?: DonutChartTranslations;
|
|
49
|
+
className?: string;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=DonutChart.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DonutChart.types.d.ts","sourceRoot":"","sources":["../../../../src/components/donut-chart/DonutChart.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC7B,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG;IAC/C,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACpC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,6BAA6B;IAC7B,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,2FAA2F;IAC3F,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,0FAA0F;IAC1F,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,mGAAmG;IACnG,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC;;;OAGG;IACH,YAAY,CAAC,EAAE,sBAAsB,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DonutChartDatum, DonutChartSlice } from "./DonutChart.types";
|
|
2
|
+
/** Paleta categórica por defecto: primary/secondary/success/warning/danger de BeweOS. */
|
|
3
|
+
export declare const DEFAULT_DONUT_COLORS: string[];
|
|
4
|
+
export declare function computeTotal(data: DonutChartDatum[]): number;
|
|
5
|
+
/**
|
|
6
|
+
* `true` cuando no hay datos o todos los valores son 0 — mismo criterio que el
|
|
7
|
+
* `NotData` legacy de Guru.js: un donut sin nada que repartir no aporta información.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isDonutEmpty(data: DonutChartDatum[]): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Resuelve las proporciones y el color final de cada categoría.
|
|
12
|
+
* El color propio de cada dato tiene prioridad; si falta, se cicla `palette` por índice.
|
|
13
|
+
*/
|
|
14
|
+
export declare function computeSlices(data: DonutChartDatum[], palette?: string[]): DonutChartSlice[];
|
|
15
|
+
//# sourceMappingURL=donut-chart.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"donut-chart.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/donut-chart/donut-chart.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE3E,yFAAyF;AACzF,eAAO,MAAM,oBAAoB,UAMhC,CAAC;AAMF,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,CAE5D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,OAAO,CAE7D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC5B,IAAI,EAAE,eAAe,EAAE,EACvB,OAAO,GAAE,MAAM,EAAyB,GACtC,eAAe,EAAE,CAWnB"}
|