@fixefy/fixefy-ui-components 0.3.28 → 0.3.29

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,6 @@
1
+ import React from 'react';
2
+ export declare const FxGeneralModal: ({ buttonComponent, modalComponent, onClick, }: {
3
+ buttonComponent: any;
4
+ modalComponent: any;
5
+ onClick?: any;
6
+ }) => React.JSX.Element;
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxGeneralModal", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return FxGeneralModal;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
13
+ const _material = require("@mui/material");
14
+ function _getRequireWildcardCache(nodeInterop) {
15
+ if (typeof WeakMap !== "function") return null;
16
+ var cacheBabelInterop = new WeakMap();
17
+ var cacheNodeInterop = new WeakMap();
18
+ return (_getRequireWildcardCache = function(nodeInterop) {
19
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
20
+ })(nodeInterop);
21
+ }
22
+ function _interop_require_wildcard(obj, nodeInterop) {
23
+ if (!nodeInterop && obj && obj.__esModule) {
24
+ return obj;
25
+ }
26
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
27
+ return {
28
+ default: obj
29
+ };
30
+ }
31
+ var cache = _getRequireWildcardCache(nodeInterop);
32
+ if (cache && cache.has(obj)) {
33
+ return cache.get(obj);
34
+ }
35
+ var newObj = {
36
+ __proto__: null
37
+ };
38
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
39
+ for(var key in obj){
40
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
41
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
42
+ if (desc && (desc.get || desc.set)) {
43
+ Object.defineProperty(newObj, key, desc);
44
+ } else {
45
+ newObj[key] = obj[key];
46
+ }
47
+ }
48
+ }
49
+ newObj.default = obj;
50
+ if (cache) {
51
+ cache.set(obj, newObj);
52
+ }
53
+ return newObj;
54
+ }
55
+ const FxGeneralModal = ({ buttonComponent, modalComponent, onClick })=>{
56
+ const [isOpen, setIsOpen] = (0, _react.useState)(false);
57
+ const [AnchorEl, setAnchorEl] = (0, _react.useState)(null);
58
+ const handleClick = (e)=>{
59
+ if (onClick) {
60
+ onClick();
61
+ setIsOpen((prev)=>!prev);
62
+ setAnchorEl(e.currentTarget);
63
+ } else {
64
+ setIsOpen((prev)=>!prev);
65
+ setAnchorEl(e.currentTarget);
66
+ }
67
+ };
68
+ const handleClose = ()=>{
69
+ setIsOpen(false);
70
+ setAnchorEl(null);
71
+ };
72
+ (0, _react.useEffect)(()=>{
73
+ setIsOpen(false);
74
+ }, [
75
+ buttonComponent
76
+ ]);
77
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
78
+ children: [
79
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
80
+ onClick: handleClick,
81
+ children: buttonComponent
82
+ }),
83
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Menu, {
84
+ id: "fade-menu",
85
+ MenuListProps: {
86
+ 'aria-labelledby': 'fade-button'
87
+ },
88
+ anchorEl: AnchorEl,
89
+ open: isOpen,
90
+ onClose: handleClose,
91
+ TransitionComponent: _material.Fade,
92
+ children: isOpen && modalComponent
93
+ })
94
+ ]
95
+ });
96
+ };
@@ -0,0 +1 @@
1
+ export { FxGeneralModal } from './FxGeneralModal';
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "FxGeneralModal", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return _FxGeneralModal.FxGeneralModal;
9
+ }
10
+ });
11
+ const _FxGeneralModal = require("./FxGeneralModal");
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { FxAvatar, AvatarPropsType, BackgroundColorsType } from './FxAvatar';
5
5
  export { FxButton, ButtonPropsType } from './FxButton';
6
6
  export { FxChip, ChipPropsType } from './FxChip';
7
7
  export { FxDatesProgress } from './FxDatesProgress';
8
+ export { FxGeneralModal } from './FxGeneralModal';
8
9
  export { FxIcon } from './FxIcon';
9
10
  export { FxMenuItemWithIcon } from './FxMenuItemWithIcon';
10
11
  export { FxModal, ModalPropsType } from './FxModal';
package/dist/index.js CHANGED
@@ -66,6 +66,9 @@ _export(exports, {
66
66
  FxDatesProgress: function() {
67
67
  return _FxDatesProgress.FxDatesProgress;
68
68
  },
69
+ FxGeneralModal: function() {
70
+ return _FxGeneralModal.FxGeneralModal;
71
+ },
69
72
  FxIcon: function() {
70
73
  return _FxIcon.FxIcon;
71
74
  },
@@ -233,6 +236,7 @@ const _FxAvatar = require("./FxAvatar");
233
236
  const _FxButton = require("./FxButton");
234
237
  const _FxChip = require("./FxChip");
235
238
  const _FxDatesProgress = require("./FxDatesProgress");
239
+ const _FxGeneralModal = require("./FxGeneralModal");
236
240
  const _FxIcon = require("./FxIcon");
237
241
  const _FxMenuItemWithIcon = require("./FxMenuItemWithIcon");
238
242
  const _FxModal = require("./FxModal");
package/package.json CHANGED
@@ -67,5 +67,5 @@
67
67
  "require": "./dist/index.js"
68
68
  }
69
69
  },
70
- "version": "0.3.28"
70
+ "version": "0.3.29"
71
71
  }