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