@flytedan/flytebot-design-system 0.52.0 → 0.54.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.d.cts CHANGED
@@ -1109,7 +1109,7 @@ interface FunnelChartProps {
1109
1109
  * FunnelChart — ordered steps drawn as a tapering stack (Sent -> Delivered -> Clicked ->
1110
1110
  * Opted-out, the reference front end's own shape, PLN-2 SMS-20), each reporting its
1111
1111
  * value, its step rate (conversion from the step before it) and its percent of the
1112
- * first step. Colour comes only from `--chart-1..8` (MP-210), one per step in order.
1112
+ * first step. Each step's label (name, value, rates) sits above its own bar. Colour comes only from `--chart-1..8` (MP-210), one per step in order.
1113
1113
  *
1114
1114
  * Every step is a real `<button>` wrapped in the kit's `Tooltip`, keyboard-reachable
1115
1115
  * exactly like `BarList`'s rows — a funnel is a ranked, ordered list before it is a
@@ -1185,7 +1185,10 @@ interface DataTableProps {
1185
1185
  columns: DataTableColumn[];
1186
1186
  rows: any[];
1187
1187
  compact?: boolean;
1188
- selectedId?: string | number;
1188
+ /** Keys (row[rowKey]) of every selected row; each gets aria-selected and the selected styling. */
1189
+ selectedIds?: ReadonlyArray<string | number>;
1190
+ /** Per-row title (native tooltip), e.g. "Click to add to / remove from filter". */
1191
+ rowTitle?: (row: any) => string;
1189
1192
  onRowClick?: (row: any) => void;
1190
1193
  rowKey?: string;
1191
1194
  /** First load: nothing on screen yet, so skeleton rows are drawn. */
@@ -1201,7 +1204,7 @@ interface DataTableProps {
1201
1204
  onSort?: (key: string) => void;
1202
1205
  className?: string;
1203
1206
  }
1204
- declare function DataTable({ columns, rows, compact, selectedId, onRowClick, rowKey, loading, refreshing, skeletonRows, sort, onSort, className, ...rest }: DataTableProps): React.JSX.Element;
1207
+ declare function DataTable({ columns, rows, compact, selectedIds, rowTitle, onRowClick, rowKey, loading, refreshing, skeletonRows, sort, onSort, className, ...rest }: DataTableProps): React.JSX.Element;
1205
1208
 
1206
1209
  interface FilterFieldOption {
1207
1210
  value: string;
package/dist/index.d.ts CHANGED
@@ -1109,7 +1109,7 @@ interface FunnelChartProps {
1109
1109
  * FunnelChart — ordered steps drawn as a tapering stack (Sent -> Delivered -> Clicked ->
1110
1110
  * Opted-out, the reference front end's own shape, PLN-2 SMS-20), each reporting its
1111
1111
  * value, its step rate (conversion from the step before it) and its percent of the
1112
- * first step. Colour comes only from `--chart-1..8` (MP-210), one per step in order.
1112
+ * first step. Each step's label (name, value, rates) sits above its own bar. Colour comes only from `--chart-1..8` (MP-210), one per step in order.
1113
1113
  *
1114
1114
  * Every step is a real `<button>` wrapped in the kit's `Tooltip`, keyboard-reachable
1115
1115
  * exactly like `BarList`'s rows — a funnel is a ranked, ordered list before it is a
@@ -1185,7 +1185,10 @@ interface DataTableProps {
1185
1185
  columns: DataTableColumn[];
1186
1186
  rows: any[];
1187
1187
  compact?: boolean;
1188
- selectedId?: string | number;
1188
+ /** Keys (row[rowKey]) of every selected row; each gets aria-selected and the selected styling. */
1189
+ selectedIds?: ReadonlyArray<string | number>;
1190
+ /** Per-row title (native tooltip), e.g. "Click to add to / remove from filter". */
1191
+ rowTitle?: (row: any) => string;
1189
1192
  onRowClick?: (row: any) => void;
1190
1193
  rowKey?: string;
1191
1194
  /** First load: nothing on screen yet, so skeleton rows are drawn. */
@@ -1201,7 +1204,7 @@ interface DataTableProps {
1201
1204
  onSort?: (key: string) => void;
1202
1205
  className?: string;
1203
1206
  }
1204
- declare function DataTable({ columns, rows, compact, selectedId, onRowClick, rowKey, loading, refreshing, skeletonRows, sort, onSort, className, ...rest }: DataTableProps): React.JSX.Element;
1207
+ declare function DataTable({ columns, rows, compact, selectedIds, rowTitle, onRowClick, rowKey, loading, refreshing, skeletonRows, sort, onSort, className, ...rest }: DataTableProps): React.JSX.Element;
1205
1208
 
1206
1209
  interface FilterFieldOption {
1207
1210
  value: string;
package/dist/index.js CHANGED
@@ -2779,19 +2779,6 @@ function FunnelChart({
2779
2779
  const color = chartColor(i);
2780
2780
  const detail = `${s.label} \u2014 ${valueFormat(value)} \xB7 ${formatPercent(Math.round(pctFirst))} of ${steps[0]?.label || "first step"}` + (stepRate != null ? ` \xB7 ${formatPercent(Math.round(stepRate))} of ${steps[i - 1].label}` : "");
2781
2781
  return /* @__PURE__ */ jsx40("li", { className: "fd-funnel-row", children: /* @__PURE__ */ jsx40(Tooltip, { label: detail, children: /* @__PURE__ */ jsxs32("button", { type: "button", className: "fd-funnel-btn", children: [
2782
- /* @__PURE__ */ jsx40("span", { className: "fd-funnel-shape-wrap", style: { height: barHeight }, children: /* @__PURE__ */ jsx40(
2783
- "span",
2784
- {
2785
- className: "fd-funnel-shape",
2786
- role: "img",
2787
- "aria-label": detail,
2788
- style: {
2789
- width: widthPct + "%",
2790
- background: color,
2791
- clipPath: `polygon(${insetTop}% 0, ${100 - insetTop}% 0, ${100 - insetBottom}% 100%, ${insetBottom}% 100%)`
2792
- }
2793
- }
2794
- ) }),
2795
2782
  /* @__PURE__ */ jsxs32("span", { className: "fd-funnel-meta", children: [
2796
2783
  /* @__PURE__ */ jsx40("span", { className: "fd-funnel-label", title: truncationTitle(s.label), children: s.label }),
2797
2784
  /* @__PURE__ */ jsx40("span", { className: "fd-funnel-value fd-tabular", children: valueFormat(value) }),
@@ -2805,7 +2792,20 @@ function FunnelChart({
2805
2792
  " of first"
2806
2793
  ] })
2807
2794
  ] })
2808
- ] })
2795
+ ] }),
2796
+ /* @__PURE__ */ jsx40("span", { className: "fd-funnel-shape-wrap", style: { height: barHeight }, children: /* @__PURE__ */ jsx40(
2797
+ "span",
2798
+ {
2799
+ className: "fd-funnel-shape",
2800
+ role: "img",
2801
+ "aria-label": detail,
2802
+ style: {
2803
+ width: widthPct + "%",
2804
+ background: color,
2805
+ clipPath: `polygon(${insetTop}% 0, ${100 - insetTop}% 0, ${100 - insetBottom}% 100%, ${insetBottom}% 100%)`
2806
+ }
2807
+ }
2808
+ ) })
2809
2809
  ] }) }) }, s.id);
2810
2810
  }) }),
