@axzydev/axzy_ui_system 1.8.6 → 1.8.7
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/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/organisms/bento/bento.tsx +9 -3
package/package.json
CHANGED
|
@@ -422,6 +422,11 @@ export interface ITBentoStatStripProps {
|
|
|
422
422
|
onSelect?: (id: string) => void;
|
|
423
423
|
/** Dibuja la barra apilada con la proporción de cada cifra. */
|
|
424
424
|
stack?: boolean;
|
|
425
|
+
/**
|
|
426
|
+
* Cifras que forman la barra, cuando no todas las de la tira se suman
|
|
427
|
+
* (p. ej. «sin asignar» es un subconjunto de «abiertos»). Por defecto usa `items`.
|
|
428
|
+
*/
|
|
429
|
+
stackItems?: ITBentoStatItem[];
|
|
425
430
|
className?: string;
|
|
426
431
|
}
|
|
427
432
|
|
|
@@ -430,10 +435,11 @@ export interface ITBentoStatStripProps {
|
|
|
430
435
|
* por línea fina y, si se pide, la barra apilada con la proporción de cada uno.
|
|
431
436
|
* Al pasar el cursor por un bloque se resalta su segmento de la barra.
|
|
432
437
|
*/
|
|
433
|
-
export function ITBentoStatStrip({ items, activeId, onSelect, stack = false, className }: ITBentoStatStripProps) {
|
|
438
|
+
export function ITBentoStatStrip({ items, activeId, onSelect, stack = false, stackItems, className }: ITBentoStatStripProps) {
|
|
434
439
|
const [hovered, setHovered] = useState<string | null>(null);
|
|
435
440
|
const focus = hovered ?? activeId ?? null;
|
|
436
|
-
const
|
|
441
|
+
const parts = stackItems ?? items;
|
|
442
|
+
const total = parts.reduce((acc, item) => acc + (typeof item.value === "number" ? item.value : 0), 0);
|
|
437
443
|
const clickable = typeof onSelect === "function";
|
|
438
444
|
|
|
439
445
|
return (
|
|
@@ -467,7 +473,7 @@ export function ITBentoStatStrip({ items, activeId, onSelect, stack = false, cla
|
|
|
467
473
|
|
|
468
474
|
{stack && total > 0 && (
|
|
469
475
|
<div className={clsx("it-bento-statstrip__stack", focus && "is-dim")} aria-hidden>
|
|
470
|
-
{
|
|
476
|
+
{parts
|
|
471
477
|
.filter((item) => typeof item.value === "number" && item.value > 0)
|
|
472
478
|
.map((item) => (
|
|
473
479
|
<i
|