@m4l/components 0.0.22 → 0.0.25

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.
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from './types';
3
+ export declare function Icon(props: IconProps): JSX.Element;
@@ -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,6 @@
1
+ export interface IconProps {
2
+ src: string;
3
+ width?: number | string;
4
+ height?: number | string;
5
+ bgColor?: string | 'info' | 'warning' | 'error' | 'active' | 'disabled';
6
+ }
@@ -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 };
@@ -1,3 +1,4 @@
1
1
  export * from './variants';
2
2
  export { IconButtonAnimate } from './IconButtonAnimate';
3
+ export { MotionContainer } from './MotionContainer';
3
4
  export { MotionLazyContainer } from './MotionLazyContainer';
@@ -0,0 +1,136 @@
1
+ import { VariantsType } from '../type';
2
+ export declare const varBounce: (props?: VariantsType | undefined) => {
3
+ in: {
4
+ initial: {};
5
+ animate: {
6
+ scale: number[];
7
+ opacity: number[];
8
+ transition: {
9
+ duration: number;
10
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
11
+ };
12
+ };
13
+ exit: {
14
+ scale: number[];
15
+ opacity: number[];
16
+ };
17
+ };
18
+ inUp: {
19
+ initial: {};
20
+ animate: {
21
+ y: number[];
22
+ scaleY: number[];
23
+ opacity: number[];
24
+ transition: {
25
+ duration: number;
26
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
27
+ };
28
+ };
29
+ exit: {
30
+ y: number[];
31
+ scaleY: number[];
32
+ opacity: number[];
33
+ transition: {
34
+ duration: number;
35
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
36
+ };
37
+ };
38
+ };
39
+ inDown: {
40
+ initial: {};
41
+ animate: {
42
+ y: number[];
43
+ scaleY: number[];
44
+ opacity: number[];
45
+ transition: {
46
+ duration: number;
47
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
48
+ };
49
+ };
50
+ exit: {
51
+ y: number[];
52
+ scaleY: number[];
53
+ opacity: number[];
54
+ transition: {
55
+ duration: number;
56
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
57
+ };
58
+ };
59
+ };
60
+ inLeft: {
61
+ initial: {};
62
+ animate: {
63
+ x: number[];
64
+ scaleX: number[];
65
+ opacity: number[];
66
+ transition: {
67
+ duration: number;
68
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
69
+ };
70
+ };
71
+ exit: {
72
+ x: number[];
73
+ scaleX: number[];
74
+ opacity: number[];
75
+ transition: {
76
+ duration: number;
77
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
78
+ };
79
+ };
80
+ };
81
+ inRight: {
82
+ initial: {};
83
+ animate: {
84
+ x: number[];
85
+ scaleX: number[];
86
+ opacity: number[];
87
+ transition: {
88
+ duration: number;
89
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
90
+ };
91
+ };
92
+ exit: {
93
+ x: number[];
94
+ scaleX: number[];
95
+ opacity: number[];
96
+ transition: {
97
+ duration: number;
98
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
99
+ };
100
+ };
101
+ };
102
+ out: {
103
+ animate: {
104
+ scale: number[];
105
+ opacity: number[];
106
+ };
107
+ };
108
+ outUp: {
109
+ animate: {
110
+ y: number[];
111
+ scaleY: number[];
112
+ opacity: number[];
113
+ };
114
+ };
115
+ outDown: {
116
+ animate: {
117
+ y: number[];
118
+ scaleY: number[];
119
+ opacity: number[];
120
+ };
121
+ };
122
+ outLeft: {
123
+ animate: {
124
+ x: number[];
125
+ scaleX: number[];
126
+ opacity: number[];
127
+ };
128
+ };
129
+ outRight: {
130
+ animate: {
131
+ x: number[];
132
+ scaleX: number[];
133
+ opacity: number[];
134
+ };
135
+ };
136
+ };
@@ -0,0 +1,97 @@
1
+ import { v as varTranEnter, a as varTranExit } from "./transition.js";
2
+ const varBounce = (props) => {
3
+ const durationIn = props?.durationIn;
4
+ const durationOut = props?.durationOut;
5
+ const easeIn = props?.easeIn;
6
+ const easeOut = props?.easeOut;
7
+ return {
8
+ in: {
9
+ initial: {},
10
+ animate: {
11
+ scale: [0.3, 1.1, 0.9, 1.03, 0.97, 1],
12
+ opacity: [0, 1, 1, 1, 1, 1],
13
+ transition: varTranEnter({ durationIn, easeIn })
14
+ },
15
+ exit: {
16
+ scale: [0.9, 1.1, 0.3],
17
+ opacity: [1, 1, 0]
18
+ }
19
+ },
20
+ inUp: {
21
+ initial: {},
22
+ animate: {
23
+ y: [720, -24, 12, -4, 0],
24
+ scaleY: [4, 0.9, 0.95, 0.985, 1],
25
+ opacity: [0, 1, 1, 1, 1],
26
+ transition: { ...varTranEnter({ durationIn, easeIn }) }
27
+ },
28
+ exit: {
29
+ y: [12, -24, 720],
30
+ scaleY: [0.985, 0.9, 3],
31
+ opacity: [1, 1, 0],
32
+ transition: varTranExit({ durationOut, easeOut })
33
+ }
34
+ },
35
+ inDown: {
36
+ initial: {},
37
+ animate: {
38
+ y: [-720, 24, -12, 4, 0],
39
+ scaleY: [4, 0.9, 0.95, 0.985, 1],
40
+ opacity: [0, 1, 1, 1, 1],
41
+ transition: varTranEnter({ durationIn, easeIn })
42
+ },
43
+ exit: {
44
+ y: [-12, 24, -720],
45
+ scaleY: [0.985, 0.9, 3],
46
+ opacity: [1, 1, 0],
47
+ transition: varTranExit({ durationOut, easeOut })
48
+ }
49
+ },
50
+ inLeft: {
51
+ initial: {},
52
+ animate: {
53
+ x: [-720, 24, -12, 4, 0],
54
+ scaleX: [3, 1, 0.98, 0.995, 1],
55
+ opacity: [0, 1, 1, 1, 1],
56
+ transition: varTranEnter({ durationIn, easeIn })
57
+ },
58
+ exit: {
59
+ x: [0, 24, -720],
60
+ scaleX: [1, 0.9, 2],
61
+ opacity: [1, 1, 0],
62
+ transition: varTranExit({ durationOut, easeOut })
63
+ }
64
+ },
65
+ inRight: {
66
+ initial: {},
67
+ animate: {
68
+ x: [720, -24, 12, -4, 0],
69
+ scaleX: [3, 1, 0.98, 0.995, 1],
70
+ opacity: [0, 1, 1, 1, 1],
71
+ transition: varTranEnter({ durationIn, easeIn })
72
+ },
73
+ exit: {
74
+ x: [0, -24, 720],
75
+ scaleX: [1, 0.9, 2],
76
+ opacity: [1, 1, 0],
77
+ transition: varTranExit({ durationOut, easeOut })
78
+ }
79
+ },
80
+ out: {
81
+ animate: { scale: [0.9, 1.1, 0.3], opacity: [1, 1, 0] }
82
+ },
83
+ outUp: {
84
+ animate: { y: [-12, 24, -720], scaleY: [0.985, 0.9, 3], opacity: [1, 1, 0] }
85
+ },
86
+ outDown: {
87
+ animate: { y: [12, -24, 720], scaleY: [0.985, 0.9, 3], opacity: [1, 1, 0] }
88
+ },
89
+ outLeft: {
90
+ animate: { x: [0, 24, -720], scaleX: [1, 0.9, 2], opacity: [1, 1, 0] }
91
+ },
92
+ outRight: {
93
+ animate: { x: [0, -24, 720], scaleX: [1, 0.9, 2], opacity: [1, 1, 0] }
94
+ }
95
+ };
96
+ };
97
+ export { varBounce as v };
@@ -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 };
@@ -1,2 +1,4 @@
1
1
  export * from './fade';
