@axzydev/axzy_ui_system 1.8.4 → 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
@@ -47,8 +47,11 @@ __export(index_exports, {
47
47
  ITBentoGauge: () => ITBentoGauge,
48
48
  ITBentoGrid: () => ITBentoGrid,
49
49
  ITBentoLive: () => ITBentoLive,
50
+ ITBentoPill: () => ITBentoPill,
51
+ ITBentoPillRow: () => ITBentoPillRow,
50
52
  ITBentoSegments: () => ITBentoSegments,
51
53
  ITBentoSpark: () => ITBentoSpark,
54
+ ITBentoStatStrip: () => ITBentoStatStrip,
52
55
  ITBentoTile: () => ITBentoTile,
53
56
  ITBentoWaves: () => ITBentoWaves,
54
57
  ITBentoWeekBars: () => ITBentoWeekBars,
@@ -2433,6 +2436,60 @@ function ITBentoFeed({ groups, onItemClick, maxHeight = 330 }) {
2433
2436
  ) }, item.id)) })
2434
2437
  ] }, group.key)) });
2435
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
+ }
2484
+ function ITBentoPill({ children, dot, color, className }) {
2485
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: (0, import_clsx9.default)("it-bento-pill", className), style: color ? { color } : void 0, children: [
2486
+ dot && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("i", { className: "it-bento-pill__dot", style: { background: dot }, "aria-hidden": true }),
2487
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "it-bento-pill__text", children })
2488
+ ] });
2489
+ }
2490
+ function ITBentoPillRow({ children, className }) {
2491
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_clsx9.default)("flex flex-wrap items-center gap-1.5", className), children });
2492
+ }
2436
2493
  function ITBentoLive({ label, className }) {
2437
2494
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2438
2495
  "span",
@@ -17959,8 +18016,11 @@ var createValidationSchema = (fields) => Yup.object().shape(
17959
18016
  ITBentoGauge,
17960
18017
  ITBentoGrid,
17961
18018
  ITBentoLive,
18019
+ ITBentoPill,
18020
+ ITBentoPillRow,
17962
18021
  ITBentoSegments,
17963
18022
  ITBentoSpark,
18023
+ ITBentoStatStrip,
17964
18024
  ITBentoTile,
17965
18025
  ITBentoWaves,
17966
18026
  ITBentoWeekBars,