@veritone-ce/design-system 0.9.4 → 0.9.6

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.
@@ -0,0 +1,29 @@
1
+ import { ThemeOptions as MuiThemeOptions } from '@mui/material';
2
+ import '@fontsource/nunito-sans';
3
+ import '@fontsource/dosis';
4
+ declare module '@mui/material/Button' {
5
+ interface ButtonPropsVariantOverrides {
6
+ secondary: true;
7
+ }
8
+ }
9
+ declare module '@mui/material/styles/createPalette' {
10
+ type ButtonPaletteColorOptions = SimplePaletteColorOptions & {
11
+ hover: string;
12
+ };
13
+ interface Palette {
14
+ button: ButtonPaletteColorOptions;
15
+ neutral: Palette['primary'];
16
+ }
17
+ interface PaletteOptions {
18
+ button?: ButtonPaletteColorOptions;
19
+ neutral?: PaletteColorOptions;
20
+ }
21
+ interface ThemeOptions extends MuiThemeOptions {
22
+ pallete?: {
23
+ button?: ButtonPaletteColorOptions;
24
+ neutral?: PaletteColorOptions;
25
+ };
26
+ }
27
+ }
28
+ declare let theme: import("@mui/material").Theme;
29
+ export default theme;
@@ -0,0 +1,321 @@
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 { createTheme } from '@mui/material';
14
+ import '@fontsource/nunito-sans';
15
+ import '@fontsource/dosis';
16
+ import sx from '@mui/system/sx';
17
+ import CheckCircleIcon from '@mui/icons-material/CheckCircle';
18
+ import InfoIcon from '@mui/icons-material/Info';
19
+ import WarningIcon from '@mui/icons-material/Error';
20
+ import ErrorIcon from '@mui/icons-material/Cancel';
21
+ // create theme in steps https://mui.com/material-ui/customization/theming/#api
22
+ var theme = createTheme({
23
+ typography: {
24
+ fontFamily: ['Nunito Sans', 'Helvetica', 'sans-serif'].join(','),
25
+ h2: {
26
+ fontSize: '1.429rem',
27
+ lineHeight: '2.143rem',
28
+ fontWeight: '700',
29
+ },
30
+ },
31
+ palette: {
32
+ primary: {
33
+ main: '#214167',
34
+ },
35
+ secondary: {
36
+ main: '#335B89',
37
+ contrastText: '#ffffff',
38
+ },
39
+ neutral: {
40
+ main: '#5C6269',
41
+ },
42
+ button: {
43
+ main: '#1871E8',
44
+ hover: '#335B89',
45
+ },
46
+ success: {
47
+ main: '#28BA3F',
48
+ },
49
+ info: {
50
+ main: '#325491',
51
+ },
52
+ warning: {
53
+ main: '#FFBB0A',
54
+ },
55
+ error: {
56
+ main: '#D43060',
57
+ },
58
+ divider: '#214167',
59
+ },
60
+ spacing: 10,
61
+ });
62
+ theme = createTheme(theme, {
63
+ components: {
64
+ MuiButton: {
65
+ defaultProps: {
66
+ variant: 'contained',
67
+ disableRipple: true,
68
+ },
69
+ styleOverrides: {
70
+ // @ts-ignore
71
+ root: function (_a) {
72
+ var ownerState = _a.ownerState;
73
+ return (__assign(__assign({ textTransform: 'none', '&.Mui-disabled': {
74
+ borderColor: "#E0E8F0",
75
+ }, '&.Mui-disabled .MuiButton-startIcon': {
76
+ opacity: 0.3,
77
+ } }, (ownerState.variant === "contained" &&
78
+ {
79
+ fontWeight: '600',
80
+ backgroundColor: theme.palette.button.main,
81
+ ':hover': {
82
+ backgroundColor: theme.palette.button.hover,
83
+ },
84
+ })), (ownerState.variant === "text" &&
85
+ {
86
+ fontWeight: '600',
87
+ color: theme.palette.button.main,
88
+ ':hover': {
89
+ color: theme.palette.button.hover,
90
+ },
91
+ '.MuiButton-startIcon': {
92
+ color: "#555F7C",
93
+ marginRight: theme.spacing(2),
94
+ },
95
+ })));
96
+ },
97
+ },
98
+ variants: [
99
+ {
100
+ props: {
101
+ variant: 'secondary',
102
+ },
103
+ style: sx({
104
+ backgroundColor: 'white',
105
+ color: theme.palette.neutral.main,
106
+ border: "1px solid ".concat(theme.palette.neutral.main),
107
+ ':hover': {
108
+ border: "1px solid ".concat(theme.palette.primary.main),
109
+ color: theme.palette.primary.main,
110
+ backgroundColor: 'white',
111
+ },
112
+ }),
113
+ },
114
+ ],
115
+ },
116
+ MuiInputLabel: {
117
+ styleOverrides: {
118
+ root: sx({
119
+ color: "#5C6269",
120
+ fontSize: "14px",
121
+ lineHeight: "21px",
122
+ fontWeight: "600",
123
+ }),
124
+ },
125
+ },
126
+ MuiFormHelperText: {
127
+ styleOverrides: {
128
+ root: sx({
129
+ position: 'relative',
130
+ marginLeft: 0,
131
+ '&.Mui-error': {
132
+ paddingLeft: "17px",
133
+ '&::before': {
134
+ content: "\"\"",
135
+ height: "12px",
136
+ width: '12px',
137
+ position: 'absolute',
138
+ left: 0,
139
+ top: "50%",
140
+ transform: "translate(0, -50%)",
141
+ backgroundColor: theme.palette.error.main,
142
+ borderRadius: "100%",
143
+ },
144
+ },
145
+ }),
146
+ },
147
+ },
148
+ MuiTextField: {
149
+ defaultProps: {
150
+ size: 'small',
151
+ },
152
+ styleOverrides: {
153
+ root: sx({
154
+ color: "#2A323C",
155
+ '& .MuiOutlinedInput-root': {
156
+ '& fieldset': {
157
+ borderColor: "#E0E8F0",
158
+ },
159
+ '&:hover fieldset': {
160
+ borderColor: "#335B89",
161
+ },
162
+ '&.Mui-focused fieldset': {
163
+ border: "1px solid #5C6269",
164
+ },
165
+ '&.Mui-error fieldset': {
166
+ borderColor: theme.palette.error.main,
167
+ },
168
+ },
169
+ }),
170
+ },
171
+ },
172
+ MuiStepIcon: {
173
+ styleOverrides: {
174
+ root: {
175
+ borderRadius: "100%",
176
+ outline: "1px solid #465364",
177
+ color: "white",
178
+ text: {
179
+ fill: "#465364",
180
+ },
181
+ '&.Mui-active': {
182
+ outline: "none",
183
+ color: theme.palette.button.main,
184
+ text: {
185
+ fill: "white",
186
+ },
187
+ },
188
+ },
189
+ },
190
+ },
191
+ MuiDialogTitle: {
192
+ styleOverrides: {
193
+ root: {
194
+ fontSize: "24px",
195
+ lineHeight: "34px",
196
+ paddingTop: theme.spacing(3),
197
+ paddingLeft: theme.spacing(3),
198
+ paddingRight: theme.spacing(3),
199
+ paddingBottom: theme.spacing(1),
200
+ },
201
+ },
202
+ },
203
+ MuiDialogContent: {
204
+ styleOverrides: {
205
+ root: {
206
+ paddingTop: 0,
207
+ paddingLeft: theme.spacing(3),
208
+ paddingRight: theme.spacing(3),
209
+ paddingBottom: theme.spacing(1),
210
+ },
211
+ },
212
+ },
213
+ MuiDialogActions: {
214
+ styleOverrides: {
215
+ root: {
216
+ padding: theme.spacing(3),
217
+ },
218
+ },
219
+ },
220
+ MuiLink: {
221
+ defaultProps: {
222
+ underline: "none",
223
+ color: "#1871E8",
224
+ },
225
+ },
226
+ MuiSnackbar: {
227
+ defaultProps: {
228
+ autoHideDuration: 6000,
229
+ anchorOrigin: {
230
+ vertical: "top",
231
+ horizontal: "right",
232
+ },
233
+ },
234
+ styleOverrides: {
235
+ root: {
236
+ width: "100%",
237
+ maxWidth: "415px",
238
+ position: "absolute",
239
+ },
240
+ },
241
+ },
242
+ MuiAlert: {
243
+ defaultProps: {
244
+ variant: "outlined",
245
+ iconMapping: {
246
+ success: _jsx(CheckCircleIcon, {}),
247
+ info: _jsx(InfoIcon, {}),
248
+ warning: _jsx(WarningIcon, {}),
249
+ error: _jsx(ErrorIcon, {}),
250
+ },
251
+ },
252
+ styleOverrides: {
253
+ root: {
254
+ width: "100%",
255
+ backgroundColor: "white",
256
+ borderColor: "#D5DFE9",
257
+ position: "relative",
258
+ overflow: "hidden",
259
+ '&:after': {
260
+ content: '""',
261
+ position: "absolute",
262
+ width: "4px",
263
+ left: 0,
264
+ top: 0,
265
+ bottom: 0,
266
+ },
267
+ '&.MuiAlert-outlinedSuccess:after': {
268
+ backgroundColor: theme.palette.success.main,
269
+ },
270
+ '&.MuiAlert-outlinedInfo:after': {
271
+ backgroundColor: theme.palette.info.main,
272
+ },
273
+ '&.MuiAlert-outlinedWarning:after': {
274
+ backgroundColor: theme.palette.warning.main,
275
+ },
276
+ '&.MuiAlert-outlinedError:after': {
277
+ backgroundColor: theme.palette.error.main,
278
+ },
279
+ '& .MuiAlert-icon': {
280
+ opacity: 1,
281
+ fontSize: 20,
282
+ },
283
+ '& .MuiAlert-message': {
284
+ fontSize: "12px",
285
+ lineHeight: "22px",
286
+ color: "black",
287
+ },
288
+ },
289
+ },
290
+ },
291
+ MuiCircularProgress: {
292
+ styleOverrides: {
293
+ root: {
294
+ color: theme.palette.button.main,
295
+ },
296
+ },
297
+ },
298
+ MuiCardContent: {
299
+ styleOverrides: {
300
+ root: {
301
+ padding: theme.spacing(2),
302
+ paddingTop: theme.spacing(1),
303
+ },
304
+ },
305
+ },
306
+ MuiDataGrid: {
307
+ styleOverrides: {
308
+ root: {
309
+ '& .MuiDataGrid-columnHeader:focus': {
310
+ outline: 0,
311
+ },
312
+ '& .MuiDataGrid-cell:focus': {
313
+ outline: 0,
314
+ },
315
+ },
316
+ },
317
+ },
318
+ },
319
+ });
320
+ export default theme;
321
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/assets/theme.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAmC,MAAM,eAAe,CAAA;AAC5E,OAAO,yBAAyB,CAAA;AAChC,OAAO,mBAAmB,CAAA;AAC1B,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAE/B,OAAO,eAAe,MAAM,iCAAiC,CAAA;AAC7D,OAAO,QAAQ,MAAM,0BAA0B,CAAA;AAC/C,OAAO,WAAW,MAAM,2BAA2B,CAAA;AACnD,OAAO,SAAS,MAAM,4BAA4B,CAAA;AAgClD,+EAA+E;AAC/E,IAAI,KAAK,GAAG,WAAW,CAAC;IACtB,UAAU,EAAE;QACV,UAAU,EAAE,CAAC,aAAa,EAAE,WAAW,EAAE,YAAY,CAAC,CAA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,mCAAmC,EAAE;wBACnC,OAAO,EAAE,CAAC;qBACX;oBACD,2BAA2B,EAAE;wBAC3B,OAAO,EAAE,CAAC;qBACX;iBACF;aACF;SACF;KACF;CACF,CAAC,CAAA;AAEF,eAAe,KAAK,CAAA"}
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { ButtonProps as MuiButtonProps } from '@mui/material';
3
+ export declare type ButtonProps = {
4
+ /**
5
+ Use the isProcessing prop to indicate to the user that an action is in process. This will disable the button.
6
+ */
7
+ isProcessing?: boolean;
8
+ } & MuiButtonProps;
9
+ /**
10
+ - Use a button for common user click actions. Several variations available.
11
+ **/
12
+ declare const Button: ({ children, isProcessing, ...props }: ButtonProps) => JSX.Element;
13
+ export default Button;
@@ -0,0 +1,47 @@
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
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { Button as MuiButton, CircularProgress, Box } from '@mui/material';
25
+ /**
26
+ - Use a button for common user click actions. Several variations available.
27
+ **/
28
+ var Button = function (_a) {
29
+ var children = _a.children, _b = _a.isProcessing, isProcessing = _b === void 0 ? false : _b, props = __rest(_a, ["children", "isProcessing"]);
30
+ var processingIndicator = (_jsx(Box, __assign({ sx: {
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;
41
+ return (_jsxs(Box, __assign({ sx: {
42
+ display: "inline-flex",
43
+ position: "relative",
44
+ } }, { children: [_jsx(MuiButton, __assign({}, props, { disabled: isProcessing || props.disabled }, { children: children })), indicator] })));
45
+ };
46
+ export default Button;
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAiC,gBAAgB,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AASzG;;GAEG;AACH,IAAM,MAAM,GAAG,UAAC,EAIF;IAHZ,IAAA,QAAQ,cAAA,EACR,oBAAoB,EAApB,YAAY,mBAAG,KAAK,KAAA,EACjB,KAAK,cAHM,4BAIf,CADS;IAER,IAAM,mBAAmB,GAAG,CAC1B,KAAC,GAAG,aACF,EAAE,EAAE;YACF,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,MAAM;YACf,YAAY,EAAE,QAAQ;YACtB,UAAU,EAAE,QAAQ;SACrB,gBAED,KAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,GAAqB,IAC3C,CACP,CAAA;IAED,IAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAA;IAE3D,OAAO,CACL,MAAC,GAAG,aACF,EAAE,EAAE;YACF,OAAO,EAAE,aAAa;YACtB,QAAQ,EAAE,UAAU;SACrB,iBAED,KAAC,SAAS,eAAK,KAAK,IAAE,QAAQ,EAAE,YAAY,IAAI,KAAK,CAAC,QAAQ,gBAC3D,QAAQ,IACC,EACX,SAAS,KACN,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,MAAM,CAAA"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { ThemeProviderProps } from '@mui/system';
3
+ declare const ThemeProvider: ({ children, }: ThemeProviderProps) => JSX.Element;
4
+ export default ThemeProvider;
@@ -0,0 +1,20 @@
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 { ThemeProvider as MuiThemeProvider } from '@mui/system';
14
+ import theme from '../../assets/theme';
15
+ var ThemeProvider = function (_a) {
16
+ var children = _a.children;
17
+ return (_jsx(MuiThemeProvider, __assign({ theme: theme }, { children: children })));
18
+ };
19
+ export default ThemeProvider;
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ThemeProvider/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAsB,MAAM,aAAa,CAAA;AACnF,OAAO,KAAK,MAAM,oBAAoB,CAAA;AAEtC,IAAM,aAAa,GAAG,UAAC,EAEF;QADnB,QAAQ,cAAA;IAER,OAAO,CACL,KAAC,gBAAgB,aAAC,KAAK,EAAE,KAAK,gBAAG,QAAQ,IAAoB,CAC9D,CAAA;AACH,CAAC,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './components/Button';
2
+ export * from './components/ThemeProvider';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,4BAA4B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritone-ce/design-system",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "private": false,
5
5
  "dependencies": {
6
6
  "@emotion/react": "^11.10.4",
@@ -96,8 +96,10 @@
96
96
  ]
97
97
  ]
98
98
  },
99
- "description": "design system for veritone ce",
100
- "main": "dist/index.js",
99
+ "description": "Design System for Veritone CE",
100
+ "files": [
101
+ "dist/*"
102
+ ],
101
103
  "repository": {
102
104
  "type": "git",
103
105
  "url": "git+ssh://git@github.com/veritone/design-system.git"
@@ -1,23 +0,0 @@
1
- # Name of our action
2
- name: "Chromatic"
3
- # The event that will trigger the action
4
- on:
5
- pull_request:
6
- branches: [develop]
7
-
8
- # What the action will do
9
- jobs:
10
- test:
11
- # The operating system it will run on
12
- runs-on: ubuntu-latest
13
- # The list of steps that the action will go through
14
- steps:
15
- - uses: actions/checkout@v1
16
- - run: yarn
17
- #👇 Adds Chromatic as a step in the workflow
18
- - uses: chromaui/action@v1
19
- # Options required for Chromatic's GitHub Action
20
- with:
21
- #👇 Chromatic projectToken, see https://storybook.js.org/tutorials/design-systems-for-developers/react/en/review/ to obtain it
22
- projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
23
- token: ${{ secrets.GITHUB_TOKEN }}
@@ -1,39 +0,0 @@
1
- # Name of our action
2
- name: Release
3
-
4
- # The event that will trigger the action
5
- on:
6
- push:
7
- branches: [main]
8
-
9
- # what the action will do
10
- jobs:
11
- release:
12
- # The operating system it will run on
13
- runs-on: ubuntu-latest
14
- # This check needs to be in place to prevent a publish loop with auto and github actions
15
- if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
16
- # The list of steps that the action will go through
17
- steps:
18
- - uses: actions/checkout@v2
19
- - name: Prepare repository
20
- run: git fetch --unshallow --tags
21
- - name: Use Node.js 12.x
22
- uses: actions/setup-node@v1
23
- with:
24
- node-version: 12.x
25
- - name: Cache node modules
26
- uses: actions/cache@v1
27
- with:
28
- path: node_modules
29
- key: yarn-deps-${{ hashFiles('yarn.lock') }}
30
- restore-keys: |
31
- yarn-deps-${{ hashFiles('yarn.lock') }}
32
- - name: Create Release
33
- env:
34
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
36
- run: |
37
- yarn install --frozen-lockfile
38
- yarn build
39
- yarn release
@@ -1,21 +0,0 @@
1
- module.exports = {
2
- stories: [
3
- '../src/Intro.stories.mdx',
4
- '../src/**/*.stories.mdx',
5
- '../src/**/*.stories.@(js|jsx|ts|tsx)'
6
- ],
7
- addons: [
8
- '@storybook/addon-links',
9
- '@storybook/addon-essentials',
10
- '@storybook/addon-interactions',
11
- '@storybook/preset-create-react-app',
12
- '@storybook/addon-a11y',
13
- ],
14
- framework: '@storybook/react',
15
- core: {
16
- builder: '@storybook/builder-webpack5'
17
- },
18
- features: {
19
- interactionsDebugger: true,
20
- },
21
- }
@@ -1,22 +0,0 @@
1
- import React from 'react'
2
- import { ThemeProvider} from '@mui/system'
3
- import theme from '../src/assets/theme'
4
-
5
- export const decorators = [
6
- (Story) => (
7
- <ThemeProvider theme={theme}>
8
- <Story />
9
- </ThemeProvider>
10
-
11
- ),
12
- ]
13
-
14
- export const parameters = {
15
- actions: { argTypesRegex: "^on[A-Z].*" },
16
- controls: {
17
- matchers: {
18
- color: /(background|color)$/i,
19
- date: /Date$/,
20
- },
21
- },
22
- }
Binary file
package/public/index.html DELETED
@@ -1,42 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="theme-color" content="#000000" />
8
- <meta
9
- name="description"
10
- content="Veritone CE Design System"
11
- />
12
- <!--
13
- manifest.json provides metadata used when your web app is installed on a
14
- user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
15
- -->
16
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
17
- <!--
18
- Notice the use of %PUBLIC_URL% in the tags above.
19
- It will be replaced with the URL of the `public` folder during the build.
20
- Only files inside the `public` folder can be referenced from the HTML.
21
-
22
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
23
- work correctly both with client-side routing and a non-root public URL.
24
- Learn how to configure a non-root public URL by running `npm run build`.
25
- -->
26
- <title>Veritone | Design System</title>
27
- </head>
28
- <body>
29
- <noscript>You need to enable JavaScript to run this app.</noscript>
30
- <div id="root"></div>
31
- <!--
32
- This HTML file is a template.
33
- If you open it directly in the browser, you will see an empty page.
34
-
35
- You can add webfonts, meta tags, or analytics to this file.
36
- The build step will place the bundled scripts into the <body> tag.
37
-
38
- To begin the development, run `npm start` or `yarn start`.
39
- To create a production bundle, use `npm run build` or `yarn build`.
40
- -->
41
- </body>
42
- </html>
@@ -1,15 +0,0 @@
1
- {
2
- "short_name": "Design System",
3
- "name": "Veritone CE Design System",
4
- "icons": [
5
- {
6
- "src": "favicon.ico",
7
- "sizes": "64x64 32x32 24x24 16x16",
8
- "type": "image/x-icon"
9
- }
10
- ],
11
- "start_url": ".",
12
- "display": "standalone",
13
- "theme_color": "#000000",
14
- "background_color": "#ffffff"
15
- }
package/public/robots.txt DELETED
@@ -1,3 +0,0 @@
1
- # https://www.robotstxt.org/robotstxt.html
2
- User-agent: *
3
- Disallow:
@@ -1,7 +0,0 @@
1
- import { Meta } from "@storybook/addon-docs";
2
-
3
- <Meta title="Introduction" />
4
-
5
- # Veritone CE Design System
6
-
7
- The Veritone CE Design System is a collection of common components that are intended to be shared across applications.
@@ -1,345 +0,0 @@
1
- import { createTheme, ThemeOptions as MuiThemeOptions } from '@mui/material'
2
- import '@fontsource/nunito-sans'
3
- import '@fontsource/dosis'
4
- import sx from '@mui/system/sx'
5
- import { CSSProperties } from '@mui/styled-engine'
6
- import CheckCircleIcon from '@mui/icons-material/CheckCircle'
7
- import InfoIcon from '@mui/icons-material/Info'
8
- import WarningIcon from '@mui/icons-material/Error'
9
- import ErrorIcon from '@mui/icons-material/Cancel'
10
-
11
- declare module '@mui/material/Button' {
12
- interface ButtonPropsVariantOverrides {
13
- secondary: true
14
- }
15
- }
16
-
17
- declare module '@mui/material/styles/createPalette' {
18
- type ButtonPaletteColorOptions = SimplePaletteColorOptions & {
19
- hover: string
20
- }
21
-
22
- interface Palette {
23
- button: ButtonPaletteColorOptions
24
- neutral: Palette['primary']
25
- }
26
-
27
- interface PaletteOptions {
28
- button?: ButtonPaletteColorOptions
29
- neutral?: PaletteColorOptions
30
- }
31
-
32
- // allow configuration using `createTheme`
33
- interface ThemeOptions extends MuiThemeOptions {
34
- pallete?: {
35
- button?: ButtonPaletteColorOptions
36
- neutral?: PaletteColorOptions
37
- }
38
- }
39
- }
40
-
41
- // create theme in steps https://mui.com/material-ui/customization/theming/#api
42
- let theme = createTheme({
43
- typography: {
44
- fontFamily: ['Nunito Sans', 'Helvetica', 'sans-serif'].join(','),
45
- h2: {
46
- fontSize: '1.429rem',
47
- lineHeight: '2.143rem',
48
- fontWeight: '700',
49
- },
50
- },
51
- palette: {
52
- primary: {
53
- main: '#214167',
54
- },
55
- secondary: {
56
- main: '#335B89',
57
- contrastText: '#ffffff',
58
- },
59
- neutral: {
60
- main: '#5C6269',
61
- },
62
- button: {
63
- main: '#1871E8',
64
- hover: '#335B89',
65
- },
66
- success: {
67
- main: '#28BA3F',
68
- },
69
- info: {
70
- main: '#325491',
71
- },
72
- warning: {
73
- main: '#FFBB0A',
74
- },
75
- error: {
76
- main: '#D43060',
77
- },
78
- divider: '#214167',
79
- },
80
- spacing: 10,
81
- })
82
-
83
- theme = createTheme(theme, {
84
- components: {
85
- MuiButton: {
86
- defaultProps: {
87
- variant: 'contained',
88
- disableRipple: true,
89
- },
90
- styleOverrides: {
91
- // @ts-ignore
92
- root: ({ ownerState }) => ({
93
- textTransform: 'none',
94
- '&.Mui-disabled': {
95
- borderColor: `#E0E8F0`,
96
- },
97
- '&.Mui-disabled .MuiButton-startIcon': {
98
- opacity: 0.3,
99
- },
100
- ...(ownerState.variant === `contained` &&
101
- ({
102
- fontWeight: '600',
103
- backgroundColor: theme.palette.button.main,
104
- ':hover': {
105
- backgroundColor: theme.palette.button.hover,
106
- },
107
- } as CSSProperties)),
108
- ...(ownerState.variant === `text` &&
109
- ({
110
- fontWeight: '600',
111
- color: theme.palette.button.main,
112
- ':hover': {
113
- color: theme.palette.button.hover,
114
- },
115
- '.MuiButton-startIcon': {
116
- color: `#555F7C`,
117
- marginRight: theme.spacing(2),
118
- },
119
- } as CSSProperties)),
120
- }),
121
- },
122
- variants: [
123
- {
124
- props: {
125
- variant: 'secondary',
126
- },
127
- style: sx({
128
- backgroundColor: 'white',
129
- color: theme.palette.neutral.main,
130
- border: `1px solid ${theme.palette.neutral.main}`,
131
- ':hover': {
132
- border: `1px solid ${theme.palette.primary.main}`,
133
- color: theme.palette.primary.main,
134
- backgroundColor: 'white',
135
- },
136
- }),
137
- },
138
- ],
139
- },
140
- MuiInputLabel: {
141
- styleOverrides: {
142
- root: sx({
143
- color: `#5C6269`,
144
- fontSize: `14px`,
145
- lineHeight: `21px`,
146
- fontWeight: `600`,
147
- }),
148
- },
149
- },
150
- MuiFormHelperText: {
151
- styleOverrides: {
152
- root: sx({
153
- position: 'relative',
154
- marginLeft: 0,
155
- '&.Mui-error': {
156
- paddingLeft: `17px`,
157
- '&::before': {
158
- content: `""`,
159
- height: `12px`,
160
- width: '12px',
161
- position: 'absolute',
162
- left: 0,
163
- top: `50%`,
164
- transform: `translate(0, -50%)`,
165
- backgroundColor: theme.palette.error.main,
166
- borderRadius: `100%`,
167
- },
168
- },
169
- }),
170
- },
171
- },
172
- MuiTextField: {
173
- defaultProps: {
174
- size: 'small',
175
- },
176
- styleOverrides: {
177
- root: sx({
178
- color: `#2A323C`,
179
- '& .MuiOutlinedInput-root': {
180
- '& fieldset': {
181
- borderColor: `#E0E8F0`,
182
- },
183
- '&:hover fieldset': {
184
- borderColor: `#335B89`,
185
- },
186
- '&.Mui-focused fieldset': {
187
- border: `1px solid #5C6269`,
188
- },
189
- '&.Mui-error fieldset': {
190
- borderColor: theme.palette.error.main,
191
- },
192
- },
193
- }),
194
- },
195
- },
196
- MuiStepIcon: {
197
- styleOverrides: {
198
- root: {
199
- borderRadius: `100%`,
200
- outline: `1px solid #465364`,
201
- color: `white`,
202
- text: {
203
- fill: `#465364`,
204
- },
205
- '&.Mui-active': {
206
- outline: `none`,
207
- color: theme.palette.button.main,
208
- text: {
209
- fill: `white`,
210
- },
211
- },
212
- },
213
- },
214
- },
215
- MuiDialogTitle: {
216
- styleOverrides: {
217
- root: {
218
- fontSize: `24px`,
219
- lineHeight: `34px`,
220
- paddingTop: theme.spacing(3),
221
- paddingLeft: theme.spacing(3),
222
- paddingRight: theme.spacing(3),
223
- paddingBottom: theme.spacing(1),
224
- },
225
- },
226
- },
227
- MuiDialogContent: {
228
- styleOverrides: {
229
- root: {
230
- paddingTop: 0,
231
- paddingLeft: theme.spacing(3),
232
- paddingRight: theme.spacing(3),
233
- paddingBottom: theme.spacing(1),
234
- },
235
- },
236
- },
237
- MuiDialogActions: {
238
- styleOverrides: {
239
- root: {
240
- padding: theme.spacing(3),
241
- },
242
- },
243
- },
244
- MuiLink: {
245
- defaultProps: {
246
- underline: `none`,
247
- color: `#1871E8`,
248
- },
249
- },
250
- MuiSnackbar: {
251
- defaultProps: {
252
- autoHideDuration: 6000,
253
- anchorOrigin: {
254
- vertical: `top`,
255
- horizontal: `right`,
256
- },
257
- },
258
- styleOverrides: {
259
- root: {
260
- width: `100%`,
261
- maxWidth: `415px`,
262
- position: `absolute`,
263
- },
264
- },
265
- },
266
- MuiAlert: {
267
- defaultProps: {
268
- variant: `outlined`,
269
- iconMapping: {
270
- success: <CheckCircleIcon />,
271
- info: <InfoIcon />,
272
- warning: <WarningIcon />,
273
- error: <ErrorIcon />,
274
- },
275
- },
276
- styleOverrides: {
277
- root: {
278
- width: `100%`,
279
- backgroundColor: `white`,
280
- borderColor: `#D5DFE9`,
281
- position: `relative`,
282
- overflow: `hidden`,
283
- '&:after': {
284
- content: '""',
285
- position: `absolute`,
286
- width: `4px`,
287
- left: 0,
288
- top: 0,
289
- bottom: 0,
290
- },
291
- '&.MuiAlert-outlinedSuccess:after': {
292
- backgroundColor: theme.palette.success.main,
293
- },
294
- '&.MuiAlert-outlinedInfo:after': {
295
- backgroundColor: theme.palette.info.main,
296
- },
297
- '&.MuiAlert-outlinedWarning:after': {
298
- backgroundColor: theme.palette.warning.main,
299
- },
300
- '&.MuiAlert-outlinedError:after': {
301
- backgroundColor: theme.palette.error.main,
302
- },
303
- '& .MuiAlert-icon': {
304
- opacity: 1,
305
- fontSize: 20,
306
- },
307
- '& .MuiAlert-message': {
308
- fontSize: `12px`,
309
- lineHeight: `22px`,
310
- color: `black`,
311
- },
312
- },
313
- },
314
- },
315
- MuiCircularProgress: {
316
- styleOverrides: {
317
- root: {
318
- color: theme.palette.button.main,
319
- },
320
- },
321
- },
322
- MuiCardContent: {
323
- styleOverrides: {
324
- root: {
325
- padding: theme.spacing(2),
326
- paddingTop: theme.spacing(1),
327
- },
328
- },
329
- },
330
- MuiDataGrid: {
331
- styleOverrides: {
332
- root: {
333
- '& .MuiDataGrid-columnHeader:focus': {
334
- outline: 0,
335
- },
336
- '& .MuiDataGrid-cell:focus': {
337
- outline: 0,
338
- },
339
- },
340
- },
341
- },
342
- },
343
- })
344
-
345
- export default theme
@@ -1,56 +0,0 @@
1
- import { ComponentMeta, ComponentStory } from '@storybook/react'
2
- import Button from './'
3
- // import { userEvent, within } from '@storybook/testing-library'
4
- // import { expect } from '@storybook/jest'
5
-
6
- export default {
7
- title: 'Components/Button',
8
- component: Button,
9
- argType: {
10
- variant: `contained`,
11
- },
12
- parameters: {
13
- componentSubtitle: 'Clickable Button with many variations',
14
- controls: {
15
- exclude: [
16
- 'variant',
17
- 'classes',
18
- ]
19
- }
20
- },
21
- } as ComponentMeta<typeof Button>
22
-
23
- const Template: ComponentStory<typeof Button> = (args) => <Button {...args}>Text</Button>
24
-
25
- export const Primary = Template.bind({})
26
-
27
- export const Secondary = Template.bind({})
28
- Secondary.args = {
29
- variant: 'secondary',
30
- }
31
-
32
- export const Processing = Template.bind({})
33
- Processing.args = {
34
- isProcessing: true,
35
- }
36
-
37
- /*
38
- * New story using the play function.
39
- * See https://storybook.js.org/docs/react/writing-stories/play-function
40
- * to learn more about the play function.
41
- */
42
- // export const WithInteractions = (args) => <Button {...args} />;
43
- // export const WithInteractions = Template.bind({})
44
- // WithInteractions.args = {
45
- // href: 'http://storybook.js.org',
46
- // }
47
-
48
- // WithInteractions.play = async ({ canvasElement }) => {
49
- // // Assigns canvas to the component root element
50
- // const canvas = within(canvasElement)
51
- // await userEvent.click(canvas.getByRole('link'))
52
- // expect(canvas.getByRole('link')).toHaveAttribute(
53
- // 'href',
54
- // 'http://storybook.js.org',
55
- // )
56
- // }
@@ -1,53 +0,0 @@
1
-
2
- import { Button as MuiButton, ButtonProps as MuiButtonProps, CircularProgress, Box } from '@mui/material'
3
-
4
- export type ButtonProps = {
5
- /**
6
- Use the isProcessing prop to indicate to the user that an action is in process. This will disable the button.
7
- */
8
- isProcessing?: boolean
9
- } & MuiButtonProps
10
-
11
- /**
12
- - Use a button for common user click actions. Several variations available.
13
- **/
14
- const Button = ({
15
- children,
16
- isProcessing = false,
17
- ...props
18
- }: ButtonProps) => {
19
- const processingIndicator = (
20
- <Box
21
- sx={{
22
- position: `absolute`,
23
- top: 0,
24
- left: 0,
25
- right: 0,
26
- bottom: 0,
27
- display: `grid`,
28
- justifyItems: `center`,
29
- alignItems: `center`,
30
- }}
31
- >
32
- <CircularProgress size={20}></CircularProgress>
33
- </Box>
34
- )
35
-
36
- const indicator = isProcessing ? processingIndicator : null
37
-
38
- return (
39
- <Box
40
- sx={{
41
- display: `inline-flex`,
42
- position: `relative`,
43
- }}
44
- >
45
- <MuiButton {...props} disabled={isProcessing || props.disabled}>
46
- {children}
47
- </MuiButton>
48
- {indicator}
49
- </Box>
50
- )
51
- }
52
-
53
- export default Button
@@ -1,12 +0,0 @@
1
- import { ThemeProvider as MuiThemeProvider, ThemeProviderProps } from '@mui/system'
2
- import theme from '../../assets/theme'
3
-
4
- const ThemeProvider = ({
5
- children,
6
- }: ThemeProviderProps) => {
7
- return (
8
- <MuiThemeProvider theme={theme}>{children}</MuiThemeProvider>
9
- )
10
- }
11
-
12
- export default ThemeProvider
package/src/index.tsx DELETED
@@ -1,2 +0,0 @@
1
- export * from './components/Button'
2
- export * from './components/ThemeProvider'
@@ -1 +0,0 @@
1
- /// <reference types="react-scripts" />
@@ -1,15 +0,0 @@
1
- import { ReportHandler } from 'web-vitals';
2
-
3
- const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
- if (onPerfEntry && onPerfEntry instanceof Function) {
5
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
- getCLS(onPerfEntry);
7
- getFID(onPerfEntry);
8
- getFCP(onPerfEntry);
9
- getLCP(onPerfEntry);
10
- getTTFB(onPerfEntry);
11
- });
12
- }
13
- };
14
-
15
- export default reportWebVitals;
package/src/setupTests.ts DELETED
@@ -1,5 +0,0 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom';
package/tsconfig.json DELETED
@@ -1,42 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": [
5
- "dom",
6
- "dom.iterable",
7
- "esnext"
8
- ],
9
- "allowJs": true,
10
- "skipLibCheck": true,
11
- "esModuleInterop": true,
12
- "allowSyntheticDefaultImports": true,
13
- "strict": true,
14
- "forceConsistentCasingInFileNames": true,
15
- "noFallthroughCasesInSwitch": true,
16
- "module": "esnext",
17
- "moduleResolution": "node",
18
- "resolveJsonModule": true,
19
- "isolatedModules": true,
20
- "declaration": true,
21
- "jsx": "react-jsx",
22
- "rootDir": "./src",
23
- "outDir": "./dist",
24
- "sourceMap": true,
25
- },
26
- "include": [
27
- "src/index.tsx"
28
- ],
29
- "exclude": [
30
- "node_modules"
31
- ]
32
- }
33
- // {
34
- // "compilerOptions": {
35
- // "outDir": "./dist/",
36
- // "sourceMap": true,
37
- // "noImplicitAny": true,
38
- // "module": "commonjs",
39
- // "target": "es2015",
40
- // "jsx": "react"
41
- // }
42
- // }