@mond-design-system/react 4.3.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.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
|
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
|
|
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 = {
|
|
@@ -1624,8 +1624,8 @@ var Card_module_default = { "card": "mds-Card__card", "variant-raised": "mds-Car
|
|
|
1624
1624
|
function Card({ children, variant = "card", emphasis = false, onClick, href, as, className, ref, ...rest }) {
|
|
1625
1625
|
const cardClass = cx(Card_module_default.card, Card_module_default[`variant-${variant}`], emphasis && Card_module_default.emphasis, className);
|
|
1626
1626
|
if (href !== void 0) {
|
|
1627
|
-
const
|
|
1628
|
-
return /* @__PURE__ */ jsx(
|
|
1627
|
+
const Element2 = as ?? "a";
|
|
1628
|
+
return /* @__PURE__ */ jsx(Element2, { className: cx(cardClass, Card_module_default.interactive), href, ref, ...rest, children });
|
|
1629
1629
|
}
|
|
1630
1630
|
if (onClick !== void 0) {
|
|
1631
1631
|
return /* @__PURE__ */ jsx(
|
|
@@ -1640,7 +1640,8 @@ function Card({ children, variant = "card", emphasis = false, onClick, href, as,
|
|
|
1640
1640
|
}
|
|
1641
1641
|
);
|
|
1642
1642
|
}
|
|
1643
|
-
|
|
1643
|
+
const Element = as ?? "div";
|
|
1644
|
+
return /* @__PURE__ */ jsx(Element, { className: cardClass, ref, ...rest, children });
|
|
1644
1645
|
}
|
|
1645
1646
|
function CardHeader({ className, ...rest }) {
|
|
1646
1647
|
return /* @__PURE__ */ jsx("div", { className: cx(Card_module_default.header, className), ...rest });
|