@mond-design-system/react 4.3.0 → 4.5.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
@@ -44,13 +44,15 @@ interface TextProps extends HTMLAttributes<HTMLElement> {
44
44
  */
45
45
  declare function Text({ variant, as, tone, align, truncate, className, ...rest }: TextProps): ReactElement;
46
46
 
47
- type HeadingVariant = "display" | "title" | "subtitle";
47
+ type HeadingVariant = "display" | "title" | "subtitle" | "label";
48
48
  type HeadingLevel = 1 | 2 | 3 | 4;
49
49
  type HeadingTone = "primary" | "secondary" | "inverse" | "accent" | "on-media";
50
50
  interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
51
51
  /** Document outline level → h1–h4, with a matching default type role. Default 2. */
52
52
  level?: HeadingLevel;
53
- /** Type role override — outline level and visual size are separate concerns. */
53
+ /** Type role override — outline level and visual size are separate concerns.
54
+ `label` is the small one: a rail beside the page, a group inside a form —
55
+ a title that names its section without competing with the page's own. */
54
56
  variant?: HeadingVariant;
55
57
  tone?: HeadingTone;
56
58
  }
@@ -528,6 +530,11 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
528
530
  /** Any CSS length. Text defaults to full width, one line tall. */
529
531
  width?: string;
530
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;
531
538
  ref?: Ref<HTMLSpanElement>;
532
539
  }
533
540
  /**
@@ -540,6 +547,7 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
540
547
  * <Stack gap="tight">
541
548
  * <Skeleton width="40%" />
542
549
  * <Skeleton />
550
+ * <Skeleton lines={3} />
543
551
  * <Skeleton variant="rect" height="8rem" />
544
552
  * </Stack>
545
553
  * ) : (
@@ -548,7 +556,7 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
548
556
  * </div>
549
557
  * ```
550
558
  */
551
- declare function Skeleton({ variant, width, height, className, style, ...rest }: SkeletonProps): ReactElement;
559
+ declare function Skeleton({ variant, width, height, lines, className, style, ...rest }: SkeletonProps): ReactElement;
552
560
 
553
561
  interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
554
562
  /** 0–100; clamped. Ignored when indeterminate. */
