@driveflux/ui 1.0.0-next.0 → 1.0.0-next.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/.turbo/turbo-build.log +7 -6
- package/CHANGELOG.md +16 -0
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/modal/components/EnhancedModalFooter.js +3 -7
- package/dist/cjs/modal/components/StandardModalContent.js +3 -31
- package/dist/cjs/toast/use-toast-result.js +5 -51
- package/dist/cjs/translations.js +40 -0
- package/dist/cjs/utils/react.js +2 -43
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/modal/components/EnhancedModalFooter.d.ts.map +1 -1
- package/dist/modal/components/EnhancedModalFooter.js +3 -7
- package/dist/modal/components/StandardModalContent.d.ts.map +1 -1
- package/dist/modal/components/StandardModalContent.js +3 -31
- package/dist/toast/use-toast-result.d.ts.map +1 -1
- package/dist/toast/use-toast-result.js +5 -51
- package/dist/translations.d.ts +24 -0
- package/dist/translations.d.ts.map +1 -0
- package/dist/translations.js +19 -0
- package/dist/utils/react.d.ts +4 -4
- package/dist/utils/react.d.ts.map +1 -1
- package/dist/utils/react.js +2 -2
- package/package.json +23 -18
- package/src/index.ts +2 -0
- package/src/modal/components/EnhancedModalFooter.tsx +3 -3
- package/src/modal/components/StandardModalContent.tsx +3 -3
- package/src/toast/use-toast-result.tsx +5 -5
- package/src/translations.ts +23 -0
- package/src/utils/react.ts +5 -5
- package/translations.cjs +1 -0
- package/translations.d.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Successfully compiled:
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @driveflux/ui@1.0.0-next.2 build /Users/flux/Projects/flux/shared/ui
|
|
4
|
+
> fab
|
|
5
|
+
|
|
6
|
+
Successfully compiled: 19 files with swc (181.26ms)
|
|
7
|
+
Successfully compiled: 19 files with swc (200.89ms)
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @driveflux/ui
|
|
2
2
|
|
|
3
|
+
## 1.0.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Version bump
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @driveflux/icons@1.0.0-next.2
|
|
10
|
+
|
|
11
|
+
## 1.0.0-next.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- verion bump + minor improvements
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @driveflux/icons@1.0.0-next.1
|
|
18
|
+
|
|
3
19
|
## 1.0.0-next.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
package/dist/cjs/index.js
CHANGED
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "default", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _jsxruntime = require("react/jsx-runtime");
|
|
12
|
-
var _macro = require("@lingui/macro");
|
|
13
12
|
var _chakra = require("../../chakra.js");
|
|
14
13
|
var _colors = require("../../theme/colors.js");
|
|
14
|
+
var _translations = require("../../translations.js");
|
|
15
15
|
var _useenhancedmodal = require("../use-enhanced-modal.js");
|
|
16
16
|
function _define_property(obj, key, value) {
|
|
17
17
|
if (key in obj) {
|
|
@@ -144,9 +144,7 @@ var EnhancedModalFooter = function(_param) {
|
|
|
144
144
|
fontSize: "10px",
|
|
145
145
|
fontWeight: "bold",
|
|
146
146
|
letterSpacing: "3px",
|
|
147
|
-
children: (cancelProps === null || cancelProps === void 0 ? void 0 : cancelProps.children) ? cancelProps.children :
|
|
148
|
-
children: "Cancel"
|
|
149
|
-
})
|
|
147
|
+
children: (cancelProps === null || cancelProps === void 0 ? void 0 : cancelProps.children) ? cancelProps.children : _translations.translations.cancel
|
|
150
148
|
})),
|
|
151
149
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_chakra.Button, _object_spread_props(_object_spread({
|
|
152
150
|
w: "full"
|
|
@@ -154,9 +152,7 @@ var EnhancedModalFooter = function(_param) {
|
|
|
154
152
|
fontSize: "10px",
|
|
155
153
|
fontWeight: "bold",
|
|
156
154
|
letterSpacing: "3px",
|
|
157
|
-
children: (okProps === null || okProps === void 0 ? void 0 : okProps.children) ? okProps.children :
|
|
158
|
-
children: "Confirm"
|
|
159
|
-
})
|
|
155
|
+
children: (okProps === null || okProps === void 0 ? void 0 : okProps.children) ? okProps.children : _translations.translations.confirm
|
|
160
156
|
}))
|
|
161
157
|
]
|
|
162
158
|
}),
|
|
@@ -9,9 +9,9 @@ Object.defineProperty(exports, "default", {
|
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
var _jsxruntime = require("react/jsx-runtime");
|
|
12
|
-
var _macro = require("@lingui/macro");
|
|
13
12
|
var _react = require("react");
|
|
14
13
|
var _chakra = require("../../chakra.js");
|
|
14
|
+
var _translations = require("../../translations.js");
|
|
15
15
|
var _react1 = require("../../utils/react.js");
|
|
16
16
|
var _useenhancedmodal = require("../use-enhanced-modal.js");
|
|
17
17
|
function _array_like_to_array(arr, len) {
|
|
@@ -136,16 +136,6 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
136
136
|
function _sliced_to_array(arr, i) {
|
|
137
137
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
138
138
|
}
|
|
139
|
-
function _tagged_template_literal(strings, raw) {
|
|
140
|
-
if (!raw) {
|
|
141
|
-
raw = strings.slice(0);
|
|
142
|
-
}
|
|
143
|
-
return Object.freeze(Object.defineProperties(strings, {
|
|
144
|
-
raw: {
|
|
145
|
-
value: Object.freeze(raw)
|
|
146
|
-
}
|
|
147
|
-
}));
|
|
148
|
-
}
|
|
149
139
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
150
140
|
if (!o) return;
|
|
151
141
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -249,24 +239,6 @@ function _ts_generator(thisArg, body) {
|
|
|
249
239
|
};
|
|
250
240
|
}
|
|
251
241
|
}
|
|
252
|
-
function _templateObject() {
|
|
253
|
-
var data = _tagged_template_literal([
|
|
254
|
-
"Close"
|
|
255
|
-
]);
|
|
256
|
-
_templateObject = function _templateObject() {
|
|
257
|
-
return data;
|
|
258
|
-
};
|
|
259
|
-
return data;
|
|
260
|
-
}
|
|
261
|
-
function _templateObject1() {
|
|
262
|
-
var data = _tagged_template_literal([
|
|
263
|
-
"Ok"
|
|
264
|
-
]);
|
|
265
|
-
_templateObject1 = function _templateObject() {
|
|
266
|
-
return data;
|
|
267
|
-
};
|
|
268
|
-
return data;
|
|
269
|
-
}
|
|
270
242
|
var StandardModalContent = function(_param) {
|
|
271
243
|
var _param_controls = _param.controls, open = _param_controls.open, close = _param_controls.close, modalContentConfig = _param.modalContentConfig, props = _object_without_properties(_param, [
|
|
272
244
|
"controls",
|
|
@@ -367,7 +339,7 @@ var StandardModalContent = function(_param) {
|
|
|
367
339
|
w: "full",
|
|
368
340
|
variant: "outline",
|
|
369
341
|
onClick: handleCancel,
|
|
370
|
-
children: modalContentConfig.cancelText ||
|
|
342
|
+
children: modalContentConfig.cancelText || _translations.translations.close
|
|
371
343
|
}),
|
|
372
344
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_chakra.Button, {
|
|
373
345
|
isDisabled: modalContentConfig.isOkDisabled,
|
|
@@ -376,7 +348,7 @@ var StandardModalContent = function(_param) {
|
|
|
376
348
|
variant: "solid",
|
|
377
349
|
onClick: handleOK,
|
|
378
350
|
colorScheme: modalContentConfig.okColorScheme,
|
|
379
|
-
children: modalContentConfig.okText ||
|
|
351
|
+
children: modalContentConfig.okText || _translations.translations.ok
|
|
380
352
|
})
|
|
381
353
|
]
|
|
382
354
|
})
|
|
@@ -17,10 +17,10 @@ _export(exports, {
|
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
var _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
var _macro = require("@lingui/macro");
|
|
21
20
|
var _merge = /*#__PURE__*/ _interop_require_default(require("lodash/merge.js"));
|
|
22
21
|
var _react = require("react");
|
|
23
22
|
var _chakra = require("../chakra.js");
|
|
23
|
+
var _translations = require("../translations.js");
|
|
24
24
|
var _accessors = require("../utils/accessors.js");
|
|
25
25
|
function _define_property(obj, key, value) {
|
|
26
26
|
if (key in obj) {
|
|
@@ -106,66 +106,20 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
106
106
|
}
|
|
107
107
|
return target;
|
|
108
108
|
}
|
|
109
|
-
function _tagged_template_literal(strings, raw) {
|
|
110
|
-
if (!raw) {
|
|
111
|
-
raw = strings.slice(0);
|
|
112
|
-
}
|
|
113
|
-
return Object.freeze(Object.defineProperties(strings, {
|
|
114
|
-
raw: {
|
|
115
|
-
value: Object.freeze(raw)
|
|
116
|
-
}
|
|
117
|
-
}));
|
|
118
|
-
}
|
|
119
|
-
function _templateObject() {
|
|
120
|
-
var data = _tagged_template_literal([
|
|
121
|
-
"Success"
|
|
122
|
-
]);
|
|
123
|
-
_templateObject = function _templateObject() {
|
|
124
|
-
return data;
|
|
125
|
-
};
|
|
126
|
-
return data;
|
|
127
|
-
}
|
|
128
|
-
function _templateObject1() {
|
|
129
|
-
var data = _tagged_template_literal([
|
|
130
|
-
"The operation was done successfully"
|
|
131
|
-
]);
|
|
132
|
-
_templateObject1 = function _templateObject() {
|
|
133
|
-
return data;
|
|
134
|
-
};
|
|
135
|
-
return data;
|
|
136
|
-
}
|
|
137
|
-
function _templateObject2() {
|
|
138
|
-
var data = _tagged_template_literal([
|
|
139
|
-
"Operation Failed"
|
|
140
|
-
]);
|
|
141
|
-
_templateObject2 = function _templateObject() {
|
|
142
|
-
return data;
|
|
143
|
-
};
|
|
144
|
-
return data;
|
|
145
|
-
}
|
|
146
|
-
function _templateObject3() {
|
|
147
|
-
var data = _tagged_template_literal([
|
|
148
|
-
"There was a problem while performing this operation"
|
|
149
|
-
]);
|
|
150
|
-
_templateObject3 = function _templateObject() {
|
|
151
|
-
return data;
|
|
152
|
-
};
|
|
153
|
-
return data;
|
|
154
|
-
}
|
|
155
109
|
var accessStatus = function(s, data) {
|
|
156
110
|
return typeof s === "function" ? s(data) : s;
|
|
157
111
|
};
|
|
158
112
|
var defaultUseToastResultOptions = {
|
|
159
113
|
success: {
|
|
160
114
|
status: "success",
|
|
161
|
-
title:
|
|
162
|
-
description:
|
|
115
|
+
title: _translations.translations.success,
|
|
116
|
+
description: _translations.translations.successDescription,
|
|
163
117
|
isClosable: true
|
|
164
118
|
},
|
|
165
119
|
error: {
|
|
166
120
|
status: "error",
|
|
167
|
-
title:
|
|
168
|
-
defaultDescription:
|
|
121
|
+
title: _translations.translations.failed,
|
|
122
|
+
defaultDescription: _translations.translations.failedDescription,
|
|
169
123
|
showValidationErrors: true,
|
|
170
124
|
isClosable: true
|
|
171
125
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
setTranslation: function() {
|
|
13
|
+
return setTranslation;
|
|
14
|
+
},
|
|
15
|
+
setTranslations: function() {
|
|
16
|
+
return setTranslations;
|
|
17
|
+
},
|
|
18
|
+
translations: function() {
|
|
19
|
+
return translations;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
var translations = {
|
|
23
|
+
success: "Success",
|
|
24
|
+
successDescription: "Operation completed successfully.",
|
|
25
|
+
failed: "Operation Failed",
|
|
26
|
+
failedDescription: "There was a problem while performing this operation.",
|
|
27
|
+
cancel: "Cancel",
|
|
28
|
+
confirm: "Confirm",
|
|
29
|
+
close: "Close",
|
|
30
|
+
ok: "Ok"
|
|
31
|
+
};
|
|
32
|
+
var setTranslations = function(ts) {
|
|
33
|
+
for(var key in ts){
|
|
34
|
+
// @ts-expect-error
|
|
35
|
+
translations[key] = ts[key];
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var setTranslation = function(key, value) {
|
|
39
|
+
translations[key] = value;
|
|
40
|
+
};
|
package/dist/cjs/utils/react.js
CHANGED
|
@@ -19,7 +19,7 @@ _export(exports, {
|
|
|
19
19
|
return isReactNode;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
-
var _react =
|
|
22
|
+
var _react = require("react");
|
|
23
23
|
function _instanceof(left, right) {
|
|
24
24
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
25
25
|
return !!right[Symbol.hasInstance](left);
|
|
@@ -27,50 +27,9 @@ function _instanceof(left, right) {
|
|
|
27
27
|
return left instanceof right;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
31
|
-
if (typeof WeakMap !== "function") return null;
|
|
32
|
-
var cacheBabelInterop = new WeakMap();
|
|
33
|
-
var cacheNodeInterop = new WeakMap();
|
|
34
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
35
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
36
|
-
})(nodeInterop);
|
|
37
|
-
}
|
|
38
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
39
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
43
|
-
return {
|
|
44
|
-
default: obj
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
48
|
-
if (cache && cache.has(obj)) {
|
|
49
|
-
return cache.get(obj);
|
|
50
|
-
}
|
|
51
|
-
var newObj = {
|
|
52
|
-
__proto__: null
|
|
53
|
-
};
|
|
54
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
55
|
-
for(var key in obj){
|
|
56
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
57
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
58
|
-
if (desc && (desc.get || desc.set)) {
|
|
59
|
-
Object.defineProperty(newObj, key, desc);
|
|
60
|
-
} else {
|
|
61
|
-
newObj[key] = obj[key];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
newObj.default = obj;
|
|
66
|
-
if (cache) {
|
|
67
|
-
cache.set(obj, newObj);
|
|
68
|
-
}
|
|
69
|
-
return newObj;
|
|
70
|
-
}
|
|
71
30
|
function isReactComponent(Component) {
|
|
72
31
|
return typeof Component === "function" && // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- React component, it's fine
|
|
73
|
-
(_instanceof(Component.prototype,
|
|
32
|
+
(_instanceof(Component.prototype, Component) || Component.displayName !== undefined);
|
|
74
33
|
}
|
|
75
34
|
function isReactElement(element) {
|
|
76
35
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- isValidElement is a validation function
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnhancedModalFooter.d.ts","sourceRoot":"","sources":["../../../src/modal/components/EnhancedModalFooter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EnhancedModalFooter.d.ts","sourceRoot":"","sources":["../../../src/modal/components/EnhancedModalFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAU,WAAW,EAAS,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAKxE,KAAK,KAAK,GAAG;IACX,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,GAAG,UAAU,CAAA;AAEd,QAAA,MAAM,mBAAmB,EAAE,EAAE,CAAC,KAAK,CAkClC,CAAA;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -78,9 +78,9 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
80
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
81
|
-
import { Trans } from "@lingui/macro";
|
|
82
81
|
import { Button, Stack } from "../../chakra.js";
|
|
83
82
|
import { colors } from "../../theme/colors.js";
|
|
83
|
+
import { translations } from "../../translations.js";
|
|
84
84
|
import { useEnhancedModal } from "../use-enhanced-modal.js";
|
|
85
85
|
var EnhancedModalFooter = function(_param) {
|
|
86
86
|
var sticky = _param.sticky, cancelProps = _param.cancelProps, okProps = _param.okProps, children = _param.children, suffix = _param.suffix, props = _object_without_properties(_param, [
|
|
@@ -134,9 +134,7 @@ var EnhancedModalFooter = function(_param) {
|
|
|
134
134
|
fontSize: "10px",
|
|
135
135
|
fontWeight: "bold",
|
|
136
136
|
letterSpacing: "3px",
|
|
137
|
-
children: (cancelProps === null || cancelProps === void 0 ? void 0 : cancelProps.children) ? cancelProps.children :
|
|
138
|
-
children: "Cancel"
|
|
139
|
-
})
|
|
137
|
+
children: (cancelProps === null || cancelProps === void 0 ? void 0 : cancelProps.children) ? cancelProps.children : translations.cancel
|
|
140
138
|
})),
|
|
141
139
|
/*#__PURE__*/ _jsx(Button, _object_spread_props(_object_spread({
|
|
142
140
|
w: "full"
|
|
@@ -144,9 +142,7 @@ var EnhancedModalFooter = function(_param) {
|
|
|
144
142
|
fontSize: "10px",
|
|
145
143
|
fontWeight: "bold",
|
|
146
144
|
letterSpacing: "3px",
|
|
147
|
-
children: (okProps === null || okProps === void 0 ? void 0 : okProps.children) ? okProps.children :
|
|
148
|
-
children: "Confirm"
|
|
149
|
-
})
|
|
145
|
+
children: (okProps === null || okProps === void 0 ? void 0 : okProps.children) ? okProps.children : translations.confirm
|
|
150
146
|
}))
|
|
151
147
|
]
|
|
152
148
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardModalContent.d.ts","sourceRoot":"","sources":["../../../src/modal/components/StandardModalContent.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StandardModalContent.d.ts","sourceRoot":"","sources":["../../../src/modal/components/StandardModalContent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAyB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAA;AAWtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAG1E,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,iBAAiB,CAAA;IAC3B,kBAAkB,EAAE,OAAO,CAAC,kBAAkB,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC,CAAA;CACtE,CAAA;AAED,QAAA,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA2CnC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -120,16 +120,6 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
120
120
|
function _sliced_to_array(arr, i) {
|
|
121
121
|
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
122
122
|
}
|
|
123
|
-
function _tagged_template_literal(strings, raw) {
|
|
124
|
-
if (!raw) {
|
|
125
|
-
raw = strings.slice(0);
|
|
126
|
-
}
|
|
127
|
-
return Object.freeze(Object.defineProperties(strings, {
|
|
128
|
-
raw: {
|
|
129
|
-
value: Object.freeze(raw)
|
|
130
|
-
}
|
|
131
|
-
}));
|
|
132
|
-
}
|
|
133
123
|
function _unsupported_iterable_to_array(o, minLen) {
|
|
134
124
|
if (!o) return;
|
|
135
125
|
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
@@ -233,28 +223,10 @@ function _ts_generator(thisArg, body) {
|
|
|
233
223
|
};
|
|
234
224
|
}
|
|
235
225
|
}
|
|
236
|
-
function _templateObject() {
|
|
237
|
-
var data = _tagged_template_literal([
|
|
238
|
-
"Close"
|
|
239
|
-
]);
|
|
240
|
-
_templateObject = function _templateObject() {
|
|
241
|
-
return data;
|
|
242
|
-
};
|
|
243
|
-
return data;
|
|
244
|
-
}
|
|
245
|
-
function _templateObject1() {
|
|
246
|
-
var data = _tagged_template_literal([
|
|
247
|
-
"Ok"
|
|
248
|
-
]);
|
|
249
|
-
_templateObject1 = function _templateObject() {
|
|
250
|
-
return data;
|
|
251
|
-
};
|
|
252
|
-
return data;
|
|
253
|
-
}
|
|
254
226
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
255
|
-
import { t } from "@lingui/macro";
|
|
256
227
|
import { useCallback, useState } from "react";
|
|
257
228
|
import { Button, HStack, ModalBody, ModalCloseButton, ModalFooter, ModalHeader } from "../../chakra.js";
|
|
229
|
+
import { translations } from "../../translations.js";
|
|
258
230
|
import { isReactNode } from "../../utils/react.js";
|
|
259
231
|
import { useEnhancedModal } from "../use-enhanced-modal.js";
|
|
260
232
|
var StandardModalContent = function(_param) {
|
|
@@ -357,7 +329,7 @@ var StandardModalContent = function(_param) {
|
|
|
357
329
|
w: "full",
|
|
358
330
|
variant: "outline",
|
|
359
331
|
onClick: handleCancel,
|
|
360
|
-
children: modalContentConfig.cancelText ||
|
|
332
|
+
children: modalContentConfig.cancelText || translations.close
|
|
361
333
|
}),
|
|
362
334
|
/*#__PURE__*/ _jsx(Button, {
|
|
363
335
|
isDisabled: modalContentConfig.isOkDisabled,
|
|
@@ -366,7 +338,7 @@ var StandardModalContent = function(_param) {
|
|
|
366
338
|
variant: "solid",
|
|
367
339
|
onClick: handleOK,
|
|
368
340
|
colorScheme: modalContentConfig.okColorScheme,
|
|
369
|
-
children: modalContentConfig.okText ||
|
|
341
|
+
children: modalContentConfig.okText || translations.ok
|
|
370
342
|
})
|
|
371
343
|
]
|
|
372
344
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast-result.d.ts","sourceRoot":"","sources":["../../src/toast/use-toast-result.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"use-toast-result.d.ts","sourceRoot":"","sources":["../../src/toast/use-toast-result.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGvD,OAAO,EAML,KAAK,mBAAmB,EACxB,KAAK,OAAO,EACZ,KAAK,eAAe,EACrB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAmB,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAE/E,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,eAAe,CAAC,QAAQ,CAAC,CAAA;AAMjE,KAAK,qBAAqB,CAAC,CAAC,IAAI,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC,GAAG;IAC1F,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IAChD,KAAK,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAA;IACvD,WAAW,CAAC,EAAE,eAAe,CAAC,aAAa,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAA;CACpE,CAAA;AAED,KAAK,oBAAoB,CAAC,CAAC,GAAG,OAAO,IAAI,qBAAqB,CAAC,CAAC,CAAC,GAAG;IAClE,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,KAAK,qBAAqB,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,EAAE,CAAC,GAAG,OAAO,IAAI;IAC3D,cAAc,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAA;IACzC,OAAO,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,IAAI,CAAA;IACnD,KAAK,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,IAAI,CAAA;CACjD,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,YAAY,EAAE,CAAC,CAAC,SAAS,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAA;IACnG,YAAY,EAAE,CAAC,CAAC,SAAS,GAAG,EAAE,eAAe,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAA;IACpF,WAAW,EAAE,CAAC,CAAC,SAAS,OAAO,EAAE,CAAC,SAAS,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAC9E,MAAM,EAAE,CAAC,EACT,mBAAmB,CAAC,EAAE,qBAAqB,CAAC,CAAC,EAAE,OAAO,CAAC,KACpD,OAAO,GAAG,SAAS,CAAA;IACxB,UAAU,EAAE,CAAC,eAAe,CAAC,EAAE,eAAe,KAAK,OAAO,CAAA;IAC1D,KAAK,EAAE,mBAAmB,CAAA;CAC3B,CAAA;AAkBD,eAAO,MAAM,uBAAuB,eAAgB,gBAAgB,aAInE,CAAA;AAeD,eAAO,MAAM,cAAc,aAAc,qBAAqB,KAAG,cAkFhE,CAAA"}
|
|
@@ -77,57 +77,11 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
77
77
|
}
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
|
-
function _tagged_template_literal(strings, raw) {
|
|
81
|
-
if (!raw) {
|
|
82
|
-
raw = strings.slice(0);
|
|
83
|
-
}
|
|
84
|
-
return Object.freeze(Object.defineProperties(strings, {
|
|
85
|
-
raw: {
|
|
86
|
-
value: Object.freeze(raw)
|
|
87
|
-
}
|
|
88
|
-
}));
|
|
89
|
-
}
|
|
90
|
-
function _templateObject() {
|
|
91
|
-
var data = _tagged_template_literal([
|
|
92
|
-
"Success"
|
|
93
|
-
]);
|
|
94
|
-
_templateObject = function _templateObject() {
|
|
95
|
-
return data;
|
|
96
|
-
};
|
|
97
|
-
return data;
|
|
98
|
-
}
|
|
99
|
-
function _templateObject1() {
|
|
100
|
-
var data = _tagged_template_literal([
|
|
101
|
-
"The operation was done successfully"
|
|
102
|
-
]);
|
|
103
|
-
_templateObject1 = function _templateObject() {
|
|
104
|
-
return data;
|
|
105
|
-
};
|
|
106
|
-
return data;
|
|
107
|
-
}
|
|
108
|
-
function _templateObject2() {
|
|
109
|
-
var data = _tagged_template_literal([
|
|
110
|
-
"Operation Failed"
|
|
111
|
-
]);
|
|
112
|
-
_templateObject2 = function _templateObject() {
|
|
113
|
-
return data;
|
|
114
|
-
};
|
|
115
|
-
return data;
|
|
116
|
-
}
|
|
117
|
-
function _templateObject3() {
|
|
118
|
-
var data = _tagged_template_literal([
|
|
119
|
-
"There was a problem while performing this operation"
|
|
120
|
-
]);
|
|
121
|
-
_templateObject3 = function _templateObject() {
|
|
122
|
-
return data;
|
|
123
|
-
};
|
|
124
|
-
return data;
|
|
125
|
-
}
|
|
126
80
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
127
|
-
import { t } from "@lingui/macro";
|
|
128
81
|
import merge from "lodash/merge.js";
|
|
129
82
|
import { useCallback } from "react";
|
|
130
83
|
import { Box, ListItem, Text, UnorderedList, useToast } from "../chakra.js";
|
|
84
|
+
import { translations } from "../translations.js";
|
|
131
85
|
import { accessReactNode } from "../utils/accessors.js";
|
|
132
86
|
var accessStatus = function(s, data) {
|
|
133
87
|
return typeof s === "function" ? s(data) : s;
|
|
@@ -135,14 +89,14 @@ var accessStatus = function(s, data) {
|
|
|
135
89
|
var defaultUseToastResultOptions = {
|
|
136
90
|
success: {
|
|
137
91
|
status: "success",
|
|
138
|
-
title:
|
|
139
|
-
description:
|
|
92
|
+
title: translations.success,
|
|
93
|
+
description: translations.successDescription,
|
|
140
94
|
isClosable: true
|
|
141
95
|
},
|
|
142
96
|
error: {
|
|
143
97
|
status: "error",
|
|
144
|
-
title:
|
|
145
|
-
defaultDescription:
|
|
98
|
+
title: translations.failed,
|
|
99
|
+
defaultDescription: translations.failedDescription,
|
|
146
100
|
showValidationErrors: true,
|
|
147
101
|
isClosable: true
|
|
148
102
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type Translations = typeof translations;
|
|
2
|
+
export declare const translations: {
|
|
3
|
+
success: string;
|
|
4
|
+
successDescription: string;
|
|
5
|
+
failed: string;
|
|
6
|
+
failedDescription: string;
|
|
7
|
+
cancel: string;
|
|
8
|
+
confirm: string;
|
|
9
|
+
close: string;
|
|
10
|
+
ok: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const setTranslations: (ts: Partial<Translations>) => void;
|
|
13
|
+
export declare const setTranslation: <K extends "success" | "successDescription" | "failed" | "failedDescription" | "cancel" | "confirm" | "close" | "ok">(key: K, value: {
|
|
14
|
+
success: string;
|
|
15
|
+
successDescription: string;
|
|
16
|
+
failed: string;
|
|
17
|
+
failedDescription: string;
|
|
18
|
+
cancel: string;
|
|
19
|
+
confirm: string;
|
|
20
|
+
close: string;
|
|
21
|
+
ok: string;
|
|
22
|
+
}[K]) => void;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../src/translations.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG,OAAO,YAAY,CAAA;AAEvC,eAAO,MAAM,YAAY;;;;;;;;;CASxB,CAAA;AAED,eAAO,MAAM,eAAe,OAAQ,QAAQ,YAAY,CAAC,SAKxD,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;aAE1B,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export var translations = {
|
|
2
|
+
success: "Success",
|
|
3
|
+
successDescription: "Operation completed successfully.",
|
|
4
|
+
failed: "Operation Failed",
|
|
5
|
+
failedDescription: "There was a problem while performing this operation.",
|
|
6
|
+
cancel: "Cancel",
|
|
7
|
+
confirm: "Confirm",
|
|
8
|
+
close: "Close",
|
|
9
|
+
ok: "Ok"
|
|
10
|
+
};
|
|
11
|
+
export var setTranslations = function(ts) {
|
|
12
|
+
for(var key in ts){
|
|
13
|
+
// @ts-expect-error
|
|
14
|
+
translations[key] = ts[key];
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export var setTranslation = function(key, value) {
|
|
18
|
+
translations[key] = value;
|
|
19
|
+
};
|
package/dist/utils/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function isReactComponent(Component: any): Component is
|
|
3
|
-
export declare function isReactElement(element: any): element is
|
|
4
|
-
export declare function isReactNode(node: any): node is
|
|
1
|
+
import { type ComponentType, type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
export declare function isReactComponent(Component: any): Component is ComponentType<any>;
|
|
3
|
+
export declare function isReactElement(element: any): element is ReactElement;
|
|
4
|
+
export declare function isReactNode(node: any): node is ReactNode;
|
|
5
5
|
//# sourceMappingURL=react.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/utils/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/utils/react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE7F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,GAAG,GAAG,SAAS,IAAI,aAAa,CAAC,GAAG,CAAC,CAMhF;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,YAAY,CAGpE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,SAAS,CAgBxD"}
|
package/dist/utils/react.js
CHANGED
|
@@ -5,10 +5,10 @@ function _instanceof(left, right) {
|
|
|
5
5
|
return left instanceof right;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
import {
|
|
8
|
+
import { isValidElement } from "react";
|
|
9
9
|
export function isReactComponent(Component) {
|
|
10
10
|
return typeof Component === "function" && // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- React component, it's fine
|
|
11
|
-
(_instanceof(Component.prototype,
|
|
11
|
+
(_instanceof(Component.prototype, Component) || Component.displayName !== undefined);
|
|
12
12
|
}
|
|
13
13
|
export function isReactElement(element) {
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- isValidElement is a validation function
|