From 22779bbf2bad76546474ccda9b989386e575717e Mon Sep 17 00:00:00 2001 From: Tomas Psota Date: Wed, 15 Jun 2022 10:37:21 +0200 Subject: [PATCH] chore(JumpLinks): convert examples to TypeScript Signed-off-by: Tomas Psota --- .../JumpLinks/examples/JumpLinks.md | 75 ++----------------- .../JumpLinks/examples/JumpLinksBasic.tsx | 10 +++ ...pLinksExpandableVerticalWithSubsection.tsx | 18 +++++ .../JumpLinks/examples/JumpLinksVertical.tsx | 10 +++ .../examples/JumpLinksVerticalWithLabel.tsx | 10 +++ .../examples/JumpLinksWithCenteredList.tsx | 10 +++ .../JumpLinks/examples/JumpLinksWithLabel.tsx | 17 +++++ 7 files changed, 81 insertions(+), 69 deletions(-) create mode 100644 packages/react-core/src/components/JumpLinks/examples/JumpLinksBasic.tsx create mode 100644 packages/react-core/src/components/JumpLinks/examples/JumpLinksExpandableVerticalWithSubsection.tsx create mode 100644 packages/react-core/src/components/JumpLinks/examples/JumpLinksVertical.tsx create mode 100644 packages/react-core/src/components/JumpLinks/examples/JumpLinksVerticalWithLabel.tsx create mode 100644 packages/react-core/src/components/JumpLinks/examples/JumpLinksWithCenteredList.tsx create mode 100644 packages/react-core/src/components/JumpLinks/examples/JumpLinksWithLabel.tsx diff --git a/packages/react-core/src/components/JumpLinks/examples/JumpLinks.md b/packages/react-core/src/components/JumpLinks/examples/JumpLinks.md index 4074b0c67d1..b0ceedcc9a0 100644 --- a/packages/react-core/src/components/JumpLinks/examples/JumpLinks.md +++ b/packages/react-core/src/components/JumpLinks/examples/JumpLinks.md @@ -9,89 +9,26 @@ propComponents: ['JumpLinks', 'JumpLinksItem'] These examples are static because they have no element to scroll spy on that makes sense. Check out the [React demos](./react-demos) to see scroll spying in action! ### Basic -```js -import React from 'react'; -import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; - - - Inactive section - Active section - Inactive section - +```ts file='./JumpLinksBasic.tsx' ``` ### With centered list -```js -import React from 'react'; -import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; - - - Inactive section - Active section - Inactive section - +```ts file='./JumpLinksWithCenteredList.tsx' ``` ### With label -```js -import React from 'react'; -import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; - - - - Inactive section - Active section - Inactive section - - - Inactive section - Active section - Inactive section - - +```ts file='./JumpLinksWithLabel.tsx' ``` ### Vertical -```js -import React from 'react'; -import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; - - - Inactive section - Active section - Inactive section - +```ts file='./JumpLinksVertical.tsx' ``` ### Vertical with label -```js -import React from 'react'; -import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; - - - Inactive section - Active section - Inactive section - +```ts file='./JumpLinksVerticalWithLabel.tsx' ``` ### Expandable vertical with subsection -```js -import React from 'react'; -import { JumpLinks, JumpLinksItem, JumpLinksList } from '@patternfly/react-core'; - - - Inactive section - - Section with active subsection - - Active subsection - Inactive subsection - Inactive subsection - - - Inactive section - Inactive section - +```ts file='./JumpLinksExpandableVerticalWithSubsection.tsx' ``` diff --git a/packages/react-core/src/components/JumpLinks/examples/JumpLinksBasic.tsx b/packages/react-core/src/components/JumpLinks/examples/JumpLinksBasic.tsx new file mode 100644 index 00000000000..c638b4efb25 --- /dev/null +++ b/packages/react-core/src/components/JumpLinks/examples/JumpLinksBasic.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; + +export const JumpLinksBasic: React.FunctionComponent = () => ( + + Inactive section + Active section + Inactive section + +); diff --git a/packages/react-core/src/components/JumpLinks/examples/JumpLinksExpandableVerticalWithSubsection.tsx b/packages/react-core/src/components/JumpLinks/examples/JumpLinksExpandableVerticalWithSubsection.tsx new file mode 100644 index 00000000000..40b45fd46dd --- /dev/null +++ b/packages/react-core/src/components/JumpLinks/examples/JumpLinksExpandableVerticalWithSubsection.tsx @@ -0,0 +1,18 @@ +import React from 'react'; +import { JumpLinks, JumpLinksItem, JumpLinksList } from '@patternfly/react-core'; + +export const JumpLinksExpandableVerticalWithSubsection: React.FunctionComponent = () => ( + + Inactive section + + Section with active subsection + + Active subsection + Inactive subsection + Inactive subsection + + + Inactive section + Inactive section + +); diff --git a/packages/react-core/src/components/JumpLinks/examples/JumpLinksVertical.tsx b/packages/react-core/src/components/JumpLinks/examples/JumpLinksVertical.tsx new file mode 100644 index 00000000000..a087d74cab3 --- /dev/null +++ b/packages/react-core/src/components/JumpLinks/examples/JumpLinksVertical.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; + +export const JumpLinksVertical: React.FunctionComponent = () => ( + + Inactive section + Active section + Inactive section + +); diff --git a/packages/react-core/src/components/JumpLinks/examples/JumpLinksVerticalWithLabel.tsx b/packages/react-core/src/components/JumpLinks/examples/JumpLinksVerticalWithLabel.tsx new file mode 100644 index 00000000000..0fafa87c303 --- /dev/null +++ b/packages/react-core/src/components/JumpLinks/examples/JumpLinksVerticalWithLabel.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; + +export const JumpLinksVerticalWithLabel: React.FunctionComponent = () => ( + + Inactive section + Active section + Inactive section + +); diff --git a/packages/react-core/src/components/JumpLinks/examples/JumpLinksWithCenteredList.tsx b/packages/react-core/src/components/JumpLinks/examples/JumpLinksWithCenteredList.tsx new file mode 100644 index 00000000000..d317775f2de --- /dev/null +++ b/packages/react-core/src/components/JumpLinks/examples/JumpLinksWithCenteredList.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; + +export const JumpLinksWithCenteredList: React.FunctionComponent = () => ( + + Inactive section + Active section + Inactive section + +); diff --git a/packages/react-core/src/components/JumpLinks/examples/JumpLinksWithLabel.tsx b/packages/react-core/src/components/JumpLinks/examples/JumpLinksWithLabel.tsx new file mode 100644 index 00000000000..5f189a7896b --- /dev/null +++ b/packages/react-core/src/components/JumpLinks/examples/JumpLinksWithLabel.tsx @@ -0,0 +1,17 @@ +import React from 'react'; +import { JumpLinks, JumpLinksItem } from '@patternfly/react-core'; + +export const JumpLinksWithLabel: React.FunctionComponent = () => ( + <> + + Inactive section + Active section + Inactive section + + + Inactive section + Active section + Inactive section + + +);