@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.cjs +17 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +30 -103
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +17 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
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,
|
|
1014
|
+
* Rows and columns, at every width.
|
|
1016
1015
|
*
|
|
1017
|
-
*
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
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
|
|
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,
|
|
1014
|
+
* Rows and columns, at every width.
|
|
1016
1015
|
*
|
|
1017
|
-
*
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
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", "
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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 })
|