@veracity/vui 0.0.15 → 0.1.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/alert/alert.js +10 -10
- package/alert/alert.types.d.ts +3 -3
- package/alert/alertText.d.ts +2 -2
- package/alert/alertText.js +2 -2
- package/alert/alertTitle.d.ts +2 -2
- package/alert/alertTitle.js +2 -2
- package/alert/theme.d.ts +2 -0
- package/alert/theme.js +5 -3
- 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/button/buttonIcon.js +30 -0
- 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/buttonGroup/index.js +21 -0
- 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 +2 -2
- 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 +6 -6
- 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 +0 -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 +4 -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 +5 -2
- package/index.js +5 -2
- package/input/context.d.ts +4 -0
- package/input/context.js +23 -0
- package/input/index.d.ts +2 -0
- package/input/index.js +2 -0
- package/input/input.d.ts +7 -2
- package/input/input.js +32 -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/package.json +1 -1
- 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 +2 -2
- package/radio/radio.types.d.ts +1 -1
- package/radio/radioGroup.types.d.ts +1 -1
- 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 +15 -16
- 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/tag/tagIcon.js +30 -0
- 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/theme/components.d.ts +265 -181
- package/theme/components.js +36 -32
- package/theme/defaultTheme.d.ts +265 -181
- 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 +4 -6
- package/utils/object.js +18 -26
- package/utils/types.d.ts +2 -0
- 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/{label/label.types.js → card/card.types.js} +0 -0
- /package/{list/listItem.types.js → core/types/styled.js} +0 -0
- /package/{switch/switchButton.types.js → image/image.types.js} +0 -0
- /package/{tile/tile.types.js → panel/panel.types.js} +0 -0
package/utils/object.d.ts
CHANGED
|
@@ -8,15 +8,13 @@ export declare const filterUndefined: (object: Dict) => Dict<any>;
|
|
|
8
8
|
* @param separator used when path is a string to split individual keys
|
|
9
9
|
*/
|
|
10
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
11
|
/**
|
|
14
12
|
* Recursively deep merges two objects in an immutable fashion, following these rules:
|
|
15
|
-
* -
|
|
16
|
-
* -
|
|
17
|
-
* -
|
|
13
|
+
* - Key exists in target and both keys are objects => merge
|
|
14
|
+
* - Key exists in target and both keys are arrays => concat (not unique)
|
|
15
|
+
* - Key isn't an object, an array or doesn't exist in target => override
|
|
18
16
|
*/
|
|
19
|
-
export declare function
|
|
17
|
+
export declare function merge<Target extends Dict, Source extends Dict>(target: Target, source: Source): Target & Source;
|
|
20
18
|
declare type FilterFn<T> = (value: any, key: string, object: T) => boolean;
|
|
21
19
|
/**
|
|
22
20
|
* Returns the items of an object that meet the condition specified in a callback function.
|
package/utils/object.js
CHANGED
|
@@ -11,7 +11,8 @@ 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.omit = exports.objectFilter = exports.
|
|
14
|
+
exports.omit = exports.objectFilter = exports.merge = exports.get = 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;
|
|
@@ -23,48 +24,39 @@ exports.filterUndefined = filterUndefined;
|
|
|
23
24
|
*/
|
|
24
25
|
function get(object, path, separator) {
|
|
25
26
|
if (separator === void 0) { separator = '.'; }
|
|
26
|
-
if (!
|
|
27
|
+
if (!assertion_1.isObject(object))
|
|
27
28
|
return;
|
|
28
29
|
var keys = Array.isArray(path) ? path : path.split(separator);
|
|
29
30
|
return keys.reduce(function (obj, property) { return obj === null || obj === void 0 ? void 0 : obj[property]; }, object);
|
|
30
31
|
}
|
|
31
32
|
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
33
|
/**
|
|
38
34
|
* Recursively deep merges two objects in an immutable fashion, following these rules:
|
|
39
|
-
* -
|
|
40
|
-
* -
|
|
41
|
-
* -
|
|
35
|
+
* - Key exists in target and both keys are objects => merge
|
|
36
|
+
* - Key exists in target and both keys are arrays => concat (not unique)
|
|
37
|
+
* - Key isn't an object, an array or doesn't exist in target => override
|
|
42
38
|
*/
|
|
43
|
-
function
|
|
44
|
-
var output;
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
function merge(target, source) {
|
|
40
|
+
var output = __assign({}, target);
|
|
41
|
+
if (assertion_1.isObject(target) && assertion_1.isObject(source)) {
|
|
42
|
+
Object.keys(source).forEach(function (key) {
|
|
43
|
+
var _a;
|
|
48
44
|
if (key === '__proto__')
|
|
49
45
|
return;
|
|
50
|
-
if (key in source) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
else {
|
|
56
|
-
output[key] = override[key];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
46
|
+
if (key in target && assertion_1.isObject(target[key]) && assertion_1.isObject(source[key])) {
|
|
47
|
+
output[key] = merge(target[key], source[key]);
|
|
48
|
+
}
|
|
49
|
+
else if (key in target && assertion_1.isArray(target[key]) && assertion_1.isArray(source[key])) {
|
|
50
|
+
output[key] = (_a = target[key]) === null || _a === void 0 ? void 0 : _a.concat(source[key]);
|
|
59
51
|
}
|
|
60
52
|
else {
|
|
61
|
-
output[key] =
|
|
53
|
+
output[key] = source[key];
|
|
62
54
|
}
|
|
63
55
|
});
|
|
64
56
|
}
|
|
65
57
|
return output;
|
|
66
58
|
}
|
|
67
|
-
exports.
|
|
59
|
+
exports.merge = merge;
|
|
68
60
|
/**
|
|
69
61
|
* Returns the items of an object that meet the condition specified in a callback function.
|
|
70
62
|
*/
|
package/utils/types.d.ts
CHANGED
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
|