@veracity/vui 0.0.15 → 0.2.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/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/{alert/alertText.js → button/buttonIcon.js} +9 -9
- 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/{alert → buttonGroup}/index.js +4 -8
- 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 +4 -4
- 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 +7 -7
- 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 +1 -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 +5 -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 +6 -3
- package/index.js +6 -3
- package/input/context.d.ts +4 -0
- package/{alert → input}/context.js +4 -4
- package/input/index.d.ts +2 -0
- package/input/index.js +2 -0
- package/input/input.d.ts +7 -2
- package/input/input.js +33 -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/notification/consts.d.ts +2 -0
- package/{alert → notification}/consts.js +7 -7
- package/notification/context.d.ts +4 -0
- package/notification/context.js +23 -0
- package/notification/index.d.ts +8 -0
- package/notification/index.js +25 -0
- package/notification/notification.d.ts +13 -0
- package/{alert/alert.js → notification/notification.js} +25 -25
- package/notification/notification.types.d.ts +20 -0
- package/notification/notificationButton.d.ts +3 -0
- package/{alert/alertButton.js → notification/notificationButton.js} +8 -8
- package/notification/notificationIcon.d.ts +3 -0
- package/{alert/alertIcon.js → notification/notificationIcon.js} +9 -9
- package/notification/notificationText.d.ts +3 -0
- package/notification/notificationText.js +30 -0
- package/notification/notificationTitle.d.ts +3 -0
- package/notification/notificationTitle.js +30 -0
- package/{alert → notification}/theme.d.ts +0 -15
- package/{alert → notification}/theme.js +1 -22
- package/package.json +2 -3
- 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 +4 -4
- package/radio/radio.types.d.ts +1 -1
- package/radio/radioGroup.types.d.ts +1 -1
- package/skeleton/skeleton.types.d.ts +1 -0
- package/spinner/spinner.types.d.ts +1 -0
- package/svg/cache.js +1 -5
- package/svg/svg.js +2 -3
- 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 +18 -19
- 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/{alert/alertTitle.js → tag/tagIcon.js} +9 -9
- 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/textarea/textarea.js +2 -1
- package/textarea/textarea.types.d.ts +1 -0
- package/theme/components.d.ts +291 -223
- package/theme/components.js +32 -28
- package/theme/defaultTheme.d.ts +291 -223
- 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 +5 -18
- package/utils/object.js +17 -50
- package/utils/types.d.ts +2 -0
- package/alert/alert.d.ts +0 -13
- package/alert/alert.types.d.ts +0 -20
- package/alert/alertButton.d.ts +0 -3
- package/alert/alertIcon.d.ts +0 -3
- package/alert/alertText.d.ts +0 -3
- package/alert/alertTitle.d.ts +0 -3
- package/alert/consts.d.ts +0 -2
- package/alert/context.d.ts +0 -4
- package/alert/index.d.ts +0 -8
- package/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/{alert/alert.types.js → card/card.types.js} +0 -0
- /package/{label/label.types.js → core/types/styled.js} +0 -0
- /package/{list/listItem.types.js → image/image.types.js} +0 -0
- /package/{switch/switchButton.types.js → notification/notification.types.js} +0 -0
- /package/{tile/tile.types.js → panel/panel.types.js} +0 -0
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
import { Dict } from '../utils';
|
|
2
|
-
declare function variantSolid(props: Dict): {
|
|
3
|
-
container: {
|
|
4
|
-
bg: string;
|
|
5
|
-
color: string;
|
|
6
|
-
};
|
|
7
|
-
button: {
|
|
8
|
-
bg: string;
|
|
9
|
-
hoverBg: string;
|
|
10
|
-
};
|
|
11
|
-
icon: {};
|
|
12
|
-
message: {};
|
|
13
|
-
text: {};
|
|
14
|
-
title: {};
|
|
15
|
-
};
|
|
16
2
|
declare function variantSubtle(props: Dict): {
|
|
17
3
|
container: {
|
|
18
4
|
bg: string;
|
|
@@ -39,7 +25,6 @@ declare const _default: {
|
|
|
39
25
|
parts: string[];
|
|
40
26
|
sizes: {};
|
|
41
27
|
variants: {
|
|
42
|
-
solid: typeof variantSolid;
|
|
43
28
|
subtle: typeof variantSubtle;
|
|
44
29
|
};
|
|
45
30
|
};
|
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function variantSolid(props) {
|
|
4
|
-
var c = props.colorScheme;
|
|
5
|
-
var container = {
|
|
6
|
-
bg: c + ".70",
|
|
7
|
-
color: 'white'
|
|
8
|
-
};
|
|
9
|
-
var button = {
|
|
10
|
-
bg: c + ".70",
|
|
11
|
-
hoverBg: c + ".80"
|
|
12
|
-
};
|
|
13
|
-
var icon = {};
|
|
14
|
-
var message = {};
|
|
15
|
-
var text = {};
|
|
16
|
-
var title = {};
|
|
17
|
-
return { container: container, button: button, icon: icon, message: message, text: text, title: title };
|
|
18
|
-
}
|
|
19
3
|
function variantSubtle(props) {
|
|
20
4
|
var c = props.colorScheme;
|
|
21
5
|
var container = {
|
|
@@ -34,13 +18,9 @@ function variantSubtle(props) {
|
|
|
34
18
|
var message = {};
|
|
35
19
|
var text = {};
|
|
36
20
|
var title = {};
|
|
37
|
-
if (c === 'grey') {
|
|
38
|
-
button.color = 'prussian.80';
|
|
39
|
-
container.color = 'prussian.80';
|
|
40
|
-
}
|
|
41
21
|
if (c === 'yellow') {
|
|
42
|
-
button.color = 'yellow.100';
|
|
43
22
|
container.color = 'yellow.100';
|
|
23
|
+
button.color = 'yellow.100';
|
|
44
24
|
}
|
|
45
25
|
return { container: container, button: button, icon: icon, message: message, text: text, title: title };
|
|
46
26
|
}
|
|
@@ -51,7 +31,6 @@ var defaultProps = {
|
|
|
51
31
|
var parts = ['container', 'button', 'icon', 'message', 'text', 'title'];
|
|
52
32
|
var sizes = {};
|
|
53
33
|
var variants = {
|
|
54
|
-
solid: variantSolid,
|
|
55
34
|
subtle: variantSubtle
|
|
56
35
|
};
|
|
57
36
|
exports.default = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Veracity UI React components library based on Styled Components and @xstyled",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Veracity",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@xstyled/styled-components": "^2.4.1",
|
|
20
|
-
"
|
|
21
|
-
"styled-components": "^5.2.1"
|
|
20
|
+
"styled-components": "^5.3.1"
|
|
22
21
|
},
|
|
23
22
|
"peerDependencies": {
|
|
24
23
|
"react": "^17.0.1",
|
package/panel/index.d.ts
ADDED
package/panel/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
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("./panel"), exports);
|
|
18
|
+
__exportStar(require("./panel.types"), exports);
|
|
19
|
+
var panel_1 = require("./panel");
|
|
20
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(panel_1).default; } });
|
package/panel/panel.d.ts
ADDED
package/panel/panel.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
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.Panel = void 0;
|
|
29
|
+
var react_1 = __importDefault(require("react"));
|
|
30
|
+
var box_1 = __importDefault(require("../box"));
|
|
31
|
+
var core_1 = require("../core");
|
|
32
|
+
var utils_1 = require("../utils");
|
|
33
|
+
exports.Panel = core_1.vui(function (props, ref) {
|
|
34
|
+
var _a = core_1.omitThemingProps(props), className = _a.className, rest = __rest(_a, ["className"]);
|
|
35
|
+
var styles = core_1.useStyleConfig('Panel', props);
|
|
36
|
+
return (react_1.default.createElement(box_1.default, __assign({ bg: "white", borderRadius: "md", className: utils_1.cs('vui-panel', className), p: 2, ref: ref }, styles, rest)));
|
|
37
|
+
});
|
|
38
|
+
exports.Panel.displayName = 'Panel';
|
|
39
|
+
exports.default = exports.Panel;
|
|
@@ -4,19 +4,12 @@ declare const _default: {
|
|
|
4
4
|
};
|
|
5
5
|
sizes: {};
|
|
6
6
|
variants: {
|
|
7
|
-
|
|
8
|
-
bg: string;
|
|
9
|
-
borderRadius: string;
|
|
7
|
+
elevated: {
|
|
10
8
|
shadow: string;
|
|
11
|
-
hoverShadow: string;
|
|
12
|
-
p: number;
|
|
13
9
|
};
|
|
14
10
|
outlined: {
|
|
15
|
-
bg: string;
|
|
16
11
|
border: number;
|
|
17
12
|
borderColor: string;
|
|
18
|
-
borderRadius: string;
|
|
19
|
-
p: number;
|
|
20
13
|
};
|
|
21
14
|
};
|
|
22
15
|
};
|
package/{tile → panel}/theme.js
RENAMED
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
var defaultProps = {
|
|
4
|
-
variant: '
|
|
4
|
+
variant: 'elevated'
|
|
5
5
|
};
|
|
6
6
|
var sizes = {};
|
|
7
7
|
var variants = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
borderRadius: 'md',
|
|
11
|
-
shadow: '1',
|
|
12
|
-
hoverShadow: '3',
|
|
13
|
-
p: 2
|
|
8
|
+
elevated: {
|
|
9
|
+
shadow: '1'
|
|
14
10
|
},
|
|
15
11
|
outlined: {
|
|
16
|
-
bg: 'white',
|
|
17
12
|
border: 1,
|
|
18
|
-
borderColor: 'grey.40'
|
|
19
|
-
borderRadius: 'md',
|
|
20
|
-
p: 2
|
|
13
|
+
borderColor: 'grey.40'
|
|
21
14
|
}
|
|
22
15
|
};
|
|
23
16
|
exports.default = {
|
package/radio/radio.js
CHANGED
|
@@ -45,12 +45,12 @@ exports.Radio = core_1.vui(function (props, ref) {
|
|
|
45
45
|
var _a;
|
|
46
46
|
var _b = (_a = context_1.useRadioGroup()) !== null && _a !== void 0 ? _a : {}, groupOnChange = _b.onChange, groupValue = _b.value, radioGroupProps = __rest(_b, ["onChange", "value"]);
|
|
47
47
|
var mergedProps = __assign(__assign({}, radioGroupProps), props);
|
|
48
|
-
var _c = core_1.omitThemingProps(mergedProps), _d = _c.checked, checked = _d === void 0 ? groupValue !== undefined ? props.value === groupValue : undefined : _d, children = _c.children, className = _c.className, defaultChecked = _c.defaultChecked, disabled = _c.disabled, _e = _c.icon, iconProp = _e === void 0 ? 'cuiRadioUnselected' : _e, _f = _c.iconChecked, iconChecked = _f === void 0 ? 'cuiRadioSelected' : _f, inputProps = _c.inputProps, inputRef = _c.inputRef, label = _c.label, name = _c.name, onChange = _c.onChange, required = _c.required, value = _c.value, rest = __rest(_c, ["checked", "children", "className", "defaultChecked", "disabled", "icon", "iconChecked", "inputProps", "inputRef", "label", "name", "onChange", "required", "value"]);
|
|
48
|
+
var _c = core_1.omitThemingProps(mergedProps), _d = _c.checked, checked = _d === void 0 ? groupValue !== undefined ? props.value === groupValue : undefined : _d, children = _c.children, className = _c.className, defaultChecked = _c.defaultChecked, disabled = _c.disabled, _e = _c.icon, iconProp = _e === void 0 ? 'cuiRadioUnselected' : _e, _f = _c.iconChecked, iconChecked = _f === void 0 ? 'cuiRadioSelected' : _f, id = _c.id, inputProps = _c.inputProps, inputRef = _c.inputRef, label = _c.label, name = _c.name, onChange = _c.onChange, required = _c.required, value = _c.value, rest = __rest(_c, ["checked", "children", "className", "defaultChecked", "disabled", "icon", "iconChecked", "id", "inputProps", "inputRef", "label", "name", "onChange", "required", "value"]);
|
|
49
49
|
var styles = core_1.useStyleConfig('Radio', mergedProps);
|
|
50
50
|
var _g = styles.control, controlColor = _g.color, hoverColor = _g.hoverColor, controlStyles = __rest(_g, ["color", "hoverColor"]);
|
|
51
51
|
var icon = checked ? iconChecked : iconProp;
|
|
52
52
|
var controlMr = children || label ? 1 : 0;
|
|
53
|
-
var color = checked ? controlColor : 'grey.
|
|
53
|
+
var color = checked ? controlColor : 'grey.60';
|
|
54
54
|
var controlHoverColor = checked ? hoverColor : 'grey.90';
|
|
55
55
|
function handleOnChange(e) {
|
|
56
56
|
groupOnChange === null || groupOnChange === void 0 ? void 0 : groupOnChange(e);
|
|
@@ -58,8 +58,8 @@ exports.Radio = core_1.vui(function (props, ref) {
|
|
|
58
58
|
}
|
|
59
59
|
return (react_1.default.createElement(exports.RadioBase, __assign({ className: utils_1.cs('vui-radio', disabled && 'disabled', className), controlHoverColor: controlHoverColor, ref: ref }, styles.container, rest),
|
|
60
60
|
react_1.default.createElement(exports.RadioControl, __assign({ borderRadius: "50%", className: "vui-radioControl", color: color, focusWithinRing: 3, mr: controlMr, transitionDuration: "fast" }, controlStyles),
|
|
61
|
-
react_1.default.createElement(exports.RadioInput, __assign({ className: "vui-radioInput", onChange: handleOnChange, ref: inputRef, type: "radio" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, name: name, required: required, value: value }, inputProps)),
|
|
62
|
-
react_1.default.createElement(icon_1.default, { className: "vui-radioIcon", h: "100%",
|
|
61
|
+
react_1.default.createElement(exports.RadioInput, __assign({ className: "vui-radioInput", onChange: handleOnChange, ref: inputRef, type: "radio" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, id: id, name: name, required: required, value: value }, inputProps)),
|
|
62
|
+
react_1.default.createElement(icon_1.default, { className: "vui-radioIcon", h: "100%", name: icon, w: "100%" })), children !== null && children !== void 0 ? children : (label && (react_1.default.createElement(t_1.default, __assign({ className: "vui-radioLabel", lineHeight: "normal" }, styles.label), label)))));
|
|
63
63
|
});
|
|
64
64
|
exports.Radio.displayName = 'Radio';
|
|
65
65
|
exports.default = exports.Radio;
|
package/radio/radio.types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { SystemProps } from '../system';
|
|
|
5
5
|
import { ThemingProps } from '../theme';
|
|
6
6
|
export interface RadioProps extends SystemProps, ThemingProps<'Radio'> {
|
|
7
7
|
checked?: boolean;
|
|
8
|
-
colorScheme?: 'blue' | '
|
|
8
|
+
colorScheme?: 'blue' | 'prussian';
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
icon?: IconProp;
|
|
11
11
|
iconChecked?: IconProp;
|
|
@@ -2,7 +2,7 @@ import { ChangeEventHandler, FocusEventHandler } from '../core';
|
|
|
2
2
|
import { SystemProps } from '../system';
|
|
3
3
|
import { ThemingProps } from '../theme';
|
|
4
4
|
export interface RadioGroupProps extends SystemProps, ThemingProps<'Radio'> {
|
|
5
|
-
colorScheme?: 'blue' | '
|
|
5
|
+
colorScheme?: 'blue' | 'prussian';
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
name?: string;
|
|
8
8
|
onBlur?: FocusEventHandler;
|
|
@@ -5,6 +5,7 @@ export interface SpinnerCircleStyleProps extends SystemProps {
|
|
|
5
5
|
speed?: string;
|
|
6
6
|
}
|
|
7
7
|
export interface SpinnerProps extends Omit<BoxProps, 'size' | 'variant'>, Omit<ThemingProps<'Spinner'>, 'size'> {
|
|
8
|
+
children?: never;
|
|
8
9
|
colorScheme?: 'blue' | 'grey' | 'prussian';
|
|
9
10
|
emptyColor?: string;
|
|
10
11
|
speed?: string;
|
package/svg/cache.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var axios_1 = __importDefault(require("axios"));
|
|
7
3
|
/**
|
|
8
4
|
* Provides svg caching functionality to avoid redundant XHR requests.
|
|
9
5
|
* When the retrieved item doesn't exist in cache yet, a request is sent
|
|
@@ -20,7 +16,7 @@ var Cache = /** @class */ (function () {
|
|
|
20
16
|
this.get = function (src) {
|
|
21
17
|
var item = _this.cache.get(src);
|
|
22
18
|
if (!item) {
|
|
23
|
-
var promise =
|
|
19
|
+
var promise = fetch(src).then(function (res) { return res.text(); });
|
|
24
20
|
_this.add(src, promise);
|
|
25
21
|
return promise;
|
|
26
22
|
}
|
package/svg/svg.js
CHANGED
|
@@ -114,6 +114,8 @@ exports.Svg = core_1.vui(function (props, ref) {
|
|
|
114
114
|
var _a = __read(react_1.useState(helpers_1.initState()), 2), state = _a[0], setState = _a[1];
|
|
115
115
|
var isMountedRef = react_1.useRef(false);
|
|
116
116
|
var srcRef = react_1.useRef(src);
|
|
117
|
+
var _b = state.content, content = _b === void 0 ? '' : _b, _c = state.svgAttributes, svgAttributes = _c === void 0 ? {} : _c;
|
|
118
|
+
var innerHTML = !children ? { __html: content } : undefined;
|
|
117
119
|
react_1.useEffect(function () {
|
|
118
120
|
isMountedRef.current = true;
|
|
119
121
|
return function () {
|
|
@@ -155,9 +157,6 @@ exports.Svg = core_1.vui(function (props, ref) {
|
|
|
155
157
|
}
|
|
156
158
|
src && loadSvg(src);
|
|
157
159
|
}, [src]);
|
|
158
|
-
var _b = state.content, content = _b === void 0 ? '' : _b, _c = state.svgAttributes, svgAttributes = _c === void 0 ? {} : _c;
|
|
159
|
-
var innerHTML = !children ? { __html: content } : undefined;
|
|
160
|
-
// const pathFill = Array.isArray(fill) ? fill : [fill]
|
|
161
160
|
return (react_1.default.createElement(exports.SvgBase, __assign({ className: utils_1.cs('vui-svg', className), dangerouslySetInnerHTML: innerHTML, ref: ref, xmlns: "http://www.w3.org/2000/svg" }, svgAttributes, rest), children));
|
|
162
161
|
});
|
|
163
162
|
exports.Svg.displayName = 'Svg';
|
package/switch/index.d.ts
CHANGED
package/switch/index.js
CHANGED
|
@@ -18,7 +18,6 @@ __exportStar(require("./context"), exports);
|
|
|
18
18
|
__exportStar(require("./switch"), exports);
|
|
19
19
|
__exportStar(require("./switch.types"), exports);
|
|
20
20
|
__exportStar(require("./switchButton"), exports);
|
|
21
|
-
__exportStar(require("./switchButton.types"), exports);
|
|
22
21
|
__exportStar(require("./switchLabel"), exports);
|
|
23
22
|
var switch_1 = require("./switch");
|
|
24
23
|
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(switch_1).default; } });
|
package/switch/switch.js
CHANGED
|
@@ -76,8 +76,9 @@ var t_1 = require("../t");
|
|
|
76
76
|
var utils_1 = require("../utils");
|
|
77
77
|
exports.SwitchBase = styled_components_1.default.label.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tline-height: normal;\n\twidth: fit-content;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tcolor: var(--vui-colors-disabled-font);\n\t\t}\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tline-height: normal;\n\twidth: fit-content;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tcolor: var(--vui-colors-disabled-font);\n\t\t}\n\t}\n\n\t", "\n"])), t_1.TBase, system_1.system);
|
|
78
78
|
exports.Switch = core_1.vui(function (props, ref) {
|
|
79
|
-
var
|
|
80
|
-
var
|
|
79
|
+
var _a;
|
|
80
|
+
var button = props.button, checked = props.checked, children = props.children, className = props.className, colorScheme = props.colorScheme, defaultChecked = props.defaultChecked, disabled = props.disabled, id = props.id, innerLabelOff = props.innerLabelOff, innerLabelOn = props.innerLabelOn, inputRef = props.inputRef, labelLeft = props.labelLeft, labelRight = props.labelRight, name = props.name, onBlur = props.onBlur, onChange = props.onChange, onFocus = props.onFocus, required = props.required, size = props.size, value = props.value, variant = props.variant, rest = __rest(props, ["button", "checked", "children", "className", "colorScheme", "defaultChecked", "disabled", "id", "innerLabelOff", "innerLabelOn", "inputRef", "labelLeft", "labelRight", "name", "onBlur", "onChange", "onFocus", "required", "size", "value", "variant"]);
|
|
81
|
+
var _b = __read(react_1.useState(defaultChecked), 2), isChecked = _b[0], setIsChecked = _b[1];
|
|
81
82
|
var styles = core_1.useStyleConfig('Switch', props);
|
|
82
83
|
react_1.useEffect(function () {
|
|
83
84
|
checked !== undefined && setIsChecked(checked);
|
|
@@ -120,10 +121,9 @@ exports.Switch = core_1.vui(function (props, ref) {
|
|
|
120
121
|
'data-disabled': disabled ? true : false
|
|
121
122
|
});
|
|
122
123
|
return (react_1.default.createElement(context_1.SwitchProvider, { value: context },
|
|
123
|
-
react_1.default.createElement(exports.SwitchBase, __assign({ className: utils_1.cs('vui-switch', className), ref: ref }, styles.container, aliasedProps, rest),
|
|
124
|
-
labelLeft
|
|
125
|
-
react_1.default.createElement(
|
|
126
|
-
labelRight && react_1.default.createElement(switchLabel_1.SwitchLabel, { ml: 1 }, labelRight))))));
|
|
124
|
+
react_1.default.createElement(exports.SwitchBase, __assign({ className: utils_1.cs('vui-switch', className), ref: ref }, styles.container, aliasedProps, rest),
|
|
125
|
+
utils_1.isReactText(labelLeft) ? react_1.default.createElement(switchLabel_1.SwitchLabel, { mr: 1, text: labelLeft }) : labelLeft, (_a = children !== null && children !== void 0 ? children : button) !== null && _a !== void 0 ? _a : react_1.default.createElement(switchButton_1.SwitchButton, __assign({}, { id: id, innerLabelOff: innerLabelOff, innerLabelOn: innerLabelOn, inputRef: inputRef })),
|
|
126
|
+
utils_1.isReactText(labelRight) ? react_1.default.createElement(switchLabel_1.SwitchLabel, { ml: 1, text: labelRight }) : labelRight)));
|
|
127
127
|
});
|
|
128
128
|
exports.Switch.displayName = 'Switch';
|
|
129
129
|
exports.Switch.Button = switchButton_1.SwitchButton;
|
package/switch/switch.types.d.ts
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChangeEventHandler, FocusEventHandler } from '../core';
|
|
1
|
+
import { ReactNode, ReactText } from 'react';
|
|
2
|
+
import { ChangeEventHandler, FocusEventHandler, PropsOf } from '../core';
|
|
3
3
|
import { SystemProps } from '../system';
|
|
4
4
|
import { ThemingProps } from '../theme';
|
|
5
|
+
export interface SwitchButtonProps extends SystemProps, ThemingProps<'Switch'> {
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
colorScheme?: 'blue' | 'green' | 'prussian' | 'red';
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
innerLabelOff?: ReactNode;
|
|
10
|
+
innerLabelOn?: ReactNode;
|
|
11
|
+
inputProps?: PropsOf<'input', SystemProps>;
|
|
12
|
+
inputRef?: React.MutableRefObject<HTMLInputElement | null> | null;
|
|
13
|
+
name?: string;
|
|
14
|
+
onBlur?: FocusEventHandler;
|
|
15
|
+
onChange?: ChangeEventHandler;
|
|
16
|
+
onFocus?: FocusEventHandler;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
value?: number | string;
|
|
19
|
+
}
|
|
5
20
|
export interface SwitchProps extends SystemProps, ThemingProps<'Switch'> {
|
|
21
|
+
button?: ReactNode;
|
|
6
22
|
checked?: boolean;
|
|
7
23
|
colorScheme?: 'blue' | 'green' | 'prussian' | 'red';
|
|
8
24
|
disabled?: boolean;
|
|
9
25
|
innerLabelOff?: ReactNode;
|
|
10
26
|
innerLabelOn?: ReactNode;
|
|
11
|
-
inputProps?: HTMLAttributes<HTMLInputElement>;
|
|
12
27
|
inputRef?: React.MutableRefObject<HTMLInputElement | null> | null;
|
|
13
28
|
labelLeft?: ReactNode;
|
|
14
29
|
labelRight?: ReactNode;
|
|
@@ -17,5 +32,5 @@ export interface SwitchProps extends SystemProps, ThemingProps<'Switch'> {
|
|
|
17
32
|
onChange?: ChangeEventHandler;
|
|
18
33
|
onFocus?: FocusEventHandler;
|
|
19
34
|
required?: boolean;
|
|
20
|
-
value?:
|
|
35
|
+
value?: ReactText;
|
|
21
36
|
}
|
package/switch/switchButton.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SwitchButtonProps } from './
|
|
1
|
+
import { SwitchButtonProps } from './switch.types';
|
|
2
2
|
import { SystemProps } from '../system';
|
|
3
|
-
export declare const SwitchInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme,
|
|
3
|
+
export declare const SwitchInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
4
4
|
export declare const SwitchThumb: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
5
5
|
export declare const SwitchTrack: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
|
|
6
6
|
export declare const SwitchButtonBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, SystemProps, never>;
|
package/switch/switchButton.js
CHANGED
|
@@ -71,18 +71,19 @@ var context_1 = require("./context");
|
|
|
71
71
|
var core_1 = require("../core");
|
|
72
72
|
var system_1 = require("../system");
|
|
73
73
|
var utils_1 = require("../utils");
|
|
74
|
-
exports.SwitchInput = styled_components_1.default.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tcursor: inherit;\n\theight: calc(100% + 10px);\n\tleft: -5px;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: -5px;\n\twidth: calc(100% + 10px);\n\tz-index: 1;\n"], ["\n\tcursor: inherit;\n\theight: calc(100% + 10px);\n\tleft: -5px;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: -5px;\n\twidth: calc(100% + 10px);\n\tz-index: 1;\n"])));
|
|
74
|
+
exports.SwitchInput = styled_components_1.default.input.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tcursor: inherit;\n\theight: calc(100% + 10px);\n\tleft: -5px;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: -5px;\n\twidth: calc(100% + 10px);\n\tz-index: 1;\n\n\t", "\n"], ["\n\tcursor: inherit;\n\theight: calc(100% + 10px);\n\tleft: -5px;\n\tmargin: 0;\n\topacity: 0;\n\tpadding: 0;\n\tposition: absolute;\n\ttop: -5px;\n\twidth: calc(100% + 10px);\n\tz-index: 1;\n\n\t", "\n"])), system_1.system);
|
|
75
75
|
exports.SwitchThumb = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: absolute;\n\n\t", "\n"], ["\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: absolute;\n\n\t", "\n"])), system_1.system);
|
|
76
|
-
exports.SwitchTrack = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tposition: relative;\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tposition: relative;\n\n\t", "\n"])), system_1.system);
|
|
77
|
-
exports.SwitchButtonBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n\tcolor: white;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tborder-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-font);\n\t\t}\n\n\t\t", " {\n\t\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\t}\n\t}\n\n\t", "\n"], ["\n\tcolor: white;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tborder-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-font);\n\t\t}\n\n\t\t", " {\n\t\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\t}\n\t}\n\n\t", "\n"])), exports.SwitchThumb, exports.SwitchTrack, system_1.system);
|
|
76
|
+
exports.SwitchTrack = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex: 1;\n\tposition: relative;\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex: 1;\n\tposition: relative;\n\n\t", "\n"])), system_1.system);
|
|
77
|
+
exports.SwitchButtonBase = styled_components_1.default.span.withConfig(core_1.forwardPropConfig(system_1.system))(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n\tcolor: white;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tborder-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-font);\n\t\t}\n\n\t\t", " {\n\t\t\t--x-ring-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\t}\n\t}\n\n\t", "\n"], ["\n\tcolor: white;\n\tcursor: pointer;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tposition: relative;\n\n\t&[data-disabled='true'] {\n\t\tcursor: not-allowed;\n\n\t\t", " {\n\t\t\tborder-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-font);\n\t\t}\n\n\t\t", " {\n\t\t\t--x-ring-color: var(--vui-colors-disabled-border);\n\t\t\tbackground-color: var(--vui-colors-disabled-bg);\n\t\t}\n\t}\n\n\t", "\n"])), exports.SwitchThumb, exports.SwitchTrack, system_1.system);
|
|
78
78
|
exports.SwitchButton = core_1.vui(function (props, ref) {
|
|
79
79
|
var _a;
|
|
80
80
|
var _b = (_a = context_1.useSwitch()) !== null && _a !== void 0 ? _a : {}, switchIsChecked = _b.isChecked, switchProps = __rest(_b, ["isChecked"]);
|
|
81
81
|
var mergedProps = __assign(__assign({}, switchProps), props);
|
|
82
|
-
var _c = core_1.omitThemingProps(mergedProps), checked = _c.checked, className = _c.className, defaultChecked = _c.defaultChecked, disabled = _c.disabled, innerLabelOff = _c.innerLabelOff, innerLabelOn = _c.innerLabelOn, inputProps = _c.inputProps, inputRef = _c.inputRef, name = _c.name, onBlur = _c.onBlur, onChange = _c.onChange, onFocus = _c.onFocus, required = _c.required, value = _c.value, rest = __rest(_c, ["checked", "className", "defaultChecked", "disabled", "innerLabelOff", "innerLabelOn", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "required", "value"]);
|
|
82
|
+
var _c = core_1.omitThemingProps(mergedProps), checked = _c.checked, className = _c.className, defaultChecked = _c.defaultChecked, disabled = _c.disabled, id = _c.id, innerLabelOff = _c.innerLabelOff, innerLabelOn = _c.innerLabelOn, inputProps = _c.inputProps, inputRef = _c.inputRef, name = _c.name, onBlur = _c.onBlur, onChange = _c.onChange, onFocus = _c.onFocus, required = _c.required, value = _c.value, rest = __rest(_c, ["checked", "className", "defaultChecked", "disabled", "id", "innerLabelOff", "innerLabelOn", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "required", "value"]);
|
|
83
83
|
var _d = __read(react_1.useState(defaultChecked), 2), isChecked = _d[0], setIsChecked = _d[1];
|
|
84
84
|
var _e = __read(react_1.useState(false), 2), isFocused = _e[0], setIsFocused = _e[1];
|
|
85
85
|
var styles = core_1.useStyleConfig('Switch', mergedProps);
|
|
86
|
+
var _f = styles.button, thumbStyles = _f.thumb, trackStyles = _f.track, buttonStyles = __rest(_f, ["thumb", "track"]);
|
|
86
87
|
var isControlled = checked !== undefined || switchIsChecked !== undefined;
|
|
87
88
|
react_1.useEffect(function () {
|
|
88
89
|
if (isControlled) {
|
|
@@ -101,31 +102,29 @@ exports.SwitchButton = core_1.vui(function (props, ref) {
|
|
|
101
102
|
setIsFocused(true);
|
|
102
103
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
103
104
|
}
|
|
104
|
-
var hDiff = (
|
|
105
|
-
var thumbOffset = "calc(100% - " + Math.abs(hDiff -
|
|
106
|
-
var labelOffset =
|
|
107
|
-
var
|
|
105
|
+
var hDiff = (thumbStyles.h - trackStyles.h) / 2;
|
|
106
|
+
var thumbOffset = "calc(100% - " + Math.abs(hDiff - thumbStyles.h) + "px)";
|
|
107
|
+
var labelOffset = thumbStyles.h - hDiff + 4 + "px";
|
|
108
|
+
var buttonAliasedProps = utils_1.filterUndefined({
|
|
108
109
|
'data-checked': isChecked ? true : false,
|
|
109
110
|
'data-disabled': disabled ? true : false,
|
|
110
111
|
'data-focused': isFocused ? true : false
|
|
111
112
|
});
|
|
112
|
-
var
|
|
113
|
+
var thumbAliasedProps = utils_1.filterUndefined({
|
|
113
114
|
left: isChecked ? thumbOffset : -hDiff,
|
|
114
|
-
ring: isFocused ?
|
|
115
|
+
ring: isFocused ? thumbStyles.ring : 0
|
|
115
116
|
});
|
|
116
|
-
var
|
|
117
|
-
bg: isChecked ?
|
|
117
|
+
var trackAliasedProps = utils_1.filterUndefined({
|
|
118
|
+
bg: isChecked ? trackStyles.bg : 'grey.50',
|
|
118
119
|
pl: isChecked ? 1 : labelOffset,
|
|
119
120
|
pr: isChecked ? labelOffset : 1,
|
|
120
|
-
ring: isFocused ?
|
|
121
|
+
ring: isFocused ? trackStyles.ring : disabled ? 1 : 0
|
|
121
122
|
});
|
|
122
|
-
return (react_1.default.createElement(exports.SwitchButtonBase, __assign({ className: utils_1.cs('vui-switchButton', className),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
react_1.default.createElement(exports.SwitchInput, __assign({ className: "vui-switchInput", onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, ref: inputRef, type: "checkbox" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, name: name, required: required, value: value }, inputProps)),
|
|
126
|
-
react_1.default.createElement(exports.SwitchTrack, __assign({ borderRadius: 100, className: "vui-switchTrack", transitionDuration: "fast" }, styles.track, trackProps),
|
|
123
|
+
return (react_1.default.createElement(exports.SwitchButtonBase, __assign({ className: utils_1.cs('vui-switchButton', className), ref: ref }, buttonStyles, buttonAliasedProps, rest),
|
|
124
|
+
react_1.default.createElement(exports.SwitchInput, __assign({ className: "vui-switchInput", onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, ref: inputRef, type: "checkbox" }, { checked: checked, defaultChecked: defaultChecked, disabled: disabled, id: id, name: name, required: required, value: value }, inputProps)),
|
|
125
|
+
react_1.default.createElement(exports.SwitchTrack, __assign({ borderRadius: "round", className: "vui-switchTrack", transitionDuration: "fast" }, trackStyles, trackAliasedProps),
|
|
127
126
|
!isChecked && innerLabelOff,
|
|
128
|
-
react_1.default.createElement(exports.SwitchThumb, __assign({ borderRadius: "
|
|
127
|
+
react_1.default.createElement(exports.SwitchThumb, __assign({ borderRadius: "round", className: "vui-switchThumb", transitionDuration: "fast" }, thumbStyles, thumbAliasedProps)),
|
|
129
128
|
isChecked && innerLabelOn)));
|
|
130
129
|
});
|
|
131
130
|
exports.SwitchButton.displayName = 'SwitchButton';
|
package/switch/theme.d.ts
CHANGED
|
@@ -1,71 +1,67 @@
|
|
|
1
1
|
import { Dict } from '../utils';
|
|
2
|
-
declare function sizeLg(
|
|
2
|
+
declare function sizeLg(): {
|
|
3
|
+
container: {};
|
|
3
4
|
button: {
|
|
4
5
|
fontSize: string;
|
|
6
|
+
minW: number;
|
|
7
|
+
thumb: {
|
|
8
|
+
h: number;
|
|
9
|
+
w: number;
|
|
10
|
+
};
|
|
11
|
+
track: {
|
|
12
|
+
h: number;
|
|
13
|
+
};
|
|
5
14
|
};
|
|
6
15
|
label: {
|
|
7
16
|
size: string;
|
|
8
17
|
};
|
|
9
|
-
thumb: {
|
|
10
|
-
h: number;
|
|
11
|
-
w: number;
|
|
12
|
-
};
|
|
13
|
-
track: {
|
|
14
|
-
h: number;
|
|
15
|
-
minW: number;
|
|
16
|
-
};
|
|
17
18
|
};
|
|
18
|
-
declare function sizeMd(
|
|
19
|
+
declare function sizeMd(): {
|
|
20
|
+
container: {};
|
|
19
21
|
button: {
|
|
20
22
|
fontSize: string;
|
|
23
|
+
minW: number;
|
|
24
|
+
thumb: {
|
|
25
|
+
h: number;
|
|
26
|
+
w: number;
|
|
27
|
+
};
|
|
28
|
+
track: {
|
|
29
|
+
h: number;
|
|
30
|
+
};
|
|
21
31
|
};
|
|
22
32
|
label: {
|
|
23
33
|
size: string;
|
|
24
34
|
};
|
|
25
|
-
thumb: {
|
|
26
|
-
h: number;
|
|
27
|
-
w: number;
|
|
28
|
-
};
|
|
29
|
-
track: {
|
|
30
|
-
h: number;
|
|
31
|
-
minW: number;
|
|
32
|
-
};
|
|
33
35
|
};
|
|
34
|
-
declare function sizeSm(
|
|
36
|
+
declare function sizeSm(): {
|
|
37
|
+
container: {};
|
|
35
38
|
button: {
|
|
36
39
|
fontSize: string;
|
|
40
|
+
minW: number;
|
|
41
|
+
thumb: {
|
|
42
|
+
h: number;
|
|
43
|
+
w: number;
|
|
44
|
+
};
|
|
45
|
+
track: {
|
|
46
|
+
h: number;
|
|
47
|
+
};
|
|
37
48
|
};
|
|
38
49
|
label: {
|
|
39
50
|
size: string;
|
|
40
51
|
};
|
|
41
|
-
thumb: {
|
|
42
|
-
h: number;
|
|
43
|
-
w: number;
|
|
44
|
-
};
|
|
45
|
-
track: {
|
|
46
|
-
h: number;
|
|
47
|
-
minW: number;
|
|
48
|
-
};
|
|
49
52
|
};
|
|
50
53
|
declare function variantContained(props: Dict): {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
borderColor: string;
|
|
63
|
-
borderWidth: number;
|
|
64
|
-
ring: number;
|
|
65
|
-
};
|
|
66
|
-
track: {
|
|
67
|
-
bg: string;
|
|
68
|
-
};
|
|
54
|
+
container: {};
|
|
55
|
+
button: {
|
|
56
|
+
thumb: {
|
|
57
|
+
bg: string;
|
|
58
|
+
};
|
|
59
|
+
track: {
|
|
60
|
+
bg: string;
|
|
61
|
+
ring: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
label: {};
|
|
69
65
|
};
|
|
70
66
|
declare const _default: {
|
|
71
67
|
defaultProps: {
|
|
@@ -81,7 +77,6 @@ declare const _default: {
|
|
|
81
77
|
};
|
|
82
78
|
variants: {
|
|
83
79
|
contained: typeof variantContained;
|
|
84
|
-
thin: typeof variantThin;
|
|
85
80
|
};
|
|
86
81
|
};
|
|
87
82
|
export default _default;
|