@m4l/base 1.5.0 → 1.5.1-beta-chore-764-remove-s3-assets.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 +52 -52
- package/components/Icon/Icon.d.ts.map +1 -1
- package/components/Icon/Icon.js +40 -39
- package/package.json +3 -2
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.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,
|
|
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,qDAqH7B,CAAC;AAEF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/components/Icon/Icon.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as P, Fragment as j, jsx as n } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { isValidElement as
|
|
2
|
+
import u from "clsx";
|
|
3
|
+
import { isValidElement as S, cloneElement as A } from "react";
|
|
4
4
|
import { useModuleSkeleton as F } from "@m4l/core";
|
|
5
|
-
import { getPropDataTestId as
|
|
5
|
+
import { getPropDataTestId as s } from "../../utils/getNameDataTestId.js";
|
|
6
6
|
import { ICON_CLASSES as o, normalizeIconSize as L, ICON_PREFIX as a } from "./constants.js";
|
|
7
7
|
import { TooltipStyled as M, RootStyled as k, IconSkeletonStyled as O, IconStyled as _ } from "./slots/IconSlots.js";
|
|
8
8
|
function B(t) {
|
|
9
9
|
return "src" in t && typeof t.src == "string" || "icon" in t && typeof t.icon == "string";
|
|
10
10
|
}
|
|
11
11
|
function V(t) {
|
|
12
|
-
return "src" in t && t.src !== void 0 &&
|
|
12
|
+
return "src" in t && t.src !== void 0 && S(t.src) || "icon" in t && t.icon !== void 0 && S(t.icon);
|
|
13
13
|
}
|
|
14
14
|
function X(t) {
|
|
15
15
|
if (B(t) || V(t))
|
|
@@ -18,80 +18,81 @@ function X(t) {
|
|
|
18
18
|
const W = (t) => {
|
|
19
19
|
const {
|
|
20
20
|
size: x = "medium",
|
|
21
|
-
rotationAngle:
|
|
22
|
-
tooltipContent:
|
|
21
|
+
rotationAngle: l,
|
|
22
|
+
tooltipContent: f,
|
|
23
23
|
color: C = "text.primary",
|
|
24
|
-
className:
|
|
24
|
+
className: I,
|
|
25
25
|
placement: N = "bottom",
|
|
26
26
|
instaceDataTestId: w,
|
|
27
27
|
instanceDataTestId: R,
|
|
28
|
-
disabled:
|
|
28
|
+
disabled: d,
|
|
29
29
|
selected: T,
|
|
30
30
|
enabledSelected: D,
|
|
31
|
-
onClick:
|
|
32
|
-
ariaLabel:
|
|
33
|
-
} = t, y = F(),
|
|
31
|
+
onClick: g,
|
|
32
|
+
ariaLabel: i
|
|
33
|
+
} = t, y = F(), c = R ?? w, e = X(t), m = L(x), E = e !== void 0 ? typeof e == "string" : void 0, h = i ? {
|
|
34
34
|
role: "img",
|
|
35
|
-
"aria-label":
|
|
35
|
+
"aria-label": i
|
|
36
36
|
} : {
|
|
37
37
|
"aria-hidden": !0
|
|
38
|
-
},
|
|
39
|
-
size:
|
|
38
|
+
}, r = {
|
|
39
|
+
size: m,
|
|
40
40
|
color: C,
|
|
41
41
|
src: e,
|
|
42
|
-
disabled:
|
|
43
|
-
rotationAngle:
|
|
42
|
+
disabled: d,
|
|
43
|
+
rotationAngle: l,
|
|
44
44
|
selected: T,
|
|
45
45
|
enabledSelected: D,
|
|
46
46
|
isSkeleton: y,
|
|
47
47
|
isMaskStrategy: E
|
|
48
|
-
}, v = typeof
|
|
49
|
-
className:
|
|
50
|
-
ownerState: { ...
|
|
51
|
-
onClick: v ?
|
|
48
|
+
}, v = typeof g == "function" && !d, z = {
|
|
49
|
+
className: u(I, o.root),
|
|
50
|
+
ownerState: { ...r },
|
|
51
|
+
onClick: v ? g : void 0,
|
|
52
52
|
tabIndex: v ? 0 : -1,
|
|
53
|
-
"aria-disabled":
|
|
54
|
-
...
|
|
53
|
+
"aria-disabled": d,
|
|
54
|
+
...s(a, "root", c)
|
|
55
55
|
}, b = () => e && typeof e == "string" ? /* @__PURE__ */ n(
|
|
56
56
|
_,
|
|
57
57
|
{
|
|
58
|
-
className:
|
|
59
|
-
ownerState: { ...
|
|
60
|
-
...
|
|
58
|
+
className: u(o.icon, o.root),
|
|
59
|
+
ownerState: { ...r },
|
|
60
|
+
...s(a, "icon", c),
|
|
61
61
|
...h
|
|
62
62
|
}
|
|
63
|
-
) : e &&
|
|
63
|
+
) : e && S(e) ? A(e, {
|
|
64
64
|
sx: {
|
|
65
|
-
fontSize:
|
|
66
|
-
...
|
|
67
|
-
transform: `rotate(${
|
|
65
|
+
fontSize: m === "small" ? "small" : "medium",
|
|
66
|
+
...l && {
|
|
67
|
+
transform: `rotate(${l}deg)`
|
|
68
68
|
},
|
|
69
69
|
width: "100%",
|
|
70
70
|
height: "100%"
|
|
71
71
|
},
|
|
72
|
-
...h
|
|
72
|
+
...h,
|
|
73
|
+
...i ? { titleAccess: i } : {}
|
|
73
74
|
}) : null;
|
|
74
75
|
return /* @__PURE__ */ P(j, { children: [
|
|
75
|
-
|
|
76
|
+
f ? /* @__PURE__ */ n(
|
|
76
77
|
M,
|
|
77
78
|
{
|
|
78
|
-
className:
|
|
79
|
-
title:
|
|
80
|
-
ownerState: { ...
|
|
79
|
+
className: I || o.tooltip,
|
|
80
|
+
title: f,
|
|
81
|
+
ownerState: { ...r },
|
|
81
82
|
placement: N,
|
|
82
|
-
size:
|
|
83
|
-
...
|
|
83
|
+
size: m,
|
|
84
|
+
...s(a, "tooltip", c),
|
|
84
85
|
children: /* @__PURE__ */ n(k, { ...z, children: b() })
|
|
85
86
|
}
|
|
86
87
|
) : /* @__PURE__ */ n(k, { ...z, children: b() }),
|
|
87
88
|
y && /* @__PURE__ */ n(
|
|
88
89
|
O,
|
|
89
90
|
{
|
|
90
|
-
className:
|
|
91
|
+
className: u(o.iconSkeleton, o.root),
|
|
91
92
|
variant: "rectangular",
|
|
92
|
-
ownerState: { ...
|
|
93
|
+
ownerState: { ...r },
|
|
93
94
|
"aria-hidden": "true",
|
|
94
|
-
...
|
|
95
|
+
...s(a, "iconSkeleton", c)
|
|
95
96
|
}
|
|
96
97
|
)
|
|
97
98
|
] });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/base",
|
|
3
|
-
"version": "1.5.0",
|
|
3
|
+
"version": "1.5.1-beta-chore-764-remove-s3-assets.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,10 +30,11 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@m4l/core": "^2.0.33",
|
|
33
|
+
"@m4l/icons": "^1.0.0",
|
|
33
34
|
"@m4l/styles": "^7.1.48",
|
|
34
35
|
"@emotion/react": "11.14.0",
|
|
35
36
|
"clsx": "2.1.1",
|
|
36
|
-
"react": "19.
|
|
37
|
+
"react": "19.1.0",
|
|
37
38
|
"@mui/material": "5.16.7"
|
|
38
39
|
}
|
|
39
40
|
}
|