@flytedan/flytebot-design-system 0.11.2 → 0.11.4

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
@@ -1353,7 +1353,9 @@ interface EntityRowMetric {
1353
1353
  /** Phosphor icon name shown before the value, e.g. "student". */
1354
1354
  icon?: string;
1355
1355
  /** Fixed cell width in px. Same value on the same column of every row is what makes
1356
- * the strip a real aligned column rather than text that happens to sit near text. */
1356
+ * the strip a real aligned column rather than text that happens to sit near text.
1357
+ * On a narrow screen (≤768px) cells size to their figure instead, so a phone-width row
1358
+ * shows every figure rather than clipping whole columns off its end. */
1357
1359
  width?: number;
1358
1360
  tone?: "default" | "muted" | "danger";
1359
1361
  }
@@ -1505,7 +1507,9 @@ interface TransferListProps<T> {
1505
1507
  * ghost that follows the cursor: with per-field props that second call has to
1506
1508
  * remember to pass each of them, and the version of this component that did exactly
1507
1509
  * that quietly dropped every field but title and meta off the dragged card. Handing
1508
- * the same object to both render sites makes that class of bug unrepresentable. */
1510
+ * the same object to both render sites makes that class of bug unrepresentable.
1511
+ * The row's `title` also names its +/- action, with the destination side's `label`:
1512
+ * "Move Alpha to In audience". */
1509
1513
  renderRow: (item: T) => EntityRowContent;
1510
1514
  /** Fired by both a drag-drop and the equivalent +/- click. The caller owns actually
1511
1515
  * moving the item between whatever backing lists it maintains — this component never
package/dist/index.d.ts CHANGED
@@ -1353,7 +1353,9 @@ interface EntityRowMetric {
1353
1353
  /** Phosphor icon name shown before the value, e.g. "student". */
1354
1354
  icon?: string;
1355
1355
  /** Fixed cell width in px. Same value on the same column of every row is what makes
1356
- * the strip a real aligned column rather than text that happens to sit near text. */
1356
+ * the strip a real aligned column rather than text that happens to sit near text.
1357
+ * On a narrow screen (≤768px) cells size to their figure instead, so a phone-width row
1358
+ * shows every figure rather than clipping whole columns off its end. */
1357
1359
  width?: number;
1358
1360
  tone?: "default" | "muted" | "danger";
1359
1361
  }
@@ -1505,7 +1507,9 @@ interface TransferListProps<T> {
1505
1507
  * ghost that follows the cursor: with per-field props that second call has to
1506
1508
  * remember to pass each of them, and the version of this component that did exactly
1507
1509
  * that quietly dropped every field but title and meta off the dragged card. Handing
1508
- * the same object to both render sites makes that class of bug unrepresentable. */
1510
+ * the same object to both render sites makes that class of bug unrepresentable.
1511
+ * The row's `title` also names its +/- action, with the destination side's `label`:
1512
+ * "Move Alpha to In audience". */
1509
1513
  renderRow: (item: T) => EntityRowContent;
1510
1514
  /** Fired by both a drag-drop and the equivalent +/- click. The caller owns actually
1511
1515
  * moving the item between whatever backing lists it maintains — this component never
package/dist/index.js CHANGED
@@ -2833,7 +2833,7 @@ function EntityRowMetrics({ metrics, className = "", style }) {
2833
2833
  return /* @__PURE__ */ jsx39("span", { className: ["fd-erow-metrics", className].filter(Boolean).join(" "), style, children: metrics.map((m, i) => {
2834
2834
  const key = m.id || m.label || i;
2835
2835
  const className2 = ["fd-erow-metric", m.tone && m.tone !== "default" ? "is-" + m.tone : "", m.tooltip != null ? "is-described" : ""].filter(Boolean).join(" ");
2836
- const cellStyle = { width: (m.width || ENTITY_ROW_METRIC_WIDTH) + "px", color: METRIC_TONE_COLOR[m.tone || "default"] };
2836
+ const cellStyle = { "--erow-metric-w": (m.width || ENTITY_ROW_METRIC_WIDTH) + "px", color: METRIC_TONE_COLOR[m.tone || "default"] };
2837
2837
  const content = /* @__PURE__ */ jsxs35(React17.Fragment, { children: [
2838
2838
  m.icon ? /* @__PURE__ */ jsx39("i", { className: "ph ph-" + m.icon, "aria-hidden": "true" }) : null,
2839
2839
  /* @__PURE__ */ jsx39("span", { className: "fd-erow-metric-value fd-tabular", children: m.value }),
@@ -3135,18 +3135,7 @@ function TransferList({
3135
3135
  ref: (el) => {
3136
3136
  sideRefs.current[side] = el;
3137
3137
  },
3138
- style: {
3139
- flex: 1,
3140
- minWidth: 0,
3141
- display: "flex",
3142
- flexDirection: "column",
3143
- gap: 8,
3144
- padding: 10,
3145
- borderRadius: 10,
3146
- border: "1px solid " + (dragOverSide === side ? "var(--brand)" : "var(--border)"),
3147
- background: "var(--surface)",
3148
- position: "relative"
3149
- },
3138
+ className: ["fd-tlist-side", dragOverSide === side ? "is-drop-target" : ""].filter(Boolean).join(" "),
3150
3139
  children: [
3151
3140
  cfg.label ? /* @__PURE__ */ jsxs38("span", { className: "fd-overline fd-muted", children: [
3152
3141
  cfg.label,
@@ -3177,15 +3166,20 @@ function TransferList({
3177
3166
  if (isBeingDragged) {
3178
3167
  return /* @__PURE__ */ jsx43("div", { className: "fd-erow-placeholder", "aria-hidden": "true" });
3179
3168
  }
3169
+ const content = renderRow(item);
3170
+ const destination = (side === "left" ? right : left).label || "the other list";
3180
3171
  return /* @__PURE__ */ jsx43(
3181
3172
  EntityRow,
3182
3173
  {
3183
- ...renderRow(item),
3174
+ ...content,
3184
3175
  draggable: true,
3185
3176
  onPointerDown: (e) => beginDrag(e, item, side),
3186
3177
  action: {
3187
3178
  icon: side === "left" ? "plus" : "minus",
3188
- label: (side === "left" ? "Move to " : "Move from ") + (side === "left" ? right.label || "the other list" : left.label || "the other list"),
3179
+ // Names the row AND where it goes. A list repeats this button on every
3180
+ // row, so a name without the row's title is the same word fifty times
3181
+ // over to a screen reader, with nothing to tell one button from the next.
3182
+ label: "Move " + content.title + " to " + destination,
3189
3183
  tone: side === "left" ? "add" : "remove",
3190
3184
  onClick: () => onMove(item, side, opposite)
3191
3185
  }
@@ -3203,7 +3197,7 @@ function TransferList({
3203
3197
  }
3204
3198
  );
3205
3199
  };
3206
- return /* @__PURE__ */ jsxs38("div", { className: ["fd-tlist", className].filter(Boolean).join(" "), style: { display: "flex", gap: 16, alignItems: "flex-start" }, children: [
3200
+ return /* @__PURE__ */ jsxs38("div", { className: ["fd-tlist", className].filter(Boolean).join(" "), children: [
3207
3201
  renderSide("left", left, "right"),
3208
3202
  renderSide("right", right, "left"),
3209
3203
  drag ? createPortal4(