2811
2811
  /* @__PURE__ */ jsx40(
@@ -2937,7 +2937,8 @@ function DataTable({
2937
2937
  columns = [],
2938
2938
  rows = [],
2939
2939
  compact: compact3 = false,
2940
- selectedId,
2940
+ selectedIds,
2941
+ rowTitle,
2941
2942
  onRowClick,
2942
2943
  rowKey = "id",
2943
2944
  loading = false,
@@ -2974,7 +2975,8 @@ function DataTable({
2974
2975
  /* @__PURE__ */ jsx43("tbody", { className: stale ? "fd-stale" : void 0, children: loading ? Array.from({ length: skeletonRows }).map((_, i) => /* @__PURE__ */ jsx43("tr", { children: columns.map((c) => /* @__PURE__ */ jsx43("td", { className: c.numeric ? "is-num" : "", children: /* @__PURE__ */ jsx43("span", { className: "fd-skel fd-skel-text", style: { display: "inline-block", height: 13, width: c.numeric ? 52 : i % 3 === 0 ? "72%" : "88%" } }) }, c.key)) }, i)) : rows.map((r) => /* @__PURE__ */ jsx43(
2975
2976
  "tr",
2976
2977
  {
2977
- "aria-selected": selectedId === r[rowKey] ? "true" : void 0,
2978
+ "aria-selected": selectedIds?.includes(r[rowKey]) ? "true" : void 0,
2979
+ title: rowTitle ? rowTitle(r) : void 0,
2978
2980
  onClick: onRowClick ? () => onRowClick(r) : void 0,
2979
2981
  style: onRowClick ? { cursor: "pointer" } : void 0,
2980
2982
  children: columns.map((c) => /* @__PURE__ */ jsx43("td", { className: c.numeric ? "is-num" : "", children: c.render ? c.render(r) : r[c.key] }, c.key))