@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/heading/heading.js
CHANGED
|
@@ -35,18 +35,18 @@ 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.HeadingBase = styled_components_1.default.h2.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.system);
|
|
39
|
-
exports.Heading = core_1.vui(function (props, ref) {
|
|
40
|
-
var _a = core_1.omitThemingProps(props), align = _a.align, casing = _a.casing, children = _a.children, className = _a.className, decoration = _a.decoration, text = _a.text, weight = _a.weight, rest = __rest(_a, ["align", "casing", "children", "className", "decoration", "text", "weight"]);
|
|
41
|
-
var styles = core_1.useStyleConfig('Heading', props);
|
|
38
|
+
exports.HeadingBase = styled_components_1.default.h2.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\t", "\n"], ["\n\t", "\n"])), system_1.system);
|
|
39
|
+
exports.Heading = (0, core_1.vui)(function (props, ref) {
|
|
40
|
+
var _a = (0, core_1.omitThemingProps)(props), align = _a.align, casing = _a.casing, children = _a.children, className = _a.className, decoration = _a.decoration, text = _a.text, weight = _a.weight, rest = __rest(_a, ["align", "casing", "children", "className", "decoration", "text", "weight"]);
|
|
41
|
+
var styles = (0, core_1.useStyleConfig)('Heading', props);
|
|
42
42
|
var hClassName = props.size ? "vui-" + props.size : '';
|
|
43
|
-
var aliasedProps = utils_1.filterUndefined({
|
|
43
|
+
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
44
44
|
fontWeight: weight,
|
|
45
45
|
textAlign: align,
|
|
46
46
|
textDecoration: decoration,
|
|
47
47
|
textTransform: casing
|
|
48
48
|
});
|
|
49
|
-
return (react_1.default.createElement(exports.HeadingBase, __assign({ className: utils_1.cs('vui-heading', hClassName, className), fontWeight: "demi", ref: ref, transitionDuration: "fast" }, styles, aliasedProps, rest), children !== null && children !== void 0 ? children : text));
|
|
49
|
+
return (react_1.default.createElement(exports.HeadingBase, __assign({ className: (0, utils_1.cs)('vui-heading', hClassName, className), fontWeight: "demi", ref: ref, transitionDuration: "fast" }, styles, aliasedProps, rest), children !== null && children !== void 0 ? children : text));
|
|
50
50
|
});
|
|
51
51
|
exports.Heading.displayName = 'Heading';
|
|
52
52
|
exports.default = exports.Heading;
|
package/heading/headings.js
CHANGED
|
@@ -18,9 +18,9 @@ exports.H6 = exports.H5 = exports.H4 = exports.H3 = exports.H2 = exports.H1 = vo
|
|
|
18
18
|
var react_1 = __importDefault(require("react"));
|
|
19
19
|
var heading_1 = __importDefault(require("./heading"));
|
|
20
20
|
var core_1 = require("../core");
|
|
21
|
-
exports.H1 = core_1.vui(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h1" }, props)); });
|
|
22
|
-
exports.H2 = core_1.vui(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h2" }, props)); });
|
|
23
|
-
exports.H3 = core_1.vui(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h3" }, props)); });
|
|
24
|
-
exports.H4 = core_1.vui(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h4" }, props)); });
|
|
25
|
-
exports.H5 = core_1.vui(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h5" }, props)); });
|
|
26
|
-
exports.H6 = core_1.vui(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h6" }, props)); });
|
|
21
|
+
exports.H1 = (0, core_1.vui)(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h1" }, props)); });
|
|
22
|
+
exports.H2 = (0, core_1.vui)(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h2" }, props)); });
|
|
23
|
+
exports.H3 = (0, core_1.vui)(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h3" }, props)); });
|
|
24
|
+
exports.H4 = (0, core_1.vui)(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h4" }, props)); });
|
|
25
|
+
exports.H5 = (0, core_1.vui)(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h5" }, props)); });
|
|
26
|
+
exports.H6 = (0, core_1.vui)(function (props, ref) { return react_1.default.createElement(heading_1.default, __assign({ ref: ref, size: "h6" }, props)); });
|
package/icon/icon.js
CHANGED
|
@@ -31,18 +31,18 @@ var helpers_1 = require("./helpers");
|
|
|
31
31
|
var core_1 = require("../core");
|
|
32
32
|
var svg_1 = require("../svg");
|
|
33
33
|
var utils_1 = require("../utils");
|
|
34
|
-
exports.Icon = core_1.vui(function (props, ref) {
|
|
34
|
+
exports.Icon = (0, core_1.vui)(function (props, ref) {
|
|
35
35
|
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
|
|
36
|
-
var _a = core_1.omitThemingProps(props), className = _a.className, icon = _a.icon, _b = _a.name, name = _b === void 0 ? props.icon : _b, rotate = _a.rotate, scale = _a.scale, rest = __rest(_a, ["className", "icon", "name", "rotate", "scale"]);
|
|
37
|
-
var styles = core_1.useStyleConfig('Icon', props);
|
|
38
|
-
var _c = helpers_1.getIconDetails(name), customIcon = _c.customIcon, src = _c.src;
|
|
36
|
+
var _a = (0, core_1.omitThemingProps)(props), className = _a.className, icon = _a.icon, _b = _a.name, name = _b === void 0 ? props.icon : _b, rotate = _a.rotate, scale = _a.scale, rest = __rest(_a, ["className", "icon", "name", "rotate", "scale"]);
|
|
37
|
+
var styles = (0, core_1.useStyleConfig)('Icon', props);
|
|
38
|
+
var _c = (0, helpers_1.getIconDetails)(name), customIcon = _c.customIcon, src = _c.src;
|
|
39
39
|
var scaledSize = scale ? 16 * scale : undefined;
|
|
40
|
-
var aliasedProps = utils_1.filterUndefined({
|
|
40
|
+
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
41
41
|
h: scaledSize,
|
|
42
42
|
transform: rotate !== undefined ? "rotate(" + rotate + "deg)" : undefined,
|
|
43
43
|
w: scaledSize
|
|
44
44
|
});
|
|
45
|
-
return (react_1.default.createElement(svg_1.Svg, __assign({ className: utils_1.cs('vui-icon', className), display: "inline-flex", flexShrink: 0, ref: ref, src: src }, styles, customIcon === null || customIcon === void 0 ? void 0 : customIcon.svgProps, aliasedProps, rest), customIcon === null || customIcon === void 0 ? void 0 : customIcon.d.map(function (d, i) { return (react_1.default.createElement("path", __assign({ d: d, fill: "currentColor", key: i }, customIcon.pathProps[i]))); })));
|
|
45
|
+
return (react_1.default.createElement(svg_1.Svg, __assign({ className: (0, utils_1.cs)('vui-icon', className), display: "inline-flex", flexShrink: 0, ref: ref, src: src }, styles, customIcon === null || customIcon === void 0 ? void 0 : customIcon.svgProps, aliasedProps, rest), customIcon === null || customIcon === void 0 ? void 0 : customIcon.d.map(function (d, i) { return (react_1.default.createElement("path", __assign({ d: d, fill: "currentColor", key: i }, customIcon.pathProps[i]))); })));
|
|
46
46
|
});
|
|
47
47
|
exports.Icon.displayName = 'Icon';
|
|
48
48
|
exports.default = exports.Icon;
|
package/icon/icon.types.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { PropsOf } from '../core';
|
|
3
2
|
import { VuiIcon } from '../icons';
|
|
4
3
|
import Svg, { SvgProps } from '../svg';
|
|
5
4
|
import { ThemingProps } from '../theme';
|
|
6
|
-
import { AnyString } from '../utils';
|
|
5
|
+
import { AnyString, PropsOf } from '../utils';
|
|
7
6
|
export interface GetIconDetailsResult {
|
|
8
7
|
customIcon?: {
|
|
9
8
|
d: string[];
|
package/icons/library.js
CHANGED
|
@@ -15,10 +15,14 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
15
15
|
}
|
|
16
16
|
return ar;
|
|
17
17
|
};
|
|
18
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
19
|
-
for (var i = 0,
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
22
26
|
};
|
|
23
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
28
|
var consts_1 = require("./consts");
|
|
@@ -47,7 +51,7 @@ var Library = /** @class */ (function () {
|
|
|
47
51
|
return _this.cache.has(name);
|
|
48
52
|
};
|
|
49
53
|
this.init = function () {
|
|
50
|
-
_this.add.apply(_this, __spreadArray([], __read(Object.values(consts_1.defaultIcons))));
|
|
54
|
+
_this.add.apply(_this, __spreadArray([], __read(Object.values(consts_1.defaultIcons)), false));
|
|
51
55
|
};
|
|
52
56
|
this.reset = function () {
|
|
53
57
|
_this.cache.clear();
|
package/icons/types.d.ts
CHANGED
package/image/image.js
CHANGED
|
@@ -29,10 +29,10 @@ exports.Image = void 0;
|
|
|
29
29
|
var react_1 = __importDefault(require("react"));
|
|
30
30
|
var core_1 = require("../core");
|
|
31
31
|
var utils_1 = require("../utils");
|
|
32
|
-
exports.Image = core_1.vui(function (props, ref) {
|
|
33
|
-
var _a = core_1.omitThemingProps(props), className = _a.className, rest = __rest(_a, ["className"]);
|
|
34
|
-
var styles = core_1.useStyleConfig('Image', props);
|
|
35
|
-
return react_1.default.createElement(core_1.v.img, __assign({ className: utils_1.cs('vui-image', className), ref: ref }, styles, rest));
|
|
32
|
+
exports.Image = (0, core_1.vui)(function (props, ref) {
|
|
33
|
+
var _a = (0, core_1.omitThemingProps)(props), className = _a.className, rest = __rest(_a, ["className"]);
|
|
34
|
+
var styles = (0, core_1.useStyleConfig)('Image', props);
|
|
35
|
+
return react_1.default.createElement(core_1.v.img, __assign({ className: (0, utils_1.cs)('vui-image', className), ref: ref }, styles, rest));
|
|
36
36
|
});
|
|
37
37
|
exports.Image.displayName = 'Image';
|
|
38
38
|
exports.default = exports.Image;
|
package/input/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.useInput = exports.InputProvider = void 0;
|
|
20
20
|
var core_1 = require("../core");
|
|
21
|
-
var _a = __read(core_1.createContext({ isOptional: true }), 2), InputProvider = _a[0], useInput = _a[1];
|
|
21
|
+
var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), InputProvider = _a[0], useInput = _a[1];
|
|
22
22
|
exports.InputProvider = InputProvider;
|
|
23
23
|
exports.useInput = useInput;
|
package/input/input.js
CHANGED
|
@@ -76,35 +76,30 @@ var core_1 = require("../core");
|
|
|
76
76
|
var system_1 = require("../system");
|
|
77
77
|
var t_1 = __importDefault(require("../t"));
|
|
78
78
|
var utils_1 = require("../utils");
|
|
79
|
-
exports.InputBase = styled_components_1.default.div.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tbackground-color: white;\n\tborder-width: 1px;\n\tdisplay: flex;\n\toutline: none;\n\tposition: relative;\n\twidth: 100%;\n\n\t&.disabled {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tbackground-color: white;\n\tborder-width: 1px;\n\tdisplay: flex;\n\toutline: none;\n\tposition: relative;\n\twidth: 100%;\n\n\t&.disabled {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
80
|
-
exports.Input = core_1.vui(function (props, ref) {
|
|
79
|
+
exports.InputBase = styled_components_1.default.div.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tbackground-color: white;\n\tborder-width: 1px;\n\tdisplay: flex;\n\toutline: none;\n\tposition: relative;\n\twidth: 100%;\n\n\t&.disabled {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tbackground-color: white;\n\tborder-width: 1px;\n\tdisplay: flex;\n\toutline: none;\n\tposition: relative;\n\twidth: 100%;\n\n\t&.disabled {\n\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
80
|
+
exports.Input = (0, core_1.vui)(function (props, ref) {
|
|
81
81
|
var _a, _b, _c, _d;
|
|
82
|
-
var _e = __read(react_1.useState(helpers_1.getInitialCount(props)), 2), count = _e[0], setCount = _e[1];
|
|
82
|
+
var _e = __read((0, react_1.useState)((0, helpers_1.getInitialCount)(props)), 2), count = _e[0], setCount = _e[1];
|
|
83
83
|
var autoComplete = props.autoComplete, autoFocus = props.autoFocus, children = props.children, className = props.className, colorScheme = props.colorScheme, defaultValue = props.defaultValue, disabled = props.disabled, iconLeft = props.iconLeft, iconRight = props.iconRight, id = props.id, input = props.input, inputProps = props.inputProps, inputRef = props.inputRef, isInvalid = props.isInvalid, itemLeft = props.itemLeft, itemRight = props.itemRight, max = props.max, maxLength = props.maxLength, min = props.min, name = props.name, onBlur = props.onBlur, onChangeProp = props.onChange, onFocus = props.onFocus, pattern = props.pattern, placeholder = props.placeholder, readOnly = props.readOnly, required = props.required, showCount = props.showCount, size = props.size, _f = props.state, state = _f === void 0 ? '' : _f, stateMapping = props.stateMapping, step = props.step, _g = props.type, type = _g === void 0 ? 'text' : _g, value = props.value, variant = props.variant, rest = __rest(props, ["autoComplete", "autoFocus", "children", "className", "colorScheme", "defaultValue", "disabled", "iconLeft", "iconRight", "id", "input", "inputProps", "inputRef", "isInvalid", "itemLeft", "itemRight", "max", "maxLength", "min", "name", "onBlur", "onChange", "onFocus", "pattern", "placeholder", "readOnly", "required", "showCount", "size", "state", "stateMapping", "step", "type", "value", "variant"]);
|
|
84
84
|
var states = __assign(__assign({}, consts_1.inputStateMapping), stateMapping);
|
|
85
|
-
var computedColorScheme = utils_1.filterUndefined({
|
|
85
|
+
var computedColorScheme = (0, utils_1.filterUndefined)({
|
|
86
86
|
colorScheme: (_a = colorScheme !== null && colorScheme !== void 0 ? colorScheme : (isInvalid ? 'red' : undefined)) !== null && _a !== void 0 ? _a : (_b = states[state]) === null || _b === void 0 ? void 0 : _b.colorScheme
|
|
87
87
|
});
|
|
88
|
-
var styles = core_1.useStyleConfig('Input', __assign(__assign({}, computedColorScheme), props));
|
|
89
|
-
var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, disabled: disabled, size: size, variant: variant }); }, [
|
|
90
|
-
colorScheme,
|
|
91
|
-
disabled,
|
|
92
|
-
size,
|
|
93
|
-
variant
|
|
94
|
-
]);
|
|
88
|
+
var styles = (0, core_1.useStyleConfig)('Input', __assign(__assign({}, computedColorScheme), props));
|
|
89
|
+
var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, disabled: disabled, size: size, variant: variant }); }, [colorScheme, disabled, size, variant]);
|
|
95
90
|
function onChange(e) {
|
|
96
91
|
setCount(e.target.value.length);
|
|
97
92
|
onChangeProp === null || onChangeProp === void 0 ? void 0 : onChangeProp(e);
|
|
98
93
|
}
|
|
99
|
-
var aliasedProps = utils_1.filterUndefined({
|
|
100
|
-
bg: readOnly ? 'grey.
|
|
94
|
+
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
95
|
+
bg: readOnly ? 'grey.10' : undefined,
|
|
101
96
|
focusWithinBorderColor: !readOnly ? 'transparent' : undefined,
|
|
102
97
|
focusWithinRingColor: readOnly ? 'transparent' : undefined
|
|
103
98
|
});
|
|
104
99
|
return (react_1.default.createElement(context_1.InputProvider, { value: context },
|
|
105
|
-
react_1.default.createElement(exports.InputBase, __assign({ borderRadius: "md", className: utils_1.cs('vui-input', disabled && 'disabled', className), ref: ref, transitionDuration: "fast" }, styles.container, aliasedProps, rest),
|
|
100
|
+
react_1.default.createElement(exports.InputBase, __assign({ borderRadius: "md", className: (0, utils_1.cs)('vui-input', disabled && 'disabled', className), ref: ref, transitionDuration: "fast" }, styles.container, aliasedProps, rest),
|
|
106
101
|
itemLeft,
|
|
107
|
-
utils_1.isString(iconLeft) ? react_1.default.createElement(inputIcon_1.default, { ml: 1, name: iconLeft }) : iconLeft, (_c = children !== null && children !== void 0 ? children : input) !== null && _c !== void 0 ? _c : (react_1.default.createElement(inputInput_1.default, __assign({ ref: inputRef }, {
|
|
102
|
+
(0, utils_1.isString)(iconLeft) ? react_1.default.createElement(inputIcon_1.default, { ml: 1, name: iconLeft }) : iconLeft, (_c = children !== null && children !== void 0 ? children : input) !== null && _c !== void 0 ? _c : (react_1.default.createElement(inputInput_1.default, __assign({ ref: inputRef }, {
|
|
108
103
|
autoComplete: autoComplete,
|
|
109
104
|
autoFocus: autoFocus,
|
|
110
105
|
defaultValue: defaultValue,
|
|
@@ -125,7 +120,7 @@ exports.Input = core_1.vui(function (props, ref) {
|
|
|
125
120
|
type: type,
|
|
126
121
|
value: value
|
|
127
122
|
}, inputProps))),
|
|
128
|
-
utils_1.isString(iconRight) ? react_1.default.createElement(inputIcon_1.default, { mr: 1, name: iconRight }) : iconRight,
|
|
123
|
+
(0, utils_1.isString)(iconRight) ? react_1.default.createElement(inputIcon_1.default, { mr: 1, name: iconRight }) : iconRight,
|
|
129
124
|
itemRight,
|
|
130
125
|
state && react_1.default.createElement(inputIcon_1.default, __assign({ mr: 1 }, (_d = states[state]) === null || _d === void 0 ? void 0 : _d.iconProps)),
|
|
131
126
|
showCount && (react_1.default.createElement(t_1.default, { color: "grey.80", position: "absolute", right: 0, size: "sm", top: "calc(100% + 1px)" },
|
package/input/input.types.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ChangeEventHandler, FocusEventHandler, PropsOf } from '../core';
|
|
3
2
|
import { IconProp, IconProps } from '../icon';
|
|
4
3
|
import { SystemProps } from '../system';
|
|
5
4
|
import { ThemingProps } from '../theme';
|
|
6
|
-
import { AnyElement } from '../utils';
|
|
5
|
+
import { AnyElement, ChangeEventHandler, FocusEventHandler, PropsOf } from '../utils';
|
|
7
6
|
export interface InputInputProps extends PropsOf<'input', SystemProps> {
|
|
8
7
|
}
|
|
9
8
|
export interface InputProps extends SystemProps, ThemingProps<'Input'> {
|
package/input/inputIcon.js
CHANGED
|
@@ -19,10 +19,10 @@ 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.InputIcon = core_1.vui(function (props, ref) {
|
|
23
|
-
var inputProps = context_1.useInput();
|
|
22
|
+
exports.InputIcon = (0, core_1.vui)(function (props, ref) {
|
|
23
|
+
var inputProps = (0, context_1.useInput)();
|
|
24
24
|
var mergedProps = __assign(__assign({}, inputProps), props);
|
|
25
|
-
var styles = core_1.useStyleConfig('Input', mergedProps);
|
|
25
|
+
var styles = (0, core_1.useStyleConfig)('Input', mergedProps);
|
|
26
26
|
var color = !mergedProps.disabled ? 'blue.80' : 'grey.50';
|
|
27
27
|
return react_1.default.createElement(icon_1.default, __assign({ className: "vui-inputIcon", color: color, ref: ref }, styles.icon, props));
|
|
28
28
|
});
|
package/input/inputInput.js
CHANGED
|
@@ -24,11 +24,11 @@ var styled_components_1 = __importDefault(require("styled-components"));
|
|
|
24
24
|
var context_1 = require("./context");
|
|
25
25
|
var core_1 = require("../core");
|
|
26
26
|
var system_1 = require("../system");
|
|
27
|
-
exports.InputInputBase = styled_components_1.default.input.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-self: stretch;\n\tbackground-color: transparent;\n\tborder: none;\n\tflex: 1;\n\tfont-size: inherit;\n\tmin-width: 0;\n\toutline: none;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"], ["\n\talign-self: stretch;\n\tbackground-color: transparent;\n\tborder: none;\n\tflex: 1;\n\tfont-size: inherit;\n\tmin-width: 0;\n\toutline: none;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
28
|
-
exports.InputInput = core_1.vui(function (props, ref) {
|
|
29
|
-
var inputProps = context_1.useInput();
|
|
27
|
+
exports.InputInputBase = styled_components_1.default.input.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-self: stretch;\n\tbackground-color: transparent;\n\tborder: none;\n\tflex: 1;\n\tfont-size: inherit;\n\tmin-width: 0;\n\toutline: none;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"], ["\n\talign-self: stretch;\n\tbackground-color: transparent;\n\tborder: none;\n\tflex: 1;\n\tfont-size: inherit;\n\tmin-width: 0;\n\toutline: none;\n\n\t:disabled,\n\t:disabled::placeholder {\n\t\tcolor: var(--vui-colors-disabled-font);\n\t\tcursor: not-allowed;\n\t}\n\n\t", "\n"])), system_1.system);
|
|
28
|
+
exports.InputInput = (0, core_1.vui)(function (props, ref) {
|
|
29
|
+
var inputProps = (0, context_1.useInput)();
|
|
30
30
|
var mergedProps = __assign(__assign({}, inputProps), props);
|
|
31
|
-
var styles = core_1.useStyleConfig('Input', mergedProps);
|
|
31
|
+
var styles = (0, core_1.useStyleConfig)('Input', mergedProps);
|
|
32
32
|
return (react_1.default.createElement(exports.InputInputBase, __assign({ borderRadius: "md", className: "vui-inputInput", placeholderColor: "grey.60", px: 1, ref: ref }, styles.input, props)));
|
|
33
33
|
});
|
|
34
34
|
exports.InputInput.displayName = 'InputInput';
|
package/link/context.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.useLink = exports.LinkProvider = void 0;
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), LinkProvider = _a[0], useLink = _a[1];
|
|
22
|
+
exports.LinkProvider = LinkProvider;
|
|
23
|
+
exports.useLink = useLink;
|
package/link/index.d.ts
CHANGED
package/link/index.js
CHANGED
|
@@ -16,5 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.default = void 0;
|
|
17
17
|
__exportStar(require("./link"), exports);
|
|
18
18
|
__exportStar(require("./link.types"), exports);
|
|
19
|
+
__exportStar(require("./linkIcon"), exports);
|
|
20
|
+
__exportStar(require("./linkText"), exports);
|
|
19
21
|
var link_1 = require("./link");
|
|
20
22
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(link_1).default; } });
|
package/link/link.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { LinkProps } from './link.types';
|
|
2
|
+
import LinkIcon from './linkIcon';
|
|
3
|
+
import LinkText from './linkText';
|
|
4
|
+
import { VuiComponent } from '../core';
|
|
2
5
|
import { SystemProps } from '../system';
|
|
3
6
|
export declare const LinkBase: import("styled-components").StyledComponent<"a", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
4
|
-
export declare const Link:
|
|
7
|
+
export declare const Link: VuiComponent<"a", LinkProps> & {
|
|
8
|
+
Icon: typeof LinkIcon;
|
|
9
|
+
Text: typeof LinkText;
|
|
10
|
+
};
|
|
5
11
|
export default Link;
|
package/link/link.js
CHANGED
|
@@ -14,6 +14,25 @@ var __assign = (this && this.__assign) || function () {
|
|
|
14
14
|
};
|
|
15
15
|
return __assign.apply(this, arguments);
|
|
16
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
|
+
};
|
|
17
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
18
37
|
var t = {};
|
|
19
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -30,24 +49,33 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
30
49
|
};
|
|
31
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
51
|
exports.Link = exports.LinkBase = void 0;
|
|
33
|
-
var react_1 =
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
34
53
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
54
|
+
var context_1 = require("./context");
|
|
55
|
+
var linkIcon_1 = __importDefault(require("./linkIcon"));
|
|
56
|
+
var linkText_1 = __importDefault(require("./linkText"));
|
|
35
57
|
var core_1 = require("../core");
|
|
36
58
|
var system_1 = require("../system");
|
|
37
59
|
var utils_1 = require("../utils");
|
|
38
|
-
exports.LinkBase = styled_components_1.default.a.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\toutline: none;\n\ttext-decoration: none;\n\twidth: fit-content;\n\n\t", "\n"], ["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\toutline: none;\n\ttext-decoration: none;\n\twidth: fit-content;\n\n\t", "\n"])), system_1.system);
|
|
39
|
-
exports.Link = core_1.vui(function (props, ref) {
|
|
40
|
-
var
|
|
41
|
-
var styles = core_1.useStyleConfig('Link', props);
|
|
42
|
-
var
|
|
60
|
+
exports.LinkBase = styled_components_1.default.a.withConfig((0, core_1.forwardPropConfig)(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\toutline: none;\n\ttext-decoration: none;\n\twidth: fit-content;\n\n\t", "\n"], ["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\toutline: none;\n\ttext-decoration: none;\n\twidth: fit-content;\n\n\t", "\n"])), system_1.system);
|
|
61
|
+
exports.Link = (0, core_1.vui)(function (props, ref) {
|
|
62
|
+
var children = props.children, className = props.className, colorScheme = props.colorScheme, decoration = props.decoration, disabled = props.disabled, _a = props.hoverDecoration, hoverDecoration = _a === void 0 ? 'underline' : _a, iconLeft = props.iconLeft, iconRight = props.iconRight, isExternal = props.isExternal, isUnderlined = props.isUnderlined, size = props.size, text = props.text, variant = props.variant, weight = props.weight, rest = __rest(props, ["children", "className", "colorScheme", "decoration", "disabled", "hoverDecoration", "iconLeft", "iconRight", "isExternal", "isUnderlined", "size", "text", "variant", "weight"]);
|
|
63
|
+
var styles = (0, core_1.useStyleConfig)('Link', props);
|
|
64
|
+
var context = (0, react_1.useMemo)(function () { return (0, utils_1.filterUndefined)({ colorScheme: colorScheme, disabled: disabled, size: size, variant: variant }); }, [colorScheme, disabled, size, variant]);
|
|
65
|
+
var aliasedProps = (0, utils_1.filterUndefined)({
|
|
43
66
|
fontWeight: weight,
|
|
44
67
|
hoverTextDecoration: hoverDecoration,
|
|
45
68
|
rel: isExternal ? 'noopener' : undefined,
|
|
46
69
|
target: isExternal ? '_blank' : undefined,
|
|
47
70
|
textDecoration: decoration !== null && decoration !== void 0 ? decoration : (isUnderlined ? 'underline' : undefined)
|
|
48
71
|
});
|
|
49
|
-
return (react_1.default.createElement(
|
|
72
|
+
return (react_1.default.createElement(context_1.LinkProvider, { value: context },
|
|
73
|
+
react_1.default.createElement(exports.LinkBase, __assign({ borderRadius: "sm", className: (0, utils_1.cs)('vui-link', className), focusRing: 2, ref: ref, transitionDuration: "instant" }, styles.container, aliasedProps, rest),
|
|
74
|
+
(0, utils_1.isString)(iconLeft) ? react_1.default.createElement(linkIcon_1.default, { mr: 1, name: iconLeft }) : iconLeft, children !== null && children !== void 0 ? children : ((0, utils_1.isReactText)(text) ? react_1.default.createElement(linkText_1.default, { text: text }) : text),
|
|
75
|
+
(0, utils_1.isString)(iconRight) ? react_1.default.createElement(linkIcon_1.default, { ml: 1, name: iconRight }) : iconRight)));
|
|
50
76
|
});
|
|
51
77
|
exports.Link.displayName = 'Link';
|
|
78
|
+
exports.Link.Icon = linkIcon_1.default;
|
|
79
|
+
exports.Link.Text = linkText_1.default;
|
|
52
80
|
exports.default = exports.Link;
|
|
53
81
|
var templateObject_1;
|
package/link/link.types.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import { IconProp } from '../icon';
|
|
1
2
|
import { SystemProps, TypographyProps } from '../system';
|
|
2
3
|
import { ThemingProps } from '../theme';
|
|
4
|
+
import { AnyElement } from '../utils';
|
|
3
5
|
export interface LinkProps extends SystemProps, ThemingProps<'Link'> {
|
|
4
6
|
colorScheme?: 'blue' | 'white';
|
|
5
7
|
decoration?: TypographyProps['textDecoration'];
|
|
8
|
+
disabled?: boolean;
|
|
6
9
|
hoverDecoration?: TypographyProps['textDecoration'];
|
|
10
|
+
iconLeft?: IconProp | AnyElement;
|
|
11
|
+
iconRight?: IconProp | AnyElement;
|
|
7
12
|
isExternal?: boolean;
|
|
8
13
|
isUnderlined?: boolean;
|
|
9
14
|
text?: number | string;
|
package/link/linkIcon.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.LinkIcon = 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.LinkIcon = (0, core_1.vui)(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var linkProps = (_a = (0, context_1.useLink)()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, linkProps), props);
|
|
26
|
+
var styles = (0, core_1.useStyleConfig)('Link', mergedProps);
|
|
27
|
+
return react_1.default.createElement(icon_1.default, __assign({ className: "vui-linkIcon", ref: ref }, styles.icon, props));
|
|
28
|
+
});
|
|
29
|
+
exports.LinkIcon.displayName = 'LinkIcon';
|
|
30
|
+
exports.default = exports.LinkIcon;
|
package/link/linkText.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.LinkText = 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.LinkText = (0, core_1.vui)(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var linkProps = (_a = (0, context_1.useLink)()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, linkProps), props);
|
|
26
|
+
var styles = (0, core_1.useStyleConfig)('Link', mergedProps);
|
|
27
|
+
return react_1.default.createElement(t_1.default, __assign({ className: "vui-linkText", fontSize: "inherit", ref: ref }, styles.text, props));
|
|
28
|
+
});
|
|
29
|
+
exports.LinkText.displayName = 'LinkText';
|
|
30
|
+
exports.default = exports.LinkText;
|
package/link/theme.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Dict } from '../utils';
|
|
2
2
|
declare function variantDefault(props: Dict): {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
container: {
|
|
4
|
+
color: string;
|
|
5
|
+
hoverColor: string;
|
|
6
|
+
};
|
|
5
7
|
};
|
|
6
8
|
declare function variantLight(props: Dict): {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
container: {
|
|
10
|
+
color: string;
|
|
11
|
+
hoverColor: string;
|
|
12
|
+
};
|
|
9
13
|
};
|
|
10
14
|
declare const _default: {
|
|
11
15
|
defaultProps: {
|
|
@@ -13,18 +17,31 @@ declare const _default: {
|
|
|
13
17
|
size: string;
|
|
14
18
|
variant: string;
|
|
15
19
|
};
|
|
20
|
+
parts: string[];
|
|
16
21
|
sizes: {
|
|
17
|
-
xs: {
|
|
18
|
-
fontSize: string;
|
|
19
|
-
};
|
|
20
22
|
sm: {
|
|
21
|
-
|
|
23
|
+
container: {
|
|
24
|
+
fontSize: string;
|
|
25
|
+
};
|
|
26
|
+
icon: {
|
|
27
|
+
size: string;
|
|
28
|
+
};
|
|
22
29
|
};
|
|
23
30
|
md: {
|
|
24
|
-
|
|
31
|
+
container: {
|
|
32
|
+
fontSize: string;
|
|
33
|
+
};
|
|
34
|
+
icon: {
|
|
35
|
+
size: string;
|
|
36
|
+
};
|
|
25
37
|
};
|
|
26
38
|
lg: {
|
|
27
|
-
|
|
39
|
+
container: {
|
|
40
|
+
fontSize: string;
|
|
41
|
+
};
|
|
42
|
+
icon: {
|
|
43
|
+
size: string;
|
|
44
|
+
};
|
|
28
45
|
};
|
|
29
46
|
};
|
|
30
47
|
variants: {
|
package/link/theme.js
CHANGED
|
@@ -2,41 +2,54 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
function variantDefault(props) {
|
|
4
4
|
var c = props.colorScheme;
|
|
5
|
-
var
|
|
5
|
+
var container = {
|
|
6
6
|
color: c + ".80",
|
|
7
7
|
hoverColor: c + ".60"
|
|
8
8
|
};
|
|
9
9
|
if (c === 'white') {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
container.color = 'white';
|
|
11
|
+
container.hoverColor = 'white';
|
|
12
12
|
}
|
|
13
|
-
return
|
|
13
|
+
return { container: container };
|
|
14
14
|
}
|
|
15
15
|
function variantLight(props) {
|
|
16
16
|
var c = props.colorScheme;
|
|
17
|
-
var
|
|
17
|
+
var container = {
|
|
18
18
|
color: c + ".60",
|
|
19
19
|
hoverColor: c + ".40"
|
|
20
20
|
};
|
|
21
|
-
return
|
|
21
|
+
return { container: container };
|
|
22
22
|
}
|
|
23
23
|
var defaultProps = {
|
|
24
24
|
colorScheme: 'blue',
|
|
25
25
|
size: 'md',
|
|
26
26
|
variant: 'default'
|
|
27
27
|
};
|
|
28
|
+
var parts = ['container', 'icon', 'text'];
|
|
28
29
|
var sizes = {
|
|
29
|
-
xs: {
|
|
30
|
-
fontSize: 'xs'
|
|
31
|
-
},
|
|
32
30
|
sm: {
|
|
33
|
-
|
|
31
|
+
container: {
|
|
32
|
+
fontSize: 'sm'
|
|
33
|
+
},
|
|
34
|
+
icon: {
|
|
35
|
+
size: 'xs'
|
|
36
|
+
}
|
|
34
37
|
},
|
|
35
38
|
md: {
|
|
36
|
-
|
|
39
|
+
container: {
|
|
40
|
+
fontSize: 'md'
|
|
41
|
+
},
|
|
42
|
+
icon: {
|
|
43
|
+
size: 'xs'
|
|
44
|
+
}
|
|
37
45
|
},
|
|
38
46
|
lg: {
|
|
39
|
-
|
|
47
|
+
container: {
|
|
48
|
+
fontSize: 'lg'
|
|
49
|
+
},
|
|
50
|
+
icon: {
|
|
51
|
+
size: 'sm'
|
|
52
|
+
}
|
|
40
53
|
}
|
|
41
54
|
};
|
|
42
55
|
var variants = {
|
|
@@ -45,6 +58,7 @@ var variants = {
|
|
|
45
58
|
};
|
|
46
59
|
exports.default = {
|
|
47
60
|
defaultProps: defaultProps,
|
|
61
|
+
parts: parts,
|
|
48
62
|
sizes: sizes,
|
|
49
63
|
variants: variants
|
|
50
64
|
};
|
package/list/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.useList = exports.ListProvider = void 0;
|
|
20
20
|
var core_1 = require("../core");
|
|
21
|
-
var _a = __read(core_1.createContext({ isOptional: true }), 2), ListProvider = _a[0], useList = _a[1];
|
|
21
|
+
var _a = __read((0, core_1.createContext)({ isOptional: true }), 2), ListProvider = _a[0], useList = _a[1];
|
|
22
22
|
exports.ListProvider = ListProvider;
|
|
23
23
|
exports.useList = useList;
|