@@ -1076,7 +1084,10 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "onClick"> {
1076
1084
  onClick?: () => void;
1077
1085
  /** Makes the whole card a link. Wins over onClick. */
1078
1086
  href?: string;
1079
- /** Element override for that link, e.g. a router's Link. */
1087
+ /** Element override for the root. With href, the link element — a router's
1088
+ Link. Without one, what the card is in the outline: a <section> that names
1089
+ itself, an <article> holding a post. No wrapper can supply that from
1090
+ outside, since the wrapper is not the card. Default div. */
1080
1091
  as?: ElementType;
1081
1092
  /** The root is an `<a>`, a `<button>` or a `<div>` depending on the props,
1082
1093
  so the ref is typed to what all three are. */
package/dist/index.d.ts CHANGED
@@ -44,13 +44,15 @@ interface TextProps extends HTMLAttributes<HTMLElement> {
44
44
  */
45
45
  declare function Text({ variant, as, tone, align, truncate, className, ...rest }: TextProps): ReactElement;
46
46
 
47
- type HeadingVariant = "display" | "title" | "subtitle";
47
+ type HeadingVariant = "display" | "title" | "subtitle" | "label";
48
48
  type HeadingLevel = 1 | 2 | 3 | 4;
49
49
  type HeadingTone = "primary" | "secondary" | "inverse" | "accent" | "on-media";
50
50
  interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {
51
51
  /** Document outline level → h1–h4, with a matching default type role. Default 2. */
52
52
  level?: HeadingLevel;
53
- /** Type role override — outline level and visual size are separate concerns. */
53
+ /** Type role override — outline level and visual size are separate concerns.
54
+ `label` is the small one: a rail beside the page, a group inside a form —
55
+ a title that names its section without competing with the page's own. */
54
56
  variant?: HeadingVariant;
55
57
  tone?: HeadingTone;
56
58
  }
@@ -528,6 +530,11 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
528
530
  /** Any CSS length. Text defaults to full width, one line tall. */
529
531
  width?: string;
530
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;
531
538
  ref?: Ref<HTMLSpanElement>;
532
539
  }
533
540
  /**
@@ -540,6 +547,7 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
540
547
  * <Stack gap="tight">
541
548
  * <Skeleton width="40%" />
542
549
  * <Skeleton />
550
+ * <Skeleton lines={3} />
543
551
  * <Skeleton variant="rect" height="8rem" />
544
552
  * </Stack>
545
553
  * ) : (
@@ -548,7 +556,7 @@ interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
548
556
  * </div>
549
557
  * ```
550
558
  */
551
- declare function Skeleton({ variant, width, height, className, style, ...rest }: SkeletonProps): ReactElement;
559
+ declare function Skeleton({ variant, width, height, lines, className, style, ...rest }: SkeletonProps): ReactElement;
552
560
 
553
561
  interface ProgressBarProps extends HTMLAttributes<HTMLDivElement> {
554
562
  /** 0–100; clamped. Ignored when indeterminate. */
@@ -1076,7 +1084,10 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "onClick"> {
1076
1084
  onClick?: () => void;
1077
1085
  /** Makes the whole card a link. Wins over onClick. */
1078
1086
  href?: string;
1079
- /** Element override for that link, e.g. a router's Link. */
1087
+ /** Element override for the root. With href, the link element — a router's
1088
+ Link. Without one, what the card is in the outline: a <section> that names
1089
+ itself, an <article> holding a post. No wrapper can supply that from
1090
+ outside, since the wrapper is not the card. Default div. */
1080
1091
  as?: ElementType;
1081
1092
  /** The root is an `<a>`, a `<button>` or a `<div>` depending on the props,
1082
1093
  so the ref is typed to what all three are. */
package/dist/index.js CHANGED
@@ -48,7 +48,7 @@ function Text({
48
48
  }
49
49
 
50
50
  // mds-cssmod:/home/runner/work/mond-design-system/mond-design-system/packages/react/src/components/Heading/Heading.module.css?mds-scoped
51
- var Heading_module_default = { "heading": "mds-Heading__heading", "variant-display": "mds-Heading__variant-display", "variant-title": "mds-Heading__variant-title", "variant-subtitle": "mds-Heading__variant-subtitle", "tone-primary": "mds-Heading__tone-primary", "tone-secondary": "mds-Heading__tone-secondary", "tone-inverse": "mds-Heading__tone-inverse", "tone-accent": "mds-Heading__tone-accent", "tone-on-media": "mds-Heading__tone-on-media" };
51
+ var Heading_module_default = { "heading": "mds-Heading__heading", "variant-display": "mds-Heading__variant-display", "variant-title": "mds-Heading__variant-title", "variant-subtitle": "mds-Heading__variant-subtitle", "variant-label": "mds-Heading__variant-label", "tone-primary": "mds-Heading__tone-primary", "tone-secondary": "mds-Heading__tone-secondary", "tone-inverse": "mds-Heading__tone-inverse", "tone-accent": "mds-Heading__tone-accent", "tone-on-media": "mds-Heading__tone-on-media" };
52
52
 
53
53
  // src/components/Heading/Heading.tsx
54
54
  var LEVEL_VARIANT = {
@@ -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
- return /* @__PURE__ */ jsx(
1041
- "span",
1042
- {
1043
- "aria-hidden": "true",
1044
- className: cx(Skeleton_module_default.skeleton, Skeleton_module_default[`variant-${variant}`], className),
1045
- style: { ...vars, ...style },
1046
- ...rest
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
@@ -1624,8 +1629,8 @@ var Card_module_default = { "card": "mds-Card__card", "variant-raised": "mds-Car
1624
1629
  function Card({ children, variant = "card", emphasis = false, onClick, href, as, className, ref, ...rest }) {
1625
1630
  const cardClass = cx(Card_module_default.card, Card_module_default[`variant-${variant}`], emphasis && Card_module_default.emphasis, className);
1626
1631
  if (href !== void 0) {
1627
- const Element = as ?? "a";
1628
- return /* @__PURE__ */ jsx(Element, { className: cx(cardClass, Card_module_default.interactive), href, ref, ...rest, children });
1632
+ const Element2 = as ?? "a";
1633
+ return /* @__PURE__ */ jsx(Element2, { className: cx(cardClass, Card_module_default.interactive), href, ref, ...rest, children });
1629
1634
  }
1630
1635
  if (onClick !== void 0) {
1631
1636
  return /* @__PURE__ */ jsx(
@@ -1640,7 +1645,8 @@ function Card({ children, variant = "card", emphasis = false, onClick, href, as,
1640
1645
  }
1641
1646
  );
1642
1647
  }
1643
- return /* @__PURE__ */ jsx("div", { className: cardClass, ref, ...rest, children });
1648
+ const Element = as ?? "div";
1649
+ return /* @__PURE__ */ jsx(Element, { className: cardClass, ref, ...rest, children });
1644
1650
  }
1645
1651
  function CardHeader({ className, ...rest }) {
1646
1652
  return /* @__PURE__ */ jsx("div", { className: cx(Card_module_default.header, className), ...rest });