diff --git a/platform/ui/index.js b/platform/ui/index.js
index 78dc23ea6..02defd329 100644
--- a/platform/ui/index.js
+++ b/platform/ui/index.js
@@ -1,23 +1,7 @@
import * as utils from './src/utils/';
-import {
- ModalProvider,
- ModalConsumer,
- useModal,
- withModal,
-} from './src/contextProviders';
+export * from './src/components';
+
+export { utils };
-export {
- Button,
- ButtonGroup,
- DateRange,
- Icon,
- IconButton,
- Input,
- NavBar,
- Select,
- Svg,
- ThemeWrapper,
- Typography,
-} from './src/components';
export { StudyList } from './src/views';
export { ModalProvider, ModalConsumer, useModal, withModal, utils };
diff --git a/platform/ui/src/components/Table/Table.jsx b/platform/ui/src/components/Table/Table.jsx
new file mode 100644
index 000000000..86029dbf4
--- /dev/null
+++ b/platform/ui/src/components/Table/Table.jsx
@@ -0,0 +1,35 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import classnames from 'classnames';
+
+const Table = ({ children, className, fullWidth, style }) => {
+ return (
+
+ {children}
+
+ );
+};
+
+Table.defaultProps = {
+ className: '',
+ fullWidth: true,
+ style: {},
+};
+
+Table.propTypes = {
+ fullWidth: PropTypes.bool,
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ style: PropTypes.object,
+};
+
+export default Table;
diff --git a/platform/ui/src/components/Table/Table.mdx b/platform/ui/src/components/Table/Table.mdx
new file mode 100644
index 000000000..9ee423a45
--- /dev/null
+++ b/platform/ui/src/components/Table/Table.mdx
@@ -0,0 +1,63 @@
+---
+name: Table
+menu: Components
+route: components/table
+---
+
+import { Playground, Props, Link } from 'docz';
+import { Table, TableHead, TableBody, TableRow, TableCell } from '@ohif/ui';
+
+# Table
+
+Tables display sets of data.
+
+## Import
+
+```javascript
+import { Table } from '@ohfi/ui';
+```
+
+## Basic usage
+
+
+
+
+
+
+ Item 01
+ Item 02
+ Item 03
+ Item 04
+
+
+
+
+ Content 01
+ Content 02
+ Content 03
+ Content 04
+
+
+
+
+
+
+## Table width
+
+Table has full width by default. If you want to change its width, you will have
+to set the `fullWidth` prop to `false` and then define your own table width by
+passing a `className` or by `style`.
+
+## Table components
+
+ TableHead
+
+ TableBody
+
+ TableRow
+
+ TableCell
+
+## Properties
+
+
diff --git a/platform/ui/src/components/Table/index.js b/platform/ui/src/components/Table/index.js
new file mode 100644
index 000000000..ad6fbcbd7
--- /dev/null
+++ b/platform/ui/src/components/Table/index.js
@@ -0,0 +1,2 @@
+import Table from './Table';
+export default Table;
diff --git a/platform/ui/src/components/TableBody/TableBody.jsx b/platform/ui/src/components/TableBody/TableBody.jsx
new file mode 100644
index 000000000..d3e6d6357
--- /dev/null
+++ b/platform/ui/src/components/TableBody/TableBody.jsx
@@ -0,0 +1,32 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import classnames from 'classnames';
+
+const TableBody = ({ children, className, style }) => {
+ return (
+
+ {React.Children.map(children, child =>
+ React.cloneElement(child, { isTableHead: false })
+ )}
+
+ );
+};
+
+TableBody.defaultProps = {
+ className: '',
+ style: {},
+};
+
+TableBody.propTypes = {
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ style: PropTypes.object,
+};
+
+export default TableBody;
diff --git a/platform/ui/src/components/TableBody/index.js b/platform/ui/src/components/TableBody/index.js
new file mode 100644
index 000000000..debbe4eaf
--- /dev/null
+++ b/platform/ui/src/components/TableBody/index.js
@@ -0,0 +1,2 @@
+import TableBody from './TableBody';
+export default TableBody;
diff --git a/platform/ui/src/components/TableCell/TableCell.jsx b/platform/ui/src/components/TableCell/TableCell.jsx
new file mode 100644
index 000000000..30982abf3
--- /dev/null
+++ b/platform/ui/src/components/TableCell/TableCell.jsx
@@ -0,0 +1,43 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import classnames from 'classnames';
+
+const TableCell = ({ children, className, isTableHead, size, style }) => {
+ const sizeClasses = {
+ small: 'flex-0.3',
+ normal: 'flex-1',
+ };
+
+ return (
+
+ {children}
+
+ );
+};
+
+TableCell.defaultProps = {
+ className: '',
+ isTableHead: false,
+ size: 'normal',
+ style: {},
+};
+
+TableCell.propTypes = {
+ isTableHead: PropTypes.bool,
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ size: PropTypes.oneOf(['small', 'normal']),
+ style: PropTypes.object,
+};
+
+export default TableCell;
diff --git a/platform/ui/src/components/TableCell/index.js b/platform/ui/src/components/TableCell/index.js
new file mode 100644
index 000000000..a6381757e
--- /dev/null
+++ b/platform/ui/src/components/TableCell/index.js
@@ -0,0 +1,2 @@
+import TableCell from './TableCell';
+export default TableCell;
diff --git a/platform/ui/src/components/TableHead/TableHead.jsx b/platform/ui/src/components/TableHead/TableHead.jsx
new file mode 100644
index 000000000..42fcb8e43
--- /dev/null
+++ b/platform/ui/src/components/TableHead/TableHead.jsx
@@ -0,0 +1,32 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import classnames from 'classnames';
+
+const TableHead = ({ children, className, style }) => {
+ return (
+
+ {React.cloneElement(children, {
+ isTableHead: true,
+ })}
+
+ );
+};
+
+TableHead.defaultProps = {
+ className: '',
+ style: {},
+};
+
+TableHead.propTypes = {
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ style: PropTypes.object,
+};
+
+export default TableHead;
diff --git a/platform/ui/src/components/TableHead/index.js b/platform/ui/src/components/TableHead/index.js
new file mode 100644
index 000000000..4befa4c86
--- /dev/null
+++ b/platform/ui/src/components/TableHead/index.js
@@ -0,0 +1,2 @@
+import TableHead from './TableHead';
+export default TableHead;
diff --git a/platform/ui/src/components/TableRow/TableRow.jsx b/platform/ui/src/components/TableRow/TableRow.jsx
new file mode 100644
index 000000000..7a9052e2b
--- /dev/null
+++ b/platform/ui/src/components/TableRow/TableRow.jsx
@@ -0,0 +1,28 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import classnames from 'classnames';
+
+const TableRow = ({ children, className, isTableHead, style }) => {
+ return (
+
+ {React.Children.map(children, child =>
+ React.cloneElement(child, { isTableHead })
+ )}
+
+ );
+};
+
+TableRow.defaultProps = {
+ isTableHead: false,
+ className: '',
+ style: {},
+};
+
+TableRow.propTypes = {
+ isTableHead: PropTypes.bool,
+ children: PropTypes.node.isRequired,
+ className: PropTypes.string,
+ style: PropTypes.object,
+};
+
+export default TableRow;
diff --git a/platform/ui/src/components/TableRow/index.js b/platform/ui/src/components/TableRow/index.js
new file mode 100644
index 000000000..560f3b653
--- /dev/null
+++ b/platform/ui/src/components/TableRow/index.js
@@ -0,0 +1,2 @@
+import TableRow from './TableRow';
+export default TableRow;
diff --git a/platform/ui/src/components/index.js b/platform/ui/src/components/index.js
index 49e011fd7..add5a5313 100644
--- a/platform/ui/src/components/index.js
+++ b/platform/ui/src/components/index.js
@@ -7,6 +7,11 @@ import Input from './Input';
import NavBar from './NavBar';
import Select from './Select';
import Svg from './Svg';
+import Table from './Table';
+import TableBody from './TableBody';
+import TableCell from './TableCell';
+import TableHead from './TableHead';
+import TableRow from './TableRow';
import ThemeWrapper from './ThemeWrapper/';
import Typography from './Typography';
@@ -20,6 +25,11 @@ export {
NavBar,
Select,
Svg,
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableRow,
ThemeWrapper,
Typography,
};
diff --git a/platform/ui/src/gatsby-theme-docz/components/Layout/index.js b/platform/ui/src/gatsby-theme-docz/components/Layout/index.js
index c22eb568a..8495bad79 100644
--- a/platform/ui/src/gatsby-theme-docz/components/Layout/index.js
+++ b/platform/ui/src/gatsby-theme-docz/components/Layout/index.js
@@ -36,6 +36,7 @@ export const Layout = ({ children }) => {
onClick={() => setSidebarOpen(false)}
/>
{
props.onClick()}
- className="fixed z-10 left-0 w-full h-full bg-black opacity-80"
- style={{ top: '81px' }}
+ className="fixed left-0 w-full h-full bg-black opacity-80"
+ style={{ top: 81, zIndex: 99999 }}
/>
diff --git a/platform/ui/src/gatsby-theme-docz/theme.css b/platform/ui/src/gatsby-theme-docz/theme.css
index 853f65234..9a0e034fa 100644
--- a/platform/ui/src/gatsby-theme-docz/theme.css
+++ b/platform/ui/src/gatsby-theme-docz/theme.css
@@ -6,7 +6,11 @@
background: #000;
}
-[data-testid='main-container'] > h2 {
- margin: 20px 0;
- font-weight: bold;
+#main-container > h2 {
+ @apply font-bold my-8 text-2xl;
+}
+
+#main-container > ul li a,
+#main-container > a {
+ @apply underline text-blue-500;
}
diff --git a/platform/ui/src/views/StudyList/components/StudyListTable.js b/platform/ui/src/views/StudyList/components/StudyListTable.js
index e33f91b2f..1c2bf6973 100644
--- a/platform/ui/src/views/StudyList/components/StudyListTable.js
+++ b/platform/ui/src/views/StudyList/components/StudyListTable.js
@@ -3,14 +3,23 @@ import PropTypes from 'prop-types';
import classnames from 'classnames';
import { format } from 'date-fns';
-import { Button, Icon, Typography } from '@ohif/ui';
+import {
+ Button,
+ Icon,
+ Typography,
+ Table,
+ TableHead,
+ TableBody,
+ TableRow,
+ TableCell,
+} from '@ohif/ui';
const getGridColClass = (filtersMeta, name) => {
const filter = filtersMeta.find(filter => filter.name === name);
return (filter && filter.gridCol && `w-${filter.gridCol}/24`) || '';
};
-const TableRow = props => {
+const StudyTableRow = props => {
const {
AccessionNumber,
Modalities,
@@ -30,11 +39,6 @@ const TableRow = props => {
'px-4 py-2 text-base',
{ 'border-b border-custom-violetPale': !isOpened },
];
- const seriesWidthClasses = {
- normal: 'px-2 flex-1',
- small: 'px-2 flex-0.3',
- };
- const seriesBodyClasses = 'border-r border-custom-violetPale';
return (
<>
@@ -176,75 +180,35 @@ const TableRow = props => {
-
-
-
- Description
-
-
- Series
-
-
- Modality
-
-
- Instances
-
-
-
+
+
+
+ Description
+ Series
+ Modality
+ Instances
+
+
+
+
{series.map((seriesItem, i) => (
-
-
-
+
+
{seriesItem.SeriesNumber}
-
-
+
+
{seriesItem.Modality}
-
-
+
+
{seriesItem.instances.length}
-
-
+
+
))}
-
-
+
+
@@ -258,7 +222,7 @@ const TableRow = props => {
);
};
-TableRow.propTypes = {
+StudyTableRow.propTypes = {
AccessionNumber: PropTypes.string.isRequired,
Modalities: PropTypes.string.isRequired,
Instances: PropTypes.number.isRequired,
@@ -275,7 +239,7 @@ const StudyListTable = ({ studies, numOfStudies, filtersMeta }) => {
{studies.map((study, i) => (
-