@axzydev/axzy_ui_system 1.8.5 → 1.8.6

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 CHANGED
@@ -51,6 +51,7 @@ __export(index_exports, {
51
51
  ITBentoPillRow: () => ITBentoPillRow,
52
52
  ITBentoSegments: () => ITBentoSegments,
53
53
  ITBentoSpark: () => ITBentoSpark,
54
+ ITBentoStatStrip: () => ITBentoStatStrip,
54
55
  ITBentoTile: () => ITBentoTile,
55
56
  ITBentoWaves: () => ITBentoWaves,
56
57
  ITBentoWeekBars: () => ITBentoWeekBars,
@@ -2435,6 +2436,51 @@ function ITBentoFeed({ groups, onItemClick, maxHeight = 330 }) {
2435
2436
  ) }, item.id)) })
2436
2437
  ] }, group.key)) });
2437
2438
  }
2439
+ function ITBentoStatStrip({ items, activeId, onSelect, stack = false, className }) {
2440
+ const [hovered, setHovered] = (0, import_react17.useState)(null);
2441
+ const focus = hovered ?? activeId ?? null;
2442
+ const total = items.reduce((acc, item) => acc + (typeof item.value === "number" ? item.value : 0), 0);
2443
+ const clickable = typeof onSelect === "function";
2444
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_clsx9.default)("it-bento-statstrip", className), children: [
2445
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "it-bento-statstrip__grid", style: { ["--it-bento-cols"]: Math.min(items.length, 4) }, children: items.map((item) => {
2446
+ const on = item.id === activeId;
2447
+ const Tag = clickable ? "button" : "div";
2448
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2449
+ Tag,
2450
+ {
2451
+ type: clickable ? "button" : void 0,
2452
+ className: (0, import_clsx9.default)("it-bento-statstrip__item", on && "is-on"),
2453
+ style: { ["--it-bento-c"]: item.color ?? "currentColor" },
2454
+ onClick: clickable ? () => onSelect?.(item.id) : void 0,
2455
+ onMouseEnter: () => setHovered(item.id),
2456
+ onMouseLeave: () => setHovered(null),
2457
+ children: [
2458
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "it-bento-statstrip__label", children: [
2459
+ item.color && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { style: { background: item.color }, "aria-hidden": true }),
2460
+ item.label
2461
+ ] }),
2462
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "it-bento-statstrip__row", children: [
2463
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "it-bento-statstrip__value", children: item.value }),
2464
+ item.caption && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("small", { className: "it-bento-statstrip__caption", children: item.caption })
2465
+ ] })
2466
+ ]
2467
+ },
2468
+ item.id
2469
+ );
2470
+ }) }),
2471
+ stack && total > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_clsx9.default)("it-bento-statstrip__stack", focus && "is-dim"), "aria-hidden": true, children: items.filter((item) => typeof item.value === "number" && item.value > 0).map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2472
+ "i",
2473
+ {
2474
+ className: (0, import_clsx9.default)(item.id === focus && "is-on"),
2475
+ style: { width: `${(Number(item.value) || 0) / total * 100}%`, background: item.color ?? "currentColor" },
2476
+ onMouseEnter: () => setHovered(item.id),
2477
+ onMouseLeave: () => setHovered(null),
2478
+ onClick: clickable ? () => onSelect?.(item.id) : void 0
2479
+ },
2480
+ item.id
2481
+ )) })
2482
+ ] });
2483
+ }
2438
2484
  function ITBentoPill({ children, dot, color, className }) {
2439
2485
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: (0, import_clsx9.default)("it-bento-pill", className), style: color ? { color } : void 0, children: [
2440
2486
  dot && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: "it-bento-pill__dot", style: { background: dot }, "aria-hidden": true }),
@@ -17974,6 +18020,7 @@ var createValidationSchema = (fields) => Yup.object().shape(
17974
18020
  ITBentoPillRow,
17975
18021
  ITBentoSegments,
17976
18022
  ITBentoSpark,
18023
+ ITBentoStatStrip,
17977
18024
  ITBentoTile,
17978
18025
  ITBentoWaves,
17979
18026
  ITBentoWeekBars,