@m4l/components 0.0.23 → 0.0.24
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/dist/components/Icon/index.d.ts +3 -0
- package/dist/components/Icon/index.js +26 -0
- package/dist/components/Icon/styles.d.ts +3 -0
- package/dist/components/Icon/types.d.ts +6 -0
- package/dist/components/animate/MotionContainer/index.d.ts +10 -0
- package/dist/components/animate/MotionContainer/index.js +31 -0
- package/dist/components/animate/index.d.ts +1 -0
- package/dist/components/animate/variants/container.d.ts +19 -0
- package/dist/components/animate/variants/container.js +20 -0
- package/dist/components/animate/variants/index.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +4 -1
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { styled } from "@mui/material";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
const MaskIcon = styled("div", {
|
|
4
|
+
shouldForwardProp: (props) => props !== "src" && props !== "width" && props !== "height" && props !== "bgColor"
|
|
5
|
+
})((props) => ({
|
|
6
|
+
WebkitMask: `url(${props.src}) no-repeat`,
|
|
7
|
+
mask: `url(${props.src}) no-repeat`,
|
|
8
|
+
width: props.width === void 0 ? "20px" : props.width,
|
|
9
|
+
height: props.height === void 0 ? "20px" : props.height,
|
|
10
|
+
backgroundColor: props.bgColor === "active" ? props.theme.palette.action.active : props.bgColor === "selected" ? props.theme.palette.primary.main : props.bgColor === "info" ? props.theme.palette.info.main : props.bgColor === "warning" ? props.theme.palette.warning.main : props.bgColor === "error" ? props.theme.palette.error.main : props.bgColor
|
|
11
|
+
}));
|
|
12
|
+
function Icon(props) {
|
|
13
|
+
const {
|
|
14
|
+
src = "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/commons/assets/icons/default.svg",
|
|
15
|
+
width = "20px",
|
|
16
|
+
height = "20px",
|
|
17
|
+
bgColor = "active"
|
|
18
|
+
} = props;
|
|
19
|
+
return /* @__PURE__ */ jsx(MaskIcon, {
|
|
20
|
+
src,
|
|
21
|
+
width,
|
|
22
|
+
height,
|
|
23
|
+
bgColor
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
export { Icon as I };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconProps } from './types';
|
|
3
|
+
export declare const MaskIcon: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & IconProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MotionProps } from 'framer-motion';
|
|
3
|
+
import { BoxProps } from '@mui/material';
|
|
4
|
+
declare type IProps = BoxProps & MotionProps;
|
|
5
|
+
export interface Props extends IProps {
|
|
6
|
+
animate?: boolean;
|
|
7
|
+
action?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function MotionContainer({ animate, action, children, ...other }: Props): JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { m } from "framer-motion";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { v as varContainer } from "../variants/container.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
function MotionContainer({
|
|
6
|
+
animate,
|
|
7
|
+
action = false,
|
|
8
|
+
children,
|
|
9
|
+
...other
|
|
10
|
+
}) {
|
|
11
|
+
if (action) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
13
|
+
component: m.div,
|
|
14
|
+
initial: false,
|
|
15
|
+
animate: animate ? "animate" : "exit",
|
|
16
|
+
variants: varContainer(),
|
|
17
|
+
...other,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
22
|
+
component: m.div,
|
|
23
|
+
initial: "initial",
|
|
24
|
+
animate: "animate",
|
|
25
|
+
exit: "exit",
|
|
26
|
+
variants: varContainer(),
|
|
27
|
+
...other,
|
|
28
|
+
children
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export { MotionContainer as M };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare type Props = {
|
|
2
|
+
staggerIn?: number;
|
|
3
|
+
delayIn?: number;
|
|
4
|
+
staggerOut?: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const varContainer: (props?: Props | undefined) => {
|
|
7
|
+
animate: {
|
|
8
|
+
transition: {
|
|
9
|
+
staggerChildren: number;
|
|
10
|
+
delayChildren: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
exit: {
|
|
14
|
+
transition: {
|
|
15
|
+
staggerChildren: number;
|
|
16
|
+
staggerDirection: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const varContainer = (props) => {
|
|
2
|
+
const staggerIn = props?.staggerIn || 0.05;
|
|
3
|
+
const delayIn = props?.staggerIn || 0.05;
|
|
4
|
+
const staggerOut = props?.staggerIn || 0.05;
|
|
5
|
+
return {
|
|
6
|
+
animate: {
|
|
7
|
+
transition: {
|
|
8
|
+
staggerChildren: staggerIn,
|
|
9
|
+
delayChildren: delayIn
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
exit: {
|
|
13
|
+
transition: {
|
|
14
|
+
staggerChildren: staggerOut,
|
|
15
|
+
staggerDirection: -1
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export { varContainer as v };
|
|
@@ -9,6 +9,7 @@ export type { RowKey } from '../components/DataGrid/types';
|
|
|
9
9
|
export { getGridComponentsDictionary } from '../components/DataGrid/dictionary';
|
|
10
10
|
export * from '../components/FormActions';
|
|
11
11
|
export * from '../components/FormActions/dictionary';
|
|
12
|
+
export * from '../components/Icon';
|
|
12
13
|
export * from '../components/Image';
|
|
13
14
|
export * from '../components/LanguagePopover';
|
|
14
15
|
export * from '../components/Loadable';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { I as IconButton, a as IconButtonAnimate } from "./components/mui_extended/IconButton/index.js";
|
|
2
2
|
import "framer-motion";
|
|
3
|
+
import "@mui/material";
|
|
3
4
|
import "react/jsx-runtime";
|
|
4
5
|
import "react";
|
|
5
6
|
import "react-hook-form";
|
|
@@ -7,7 +8,6 @@ export { F as FormProvider } from "./components/hook-form/FormProvider/index.js"
|
|
|
7
8
|
import "react-router-dom";
|
|
8
9
|
import "@m4l/core";
|
|
9
10
|
import "@mui/lab";
|
|
10
|
-
import "@mui/material";
|
|
11
11
|
export { M as ModalContext, a as ModalProvider } from "./contexts/ModalContext/index.js";
|
|
12
12
|
export { R as RHFAutocompleteAsync } from "./components/hook-form/RHFAutocompleteAsync/index.js";
|
|
13
13
|
export { R as RHFCheckbox } from "./components/hook-form/RHFCheckbox/index.js";
|
|
@@ -27,6 +27,7 @@ import "react-dnd";
|
|
|
27
27
|
import "react-dnd-html5-backend";
|
|
28
28
|
import "date-fns";
|
|
29
29
|
export { F as FormActions, d as defaultActionsDictionary, g as getActionnsComponentsDictionary } from "./components/FormActions/index.js";
|
|
30
|
+
export { I as Icon } from "./components/Icon/index.js";
|
|
30
31
|
import "./react-draggable.js";
|
|
31
32
|
export { M as ModalDialog, d as defaultModalDialogDictionary, g as getModalDialogComponentsDictionary } from "./components/ModalDialog/index.js";
|
|
32
33
|
export { R as Resizeable } from "./components/Resizeable/index.js";
|
|
@@ -41,7 +42,9 @@ export { S as ScrollBar } from "./components/ScrollBar/index.js";
|
|
|
41
42
|
import "./react-splitter-layout.js";
|
|
42
43
|
export { S as SplitLayout } from "./components/SplitLayout/index.js";
|
|
43
44
|
export { v as varFade } from "./components/animate/variants/fade.js";
|
|
45
|
+
export { v as varContainer } from "./components/animate/variants/container.js";
|
|
44
46
|
export { v as varTranEnter, a as varTranExit, b as varTranHover } from "./components/animate/variants/transition.js";
|
|
47
|
+
export { M as MotionContainer } from "./components/animate/MotionContainer/index.js";
|
|
45
48
|
export { M as MotionLazyContainer } from "./components/animate/MotionLazyContainer/index.js";
|
|
46
49
|
export { R as RHFMultiCheckbox } from "./components/hook-form/RHFMultiCheckbox/index.js";
|
|
47
50
|
export { R as RHFSelect } from "./components/hook-form/RHFSelect.js";
|