From b6201ebc34ff7cadb81c4d5957db538172babf4e Mon Sep 17 00:00:00 2001 From: Rodrigo Antinarelli Date: Thu, 2 Apr 2020 15:52:41 -0300 Subject: [PATCH] feat: ui-v2 Color System Naming --- platform/ui/src/components/Button/Button.jsx | 25 +++--- .../components/ButtonGroup/ButtonGroup.jsx | 8 +- .../ui/src/components/DateRange/DateRange.css | 12 +-- .../ui/src/components/DateRange/DateRange.jsx | 12 +-- .../components/EmptyStudies/EmptyStudies.js | 2 +- platform/ui/src/components/Icon/icon.mdx | 6 +- .../src/components/IconButton/IconButton.jsx | 20 ++--- .../InputLabelWrapper/InputLabelWrapper.jsx | 4 +- .../ui/src/components/InputText/InputText.jsx | 4 +- platform/ui/src/components/NavBar/NavBar.jsx | 2 +- platform/ui/src/components/Select/Select.css | 4 +- .../ui/src/components/TableCell/TableCell.jsx | 2 +- .../ui/src/components/TableHead/TableHead.jsx | 8 +- .../src/components/Typography/Typography.jsx | 4 +- .../ui/src/gatsby-theme-docz/tailwind.css | 4 +- platform/ui/src/gatsby-theme-docz/theme.css | 4 + .../ui/src/views/Colors/BackgroundColor.jsx | 24 ++++++ platform/ui/src/views/Colors/Colors.mdx | 84 +++++++++++++++++++ .../src/views/StudyList/components/Header.js | 4 +- .../StudyList/components/StudyListFilter.js | 39 ++++----- .../components/StudyListPagination.js | 12 +-- .../StudyList/components/StudyListTable.js | 22 ++--- platform/ui/tailwind.config.js | 67 ++++++++++----- 23 files changed, 254 insertions(+), 119 deletions(-) create mode 100644 platform/ui/src/views/Colors/BackgroundColor.jsx create mode 100644 platform/ui/src/views/Colors/Colors.mdx diff --git a/platform/ui/src/components/Button/Button.jsx b/platform/ui/src/components/Button/Button.jsx index a3f656f4f..314ca1b9a 100644 --- a/platform/ui/src/components/Button/Button.jsx +++ b/platform/ui/src/components/Button/Button.jsx @@ -30,31 +30,31 @@ const disabledClasses = { const variantClasses = { text: { default: - 'text-custom-aquaBright hover:bg-custom-aquaBright hover:text-white active:opacity-80 focus:bg-custom-aquaBright focus:text-white', + 'text-primary-light hover:bg-primary-light hover:text-white active:opacity-80 focus:bg-primary-light focus:text-white', primary: - 'text-custom-blue hover:bg-custom-blue hover:text-white active:opacity-80 focus:bg-custom-blue focus:text-white', + 'text-primary-main hover:bg-primary-main hover:text-white active:opacity-80 focus:bg-primary-main focus:text-white', secondary: - 'text-custom-violetPale hover:bg-custom-violetPale hover:text-white active:opacity-80 focus:bg-custom-violetPale focus:text-white', + 'text-secondary-light hover:bg-secondary-light hover:text-white active:opacity-80 focus:bg-secondary-light focus:text-white', white: 'text-white hover:bg-white hover:text-black active:opacity-80 focus:bg-white focus:text-black', }, outlined: { default: - 'border bg-trasparent border-custom-aquaBright text-custom-aquaBright hover:bg-custom-aquaBright hover:text-black focus:text-black focus:bg-custom-aquaBright active:opacity-80', + 'border bg-trasparent border-primary-light text-primary-light hover:bg-primary-light hover:text-black focus:text-black focus:bg-primary-light active:opacity-80', primary: - 'border bg-transparent border-custom-blue text-custom-blue hover:opacity-80 active:opacity-100 focus:opacity-80', + 'border bg-transparent border-primary-main text-primary-main hover:opacity-80 active:opacity-100 focus:opacity-80', secondary: - 'border bg-transparent border-custom-violetPale text-custom-violetPale hover:opacity-80 active:opacity-100 focus:opacity-80', + 'border bg-transparent border-secondary-light text-secondary-light hover:opacity-80 active:opacity-100 focus:opacity-80', white: 'border bg-transparent border-white text-white hover:opacity-80 active:opacity-100 focus:opacity-80', }, contained: { default: - 'bg-custom-aquaBright text-black hover:opacity-80 active:opacity-100 focus:opacity-80', + 'bg-primary-light text-black hover:opacity-80 active:opacity-100 focus:opacity-80', primary: - 'bg-custom-blue text-white hover:opacity-80 active:opacity-100 focus:opacity-80', + 'bg-primary-main text-white hover:opacity-80 active:opacity-100 focus:opacity-80', secondary: - 'bg-custom-violetPale text-white hover:opacity-80 active:opacity-100 focus:opacity-80', + 'bg-secondary-light text-white hover:opacity-80 active:opacity-100 focus:opacity-80', white: 'bg-white text-black hover:opacity-80 active:opacity-100 focus:opacity-80', }, @@ -92,7 +92,12 @@ const Button = ({
{startIconProp}
); - const endIcon = endIconProp &&
{endIconProp}
; + const handleOnClick = e => { + buttonElement.current.blur(); + if (rest.onClick) { + rest.onClick(e); + } + }; return ( @@ -165,7 +162,7 @@ const StudyListFilter = ({ filtersMeta, filtersValues, numOfStudies }) => { rounded="full" variant="outlined" color="primary" - className="text-custom-blueBright border-custom-blueBright mx-8" + className="text-primary-active border-primary-active mx-8" startIcon={} onClick={clearFilters} > @@ -177,7 +174,7 @@ const StudyListFilter = ({ filtersMeta, filtersValues, numOfStudies }) => { Studies @@ -187,10 +184,10 @@ const StudyListFilter = ({ filtersMeta, filtersValues, numOfStudies }) => {
-
+
- {filtersMeta.map(filterMeta => { + {filtersMeta.map((filterMeta) => { return (
{
{numOfStudies > 100 && (
-
+

Filter list to 100 studies or less to enable sorting

diff --git a/platform/ui/src/views/StudyList/components/StudyListPagination.js b/platform/ui/src/views/StudyList/components/StudyListPagination.js index 6cc4b8980..940ac1081 100644 --- a/platform/ui/src/views/StudyList/components/StudyListPagination.js +++ b/platform/ui/src/views/StudyList/components/StudyListPagination.js @@ -7,10 +7,10 @@ import { Icon, } from '../../../components/'; -const StudyListPagination = props => { +const StudyListPagination = (props) => { const [currentPage, setCurrentPage] = useState(1); - const navigateToPage = page => { + const navigateToPage = (page) => { const toPage = page < 1 ? 1 : page; setCurrentPage(toPage); }; @@ -23,7 +23,7 @@ const StudyListPagination = props => {