-
Notifications
You must be signed in to change notification settings - Fork 0
[feat/button] - 버튼 default / secondary 두가지 #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b22a444
feat/button - 버튼 default / secondary 두가지
ramong26 6746f65
feat/button - fix/ci, build and Lint & type check
ramong26 cc57a45
feat/button - fix/ci, build and Lint & type check
ramong26 1d0877f
feat/button - fix/ci, build and Lint & type check
ramong26 ecd06c7
feat/button - fix/ci, build and Lint & type check
ramong26 8613e5b
feat/button - fix/ci, build and Lint & type check
ramong26 cade429
feat/button - fix/ci, build and Lint & type check
ramong26 5293791
feat/button - fix/ci, build and Lint & type check
ramong26 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "singleQuote": true, | ||
| "trailingComma": "none", | ||
| "semi": true, | ||
| "arrowParens": "always", | ||
| "endOfLine": "lf" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,74 @@ | ||
| @use '@/styles/index' as v; | ||
|
|
||
| .xp-btn { | ||
| padding: 4px 8px; | ||
| border: 2px solid black; | ||
| font-weight: 400; | ||
| background: #d4d4d4; | ||
| color: #5a5a5a; | ||
| border: none; | ||
| font-family: 'Tahoma', 'Verdana', sans-serif; | ||
| font-size: 16px; | ||
| padding: 6px 18px; | ||
| cursor: pointer; | ||
| box-shadow: | ||
| inset 1px 1px 0 0 #fff, | ||
| 1px 1px 0 0 #868686, | ||
| 2px 2px 0 0 #222; | ||
| transition: | ||
| background-color 0.12s, | ||
| color 0.12s, | ||
| box-shadow 0.12s; | ||
|
|
||
| &:hover, | ||
| &:focus { | ||
| background: #e5e5e5; | ||
| color: #222; | ||
| box-shadow: | ||
| inset 1px 1px 0 0 #fff, | ||
| 2px 2px 0 0 #222; | ||
| } | ||
| &:active { | ||
| background: #bbbbbb; | ||
| color: #222; | ||
| box-shadow: | ||
| inset 1px 1px 0 0 #fff, | ||
| 1px 1px 0 0 #868686, | ||
| 0px 0px 0 0 #222; | ||
| } | ||
|
|
||
| @media (max-width: 640px) { | ||
| font-size: 13px; | ||
| padding: 5px 12px; | ||
| } | ||
| } | ||
|
|
||
| // 빨강 버튼 (secondary) | ||
| .xp-btn.secondary { | ||
| background: #d43c3c; | ||
| color: #fff; | ||
| border: none; | ||
| box-shadow: | ||
| inset 1px 1px 0 0 #fff, | ||
| 1px 1px 0 0 #b92a2a, | ||
| 2px 2px 0 0 #7a1818; | ||
|
|
||
| &[data-variant="primary"] { | ||
| background: #ffffff; | ||
| color: #000000; | ||
| &:hover { | ||
| background: #f2f2f2; | ||
| color: #222222; | ||
| } | ||
| &:hover, | ||
| &:focus { | ||
| background: #b92a2a; | ||
| color: #fff; | ||
| box-shadow: | ||
| inset 1px 1px 0 0 #fff, | ||
| 2px 2px 0 0 #7a1818; | ||
| } | ||
| &[data-variant="secondary"] { | ||
| background: #eee; | ||
| color: #333; | ||
| &:hover { | ||
| background: #e0e0e0; | ||
| color: #222; | ||
| } | ||
| &:active { | ||
| background: #a12222; | ||
| color: #fff; | ||
| box-shadow: | ||
| inset 1px 1px 0 0 #fff, | ||
| 1px 1px 0 0 #b92a2a, | ||
| 0px 0px 0 0 #7a1818; | ||
| } | ||
|
|
||
| @media (max-width: 640px) { | ||
| font-size: 13px; | ||
| padding: 5px 12px; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,20 @@ | ||
| import type { Meta, StoryObj } from "@storybook/react-vite"; | ||
| import Button from "./Button"; | ||
| import type { Meta, StoryObj } from '@storybook/react-vite'; | ||
| import Button from './Button'; | ||
|
|
||
| const meta: Meta<typeof Button> = { | ||
| title: "Components/Button", | ||
| title: 'Components/Button', | ||
| component: Button, | ||
| argTypes: { onClick: { action: "clicked" } }, | ||
| argTypes: { onClick: { action: 'clicked' } } | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof Button>; | ||
|
|
||
| export const Primary: Story = { | ||
| args: { children: "클릭", variant: "primary" }, | ||
| args: { | ||
| children: '클릭', | ||
| variant: 'default', | ||
| selected: true, | ||
| color: 'rgba(255, 0, 0, 1)' | ||
| } | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,16 +1,23 @@ | ||||
| import React from "react"; | ||||
| import "./Button.scss"; | ||||
| import React from 'react'; | ||||
| import './Button.scss'; | ||||
|
|
||||
| export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & { | ||||
| variant?: "primary" | "secondary"; | ||||
| selected?: boolean; | ||||
|
||||
| selected?: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| import type { StorybookConfig } from "@storybook/react-vite"; | ||
| import type { StorybookConfig } from '@storybook/react-vite'; | ||
|
|
||
| const config: StorybookConfig = { | ||
| stories: ["../src/**/*.stories.@(ts|tsx|mdx)"], | ||
| addons: ["@storybook/addon-essentials", "@storybook/addon-a11y"], | ||
| framework: { name: "@storybook/react-vite", options: {} }, | ||
| stories: ['../src/**/*.stories.@(ts|tsx|mdx)'], | ||
| addons: ['@storybook/addon-essentials', '@storybook/addon-a11y'], | ||
| framework: { name: '@storybook/react-vite', options: {} } | ||
| }; | ||
| export default config; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The story includes
selectedandcolorprops that are not defined in the ButtonProps interface. Remove these props or add them to the component's prop definitions.