@m4l/base 1.0.0 → 1.0.1-beta-hotfix-publish-components-and-base-libraries.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/@types/types.d.ts +42 -0
- package/components/Icon/Icon.d.ts +1 -2
- package/components/Icon/Icon.d.ts.map +1 -1
- package/components/Icon/Icon.js +30 -31
- package/components/Icon/Icon.styles.js +3 -3
- package/components/Icon/index.d.ts +1 -1
- package/components/Icon/index.d.ts.map +1 -1
- package/components/Icon/types.d.ts +2 -3
- package/components/Icon/types.d.ts.map +1 -1
- package/extended/mui/Tooltip/Tooltip.styles.js +3 -3
- package/extended/mui/Typography/Typography.d.ts.map +1 -1
- package/extended/mui/Typography/slots/typographySlots.d.ts.map +1 -1
- package/extended/mui/Typography/slots/typographySlots.js +5 -4
- package/extended/mui/Typography/types.d.ts +8 -2
- 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 +8 -10
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +18 -19
- package/package.json +3 -3
- package/utils/getComponentSlotRoot.d.ts +2 -2
- package/utils/getNameDataTestId.d.ts +2 -2
- package/utils/getTypographyStyles.d.ts +6 -3
- package/utils/getTypographyStyles.d.ts.map +1 -1
- package/utils/getTypographyStyles.js +12 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentsOverrides, ComponentsVariants, Theme } from '@mui/material/styles';
|
|
2
|
+
import type { IconOwnerState, IconSlotsType } from '../components/Icon/types';
|
|
3
|
+
import type {
|
|
4
|
+
TooltipOwnerState,
|
|
5
|
+
TooltipSlotsType,
|
|
6
|
+
} from '../extended/mui/Tooltip/types';
|
|
7
|
+
import type {
|
|
8
|
+
TypographyOwnerState,
|
|
9
|
+
TypographySlotsType,
|
|
10
|
+
} from '../extended/mui/Typography/types';
|
|
11
|
+
|
|
12
|
+
declare module '@mui/material/styles' {
|
|
13
|
+
interface ComponentNameToClassKey {
|
|
14
|
+
M4LIcon: IconSlotsType;
|
|
15
|
+
M4LTooltip: TooltipSlotsType;
|
|
16
|
+
M4LTypography: TypographySlotsType;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface ComponentsPropsList {
|
|
20
|
+
M4LIcon: Partial<IconOwnerState>;
|
|
21
|
+
M4LTooltip: Partial<TooltipOwnerState>;
|
|
22
|
+
M4LTypography: Partial<TypographyOwnerState>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Components {
|
|
26
|
+
M4LIcon?: {
|
|
27
|
+
defaultProps?: ComponentsPropsList['M4LIcon'];
|
|
28
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LIcon'];
|
|
29
|
+
variants?: ComponentsVariants['M4LIcon'];
|
|
30
|
+
};
|
|
31
|
+
M4LTooltip?: {
|
|
32
|
+
defaultProps?: ComponentsPropsList['M4LTooltip'];
|
|
33
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LTooltip'];
|
|
34
|
+
variants?: ComponentsVariants['M4LTooltip'];
|
|
35
|
+
};
|
|
36
|
+
M4LTypography?: {
|
|
37
|
+
defaultProps?: ComponentsPropsList['M4LTypography'];
|
|
38
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LTypography'];
|
|
39
|
+
variants?: ComponentsVariants['M4LTypography'];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -3,6 +3,5 @@ import { IconProps } from './types';
|
|
|
3
3
|
* Render the base Icon primitive with URL-mask and SVG-component support.
|
|
4
4
|
*/
|
|
5
5
|
declare const Icon: (props: IconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
6
|
-
|
|
7
|
-
export { BaseIcon, Icon };
|
|
6
|
+
export { Icon };
|
|
8
7
|
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/Icon.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAkB,SAAS,EAA0C,MAAM,SAAS,CAAC;AAgC5F;;GAEG;AACH,QAAA,MAAM,IAAI,GAAI,OAAO,SAAS,qDAoH7B,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/components/Icon/Icon.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { jsxs as P, Fragment as j, jsx as
|
|
1
|
+
import { jsxs as P, Fragment as j, jsx as n } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import m from "clsx";
|
|
3
|
-
import { isValidElement as
|
|
3
|
+
import { isValidElement as u, cloneElement as A } from "react";
|
|
4
|
+
import { useModuleSkeleton as F } from "@m4l/core";
|
|
4
5
|
import { getPropDataTestId as r } from "../../utils/getNameDataTestId.js";
|
|
5
|
-
import { ICON_CLASSES as
|
|
6
|
-
import { TooltipStyled as
|
|
7
|
-
function
|
|
6
|
+
import { ICON_CLASSES as o, normalizeIconSize as L, ICON_PREFIX as a } from "./constants.js";
|
|
7
|
+
import { TooltipStyled as M, RootStyled as k, IconSkeletonStyled as O, IconStyled as _ } from "./slots/IconSlots.js";
|
|
8
|
+
function B(t) {
|
|
8
9
|
return "src" in t && typeof t.src == "string" || "icon" in t && typeof t.icon == "string";
|
|
9
10
|
}
|
|
10
|
-
function M(t) {
|
|
11
|
-
return "src" in t && t.src !== void 0 && S(t.src) || "icon" in t && t.icon !== void 0 && S(t.icon);
|
|
12
|
-
}
|
|
13
11
|
function V(t) {
|
|
14
|
-
|
|
12
|
+
return "src" in t && t.src !== void 0 && u(t.src) || "icon" in t && t.icon !== void 0 && u(t.icon);
|
|
13
|
+
}
|
|
14
|
+
function X(t) {
|
|
15
|
+
if (B(t) || V(t))
|
|
15
16
|
return "src" in t ? t.src : t.icon;
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
+
const W = (t) => {
|
|
18
19
|
const {
|
|
19
20
|
size: x = "medium",
|
|
20
21
|
rotationAngle: s,
|
|
21
|
-
tooltipContent:
|
|
22
|
+
tooltipContent: S,
|
|
22
23
|
color: C = "text.primary",
|
|
23
24
|
className: f,
|
|
24
25
|
placement: N = "bottom",
|
|
@@ -28,9 +29,8 @@ const X = (t) => {
|
|
|
28
29
|
selected: T,
|
|
29
30
|
enabledSelected: D,
|
|
30
31
|
onClick: I,
|
|
31
|
-
ariaLabel: g
|
|
32
|
-
|
|
33
|
-
} = t, i = R ?? w, e = V(t), d = B(x), E = e !== void 0 ? typeof e == "string" : void 0, h = g ? {
|
|
32
|
+
ariaLabel: g
|
|
33
|
+
} = t, y = F(), i = R ?? w, e = X(t), d = L(x), E = e !== void 0 ? typeof e == "string" : void 0, h = g ? {
|
|
34
34
|
role: "img",
|
|
35
35
|
"aria-label": g
|
|
36
36
|
} : {
|
|
@@ -46,21 +46,21 @@ const X = (t) => {
|
|
|
46
46
|
isSkeleton: y,
|
|
47
47
|
isMaskStrategy: E
|
|
48
48
|
}, v = typeof I == "function" && !l, z = {
|
|
49
|
-
className: m(f,
|
|
49
|
+
className: m(f, o.root),
|
|
50
50
|
ownerState: { ...c },
|
|
51
51
|
onClick: v ? I : void 0,
|
|
52
52
|
tabIndex: v ? 0 : -1,
|
|
53
53
|
"aria-disabled": l,
|
|
54
54
|
...r(a, "root", i)
|
|
55
|
-
}, b = () => e && typeof e == "string" ? /* @__PURE__ */
|
|
56
|
-
|
|
55
|
+
}, b = () => e && typeof e == "string" ? /* @__PURE__ */ n(
|
|
56
|
+
_,
|
|
57
57
|
{
|
|
58
|
-
className: m(
|
|
58
|
+
className: m(o.icon, o.root),
|
|
59
59
|
ownerState: { ...c },
|
|
60
60
|
...r(a, "icon", i),
|
|
61
61
|
...h
|
|
62
62
|
}
|
|
63
|
-
) : e &&
|
|
63
|
+
) : e && u(e) ? A(e, {
|
|
64
64
|
sx: {
|
|
65
65
|
fontSize: d === "small" ? "small" : "medium",
|
|
66
66
|
...s && {
|
|
@@ -72,22 +72,22 @@ const X = (t) => {
|
|
|
72
72
|
...h
|
|
73
73
|
}) : null;
|
|
74
74
|
return /* @__PURE__ */ P(j, { children: [
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
S ? /* @__PURE__ */ n(
|
|
76
|
+
M,
|
|
77
77
|
{
|
|
78
|
-
className: f ||
|
|
79
|
-
title:
|
|
78
|
+
className: f || o.tooltip,
|
|
79
|
+
title: S,
|
|
80
80
|
ownerState: { ...c },
|
|
81
81
|
placement: N,
|
|
82
82
|
size: d,
|
|
83
83
|
...r(a, "tooltip", i),
|
|
84
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ n(k, { ...z, children: b() })
|
|
85
85
|
}
|
|
86
|
-
) : /* @__PURE__ */
|
|
87
|
-
y && /* @__PURE__ */
|
|
88
|
-
|
|
86
|
+
) : /* @__PURE__ */ n(k, { ...z, children: b() }),
|
|
87
|
+
y && /* @__PURE__ */ n(
|
|
88
|
+
O,
|
|
89
89
|
{
|
|
90
|
-
className: m(
|
|
90
|
+
className: m(o.iconSkeleton, o.root),
|
|
91
91
|
variant: "rectangular",
|
|
92
92
|
ownerState: { ...c },
|
|
93
93
|
"aria-hidden": "true",
|
|
@@ -95,8 +95,7 @@ const X = (t) => {
|
|
|
95
95
|
}
|
|
96
96
|
)
|
|
97
97
|
] });
|
|
98
|
-
}
|
|
98
|
+
};
|
|
99
99
|
export {
|
|
100
|
-
|
|
101
|
-
X as Icon
|
|
100
|
+
W as Icon
|
|
102
101
|
};
|
|
@@ -23,7 +23,7 @@ function n(i, e = "medium") {
|
|
|
23
23
|
height: t
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const u = {
|
|
27
27
|
/**
|
|
28
28
|
* Root styles for the Icon component, handling both mask and non-mask strategies, as well as disabled and selected states.
|
|
29
29
|
*/
|
|
@@ -76,7 +76,7 @@ const g = {
|
|
|
76
76
|
* Skeleton styles for the icon element when in loading state.
|
|
77
77
|
*/
|
|
78
78
|
iconSkeleton: ({ theme: i, ownerState: e }) => ({
|
|
79
|
-
"
|
|
79
|
+
"&": {
|
|
80
80
|
borderRadius: i.size?.borderRadius?.r1 ?? i.shape.borderRadius,
|
|
81
81
|
...n(i, e?.size ?? "medium")
|
|
82
82
|
}
|
|
@@ -84,5 +84,5 @@ const g = {
|
|
|
84
84
|
tooltip: {}
|
|
85
85
|
};
|
|
86
86
|
export {
|
|
87
|
-
|
|
87
|
+
u as iconStyles
|
|
88
88
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Icon
|
|
1
|
+
export { Icon } from './Icon';
|
|
2
2
|
export { ICON_CLASSES, ICON_KEY_COMPONENT, ICON_PREFIX, } from './constants';
|
|
3
3
|
export type { IconBaseProps, IconColorDeep, IconOwnerState, IconProps, IconResourceComponent, IconResourceSrc, IconSlotsType, IconStyles, } from './types';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,SAAS,EACT,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,UAAU,GACX,MAAM,SAAS,CAAC"}
|
|
@@ -38,8 +38,6 @@ export interface IconBaseProps extends Pick<TooltipProps, 'placement'> {
|
|
|
38
38
|
onClick?: (event: React.MouseEvent<any, MouseEvent>) => void;
|
|
39
39
|
/** Optional aria-label override. */
|
|
40
40
|
ariaLabel?: string;
|
|
41
|
-
/** Explicit skeleton state for callers that already consume module skeleton context. */
|
|
42
|
-
isSkeleton?: boolean;
|
|
43
41
|
}
|
|
44
42
|
export type IconResourceSrc = IconBaseProps & ({
|
|
45
43
|
/** SVG source URL rendered with CSS mask. */
|
|
@@ -63,8 +61,9 @@ export type IconProps = IconResourceSrc | IconResourceComponent;
|
|
|
63
61
|
/**
|
|
64
62
|
* Owner state consumed by the styled Icon slots.
|
|
65
63
|
*/
|
|
66
|
-
export interface IconOwnerState extends Pick<IconBaseProps, 'selected' | 'enabledSelected' | 'size' | 'rotationAngle' | 'color' | 'disabled'
|
|
64
|
+
export interface IconOwnerState extends Pick<IconBaseProps, 'selected' | 'enabledSelected' | 'size' | 'rotationAngle' | 'color' | 'disabled'> {
|
|
67
65
|
src?: string | ReactNode;
|
|
66
|
+
isSkeleton?: boolean;
|
|
68
67
|
isMaskStrategy?: boolean;
|
|
69
68
|
}
|
|
70
69
|
export type IconSlotsType = keyof typeof IconSlots;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,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E,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,GACD;IACE,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;CACd,CACJ,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG,CAChD;IACE,uCAAuC;IACvC,GAAG,EAAE,YAAY,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC;CACd,GACD;IACE,GAAG,CAAC,EAAE,KAAK,CAAC;IACZ,2DAA2D;IAC3D,IAAI,EAAE,YAAY,CAAC;CACpB,CACJ,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,eAAe,GAAG,qBAAqB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,aAAa,EACb,UAAU,GAAG,iBAAiB,GAAG,MAAM,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,CACjF;IACC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,SAAS,CAAC;AAEnD,MAAM,MAAM,UAAU,GAAG,sBAAsB,CAC7C,aAAa,EACb,OAAO,kBAAkB,EACzB,KAAK,CACN,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getTypographyStyles as i } from "../../../utils/getTypographyStyles.js";
|
|
2
|
-
const
|
|
2
|
+
const a = {
|
|
3
3
|
/**
|
|
4
4
|
* Root slot styles for the Tooltip primitive.
|
|
5
5
|
*/
|
|
@@ -12,7 +12,7 @@ const s = {
|
|
|
12
12
|
...i(
|
|
13
13
|
o.generalSettings.isMobile,
|
|
14
14
|
t?.size || "medium",
|
|
15
|
-
"
|
|
15
|
+
"bodyStandard"
|
|
16
16
|
)
|
|
17
17
|
}),
|
|
18
18
|
/**
|
|
@@ -61,5 +61,5 @@ const s = {
|
|
|
61
61
|
})
|
|
62
62
|
};
|
|
63
63
|
export {
|
|
64
|
-
|
|
64
|
+
a as tooltipStyles
|
|
65
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/Typography.tsx"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"Typography.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/Typography.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkD,eAAe,EAAE,MAAM,SAAS,CAAC;AAM1F;;GAEG;AACH,eAAO,MAAM,UAAU,0HAsDrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typographySlots.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/base/src/extended/mui/Typography/slots/typographySlots.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typographySlots.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/base/src/extended/mui/Typography/slots/typographySlots.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;AAOrB;;GAEG;AACH,eAAO,MAAM,mBAAmB;;UAIP,CAAC;AAE1B;;GAEG;AACH,eAAO,MAAM,cAAc;;UAIE,CAAC"}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
+
import "@m4l/styles";
|
|
1
2
|
import { Typography as l, Skeleton as m } from "@mui/material";
|
|
2
3
|
import { styled as t } from "@mui/material/styles";
|
|
3
4
|
import { TYPOGRAPHY_KEY_COMPONENT as r } from "../constants.js";
|
|
4
5
|
import { TypographySlots as e } from "./typographyEnum.js";
|
|
5
6
|
import { typographyStyles as p } from "../typography.styles.js";
|
|
6
|
-
const
|
|
7
|
+
const h = t(l, {
|
|
7
8
|
name: r,
|
|
8
9
|
slot: e.root,
|
|
9
10
|
shouldForwardProp: (o) => o !== "ownerState"
|
|
10
|
-
})(p.root),
|
|
11
|
+
})(p.root), i = t(m, {
|
|
11
12
|
name: r,
|
|
12
13
|
slot: e.skeleton,
|
|
13
14
|
shouldForwardProp: (o) => o !== "ownerState"
|
|
14
15
|
})(p.skeleton);
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
h as StyledMUITypography,
|
|
18
|
+
i as StyledSkeleton
|
|
18
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypographyProps as MUITypographyProps, Theme } from '@mui/material';
|
|
2
|
-
import { Sizes,
|
|
2
|
+
import { Sizes, TypographyVariantProp } from '@m4l/styles';
|
|
3
3
|
import { TypographySlots } from './slots/typographyEnum';
|
|
4
4
|
import { TYPOGRAPHY_KEY_COMPONENT } from './constants';
|
|
5
5
|
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
@@ -22,7 +22,7 @@ export interface TypographyProps extends Omit<MUITypographyProps, 'color' | 'var
|
|
|
22
22
|
/** Supported component sizes. */
|
|
23
23
|
size?: Extract<Sizes, 'small' | 'medium'>;
|
|
24
24
|
/** Typography variants available in the design system. */
|
|
25
|
-
variant?:
|
|
25
|
+
variant?: TypographyVariantProp;
|
|
26
26
|
/** Component content. */
|
|
27
27
|
children?: React.ReactNode;
|
|
28
28
|
/** Optional data-testid suffix. */
|
|
@@ -36,6 +36,12 @@ export interface TypographyProps extends Omit<MUITypographyProps, 'color' | 'var
|
|
|
36
36
|
/** Font family override. */
|
|
37
37
|
fontFamily?: TypographyFontsFamily;
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* MUI variant prop shape seen by the wrapped primitive after theme/module augmentations.
|
|
41
|
+
* Some declaration-build paths do not fully preserve the augmentation at the JSX boundary, so
|
|
42
|
+
* the wrapper keeps this alias to cast only at the integration seam with MUI.
|
|
43
|
+
*/
|
|
44
|
+
export type MUITypographyVariantProp = MUITypographyProps['variant'];
|
|
39
45
|
/**
|
|
40
46
|
* Owner state used by the styled slots.
|
|
41
47
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Typography/types.ts"],"names":[],"mappings":"
|
|
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;AAErD;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1G,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,2DAA2D;IAC3D,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,8CAA8C;IAC9C,KAAK,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;IACrD,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1C,0DAA0D;IAC1D,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,yBAAyB;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,4BAA4B;IAC5B,UAAU,CAAC,EAAE,qBAAqB,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;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":"AAIA,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":"AAIA,OAAO,KAAK,EAAwB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAOtE,eAAO,MAAM,gBAAgB,EAAE,gBAuC9B,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { getPropertyByString as s } from "@m4l/core";
|
|
2
|
-
import { getSizeStyles as
|
|
3
|
-
import { getTypographyStyles as
|
|
4
|
-
const
|
|
2
|
+
import { getSizeStyles as e } from "../../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
|
+
import { getTypographyStyles as o } from "../../../utils/getTypographyStyles.js";
|
|
4
|
+
const p = {
|
|
5
5
|
/**
|
|
6
6
|
* Root slot styles for the Typography primitive.
|
|
7
7
|
*/
|
|
8
8
|
root: ({ ownerState: i, theme: l }) => ({
|
|
9
9
|
margin: 0,
|
|
10
10
|
cursor: "default",
|
|
11
|
-
...i?.fontFamily && i.fontFamily !== "Inter" && {
|
|
12
|
-
fontFamily: i.fontFamily
|
|
13
|
-
},
|
|
14
11
|
"&.M4lclassCssSpecificity": {
|
|
15
12
|
...i?.skeletonRows && i.skeletonRows > 1 && {
|
|
16
13
|
display: "flex",
|
|
@@ -21,10 +18,11 @@ const y = {
|
|
|
21
18
|
} : {
|
|
22
19
|
color: s(l.vars.palette, i?.color || "text.primary", "text.primary")
|
|
23
20
|
},
|
|
24
|
-
|
|
21
|
+
fontFamily: i?.fontFamily ?? "Inter",
|
|
22
|
+
...o(
|
|
25
23
|
l.generalSettings.isMobile,
|
|
26
24
|
i?.size || "medium",
|
|
27
|
-
i?.variant || "
|
|
25
|
+
i?.variant || "bodyStandard"
|
|
28
26
|
),
|
|
29
27
|
...i?.ellipsis && {
|
|
30
28
|
overflow: "hidden",
|
|
@@ -38,9 +36,9 @@ const y = {
|
|
|
38
36
|
* Skeleton slot styles for the Typography primitive.
|
|
39
37
|
*/
|
|
40
38
|
skeleton: ({ theme: i, ownerState: l }) => ({
|
|
41
|
-
...
|
|
39
|
+
...e(i, l?.size || "medium", "base")
|
|
42
40
|
})
|
|
43
41
|
};
|
|
44
42
|
export {
|
|
45
|
-
|
|
43
|
+
p as typographyStyles
|
|
46
44
|
};
|
package/index.d.ts
CHANGED
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/base/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/base/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ICON_CLASSES as
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import { DEFAULT_TOOLTIP_OFFSET as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { TYPOGRAPHY_CLASSES as
|
|
1
|
+
import { Icon as o } from "./components/Icon/Icon.js";
|
|
2
|
+
import { ICON_CLASSES as _, ICON_KEY_COMPONENT as E, ICON_PREFIX as S } from "./components/Icon/constants.js";
|
|
3
|
+
import { Tooltip as Y } from "./extended/mui/Tooltip/Tooltip.js";
|
|
4
|
+
import { DEFAULT_TOOLTIP_OFFSET as N, TOOLTIP_CLASSES as A, TOOLTIP_KEY_COMPONENT as p } from "./extended/mui/Tooltip/constants.js";
|
|
5
|
+
import { Typography as L } from "./extended/mui/Typography/Typography.js";
|
|
6
|
+
import { TYPOGRAPHY_CLASSES as e, TYPOGRAPHY_CLASS_NAME_SPECIFY as f, TYPOGRAPHY_FONTS as m, TYPOGRAPHY_KEY_COMPONENT as x } from "./extended/mui/Typography/constants.js";
|
|
7
7
|
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
E as
|
|
11
|
-
S as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
I as TOOLTIP_CLASSES,
|
|
8
|
+
N as DEFAULT_TOOLTIP_OFFSET,
|
|
9
|
+
_ as ICON_CLASSES,
|
|
10
|
+
E as ICON_KEY_COMPONENT,
|
|
11
|
+
S as ICON_PREFIX,
|
|
12
|
+
o as Icon,
|
|
13
|
+
A as TOOLTIP_CLASSES,
|
|
15
14
|
p as TOOLTIP_KEY_COMPONENT,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
e as TYPOGRAPHY_CLASSES,
|
|
16
|
+
f as TYPOGRAPHY_CLASS_NAME_SPECIFY,
|
|
17
|
+
m as TYPOGRAPHY_FONTS,
|
|
18
|
+
x as TYPOGRAPHY_KEY_COMPONENT,
|
|
19
|
+
Y as Tooltip,
|
|
20
|
+
L as Typography
|
|
22
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/base",
|
|
3
|
-
"version": "1.0.0",
|
|
3
|
+
"version": "1.0.1-beta-hotfix-publish-components-and-base-libraries.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"@m4l/core": "^2.0.33",
|
|
33
33
|
"@m4l/styles": "^7.1.48",
|
|
34
34
|
"@emotion/react": "11.14.0",
|
|
35
|
-
"clsx": "
|
|
36
|
-
"react": "
|
|
35
|
+
"clsx": "2.1.1",
|
|
36
|
+
"react": "19.2.4",
|
|
37
37
|
"@mui/material": "5.16.7"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Build the canonical root slot class name for a component
|
|
2
|
+
* Build the canonical root slot class name for a component
|
|
3
3
|
*/
|
|
4
4
|
export declare function getComponentSlotRoot(componentKey: string): string;
|
|
5
5
|
type ComponentSlots = Record<string, string> | readonly string[];
|
|
6
6
|
/**
|
|
7
|
-
* Build the class-name inventory for all component slots
|
|
7
|
+
* Build the class-name inventory for all component slots
|
|
8
8
|
*/
|
|
9
9
|
export declare const getComponentClasses: <T extends ComponentSlots>(componentName: string, slotList: T) => T extends readonly string[] ? Record<T[number], string> : Record<keyof T, string>;
|
|
10
10
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Build the stable test id string for a component slot
|
|
2
|
+
* Build the stable test id string for a component slot
|
|
3
3
|
*/
|
|
4
4
|
export declare const getNameDataTestId: (componentName: string, slotKey: string, instanceId?: string) => string;
|
|
5
5
|
/**
|
|
6
|
-
* Return a data-testid prop outside production builds
|
|
6
|
+
* Return a data-testid prop outside production builds
|
|
7
7
|
*/
|
|
8
8
|
export declare function getPropDataTestId(componentName: string, slotKey: string, instanceId?: string): {
|
|
9
9
|
'data-testid': string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { FontProperties, Sizes,
|
|
1
|
+
import { FontProperties, Sizes, TypographyVariantProp } from '@m4l/styles';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Returns typography token styles for use in component CSS.
|
|
4
|
+
* @param variant - Typography variant to apply (design-system or legacy name; unknown keys fall back to `bodyStandard`).
|
|
5
|
+
* @param isMobile - From `theme.generalSettings.isMobile`.
|
|
6
|
+
* @param size - `small` or `medium` from the component or `AppearanceComponentProvider`.
|
|
4
7
|
*/
|
|
5
|
-
export declare const getTypographyStyles: (isMobile: boolean, size: Extract<Sizes, "small" | "medium">, variant:
|
|
8
|
+
export declare const getTypographyStyles: (isMobile: boolean, size: Extract<Sizes, "small" | "medium">, variant: TypographyVariantProp) => FontProperties;
|
|
6
9
|
//# 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,
|
|
1
|
+
{"version":3,"file":"getTypographyStyles.d.ts","sourceRoot":"","sources":["../../../../../packages/base/src/utils/getTypographyStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAEd,KAAK,EAGL,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,cAUF,CAAC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { TYPOGRAPHY_SIZES_MOBILE as
|
|
2
|
-
const
|
|
1
|
+
import { TYPOGRAPHY_SIZES_MOBILE as d, TYPOGRAPHY_SIZES_DESKTOP as e } from "@m4l/styles";
|
|
2
|
+
const S = "bodyStandard", o = {
|
|
3
|
+
subtitle: "subtitleStandard",
|
|
4
|
+
paragraph: "paragraphStandard",
|
|
5
|
+
body: "bodyStandard",
|
|
6
|
+
action: "bodyStandard",
|
|
7
|
+
caption: "captionStandard"
|
|
8
|
+
}, y = (t) => Object.prototype.hasOwnProperty.call(o, t) ? o[t] : t, i = (t, n, p) => {
|
|
9
|
+
const r = (t ? d : e)[n], a = y(p);
|
|
10
|
+
return a in r ? r[a] : r[S];
|
|
11
|
+
};
|
|
3
12
|
export {
|
|
4
|
-
|
|
13
|
+
i as getTypographyStyles
|
|
5
14
|
};
|