@m4l/base 1.0.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.
Files changed (87) hide show
  1. package/@types/augmentations.d.ts +8 -0
  2. package/@types/augmentations.d.ts.map +1 -0
  3. package/components/Icon/Icon.d.ts +8 -0
  4. package/components/Icon/Icon.d.ts.map +1 -0
  5. package/components/Icon/Icon.js +102 -0
  6. package/components/Icon/Icon.styles.d.ts +3 -0
  7. package/components/Icon/Icon.styles.d.ts.map +1 -0
  8. package/components/Icon/Icon.styles.js +88 -0
  9. package/components/Icon/constants.d.ts +8 -0
  10. package/components/Icon/constants.d.ts.map +1 -0
  11. package/components/Icon/constants.js +12 -0
  12. package/components/Icon/index.d.ts +4 -0
  13. package/components/Icon/index.d.ts.map +1 -0
  14. package/components/Icon/slots/IconEnum.d.ts +7 -0
  15. package/components/Icon/slots/IconEnum.d.ts.map +1 -0
  16. package/components/Icon/slots/IconEnum.js +4 -0
  17. package/components/Icon/slots/IconSlots.d.ts +13 -0
  18. package/components/Icon/slots/IconSlots.d.ts.map +1 -0
  19. package/components/Icon/slots/IconSlots.js +29 -0
  20. package/components/Icon/slots/index.d.ts +3 -0
  21. package/components/Icon/slots/index.d.ts.map +1 -0
  22. package/components/Icon/types.d.ts +72 -0
  23. package/components/Icon/types.d.ts.map +1 -0
  24. package/components/index.d.ts +2 -0
  25. package/components/index.d.ts.map +1 -0
  26. package/extended/index.d.ts +2 -0
  27. package/extended/index.d.ts.map +1 -0
  28. package/extended/mui/Tooltip/Tooltip.d.ts +6 -0
  29. package/extended/mui/Tooltip/Tooltip.d.ts.map +1 -0
  30. package/extended/mui/Tooltip/Tooltip.js +33 -0
  31. package/extended/mui/Tooltip/Tooltip.styles.d.ts +3 -0
  32. package/extended/mui/Tooltip/Tooltip.styles.d.ts.map +1 -0
  33. package/extended/mui/Tooltip/Tooltip.styles.js +65 -0
  34. package/extended/mui/Tooltip/constants.d.ts +13 -0
  35. package/extended/mui/Tooltip/constants.d.ts.map +1 -0
  36. package/extended/mui/Tooltip/constants.js +8 -0
  37. package/extended/mui/Tooltip/index.d.ts +4 -0
  38. package/extended/mui/Tooltip/index.d.ts.map +1 -0
  39. package/extended/mui/Tooltip/slots/TooltipEnum.d.ts +9 -0
  40. package/extended/mui/Tooltip/slots/TooltipEnum.d.ts.map +1 -0
  41. package/extended/mui/Tooltip/slots/TooltipEnum.js +4 -0
  42. package/extended/mui/Tooltip/slots/TooltipSlots.d.ts +10 -0
  43. package/extended/mui/Tooltip/slots/TooltipSlots.d.ts.map +1 -0
  44. package/extended/mui/Tooltip/slots/TooltipSlots.js +22 -0
  45. package/extended/mui/Tooltip/slots/index.d.ts +3 -0
  46. package/extended/mui/Tooltip/slots/index.d.ts.map +1 -0
  47. package/extended/mui/Tooltip/types.d.ts +31 -0
  48. package/extended/mui/Tooltip/types.d.ts.map +1 -0
  49. package/extended/mui/Typography/Typography.d.ts +6 -0
  50. package/extended/mui/Typography/Typography.d.ts.map +1 -0
  51. package/extended/mui/Typography/Typography.js +57 -0
  52. package/extended/mui/Typography/constants.d.ts +17 -0
  53. package/extended/mui/Typography/constants.d.ts.map +1 -0
  54. package/extended/mui/Typography/constants.js +12 -0
  55. package/extended/mui/Typography/index.d.ts +4 -0
  56. package/extended/mui/Typography/index.d.ts.map +1 -0
  57. package/extended/mui/Typography/slots/typographyEnum.d.ts +8 -0
  58. package/extended/mui/Typography/slots/typographyEnum.d.ts.map +1 -0
  59. package/extended/mui/Typography/slots/typographyEnum.js +4 -0
  60. package/extended/mui/Typography/slots/typographySlots.d.ts +13 -0
  61. package/extended/mui/Typography/slots/typographySlots.d.ts.map +1 -0
  62. package/extended/mui/Typography/slots/typographySlots.js +18 -0
  63. package/extended/mui/Typography/types.d.ts +60 -0
  64. package/extended/mui/Typography/types.d.ts.map +1 -0
  65. package/extended/mui/Typography/typography.styles.d.ts +3 -0
  66. package/extended/mui/Typography/typography.styles.d.ts.map +1 -0
  67. package/extended/mui/Typography/typography.styles.js +46 -0
  68. package/extended/mui/index.d.ts +3 -0
  69. package/extended/mui/index.d.ts.map +1 -0
  70. package/index.d.ts +3 -0
  71. package/index.d.ts.map +1 -0
  72. package/index.js +22 -0
  73. package/package.json +39 -0
  74. package/utils/getComponentSlotRoot.d.ts +11 -0
  75. package/utils/getComponentSlotRoot.d.ts.map +1 -0
  76. package/utils/getComponentSlotRoot.js +9 -0
  77. package/utils/getNameDataTestId.d.ts +13 -0
  78. package/utils/getNameDataTestId.d.ts.map +1 -0
  79. package/utils/getNameDataTestId.js +8 -0
  80. package/utils/getSizeStyles/getSizeStyles.d.ts +15 -0
  81. package/utils/getSizeStyles/getSizeStyles.d.ts.map +1 -0
  82. package/utils/getSizeStyles/getSizeStyles.js +11 -0
  83. package/utils/getTypographyStyles.d.ts +6 -0
  84. package/utils/getTypographyStyles.d.ts.map +1 -0
  85. package/utils/getTypographyStyles.js +5 -0
  86. package/utils/types.d.ts +30 -0
  87. package/utils/types.d.ts.map +1 -0
