@mediaradar/design-components 0.26.0 → 0.30.0

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
@@ -1498,6 +1498,16 @@ function cx4(...classes) {
1498
1498
  function slug3(value) {
1499
1499
  return value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
1500
1500
  }
1501
+ function OptionIcon({ children }) {
1502
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1503
+ "span",
1504
+ {
1505
+ "aria-hidden": "true",
1506
+ className: "flex h-3 w-4 shrink-0 items-center justify-center overflow-hidden text-text-secondary *:max-h-full *:max-w-full",
1507
+ children
1508
+ }
1509
+ );
1510
+ }
1501
1511
  function SelectFilter({
1502
1512
  caption,
1503
1513
  value,
@@ -1506,7 +1516,8 @@ function SelectFilter({
1506
1516
  align = "left",
1507
1517
  fullWidth = false,
1508
1518
  className,
1509
- testIdPrefix
1519
+ testIdPrefix,
1520
+ renderIcon
1510
1521
  }) {
1511
1522
  const [open, setOpen] = (0, import_react7.useState)(false);
1512
1523
  const [pos, setPos] = (0, import_react7.useState)(null);
@@ -1541,6 +1552,7 @@ function SelectFilter({
1541
1552
  window.removeEventListener("scroll", reposition, true);
1542
1553
  };
1543
1554
  }, [open, close, reposition]);
1555
+ const valueText = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value });
1544
1556
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: cx4("relative", fullWidth && "w-full"), ref, children: [
1545
1557
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1546
1558
  "button",
@@ -1558,7 +1570,10 @@ function SelectFilter({
1558
1570
  children: [
1559
1571
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex flex-col gap-1 text-left leading-none", children: [
1560
1572
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-control-caption uppercase tracking-wide text-text-tertiary", children: caption }),
1561
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-[12px] font-medium text-text-primary", children: value })
1573
+ renderIcon ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "flex items-center gap-1.5", children: [
1574
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(OptionIcon, { children: renderIcon(value) }),
1575
+ valueText
1576
+ ] }) : valueText
1562
1577
  ] }),
1563
1578
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1564
1579
  import_lucide_react10.ChevronDown,
@@ -1600,6 +1615,7 @@ function SelectFilter({
1600
1615
  className: "flex w-full items-center gap-2.5 rounded-control px-2 py-2 text-left transition-colors hover:bg-subtle",
1601
1616
  children: [
1602
1617
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center text-brand-primaryAction", children: selected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react10.Check, { size: 15, strokeWidth: 3 }) }),
1618
+ renderIcon && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(OptionIcon, { children: renderIcon(o) }),
1603
1619
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1604
1620
  "span",
1605
1621
  {
@@ -3328,7 +3344,7 @@ function Pager({ page, totalPages, onPage, disabled = false, label = "Pagination
3328
3344
  btn,
3329
3345
  p === page ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3330
3346
  ),
3331
- children: p
3347
+ children: p.toLocaleString()
3332
3348
  },
3333
3349
  p
3334
3350
  )
@@ -3572,7 +3588,7 @@ function TablePagination({
3572
3588
  off,
3573
3589
  p === current ? "bg-brand-primaryAction font-semibold text-brand-onprimary" : "text-text-secondary hover:bg-subtle hover:text-text-primary"
3574
3590
  ),
3575
- children: p
3591
+ children: p.toLocaleString()
3576
3592
  },
3577
3593
  p
3578
3594
  )