@platned/ui 0.9.0 → 0.9.1

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.d.cts CHANGED
@@ -3090,7 +3090,16 @@ declare function PageHeading({ title, subtitle, size, as, actions, truncateTitle
3090
3090
 
3091
3091
  type PageToolbarSize = 'sm' | 'md';
3092
3092
  interface PageToolbarProps {
3093
+ /** The heading block (usually a `PageHeading`). Without `actions`, the actions as well (legacy). */
3093
3094
  children: ReactNode;
3095
+ /**
3096
+ * The action cluster, e.g. buttons. New in 0.9.1. Passing it makes the bar responsive: on a
3097
+ * wide screen the actions sit on the heading's row, at the right; when they don't fit, they
3098
+ * wrap below the heading and among themselves. The heading never narrows below 12rem (or the
3099
+ * full width, if less). Without it, children keep the old single-row layout, which squeezed
3100
+ * the heading to a sliver and ran the actions off-screen on a phone.
3101
+ */
3102
+ actions?: ReactNode;
3094
3103
  /**
3095
3104
  * Renders an icon-only back control at the far left, ahead of the heading: the Page Header's
3096
3105
  * `backButton` in Figma (node 3473:16837). New in 0.7.0, from SCIC. Omit for no back control.
@@ -3098,7 +3107,10 @@ interface PageToolbarProps {
3098
3107
  onBack?: () => void;
3099
3108
  /** Accessible name for the back control. Default "Go back". */
3100
3109
  backLabel?: string;
3101
- /** Allow the row to wrap when the action cluster is wide (entity-detail has seven buttons). */
3110
+ /**
3111
+ * Allow the row to wrap when the action cluster is wide (entity-detail has seven buttons).
3112
+ * @deprecated Pass the actions through `actions`, which always wraps where needed.
3113
+ */
3102
3114
  wrap?: boolean;
3103
3115
  /**
3104
3116
  * The bar's **own** height and padding. `sm` suits a secondary bar under the main toolbar.
@@ -3119,7 +3131,7 @@ interface PageToolbarProps {
3119
3131
  * variant is adopted here, which is a deliberate improvement below `md` where the
3120
3132
  * fixed 28px padding was cramped.
3121
3133
  */
3122
- declare function PageToolbar({ children, onBack, backLabel, wrap, size, className, }: PageToolbarProps): react.JSX.Element;
3134
+ declare function PageToolbar({ children, actions, onBack, backLabel, wrap, size, className, }: PageToolbarProps): react.JSX.Element;
3123
3135
 
3124
3136
  type FilterBarSize = 'sm' | 'md';
3125
3137
  interface FilterBarProps {
@@ -4621,6 +4633,11 @@ declare function CopyButton({ value, label, copiedLabel, className }: CopyButton
4621
4633
  * `alexandra.konstan…@example.com`. The full address stays in the DOM (screen readers and copy
4622
4634
  * get all of it) and in `title`. Pair it with `copyValue`, so touch users, who cannot hover, can
4623
4635
  * still get the address.
4636
+ *
4637
+ * An email never wraps. It ellipsises through explicit overflow classes rather than the
4638
+ * `truncate` utility, because containers that un-truncate for touch target `.truncate`.
4639
+ * `DataTable`'s card layout does that, and through 0.9.0 it broke an address mid-word
4640
+ * ("alex.reviewer@example.tes / t").
4624
4641
  */
4625
4642
  declare function EmailText({ email, className }: {
4626
4643
  email: string;
@@ -4852,7 +4869,12 @@ declare function DataTablePagination<TData>({ table, pageSizeOptions, summary, }
4852
4869
  type TableCellSize = 'sm' | 'md';
4853
4870
  interface TableCellLeadTextProps {
4854
4871
  primary: string;
4855
- secondary?: string;
4872
+ /**
4873
+ * The muted second line. A string ellipsises with a `title`. From 0.9.1 it can also be an
4874
+ * element, such as `<EmailText email={…} />`, which manages its own overflow: an email
4875
+ * should truncate before the `@`, never wrap mid-word.
4876
+ */
4877
+ secondary?: ReactNode;
4856
4878
  size?: TableCellSize;
4857
4879
  className?: string;
4858
4880
  }
package/dist/index.d.ts CHANGED
@@ -3090,7 +3090,16 @@ declare function PageHeading({ title, subtitle, size, as, actions, truncateTitle
3090
3090
 
3091
3091
  type PageToolbarSize = 'sm' | 'md';
3092
3092
  interface PageToolbarProps {
3093
+ /** The heading block (usually a `PageHeading`). Without `actions`, the actions as well (legacy). */
3093
3094
  children: ReactNode;
3095
+ /**
3096
+ * The action cluster, e.g. buttons. New in 0.9.1. Passing it makes the bar responsive: on a
3097
+ * wide screen the actions sit on the heading's row, at the right; when they don't fit, they
3098
+ * wrap below the heading and among themselves. The heading never narrows below 12rem (or the
3099
+ * full width, if less). Without it, children keep the old single-row layout, which squeezed
3100
+ * the heading to a sliver and ran the actions off-screen on a phone.
3101
+ */
3102
+ actions?: ReactNode;
3094
3103
  /**
3095
3104
  * Renders an icon-only back control at the far left, ahead of the heading: the Page Header's
3096
3105
  * `backButton` in Figma (node 3473:16837). New in 0.7.0, from SCIC. Omit for no back control.
@@ -3098,7 +3107,10 @@ interface PageToolbarProps {
3098
3107
  onBack?: () => void;
3099
3108
  /** Accessible name for the back control. Default "Go back". */
3100
3109
  backLabel?: string;
3101
- /** Allow the row to wrap when the action cluster is wide (entity-detail has seven buttons). */
3110
+ /**
3111
+ * Allow the row to wrap when the action cluster is wide (entity-detail has seven buttons).
3112
+ * @deprecated Pass the actions through `actions`, which always wraps where needed.
3113
+ */
3102
3114
  wrap?: boolean;
3103
3115
  /**
3104
3116
  * The bar's **own** height and padding. `sm` suits a secondary bar under the main toolbar.
@@ -3119,7 +3131,7 @@ interface PageToolbarProps {
3119
3131
  * variant is adopted here, which is a deliberate improvement below `md` where the
3120
3132
  * fixed 28px padding was cramped.
3121
3133
  */
3122
- declare function PageToolbar({ children, onBack, backLabel, wrap, size, className, }: PageToolbarProps): react.JSX.Element;
3134
+ declare function PageToolbar({ children, actions, onBack, backLabel, wrap, size, className, }: PageToolbarProps): react.JSX.Element;
3123
3135
 
3124
3136
  type FilterBarSize = 'sm' | 'md';
3125
3137
  interface FilterBarProps {
@@ -4621,6 +4633,11 @@ declare function CopyButton({ value, label, copiedLabel, className }: CopyButton
4621
4633
  * `alexandra.konstan…@example.com`. The full address stays in the DOM (screen readers and copy
4622
4634
  * get all of it) and in `title`. Pair it with `copyValue`, so touch users, who cannot hover, can
4623
4635
  * still get the address.
4636
+ *
4637
+ * An email never wraps. It ellipsises through explicit overflow classes rather than the
4638
+ * `truncate` utility, because containers that un-truncate for touch target `.truncate`.
4639
+ * `DataTable`'s card layout does that, and through 0.9.0 it broke an address mid-word
4640
+ * ("alex.reviewer@example.tes / t").
4624
4641
  */
4625
4642
  declare function EmailText({ email, className }: {
4626
4643
  email: string;
@@ -4852,7 +4869,12 @@ declare function DataTablePagination<TData>({ table, pageSizeOptions, summary, }
4852
4869
  type TableCellSize = 'sm' | 'md';
4853
4870
  interface TableCellLeadTextProps {
4854
4871
  primary: string;
4855
- secondary?: string;
4872
+ /**
4873
+ * The muted second line. A string ellipsises with a `title`. From 0.9.1 it can also be an
4874
+ * element, such as `<EmailText email={…} />`, which manages its own overflow: an email
4875
+ * should truncate before the `@`, never wrap mid-word.
4876
+ */
4877
+ secondary?: ReactNode;
4856
4878
  size?: TableCellSize;
4857
4879
  className?: string;
4858
4880
  }
package/dist/index.js CHANGED
@@ -3803,13 +3803,14 @@ function RoleBadge({ role, size: size2 = "sm", tone, color }) {
3803
3803
  "span",
3804
3804
  {
3805
3805
  "data-tone": tone,
3806
+ title: role,
3806
3807
  className: clsx28(
3807
- "inline-flex items-center rounded-full font-medium whitespace-nowrap",
3808
+ "inline-flex max-w-full items-center rounded-full font-medium whitespace-nowrap align-middle",
3808
3809
  size2 === "sm" ? "px-2 py-0.5 text-body-tiny" : "px-3 py-1 text-body-xs",
3809
3810
  !rawColor && TONE_STYLES[resolved]
3810
3811
  ),
3811
3812
  style: rawColor ? { backgroundColor: `${rawColor}1F`, color: rawColor } : void 0,
3812
- children: role
3813
+ children: /* @__PURE__ */ jsx27("span", { className: "min-w-0 truncate", children: role })
3813
3814
  }
3814
3815
  );
3815
3816
  }
@@ -7926,12 +7927,33 @@ var SIZE7 = {
7926
7927
  };
7927
7928
  function PageToolbar({
7928
7929
  children,
7930
+ actions,
7929
7931
  onBack,
7930
7932
  backLabel = "Go back",
7931
7933
  wrap,
7932
7934
  size: size2 = "md",
7933
7935
  className
7934
7936
  }) {
7937
+ if (actions !== void 0) {
7938
+ return /* @__PURE__ */ jsxs48(
7939
+ "div",
7940
+ {
7941
+ "data-slot": "page-toolbar",
7942
+ className: clsx53(
7943
+ "flex shrink-0 flex-wrap items-center gap-x-4 gap-y-3 border-b border-default bg-default",
7944
+ SIZE7[size2],
7945
+ className
7946
+ ),
7947
+ children: [
7948
+ /* @__PURE__ */ jsxs48("div", { className: "flex min-w-[min(100%,12rem)] flex-1 basis-48 items-center gap-4", children: [
7949
+ onBack && /* @__PURE__ */ jsx73(IconButton, { variant: "neutral", size: "md", "aria-label": backLabel, onClick: onBack, children: /* @__PURE__ */ jsx73(ArrowLeftIcon2, { "aria-hidden": true }) }),
7950
+ /* @__PURE__ */ jsx73("div", { className: "min-w-0 flex-1", children })
7951
+ ] }),
7952
+ /* @__PURE__ */ jsx73("div", { "data-slot": "page-toolbar-actions", className: "ml-auto flex max-w-full flex-wrap items-center justify-end gap-2", children: actions })
7953
+ ]
7954
+ }
7955
+ );
7956
+ }
7935
7957
  return /* @__PURE__ */ jsxs48(
7936
7958
  "div",
7937
7959
  {
@@ -10296,9 +10318,9 @@ function EmailText({ email, className }) {
10296
10318
  const at = email.lastIndexOf("@");
10297
10319
  const local = at > 0 ? email.slice(0, at) : email;
10298
10320
  const domain = at > 0 ? email.slice(at) : "";
10299
- return /* @__PURE__ */ jsxs75("span", { title: email, className: clsx88("flex min-w-0 max-w-full", className), children: [
10300
- /* @__PURE__ */ jsx109("span", { className: "min-w-0 truncate", children: local }),
10301
- domain && /* @__PURE__ */ jsx109("span", { className: "min-w-0 truncate [flex-shrink:0.001]", children: domain })
10321
+ return /* @__PURE__ */ jsxs75("span", { title: email, "data-slot": "email-text", className: clsx88("flex min-w-0 max-w-full", className), children: [
10322
+ /* @__PURE__ */ jsx109("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap", children: local }),
10323
+ domain && /* @__PURE__ */ jsx109("span", { className: "min-w-0 overflow-hidden text-ellipsis whitespace-nowrap [flex-shrink:0.001]", children: domain })
10302
10324
  ] });
10303
10325
  }
10304
10326
 
@@ -10932,17 +10954,30 @@ function TableCellLeadText({ primary, secondary, size: size2 = "md", className }
10932
10954
  children: primary
10933
10955
  }
10934
10956
  ),
10935
- secondary && /* @__PURE__ */ jsx116(
10957
+ secondary && (typeof secondary === "string" || typeof secondary === "number" ? /* @__PURE__ */ jsx116(
10936
10958
  "span",
10937
10959
  {
10938
- title: secondary,
10960
+ title: String(secondary),
10939
10961
  className: clsx94(
10940
10962
  "block truncate font-normal leading-tight text-default-secondary",
10941
10963
  size2 === "sm" ? "text-body-tiny" : "text-body-xs"
10942
10964
  ),
10943
10965
  children: secondary
10944
10966
  }
10945
- )
10967
+ ) : (
10968
+ // An element brings its own overflow handling, so it gets no `truncate` here,
10969
+ // which a card layout's touch un-truncation would otherwise turn into wrapping.
10970
+ /* @__PURE__ */ jsx116(
10971
+ "span",
10972
+ {
10973
+ className: clsx94(
10974
+ "block min-w-0 font-normal leading-tight text-default-secondary",
10975
+ size2 === "sm" ? "text-body-tiny" : "text-body-xs"
10976
+ ),
10977
+ children: secondary
10978
+ }
10979
+ )
10980
+ ))
10946
10981
  ] });
10947
10982
  }
10948
10983
  function TableCellText({