diff --git a/packages/design-system-react/jest.config.js b/packages/design-system-react/jest.config.js index 9e67c1ef..ab6b18a1 100644 --- a/packages/design-system-react/jest.config.js +++ b/packages/design-system-react/jest.config.js @@ -14,6 +14,9 @@ module.exports = merge(baseConfig, { // The display name when running multiple projects displayName, + // Add coverage ignore patterns + coveragePathIgnorePatterns: ['index.ts'], + // An object that configures minimum threshold enforcement for coverage results coverageThreshold: { global: { diff --git a/packages/design-system-react/src/Button.stories.ts b/packages/design-system-react/src/components/button/Button.stories.ts similarity index 100% rename from packages/design-system-react/src/Button.stories.ts rename to packages/design-system-react/src/components/button/Button.stories.ts diff --git a/packages/design-system-react/src/Button.test.tsx b/packages/design-system-react/src/components/button/Button.test.tsx similarity index 100% rename from packages/design-system-react/src/Button.test.tsx rename to packages/design-system-react/src/components/button/Button.test.tsx diff --git a/packages/design-system-react/src/Button.tsx b/packages/design-system-react/src/components/button/Button.tsx similarity index 100% rename from packages/design-system-react/src/Button.tsx rename to packages/design-system-react/src/components/button/Button.tsx diff --git a/packages/design-system-react/src/components/button/index.ts b/packages/design-system-react/src/components/button/index.ts new file mode 100644 index 00000000..fa3c8a51 --- /dev/null +++ b/packages/design-system-react/src/components/button/index.ts @@ -0,0 +1,2 @@ +export { Button } from './Button'; +export type { ButtonProps } from './Button'; diff --git a/packages/design-system-react/src/components/index.ts b/packages/design-system-react/src/components/index.ts new file mode 100644 index 00000000..423616a4 --- /dev/null +++ b/packages/design-system-react/src/components/index.ts @@ -0,0 +1,5 @@ +export { Text, TextVariant } from './text'; +export type { TextProps } from './text'; + +export { Button } from './button'; +export type { ButtonProps } from './button'; diff --git a/packages/design-system-react/src/Text.stories.tsx b/packages/design-system-react/src/components/text/Text.stories.tsx similarity index 100% rename from packages/design-system-react/src/Text.stories.tsx rename to packages/design-system-react/src/components/text/Text.stories.tsx diff --git a/packages/design-system-react/src/Text.test.tsx b/packages/design-system-react/src/components/text/Text.test.tsx similarity index 100% rename from packages/design-system-react/src/Text.test.tsx rename to packages/design-system-react/src/components/text/Text.test.tsx diff --git a/packages/design-system-react/src/Text.tsx b/packages/design-system-react/src/components/text/Text.tsx similarity index 98% rename from packages/design-system-react/src/Text.tsx rename to packages/design-system-react/src/components/text/Text.tsx index 2b538661..03d34aed 100644 --- a/packages/design-system-react/src/Text.tsx +++ b/packages/design-system-react/src/components/text/Text.tsx @@ -16,7 +16,7 @@ export enum TextVariant { BodyXs = 'body-xs', } -interface TextProps { +export interface TextProps { variant: TextVariant; children: React.ReactNode; className?: string; diff --git a/packages/design-system-react/src/components/text/index.ts b/packages/design-system-react/src/components/text/index.ts new file mode 100644 index 00000000..fb3ad78c --- /dev/null +++ b/packages/design-system-react/src/components/text/index.ts @@ -0,0 +1,2 @@ +export { Text, TextVariant } from './Text'; +export type { TextProps } from './Text'; diff --git a/packages/design-system-react/src/index.test.ts b/packages/design-system-react/src/index.test.ts deleted file mode 100644 index 622068c1..00000000 --- a/packages/design-system-react/src/index.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Button, Text } from '.'; - -describe('Design System React Index', () => { - it('should export Button component', () => { - expect(Button).toBeDefined(); - }); - - it('should export Text component', () => { - expect(Text).toBeDefined(); - }); -}); diff --git a/packages/design-system-react/src/index.ts b/packages/design-system-react/src/index.ts index 1dcf7529..07635cbb 100644 --- a/packages/design-system-react/src/index.ts +++ b/packages/design-system-react/src/index.ts @@ -1,2 +1 @@ -export { Button } from './Button'; -export { Text } from './Text'; +export * from './components';