@veracity/vui 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/avatar/avatar.js +5 -5
- package/avatar/theme.d.ts +5 -9
- package/avatar/theme.js +5 -18
- 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 +1 -6
- package/buttonGroup/buttonGroup.js +5 -10
- package/buttonGroup/context.js +1 -1
- package/card/card.js +4 -4
- package/checkbox/checkbox.js +13 -12
- package/checkbox/checkbox.types.d.ts +1 -1
- package/checkbox/checkboxGroup.js +7 -7
- package/checkbox/checkboxGroup.types.d.ts +2 -2
- package/checkbox/context.js +1 -1
- package/checkbox/theme.js +5 -2
- package/core/globalStyle.js +6 -8
- package/core/index.d.ts +1 -2
- package/core/index.js +2 -5
- package/core/resetCSS.js +2 -2
- package/core/styled.d.ts +192 -4
- package/core/styled.js +55 -13
- package/core/types/component.d.ts +2 -7
- package/core/types/index.d.ts +0 -2
- package/core/types/index.js +0 -2
- package/core/utils.d.ts +2 -2
- package/core/utils.js +13 -12
- package/divider/divider.js +6 -6
- package/heading/heading.js +6 -6
- package/heading/headings.js +6 -6
- package/icon/icon.js +6 -6
- package/icon/icon.types.d.ts +1 -2
- package/icons/library.js +9 -5
- package/icons/types.d.ts +1 -1
- package/image/image.js +4 -4
- package/input/context.js +1 -1
- package/input/input.js +11 -16
- package/input/input.types.d.ts +1 -2
- package/input/inputIcon.js +3 -3
- package/input/inputInput.js +4 -4
- package/link/context.d.ts +4 -0
- package/link/context.js +23 -0
- package/link/index.d.ts +2 -0
- package/link/index.js +2 -0
- package/link/link.d.ts +7 -1
- package/link/link.js +35 -7
- package/link/link.types.d.ts +5 -0
- package/link/linkIcon.d.ts +3 -0
- package/link/linkIcon.js +30 -0
- package/link/linkText.d.ts +3 -0
- package/link/linkText.js +30 -0
- package/link/theme.d.ts +27 -10
- package/link/theme.js +26 -12
- package/list/context.js +1 -1
- package/list/index.d.ts +1 -0
- package/list/index.js +1 -0
- package/list/list.d.ts +2 -0
- package/list/list.js +8 -11
- package/list/listDivider.d.ts +3 -0
- package/list/listDivider.js +30 -0
- package/list/listHeading.js +4 -4
- package/list/listIcon.js +3 -3
- package/list/listItem.js +8 -8
- package/list/listText.js +3 -3
- package/list/theme.d.ts +0 -16
- package/list/theme.js +6 -22
- package/notification/context.js +1 -1
- package/notification/notification.js +6 -11
- package/notification/notificationButton.js +3 -3
- package/notification/notificationIcon.js +3 -3
- package/notification/notificationText.js +3 -3
- package/notification/notificationTitle.js +3 -3
- package/p/p.js +6 -6
- package/package.json +1 -1
- package/panel/panel.js +4 -4
- package/radio/context.js +1 -1
- package/radio/radio.js +58 -13
- package/radio/radio.types.d.ts +1 -1
- package/radio/radioGroup.js +24 -17
- package/radio/radioGroup.types.d.ts +2 -2
- package/radio/theme.js +5 -2
- package/skeleton/skeleton.js +6 -6
- package/spinner/spinner.js +5 -5
- package/svg/svg.js +12 -12
- package/switch/context.js +1 -1
- package/switch/switch.js +12 -50
- package/switch/switch.types.d.ts +3 -3
- package/switch/switchButton.js +19 -21
- package/switch/switchLabel.js +3 -3
- package/switch/theme.d.ts +0 -5
- package/switch/theme.js +4 -9
- package/system/custom.d.ts +7 -20
- package/system/custom.js +19 -25
- package/system/system.d.ts +4 -3
- package/system/system.js +2 -2
- package/system/tables.d.ts +14 -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 +16 -13
- package/tag/tag.types.d.ts +2 -0
- package/tag/tagButton.d.ts +3 -0
- package/tag/tagButton.js +41 -0
- 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 +9 -9
- package/textarea/textarea.types.d.ts +1 -1
- package/theme/components.d.ts +58 -39
- package/theme/defaultTheme.d.ts +59 -39
- package/theme/foundations/index.d.ts +1 -0
- package/theme/foundations/shadows.js +2 -2
- package/theme/foundations/transformers.d.ts +1 -0
- package/theme/foundations/transformers.js +26 -0
- package/theme/index.d.ts +16 -0
- package/theme/index.js +33 -1
- package/utils/assertion.js +1 -2
- package/utils/function.js +9 -5
- package/utils/object.d.ts +4 -1
- package/utils/object.js +27 -28
- package/utils/types.d.ts +23 -1
- package/core/types/events.d.ts +0 -17
- package/core/types/styled.d.ts +0 -11
- package/core/types/styled.js +0 -2
- package/core/v.d.ts +0 -182
- package/core/v.js +0 -6
- /package/{core/types/events.js → system/tables.js} +0 -0
package/system/system.d.ts
CHANGED
|
@@ -4,14 +4,15 @@ import { BordersProps } from './borders';
|
|
|
4
4
|
import { EffectsProps } from './effects';
|
|
5
5
|
import { FlexboxesProps } from './flexboxes';
|
|
6
6
|
import { InteractivityProps } from './interactivity';
|
|
7
|
-
import {
|
|
7
|
+
import { IsTruncatedProps, MaxLinesProps, SpaceAroundProps, WordBreakProps } from './custom';
|
|
8
8
|
import { LayoutProps } from './layout';
|
|
9
9
|
import { SizingProps } from './sizing';
|
|
10
10
|
import { SpaceProps } from './space';
|
|
11
|
+
import { TablesProps } from './tables';
|
|
11
12
|
import { TransformsProps } from './transforms';
|
|
12
13
|
import { TransitionsProps } from './transitions';
|
|
13
14
|
import { TypographyProps } from './typography';
|
|
14
|
-
export interface SystemProps extends AnimationsProps, BackgroundColorProps, BordersProps,
|
|
15
|
+
export interface SystemProps extends AnimationsProps, BackgroundColorProps, BordersProps, EffectsProps, FlexboxesProps, InteractivityProps, IsTruncatedProps, LayoutProps, MaxLinesProps, SizingProps, SpaceProps, SpaceAroundProps, TablesProps, TransformsProps, TransitionsProps, TypographyProps, WordBreakProps {
|
|
15
16
|
}
|
|
16
|
-
declare const _default: import("@xstyled/
|
|
17
|
+
declare const _default: import("@xstyled/styled-components").StyleGenerator;
|
|
17
18
|
export default _default;
|
package/system/system.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var
|
|
3
|
+
var styled_components_1 = require("@xstyled/styled-components");
|
|
4
4
|
var custom_1 = require("./custom");
|
|
5
|
-
exports.default =
|
|
5
|
+
exports.default = (0, styled_components_1.compose)(styled_components_1.animation, styled_components_1.backgroundColor, styled_components_1.borders, styled_components_1.color, styled_components_1.effects, styled_components_1.flexboxes, styled_components_1.interactivity, custom_1.isTruncated, styled_components_1.layout, custom_1.maxLines, styled_components_1.sizing, styled_components_1.space, custom_1.spaceAround, styled_components_1.tables, styled_components_1.transforms, styled_components_1.transitions, styled_components_1.typography, custom_1.wordBreak);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SystemProp } from '@xstyled/system';
|
|
2
|
+
import * as CSS from 'csstype';
|
|
3
|
+
import { VuiTheme } from '../theme';
|
|
4
|
+
declare type BorderCollapseProp = SystemProp<CSS.Property.BorderCollapse, VuiTheme>;
|
|
5
|
+
export interface BorderCollapseProps {
|
|
6
|
+
borderCollapse?: BorderCollapseProp;
|
|
7
|
+
}
|
|
8
|
+
declare type TableLayoutProp = SystemProp<CSS.Property.TableLayout, VuiTheme>;
|
|
9
|
+
export interface TableLayoutProps {
|
|
10
|
+
tableLayout?: TableLayoutProp;
|
|
11
|
+
}
|
|
12
|
+
export interface TablesProps extends BorderCollapseProps, TableLayoutProps {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
package/t/t.js
CHANGED
|
@@ -35,11 +35,11 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
35
35
|
var core_1 = require("../core");
|
|
36
36
|
var system_1 = require("../system");
|
|
37
37
|
var utils_1 = require("../utils");
|
|
38
|
-
exports.TBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.system);
|
|
39
|
-
exports.T = core_1.vui(function (props, ref) {
|
|
40
|
-
var _a = core_1.omitThemingProps(props), align = _a.align, casing = _a.casing, centerV = _a.centerV, children = _a.children, className = _a.className, decoration = _a.decoration, text = _a.text, weight = _a.weight, rest = __rest(_a, ["align", "casing", "centerV", "children", "className", "decoration", "text", "weight"]);
|
|
41
|
-
var styles = core_1.useStyleConfig('T', props);
|
|
42
|
-
var aliasedProps = utils_1.filterUndefined({
|
|
38
|
+
exports.TBase = styled_components_1.default.span.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.system);
|
|
39
|
+
exports.T = (0, core_1.vui)(function (props, ref) {
|
|
40
|
+
var _a = (0, core_1.omitThemingProps)(props), align = _a.align, casing = _a.casing, centerV = _a.centerV, children = _a.children, className = _a.className, decoration = _a.decoration, text = _a.text, weight = _a.weight, rest = __rest(_a, ["align", "casing", "centerV", "children", "className", "decoration", "text", "weight"]);
|
|
41
|
+
var styles = (0, core_1.useStyleConfig)('T', props);
|
|
42
|
+
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
43
43
|
alignItems: centerV ? 'center' : undefined,
|
|
44
44
|
display: centerV ? 'inline-flex' : undefined,
|
|
45
45
|
fontWeight: weight,
|
|
@@ -47,7 +47,7 @@ exports.T = core_1.vui(function (props, ref) {
|
|
|
47
47
|
textDecoration: decoration,
|
|
48
48
|
textTransform: casing
|
|
49
49
|
});
|
|
50
|
-
return (react_1.default.createElement(exports.TBase, __assign({ className: utils_1.cs('vui-t', className), ref: ref, transitionDuration: "fast" }, styles, aliasedProps, rest), children !== null && children !== void 0 ? children : text));
|
|
50
|
+
return (react_1.default.createElement(exports.TBase, __assign({ className: (0, utils_1.cs)('vui-t', className), ref: ref, transitionDuration: "fast" }, styles, aliasedProps, rest), children !== null && children !== void 0 ? children : text));
|
|
51
51
|
});
|
|
52
52
|
exports.T.displayName = 'T';
|
|
53
53
|
exports.default = exports.T;
|
package/tag/context.js
CHANGED
|
@@ -18,6 +18,6 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.useTag = exports.TagProvider = void 0;
|
|
20
20
|
var core_1 = require("../core");
|
|
21
|
-
var _a = __read(core_1.createContext({ isOptional: true }), 2), TagProvider = _a[0], useTag = _a[1];
|
|
21
|
+
var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), TagProvider = _a[0], useTag = _a[1];
|
|
22
22
|
exports.TagProvider = TagProvider;
|
|
23
23
|
exports.useTag = useTag;
|
package/tag/index.d.ts
CHANGED
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,22 +52,23 @@ 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&[data-disabled='true'] {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t\tuser-select: 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&[data-disabled='true'] {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t\tuser-select: 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, disabled = props.disabled, 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, onClick = props.onClick, 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", "disabled", "icon", "iconLeft", "iconRight", "isFullWidth", "isInteractive", "isRound", "isTruncated", "itemLeft", "itemRight", "onClick", "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, disabled: disabled, size: size, variant: variant }); }, [colorScheme, disabled, size, variant]);
|
|
66
67
|
var spaceX = spaceXBase / 8;
|
|
67
68
|
var spaceXText = (spaceXBase + 4) / 8;
|
|
68
69
|
var pl = icon || itemLeft || iconLeft ? spaceX : spaceXText;
|
|
69
70
|
var pr = icon || itemRight || iconRight ? spaceX : spaceXText;
|
|
70
|
-
var interactiveProps = isInteractive
|
|
71
|
+
var interactiveProps = !disabled && isInteractive
|
|
71
72
|
? {
|
|
72
73
|
cursor: 'pointer',
|
|
73
74
|
hoverBg: hoverBg,
|
|
@@ -77,22 +78,24 @@ 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,
|
|
83
|
+
'data-disabled': disabled,
|
|
82
84
|
fontWeight: weight,
|
|
83
85
|
textTransform: casing,
|
|
84
86
|
w: isFullWidth ? '100%' : undefined
|
|
85
87
|
});
|
|
86
88
|
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,
|
|
89
|
+
react_1.default.createElement(exports.TagBase, __assign({ borderRadius: "md", className: (0, utils_1.cs)('vui-tag', className), fontWeight: "medium", h: h, onClick: !disabled ? onClick : undefined, pl: pl, pr: pr, ref: ref, transitionDuration: "fast" }, tagStyles, interactiveProps, aliasedProps, rest),
|
|
90
|
+
(0, utils_1.isString)(icon) ? react_1.default.createElement(tagIcon_1.default, { name: icon }) : icon,
|
|
89
91
|
!icon && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
90
92
|
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)))));
|
|
93
|
+
(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),
|
|
94
|
+
(0, utils_1.isString)(iconRight) ? react_1.default.createElement(tagIcon_1.default, { ml: spaceX, name: iconRight }) : iconRight,
|
|
95
|
+
onDelete ? react_1.default.createElement(tagButton_1.default, { ml: spaceX, onClick: onDelete }) : itemRight)))));
|
|
94
96
|
});
|
|
95
97
|
exports.Tag.displayName = 'Tag';
|
|
98
|
+
exports.Tag.Button = tagButton_1.default;
|
|
96
99
|
exports.Tag.Icon = tagIcon_1.default;
|
|
97
100
|
exports.Tag.Text = tagText_1.default;
|
|
98
101
|
exports.default = exports.Tag;
|
package/tag/tag.types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { AnyElement } from '../utils';
|
|
|
6
6
|
export interface TagProps extends SystemProps, ThemingProps<'Tag'> {
|
|
7
7
|
casing?: TypographyProps['textTransform'];
|
|
8
8
|
colorScheme?: 'blue' | 'green' | 'grey' | 'prussian' | 'red' | 'yellow';
|
|
9
|
+
disabled?: boolean;
|
|
9
10
|
icon?: IconProp | AnyElement;
|
|
10
11
|
iconLeft?: IconProp | AnyElement;
|
|
11
12
|
iconRight?: IconProp | AnyElement;
|
|
@@ -14,6 +15,7 @@ export interface TagProps extends SystemProps, ThemingProps<'Tag'> {
|
|
|
14
15
|
isRound?: boolean;
|
|
15
16
|
itemLeft?: React.ReactNode;
|
|
16
17
|
itemRight?: React.ReactNode;
|
|
18
|
+
onDelete?: () => void;
|
|
17
19
|
text?: React.ReactNode;
|
|
18
20
|
weight?: TypographyProps['fontWeight'];
|
|
19
21
|
}
|
package/tag/tagButton.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.TagButton = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var context_1 = require("./context");
|
|
31
|
+
var button_1 = __importDefault(require("../button"));
|
|
32
|
+
var core_1 = require("../core");
|
|
33
|
+
exports.TagButton = (0, core_1.vui)(function (props, ref) {
|
|
34
|
+
var _a;
|
|
35
|
+
var _b = (_a = (0, context_1.useTag)()) !== null && _a !== void 0 ? _a : {}, disabled = _b.disabled, tagProps = __rest(_b, ["disabled"]);
|
|
36
|
+
var mergedProps = __assign(__assign({}, tagProps), props);
|
|
37
|
+
var styles = (0, core_1.useStyleConfig)('Tag', mergedProps);
|
|
38
|
+
return (react_1.default.createElement(button_1.default, __assign({ className: "vui-tagButton", colorScheme: mergedProps.colorScheme, disabled: disabled, icon: "falTimes", isRound: true, mr: -0.5, ref: ref }, styles.button, props)));
|
|
39
|
+
});
|
|
40
|
+
exports.TagButton.displayName = 'TagButton';
|
|
41
|
+
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,25 +72,25 @@ 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, 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 = 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,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ChangeEventHandler, FocusEventHandler, PropsOf } from '../core';
|
|
3
2
|
import { SystemProps } from '../system';
|
|
4
3
|
import { ThemingProps } from '../theme';
|
|
4
|
+
import { ChangeEventHandler, FocusEventHandler, PropsOf } from '../utils';
|
|
5
5
|
export interface TextareaProps extends SystemProps, ThemingProps<'Textarea'> {
|
|
6
6
|
autoFocus?: boolean;
|
|
7
7
|
children?: never;
|