@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/tag/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.default = void 0;
|
|
17
|
+
__exportStar(require("./context"), exports);
|
|
18
|
+
__exportStar(require("./tag"), exports);
|
|
19
|
+
__exportStar(require("./tag.types"), exports);
|
|
20
|
+
__exportStar(require("./tagIcon"), exports);
|
|
21
|
+
__exportStar(require("./tagText"), exports);
|
|
22
|
+
var tag_1 = require("./tag");
|
|
23
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(tag_1).default; } });
|
package/tag/tag.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TagProps } from './tag.types';
|
|
2
|
+
import TagIcon from './tagIcon';
|
|
3
|
+
import TagText from './tagText';
|
|
4
|
+
import { VuiComponent } from '../core';
|
|
5
|
+
import { SystemProps } from '../system';
|
|
6
|
+
export declare const TagBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
7
|
+
export declare const Tag: VuiComponent<"span", TagProps> & {
|
|
8
|
+
Icon: typeof TagIcon;
|
|
9
|
+
Text: typeof TagText;
|
|
10
|
+
};
|
|
11
|
+
export default Tag;
|
package/tag/tag.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
+
t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
47
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
48
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
49
|
+
};
|
|
50
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
51
|
+
exports.Tag = exports.TagBase = void 0;
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
53
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
54
|
+
var context_1 = require("./context");
|
|
55
|
+
var tagIcon_1 = __importDefault(require("./tagIcon"));
|
|
56
|
+
var tagText_1 = __importDefault(require("./tagText"));
|
|
57
|
+
var core_1 = require("../core");
|
|
58
|
+
var system_1 = require("../system");
|
|
59
|
+
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, colorScheme = props.colorScheme, icon = props.icon, iconLeft = props.iconLeft, iconRight = props.iconRight, isFullWidth = props.isFullWidth, _a = props.isInteractive, isInteractive = _a === void 0 ? props.onClick !== undefined : _a, isRound = props.isRound, _b = props.isTruncated, isTruncated = _b === void 0 ? true : _b, itemLeft = props.itemLeft, itemRight = props.itemRight, size = props.size, text = props.text, variant = props.variant, weight = props.weight, rest = __rest(props, ["casing", "children", "className", "colorScheme", "icon", "iconLeft", "iconRight", "isFullWidth", "isInteractive", "isRound", "isTruncated", "itemLeft", "itemRight", "size", "text", "variant", "weight"]);
|
|
63
|
+
var styles = core_1.useStyleConfig('Tag', props);
|
|
64
|
+
var _c = styles.container, activeBg = _c.activeBg, h = _c.h, hoverBg = _c.hoverBg, _d = _c.spaceX, spaceXBase = _d === void 0 ? 0 : _d, tagStyles = __rest(_c, ["activeBg", "h", "hoverBg", "spaceX"]);
|
|
65
|
+
var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, size: size, variant: variant }); }, [colorScheme, size, variant]);
|
|
66
|
+
var spaceX = spaceXBase / 8;
|
|
67
|
+
var spaceXText = (spaceXBase + 4) / 8;
|
|
68
|
+
var pl = icon || itemLeft || iconLeft ? spaceX : spaceXText;
|
|
69
|
+
var pr = icon || itemRight || iconRight ? spaceX : spaceXText;
|
|
70
|
+
var interactiveProps = isInteractive
|
|
71
|
+
? {
|
|
72
|
+
cursor: 'pointer',
|
|
73
|
+
hoverBg: hoverBg,
|
|
74
|
+
activeBg: activeBg,
|
|
75
|
+
focusRing: 3,
|
|
76
|
+
tabIndex: 0,
|
|
77
|
+
userSelect: 'none'
|
|
78
|
+
}
|
|
79
|
+
: {};
|
|
80
|
+
var aliasedProps = utils_1.filterUndefined({
|
|
81
|
+
borderRadius: isRound ? h / 2 : undefined,
|
|
82
|
+
fontWeight: weight,
|
|
83
|
+
textTransform: casing,
|
|
84
|
+
w: isFullWidth ? '100%' : undefined
|
|
85
|
+
});
|
|
86
|
+
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
|
+
!icon && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
90
|
+
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)))));
|
|
94
|
+
});
|
|
95
|
+
exports.Tag.displayName = 'Tag';
|
|
96
|
+
exports.Tag.Icon = tagIcon_1.default;
|
|
97
|
+
exports.Tag.Text = tagText_1.default;
|
|
98
|
+
exports.default = exports.Tag;
|
|
99
|
+
var templateObject_1;
|
|
@@ -2,19 +2,18 @@
|
|
|
2
2
|
import { IconProp } from '../icon';
|
|
3
3
|
import { SystemProps, TypographyProps } from '../system';
|
|
4
4
|
import { ThemingProps } from '../theme';
|
|
5
|
-
|
|
5
|
+
import { AnyElement } from '../utils';
|
|
6
|
+
export interface TagProps extends SystemProps, ThemingProps<'Tag'> {
|
|
6
7
|
casing?: TypographyProps['textTransform'];
|
|
7
8
|
colorScheme?: 'blue' | 'green' | 'grey' | 'prussian' | 'red' | 'yellow';
|
|
8
|
-
icon?: IconProp;
|
|
9
|
-
iconLeft?: IconProp;
|
|
10
|
-
iconRight?: IconProp;
|
|
11
|
-
isElevated?: boolean;
|
|
9
|
+
icon?: IconProp | AnyElement;
|
|
10
|
+
iconLeft?: IconProp | AnyElement;
|
|
11
|
+
iconRight?: IconProp | AnyElement;
|
|
12
12
|
isFullWidth?: boolean;
|
|
13
13
|
isInteractive?: boolean;
|
|
14
14
|
isRound?: boolean;
|
|
15
|
-
isSplit?: boolean;
|
|
16
15
|
itemLeft?: React.ReactNode;
|
|
17
16
|
itemRight?: React.ReactNode;
|
|
18
|
-
text?:
|
|
17
|
+
text?: React.ReactNode;
|
|
19
18
|
weight?: TypographyProps['fontWeight'];
|
|
20
19
|
}
|
package/tag/tag.types.js
ADDED
package/tag/tagIcon.d.ts
ADDED
package/tag/tagIcon.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.TagIcon = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var context_1 = require("./context");
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var icon_1 = __importDefault(require("../icon"));
|
|
22
|
+
exports.TagIcon = core_1.vui(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var tagProps = (_a = context_1.useTag()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, tagProps), props);
|
|
26
|
+
var styles = core_1.useStyleConfig('Tag', mergedProps);
|
|
27
|
+
return react_1.default.createElement(icon_1.default, __assign({ className: "vui-tagIcon", ref: ref }, styles.icon, props));
|
|
28
|
+
});
|
|
29
|
+
exports.TagIcon.displayName = 'TagIcon';
|
|
30
|
+
exports.default = exports.TagIcon;
|
package/tag/tagText.d.ts
ADDED
package/tag/tagText.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.TagText = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var context_1 = require("./context");
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var t_1 = __importDefault(require("../t"));
|
|
22
|
+
exports.TagText = core_1.vui(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var tagProps = (_a = context_1.useTag()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, tagProps), props);
|
|
26
|
+
var styles = core_1.useStyleConfig('Tag', mergedProps);
|
|
27
|
+
return react_1.default.createElement(t_1.default, __assign({ className: "vui-tagText", fontSize: "inherit", ref: ref }, styles.text, props));
|
|
28
|
+
});
|
|
29
|
+
exports.TagText.displayName = 'TagText';
|
|
30
|
+
exports.default = exports.TagText;
|
package/tag/theme.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Dict } from '../utils';
|
|
2
|
+
declare function variantSolid(props: Dict): {
|
|
3
|
+
container: {
|
|
4
|
+
hoverBg: string;
|
|
5
|
+
activeBg: string;
|
|
6
|
+
bg: string;
|
|
7
|
+
color: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare function variantSubtle(props: Dict): {
|
|
11
|
+
container: {
|
|
12
|
+
hoverBg: string;
|
|
13
|
+
activeBg: string;
|
|
14
|
+
bg: string;
|
|
15
|
+
color: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
declare const _default: {
|
|
19
|
+
defaultProps: {
|
|
20
|
+
colorScheme: string;
|
|
21
|
+
size: string;
|
|
22
|
+
variant: string;
|
|
23
|
+
};
|
|
24
|
+
parts: string[];
|
|
25
|
+
sizes: {
|
|
26
|
+
sm: {
|
|
27
|
+
container: {
|
|
28
|
+
fontSize: string;
|
|
29
|
+
h: number;
|
|
30
|
+
spaceX: number;
|
|
31
|
+
};
|
|
32
|
+
icon: {
|
|
33
|
+
size: string;
|
|
34
|
+
};
|
|
35
|
+
text: {};
|
|
36
|
+
};
|
|
37
|
+
md: {
|
|
38
|
+
container: {
|
|
39
|
+
fontSize: string;
|
|
40
|
+
h: number;
|
|
41
|
+
spaceX: number;
|
|
42
|
+
};
|
|
43
|
+
icon: {
|
|
44
|
+
size: string;
|
|
45
|
+
};
|
|
46
|
+
text: {};
|
|
47
|
+
};
|
|
48
|
+
lg: {
|
|
49
|
+
container: {
|
|
50
|
+
fontSize: string;
|
|
51
|
+
h: number;
|
|
52
|
+
spaceX: number;
|
|
53
|
+
};
|
|
54
|
+
icon: {
|
|
55
|
+
size: string;
|
|
56
|
+
};
|
|
57
|
+
text: {};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
variants: {
|
|
61
|
+
solid: typeof variantSolid;
|
|
62
|
+
subtle: typeof variantSubtle;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export default _default;
|
package/tag/theme.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function variantSolid(props) {
|
|
4
|
+
var c = props.colorScheme;
|
|
5
|
+
var container = {
|
|
6
|
+
hoverBg: c + ".90",
|
|
7
|
+
activeBg: c + ".100",
|
|
8
|
+
bg: c + ".80",
|
|
9
|
+
color: 'white'
|
|
10
|
+
};
|
|
11
|
+
if (c === 'yellow') {
|
|
12
|
+
container.hoverBg = c + ".80";
|
|
13
|
+
container.activeBg = c + ".90";
|
|
14
|
+
container.bg = c + ".70";
|
|
15
|
+
}
|
|
16
|
+
return { container: container };
|
|
17
|
+
}
|
|
18
|
+
function variantSubtle(props) {
|
|
19
|
+
var c = props.colorScheme;
|
|
20
|
+
var container = {
|
|
21
|
+
hoverBg: c + ".30",
|
|
22
|
+
activeBg: c + ".40",
|
|
23
|
+
bg: c + ".20",
|
|
24
|
+
color: 'prussian.80'
|
|
25
|
+
};
|
|
26
|
+
return { container: container };
|
|
27
|
+
}
|
|
28
|
+
var defaultProps = {
|
|
29
|
+
colorScheme: 'blue',
|
|
30
|
+
size: 'md',
|
|
31
|
+
variant: 'subtle'
|
|
32
|
+
};
|
|
33
|
+
var parts = ['container', 'icon', 'text'];
|
|
34
|
+
var sizes = {
|
|
35
|
+
sm: {
|
|
36
|
+
container: {
|
|
37
|
+
fontSize: 'sm',
|
|
38
|
+
h: 24,
|
|
39
|
+
spaceX: 4
|
|
40
|
+
},
|
|
41
|
+
icon: {
|
|
42
|
+
size: 'xs'
|
|
43
|
+
},
|
|
44
|
+
text: {}
|
|
45
|
+
},
|
|
46
|
+
md: {
|
|
47
|
+
container: {
|
|
48
|
+
fontSize: 'sm',
|
|
49
|
+
h: 32,
|
|
50
|
+
spaceX: 6
|
|
51
|
+
},
|
|
52
|
+
icon: {
|
|
53
|
+
size: 'sm'
|
|
54
|
+
},
|
|
55
|
+
text: {}
|
|
56
|
+
},
|
|
57
|
+
lg: {
|
|
58
|
+
container: {
|
|
59
|
+
fontSize: 'md',
|
|
60
|
+
h: 40,
|
|
61
|
+
spaceX: 8
|
|
62
|
+
},
|
|
63
|
+
icon: {
|
|
64
|
+
size: 'md'
|
|
65
|
+
},
|
|
66
|
+
text: {}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
var variants = {
|
|
70
|
+
solid: variantSolid,
|
|
71
|
+
subtle: variantSubtle
|
|
72
|
+
};
|
|
73
|
+
exports.default = {
|
|
74
|
+
defaultProps: defaultProps,
|
|
75
|
+
parts: parts,
|
|
76
|
+
sizes: sizes,
|
|
77
|
+
variants: variants
|
|
78
|
+
};
|