@veracity/vui 0.0.15 → 0.2.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.
- package/avatar/avatar.js +2 -2
- package/box/box.js +1 -1
- package/button/button.d.ts +7 -1
- package/button/button.js +56 -23
- package/button/button.types.d.ts +8 -6
- package/button/buttonIcon.d.ts +3 -0
- package/{alert/alertText.js → button/buttonIcon.js} +9 -9
- package/button/buttonText.d.ts +3 -0
- package/button/buttonText.js +30 -0
- package/button/buttons.d.ts +4 -3
- package/button/buttons.js +4 -3
- package/button/consts.js +3 -2
- package/button/context.d.ts +2 -2
- package/button/context.js +4 -4
- package/button/index.d.ts +2 -2
- package/button/index.js +2 -2
- package/button/theme.d.ts +79 -41
- package/button/theme.js +85 -46
- package/{button → buttonGroup}/buttonGroup.d.ts +3 -1
- package/{button → buttonGroup}/buttonGroup.js +4 -2
- package/buttonGroup/context.d.ts +4 -0
- package/buttonGroup/context.js +23 -0
- package/buttonGroup/helpers.d.ts +3 -0
- package/buttonGroup/helpers.js +10 -0
- package/buttonGroup/index.d.ts +4 -0
- package/{alert → buttonGroup}/index.js +4 -8
- package/card/card.d.ts +3 -0
- package/{tile/tile.js → card/card.js} +8 -7
- package/{tile/tile.types.d.ts → card/card.types.d.ts} +1 -1
- package/card/index.d.ts +3 -0
- package/{tile → card}/index.js +4 -4
- package/card/theme.d.ts +6 -0
- package/card/theme.js +10 -0
- package/checkbox/checkbox.js +4 -4
- package/checkbox/checkbox.types.d.ts +1 -1
- package/checkbox/checkboxGroup.types.d.ts +1 -1
- package/core/globalStyle.d.ts +4 -1
- package/core/globalStyle.js +7 -3
- package/core/index.d.ts +2 -0
- package/core/index.js +5 -1
- package/core/styled.d.ts +4 -0
- package/core/styled.js +80 -0
- package/core/types/component.d.ts +12 -12
- package/core/types/index.d.ts +1 -0
- package/core/types/index.js +1 -0
- package/core/types/styled.d.ts +11 -0
- package/core/utils.d.ts +2 -2
- package/core/utils.js +7 -7
- package/core/v.d.ts +182 -0
- package/core/v.js +6 -0
- package/core/vuiProvider.d.ts +13 -2
- package/core/vuiProvider.js +1 -1
- package/divider/divider.types.d.ts +1 -1
- package/heading/heading.types.d.ts +2 -1
- package/icon/helpers.d.ts +2 -3
- package/icon/helpers.js +6 -8
- package/icon/icon.js +3 -2
- package/icon/icon.types.d.ts +4 -2
- package/icons/library.js +1 -1
- package/icons/types.d.ts +1 -1
- package/image/image.d.ts +3 -0
- package/image/image.js +38 -0
- package/image/image.types.d.ts +5 -0
- package/image/index.d.ts +3 -0
- package/{label → image}/index.js +4 -4
- package/image/theme.d.ts +6 -0
- package/image/theme.js +10 -0
- package/index.d.ts +6 -3
- package/index.js +6 -3
- package/input/context.d.ts +4 -0
- package/{alert → input}/context.js +4 -4
- package/input/index.d.ts +2 -0
- package/input/index.js +2 -0
- package/input/input.d.ts +7 -2
- package/input/input.js +33 -22
- package/input/input.types.d.ts +7 -3
- package/input/inputIcon.d.ts +3 -0
- package/input/inputIcon.js +30 -0
- package/input/inputInput.d.ts +5 -0
- package/input/inputInput.js +36 -0
- package/input/theme.d.ts +40 -15
- package/input/theme.js +40 -16
- package/list/index.d.ts +3 -1
- package/list/index.js +3 -1
- package/list/list.d.ts +2 -0
- package/list/list.js +3 -1
- package/list/list.types.d.ts +19 -1
- package/list/listHeading.d.ts +2 -2
- package/list/listHeading.js +2 -2
- package/list/listIcon.js +1 -1
- package/list/listItem.d.ts +1 -1
- package/list/listItem.js +8 -5
- package/list/listText.d.ts +3 -0
- package/list/listText.js +30 -0
- package/list/theme.d.ts +20 -6
- package/list/theme.js +26 -12
- package/notification/consts.d.ts +2 -0
- package/{alert → notification}/consts.js +7 -7
- package/notification/context.d.ts +4 -0
- package/notification/context.js +23 -0
- package/notification/index.d.ts +8 -0
- package/notification/index.js +25 -0
- package/notification/notification.d.ts +13 -0
- package/{alert/alert.js → notification/notification.js} +25 -25
- package/notification/notification.types.d.ts +20 -0
- package/notification/notificationButton.d.ts +3 -0
- package/{alert/alertButton.js → notification/notificationButton.js} +8 -8
- package/notification/notificationIcon.d.ts +3 -0
- package/{alert/alertIcon.js → notification/notificationIcon.js} +9 -9
- package/notification/notificationText.d.ts +3 -0
- package/notification/notificationText.js +30 -0
- package/notification/notificationTitle.d.ts +3 -0
- package/notification/notificationTitle.js +30 -0
- package/{alert → notification}/theme.d.ts +0 -15
- package/{alert → notification}/theme.js +1 -22
- package/package.json +2 -3
- package/panel/index.d.ts +3 -0
- package/panel/index.js +20 -0
- package/panel/panel.d.ts +3 -0
- package/panel/panel.js +39 -0
- package/panel/panel.types.d.ts +4 -0
- package/{tile → panel}/theme.d.ts +1 -8
- package/{tile → panel}/theme.js +4 -11
- package/radio/radio.js +4 -4
- package/radio/radio.types.d.ts +1 -1
- package/radio/radioGroup.types.d.ts +1 -1
- package/skeleton/skeleton.types.d.ts +1 -0
- package/spinner/spinner.types.d.ts +1 -0
- package/svg/cache.js +1 -5
- package/svg/svg.js +2 -3
- package/switch/index.d.ts +0 -1
- package/switch/index.js +0 -1
- package/switch/switch.js +6 -6
- package/switch/switch.types.d.ts +19 -4
- package/switch/switchButton.d.ts +2 -2
- package/switch/switchButton.js +18 -19
- package/switch/theme.d.ts +41 -46
- package/switch/theme.js +50 -72
- package/system/borders.d.ts +3 -1
- package/system/custom.d.ts +24 -7
- package/system/custom.js +33 -13
- package/system/system.d.ts +2 -2
- package/system/system.js +1 -1
- package/t/t.types.d.ts +2 -1
- package/tag/context.d.ts +4 -0
- package/tag/context.js +23 -0
- package/tag/index.d.ts +6 -0
- package/tag/index.js +23 -0
- package/tag/tag.d.ts +11 -0
- package/tag/tag.js +99 -0
- package/{label/label.types.d.ts → tag/tag.types.d.ts} +6 -7
- package/tag/tag.types.js +2 -0
- package/tag/tagIcon.d.ts +3 -0
- package/{alert/alertTitle.js → tag/tagIcon.js} +9 -9
- package/tag/tagText.d.ts +3 -0
- package/tag/tagText.js +30 -0
- package/tag/theme.d.ts +65 -0
- package/tag/theme.js +78 -0
- package/textarea/textarea.js +2 -1
- package/textarea/textarea.types.d.ts +1 -0
- package/theme/components.d.ts +291 -223
- package/theme/components.js +32 -28
- package/theme/defaultTheme.d.ts +291 -223
- package/utils/assertion.d.ts +14 -0
- package/utils/assertion.js +34 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/object.d.ts +5 -18
- package/utils/object.js +17 -50
- package/utils/types.d.ts +2 -0
- 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/label/index.d.ts +0 -3
- package/label/label.d.ts +0 -5
- package/label/label.js +0 -71
- package/label/theme.d.ts +0 -61
- package/label/theme.js +0 -107
- package/list/listItem.types.d.ts +0 -16
- package/switch/switchButton.types.d.ts +0 -19
- package/tile/index.d.ts +0 -3
- package/tile/tile.d.ts +0 -3
- /package/{button → buttonGroup}/buttonGroup.types.d.ts +0 -0
- /package/{button → buttonGroup}/buttonGroup.types.js +0 -0
- /package/{alert/alert.types.js → card/card.types.js} +0 -0
- /package/{label/label.types.js → core/types/styled.js} +0 -0
- /package/{list/listItem.types.js → image/image.types.js} +0 -0
- /package/{switch/switchButton.types.js → notification/notification.types.js} +0 -0
- /package/{tile/tile.types.js → panel/panel.types.js} +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isString = exports.isReactText = exports.isObject = exports.isNumber = exports.isFunction = exports.isArray = void 0;
|
|
4
|
+
/** Is value an array. */
|
|
5
|
+
function isArray(value) {
|
|
6
|
+
return Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
exports.isArray = isArray;
|
|
9
|
+
/** Is value a function. */
|
|
10
|
+
function isFunction(value) {
|
|
11
|
+
return typeof value === 'function';
|
|
12
|
+
}
|
|
13
|
+
exports.isFunction = isFunction;
|
|
14
|
+
/** Is value a number. */
|
|
15
|
+
function isNumber(value) {
|
|
16
|
+
return typeof value === 'number';
|
|
17
|
+
}
|
|
18
|
+
exports.isNumber = isNumber;
|
|
19
|
+
/** Is value an object. */
|
|
20
|
+
function isObject(value) {
|
|
21
|
+
var type = typeof value;
|
|
22
|
+
return value !== null && (type === 'object' || type === 'function') && !isArray(value);
|
|
23
|
+
}
|
|
24
|
+
exports.isObject = isObject;
|
|
25
|
+
/** Is value a valid ReactText - string or number */
|
|
26
|
+
function isReactText(value) {
|
|
27
|
+
return isNumber(value) || isString(value);
|
|
28
|
+
}
|
|
29
|
+
exports.isReactText = isReactText;
|
|
30
|
+
/** Is value a string */
|
|
31
|
+
function isString(value) {
|
|
32
|
+
return Object.prototype.toString.call(value) === '[object String]';
|
|
33
|
+
}
|
|
34
|
+
exports.isString = isString;
|
package/utils/index.d.ts
CHANGED
package/utils/index.js
CHANGED
|
@@ -10,6 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
10
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./assertion"), exports);
|
|
13
14
|
__exportStar(require("./function"), exports);
|
|
14
15
|
__exportStar(require("./object"), exports);
|
|
15
16
|
__exportStar(require("./styles"), exports);
|
package/utils/object.d.ts
CHANGED
|
@@ -1,27 +1,14 @@
|
|
|
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
|
-
/** Checks if the item is an object. */
|
|
12
|
-
export declare function isObj(item: any): boolean;
|
|
13
4
|
/**
|
|
14
5
|
* Recursively deep merges two objects in an immutable fashion, following these rules:
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
6
|
+
* - Key exists in target and both keys are objects => merge
|
|
7
|
+
* - Key exists in target and both keys are arrays => concat (not unique)
|
|
8
|
+
* - Key isn't an object, an array or doesn't exist in target => override
|
|
18
9
|
*/
|
|
19
|
-
export declare function
|
|
20
|
-
declare type FilterFn<T> = (value: any, key: string, object: T) => boolean;
|
|
10
|
+
export declare function merge<Target extends Dict, Source extends Dict>(target: Target, source: Source): Target & Source;
|
|
21
11
|
/**
|
|
22
12
|
* Returns the items of an object that meet the condition specified in a callback function.
|
|
23
13
|
*/
|
|
24
|
-
export declare function objectFilter<T extends Dict>(object: T, fn:
|
|
25
|
-
/** Removes given keys from an object. */
|
|
26
|
-
export declare function omit<T extends Dict, K extends keyof T>(object: T, keys: K[]): Omit<T, K>;
|
|
27
|
-
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,60 +11,38 @@ 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
|
+
var assertion_1 = require("./assertion");
|
|
15
16
|
/** Removes keys from an object if their value is undefined. */
|
|
16
17
|
var filterUndefined = function (object) { return objectFilter(object, function (val) { return val !== null && val !== undefined; }); };
|
|
17
18
|
exports.filterUndefined = filterUndefined;
|
|
18
|
-
/**
|
|
19
|
-
* Recursively retrieves a nested property of a given object
|
|
20
|
-
* @param object
|
|
21
|
-
* @param path string, such as: 'user.name', or array ['user', 'name']
|
|
22
|
-
* @param separator used when path is a string to split individual keys
|
|
23
|
-
*/
|
|
24
|
-
function get(object, path, separator) {
|
|
25
|
-
if (separator === void 0) { separator = '.'; }
|
|
26
|
-
if (!isObj(object))
|
|
27
|
-
return;
|
|
28
|
-
var keys = Array.isArray(path) ? path : path.split(separator);
|
|
29
|
-
return keys.reduce(function (obj, property) { return obj === null || obj === void 0 ? void 0 : obj[property]; }, object);
|
|
30
|
-
}
|
|
31
|
-
exports.get = get;
|
|
32
|
-
/** Checks if the item is an object. */
|
|
33
|
-
function isObj(item) {
|
|
34
|
-
return item && typeof item === 'object' && item.constructor === Object;
|
|
35
|
-
}
|
|
36
|
-
exports.isObj = isObj;
|
|
37
19
|
/**
|
|
38
20
|
* Recursively deep merges two objects in an immutable fashion, following these rules:
|
|
39
|
-
* -
|
|
40
|
-
* -
|
|
41
|
-
* -
|
|
21
|
+
* - Key exists in target and both keys are objects => merge
|
|
22
|
+
* - Key exists in target and both keys are arrays => concat (not unique)
|
|
23
|
+
* - Key isn't an object, an array or doesn't exist in target => override
|
|
42
24
|
*/
|
|
43
|
-
function
|
|
44
|
-
var output;
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
25
|
+
function merge(target, source) {
|
|
26
|
+
var output = __assign({}, target);
|
|
27
|
+
if (assertion_1.isObject(target) && assertion_1.isObject(source)) {
|
|
28
|
+
Object.keys(source).forEach(function (key) {
|
|
29
|
+
var _a;
|
|
48
30
|
if (key === '__proto__')
|
|
49
31
|
return;
|
|
50
|
-
if (key in source) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
else {
|
|
56
|
-
output[key] = override[key];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
32
|
+
if (key in target && assertion_1.isObject(target[key]) && assertion_1.isObject(source[key])) {
|
|
33
|
+
output[key] = merge(target[key], source[key]);
|
|
34
|
+
}
|
|
35
|
+
else if (key in target && assertion_1.isArray(target[key]) && assertion_1.isArray(source[key])) {
|
|
36
|
+
output[key] = (_a = target[key]) === null || _a === void 0 ? void 0 : _a.concat(source[key]);
|
|
59
37
|
}
|
|
60
38
|
else {
|
|
61
|
-
output[key] =
|
|
39
|
+
output[key] = source[key];
|
|
62
40
|
}
|
|
63
41
|
});
|
|
64
42
|
}
|
|
65
43
|
return output;
|
|
66
44
|
}
|
|
67
|
-
exports.
|
|
45
|
+
exports.merge = merge;
|
|
68
46
|
/**
|
|
69
47
|
* Returns the items of an object that meet the condition specified in a callback function.
|
|
70
48
|
*/
|
|
@@ -80,14 +58,3 @@ function objectFilter(object, fn) {
|
|
|
80
58
|
return result;
|
|
81
59
|
}
|
|
82
60
|
exports.objectFilter = objectFilter;
|
|
83
|
-
/** Removes given keys from an object. */
|
|
84
|
-
function omit(object, keys) {
|
|
85
|
-
var result = {};
|
|
86
|
-
Object.keys(object).forEach(function (key) {
|
|
87
|
-
if (keys.includes(key))
|
|
88
|
-
return;
|
|
89
|
-
result[key] = object[key];
|
|
90
|
-
});
|
|
91
|
-
return result;
|
|
92
|
-
}
|
|
93
|
-
exports.omit = omit;
|
package/utils/types.d.ts
CHANGED
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 { IconProps } from '../icon';
|
|
4
|
-
import { VuiIcon } from '../icons';
|
|
5
|
-
import { ThemingProps } from '../theme';
|
|
6
|
-
export interface AlertProps extends Omit<BoxProps, 'size' | 'variant'>, ThemingProps<'Alert'> {
|
|
7
|
-
action?: ReactNode;
|
|
8
|
-
colorScheme?: 'blue' | 'green' | 'grey' | 'prussian' | 'red' | 'yellow';
|
|
9
|
-
icon?: VuiIcon | (ReactNode & {});
|
|
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
package/label/index.d.ts
DELETED
package/label/label.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { LabelProps } from './label.types';
|
|
2
|
-
import { SystemProps } from '../system';
|
|
3
|
-
export declare const LabelBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
4
|
-
export declare const Label: import("../core").VuiComponent<"span", LabelProps>;
|
|
5
|
-
export default Label;
|
package/label/label.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
|
-
var __assign = (this && this.__assign) || function () {
|
|
7
|
-
__assign = Object.assign || function(t) {
|
|
8
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9
|
-
s = arguments[i];
|
|
10
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
11
|
-
t[p] = s[p];
|
|
12
|
-
}
|
|
13
|
-
return t;
|
|
14
|
-
};
|
|
15
|
-
return __assign.apply(this, arguments);
|
|
16
|
-
};
|
|
17
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
|
-
var t = {};
|
|
19
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
20
|
-
t[p] = s[p];
|
|
21
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
22
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
23
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
24
|
-
t[p[i]] = s[p[i]];
|
|
25
|
-
}
|
|
26
|
-
return t;
|
|
27
|
-
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
exports.Label = exports.LabelBase = void 0;
|
|
33
|
-
var react_1 = __importDefault(require("react"));
|
|
34
|
-
var styled_components_1 = __importDefault(require("styled-components"));
|
|
35
|
-
var core_1 = require("../core");
|
|
36
|
-
var icon_1 = __importDefault(require("../icon"));
|
|
37
|
-
var system_1 = require("../system");
|
|
38
|
-
var utils_1 = require("../utils");
|
|
39
|
-
var Text = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.isTruncated);
|
|
40
|
-
exports.LabelBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\tline-height: normal;\n\tposition: relative;\n\twidth: fit-content;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tjustify-content: center;\n\tline-height: normal;\n\tposition: relative;\n\twidth: fit-content;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t\toutline: none;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
41
|
-
exports.Label = core_1.vui(function (props, ref) {
|
|
42
|
-
var _a = core_1.omitThemingProps(props), casing = _a.casing, children = _a.children, className = _a.className, icon = _a.icon, iconLeft = _a.iconLeft, iconRight = _a.iconRight, isElevated = _a.isElevated, isFullWidth = _a.isFullWidth, _b = _a.isInteractive, isInteractive = _b === void 0 ? props.onClick !== undefined : _b, isRound = _a.isRound, isSplit = _a.isSplit, _c = _a.isTruncated, isTruncated = _c === void 0 ? true : _c, itemLeft = _a.itemLeft, itemRight = _a.itemRight, text = _a.text, weight = _a.weight, rest = __rest(_a, ["casing", "children", "className", "icon", "iconLeft", "iconRight", "isElevated", "isFullWidth", "isInteractive", "isRound", "isSplit", "isTruncated", "itemLeft", "itemRight", "text", "weight"]);
|
|
43
|
-
var _d = core_1.useStyleConfig('Label', props), activeBg = _d.activeBg, h = _d.h, hoverBg = _d.hoverBg, _e = _d.iconSize, iconSize = _e === void 0 ? 'md' : _e, _f = _d.spaceX, spaceXBase = _f === void 0 ? 0 : _f, styles = __rest(_d, ["activeBg", "h", "hoverBg", "iconSize", "spaceX"]);
|
|
44
|
-
var spaceX = spaceXBase / 8;
|
|
45
|
-
var spaceXText = (spaceXBase + 4) / 8;
|
|
46
|
-
var iconRightMl = isSplit ? 'auto' : spaceX;
|
|
47
|
-
var pl = icon || itemLeft || iconLeft ? spaceX : spaceXText;
|
|
48
|
-
var pr = icon || itemRight || iconRight ? spaceX : spaceXText;
|
|
49
|
-
var interactiveProps = isInteractive
|
|
50
|
-
? {
|
|
51
|
-
cursor: 'pointer',
|
|
52
|
-
hoverBg: hoverBg,
|
|
53
|
-
activeBg: activeBg,
|
|
54
|
-
focusRing: 3,
|
|
55
|
-
tabIndex: 0,
|
|
56
|
-
userSelect: 'none'
|
|
57
|
-
}
|
|
58
|
-
: {};
|
|
59
|
-
var aliasedProps = utils_1.filterUndefined({
|
|
60
|
-
borderRadius: isRound ? h / 2 : undefined,
|
|
61
|
-
boxShadow: isElevated ? '1' : undefined,
|
|
62
|
-
fontWeight: weight,
|
|
63
|
-
textTransform: casing,
|
|
64
|
-
w: isFullWidth ? '100%' : undefined
|
|
65
|
-
});
|
|
66
|
-
return (react_1.default.createElement(exports.LabelBase, __assign({ borderRadius: "md", className: utils_1.cs('vui-label', className), fontWeight: "medium", h: h, pl: pl, pr: pr, ref: ref, transitionDuration: "fast" }, styles, interactiveProps, aliasedProps, rest), icon ? (react_1.default.createElement(icon_1.default, { icon: icon, size: iconSize })) : (react_1.default.createElement(react_1.default.Fragment, null, itemLeft !== null && itemLeft !== void 0 ? itemLeft : (iconLeft && react_1.default.createElement(icon_1.default, { icon: iconLeft, mr: spaceX, size: iconSize })),
|
|
67
|
-
react_1.default.createElement(Text, { isTruncated: isTruncated }, children !== null && children !== void 0 ? children : text), itemRight !== null && itemRight !== void 0 ? itemRight : (iconRight && react_1.default.createElement(icon_1.default, { icon: iconRight, ml: iconRightMl, size: iconSize }))))));
|
|
68
|
-
});
|
|
69
|
-
exports.Label.displayName = 'Label';
|
|
70
|
-
exports.default = exports.Label;
|
|
71
|
-
var templateObject_1, templateObject_2;
|
package/label/theme.d.ts
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { Dict } from '../utils';
|
|
2
|
-
declare function variantOutlined(props: Dict): {
|
|
3
|
-
hoverBg: string;
|
|
4
|
-
activeBg: string;
|
|
5
|
-
bg: string;
|
|
6
|
-
color: string;
|
|
7
|
-
borderColor: string;
|
|
8
|
-
borderWidth: number;
|
|
9
|
-
};
|
|
10
|
-
declare function variantSolid(props: Dict): {
|
|
11
|
-
hoverBg: string;
|
|
12
|
-
activeBg: string;
|
|
13
|
-
bg: string;
|
|
14
|
-
color: string;
|
|
15
|
-
};
|
|
16
|
-
declare function variantSubtle(props: Dict): {
|
|
17
|
-
hoverBg: string;
|
|
18
|
-
activeBg: string;
|
|
19
|
-
bg: string;
|
|
20
|
-
color: string;
|
|
21
|
-
};
|
|
22
|
-
declare function variantText(props: Dict): {
|
|
23
|
-
hoverBg: string;
|
|
24
|
-
activeBg: string;
|
|
25
|
-
bg: string;
|
|
26
|
-
color: string;
|
|
27
|
-
};
|
|
28
|
-
declare const _default: {
|
|
29
|
-
defaultProps: {
|
|
30
|
-
colorScheme: string;
|
|
31
|
-
size: string;
|
|
32
|
-
variant: string;
|
|
33
|
-
};
|
|
34
|
-
sizes: {
|
|
35
|
-
sm: {
|
|
36
|
-
fontSize: string;
|
|
37
|
-
h: number;
|
|
38
|
-
iconSize: string;
|
|
39
|
-
spaceX: number;
|
|
40
|
-
};
|
|
41
|
-
md: {
|
|
42
|
-
fontSize: string;
|
|
43
|
-
h: number;
|
|
44
|
-
iconSize: string;
|
|
45
|
-
spaceX: number;
|
|
46
|
-
};
|
|
47
|
-
lg: {
|
|
48
|
-
fontSize: string;
|
|
49
|
-
h: number;
|
|
50
|
-
iconSize: string;
|
|
51
|
-
spaceX: number;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
variants: {
|
|
55
|
-
outlined: typeof variantOutlined;
|
|
56
|
-
solid: typeof variantSolid;
|
|
57
|
-
subtle: typeof variantSubtle;
|
|
58
|
-
text: typeof variantText;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
export default _default;
|
package/label/theme.js
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
function variantOutlined(props) {
|
|
15
|
-
var c = props.colorScheme;
|
|
16
|
-
var styles = __assign({ borderColor: c + ".80", borderWidth: 1 }, variantText(props));
|
|
17
|
-
return styles;
|
|
18
|
-
}
|
|
19
|
-
function variantSolid(props) {
|
|
20
|
-
var c = props.colorScheme;
|
|
21
|
-
var styles = {
|
|
22
|
-
hoverBg: c + ".90",
|
|
23
|
-
activeBg: c + ".100",
|
|
24
|
-
bg: c + ".80",
|
|
25
|
-
color: 'white'
|
|
26
|
-
};
|
|
27
|
-
if (c === 'yellow') {
|
|
28
|
-
styles.hoverBg = c + ".80";
|
|
29
|
-
styles.activeBg = c + ".90";
|
|
30
|
-
styles.bg = c + ".70";
|
|
31
|
-
}
|
|
32
|
-
return styles;
|
|
33
|
-
}
|
|
34
|
-
function variantSubtle(props) {
|
|
35
|
-
var c = props.colorScheme;
|
|
36
|
-
var styles = {
|
|
37
|
-
hoverBg: c + ".30",
|
|
38
|
-
activeBg: c + ".40",
|
|
39
|
-
bg: c + ".20",
|
|
40
|
-
color: c + ".80"
|
|
41
|
-
};
|
|
42
|
-
// Special cases
|
|
43
|
-
if (c === 'green') {
|
|
44
|
-
styles.color = c + ".90";
|
|
45
|
-
}
|
|
46
|
-
if (c === 'grey') {
|
|
47
|
-
styles.color = "prussian.80";
|
|
48
|
-
}
|
|
49
|
-
if (c === 'red') {
|
|
50
|
-
styles.color = c + ".90";
|
|
51
|
-
}
|
|
52
|
-
if (c === 'yellow') {
|
|
53
|
-
styles.color = c + ".100";
|
|
54
|
-
}
|
|
55
|
-
return styles;
|
|
56
|
-
}
|
|
57
|
-
function variantText(props) {
|
|
58
|
-
var c = props.colorScheme;
|
|
59
|
-
var styles = {
|
|
60
|
-
hoverBg: c + ".20",
|
|
61
|
-
activeBg: c + ".30",
|
|
62
|
-
bg: 'transparent',
|
|
63
|
-
color: c + ".80"
|
|
64
|
-
};
|
|
65
|
-
// Special cases
|
|
66
|
-
if (c === 'prussian') {
|
|
67
|
-
styles.activeBg = 'blue.30';
|
|
68
|
-
styles.hoverBg = 'blue.20';
|
|
69
|
-
}
|
|
70
|
-
return styles;
|
|
71
|
-
}
|
|
72
|
-
var defaultProps = {
|
|
73
|
-
colorScheme: 'blue',
|
|
74
|
-
size: 'md',
|
|
75
|
-
variant: 'subtle'
|
|
76
|
-
};
|
|
77
|
-
var sizes = {
|
|
78
|
-
sm: {
|
|
79
|
-
fontSize: 'sm',
|
|
80
|
-
h: 24,
|
|
81
|
-
iconSize: 'xs',
|
|
82
|
-
spaceX: 4
|
|
83
|
-
},
|
|
84
|
-
md: {
|
|
85
|
-
fontSize: 'sm',
|
|
86
|
-
h: 32,
|
|
87
|
-
iconSize: 'sm',
|
|
88
|
-
spaceX: 6
|
|
89
|
-
},
|
|
90
|
-
lg: {
|
|
91
|
-
fontSize: 'md',
|
|
92
|
-
h: 40,
|
|
93
|
-
iconSize: 'md',
|
|
94
|
-
spaceX: 8
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
var variants = {
|
|
98
|
-
outlined: variantOutlined,
|
|
99
|
-
solid: variantSolid,
|
|
100
|
-
subtle: variantSubtle,
|
|
101
|
-
text: variantText
|
|
102
|
-
};
|
|
103
|
-
exports.default = {
|
|
104
|
-
defaultProps: defaultProps,
|
|
105
|
-
sizes: sizes,
|
|
106
|
-
variants: variants
|
|
107
|
-
};
|
package/list/listItem.types.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IconProp } from '../icon';
|
|
2
|
-
import { SystemProps } from '../system';
|
|
3
|
-
import { ThemingProps } from '../theme';
|
|
4
|
-
export interface ListItemProps extends SystemProps, ThemingProps<'List'> {
|
|
5
|
-
center?: boolean;
|
|
6
|
-
centerH?: boolean;
|
|
7
|
-
centerV?: boolean;
|
|
8
|
-
colorScheme?: 'blue' | 'grey';
|
|
9
|
-
column?: boolean;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
iconLeft?: IconProp;
|
|
12
|
-
iconRight?: IconProp;
|
|
13
|
-
isInteractive?: boolean;
|
|
14
|
-
isSelected?: boolean;
|
|
15
|
-
text?: number | string;
|
|
16
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { ChangeEventHandler, FocusEventHandler } from '../core';
|
|
3
|
-
import { SystemProps } from '../system';
|
|
4
|
-
import { ThemingProps } from '../theme';
|
|
5
|
-
export interface SwitchButtonProps extends SystemProps, ThemingProps<'Switch'> {
|
|
6
|
-
checked?: boolean;
|
|
7
|
-
colorScheme?: 'blue' | 'green' | 'prussian' | 'red';
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
innerLabelOff?: ReactNode;
|
|
10
|
-
innerLabelOn?: ReactNode;
|
|
11
|
-
inputProps?: HTMLAttributes<HTMLInputElement>;
|
|
12
|
-
inputRef?: React.MutableRefObject<HTMLInputElement | null> | null;
|
|
13
|
-
name?: string;
|
|
14
|
-
onBlur?: FocusEventHandler;
|
|
15
|
-
onChange?: ChangeEventHandler;
|
|
16
|
-
onFocus?: FocusEventHandler;
|
|
17
|
-
required?: boolean;
|
|
18
|
-
value?: number | string;
|
|
19
|
-
}
|
package/tile/index.d.ts
DELETED
package/tile/tile.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|