@veritone-ce/design-system 1.12.62 → 1.12.63
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/cjs/components/Autocomplete/index.js +26 -3
- package/dist/cjs/components/Checkbox/index.js +7 -1
- package/dist/cjs/components/Input/index.js +0 -3
- package/dist/cjs/components/Input/input.theme.js +23 -17
- package/dist/cjs/components/Modal/modal.theme.js +2 -1
- package/dist/esm/components/Autocomplete/index.js +26 -3
- package/dist/esm/components/Checkbox/index.js +7 -1
- package/dist/esm/components/Input/index.js +0 -3
- package/dist/esm/components/Input/input.theme.js +23 -17
- package/dist/esm/components/Modal/modal.theme.js +2 -1
- package/dist/types/components/Autocomplete/index.d.ts +5 -2
- package/dist/types/components/Input/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _material = require("@mui/material");
|
|
9
|
+
var _styles = require("@mui/material/styles");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
12
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
@@ -14,12 +15,24 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
14
15
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
16
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
17
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
18
|
+
var StyledAutocomplete = (0, _styles.styled)(_material.Autocomplete)({
|
|
19
|
+
'& .MuiOutlinedInput-root': {
|
|
20
|
+
padding: '0px 8px 4px'
|
|
21
|
+
}
|
|
22
|
+
});
|
|
17
23
|
function Autocomplete(props) {
|
|
18
|
-
|
|
24
|
+
var value = _react["default"].useMemo(function () {
|
|
25
|
+
var _props$items$find;
|
|
26
|
+
return props.value !== undefined ? (_props$items$find = props.items.find(function (v) {
|
|
27
|
+
return v.value === props.value;
|
|
28
|
+
})) !== null && _props$items$find !== void 0 ? _props$items$find : null : undefined;
|
|
29
|
+
}, [props.items, props.value]);
|
|
30
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledAutocomplete, {
|
|
19
31
|
disablePortal: props.disablePortal,
|
|
20
32
|
options: props.items,
|
|
21
33
|
inputValue: props.inputValue,
|
|
22
34
|
filterOptions: props.filterOptions,
|
|
35
|
+
value: value,
|
|
23
36
|
isOptionEqualToValue: function isOptionEqualToValue(option, value) {
|
|
24
37
|
return option.value === value.value;
|
|
25
38
|
},
|
|
@@ -27,15 +40,25 @@ function Autocomplete(props) {
|
|
|
27
40
|
return props.onInputChange(event, inputValue);
|
|
28
41
|
},
|
|
29
42
|
fullWidth: props.fullWidth,
|
|
43
|
+
disabled: props.disabled,
|
|
44
|
+
ListboxProps: {
|
|
45
|
+
style: {
|
|
46
|
+
maxHeight: '30rem'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
30
49
|
renderInput: function renderInput(params) {
|
|
31
50
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, _objectSpread(_objectSpread({}, params), {}, {
|
|
51
|
+
InputLabelProps: _objectSpread(_objectSpread({}, params.InputLabelProps), {}, {
|
|
52
|
+
shrink: true
|
|
53
|
+
}),
|
|
32
54
|
label: props.label,
|
|
33
55
|
error: props.error,
|
|
56
|
+
placeholder: props.placeholder,
|
|
34
57
|
helperText: props.error ? "Please select a ".concat(props.label) : ''
|
|
35
58
|
}));
|
|
36
59
|
},
|
|
37
|
-
onChange: function onChange(event,
|
|
38
|
-
return props.onChange(event, value);
|
|
60
|
+
onChange: function onChange(event, item) {
|
|
61
|
+
return props.onChange(event, item !== null ? item.value : null);
|
|
39
62
|
},
|
|
40
63
|
sx: props.sx
|
|
41
64
|
});
|
|
@@ -6,12 +6,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _material = require("@mui/material");
|
|
9
|
+
var _styles = require("@mui/material/styles");
|
|
9
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
|
+
var StyledCheckbox = (0, _styles.styled)(_material.Checkbox)({
|
|
13
|
+
'& .MuiSvgIcon-root': {
|
|
14
|
+
fontSize: 18
|
|
15
|
+
}
|
|
16
|
+
});
|
|
11
17
|
var Checkbox = function Checkbox(props) {
|
|
12
18
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.FormControlLabel, {
|
|
13
19
|
label: props.label,
|
|
14
|
-
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
20
|
+
control: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCheckbox, {
|
|
15
21
|
"data-testid": props['data-testid'],
|
|
16
22
|
checked: props.checked,
|
|
17
23
|
indeterminate: props.indeterminate,
|
|
@@ -10,9 +10,6 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
11
|
var Input = function Input(props) {
|
|
12
12
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_material.TextField, {
|
|
13
|
-
InputLabelProps: {
|
|
14
|
-
shrink: false
|
|
15
|
-
},
|
|
16
13
|
"data-testid": props['data-testid'],
|
|
17
14
|
type: props.type,
|
|
18
15
|
value: props.value,
|
|
@@ -6,7 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var inputTheme = function inputTheme(theme) {
|
|
8
8
|
return {
|
|
9
|
-
defaultProps: {
|
|
9
|
+
defaultProps: {
|
|
10
|
+
InputLabelProps: {
|
|
11
|
+
shrink: true
|
|
12
|
+
}
|
|
13
|
+
},
|
|
10
14
|
styleOverrides: {
|
|
11
15
|
root: function root() {
|
|
12
16
|
return {
|
|
@@ -18,19 +22,20 @@ var inputTheme = function inputTheme(theme) {
|
|
|
18
22
|
fontWeight: 600,
|
|
19
23
|
fontSize: '14px',
|
|
20
24
|
lineHeight: '20px',
|
|
21
|
-
color: theme.palette.
|
|
25
|
+
color: theme.palette.text.secondary,
|
|
22
26
|
'&.Mui-focused': {
|
|
23
|
-
color: theme.palette.
|
|
27
|
+
color: theme.palette.text.secondary
|
|
24
28
|
}
|
|
25
29
|
},
|
|
26
30
|
'& .MuiInputLabel-root.Mui-disabled': {
|
|
27
|
-
color: theme.palette.
|
|
31
|
+
color: theme.palette.text.secondary
|
|
28
32
|
},
|
|
29
33
|
'& .MuiInputLabel-root.Mui-error': {
|
|
30
|
-
color: theme.palette.
|
|
34
|
+
color: theme.palette.text.secondary
|
|
31
35
|
},
|
|
32
36
|
'& .MuiInputBase-root': {
|
|
33
|
-
|
|
37
|
+
marginTop: '3px',
|
|
38
|
+
padding: '0px 8px 4px',
|
|
34
39
|
height: '36px',
|
|
35
40
|
'& input': {
|
|
36
41
|
boxSizing: 'border-box',
|
|
@@ -43,24 +48,25 @@ var inputTheme = function inputTheme(theme) {
|
|
|
43
48
|
lineHeight: '20px',
|
|
44
49
|
color: theme.palette.text.primary,
|
|
45
50
|
border: 'none',
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
51
|
+
zIndex: 1,
|
|
52
|
+
// put above fieldset
|
|
53
|
+
'&::placeholder': {
|
|
54
|
+
opacity: '0.6'
|
|
49
55
|
}
|
|
50
56
|
},
|
|
51
57
|
'& fieldset': {
|
|
52
|
-
|
|
58
|
+
zIndex: 0,
|
|
59
|
+
border: "1px solid ".concat(theme.palette.text.secondary),
|
|
53
60
|
borderRadius: '4px',
|
|
54
|
-
'&:focus': {
|
|
55
|
-
border: "2px solid ".concat(theme.palette.secondary.main)
|
|
56
|
-
},
|
|
57
|
-
'&:disabled': {
|
|
58
|
-
background: theme.palette.action.disabledBackground,
|
|
59
|
-
borderColor: '#E0E8F0 !important'
|
|
60
|
-
},
|
|
61
61
|
'& legend': {
|
|
62
62
|
display: 'none'
|
|
63
63
|
}
|
|
64
|
+
},
|
|
65
|
+
'&.Mui-disabled': {
|
|
66
|
+
'& fieldset': {
|
|
67
|
+
background: theme.palette.action.disabledBackground,
|
|
68
|
+
borderColor: '#E0E8F0'
|
|
69
|
+
}
|
|
64
70
|
}
|
|
65
71
|
},
|
|
66
72
|
'& .MuiInputBase-root.MuiInputBase-multiline': {
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
+
var _material = require("@mui/material");
|
|
7
8
|
var modalTheme = function modalTheme(theme) {
|
|
8
9
|
return {
|
|
9
10
|
defaultProps: {},
|
|
@@ -12,7 +13,7 @@ var modalTheme = function modalTheme(theme) {
|
|
|
12
13
|
return {
|
|
13
14
|
borderRadius: '4px',
|
|
14
15
|
'& .MuiBackdrop-root': {
|
|
15
|
-
backgroundColor: theme.palette.neutral.main
|
|
16
|
+
backgroundColor: (0, _material.alpha)(theme.palette.neutral.main, 0.65)
|
|
16
17
|
},
|
|
17
18
|
margin: 'auto',
|
|
18
19
|
'& .MuiPaper-root': {
|
|
@@ -6,13 +6,26 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { Autocomplete as MuiAutocomplete, TextField } from '@mui/material';
|
|
9
|
+
import { styled } from '@mui/material/styles';
|
|
9
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
var StyledAutocomplete = styled(MuiAutocomplete)({
|
|
12
|
+
'& .MuiOutlinedInput-root': {
|
|
13
|
+
padding: '0px 8px 4px'
|
|
14
|
+
}
|
|
15
|
+
});
|
|
10
16
|
function Autocomplete(props) {
|
|
11
|
-
|
|
17
|
+
var value = React.useMemo(function () {
|
|
18
|
+
var _props$items$find;
|
|
19
|
+
return props.value !== undefined ? (_props$items$find = props.items.find(function (v) {
|
|
20
|
+
return v.value === props.value;
|
|
21
|
+
})) !== null && _props$items$find !== void 0 ? _props$items$find : null : undefined;
|
|
22
|
+
}, [props.items, props.value]);
|
|
23
|
+
return /*#__PURE__*/_jsx(StyledAutocomplete, {
|
|
12
24
|
disablePortal: props.disablePortal,
|
|
13
25
|
options: props.items,
|
|
14
26
|
inputValue: props.inputValue,
|
|
15
27
|
filterOptions: props.filterOptions,
|
|
28
|
+
value: value,
|
|
16
29
|
isOptionEqualToValue: function isOptionEqualToValue(option, value) {
|
|
17
30
|
return option.value === value.value;
|
|
18
31
|
},
|
|
@@ -20,15 +33,25 @@ function Autocomplete(props) {
|
|
|
20
33
|
return props.onInputChange(event, inputValue);
|
|
21
34
|
},
|
|
22
35
|
fullWidth: props.fullWidth,
|
|
36
|
+
disabled: props.disabled,
|
|
37
|
+
ListboxProps: {
|
|
38
|
+
style: {
|
|
39
|
+
maxHeight: '30rem'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
23
42
|
renderInput: function renderInput(params) {
|
|
24
43
|
return /*#__PURE__*/_jsx(TextField, _objectSpread(_objectSpread({}, params), {}, {
|
|
44
|
+
InputLabelProps: _objectSpread(_objectSpread({}, params.InputLabelProps), {}, {
|
|
45
|
+
shrink: true
|
|
46
|
+
}),
|
|
25
47
|
label: props.label,
|
|
26
48
|
error: props.error,
|
|
49
|
+
placeholder: props.placeholder,
|
|
27
50
|
helperText: props.error ? "Please select a ".concat(props.label) : ''
|
|
28
51
|
}));
|
|
29
52
|
},
|
|
30
|
-
onChange: function onChange(event,
|
|
31
|
-
return props.onChange(event, value);
|
|
53
|
+
onChange: function onChange(event, item) {
|
|
54
|
+
return props.onChange(event, item !== null ? item.value : null);
|
|
32
55
|
},
|
|
33
56
|
sx: props.sx
|
|
34
57
|
});
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormControlLabel, Checkbox as MuiCheckbox } from '@mui/material';
|
|
3
|
+
import { styled } from '@mui/material/styles';
|
|
3
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
var StyledCheckbox = styled(MuiCheckbox)({
|
|
6
|
+
'& .MuiSvgIcon-root': {
|
|
7
|
+
fontSize: 18
|
|
8
|
+
}
|
|
9
|
+
});
|
|
4
10
|
var Checkbox = function Checkbox(props) {
|
|
5
11
|
return /*#__PURE__*/_jsx(FormControlLabel, {
|
|
6
12
|
label: props.label,
|
|
7
|
-
control: /*#__PURE__*/_jsx(
|
|
13
|
+
control: /*#__PURE__*/_jsx(StyledCheckbox, {
|
|
8
14
|
"data-testid": props['data-testid'],
|
|
9
15
|
checked: props.checked,
|
|
10
16
|
indeterminate: props.indeterminate,
|
|
@@ -4,9 +4,6 @@ import { InputAdornment } from '@mui/material';
|
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
5
|
var Input = function Input(props) {
|
|
6
6
|
return /*#__PURE__*/_jsx(TextField, {
|
|
7
|
-
InputLabelProps: {
|
|
8
|
-
shrink: false
|
|
9
|
-
},
|
|
10
7
|
"data-testid": props['data-testid'],
|
|
11
8
|
type: props.type,
|
|
12
9
|
value: props.value,
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
var inputTheme = function inputTheme(theme) {
|
|
2
2
|
return {
|
|
3
|
-
defaultProps: {
|
|
3
|
+
defaultProps: {
|
|
4
|
+
InputLabelProps: {
|
|
5
|
+
shrink: true
|
|
6
|
+
}
|
|
7
|
+
},
|
|
4
8
|
styleOverrides: {
|
|
5
9
|
root: function root() {
|
|
6
10
|
return {
|
|
@@ -12,19 +16,20 @@ var inputTheme = function inputTheme(theme) {
|
|
|
12
16
|
fontWeight: 600,
|
|
13
17
|
fontSize: '14px',
|
|
14
18
|
lineHeight: '20px',
|
|
15
|
-
color: theme.palette.
|
|
19
|
+
color: theme.palette.text.secondary,
|
|
16
20
|
'&.Mui-focused': {
|
|
17
|
-
color: theme.palette.
|
|
21
|
+
color: theme.palette.text.secondary
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
'& .MuiInputLabel-root.Mui-disabled': {
|
|
21
|
-
color: theme.palette.
|
|
25
|
+
color: theme.palette.text.secondary
|
|
22
26
|
},
|
|
23
27
|
'& .MuiInputLabel-root.Mui-error': {
|
|
24
|
-
color: theme.palette.
|
|
28
|
+
color: theme.palette.text.secondary
|
|
25
29
|
},
|
|
26
30
|
'& .MuiInputBase-root': {
|
|
27
|
-
|
|
31
|
+
marginTop: '3px',
|
|
32
|
+
padding: '0px 8px 4px',
|
|
28
33
|
height: '36px',
|
|
29
34
|
'& input': {
|
|
30
35
|
boxSizing: 'border-box',
|
|
@@ -37,24 +42,25 @@ var inputTheme = function inputTheme(theme) {
|
|
|
37
42
|
lineHeight: '20px',
|
|
38
43
|
color: theme.palette.text.primary,
|
|
39
44
|
border: 'none',
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
zIndex: 1,
|
|
46
|
+
// put above fieldset
|
|
47
|
+
'&::placeholder': {
|
|
48
|
+
opacity: '0.6'
|
|
43
49
|
}
|
|
44
50
|
},
|
|
45
51
|
'& fieldset': {
|
|
46
|
-
|
|
52
|
+
zIndex: 0,
|
|
53
|
+
border: "1px solid ".concat(theme.palette.text.secondary),
|
|
47
54
|
borderRadius: '4px',
|
|
48
|
-
'&:focus': {
|
|
49
|
-
border: "2px solid ".concat(theme.palette.secondary.main)
|
|
50
|
-
},
|
|
51
|
-
'&:disabled': {
|
|
52
|
-
background: theme.palette.action.disabledBackground,
|
|
53
|
-
borderColor: '#E0E8F0 !important'
|
|
54
|
-
},
|
|
55
55
|
'& legend': {
|
|
56
56
|
display: 'none'
|
|
57
57
|
}
|
|
58
|
+
},
|
|
59
|
+
'&.Mui-disabled': {
|
|
60
|
+
'& fieldset': {
|
|
61
|
+
background: theme.palette.action.disabledBackground,
|
|
62
|
+
borderColor: '#E0E8F0'
|
|
63
|
+
}
|
|
58
64
|
}
|
|
59
65
|
},
|
|
60
66
|
'& .MuiInputBase-root.MuiInputBase-multiline': {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { alpha } from '@mui/material';
|
|
1
2
|
var modalTheme = function modalTheme(theme) {
|
|
2
3
|
return {
|
|
3
4
|
defaultProps: {},
|
|
@@ -6,7 +7,7 @@ var modalTheme = function modalTheme(theme) {
|
|
|
6
7
|
return {
|
|
7
8
|
borderRadius: '4px',
|
|
8
9
|
'& .MuiBackdrop-root': {
|
|
9
|
-
backgroundColor: theme.palette.neutral.main
|
|
10
|
+
backgroundColor: alpha(theme.palette.neutral.main, 0.65)
|
|
10
11
|
},
|
|
11
12
|
margin: 'auto',
|
|
12
13
|
'& .MuiPaper-root': {
|
|
@@ -8,11 +8,14 @@ type Item = {
|
|
|
8
8
|
export type AutocompleteProps = {
|
|
9
9
|
items: Item[];
|
|
10
10
|
filterOptions?: (options: Item[], state: FilterOptionsState<Item>) => Item[];
|
|
11
|
-
|
|
11
|
+
value?: string | null;
|
|
12
|
+
label?: string;
|
|
12
13
|
disablePortal?: boolean;
|
|
14
|
+
placeholder?: string;
|
|
13
15
|
inputValue?: string;
|
|
14
16
|
onInputChange?: (event: React.SyntheticEvent, inputValue: string) => void;
|
|
15
|
-
onChange: (event: React.SyntheticEvent, value:
|
|
17
|
+
onChange: (event: React.SyntheticEvent, value: string | null) => void;
|
|
18
|
+
disabled?: boolean;
|
|
16
19
|
error?: boolean;
|
|
17
20
|
sx?: SxProps<Theme>;
|
|
18
21
|
fullWidth?: boolean;
|
|
@@ -3,7 +3,7 @@ import { SxProps, Theme } from '@mui/material/styles';
|
|
|
3
3
|
export type InputProps = {
|
|
4
4
|
'data-testid'?: string;
|
|
5
5
|
type?: React.InputHTMLAttributes<unknown>['type'];
|
|
6
|
-
value
|
|
6
|
+
value?: unknown;
|
|
7
7
|
helperText?: React.ReactNode;
|
|
8
8
|
label?: React.ReactNode;
|
|
9
9
|
disabled?: boolean;
|