Skip to content
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

Feature/#080 panda css 라이브러리 설정 #91

Merged
merged 29 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5e49074
build: panda css 라이브러리 설치
pipisebastian Nov 9, 2024
1d96a24
Merge branch 'Feature/#081_eslint_에러안뜨는_버그_픽스' of https://github.com/…
pipisebastian Nov 9, 2024
309dbd1
Merge branch 'dev' of https://github.com/boostcampwm-2024/web33-Nocta…
pipisebastian Nov 9, 2024
c166beb
chore: import 순서정렬 플러그인 설치
pipisebastian Nov 10, 2024
4d62b96
refactor: 필요없는 svg 파일 삭제
pipisebastian Nov 10, 2024
ac6ab36
chore: panda eslint 플러그인 설치
pipisebastian Nov 10, 2024
1de79f5
chore: panda eslint 순서 정렬 플러그인 설치
pipisebastian Nov 10, 2024
beb09a0
feat: plus svg 아이콘 추가
pipisebastian Nov 10, 2024
d96795a
feat: 배경 이미지 추가
pipisebastian Nov 10, 2024
56500c3
feat: 토큰 추가
pipisebastian Nov 10, 2024
7d74788
feat: 글래스모피즘 레시피 추가
pipisebastian Nov 10, 2024
aac2aa0
feat: 타이포그래피 추가
pipisebastian Nov 10, 2024
e9aa05c
feat: 전역 스타일 추가
pipisebastian Nov 10, 2024
0850fc0
feat: 토큰, 레시피, 전역 스타일 적용
pipisebastian Nov 10, 2024
5780506
feat: sidebar 컴포넌트 구현
pipisebastian Nov 10, 2024
a863b6a
feat: icon Recipe 구현
pipisebastian Nov 10, 2024
290f933
refactor: icon Recipe 제거
pipisebastian Nov 10, 2024
bc92668
feat: icon button 컴포넌트 구현
pipisebastian Nov 10, 2024
53e1c91
feat: button navigator 컴포넌트 구현
pipisebastian Nov 10, 2024
d333e2c
refactor: icon button 추가할 기능 주석 추가
pipisebastian Nov 10, 2024
eed3e24
feat: edtior 컴포넌트 틀 구현
pipisebastian Nov 10, 2024
8adc5e9
feat: page 컴포넌트 구현
pipisebastian Nov 10, 2024
7ac9bba
feat: workspace 컴포넌트 구현
pipisebastian Nov 10, 2024
967cb61
Merge branch 'dev' of https://github.com/boostcampwm-2024/web33-Nocta…
pipisebastian Nov 11, 2024
a3401b0
fix: setting 경로 오류 수정
pipisebastian Nov 11, 2024
52dc526
refactor: 필요없는 import문 제거
pipisebastian Nov 11, 2024
4130658
refactor: import 순서 변경
pipisebastian Nov 11, 2024
9edf1d3
refactor: bottomNavigator 파일명 오타 수정
pipisebastian Nov 11, 2024
316d21c
chore: panda css 빌드파일 eslint 규칙 제외하도록
pipisebastian Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"printWidth": 100,
"tabWidth": 2,
"jsxSingleQuote": false,
"singleQuote": false
"singleQuote": false,

"plugins": ["@pandabox/prettier-plugin"],
"pandaFirstProps": ["as", "className", "layerStyle", "textStyle"],
"pandaStylePropsFirst": true,
"pandaSortOtherProps": true
}
4 changes: 4 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?

## Panda
styled-system
styled-system-studio
44 changes: 43 additions & 1 deletion client/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import jsxA11y from "eslint-plugin-jsx-a11y";
import { fileURLToPath } from "url";
import { dirname, resolve } from "path";
import rootConfig from "../eslint.config.js";
import panda from "@pandacss/eslint-plugin";
import pandabox from "@pandabox/prettier-plugin";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand All @@ -14,10 +16,13 @@ export default [

{
files: ["src/**/*.{ts,tsx}"],
ignores: ["styled-system"],
plugins: {
react,
"react-hooks": reactHooks,
"jsx-a11y": jsxA11y,
"@pandacss": panda,
"@pandabox": pandabox,
},
languageOptions: {
parserOptions: {
Expand Down Expand Up @@ -70,17 +75,54 @@ export default [
"jsx-a11y/click-events-have-key-events": "warn",
"jsx-a11y/no-static-element-interactions": "warn",
"jsx-a11y/label-has-associated-control": "warn",

// import 순서
"import/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type",
],
pathGroups: [
{
pattern: "@/**",
group: "internal",
},
],
alphabetize: {
order: "asc",
},
},
],

...panda.configs.recommended.rules,
"@pandacss/no-config-function-in-source": "off",
"@pandacss/prefer-longhand-properties": "error",
},
settings: {
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: resolve(__dirname, "./tsconfig.json"),
project: "./tsconfig.json",
},
},
react: {
version: "detect",
},
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"],
},
"import/internal-regex": "^@/",
},
},
];
8 changes: 7 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
"dev": "vite --host",
"build": "tsc -b && vite build",
"lint": "eslint \"src/**/*.{ts,tsx}\" --fix",
"preview": "vite preview"
"preview": "vite preview",
"prepare": "panda codegen"
},
"dependencies": {
"@pandabox/panda-plugins": "^0.0.8",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"socket.io-client": "^4.8.1"
},
"devDependencies": {
"@pandabox/prettier-plugin": "^0.1.3",
"@pandacss/dev": "^0.47.1",
"@pandacss/eslint-plugin": "^0.2.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
Expand All @@ -23,6 +28,7 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.14",
"prettier": "^3.0.0",
"vite": "^5.4.10",
"vite-tsconfig-paths": "^5.1.0"
}
Expand Down
30 changes: 30 additions & 0 deletions client/panda.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig } from "@pandacss/dev";
import { radii } from "@styles/tokens/radii";
import { colors } from "@styles/tokens/color";
import { shadows } from "@styles/tokens/shadow";
import { spacing } from "@styles/tokens/spacing";
import { textStyles } from "@styles/typography";
import { globalStyles } from "@styles/global";
import { glassContainerRecipe } from "@styles/recipes/glassContainerRecipe";

