From 5eeedf3be8e0b34ac7d93918ff14a65687e354a5 Mon Sep 17 00:00:00 2001 From: Pavel Klibani Date: Sat, 16 Sep 2023 20:07:40 +0200 Subject: [PATCH] Docs(web-react): Add Pill demo #DS-904 - Pill demo in web-react is now same as demo in web and web-twig --- .../src/components/Pill/demo/Pill.tsx | 14 ------- .../src/components/Pill/demo/PillColors.tsx | 40 ++++++++----------- .../src/components/Pill/demo/PillLongText.tsx | 6 +++ .../src/components/Pill/demo/index.tsx | 8 ++-- 4 files changed, 27 insertions(+), 41 deletions(-) delete mode 100644 packages/web-react/src/components/Pill/demo/Pill.tsx create mode 100644 packages/web-react/src/components/Pill/demo/PillLongText.tsx diff --git a/packages/web-react/src/components/Pill/demo/Pill.tsx b/packages/web-react/src/components/Pill/demo/Pill.tsx deleted file mode 100644 index 45fd66970c..0000000000 --- a/packages/web-react/src/components/Pill/demo/Pill.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React, { ElementType } from 'react'; -import { ComponentStory } from '@storybook/react'; -import Pill from '../Pill'; -import { SpiritPillProps } from '../../../types'; - -const Story: ComponentStory = (args: SpiritPillProps) => ( - -); - -Story.args = { - children: '3', -}; - -export default Story; diff --git a/packages/web-react/src/components/Pill/demo/PillColors.tsx b/packages/web-react/src/components/Pill/demo/PillColors.tsx index 4ecb6f6020..665673589a 100644 --- a/packages/web-react/src/components/Pill/demo/PillColors.tsx +++ b/packages/web-react/src/components/Pill/demo/PillColors.tsx @@ -1,27 +1,21 @@ import React from 'react'; +import { ActionColors, EmotionColors } from '../../../constants'; import Pill from '../Pill'; -// @see: https://github.com/storybookjs/storybook/issues/8104#issuecomment-932310244 -// eslint-disable-next-line @typescript-eslint/no-unused-vars -const Story = (props: unknown) => ( - <> -
- 3 - 3 - 3 - 3 -
-
- 333 - 333 -
-
- 3 - 3 - 3 - 3 -
- -); +const PillColors = () => { + const actionColors = Object.values(ActionColors); + const emotionColors = Object.values(EmotionColors); + const colors = [...actionColors, ...emotionColors]; -export default Story; + return ( + <> + {colors.map((color) => ( + + 3 + + ))} + + ); +}; + +export default PillColors; diff --git a/packages/web-react/src/components/Pill/demo/PillLongText.tsx b/packages/web-react/src/components/Pill/demo/PillLongText.tsx new file mode 100644 index 0000000000..496192733b --- /dev/null +++ b/packages/web-react/src/components/Pill/demo/PillLongText.tsx @@ -0,0 +1,6 @@ +import React from 'react'; +import Pill from '../Pill'; + +const PillLongText = () => 333; + +export default PillLongText; diff --git a/packages/web-react/src/components/Pill/demo/index.tsx b/packages/web-react/src/components/Pill/demo/index.tsx index 54738aa55d..b1f67797c8 100644 --- a/packages/web-react/src/components/Pill/demo/index.tsx +++ b/packages/web-react/src/components/Pill/demo/index.tsx @@ -1,16 +1,16 @@ import React from 'react'; import ReactDOM from 'react-dom/client'; import DocsSection from '../../../../docs/DocsSections'; -import Pill from './Pill'; import PillColors from './PillColors'; +import PillLongText from './PillLongText'; ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( - - - + + + , );