Skip to content

Commit

Permalink
feat: @boolti/ui 패키지 추가, 버튼 컴포넌트 추가 (#15)
Browse files Browse the repository at this point in the history
* feat: ui 패키지 생성 및 파일 이동

* refac: 폴더 구조 정리

* feat: 버튼 베이스 컴포넌트 추가

* feat: 색상, 사이즈 관련 타입 추가 초기 작업 스타일 추가

* fix: 잘못 임포트한 것 수정

* feat: 기본 사이즈, 색상 관련 스타일 추가

* feat: 아이콘 관련 스타일 추가

* feat: 변경된 값 반영

* feat: 버튼 hover, active, disabled 스타일 추가

* feat: ui 패키지에도 breakpoint 타입 추가

* fix: 타입 오류 수정

* fix: 화살표 함수로 변경
  • Loading branch information
alstn2468 authored Jan 27, 2024
1 parent 8312a9b commit 1e9fd8d
Show file tree
Hide file tree
Showing 21 changed files with 454 additions and 15 deletions.
37 changes: 31 additions & 6 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"@boolti/api": "*",
"@boolti/ui": "*",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QueryClientProvider } from '@boolti/api';
import { createBrowserRouter, RouterProvider, Navigate } from 'react-router-dom';
import ThemeProvider from './styles/ThemeProvider';
import { ThemeProvider } from '@boolti/ui';
import LoginPage from './pages/Login/LoginPage';
import SignUpCompletePage from './pages/SignUpComplete/SignUpCompletePage';
import 'the-new-css-reset/css/reset.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import '@emotion/react';

import palette from './palette';
import typo from './typo';
import breakpoint from './breakpoint';
import { palette, typo, breakpoint } from '@boolti/ui';

declare module '@emotion/react' {
export interface Theme {
Expand Down
1 change: 1 addition & 0 deletions apps/preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"preview": "vite preview"
},
"dependencies": {
"@boolti/ui": "*",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"react": "^18.2.0",
Expand Down
189 changes: 188 additions & 1 deletion apps/preview/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,192 @@
import { Button, ThemeProvider } from '@boolti/ui';

const Icon = () => (
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
fillRule="evenodd"
clipRule="evenodd"
d="M10 18C14.4183 18 18 14.4183 18 10C18 5.58172 14.4183 2 10 2C5.58172 2 2 5.58172 2 10C2 14.4183 5.58172 18 10 18ZM10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z"
fill="currentColor"
/>
</svg>
);

const App = () => {
return <h1>Preview</h1>;
return (
<ThemeProvider>
<h1>
Preview
<div
style={{
display: 'flex',
width: 1200,
justifyContent: 'space-between',
marginBottom: 20,
alignItems: 'flex-end',
}}
>
<Button size="bold" colorTheme="primary">
BUTTON
</Button>
<Button size="medium" colorTheme="primary">
BUTTON
</Button>
<Button size="regular" colorTheme="primary">
BUTTON
</Button>
<Button size="small" colorTheme="primary">
BUTTON
</Button>
<Button size="x-small" colorTheme="primary">
BUTTON
</Button>
<Button size="x-small" colorTheme="primary" disabled>
BUTTON
</Button>
</div>
<div
style={{
display: 'flex',
width: 1200,
justifyContent: 'space-between',
marginBottom: 20,
alignItems: 'flex-end',
}}
>
<Button icon={<Icon />} size="bold" colorTheme="primary">
BUTTON
</Button>
<Button icon={<Icon />} size="medium" colorTheme="primary">
BUTTON
</Button>
<Button icon={<Icon />} size="regular" colorTheme="primary">
BUTTON
</Button>
<Button icon={<Icon />} size="small" colorTheme="primary">
BUTTON
</Button>
<Button icon={<Icon />} size="x-small" colorTheme="primary">
BUTTON
</Button>
<Button icon={<Icon />} size="x-small" colorTheme="primary" disabled>
BUTTON
</Button>
</div>
<div
style={{
display: 'flex',
width: 1200,
justifyContent: 'space-between',
marginBottom: 20,
alignItems: 'flex-end',
}}
>
<Button icon={<Icon />} size="bold" colorTheme="netural">
BUTTON
</Button>
<Button icon={<Icon />} size="medium" colorTheme="netural">
BUTTON
</Button>
<Button icon={<Icon />} size="regular" colorTheme="netural">
BUTTON
</Button>
<Button icon={<Icon />} size="small" colorTheme="netural">
BUTTON
</Button>
<Button icon={<Icon />} size="x-small" colorTheme="netural">
BUTTON
</Button>
<Button icon={<Icon />} size="x-small" colorTheme="netural" disabled>
BUTTON
</Button>
</div>
<div
style={{
display: 'flex',
width: 1200,
justifyContent: 'space-between',
marginBottom: 20,
alignItems: 'flex-end',
}}
>
<Button size="bold" colorTheme="netural">
BUTTON
</Button>
<Button size="medium" colorTheme="netural">
BUTTON
</Button>
<Button size="regular" colorTheme="netural">
BUTTON
</Button>
<Button size="small" colorTheme="netural">
BUTTON
</Button>
<Button size="x-small" colorTheme="netural">
BUTTON
</Button>
<Button size="x-small" colorTheme="netural" disabled>
BUTTON
</Button>
</div>
<div
style={{
display: 'flex',
width: 1200,
justifyContent: 'space-between',
marginBottom: 20,
alignItems: 'flex-end',
}}
>
<Button icon={<Icon />} size="bold" colorTheme="line">
BUTTON
</Button>
<Button icon={<Icon />} size="medium" colorTheme="line">
BUTTON
</Button>
<Button icon={<Icon />} size="regular" colorTheme="line">
BUTTON
</Button>
<Button icon={<Icon />} size="small" colorTheme="line">
BUTTON
</Button>
<Button icon={<Icon />} size="x-small" colorTheme="line">
BUTTON
</Button>
<Button icon={<Icon />} size="x-small" colorTheme="line" disabled>
BUTTON
</Button>
</div>
<div
style={{
display: 'flex',
width: 1200,
justifyContent: 'space-between',
marginBottom: 20,
alignItems: 'flex-end',
}}
>
<Button size="bold" colorTheme="line">
BUTTON
</Button>
<Button size="medium" colorTheme="line">
BUTTON
</Button>
<Button size="regular" colorTheme="line">
BUTTON
</Button>
<Button size="small" colorTheme="line">
BUTTON
</Button>
<Button size="x-small" colorTheme="line">
BUTTON
</Button>
<Button size="x-small" colorTheme="line" disabled>
BUTTON
</Button>
</div>
</h1>
</ThemeProvider>
);
};

export default App;
11 changes: 11 additions & 0 deletions apps/preview/src/emotion.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import '@emotion/react';

import { palette, typo, breakpoint } from '@boolti/ui';

declare module '@emotion/react' {
export interface Theme {
palette: typeof palette;
typo: typeof typo;
breakpoint: typeof breakpoint;
}
}
24 changes: 24 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "@boolti/ui",
"private": true,
"version": "0.0.0",
"type": "module",
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0"
},
"dependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@boolti/eslint-config": "*",
"@boolti/typescript-config": "*",
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"typescript": "^5.2.2"
}
}
Loading

0 comments on commit 1e9fd8d

Please sign in to comment.