@mond-design-system/react 5.1.0 → 6.0.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
@@ -960,8 +960,7 @@ declare function ListItem({ title, description, leading, trailing, actions, onCl
960
960
 
961
961
  interface DataColumn<Row> {
962
962
  key: string;
963
- /** Read in the header row, and echoed beside the cell once the table has
964
- folded into cards. */
963
+ /** Read in the header row. */
965
964
  header: ReactNode;
966
965
  /** CSS width for the column, applied through the colgroup. */
967
966
  width?: string;
@@ -1012,11 +1011,13 @@ type DataTableProps<Row> = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
1012
1011
  ref?: Ref<HTMLDivElement>;
1013
1012
  } & DataTableSelection;
1014
1013
  /**
1015
- * Rows and columns, folded into cards on a narrow screen.
1014
+ * Rows and columns, at every width.
1016
1015
  *
1017
- * Below the wide breakpoint a table cannot be read across, so each row becomes
1018
- * a card and every cell carries its column's header beside it. The markup is
1019
- * one table either way: what changes is the layout, never the semantics.
1016
+ * A table is for reading across a row and comparing down a column, and it stays
1017
+ * one on a narrow screen rather than turning into something else: where the
1018
+ * columns need more room than there is, the table pans sideways inside a box
1019
+ * that takes focus. An app wanting cards on a phone builds cards — that is a
1020
+ * different component, not this one wearing a second layout.
1020
1021
  *
1021
1022
  * ```tsx
1022
1023
  * <DataTable
package/dist/index.d.ts CHANGED
@@ -960,8 +960,7 @@ declare function ListItem({ title, description, leading, trailing, actions, onCl
960
960
 
961
961
  interface DataColumn<Row> {
962
962
  key: string;
963
- /** Read in the header row, and echoed beside the cell once the table has
964
- folded into cards. */
963
+ /** Read in the header row. */
965
964
  header: ReactNode;
966
965
  /** CSS width for the column, applied through the colgroup. */
967
966
  width?: string;
@@ -1012,11 +1011,13 @@ type DataTableProps<Row> = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
1012
1011
  ref?: Ref<HTMLDivElement>;
1013
1012
  } & DataTableSelection;
1014
1013
  /**
1015
- * Rows and columns, folded into cards on a narrow screen.
1014
+ * Rows and columns, at every width.
1016
1015
  *
1017
- * Below the wide breakpoint a table cannot be read across, so each row becomes
1018
- * a card and every cell carries its column's header beside it. The markup is
1019
- * one table either way: what changes is the layout, never the semantics.
1016
+ * A table is for reading across a row and comparing down a column, and it stays
1017
+ * one on a narrow screen rather than turning into something else: where the
1018
+ * columns need more room than there is, the table pans sideways inside a box
1019
+ * that takes focus. An app wanting cards on a phone builds cards — that is a
1020
+ * different component, not this one wearing a second layout.
1020
1021
  *
1021
1022
  * ```tsx
1022
1023
  * <DataTable
package/dist/index.js CHANGED
@@ -1492,7 +1492,7 @@ function ListItem({
1492
1492
  }
1493
1493
 
1494
1494
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/DataTable/DataTable.module.css?mds-scoped
1495
- var DataTable_module_default = { "root": "mds-DataTable__root", "table": "mds-DataTable__table", "body": "mds-DataTable__body", "row": "mds-DataTable__row", "cell": "mds-DataTable__cell", "select": "mds-DataTable__select", "actions": "mds-DataTable__actions", "key": "mds-DataTable__key", "lead": "mds-DataTable__lead", "selected": "mds-DataTable__selected", "muted": "mds-DataTable__muted", "empty": "mds-DataTable__empty", "bulk": "mds-DataTable__bulk", "bulkActions": "mds-DataTable__bulkActions", "head": "mds-DataTable__head" };
1495
+ var DataTable_module_default = { "root": "mds-DataTable__root", "scroll": "mds-DataTable__scroll", "table": "mds-DataTable__table", "row": "mds-DataTable__row", "body": "mds-DataTable__body", "selected": "mds-DataTable__selected", "cell": "mds-DataTable__cell", "select": "mds-DataTable__select", "actions": "mds-DataTable__actions", "muted": "mds-DataTable__muted", "empty": "mds-DataTable__empty", "bulk": "mds-DataTable__bulk", "bulkActions": "mds-DataTable__bulkActions" };
1496
1496
  function DataTable({
1497
1497
  label,
1498
1498
  columns,
@@ -1527,13 +1527,19 @@ function DataTable({
1527
1527
  return typeof first === "string" ? first : rowKey(row);
1528
1528
  };
1529
1529
  return /* @__PURE__ */ jsxs("div", { className: cx(DataTable_module_default.root, className), ref, ...rest, children: [
1530
- /* @__PURE__ */ jsxs("table", { className: DataTable_module_default.table, "aria-label": label, children: [
1530
+ /* @__PURE__ */ jsx("div", { className: DataTable_module_default.scroll, role: "region", "aria-label": label, tabIndex: 0, children: /* @__PURE__ */ jsxs("table", { className: DataTable_module_default.table, "aria-label": label, children: [
1531
1531
  /* @__PURE__ */ jsxs("colgroup", { children: [
1532
1532
  selectable && /* @__PURE__ */ jsx("col", {}),
1533
- columns.map((column) => /* @__PURE__ */ jsx("col", { style: column.width !== void 0 ? { width: column.width } : void 0 }, column.key)),
1533
+ columns.map((column) => /* @__PURE__ */ jsx(
1534
+ "col",
1535
+ {
1536
+ style: column.width !== void 0 ? { width: column.width } : void 0
1537
+ },
1538
+ column.key
1539
+ )),
1534
1540
  rowActions && /* @__PURE__ */ jsx("col", {})
1535
1541
  ] }),
1536
- /* @__PURE__ */ jsx(VisuallyHidden, { as: "thead", className: DataTable_module_default.head, children: /* @__PURE__ */ jsxs("tr", { className: DataTable_module_default.row, children: [
1542
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: DataTable_module_default.row, children: [
1537
1543
  selectable && /* @__PURE__ */ jsx("th", { scope: "col", className: DataTable_module_default.select, children: /* @__PURE__ */ jsx(
1538
1544
  Checkbox,
1539
1545
  {
@@ -1553,7 +1559,11 @@ function DataTable({
1553
1559
  return /* @__PURE__ */ jsxs(
1554
1560
  "tr",
1555
1561
  {
1556
- className: cx(DataTable_module_default.row, taken && DataTable_module_default.selected, rowMuted?.(row) === true && DataTable_module_default.muted),
1562
+ className: cx(
1563
+ DataTable_module_default.row,
1564
+ taken && DataTable_module_default.selected,
1565
+ rowMuted?.(row) === true && DataTable_module_default.muted
1566
+ ),
1557
1567
  children: [
1558
1568
  selectable && /* @__PURE__ */ jsx("td", { className: DataTable_module_default.select, children: /* @__PURE__ */ jsx(
1559
1569
  Checkbox,
@@ -1564,17 +1574,14 @@ function DataTable({
1564
1574
  onChange: (event) => toggle(key, event.target.checked)
1565
1575
  }
1566
1576
  ) }),
1567
- columns.map((column, index) => /* @__PURE__ */ jsxs("td", { className: cx(DataTable_module_default.cell, index === 0 && DataTable_module_default.lead), children: [
1568
- index > 0 && /* @__PURE__ */ jsx("span", { className: DataTable_module_default.key, "aria-hidden": "true", children: column.header }),
1569
- column.cell(row)
1570
- ] }, column.key)),
1577
+ columns.map((column) => /* @__PURE__ */ jsx("td", { className: DataTable_module_default.cell, children: column.cell(row) }, column.key)),
1571
1578
  rowActions && /* @__PURE__ */ jsx("td", { className: DataTable_module_default.actions, children: rowActions(row) })
1572
1579
  ]
1573
1580
  },
1574
1581
  key
1575
1582
  );
1576
1583
  }) : empty !== void 0 && /* @__PURE__ */ jsx("tr", { className: DataTable_module_default.row, children: /* @__PURE__ */ jsx("td", { className: DataTable_module_default.empty, colSpan: span, children: /* @__PURE__ */ jsx(Text, { variant: "note", children: empty }) }) }) })
1577
- ] }),
1584
+ ] }) }),
1578
1585
  selectable && selected.length > 0 && bulkActions !== void 0 && /* @__PURE__ */ jsxs("div", { className: DataTable_module_default.bulk, role: "status", children: [
1579
1586
  /* @__PURE__ */ jsx(Text, { variant: "meta", children: selectionLabels.count(selected.length) }),
1580
1587
  /* @__PURE__ */ jsx("div", { className: DataTable_module_default.bulkActions, children: bulkActions })