diff --git a/src/stories/Avatar.stories.tsx b/src/stories/Atoms/Avatar.stories.tsx similarity index 78% rename from src/stories/Avatar.stories.tsx rename to src/stories/Atoms/Avatar.stories.tsx index 936056b..b9be9e6 100644 --- a/src/stories/Avatar.stories.tsx +++ b/src/stories/Atoms/Avatar.stories.tsx @@ -1,5 +1,5 @@ import { Meta, StoryObj } from '@storybook/react'; -import { Avatar } from '../components/Avatar/Avatar'; +import { Avatar } from '../../components/Avatar/Avatar'; const meta: Meta = { title: 'Design System/Avatar', @@ -36,12 +36,7 @@ export const Sizes: Story = { export const Circle: Story = { render: () => ( <> - + ), }; diff --git a/src/stories/AvatarList.stories.tsx b/src/stories/Atoms/AvatarList.stories.tsx similarity index 86% rename from src/stories/AvatarList.stories.tsx rename to src/stories/Atoms/AvatarList.stories.tsx index 2237fbb..faa4361 100644 --- a/src/stories/AvatarList.stories.tsx +++ b/src/stories/Atoms/AvatarList.stories.tsx @@ -1,6 +1,6 @@ import { Meta, StoryFn } from '@storybook/react'; -import { AvatarList, AvatarListProps } from '../components/AvatarList/AvatarList'; +import { AvatarList, AvatarListProps } from '../../components/AvatarList/AvatarList'; export default { title: 'Design System/AvatarList', @@ -44,11 +44,11 @@ Ellipsized.args = { export const BigUserCount = Template.bind({}); BigUserCount.args = { - users: Ellipsized.args.users as AvatarListProps['users'], - userCount: 100, + users: Ellipsized.args.users as AvatarListProps['users'], + userCount: 100, }; export const Empty = Template.bind({}); Empty.args = { users: [], -}; \ No newline at end of file +}; diff --git a/src/stories/Badge.stories.tsx b/src/stories/Atoms/Badge.stories.tsx similarity index 92% rename from src/stories/Badge.stories.tsx rename to src/stories/Atoms/Badge.stories.tsx index 55c97f8..f06a2e3 100644 --- a/src/stories/Badge.stories.tsx +++ b/src/stories/Atoms/Badge.stories.tsx @@ -1,5 +1,5 @@ import { containerStyle, informationStyle } from './styles'; -import Badge from '../components/Badge/Badge'; +import Badge from '../../components/Badge/Badge'; import type { Meta, StoryObj } from '@storybook/react'; const meta = { @@ -36,7 +36,7 @@ type Story = StoryObj; export const Playground: Story = {}; export const Variants: Story = { - render: ({children}) => ( + render: ({ children }) => (
  • keyword
    @@ -65,13 +65,13 @@ export const Sizes: Story = {
    • Small
      - + {children}
    • Large
      - + {children}
    • diff --git a/src/stories/Body.stories.tsx b/src/stories/Atoms/Body.stories.tsx similarity index 62% rename from src/stories/Body.stories.tsx rename to src/stories/Atoms/Body.stories.tsx index f68c351..08623b4 100644 --- a/src/stories/Body.stories.tsx +++ b/src/stories/Atoms/Body.stories.tsx @@ -1,8 +1,8 @@ -import { containerStyle, informationStyle } from '@stories/styles'; +import { containerStyle, informationStyle } from '@/stories/Atoms/styles'; import type { Meta, StoryObj } from '@storybook/react'; -import type { BodyProps } from '../components/Body/Body'; -import Body from '../components/Body/Body'; +import type { BodyProps } from '../../components/Body/Body'; +import Body from '../../components/Body/Body'; const meta = { title: 'Design System/Body', @@ -47,25 +47,25 @@ export const Playground: Story = {}; export const Sizes: Story = { render: ({ children }) => ( - <> -
    • -
      Small
      - {children} -
    • -
    • -
      Medium
      - {children} -
    • -
    • -
      Large
      - {children} -
    • -
    • -
      X Large
      - {children} -
    • - - ), + <> +
    • +
      Small
      + {children} +
    • +
    • +
      Medium
      + {children} +
    • +
    • +
      Large
      + {children} +
    • +
    • +
      X Large
      + {children} +
    • + + ), argTypes: { size: { control: false, @@ -73,11 +73,10 @@ export const Sizes: Story = { }, }; - export const Small: Story = createBodyStory('small') as Story; export const Medium: Story = createBodyStory('medium') as Story; export const Large: Story = createBodyStory('large') as Story; -export const XLarge: Story = createBodyStory('xLarge') as Story;; \ No newline at end of file +export const XLarge: Story = createBodyStory('xLarge') as Story; diff --git a/src/stories/Button.stories.tsx b/src/stories/Atoms/Button.stories.tsx similarity index 83% rename from src/stories/Button.stories.tsx rename to src/stories/Atoms/Button.stories.tsx index ae329f3..4cf802e 100644 --- a/src/stories/Button.stories.tsx +++ b/src/stories/Atoms/Button.stories.tsx @@ -1,8 +1,8 @@ -import { containerStyle, informationStyle } from '../stories/styles'; +import { containerStyle, informationStyle } from './styles'; import type { Meta, StoryObj } from '@storybook/react'; -import type { ButtonProps } from '../components/Button/Button'; -import Button from '../components/Button/Button'; +import type { ButtonProps } from '../../components/Button/Button'; +import Button from '../../components/Button/Button'; const meta = { title: 'Design System/Button', @@ -52,13 +52,13 @@ export const Variants: Story = {
      • Primary
        -
      • Secondary
        -
      • @@ -76,19 +76,19 @@ export const Sizes: Story = {
        • Small
          -
        • Medium
          -
        • Large
          -
        • diff --git a/src/stories/Atoms/Checkbox.stories.tsx b/src/stories/Atoms/Checkbox.stories.tsx new file mode 100644 index 0000000..a7c627c --- /dev/null +++ b/src/stories/Atoms/Checkbox.stories.tsx @@ -0,0 +1,57 @@ +import { containerStyle, informationStyle } from '@/stories/Atoms/styles'; +import type { Meta, StoryObj } from '@storybook/react'; + +import Checkbox from '../../components/Checkbox/Checkbox'; + +const meta = { + title: 'Design System/Checkbox', + component: Checkbox, + argTypes: { + checked: { + control: { type: 'boolean' }, + }, + label: { + control: { type: 'text' }, + }, + }, + args: { + checked: true, + label: 'Label', + }, +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Playground: Story = {}; + +export const Checkboxes: Story = { + render: () => ( +
            +
          • +
            Checked
            + +
          • +
          • +
            Unchecked
            + +
          • +
          • +
            Checked with Label
            + +
          • +
          • +
            Unchecked with Label
            + +
          • +
          + ), + argTypes: { + checked: { + control: false, + }, + label: { + control: false, + }, + }, +}; diff --git a/src/stories/Heading.stories.tsx b/src/stories/Atoms/Heading.stories.tsx similarity index 58% rename from src/stories/Heading.stories.tsx rename to src/stories/Atoms/Heading.stories.tsx index e430568..08fbe39 100644 --- a/src/stories/Heading.stories.tsx +++ b/src/stories/Atoms/Heading.stories.tsx @@ -1,7 +1,7 @@ -import { containerStyle, informationStyle } from '@stories/styles'; +import { containerStyle, informationStyle } from '@/stories/Atoms/styles'; import type { Meta, StoryObj } from '@storybook/react'; -import type { HeadingProps } from '../components/Heading/Heading'; -import Heading from '../components/Heading/Heading'; +import type { HeadingProps } from '../../components/Heading/Heading'; +import Heading from '../../components/Heading/Heading'; const meta = { title: 'Design System/Heading', @@ -46,29 +46,29 @@ export const Playground: Story = {}; export const Sizes: Story = { render: ({ children }) => ( - <> -
        • -
          Small
          - {children} -
        • -
        • -
          Medium
          - {children} -
        • -
        • -
          Large
          - {children} -
        • -
        • -
          X Large
          - {children} -
        • -
        • -
          XX Large
          - {children} -
        • - - ), + <> +
        • +
          Small
          + {children} +
        • +
        • +
          Medium
          + {children} +
        • +
        • +
          Large
          + {children} +
        • +
        • +
          X Large
          + {children} +
        • +
        • +
          XX Large
          + {children} +
        • + + ), argTypes: { size: { control: false, @@ -76,13 +76,12 @@ export const Sizes: Story = { }, }; - export const Small: Story = createHeadingStory('small') as Story; export const Medium: Story = createHeadingStory('medium') as Story; export const Large: Story = createHeadingStory('large') as Story; -export const XLarge: Story = createHeadingStory('xLarge') as Story;; +export const XLarge: Story = createHeadingStory('xLarge') as Story; export const XXLarge: Story = createHeadingStory('xxLarge') as Story; diff --git a/src/stories/Input.stories.tsx b/src/stories/Atoms/Input.stories.tsx similarity index 68% rename from src/stories/Input.stories.tsx rename to src/stories/Atoms/Input.stories.tsx index 248de07..7c8b933 100644 --- a/src/stories/Input.stories.tsx +++ b/src/stories/Atoms/Input.stories.tsx @@ -1,5 +1,5 @@ import Icon from '@components/Icon/Icon'; -import { containerStyle, informationStyle } from '@stories/styles'; +import { containerStyle, informationStyle } from '@/stories/Atoms/styles'; import type { Meta, StoryObj } from '@storybook/react'; import Input from '@components/Input/Input'; @@ -46,17 +46,17 @@ export const Playground: Story = {}; export const Variants: Story = { render: ({ size, isError, placeholder }) => ( -
            -
          • -
            Default
            - -
          • -
          • -
            Text
            - -
          • -
          - ), +
            +
          • +
            Default
            + +
          • +
          • +
            Text
            + +
          • +
          + ), argTypes: { variant: { control: false, @@ -66,21 +66,21 @@ export const Variants: Story = { export const Sizes: Story = { render: ({ variant, isError, placeholder }) => ( -
            -
          • -
            Small
            - -
          • -
          • -
            Medium
            - -
          • -
          • -
            Large
            - -
          • -
          - ), +
            +
          • +
            Small
            + +
          • +
          • +
            Medium
            + +
          • +
          • +
            Large
            + +
          • +
          + ), argTypes: { size: { control: false, @@ -112,7 +112,7 @@ export const Text: Story = { export const WithIcon: Story = { args: { - icon: , + icon: , }, argTypes: { icon: { @@ -148,7 +148,7 @@ export const WithLabelAndSupportingText: Story = { export const WithIconLabelAndSupportingText: Story = { args: { label: 'Label', - icon: , + icon: , supportingText: 'Supporting Text', required: true, }, diff --git a/src/stories/Logo.stories.tsx b/src/stories/Atoms/Logo.stories.tsx similarity index 94% rename from src/stories/Logo.stories.tsx rename to src/stories/Atoms/Logo.stories.tsx index b26fe44..f0fd7b0 100644 --- a/src/stories/Logo.stories.tsx +++ b/src/stories/Atoms/Logo.stories.tsx @@ -1,7 +1,7 @@ import styled from '@emotion/styled'; import { css } from '@emotion/react'; -import { Logo, CharacterProps } from '../components/Logo/Logo'; -import { characters } from '../assets/characters'; +import { Logo, CharacterProps } from '../../components/Logo/Logo'; +import { characters } from '../../assets/characters'; import type { Meta, StoryObj } from '@storybook/react'; const Meta = styled.div` @@ -55,7 +55,6 @@ const meta = { export default meta; type Story = StoryObj; - export const Labels = { render: (): JSX.Element => ( <> diff --git a/src/stories/Modal.stories.tsx b/src/stories/Atoms/Modal.stories.tsx similarity index 100% rename from src/stories/Modal.stories.tsx rename to src/stories/Atoms/Modal.stories.tsx diff --git a/src/stories/Paragraph.stories.tsx b/src/stories/Atoms/Paragraph.stories.tsx similarity index 100% rename from src/stories/Paragraph.stories.tsx rename to src/stories/Atoms/Paragraph.stories.tsx diff --git a/src/stories/ShowMoreBtn.stories.tsx b/src/stories/Atoms/ShowMoreBtn.stories.tsx similarity index 100% rename from src/stories/ShowMoreBtn.stories.tsx rename to src/stories/Atoms/ShowMoreBtn.stories.tsx diff --git a/src/stories/Skeleton.stories.tsx b/src/stories/Atoms/Skeleton.stories.tsx similarity index 79% rename from src/stories/Skeleton.stories.tsx rename to src/stories/Atoms/Skeleton.stories.tsx index 88669c2..a5ab209 100644 --- a/src/stories/Skeleton.stories.tsx +++ b/src/stories/Atoms/Skeleton.stories.tsx @@ -1,4 +1,4 @@ -import { containerStyle } from '@stories/styles'; +import { containerStyle } from '@/stories/Atoms/styles'; import type { Meta, StoryObj } from '@storybook/react'; import Skeleton from '@components/Skeleton/Skeleton'; @@ -29,7 +29,7 @@ export const Image: Story = { args: { width: '168px', height: '260px', - variant: "square" + variant: 'square', }, }; @@ -52,13 +52,13 @@ export const Circle: Story = { export const Combination: Story = { render: () => ( -
          - - - - -
          - ), +
          + + + + +
          + ), argTypes: { variant: { control: false }, width: { control: false }, diff --git a/src/stories/SwitchToggle.stories.tsx b/src/stories/Atoms/SwitchToggle.stories.tsx similarity index 100% rename from src/stories/SwitchToggle.stories.tsx rename to src/stories/Atoms/SwitchToggle.stories.tsx diff --git a/src/stories/Atoms/Tabs.stories.tsx b/src/stories/Atoms/Tabs.stories.tsx new file mode 100644 index 0000000..1acd962 --- /dev/null +++ b/src/stories/Atoms/Tabs.stories.tsx @@ -0,0 +1,87 @@ +import { containerStyle, informationStyle } from '@/stories/Atoms/styles'; +import type { Meta, StoryObj } from '@storybook/react'; + +import { useSelect } from '../../hooks/useSelect'; + +import Tab from '@components/Tab/Tab'; +import Tabs from '@components/Tabs/Tabs'; + +const meta = { + title: 'Design System/Tabs', + component: Tabs, + decorators: [ + (Story) => ( +
            + +
          + ), + ], +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Variants: Story = { + render: () => { + const outlineSelector = useSelect('tab1'); + const selectedOutline = outlineSelector.selected; + const handleSelectOutline = outlineSelector.handleSelectClick; + + const blockSelector = useSelect('tab1'); + const selectedBlock = blockSelector.selected; + const handleSelectBlock = blockSelector.handleSelectClick; + + const outlineSelectorOverflow = useSelect('tab1'); + const selectedOutlineOverflow = outlineSelectorOverflow.selected; + const handleSelectOutlineOverflow = outlineSelectorOverflow.handleSelectClick; + + return ( + <> +
        • +
          outline
          + + + + +
        • +
        • +
          block
          + + + + +
        • +
        • +
          overflow-outline
          + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        • + + ); + }, +}; diff --git a/src/stories/Textarea.stories.tsx b/src/stories/Atoms/Textarea.stories.tsx similarity index 70% rename from src/stories/Textarea.stories.tsx rename to src/stories/Atoms/Textarea.stories.tsx index eaec378..9ba5a08 100644 --- a/src/stories/Textarea.stories.tsx +++ b/src/stories/Atoms/Textarea.stories.tsx @@ -1,4 +1,4 @@ -import { containerStyle, informationStyle } from '@stories/styles'; +import { containerStyle, informationStyle } from '@/stories/Atoms/styles'; import type { Meta, StoryObj } from '@storybook/react'; import Textarea from '@components/Textarea/Textarea'; @@ -39,21 +39,21 @@ export const Playground: Story = {}; export const Sizes: Story = { render: ({ isError, placeholder }) => ( -
            -
          • -
            Small
            -