@m4l/base 1.6.0 → 1.7.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/extended/mui/Typography/constants.d.ts +1 -0
- package/extended/mui/Typography/constants.d.ts.map +1 -1
- package/extended/mui/Typography/constants.js +11 -10
- package/extended/mui/Typography/types.d.ts +1 -1
- package/extended/mui/Typography/types.d.ts.map +1 -1
- package/extended/mui/Typography/typography.styles.d.ts.map +1 -1
- package/extended/mui/Typography/typography.styles.js +12 -10
- package/package.json +1 -1
- package/utils/getTypographyStyles.d.ts +3 -1
- package/utils/getTypographyStyles.d.ts.map +1 -1
- package/utils/getTypographyStyles.js +7 -6
|
@@ -13,6 +13,7 @@ export declare const TYPOGRAPHY_CLASSES: Record<"root" | "skeleton", string>;
|
|
|
13
13
|
export declare const TYPOGRAPHY_FONTS: {
|
|
14
14
|
readonly Inter: "Inter";
|
|
15
15
|
readonly Jura: "Jura";
|
|
16
|
+
readonly IBMPlexMono: "IBM Plex Mono";
|
|
16
17
|
};
|
|
17
18
|
/**
|
|
18
19
|
* Shared fallback stack used when the primary design-system font is unavailable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/constants.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,kBAAkB,qCAG9B,CAAC;AAEF,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/constants.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,wBAAwB,kBAAkB,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AAEtE;;GAEG;AACH,eAAO,MAAM,kBAAkB,qCAG9B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,+BAA+B,oEACiB,CAAC;AAE9D;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,UASzD"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { getComponentClasses as
|
|
1
|
+
import { getComponentClasses as n } from "../../../utils/getComponentSlotRoot.js";
|
|
2
2
|
import { TypographySlots as r } from "./slots/typographyEnum.js";
|
|
3
|
-
const s = "M4LTypography",
|
|
3
|
+
const s = "M4LTypography", M = "M4lclassCssSpecificity", Y = n(
|
|
4
4
|
s,
|
|
5
5
|
r
|
|
6
6
|
), e = {
|
|
7
7
|
Inter: "Inter",
|
|
8
|
-
Jura: "Jura"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
Jura: "Jura",
|
|
9
|
+
IBMPlexMono: "IBM Plex Mono"
|
|
10
|
+
}, t = '"Segoe UI",Roboto,"Helvetica Neue","Open Sans",sans-serif';
|
|
11
|
+
function c(o) {
|
|
12
|
+
return o === e.IBMPlexMono ? '"IBM Plex Mono",monospace' : o === e.Inter || o === e.Jura ? `${o},${t}` : o;
|
|
12
13
|
}
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
Y as TYPOGRAPHY_CLASSES,
|
|
16
|
+
M as TYPOGRAPHY_CLASS_NAME_SPECIFY,
|
|
16
17
|
e as TYPOGRAPHY_FONTS,
|
|
17
|
-
|
|
18
|
+
t as TYPOGRAPHY_FONT_FAMILY_FALLBACK,
|
|
18
19
|
s as TYPOGRAPHY_KEY_COMPONENT,
|
|
19
|
-
|
|
20
|
+
c as getTypographyFontFamily
|
|
20
21
|
};
|
|
@@ -8,7 +8,7 @@ import { DeepKeyOf } from '../../../utils/types';
|
|
|
8
8
|
* Typography color options supported by the component.
|
|
9
9
|
*/
|
|
10
10
|
export type TypographyColors = 'text.primary' | 'text.secondary' | 'text.disabled' | string;
|
|
11
|
-
export type TypographyFontsFamily = 'Inter' | 'Jura';
|
|
11
|
+
export type TypographyFontsFamily = 'Inter' | 'Jura' | 'IBM Plex Mono';
|
|
12
12
|
/**
|
|
13
13
|
* Typography props built on top of MUI Typography.
|
|
14
14
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/types.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,gBAAgB,GAAG,eAAe,GAAG,MAAM,CAAC;AAE5F,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/types.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,IAAI,kBAAkB,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OA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;AAErE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;IAChC,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACpC,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;IAC9B,YAAY,EAAE,eAAe,CAAC,cAAc,CAAC,CAAC;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;IACtC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,eAAe,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,mBAAmB,EAAE,OAAO,wBAAwB,EAAE,KAAK,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typography.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/typography.styles.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAOtE,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"typography.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/typography.styles.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAOtE,eAAO,MAAM,gBAAgB,EAAE,gBAmD9B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getPropertyByString as
|
|
2
|
-
import { getSizeStyles as
|
|
3
|
-
import {
|
|
4
|
-
import { getTypographyFontFamily as
|
|
1
|
+
import { getPropertyByString as r } from "@m4l/core";
|
|
2
|
+
import { getSizeStyles as s } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
|
+
import { getTypographyFamilyStyles as t } from "../../../utils/getTypographyStyles.js";
|
|
4
|
+
import { getTypographyFontFamily as e, TYPOGRAPHY_FONTS as o } from "./constants.js";
|
|
5
5
|
const d = {
|
|
6
6
|
/**
|
|
7
7
|
* Root slot styles for the Typography primitive.
|
|
@@ -17,19 +17,21 @@ const d = {
|
|
|
17
17
|
...i?.disabled || i?.color === "text.disabled" ? {
|
|
18
18
|
color: l.vars.palette.text.disabled
|
|
19
19
|
} : {
|
|
20
|
-
color:
|
|
20
|
+
color: r(
|
|
21
21
|
l.vars.palette,
|
|
22
22
|
i?.color || "text.primary",
|
|
23
23
|
"text.primary"
|
|
24
24
|
)
|
|
25
25
|
},
|
|
26
|
-
fontFamily:
|
|
27
|
-
|
|
26
|
+
fontFamily: e(
|
|
27
|
+
// Figma's Inter/Title/Title resolves to IBM Plex Mono Bold.
|
|
28
|
+
(!i?.fontFamily || i.fontFamily === o.Inter) && i?.variant === "titleStandard" ? o.IBMPlexMono : i?.fontFamily ?? o.Inter
|
|
28
29
|
),
|
|
29
|
-
...
|
|
30
|
+
...t(
|
|
30
31
|
l.generalSettings.isMobile,
|
|
31
32
|
i?.size || "medium",
|
|
32
|
-
i?.variant || "bodyStandard"
|
|
33
|
+
i?.variant || "bodyStandard",
|
|
34
|
+
i?.fontFamily ?? o.Inter
|
|
33
35
|
),
|
|
34
36
|
...i?.ellipsis && {
|
|
35
37
|
overflow: "hidden",
|
|
@@ -43,7 +45,7 @@ const d = {
|
|
|
43
45
|
* Skeleton slot styles for the Typography primitive.
|
|
44
46
|
*/
|
|
45
47
|
skeleton: ({ theme: i, ownerState: l }) => ({
|
|
46
|
-
...
|
|
48
|
+
...s(i, l?.size || "medium", "base")
|
|
47
49
|
})
|
|
48
50
|
};
|
|
49
51
|
export {
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FontProperties, Sizes, TypographyVariantProp } from '@m4l/styles';
|
|
1
|
+
import { FontProperties, Sizes, TYPOGRAPHY_SIZES_BY_FAMILY, TypographyVariantProp } from '@m4l/styles';
|
|
2
2
|
/**
|
|
3
3
|
* Returns typography token styles for use in component CSS.
|
|
4
4
|
* @param variant - Typography variant to apply (design-system or legacy name; unknown keys fall back to `bodyStandard`).
|
|
@@ -6,4 +6,6 @@ import { FontProperties, Sizes, TypographyVariantProp } from '@m4l/styles';
|
|
|
6
6
|
* @param size - `small` or `medium` from the component or `AppearanceComponentProvider`.
|
|
7
7
|
*/
|
|
8
8
|
export declare const getTypographyStyles: (isMobile: boolean, size: Extract<Sizes, "small" | "medium">, variant: TypographyVariantProp) => FontProperties;
|
|
9
|
+
/** Resolve family-specific typography while preserving semantic aliases and the body fallback. */
|
|
10
|
+
export declare const getTypographyFamilyStyles: (isMobile: boolean, size: Extract<Sizes, "small" | "medium">, variant: TypographyVariantProp, fontFamily: keyof typeof TYPOGRAPHY_SIZES_BY_FAMILY) => FontProperties;
|
|
9
11
|
//# sourceMappingURL=getTypographyStyles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTypographyStyles.d.ts","sourceRoot":"","sources":["../../../../../packages/base/src/utils/getTypographyStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAEd,KAAK,
|
|
1
|
+
{"version":3,"file":"getTypographyStyles.d.ts","sourceRoot":"","sources":["../../../../../packages/base/src/utils/getTypographyStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAEd,KAAK,EACL,0BAA0B,EAC1B,qBAAqB,EAEtB,MAAM,aAAa,CAAC;AAsBrB;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,OAAO,EACjB,MAAM,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,EACxC,SAAS,qBAAqB,KAC7B,cAEF,CAAC;AAEF,kGAAkG;AAClG,eAAO,MAAM,yBAAyB,GACpC,UAAU,OAAO,EACjB,MAAM,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,EACxC,SAAS,qBAAqB,EAC9B,YAAY,MAAM,OAAO,0BAA0B,KAClD,cAUF,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { TYPOGRAPHY_SIZES_BY_FAMILY as y } from "@m4l/styles";
|
|
2
|
+
const d = "bodyStandard", e = {
|
|
3
3
|
subtitle: "subtitleStandard",
|
|
4
4
|
paragraph: "paragraphStandard",
|
|
5
5
|
body: "bodyStandard",
|
|
6
6
|
action: "bodyStandard",
|
|
7
7
|
caption: "captionStandard"
|
|
8
|
-
},
|
|
9
|
-
const
|
|
10
|
-
return a
|
|
8
|
+
}, c = (t) => Object.prototype.hasOwnProperty.call(e, t) ? e[t] : t, A = (t, r, o) => s(t, r, o, "Inter"), s = (t, r, o, p) => {
|
|
9
|
+
const a = y[p][t ? "mobile" : "desktop"][r], n = c(o);
|
|
10
|
+
return Object.prototype.hasOwnProperty.call(a, n) ? a[n] : a[d];
|
|
11
11
|
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
s as getTypographyFamilyStyles,
|
|
14
|
+
A as getTypographyStyles
|
|
14
15
|
};
|