diff --git a/apps/preview/src/App.tsx b/apps/preview/src/App.tsx index fb117992..9a8475c4 100644 --- a/apps/preview/src/App.tsx +++ b/apps/preview/src/App.tsx @@ -1,4 +1,4 @@ -import { Button, TextButton, ThemeProvider } from '@boolti/ui'; +import { Badge, Button, TextButton, ThemeProvider } from '@boolti/ui'; const Icon = () => ( @@ -184,12 +184,21 @@ const App = () => { BUTTON - TEXT BUTTON - }>TEXT BUTTON - TEXT BUTTON - } disabled> - TEXT BUTTON - +
+ TEXT BUTTON + }>TEXT BUTTON + TEXT BUTTON + } disabled> + TEXT BUTTON + +
+
+ 티켓 판매 오픈 D-n + 티켓 판매 중 + 티켓 판매 종료 + 공연 당일 + 공연 종료 +
); diff --git a/packages/ui/src/components/Badge/Badge.style.ts b/packages/ui/src/components/Badge/Badge.style.ts new file mode 100644 index 00000000..da09d782 --- /dev/null +++ b/packages/ui/src/components/Badge/Badge.style.ts @@ -0,0 +1,26 @@ +import styled from '@emotion/styled'; + +type colorTheme = 'purple' | 'blue' | 'green' | 'red' | 'grey'; + +export interface BadgeProps { + colorTheme: colorTheme; +} + +const Container = styled.span` + display: inline-flex; + justify-content: center; + align-items: center; + border-radius: 24px; + padding: 3px 8px; + ${({ theme }) => theme.typo.b1}; + ${({ colorTheme, theme }) => { + return ` + color: ${theme.palette[colorTheme].main}; + background-color: ${theme.palette[colorTheme].sub}; + `; + }} +`; + +export default { + Container, +}; diff --git a/packages/ui/src/components/Badge/index.tsx b/packages/ui/src/components/Badge/index.tsx new file mode 100644 index 00000000..760c8269 --- /dev/null +++ b/packages/ui/src/components/Badge/index.tsx @@ -0,0 +1,7 @@ +import Styled, { BadgeProps } from './Badge.style'; + +const Badge = ({ colorTheme, children }: React.PropsWithChildren) => { + return {children}; +}; + +export default Badge; diff --git a/packages/ui/src/components/index.ts b/packages/ui/src/components/index.ts index 8b4d570e..644c62ed 100644 --- a/packages/ui/src/components/index.ts +++ b/packages/ui/src/components/index.ts @@ -1,5 +1,6 @@ import ThemeProvider from './ThemeProvider'; import Button from './Button'; import TextButton from './TextButton'; +import Badge from './Badge'; -export { ThemeProvider, Button, TextButton }; +export { ThemeProvider, Button, TextButton, Badge }; diff --git a/packages/ui/src/systems/palette.ts b/packages/ui/src/systems/palette.ts index ec2ea27d..0e2a7136 100644 --- a/packages/ui/src/systems/palette.ts +++ b/packages/ui/src/systems/palette.ts @@ -10,7 +10,25 @@ const palette = { success: '#52C41A', link: '#1890FF', }, + purple: { + main: '#B150FF', + sub: '#E6C8FE', + }, + blue: { + main: '#2B7BE9', + sub: '#C8E7FE', + }, + green: { + main: '#52C41A', + sub: '#CCF3BA', + }, + red: { + main: '#FF5A14', + sub: '#FFCFBA', + }, grey: { + main: '#87909B', + sub: '#EAECEF', w: '#FFFFFF', g00: '#F8F9FA', g10: '#F2F3F5',