@m4l/base 1.7.2-beta-improvement-804-reports-mfs-enhancements.1 → 1.7.2
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 +52 -52
- package/components/Icon/Icon.styles.d.ts.map +1 -1
- package/components/Icon/Icon.styles.js +23 -25
- package/package.json +1 -1
- package/utils/getIconPaintStyles/getIconPaintStyles.d.ts +9 -4
- package/utils/getIconPaintStyles/getIconPaintStyles.d.ts.map +1 -1
- package/utils/getIconPaintStyles/getIconPaintStyles.js +10 -10
package/@types/types.d.ts
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { ComponentsOverrides, ComponentsVariants, Theme } from '@mui/material/styles';
|
|
2
|
-
import type { IconOwnerState, IconSlotsType } from '../components/Icon/types';
|
|
3
|
-
import type {
|
|
4
|
-
ButtonBaseOwnerState,
|
|
5
|
-
ButtonBaseSlotsType,
|
|
6
|
-
} from '../extended/mui/ButtonBase/types';
|
|
7
|
-
import type {
|
|
8
|
-
TooltipOwnerState,
|
|
9
|
-
TooltipSlotsType,
|
|
10
|
-
} from '../extended/mui/Tooltip/types';
|
|
11
|
-
import type {
|
|
12
|
-
TypographyOwnerState,
|
|
13
|
-
TypographySlotsType,
|
|
14
|
-
} from '../extended/mui/Typography/types';
|
|
15
|
-
|
|
16
|
-
declare module '@mui/material/styles' {
|
|
17
|
-
interface ComponentNameToClassKey {
|
|
18
|
-
M4LButtonBase: ButtonBaseSlotsType;
|
|
19
|
-
M4LIcon: IconSlotsType;
|
|
20
|
-
M4LTooltip: TooltipSlotsType;
|
|
21
|
-
M4LTypography: TypographySlotsType;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface ComponentsPropsList {
|
|
25
|
-
M4LButtonBase: Partial<ButtonBaseOwnerState>;
|
|
26
|
-
M4LIcon: Partial<IconOwnerState>;
|
|
27
|
-
M4LTooltip: Partial<TooltipOwnerState>;
|
|
28
|
-
M4LTypography: Partial<TypographyOwnerState>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface Components {
|
|
32
|
-
M4LButtonBase?: {
|
|
33
|
-
defaultProps?: ComponentsPropsList['M4LButtonBase'];
|
|
34
|
-
styleOverrides?: ComponentsOverrides<Theme>['M4LButtonBase'];
|
|
35
|
-
variants?: ComponentsVariants['M4LButtonBase'];
|
|
36
|
-
};
|
|
37
|
-
M4LIcon?: {
|
|
38
|
-
defaultProps?: ComponentsPropsList['M4LIcon'];
|
|
39
|
-
styleOverrides?: ComponentsOverrides<Theme>['M4LIcon'];
|
|
40
|
-
variants?: ComponentsVariants['M4LIcon'];
|
|
41
|
-
};
|
|
42
|
-
M4LTooltip?: {
|
|
43
|
-
defaultProps?: ComponentsPropsList['M4LTooltip'];
|
|
44
|
-
styleOverrides?: ComponentsOverrides<Theme>['M4LTooltip'];
|
|
45
|
-
variants?: ComponentsVariants['M4LTooltip'];
|
|
46
|
-
};
|
|
47
|
-
M4LTypography?: {
|
|
48
|
-
defaultProps?: ComponentsPropsList['M4LTypography'];
|
|
49
|
-
styleOverrides?: ComponentsOverrides<Theme>['M4LTypography'];
|
|
50
|
-
variants?: ComponentsVariants['M4LTypography'];
|
|
51
|
-
};
|
|
52
|
-
}
|
|
1
|
+
import { ComponentsOverrides, ComponentsVariants, Theme } from '@mui/material/styles';
|
|
2
|
+
import type { IconOwnerState, IconSlotsType } from '../components/Icon/types';
|
|
3
|
+
import type {
|
|
4
|
+
ButtonBaseOwnerState,
|
|
5
|
+
ButtonBaseSlotsType,
|
|
6
|
+
} from '../extended/mui/ButtonBase/types';
|
|
7
|
+
import type {
|
|
8
|
+
TooltipOwnerState,
|
|
9
|
+
TooltipSlotsType,
|
|
10
|
+
} from '../extended/mui/Tooltip/types';
|
|
11
|
+
import type {
|
|
12
|
+
TypographyOwnerState,
|
|
13
|
+
TypographySlotsType,
|
|
14
|
+
} from '../extended/mui/Typography/types';
|
|
15
|
+
|
|
16
|
+
declare module '@mui/material/styles' {
|
|
17
|
+
interface ComponentNameToClassKey {
|
|
18
|
+
M4LButtonBase: ButtonBaseSlotsType;
|
|
19
|
+
M4LIcon: IconSlotsType;
|
|
20
|
+
M4LTooltip: TooltipSlotsType;
|
|
21
|
+
M4LTypography: TypographySlotsType;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ComponentsPropsList {
|
|
25
|
+
M4LButtonBase: Partial<ButtonBaseOwnerState>;
|
|
26
|
+
M4LIcon: Partial<IconOwnerState>;
|
|
27
|
+
M4LTooltip: Partial<TooltipOwnerState>;
|
|
28
|
+
M4LTypography: Partial<TypographyOwnerState>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface Components {
|
|
32
|
+
M4LButtonBase?: {
|
|
33
|
+
defaultProps?: ComponentsPropsList['M4LButtonBase'];
|
|
34
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LButtonBase'];
|
|
35
|
+
variants?: ComponentsVariants['M4LButtonBase'];
|
|
36
|
+
};
|
|
37
|
+
M4LIcon?: {
|
|
38
|
+
defaultProps?: ComponentsPropsList['M4LIcon'];
|
|
39
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LIcon'];
|
|
40
|
+
variants?: ComponentsVariants['M4LIcon'];
|
|
41
|
+
};
|
|
42
|
+
M4LTooltip?: {
|
|
43
|
+
defaultProps?: ComponentsPropsList['M4LTooltip'];
|
|
44
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LTooltip'];
|
|
45
|
+
variants?: ComponentsVariants['M4LTooltip'];
|
|
46
|
+
};
|
|
47
|
+
M4LTypography?: {
|
|
48
|
+
defaultProps?: ComponentsPropsList['M4LTypography'];
|
|
49
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LTypography'];
|
|
50
|
+
variants?: ComponentsVariants['M4LTypography'];
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/Icon.styles.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,SAAS,CAAC;AAkD1D,eAAO,MAAM,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"Icon.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/Icon.styles.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,SAAS,CAAC;AAkD1D,eAAO,MAAM,UAAU,EAAE,UAiExB,CAAC"}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { getSizeStyles as
|
|
2
|
-
import { ICON_CLASSES as
|
|
1
|
+
import { getSizeStyles as a } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
|
+
import { ICON_CLASSES as l } from "./constants.js";
|
|
3
3
|
import { getOriginalSvgIconRootPaintStyles as d, ICON_SVG_SHAPE_SELECTOR as c } from "../../utils/getIconPaintStyles/getIconPaintStyles.js";
|
|
4
4
|
const p = {
|
|
5
5
|
small: 16,
|
|
6
6
|
medium: 24
|
|
7
7
|
};
|
|
8
|
-
function u(
|
|
9
|
-
const
|
|
8
|
+
function u(t, i) {
|
|
9
|
+
const e = t.vars?.palette ?? t.palette;
|
|
10
10
|
return i.split(".").reduce((s, n) => {
|
|
11
11
|
if (s && typeof s == "object" && n in s)
|
|
12
12
|
return s[n];
|
|
13
|
-
},
|
|
13
|
+
}, e) ?? (i.includes(".") ? e.text.primary : i);
|
|
14
14
|
}
|
|
15
|
-
function o(
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
15
|
+
function o(t, i = "medium") {
|
|
16
|
+
if (t.vars?.size && t.generalSettings)
|
|
17
|
+
return a(t, i, "base", (r) => ({
|
|
18
18
|
width: r,
|
|
19
19
|
height: r
|
|
20
20
|
}));
|
|
21
|
-
const
|
|
21
|
+
const e = p[i];
|
|
22
22
|
return {
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
23
|
+
width: e,
|
|
24
|
+
height: e
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
const
|
|
27
|
+
const k = {
|
|
28
28
|
/**
|
|
29
29
|
* Root styles for the Icon component, handling both mask and non-mask strategies, as well as disabled and selected states.
|
|
30
30
|
*/
|
|
31
|
-
root: ({ theme:
|
|
32
|
-
const
|
|
31
|
+
root: ({ theme: t, ownerState: i }) => {
|
|
32
|
+
const e = i?.disabled ? (t.vars?.palette ?? t.palette).text.disabled : i?.selected && i?.enabledSelected ? (t.vars?.palette ?? t.palette).primary.enabled : u(t, String(i?.color));
|
|
33
33
|
return {
|
|
34
34
|
display: i?.isSkeleton ? "none" : "flex",
|
|
35
35
|
justifyContent: "center",
|
|
36
36
|
alignItems: "center",
|
|
37
37
|
width: "fit-content",
|
|
38
38
|
transition: "transform 0.5s ease-in-out",
|
|
39
|
-
...o(
|
|
39
|
+
...o(t, i?.size ?? "medium"),
|
|
40
40
|
...i?.isMaskStrategy === !1 && {
|
|
41
41
|
"& .MuiSvgIcon-root": {
|
|
42
42
|
width: "inherit",
|
|
@@ -44,15 +44,13 @@ const b = {
|
|
|
44
44
|
display: "flex",
|
|
45
45
|
alignItems: "center",
|
|
46
46
|
justifyContent: "center",
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
fill: t
|
|
50
|
-
}
|
|
47
|
+
[c]: {
|
|
48
|
+
fill: e
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
},
|
|
54
52
|
...i?.isMaskStrategy === !0 && {
|
|
55
|
-
[`& .${
|
|
53
|
+
[`& .${l.icon}`]: {
|
|
56
54
|
maskPosition: "center",
|
|
57
55
|
maskRepeat: "no-repeat",
|
|
58
56
|
maskSize: "cover",
|
|
@@ -63,7 +61,7 @@ const b = {
|
|
|
63
61
|
...i?.rotationAngle && {
|
|
64
62
|
transform: `rotate(${i.rotationAngle}deg)`
|
|
65
63
|
},
|
|
66
|
-
backgroundColor:
|
|
64
|
+
backgroundColor: e
|
|
67
65
|
}
|
|
68
66
|
},
|
|
69
67
|
...i?.originalColor && d()
|
|
@@ -79,14 +77,14 @@ const b = {
|
|
|
79
77
|
/**
|
|
80
78
|
* Skeleton styles for the icon element when in loading state.
|
|
81
79
|
*/
|
|
82
|
-
iconSkeleton: ({ theme:
|
|
80
|
+
iconSkeleton: ({ theme: t, ownerState: i }) => ({
|
|
83
81
|
"&": {
|
|
84
|
-
borderRadius:
|
|
85
|
-
...o(
|
|
82
|
+
borderRadius: t.size?.borderRadius?.r1 ?? t.shape.borderRadius,
|
|
83
|
+
...o(t, i?.size ?? "medium")
|
|
86
84
|
}
|
|
87
85
|
}),
|
|
88
86
|
tooltip: {}
|
|
89
87
|
};
|
|
90
88
|
export {
|
|
91
|
-
|
|
89
|
+
k as iconStyles
|
|
92
90
|
};
|
package/package.json
CHANGED
|
@@ -8,8 +8,13 @@
|
|
|
8
8
|
* silently misses every SVG icon, so both branches must always be declared.
|
|
9
9
|
*/
|
|
10
10
|
export declare const ICON_SVG_SHAPE_SELECTOR = "& svg, & path, & rect, & circle, & ellipse, & polygon, & polyline, & line, & g, & text, & tspan, & use";
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Nodes whose fill multicolor sources restore. Besides shapes with an authored `fill`,
|
|
13
|
+
* stroke-only shapes (e.g. an illustration card border) and the `g` groups they inherit
|
|
14
|
+
* from must be reverted too, or they keep the icon color and cover the artwork.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ORIGINAL_SVG_ICON_PAINT_SELECTOR = "&&&:not(.Mui-disabled) .M4LIcon-root .MuiSvgIcon-root :is([fill], [stroke], g)";
|
|
17
|
+
export declare const ORIGINAL_SVG_ICON_ROOT_PAINT_SELECTOR = "&&&:not([aria-disabled=\"true\"]) .MuiSvgIcon-root :is([fill], [stroke], g)";
|
|
13
18
|
export interface IconPaintOptions {
|
|
14
19
|
/**
|
|
15
20
|
* Selector inserted between the rule root and the icon nodes, for call sites
|
|
@@ -46,7 +51,7 @@ export declare function getIconPaintStyles(color: string, options?: IconPaintOpt
|
|
|
46
51
|
* Restore presentation fills for enabled multicolor SVG actions.
|
|
47
52
|
*/
|
|
48
53
|
export declare function getOriginalSvgIconPaintStyles(): {
|
|
49
|
-
"&&&:not(.Mui-disabled) .M4LIcon-root .MuiSvgIcon-root [fill]": {
|
|
54
|
+
"&&&:not(.Mui-disabled) .M4LIcon-root .MuiSvgIcon-root :is([fill], [stroke], g)": {
|
|
50
55
|
fill: string;
|
|
51
56
|
};
|
|
52
57
|
};
|
|
@@ -54,7 +59,7 @@ export declare function getOriginalSvgIconPaintStyles(): {
|
|
|
54
59
|
* Restore presentation fills for enabled multicolor SVG resources rendered directly by Icon.
|
|
55
60
|
*/
|
|
56
61
|
export declare function getOriginalSvgIconRootPaintStyles(): {
|
|
57
|
-
"&&&:not([aria-disabled=\"true\"]) .MuiSvgIcon-root [fill]": {
|
|
62
|
+
"&&&:not([aria-disabled=\"true\"]) .MuiSvgIcon-root :is([fill], [stroke], g)": {
|
|
58
63
|
fill: string;
|
|
59
64
|
};
|
|
60
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getIconPaintStyles.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/utils/getIconPaintStyles/getIconPaintStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,2GACsE,CAAC;AAC3G,eAAO,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"getIconPaintStyles.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/utils/getIconPaintStyles/getIconPaintStyles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,2GACsE,CAAC;AAC3G;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,mFACqC,CAAC;AACnF,eAAO,MAAM,qCAAqC,gFAC2B,CAAC;AAE9E,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB;;;;;;;;;;;EAgB3E;AAED;;GAEG;AACH,wBAAgB,6BAA6B;;;;EAM5C;AAED;;GAEG;AACH,wBAAgB,iCAAiC;;;;EAMhD"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const l = "& svg, & path, & rect, & circle, & ellipse, & polygon, & polyline, & line, & g, & text, & tspan, & use", c = "&&&:not(.Mui-disabled) .M4LIcon-root .MuiSvgIcon-root [fill]",
|
|
2
|
-
function
|
|
3
|
-
const { scope:
|
|
1
|
+
const l = "& svg, & path, & rect, & circle, & ellipse, & polygon, & polyline, & line, & g, & text, & tspan, & use", c = "&&&:not(.Mui-disabled) .M4LIcon-root .MuiSvgIcon-root :is([fill], [stroke], g)", s = '&&&:not([aria-disabled="true"]) .MuiSvgIcon-root :is([fill], [stroke], g)';
|
|
2
|
+
function a(t, i) {
|
|
3
|
+
const { scope: o, important: r = !0 } = i ?? {}, n = o ? `& ${o} ` : "& ", e = r ? `${t} !important` : t;
|
|
4
4
|
return {
|
|
5
|
-
[`${
|
|
5
|
+
[`${n}.M4LIcon-icon`]: {
|
|
6
6
|
backgroundColor: e
|
|
7
7
|
},
|
|
8
|
-
[`${
|
|
8
|
+
[`${n}.MuiSvgIcon-root`]: {
|
|
9
9
|
[l]: {
|
|
10
10
|
fill: e,
|
|
11
11
|
stroke: "none"
|
|
@@ -20,9 +20,9 @@ function I() {
|
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function g() {
|
|
24
24
|
return {
|
|
25
|
-
[
|
|
25
|
+
[s]: {
|
|
26
26
|
fill: "revert-layer"
|
|
27
27
|
}
|
|
28
28
|
};
|
|
@@ -30,8 +30,8 @@ function u() {
|
|
|
30
30
|
export {
|
|
31
31
|
l as ICON_SVG_SHAPE_SELECTOR,
|
|
32
32
|
c as ORIGINAL_SVG_ICON_PAINT_SELECTOR,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
s as ORIGINAL_SVG_ICON_ROOT_PAINT_SELECTOR,
|
|
34
|
+
a as getIconPaintStyles,
|
|
35
35
|
I as getOriginalSvgIconPaintStyles,
|
|
36
|
-
|
|
36
|
+
g as getOriginalSvgIconRootPaintStyles
|
|
37
37
|
};
|