From e29d5f365201a025f407528effe91221c71a3530 Mon Sep 17 00:00:00 2001 From: jenny-s51 Date: Mon, 13 Jun 2022 12:01:26 -0400 Subject: [PATCH] convert label demos to TS --- .../src/components/Label/examples/Label.md | 404 +----------------- .../Label/examples/LabelCompact.tsx | 27 ++ .../components/Label/examples/LabelFilled.tsx | 167 ++++++++ .../Label/examples/LabelOutline.tsx | 188 ++++++++ .../Label/examples/LabelRouterLink.tsx | 20 + 5 files changed, 407 insertions(+), 399 deletions(-) create mode 100644 packages/react-core/src/components/Label/examples/LabelCompact.tsx create mode 100644 packages/react-core/src/components/Label/examples/LabelFilled.tsx create mode 100644 packages/react-core/src/components/Label/examples/LabelOutline.tsx create mode 100644 packages/react-core/src/components/Label/examples/LabelRouterLink.tsx diff --git a/packages/react-core/src/components/Label/examples/Label.md b/packages/react-core/src/components/Label/examples/Label.md index 56b2629b50d..d7a310f6e7b 100644 --- a/packages/react-core/src/components/Label/examples/Label.md +++ b/packages/react-core/src/components/Label/examples/Label.md @@ -12,416 +12,22 @@ import { Link } from '@reach/router'; ### Filled -```js -import React from 'react'; -import { Label } from '@patternfly/react-core'; -import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon'; - - - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
; +```ts file="LabelFilled.tsx" ``` ### Outline -```js -import React from 'react'; -import { Label } from '@patternfly/react-core'; -import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon'; - - - {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
-
- {' '} - {' '} - {' '} - {' '} - {' '} - - -
; +```ts file="LabelOutline.tsx" ``` ### Compact -```js -import React from 'react'; -import { Label } from '@patternfly/react-core'; -import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon'; - - - {' '} - {' '} - {' '} - {' '} - {' '} - - -; +```ts file="LabelCompact.tsx" ``` ### Router link -```js -import React from 'react'; -import { Label } from '@patternfly/react-core'; -import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon'; -import { Link } from '@reach/router'; - -; +```ts file="LabelRouterLink.tsx" ``` ### Editable @@ -430,5 +36,5 @@ Click or press either enter or space to begin editing a label. After editing, cl You can also customize any Label's close button aria-label as this example shows with `closeBtnAriaLabel`. -```js file="LabelEditable.tsx" isBeta +```ts file="LabelEditable.tsx" isBeta ``` diff --git a/packages/react-core/src/components/Label/examples/LabelCompact.tsx b/packages/react-core/src/components/Label/examples/LabelCompact.tsx new file mode 100644 index 00000000000..2f77a0644a7 --- /dev/null +++ b/packages/react-core/src/components/Label/examples/LabelCompact.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import { Label } from '@patternfly/react-core'; +import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon'; + +export const LabelCompact: React.FunctionComponent = () => ( + + {' '} + {' '} + {' '} + {' '} + {' '} + + + +); diff --git a/packages/react-core/src/components/Label/examples/LabelFilled.tsx b/packages/react-core/src/components/Label/examples/LabelFilled.tsx new file mode 100644 index 00000000000..a7357001dc2 --- /dev/null +++ b/packages/react-core/src/components/Label/examples/LabelFilled.tsx @@ -0,0 +1,167 @@ +import React from 'react'; +import { Label } from '@patternfly/react-core'; +import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon'; + +export const LabelFilled: React.FunctionComponent = () => ( + + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+); diff --git a/packages/react-core/src/components/Label/examples/LabelOutline.tsx b/packages/react-core/src/components/Label/examples/LabelOutline.tsx new file mode 100644 index 00000000000..0b16390efdc --- /dev/null +++ b/packages/react-core/src/components/Label/examples/LabelOutline.tsx @@ -0,0 +1,188 @@ +import React from 'react'; +import { Label } from '@patternfly/react-core'; +import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon'; + +export const LabelOutline: React.FunctionComponent = () => ( + + {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+
+ {' '} + {' '} + {' '} + {' '} + {' '} + + +
+); diff --git a/packages/react-core/src/components/Label/examples/LabelRouterLink.tsx b/packages/react-core/src/components/Label/examples/LabelRouterLink.tsx new file mode 100644 index 00000000000..cc09847321a --- /dev/null +++ b/packages/react-core/src/components/Label/examples/LabelRouterLink.tsx @@ -0,0 +1,20 @@ +import React from 'react'; +import { Label } from '@patternfly/react-core'; +import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon'; +import { Link } from '@reach/router'; + +export const LabelRouterLink: React.FunctionComponent = () => ( + +);