@driveflux/ui 2.0.2 → 2.0.3-next.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.
Files changed (42) hide show
  1. package/dist/bottom-sheet/BottomSheetProvider.js +157 -29
  2. package/dist/bottom-sheet/BottomSheetProvider.js.map +1 -1
  3. package/dist/bottom-sheet/context.d.ts.map +1 -1
  4. package/dist/bottom-sheet/context.js +3 -4
  5. package/dist/bottom-sheet/context.js.map +1 -1
  6. package/dist/bottom-sheet/index.js +0 -1
  7. package/dist/bottom-sheet/use-bottom-sheet.js +3 -2
  8. package/dist/bottom-sheet/utils.js +4 -5
  9. package/dist/chakra.d.ts +1 -1
  10. package/dist/chakra.d.ts.map +1 -1
  11. package/dist/chakra.js +0 -1
  12. package/dist/chakra.js.map +1 -1
  13. package/dist/modal/ModalProvider.js +192 -55
  14. package/dist/modal/components/EnhancedModalCustomWrapper.js +118 -6
  15. package/dist/modal/components/EnhancedModalCustomWrapper.js.map +1 -1
  16. package/dist/modal/components/EnhancedModalFooter.js +147 -5
  17. package/dist/modal/components/MinimalModalContent.js +79 -6
  18. package/dist/modal/components/StandardModalContent.js +342 -25
  19. package/dist/modal/context.d.ts.map +1 -1
  20. package/dist/modal/context.js +7 -8
  21. package/dist/modal/context.js.map +1 -1
  22. package/dist/modal/index.d.ts +1 -1
  23. package/dist/modal/index.d.ts.map +1 -1
  24. package/dist/modal/index.js +1 -2
  25. package/dist/modal/index.js.map +1 -1
  26. package/dist/modal/use-enhanced-modal.js +1 -2
  27. package/dist/theme/colors.js +44 -63
  28. package/dist/theme/index.js +0 -1
  29. package/dist/toast/index.js +1 -3
  30. package/dist/toast/use-toast-result.d.ts.map +1 -1
  31. package/dist/toast/use-toast-result.js +153 -56
  32. package/dist/toast/use-toast-result.js.map +1 -1
  33. package/dist/translations.d.ts.map +1 -1
  34. package/dist/translations.js +5 -6
  35. package/dist/translations.js.map +1 -1
  36. package/dist/types.js +1 -2
  37. package/dist/utils/accessors.js +23 -11
  38. package/dist/utils/index.js +0 -1
  39. package/dist/utils/react.d.ts.map +1 -1
  40. package/dist/utils/react.js +17 -12
  41. package/dist/utils/react.js.map +1 -1
  42. package/package.json +19 -21
@@ -1,12 +1,124 @@
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
+ }
1
80
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
81
  import IconClose from '@driveflux/icons/icons/IconClose';
3
- import { Button, HStack, Heading, Stack, } from '../../chakra.js';
82
+ import { Button, Heading, HStack, Stack } from '../../chakra.js';
4
83
  import { useEnhancedModal } from '../use-enhanced-modal.js';
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: () => {
84
+ var EnhancedModalCustomWrapper = function(_param) {
85
+ var title = _param.title, children = _param.children, isCloseHidden = _param.isCloseHidden, props = _object_without_properties(_param, [
86
+ "title",
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() {
8
112
  close();
9
- }, children: _jsx(IconClose, { size: '28px' }) }))] }), children] }));
113
+ },
114
+ children: /*#__PURE__*/ _jsx(IconClose, {
115
+ size: '28px'
116
+ })
117
+ })
118
+ ]
119
+ }),
120
+ children
121
+ ]
122
+ }));
10
123
  };
11
124
  export default EnhancedModalCustomWrapper;
