diff --git a/package.json b/package.json index b6366c8109a2..14452b98f5b6 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "vite.config.ts" ], "ext": "js,jsx,ts,tsx", - "exec": "yarn storybook" + "exec": "yarn storybook --ci" }, "devDependencies": { "@storybook/addon-essentials": "^7.0.0", diff --git a/src/components/Button/Button.stories.tsx b/src/components/Button/Button.stories.tsx new file mode 100644 index 000000000000..7e437ad8d1ce --- /dev/null +++ b/src/components/Button/Button.stories.tsx @@ -0,0 +1,15 @@ +import { Meta, StoryObj } from "@storybook/react"; +import { Button } from "./Button"; + +const meta: Meta = { + title: "Components/Button", + component: Button, +}; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: { children: "Button" }, +}; diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 263d01d5e7ef..9078cdd8c00c 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -1,22 +1,42 @@ -import React from "react"; +import { styled } from "@storybook/theming"; +import React, { FC } from "react"; -export const buttonStyles: React.ComponentProps<"button">["style"] = { - border: 0, - cursor: "pointer", - fontSize: 13, - lineHeight: 1, - padding: "9px 12px", - backgroundColor: "#029CFD", - borderRadius: 4, - color: "#fff", - fontWeight: 700, -}; +export interface ButtonProps { + children: string; + onClick?: (e: React.MouseEvent) => void; +} -export function Button(props: React.ComponentProps<"button">) { - const style = { - ...buttonStyles, - ...(props.style || {}), - }; +const Container = styled.button` + all: unset; + border: 0; + border-radius: 0.25rem; + cursor: pointer; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 0.75rem; + background: ${({ theme }) => theme.color.secondary}; + color: ${({ theme }) => theme.color.lightest}; + height: 32px; + font-size: 0.8125rem; + font-weight: 700; + font-family: ${({ theme }) => theme.typography.fonts.base}; + transition: all 0.16s ease-in-out; + text-decoration: none; - return + + )} + + ); +};