From 2a1826887a79f9e73154671d8d191179f5fa5670 Mon Sep 17 00:00:00 2001 From: HasithDeAlwis Date: Tue, 7 Jan 2025 00:09:06 -0500 Subject: [PATCH] fix(storybook): build failing due to duplicate stories --- .../components/typography/typgoraphy.tsx | 42 ----------- .../typography/typography.stories.tsx | 73 ------------------- 2 files changed, 115 deletions(-) delete mode 100644 libs/shared/ui/src/cuHacking/components/typography/typgoraphy.tsx delete mode 100644 libs/shared/ui/src/cuHacking/components/typography/typography.stories.tsx diff --git a/libs/shared/ui/src/cuHacking/components/typography/typgoraphy.tsx b/libs/shared/ui/src/cuHacking/components/typography/typgoraphy.tsx deleted file mode 100644 index 8e5bb18c8..000000000 --- a/libs/shared/ui/src/cuHacking/components/typography/typgoraphy.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { cn } from '@cuhacking/shared/utils/cn' -import { cva } from 'class-variance-authority' -import React from 'react' - -interface TypographyProps { - variant: - | 'h1' - | 'h2' - | 'h3' - | 'h4' - | 'h5' - | 'h6' - | 'paragraph-sm' - | 'paragraph-base' - | 'paragraph-xs' - children: React.ReactNode - className: string -} - -const typographyVariants = cva('', { - variants: { - variant: { - 'h1': 'text-6xl font-bold font-sans', - 'h2': 'text-5xl font-normal font-sans', - 'h3': 'font-sans font-medium leading-10 font-sans text-4xl tracking-normal uppercase no-underline', - 'h4': 'text-2xl font-normal font-sans', - 'h5': 'text-lg font-normal font-sans', - 'h6': 'font-sans font-medium leading-5 text-sm tracking-normal uppercase no-underline', - 'paragraph-base': 'text-base font-normal font-sans', - 'paragraph-sm': 'text-sm font-normal font-sans', - 'paragraph-xs': 'text-xs font-normal font-sans', - }, - }, -}) - -export function Typography({ variant, className, children }: TypographyProps) { - return ( -
- {children} -
- ) -} diff --git a/libs/shared/ui/src/cuHacking/components/typography/typography.stories.tsx b/libs/shared/ui/src/cuHacking/components/typography/typography.stories.tsx deleted file mode 100644 index 001359310..000000000 --- a/libs/shared/ui/src/cuHacking/components/typography/typography.stories.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import type { Meta, StoryObj } from '@storybook/react' -import { Typography } from './typgoraphy' - -const meta: Meta = { - title: 'cuHacking Design System/Typography', - component: Typography, - tags: ['autodocs'], - parameters: { - layout: 'centered', - }, - args: { - variant: 'h1', - children: 'This is a headline', - className: '', - }, - argTypes: { - variant: { - control: { - type: 'select', - options: [ - 'h1', - 'h2', - 'h3', - 'h4', - 'h5', - 'h6', - 'paragraph-sm', - 'paragraph-base', - 'paragraph-xs', - ], - }, - table: { - type: { summary: 'Typography variant' }, - defaultValue: { summary: 'h1' }, - }, - }, - children: { - control: { type: 'text' }, - table: { - type: { summary: 'React.ReactNode' }, - }, - }, - className: { - control: { type: 'text' }, - table: { - type: { summary: 'string' }, - }, - }, - }, -} - -export default meta -type Story = StoryObj - -function createVariantStory(variant: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'paragraph-base' | 'paragraph-sm' | 'paragraph-xs'): Story { - return { - args: { - variant, - children: `This is ${variant} typography`, - className: '', - }, - } -} - -export const H1: Story = createVariantStory('h1') -export const H2: Story = createVariantStory('h2') -export const H3: Story = createVariantStory('h3') -export const H4: Story = createVariantStory('h4') -export const H5: Story = createVariantStory('h5') -export const H6: Story = createVariantStory('h6') -export const ParagraphBase: Story = createVariantStory('paragraph-base') -export const ParagraphSm: Story = createVariantStory('paragraph-sm') -export const ParagraphXs: Story = createVariantStory('paragraph-xs')