@driveflux/ui 1.0.13 → 1.1.0
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/bottom-sheet/BottomSheetProvider.d.ts +4 -0
- package/dist/bottom-sheet/BottomSheetProvider.d.ts.map +1 -0
- package/dist/bottom-sheet/BottomSheetProvider.js +190 -0
- package/dist/bottom-sheet/context.d.ts +15 -0
- package/dist/bottom-sheet/context.d.ts.map +1 -0
- package/dist/bottom-sheet/context.js +6 -0
- package/dist/bottom-sheet/index.d.ts +4 -0
- package/dist/bottom-sheet/index.d.ts.map +1 -0
- package/dist/bottom-sheet/index.js +3 -0
- package/dist/bottom-sheet/use-bottom-sheet.d.ts +6 -0
- package/dist/bottom-sheet/use-bottom-sheet.d.ts.map +1 -0
- package/dist/bottom-sheet/use-bottom-sheet.js +5 -0
- package/dist/bottom-sheet/utils.d.ts +2 -0
- package/dist/bottom-sheet/utils.d.ts.map +1 -0
- package/dist/bottom-sheet/utils.js +15 -0
- package/dist/chakra.d.ts.map +1 -1
- package/dist/chakra.js +1 -0
- package/dist/modal/ModalProvider.d.ts.map +1 -1
- package/dist/modal/ModalProvider.js +1 -4
- package/dist/modal/use-enhanced-modal.d.ts.map +1 -1
- package/dist/theme/colors.d.ts.map +1 -1
- package/dist/theme/colors.js +36 -36
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/translations.d.ts.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/accessors.d.ts.map +1 -1
- package/dist/utils/react.d.ts.map +1 -1
- package/package.json +30 -29
- package/.eslintrc.json +0 -3
- package/.swcrc +0 -14
- package/.turbo/turbo-build.log +0 -11
- package/CHANGELOG.md +0 -150
- package/dist/cjs/chakra.js +0 -18
- package/dist/cjs/index.js +0 -20
- package/dist/cjs/modal/ModalProvider.js +0 -255
- package/dist/cjs/modal/components/EnhancedModalCustomWrapper.js +0 -139
- package/dist/cjs/modal/components/EnhancedModalFooter.js +0 -163
- package/dist/cjs/modal/components/MinimalModalContent.js +0 -94
- package/dist/cjs/modal/components/StandardModalContent.js +0 -359
- package/dist/cjs/modal/context.js +0 -20
- package/dist/cjs/modal/index.js +0 -48
- package/dist/cjs/modal/use-enhanced-modal.js +0 -15
- package/dist/cjs/theme/colors.js +0 -147
- package/dist/cjs/theme/index.js +0 -18
- package/dist/cjs/toast/index.js +0 -19
- package/dist/cjs/toast/use-toast-result.js +0 -210
- package/dist/cjs/translations.js +0 -42
- package/dist/cjs/types.js +0 -4
- package/dist/cjs/utils/accessors.js +0 -65
- package/dist/cjs/utils/index.js +0 -19
- package/dist/cjs/utils/react.js +0 -56
- package/dist/index.js +0 -3
- package/index.cjs +0 -1
- package/index.d.ts +0 -1
- package/modal.cjs +0 -1
- package/modal.d.ts +0 -1
- package/src/chakra.ts +0 -2
- package/src/index.ts +0 -4
- package/src/modal/ModalProvider.tsx +0 -143
- package/src/modal/components/EnhancedModalCustomWrapper.tsx +0 -39
- package/src/modal/components/EnhancedModalFooter.tsx +0 -51
- package/src/modal/components/MinimalModalContent.tsx +0 -24
- package/src/modal/components/StandardModalContent.tsx +0 -65
- package/src/modal/context.tsx +0 -81
- package/src/modal/index.ts +0 -7
- package/src/modal/use-enhanced-modal.ts +0 -7
- package/src/theme/colors.ts +0 -179
- package/src/theme/index.ts +0 -1
- package/src/toast/index.ts +0 -3
- package/src/toast/use-toast-result.tsx +0 -168
- package/src/translations.ts +0 -25
- package/src/types.ts +0 -22
- package/src/utils/accessors.ts +0 -64
- package/src/utils/index.ts +0 -2
- package/src/utils/react.ts +0 -35
- package/theme.cjs +0 -1
- package/theme.d.ts +0 -1
- package/toast.cjs +0 -1
- package/toast.d.ts +0 -1
- package/translations.cjs +0 -1
- package/translations.d.ts +0 -1
- package/tsconfig.json +0 -14
- package/tsconfig.tsbuildinfo +0 -1
- package/utils.cjs +0 -1
- package/utils.d.ts +0 -1
package/CHANGELOG.md
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
# @driveflux/ui
|
|
2
|
-
|
|
3
|
-
## 1.0.13
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- Minor adjustments for deps
|
|
8
|
-
- Upgraded packages
|
|
9
|
-
- Updated dependencies
|
|
10
|
-
- Updated dependencies
|
|
11
|
-
- @driveflux/singleton@1.0.5
|
|
12
|
-
- @driveflux/icons@1.0.10
|
|
13
|
-
|
|
14
|
-
## 1.0.12
|
|
15
|
-
|
|
16
|
-
### Patch Changes
|
|
17
|
-
|
|
18
|
-
- Minor updates on build
|
|
19
|
-
- Updated dependencies
|
|
20
|
-
- @driveflux/singleton@1.0.4
|
|
21
|
-
- @driveflux/icons@1.0.9
|
|
22
|
-
|
|
23
|
-
## 1.0.11
|
|
24
|
-
|
|
25
|
-
### Patch Changes
|
|
26
|
-
|
|
27
|
-
- Upgraded all packages
|
|
28
|
-
- Updated dependencies
|
|
29
|
-
- @driveflux/singleton@1.0.3
|
|
30
|
-
- @driveflux/icons@1.0.8
|
|
31
|
-
|
|
32
|
-
## 1.0.10
|
|
33
|
-
|
|
34
|
-
### Patch Changes
|
|
35
|
-
|
|
36
|
-
- Updates
|
|
37
|
-
|
|
38
|
-
## 1.0.9
|
|
39
|
-
|
|
40
|
-
### Patch Changes
|
|
41
|
-
|
|
42
|
-
- Improved toast and hero
|
|
43
|
-
|
|
44
|
-
## 1.0.8
|
|
45
|
-
|
|
46
|
-
### Patch Changes
|
|
47
|
-
|
|
48
|
-
- Upgraded packages again
|
|
49
|
-
- Updated dependencies
|
|
50
|
-
- @driveflux/singleton@1.0.2
|
|
51
|
-
- @driveflux/icons@1.0.7
|
|
52
|
-
|
|
53
|
-
## 1.0.7
|
|
54
|
-
|
|
55
|
-
### Patch Changes
|
|
56
|
-
|
|
57
|
-
- Upgraded packages
|
|
58
|
-
- Updated dependencies
|
|
59
|
-
- @driveflux/singleton@1.0.1
|
|
60
|
-
- @driveflux/icons@1.0.6
|
|
61
|
-
|
|
62
|
-
## 1.0.6
|
|
63
|
-
|
|
64
|
-
### Patch Changes
|
|
65
|
-
|
|
66
|
-
- Date fns and other bug fixes
|
|
67
|
-
- Updated dependencies
|
|
68
|
-
- @driveflux/icons@1.0.5
|
|
69
|
-
|
|
70
|
-
## 1.0.5
|
|
71
|
-
|
|
72
|
-
### Patch Changes
|
|
73
|
-
|
|
74
|
-
- Version upgrade
|
|
75
|
-
- Updated dependencies
|
|
76
|
-
- @driveflux/icons@1.0.4
|
|
77
|
-
|
|
78
|
-
## 1.0.4
|
|
79
|
-
|
|
80
|
-
### Patch Changes
|
|
81
|
-
|
|
82
|
-
- Reverted SWC core version
|
|
83
|
-
- Updated dependencies
|
|
84
|
-
- @driveflux/icons@1.0.3
|
|
85
|
-
|
|
86
|
-
## 1.0.3
|
|
87
|
-
|
|
88
|
-
### Patch Changes
|
|
89
|
-
|
|
90
|
-
- Updated dependencies
|
|
91
|
-
- Updated dependencies
|
|
92
|
-
- @driveflux/icons@1.0.2
|
|
93
|
-
|
|
94
|
-
## 1.0.2
|
|
95
|
-
|
|
96
|
-
### Patch Changes
|
|
97
|
-
|
|
98
|
-
- Fixed imports and bugs
|
|
99
|
-
|
|
100
|
-
## 1.0.1
|
|
101
|
-
|
|
102
|
-
### Patch Changes
|
|
103
|
-
|
|
104
|
-
- Bump versions
|
|
105
|
-
- Updated dependencies
|
|
106
|
-
- @driveflux/icons@1.0.1
|
|
107
|
-
|
|
108
|
-
## 1.0.0
|
|
109
|
-
|
|
110
|
-
### Major Changes
|
|
111
|
-
|
|
112
|
-
- 4.5 pre-release
|
|
113
|
-
|
|
114
|
-
### Patch Changes
|
|
115
|
-
|
|
116
|
-
- verion bump + minor improvements
|
|
117
|
-
- Bump all versions
|
|
118
|
-
- Version bump
|
|
119
|
-
- Updated dependencies
|
|
120
|
-
- Updated dependencies
|
|
121
|
-
- Updated dependencies
|
|
122
|
-
- Updated dependencies
|
|
123
|
-
- @driveflux/icons@1.0.0
|
|
124
|
-
|
|
125
|
-
## 1.0.0-next.2
|
|
126
|
-
|
|
127
|
-
### Patch Changes
|
|
128
|
-
|
|
129
|
-
- Version bump
|
|
130
|
-
- Updated dependencies
|
|
131
|
-
- @driveflux/icons@1.0.0-next.2
|
|
132
|
-
|
|
133
|
-
## 1.0.0-next.1
|
|
134
|
-
|
|
135
|
-
### Patch Changes
|
|
136
|
-
|
|
137
|
-
- verion bump + minor improvements
|
|
138
|
-
- Updated dependencies
|
|
139
|
-
- @driveflux/icons@1.0.0-next.1
|
|
140
|
-
|
|
141
|
-
## 1.0.0-next.0
|
|
142
|
-
|
|
143
|
-
### Major Changes
|
|
144
|
-
|
|
145
|
-
- 4.5 pre-release
|
|
146
|
-
|
|
147
|
-
### Patch Changes
|
|
148
|
-
|
|
149
|
-
- Updated dependencies
|
|
150
|
-
- @driveflux/icons@1.0.0-next.0
|
package/dist/cjs/chakra.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
_export_star(require("@chakra-ui/react"), exports);
|
|
6
|
-
function _export_star(from, to) {
|
|
7
|
-
Object.keys(from).forEach(function(k) {
|
|
8
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
9
|
-
Object.defineProperty(to, k, {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function() {
|
|
12
|
-
return from[k];
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
return from;
|
|
18
|
-
}
|
package/dist/cjs/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// TODO check if is an error or not
|
|
2
|
-
// Turbopack has a bug that's not allowing export * from './chakra.js' to work
|
|
3
|
-
"use strict";
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
_export_star(require("./chakra.js"), exports);
|
|
8
|
-
function _export_star(from, to) {
|
|
9
|
-
Object.keys(from).forEach(function(k) {
|
|
10
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
11
|
-
Object.defineProperty(to, k, {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: function() {
|
|
14
|
-
return from[k];
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
return from;
|
|
20
|
-
}
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _jsxruntime = require("react/jsx-runtime");
|
|
12
|
-
var _isEmpty = /*#__PURE__*/ _interop_require_default(require("lodash/isEmpty.js"));
|
|
13
|
-
var _react = require("react");
|
|
14
|
-
var _chakra = require("../chakra.js");
|
|
15
|
-
var _react1 = require("../utils/react.js");
|
|
16
|
-
var _MinimalModalContent = /*#__PURE__*/ _interop_require_default(require("./components/MinimalModalContent.js"));
|
|
17
|
-
var _StandardModalContent = /*#__PURE__*/ _interop_require_default(require("./components/StandardModalContent.js"));
|
|
18
|
-
var _context = require("./context.js");
|
|
19
|
-
function _array_like_to_array(arr, len) {
|
|
20
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
21
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
22
|
-
return arr2;
|
|
23
|
-
}
|
|
24
|
-
function _array_with_holes(arr) {
|
|
25
|
-
if (Array.isArray(arr)) return arr;
|
|
26
|
-
}
|
|
27
|
-
function _define_property(obj, key, value) {
|
|
28
|
-
if (key in obj) {
|
|
29
|
-
Object.defineProperty(obj, key, {
|
|
30
|
-
value: value,
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true,
|
|
33
|
-
writable: true
|
|
34
|
-
});
|
|
35
|
-
} else {
|
|
36
|
-
obj[key] = value;
|
|
37
|
-
}
|
|
38
|
-
return obj;
|
|
39
|
-
}
|
|
40
|
-
function _interop_require_default(obj) {
|
|
41
|
-
return obj && obj.__esModule ? obj : {
|
|
42
|
-
default: obj
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function _iterable_to_array_limit(arr, i) {
|
|
46
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
47
|
-
if (_i == null) return;
|
|
48
|
-
var _arr = [];
|
|
49
|
-
var _n = true;
|
|
50
|
-
var _d = false;
|
|
51
|
-
var _s, _e;
|
|
52
|
-
try {
|
|
53
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
54
|
-
_arr.push(_s.value);
|
|
55
|
-
if (i && _arr.length === i) break;
|
|
56
|
-
}
|
|
57
|
-
} catch (err) {
|
|
58
|
-
_d = true;
|
|
59
|
-
_e = err;
|
|
60
|
-
} finally{
|
|
61
|
-
try {
|
|
62
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
63
|
-
} finally{
|
|
64
|
-
if (_d) throw _e;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return _arr;
|
|
68
|
-
}
|
|
69
|
-
function _non_iterable_rest() {
|
|
70
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
71
|
-
}
|
|
72
|
-
function _object_spread(target) {
|
|
73
|
-
for(var i = 1; i < arguments.length; i++){
|
|
74
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
75
|
-
var ownKeys = Object.keys(source);
|
|
76
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
77
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
78
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
81
|
-
ownKeys.forEach(function(key) {
|
|
82
|
-
_define_property(target, key, source[key]);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
return target;
|
|
86
|
-
}
|
|
87
|
-
function ownKeys(object, enumerableOnly) {
|
|
88
|
-
var keys = Object.keys(object);
|
|
89
|
-
if (Object.getOwnPropertySymbols) {
|
|
90
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
91
|
-
if (enumerableOnly) {
|
|
92
|
-
symbols = symbols.filter(function(sym) {
|
|
93
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
keys.push.apply(keys, symbols);
|
|
97
|
-
}
|
|
98
|
-
return keys;
|
|
99
|
-
}
|
|
100
|
-
function _object_spread_props(target, source) {
|
|
101
|
-
source = source != null ? source : {};
|
|
102
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
103
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
104
|
-
} else {
|
|
105
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
106
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
return target;
|
|
110
|
-
}
|
|
111
|
-
function _sliced_to_array(arr, i) {
|
|
112
|
-
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
113
|
-
}
|
|
114
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
115
|
-
if (!o) return;
|
|
116
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
117
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
118
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
119
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
120
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
121
|
-
}
|
|
122
|
-
var getModalComponent = function(modalContentConfig, controls) {
|
|
123
|
-
var otherProps = modalContentConfig.contentProps || {};
|
|
124
|
-
switch(modalContentConfig.type){
|
|
125
|
-
case 'standard':
|
|
126
|
-
{
|
|
127
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_StandardModalContent.default, _object_spread({
|
|
128
|
-
controls: controls,
|
|
129
|
-
modalContentConfig: modalContentConfig
|
|
130
|
-
}, otherProps));
|
|
131
|
-
}
|
|
132
|
-
case 'minimal':
|
|
133
|
-
{
|
|
134
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_MinimalModalContent.default, _object_spread({
|
|
135
|
-
controls: controls,
|
|
136
|
-
modalContentConfig: modalContentConfig
|
|
137
|
-
}, otherProps));
|
|
138
|
-
}
|
|
139
|
-
case 'custom':
|
|
140
|
-
return (0, _react1.isReactNode)(modalContentConfig.content) ? modalContentConfig.content : /*#__PURE__*/ (0, _jsxruntime.jsx)(modalContentConfig.content, _object_spread({
|
|
141
|
-
open: open,
|
|
142
|
-
close: close
|
|
143
|
-
}, otherProps));
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
var isModalOpenOptions = function(options) {
|
|
147
|
-
return (options === null || options === void 0 ? void 0 : options.modalContentConfig) !== undefined;
|
|
148
|
-
};
|
|
149
|
-
var ModalProvider = function(param) {
|
|
150
|
-
var children = param.children;
|
|
151
|
-
var _useDisclosure = (0, _chakra.useDisclosure)(), isOpen = _useDisclosure.isOpen, onCloseRaw = _useDisclosure.onClose, onOpenRaw = _useDisclosure.onOpen;
|
|
152
|
-
var _useState = _sliced_to_array((0, _react.useState)(), 2), modalContentConfig = _useState[0], setModalContentConfig = _useState[1];
|
|
153
|
-
var _useState1 = _sliced_to_array((0, _react.useState)(), 2), modalOptions = _useState1[0], setModalOptions = _useState1[1];
|
|
154
|
-
var _useState2 = _sliced_to_array((0, _react.useState)(), 2), modalState = _useState2[0], setModalState = _useState2[1];
|
|
155
|
-
var onClose = (0, _react.useCallback)(function(options) {
|
|
156
|
-
onCloseRaw();
|
|
157
|
-
if (modalOptions === null || modalOptions === void 0 ? void 0 : modalOptions.onClose) {
|
|
158
|
-
modalOptions.onClose();
|
|
159
|
-
}
|
|
160
|
-
if (!(options === null || options === void 0 ? void 0 : options.keepModalContentConfig)) {
|
|
161
|
-
setModalContentConfig(undefined);
|
|
162
|
-
setModalOptions(undefined);
|
|
163
|
-
setModalState(undefined);
|
|
164
|
-
}
|
|
165
|
-
}, [
|
|
166
|
-
modalOptions
|
|
167
|
-
]);
|
|
168
|
-
var onOpen = (0, _react.useCallback)(function(modalContentConfigOrOptions) {
|
|
169
|
-
var newModalContentConfig;
|
|
170
|
-
var newModalSate;
|
|
171
|
-
var newModalOptions;
|
|
172
|
-
// Here, we know we're passing the global options object
|
|
173
|
-
if (isModalOpenOptions(modalContentConfigOrOptions)) {
|
|
174
|
-
newModalContentConfig = modalContentConfigOrOptions.modalContentConfig;
|
|
175
|
-
newModalSate = modalContentConfigOrOptions.modalContentConfig.initialModalState;
|
|
176
|
-
newModalOptions = modalContentConfigOrOptions;
|
|
177
|
-
} else if (modalContentConfigOrOptions) {
|
|
178
|
-
newModalContentConfig = modalContentConfigOrOptions;
|
|
179
|
-
newModalSate = undefined;
|
|
180
|
-
newModalOptions = undefined;
|
|
181
|
-
}
|
|
182
|
-
setModalContentConfig(function(oldModalContentConfig) {
|
|
183
|
-
var modalContentConfig = newModalContentConfig || oldModalContentConfig;
|
|
184
|
-
if (modalContentConfig) {
|
|
185
|
-
onOpenRaw();
|
|
186
|
-
}
|
|
187
|
-
return modalContentConfig;
|
|
188
|
-
});
|
|
189
|
-
setModalState(newModalSate);
|
|
190
|
-
setModalOptions(newModalOptions);
|
|
191
|
-
}, []);
|
|
192
|
-
var update = (0, _react.useCallback)(function(updateOptions) {
|
|
193
|
-
if (!updateOptions || (0, _isEmpty.default)(updateOptions)) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
setModalContentConfig(function(oldModalContentConfig) {
|
|
197
|
-
if (!oldModalContentConfig) {
|
|
198
|
-
return oldModalContentConfig;
|
|
199
|
-
}
|
|
200
|
-
return _object_spread_props(_object_spread({}, oldModalContentConfig, updateOptions.modalContentConfig), {
|
|
201
|
-
contentProps: _object_spread({}, updateOptions.contentProps, oldModalContentConfig.contentProps)
|
|
202
|
-
});
|
|
203
|
-
});
|
|
204
|
-
}, []);
|
|
205
|
-
var state = (0, _react.useMemo)(function() {
|
|
206
|
-
return {
|
|
207
|
-
isOpen: isOpen,
|
|
208
|
-
// TODO
|
|
209
|
-
// @ts-expect-error
|
|
210
|
-
open: onOpen,
|
|
211
|
-
close: onClose,
|
|
212
|
-
update: update,
|
|
213
|
-
modalState: modalState,
|
|
214
|
-
setModalState: setModalState
|
|
215
|
-
};
|
|
216
|
-
}, [
|
|
217
|
-
onOpen,
|
|
218
|
-
onClose,
|
|
219
|
-
update,
|
|
220
|
-
modalState,
|
|
221
|
-
setModalState,
|
|
222
|
-
isOpen
|
|
223
|
-
]);
|
|
224
|
-
var content = (0, _react.useMemo)(function() {
|
|
225
|
-
return modalContentConfig && getModalComponent(modalContentConfig, state);
|
|
226
|
-
}, [
|
|
227
|
-
modalContentConfig
|
|
228
|
-
]);
|
|
229
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_context.ModalContext.Provider, {
|
|
230
|
-
value: state,
|
|
231
|
-
children: [
|
|
232
|
-
children,
|
|
233
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_chakra.Modal, {
|
|
234
|
-
scrollBehavior: 'inside',
|
|
235
|
-
isCentered: true,
|
|
236
|
-
blockScrollOnMount: true,
|
|
237
|
-
closeOnOverlayClick: true,
|
|
238
|
-
size: (modalContentConfig === null || modalContentConfig === void 0 ? void 0 : modalContentConfig.size) || {
|
|
239
|
-
base: 'full',
|
|
240
|
-
md: '3xl'
|
|
241
|
-
},
|
|
242
|
-
isOpen: isOpen,
|
|
243
|
-
onClose: onClose,
|
|
244
|
-
children: [
|
|
245
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_chakra.ModalOverlay, {}),
|
|
246
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_chakra.ModalContent, {
|
|
247
|
-
borderRadius: 0,
|
|
248
|
-
children: content
|
|
249
|
-
})
|
|
250
|
-
]
|
|
251
|
-
})
|
|
252
|
-
]
|
|
253
|
-
});
|
|
254
|
-
};
|
|
255
|
-
var _default = ModalProvider;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "default", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _default;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
var _jsxruntime = require("react/jsx-runtime");
|
|
12
|
-
var _IconClose = /*#__PURE__*/ _interop_require_default(require("@driveflux/icons/icons/IconClose"));
|
|
13
|
-
var _chakra = require("../../chakra.js");
|
|
14
|
-
var _useenhancedmodal = require("../use-enhanced-modal.js");
|
|
15
|
-
function _define_property(obj, key, value) {
|
|
16
|
-
if (key in obj) {
|
|
17
|
-
Object.defineProperty(obj, key, {
|
|
18
|
-
value: value,
|
|
19
|
-
enumerable: true,
|
|
20
|
-
configurable: true,
|
|
21
|
-
writable: true
|
|
22
|
-
});
|
|
23
|
-
} else {
|
|
24
|
-
obj[key] = value;
|
|
25
|
-
}
|
|
26
|
-
return obj;
|
|
27
|
-
}
|
|
28
|
-
function _interop_require_default(obj) {
|
|
29
|
-
return obj && obj.__esModule ? obj : {
|
|
30
|
-
default: obj
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function _object_spread(target) {
|
|
34
|
-
for(var i = 1; i < arguments.length; i++){
|
|
35
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
36
|
-
var ownKeys = Object.keys(source);
|
|
37
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
38
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
39
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
40
|
-
}));
|
|
41
|
-
}
|
|
42
|
-
ownKeys.forEach(function(key) {
|
|
43
|
-
_define_property(target, key, source[key]);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return target;
|
|
47
|
-
}
|
|
48
|
-
function ownKeys(object, enumerableOnly) {
|
|
49
|
-
var keys = Object.keys(object);
|
|
50
|
-
if (Object.getOwnPropertySymbols) {
|
|
51
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
52
|
-
if (enumerableOnly) {
|
|
53
|
-
symbols = symbols.filter(function(sym) {
|
|
54
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
keys.push.apply(keys, symbols);
|
|
58
|
-
}
|
|
59
|
-
return keys;
|
|
60
|
-
}
|
|
61
|
-
function _object_spread_props(target, source) {
|
|
62
|
-
source = source != null ? source : {};
|
|
63
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
64
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
65
|
-
} else {
|
|
66
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
67
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return target;
|
|
71
|
-
}
|
|
72
|
-
function _object_without_properties(source, excluded) {
|
|
73
|
-
if (source == null) return {};
|
|
74
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
75
|
-
var key, i;
|
|
76
|
-
if (Object.getOwnPropertySymbols) {
|
|
77
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
78
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
79
|
-
key = sourceSymbolKeys[i];
|
|
80
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
81
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
82
|
-
target[key] = source[key];
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return target;
|
|
86
|
-
}
|
|
87
|
-
function _object_without_properties_loose(source, excluded) {
|
|
88
|
-
if (source == null) return {};
|
|
89
|
-
var target = {};
|
|
90
|
-
var sourceKeys = Object.keys(source);
|
|
91
|
-
var key, i;
|
|
92
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
93
|
-
key = sourceKeys[i];
|
|
94
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
95
|
-
target[key] = source[key];
|
|
96
|
-
}
|
|
97
|
-
return target;
|
|
98
|
-
}
|
|
99
|
-
var EnhancedModalCustomWrapper = function(_param) {
|
|
100
|
-
var title = _param.title, children = _param.children, isCloseHidden = _param.isCloseHidden, props = _object_without_properties(_param, [
|
|
101
|
-
"title",
|
|
102
|
-
"children",
|
|
103
|
-
"isCloseHidden"
|
|
104
|
-
]);
|
|
105
|
-
var close = (0, _useenhancedmodal.useEnhancedModal)().close;
|
|
106
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_chakra.Stack, _object_spread_props(_object_spread({
|
|
107
|
-
overflowY: 'scroll',
|
|
108
|
-
px: '32px',
|
|
109
|
-
py: '24px',
|
|
110
|
-
spacing: '18px'
|
|
111
|
-
}, props), {
|
|
112
|
-
children: [
|
|
113
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_chakra.HStack, {
|
|
114
|
-
justifyContent: 'space-between',
|
|
115
|
-
children: [
|
|
116
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_chakra.Heading, {
|
|
117
|
-
fontSize: '18px',
|
|
118
|
-
textTransform: 'uppercase',
|
|
119
|
-
children: title
|
|
120
|
-
}),
|
|
121
|
-
!isCloseHidden && /*#__PURE__*/ (0, _jsxruntime.jsx)(_chakra.Button, {
|
|
122
|
-
p: 0,
|
|
123
|
-
variant: 'unstyled',
|
|
124
|
-
border: 0,
|
|
125
|
-
w: 'fit-content',
|
|
126
|
-
onClick: function() {
|
|
127
|
-
close();
|
|
128
|
-
},
|
|
129
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_IconClose.default, {
|
|
130
|
-
size: '28px'
|
|
131
|
-
})
|
|
132
|
-
})
|
|
133
|
-
]
|
|
134
|
-
}),
|
|
135
|
-
children
|
|
136
|
-
]
|
|
137
|
-
}));
|
|
138
|
-
};
|
|
139
|
-
var _default = EnhancedModalCustomWrapper;
|