@m4l/components 0.0.19 → 0.0.22

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/commonjs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import "react";
2
- import "react-dom";
3
2
  import "prop-types";
3
+ import "react-dom";
4
4
  import "clsx";
5
5
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
6
6
  function getDefaultExportFromCjs(x) {
@@ -1070,6 +1070,10 @@ const ColumnsConfig = forwardRef((props, ref) => {
1070
1070
  const [rows, setRows] = useState(getRowsFromColumnsConfig(columnsConfig));
1071
1071
  const [selRows, setSelRows] = useState(() => /* @__PURE__ */ new Set());
1072
1072
  const divRef = useRef(null);
1073
+ const {
1074
+ host_static_assets,
1075
+ environment
1076
+ } = useEnvironment();
1073
1077
  useImperativeHandle(ref, () => ({
1074
1078
  onClickIntro: handleIntro,
1075
1079
  current: divRef.current
@@ -1251,40 +1255,40 @@ const ColumnsConfig = forwardRef((props, ref) => {
1251
1255
  onClick: handleMoveFirst,
1252
1256
  "aria-label": "move first place",
1253
1257
  disabled: rowSelectedIndex < 1,
1254
- src: "components/grid/assets/icons/move_first_place.svg"
1258
+ src: `${host_static_assets}/${environment}/components/grid/assets/icons/move_first_place.svg`
1255
1259
  }), /* @__PURE__ */ jsx(IconButton, {
1256
1260
  dictionaryTooltip: "grid.settings_move_up",
1257
1261
  onClick: () => handleMoveUpDownd(-1),
1258
1262
  "aria-label": "move up place",
1259
1263
  disabled: rowSelectedIndex < 1,
1260
- src: "components/grid/assets/icons/move_up_place.svg"
1264
+ src: `${host_static_assets}/${environment}/components/grid/assets/icons/move_up_place.svg`
1261
1265
  }), /* @__PURE__ */ jsx(IconButton, {
1262
1266
  dictionaryTooltip: "grid.settings_move_last",
1263
1267
  onClick: handleMoveLast,
1264
1268
  "aria-label": "move last place",
1265
1269
  disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
1266
- src: "components/grid/assets/icons/move_last_place.svg"
1270
+ src: `${host_static_assets}/${environment}/components/grid/assets/icons/move_last_place.svg`
1267
1271
  }), /* @__PURE__ */ jsx(IconButton, {
1268
1272
  dictionaryTooltip: "grid.settings_move_down",
1269
1273
  onClick: () => handleMoveUpDownd(1),
1270
1274
  "aria-label": "move down place",
1271
1275
  disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
1272
- src: "components/grid/assets/icons/move_down_place.svg"
1276
+ src: `${host_static_assets}/${environment}/components/grid/assets/icons/move_down_place.svg`
1273
1277
  }), /* @__PURE__ */ jsx(IconButton, {
1274
1278
  dictionaryTooltip: "grid.settings_visible_all",
1275
1279
  onClick: checkAll,
1276
1280
  "aria-label": "check visible all",
1277
- src: "components/grid/assets/icons/check_all.svg"
1281
+ src: `${host_static_assets}/${environment}/components/grid/assets/icons/check_all.svg`
1278
1282
  }), /* @__PURE__ */ jsx(IconButton, {
1279
1283
  dictionaryTooltip: "grid.settings_no_visible_all",
1280
1284
  onClick: unCheckAll,
1281
1285
  "aria-label": "un check all",
1282
- src: "components/grid/assets/icons/uncheck_all.svg"
1286
+ src: `${host_static_assets}/${environment}/components/grid/assets/icons/uncheck_all.svg`
1283
1287
  }), /* @__PURE__ */ jsx(IconButton, {
1284
1288
  dictionaryTooltip: "grid.settings_restore",
1285
1289
  onClick: restoreAll,
1286
1290
  "aria-label": "Restore columns",
1287
- src: "components/grid/assets/icons/restore_columns.svg"
1291
+ src: `${host_static_assets}/${environment}/components/grid/assets/icons/restore_columns.svg`
1288
1292
  })]
1289
1293
  })]
1290
1294
  });
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { IconButtonProps } from '@mui/material';
3
+ export declare const IconButtonAnimate: import("react").ForwardRefExoticComponent<Pick<IconButtonProps<"button", {}>, "size" | "form" | "slot" | "title" | "color" | "translate" | "sx" | "key" | "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "name" | "type" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "value" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "edge"> & import("react").RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare type AnimateWrapProp = {
3
+ children: ReactNode;
4
+ size: 'small' | 'medium' | 'large';
5
+ };
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ declare type Props = {
3
+ children: ReactNode;
4
+ };
5
+ export declare function MotionLazyContainer({ children }: Props): JSX.Element;
6
+ export {};
@@ -0,0 +1,13 @@
1
+ import { LazyMotion } from "framer-motion";
2
+ import { jsx } from "react/jsx-runtime";
3
+ const loadFeatures = () => import("../features.js").then((res) => res.default);
4
+ function MotionLazyContainer({
5
+ children
6
+ }) {
7
+ return /* @__PURE__ */ jsx(LazyMotion, {
8
+ strict: true,
9
+ features: loadFeatures,
10
+ children
11
+ });
12
+ }
13
+ export { MotionLazyContainer as M };
@@ -0,0 +1,2 @@
1
+ import { domMax } from "framer-motion";
2
+ export { domMax as default } from "framer-motion";
@@ -0,0 +1,3 @@
1
+ export * from './variants';
2
+ export { IconButtonAnimate } from './IconButtonAnimate';
3
+ export { MotionLazyContainer } from './MotionLazyContainer';
@@ -0,0 +1,26 @@
1
+ declare type EaseType = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | 'circIn' | 'circOut' | 'circInOut' | 'backIn' | 'backOut' | 'backInOut' | 'anticipate' | number[];
2
+ export declare type VariantsType = {
3
+ distance?: number;
4
+ durationIn?: number;
5
+ durationOut?: number;
6
+ easeIn?: EaseType;
7
+ easeOut?: EaseType;
8
+ };
9
+ export declare type TranHoverType = {
10
+ duration?: number;
11
+ ease?: EaseType;
12
+ };
13
+ export declare type TranEnterType = {
14
+ durationIn?: number;
15
+ easeIn?: EaseType;
16
+ };
17
+ export declare type TranExitType = {
18
+ durationOut?: number;
19
+ easeOut?: EaseType;
20
+ };
21
+ export declare type BackgroundType = {
22
+ colors?: string[];
23
+ duration?: number;
24
+ ease?: EaseType;
25
+ };
26
+ export {};
@@ -0,0 +1,217 @@
1
+ import { VariantsType } from '../type';
2
+ export declare const varFade: (props?: VariantsType | undefined) => {
3
+ in: {
4
+ initial: {
5
+ opacity: number;
6
+ };
7
+ animate: {
8
+ opacity: number;
9
+ transition: (props?: import("../type").TranEnterType | undefined) => {
10
+ duration: number;
11
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
12
+ };
13
+ };
14
+ exit: {
15
+ opacity: number;
16
+ transition: (props?: import("../type").TranExitType | undefined) => {
17
+ duration: number;
18
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
19
+ };
20
+ };
21
+ };
22
+ inUp: {
23
+ initial: {
24
+ y: number;
25
+ opacity: number;
26
+ };
27
+ animate: {
28
+ y: number;
29
+ opacity: number;
30
+ transition: {
31
+ duration: number;
32
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
33
+ };
34
+ };
35
+ exit: {
36
+ y: number;
37
+ opacity: number;
38
+ transition: {
39
+ duration: number;
40
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
41
+ };
42
+ };
43
+ };
44
+ inDown: {
45
+ initial: {
46
+ y: number;
47
+ opacity: number;
48
+ };
49
+ animate: {
50
+ y: number;
51
+ opacity: number;
52
+ transition: {
53
+ duration: number;
54
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
55
+ };
56
+ };
57
+ exit: {
58
+ y: number;
59
+ opacity: number;
60
+ transition: {
61
+ duration: number;
62
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
63
+ };
64
+ };
65
+ };
66
+ inLeft: {
67
+ initial: {
68
+ x: number;
69
+ opacity: number;
70
+ };
71
+ animate: {
72
+ x: number;
73
+ opacity: number;
74
+ transition: {
75
+ duration: number;
76
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
77
+ };
78
+ };
79
+ exit: {
80
+ x: number;
81
+ opacity: number;
82
+ transition: {
83
+ duration: number;
84
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
85
+ };
86
+ };
87
+ };
88
+ inRight: {
89
+ initial: {
90
+ x: number;
91
+ opacity: number;
92
+ };
93
+ animate: {
94
+ x: 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
+ exit: {
102
+ x: number;
103
+ opacity: number;
104
+ transition: {
105
+ duration: number;
106
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
107
+ };
108
+ };
109
+ };
110
+ out: {
111
+ initial: {
112
+ opacity: number;
113
+ };
114
+ animate: {
115
+ opacity: number;
116
+ transition: {
117
+ duration: number;
118
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
119
+ };
120
+ };
121
+ exit: {
122
+ opacity: number;
123
+ transition: {
124
+ duration: number;
125
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
126
+ };
127
+ };
128
+ };
129
+ outUp: {
130
+ initial: {
131
+ y: number;
132
+ opacity: number;
133
+ };
134
+ animate: {
135
+ y: number;
136
+ opacity: number;
137
+ transition: {
138
+ duration: number;
139
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
140
+ };
141
+ };
142
+ exit: {
143
+ y: number;
144
+ opacity: number;
145
+ transition: {
146
+ duration: number;
147
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
148
+ };
149
+ };
150
+ };
151
+ outDown: {
152
+ initial: {
153
+ y: number;
154
+ opacity: number;
155
+ };
156
+ animate: {
157
+ y: number;
158
+ opacity: number;
159
+ transition: {
160
+ duration: number;
161
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
162
+ };
163
+ };
164
+ exit: {
165
+ y: number;
166
+ opacity: number;
167
+ transition: {
168
+ duration: number;
169
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
170
+ };
171
+ };
172
+ };
173
+ outLeft: {
174
+ initial: {
175
+ x: number;
176
+ opacity: number;
177
+ };
178
+ animate: {
179
+ x: number;
180
+ opacity: number;
181
+ transition: {
182
+ duration: number;
183
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
184
+ };
185
+ };
186
+ exit: {
187
+ x: number;
188
+ opacity: number;
189
+ transition: {
190
+ duration: number;
191
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
192
+ };
193
+ };
194
+ };
195
+ outRight: {
196
+ initial: {
197
+ x: number;
198
+ opacity: number;
199
+ };
200
+ animate: {
201
+ x: number;
202
+ opacity: number;
203
+ transition: {
204
+ duration: number;
205
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
206
+ };
207
+ };
208
+ exit: {
209
+ x: number;
210
+ opacity: number;
211
+ transition: {
212
+ duration: number;
213
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
214
+ };
215
+ };
216
+ };
217
+ };
@@ -0,0 +1,61 @@
1
+ import { v as varTranEnter, a as varTranExit } from "./transition.js";
2
+ const varFade = (props) => {
3
+ const distance = props?.distance || 120;
4
+ const durationIn = props?.durationIn;
5
+ const durationOut = props?.durationOut;
6
+ const easeIn = props?.easeIn;
7
+ const easeOut = props?.easeOut;
8
+ return {
9
+ in: {
10
+ initial: { opacity: 0 },
11
+ animate: { opacity: 1, transition: varTranEnter },
12
+ exit: { opacity: 0, transition: varTranExit }
13
+ },
14
+ inUp: {
15
+ initial: { y: distance, opacity: 0 },
16
+ animate: { y: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
17
+ exit: { y: distance, opacity: 0, transition: varTranExit({ durationOut, easeOut }) }
18
+ },
19
+ inDown: {
20
+ initial: { y: -distance, opacity: 0 },
21
+ animate: { y: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
22
+ exit: { y: -distance, opacity: 0, transition: varTranExit({ durationOut, easeOut }) }
23
+ },
24
+ inLeft: {
25
+ initial: { x: -distance, opacity: 0 },
26
+ animate: { x: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
27
+ exit: { x: -distance, opacity: 0, transition: varTranExit({ durationOut, easeOut }) }
28
+ },
29
+ inRight: {
30
+ initial: { x: distance, opacity: 0 },
31
+ animate: { x: 0, opacity: 1, transition: varTranEnter({ durationIn, easeIn }) },
32
+ exit: { x: distance, opacity: 0, transition: varTranExit({ durationOut, easeOut }) }
33
+ },
34
+ out: {
35
+ initial: { opacity: 1 },
36
+ animate: { opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
37
+ exit: { opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
38
+ },
39
+ outUp: {
40
+ initial: { y: 0, opacity: 1 },
41
+ animate: { y: -distance, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
42
+ exit: { y: 0, opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
43
+ },
44
+ outDown: {
45
+ initial: { y: 0, opacity: 1 },
46
+ animate: { y: distance, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
47
+ exit: { y: 0, opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
48
+ },
49
+ outLeft: {
50
+ initial: { x: 0, opacity: 1 },
51
+ animate: { x: -distance, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
52
+ exit: { x: 0, opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
53
+ },
54
+ outRight: {
55
+ initial: { x: 0, opacity: 1 },
56
+ animate: { x: distance, opacity: 0, transition: varTranEnter({ durationIn, easeIn }) },
57
+ exit: { x: 0, opacity: 1, transition: varTranExit({ durationOut, easeOut }) }
58
+ }
59
+ };
60
+ };
61
+ export { varFade as v };
@@ -0,0 +1,2 @@
1
+ export * from './fade';
2
+ export * from './transition';
@@ -0,0 +1,13 @@
1
+ import { TranHoverType, TranEnterType, TranExitType } from '../type';
2
+ export declare const varTranHover: (props?: TranHoverType | undefined) => {
3
+ duration: number;
4
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
5
+ };
6
+ export declare const varTranEnter: (props?: TranEnterType | undefined) => {
7
+ duration: number;
8
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
9
+ };
10
+ export declare const varTranExit: (props?: TranExitType | undefined) => {
11
+ duration: number;
12
+ ease: "linear" | "easeIn" | "easeOut" | "easeInOut" | "circIn" | "circOut" | "circInOut" | "backIn" | "backOut" | "backInOut" | "anticipate" | number[];
13
+ };
@@ -0,0 +1,16 @@
1
+ const varTranHover = (props) => {
2
+ const duration = props?.duration || 0.32;
3
+ const ease = props?.ease || [0.43, 0.13, 0.23, 0.96];
4
+ return { duration, ease };
5
+ };
6
+ const varTranEnter = (props) => {
7
+ const duration = props?.durationIn || 0.64;
8
+ const ease = props?.easeIn || [0.43, 0.13, 0.23, 0.96];
9
+ return { duration, ease };
10
+ };
11
+ const varTranExit = (props) => {
12
+ const duration = props?.durationOut || 0.48;
13
+ const ease = props?.easeOut || [0.43, 0.13, 0.23, 0.96];
14
+ return { duration, ease };
15
+ };
16
+ export { varTranExit as a, varTranHover as b, varTranEnter as v };
@@ -1,3 +1,6 @@
1
+ export * from '../components/animate';
2
+ export * from '../components/hook-form';
3
+ export * from '../components/mui_extended';
1
4
  export * from '../components/CompanyLogo';
2
5
  export { DataGrid } from '../components/DataGrid';
3
6
  export { DateFormatter, BooleanFormatter } from '../components/DataGrid/formatters';
@@ -6,7 +9,6 @@ export type { RowKey } from '../components/DataGrid/types';
6
9
  export { getGridComponentsDictionary } from '../components/DataGrid/dictionary';
7
10
  export * from '../components/FormActions';
8
11
  export * from '../components/FormActions/dictionary';
9
- export * from '../components/hook-form';
10
12
  export * from '../components/Image';
11
13
  export * from '../components/LanguagePopover';
12
14
  export * from '../components/Loadable';
@@ -21,5 +23,4 @@ export * from '../components/PropertyValue';
21
23
  export * from '../components/Resizeable';
22
24
  export * from '../components/ScrollBar';
23
25
  export * from '../components/SplitLayout';
24
- export * from '../components/mui_extended';
25
26
  export type { SplitPosition } from '../components/SplitLayout/types';
@@ -1,8 +1,64 @@
1
- import { useMemo } from "react";
1
+ import { m } from "framer-motion";
2
+ import { forwardRef, useMemo } from "react";
3
+ import { IconButton as IconButton$1, Box, Tooltip } from "@mui/material";
4
+ import { jsx } from "react/jsx-runtime";
2
5
  import { useModuleDictionary } from "@m4l/core";
3
- import { IconButton as IconButton$1, Tooltip } from "@mui/material";
4
6
  import { B as BoxIcon } from "../BoxIcon/index.js";
5
- import { jsx } from "react/jsx-runtime";
7
+ const varSmall = {
8
+ hover: {
9
+ scale: 1.1
10
+ },
11
+ tap: {
12
+ scale: 0.95
13
+ }
14
+ };
15
+ const varMedium = {
16
+ hover: {
17
+ scale: 1.09
18
+ },
19
+ tap: {
20
+ scale: 0.97
21
+ }
22
+ };
23
+ const varLarge = {
24
+ hover: {
25
+ scale: 1.08
26
+ },
27
+ tap: {
28
+ scale: 0.99
29
+ }
30
+ };
31
+ function AnimateWrap({
32
+ size,
33
+ children
34
+ }) {
35
+ const isSmall = size === "small";
36
+ const isLarge = size === "large";
37
+ return /* @__PURE__ */ jsx(Box, {
38
+ component: m.div,
39
+ whileTap: "tap",
40
+ whileHover: "hover",
41
+ variants: isSmall && varSmall || isLarge && varLarge || varMedium,
42
+ sx: {
43
+ display: "inline-flex"
44
+ },
45
+ children
46
+ });
47
+ }
48
+ const IconButtonAnimate = forwardRef(({
49
+ children,
50
+ size = "medium",
51
+ ...other
52
+ }, ref) => /* @__PURE__ */ jsx(AnimateWrap, {
53
+ size,
54
+ children: /* @__PURE__ */ jsx(IconButton$1, {
55
+ size,
56
+ ref,
57
+ ...other,
58
+ children
59
+ })
60
+ }));
61
+ IconButtonAnimate.displayName = "IconButtonAnimate";
6
62
  function IconButton({
7
63
  src,
8
64
  tooltip,
@@ -34,4 +90,4 @@ function IconButton({
34
90
  }
35
91
  return iconButton;
36
92
  }
37
- export { IconButton as I };
93
+ export { IconButton as I, IconButtonAnimate as a };
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ export { I as IconButton, a as IconButtonAnimate } from "./components/mui_extended/IconButton/index.js";
2
+ import "framer-motion";
3
+ import "react/jsx-runtime";
1
4
  import "react";
2
5
  import "react-hook-form";
3
6
  export { F as FormProvider } from "./components/hook-form/FormProvider/index.js";
@@ -6,7 +9,6 @@ import "@m4l/core";
6
9
  import "@mui/lab";
7
10
  import "@mui/material";
8
11
  export { M as ModalContext, a as ModalProvider } from "./contexts/ModalContext/index.js";
9
- import "react/jsx-runtime";
10
12
  export { R as RHFAutocompleteAsync } from "./components/hook-form/RHFAutocompleteAsync/index.js";
11
13
  export { R as RHFCheckbox } from "./components/hook-form/RHFCheckbox/index.js";
12
14
  export { R as RHFTextField } from "./components/hook-form/RHFTextField/index.js";
@@ -37,19 +39,21 @@ export { P as PropertyValue } from "./components/PropertyValue/index.js";
37
39
  export { S as ScrollBar } from "./components/ScrollBar/index.js";
38
40
  import "./react-splitter-layout.js";
39
41
  export { S as SplitLayout } from "./components/SplitLayout/index.js";
40
- export { B as BooleanFormatter } from "./components/DataGrid/formatters/BooleanFormatter/index.js";
41
- export { D as DateFormatter } from "./components/DataGrid/formatters/DateFormatter/index.js";
42
+ export { v as varFade } from "./components/animate/variants/fade.js";
43
+ export { v as varTranEnter, a as varTranExit, b as varTranHover } from "./components/animate/variants/transition.js";
44
+ export { M as MotionLazyContainer } from "./components/animate/MotionLazyContainer/index.js";
42
45
  export { R as RHFMultiCheckbox } from "./components/hook-form/RHFMultiCheckbox/index.js";
43
46
  export { R as RHFSelect } from "./components/hook-form/RHFSelect.js";
44
47
  export { R as RHFRadioGroup } from "./components/hook-form/RHFRadioGroup.js";
45
- export { L as LanguagePopover } from "./components/LanguagePopover/index.js";
46
- export { L as Loadable } from "./components/Loadable/index.js";
47
48
  export { A as Accordion } from "./components/mui_extended/Accordion/index.js";
48
49
  export { B as BoxIcon } from "./components/mui_extended/BoxIcon/index.js";
49
50
  export { B as Breadcrumbs } from "./components/mui_extended/Breadcrumbs/index.js";
50
- export { I as IconButton } from "./components/mui_extended/IconButton/index.js";
51
51
  export { L as LinkWithRoute } from "./components/mui_extended/LinkWithRoute/index.js";
52
52
  export { T as Typography } from "./components/mui_extended/Typography/index.js";
53
+ export { B as BooleanFormatter } from "./components/DataGrid/formatters/BooleanFormatter/index.js";
54
+ export { D as DateFormatter } from "./components/DataGrid/formatters/DateFormatter/index.js";
55
+ export { L as LanguagePopover } from "./components/LanguagePopover/index.js";
56
+ export { L as Loadable } from "./components/Loadable/index.js";
53
57
  export { u as useModal } from "./hooks/useModal/index.js";
54
58
  import "./node_modules.js";
55
59
  import "react-dom";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
3
  "private": false,
4
- "version": "0.0.19",
4
+ "version": "0.0.22",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -27,12 +27,14 @@
27
27
  "@mui/x-date-pickers": "^5.0.0-beta.0",
28
28
  "clsx": "^1.2.1",
29
29
  "date-fns": "^2.28.0",
30
+ "framer-motion": "^6.5.0",
30
31
  "lodash": "^4.17.21",
31
32
  "prop-types": "^15.8.1",
32
33
  "react": "^17.0.0 || 18.x",
33
34
  "react-dnd": "^16.0.1",
34
35
  "react-dnd-html5-backend": "^16.0.1",
35
36
  "react-dom": "^18.0.0",
37
+ "react-draggable": "^4.4.5",
36
38
  "react-hook-form": "^7.33.1",
37
39
  "react-router-dom": "^6.3.0"
38
40
  },
@@ -67,6 +69,7 @@
67
69
  "eslint-plugin-react": "^7.30.0",
68
70
  "eslint-plugin-react-hooks": "^4.5.0",
69
71
  "eslint-plugin-unused-imports": "^2.0.0",
72
+ "framer-motion": "^6.5.0",
70
73
  "lodash": "^4.17.21",
71
74
  "nprogress": "^0.2.0",
72
75
  "prettier": "^2.6.2",