@veracity/vui 0.0.3 → 0.0.4
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.d.ts +15 -0
- package/alert/alert.js +87 -0
- package/alert/alert.types.d.ts +19 -0
- package/alert/alert.types.js +2 -0
- package/alert/alertButton.d.ts +3 -0
- package/alert/alertButton.js +30 -0
- package/alert/alertIcon.d.ts +3 -0
- package/alert/alertIcon.js +33 -0
- package/alert/alertMessage.d.ts +3 -0
- package/alert/alertMessage.js +31 -0
- package/alert/alertText.d.ts +3 -0
- package/alert/alertText.js +30 -0
- package/alert/alertTitle.d.ts +3 -0
- package/alert/alertTitle.js +30 -0
- package/alert/consts.d.ts +2 -0
- package/alert/consts.js +25 -0
- package/alert/context.d.ts +4 -0
- package/alert/context.js +23 -0
- package/alert/index.d.ts +9 -0
- package/alert/index.js +26 -0
- package/alert/theme.d.ts +46 -0
- package/alert/theme.js +62 -0
- package/avatar/avatar.d.ts +4 -4
- package/avatar/avatar.js +2 -5
- package/avatar/avatar.types.d.ts +1 -2
- package/box/box.d.ts +4 -4
- package/box/box.js +2 -4
- package/box/box.types.d.ts +10 -12
- package/button/button.d.ts +4 -4
- package/button/button.js +1 -3
- package/button/button.types.d.ts +2 -2
- package/button/buttonGroup.d.ts +2 -4
- package/button/buttonGroup.js +1 -3
- package/button/buttonGroup.types.d.ts +1 -2
- package/button/buttons.d.ts +5 -5
- package/checkbox/checkbox.d.ts +3 -7
- package/checkbox/checkbox.js +3 -7
- package/checkbox/checkbox.types.d.ts +4 -2
- package/checkbox/checkboxGroup.d.ts +2 -4
- package/checkbox/checkboxGroup.js +3 -12
- package/checkbox/checkboxGroup.types.d.ts +5 -3
- package/checkbox/theme.d.ts +0 -1
- package/checkbox/theme.js +0 -1
- package/core/globalStyle.js +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.js +3 -1
- package/core/resetCSS.d.ts +2 -0
- package/core/resetCSS.js +9 -0
- package/core/types.d.ts +18 -2
- package/core/types.js +1 -0
- package/core/utils.d.ts +10 -5
- package/core/utils.js +17 -2
- package/core/vuiProvider.js +2 -1
- package/divider/divider.d.ts +2 -4
- package/divider/divider.js +7 -10
- package/divider/divider.types.d.ts +1 -2
- package/heading/heading.d.ts +4 -4
- package/heading/heading.js +1 -3
- package/heading/heading.types.d.ts +7 -9
- package/heading/headings.d.ts +6 -6
- package/icon/icon.d.ts +1 -1
- package/icon/icon.js +8 -4
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/input/consts.d.ts +2 -18
- package/input/consts.js +2 -2
- package/input/input.d.ts +5 -5
- package/input/input.js +6 -6
- package/input/input.types.d.ts +12 -6
- package/label/label.d.ts +4 -4
- package/label/label.js +1 -3
- package/label/label.types.d.ts +2 -2
- package/link/link.d.ts +4 -4
- package/link/link.js +1 -3
- package/link/link.types.d.ts +7 -9
- package/list/list.d.ts +8 -4
- package/list/list.js +5 -5
- package/list/list.types.d.ts +1 -2
- package/list/listIcon.d.ts +3 -0
- package/list/listIcon.js +30 -0
- package/list/listItem.d.ts +2 -4
- package/list/listItem.js +9 -9
- package/list/listItem.types.d.ts +4 -2
- package/list/theme.d.ts +37 -2
- package/list/theme.js +43 -14
- package/p/p.d.ts +4 -4
- package/p/p.js +1 -3
- package/p/p.types.d.ts +8 -11
- package/package.json +1 -1
- package/radio/radio.d.ts +3 -7
- package/radio/radio.js +4 -10
- package/radio/radio.types.d.ts +4 -2
- package/radio/radioGroup.d.ts +2 -4
- package/radio/radioGroup.js +5 -5
- package/radio/radioGroup.types.d.ts +5 -3
- package/radio/theme.d.ts +0 -1
- package/radio/theme.js +0 -1
- package/skeleton/skeleton.d.ts +2 -4
- package/skeleton/skeleton.js +1 -3
- package/skeleton/skeleton.types.d.ts +1 -2
- package/spinner/consts.d.ts +34 -0
- package/spinner/consts.js +21 -0
- package/spinner/index.d.ts +3 -0
- package/spinner/index.js +20 -0
- package/spinner/spinner.d.ts +4 -0
- package/spinner/spinner.js +60 -0
- package/spinner/spinner.types.d.ts +15 -0
- package/spinner/spinner.types.js +2 -0
- package/spinner/theme.d.ts +68 -0
- package/spinner/theme.js +74 -0
- package/styles/radii.d.ts +1 -0
- package/styles/radii.js +2 -1
- package/svg/helpers.d.ts +1 -1
- package/svg/helpers.js +1 -1
- package/svg/svg.d.ts +3 -5
- package/svg/svg.js +8 -5
- package/svg/svg.types.d.ts +8 -3
- package/switch/index.d.ts +1 -0
- package/switch/index.js +1 -0
- package/switch/switch.d.ts +8 -4
- package/switch/switch.js +26 -6
- package/switch/switch.types.d.ts +3 -1
- package/switch/switchButton.d.ts +4 -10
- package/switch/switchButton.js +3 -9
- package/switch/switchButton.types.d.ts +1 -1
- package/switch/switchLabel.d.ts +1 -1
- package/switch/switchLabel.js +1 -1
- package/system/colors.d.ts +3 -2
- package/system/transitions.d.ts +2 -1
- package/t/t.d.ts +4 -4
- package/t/t.js +1 -3
- package/t/t.types.d.ts +7 -9
- package/textarea/textarea.d.ts +4 -4
- package/textarea/textarea.js +1 -3
- package/textarea/textarea.types.d.ts +1 -2
- package/theme/components.d.ts +144 -4
- package/theme/components.js +40 -36
- package/theme/defaultTheme.d.ts +145 -4
- package/theme/foundations.d.ts +1 -0
- package/tile/tile.d.ts +1 -1
- package/tile/tile.js +2 -2
- package/tile/tile.types.d.ts +2 -2
package/alert/alert.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AlertProps } from './alert.types';
|
|
2
|
+
import AlertButton from './alertButton';
|
|
3
|
+
import AlertIcon from './alertIcon';
|
|
4
|
+
import AlertMessage from './alertMessage';
|
|
5
|
+
import AlertText from './alertText';
|
|
6
|
+
import AlertTitle from './alertTitle';
|
|
7
|
+
import { VuiComponent } from '../core';
|
|
8
|
+
export declare const Alert: VuiComponent<"div", AlertProps> & {
|
|
9
|
+
Button: typeof AlertButton;
|
|
10
|
+
Icon: typeof AlertIcon;
|
|
11
|
+
Message: typeof AlertMessage;
|
|
12
|
+
Text: typeof AlertText;
|
|
13
|
+
Title: typeof AlertTitle;
|
|
14
|
+
};
|
|
15
|
+
export default Alert;
|
package/alert/alert.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
+
if (mod && mod.__esModule) return mod;
|
|
27
|
+
var result = {};
|
|
28
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
+
__setModuleDefault(result, mod);
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
33
|
+
var t = {};
|
|
34
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
35
|
+
t[p] = s[p];
|
|
36
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
37
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
38
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
39
|
+
t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.Alert = void 0;
|
|
48
|
+
var react_1 = __importStar(require("react"));
|
|
49
|
+
var alertButton_1 = __importDefault(require("./alertButton"));
|
|
50
|
+
var alertIcon_1 = __importDefault(require("./alertIcon"));
|
|
51
|
+
var alertMessage_1 = __importDefault(require("./alertMessage"));
|
|
52
|
+
var alertText_1 = __importDefault(require("./alertText"));
|
|
53
|
+
var alertTitle_1 = __importDefault(require("./alertTitle"));
|
|
54
|
+
var consts_1 = require("./consts");
|
|
55
|
+
var context_1 = require("./context");
|
|
56
|
+
var box_1 = __importDefault(require("../box"));
|
|
57
|
+
var core_1 = require("../core");
|
|
58
|
+
var utils_1 = require("../utils");
|
|
59
|
+
exports.Alert = core_1.forwardRef(function (props, ref) {
|
|
60
|
+
var _a;
|
|
61
|
+
var action = props.action, children = props.children, className = props.className, _b = props.colorScheme, colorSchemeProp = _b === void 0 ? 'blue' : _b, iconProp = props.icon, isVertical = props.isVertical, onClose = props.onClose, size = props.size, status = props.status, statusMapping = props.statusMapping, text = props.text, title = props.title, variant = props.variant, rest = __rest(props, ["action", "children", "className", "colorScheme", "icon", "isVertical", "onClose", "size", "status", "statusMapping", "text", "title", "variant"]);
|
|
62
|
+
var statuses = __assign(__assign({}, consts_1.alertStatusMapping), statusMapping);
|
|
63
|
+
var _c = (_a = (status && statuses[status])) !== null && _a !== void 0 ? _a : {}, _d = _c.colorScheme, colorScheme = _d === void 0 ? colorSchemeProp : _d, _e = _c.icon, icon = _e === void 0 ? iconProp : _e;
|
|
64
|
+
var styles = core_1.useStyleConfig('Alert', __assign({ colorScheme: colorScheme }, props));
|
|
65
|
+
var context = react_1.useMemo(function () { return utils_1.filterUndefined({ colorScheme: colorScheme, isVertical: isVertical, size: size, status: status, variant: variant }); }, [
|
|
66
|
+
colorScheme,
|
|
67
|
+
isVertical,
|
|
68
|
+
size,
|
|
69
|
+
status,
|
|
70
|
+
variant
|
|
71
|
+
]);
|
|
72
|
+
return (react_1.default.createElement(context_1.AlertProvider, { value: context },
|
|
73
|
+
react_1.default.createElement(box_1.default, __assign({ borderRadius: "md", className: utils_1.cs('vui-alert', className), px: 1.5, py: 1, ref: ref, w: "fit-content" }, styles.container, rest), children ? (children) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
74
|
+
typeof icon === 'string' ? (react_1.default.createElement(alertIcon_1.default, { animation: status === 'loading' ? 'spin' : undefined, icon: icon })) : (icon),
|
|
75
|
+
react_1.default.createElement(alertMessage_1.default, null,
|
|
76
|
+
title && react_1.default.createElement(alertTitle_1.default, null, title),
|
|
77
|
+
text && react_1.default.createElement(alertText_1.default, null, text)),
|
|
78
|
+
action,
|
|
79
|
+
onClose && react_1.default.createElement(alertButton_1.default, { icon: "falTimes", onClick: onClose }))))));
|
|
80
|
+
});
|
|
81
|
+
exports.Alert.displayName = 'Alert';
|
|
82
|
+
exports.Alert.Button = alertButton_1.default;
|
|
83
|
+
exports.Alert.Icon = alertIcon_1.default;
|
|
84
|
+
exports.Alert.Message = alertMessage_1.default;
|
|
85
|
+
exports.Alert.Text = alertText_1.default;
|
|
86
|
+
exports.Alert.Title = alertTitle_1.default;
|
|
87
|
+
exports.default = exports.Alert;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps } from '../box';
|
|
3
|
+
import { ThemingProps } from '../theme';
|
|
4
|
+
export interface AlertProps extends Omit<BoxProps, 'size' | 'variant'>, ThemingProps<'Alert'> {
|
|
5
|
+
action?: React.ReactElement;
|
|
6
|
+
colorScheme?: 'blue' | 'green' | 'grey' | 'prussian' | 'red' | 'yellow';
|
|
7
|
+
icon?: React.ReactElement | string;
|
|
8
|
+
isVertical?: boolean;
|
|
9
|
+
onClose?: () => void;
|
|
10
|
+
status?: AlertStatus;
|
|
11
|
+
statusMapping?: AlertStatusMapping;
|
|
12
|
+
text?: React.ReactElement | string;
|
|
13
|
+
title?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare type AlertStatus = 'error' | 'info' | 'loading' | 'success' | 'warning';
|
|
16
|
+
export declare type AlertStatusMapping = Record<string, {
|
|
17
|
+
colorScheme?: AlertProps['colorScheme'];
|
|
18
|
+
icon: AlertProps['icon'];
|
|
19
|
+
}>;
|
|
@@ -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.AlertButton = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var context_1 = require("./context");
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var button_1 = __importDefault(require("../button"));
|
|
22
|
+
exports.AlertButton = core_1.forwardRef(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var alertProps = (_a = context_1.useAlert()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, alertProps), props);
|
|
26
|
+
var styles = core_1.useStyleConfig('Alert', mergedProps);
|
|
27
|
+
return (react_1.default.createElement(button_1.default, __assign({ className: "vui-alertButton", colorScheme: mergedProps.colorScheme, ml: 0.5, mr: -0.5, ref: ref, size: "sm" }, styles.button, props)));
|
|
28
|
+
});
|
|
29
|
+
exports.AlertButton.displayName = 'AlertButton';
|
|
30
|
+
exports.default = exports.AlertButton;
|
|
@@ -0,0 +1,33 @@
|
|
|
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.AlertIcon = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var consts_1 = require("./consts");
|
|
20
|
+
var context_1 = require("./context");
|
|
21
|
+
var core_1 = require("../core");
|
|
22
|
+
var icon_1 = __importDefault(require("../icon"));
|
|
23
|
+
exports.AlertIcon = core_1.forwardRef(function (props, ref) {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
var alertProps = (_a = context_1.useAlert()) !== null && _a !== void 0 ? _a : {};
|
|
26
|
+
var mergedProps = __assign(__assign({}, alertProps), props);
|
|
27
|
+
var styles = core_1.useStyleConfig('Alert', mergedProps);
|
|
28
|
+
var status = mergedProps.status;
|
|
29
|
+
var icon = ((_b = (status && consts_1.alertStatusMapping[status])) !== null && _b !== void 0 ? _b : {}).icon;
|
|
30
|
+
return (react_1.default.createElement(icon_1.default, __assign({ animation: status === 'loading' ? 'spin' : undefined, className: "vui-alertIcon", icon: icon, mr: 1, my: 0.5, ref: ref, size: "md" }, styles.icon, props)));
|
|
31
|
+
});
|
|
32
|
+
exports.AlertIcon.displayName = 'AlertIcon';
|
|
33
|
+
exports.default = exports.AlertIcon;
|
|
@@ -0,0 +1,31 @@
|
|
|
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.AlertMessage = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var context_1 = require("./context");
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var box_1 = __importDefault(require("../box"));
|
|
22
|
+
exports.AlertMessage = core_1.forwardRef(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var alertProps = (_a = context_1.useAlert()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, alertProps), props);
|
|
26
|
+
var styles = core_1.useStyleConfig('Alert', mergedProps);
|
|
27
|
+
var isVertical = mergedProps.isVertical;
|
|
28
|
+
return (react_1.default.createElement(box_1.default, __assign({ className: "vui-alertMessage", column: isVertical, flex: "1", minW: 0, py: 0.5, ref: ref }, styles.message, props)));
|
|
29
|
+
});
|
|
30
|
+
exports.AlertMessage.displayName = 'AlertMessage';
|
|
31
|
+
exports.default = exports.AlertMessage;
|
|
@@ -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.AlertText = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var context_1 = require("./context");
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var p_1 = __importDefault(require("../p"));
|
|
22
|
+
exports.AlertText = core_1.forwardRef(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var alertProps = (_a = context_1.useAlert()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, alertProps), props);
|
|
26
|
+
var styles = core_1.useStyleConfig('Alert', mergedProps);
|
|
27
|
+
return react_1.default.createElement(p_1.default, __assign({ className: "vui-alertText", ref: ref }, styles.text, props));
|
|
28
|
+
});
|
|
29
|
+
exports.AlertText.displayName = 'AlertText';
|
|
30
|
+
exports.default = exports.AlertText;
|
|
@@ -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.AlertTitle = void 0;
|
|
18
|
+
var react_1 = __importDefault(require("react"));
|
|
19
|
+
var context_1 = require("./context");
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var heading_1 = __importDefault(require("../heading"));
|
|
22
|
+
exports.AlertTitle = core_1.forwardRef(function (props, ref) {
|
|
23
|
+
var _a;
|
|
24
|
+
var alertProps = (_a = context_1.useAlert()) !== null && _a !== void 0 ? _a : {};
|
|
25
|
+
var mergedProps = __assign(__assign({}, alertProps), props);
|
|
26
|
+
var styles = core_1.useStyleConfig('Alert', mergedProps);
|
|
27
|
+
return react_1.default.createElement(heading_1.default, __assign({ className: "vui-alertTitle", lineHeight: 1.5, mr: 1, ref: ref, size: "h6" }, styles.title, props));
|
|
28
|
+
});
|
|
29
|
+
exports.AlertTitle.displayName = 'AlertTitle';
|
|
30
|
+
exports.default = exports.AlertTitle;
|
package/alert/consts.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.alertStatusMapping = void 0;
|
|
4
|
+
exports.alertStatusMapping = {
|
|
5
|
+
error: {
|
|
6
|
+
colorScheme: 'red',
|
|
7
|
+
icon: 'falTimesCircle'
|
|
8
|
+
},
|
|
9
|
+
info: {
|
|
10
|
+
colorScheme: 'blue',
|
|
11
|
+
icon: 'falInfoCircle'
|
|
12
|
+
},
|
|
13
|
+
loading: {
|
|
14
|
+
colorScheme: 'blue',
|
|
15
|
+
icon: 'falSpinner'
|
|
16
|
+
},
|
|
17
|
+
success: {
|
|
18
|
+
colorScheme: 'green',
|
|
19
|
+
icon: 'falCheckCircle'
|
|
20
|
+
},
|
|
21
|
+
warning: {
|
|
22
|
+
colorScheme: 'yellow',
|
|
23
|
+
icon: 'falExclamationCircle'
|
|
24
|
+
}
|
|
25
|
+
};
|
package/alert/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.useAlert = exports.AlertProvider = void 0;
|
|
20
|
+
var core_1 = require("../core");
|
|
21
|
+
var _a = __read(core_1.createContext({ isOptional: true }), 2), AlertProvider = _a[0], useAlert = _a[1];
|
|
22
|
+
exports.AlertProvider = AlertProvider;
|
|
23
|
+
exports.useAlert = useAlert;
|
package/alert/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './alert';
|
|
2
|
+
export * from './alert.types';
|
|
3
|
+
export * from './alertButton';
|
|
4
|
+
export * from './alertIcon';
|
|
5
|
+
export * from './alertMessage';
|
|
6
|
+
export * from './alertText';
|
|
7
|
+
export * from './alertTitle';
|
|
8
|
+
export * from './context';
|
|
9
|
+
export { default } from './alert';
|
package/alert/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
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("./alert"), exports);
|
|
18
|
+
__exportStar(require("./alert.types"), exports);
|
|
19
|
+
__exportStar(require("./alertButton"), exports);
|
|
20
|
+
__exportStar(require("./alertIcon"), exports);
|
|
21
|
+
__exportStar(require("./alertMessage"), exports);
|
|
22
|
+
__exportStar(require("./alertText"), exports);
|
|
23
|
+
__exportStar(require("./alertTitle"), exports);
|
|
24
|
+
__exportStar(require("./context"), exports);
|
|
25
|
+
var alert_1 = require("./alert");
|
|
26
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(alert_1).default; } });
|
package/alert/theme.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
declare function variantSubtle(props: Dict): {
|
|
17
|
+
container: {
|
|
18
|
+
bg: string;
|
|
19
|
+
borderColor: string;
|
|
20
|
+
borderWidth: number;
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
button: {
|
|
24
|
+
color: string;
|
|
25
|
+
hoverBg: string;
|
|
26
|
+
activeBg: string;
|
|
27
|
+
variant: string;
|
|
28
|
+
};
|
|
29
|
+
icon: {};
|
|
30
|
+
message: {};
|
|
31
|
+
text: {};
|
|
32
|
+
title: {};
|
|
33
|
+
};
|
|
34
|
+
declare const _default: {
|
|
35
|
+
defaultProps: {
|
|
36
|
+
colorScheme: string;
|
|
37
|
+
variant: string;
|
|
38
|
+
};
|
|
39
|
+
parts: string[];
|
|
40
|
+
sizes: {};
|
|
41
|
+
variants: {
|
|
42
|
+
solid: typeof variantSolid;
|
|
43
|
+
subtle: typeof variantSubtle;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export default _default;
|
package/alert/theme.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
function variantSubtle(props) {
|
|
20
|
+
var c = props.colorScheme;
|
|
21
|
+
var container = {
|
|
22
|
+
bg: c + ".20",
|
|
23
|
+
borderColor: c + ".80",
|
|
24
|
+
borderWidth: 1,
|
|
25
|
+
color: c + ".90"
|
|
26
|
+
};
|
|
27
|
+
var button = {
|
|
28
|
+
color: c + ".90",
|
|
29
|
+
hoverBg: c + ".30",
|
|
30
|
+
activeBg: c + ".40",
|
|
31
|
+
variant: 'text'
|
|
32
|
+
};
|
|
33
|
+
var icon = {};
|
|
34
|
+
var message = {};
|
|
35
|
+
var text = {};
|
|
36
|
+
var title = {};
|
|
37
|
+
if (c === 'grey') {
|
|
38
|
+
button.color = 'prussian.80';
|
|
39
|
+
container.color = 'prussian.80';
|
|
40
|
+
}
|
|
41
|
+
if (c === 'yellow') {
|
|
42
|
+
button.color = 'yellow.100';
|
|
43
|
+
container.color = 'yellow.100';
|
|
44
|
+
}
|
|
45
|
+
return { container: container, button: button, icon: icon, message: message, text: text, title: title };
|
|
46
|
+
}
|
|
47
|
+
var defaultProps = {
|
|
48
|
+
colorScheme: 'blue',
|
|
49
|
+
variant: 'subtle'
|
|
50
|
+
};
|
|
51
|
+
var parts = ['container', 'button', 'icon', 'message', 'text', 'title'];
|
|
52
|
+
var sizes = {};
|
|
53
|
+
var variants = {
|
|
54
|
+
solid: variantSolid,
|
|
55
|
+
subtle: variantSubtle
|
|
56
|
+
};
|
|
57
|
+
exports.default = {
|
|
58
|
+
defaultProps: defaultProps,
|
|
59
|
+
parts: parts,
|
|
60
|
+
sizes: sizes,
|
|
61
|
+
variants: variants
|
|
62
|
+
};
|
package/avatar/avatar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AvatarProps, AvatarStyleProps } from './avatar.types';
|
|
2
|
-
export declare const AvatarBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare const Avatar: import("
|
|
2
|
+
export declare const AvatarBase: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, AvatarStyleProps & {
|
|
3
|
+
color?: any;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const Avatar: import("../core").VuiComponent<"span", AvatarProps>;
|
|
6
6
|
export default Avatar;
|
package/avatar/avatar.js
CHANGED
|
@@ -54,9 +54,7 @@ var icon_1 = __importDefault(require("../icon"));
|
|
|
54
54
|
var utils_1 = require("../utils");
|
|
55
55
|
var generator = styled_components_1.compose(styled_components_1.backgroundColor, styled_components_1.borders, styled_components_1.interactivity, styled_components_1.sizing, styled_components_1.space, styled_components_1.transitions, styled_components_1.typography);
|
|
56
56
|
var AvatarImage = styled_components_2.default.img(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\theight: 100%;\n\twidth: 100%;\n\n\t", "\n"], ["\n\theight: 100%;\n\twidth: 100%;\n\n\t", "\n"])), styled_components_1.borders);
|
|
57
|
-
exports.AvatarBase = styled_components_2.default.span.withConfig({
|
|
58
|
-
shouldForwardProp: core_1.shouldForwardProp(generator.meta.props)
|
|
59
|
-
})(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: 1.333;\n\toutline: none;\n\ttransition: all 0s ease-in-out;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: 1.333;\n\toutline: none;\n\ttransition: all 0s ease-in-out;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"])), generator);
|
|
57
|
+
exports.AvatarBase = styled_components_2.default.span.withConfig(core_1.forwardPropConfig(generator))(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"], ["\n\talign-items: center;\n\tdisplay: inline-flex;\n\tflex-shrink: 0;\n\tjustify-content: center;\n\tline-height: normal;\n\toutline: none;\n\n\t&:focus {\n\t\tborder-color: transparent;\n\t}\n\n\t", "\n"])), generator);
|
|
60
58
|
function defaultGetInitials(name) {
|
|
61
59
|
if (name === void 0) { name = ''; }
|
|
62
60
|
var _a = __read(name.split(' '), 2), _b = _a[0], first = _b === void 0 ? '' : _b, _c = _a[1], last = _c === void 0 ? '' : _c;
|
|
@@ -77,8 +75,7 @@ exports.Avatar = core_1.forwardRef(function (props, ref) {
|
|
|
77
75
|
userSelect: 'none'
|
|
78
76
|
}
|
|
79
77
|
: {};
|
|
80
|
-
|
|
81
|
-
return (react_1.default.createElement(exports.AvatarBase, __assign({ borderRadius: borderRadius, className: utils_1.cs('vui-avatar', className), fontWeight: "medium", h: h, ref: ref, transitionDuration: "fast", w: h }, styles, interactiveProps, aliasedProps, rest), children ? (children) : src ? (react_1.default.createElement(AvatarImage, { borderRadius: borderRadius, src: src })) : icon ? (react_1.default.createElement(icon_1.default, { icon: icon, size: iconSize })) : initials ? (initials) : null));
|
|
78
|
+
return (react_1.default.createElement(exports.AvatarBase, __assign({ borderRadius: borderRadius, className: utils_1.cs('vui-avatar', className), fontWeight: "medium", h: h, ref: ref, transitionDuration: "fast", w: h }, styles, interactiveProps, rest), children ? (children) : src ? (react_1.default.createElement(AvatarImage, { borderRadius: borderRadius, src: src })) : icon ? (react_1.default.createElement(icon_1.default, { icon: icon, size: iconSize })) : initials ? (initials) : null));
|
|
82
79
|
});
|
|
83
80
|
exports.Avatar.displayName = 'Avatar';
|
|
84
81
|
exports.default = exports.Avatar;
|
package/avatar/avatar.types.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
1
|
import { IconProp } from '../icon';
|
|
3
2
|
import { BackgroundColorProps, BordersProps, InteractivityProps, SizingProps, SpaceProps, TransitionsProps, TypographyProps } from '../system';
|
|
4
3
|
import { ThemingProps } from '../theme';
|
|
5
4
|
export interface AvatarImageStyleProps extends BordersProps {
|
|
6
5
|
}
|
|
7
|
-
export interface AvatarProps extends
|
|
6
|
+
export interface AvatarProps extends AvatarStyleProps, ThemingProps<'Avatar'> {
|
|
8
7
|
colorScheme?: 'blue' | 'green' | 'grey' | 'prussian' | 'red' | 'yellow';
|
|
9
8
|
getInitials?: (name: string) => string;
|
|
10
9
|
icon?: IconProp;
|
package/box/box.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BoxProps, BoxStyleProps } from './box.types';
|
|
2
|
-
export declare const BoxBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare const Box: import("
|
|
2
|
+
export declare const BoxBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, BoxStyleProps & {
|
|
3
|
+
color?: any;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const Box: import("../core").VuiComponent<"div", BoxProps>;
|
|
6
6
|
export default Box;
|
package/box/box.js
CHANGED
|
@@ -35,10 +35,8 @@ var react_1 = __importDefault(require("react"));
|
|
|
35
35
|
var styled_components_2 = __importDefault(require("styled-components"));
|
|
36
36
|
var core_1 = require("../core");
|
|
37
37
|
var utils_1 = require("../utils");
|
|
38
|
-
var generator = styled_components_1.compose(styled_components_1.backgroundColor, styled_components_1.borders, styled_components_1.effects, styled_components_1.flexboxes, styled_components_1.interactivity, styled_components_1.layout, styled_components_1.sizing, styled_components_1.space, styled_components_1.transitions);
|
|
39
|
-
exports.BoxBase = styled_components_2.default.div.withConfig(
|
|
40
|
-
shouldForwardProp: core_1.shouldForwardProp(generator.meta.props)
|
|
41
|
-
})(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\ttransition: all 0s ease-in-out;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\ttransition: all 0s ease-in-out;\n\n\t", "\n"])), generator);
|
|
38
|
+
var generator = styled_components_1.compose(styled_components_1.backgroundColor, styled_components_1.borders, styled_components_1.color, styled_components_1.effects, styled_components_1.flexboxes, styled_components_1.interactivity, styled_components_1.layout, styled_components_1.sizing, styled_components_1.space, styled_components_1.transitions);
|
|
39
|
+
exports.BoxBase = styled_components_2.default.div.withConfig(core_1.forwardPropConfig(generator))(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n\tdisplay: flex;\n\n\t", "\n"], ["\n\tdisplay: flex;\n\n\t", "\n"])), generator);
|
|
42
40
|
exports.Box = core_1.forwardRef(function (props, ref) {
|
|
43
41
|
var _a = core_1.omitThemingProps(props), align = _a.align, center = _a.center, centerH = _a.centerH, centerV = _a.centerV, className = _a.className, column = _a.column, direction = _a.direction, hoverShadow = _a.hoverShadow, justify = _a.justify, radius = _a.radius, shadow = _a.shadow, wrap = _a.wrap, rest = __rest(_a, ["align", "center", "centerH", "centerV", "className", "column", "direction", "hoverShadow", "justify", "radius", "shadow", "wrap"]);
|
|
44
42
|
var styles = core_1.useStyleConfig('Box', props);
|
package/box/box.types.d.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export interface BoxProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>, BoxStyleProps, ThemingProps<'Box'> {
|
|
6
|
-
align?: AlignItemsProps['alignItems'];
|
|
1
|
+
import { BackgroundColorProps, BordersProps, ColorProps, EffectsProps, FlexboxesProps, InteractivityProps, LayoutProps, SizingProps, SpaceProps, TransitionsProps } from '../system';
|
|
2
|
+
import { ThemingProps } from '../theme';
|
|
3
|
+
export interface BoxProps extends BoxStyleProps, ThemingProps<'Box'> {
|
|
4
|
+
align?: FlexboxesProps['alignItems'];
|
|
7
5
|
center?: boolean;
|
|
8
6
|
centerH?: boolean;
|
|
9
7
|
centerV?: boolean;
|
|
10
8
|
column?: boolean;
|
|
11
|
-
direction?:
|
|
12
|
-
hoverShadow?:
|
|
13
|
-
justify?:
|
|
14
|
-
radius?:
|
|
15
|
-
shadow?:
|
|
9
|
+
direction?: FlexboxesProps['flexDirection'];
|
|
10
|
+
hoverShadow?: EffectsProps['hoverBoxShadow'];
|
|
11
|
+
justify?: FlexboxesProps['justifyContent'];
|
|
12
|
+
radius?: BordersProps['borderRadius'];
|
|
13
|
+
shadow?: EffectsProps['boxShadow'];
|
|
16
14
|
wrap?: boolean;
|
|
17
15
|
}
|
|
18
|
-
export interface BoxStyleProps extends BackgroundColorProps, BordersProps, EffectsProps, FlexboxesProps, InteractivityProps, LayoutProps, SizingProps, SpaceProps, TransitionsProps {
|
|
16
|
+
export interface BoxStyleProps extends BackgroundColorProps, BordersProps, ColorProps, EffectsProps, FlexboxesProps, InteractivityProps, LayoutProps, SizingProps, SpaceProps, TransitionsProps {
|
|
19
17
|
}
|
package/button/button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ButtonProps, ButtonStyleProps } from './button.types';
|
|
2
|
-
export declare const ButtonBase: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
export declare const Button: import("
|
|
2
|
+
export declare const ButtonBase: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, ButtonStyleProps & {
|
|
3
|
+
color?: any;
|
|
4
|
+
}, never>;
|
|
5
|
+
export declare const Button: import("../core").VuiComponent<"button", ButtonProps>;
|
|
6
6
|
export default Button;
|