@qoretechnologies/reqore 0.36.8 → 0.37.1
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/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js +2 -2
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Drawer/backdrop.d.ts +10 -0
- package/dist/components/Drawer/backdrop.d.ts.map +1 -0
- package/dist/components/Drawer/backdrop.js +59 -0
- package/dist/components/Drawer/backdrop.js.map +1 -0
- package/dist/components/Drawer/index.d.ts +0 -1
- package/dist/components/Drawer/index.d.ts.map +1 -1
- package/dist/components/Drawer/index.js +4 -20
- package/dist/components/Drawer/index.js.map +1 -1
- package/dist/components/Navbar/index.d.ts.map +1 -1
- package/dist/components/Navbar/index.js +1 -1
- package/dist/components/Navbar/index.js.map +1 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +2 -2
- package/dist/components/Sidebar/index.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts +7 -0
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +93 -36
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +1 -2
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/context/ReqoreContext.d.ts +3 -1
- package/dist/context/ReqoreContext.d.ts.map +1 -1
- package/dist/context/ReqoreContext.js +2 -0
- package/dist/context/ReqoreContext.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Collection/item.tsx +4 -5
- package/src/components/Drawer/backdrop.tsx +43 -0
- package/src/components/Drawer/index.tsx +4 -23
- package/src/components/Navbar/index.tsx +1 -0
- package/src/components/Sidebar/index.tsx +3 -4
- package/src/containers/ReqoreProvider.tsx +131 -66
- package/src/containers/UIProvider.tsx +1 -6
- package/src/context/ReqoreContext.tsx +10 -1
- package/src/stories/Drawer/Drawer.stories.tsx +5 -1
- package/src/stories/Modal/Manager.stories.tsx +166 -0
- package/tests.json +1 -1
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
37
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
38
|
if (ar || !(i in from)) {
|
|
@@ -26,7 +49,8 @@ exports.__esModule = true;
|
|
|
26
49
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
27
50
|
var react_1 = require("react");
|
|
28
51
|
var lodash_1 = require("lodash");
|
|
29
|
-
var react_2 = require("react");
|
|
52
|
+
var react_2 = __importStar(require("react"));
|
|
53
|
+
var react_dom_1 = require("react-dom");
|
|
30
54
|
var react_use_1 = require("react-use");
|
|
31
55
|
var shortid_1 = __importDefault(require("shortid"));
|
|
32
56
|
var use_context_selector_1 = require("use-context-selector");
|
|
@@ -35,10 +59,12 @@ var Notifications_1 = __importDefault(require("../components/Notifications"));
|
|
|
35
59
|
var notification_1 = __importDefault(require("../components/Notifications/notification"));
|
|
36
60
|
var ReqoreContext_1 = __importDefault(require("../context/ReqoreContext"));
|
|
37
61
|
var ThemeContext_1 = __importDefault(require("../context/ThemeContext"));
|
|
62
|
+
var PopoverProvider_1 = __importDefault(require("./PopoverProvider"));
|
|
38
63
|
var ReqoreProvider = function (_a) {
|
|
39
64
|
var children = _a.children, _b = _a.options, options = _b === void 0 ? {} : _b;
|
|
40
65
|
var _c = (0, react_2.useState)([]), notifications = _c[0], setNotifications = _c[1];
|
|
41
|
-
var _d = (0, react_2.useState)({}),
|
|
66
|
+
var _d = (0, react_2.useState)({}), modals = _d[0], setModals = _d[1];
|
|
67
|
+
var _e = (0, react_2.useState)({}), confirmationModal = _e[0], setConfirmationModal = _e[1];
|
|
42
68
|
var theme = (0, use_context_selector_1.useContext)(ThemeContext_1["default"]);
|
|
43
69
|
var latestZIndex = (0, react_2.useRef)(9000);
|
|
44
70
|
var isMobile = process.env.NODE_ENV === 'test' ? false : (0, react_use_1.useMedia)('(max-width: 480px)');
|
|
@@ -57,6 +83,21 @@ var ReqoreProvider = function (_a) {
|
|
|
57
83
|
var closeConfirmationModal = function () {
|
|
58
84
|
setConfirmationModal(function (cur) { return (__assign(__assign({}, cur), { isOpen: false })); });
|
|
59
85
|
};
|
|
86
|
+
var addModal = (0, react_2.useCallback)(function (modal, id) {
|
|
87
|
+
var _id = id || shortid_1["default"].generate();
|
|
88
|
+
setModals(function (cur) {
|
|
89
|
+
var _a;
|
|
90
|
+
return __assign(__assign({}, cur), (_a = {}, _a[_id] = modal, _a));
|
|
91
|
+
});
|
|
92
|
+
return _id;
|
|
93
|
+
}, []);
|
|
94
|
+
var removeModal = (0, react_2.useCallback)(function (id) {
|
|
95
|
+
setModals(function (cur) {
|
|
96
|
+
var newModals = __assign({}, cur);
|
|
97
|
+
delete newModals[id];
|
|
98
|
+
return newModals;
|
|
99
|
+
});
|
|
100
|
+
}, []);
|
|
60
101
|
var addNotification = function (data) {
|
|
61
102
|
setNotifications(function (cur) {
|
|
62
103
|
var newNotifications = __spreadArray([], cur, true);
|
|
@@ -79,11 +120,13 @@ var ReqoreProvider = function (_a) {
|
|
|
79
120
|
return __spreadArray([], cur, true).filter(function (notification) { return notification.id !== id; });
|
|
80
121
|
});
|
|
81
122
|
};
|
|
82
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.
|
|
123
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(ReqoreContext_1["default"].Provider, __assign({ value: {
|
|
83
124
|
notifications: notifications,
|
|
84
125
|
theme: theme,
|
|
85
126
|
addNotification: addNotification,
|
|
86
127
|
removeNotification: removeNotification,
|
|
128
|
+
addModal: addModal,
|
|
129
|
+
removeModal: removeModal,
|
|
87
130
|
confirmAction: confirmAction,
|
|
88
131
|
isMobile: isMobile,
|
|
89
132
|
isTablet: isTablet,
|
|
@@ -93,41 +136,55 @@ var ReqoreProvider = function (_a) {
|
|
|
93
136
|
animations: options.animations || { buttons: true, dialogs: true },
|
|
94
137
|
tooltips: options.tooltips || { delay: 0 },
|
|
95
138
|
closePopoversOnEscPress: 'closePopoversOnEscPress' in options ? options.closePopoversOnEscPress : true
|
|
96
|
-
} }, { children: [(0, lodash_1.size)(notifications) > 0 ? ((0, jsx_runtime_1.jsx)(Notifications_1["default"], __assign({ position: options.notificationsPosition }, { children: notifications.map(function (notification) { return ((0, react_1.createElement)(notification_1["default"], __assign({}, notification, { key: notification.id, onClick: notification.onClick
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
139
|
+
} }, { children: (0, jsx_runtime_1.jsxs)(PopoverProvider_1["default"], __assign({ uiScale: options === null || options === void 0 ? void 0 : options.uiScale }, { children: [(0, lodash_1.size)(notifications) > 0 ? ((0, jsx_runtime_1.jsx)(Notifications_1["default"], __assign({ position: options.notificationsPosition }, { children: notifications.map(function (notification) { return ((0, react_1.createElement)(notification_1["default"], __assign({}, notification, { key: notification.id, onClick: notification.onClick
|
|
140
|
+
? function () { return void notification.onClick(notification.id); }
|
|
141
|
+
: undefined, onClose: function () {
|
|
142
|
+
if (notification.onClose) {
|
|
143
|
+
notification.onClose(notification.id);
|
|
144
|
+
}
|
|
145
|
+
removeNotification(notification.id);
|
|
146
|
+
}, onFinish: function () {
|
|
147
|
+
if (notification.onFinish) {
|
|
148
|
+
notification.onFinish(notification.id);
|
|
149
|
+
}
|
|
150
|
+
removeNotification(notification.id);
|
|
151
|
+
} }))); }) }))) : null, children, confirmationModal.isOpen && ((0, jsx_runtime_1.jsx)(__1.ReqoreModal, __assign({ isOpen: true, flat: true, opacity: 0.9, blur: 2, width: '500px', intent: confirmationModal.intent, label: confirmationModal.title || 'Confirm your action', icon: 'ErrorWarningFill', className: 'reqore-confirmation-modal', bottomActions: [
|
|
152
|
+
{
|
|
153
|
+
label: confirmationModal.cancelLabel || 'Cancel',
|
|
154
|
+
icon: 'CloseLine',
|
|
155
|
+
onClick: function () {
|
|
156
|
+
var _a;
|
|
157
|
+
(_a = confirmationModal === null || confirmationModal === void 0 ? void 0 : confirmationModal.onCancel) === null || _a === void 0 ? void 0 : _a.call(confirmationModal);
|
|
158
|
+
closeConfirmationModal();
|
|
159
|
+
},
|
|
160
|
+
position: 'left'
|
|
116
161
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
162
|
+
{
|
|
163
|
+
label: confirmationModal.confirmLabel || 'Confirm',
|
|
164
|
+
intent: confirmationModal.confirmButtonIntent || 'success',
|
|
165
|
+
icon: confirmationModal.confirmIcon || 'CheckLine',
|
|
166
|
+
onClick: function () {
|
|
167
|
+
var _a;
|
|
168
|
+
(_a = confirmationModal === null || confirmationModal === void 0 ? void 0 : confirmationModal.onConfirm) === null || _a === void 0 ? void 0 : _a.call(confirmationModal);
|
|
169
|
+
closeConfirmationModal();
|
|
170
|
+
},
|
|
171
|
+
position: 'right'
|
|
127
172
|
},
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
173
|
+
] }, { children: (0, jsx_runtime_1.jsx)(__1.ReqoreTextEffect, __assign({ as: 'p', effect: { textAlign: 'center', weight: 'bold', textSize: 'big' } }, { children: confirmationModal.description || 'Are you sure you want to proceed?' })) }))), (0, lodash_1.map)(modals, function (modal, key) {
|
|
174
|
+
return react_2["default"].isValidElement(modal) ? ((0, react_dom_1.createPortal)(react_2["default"].cloneElement(modal, {
|
|
175
|
+
key: key,
|
|
176
|
+
isOpen: true,
|
|
177
|
+
onClose: function () {
|
|
178
|
+
var _a, _b;
|
|
179
|
+
removeModal(key);
|
|
180
|
+
(_b = (_a = modal.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
181
|
+
}
|
|
182
|
+
}), document.querySelector('#reqore-portal'))) : ((0, react_1.createElement)(__1.ReqoreModal, __assign({}, modal, { key: key, isOpen: true, onClose: function () {
|
|
183
|
+
var _a;
|
|
184
|
+
removeModal(key);
|
|
185
|
+
(_a = modal.onClose) === null || _a === void 0 ? void 0 : _a.call(modal);
|
|
186
|
+
} })));
|
|
187
|
+
})] })) })) }));
|
|
131
188
|
};
|
|
132
189
|
exports["default"] = ReqoreProvider;
|
|
133
190
|
//# sourceMappingURL=ReqoreProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReqoreProvider.js","sourceRoot":"","sources":["../../src/containers/ReqoreProvider.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReqoreProvider.js","sourceRoot":"","sources":["../../src/containers/ReqoreProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,6CAA6D;AAC7D,uCAAyC;AACzC,uCAAqC;AACrC,oDAA8B;AAC9B,6DAAkD;AAClD,wBAAmD;AAEnD,8EAAqE;AACrE,0FAEkD;AAElD,2EAAqD;AACrD,yEAAmD;AAEnD,sEAAgD;AAoChD,IAAM,cAAc,GAAmC,UAAC,EAA0B;QAAxB,QAAQ,cAAA,EAAE,eAAY,EAAZ,OAAO,mBAAG,EAAE,KAAA;IACxE,IAAA,KAAoC,IAAA,gBAAQ,EAAmC,EAAE,CAAC,EAAjF,aAAa,QAAA,EAAE,gBAAgB,QAAkD,CAAC;IACnF,IAAA,KAAsB,IAAA,gBAAQ,EAAgB,EAAE,CAAC,EAAhD,MAAM,QAAA,EAAE,SAAS,QAA+B,CAAC;IAClD,IAAA,KAA4C,IAAA,gBAAQ,EAA2B,EAAE,CAAC,EAAjF,iBAAiB,QAAA,EAAE,oBAAoB,QAA0C,CAAC;IACzF,IAAM,KAAK,GAAiB,IAAA,iCAAU,EAAe,yBAAY,CAAC,CAAC;IACnE,IAAM,YAAY,GAAG,IAAA,cAAM,EAAS,IAAI,CAAC,CAAC;IAE1C,IAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAA,oBAAQ,EAAC,oBAAoB,CA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5B,IAAA,wBAAY,EACV,kBAAK,CAAC,YAAY,CAAC,KAAK,EAAE;4BACxB,GAAG,KAAA;4BACH,MAAM,EAAE,IAAI;4BACZ,OAAO,EAAE;;gCACP,WAAW,CAAC,GAAG,CAAC,CAAC;gCACjB,MAAA,MAAA,KAAK,CAAC,KAAK,EAAC,OAAO,kDAAI,CAAC;4BAC1B,CAAC;yBACF,CAAC,EACF,QAAQ,CAAC,aAAa,CAAC,gBAAgB,CAAE,CAC1C,CACF,CAAC,CAAC,CAAC,CACF,2BAAC,eAAW,eACN,KAAK,IACT,GAAG,EAAE,GAAG,EACR,MAAM,QACN,OAAO,EAAE;;gCACP,WAAW,CAAC,GAAG,CAAC,CAAC;gCACjB,MAAA,KAAK,CAAC,OAAO,qDAAI,CAAC;4BACpB,CAAC,IACD,CACH;oBAtBD,CAsBC,CACF,KACe,IACK,GACxB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIProvider.d.ts","sourceRoot":"","sources":["../../src/containers/UIProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAiB,YAAY,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"UIProvider.d.ts","sourceRoot":"","sources":["../../src/containers/UIProvider.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAGpD,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAiB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAMjE,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qBAAqB,CAAC,EAAE,4BAA4B,CAAC;IACrD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE;QACX,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT;;;;aAIK;QACL,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AACD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9B,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAwCD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAoBtD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -51,7 +51,6 @@ var Layout_1 = __importDefault(require("../components/Layout"));
|
|
|
51
51
|
var theme_1 = require("../constants/theme");
|
|
52
52
|
var ThemeContext_1 = __importDefault(require("../context/ThemeContext"));
|
|
53
53
|
var colors_1 = require("../helpers/colors");
|
|
54
|
-
var PopoverProvider_1 = __importDefault(require("./PopoverProvider"));
|
|
55
54
|
var ReqoreProvider_1 = __importDefault(require("./ReqoreProvider"));
|
|
56
55
|
var ThemeProvider_1 = __importDefault(require("./ThemeProvider"));
|
|
57
56
|
var GlobalStyle = (0, styled_components_1.createGlobalStyle)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .reqore-blur-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 999998;\n cursor: pointer;\n background-color: ", ";\n backdrop-filter: blur(3px);\n }\n\n .reqore-blur-z-index {\n z-index: 999999;\n }\n"], ["\n .reqore-blur-wrapper {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 999998;\n cursor: pointer;\n background-color: ", ";\n backdrop-filter: blur(3px);\n }\n\n .reqore-blur-z-index {\n z-index: 999999;\n }\n"])), function (_a) {
|
|
@@ -71,7 +70,7 @@ var ReqoreUIProvider = function (_a) {
|
|
|
71
70
|
var _theme = (0, lodash_1.cloneDeep)(theme || {});
|
|
72
71
|
var _defaultTheme = (0, lodash_1.cloneDeep)(theme_1.DEFAULT_THEME);
|
|
73
72
|
var rebuiltTheme = (0, colors_1.buildTheme)((0, merge_1["default"])(_defaultTheme, _theme));
|
|
74
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(ThemeContext_1["default"].Provider, __assign({ value: __assign({}, rebuiltTheme) }, { children: [(0, jsx_runtime_1.jsx)(ThemeProvider_1["default"], { children: (0, jsx_runtime_1.jsx)(GlobalStyle, {}) }), (0, jsx_runtime_1.jsx)(Layout_1["default"], __assign({ withSidebar: options === null || options === void 0 ? void 0 : options.withSidebar }, { children: modalPortal ? (
|
|
73
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(ThemeContext_1["default"].Provider, __assign({ value: __assign({}, rebuiltTheme) }, { children: [(0, jsx_runtime_1.jsx)(ThemeProvider_1["default"], { children: (0, jsx_runtime_1.jsx)(GlobalStyle, {}) }), (0, jsx_runtime_1.jsx)(Layout_1["default"], __assign({ withSidebar: options === null || options === void 0 ? void 0 : options.withSidebar }, { children: modalPortal ? (0, jsx_runtime_1.jsx)(ReqoreProvider_1["default"], __assign({ options: options }, { children: children })) : null })), (0, jsx_runtime_1.jsx)(ReqorePortal, { ref: setModalPortal })] })) }));
|
|
75
74
|
};
|
|
76
75
|
exports["default"] = ReqoreUIProvider;
|
|
77
76
|
var templateObject_1, templateObject_2, templateObject_3;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIProvider.js","sourceRoot":"","sources":["../../src/containers/UIProvider.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,uDAAiC;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EAAnD,WAAW,QAAA,EAAE,cAAc,QAAwB,CAAC;IAE3D,IAAM,MAAM,GAA0B,IAAA,kBAAS,EAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC7D,IAAM,aAAa,GAAiB,IAAA,kBAAS,EAAC,qBAAa,CAAC,CAAC;IAC7D,IAAM,YAAY,GAAiB,IAAA,mBAAU,EAAC,IAAA,kBAAK,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC,CAAC;IAE5E,OAAO,CACL,2DACE,wBAAC,yBAAY,CAAC,QAAQ,aAAC,KAAK,eAAO,YAAY,kBAC7C,uBAAC,0BAAmB,cAClB,uBAAC,WAAW,KAAG,GACK,EACtB,uBAAC,mBAAmB,aAAC,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,gBACnD,WAAW,CAAC,CAAC,CAAC,uBAAC,2BAAc,aAAC,OAAO,EAAE,OAAO,gBAAG,QAAQ,IAAkB,CAAC,CAAC,CAAC,IAAI,IAC/D,EACtB,uBAAC,YAAY,IAAC,GAAG,EAAE,cAAc,GAAI,KACf,GACvB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAe,gBAAgB,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { IReqoreTheme } from '../constants/theme';
|
|
2
|
-
import { IReqoreConfirmationModal, IReqoreNotificationData } from '../containers/ReqoreProvider';
|
|
2
|
+
import { IReqoreConfirmationModal, IReqoreModalFromProps, IReqoreNotificationData, TReqoreCustomModal } from '../containers/ReqoreProvider';
|
|
3
3
|
import { IReqoreOptions } from '../containers/UIProvider';
|
|
4
4
|
export interface IReqoreContext {
|
|
5
5
|
readonly confirmAction: (data: IReqoreConfirmationModal) => void;
|
|
6
6
|
readonly notifications?: IReqoreNotificationData[] | null;
|
|
7
7
|
readonly addNotification?: (data: IReqoreNotificationData) => any;
|
|
8
|
+
readonly addModal?: (modal: IReqoreModalFromProps | TReqoreCustomModal, id?: string) => string;
|
|
9
|
+
readonly removeModal?: (id: string) => void;
|
|
8
10
|
readonly removeNotification?: (id: string) => any;
|
|
9
11
|
readonly isMobile?: boolean;
|
|
10
12
|
readonly isTablet?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReqoreContext.d.ts","sourceRoot":"","sources":["../../src/context/ReqoreContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"ReqoreContext.d.ts","sourceRoot":"","sources":["../../src/context/ReqoreContext.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,wBAAwB,KAAK,IAAI,CAAC;IACjE,QAAQ,CAAC,aAAa,CAAC,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAC;IAC1D,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,GAAG,CAAC;IAClE,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,GAAG,kBAAkB,EAAE,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/F,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,GAAG,CAAC;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,MAAM,CAAC;IAC7C,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAC;IAC/C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,KAAK,EAAE,YAAY,CAAC;CACrB;;AAED,wBAaG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReqoreContext.js","sourceRoot":"","sources":["../../src/context/ReqoreContext.tsx"],"names":[],"mappings":";;AAAA,6DAAqD;AACrD,4CAAiE;
|
|
1
|
+
{"version":3,"file":"ReqoreContext.js","sourceRoot":"","sources":["../../src/context/ReqoreContext.tsx"],"names":[],"mappings":";;AAAA,6DAAqD;AACrD,4CAAiE;AA2BjE,qBAAe,IAAA,oCAAa,EAAiB;IAC3C,aAAa,EAAE,IAAI;IACnB,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,IAAI;IACxB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE;QACV,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,IAAI;KACd;IACD,uBAAuB,EAAE,IAAI;IAC7B,KAAK,EAAE,qBAAa;CACrB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ import styled, { css } from 'styled-components';
|
|
|
6
6
|
import { changeDarkness, getMainBackgroundColor } from '../../helpers/colors';
|
|
7
7
|
import { useReqoreProperty } from '../../hooks/useReqoreContext';
|
|
8
8
|
import { useReqoreTheme } from '../../hooks/useTheme';
|
|
9
|
-
import {
|
|
9
|
+
import { ReqoreBackdrop } from '../Drawer/backdrop';
|
|
10
10
|
import {
|
|
11
11
|
IReqorePanelAction,
|
|
12
12
|
IReqorePanelBottomAction,
|
|
@@ -150,7 +150,7 @@ export const ReqoreCollectionItem = ({
|
|
|
150
150
|
);
|
|
151
151
|
|
|
152
152
|
const renderContent = () => {
|
|
153
|
-
const handleItemClick = (event) => {
|
|
153
|
+
const handleItemClick = (event?: any) => {
|
|
154
154
|
if (expandable) {
|
|
155
155
|
if (isSelected) {
|
|
156
156
|
setDimensions(originalDimensions.current);
|
|
@@ -194,11 +194,10 @@ export const ReqoreCollectionItem = ({
|
|
|
194
194
|
{position && (
|
|
195
195
|
<>
|
|
196
196
|
<div style={{ ...originalDimensions.current }} />
|
|
197
|
-
<
|
|
197
|
+
<ReqoreBackdrop
|
|
198
198
|
zIndex={getAndIncreaseZIndex()}
|
|
199
199
|
blur={5}
|
|
200
|
-
|
|
201
|
-
onClick={handleItemClick}
|
|
200
|
+
onClose={() => handleItemClick()}
|
|
202
201
|
/>
|
|
203
202
|
</>
|
|
204
203
|
)}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { animated } from '@react-spring/web';
|
|
2
|
+
import { rgba } from 'polished';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { IReqoreDrawerStyle } from '.';
|
|
6
|
+
import { getMainBackgroundColor } from '../../helpers/colors';
|
|
7
|
+
|
|
8
|
+
export interface IReqoreBackdropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
blur?: number;
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
opacity?: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const StyledBackdrop = styled(animated.div)<
|
|
16
|
+
IReqoreDrawerStyle & { closable: boolean; zIndex?: number }
|
|
17
|
+
>`
|
|
18
|
+
position: fixed;
|
|
19
|
+
top: 0;
|
|
20
|
+
bottom: 0;
|
|
21
|
+
right: 0;
|
|
22
|
+
left: 0;
|
|
23
|
+
backdrop-filter: ${({ blur }) => (blur ? `blur(${blur}px)` : undefined)};
|
|
24
|
+
z-index: ${({ zIndex }) => zIndex};
|
|
25
|
+
background-color: ${({ theme }) => rgba(getMainBackgroundColor(theme), 0.3)};
|
|
26
|
+
cursor: ${({ closable }) => (closable ? 'pointer' : 'initial')};
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
export const ReqoreBackdrop = memo(
|
|
30
|
+
({ onClose, zIndex, blur, opacity, ...rest }: IReqoreBackdropProps) => (
|
|
31
|
+
<StyledBackdrop
|
|
32
|
+
{...rest}
|
|
33
|
+
className={`${rest.className || ''} reqore-drawer-backdrop`}
|
|
34
|
+
onClick={() => onClose?.()}
|
|
35
|
+
closable={!!onClose}
|
|
36
|
+
zIndex={zIndex}
|
|
37
|
+
blur={blur}
|
|
38
|
+
style={{
|
|
39
|
+
opacity,
|
|
40
|
+
}}
|
|
41
|
+
/>
|
|
42
|
+
)
|
|
43
|
+
);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { animated, useTransition } from '@react-spring/web';
|
|
2
|
-
import { rgba } from 'polished';
|
|
3
2
|
import { Resizable } from 're-resizable';
|
|
4
3
|
import { useEffect, useMemo, useState } from 'react';
|
|
5
4
|
import { createPortal } from 'react-dom';
|
|
@@ -8,12 +7,12 @@ import { useReqoreProperty } from '../..';
|
|
|
8
7
|
import { SPRING_CONFIG, SPRING_CONFIG_NO_ANIMATIONS } from '../../constants/animations';
|
|
9
8
|
import { IReqoreTheme } from '../../constants/theme';
|
|
10
9
|
import ReqoreThemeProvider from '../../containers/ThemeProvider';
|
|
11
|
-
import { getMainBackgroundColor } from '../../helpers/colors';
|
|
12
10
|
import useLatestZIndex from '../../hooks/useLatestZIndex';
|
|
13
11
|
import { useReqoreTheme } from '../../hooks/useTheme';
|
|
14
12
|
import { IReqoreIconName } from '../../types/icons';
|
|
15
13
|
import ReqoreButton from '../Button';
|
|
16
14
|
import { IReqorePanelAction, IReqorePanelProps, ReqorePanel } from '../Panel';
|
|
15
|
+
import { ReqoreBackdrop } from './backdrop';
|
|
17
16
|
|
|
18
17
|
export type TPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
19
18
|
|
|
@@ -97,20 +96,6 @@ export const StyledCloseWrapper = styled.div<IReqoreDrawerStyle>`
|
|
|
97
96
|
|
|
98
97
|
export const StyledDrawerResizable = styled(animated.div)``;
|
|
99
98
|
|
|
100
|
-
export const StyledBackdrop = styled(animated.div)<
|
|
101
|
-
IReqoreDrawerStyle & { closable: boolean; zIndex?: number }
|
|
102
|
-
>`
|
|
103
|
-
position: fixed;
|
|
104
|
-
top: 0;
|
|
105
|
-
bottom: 0;
|
|
106
|
-
right: 0;
|
|
107
|
-
left: 0;
|
|
108
|
-
backdrop-filter: ${({ blur }) => (blur ? `blur(${blur}px)` : undefined)};
|
|
109
|
-
z-index: ${({ zIndex }) => zIndex};
|
|
110
|
-
background-color: ${({ theme }) => rgba(getMainBackgroundColor(theme), 0.3)};
|
|
111
|
-
cursor: ${({ closable }) => (closable ? 'pointer' : 'initial')};
|
|
112
|
-
`;
|
|
113
|
-
|
|
114
99
|
/**
|
|
115
100
|
* It returns an icon name based on the position and whether the panel is hidden or not
|
|
116
101
|
* @param {'top' | 'bottom' | 'left' | 'right'} position - The position of the panel.
|
|
@@ -245,15 +230,11 @@ export const ReqoreDrawer: React.FC<IReqoreDrawerProps> = ({
|
|
|
245
230
|
item ? (
|
|
246
231
|
<ReqoreThemeProvider theme={theme}>
|
|
247
232
|
{hasBackdrop && !_isHidden ? (
|
|
248
|
-
<
|
|
249
|
-
|
|
250
|
-
onClick={() => onClose && onClose()}
|
|
251
|
-
closable={!!onClose}
|
|
233
|
+
<ReqoreBackdrop
|
|
234
|
+
onClose={onClose}
|
|
252
235
|
zIndex={zIndex}
|
|
253
236
|
blur={blur}
|
|
254
|
-
|
|
255
|
-
opacity: styles.opacity,
|
|
256
|
-
}}
|
|
237
|
+
opacity={styles.opacity}
|
|
257
238
|
/>
|
|
258
239
|
) : null}
|
|
259
240
|
<Resizable
|
|
@@ -20,6 +20,7 @@ export interface IReqoreNavbarStyle extends IReqoreNavbarProps {
|
|
|
20
20
|
export const StyledNavbar = styled.div<IReqoreNavbarStyle>`
|
|
21
21
|
${({ theme, type }: IReqoreNavbarStyle) => css`
|
|
22
22
|
height: 50px;
|
|
23
|
+
flex-shrink: 0;
|
|
23
24
|
width: 100%;
|
|
24
25
|
padding: 0 10px;
|
|
25
26
|
color: ${theme[type]?.color ||
|
|
@@ -13,7 +13,7 @@ import useLatestZIndex from '../../hooks/useLatestZIndex';
|
|
|
13
13
|
import { useReqoreTheme } from '../../hooks/useTheme';
|
|
14
14
|
import { ActiveIconScale, InactiveIconScale, ScaleIconOnHover } from '../../styles';
|
|
15
15
|
import { IReqoreIconName } from '../../types/icons';
|
|
16
|
-
import {
|
|
16
|
+
import { ReqoreBackdrop } from '../Drawer/backdrop';
|
|
17
17
|
import ReqoreIcon from '../Icon';
|
|
18
18
|
import SidebarItem from './item';
|
|
19
19
|
|
|
@@ -423,10 +423,9 @@ const ReqoreSidebar: React.FC<IQorusSidebarProps> = ({
|
|
|
423
423
|
return (
|
|
424
424
|
<>
|
|
425
425
|
{floating && hasFloatingBackdrop && isOpen ? (
|
|
426
|
-
<
|
|
426
|
+
<ReqoreBackdrop
|
|
427
427
|
className='reqore-sidebar-backdrop'
|
|
428
|
-
|
|
429
|
-
closable
|
|
428
|
+
onClose={() => onCloseClick?.()}
|
|
430
429
|
zIndex={zIndex}
|
|
431
430
|
/>
|
|
432
431
|
) : null}
|