export default defineConfig({
preflight: true,
include: ["./src/**/*.{js,jsx,ts,tsx}", "./pages/**/*.{js,jsx,ts,tsx}"],
exclude: [],
globalCss: globalStyles,
theme: {
extend: {
tokens: {
colors,
radii,
shadows,
spacing,
},
recipes: {
glassContainer: glassContainerRecipe,
},
textStyles,
},
},
outdir: "styled-system",
});
5 changes: 5 additions & 0 deletions client/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
'@pandacss/dev/postcss': {},
},
}
1 change: 0 additions & 1 deletion client/public/vite.svg

This file was deleted.

42 changes: 0 additions & 42 deletions client/src/App.css

This file was deleted.

24 changes: 3 additions & 21 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
import { useState } from "react";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import "./App.css";
import WorkSpace from "@features/workSpace/WorkSpace";

const App = () => {
const [count, setCount] = useState(0);
// TODO 라우터, react query 설정

return (
<>
<div>
<a href="https://vite.dev" target="_blank">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>count is {count}</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">Click on the Vite and React logos to learn more</p>
<WorkSpace />
</>
);
};
Expand Down
4 changes: 4 additions & 0 deletions client/src/assets/icons/plusIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/src/assets/images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion client/src/assets/react.svg

This file was deleted.

24 changes: 24 additions & 0 deletions client/src/components/bottomNavigator/BottomNavigator.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { css, cx } from "@styled-system/css";
import { glassContainer } from "@styled-system/recipes";

export const bottomNavigatorContainer = cx(
glassContainer({
borderRadius: "top",
}),
css({
display: "flex",
zIndex: 1000,
position: "fixed",
left: "50%",
bottom: 0,
transform: "translateX(-50%)",
gap: "lg",
justifyContent: "center",
alignItems: "center",
minWidth: "360px",
height: "88px",
padding: "sm",
paddingBottom: "lg",
background: "white/60",
}),
);
30 changes: 30 additions & 0 deletions client/src/components/bottomNavigator/BottomNavigator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { IconButton } from "@components/button/IconButton";
import { bottomNavigatorContainer } from "./BottomNavigator.style";

interface NavItem {
id: number;
icon: string;
}

export const BottomNavigator = () => {
const items: NavItem[] = [
{
id: 1,
icon: "🏠",
},
{
id: 2,
icon: "🔍",
},
{
id: 3,
icon: "📚",
},
];

return (
<div className={bottomNavigatorContainer}>
{items?.map(({ id, icon }) => <IconButton icon={icon} key={id} size="md" />)}
</div>
);
};
48 changes: 48 additions & 0 deletions client/src/components/button/IconButton.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { cva } from "@styled-system/css";

export const iconButtonContainer = cva({
base: {
display: "flex",

justifyContent: "center",
alignItems: "center",
borderRadius: "xs",
background: "white",
"&:hover": {
cursor: "pointer",
},
},
variants: {
size: {
sm: {
width: "44px",
height: "44px",
boxShadow: "sm",
},
md: {
width: "52px",
height: "52px",
boxShadow: "md",
},
},
},
defaultVariants: {
size: "md",
},
});

export const iconBox = cva({
variants: {
size: {
sm: {
fontSize: "24px",
},
md: {
fontSize: "30px",
},
},
},
defaultVariants: {
size: "md",
},
});
16 changes: 16 additions & 0 deletions client/src/components/button/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { iconButtonContainer, iconBox } from "./IconButton.style";

interface IconButtonProps {
icon: string;
size: "sm" | "md";
onClick?: () => void;
}

export const IconButton = ({ icon, size, onClick }: IconButtonProps) => {
// TODO 추후 svg 파일을 받아올 수 있도록 수정 (사이드바 - 페이지 추가 버튼)
return (
<button className={iconButtonContainer({ size })} onClick={onClick}>
<span className={iconBox({ size })}>{icon}</span>
</button>
);
};
23 changes: 23 additions & 0 deletions client/src/components/sidebar/MenuButton.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { css } from "@styled-system/css";

export const menuItemWrapper = css({
display: "flex",
gap: "lg",
alignItems: "center",
borderRightRadius: "md",
width: "300px",
padding: "md",
boxShadow: "sm",
});

export const imageBox = css({
borderRadius: "sm",
width: "50px",
height: "50px",
overflow: "hidden",
});

export const textBox = css({
textStyle: "display-medium20",
color: "gray.900",
});
Loading
Loading