12
- //# sourceMappingURL=EnhancedModalCustomWrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EnhancedModalCustomWrapper.js","sourceRoot":"","sources":["../../../src/modal/components/EnhancedModalCustomWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,kCAAkC,CAAA;AAExD,OAAO,EACN,MAAM,EACN,MAAM,EACN,OAAO,EACP,KAAK,GAEL,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAO3D,MAAM,0BAA0B,GAAiC,CAAC,EACjE,KAAK,EACL,QAAQ,EACR,aAAa,EACb,GAAG,KAAK,EACR,EAAE,EAAE;IACJ,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAEpC,OAAO,CACN,MAAC,KAAK,IACL,SAAS,EAAE,QAAQ,EACnB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,KACX,KAAK,aAET,MAAC,MAAM,IAAC,cAAc,EAAE,eAAe,aACtC,KAAC,OAAO,IAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,YACnD,KAAK,GACG,EACT,CAAC,aAAa,IAAI,CAClB,KAAC,MAAM,IACN,CAAC,EAAE,CAAC,EACJ,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,CAAC,EACT,CAAC,EAAE,aAAa,EAChB,OAAO,EAAE,GAAG,EAAE;4BACb,KAAK,EAAE,CAAA;wBACR,CAAC,YAED,KAAC,SAAS,IAAC,IAAI,EAAE,MAAM,GAAI,GACnB,CACT,IACO,EACR,QAAQ,IACF,CACR,CAAA;AACF,CAAC,CAAA;AAED,eAAe,0BAA0B,CAAA"}
1
+ {"version":3,"file":"EnhancedModalCustomWrapper.js","sourceRoot":"","sources":["../../../src/modal/components/EnhancedModalCustomWrapper.tsx"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,kCAAkC,CAAA;AAExD,OAAO,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,KAAK,GAEL,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAO3D,MAAM,0BAA0B,GAAiC,CAAC,EACjE,KAAK,EACL,QAAQ,EACR,aAAa,EACb,GAAG,KAAK,EACR,EAAE,EAAE;IACJ,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAEpC,OAAO,CACN,MAAC,KAAK,IACL,SAAS,EAAE,QAAQ,EACnB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,KACX,KAAK,aAET,MAAC,MAAM,IAAC,cAAc,EAAE,eAAe,aACtC,KAAC,OAAO,IAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,YACnD,KAAK,GACG,EACT,CAAC,aAAa,IAAI,CAClB,KAAC,MAAM,IACN,CAAC,EAAE,CAAC,EACJ,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,CAAC,EACT,CAAC,EAAE,aAAa,EAChB,OAAO,EAAE,GAAG,EAAE;4BACb,KAAK,EAAE,CAAA;wBACR,CAAC,YAED,KAAC,SAAS,IAAC,IAAI,EAAE,MAAM,GAAI,GACnB,CACT,IACO,EACR,QAAQ,IACF,CACR,CAAA;AACF,CAAC,CAAA;AAED,eAAe,0BAA0B,CAAA"}
@@ -1,11 +1,153 @@
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
+ }
1
80
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Stack, } from '../../chakra.js';
81
+ import { Button, Stack } from '../../chakra.js';
3
82
  import { colors } from '../../theme/colors.js';
4
83
  import { translations } from '../../translations.js';
5
84
  import { useEnhancedModal } from '../use-enhanced-modal.js';
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] }));
85
+ var EnhancedModalFooter = function(_param) {
86
+ var sticky = _param.sticky, cancelProps = _param.cancelProps, okProps = _param.okProps, children = _param.children, suffix = _param.suffix, props = _object_without_properties(_param, [
87
+ "sticky",
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
+ }));
9
152
  };
10
153
  export default EnhancedModalFooter;
11
- //# sourceMappingURL=EnhancedModalFooter.js.map
@@ -1,11 +1,84 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
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 = _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";
2
57
  import { Fragment } from 'react';
3
58
  import { Box, ModalBody, ModalCloseButton, ModalHeader } from '../../chakra.js';
4
59
  import { isReactNode } from '../../utils/react.js';
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 })) })] }));
60
+ var MinimalModalContent = function(_param) {
61
+ var _param_controls = _param.controls, open = _param_controls.open, close = _param_controls.close, modalContentConfig = _param.modalContentConfig, props = _object_without_properties(_param, [
62
+ "controls",
63
+ "modalContentConfig"
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
+ });
9
83
  };
10
84
  export default MinimalModalContent;
11
- //# sourceMappingURL=MinimalModalContent.js.map