From a2c16534392e64fcf3fe1f1cf35052a11d35c8aa Mon Sep 17 00:00:00 2001 From: Vadym Date: Fri, 26 Jan 2024 13:25:50 +0100 Subject: [PATCH] docs(ColorPage): table of colors --- .../src/docs/foundations/Color/ColorTable.tsx | 7 ++----- .../src/docs/foundations/{ => Shadow}/Shadow.stories.mdx | 4 ++-- .../src/docs/foundations/Shadow/constants.ts | 0 packages/react-components/src/docs/helpers.ts | 4 ++++ 4 files changed, 8 insertions(+), 7 deletions(-) rename packages/react-components/src/docs/foundations/{ => Shadow}/Shadow.stories.mdx (74%) create mode 100644 packages/react-components/src/docs/foundations/Shadow/constants.ts create mode 100644 packages/react-components/src/docs/helpers.ts diff --git a/packages/react-components/src/docs/foundations/Color/ColorTable.tsx b/packages/react-components/src/docs/foundations/Color/ColorTable.tsx index 9d9fdaa92..612d52ca7 100644 --- a/packages/react-components/src/docs/foundations/Color/ColorTable.tsx +++ b/packages/react-components/src/docs/foundations/Color/ColorTable.tsx @@ -1,5 +1,7 @@ import * as React from 'react'; +import { handleCopyText } from '../../helpers'; + import { ColorShape } from './types'; import '../../components/Table/Table.css'; @@ -9,11 +11,6 @@ interface IColorTableProps { } export const ColorTable: React.FC = ({ data }) => { - const handleCopyText = (text: string): void => { - void navigator.clipboard.writeText(text); - alert(`"${text}" copied to clipboard`); - }; - return ( diff --git a/packages/react-components/src/docs/foundations/Shadow.stories.mdx b/packages/react-components/src/docs/foundations/Shadow/Shadow.stories.mdx similarity index 74% rename from packages/react-components/src/docs/foundations/Shadow.stories.mdx rename to packages/react-components/src/docs/foundations/Shadow/Shadow.stories.mdx index 085610579..c706f645e 100644 --- a/packages/react-components/src/docs/foundations/Shadow.stories.mdx +++ b/packages/react-components/src/docs/foundations/Shadow/Shadow.stories.mdx @@ -1,6 +1,6 @@ import { Meta, Canvas } from '@storybook/addon-docs'; -import { Shadow } from '../components/Shadow/Shadow'; -import { ShadowExamples } from '../components/Shadow/ShadowExamples'; +import { Shadow } from '../../components/Shadow/Shadow'; +import { ShadowExamples } from '../../components/Shadow/ShadowExamples'; diff --git a/packages/react-components/src/docs/foundations/Shadow/constants.ts b/packages/react-components/src/docs/foundations/Shadow/constants.ts new file mode 100644 index 000000000..e69de29bb diff --git a/packages/react-components/src/docs/helpers.ts b/packages/react-components/src/docs/helpers.ts new file mode 100644 index 000000000..77b4b7e9c --- /dev/null +++ b/packages/react-components/src/docs/helpers.ts @@ -0,0 +1,4 @@ +export const handleCopyText = (text: string): void => { + void navigator.clipboard.writeText(text); + alert(`"${text}" copied to clipboard`); +};