From 925bb61dae7a90140bc6170f0c81f4d64d2a48b6 Mon Sep 17 00:00:00 2001 From: Roid-obi Date: Wed, 10 Jan 2024 00:15:49 +0700 Subject: [PATCH] feat: docs navbar, paddingcontainer, and text --- src/stories/Button/Button.stories.tsx | 8 +- src/stories/Button/Button.tsx | 32 ++-- .../Card-solutions/CardSolution.stories.tsx | 4 +- .../Card-solutions/CardSolution.style.ts | 2 +- src/stories/Card-solutions/CardSolution.tsx | 10 +- src/stories/Card/Card.stories.tsx | 10 +- src/stories/Card/Card.style.ts | 2 +- src/stories/Card/Card.tsx | 12 +- src/stories/Navbar/link.tsx | 73 ++++++++ src/stories/Navbar/navbar.stories.tsx | 33 ++++ src/stories/Navbar/navbar.style.ts | 175 ++++++++++++++++++ src/stories/Navbar/navbar.tsx | 40 ++++ .../paddingContainer.stories.tsx | 39 ++++ .../paddingContainer.style.ts | 21 +++ .../PaddingContainer/paddingContainer.tsx | 10 + src/stories/Text/Text.stories.tsx | 49 +++++ src/stories/Text/text.style.ts | 13 ++ src/stories/Text/text.tsx | 74 ++++++++ src/stories/assets/Font/Font.tsx | 21 ++- styles/globals.css | 9 +- yarn.lock | 77 ++------ 21 files changed, 615 insertions(+), 99 deletions(-) create mode 100644 src/stories/Navbar/link.tsx create mode 100644 src/stories/Navbar/navbar.stories.tsx create mode 100644 src/stories/Navbar/navbar.style.ts create mode 100644 src/stories/Navbar/navbar.tsx create mode 100644 src/stories/PaddingContainer/paddingContainer.stories.tsx create mode 100644 src/stories/PaddingContainer/paddingContainer.style.ts create mode 100644 src/stories/PaddingContainer/paddingContainer.tsx create mode 100644 src/stories/Text/Text.stories.tsx create mode 100644 src/stories/Text/text.style.ts create mode 100644 src/stories/Text/text.tsx diff --git a/src/stories/Button/Button.stories.tsx b/src/stories/Button/Button.stories.tsx index 7fcf220..9d95e07 100644 --- a/src/stories/Button/Button.stories.tsx +++ b/src/stories/Button/Button.stories.tsx @@ -30,15 +30,15 @@ type Story = StoryObj; export const Primary: Story = { args: { - Type: "primary", - Text: "Button", + type: "primary", + content: "Button", }, }; export const Secondary: Story = { args: { - Type: "secondary", - Text: "Button", + type: "secondary", + content: "Button", }, }; diff --git a/src/stories/Button/Button.tsx b/src/stories/Button/Button.tsx index b78f154..5948261 100644 --- a/src/stories/Button/Button.tsx +++ b/src/stories/Button/Button.tsx @@ -2,20 +2,19 @@ import Link from 'next/link'; import { StyledButton } from './Button.style'; import { useState } from 'react'; -import Font from '../assets/Font/Font'; export interface ButtonProps { /** * Enter the button type "primary" or "secondary" */ - Type?: "primary" | "secondary"; + type: 'primary' | 'secondary'; /** - * Enter text button + * Enter content button */ - Text?: string; - /** + content: string; + /** * Leading to where - */ + */ href?: string; /** * Enter additional styles @@ -27,15 +26,26 @@ export interface ButtonProps { onClick?: () => void; } -export default function Button({ Type="primary", Text, href, style, ...props }: ButtonProps) { +export default function Button({ + type = 'primary', + content, + href, + style, + ...props +}: ButtonProps) { const [isDisabled, setIsDisabled] = useState(false); - const mode = `button--${Type}` + const mode = `button--${type}`; return ( <> - - - {Text} + + {content} diff --git a/src/stories/Card-solutions/CardSolution.stories.tsx b/src/stories/Card-solutions/CardSolution.stories.tsx index 0cae454..cfe8858 100644 --- a/src/stories/Card-solutions/CardSolution.stories.tsx +++ b/src/stories/Card-solutions/CardSolution.stories.tsx @@ -5,7 +5,7 @@ import CardSolution from "./CardSolution"; // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export const meta = { - title: "Components/Card/Card-Solution", + title: "Components/Card-Solution", component: CardSolution, parameters: { // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout @@ -34,7 +34,7 @@ type Story = StoryObj; // More on writing stories with args: https://storybook.js.org/docs/react/writing-stories/args export const CardSolutions: Story = { args: { - logo: - {logo} + {icon} {tittle} {description} diff --git a/src/stories/Card/Card.stories.tsx b/src/stories/Card/Card.stories.tsx index a4ebd0b..f4b35c0 100644 --- a/src/stories/Card/Card.stories.tsx +++ b/src/stories/Card/Card.stories.tsx @@ -6,7 +6,7 @@ import Button from "../Button/Button"; // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction#default-export const meta = { - title: "Components/Card/Card", + title: "Components/Card", component: Card, parameters: { // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/react/configure/story-layout @@ -44,8 +44,8 @@ export const CardGeneral: Story = { Earum rerum vero, nostrum, cupiditate repellat quod distinctio facilis repellendus iste ratione reprehenderit architecto est itaque, sequi molestias.