2
+ export * from './bounce';
3
+ export * from './container';
2
4
  export * from './transition';
@@ -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';
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { MuiLabLoadingButtonProps } from './types';
3
+ export declare const LoadingButton: (props: MuiLabLoadingButtonProps) => JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { LoadingButton as LoadingButton$1 } from "@mui/lab";
2
+ import { Skeleton } from "@mui/material";
3
+ import { styled } from "@mui/material/styles";
4
+ import { jsx } from "react/jsx-runtime";
5
+ const WrapperSKTLoadingButton = styled("div")(({
6
+ theme
7
+ }) => ({
8
+ display: "flex",
9
+ width: "100%",
10
+ borderRadius: theme.spacing(1),
11
+ overflow: "hidden"
12
+ }));
13
+ const SKTLoadingButton = () => /* @__PURE__ */ jsx(WrapperSKTLoadingButton, {
14
+ id: "WrapperSKTLoadingButton",
15
+ children: /* @__PURE__ */ jsx(Skeleton, {
16
+ variant: "rectangular",
17
+ width: "100%",
18
+ height: "48px"
19
+ })
20
+ });
21
+ const LoadingButton = (props) => {
22
+ const {
23
+ isSkeleton,
24
+ children,
25
+ ...other
26
+ } = props;
27
+ if (isSkeleton) {
28
+ return /* @__PURE__ */ jsx(SKTLoadingButton, {});
29
+ }
30
+ return /* @__PURE__ */ jsx(LoadingButton$1, {
31
+ ...other,
32
+ children
33
+ });
34
+ };
35
+ export { LoadingButton as L };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const SKTLoadingButton: () => JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const WrapperSKTLoadingButton: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,5 @@
1
+ import { LoadingButtonProps } from '@mui/lab';
2
+ export interface MuiLabLoadingButtonProps extends LoadingButtonProps {
3
+ isSkeleton?: boolean;
4
+ children?: any;
5
+ }
@@ -4,6 +4,7 @@ export { Breadcrumbs } from './Breadcrumbs';
4
4
  export type { TLink } from './Breadcrumbs/types';
