@driveflux/ui 3.0.5 → 3.0.6
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.js +157 -29
- package/dist/bottom-sheet/context.js +3 -4
- package/dist/bottom-sheet/index.js +0 -1
- package/dist/bottom-sheet/use-bottom-sheet.js +3 -2
- package/dist/bottom-sheet/utils.js +4 -5
- package/dist/chakra.js +0 -1
- package/dist/modal/ModalProvider.js +197 -59
- package/dist/modal/components/EnhancedModalCustomWrapper.js +127 -6
- package/dist/modal/components/EnhancedModalFooter.js +156 -5
- package/dist/modal/components/MinimalModalContent.js +88 -6
- package/dist/modal/components/StandardModalContent.js +359 -25
- package/dist/modal/context.js +7 -8
- package/dist/modal/index.js +0 -1
- package/dist/modal/use-enhanced-modal.js +1 -2
- package/dist/theme/colors.js +44 -63
- package/dist/theme/index.js +0 -1
- package/dist/toast/index.js +1 -3
- package/dist/toast/use-toast-result.js +161 -54
- package/dist/translations.js +5 -6
- package/dist/types.js +1 -2
- package/dist/utils/accessors.js +23 -11
- package/dist/utils/index.js +0 -1
- package/dist/utils/react.js +18 -12
- package/package.json +7 -7
|
@@ -1,12 +1,133 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function _object_without_properties(source, excluded) {
|
|
54
|
+
if (source == null) return {};
|
|
55
|
+
var target = {}, sourceKeys, key, i;
|
|
56
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
57
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
58
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
59
|
+
key = sourceKeys[i];
|
|
60
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
+
target[key] = source[key];
|
|
63
|
+
}
|
|
64
|
+
return target;
|
|
65
|
+
}
|
|
66
|
+
target = _object_without_properties_loose(source, excluded);
|
|
67
|
+
if (Object.getOwnPropertySymbols) {
|
|
68
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
69
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
70
|
+
key = sourceKeys[i];
|
|
71
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
72
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
73
|
+
target[key] = source[key];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return target;
|
|
77
|
+
}
|
|
78
|
+
function _object_without_properties_loose(source, excluded) {
|
|
79
|
+
if (source == null) return {};
|
|
80
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
81
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
82
|
+
key = sourceKeys[i];
|
|
83
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
84
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
85
|
+
target[key] = source[key];
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
1
89
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
90
|
import IconClose from '@driveflux/icons/icons/IconClose';
|
|
3
|
-
import { Button, Heading, HStack, Stack
|
|
91
|
+
import { Button, Heading, HStack, Stack } from '../../chakra.js';
|
|
4
92
|
import { useEnhancedModal } from '../use-enhanced-modal.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
93
|
+
var EnhancedModalCustomWrapper = function EnhancedModalCustomWrapper(_0) {
|
|
94
|
+
var title = _0.title, children = _0.children, isCloseHidden = _0.isCloseHidden, props = _object_without_properties(_0, [
|
|
95
|
+
"title",
|
|
96
|
+
"children",
|
|
97
|
+
"isCloseHidden"
|
|
98
|
+
]);
|
|
99
|
+
var close = useEnhancedModal().close;
|
|
100
|
+
return /*#__PURE__*/ _jsxs(Stack, _object_spread_props(_object_spread({
|
|
101
|
+
overflowY: 'scroll',
|
|
102
|
+
px: '32px',
|
|
103
|
+
py: '24px',
|
|
104
|
+
spacing: '18px'
|
|
105
|
+
}, props), {
|
|
106
|
+
children: [
|
|
107
|
+
/*#__PURE__*/ _jsxs(HStack, {
|
|
108
|
+
justifyContent: 'space-between',
|
|
109
|
+
children: [
|
|
110
|
+
/*#__PURE__*/ _jsx(Heading, {
|
|
111
|
+
fontSize: '18px',
|
|
112
|
+
textTransform: 'uppercase',
|
|
113
|
+
children: title
|
|
114
|
+
}),
|
|
115
|
+
!isCloseHidden && /*#__PURE__*/ _jsx(Button, {
|
|
116
|
+
p: 0,
|
|
117
|
+
variant: 'unstyled',
|
|
118
|
+
border: 0,
|
|
119
|
+
w: 'fit-content',
|
|
120
|
+
onClick: function onClick() {
|
|
8
121
|
close();
|
|
9
|
-
},
|
|
122
|
+
},
|
|
123
|
+
children: /*#__PURE__*/ _jsx(IconClose, {
|
|
124
|
+
size: '28px'
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
]
|
|
128
|
+
}),
|
|
129
|
+
children
|
|
130
|
+
]
|
|
131
|
+
}));
|
|
10
132
|
};
|
|
11
133
|
export default EnhancedModalCustomWrapper;
|
|
12
|
-
//# sourceMappingURL=EnhancedModalCustomWrapper.js.map
|
|
@@ -1,11 +1,162 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
53
|
+
function _object_without_properties(source, excluded) {
|
|
54
|
+
if (source == null) return {};
|
|
55
|
+
var target = {}, sourceKeys, key, i;
|
|
56
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
57
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
58
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
59
|
+
key = sourceKeys[i];
|
|
60
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
61
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
62
|
+
target[key] = source[key];
|
|
63
|
+
}
|
|
64
|
+
return target;
|
|
65
|
+
}
|
|
66
|
+
target = _object_without_properties_loose(source, excluded);
|
|
67
|
+
if (Object.getOwnPropertySymbols) {
|
|
68
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
69
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
70
|
+
key = sourceKeys[i];
|
|
71
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
72
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
73
|
+
target[key] = source[key];
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return target;
|
|
77
|
+
}
|
|
78
|
+
function _object_without_properties_loose(source, excluded) {
|
|
79
|
+
if (source == null) return {};
|
|
80
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
81
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
82
|
+
key = sourceKeys[i];
|
|
83
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
84
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
85
|
+
target[key] = source[key];
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
1
89
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Button, Stack
|
|
90
|
+
import { Button, Stack } from '../../chakra.js';
|
|
3
91
|
import { colors } from '../../theme/colors.js';
|
|
4
92
|
import { translations } from '../../translations.js';
|
|
5
93
|
import { useEnhancedModal } from '../use-enhanced-modal.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
94
|
+
var EnhancedModalFooter = function EnhancedModalFooter(_0) {
|
|
95
|
+
var sticky = _0.sticky, cancelProps = _0.cancelProps, okProps = _0.okProps, children = _0.children, suffix = _0.suffix, props = _object_without_properties(_0, [
|
|
96
|
+
"sticky",
|
|
97
|
+
"cancelProps",
|
|
98
|
+
"okProps",
|
|
99
|
+
"children",
|
|
100
|
+
"suffix"
|
|
101
|
+
]);
|
|
102
|
+
var close = useEnhancedModal().close;
|
|
103
|
+
return /*#__PURE__*/ _jsxs(Stack, _object_spread_props(_object_spread({
|
|
104
|
+
pos: {
|
|
105
|
+
base: 'absolute',
|
|
106
|
+
md: sticky ? 'absolute' : 'static'
|
|
107
|
+
},
|
|
108
|
+
bottom: 0,
|
|
109
|
+
left: 0,
|
|
110
|
+
right: 0,
|
|
111
|
+
py: '32px',
|
|
112
|
+
px: {
|
|
113
|
+
base: '32px',
|
|
114
|
+
md: sticky ? '32px' : '0'
|
|
115
|
+
},
|
|
116
|
+
borderTop: sticky ? "1px solid ".concat(colors.primary2) : '',
|
|
117
|
+
background: colors.white,
|
|
118
|
+
spacing: '24px',
|
|
119
|
+
zIndex: 'sticky'
|
|
120
|
+
}, props), {
|
|
121
|
+
children: [
|
|
122
|
+
children ? /*#__PURE__*/ _jsx(Stack, {
|
|
123
|
+
direction: {
|
|
124
|
+
base: 'column-reverse',
|
|
125
|
+
md: 'row'
|
|
126
|
+
},
|
|
127
|
+
spacing: '24px',
|
|
128
|
+
children: children
|
|
129
|
+
}) : /*#__PURE__*/ _jsxs(Stack, {
|
|
130
|
+
direction: {
|
|
131
|
+
base: 'column-reverse',
|
|
132
|
+
md: 'row'
|
|
133
|
+
},
|
|
134
|
+
spacing: '24px',
|
|
135
|
+
children: [
|
|
136
|
+
/*#__PURE__*/ _jsx(Button, _object_spread_props(_object_spread({
|
|
137
|
+
w: 'full',
|
|
138
|
+
variant: 'outline',
|
|
139
|
+
onClick: function onClick() {
|
|
140
|
+
return close();
|
|
141
|
+
}
|
|
142
|
+
}, cancelProps), {
|
|
143
|
+
fontSize: '10px',
|
|
144
|
+
fontWeight: '700',
|
|
145
|
+
letterSpacing: '3px',
|
|
146
|
+
children: (cancelProps === null || cancelProps === void 0 ? void 0 : cancelProps.children) ? cancelProps.children : translations.cancel
|
|
147
|
+
})),
|
|
148
|
+
/*#__PURE__*/ _jsx(Button, _object_spread_props(_object_spread({
|
|
149
|
+
w: 'full'
|
|
150
|
+
}, okProps), {
|
|
151
|
+
fontSize: '10px',
|
|
152
|
+
fontWeight: '700',
|
|
153
|
+
letterSpacing: '3px',
|
|
154
|
+
children: (okProps === null || okProps === void 0 ? void 0 : okProps.children) ? okProps.children : translations.confirm
|
|
155
|
+
}))
|
|
156
|
+
]
|
|
157
|
+
}),
|
|
158
|
+
suffix
|
|
159
|
+
]
|
|
160
|
+
}));
|
|
9
161
|
};
|
|
10
162
|
export default EnhancedModalFooter;
|
|
11
|
-
//# sourceMappingURL=EnhancedModalFooter.js.map
|
|
@@ -1,11 +1,93 @@
|
|
|
1
|
-
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
function _object_without_properties(source, excluded) {
|
|
30
|
+
if (source == null) return {};
|
|
31
|
+
var target = {}, sourceKeys, key, i;
|
|
32
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
33
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
34
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
35
|
+
key = sourceKeys[i];
|
|
36
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
37
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
38
|
+
target[key] = source[key];
|
|
39
|
+
}
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
target = _object_without_properties_loose(source, excluded);
|
|
43
|
+
if (Object.getOwnPropertySymbols) {
|
|
44
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
+
key = sourceKeys[i];
|
|
47
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
48
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
49
|
+
target[key] = source[key];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
function _object_without_properties_loose(source, excluded) {
|
|
55
|
+
if (source == null) return {};
|
|
56
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
57
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
58
|
+
key = sourceKeys[i];
|
|
59
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
61
|
+
target[key] = source[key];
|
|
62
|
+
}
|
|
63
|
+
return target;
|
|
64
|
+
}
|
|
65
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
66
|
import { Fragment } from 'react';
|
|
3
67
|
import { Box, ModalBody, ModalCloseButton, ModalHeader } from '../../chakra.js';
|
|
4
68
|
import { isReactNode } from '../../utils/react.js';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
69
|
+
var MinimalModalContent = function MinimalModalContent(_0) {
|
|
70
|
+
var _0_controls = _0.controls, open = _0_controls.open, close = _0_controls.close, modalContentConfig = _0.modalContentConfig, props = _object_without_properties(_0, [
|
|
71
|
+
"controls",
|
|
72
|
+
"modalContentConfig"
|
|
73
|
+
]);
|
|
74
|
+
var Content = modalContentConfig.content;
|
|
75
|
+
var Wrapper = modalContentConfig.noModalBody ? Fragment : ModalBody;
|
|
76
|
+
return /*#__PURE__*/ _jsxs(_Fragment, {
|
|
77
|
+
children: [
|
|
78
|
+
modalContentConfig.title ? /*#__PURE__*/ _jsx(ModalHeader, {
|
|
79
|
+
children: modalContentConfig.title
|
|
80
|
+
}) : /*#__PURE__*/ _jsx(Box, {
|
|
81
|
+
h: '32px'
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ _jsx(ModalCloseButton, {}),
|
|
84
|
+
/*#__PURE__*/ _jsx(Wrapper, {
|
|
85
|
+
children: isReactNode(Content) ? Content : /*#__PURE__*/ _jsx(Content, _object_spread({
|
|
86
|
+
close: close,
|
|
87
|
+
open: open
|
|
88
|
+
}, props))
|
|
89
|
+
})
|
|
90
|
+
]
|
|
91
|
+
});
|
|
9
92
|
};
|
|
10
93
|
export default MinimalModalContent;
|
|
11
|
-
//# sourceMappingURL=MinimalModalContent.js.map
|