@m4l/components 0.0.23 → 0.0.26

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
+ }
@@ -1,8 +1,7 @@
1
1
  import { useState, useEffect, useCallback, useMemo } from "react";
2
2
  import { useNetwork, useModuleDictionary, usePaginate } from "@m4l/core";
3
3
  import { Tooltip, IconButton, TextField } from "@mui/material";
4
- import { LocalizationProvider, DateTimePicker } from "@mui/x-date-pickers";
5
- import AdapterDateFns from "@mui/lab/AdapterDateFns";
4
+ import { DateTimePicker } from "@mui/x-date-pickers";
6
5
  import { styled, useTheme } from "@mui/material/styles";
7
6
  import { startOfMonth, endOfDay } from "date-fns";
8
7
  import { D as DataGrid } from "../DataGrid/index.js";
@@ -225,25 +224,22 @@ function ObjectLogs(props) {
225
224
  return /* @__PURE__ */ jsxs(Container$1, {
226
225
  children: [/* @__PURE__ */ jsxs(Actions, {
227
226
  id: "objectLogsActions",
228
- children: [/* @__PURE__ */ jsxs(LocalizationProvider, {
229
- dateAdapter: AdapterDateFns,
230
- children: [/* @__PURE__ */ jsx(DateTimePicker, {
231
- value: startValue,
232
- onChange: (newValue) => {
233
- onChangeDate(newValue, "start");
234
- },
235
- renderInput: (params) => /* @__PURE__ */ jsx(TextField, {
236
- ...params
237
- })
238
- }), /* @__PURE__ */ jsx(DateTimePicker, {
239
- value: endValue,
240
- onChange: (newValue) => {
241
- onChangeDate(newValue, "end");
242
- },
243
- renderInput: (params) => /* @__PURE__ */ jsx(TextField, {
244
- ...params
245
- })
246
- })]
227
+ children: [/* @__PURE__ */ jsx(DateTimePicker, {
228
+ value: startValue,
229
+ onChange: (newValue) => {
230
+ onChangeDate(newValue, "start");
231
+ },
232
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, {
233
+ ...params
234
+ })
235
+ }), /* @__PURE__ */ jsx(DateTimePicker, {
236
+ value: endValue,
237
+ onChange: (newValue) => {
238
+ onChangeDate(newValue, "end");
239
+ },
240
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField, {
241
+ ...params
242
+ })
247
243
  }), /* @__PURE__ */ jsx(IconButton$1, {
248
244
  dictionaryTooltip: "object_logs.search",
249
245
  onClick: onClickFilter,
@@ -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';
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,12 +27,12 @@ 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";
33
34
  export { N as NoItemSelected, d as defaultNoItemSelectedDictionary, g as getNoItemSelectedComponentsDictionary } from "./components/NoItemSelected/index.js";
34
35
  import "@mui/x-date-pickers";
35
- import "@mui/lab/AdapterDateFns";
36
36
  export { O as ObjectLogs, d as defaultObjectLogDictionary, g as getObjectLogsComponentsDictionary } from "./components/ObjectLogs/index.js";
37
37
  import "./react-json-view.js";
38
38
  export { P as PaperForm } from "./components/PaperForm/index.js";
@@ -41,7 +41,10 @@ export { S as ScrollBar } from "./components/ScrollBar/index.js";
41
41
  import "./react-splitter-layout.js";
42
42
  export { S as SplitLayout } from "./components/SplitLayout/index.js";
43
43
  export { v as varFade } from "./components/animate/variants/fade.js";
44
+ export { v as varBounce } from "./components/animate/variants/bounce.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";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
3
  "private": false,
4
- "version": "0.0.23",
4
+ "version": "0.0.26",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -21,7 +21,7 @@
21
21
  "peerDependencies": {
22
22
  "@hookform/resolvers": "^2.9.5",
23
23
  "@m4l/core": "^0.0.27",
24
- "@m4l/graphics": "^0.0.20",
24
+ "@m4l/graphics": "^0.0.21",
25
25
  "@mui/lab": "^5.0.0-alpha.89",
26
26
  "@mui/material": "^5.8.7",
27
27
  "@mui/x-date-pickers": "^5.0.0-beta.0",
@@ -42,7 +42,8 @@
42
42
  "@emotion/styled": "^11.9.3",
43
43
  "@hookform/resolvers": "^2.9.5",
44
44
  "@m4l/core": "^0.0.27",
45
- "@m4l/graphics": "^0.0.20",
45
+ "@m4l/graphics": "^0.0.21",
46
+ "@m4l/layouts": "^0.0.9",
46
47
  "@mui/lab": "^5.0.0-alpha.89",
47
48
  "@mui/material": "^5.8.7",
48
49
  "@mui/x-date-pickers": "^5.0.0-beta.0",
@@ -81,6 +82,7 @@
81
82
  "react-lazy-load-image-component": "^1.5.4",
82
83
  "react-resizable": "^3.0.4",
83
84
  "react-splitter-layout": "^4.0.0",
85
+ "react-toastify": "^9.0.5",
84
86
  "rollup-plugin-terser": "^7.0.2",
85
87
  "simplebar-react": "^2.4.1",
86
88
  "typescript": "^4.6.3",