5
5
  export { IconButton } from './IconButton';
6
6
  export { LinkWithRoute } from './LinkWithRoute';
7
+ export { LoadingButton } from './LoadingButton';
7
8
  export { MenuActions } from './MenuActions';
8
9
  export type { MenuAction, ComponentActionProps } from './MenuActions/types';
9
10
  export { MenuPopover } from './MenuPopover';
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,11 +8,11 @@ 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";
14
14
  export { R as RHFTextField } from "./components/hook-form/RHFTextField/index.js";
15
+ export { L as LoadingButton } from "./components/mui_extended/LoadingButton/index.js";
15
16
  export { M as MenuPopover } from "./components/mui_extended/MenuPopover/index.js";
16
17
  export { M as MenuActions } from "./components/mui_extended/MenuActions/index.js";
17
18
  export { P as Pager, g as getPagerComponentsDictionary } from "./components/mui_extended/Pager/index.js";
@@ -26,6 +27,7 @@ import "react-dnd";
26
27
  import "react-dnd-html5-backend";
27
28
  import "date-fns";
28
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";
29
31
  import "./react-draggable.js";
30
32
  export { M as ModalDialog, d as defaultModalDialogDictionary, g as getModalDialogComponentsDictionary } from "./components/ModalDialog/index.js";
31
33
  export { R as Resizeable } from "./components/Resizeable/index.js";
@@ -40,7 +42,10 @@ export { S as ScrollBar } from "./components/ScrollBar/index.js";
40
42
  import "./react-splitter-layout.js";
41
43
  export { S as SplitLayout } from "./components/SplitLayout/index.js";
42
44
  export { v as varFade } from "./components/animate/variants/fade.js";
45
+ export { v as varBounce } from "./components/animate/variants/bounce.js";
46
+ export { v as varContainer } from "./components/animate/variants/container.js";
43
47
  export { v as varTranEnter, a as varTranExit, b as varTranHover } from "./components/animate/variants/transition.js";
48
+ export { M as MotionContainer } from "./components/animate/MotionContainer/index.js";
44
49
  export { M as MotionLazyContainer } from "./components/animate/MotionLazyContainer/index.js";
45
50
  export { R as RHFMultiCheckbox } from "./components/hook-form/RHFMultiCheckbox/index.js";
46
51
  export { R as RHFSelect } from "./components/hook-form/RHFSelect.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
3
  "private": false,
4
- "version": "0.0.22",
4
+ "version": "0.0.25",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "dev": "vite",