@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/tag/index.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.default = void 0;
|
|
|
17
17
|
__exportStar(require("./context"), exports);
|
|
18
18
|
__exportStar(require("./tag"), exports);
|
|
19
19
|
__exportStar(require("./tag.types"), exports);
|
|
20
|
+
__exportStar(require("./tagButton"), exports);
|
|
20
21
|
__exportStar(require("./tagIcon"), exports);
|
|
21
22
|
__exportStar(require("./tagText"), exports);
|
|
22
23
|
var tag_1 = require("./tag");
|
package/tag/tag.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { TagProps } from './tag.types';
|
|
2
|
+
import TagButton from './tagButton';
|
|
2
3
|
import TagIcon from './tagIcon';
|
|
3
4
|
import TagText from './tagText';
|
|
4
5
|
import { VuiComponent } from '../core';
|
|
5
6
|
import { SystemProps } from '../system';
|
|
6
7
|
export declare const TagBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
7
8
|
export declare const Tag: VuiComponent<"span", TagProps> & {
|
|
9
|
+
Button: typeof TagButton;
|
|
8
10
|
Icon: typeof TagIcon;
|
|
9
11
|
Text: typeof TagText;
|
|
10
12
|
};
|
package/tag/tag.js
CHANGED
|
@@ -52,17 +52,18 @@ exports.Tag = exports.TagBase = void 0;
|
|
|
52
52
|
var react_1 = __importStar(require("react"));
|
|
53
53
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
54
54
|
var context_1 = require("./context");
|
|
55
|
+
var tagButton_1 = __importDefault(require("./tagButton"));
|
|
55
56
|
var tagIcon_1 = __importDefault(require("./tagIcon"));
|
|
56
57
|
var tagText_1 = __importDefault(require("./tagText"));
|
|
57
58
|
var core_1 = require("../core");
|
|
58
59
|
var system_1 = require("../system");
|
|
59
60
|
var utils_1 = require("../utils");
|
|
60
|
-
exports.TagBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __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);
|
|
61
|
-
exports.Tag = core_1.vui(function (props, ref) {
|
|
62
|
-
var casing = props.casing, children = props.children, className = props.className,
|
|
63
|
-
var styles = core_1.useStyleConfig('Tag', props);
|
|
64
|
-
var
|
|
65
|
-
var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, size: size, variant: variant }); }, [colorScheme, size, variant]);
|
|
61
|
+
exports.TagBase = styled_components_1.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __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);
|
|
62
|
+
exports.Tag = (0, core_1.vui)(function (props, ref) {
|
|
63
|
+
var casing = props.casing, children = props.children, className = props.className, _a = props.colorScheme, colorScheme = _a === void 0 ? 'blue' : _a, icon = props.icon, iconLeft = props.iconLeft, iconRight = props.iconRight, isFullWidth = props.isFullWidth, _b = props.isInteractive, isInteractive = _b === void 0 ? props.onClick !== undefined : _b, isRound = props.isRound, _c = props.isTruncated, isTruncated = _c === void 0 ? true : _c, itemLeft = props.itemLeft, itemRight = props.itemRight, onDelete = props.onDelete, _d = props.size, size = _d === void 0 ? 'md' : _d, text = props.text, _e = props.variant, variant = _e === void 0 ? 'subtle' : _e, weight = props.weight, rest = __rest(props, ["casing", "children", "className", "colorScheme", "icon", "iconLeft", "iconRight", "isFullWidth", "isInteractive", "isRound", "isTruncated", "itemLeft", "itemRight", "onDelete", "size", "text", "variant", "weight"]);
|
|
64
|
+
var styles = (0, core_1.useStyleConfig)('Tag', props);
|
|
65
|
+
var _f = styles.container, activeBg = _f.activeBg, h = _f.h, hoverBg = _f.hoverBg, _g = _f.spaceX, spaceXBase = _g === void 0 ? 0 : _g, tagStyles = __rest(_f, ["activeBg", "h", "hoverBg", "spaceX"]);
|
|
66
|
+
var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, size: size, variant: variant }); }, [colorScheme, size, variant]);
|
|
66
67
|
var spaceX = spaceXBase / 8;
|
|
67
68
|
var spaceXText = (spaceXBase + 4) / 8;
|
|
68
69
|
var pl = icon || itemLeft || iconLeft ? spaceX : spaceXText;
|
|
@@ -77,22 +78,23 @@ exports.Tag = core_1.vui(function (props, ref) {
|
|
|
77
78
|
userSelect: 'none'
|
|
78
79
|
}
|
|
79
80
|
: {};
|
|
80
|
-
var aliasedProps = utils_1.filterUndefined({
|
|
81
|
+
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
81
82
|
borderRadius: isRound ? h / 2 : undefined,
|
|
82
83
|
fontWeight: weight,
|
|
83
84
|
textTransform: casing,
|
|
84
85
|
w: isFullWidth ? '100%' : undefined
|
|
85
86
|
});
|
|
86
87
|
return (react_1.default.createElement(context_1.TagProvider, { value: context },
|
|
87
|
-
react_1.default.createElement(exports.TagBase, __assign({ borderRadius: "md", className: utils_1.cs('vui-tag', className), fontWeight: "medium", h: h, pl: pl, pr: pr, ref: ref, transitionDuration: "fast" }, tagStyles, interactiveProps, aliasedProps, rest),
|
|
88
|
-
utils_1.isString(icon) ? react_1.default.createElement(tagIcon_1.default, { name: icon }) : icon,
|
|
88
|
+
react_1.default.createElement(exports.TagBase, __assign({ borderRadius: "md", className: (0, utils_1.cs)('vui-tag', className), fontWeight: "medium", h: h, pl: pl, pr: pr, ref: ref, transitionDuration: "fast" }, tagStyles, interactiveProps, aliasedProps, rest),
|
|
89
|
+
(0, utils_1.isString)(icon) ? react_1.default.createElement(tagIcon_1.default, { name: icon }) : icon,
|
|
89
90
|
!icon && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
90
91
|
itemLeft,
|
|
91
|
-
utils_1.isString(iconLeft) ? react_1.default.createElement(tagIcon_1.default, { mr: spaceX, name: iconLeft }) : iconLeft, children !== null && children !== void 0 ? children : (utils_1.isReactText(text) ? react_1.default.createElement(tagText_1.default, __assign({}, { isTruncated: isTruncated, text: text })) : text),
|
|
92
|
-
utils_1.isString(iconRight) ? react_1.default.createElement(tagIcon_1.default, { ml: spaceX, name: iconRight }) : iconRight,
|
|
93
|
-
itemRight)))));
|
|
92
|
+
(0, utils_1.isString)(iconLeft) ? react_1.default.createElement(tagIcon_1.default, { mr: spaceX, name: iconLeft }) : iconLeft, children !== null && children !== void 0 ? children : ((0, utils_1.isReactText)(text) ? react_1.default.createElement(tagText_1.default, __assign({}, { isTruncated: isTruncated, text: text })) : text),
|
|
93
|
+
(0, utils_1.isString)(iconRight) ? react_1.default.createElement(tagIcon_1.default, { ml: spaceX, name: iconRight }) : iconRight,
|
|
94
|
+
onDelete ? react_1.default.createElement(tagButton_1.default, { ml: spaceX, onClick: onDelete }) : itemRight)))));
|
|
94
95
|
});
|
|
95
96
|
exports.Tag.displayName = 'Tag';
|
|
97
|
+
exports.Tag.Button = tagButton_1.default;
|
|
96
98
|
exports.Tag.Icon = tagIcon_1.default;
|
|
97
99
|
exports.Tag.Text = tagText_1.default;
|
|
98
100
|
exports.default = exports.Tag;
|
package/tag/tag.types.d.ts
CHANGED
|
@@ -14,17 +14,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
17
|
+
exports.TagButton = void 0;
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
19
|
var context_1 = require("./context");
|
|
20
|
-
var core_1 = require("../core");
|
|
21
20
|
var button_1 = __importDefault(require("../button"));
|
|
22
|
-
|
|
21
|
+
var core_1 = require("../core");
|
|
22
|
+
exports.TagButton = (0, core_1.vui)(function (props, ref) {
|
|
23
23
|
var _a;
|
|
24
|
-
var
|
|
25
|
-
var mergedProps = __assign(__assign({},
|
|
26
|
-
var styles = core_1.useStyleConfig('
|
|
27
|
-
return (react_1.default.createElement(button_1.default, __assign({ className: "vui-
|
|
24
|
+
var tagProps = (_a = (0, context_1.useTag)()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, tagProps), props);
|
|
26
|
+
var styles = (0, core_1.useStyleConfig)('Tag', mergedProps);
|
|
27
|
+
return (react_1.default.createElement(button_1.default, __assign({ className: "vui-tagButton", colorScheme: mergedProps.colorScheme, icon: "falTimes", isRound: true, mr: -0.5, ref: ref }, styles.button, props)));
|
|
28
28
|
});
|
|
29
|
-
exports.
|
|
30
|
-
exports.default = exports.
|
|
29
|
+
exports.TagButton.displayName = 'TagButton';
|
|
30
|
+
exports.default = exports.TagButton;
|
package/tag/tagIcon.js
CHANGED
|
@@ -19,11 +19,11 @@ var react_1 = __importDefault(require("react"));
|
|
|
19
19
|
var context_1 = require("./context");
|
|
20
20
|
var core_1 = require("../core");
|
|
21
21
|
var icon_1 = __importDefault(require("../icon"));
|
|
22
|
-
exports.TagIcon = core_1.vui(function (props, ref) {
|
|
22
|
+
exports.TagIcon = (0, core_1.vui)(function (props, ref) {
|
|
23
23
|
var _a;
|
|
24
|
-
var tagProps = (_a = context_1.useTag()) !== null && _a !== void 0 ? _a : {};
|
|
24
|
+
var tagProps = (_a = (0, context_1.useTag)()) !== null && _a !== void 0 ? _a : {};
|
|
25
25
|
var mergedProps = __assign(__assign({}, tagProps), props);
|
|
26
|
-
var styles = core_1.useStyleConfig('Tag', mergedProps);
|
|
26
|
+
var styles = (0, core_1.useStyleConfig)('Tag', mergedProps);
|
|
27
27
|
return react_1.default.createElement(icon_1.default, __assign({ className: "vui-tagIcon", ref: ref }, styles.icon, props));
|
|
28
28
|
});
|
|
29
29
|
exports.TagIcon.displayName = 'TagIcon';
|
package/tag/tagText.js
CHANGED
|
@@ -19,11 +19,11 @@ var react_1 = __importDefault(require("react"));
|
|
|
19
19
|
var context_1 = require("./context");
|
|
20
20
|
var core_1 = require("../core");
|
|
21
21
|
var t_1 = __importDefault(require("../t"));
|
|
22
|
-
exports.TagText = core_1.vui(function (props, ref) {
|
|
22
|
+
exports.TagText = (0, core_1.vui)(function (props, ref) {
|
|
23
23
|
var _a;
|
|
24
|
-
var tagProps = (_a = context_1.useTag()) !== null && _a !== void 0 ? _a : {};
|
|
24
|
+
var tagProps = (_a = (0, context_1.useTag)()) !== null && _a !== void 0 ? _a : {};
|
|
25
25
|
var mergedProps = __assign(__assign({}, tagProps), props);
|
|
26
|
-
var styles = core_1.useStyleConfig('Tag', mergedProps);
|
|
26
|
+
var styles = (0, core_1.useStyleConfig)('Tag', mergedProps);
|
|
27
27
|
return react_1.default.createElement(t_1.default, __assign({ className: "vui-tagText", fontSize: "inherit", ref: ref }, styles.text, props));
|
|
28
28
|
});
|
|
29
29
|
exports.TagText.displayName = 'TagText';
|
package/tag/theme.d.ts
CHANGED
|
@@ -6,6 +6,15 @@ declare function variantSolid(props: Dict): {
|
|
|
6
6
|
bg: string;
|
|
7
7
|
color: string;
|
|
8
8
|
};
|
|
9
|
+
button: {
|
|
10
|
+
hoverBorderColor: string;
|
|
11
|
+
borderColor: string;
|
|
12
|
+
color: string;
|
|
13
|
+
hoverBg: string;
|
|
14
|
+
activeBg: string;
|
|
15
|
+
bg: string;
|
|
16
|
+
variant: string;
|
|
17
|
+
};
|
|
9
18
|
};
|
|
10
19
|
declare function variantSubtle(props: Dict): {
|
|
11
20
|
container: {
|
|
@@ -14,6 +23,14 @@ declare function variantSubtle(props: Dict): {
|
|
|
14
23
|
bg: string;
|
|
15
24
|
color: string;
|
|
16
25
|
};
|
|
26
|
+
button: {
|
|
27
|
+
hoverBorderColor: string;
|
|
28
|
+
borderColor: string;
|
|
29
|
+
color: string;
|
|
30
|
+
hoverBg: string;
|
|
31
|
+
activeBg: string;
|
|
32
|
+
variant: string;
|
|
33
|
+
};
|
|
17
34
|
};
|
|
18
35
|
declare const _default: {
|
|
19
36
|
defaultProps: {
|
|
@@ -29,6 +46,9 @@ declare const _default: {
|
|
|
29
46
|
h: number;
|
|
30
47
|
spaceX: number;
|
|
31
48
|
};
|
|
49
|
+
button: {
|
|
50
|
+
size: string;
|
|
51
|
+
};
|
|
32
52
|
icon: {
|
|
33
53
|
size: string;
|
|
34
54
|
};
|
|
@@ -40,6 +60,9 @@ declare const _default: {
|
|
|
40
60
|
h: number;
|
|
41
61
|
spaceX: number;
|
|
42
62
|
};
|
|
63
|
+
button: {
|
|
64
|
+
size: string;
|
|
65
|
+
};
|
|
43
66
|
icon: {
|
|
44
67
|
size: string;
|
|
45
68
|
};
|
|
@@ -51,6 +74,9 @@ declare const _default: {
|
|
|
51
74
|
h: number;
|
|
52
75
|
spaceX: number;
|
|
53
76
|
};
|
|
77
|
+
button: {
|
|
78
|
+
size: string;
|
|
79
|
+
};
|
|
54
80
|
icon: {
|
|
55
81
|
size: string;
|
|
56
82
|
};
|
package/tag/theme.js
CHANGED
|
@@ -8,12 +8,24 @@ function variantSolid(props) {
|
|
|
8
8
|
bg: c + ".80",
|
|
9
9
|
color: 'white'
|
|
10
10
|
};
|
|
11
|
+
var button = {
|
|
12
|
+
hoverBorderColor: "transparent",
|
|
13
|
+
borderColor: "transparent",
|
|
14
|
+
color: 'white',
|
|
15
|
+
hoverBg: c + ".70",
|
|
16
|
+
activeBg: c + ".60",
|
|
17
|
+
bg: c + ".80",
|
|
18
|
+
variant: 'solid'
|
|
19
|
+
};
|
|
11
20
|
if (c === 'yellow') {
|
|
12
21
|
container.hoverBg = c + ".80";
|
|
13
22
|
container.activeBg = c + ".90";
|
|
14
23
|
container.bg = c + ".70";
|
|
24
|
+
button.hoverBg = 'yellow.60';
|
|
25
|
+
button.activeBg = 'yellow.50';
|
|
26
|
+
button.bg = 'yellow.70';
|
|
15
27
|
}
|
|
16
|
-
return { container: container };
|
|
28
|
+
return { container: container, button: button };
|
|
17
29
|
}
|
|
18
30
|
function variantSubtle(props) {
|
|
19
31
|
var c = props.colorScheme;
|
|
@@ -23,14 +35,22 @@ function variantSubtle(props) {
|
|
|
23
35
|
bg: c + ".20",
|
|
24
36
|
color: 'prussian.80'
|
|
25
37
|
};
|
|
26
|
-
|
|
38
|
+
var button = {
|
|
39
|
+
hoverBorderColor: "transparent",
|
|
40
|
+
borderColor: "transparent",
|
|
41
|
+
color: c + ".90",
|
|
42
|
+
hoverBg: c + ".30",
|
|
43
|
+
activeBg: c + ".40",
|
|
44
|
+
variant: 'outlined'
|
|
45
|
+
};
|
|
46
|
+
return { container: container, button: button };
|
|
27
47
|
}
|
|
28
48
|
var defaultProps = {
|
|
29
49
|
colorScheme: 'blue',
|
|
30
50
|
size: 'md',
|
|
31
51
|
variant: 'subtle'
|
|
32
52
|
};
|
|
33
|
-
var parts = ['container', 'icon', 'text'];
|
|
53
|
+
var parts = ['container', 'button', 'icon', 'text'];
|
|
34
54
|
var sizes = {
|
|
35
55
|
sm: {
|
|
36
56
|
container: {
|
|
@@ -38,6 +58,9 @@ var sizes = {
|
|
|
38
58
|
h: 24,
|
|
39
59
|
spaceX: 4
|
|
40
60
|
},
|
|
61
|
+
button: {
|
|
62
|
+
size: 'xs'
|
|
63
|
+
},
|
|
41
64
|
icon: {
|
|
42
65
|
size: 'xs'
|
|
43
66
|
},
|
|
@@ -49,6 +72,9 @@ var sizes = {
|
|
|
49
72
|
h: 32,
|
|
50
73
|
spaceX: 6
|
|
51
74
|
},
|
|
75
|
+
button: {
|
|
76
|
+
size: 'xs'
|
|
77
|
+
},
|
|
52
78
|
icon: {
|
|
53
79
|
size: 'sm'
|
|
54
80
|
},
|
|
@@ -60,6 +86,9 @@ var sizes = {
|
|
|
60
86
|
h: 40,
|
|
61
87
|
spaceX: 8
|
|
62
88
|
},
|
|
89
|
+
button: {
|
|
90
|
+
size: 'sm'
|
|
91
|
+
},
|
|
63
92
|
icon: {
|
|
64
93
|
size: 'md'
|
|
65
94
|
},
|
package/textarea/textarea.js
CHANGED
|
@@ -72,29 +72,30 @@ var core_1 = require("../core");
|
|
|
72
72
|
var system_1 = require("../system");
|
|
73
73
|
var t_1 = __importDefault(require("../t"));
|
|
74
74
|
var utils_1 = require("../utils");
|
|
75
|
-
exports.TextareaTextarea = styled_components_1.default.textarea.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tborder-width: 1px;\n\theight: 100%;\n\toutline: none;\n\tresize: none;\n\twidth: 100%;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"], ["\n\tborder-width: 1px;\n\theight: 100%;\n\toutline: none;\n\tresize: none;\n\twidth: 100%;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
76
|
-
exports.TextareaBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 80px;\n\tposition: relative;\n\twidth: 100%;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 80px;\n\tposition: relative;\n\twidth: 100%;\n\n\t", "\n"])), system_1.system);
|
|
77
|
-
exports.Textarea = core_1.vui(function (props, ref) {
|
|
78
|
-
var _a = __read(react_1.useState(helpers_1.getInitialCount(props)), 2), count = _a[0], setCount = _a[1];
|
|
79
|
-
var _b = core_1.omitThemingProps(props), autoFocus = _b.autoFocus, className = _b.className, colorSchemeProp = _b.colorScheme, defaultValue = _b.defaultValue, disabled = _b.disabled, isInvalid = _b.isInvalid, maxLength = _b.maxLength, name = _b.name, onBlur = _b.onBlur, onChangeProp = _b.onChange, onFocus = _b.onFocus, placeholder = _b.placeholder, readOnly = _b.readOnly, required = _b.required, resize = _b.resize, showCount = _b.showCount, _c = _b.textareaProps, textareaProps = _c === void 0 ? {} : _c, textareaRef = _b.textareaRef, value = _b.value, rest = __rest(_b, ["autoFocus", "className", "colorScheme", "defaultValue", "disabled", "isInvalid", "maxLength", "name", "onBlur", "onChange", "onFocus", "placeholder", "readOnly", "required", "resize", "showCount", "textareaProps", "textareaRef", "value"]);
|
|
80
|
-
var colorProps = utils_1.filterUndefined({
|
|
75
|
+
exports.TextareaTextarea = styled_components_1.default.textarea.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tborder-width: 1px;\n\theight: 100%;\n\toutline: none;\n\tresize: none;\n\twidth: 100%;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"], ["\n\tborder-width: 1px;\n\theight: 100%;\n\toutline: none;\n\tresize: none;\n\twidth: 100%;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tborder-color: var(--vui-colors-disabled-border);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
76
|
+
exports.TextareaBase = styled_components_1.default.div.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 80px;\n\tposition: relative;\n\twidth: 100%;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 80px;\n\tposition: relative;\n\twidth: 100%;\n\n\t", "\n"])), system_1.system);
|
|
77
|
+
exports.Textarea = (0, core_1.vui)(function (props, ref) {
|
|
78
|
+
var _a = __read((0, react_1.useState)((0, helpers_1.getInitialCount)(props)), 2), count = _a[0], setCount = _a[1];
|
|
79
|
+
var _b = (0, core_1.omitThemingProps)(props), autoFocus = _b.autoFocus, className = _b.className, colorSchemeProp = _b.colorScheme, defaultValue = _b.defaultValue, disabled = _b.disabled, id = _b.id, isInvalid = _b.isInvalid, maxLength = _b.maxLength, name = _b.name, onBlur = _b.onBlur, onChangeProp = _b.onChange, onFocus = _b.onFocus, placeholder = _b.placeholder, readOnly = _b.readOnly, required = _b.required, resize = _b.resize, showCount = _b.showCount, _c = _b.textareaProps, textareaProps = _c === void 0 ? {} : _c, textareaRef = _b.textareaRef, value = _b.value, rest = __rest(_b, ["autoFocus", "className", "colorScheme", "defaultValue", "disabled", "id", "isInvalid", "maxLength", "name", "onBlur", "onChange", "onFocus", "placeholder", "readOnly", "required", "resize", "showCount", "textareaProps", "textareaRef", "value"]);
|
|
80
|
+
var colorProps = (0, utils_1.filterUndefined)({
|
|
81
81
|
colorScheme: colorSchemeProp !== null && colorSchemeProp !== void 0 ? colorSchemeProp : (isInvalid ? 'red' : undefined)
|
|
82
82
|
});
|
|
83
|
-
var styles = core_1.useStyleConfig('Textarea', __assign(__assign({}, colorProps), props));
|
|
83
|
+
var styles = (0, core_1.useStyleConfig)('Textarea', __assign(__assign({}, colorProps), props));
|
|
84
84
|
function onChange(e) {
|
|
85
85
|
setCount(e.target.value.length);
|
|
86
86
|
onChangeProp === null || onChangeProp === void 0 ? void 0 : onChangeProp(e);
|
|
87
87
|
}
|
|
88
|
-
var aliasedProps = utils_1.filterUndefined({
|
|
88
|
+
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
89
89
|
bg: readOnly ? 'grey.20' : undefined,
|
|
90
90
|
focusBorderColor: !readOnly ? 'transparent' : undefined,
|
|
91
91
|
focusRing: readOnly ? 0 : undefined
|
|
92
92
|
});
|
|
93
|
-
return (react_1.default.createElement(exports.TextareaBase, __assign({ className: utils_1.cs('vui-textarea', className), ref: ref }, styles.container, rest),
|
|
93
|
+
return (react_1.default.createElement(exports.TextareaBase, __assign({ className: (0, utils_1.cs)('vui-textarea', className), ref: ref }, styles.container, rest),
|
|
94
94
|
react_1.default.createElement(exports.TextareaTextarea, __assign({ borderRadius: "md", className: "vui-textareaTextarea", p: 1, placeholderColor: "grey.60", ref: textareaRef, transitionDuration: "fast" }, {
|
|
95
95
|
autoFocus: autoFocus,
|
|
96
96
|
defaultValue: defaultValue,
|
|
97
97
|
disabled: disabled,
|
|
98
|
+
id: id,
|
|
98
99
|
maxLength: maxLength,
|
|
99
100
|
name: name,
|
|
100
101
|
onBlur: onBlur,
|
|
@@ -4,6 +4,7 @@ import { SystemProps } from '../system';
|
|
|
4
4
|
import { ThemingProps } from '../theme';
|
|
5
5
|
export interface TextareaProps extends SystemProps, ThemingProps<'Textarea'> {
|
|
6
6
|
autoFocus?: boolean;
|
|
7
|
+
children?: never;
|
|
7
8
|
colorScheme?: 'green' | 'grey' | 'red';
|
|
8
9
|
cols?: number;
|
|
9
10
|
defaultValue?: number | string;
|
package/theme/components.d.ts
CHANGED
|
@@ -1,48 +1,4 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
Alert: {
|
|
3
|
-
defaultProps: {
|
|
4
|
-
colorScheme: string;
|
|
5
|
-
variant: string;
|
|
6
|
-
};
|
|
7
|
-
parts: string[];
|
|
8
|
-
sizes: {};
|
|
9
|
-
variants: {
|
|
10
|
-
solid: (props: import("..").Dict<any>) => {
|
|
11
|
-
container: {
|
|
12
|
-
bg: string;
|
|
13
|
-
color: string;
|
|
14
|
-
};
|
|
15
|
-
button: {
|
|
16
|
-
bg: string;
|
|
17
|
-
borderColor: string;
|
|
18
|
-
hoverBg: string;
|
|
19
|
-
hoverBorderColor: string;
|
|
20
|
-
};
|
|
21
|
-
icon: {};
|
|
22
|
-
message: {};
|
|
23
|
-
text: {};
|
|
24
|
-
title: {};
|
|
25
|
-
};
|
|
26
|
-
subtle: (props: import("..").Dict<any>) => {
|
|
27
|
-
container: {
|
|
28
|
-
bg: string;
|
|
29
|
-
borderColor: string;
|
|
30
|
-
borderWidth: number;
|
|
31
|
-
color: string;
|
|
32
|
-
};
|
|
33
|
-
button: {
|
|
34
|
-
color: string;
|
|
35
|
-
hoverBg: string;
|
|
36
|
-
activeBg: string;
|
|
37
|
-
variant: string;
|
|
38
|
-
};
|
|
39
|
-
icon: {};
|
|
40
|
-
message: {};
|
|
41
|
-
text: {};
|
|
42
|
-
title: {};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
2
|
Avatar: {
|
|
47
3
|
defaultProps: {
|
|
48
4
|
colorScheme: string;
|
|
@@ -508,6 +464,34 @@ declare const _default: {
|
|
|
508
464
|
};
|
|
509
465
|
};
|
|
510
466
|
};
|
|
467
|
+
Notification: {
|
|
468
|
+
defaultProps: {
|
|
469
|
+
colorScheme: string;
|
|
470
|
+
variant: string;
|
|
471
|
+
};
|
|
472
|
+
parts: string[];
|
|
473
|
+
sizes: {};
|
|
474
|
+
variants: {
|
|
475
|
+
subtle: (props: import("..").Dict<any>) => {
|
|
476
|
+
container: {
|
|
477
|
+
bg: string;
|
|
478
|
+
borderColor: string;
|
|
479
|
+
borderWidth: number;
|
|
480
|
+
color: string;
|
|
481
|
+
};
|
|
482
|
+
button: {
|
|
483
|
+
color: string;
|
|
484
|
+
hoverBg: string;
|
|
485
|
+
activeBg: string;
|
|
486
|
+
variant: string;
|
|
487
|
+
};
|
|
488
|
+
icon: {};
|
|
489
|
+
message: {};
|
|
490
|
+
text: {};
|
|
491
|
+
title: {};
|
|
492
|
+
};
|
|
493
|
+
};
|
|
494
|
+
};
|
|
511
495
|
P: {
|
|
512
496
|
defaultProps: {
|
|
513
497
|
size: string;
|
|
@@ -802,6 +786,9 @@ declare const _default: {
|
|
|
802
786
|
h: number;
|
|
803
787
|
spaceX: number;
|
|
804
788
|
};
|
|
789
|
+
button: {
|
|
790
|
+
size: string;
|
|
791
|
+
};
|
|
805
792
|
icon: {
|
|
806
793
|
size: string;
|
|
807
794
|
};
|
|
@@ -813,6 +800,9 @@ declare const _default: {
|
|
|
813
800
|
h: number;
|
|
814
801
|
spaceX: number;
|
|
815
802
|
};
|
|
803
|
+
button: {
|
|
804
|
+
size: string;
|
|
805
|
+
};
|
|
816
806
|
icon: {
|
|
817
807
|
size: string;
|
|
818
808
|
};
|
|
@@ -824,6 +814,9 @@ declare const _default: {
|
|
|
824
814
|
h: number;
|
|
825
815
|
spaceX: number;
|
|
826
816
|
};
|
|
817
|
+
button: {
|
|
818
|
+
size: string;
|
|
819
|
+
};
|
|
827
820
|
icon: {
|
|
828
821
|
size: string;
|
|
829
822
|
};
|
|
@@ -838,6 +831,15 @@ declare const _default: {
|
|
|
838
831
|
bg: string;
|
|
839
832
|
color: string;
|
|
840
833
|
};
|
|
834
|
+
button: {
|
|
835
|
+
hoverBorderColor: string;
|
|
836
|
+
borderColor: string;
|
|
837
|
+
color: string;
|
|
838
|
+
hoverBg: string;
|
|
839
|
+
activeBg: string;
|
|
840
|
+
bg: string;
|
|
841
|
+
variant: string;
|
|
842
|
+
};
|
|
841
843
|
};
|
|
842
844
|
subtle: (props: import("..").Dict<any>) => {
|
|
843
845
|
container: {
|
|
@@ -846,6 +848,14 @@ declare const _default: {
|
|
|
846
848
|
bg: string;
|
|
847
849
|
color: string;
|
|
848
850
|
};
|
|
851
|
+
button: {
|
|
852
|
+
hoverBorderColor: string;
|
|
853
|
+
borderColor: string;
|
|
854
|
+
color: string;
|
|
855
|
+
hoverBg: string;
|
|
856
|
+
activeBg: string;
|
|
857
|
+
variant: string;
|
|
858
|
+
};
|
|
849
859
|
};
|
|
850
860
|
};
|
|
851
861
|
};
|
package/theme/components.js
CHANGED
|
@@ -3,19 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var theme_1 = __importDefault(require("../
|
|
7
|
-
var theme_2 = __importDefault(require("../
|
|
8
|
-
var theme_3 = __importDefault(require("../
|
|
9
|
-
var theme_4 = __importDefault(require("../
|
|
10
|
-
var theme_5 = __importDefault(require("../
|
|
11
|
-
var theme_6 = __importDefault(require("../
|
|
12
|
-
var theme_7 = __importDefault(require("../
|
|
13
|
-
var theme_8 = __importDefault(require("../
|
|
14
|
-
var theme_9 = __importDefault(require("../
|
|
15
|
-
var theme_10 = __importDefault(require("../
|
|
16
|
-
var theme_11 = __importDefault(require("../
|
|
17
|
-
var theme_12 = __importDefault(require("../
|
|
18
|
-
var theme_13 = __importDefault(require("../
|
|
6
|
+
var theme_1 = __importDefault(require("../avatar/theme"));
|
|
7
|
+
var theme_2 = __importDefault(require("../box/theme"));
|
|
8
|
+
var theme_3 = __importDefault(require("../button/theme"));
|
|
9
|
+
var theme_4 = __importDefault(require("../card/theme"));
|
|
10
|
+
var theme_5 = __importDefault(require("../checkbox/theme"));
|
|
11
|
+
var theme_6 = __importDefault(require("../divider/theme"));
|
|
12
|
+
var theme_7 = __importDefault(require("../heading/theme"));
|
|
13
|
+
var theme_8 = __importDefault(require("../icon/theme"));
|
|
14
|
+
var theme_9 = __importDefault(require("../image/theme"));
|
|
15
|
+
var theme_10 = __importDefault(require("../input/theme"));
|
|
16
|
+
var theme_11 = __importDefault(require("../link/theme"));
|
|
17
|
+
var theme_12 = __importDefault(require("../list/theme"));
|
|
18
|
+
var theme_13 = __importDefault(require("../notification/theme"));
|
|
19
19
|
var theme_14 = __importDefault(require("../p/theme"));
|
|
20
20
|
var theme_15 = __importDefault(require("../panel/theme"));
|
|
21
21
|
var theme_16 = __importDefault(require("../radio/theme"));
|
|
@@ -26,19 +26,19 @@ var theme_20 = __importDefault(require("../t/theme"));
|
|
|
26
26
|
var theme_21 = __importDefault(require("../tag/theme"));
|
|
27
27
|
var theme_22 = __importDefault(require("../textarea/theme"));
|
|
28
28
|
exports.default = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
Avatar: theme_1.default,
|
|
30
|
+
Box: theme_2.default,
|
|
31
|
+
Button: theme_3.default,
|
|
32
|
+
Card: theme_4.default,
|
|
33
|
+
Checkbox: theme_5.default,
|
|
34
|
+
Divider: theme_6.default,
|
|
35
|
+
Heading: theme_7.default,
|
|
36
|
+
Icon: theme_8.default,
|
|
37
|
+
Image: theme_9.default,
|
|
38
|
+
Input: theme_10.default,
|
|
39
|
+
Link: theme_11.default,
|
|
40
|
+
List: theme_12.default,
|
|
41
|
+
Notification: theme_13.default,
|
|
42
42
|
P: theme_14.default,
|
|
43
43
|
Panel: theme_15.default,
|
|
44
44
|
Radio: theme_16.default,
|