@mond-design-system/react 4.4.0 → 4.6.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 +38 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +22 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +16 -4
- package/dist/index.d.ts +16 -4
- package/dist/index.js +38 -24
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -530,6 +530,11 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
530
530
|
/** Any CSS length. Text defaults to full width, one line tall. */
|
|
531
531
|
width?: string;
|
|
532
532
|
height?: string;
|
|
533
|
+
/** How many lines of text to stand in for. Above one, the last is cut short
|
|
534
|
+
— a paragraph ends mid-line, and a block of full-width bars reads as a
|
|
535
|
+
table. Text only: a rect or a circle is one shape however many lines of
|
|
536
|
+
copy it replaces. */
|
|
537
|
+
lines?: number;
|
|
533
538
|
ref?: Ref<HTMLSpanElement>;
|
|
534
539
|
}
|
|
535
540
|
/**
|
|
@@ -542,6 +547,7 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
542
547
|
* <Stack gap="tight">
|
|
543
548
|
* <Skeleton width="40%" />
|
|
544
549
|
* <Skeleton />
|
|
550
|
+
* <Skeleton lines={3} />
|
|
545
551
|
* <Skeleton variant="rect" height="8rem" />
|
|
546
552
|
* </Stack>
|
|
547
553
|
* ) : (
|
|
@@ -550,7 +556,7 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
550
556
|
* </div>
|
|
551
557
|
* ```
|
|
552
558
|
*/
|
|
553
|
-
declare function Skeleton({ variant, width, height, className, style, ...rest }: SkeletonProps): ReactElement;
|
|
559
|
+
declare function Skeleton({ variant, width, height, lines, className, style, ...rest }: SkeletonProps): ReactElement;
|
|
554
560
|
|
|
555
561
|
interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
556
562
|
/** 0–100; clamped. Ignored when indeterminate. */
|
|
@@ -853,8 +859,14 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
|
|
|
853
859
|
description?: ReactNode;
|
|
854
860
|
/** Slot before the text — Avatar, Icon, … */
|
|
855
861
|
leading?: ReactNode;
|
|
856
|
-
/** Slot after the text — Badge, chevron, …
|
|
862
|
+
/** Slot after the text — Badge, chevron, … Inside the row's hit target, so
|
|
863
|
+
it is for things that are read, not pressed. */
|
|
857
864
|
trailing?: ReactNode;
|
|
865
|
+
/** Controls of the row's own, beside it rather than in it. A roster row
|
|
866
|
+
navigates to the member and carries an add/remove button: put that in
|
|
867
|
+
`trailing` and it is a button inside the link. This slot sits outside
|
|
868
|
+
the hit target, where a second control can be reached. */
|
|
869
|
+
actions?: ReactNode;
|
|
858
870
|
/** Makes the whole row a button. */
|
|
859
871
|
onClick?: () => void;
|
|
860
872
|
/** Marks an onClick row as a toggle — a picker row that selects rather than
|
|
@@ -880,7 +892,7 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
|
|
|
880
892
|
* One row. Static by default; interactive as one whole-row button/link.
|
|
881
893
|
* An `<li>` inside a ListGroup, a standalone `<div>` row anywhere else.
|
|
882
894
|
*/
|
|
883
|
-
declare function ListItem({ title, description, leading, trailing, onClick, pressed, href, as, surface, className, ref, ...rest }: ListItemProps): ReactElement;
|
|
895
|
+
declare function ListItem({ title, description, leading, trailing, actions, onClick, pressed, href, as, surface, className, ref, ...rest }: ListItemProps): ReactElement;
|
|
884
896
|
|
|
885
897
|
interface EmptyStateProps {
|
|
886
898
|
title: string;
|
|
@@ -996,7 +1008,7 @@ interface ToastProviderProps {
|
|
|
996
1008
|
*/
|
|
997
1009
|
declare function ToastProvider({ children, regionLabel, dismissLabel, }: ToastProviderProps): ReactElement;
|
|
998
1010
|
|
|
999
|
-
type StackGap = "hairline" | "tight" | "base" | "loose" | "section";
|
|
1011
|
+
type StackGap = "hairline" | "tight" | "base" | "loose" | "group" | "section";
|
|
1000
1012
|
type StackAlign = "start" | "center" | "end" | "stretch";
|
|
1001
1013
|
interface StackProps extends HTMLAttributes<HTMLElement> {
|
|
1002
1014
|
/** Space between children, on the gap scale. Default "base". */
|
package/dist/index.d.ts
CHANGED
|
@@ -530,6 +530,11 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
530
530
|
/** Any CSS length. Text defaults to full width, one line tall. */
|
|
531
531
|
width?: string;
|
|
532
532
|
height?: string;
|
|
533
|
+
/** How many lines of text to stand in for. Above one, the last is cut short
|
|
534
|
+
— a paragraph ends mid-line, and a block of full-width bars reads as a
|
|
535
|
+
table. Text only: a rect or a circle is one shape however many lines of
|
|
536
|
+
copy it replaces. */
|
|
537
|
+
lines?: number;
|
|
533
538
|
ref?: Ref<HTMLSpanElement>;
|
|
534
539
|
}
|
|
535
540
|
/**
|
|
@@ -542,6 +547,7 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
542
547
|
* <Stack gap="tight">
|
|
543
548
|
* <Skeleton width="40%" />
|
|
544
549
|
* <Skeleton />
|
|
550
|
+
* <Skeleton lines={3} />
|
|
545
551
|
* <Skeleton variant="rect" height="8rem" />
|
|
546
552
|
* </Stack>
|
|
547
553
|
* ) : (
|
|
@@ -550,7 +556,7 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
550
556
|
* </div>
|
|
551
557
|
* ```
|
|
552
558
|
*/
|
|
553
|
-
declare function Skeleton({ variant, width, height, className, style, ...rest }: SkeletonProps): ReactElement;
|
|
559
|
+
declare function Skeleton({ variant, width, height, lines, className, style, ...rest }: SkeletonProps): ReactElement;
|
|
554
560
|
|
|
555
561
|
interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
556
562
|
/** 0–100; clamped. Ignored when indeterminate. */
|
|
@@ -853,8 +859,14 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
|
|
|
853
859
|
description?: ReactNode;
|
|
854
860
|
/** Slot before the text — Avatar, Icon, … */
|
|
855
861
|
leading?: ReactNode;
|
|
856
|
-
/** Slot after the text — Badge, chevron, …
|
|
862
|
+
/** Slot after the text — Badge, chevron, … Inside the row's hit target, so
|
|
863
|
+
it is for things that are read, not pressed. */
|
|
857
864
|
trailing?: ReactNode;
|
|
865
|
+
/** Controls of the row's own, beside it rather than in it. A roster row
|
|
866
|
+
navigates to the member and carries an add/remove button: put that in
|
|
867
|
+
`trailing` and it is a button inside the link. This slot sits outside
|
|
868
|
+
the hit target, where a second control can be reached. */
|
|
869
|
+
actions?: ReactNode;
|
|
858
870
|
/** Makes the whole row a button. */
|
|
859
871
|
onClick?: () => void;
|
|
860
872
|
/** Marks an onClick row as a toggle — a picker row that selects rather than
|
|
@@ -880,7 +892,7 @@ interface ListItemProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "onC
|
|
|
880
892
|
* One row. Static by default; interactive as one whole-row button/link.
|
|
881
893
|
* An `<li>` inside a ListGroup, a standalone `<div>` row anywhere else.
|
|
882
894
|
*/
|
|
883
|
-
declare function ListItem({ title, description, leading, trailing, onClick, pressed, href, as, surface, className, ref, ...rest }: ListItemProps): ReactElement;
|
|
895
|
+
declare function ListItem({ title, description, leading, trailing, actions, onClick, pressed, href, as, surface, className, ref, ...rest }: ListItemProps): ReactElement;
|
|
884
896
|
|
|
885
897
|
interface EmptyStateProps {
|
|
886
898
|
title: string;
|
|
@@ -996,7 +1008,7 @@ interface ToastProviderProps {
|
|
|
996
1008
|
*/
|
|
997
1009
|
declare function ToastProvider({ children, regionLabel, dismissLabel, }: ToastProviderProps): ReactElement;
|
|
998
1010
|
|
|
999
|
-
type StackGap = "hairline" | "tight" | "base" | "loose" | "section";
|
|
1011
|
+
type StackGap = "hairline" | "tight" | "base" | "loose" | "group" | "section";
|
|
1000
1012
|
type StackAlign = "start" | "center" | "end" | "stretch";
|
|
1001
1013
|
interface StackProps extends HTMLAttributes<HTMLElement> {
|
|
1002
1014
|
/** Space between children, on the gap scale. Default "base". */
|
package/dist/index.js
CHANGED
|
@@ -1024,11 +1024,13 @@ function VisuallyHidden({ as = "span", className, ...rest }) {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
|
|
1026
1026
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Skeleton/Skeleton.module.css?mds-scoped
|
|
1027
|
-
var Skeleton_module_default = { "skeleton": "mds-Skeleton__skeleton", "pulse": "mds-Skeleton__pulse", "variant-text": "mds-Skeleton__variant-text", "variant-rect": "mds-Skeleton__variant-rect", "variant-circle": "mds-Skeleton__variant-circle" };
|
|
1027
|
+
var Skeleton_module_default = { "skeleton": "mds-Skeleton__skeleton", "pulse": "mds-Skeleton__pulse", "lines": "mds-Skeleton__lines", "variant-text": "mds-Skeleton__variant-text", "variant-rect": "mds-Skeleton__variant-rect", "variant-circle": "mds-Skeleton__variant-circle" };
|
|
1028
|
+
var LAST_LINE = "62%";
|
|
1028
1029
|
function Skeleton({
|
|
1029
1030
|
variant = "text",
|
|
1030
1031
|
width,
|
|
1031
1032
|
height,
|
|
1033
|
+
lines = 1,
|
|
1032
1034
|
className,
|
|
1033
1035
|
style,
|
|
1034
1036
|
...rest
|
|
@@ -1037,15 +1039,18 @@ function Skeleton({
|
|
|
1037
1039
|
...width ? { "--skeleton-w": width } : {},
|
|
1038
1040
|
...height ? { "--skeleton-h": height } : {}
|
|
1039
1041
|
};
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
{
|
|
1043
|
-
"
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1042
|
+
const box = cx(Skeleton_module_default.skeleton, Skeleton_module_default[`variant-${variant}`], className);
|
|
1043
|
+
if (variant === "text" && lines > 1) {
|
|
1044
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: Skeleton_module_default.lines, style, ...rest, children: Array.from({ length: lines }, (_, line) => /* @__PURE__ */ jsx(
|
|
1045
|
+
"span",
|
|
1046
|
+
{
|
|
1047
|
+
className: box,
|
|
1048
|
+
style: line === lines - 1 ? { ...vars, "--skeleton-w": LAST_LINE } : vars
|
|
1049
|
+
},
|
|
1050
|
+
line
|
|
1051
|
+
)) });
|
|
1052
|
+
}
|
|
1053
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: box, style: { ...vars, ...style }, ...rest });
|
|
1049
1054
|
}
|
|
1050
1055
|
|
|
1051
1056
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/ProgressBar/ProgressBar.module.css?mds-scoped
|
|
@@ -1319,7 +1324,7 @@ function SearchField({
|
|
|
1319
1324
|
}
|
|
1320
1325
|
|
|
1321
1326
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/List/List.module.css?mds-scoped
|
|
1322
|
-
var List_module_default = { "group": "mds-List__group", "labelledGroup": "mds-List__labelledGroup", "label": "mds-List__label", "item": "mds-List__item", "surface-card": "mds-List__surface-card", "surface-sunken": "mds-List__surface-sunken", "surface-accent": "mds-List__surface-accent", "surface-plain": "mds-List__surface-plain", "row": "mds-List__row", "interactive": "mds-List__interactive", "leading": "mds-List__leading", "trailing": "mds-List__trailing", "text": "mds-List__text", "title": "mds-List__title", "description": "mds-List__description" };
|
|
1327
|
+
var List_module_default = { "group": "mds-List__group", "labelledGroup": "mds-List__labelledGroup", "label": "mds-List__label", "item": "mds-List__item", "surface-card": "mds-List__surface-card", "surface-sunken": "mds-List__surface-sunken", "surface-accent": "mds-List__surface-accent", "surface-plain": "mds-List__surface-plain", "row": "mds-List__row", "interactive": "mds-List__interactive", "withActions": "mds-List__withActions", "actions": "mds-List__actions", "leading": "mds-List__leading", "trailing": "mds-List__trailing", "text": "mds-List__text", "title": "mds-List__title", "description": "mds-List__description" };
|
|
1323
1328
|
var ListGroupContext = createContext(false);
|
|
1324
1329
|
function ListGroup({ label, className, ...rest }) {
|
|
1325
1330
|
const headingId = useId();
|
|
@@ -1342,6 +1347,7 @@ function ListItem({
|
|
|
1342
1347
|
description,
|
|
1343
1348
|
leading,
|
|
1344
1349
|
trailing,
|
|
1350
|
+
actions,
|
|
1345
1351
|
onClick,
|
|
1346
1352
|
pressed,
|
|
1347
1353
|
href,
|
|
@@ -1363,22 +1369,30 @@ function ListItem({
|
|
|
1363
1369
|
] }),
|
|
1364
1370
|
trailing != null && /* @__PURE__ */ jsx("span", { className: List_module_default.trailing, children: trailing })
|
|
1365
1371
|
] });
|
|
1366
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ jsxs(
|
|
1367
1373
|
Root,
|
|
1368
1374
|
{
|
|
1369
|
-
className: cx(
|
|
1375
|
+
className: cx(
|
|
1376
|
+
List_module_default.item,
|
|
1377
|
+
actions != null && List_module_default.withActions,
|
|
1378
|
+
resolved && List_module_default[`surface-${resolved}`],
|
|
1379
|
+
className
|
|
1380
|
+
),
|
|
1370
1381
|
ref,
|
|
1371
1382
|
...rest,
|
|
1372
|
-
children:
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1383
|
+
children: [
|
|
1384
|
+
href !== void 0 ? /* @__PURE__ */ jsx(LinkElement, { className: cx(List_module_default.row, List_module_default.interactive), href, children: content }) : onClick !== void 0 ? /* @__PURE__ */ jsx(
|
|
1385
|
+
"button",
|
|
1386
|
+
{
|
|
1387
|
+
type: "button",
|
|
1388
|
+
className: cx(List_module_default.row, List_module_default.interactive),
|
|
1389
|
+
onClick,
|
|
1390
|
+
"aria-pressed": pressed,
|
|
1391
|
+
children: content
|
|
1392
|
+
}
|
|
1393
|
+
) : /* @__PURE__ */ jsx("span", { className: List_module_default.row, children: content }),
|
|
1394
|
+
actions != null && /* @__PURE__ */ jsx("span", { className: List_module_default.actions, children: actions })
|
|
1395
|
+
]
|
|
1382
1396
|
}
|
|
1383
1397
|
);
|
|
1384
1398
|
}
|
|
@@ -1561,7 +1575,7 @@ function ToastProvider({
|
|
|
1561
1575
|
}
|
|
1562
1576
|
|
|
1563
1577
|
// mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Stack/Stack.module.css?mds-scoped
|
|
1564
|
-
var Stack_module_default = { "stack": "mds-Stack__stack", "gap-hairline": "mds-Stack__gap-hairline", "gap-tight": "mds-Stack__gap-tight", "gap-base": "mds-Stack__gap-base", "gap-loose": "mds-Stack__gap-loose", "gap-section": "mds-Stack__gap-section", "align-start": "mds-Stack__align-start", "align-center": "mds-Stack__align-center", "align-end": "mds-Stack__align-end", "align-stretch": "mds-Stack__align-stretch" };
|
|
1578
|
+
var Stack_module_default = { "stack": "mds-Stack__stack", "gap-hairline": "mds-Stack__gap-hairline", "gap-tight": "mds-Stack__gap-tight", "gap-base": "mds-Stack__gap-base", "gap-loose": "mds-Stack__gap-loose", "gap-group": "mds-Stack__gap-group", "gap-section": "mds-Stack__gap-section", "align-start": "mds-Stack__align-start", "align-center": "mds-Stack__align-center", "align-end": "mds-Stack__align-end", "align-stretch": "mds-Stack__align-stretch" };
|
|
1565
1579
|
|
|
1566
1580
|
// src/components/Stack/Stack.tsx
|
|
1567
1581
|
function Stack({
|