@veracity/vui 0.1.0 → 0.2.1
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/avatar/avatar.js +5 -5
- package/box/box.js +6 -6
- package/button/button.js +19 -23
- package/button/button.types.d.ts +33 -3
- package/button/buttonIcon.js +3 -3
- package/button/buttonText.js +3 -3
- package/button/buttons.js +8 -8
- package/button/context.js +1 -1
- package/button/theme.js +0 -6
- package/buttonGroup/buttonGroup.js +5 -10
- package/buttonGroup/context.js +1 -1
- package/card/card.js +4 -4
- package/checkbox/checkbox.js +13 -13
- package/checkbox/checkboxGroup.js +7 -7
- package/checkbox/checkboxGroup.types.d.ts +1 -1
- package/checkbox/context.js +1 -1
- package/checkbox/theme.js +5 -2
- package/core/globalStyle.js +2 -3
- package/core/resetCSS.js +1 -1
- package/core/styled.js +11 -7
- package/core/utils.js +10 -10
- package/core/v.js +1 -1
- package/divider/divider.js +6 -6
- package/divider/divider.types.d.ts +1 -0
- package/heading/heading.js +6 -6
- package/heading/headings.js +6 -6
- package/icon/icon.js +6 -6
- package/icons/library.js +9 -5
- package/image/image.js +4 -4
- package/image/image.types.d.ts +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/input/context.js +1 -1
- package/input/input.js +13 -17
- package/input/inputIcon.js +3 -3
- package/input/inputInput.js +4 -4
- package/link/link.js +6 -6
- package/list/context.js +1 -1
- package/list/list.js +6 -11
- package/list/listHeading.js +3 -3
- package/list/listIcon.js +3 -3
- package/list/listItem.js +8 -8
- package/list/listText.js +3 -3
- package/notification/consts.d.ts +2 -0
- package/{alert → notification}/consts.js +7 -7
- package/notification/context.d.ts +4 -0
- package/{alert → notification}/context.js +4 -4
- package/notification/index.d.ts +8 -0
- package/{alert → notification}/index.js +8 -8
- package/notification/notification.d.ts +13 -0
- package/{alert/alert.js → notification/notification.js} +21 -26
- package/notification/notification.types.d.ts +20 -0
- package/notification/notificationButton.d.ts +3 -0
- package/notification/notificationButton.js +30 -0
- package/notification/notificationIcon.d.ts +3 -0
- package/{alert/alertIcon.js → notification/notificationIcon.js} +9 -9
- package/notification/notificationText.d.ts +3 -0
- package/{alert/alertText.js → notification/notificationText.js} +8 -8
- package/notification/notificationTitle.d.ts +3 -0
- package/{alert/alertTitle.js → notification/notificationTitle.js} +8 -8
- package/{alert → notification}/theme.d.ts +0 -17
- package/{alert → notification}/theme.js +0 -23
- package/p/p.js +6 -6
- package/package.json +2 -3
- package/panel/panel.js +4 -4
- package/radio/context.js +1 -1
- package/radio/radio.js +59 -14
- package/radio/radioGroup.js +25 -17
- package/radio/radioGroup.types.d.ts +1 -1
- package/radio/theme.js +5 -2
- package/skeleton/skeleton.js +6 -6
- package/skeleton/skeleton.types.d.ts +1 -0
- package/spinner/spinner.js +5 -5
- package/spinner/spinner.types.d.ts +1 -0
- package/svg/cache.js +1 -5
- package/svg/svg.js +14 -15
- package/switch/context.js +1 -1
- package/switch/switch.js +13 -51
- package/switch/switch.types.d.ts +2 -2
- package/switch/switchButton.js +21 -23
- package/switch/switchLabel.js +3 -3
- package/system/custom.d.ts +11 -7
- package/system/custom.js +24 -13
- package/system/system.d.ts +4 -3
- package/system/system.js +2 -2
- package/system/tables.d.ts +14 -0
- package/system/tables.js +2 -0
- package/t/t.js +6 -6
- package/tag/context.js +1 -1
- package/tag/index.d.ts +1 -0
- package/tag/index.js +1 -0
- package/tag/tag.d.ts +2 -0
- package/tag/tag.js +14 -12
- package/tag/tag.types.d.ts +1 -0
- package/tag/tagButton.d.ts +3 -0
- package/{alert/alertButton.js → tag/tagButton.js} +9 -9
- package/tag/tagIcon.js +3 -3
- package/tag/tagText.js +3 -3
- package/tag/theme.d.ts +26 -0
- package/tag/theme.js +32 -3
- package/textarea/textarea.js +10 -9
- package/textarea/textarea.types.d.ts +1 -0
- package/theme/components.d.ts +54 -44
- package/theme/components.js +26 -26
- package/theme/defaultTheme.d.ts +54 -44
- package/theme/foundations/shadows.js +2 -2
- package/theme/index.d.ts +16 -0
- package/theme/index.js +33 -1
- package/utils/assertion.d.ts +1 -1
- package/utils/assertion.js +1 -2
- package/utils/function.js +9 -5
- package/utils/object.d.ts +1 -12
- package/utils/object.js +4 -29
- package/alert/alert.d.ts +0 -13
- package/alert/alert.types.d.ts +0 -20
- package/alert/alertButton.d.ts +0 -3
- package/alert/alertIcon.d.ts +0 -3
- package/alert/alertText.d.ts +0 -3
- package/alert/alertTitle.d.ts +0 -3
- package/alert/consts.d.ts +0 -2
- package/alert/context.d.ts +0 -4
- package/alert/index.d.ts +0 -8
- /package/{alert/alert.types.js → notification/notification.types.js} +0 -0
package/theme/defaultTheme.d.ts
CHANGED
|
@@ -161,50 +161,6 @@ declare const defaultTheme: {
|
|
|
161
161
|
transitions: {};
|
|
162
162
|
zIndices: {};
|
|
163
163
|
components: {
|
|
164
|
-
Alert: {
|
|
165
|
-
defaultProps: {
|
|
166
|
-
colorScheme: string;
|
|
167
|
-
variant: string;
|
|
168
|
-
};
|
|
169
|
-
parts: string[];
|
|
170
|
-
sizes: {};
|
|
171
|
-
variants: {
|
|
172
|
-
solid: (props: import("..").Dict<any>) => {
|
|
173
|
-
container: {
|
|
174
|
-
bg: string;
|
|
175
|
-
color: string;
|
|
176
|
-
};
|
|
177
|
-
button: {
|
|
178
|
-
bg: string;
|
|
179
|
-
borderColor: string;
|
|
180
|
-
hoverBg: string;
|
|
181
|
-
hoverBorderColor: string;
|
|
182
|
-
};
|
|
183
|
-
icon: {};
|
|
184
|
-
message: {};
|
|
185
|
-
text: {};
|
|
186
|
-
title: {};
|
|
187
|
-
};
|
|
188
|
-
subtle: (props: import("..").Dict<any>) => {
|
|
189
|
-
container: {
|
|
190
|
-
bg: string;
|
|
191
|
-
borderColor: string;
|
|
192
|
-
borderWidth: number;
|
|
193
|
-
color: string;
|
|
194
|
-
};
|
|
195
|
-
button: {
|
|
196
|
-
color: string;
|
|
197
|
-
hoverBg: string;
|
|
198
|
-
activeBg: string;
|
|
199
|
-
variant: string;
|
|
200
|
-
};
|
|
201
|
-
icon: {};
|
|
202
|
-
message: {};
|
|
203
|
-
text: {};
|
|
204
|
-
title: {};
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
};
|
|
208
164
|
Avatar: {
|
|
209
165
|
defaultProps: {
|
|
210
166
|
colorScheme: string;
|
|
@@ -670,6 +626,34 @@ declare const defaultTheme: {
|
|
|
670
626
|
};
|
|
671
627
|
};
|
|
672
628
|
};
|
|
629
|
+
Notification: {
|
|
630
|
+
defaultProps: {
|
|
631
|
+
colorScheme: string;
|
|
632
|
+
variant: string;
|
|
633
|
+
};
|
|
634
|
+
parts: string[];
|
|
635
|
+
sizes: {};
|
|
636
|
+
variants: {
|
|
637
|
+
subtle: (props: import("..").Dict<any>) => {
|
|
638
|
+
container: {
|
|
639
|
+
bg: string;
|
|
640
|
+
borderColor: string;
|
|
641
|
+
borderWidth: number;
|
|
642
|
+
color: string;
|
|
643
|
+
};
|
|
644
|
+
button: {
|
|
645
|
+
color: string;
|
|
646
|
+
hoverBg: string;
|
|
647
|
+
activeBg: string;
|
|
648
|
+
variant: string;
|
|
649
|
+
};
|
|
650
|
+
icon: {};
|
|
651
|
+
message: {};
|
|
652
|
+
text: {};
|
|
653
|
+
title: {};
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
};
|
|
673
657
|
P: {
|
|
674
658
|
defaultProps: {
|
|
675
659
|
size: string;
|
|
@@ -964,6 +948,9 @@ declare const defaultTheme: {
|
|
|
964
948
|
h: number;
|
|
965
949
|
spaceX: number;
|
|
966
950
|
};
|
|
951
|
+
button: {
|
|
952
|
+
size: string;
|
|
953
|
+
};
|
|
967
954
|
icon: {
|
|
968
955
|
size: string;
|
|
969
956
|
};
|
|
@@ -975,6 +962,9 @@ declare const defaultTheme: {
|
|
|
975
962
|
h: number;
|
|
976
963
|
spaceX: number;
|
|
977
964
|
};
|
|
965
|
+
button: {
|
|
966
|
+
size: string;
|
|
967
|
+
};
|
|
978
968
|
icon: {
|
|
979
969
|
size: string;
|
|
980
970
|
};
|
|
@@ -986,6 +976,9 @@ declare const defaultTheme: {
|
|
|
986
976
|
h: number;
|
|
987
977
|
spaceX: number;
|
|
988
978
|
};
|
|
979
|
+
button: {
|
|
980
|
+
size: string;
|
|
981
|
+
};
|
|
989
982
|
icon: {
|
|
990
983
|
size: string;
|
|
991
984
|
};
|
|
@@ -1000,6 +993,15 @@ declare const defaultTheme: {
|
|
|
1000
993
|
bg: string;
|
|
1001
994
|
color: string;
|
|
1002
995
|
};
|
|
996
|
+
button: {
|
|
997
|
+
hoverBorderColor: string;
|
|
998
|
+
borderColor: string;
|
|
999
|
+
color: string;
|
|
1000
|
+
hoverBg: string;
|
|
1001
|
+
activeBg: string;
|
|
1002
|
+
bg: string;
|
|
1003
|
+
variant: string;
|
|
1004
|
+
};
|
|
1003
1005
|
};
|
|
1004
1006
|
subtle: (props: import("..").Dict<any>) => {
|
|
1005
1007
|
container: {
|
|
@@ -1008,6 +1010,14 @@ declare const defaultTheme: {
|
|
|
1008
1010
|
bg: string;
|
|
1009
1011
|
color: string;
|
|
1010
1012
|
};
|
|
1013
|
+
button: {
|
|
1014
|
+
hoverBorderColor: string;
|
|
1015
|
+
borderColor: string;
|
|
1016
|
+
color: string;
|
|
1017
|
+
hoverBg: string;
|
|
1018
|
+
activeBg: string;
|
|
1019
|
+
variant: string;
|
|
1020
|
+
};
|
|
1011
1021
|
};
|
|
1012
1022
|
};
|
|
1013
1023
|
};
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var colors_1 = require("./colors");
|
|
4
4
|
var utils_1 = require("../../utils");
|
|
5
|
-
var greyLight = utils_1.hexToRGB(colors_1.grey[80], 0.4);
|
|
6
|
-
var greyDark = utils_1.hexToRGB(colors_1.grey[80], 0.6);
|
|
5
|
+
var greyLight = (0, utils_1.hexToRGB)(colors_1.grey[80], 0.4);
|
|
6
|
+
var greyDark = (0, utils_1.hexToRGB)(colors_1.grey[80], 0.6);
|
|
7
7
|
exports.default = {
|
|
8
8
|
'0': "0 0 0 0 #fff",
|
|
9
9
|
'1': "0 2px 5px 0 " + greyLight,
|
package/theme/index.d.ts
CHANGED
|
@@ -2,5 +2,21 @@ import defaultTheme from './defaultTheme';
|
|
|
2
2
|
export { default as components } from './components';
|
|
3
3
|
export { default as defaultTheme } from './defaultTheme';
|
|
4
4
|
export { default as foundations } from './foundations';
|
|
5
|
+
export { default as animations } from './foundations/animations';
|
|
6
|
+
export { default as borders } from './foundations/borders';
|
|
7
|
+
export { default as colors } from './foundations/colors';
|
|
8
|
+
export { default as durations } from './foundations/durations';
|
|
9
|
+
export { default as fonts } from './foundations/fonts';
|
|
10
|
+
export { default as fontSizes } from './foundations/fontSizes';
|
|
11
|
+
export { default as fontWeights } from './foundations/fontWeights';
|
|
12
|
+
export { default as radii } from './foundations/radii';
|
|
13
|
+
export { default as ringWidths } from './foundations/ringWidths';
|
|
14
|
+
export { default as screens } from './foundations/screens';
|
|
15
|
+
export { default as shadows } from './foundations/shadows';
|
|
16
|
+
export { default as sizes } from './foundations/sizes';
|
|
17
|
+
export { default as spaces } from './foundations/spaces';
|
|
18
|
+
export { default as transforms } from './foundations/transforms';
|
|
19
|
+
export { default as transitions } from './foundations/transitions';
|
|
20
|
+
export { default as zIndices } from './foundations/zIndices';
|
|
5
21
|
export * from './types';
|
|
6
22
|
export default defaultTheme;
|
package/theme/index.js
CHANGED
|
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.foundations = exports.defaultTheme = exports.components = void 0;
|
|
16
|
+
exports.zIndices = exports.transitions = exports.transforms = exports.spaces = exports.sizes = exports.shadows = exports.screens = exports.ringWidths = exports.radii = exports.fontWeights = exports.fontSizes = exports.fonts = exports.durations = exports.colors = exports.borders = exports.animations = exports.foundations = exports.defaultTheme = exports.components = void 0;
|
|
17
17
|
var defaultTheme_1 = __importDefault(require("./defaultTheme"));
|
|
18
18
|
var components_1 = require("./components");
|
|
19
19
|
Object.defineProperty(exports, "components", { enumerable: true, get: function () { return __importDefault(components_1).default; } });
|
|
@@ -21,5 +21,37 @@ var defaultTheme_2 = require("./defaultTheme");
|
|
|
21
21
|
Object.defineProperty(exports, "defaultTheme", { enumerable: true, get: function () { return __importDefault(defaultTheme_2).default; } });
|
|
22
22
|
var foundations_1 = require("./foundations");
|
|
23
23
|
Object.defineProperty(exports, "foundations", { enumerable: true, get: function () { return __importDefault(foundations_1).default; } });
|
|
24
|
+
var animations_1 = require("./foundations/animations");
|
|
25
|
+
Object.defineProperty(exports, "animations", { enumerable: true, get: function () { return __importDefault(animations_1).default; } });
|
|
26
|
+
var borders_1 = require("./foundations/borders");
|
|
27
|
+
Object.defineProperty(exports, "borders", { enumerable: true, get: function () { return __importDefault(borders_1).default; } });
|
|
28
|
+
var colors_1 = require("./foundations/colors");
|
|
29
|
+
Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return __importDefault(colors_1).default; } });
|
|
30
|
+
var durations_1 = require("./foundations/durations");
|
|
31
|
+
Object.defineProperty(exports, "durations", { enumerable: true, get: function () { return __importDefault(durations_1).default; } });
|
|
32
|
+
var fonts_1 = require("./foundations/fonts");
|
|
33
|
+
Object.defineProperty(exports, "fonts", { enumerable: true, get: function () { return __importDefault(fonts_1).default; } });
|
|
34
|
+
var fontSizes_1 = require("./foundations/fontSizes");
|
|
35
|
+
Object.defineProperty(exports, "fontSizes", { enumerable: true, get: function () { return __importDefault(fontSizes_1).default; } });
|
|
36
|
+
var fontWeights_1 = require("./foundations/fontWeights");
|
|
37
|
+
Object.defineProperty(exports, "fontWeights", { enumerable: true, get: function () { return __importDefault(fontWeights_1).default; } });
|
|
38
|
+
var radii_1 = require("./foundations/radii");
|
|
39
|
+
Object.defineProperty(exports, "radii", { enumerable: true, get: function () { return __importDefault(radii_1).default; } });
|
|
40
|
+
var ringWidths_1 = require("./foundations/ringWidths");
|
|
41
|
+
Object.defineProperty(exports, "ringWidths", { enumerable: true, get: function () { return __importDefault(ringWidths_1).default; } });
|
|
42
|
+
var screens_1 = require("./foundations/screens");
|
|
43
|
+
Object.defineProperty(exports, "screens", { enumerable: true, get: function () { return __importDefault(screens_1).default; } });
|
|
44
|
+
var shadows_1 = require("./foundations/shadows");
|
|
45
|
+
Object.defineProperty(exports, "shadows", { enumerable: true, get: function () { return __importDefault(shadows_1).default; } });
|
|
46
|
+
var sizes_1 = require("./foundations/sizes");
|
|
47
|
+
Object.defineProperty(exports, "sizes", { enumerable: true, get: function () { return __importDefault(sizes_1).default; } });
|
|
48
|
+
var spaces_1 = require("./foundations/spaces");
|
|
49
|
+
Object.defineProperty(exports, "spaces", { enumerable: true, get: function () { return __importDefault(spaces_1).default; } });
|
|
50
|
+
var transforms_1 = require("./foundations/transforms");
|
|
51
|
+
Object.defineProperty(exports, "transforms", { enumerable: true, get: function () { return __importDefault(transforms_1).default; } });
|
|
52
|
+
var transitions_1 = require("./foundations/transitions");
|
|
53
|
+
Object.defineProperty(exports, "transitions", { enumerable: true, get: function () { return __importDefault(transitions_1).default; } });
|
|
54
|
+
var zIndices_1 = require("./foundations/zIndices");
|
|
55
|
+
Object.defineProperty(exports, "zIndices", { enumerable: true, get: function () { return __importDefault(zIndices_1).default; } });
|
|
24
56
|
__exportStar(require("./types"), exports);
|
|
25
57
|
exports.default = defaultTheme_1.default;
|
package/utils/assertion.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Dict } from './types';
|
|
3
3
|
/** Is value an array. */
|
|
4
|
-
export declare function isArray<T>(value: any): value is
|
|
4
|
+
export declare function isArray<T>(value: any): value is T[];
|
|
5
5
|
/** Is value a function. */
|
|
6
6
|
export declare function isFunction<T>(value: any): value is T;
|
|
7
7
|
/** Is value a number. */
|
package/utils/assertion.js
CHANGED
|
@@ -18,8 +18,7 @@ function isNumber(value) {
|
|
|
18
18
|
exports.isNumber = isNumber;
|
|
19
19
|
/** Is value an object. */
|
|
20
20
|
function isObject(value) {
|
|
21
|
-
|
|
22
|
-
return value !== null && (type === 'object' || type === 'function') && !isArray(value);
|
|
21
|
+
return !!value && typeof value === 'object' && !isFunction(value) && !isArray(value);
|
|
23
22
|
}
|
|
24
23
|
exports.isObject = isObject;
|
|
25
24
|
/** Is value a valid ReactText - string or number */
|
package/utils/function.js
CHANGED
|
@@ -15,10 +15,14 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
15
15
|
}
|
|
16
16
|
return ar;
|
|
17
17
|
};
|
|
18
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
19
|
-
for (var i = 0,
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
22
26
|
};
|
|
23
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
28
|
exports.runIfFn = void 0;
|
|
@@ -31,6 +35,6 @@ function runIfFn(value) {
|
|
|
31
35
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
32
36
|
args[_i - 1] = arguments[_i];
|
|
33
37
|
}
|
|
34
|
-
return typeof value === 'function' ? value.apply(void 0, __spreadArray([], __read(args))) : value;
|
|
38
|
+
return typeof value === 'function' ? value.apply(void 0, __spreadArray([], __read(args), false)) : value;
|
|
35
39
|
}
|
|
36
40
|
exports.runIfFn = runIfFn;
|
package/utils/object.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { Dict } from './types';
|
|
2
2
|
/** Removes keys from an object if their value is undefined. */
|
|
3
3
|
export declare const filterUndefined: (object: Dict) => Dict<any>;
|
|
4
|
-
/**
|
|
5
|
-
* Recursively retrieves a nested property of a given object
|
|
6
|
-
* @param object
|
|
7
|
-
* @param path string, such as: 'user.name', or array ['user', 'name']
|
|
8
|
-
* @param separator used when path is a string to split individual keys
|
|
9
|
-
*/
|
|
10
|
-
export declare function get(object: Dict, path: string | string[], separator?: string): any | undefined;
|
|
11
4
|
/**
|
|
12
5
|
* Recursively deep merges two objects in an immutable fashion, following these rules:
|
|
13
6
|
* - Key exists in target and both keys are objects => merge
|
|
@@ -15,11 +8,7 @@ export declare function get(object: Dict, path: string | string[], separator?: s
|
|
|
15
8
|
* - Key isn't an object, an array or doesn't exist in target => override
|
|
16
9
|
*/
|
|
17
10
|
export declare function merge<Target extends Dict, Source extends Dict>(target: Target, source: Source): Target & Source;
|
|
18
|
-
declare type FilterFn<T> = (value: any, key: string, object: T) => boolean;
|
|
19
11
|
/**
|
|
20
12
|
* Returns the items of an object that meet the condition specified in a callback function.
|
|
21
13
|
*/
|
|
22
|
-
export declare function objectFilter<T extends Dict>(object: T, fn:
|
|
23
|
-
/** Removes given keys from an object. */
|
|
24
|
-
export declare function omit<T extends Dict, K extends keyof T>(object: T, keys: K[]): Omit<T, K>;
|
|
25
|
-
export {};
|
|
14
|
+
export declare function objectFilter<T extends Dict>(object: T, fn: (value: any, key: string, object: T) => boolean): Dict<any>;
|
package/utils/object.js
CHANGED
|
@@ -11,25 +11,11 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.objectFilter = exports.merge = exports.filterUndefined = void 0;
|
|
15
15
|
var assertion_1 = require("./assertion");
|
|
16
16
|
/** Removes keys from an object if their value is undefined. */
|
|
17
17
|
var filterUndefined = function (object) { return objectFilter(object, function (val) { return val !== null && val !== undefined; }); };
|
|
18
18
|
exports.filterUndefined = filterUndefined;
|
|
19
|
-
/**
|
|
20
|
-
* Recursively retrieves a nested property of a given object
|
|
21
|
-
* @param object
|
|
22
|
-
* @param path string, such as: 'user.name', or array ['user', 'name']
|
|
23
|
-
* @param separator used when path is a string to split individual keys
|
|
24
|
-
*/
|
|
25
|
-
function get(object, path, separator) {
|
|
26
|
-
if (separator === void 0) { separator = '.'; }
|
|
27
|
-
if (!assertion_1.isObject(object))
|
|
28
|
-
return;
|
|
29
|
-
var keys = Array.isArray(path) ? path : path.split(separator);
|
|
30
|
-
return keys.reduce(function (obj, property) { return obj === null || obj === void 0 ? void 0 : obj[property]; }, object);
|
|
31
|
-
}
|
|
32
|
-
exports.get = get;
|
|
33
19
|
/**
|
|
34
20
|
* Recursively deep merges two objects in an immutable fashion, following these rules:
|
|
35
21
|
* - Key exists in target and both keys are objects => merge
|
|
@@ -38,15 +24,15 @@ exports.get = get;
|
|
|
38
24
|
*/
|
|
39
25
|
function merge(target, source) {
|
|
40
26
|
var output = __assign({}, target);
|
|
41
|
-
if (assertion_1.isObject(target) && assertion_1.isObject(source)) {
|
|
27
|
+
if ((0, assertion_1.isObject)(target) && (0, assertion_1.isObject)(source)) {
|
|
42
28
|
Object.keys(source).forEach(function (key) {
|
|
43
29
|
var _a;
|
|
44
30
|
if (key === '__proto__')
|
|
45
31
|
return;
|
|
46
|
-
if (key in target && assertion_1.isObject(target[key]) && assertion_1.isObject(source[key])) {
|
|
32
|
+
if (key in target && (0, assertion_1.isObject)(target[key]) && (0, assertion_1.isObject)(source[key])) {
|
|
47
33
|
output[key] = merge(target[key], source[key]);
|
|
48
34
|
}
|
|
49
|
-
else if (key in target && assertion_1.isArray(target[key]) && assertion_1.isArray(source[key])) {
|
|
35
|
+
else if (key in target && (0, assertion_1.isArray)(target[key]) && (0, assertion_1.isArray)(source[key])) {
|
|
50
36
|
output[key] = (_a = target[key]) === null || _a === void 0 ? void 0 : _a.concat(source[key]);
|
|
51
37
|
}
|
|
52
38
|
else {
|
|
@@ -72,14 +58,3 @@ function objectFilter(object, fn) {
|
|
|
72
58
|
return result;
|
|
73
59
|
}
|
|
74
60
|
exports.objectFilter = objectFilter;
|
|
75
|
-
/** Removes given keys from an object. */
|
|
76
|
-
function omit(object, keys) {
|
|
77
|
-
var result = {};
|
|
78
|
-
Object.keys(object).forEach(function (key) {
|
|
79
|
-
if (keys.includes(key))
|
|
80
|
-
return;
|
|
81
|
-
result[key] = object[key];
|
|
82
|
-
});
|
|
83
|
-
return result;
|
|
84
|
-
}
|
|
85
|
-
exports.omit = omit;
|
package/alert/alert.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { AlertProps } from './alert.types';
|
|
2
|
-
import AlertButton from './alertButton';
|
|
3
|
-
import AlertIcon from './alertIcon';
|
|
4
|
-
import AlertText from './alertText';
|
|
5
|
-
import AlertTitle from './alertTitle';
|
|
6
|
-
import { VuiComponent } from '../core';
|
|
7
|
-
export declare const Alert: VuiComponent<"div", AlertProps> & {
|
|
8
|
-
Button: typeof AlertButton;
|
|
9
|
-
Icon: typeof AlertIcon;
|
|
10
|
-
Text: typeof AlertText;
|
|
11
|
-
Title: typeof AlertTitle;
|
|
12
|
-
};
|
|
13
|
-
export default Alert;
|
package/alert/alert.types.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { BoxProps } from '../box';
|
|
3
|
-
import { IconProp, IconProps } from '../icon';
|
|
4
|
-
import { ThemingProps } from '../theme';
|
|
5
|
-
import { AnyElement } from '../utils';
|
|
6
|
-
export interface AlertProps extends Omit<BoxProps, 'size' | 'variant'>, ThemingProps<'Alert'> {
|
|
7
|
-
action?: ReactNode;
|
|
8
|
-
colorScheme?: 'blue' | 'green' | 'grey' | 'prussian' | 'red' | 'yellow';
|
|
9
|
-
icon?: IconProp | AnyElement;
|
|
10
|
-
onClose?: () => void;
|
|
11
|
-
status?: AlertStatus;
|
|
12
|
-
statusMapping?: AlertStatusMapping;
|
|
13
|
-
text?: ReactNode;
|
|
14
|
-
title?: ReactNode;
|
|
15
|
-
}
|
|
16
|
-
export declare type AlertStatus = 'error' | 'info' | 'loading' | 'success' | 'warning';
|
|
17
|
-
export declare type AlertStatusMapping = Record<string, {
|
|
18
|
-
colorScheme?: AlertProps['colorScheme'];
|
|
19
|
-
iconProps: IconProps;
|
|
20
|
-
}>;
|
package/alert/alertButton.d.ts
DELETED
package/alert/alertIcon.d.ts
DELETED
package/alert/alertText.d.ts
DELETED
package/alert/alertTitle.d.ts
DELETED
package/alert/consts.d.ts
DELETED
package/alert/context.d.ts
DELETED
package/alert/index.d.ts
DELETED
|
File without changes
|