@veritone-ce/design-system 1.2.2 → 1.3.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/dist/assets/theme.d.ts +39 -24
- package/dist/assets/theme.js +3 -18
- package/dist/components/Button/Button.stories.d.ts +7 -0
- package/dist/components/Button/Button.stories.js +47 -0
- package/dist/components/Button/Indicator.js +1 -1
- package/dist/components/Button/__tests__/Button.test.d.ts +1 -0
- package/dist/components/Button/__tests__/Button.test.js +14 -0
- package/dist/components/Button/button.theme.d.ts +3 -837
- package/dist/components/Button/button.theme.js +0 -1
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/FileUploader/FileUploader.stories.d.ts +15 -0
- package/dist/components/FileUploader/FileUploader.stories.js +26 -0
- package/dist/components/FileUploader/__tests__/FileUploader.test.d.ts +1 -0
- package/dist/components/FileUploader/__tests__/FileUploader.test.js +253 -0
- package/dist/components/FileUploader/index.d.ts +20 -0
- package/dist/components/FileUploader/index.js +151 -0
- package/dist/components/FileUploader/useUploadFile.d.ts +5 -0
- package/dist/components/FileUploader/useUploadFile.js +76 -0
- package/dist/components/ThemeProvider/__tests__/Button.test.d.ts +1 -0
- package/dist/components/ThemeProvider/__tests__/Button.test.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/reportWebVitals.d.ts +3 -0
- package/dist/reportWebVitals.js +12 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/setupTests.js +5 -0
- package/dist/utils/tests/helpers.d.ts +6 -0
- package/dist/utils/tests/helpers.js +21 -0
- package/package.json +6 -2
package/dist/assets/theme.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PaletteColorOptions, SimplePaletteColorOptions } from '@mui/material';
|
|
2
2
|
declare module '@mui/material/Button' {
|
|
3
3
|
interface ButtonPropsVariantOverrides {
|
|
4
4
|
primary: true;
|
|
@@ -7,38 +7,53 @@ declare module '@mui/material/Button' {
|
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
declare module '@mui/material/styles' {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
type Colors = typeof colors;
|
|
11
|
+
type ButtonPaletteColorOptions = SimplePaletteColorOptions & {
|
|
12
|
+
hover: string;
|
|
13
|
+
};
|
|
14
|
+
type MiscPaletteColorOptions = Colors['misc'];
|
|
15
|
+
type TextPaletteColorOptions = Colors['text'];
|
|
16
|
+
interface TypeText extends TextPaletteColorOptions {
|
|
17
|
+
}
|
|
18
|
+
interface Palette {
|
|
19
|
+
neutral: Pick<Palette['primary'], 'main'>;
|
|
20
|
+
button: ButtonPaletteColorOptions;
|
|
21
|
+
misc: MiscPaletteColorOptions;
|
|
22
|
+
}
|
|
23
|
+
interface PaletteOptions {
|
|
24
|
+
neutral: PaletteColorOptions;
|
|
25
|
+
button: ButtonPaletteColorOptions;
|
|
26
|
+
misc: MiscPaletteColorOptions;
|
|
12
27
|
}
|
|
13
28
|
}
|
|
14
|
-
declare
|
|
15
|
-
|
|
29
|
+
declare const colors: {
|
|
30
|
+
brand: {
|
|
31
|
+
pink: string;
|
|
32
|
+
blueOne: string;
|
|
33
|
+
blueTwo: string;
|
|
34
|
+
warning: string;
|
|
35
|
+
success: string;
|
|
36
|
+
error: string;
|
|
37
|
+
white: string;
|
|
38
|
+
};
|
|
39
|
+
text: {
|
|
40
|
+
primary: string;
|
|
41
|
+
secondary: string;
|
|
42
|
+
tertiary: string;
|
|
43
|
+
disabled: string;
|
|
44
|
+
};
|
|
45
|
+
button: {
|
|
46
|
+
primary: string;
|
|
16
47
|
hover: string;
|
|
17
48
|
};
|
|
18
|
-
|
|
49
|
+
misc: {
|
|
19
50
|
background: string;
|
|
20
51
|
altBackground: string;
|
|
21
52
|
rowHoverGreyOne: string;
|
|
22
53
|
rowOn: string;
|
|
23
54
|
rowOnHoverGreyTwo: string;
|
|
24
55
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
neutral: Palette['primary'];
|
|
28
|
-
misc: MiscPalleteColorOptions;
|
|
29
|
-
}
|
|
30
|
-
interface PaletteOptions {
|
|
31
|
-
button?: ButtonPaletteColorOptions;
|
|
32
|
-
neutral?: PaletteColorOptions;
|
|
33
|
-
misc?: MiscPalleteColorOptions;
|
|
34
|
-
}
|
|
35
|
-
interface ThemeOptions extends MuiThemeOptions {
|
|
36
|
-
pallete?: {
|
|
37
|
-
button?: ButtonPaletteColorOptions;
|
|
38
|
-
neutral?: PaletteColorOptions;
|
|
39
|
-
misc?: MiscPalleteColorOptions;
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
56
|
+
};
|
|
57
|
+
export declare type Theme = typeof theme;
|
|
43
58
|
declare let theme: import("@mui/material").Theme;
|
|
44
59
|
export default theme;
|
package/dist/assets/theme.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
2
|
import { createTheme } from '@mui/material';
|
|
4
|
-
import buttonTheme from 'components/Button/button.theme';
|
|
3
|
+
import buttonTheme from '../components/Button/button.theme';
|
|
5
4
|
import sx from '@mui/system/sx';
|
|
6
5
|
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
|
7
6
|
import InfoIcon from '@mui/icons-material/Info';
|
|
@@ -82,8 +81,7 @@ let theme = createTheme({
|
|
|
82
81
|
},
|
|
83
82
|
spacing: 10
|
|
84
83
|
});
|
|
85
|
-
theme = createTheme(theme, {
|
|
86
|
-
components: {
|
|
84
|
+
theme = createTheme(Object.assign(Object.assign({}, theme), { components: {
|
|
87
85
|
MuiButton: buttonTheme(theme),
|
|
88
86
|
MuiInputLabel: {
|
|
89
87
|
styleOverrides: {
|
|
@@ -274,19 +272,6 @@ theme = createTheme(theme, {
|
|
|
274
272
|
paddingTop: theme.spacing(1)
|
|
275
273
|
}
|
|
276
274
|
}
|
|
277
|
-
},
|
|
278
|
-
MuiDataGrid: {
|
|
279
|
-
styleOverrides: {
|
|
280
|
-
root: {
|
|
281
|
-
'& .MuiDataGrid-columnHeader:focus': {
|
|
282
|
-
outline: 0
|
|
283
|
-
},
|
|
284
|
-
'& .MuiDataGrid-cell:focus': {
|
|
285
|
-
outline: 0
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
275
|
}
|
|
290
|
-
}
|
|
291
|
-
});
|
|
276
|
+
} }));
|
|
292
277
|
export default theme;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentMeta, ComponentStory } from '@storybook/react';
|
|
2
|
+
import { ButtonProps } from './';
|
|
3
|
+
declare const _default: ComponentMeta<({ children, ...props }: ButtonProps) => JSX.Element>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Contained: ComponentStory<({ children, ...props }: ButtonProps) => JSX.Element>;
|
|
6
|
+
export declare const Outlined: ComponentStory<({ children, ...props }: ButtonProps) => JSX.Element>;
|
|
7
|
+
export declare const Text: ComponentStory<({ children, ...props }: ButtonProps) => JSX.Element>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from '@mui/material';
|
|
3
|
+
import Button from './';
|
|
4
|
+
import CalendarIcon from '@mui/icons-material/CalendarTodayOutlined';
|
|
5
|
+
import { Fragment } from 'react';
|
|
6
|
+
// import { userEvent, within } from '@storybook/testing-library'
|
|
7
|
+
// import { expect } from '@storybook/jest'
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Components/Button',
|
|
10
|
+
component: Button,
|
|
11
|
+
// argType: {
|
|
12
|
+
// variant: `contained`,
|
|
13
|
+
// },
|
|
14
|
+
parameters: {
|
|
15
|
+
componentSubtitle: 'Clickable Button with many variations',
|
|
16
|
+
controls: {
|
|
17
|
+
exclude: ['variant', 'classes']
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const previewProps = [
|
|
22
|
+
{},
|
|
23
|
+
{
|
|
24
|
+
startIcon: _jsx(CalendarIcon, {})
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
endIcon: _jsx(CalendarIcon, {})
|
|
28
|
+
}
|
|
29
|
+
];
|
|
30
|
+
const Template = (args) => (_jsx(Box, Object.assign({ sx: {
|
|
31
|
+
display: `grid`,
|
|
32
|
+
gridTemplateColumns: `repeat(4, min-content)`,
|
|
33
|
+
justifyItems: `flex-start`,
|
|
34
|
+
gap: 2
|
|
35
|
+
} }, { children: previewProps.map((props, index) => (_jsxs(Fragment, { children: [_jsx(Button, Object.assign({}, props, args, { children: "Button" })), _jsx(Button, Object.assign({}, props, { color: `error` }, args, { children: "Button" })), _jsx(Button, Object.assign({}, props, { disabled: true }, args, { children: "Button" })), _jsx(Button, Object.assign({}, props, { isLoading: true }, args, { children: "Button" }))] }, index))) })));
|
|
36
|
+
export const Contained = Template.bind({});
|
|
37
|
+
Contained.args = {
|
|
38
|
+
variant: 'contained'
|
|
39
|
+
};
|
|
40
|
+
export const Outlined = Template.bind({});
|
|
41
|
+
Outlined.args = {
|
|
42
|
+
variant: 'outlined'
|
|
43
|
+
};
|
|
44
|
+
export const Text = Template.bind({});
|
|
45
|
+
Text.args = {
|
|
46
|
+
variant: `text`
|
|
47
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { CircularProgress, Box } from '@mui/material';
|
|
3
|
-
import theme from 'assets/theme';
|
|
3
|
+
import theme from '../../assets/theme';
|
|
4
4
|
const Indicator = () => {
|
|
5
5
|
return (_jsx(Box, Object.assign({ className: "button-loader", "data-testid": "loading-indicator", sx: {
|
|
6
6
|
position: `absolute`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '../../../utils/tests/helpers';
|
|
3
|
+
import { screen } from '@testing-library/react';
|
|
4
|
+
import Button from '..';
|
|
5
|
+
describe('<Button />', () => {
|
|
6
|
+
it('should render the Button component', () => {
|
|
7
|
+
render(_jsx(Button, { children: "Button" }));
|
|
8
|
+
expect(screen.getByText('Button')).toBeInTheDocument();
|
|
9
|
+
});
|
|
10
|
+
it('should show circular progress', () => {
|
|
11
|
+
render(_jsx(Button, Object.assign({ isLoading: true }, { children: "Button" })));
|
|
12
|
+
expect(screen.getByTestId('loading-indicator')).toBeInTheDocument();
|
|
13
|
+
});
|
|
14
|
+
});
|