@veritone-ce/design-system 0.9.16 → 0.9.17
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/dist/assets/theme.d.ts +2 -0
- package/dist/assets/theme.js +23 -13
- package/dist/components/Button/Indicator.d.ts +3 -0
- package/dist/components/Button/Indicator.js +26 -0
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Button/index.js +6 -14
- package/dist/components/Button/useButtonProps.d.ts +3 -0
- package/dist/components/Button/useButtonProps.js +27 -0
- package/package.json +1 -1
package/dist/assets/theme.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ import '@fontsource/nunito-sans';
|
|
|
3
3
|
import '@fontsource/dosis';
|
|
4
4
|
declare module '@mui/material/Button' {
|
|
5
5
|
interface ButtonPropsVariantOverrides {
|
|
6
|
+
primary: true;
|
|
6
7
|
secondary: true;
|
|
8
|
+
tertiary: true;
|
|
7
9
|
}
|
|
8
10
|
}
|
|
9
11
|
declare module '@mui/material/styles/createPalette' {
|
package/dist/assets/theme.js
CHANGED
|
@@ -53,7 +53,7 @@ var theme = createTheme({
|
|
|
53
53
|
main: '#FFBB0A'
|
|
54
54
|
},
|
|
55
55
|
error: {
|
|
56
|
-
main: '#
|
|
56
|
+
main: '#FF0000'
|
|
57
57
|
},
|
|
58
58
|
divider: '#214167'
|
|
59
59
|
},
|
|
@@ -70,27 +70,37 @@ theme = createTheme(theme, {
|
|
|
70
70
|
// @ts-ignore
|
|
71
71
|
root: function (_a) {
|
|
72
72
|
var ownerState = _a.ownerState;
|
|
73
|
-
return (__assign(__assign({ textTransform: 'none', '&.Mui-disabled': {
|
|
73
|
+
return (__assign(__assign(__assign({ textTransform: 'none', fontWeight: '600', '&.Mui-disabled': {
|
|
74
74
|
borderColor: "#E0E8F0"
|
|
75
|
-
}, '&.Mui-disabled .MuiButton-startIcon': {
|
|
75
|
+
}, '&.Mui-disabled .MuiButton-startIcon .MuiButton-endIcon': {
|
|
76
76
|
opacity: 0.3
|
|
77
77
|
} }, (ownerState.variant === "contained" &&
|
|
78
78
|
{
|
|
79
|
-
|
|
80
|
-
backgroundColor: theme.palette.button.main,
|
|
79
|
+
//@ts-ignore
|
|
80
|
+
backgroundColor: ownerState.color === "primary" ? theme.palette.button.main : theme.palette[ownerState.color].main,
|
|
81
81
|
':hover': {
|
|
82
|
-
|
|
82
|
+
//@ts-ignore
|
|
83
|
+
backgroundColor: ownerState.color === "primary" ? theme.palette.button.hover : theme.palette[ownerState.color]
|
|
84
|
+
}
|
|
85
|
+
})), (ownerState.variant === "outlined" &&
|
|
86
|
+
{
|
|
87
|
+
//@ts-ignore
|
|
88
|
+
color: ownerState.color === "primary" ? theme.palette.neutral.main : theme.palette[ownerState.color].main,
|
|
89
|
+
//@ts-ignore
|
|
90
|
+
borderColor: ownerState.color === "primary" ? theme.palette.neutral.main : theme.palette[ownerState.color].main,
|
|
91
|
+
':hover': {
|
|
92
|
+
//@ts-ignore
|
|
93
|
+
color: ownerState.color === "primary" ? theme.palette.secondary.main : theme.palette[ownerState.color],
|
|
94
|
+
//@ts-ignore
|
|
95
|
+
borderColor: ownerState.color === "primary" ? theme.palette.secondary.main : theme.palette[ownerState.color]
|
|
83
96
|
}
|
|
84
97
|
})), (ownerState.variant === "text" &&
|
|
85
98
|
{
|
|
86
|
-
|
|
87
|
-
color: theme.palette.
|
|
99
|
+
//@ts-ignore
|
|
100
|
+
color: ownerState.color === "primary" ? theme.palette.neutral.main : theme.palette[ownerState.color].main,
|
|
88
101
|
':hover': {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
'.MuiButton-startIcon': {
|
|
92
|
-
color: "#555F7C",
|
|
93
|
-
marginRight: theme.spacing(2)
|
|
102
|
+
//@ts-ignore
|
|
103
|
+
color: ownerState.color === "primary" ? theme.palette.secondary.main : theme.palette[ownerState.color]
|
|
94
104
|
}
|
|
95
105
|
})));
|
|
96
106
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { CircularProgress, Box } from '@mui/material';
|
|
14
|
+
var Indicator = function () {
|
|
15
|
+
return (_jsx(Box, __assign({ sx: {
|
|
16
|
+
position: "absolute",
|
|
17
|
+
top: 0,
|
|
18
|
+
left: 0,
|
|
19
|
+
right: 0,
|
|
20
|
+
bottom: 0,
|
|
21
|
+
display: "grid",
|
|
22
|
+
justifyItems: "center",
|
|
23
|
+
alignItems: "center"
|
|
24
|
+
} }, { children: _jsx(CircularProgress, { size: 20 }) })));
|
|
25
|
+
};
|
|
26
|
+
export default Indicator;
|
|
@@ -9,5 +9,5 @@ export declare type ButtonProps = {
|
|
|
9
9
|
/**
|
|
10
10
|
- Use a button for common user click actions. Several variations available.
|
|
11
11
|
**/
|
|
12
|
-
declare const Button: ({ children,
|
|
12
|
+
declare const Button: ({ children, ...props }: ButtonProps) => JSX.Element;
|
|
13
13
|
export default Button;
|
|
@@ -21,26 +21,18 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { Button as MuiButton,
|
|
24
|
+
import { Button as MuiButton, Box } from '@mui/material';
|
|
25
|
+
import Indicator from './Indicator';
|
|
26
|
+
import useButtonProps from './useButtonProps';
|
|
25
27
|
/**
|
|
26
28
|
- Use a button for common user click actions. Several variations available.
|
|
27
29
|
**/
|
|
28
30
|
var Button = function (_a) {
|
|
29
|
-
var children = _a.children,
|
|
30
|
-
var
|
|
31
|
-
position: "absolute",
|
|
32
|
-
top: 0,
|
|
33
|
-
left: 0,
|
|
34
|
-
right: 0,
|
|
35
|
-
bottom: 0,
|
|
36
|
-
display: "grid",
|
|
37
|
-
justifyItems: "center",
|
|
38
|
-
alignItems: "center"
|
|
39
|
-
} }, { children: _jsx(CircularProgress, { size: 20 }) })));
|
|
40
|
-
var indicator = isProcessing ? processingIndicator : null;
|
|
31
|
+
var children = _a.children, props = __rest(_a, ["children"]);
|
|
32
|
+
var _b = useButtonProps(props), isProcessing = _b.isProcessing, muiButtonProps = __rest(_b, ["isProcessing"]);
|
|
41
33
|
return (_jsxs(Box, __assign({ sx: {
|
|
42
34
|
display: "inline-flex",
|
|
43
35
|
position: "relative"
|
|
44
|
-
} }, { children: [_jsx(MuiButton, __assign({},
|
|
36
|
+
} }, { children: [_jsx(MuiButton, __assign({}, muiButtonProps, { children: children })), isProcessing ? _jsx(Indicator, {}) : null] })));
|
|
45
37
|
};
|
|
46
38
|
export default Button;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
var useButtonProps = function (_a) {
|
|
24
|
+
var _b = _a.isProcessing, isProcessing = _b === void 0 ? false : _b, props = __rest(_a, ["isProcessing"]);
|
|
25
|
+
return __assign({ disabled: isProcessing || props.disabled, isProcessing: isProcessing }, props);
|
|
26
|
+
};
|
|
27
|
+
export default useButtonProps;
|