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