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] Chip 컴포넌트 구현 #27

Merged
merged 25 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6befcc7
feat: button 타입 설정, Chip 컴포넌트 Compound 구성
eugene028 May 25, 2024
69858fe
feat: Chip 모양새 거의 다 다듬어 감
eugene028 May 25, 2024
6c92cd4
feat: Chip Storybook 문서 다듬기
eugene028 May 25, 2024
7955b59
chore: 주석 제거
eugene028 May 25, 2024
41cd9d6
chore: ally 테스트 통과하기 위해
eugene028 May 25, 2024
ed165bf
chore: 접근성 테스트 직접 해보기
eugene028 May 25, 2024
25039d9
chore: 코드리뷰 반영
eugene028 May 28, 2024
1573082
chore:코드리뷰 반영2
eugene028 May 29, 2024
98cb8b3
refac: 디자인 명세 교체에 따른 Chip 컴포넌트 동작 방식 수정
eugene028 May 30, 2024
c1781b0
refac: disabled 속성 추가
eugene028 May 30, 2024
52ff6ca
chore: 오타 수정 및 docs 테스트
eugene028 May 30, 2024
5c288c7
fix: 빌드 에러 제거
eugene028 May 30, 2024
0687839
chore: displayName 추가
eugene028 Jun 1, 2024
f48dd80
chore: 버전업
eugene028 Jun 1, 2024
9c0bb91
chore: 없어졌던 clickable 추가
eugene028 Jun 1, 2024
b217e4d
feat: clickable
eugene028 Jun 1, 2024
2663e90
fix: 모든 내용 해결
eugene028 Jun 5, 2024
5a0a182
fix: 코드리뷰 반영
eugene028 Jun 7, 2024
13897a2
fix: 코드리뷰 반영
eugene028 Jun 7, 2024
a885cd2
chore: eslint 해결?
eugene028 Jun 7, 2024
a516c35
fix: ref 타입 미정
eugene028 Jun 7, 2024
c0109bd
fix: 마지막 코드리뷰
eugene028 Jun 7, 2024
fe49ab2
fix: 디펜던시 수정
eugene028 Jun 7, 2024
f3457f3
fix: a11y 설정 변경
eugene028 Jun 7, 2024
5883463
fix: test-runner 설정 변경
eugene028 Jun 7, 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ styled-system-studio

*storybook.log

