@mond-design-system/react 4.2.0 → 4.4.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
  }
@@ -1076,7 +1078,10 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "onClick"> {
1076
1078
  onClick?: () => void;
1077
1079
  /** Makes the whole card a link. Wins over onClick. */
1078
1080
  href?: string;
1079
- /** Element override for that link, e.g. a router's Link. */
1081
+ /** Element override for the root. With href, the link element — a router's
1082
+ Link. Without one, what the card is in the outline: a <section> that names
1083
+ itself, an <article> holding a post. No wrapper can supply that from
1084
+ outside, since the wrapper is not the card. Default div. */
1080
1085
  as?: ElementType;
1081
1086
  /** The root is an `<a>`, a `<button>` or a `<div>` depending on the props,
1082
1087
  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
  }
@@ -1076,7 +1078,10 @@ interface CardProps extends Omit<HTMLAttributes<HTMLElement>, "onClick"> {
1076
1078
  onClick?: () => void;
1077
1079
  /** Makes the whole card a link. Wins over onClick. */
1078
1080
  href?: string;
1079
- /** Element override for that link, e.g. a router's Link. */
1081
+ /** Element override for the root. With href, the link element — a router's
1082
+ Link. Without one, what the card is in the outline: a <section> that names
1083
+ itself, an <article> holding a post. No wrapper can supply that from
1084
+ outside, since the wrapper is not the card. Default div. */
1080
1085
  as?: ElementType;
1081
1086
  /** The root is an `<a>`, a `<button>` or a `<div>` depending on the props,
1082
1087
  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 = {
@@ -1521,34 +1521,42 @@ function ToastProvider({
1521
1521
  const value = useMemo(() => ({ toast, dismiss }), [toast, dismiss]);
1522
1522
  return /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
1523
1523
  children,
1524
- /* @__PURE__ */ jsx("div", { role: "region", "aria-label": regionLabel, className: Toast_module_default.viewport, children: toasts.map((entry) => /* @__PURE__ */ jsxs("div", { role: "status", className: cx(Toast_module_default.toast, Toast_module_default[`tone-${entry.tone}`]), children: [
1525
- /* @__PURE__ */ jsxs("span", { className: Toast_module_default.body, children: [
1526
- /* @__PURE__ */ jsx("span", { className: Toast_module_default.title, children: entry.title }),
1527
- entry.description !== void 0 && /* @__PURE__ */ jsx("span", { className: Toast_module_default.description, children: entry.description })
1528
- ] }),
1529
- entry.action !== void 0 && /* @__PURE__ */ jsx(
1530
- "button",
1531
- {
1532
- type: "button",
1533
- className: Toast_module_default.action,
1534
- onClick: () => {
1535
- entry.action?.onClick();
1536
- dismiss(entry.id);
1537
- },
1538
- children: entry.action.label
1539
- }
1540
- ),
1541
- /* @__PURE__ */ jsx(
1542
- "button",
1543
- {
1544
- type: "button",
1545
- "aria-label": `${dismissLabel}: ${entry.title}`,
1546
- className: Toast_module_default.close,
1547
- onClick: () => dismiss(entry.id),
1548
- children: /* @__PURE__ */ jsx(CloseGlyph, { className: Toast_module_default.closeGlyph })
1549
- }
1550
- )
1551
- ] }, entry.id)) })
1524
+ /* @__PURE__ */ jsx("div", { role: "region", "aria-label": regionLabel, className: Toast_module_default.viewport, children: toasts.map((entry) => /* @__PURE__ */ jsxs(
1525
+ "div",
1526
+ {
1527
+ role: entry.tone === "danger" ? "alert" : "status",
1528
+ className: cx(Toast_module_default.toast, Toast_module_default[`tone-${entry.tone}`]),
1529
+ children: [
1530
+ /* @__PURE__ */ jsxs("span", { className: Toast_module_default.body, children: [
1531
+ /* @__PURE__ */ jsx("span", { className: Toast_module_default.title, children: entry.title }),
1532
+ entry.description !== void 0 && /* @__PURE__ */ jsx("span", { className: Toast_module_default.description, children: entry.description })
1533
+ ] }),
1534
+ entry.action !== void 0 && /* @__PURE__ */ jsx(
1535
+ "button",
1536
+ {
1537
+ type: "button",
1538
+ className: Toast_module_default.action,
1539
+ onClick: () => {
1540
+ entry.action?.onClick();
1541
+ dismiss(entry.id);
1542
+ },
1543
+ children: entry.action.label
1544
+ }
1545
+ ),
1546
+ /* @__PURE__ */ jsx(
1547
+ "button",
1548
+ {
1549
+ type: "button",
1550
+ "aria-label": `${dismissLabel}: ${entry.title}`,
1551
+ className: Toast_module_default.close,
1552
+ onClick: () => dismiss(entry.id),
1553
+ children: /* @__PURE__ */ jsx(CloseGlyph, { className: Toast_module_default.closeGlyph })
1554
+ }
1555
+ )
1556
+ ]
1557
+ },
1558
+ entry.id
1559
+ )) })
1552
1560
  ] });
1553
1561
  }
1554
1562
 
@@ -1616,8 +1624,8 @@ var Card_module_default = { "card": "mds-Card__card", "variant-raised": "mds-Car
1616
1624
  function Card({ children, variant = "card", emphasis = false, onClick, href, as, className, ref, ...rest }) {
1617
1625
  const cardClass = cx(Card_module_default.card, Card_module_default[`variant-${variant}`], emphasis && Card_module_default.emphasis, className);
1618
1626
  if (href !== void 0) {
1619
- const Element = as ?? "a";
1620
- return /* @__PURE__ */ jsx(Element, { className: cx(cardClass, Card_module_default.interactive), href, ref, ...rest, children });
1627
+ const Element2 = as ?? "a";
1628
+ return /* @__PURE__ */ jsx(Element2, { className: cx(cardClass, Card_module_default.interactive), href, ref, ...rest, children });
1621
1629
  }
1622
1630
  if (onClick !== void 0) {
1623
1631
  return /* @__PURE__ */ jsx(
@@ -1632,7 +1640,8 @@ function Card({ children, variant = "card", emphasis = false, onClick, href, as,
1632
1640
  }
1633
1641
  );
1634
1642
  }
1635
- return /* @__PURE__ */ jsx("div", { className: cardClass, ref, ...rest, children });
1643
+ const Element = as ?? "div";
1644
+ return /* @__PURE__ */ jsx(Element, { className: cardClass, ref, ...rest, children });
1636
1645
  }
1637
1646
  function CardHeader({ className, ...rest }) {
1638
1647
  return /* @__PURE__ */ jsx("div", { className: cx(Card_module_default.header, className), ...rest });