@flytedan/flytebot-design-system 0.11.2 → 0.11.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.d.cts CHANGED
@@ -1505,7 +1505,9 @@ interface TransferListProps<T> {
1505
1505
  * ghost that follows the cursor: with per-field props that second call has to
1506
1506
  * remember to pass each of them, and the version of this component that did exactly
1507
1507
  * 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. */
1508
+ * the same object to both render sites makes that class of bug unrepresentable.
1509
+ * The row's `title` also names its +/- action, with the destination side's `label`:
1510
+ * "Move Alpha to In audience". */
1509
1511
  renderRow: (item: T) => EntityRowContent;
1510
1512
  /** Fired by both a drag-drop and the equivalent +/- click. The caller owns actually
1511
1513
  * moving the item between whatever backing lists it maintains — this component never
package/dist/index.d.ts CHANGED
@@ -1505,7 +1505,9 @@ interface TransferListProps<T> {
1505
1505
  * ghost that follows the cursor: with per-field props that second call has to
1506
1506
  * remember to pass each of them, and the version of this component that did exactly
1507
1507
  * 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. */
1508
+ * the same object to both render sites makes that class of bug unrepresentable.
1509
+ * The row's `title` also names its +/- action, with the destination side's `label`:
1510
+ * "Move Alpha to In audience". */
1509
1511
  renderRow: (item: T) => EntityRowContent;
1510
1512
  /** Fired by both a drag-drop and the equivalent +/- click. The caller owns actually
1511
1513
  * moving the item between whatever backing lists it maintains — this component never
package/dist/index.js CHANGED
@@ -3177,15 +3177,20 @@ function TransferList({
3177
3177
  if (isBeingDragged) {
3178
3178
  return /* @__PURE__ */ jsx43("div", { className: "fd-erow-placeholder", "aria-hidden": "true" });
3179
3179
  }
3180
+ const content = renderRow(item);
3181
+ const destination = (side === "left" ? right : left).label || "the other list";
3180
3182
  return /* @__PURE__ */ jsx43(
3181
3183
  EntityRow,
3182
3184
  {
3183
- ...renderRow(item),
3185
+ ...content,
3184
3186
  draggable: true,
3185
3187
  onPointerDown: (e) => beginDrag(e, item, side),
3186
3188
  action: {
3187
3189
  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"),
3190
+ // Names the row AND where it goes. A list repeats this button on every
3191
+ // row, so a name without the row's title is the same word fifty times
3192
+ // over to a screen reader, with nothing to tell one button from the next.
3193
+ label: "Move " + content.title + " to " + destination,
3189
3194
  tone: side === "left" ? "add" : "remove",
3190
3195
  onClick: () => onMove(item, side, opposite)
3191
3196
  }