@driveflux/ui 3.0.4 → 3.0.5

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.
@@ -1,133 +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 = {}, 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
- }
89
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
90
2
  import IconClose from '@driveflux/icons/icons/IconClose';
91
- import { Button, Heading, HStack, Stack } from '../../chakra.js';
3
+ import { Button, Heading, HStack, Stack, } from '../../chakra.js';
92
4
  import { useEnhancedModal } from '../use-enhanced-modal.js';
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() {
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: () => {
121
8
  close();
122
- },
123
- children: /*#__PURE__*/ _jsx(IconClose, {
124
- size: '28px'
125
- })
126
- })
127
- ]
128
- }),
129
- children
130
- ]
131
- }));
9
+ }, children: _jsx(IconClose, { size: '28px' }) }))] }), children] }));
132
10
  };
133
11
  export default EnhancedModalCustomWrapper;
12
+ //# sourceMappingURL=EnhancedModalCustomWrapper.js.map
@@ -1,162 +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 = {}, 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
- }
89
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
90
- import { Button, Stack } from '../../chakra.js';
2
+ import { Button, Stack, } from '../../chakra.js';
91
3
  import { colors } from '../../theme/colors.js';
92
4
  import { translations } from '../../translations.js';
93
5
  import { useEnhancedModal } from '../use-enhanced-modal.js';
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
- }));
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] }));
161
9
  };
162
10
  export default EnhancedModalFooter;
11
+ //# sourceMappingURL=EnhancedModalFooter.js.map
@@ -1,93 +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 _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";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
66
2
  import { Fragment } from 'react';
67
3
  import { Box, ModalBody, ModalCloseButton, ModalHeader } from '../../chakra.js';
68
4
  import { isReactNode } from '../../utils/react.js';
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
- });
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 })) })] }));
92
9
  };
93
10
  export default MinimalModalContent;
11
+ //# sourceMappingURL=MinimalModalContent.js.map