From 204914702123f661ba6f2ac9d4a238161fffa1fc Mon Sep 17 00:00:00 2001 From: Rodrigo Antinarelli Date: Thu, 12 Mar 2020 13:23:05 -0300 Subject: [PATCH] chore: uiv2 docz custom page (#1511) * feat: Customized Docz Layout * manually apply padding into playground * fix playground bug -- sticky items * fix window * remove specifc tailwind style for docz --- platform/ui/doczrc.js | 4 + platform/ui/package.json | 3 + platform/ui/src/components/Button/Button.mdx | 217 ++++++++++++++---- .../components/ButtonGroup/ButtonGroup.mdx | 8 +- platform/ui/src/components/Icon/icon.mdx | 6 +- platform/ui/src/components/Input/Input.mdx | 2 +- platform/ui/src/components/Label/Label.mdx | 6 +- .../src/components/Typography/Typography.mdx | 58 ++--- .../components/Header/index.js | 69 ++++++ .../components/Layout/index.js | 50 ++++ .../components/Sidebar/index.js | 79 +++++++ platform/ui/src/gatsby-theme-docz/theme.css | 1 - platform/ui/src/views/StudyList/StudyList.mdx | 2 +- platform/ui/tailwind.config.js | 3 + 14 files changed, 426 insertions(+), 82 deletions(-) create mode 100644 platform/ui/doczrc.js create mode 100644 platform/ui/src/gatsby-theme-docz/components/Header/index.js create mode 100644 platform/ui/src/gatsby-theme-docz/components/Layout/index.js create mode 100644 platform/ui/src/gatsby-theme-docz/components/Sidebar/index.js diff --git a/platform/ui/doczrc.js b/platform/ui/doczrc.js new file mode 100644 index 000000000..5c6861900 --- /dev/null +++ b/platform/ui/doczrc.js @@ -0,0 +1,4 @@ +export default { + title: '@ohif/ui', + menu: ['Getting Started', 'Readme', 'Components', 'Views'], +}; diff --git a/platform/ui/package.json b/platform/ui/package.json index 2fabfc281..8cc957d2d 100644 --- a/platform/ui/package.json +++ b/platform/ui/package.json @@ -27,9 +27,12 @@ "dependencies": { "classnames": "^2.2.6", "docz": "^2.2.0", + "theme-ui": "^0.2.38", + "gatsby": "2.19.24", "gatsby-plugin-postcss": "^2.1.20", "gatsby-plugin-react-svg": "^3.0.0", "gatsby-plugin-sass": "^2.1.28", + "gatsby-theme-docz": "^2.2.0", "node-sass": "^4.13.1", "prop-types": "^15.7.2", "react": "^16.11.0", diff --git a/platform/ui/src/components/Button/Button.mdx b/platform/ui/src/components/Button/Button.mdx index 55c1068d9..a9fa90bcd 100644 --- a/platform/ui/src/components/Button/Button.mdx +++ b/platform/ui/src/components/Button/Button.mdx @@ -22,8 +22,8 @@ import { Button } from '@ohfi/ui'; ## Outlined Buttons - <> - - + + ## Outlined Buttons - <> - - + + ## Text Buttons - <> +
@@ -64,13 +70,166 @@ import { Button } from '@ohfi/ui'; - + +
+
+ +## Rounded Buttons + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
## Sizes - <> +
- - +
## Buttons with icons -
+
@@ -167,24 +313,6 @@ import { Button } from '@ohfi/ui'; variant="contained" color="primary" className="m-1" -<<<<<<< HEAD - endIcon={ - - - - } - > - Download - -
- ) - }} - -======= endIcon={} > Download @@ -199,7 +327,6 @@ import { Button } from '@ohfi/ui'; Download
->>>>>>> 98a130b58... feat: Icon component (#1499)
## Icon Buttons @@ -211,7 +338,7 @@ import { IconButton } from '@ohfi/ui'; ``` -
+
@@ -260,7 +387,7 @@ import { IconButton } from '@ohfi/ui'; -
+
diff --git a/platform/ui/src/components/ButtonGroup/ButtonGroup.mdx b/platform/ui/src/components/ButtonGroup/ButtonGroup.mdx index 73934ca85..c54968ef3 100644 --- a/platform/ui/src/components/ButtonGroup/ButtonGroup.mdx +++ b/platform/ui/src/components/ButtonGroup/ButtonGroup.mdx @@ -23,7 +23,7 @@ import { ButtonGroup } from '@ohfi/ui'; ## Basic button group -
+
@@ -45,7 +45,7 @@ import { ButtonGroup } from '@ohfi/ui'; ## Group sizes and colorss -
+
@@ -67,7 +67,7 @@ import { ButtonGroup } from '@ohfi/ui'; ## Group orientation -
+
@@ -99,7 +99,7 @@ import { ButtonGroup } from '@ohfi/ui'; ## Split Button -
+
diff --git a/platform/ui/src/components/Icon/icon.mdx b/platform/ui/src/components/Icon/icon.mdx index de029ba1a..a59554ab8 100644 --- a/platform/ui/src/components/Icon/icon.mdx +++ b/platform/ui/src/components/Icon/icon.mdx @@ -13,12 +13,14 @@ import { ICONS } from './getIcon'; ## Basic usage - +
+ +
## All Icons -
+
{Object.keys(ICONS) .sort() .map((name, i) => { diff --git a/platform/ui/src/components/Input/Input.mdx b/platform/ui/src/components/Input/Input.mdx index 364ad5571..775086001 100644 --- a/platform/ui/src/components/Input/Input.mdx +++ b/platform/ui/src/components/Input/Input.mdx @@ -15,7 +15,7 @@ import Input from './'; {() => { const [inputValue, setInputValue] = React.useState(''); return ( -
+
{() => { - return