@platned/ui 0.8.2 → 0.8.3

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
@@ -3680,7 +3680,7 @@ function FormCard({
3680
3680
  }
3681
3681
  function FormCardHeader({ title, subtitle }) {
3682
3682
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "border-b border-default px-7 py-6", children: [
3683
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "text-heading-sm font-semibold text-default leading-snug", children: title }),
3683
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "text-heading-sm font-semibold text-default leading-snug [overflow-wrap:anywhere]", children: title }),
3684
3684
  subtitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-1 text-body-xs text-default-secondary", children: subtitle })
3685
3685
  ] });
3686
3686
  }
@@ -4760,7 +4760,7 @@ var Checkbox = (0, import_react29.forwardRef)(function Checkbox2({
4760
4760
  size: size2
4761
4761
  }
4762
4762
  ),
4763
- label && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: (0, import_clsx38.default)(LABEL_TEXT2[size2], "text-default"), children: label })
4763
+ label && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: (0, import_clsx38.default)(LABEL_TEXT2[size2], "min-w-0 text-default [overflow-wrap:anywhere]"), children: label })
4764
4764
  ]
4765
4765
  }
4766
4766
  ),
@@ -4769,7 +4769,7 @@ var Checkbox = (0, import_react29.forwardRef)(function Checkbox2({
4769
4769
  {
4770
4770
  id: descriptionId,
4771
4771
  className: (0, import_clsx38.default)(
4772
- "mt-0.5 pl-[26px]",
4772
+ "mt-0.5 pl-[26px] [overflow-wrap:anywhere]",
4773
4773
  LABEL_TEXT2[size2],
4774
4774
  disabled ? "text-disabled" : "text-default-secondary"
4775
4775
  ),
@@ -10132,7 +10132,7 @@ function DetailItem({
10132
10132
  if (layout === "inline") {
10133
10133
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: (0, import_clsx86.default)("flex gap-3 text-body-xs", SPAN[span], className), children: [
10134
10134
  /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: (0, import_clsx86.default)("shrink-0 text-default-secondary", labelWidth), children: label }),
10135
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5", children: [
10135
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("span", { className: "flex min-w-0 flex-1 flex-col gap-0.5 [overflow-wrap:anywhere]", children: [
10136
10136
  /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-default", children: shown }),
10137
10137
  detail && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "text-default-secondary", children: detail })
10138
10138
  ] })
@@ -10140,8 +10140,8 @@ function DetailItem({
10140
10140
  }
10141
10141
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: (0, import_clsx86.default)("flex min-w-0 flex-col gap-0.5", SPAN[span], className), children: [
10142
10142
  /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("p", { className: "text-body-tiny font-medium text-default-secondary", children: label }),
10143
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("p", { className: "text-body-sm font-medium text-default", children: shown }),
10144
- detail && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("p", { className: "text-body-xs text-default-secondary", children: detail })
10143
+ /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("p", { className: "text-body-sm font-medium text-default [overflow-wrap:anywhere]", children: shown }),
10144
+ detail && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("p", { className: "text-body-xs text-default-secondary [overflow-wrap:anywhere]", children: detail })
10145
10145
  ] });
10146
10146
  }
10147
10147
  var COLUMNS3 = {
@@ -10832,13 +10832,23 @@ function DataTablePagination({
10832
10832
  // src/components/lists/data-table-cells.tsx
10833
10833
  var import_clsx93 = __toESM(require("clsx"), 1);
10834
10834
  var import_jsx_runtime116 = require("react/jsx-runtime");
10835
+ function textFromNode(node) {
10836
+ if (typeof node === "string") return node;
10837
+ if (typeof node === "number") return String(node);
10838
+ if (Array.isArray(node)) {
10839
+ const parts4 = node.map(textFromNode);
10840
+ return parts4.every((part) => part !== void 0) ? parts4.join("") : void 0;
10841
+ }
10842
+ return void 0;
10843
+ }
10835
10844
  function TableCellLeadText({ primary, secondary, size: size2 = "md", className }) {
10836
- return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: (0, import_clsx93.default)("flex flex-col gap-0.5", className), children: [
10845
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: (0, import_clsx93.default)("flex min-w-0 flex-col gap-0.5", className), children: [
10837
10846
  /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
10838
10847
  "span",
10839
10848
  {
10849
+ title: primary,
10840
10850
  className: (0, import_clsx93.default)(
10841
- "font-medium leading-snug text-default",
10851
+ "block truncate font-medium leading-snug text-default",
10842
10852
  size2 === "sm" ? "text-body-xs" : "text-body-sm"
10843
10853
  ),
10844
10854
  children: primary
@@ -10847,8 +10857,9 @@ function TableCellLeadText({ primary, secondary, size: size2 = "md", className }
10847
10857
  secondary && /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
10848
10858
  "span",
10849
10859
  {
10860
+ title: secondary,
10850
10861
  className: (0, import_clsx93.default)(
10851
- "font-normal leading-tight text-default-secondary",
10862
+ "block truncate font-normal leading-tight text-default-secondary",
10852
10863
  size2 === "sm" ? "text-body-tiny" : "text-body-xs"
10853
10864
  ),
10854
10865
  children: secondary
@@ -10860,16 +10871,17 @@ function TableCellText({
10860
10871
  children,
10861
10872
  muted = true,
10862
10873
  size: size2 = "md",
10863
- truncate = false,
10874
+ truncate = true,
10864
10875
  className
10865
10876
  }) {
10866
10877
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
10867
10878
  "span",
10868
10879
  {
10880
+ title: truncate ? textFromNode(children) : void 0,
10869
10881
  className: (0, import_clsx93.default)(
10870
10882
  "font-normal leading-snug",
10871
10883
  size2 === "sm" ? "text-body-tiny" : "text-body-xs",
10872
- truncate ? "block truncate" : "whitespace-nowrap",
10884
+ truncate ? "block min-w-0 truncate" : "whitespace-nowrap",
10873
10885
  muted ? "text-default-secondary" : "text-default",
10874
10886
  className
10875
10887
  ),
@@ -10881,11 +10893,12 @@ function TableCellBadge({ label, className }) {
10881
10893
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
10882
10894
  "span",
10883
10895
  {
10896
+ title: label,
10884
10897
  className: (0, import_clsx93.default)(
10885
- "inline-flex items-center rounded-md border border-default bg-default-secondary px-2 py-0.5 text-body-tiny font-medium text-default-secondary whitespace-nowrap",
10898
+ "inline-flex max-w-full items-center rounded-md border border-default bg-default-secondary px-2 py-0.5 text-body-tiny font-medium text-default-secondary",
10886
10899
  className
10887
10900
  ),
10888
- children: label
10901
+ children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "truncate", children: label })
10889
10902
  }
10890
10903
  );
10891
10904
  }
@@ -10893,9 +10906,10 @@ function TableCellProgress({
10893
10906
  percent,
10894
10907
  tone = "brand",
10895
10908
  size: size2 = "md",
10909
+ label,
10896
10910
  className
10897
10911
  }) {
10898
- const clamped = Math.min(100, Math.max(0, percent));
10912
+ const clamped = Math.round(Math.min(100, Math.max(0, percent)));
10899
10913
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: (0, import_clsx93.default)("flex w-full min-w-0 items-center gap-2", className), children: [
10900
10914
  /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
10901
10915
  ProgressBar,
@@ -10904,11 +10918,11 @@ function TableCellProgress({
10904
10918
  tone,
10905
10919
  size: size2 === "sm" ? "xs" : "sm",
10906
10920
  className: "min-w-12 flex-1",
10907
- "aria-label": `${clamped}%`
10921
+ "aria-label": label ?? `${clamped}%`
10908
10922
  }
10909
10923
  ),
10910
10924
  /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("span", { className: "shrink-0 text-body-tiny leading-none tabular-nums text-default-secondary", children: [
10911
- percent,
10925
+ clamped,
10912
10926
  "%"
10913
10927
  ] })
10914
10928
  ] });
@@ -11406,7 +11420,7 @@ function BodyCell({
11406
11420
  [ROW_LINK_ATTR]: "",
11407
11421
  className: cn("block min-w-0 rounded-sm", FOCUS_RING_INSET),
11408
11422
  children: content
11409
- });
11423
+ }, cell.row.original);
11410
11424
  }
11411
11425
  return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
11412
11426
  "td",
@@ -11502,7 +11516,7 @@ function CardList({
11502
11516
  children: [
11503
11517
  /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "flex items-start gap-3", children: [
11504
11518
  selectable && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "relative z-raised shrink-0 pt-0.5", children: render(SELECT_COLUMN_ID) }),
11505
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "min-w-0 flex-1", children: href ? renderRowLink({ href, [ROW_LINK_ATTR]: "", className: trigger, children: titleContent }) : onRowClick ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
11519
+ /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "min-w-0 flex-1", children: href ? renderRowLink({ href, [ROW_LINK_ATTR]: "", className: trigger, children: titleContent }, row.original) : onRowClick ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
11506
11520
  "button",
11507
11521
  {
11508
11522
  type: "button",
@@ -11764,7 +11778,7 @@ function Toaster({
11764
11778
  "aria-atomic": "false",
11765
11779
  ...{ [TOASTER_ATTRIBUTE]: "" },
11766
11780
  className: (0, import_clsx97.default)(
11767
- "pointer-events-none fixed z-toast flex w-full max-w-[380px] flex-col gap-2",
11781
+ "pointer-events-none fixed z-toast flex w-[calc(100%-2rem)] max-w-[380px] flex-col gap-2",
11768
11782
  POSITION[position]
11769
11783
  ),
11770
11784
  children: toasts.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ToastItem, { toast: entry, onDismiss: () => dismiss(entry.id) }, entry.id))