From 7a79e42929ccf01d29449f1167e95806ba0bf376 Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Wed, 14 Jul 2021 00:15:02 +0200 Subject: [PATCH] fixes for jsx live blocks --- .../component-library/components/Button.mdx | 687 ++++++++---------- .../components/ButtonGroup.mdx | 140 ++-- .../components/DateRange.mdx | 34 +- .../components/ErrorBoundary.mdx | 8 +- .../components/MeasurementTable.mdx | 56 +- .../component-library/components/Select.mdx | 50 +- .../components/SidePanel.mdx | 94 +-- .../components/ToolbarButton.mdx | 15 +- .../components/Typography.mdx | 64 +- .../components/ViewportActionBar.mdx | 204 +++--- .../ViewportDialogProvider.mdx | 6 +- .../docs/component-library/pages/Colors.mdx | 18 +- 12 files changed, 657 insertions(+), 719 deletions(-) diff --git a/platform/docs/docs/component-library/components/Button.mdx b/platform/docs/docs/component-library/components/Button.mdx index f531ec03f..a0832304f 100644 --- a/platform/docs/docs/component-library/components/Button.mdx +++ b/platform/docs/docs/component-library/components/Button.mdx @@ -18,318 +18,247 @@ import { Button } from '@ohif/ui'; ## Outlined Buttons -````jsx live -
- - - - -
+```jsx live +
+ + + + +
``` ## Contained Buttons ```jsx live -
- - - - -
+
+ + + + +
``` ## Text Buttons ```jsx live -
- - - - -
+
+ + + + +
``` ## Rounded Buttons ```jsx live -
-
- - - - - -
-
- - - - - -
-
- - - - - -
-
- - - - - -
+
+
+ + + + +
+
+ + + + + +
+
+ + + + + +
+
+ + + + + +
+
``` ## Sizes ```jsx live -
-
- - - -
-
- - - -
-
- - - -
-
- - - -
- +
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
``` ## Buttons with icons ```jsx live -
- - - -
+
+ + + +
``` ## Icon Buttons @@ -338,104 +267,104 @@ Icon buttons are generally used in toolbars. ```javascript import { IconButton } from '@ohif/ui'; -```` - -````jsx live -
-
- - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - -
-
``` ```jsx live -
-
- - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - -
-
- - - - - - - - - -
+
+
+ + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+
+``` + +```jsx live +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + + + + +
+
``` ## Properties diff --git a/platform/docs/docs/component-library/components/ButtonGroup.mdx b/platform/docs/docs/component-library/components/ButtonGroup.mdx index 9fac11314..0c239e5f3 100644 --- a/platform/docs/docs/component-library/components/ButtonGroup.mdx +++ b/platform/docs/docs/component-library/components/ButtonGroup.mdx @@ -18,91 +18,91 @@ import { ButtonGroup } from '@ohif/ui'; ## Basic button group -````jsx live -
- - - - - - - - - - - - - - - -
+```jsx live +
+ + + + + + + + + + + + + + + +
``` ## Group sizes and colorss ```jsx live -
- - - - - - - - - - - - - - - -
+
+ + + + + + + + + + + + + + + +
``` ## Group orientation ```jsx live -
- - - - - - - - - - - - - - - -
+
+ + + + + + + + + + + + + + + +
``` ## Split Button ```jsx live -
- - - - - - -
+
+ + + + + + +
``` ## Properties diff --git a/platform/docs/docs/component-library/components/DateRange.mdx b/platform/docs/docs/component-library/components/DateRange.mdx index 832cd9bd8..32fade8e1 100644 --- a/platform/docs/docs/component-library/components/DateRange.mdx +++ b/platform/docs/docs/component-library/components/DateRange.mdx @@ -21,24 +21,22 @@ import { DateRange } from '@ohif/ui'; ## Date Range ```jsx live -{ - () => { - const [dates, setDates] = useState({ - startDate: null, - endDate: null, - }); - return ( -
- - setDates({ startDate, endDate }) - } - /> -
- ); - }; +function() { + const [dates, setDates] = useState({ + startDate: null, + endDate: null, + }); + return ( +
+ + setDates({ startDate, endDate }) + } + /> +
+ ); } ``` diff --git a/platform/docs/docs/component-library/components/ErrorBoundary.mdx b/platform/docs/docs/component-library/components/ErrorBoundary.mdx index 792fe1004..b715a2ea2 100644 --- a/platform/docs/docs/component-library/components/ErrorBoundary.mdx +++ b/platform/docs/docs/component-library/components/ErrorBoundary.mdx @@ -18,10 +18,10 @@ import { ErrorBoundary } from '@ohif/ui'; ## Basic usage -````jsx live +```jsx live
- {() => { + function() { throw new Error('Error!'); return

; }} @@ -32,7 +32,7 @@ import { ErrorBoundary } from '@ohif/ui'; ## Custom error fallback ```jsx live - {() => { + function() { const CustomFallback = ({ error, componentStack, resetErrorBoundary }) => { return (
@@ -43,7 +43,7 @@ import { ErrorBoundary } from '@ohif/ui'; return (
- {() => { + function() { throw new Error('Error!'); return

; }} diff --git a/platform/docs/docs/component-library/components/MeasurementTable.mdx b/platform/docs/docs/component-library/components/MeasurementTable.mdx index 85cc77a79..4b9f66cf0 100644 --- a/platform/docs/docs/component-library/components/MeasurementTable.mdx +++ b/platform/docs/docs/component-library/components/MeasurementTable.mdx @@ -18,39 +18,39 @@ import { MeasurementTable } from '@ohif/ui'; ## Basic usage -````jsx live - {() => { - const [activeMeasurementItem, setActiveMeasurementItem] = useState(null); - const measurementTableData = { - title: 'Measurements', - amount: 10, - data: new Array(10).fill({}).map((el, i) => ({ - id: i + 1, - label: 'Label short description', - displayText: ['24.0 x 24.0 mm (S:4, I:22)'], - isActive: activeMeasurementItem === i + 1, - })), - onClick: id => setActiveMeasurementItem(s => (s === id ? null : id)), - onEdit: id => alert(`Edit: ${id}`), - }; - return ( -
- -
- ); - }} +```jsx live +function() { + const [activeMeasurementItem, setActiveMeasurementItem] = useState(null); + const measurementTableData = { + title: 'Measurements', + amount: 10, + data: new Array(10).fill({}).map((el, i) => ({ + id: i + 1, + label: 'Label short description', + displayText: ['24.0 x 24.0 mm (S:4, I:22)'], + isActive: activeMeasurementItem === i + 1, + })), + onClick: id => setActiveMeasurementItem(s => (s === id ? null : id)), + onEdit: id => alert(`Edit: ${id}`), + }; + return ( +
+ +
+ ); +} ``` ## Empty Data ```jsx live - {() => { - return ( -
- -
- ); - }} +function() { + return ( +
+ +
+ ); +} ``` ## Properties diff --git a/platform/docs/docs/component-library/components/Select.mdx b/platform/docs/docs/component-library/components/Select.mdx index 52843cee5..43fbd618e 100644 --- a/platform/docs/docs/component-library/components/Select.mdx +++ b/platform/docs/docs/component-library/components/Select.mdx @@ -16,37 +16,37 @@ import { Select } from '@ohif/ui'; ## Basic usage -````jsx live -
-
-
+
``` ## Disabled ```jsx live -
-
-
+
``` ## No Options @@ -55,7 +55,7 @@ import { Select } from '@ohif/ui';