@mond-design-system/react 5.1.0 → 6.1.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 +20 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +39 -105
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +11 -7
- package/dist/index.d.ts +11 -7
- package/dist/index.js +20 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -765,9 +765,12 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "typ
|
|
|
765
765
|
*/
|
|
766
766
|
declare function Checkbox({ label, labelHidden, indeterminate, className, ref, ...rest }: CheckboxProps): ReactElement;
|
|
767
767
|
|
|
768
|
+
type RadioSize = "sm" | "md" | "lg";
|
|
768
769
|
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
769
770
|
/** Inline label — part of the click target. */
|
|
770
771
|
label: string;
|
|
772
|
+
/** Control step. Default md. The 44px target holds at every step. */
|
|
773
|
+
size?: RadioSize;
|
|
771
774
|
ref?: Ref<HTMLInputElement>;
|
|
772
775
|
}
|
|
773
776
|
/**
|
|
@@ -782,7 +785,7 @@ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
782
785
|
* </fieldset>
|
|
783
786
|
* ```
|
|
784
787
|
*/
|
|
785
|
-
declare function Radio({ label, className, ...rest }: RadioProps): ReactElement;
|
|
788
|
+
declare function Radio({ label, size, className, ...rest }: RadioProps): ReactElement;
|
|
786
789
|
|
|
787
790
|
interface SwitchBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
788
791
|
/** Busy blocks toggling for the same reason disabled does — a second tap
|
|
@@ -960,8 +963,7 @@ declare function ListItem({ title, description, leading, trailing, actions, onCl
|
|
|
960
963
|
|
|
961
964
|
interface DataColumn<Row> {
|
|
962
965
|
key: string;
|
|
963
|
-
/** Read in the header row
|
|
964
|
-
folded into cards. */
|
|
966
|
+
/** Read in the header row. */
|
|
965
967
|
header: ReactNode;
|
|
966
968
|
/** CSS width for the column, applied through the colgroup. */
|
|
967
969
|
width?: string;
|
|
@@ -1012,11 +1014,13 @@ type DataTableProps<Row> = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
1012
1014
|
ref?: Ref<HTMLDivElement>;
|
|
1013
1015
|
} & DataTableSelection;
|
|
1014
1016
|
/**
|
|
1015
|
-
* Rows and columns,
|
|
1017
|
+
* Rows and columns, at every width.
|
|
1016
1018
|
*
|
|
1017
|
-
*
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
1019
|
+
* A table is for reading across a row and comparing down a column, and it stays
|
|
1020
|
+
* one on a narrow screen rather than turning into something else: where the
|
|
1021
|
+
* columns need more room than there is, the table pans sideways inside a box
|
|
1022
|
+
* that takes focus. An app wanting cards on a phone builds cards — that is a
|
|
1023
|
+
* different component, not this one wearing a second layout.
|
|
1020
1024
|
*
|
|
1021
1025
|
* ```tsx
|
|
1022
1026
|
* <DataTable
|
package/dist/index.d.ts
CHANGED
|
@@ -765,9 +765,12 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "typ
|
|
|
765
765
|
*/
|
|
766
766
|
declare function Checkbox({ label, labelHidden, indeterminate, className, ref, ...rest }: CheckboxProps): ReactElement;
|
|
767
767
|
|
|
768
|
+
type RadioSize = "sm" | "md" | "lg";
|
|
768
769
|
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
769
770
|
/** Inline label — part of the click target. */
|
|
770
771
|
label: string;
|
|
772
|
+
/** Control step. Default md. The 44px target holds at every step. */
|
|
773
|
+
size?: RadioSize;
|
|
771
774
|
ref?: Ref<HTMLInputElement>;
|
|
772
775
|
}
|
|
773
776
|
/**
|
|
@@ -782,7 +785,7 @@ interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"
|
|
|
782
785
|
* </fieldset>
|
|
783
786
|
* ```
|
|
784
787
|
*/
|
|
785
|
-
declare function Radio({ label, className, ...rest }: RadioProps): ReactElement;
|
|
788
|
+
declare function Radio({ label, size, className, ...rest }: RadioProps): ReactElement;
|
|
786
789
|
|
|
787
790
|
interface SwitchBaseProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
788
791
|
/** Busy blocks toggling for the same reason disabled does — a second tap
|
|
@@ -960,8 +963,7 @@ declare function ListItem({ title, description, leading, trailing, actions, onCl
|
|
|
960
963
|
|
|
961
964
|
interface DataColumn<Row> {
|
|
962
965
|
key: string;
|
|
963
|
-
/** Read in the header row
|
|
964
|
-
folded into cards. */
|
|
966
|
+
/** Read in the header row. */
|
|
965
967
|
header: ReactNode;
|
|
966
968
|
/** CSS width for the column, applied through the colgroup. */
|
|
967
969
|
width?: string;
|
|
@@ -1012,11 +1014,13 @@ type DataTableProps<Row> = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
|
|
|
1012
1014
|
ref?: Ref<HTMLDivElement>;
|
|
1013
1015
|
} & DataTableSelection;
|
|
1014
1016
|
/**
|
|
1015
|
-
* Rows and columns,
|
|
1017
|
+
* Rows and columns, at every width.
|
|
1016
1018
|
*
|
|
1017
|
-
*
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
1019
|
+
* A table is for reading across a row and comparing down a column, and it stays
|
|
1020
|
+
* one on a narrow screen rather than turning into something else: where the
|
|
1021
|
+
* columns need more room than there is, the table pans sideways inside a box
|
|
1022
|
+
* that takes focus. An app wanting cards on a phone builds cards — that is a
|
|
1023
|
+
* different component, not this one wearing a second layout.
|
|
1020
1024
|
*
|
|
1021
1025
|
* ```tsx
|
|
1022
1026
|
* <DataTable
|
package/dist/index.js
CHANGED
|
@@ -1255,9 +1255,9 @@ function Checkbox({
|
|
|
1255
1255
|
}
|
|
1256
1256
|
|
|
1257
1257
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Radio/Radio.module.css?mds-scoped
|
|
1258
|
-
var Radio_module_default = { "root": "mds-Radio__root", "dot": "mds-Radio__dot mds-hit-area__hitArea", "label": "mds-Radio__label" };
|
|
1259
|
-
function Radio({ label, className, ...rest }) {
|
|
1260
|
-
return /* @__PURE__ */ jsxs("label", { className: cx(Radio_module_default.root, className), children: [
|
|
1258
|
+
var Radio_module_default = { "root": "mds-Radio__root", "size-sm": "mds-Radio__size-sm", "size-lg": "mds-Radio__size-lg", "dot": "mds-Radio__dot mds-hit-area__hitArea", "label": "mds-Radio__label" };
|
|
1259
|
+
function Radio({ label, size: size2 = "md", className, ...rest }) {
|
|
1260
|
+
return /* @__PURE__ */ jsxs("label", { className: cx(Radio_module_default.root, Radio_module_default[`size-${size2}`], className), children: [
|
|
1261
1261
|
/* @__PURE__ */ jsx("input", { type: "radio", className: Radio_module_default.dot, ...rest }),
|
|
1262
1262
|
/* @__PURE__ */ jsx("span", { className: Radio_module_default.label, children: label })
|
|
1263
1263
|
] });
|
|
@@ -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 })
|