@veritone-ce/design-system 1.12.5 → 1.12.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,8 @@
1
+ import { ComponentStory, Story, ComponentMeta } from '@storybook/react';
2
+ import UtilityRail from '.';
3
+ declare const _default: ComponentMeta<({ items, ...props }: {
4
+ items: import(".").Item[];
5
+ 'data-testid'?: string | undefined;
6
+ }) => JSX.Element>;
7
+ export default _default;
8
+ export declare const Default: ComponentStory<typeof UtilityRail> | Story;
@@ -0,0 +1,22 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import { mock } from './mock';
14
+ import UtilityRail from '.';
15
+ export default {
16
+ title: 'Components/UtilityRail',
17
+ component: UtilityRail
18
+ };
19
+ export const Default = (_a) => {
20
+ var args = __rest(_a, []);
21
+ return _jsx(UtilityRail, Object.assign({ items: mock }, args));
22
+ };
@@ -0,0 +1,27 @@
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 UtilityRail from '..';
5
+ import { mock } from '../mock';
6
+ describe('<UtilityRail />', () => {
7
+ it('should render the UtilityRail component', () => {
8
+ render(_jsx(UtilityRail, { items: mock }));
9
+ expect(screen.getByText('UtilityRail')).toBeInTheDocument();
10
+ });
11
+ it('should render a specific amount of items', () => {
12
+ render(_jsx(UtilityRail, { "data-testid": "utility-rail", items: [
13
+ {
14
+ title: 'Title item 1',
15
+ subtitle: 'Subtitle item 1',
16
+ description: 'Description item 1'
17
+ },
18
+ {
19
+ title: 'Title item 2',
20
+ subtitle: 'Subtitle item 2',
21
+ description: 'Description item 2'
22
+ }
23
+ ] }));
24
+ const utilityRail = screen.getByTestId('utility-rail');
25
+ expect(utilityRail.childElementCount).toHaveLength(2);
26
+ });
27
+ });
@@ -0,0 +1,11 @@
1
+ export type Item = {
2
+ title: string;
3
+ subtitle: string;
4
+ description: string;
5
+ };
6
+ type UtilityRailProps = {
7
+ items: Item[];
8
+ 'data-testid'?: string;
9
+ };
10
+ declare const UtilityRail: ({ items, ...props }: UtilityRailProps) => JSX.Element;
11
+ export default UtilityRail;
@@ -0,0 +1,54 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { useTheme } from '@mui/material/styles';
14
+ import { Typography, Box } from '@mui/material';
15
+ const UtilityRail = (_a) => {
16
+ var { items } = _a, props = __rest(_a, ["items"]);
17
+ const { palette } = useTheme();
18
+ return (_jsx(Box, Object.assign({}, props, { sx: {
19
+ 'div:last-of-type': {
20
+ borderLeft: `0.125rem transparent solid`
21
+ }
22
+ } }, { children: items.map((item, index) => (_jsx(Box, Object.assign({ "data-testid": `item-${index}`, sx: {
23
+ '&::before': {
24
+ content: '""',
25
+ display: 'block',
26
+ height: '0.625rem',
27
+ width: '0.625rem',
28
+ marginLeft: '-0.5rem',
29
+ borderRadius: '50%',
30
+ border: `0.125rem ${palette.secondary.main} solid`,
31
+ backgroundColor: `${palette.common.white}`
32
+ },
33
+ borderLeft: `0.125rem ${palette.secondary.main} solid`,
34
+ display: 'flex'
35
+ } }, { children: _jsxs(Box, Object.assign({ sx: {
36
+ padding: '0 1.25rem 1.25rem'
37
+ } }, { children: [_jsx(Typography, Object.assign({ sx: {
38
+ fontSize: '0.625rem',
39
+ fontWeight: 400,
40
+ lineHeight: '1rem',
41
+ color: palette.text.secondary
42
+ } }, { children: item.subtitle })), _jsx(Typography, Object.assign({ sx: {
43
+ fontSize: '0.75rem',
44
+ fontWeight: 400,
45
+ lineHeight: '1rem',
46
+ color: palette.text.primary
47
+ } }, { children: item.title })), _jsx(Typography, Object.assign({ sx: {
48
+ fontSize: '0.625rem',
49
+ fontWeight: 400,
50
+ lineHeight: '1rem',
51
+ color: palette.text.secondary
52
+ } }, { children: item.description }))] })) }), index))) })));
53
+ };
54
+ export default UtilityRail;
@@ -0,0 +1,2 @@
1
+ import { Item } from '.';
2
+ export declare const mock: Item[];
@@ -0,0 +1,32 @@
1
+ export const mock = [
2
+ {
3
+ title: 'Variant Exported by user567',
4
+ subtitle: '1.2.21_01:10:00',
5
+ description: 'Language: Spanish • Voice: Anna'
6
+ },
7
+ {
8
+ title: 'Variant Exported by user567',
9
+ subtitle: '1.2.21_01:10:00',
10
+ description: 'Language: Spanish • Voice: Anna'
11
+ },
12
+ {
13
+ title: 'Variant Exported by user567',
14
+ subtitle: '1.2.21_01:10:00',
15
+ description: 'Language: Spanish • Voice: Anna'
16
+ },
17
+ {
18
+ title: 'Variant Exported by user567',
19
+ subtitle: '1.2.21_01:10:00',
20
+ description: 'Language: Spanish • Voice: Anna'
21
+ },
22
+ {
23
+ title: 'Variant Exported by user567',
24
+ subtitle: '1.2.21_01:10:00',
25
+ description: 'Language: Spanish • Voice: Anna'
26
+ },
27
+ {
28
+ title: 'Variant Exported by user567',
29
+ subtitle: '1.2.21_01:10:00',
30
+ description: 'Language: Spanish • Voice: Anna'
31
+ }
32
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritone-ce/design-system",
3
- "version": "1.12.5",
3
+ "version": "1.12.6",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "start": "yarn storybook",
@@ -14,7 +14,7 @@
14
14
  "build-storybook": "build-storybook -s public",
15
15
  "test-storybook": "test-storybook",
16
16
  "build-storybook-docs": "build-storybook --docs",
17
- "prepare": "install-peers",
17
+ "prepare": "install-peers && husky install",
18
18
  "commit": "cz",
19
19
  "typecheck": "tsc --noEmit",
20
20
  "chromatic": "npx chromatic --project-token=2d24b3ec5211 --exit-zero-on-changes"
@@ -46,7 +46,6 @@
46
46
  "@types/node": "^16.7.13",
47
47
  "axios": "^1.2.1",
48
48
  "cz-conventional-changelog": "^3.3.0",
49
- "husky": "^8.0.2",
50
49
  "react": "^18.2.0",
51
50
  "react-dom": "^18.2.0",
52
51
  "react-dropzone": "^14.2.3",
@@ -87,7 +86,7 @@
87
86
  "eslint-config-prettier": "^8.5.0",
88
87
  "eslint-plugin-prettier": "^4.2.1",
89
88
  "eslint-plugin-react-hooks": "^4.6.0",
90
- "husky": "^8.0.2",
89
+ "husky": "8.0.2",
91
90
  "install-peers-cli": "^2.2.0",
92
91
  "jest": "^29.3.1",
93
92
  "jest-environment-jsdom": "^29.3.1",