.eslintcache
eslintcache
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"eslint.workingDirectories": [{ "mode": "auto" }],
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.tsdk": "node_modules/typescript/lib"
}
56 changes: 56 additions & 0 deletions apps/wow-docs/styled-system/tokens/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,62 @@ const tokens = {
value: "#051108",
variable: "var(--colors-green-950)",
},
"colors.mono.50": {
value: "#F7F7F7",
variable: "var(--colors-mono-50)",
},
"colors.mono.100": {
value: "#F0F0F0",
variable: "var(--colors-mono-100)",
},
"colors.mono.150": {
value: "#E8E8E8",
variable: "var(--colors-mono-150)",
},
"colors.mono.200": {
value: "#E1E1E1",
variable: "var(--colors-mono-200)",
},
"colors.mono.300": {
value: "#D1D1D1",
variable: "var(--colors-mono-300)",
},
"colors.mono.400": {
value: "#C2C2C2",
variable: "var(--colors-mono-400)",
},
"colors.mono.500": {
value: "#B3B3B3",
variable: "var(--colors-mono-500)",
},
"colors.mono.600": {
value: "#8F8F8F",
variable: "var(--colors-mono-600)",
},
"colors.mono.700": {
value: "#6B6B6B",
variable: "var(--colors-mono-700)",
},
"colors.mono.800": {
value: "#484848",
variable: "var(--colors-mono-800)",
},
"colors.mono.900": {
value: "#242424",
variable: "var(--colors-mono-900)",
},
"colors.mono.950": {
value: "#121212",
variable: "var(--colors-mono-950)",
},
"colors.white": {
value: "#FFFFFF",
variable: "var(--colors-white)",
},
"colors.black": {
value: "#000000",
variable: "var(--colors-black)",
},
"gradients.blueGradientDark": {
value: "linear-gradient(to right, #368FF7, #205694)",
variable: "var(--gradients-blue-gradient-dark)",
Expand Down
31 changes: 31 additions & 0 deletions apps/wow-docs/styled-system/tokens/tokens.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ export type Token =
| "colors.green.850"
| "colors.green.900"
| "colors.green.950"
| "colors.mono.50"
| "colors.mono.100"
| "colors.mono.150"
| "colors.mono.200"
| "colors.mono.300"
| "colors.mono.400"
| "colors.mono.500"
| "colors.mono.600"
| "colors.mono.700"
| "colors.mono.800"
| "colors.mono.900"
| "colors.mono.950"
| "colors.white"
| "colors.black"
| "gradients.blueGradientDark"
| "gradients.blueGradientLight"
| "gradients.redGradientDark"
Expand Down Expand Up @@ -130,6 +144,9 @@ export type ColorPalette =
| "blue"
| "yellow"
| "green"
| "mono"
| "white"
| "black"
| "primary"
| "success"
| "error"
Expand Down Expand Up @@ -207,6 +224,20 @@ export type ColorToken =
| "green.850"
| "green.900"
| "green.950"
| "mono.50"
| "mono.100"
| "mono.150"
| "mono.200"
| "mono.300"
| "mono.400"
| "mono.500"
| "mono.600"
| "mono.700"
| "mono.800"
| "mono.900"
| "mono.950"
| "white"
| "black"
| "primary"
| "success"
| "error"
Expand Down
3 changes: 3 additions & 0 deletions apps/wow-docs/styled-system/types/prop-type.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,9 @@ export interface UtilityValues {
| "blue"
| "yellow"
| "green"
| "mono"
| "white"
| "black"
| "primary"
| "success"
| "error"
Expand Down
16 changes: 16 additions & 0 deletions packages/theme/src/tokens/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ export const colors = defineTokens.colors({
900: { value: color.green900 },
950: { value: color.green950 },
},
mono: {
50: { value: color.mono50 },
100: { value: color.mono100 },
150: { value: color.mono150 },
200: { value: color.mono200 },
300: { value: color.mono300 },
400: { value: color.mono400 },
500: { value: color.mono500 },
600: { value: color.mono600 },
700: { value: color.mono700 },
800: { value: color.mono800 },
900: { value: color.mono900 },
950: { value: color.mono950 },
},
white: { value: color.white },
black: { value: color.black },
});

export const semanticTokens = defineSemanticTokens({
Expand Down
7 changes: 6 additions & 1 deletion packages/wow-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wowds-ui",
"version": "0.0.6",
"version": "0.0.9",
"description": "",
"author": "gdsc-hongik",
"repository": {
Expand Down Expand Up @@ -39,6 +39,11 @@
"types": "./dist/components/Switch/index.d.ts",
"require": "./dist/Switch.cjs",
"import": "./dist/Switch.js"
},
"./Chip": {
"types": "./dist/components/Chip/index.d.ts",
"require": "./dist/Chip.cjs",
"import": "./dist/Chip.js"
}
},
"keywords": [],
Expand Down
11 changes: 10 additions & 1 deletion packages/wow-ui/panda.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import { defineConfig } from "@pandacss/dev";
import { defineConfig, defineGlobalStyles } from "@pandacss/dev";
import { semanticTokens, textStyles, tokens } from "theme";
import { removeUnusedCssVars, removeUnusedKeyframes } from "theme/utils";

const globalCss = defineGlobalStyles({
body: {
div: "border-box",
button: "border-box",
},
});

export default defineConfig({
globalCss,
preflight: true,
minify: true,
watch: true,
outExtension: "js",
polyfill: true,
jsxFramework: "react",
dependencies: ["./src/components/**"],
include: ["./src/**/*.{js,jsx,ts,tsx}"],
exclude: [],
hooks: {
Expand Down
132 changes: 132 additions & 0 deletions packages/wow-ui/src/components/Chip/Chip.stories.ts
eugene028 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
import type { Meta, StoryObj } from "@storybook/react";

import Chip from "@/components/Chip";

const meta = {
title: "UI/Chip",
component: Chip,
tags: ["autodocs"],
parameters: {
componentSubtitle: "칩 컴포넌트",
},
argTypes: {
disabled: {
description: "disabled는 칩 버튼이 비활성화 상태인지 여부를 나타냅니다.",
table: {
type: { summary: "boolean" },
defaultValue: { summary: "false" },
},
control: {
type: "boolean",
},
},
defaultChecked: {
description:
"defaultChecked는 칩 버튼이 처음에 눌려 있는지 여부를 나타냅니다.",
table: {
type: { summary: "boolean" },
defaultValue: { summary: "false" },
},
control: {
type: "boolean",
},
},

isChecked: {
description: "isChecked는 외부에서 제어할 활성 상태를 나타냅니다.",
table: {
type: { summary: "boolean" },
defaultValue: { summary: "false" },
},
control: {
type: "boolean",
},
},
clickable: {
description: "Toggle이 가능한 칩인지에 대한 여부를 확인합니다.",
table: {
type: { summary: "boolean" },
defaultValue: { summary: "true" },
},
control: {
type: "boolean",
},
},
label: {
description: "칩에 들어가게 될 텍스트입니다.",
table: {
type: { summary: "string" },
},
type: {
name: "string",
required: true,
},
control: {
type: "text",
},
},
onClick: {
description: "칩 클릭 시 동작할 이벤트입니다.",
table: {
type: { summary: "() => void" },
control: {
type: "function",
},
},
},
onDelete: {
description: "칩에 대한 필터를 제거하기 위한 함수입니다.",
table: {
type: { summary: "() => void" },
control: {
type: "function",
},
},
},
onKeyDown: {
description:
"칩이 포커스됐을 때 엔터 키 또는 스페이스 바를 눌렀을 때 동작할 이벤트입니다.",
table: {
type: { summary: "() => void" },
control: {
type: "function",
},
},
},
},
} satisfies Meta<typeof Chip>;

export default meta;

type Story = StoryObj<typeof meta>;

export const Default: Story = {
args: {
label: "Chip",
as: "button",
clickable: true,
},
};

export const DivChip: Story = {
args: {
label: "Chip",
clickable: false,
as: "div",
},
};
export const DisabledChip: Story = {
args: {
label: "Chip",
clickable: true,
disabled: true,
as: "button",
},
};

export const NonClickable: Story = {
args: {
label: "Chip",
clickable: false,
},
};
Loading
Loading