@@ -0,0 +1,8 @@
1
+ import { Interpolation } from '@mui/material';
2
+ import { ComponentsPropsList } from '@mui/material/styles';
3
+ export type M4LOverridesStyleRules<ClassKey extends string = string, ComponentName = keyof ComponentsPropsList, Theme = unknown> = Record<ClassKey, Interpolation<(ComponentName extends keyof ComponentsPropsList ? Record<string, unknown> & {
4
+ ownerState?: ComponentsPropsList[ComponentName] & Record<string, unknown>;
5
+ } : object) & {
6
+ theme: Theme;
7
+ } & Record<string, unknown>>>;
8
+ //# sourceMappingURL=augmentations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"augmentations.d.ts","sourceRoot":"","sources":["../../../../../packages/base/src/@types/augmentations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,MAAM,sBAAsB,CAChC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,aAAa,GAAG,MAAM,mBAAmB,EACzC,KAAK,GAAG,OAAO,IACb,MAAM,CACR,QAAQ,EACR,aAAa,CACX,CAAC,aAAa,SAAS,MAAM,mBAAmB,GAC5C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACxB,UAAU,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3E,GACD,MAAM,CAAC,GAAG;IACZ,KAAK,EAAE,KAAK,CAAC;CACd,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAC5B,CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { IconProps } from './types';
2
+ /**
3
+ * Render the base Icon primitive with URL-mask and SVG-component support.
4
+ */
5
+ declare const Icon: (props: IconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
6
+ declare const BaseIcon: (props: IconProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export { BaseIcon, Icon };
8
+ //# sourceMappingURL=Icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAkB,SAAS,EAA0C,MAAM,SAAS,CAAC;AAgC5F;;GAEG;AACH,QAAA,MAAM,IAAI,GAAI,OAAO,SAAS,qDAoH7B,CAAC;AAEF,QAAA,MAAM,QAAQ,UAtHO,SAAS,qDAsHT,CAAC;AAEtB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC"}
@@ -0,0 +1,102 @@
1
+ import { jsxs as P, Fragment as j, jsx as o } from "@emotion/react/jsx-runtime";
2
+ import m from "clsx";
3
+ import { isValidElement as S, cloneElement as A } from "react";
4
+ import { getPropDataTestId as r } from "../../utils/getNameDataTestId.js";
5
+ import { ICON_CLASSES as n, normalizeIconSize as B, ICON_PREFIX as a } from "./constants.js";
6
+ import { TooltipStyled as F, RootStyled as k, IconSkeletonStyled as L, IconStyled as O } from "./slots/IconSlots.js";
7
+ function _(t) {
8
+ return "src" in t && typeof t.src == "string" || "icon" in t && typeof t.icon == "string";
9
+ }
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
+ function V(t) {
14
+ if (_(t) || M(t))
15
+ return "src" in t ? t.src : t.icon;
16
+ }
17
+ const X = (t) => {
18
+ const {
19
+ size: x = "medium",
20
+ rotationAngle: s,
21
+ tooltipContent: u,
22
+ color: C = "text.primary",
23
+ className: f,
24
+ placement: N = "bottom",
25
+ instaceDataTestId: w,
26
+ instanceDataTestId: R,
27
+ disabled: l,
28
+ selected: T,
29
+ enabledSelected: D,
30
+ onClick: I,
31
+ ariaLabel: g,
32
+ isSkeleton: y = !1
33
+ } = t, i = R ?? w, e = V(t), d = B(x), E = e !== void 0 ? typeof e == "string" : void 0, h = g ? {
34
+ role: "img",
35
+ "aria-label": g
36
+ } : {
37
+ "aria-hidden": !0
38
+ }, c = {
39
+ size: d,
40
+ color: C,
41
+ src: e,
42
+ disabled: l,
43
+ rotationAngle: s,
44
+ selected: T,
45
+ enabledSelected: D,
46
+ isSkeleton: y,
47
+ isMaskStrategy: E
48
+ }, v = typeof I == "function" && !l, z = {
49
+ className: m(f, n.root),
50
+ ownerState: { ...c },
51
+ onClick: v ? I : void 0,
52
+ tabIndex: v ? 0 : -1,
53
+ "aria-disabled": l,
54
+ ...r(a, "root", i)
55
+ }, b = () => e && typeof e == "string" ? /* @__PURE__ */ o(
56
+ O,
57
+ {
58
+ className: m(n.icon, n.root),
59
+ ownerState: { ...c },
60
+ ...r(a, "icon", i),
61
+ ...h
62
+ }
63
+ ) : e && S(e) ? A(e, {
64
+ sx: {
65
+ fontSize: d === "small" ? "small" : "medium",
66
+ ...s && {
67
+ transform: `rotate(${s}deg)`
68
+ },
69
+ width: "100%",
70
+ height: "100%"
71
+ },
72
+ ...h
73
+ }) : null;
74
+ return /* @__PURE__ */ P(j, { children: [
75
+ u ? /* @__PURE__ */ o(
76
+ F,
77
+ {
78
+ className: f || n.tooltip,
79
+ title: u,
80
+ ownerState: { ...c },
81
+ placement: N,
82
+ size: d,
83
+ ...r(a, "tooltip", i),
84
+ children: /* @__PURE__ */ o(k, { ...z, children: b() })
85
+ }
86
+ ) : /* @__PURE__ */ o(k, { ...z, children: b() }),
87
+ y && /* @__PURE__ */ o(
88
+ L,
89
+ {
90
+ className: m(n.iconSkeleton, n.root),
91
+ variant: "rectangular",
92
+ ownerState: { ...c },
93
+ "aria-hidden": "true",
94
+ ...r(a, "iconSkeleton", i)
95
+ }
96
+ )
97
+ ] });
98
+ }, U = X;
99
+ export {
100
+ U as BaseIcon,
101
+ X as Icon
102
+ };
@@ -0,0 +1,3 @@
1
+ import { IconStyles } from './types';
2
+ export declare const iconStyles: IconStyles;
3
+ //# sourceMappingURL=Icon.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icon.styles.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/Icon.styles.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,UAAU,EAAE,MAAM,SAAS,CAAC;AAiD1D,eAAO,MAAM,UAAU,EAAE,UAgExB,CAAC"}
@@ -0,0 +1,88 @@
1
+ import { getSizeStyles as o } from "../../utils/getSizeStyles/getSizeStyles.js";
2
+ import { ICON_CLASSES as l } from "./constants.js";
3
+ const a = {
4
+ small: 16,
5
+ medium: 24
6
+ };
7
+ function c(i, e) {
8
+ const t = i.vars?.palette ?? i.palette;
9
+ return e.split(".").reduce((s, r) => {
10
+ if (s && typeof s == "object" && r in s)
11
+ return s[r];
12
+ }, t) ?? t.text.primary;
13
+ }
14
+ function n(i, e = "medium") {
15
+ if (i.vars?.size && i.generalSettings)
16
+ return o(i, e, "base", (s) => ({
17
+ width: s,
18
+ height: s
19
+ }));
20
+ const t = a[e];
21
+ return {
22
+ width: t,
23
+ height: t
24
+ };
25
+ }
26
+ const g = {
27
+ /**
28
+ * Root styles for the Icon component, handling both mask and non-mask strategies, as well as disabled and selected states.
29
+ */
30
+ root: ({ theme: i, ownerState: e }) => {
31
+ const t = e?.disabled ? (i.vars?.palette ?? i.palette).text.disabled : e?.selected && e?.enabledSelected ? (i.vars?.palette ?? i.palette).primary.enabled : c(i, String(e?.color));
32
+ return {
33
+ display: e?.isSkeleton ? "none" : "flex",
34
+ justifyContent: "center",
35
+ alignItems: "center",
36
+ width: "fit-content",
37
+ transition: "transform 0.5s ease-in-out",
38
+ ...n(i, e?.size ?? "medium"),
39
+ ...e?.isMaskStrategy === !1 && {
40
+ "& .MuiSvgIcon-root": {
41
+ width: "inherit",
42
+ height: "inherit",
43
+ display: "flex",
44
+ alignItems: "center",
45
+ justifyContent: "center",
46
+ "& svg, & path, & rect, & circle, & ellipse, & polygon, & polyline, & line, & g, & text, & tspan, & use": {
47
+ fill: t
48
+ }
49
+ }
50
+ },
51
+ ...e?.isMaskStrategy === !0 && {
52
+ [`& .${l.icon}`]: {
53
+ maskPosition: "center",
54
+ maskRepeat: "no-repeat",
55
+ maskSize: "cover",
56
+ WebkitMaskRepeat: "no-repeat",
57
+ mask: `url(${e?.src})`,
58
+ WebkitMask: `url(${e?.src})`,
59
+ WebkitMaskSize: "cover",
60
+ ...e?.rotationAngle && {
61
+ transform: `rotate(${e.rotationAngle}deg)`
62
+ },
63
+ backgroundColor: t
64
+ }
65
+ }
66
+ };
67
+ },
68
+ /**
69
+ * Icon styles for the inner icon element, inheriting width and height from parent.
70
+ */
71
+ icon: () => ({
72
+ width: "inherit",
73
+ height: "inherit"
74
+ }),
75
+ /**
76
+ * Skeleton styles for the icon element when in loading state.
77
+ */
78
+ iconSkeleton: ({ theme: i, ownerState: e }) => ({
79
+ "&.M4lclassCssSpecificity": {
80
+ borderRadius: i.size?.borderRadius?.r1 ?? i.shape.borderRadius,
81
+ ...n(i, e?.size ?? "medium")
82
+ }
83
+ }),
84
+ tooltip: {}
85
+ };
86
+ export {
87
+ g as iconStyles
88
+ };
@@ -0,0 +1,8 @@
1
+ export declare const ICON_KEY_COMPONENT = "M4LIcon";
2
+ export declare const ICON_PREFIX = "Icon";
3
+ export declare const ICON_CLASSES: Record<"root" | "tooltip" | "icon" | "iconSkeleton", string>;
4
+ /**
5
+ * Normalize runtime Icon sizes to the supported public contract.
6
+ */
7
+ export declare function normalizeIconSize(size?: string): 'small' | 'medium';
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAC5C,eAAO,MAAM,WAAW,SAAS,CAAC;AAClC,eAAO,MAAM,YAAY,8DAAqD,CAAC;AAE/E;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAEnE"}
@@ -0,0 +1,12 @@
1
+ import { getComponentClasses as n } from "../../utils/getComponentSlotRoot.js";
2
+ import { IconSlots as m } from "./slots/IconEnum.js";
3
+ const t = "M4LIcon", I = "Icon", e = n(t, m);
4
+ function C(o) {
5
+ return o === "small" || o === "medium" ? o : "medium";
6
+ }
7
+ export {
8
+ e as ICON_CLASSES,
9
+ t as ICON_KEY_COMPONENT,
10
+ I as ICON_PREFIX,
11
+ C as normalizeIconSize
12
+ };
@@ -0,0 +1,4 @@
1
+ export { Icon, BaseIcon } from './Icon';
2
+ export { ICON_CLASSES, ICON_KEY_COMPONENT, ICON_PREFIX, } from './constants';
3
+ export type { IconBaseProps, IconColorDeep, IconOwnerState, IconProps, IconResourceComponent, IconResourceSrc, IconSlotsType, IconStyles, } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/base/src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACxC,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"}
@@ -0,0 +1,7 @@
1
+ export declare enum IconSlots {
2
+ root = "root",
3
+ tooltip = "tooltip",
4
+ icon = "icon",
5
+ iconSkeleton = "iconSkeleton"
6
+ }
7
+ //# sourceMappingURL=IconEnum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconEnum.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/components/Icon/slots/IconEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,YAAY,iBAAiB;CAC9B"}
@@ -0,0 +1,4 @@
1
+ var t = /* @__PURE__ */ ((o) => (o.root = "root", o.tooltip = "tooltip", o.icon = "icon", o.iconSkeleton = "iconSkeleton", o))(t || {});
2
+ export {
3
+ t as IconSlots
4
+ };
@@ -0,0 +1,13 @@
1
+ export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
2
+ ownerState?: (Partial<import('..').IconOwnerState> & Record<string, unknown>) | undefined;
3
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
+ export declare const TooltipStyled: import('@emotion/styled').StyledComponent<import('../../..').TooltipProps & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
5
+ ownerState?: (Partial<import('..').IconOwnerState> & Record<string, unknown>) | undefined;
6
+ }, {}, {}>;
7
+ export declare const IconStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
8
+ ownerState?: (Partial<import('..').IconOwnerState> & Record<string, unknown>) | undefined;
9
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const IconSkeletonStyled: import('@emotion/styled').StyledComponent<import('@mui/material').SkeletonOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "sx" | "classes" | "className" | "style" | "children" | "height" | "width" | "animation" | "variant"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
11
+ ownerState?: (Partial<import('..').IconOwnerState> & Record<string, unknown>) | undefined;
12
+ }, {}, {}>;
13
+ //# sourceMappingURL=IconSlots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconSlots.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/components/Icon/slots/IconSlots.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,UAAU;;yGAIJ,CAAC;AAEpB,eAAO,MAAM,aAAa;;UAIJ,CAAC;AAEvB,eAAO,MAAM,UAAU;;yGAIJ,CAAC;AAEpB,eAAO,MAAM,kBAAkB;;UAIJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { Skeleton as l } from "@mui/material";
2
+ import { styled as t } from "@mui/material/styles";
3
+ import { ICON_KEY_COMPONENT as r } from "../constants.js";
4
+ import { iconStyles as e } from "../Icon.styles.js";
5
+ import { IconSlots as n } from "./IconEnum.js";
6
+ import { Tooltip as i } from "../../../extended/mui/Tooltip/Tooltip.js";
7
+ const c = t("div", {
8
+ name: r,
9
+ slot: n.root,
10
+ shouldForwardProp: (o) => o !== "ownerState"
11
+ })(e.root), w = t(i, {
12
+ name: r,
13
+ slot: n.tooltip,
14
+ shouldForwardProp: (o) => o !== "ownerState"
15
+ })(e.tooltip), f = t("div", {
16
+ name: r,
17
+ slot: n.icon,
18
+ shouldForwardProp: (o) => o !== "ownerState"
19
+ })(e.icon), y = t(l, {
20
+ name: r,
21
+ slot: n.iconSkeleton,
22
+ shouldForwardProp: (o) => o !== "ownerState"
23
+ })(e.iconSkeleton);
24
+ export {
25
+ y as IconSkeletonStyled,
26
+ f as IconStyled,
27
+ c as RootStyled,
28
+ w as TooltipStyled
29
+ };
@@ -0,0 +1,3 @@
1
+ export * from './IconEnum';
2
+ export * from './IconSlots';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/components/Icon/slots/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { Theme } from '@mui/material';
2
+ import { ReactElement, ReactNode } from 'react';
3
+ import { Sizes } from '@m4l/styles';
4
+ import { M4LOverridesStyleRules } from '../../@types/augmentations';
5
+ import { TooltipProps } from '../../extended/mui/Tooltip/types';
6
+ import { DeepKeyOf } from '../../utils/types';
7
+ import { ICON_KEY_COMPONENT } from './constants';
8
+ import { IconSlots } from './slots/IconEnum';
9
+ /**
10
+ * Supported Icon color path contract.
11
+ */
12
+ export type IconColorDeep = DeepKeyOf<Theme['vars']['palette']> | string;
13
+ export interface IconBaseProps extends Pick<TooltipProps, 'placement'> {
14
+ /** Supported component sizes. */
15
+ size?: Extract<Sizes, 'small' | 'medium'>;
16
+ /** Optional SVG rotation angle in degrees. */
17
+ rotationAngle?: number;
18
+ /** Optional tooltip content rendered around the icon. */
19
+ tooltipContent?: ReactNode;
20
+ /** Color path resolved against the design-system palette. */
21
+ color?: IconColorDeep;
22
+ /** Extra root class name. */
23
+ className?: string;
24
+ /**
25
+ * Optional data-testid suffix.
26
+ * @deprecated Use `instanceDataTestId` instead.
27
+ */
28
+ instaceDataTestId?: string;
29
+ /** Optional data-testid suffix. */
30
+ instanceDataTestId?: string;
31
+ /** Disabled state. */
32
+ disabled?: boolean;
33
+ /** Selected state. */
34
+ selected?: boolean;
35
+ /** Enables selected-state coloring. */
36
+ enabledSelected?: boolean;
37
+ /** Optional click handler. */
38
+ onClick?: (event: React.MouseEvent<any, MouseEvent>) => void;
39
+ /** Optional aria-label override. */
40
+ ariaLabel?: string;
41
+ /** Explicit skeleton state for callers that already consume module skeleton context. */
42
+ isSkeleton?: boolean;
43
+ }
44
+ export type IconResourceSrc = IconBaseProps & ({
45
+ /** SVG source URL rendered with CSS mask. */
46
+ src: string;
47
+ icon?: never;
48
+ } | {
49
+ src?: never;
50
+ /** Alternate source URL prop kept for compatibility. */
51
+ icon: string;
52
+ });
53
+ export type IconResourceComponent = IconBaseProps & ({
54
+ /** SVG component rendered directly. */
55
+ src: ReactElement;
56
+ icon?: never;
57
+ } | {
58
+ src?: never;
59
+ /** Alternate SVG component prop kept for compatibility. */
60
+ icon: ReactElement;
61
+ });
62
+ export type IconProps = IconResourceSrc | IconResourceComponent;
63
+ /**
64
+ * Owner state consumed by the styled Icon slots.
65
+ */
66
+ export interface IconOwnerState extends Pick<IconBaseProps, 'selected' | 'enabledSelected' | 'size' | 'rotationAngle' | 'color' | 'disabled' | 'isSkeleton'> {
67
+ src?: string | ReactNode;
68
+ isMaskStrategy?: boolean;
69
+ }
70
+ export type IconSlotsType = keyof typeof IconSlots;
71
+ export type IconStyles = M4LOverridesStyleRules<IconSlotsType, typeof ICON_KEY_COMPONENT, Theme>;
72
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +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,kBAAkB,CAAC;AAE7C;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC,GAAG,MAAM,CAAC;AAEzE,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC;IACpE,iCAAiC;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1C,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mCAAmC;IACnC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sBAAsB;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,8BAA8B;IAC9B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC7D,oCAAoC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wFAAwF;IACxF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,CAC1C;IACE,6CAA6C;IAC7C,GAAG,EAAE,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,GAAG,YAAY,CAChG;IACC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,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"}
@@ -0,0 +1,2 @@
1
+ export * from './Icon';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/base/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './mui';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/base/src/extended/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { TooltipProps } from './types';
2
+ /**
3
+ * Render the base M4L Tooltip primitive on top of MUI Tooltip.
4
+ */
5
+ export declare const Tooltip: (props: TooltipProps) => import("@emotion/react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,qDA6B1C,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { jsx as s } from "@emotion/react/jsx-runtime";
2
+ import d from "clsx";
3
+ import { DEFAULT_TOOLTIP_OFFSET as n, TOOLTIP_CLASSES as i } from "./constants.js";
4
+ import { RootStyled as f, TooltipStyled as S, TextStyled as c } from "./slots/TooltipSlots.js";
5
+ const y = (r) => {
6
+ const { size: t = "medium", children: m, title: o, className: l, offset: p = n, ...a } = r, e = t === "small" || t === "medium" ? t : "medium";
7
+ return /* @__PURE__ */ s(
8
+ f,
9
+ {
10
+ className: d(i.root, l),
11
+ ownerState: { size: e },
12
+ title: typeof o == "string" ? /* @__PURE__ */ s(c, { className: i.text, ownerState: { size: e }, children: o }) : o,
13
+ slotProps: {
14
+ popper: {
15
+ modifiers: [
16
+ {
17
+ name: "offset",
18
+ options: {
19
+ offset: p
20
+ }
21
+ }
22
+ ]
23
+ }
24
+ },
25
+ ...a,
26
+ slots: { tooltip: S },
27
+ children: m
28
+ }
29
+ );
30
+ };
31
+ export {
32
+ y as Tooltip
33
+ };
@@ -0,0 +1,3 @@
1
+ import { TooltipStyles } from './types';
2
+ export declare const tooltipStyles: TooltipStyles;
3
+ //# sourceMappingURL=Tooltip.styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.styles.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Tooltip/Tooltip.styles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAqB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEhE,eAAO,MAAM,aAAa,EAAE,aA4D3B,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { getTypographyStyles as i } from "../../../utils/getTypographyStyles.js";
2
+ const s = {
3
+ /**
4
+ * Root slot styles for the Tooltip primitive.
5
+ */
6
+ root: {},
7
+ /**
8
+ * Text slot styles for string tooltip content.
9
+ */
10
+ text: ({ theme: o, ownerState: t }) => ({
11
+ color: o.vars.palette.text.contrastText,
12
+ ...i(
13
+ o.generalSettings.isMobile,
14
+ t?.size || "medium",
15
+ "body"
16
+ )
17
+ }),
18
+ /**
19
+ * Tooltip bubble slot styles.
20
+ */
21
+ tooltip: ({ theme: o }) => ({
22
+ background: o.vars.palette.background.contrastDefault,
23
+ padding: o.vars.size.baseSpacings.sp2,
24
+ borderRadius: o.vars.size.borderRadius.r1,
25
+ boxShadow: o.vars.customShadows.z3,
26
+ minWidth: o.vars.size.baseSpacings.sp6,
27
+ minHeight: o.vars.size.baseSpacings.sp3,
28
+ "&.MuiTooltip-tooltipPlacementRight .MuiTooltip-arrow": {
29
+ left: "-6px"
30
+ },
31
+ "&.MuiTooltip-tooltipPlacementTop .MuiTooltip-arrow": {
32
+ bottom: "-6px"
33
+ },
34
+ "&.MuiTooltip-tooltipPlacementBottom .MuiTooltip-arrow": {
35
+ top: "-6px"
36
+ },
37
+ "&.MuiTooltip-tooltipPlacementLeft .MuiTooltip-arrow": {
38
+ right: "-6px"
39
+ },
40
+ "&&& .MuiTooltip-arrow": {
41
+ transformOrigin: "unset",
42
+ overflow: "visible",
43
+ zIndex: -1,
44
+ width: "16px",
45
+ height: "16px",
46
+ display: "flex",
47
+ alignItems: "center",
48
+ justifyContent: "center",
49
+ margin: "unset",
50
+ "&::before": {
51
+ transformOrigin: "unset",
52
+ backgroundColor: o.vars.palette.background.contrastDefault,
53
+ borderRadius: o.vars.size.borderRadius.r1,
54
+ width: o.vars.size.baseSpacings.sp3,
55
+ height: o.vars.size.baseSpacings.sp3,
56
+ border: "unset",
57
+ margin: "unset",
58
+ transform: "rotate(45deg)"
59
+ }
60
+ }
61
+ })
62
+ };
63
+ export {
64
+ s as tooltipStyles
65
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * CSS component key used to associate the component with MUI slot overrides.
3
+ */
4
+ export declare const TOOLTIP_KEY_COMPONENT = "M4LTooltip";
5
+ /**
6
+ * CSS class inventory for the Tooltip component.
7
+ */
8
+ export declare const TOOLTIP_CLASSES: Record<"root" | "tooltip" | "text", string>;
9
+ /**
10
+ * Default tooltip offset in pixels.
11
+ */
12
+ export declare const DEFAULT_TOOLTIP_OFFSET: [number, number];
13
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Tooltip/constants.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD;;GAEG;AACH,eAAO,MAAM,eAAe,6CAA2D,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { getComponentClasses as o } from "../../../utils/getComponentSlotRoot.js";
2
+ import { TooltipSlots as t } from "./slots/TooltipEnum.js";
3
+ const T = "M4LTooltip", p = o(T, t), L = [0, 10];
4
+ export {
5
+ L as DEFAULT_TOOLTIP_OFFSET,
6
+ p as TOOLTIP_CLASSES,
7
+ T as TOOLTIP_KEY_COMPONENT
8
+ };
@@ -0,0 +1,4 @@
1
+ export { Tooltip } from './Tooltip';
2
+ export { DEFAULT_TOOLTIP_OFFSET, TOOLTIP_CLASSES, TOOLTIP_KEY_COMPONENT, } from './constants';
3
+ export type { TooltipOwnerState, TooltipProps, TooltipSlotsType, TooltipStyles, } from './types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../packages/base/src/extended/mui/Tooltip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,aAAa,GACd,MAAM,SAAS,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Tooltip slot names.
3
+ */
4
+ export declare enum TooltipSlots {
5
+ root = "root",
6
+ text = "text",
7
+ tooltip = "tooltip"
8
+ }
9
+ //# sourceMappingURL=TooltipEnum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipEnum.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/base/src/extended/mui/Tooltip/slots/TooltipEnum.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,YAAY;IACtB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,OAAO,YAAY;CACpB"}
@@ -0,0 +1,4 @@
1
+ var r = /* @__PURE__ */ ((t) => (t.root = "root", t.text = "text", t.tooltip = "tooltip", t))(r || {});
2
+ export {
3
+ r as TooltipSlots
4
+ };
@@ -0,0 +1,10 @@
1
+ export declare const RootStyled: import('@emotion/styled').StyledComponent<import('@mui/material').TooltipProps & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
2
+ ownerState?: (Partial<import('..').TooltipOwnerState> & Record<string, unknown>) | undefined;
3
+ }, {}, {}>;
4
+ export declare const TextStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
5
+ ownerState?: (Partial<import('..').TooltipOwnerState> & Record<string, unknown>) | undefined;
6
+ }, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
+ export declare const TooltipStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme> & Record<string, unknown> & {
8
+ ownerState?: (Partial<import('..').TooltipOwnerState> & Record<string, unknown>) | undefined;
9
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
10
+ //# sourceMappingURL=TooltipSlots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TooltipSlots.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/base/src/extended/mui/Tooltip/slots/TooltipSlots.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU;;UAID,CAAC;AAEvB,eAAO,MAAM,UAAU;;yGAID,CAAC;AAEvB,eAAO,MAAM,aAAa;;6NAGD,CAAC"}