@pylerai/design-system 1.2.4 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +183 -307
- package/dist/components/ui/badge.d.ts +2 -1
- package/dist/components/ui/badge.js +49 -0
- package/dist/components/ui/body.js +52 -0
- package/dist/components/ui/button.d.ts +2 -1
- package/dist/components/ui/button.js +172 -0
- package/dist/components/ui/calendar.js +275 -0
- package/dist/components/ui/checkbox.d.ts +7 -0
- package/dist/components/ui/checkbox.js +45 -0
- package/dist/components/ui/chip.d.ts +4 -3
- package/dist/components/ui/chip.js +66 -0
- package/dist/components/ui/dropdown.d.ts +8 -2
- package/dist/components/ui/dropdown.js +256 -0
- package/dist/components/ui/headline.js +50 -0
- package/dist/components/ui/input.d.ts +3 -2
- package/dist/components/ui/input.js +129 -0
- package/dist/components/ui/label.js +43 -0
- package/dist/components/ui/loading-bar.d.ts +2 -1
- package/dist/components/ui/loading-bar.js +64 -0
- package/dist/components/ui/modal.d.ts +3 -2
- package/dist/components/ui/modal.js +170 -0
- package/dist/components/ui/pagination.js +106 -0
- package/dist/components/ui/radio.d.ts +7 -0
- package/dist/components/ui/radio.js +42 -0
- package/dist/components/ui/search-field.d.ts +3 -2
- package/dist/components/ui/search-field.js +98 -0
- package/dist/components/ui/table.js +206 -0
- package/dist/components/ui/tabs.js +149 -0
- package/dist/components/ui/tag.d.ts +2 -1
- package/dist/components/ui/tag.js +31 -0
- package/dist/components/ui/tips.d.ts +2 -1
- package/dist/components/ui/tips.js +25 -0
- package/dist/components/ui/toast.js +70 -0
- package/dist/components/ui/toggle.d.ts +1 -2
- package/dist/components/ui/toggle.js +41 -0
- package/dist/components/ui/use-modal.js +94 -0
- package/dist/fonts/PretendardJPVariable.subset.0.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.1.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.10.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.100.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.101.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.102.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.103.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.104.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.105.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.106.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.107.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.108.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.109.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.11.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.110.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.111.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.112.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.113.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.114.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.115.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.116.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.117.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.118.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.12.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.13.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.14.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.15.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.16.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.17.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.18.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.19.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.2.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.20.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.21.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.22.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.23.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.24.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.25.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.26.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.27.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.28.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.29.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.3.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.30.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.31.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.32.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.33.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.34.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.35.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.36.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.37.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.38.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.39.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.4.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.40.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.41.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.42.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.43.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.44.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.45.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.46.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.47.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.48.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.49.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.5.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.50.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.51.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.52.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.53.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.54.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.55.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.56.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.57.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.58.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.59.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.6.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.60.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.61.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.62.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.63.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.64.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.65.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.66.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.67.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.68.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.69.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.7.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.70.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.71.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.72.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.73.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.74.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.75.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.76.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.77.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.78.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.79.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.8.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.80.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.81.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.82.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.83.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.84.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.85.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.86.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.87.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.88.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.89.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.9.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.90.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.91.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.92.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.93.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.94.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.95.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.96.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.97.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.98.woff2 +0 -0
- package/dist/fonts/PretendardJPVariable.subset.99.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.0.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.1.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.10.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.11.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.12.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.13.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.14.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.15.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.16.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.17.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.18.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.19.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.2.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.20.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.21.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.22.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.23.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.24.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.25.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.26.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.27.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.28.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.29.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.3.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.30.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.31.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.32.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.33.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.34.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.35.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.36.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.37.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.38.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.39.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.4.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.40.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.41.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.42.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.43.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.44.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.45.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.46.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.47.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.48.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.49.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.5.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.50.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.51.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.52.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.53.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.54.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.55.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.56.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.57.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.58.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.59.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.6.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.60.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.61.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.62.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.63.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.64.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.65.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.66.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.67.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.68.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.69.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.7.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.70.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.71.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.72.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.73.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.74.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.75.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.76.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.77.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.78.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.79.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.8.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.80.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.81.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.82.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.83.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.84.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.85.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.86.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.87.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.88.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.89.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.9.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.90.woff2 +0 -0
- package/dist/fonts/PretendardVariable.subset.91.woff2 +0 -0
- package/dist/fonts.css +2018 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +75 -5779
- package/dist/lib/icons.js +225 -0
- package/dist/lib/size.d.ts +8 -0
- package/dist/lib/use-dialog-a11y.d.ts +2 -0
- package/dist/lib/use-dialog-a11y.js +50 -0
- package/dist/lib/utils.js +16 -0
- package/dist/style.css +1 -1
- package/dist/tokens/pyler-light.js +134 -0
- package/dist/tokens/typography.js +84 -0
- package/package.json +22 -5
- package/pyler-tailwind-colors.cjs +4 -0
- package/dist/index.css.d.ts +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Pyler Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,120 +1,74 @@
|
|
|
1
1
|
# @pylerai/design-system
|
|
2
2
|
|
|
3
|
-
Pyler Frontend를 위한 디자인 시스템 패키지 (
|
|
3
|
+
Pyler Frontend를 위한 디자인 시스템 패키지 (React + TypeScript + Tailwind CSS)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- **패키지명**: `@pylerai/design-system`
|
|
8
|
-
- **버전**: 
|
|
9
|
-
- **라이선스**: ISC
|
|
10
|
-
- **레지스트리**: npm (registry.npmjs.org, public)
|
|
11
|
-
- **기술 스택**: React + TypeScript + Tailwind CSS + shadcn/ui + Storybook + Vitest
|
|
5
|
+
📖 **[Storybook](https://pylerai.github.io/design-system/)** — 모든 컴포넌트의 렌더링 결과와 전체 prop 문서는 여기서 확인하세요.
|
|
12
6
|
|
|
13
|
-
|
|
7
|
+
> 이 README는 Storybook이 알려줄 수 없는 것(설치·Tailwind 연동·토큰 사용법·릴리스 절차)만 다룹니다.
|
|
8
|
+
> 컴포넌트별 prop 목록은 Storybook autodocs가 소스에서 자동 생성하므로 여기에 중복해 적지 않습니다 —
|
|
9
|
+
> 같은 내용을 두 곳에 두면 한쪽이 반드시 낡습니다.
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
## 📦 패키지 정보
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
- **패키지명**: `@pylerai/design-system` 
|
|
14
|
+
- **레지스트리**: public npm (`registry.npmjs.org`) — 별도 인증 불필요
|
|
15
|
+
- **라이선스**: MIT ([LICENSE](./LICENSE))
|
|
16
|
+
- **peer 의존성**: React 18 또는 19
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
> [CHANGELOG](./CHANGELOG.md) · [CONTRIBUTING](./CONTRIBUTING.md)
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
## 🚀 설치
|
|
22
21
|
|
|
23
22
|
```bash
|
|
24
23
|
npm install @pylerai/design-system
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#### 2. Tailwind CSS 설정
|
|
26
|
+
### 1. 스타일 로드
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
앱 진입점에서 한 번만 로드합니다.
|
|
32
29
|
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
content: [
|
|
36
|
-
"./src/**/*.{js,jsx,ts,tsx}",
|
|
37
|
-
"./node_modules/@pylerai/design-system/**/*.{js,ts,jsx,tsx}", // 추가
|
|
38
|
-
],
|
|
39
|
-
// ...
|
|
40
|
-
};
|
|
30
|
+
```typescript
|
|
31
|
+
import "@pylerai/design-system/style.css";
|
|
41
32
|
```
|
|
42
33
|
|
|
43
|
-
|
|
34
|
+
CSS 파일에서 `@import` 해도 동일합니다.
|
|
44
35
|
|
|
45
36
|
```css
|
|
46
37
|
@tailwind base;
|
|
47
38
|
@tailwind components;
|
|
48
39
|
@tailwind utilities;
|
|
49
40
|
|
|
50
|
-
/* 디자인 시스템 스타일 (컴포넌트 + Pyler 컬러 변수 등) */
|
|
51
41
|
@import "@pylerai/design-system/style.css";
|
|
52
42
|
```
|
|
53
43
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
```typescript
|
|
57
|
-
import "@pylerai/design-system/style.css";
|
|
58
|
-
```
|
|
44
|
+
> 구버전 번들러에서 서브패스가 동작하지 않으면 `@pylerai/design-system/dist/style.css`를 사용하세요.
|
|
59
45
|
|
|
60
|
-
|
|
46
|
+
#### 폰트
|
|
61
47
|
|
|
62
|
-
|
|
48
|
+
`style.css`의 `--ds-font-sans`는 `"Pretendard JP", Pretendard, …` 라는 **이름**만 선언합니다. 그 이름을 실제로 등록하는 `@font-face`는 `fonts.css`에 있으므로 둘을 같이 로드합니다.
|
|
63
49
|
|
|
64
50
|
```typescript
|
|
65
|
-
import
|
|
66
|
-
|
|
67
|
-
function App() {
|
|
68
|
-
return (
|
|
69
|
-
<div className="p-4">
|
|
70
|
-
<Button>클릭하세요</Button>
|
|
71
|
-
<Button variant="outline">외곽선</Button>
|
|
72
|
-
<Button variant="destructive">삭제</Button>
|
|
73
|
-
</div>
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### 컬러 토큰 (Pyler Light)
|
|
79
|
-
|
|
80
|
-
Figma Light 모드와 동일한 HEX를 **TypeScript 상수**, **CSS 변수 (`--ds-*`)**, **Tailwind `ds` 팔레트**로 제공합니다. 앱 코드에 HEX를 직접 쓰지 말고 패키지 토큰을 참조하세요.
|
|
81
|
-
|
|
82
|
-
#### TypeScript에서 HEX·경로 사용
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
import {
|
|
86
|
-
PYLER_LIGHT_COLOR_TOKENS,
|
|
87
|
-
flatPylerLightTokens,
|
|
88
|
-
getDsCssVar,
|
|
89
|
-
} from "@pylerai/design-system";
|
|
90
|
-
|
|
91
|
-
// 중첩 객체
|
|
92
|
-
const strong = PYLER_LIGHT_COLOR_TOKENS.text.strong.hex; // "#333333"
|
|
93
|
-
|
|
94
|
-
// 순회·문서화용 플랫 리스트
|
|
95
|
-
flatPylerLightTokens.forEach(({ path, hex, cssVar }) => {
|
|
96
|
-
console.log(path, hex, cssVar);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
// CSS 변수 이름
|
|
100
|
-
getDsCssVar("text.strong"); // => "--ds-text-strong"
|
|
51
|
+
import "@pylerai/design-system/style.css";
|
|
52
|
+
import "@pylerai/design-system/fonts.css";
|
|
101
53
|
```
|
|
102
54
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
`style.css`를 로드한 뒤 임의 요소에 적용합니다.
|
|
55
|
+
그리고 앱의 전역 스타일은 폰트 이름을 직접 쓰지 않고 변수만 참조합니다.
|
|
106
56
|
|
|
107
57
|
```css
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
border-color: var(--ds-line-strong);
|
|
111
|
-
background-color: var(--ds-surface-normal);
|
|
58
|
+
body {
|
|
59
|
+
font-family: var(--ds-font-sans);
|
|
112
60
|
}
|
|
113
61
|
```
|
|
114
62
|
|
|
115
|
-
|
|
63
|
+
- **앱에서 Pretendard를 따로 로드하지 않습니다** — `next/font`, `public/fonts`, CDN `<link>` 모두 해당. 이름이 한 글자만 어긋나도 스택이 매칭에 실패해 OS 폰트나 세리프로 조용히 떨어집니다(aid-frontend PF-3757). Montserrat 등 앱 고유의 장식 폰트는 이 규칙과 무관합니다.
|
|
64
|
+
- `--ds-font-sans`를 앱에서 덮어쓰지 않습니다. `next/font` 변수로 바꿔 끼우던 방식은 폐기했습니다.
|
|
65
|
+
- 폰트는 npm `pretendard-jp`·`pretendard`의 **가변 다이나믹 서브셋**입니다. `unicode-range`로 쪼개져 화면에 쓰인 글자 범위 조각만 내려받습니다(요청 수는 늘고 총량은 줍니다). JP 서브셋은 한글 range를 선언하지 않아 한글은 2순위 Pretendard가 받으며, 두 폰트의 한글·라틴 아웃라인과 메트릭은 같습니다.
|
|
66
|
+
- `fonts.css`는 `:root { font-feature-settings: "ss05" }`를 함께 켭니다. Pretendard JP의 기본 자형은 일본어 관습(괄호·구두점 위치, 공용 한자)이라 벤더 지침대로 한국어 자형으로 맞추는 것이고, `lang="ja"` 요소는 원래 자형으로 돌아갑니다.
|
|
67
|
+
- 스택 이름과 `fonts.css` 등록 이름이 어긋나면 `npm run check:tokens`가 실패합니다.
|
|
68
|
+
|
|
69
|
+
### 2. Tailwind 연동
|
|
116
70
|
|
|
117
|
-
|
|
71
|
+
프리셋을 사용하면 `ds` 컬러 팔레트·타이포그래피 스케일·radius·shadow가 한 번에 합쳐집니다.
|
|
118
72
|
|
|
119
73
|
```javascript
|
|
120
74
|
// tailwind.config.cjs
|
|
@@ -126,303 +80,225 @@ module.exports = {
|
|
|
126
80
|
],
|
|
127
81
|
theme: {
|
|
128
82
|
extend: {
|
|
129
|
-
/*
|
|
83
|
+
/* 앱 전용 확장 */
|
|
130
84
|
},
|
|
131
85
|
},
|
|
132
86
|
};
|
|
133
87
|
```
|
|
134
88
|
|
|
135
|
-
|
|
89
|
+
이미 `extend.colors`를 쓰고 있어 색상 맵만 필요하다면:
|
|
136
90
|
|
|
137
91
|
```javascript
|
|
138
92
|
const { dsColors } = require("@pylerai/design-system/pyler-tailwind-colors");
|
|
139
93
|
|
|
140
94
|
module.exports = {
|
|
141
|
-
theme: {
|
|
142
|
-
extend: {
|
|
143
|
-
colors: {
|
|
144
|
-
ds: dsColors,
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
95
|
+
theme: { extend: { colors: { ds: dsColors } } },
|
|
148
96
|
};
|
|
149
97
|
```
|
|
150
98
|
|
|
151
|
-
|
|
99
|
+
클래스명을 `bg-ds-${color}`처럼 **동적으로 조합**하면 Tailwind의 content 스캔에 잡히지 않습니다. 그런 경우 앱 config에 safelist를 두세요.
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
safelist: [{ pattern: /^bg-ds-/ }],
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### 3. 사용
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { Button, InputField, Toaster, toast } from "@pylerai/design-system";
|
|
109
|
+
|
|
110
|
+
function App() {
|
|
111
|
+
return (
|
|
112
|
+
<div className="flex flex-col gap-4 p-4">
|
|
113
|
+
<InputField label="이메일" placeholder="you@pyler.tech" require />
|
|
114
|
+
<Button variant="filled" color="blue" size="lg" onClick={() => toast.success("저장했습니다")}>
|
|
115
|
+
저장
|
|
116
|
+
</Button>
|
|
117
|
+
<Toaster />
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
```
|
|
152
122
|
|
|
153
|
-
|
|
123
|
+
## 🧩 컴포넌트
|
|
154
124
|
|
|
155
|
-
|
|
125
|
+
전체 목록입니다. **각 컴포넌트의 prop과 실제 렌더링은 [Storybook](https://pylerai.github.io/design-system/)에서 확인하세요.**
|
|
156
126
|
|
|
157
|
-
|
|
127
|
+
| 카테고리 | export |
|
|
128
|
+
|---|---|
|
|
129
|
+
| Action | `Button`, `ButtonIndicator`, `buttonVariants` |
|
|
130
|
+
| Form | `InputField`, `TextField`, `SearchField`, `Dropdown`, `Checkbox`, `Radio`, `Toggle`, `Calendar` |
|
|
131
|
+
| Data display | `Table`, `TableRoot`, `TableHead`, `TableBody`, `TableRow`, `TableHeaderCell`, `TableCell`, `Pagination` |
|
|
132
|
+
| Status | `Badge`, `Tag`, `Chip`, `Tips`, `LoadingBar` |
|
|
133
|
+
| Feedback | `Toaster`, `toast`, `snackbar`, `SnackbarContent` |
|
|
134
|
+
| Overlay | `InformationModal`, `ActionModal`, `ContentModal`, `ModalProvider`, `useModal` |
|
|
135
|
+
| Navigation | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` |
|
|
136
|
+
| Typography | `Headline`, `Body`, `Label` (+ `headlineVariants`, `bodyVariants`, `labelVariants`) |
|
|
137
|
+
| Types | `DsSize` (전역 사이즈 스케일) |
|
|
138
|
+
| Tokens | `PYLER_LIGHT_COLOR_TOKENS`, `flatPylerLightTokens`, `PYLER_LIGHT_GROUP_ORDER`, `getDsCssVar`, `formatPylerPathForDisplay`, `PYLER_TYPOGRAPHY_STYLE` |
|
|
158
139
|
|
|
159
|
-
###
|
|
140
|
+
### 알아두면 좋은 것
|
|
160
141
|
|
|
161
|
-
|
|
142
|
+
- **`size`는 전 컴포넌트가 `xs | sm | md | lg | xl` 스케일(`DsSize`)을 씁니다.** 컴포넌트마다 지원 범위는 다릅니다 — `Button`/`LoadingBar` `sm~xl`, `InputField`/`SearchField`/`Dropdown`/`ContentModal` `sm~lg`, `Badge`/`Chip`/`Tips` `sm~md`, `Tag` `xs~md`.
|
|
143
|
+
- **`Checkbox`·`Radio`는 라벨 텍스트를 children으로 받습니다** (`<Checkbox>동의</Checkbox>`). 밖에서 `<label>`로 감싸면 label이 중첩됩니다.
|
|
144
|
+
- **`Checkbox`·`Radio`·`Toggle`의 `onChange`는 네이티브 이벤트가 아니라 값을 직접 넘깁니다** (`(checked: boolean) => void`, Radio는 `(value: string) => void`). `react-hook-form`의 `register()` 스프레드와는 그대로 맞물리지 않으니 `Controller`를 쓰세요.
|
|
145
|
+
- **`Checkbox`·`Radio`·`Toggle`·`Dropdown`은 제어 컴포넌트 전용**입니다(`defaultChecked`/`defaultValue` 미지원). `Tabs`만 제어·비제어를 모두 지원합니다.
|
|
146
|
+
- **아이콘은 아직 export되지 않습니다.** Storybook `Foundation/Icon`에서 목록은 볼 수 있지만 패키지에서 import할 수는 없습니다. `Button`의 `leftIcon`/`rightIcon`에는 앱 쪽 아이콘을 넘겨야 합니다.
|
|
162
147
|
|
|
163
|
-
|
|
148
|
+
## 🎨 디자인 토큰
|
|
164
149
|
|
|
165
|
-
|
|
150
|
+
Figma Light 모드와 동일한 값을 **CSS 변수(`--ds-*`)**, **Tailwind `ds` 팔레트**, **TypeScript 상수** 세 가지 형태로 제공합니다. 앱 코드에 HEX를 직접 쓰지 말고 토큰을 참조하세요.
|
|
166
151
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// 기본 사용
|
|
171
|
-
<Headline>페이지 제목</Headline>
|
|
172
|
-
|
|
173
|
-
// Variant
|
|
174
|
-
<Headline variant="h1-20">페이지/섹션 최상위 제목</Headline>
|
|
175
|
-
<Headline variant="h1-20-m">보조 헤드라인</Headline>
|
|
176
|
-
<Headline variant="h1-20-r">큰 본문/설명</Headline>
|
|
177
|
-
<Headline variant="h2-18">섹션 제목</Headline>
|
|
178
|
-
<Headline variant="h2-18-sb">섹션 보조 제목</Headline>
|
|
179
|
-
<Headline variant="h2-18-r">크고 차분한 본문</Headline>
|
|
180
|
-
|
|
181
|
-
// HTML 태그 지정
|
|
182
|
-
<Headline as="h1">H1 태그로 렌더링</Headline>
|
|
183
|
-
<Headline as="h2">H2 태그로 렌더링</Headline>
|
|
184
|
-
```
|
|
152
|
+
> 세 형태의 값이 어긋나지 않도록 `npm run check:tokens`가 CI에서 정합성을 검사합니다.
|
|
153
|
+
> 토큰 값을 바꾸는 기여자용 절차는 [CONTRIBUTING의 "토큰 변경 절차"](./CONTRIBUTING.md#토큰-변경-절차-컬러--타이포그래피)를 참고하세요.
|
|
185
154
|
|
|
186
|
-
|
|
155
|
+
### 컬러
|
|
187
156
|
|
|
188
|
-
|
|
157
|
+
Tailwind 유틸리티가 가장 일반적입니다.
|
|
189
158
|
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
// 기본 사용
|
|
194
|
-
<Body>본문 텍스트입니다.</Body>
|
|
195
|
-
|
|
196
|
-
// Variant
|
|
197
|
-
<Body variant="b1-16">강조 본문</Body>
|
|
198
|
-
<Body variant="b1-16-m">일반 본문(기본)</Body>
|
|
199
|
-
<Body variant="b1-16-r">일반 본문(라이트)</Body>
|
|
200
|
-
<Body variant="b2-14">작은 강조 본문</Body>
|
|
201
|
-
<Body variant="b2-14-m">작은 본문/캡션</Body>
|
|
202
|
-
<Body variant="b2-14-r">캡션/헬퍼텍스트</Body>
|
|
203
|
-
<Body variant="b3-13-m">세부설명/테이블 셀</Body>
|
|
204
|
-
<Body variant="b3-13-r">보조설명</Body>
|
|
205
|
-
<Body variant="b4-12-m">메타/상태</Body>
|
|
206
|
-
<Body variant="b4-12-r">아주 작은 본문</Body>
|
|
207
|
-
|
|
208
|
-
// HTML 태그 지정
|
|
209
|
-
<Body as="p">P 태그로 렌더링</Body>
|
|
210
|
-
<Body as="div">DIV 태그로 렌더링</Body>
|
|
159
|
+
```tsx
|
|
160
|
+
<div className="bg-ds-surface-normal border border-ds-line-normal text-ds-text-strong" />
|
|
211
161
|
```
|
|
212
162
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
폼 요소나 작은 텍스트 라벨을 위한 컴포넌트입니다.
|
|
163
|
+
CSS 변수로도 쓸 수 있습니다.
|
|
216
164
|
|
|
217
|
-
```
|
|
218
|
-
|
|
165
|
+
```css
|
|
166
|
+
.my-title {
|
|
167
|
+
color: var(--ds-text-strong);
|
|
168
|
+
background-color: var(--ds-surface-normal);
|
|
169
|
+
}
|
|
170
|
+
```
|
|
219
171
|
|
|
220
|
-
|
|
221
|
-
<Label>라벨 텍스트</Label>
|
|
172
|
+
TypeScript에서 HEX 값이나 변수명이 필요하면:
|
|
222
173
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
<Label variant="l1-10-r">라벨(비강조)</Label>
|
|
174
|
+
```typescript
|
|
175
|
+
import { PYLER_LIGHT_COLOR_TOKENS, flatPylerLightTokens, getDsCssVar } from "@pylerai/design-system";
|
|
226
176
|
|
|
227
|
-
//
|
|
228
|
-
|
|
229
|
-
|
|
177
|
+
PYLER_LIGHT_COLOR_TOKENS.text.strong.hex; // "#333333"
|
|
178
|
+
getDsCssVar("text.strong"); // "--ds-text-strong"
|
|
179
|
+
flatPylerLightTokens.forEach(({ path, hex, cssVar }) => { /* 문서화·순회용 */ });
|
|
230
180
|
```
|
|
231
181
|
|
|
232
|
-
|
|
182
|
+
토큰 그룹: `primitive` · `main` · `background` · `text` · `line` · `surface` · `primary`(blue/red/green × normal/hovered/disabled/muted) · `category` · `icon`.
|
|
183
|
+
전체 스와치와 HEX는 Storybook **Foundation → Color**에서 확인하세요.
|
|
184
|
+
|
|
185
|
+
### 타이포그래피
|
|
186
|
+
|
|
187
|
+
| 스케일 | 크기 | 굵기 | Tailwind | 순수 CSS 클래스 |
|
|
188
|
+
|---|---|---|---|---|
|
|
189
|
+
| Title 1 SB | 24px | 600 | `text-title-1-sb` | `.ds-type-title-1-sb` |
|
|
190
|
+
| Title 1 M | 24px | 500 | `text-title-1-m` | `.ds-type-title-1-m` |
|
|
191
|
+
| Title 2 SB | 20px | 600 | `text-title-2-sb` | `.ds-type-title-2-sb` |
|
|
192
|
+
| Body 1 M | 16px | 500 | `text-body-1-m` | `.ds-type-body-1-m` |
|
|
193
|
+
| Body 1 R | 16px | 400 | `text-body-1-r` | `.ds-type-body-1-r` |
|
|
194
|
+
| Body 2 SB | 14px | 600 | `text-body-2-sb` | `.ds-type-body-2-sb` |
|
|
195
|
+
| Body 2 M | 14px | 500 | `text-body-2-m` | `.ds-type-body-2-m` |
|
|
196
|
+
| Body 2 R | 14px | 400 | `text-body-2-r` | `.ds-type-body-2-r` |
|
|
197
|
+
| Body 3 M | 13px | 500 | `text-body-3-m` | `.ds-type-body-3-m` |
|
|
198
|
+
| Body 3 R | 13px | 400 | `text-body-3-r` | `.ds-type-body-3-r` |
|
|
199
|
+
| Body 4 M | 12px | 500 | `text-body-4-m` | `.ds-type-body-4-m` |
|
|
200
|
+
| Body 4 R | 12px | 400 | `text-body-4-r` | `.ds-type-body-4-r` |
|
|
201
|
+
| Label 1 R | 11px | 400 | `text-label-1-r` | `.ds-type-label-1-r` |
|
|
202
|
+
|
|
203
|
+
폰트는 Pretendard JP(`--ds-font-sans`)를 사용합니다. `@pylerai/design-system/fonts.css`를 함께 로드하면 등록됩니다(위 "폰트" 절 참고).
|
|
204
|
+
|
|
205
|
+
컴포넌트로 쓸 수도 있습니다. `as`로 태그를, `asChild`로 자식 요소에 스타일만 입힐 수 있습니다.
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
<Headline variant="title-1-sb" as="h1">페이지 제목</Headline>
|
|
209
|
+
<Body variant="body-2-r">본문</Body>
|
|
210
|
+
<Label variant="label-1-r" htmlFor="email">이메일</Label>
|
|
211
|
+
|
|
212
|
+
<Headline asChild variant="title-2-sb">
|
|
213
|
+
<a href="/docs">래퍼 없이 링크에 타이틀 스타일만</a>
|
|
214
|
+
</Headline>
|
|
215
|
+
```
|
|
233
216
|
|
|
234
|
-
|
|
217
|
+
Chakra UI·Emotion 등 CSS-in-JS에서는 `PYLER_TYPOGRAPHY_STYLE`을 `textStyle`/`sx`에 그대로 넘기면 됩니다.
|
|
235
218
|
|
|
236
219
|
```typescript
|
|
237
|
-
import {
|
|
238
|
-
|
|
239
|
-
// 기본 사용
|
|
240
|
-
<Button>클릭하세요</Button>
|
|
241
|
-
|
|
242
|
-
// Variant
|
|
243
|
-
<Button variant="default">기본</Button>
|
|
244
|
-
<Button variant="destructive">삭제</Button>
|
|
245
|
-
<Button variant="outline">외곽선</Button>
|
|
246
|
-
<Button variant="secondary">두 번째</Button>
|
|
247
|
-
<Button variant="ghost">고스트</Button>
|
|
248
|
-
<Button variant="link">링크</Button>
|
|
249
|
-
|
|
250
|
-
// Size
|
|
251
|
-
<Button size="sm">작은 버튼</Button>
|
|
252
|
-
<Button size="default">기본</Button>
|
|
253
|
-
<Button size="lg">큰 버튼</Button>
|
|
254
|
-
<Button size="icon">🔍</Button>
|
|
255
|
-
|
|
256
|
-
// 조합
|
|
257
|
-
<Button variant="outline" size="lg">외곽선 큰 버튼</Button>
|
|
258
|
-
```
|
|
220
|
+
import { PYLER_TYPOGRAPHY_STYLE } from "@pylerai/design-system";
|
|
259
221
|
|
|
260
|
-
|
|
222
|
+
<Text sx={PYLER_TYPOGRAPHY_STYLE.body2R}>본문</Text>
|
|
223
|
+
```
|
|
261
224
|
|
|
262
|
-
###
|
|
225
|
+
### Radius · Shadow · Dim
|
|
263
226
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
| H1-20R | 20 | 400 | text-h1-20-r | 큰 본문/설명 |
|
|
269
|
-
| H2-18B | 18 | 700 | text-h2-18 | 섹션 제목 |
|
|
270
|
-
| H2-18SB | 18 | 600 | text-h2-18-sb | 섹션 보조 제목 |
|
|
271
|
-
| H2-18R | 18 | 400 | text-h2-18-r | 크고 차분한 본문 |
|
|
272
|
-
| B1-16B | 16 | 700 | text-b1-16 | 강조 본문 |
|
|
273
|
-
| B1-16M | 16 | 500 | text-b1-16-m | 일반 본문(기본) |
|
|
274
|
-
| B1-16R | 16 | 400 | text-b1-16-r | 일반 본문(라이트) |
|
|
275
|
-
| B2-14B | 14 | 700 | text-b2-14 | 작은 강조 본문 |
|
|
276
|
-
| B2-14M | 14 | 500 | text-b2-14-m | 작은 본문/캡션 |
|
|
277
|
-
| B2-14R | 14 | 400 | text-b2-14-r | 캡션/헬퍼텍스트 |
|
|
278
|
-
| B3-13M | 13 | 500 | text-b3-13-m | 세부설명/테이블 셀 |
|
|
279
|
-
| B3-13R | 13 | 400 | text-b3-13-r | 보조설명 |
|
|
280
|
-
| B4-12M | 12 | 500 | text-b4-12-m | 메타/상태 |
|
|
281
|
-
| B4-12R | 12 | 400 | text-b4-12-r | 아주 작은 본문 |
|
|
282
|
-
| L1-10SB | 10 | 600 | text-l1-10-sb | 라벨/태그 |
|
|
283
|
-
| L1-10R | 10 | 400 | text-l1-10-r | 라벨(비강조) |
|
|
227
|
+
```tsx
|
|
228
|
+
<div className="rounded-ds-md shadow-ds-default" /> // radius: xs(2) ss(4) md(8) lg(12)
|
|
229
|
+
// shadow: ds-default, ds-modal
|
|
230
|
+
```
|
|
284
231
|
|
|
285
|
-
|
|
232
|
+
Dim은 `var(--ds-dim-default)`로 제공됩니다. Storybook **Foundation → Radius / Shadow / Dim** 참고.
|
|
286
233
|
|
|
287
|
-
|
|
234
|
+
## ♿ 접근성
|
|
288
235
|
|
|
289
|
-
-
|
|
290
|
-
- **충분한 대비**: 텍스트와 배경 간 충분한 색상 대비를 확보하여 가독성을 보장하세요.
|
|
291
|
-
- **적절한 라인 높이**: 본문 텍스트는 1.4~1.6의 라인 높이를 사용하여 가독성을 높이세요.
|
|
236
|
+
`@storybook/addon-a11y`(axe)가 모든 스토리에서 실행되며 **위반이 있으면 CI가 실패**합니다(`npm test`).
|
|
292
237
|
|
|
293
|
-
|
|
238
|
+
키보드 조작 요약:
|
|
294
239
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
240
|
+
| 컴포넌트 | 키보드 |
|
|
241
|
+
|---|---|
|
|
242
|
+
| `Modal` | 포커스 트랩, 열 때 포커스 진입 / 닫을 때 복원, `Esc` 닫기, 스크롤 잠금. 모달이 쌓이면 `Esc`는 최상단만 닫습니다 |
|
|
243
|
+
| `Dropdown` | `↑`/`↓`/`Home`/`End` 이동, `Enter`/`Space` 선택, `Esc` 닫기 |
|
|
244
|
+
| `Tabs` | `←`/`→`/`Home`/`End` 이동(선택 동시 적용), `Tab`은 탭 목록을 통과 |
|
|
245
|
+
| `Table` | 정렬 헤더에 포커스 이동 후 `Enter`/`Space`로 정렬, `aria-sort` 노출 |
|
|
298
246
|
|
|
299
|
-
|
|
247
|
+
라벨이 필요한 컴포넌트:
|
|
300
248
|
|
|
301
|
-
|
|
249
|
+
- `Checkbox`·`Radio`는 자체적으로 `<label>`을 렌더합니다. **밖에서 `<label>`로 감싸지 마세요** — label이 중첩되어 연결이 깨집니다. 텍스트는 children으로 넘기고(`<Checkbox>동의</Checkbox>`), 텍스트가 없으면 `aria-label`을 지정하세요.
|
|
250
|
+
- `Toggle`, 아이콘 전용 `Button`, 라벨 없는 `Dropdown`/`SearchField`에는 `aria-label`이 필요합니다.
|
|
302
251
|
|
|
303
|
-
-
|
|
304
|
-
- **헤딩 계층**: 올바른 HTML 헤딩 태그 사용
|
|
305
|
-
- **스크린 리더**: 의미 있는 텍스트와 라벨 제공
|
|
306
|
-
- **키보드 네비게이션**: 포커스 표시 및 키보드 접근성 지원
|
|
252
|
+
> ⚠️ **컬러 대비는 아직 WCAG AA를 충족하지 못합니다.** `--ds-text-normal`(#969696)은 흰 배경에서 2.95:1, `--ds-text-disabled`(#cccccc)는 1.6:1, 흰 글자 + `--ds-primary-blue-normal`(#2c80f5)은 3.8:1로 기준(4.5:1)에 미달합니다. 토큰을 바꾸면 제품 전체 색이 바뀌므로 디자이너 결정이 필요한 사안이며, 그때까지 axe의 `color-contrast` 규칙만 꺼 둔 상태입니다(`.storybook/preview.ts`).
|
|
307
253
|
|
|
308
254
|
## 📁 프로젝트 구조
|
|
309
255
|
|
|
310
256
|
```
|
|
311
257
|
design-system/
|
|
312
|
-
├── .storybook/
|
|
313
|
-
|
|
314
|
-
│ ├──
|
|
315
|
-
│
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
│
|
|
258
|
+
├── .storybook/ # Storybook 설정 (main/preview/vitest.setup)
|
|
259
|
+
├── .github/workflows/
|
|
260
|
+
│ ├── pr-checks.yml # PR 검증 (tokens → lint → tsc → test → build)
|
|
261
|
+
│ ├── deploy-github-pages.yml # Storybook 배포
|
|
262
|
+
│ └── release-package.yml # GitHub Release 생성 시 npm 자동 배포
|
|
263
|
+
├── scripts/
|
|
264
|
+
│ └── check-tokens.cjs # 토큰 정합성 검사
|
|
319
265
|
├── src/
|
|
320
|
-
│ ├── components/
|
|
321
|
-
│ │ ├── ui/
|
|
322
|
-
│ │ │ ├── button.tsx # Button 컴포넌트 구현
|
|
323
|
-
│ │ │ └── button.stories.tsx # Button Storybook 스토리
|
|
324
|
-
│ │ └── Button.tsx # Button export
|
|
325
|
-
│ ├── stories/ # Storybook 데모 컴포넌트
|
|
326
|
-
│ │ ├── assets/ # 데모용 이미지/아이콘
|
|
327
|
-
│ │ ├── Button.tsx # 데모 Button
|
|
328
|
-
│ │ ├── Button.stories.ts # Button 스토리
|
|
329
|
-
│ │ ├── Header.tsx # 데모 Header
|
|
330
|
-
│ │ ├── Header.stories.ts # Header 스토리
|
|
331
|
-
│ │ ├── Page.tsx # 데모 Page
|
|
332
|
-
│ │ ├── Page.stories.ts # Page 스토리
|
|
333
|
-
│ │ └── *.css # 데모 스타일
|
|
266
|
+
│ ├── components/ui/ # 컴포넌트 + *.stories.tsx (스토리가 곧 테스트)
|
|
334
267
|
│ ├── lib/
|
|
335
|
-
│ │
|
|
336
|
-
│
|
|
337
|
-
│ ├──
|
|
268
|
+
│ │ ├── icons.tsx # 내부 아이콘 (아직 미export)
|
|
269
|
+
│ │ └── utils.ts # cn() — clsx + tailwind-merge
|
|
270
|
+
│ ├── tokens/
|
|
271
|
+
│ │ ├── pyler-light.ts # 컬러 토큰 (TS)
|
|
272
|
+
│ │ └── typography.ts # 타이포 토큰 (CSS-in-JS용)
|
|
273
|
+
│ ├── index.css # --ds-* CSS 변수 + 타이포 유틸리티 (실제 값)
|
|
338
274
|
│ └── index.tsx # 패키지 진입점
|
|
339
|
-
├──
|
|
340
|
-
├──
|
|
341
|
-
├──
|
|
342
|
-
|
|
343
|
-
├── tsconfig.node.json # TypeScript Node 설정
|
|
344
|
-
├── vite.config.ts # Vite 설정
|
|
345
|
-
├── vitest.shims.d.ts # Vitest 타입 정의
|
|
346
|
-
└── package.json # 패키지 정보
|
|
275
|
+
├── pyler-tailwind-colors.cjs # Tailwind ds 컬러 맵
|
|
276
|
+
├── pyler-typography.cjs # Tailwind 타이포 스케일
|
|
277
|
+
├── tailwind-preset.cjs # 소비 앱용 프리셋
|
|
278
|
+
└── eslint.config.js
|
|
347
279
|
```
|
|
348
280
|
|
|
349
|
-
### 주요 디렉토리 설명
|
|
350
|
-
|
|
351
|
-
- **`src/components/`**: 실제 디자인 시스템 컴포넌트들이 위치
|
|
352
|
-
|
|
353
|
-
- `ui/`: shadcn/ui 기반 컴포넌트 구현
|
|
354
|
-
- 컴포넌트 export 파일들
|
|
355
|
-
|
|
356
|
-
- **`src/stories/`**: Storybook 데모 및 예제 컴포넌트들
|
|
357
|
-
|
|
358
|
-
- 실제 패키지에는 포함되지 않으며 개발/테스트 용도
|
|
359
|
-
- Button, Header, Page 등의 데모 컴포넌트
|
|
360
|
-
|
|
361
|
-
- **`src/lib/`**: 공통 유틸리티 함수
|
|
362
|
-
|
|
363
|
-
- `utils.ts`: class-variance-authority, clsx, tailwind-merge를 사용한 `cn` 함수
|
|
364
|
-
|
|
365
|
-
- **`.storybook/`**: Storybook 설정 파일
|
|
366
|
-
- Vitest 통합
|
|
367
|
-
- addons: a11y, docs, onboarding, vitest
|
|
368
|
-
|
|
369
281
|
## 🔧 개발
|
|
370
282
|
|
|
371
|
-
### 로컬 개발
|
|
372
|
-
|
|
373
283
|
```bash
|
|
374
|
-
# 의존성 설치
|
|
375
284
|
npm install
|
|
376
|
-
|
|
377
|
-
#
|
|
378
|
-
npm run
|
|
379
|
-
|
|
380
|
-
# 빌드
|
|
285
|
+
npm run storybook # http://localhost:6006
|
|
286
|
+
npm test # 스토리의 play 함수를 vitest로 실행
|
|
287
|
+
npm run lint
|
|
288
|
+
npm run check:tokens
|
|
381
289
|
npm run build
|
|
382
|
-
|
|
383
|
-
# 테스트 실행
|
|
384
|
-
npm test
|
|
385
290
|
```
|
|
386
291
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
컴포넌트를 개발하고 테스트하기 위해 Storybook을 사용할 수 있습니다.
|
|
292
|
+
이 저장소는 **별도 테스트 파일을 두지 않고 Storybook 스토리의 `play` 함수를 테스트로 실행**합니다(`@storybook/addon-vitest`). 스토리를 추가하면 그 자체로 렌더 스모크 테스트가 되고, 핵심 상호작용에는 `play`를 작성합니다.
|
|
390
293
|
|
|
391
|
-
|
|
392
|
-
# Storybook 개발 서버 실행
|
|
393
|
-
npm run storybook
|
|
394
|
-
|
|
395
|
-
# Storybook 빌드
|
|
396
|
-
npm run build-storybook
|
|
397
|
-
```
|
|
398
|
-
|
|
399
|
-
Storybook은 `http://localhost:6006`에서 실행됩니다.
|
|
400
|
-
|
|
401
|
-
컴포넌트 스토리는 `src/components/**/*.stories.tsx` 경로에 생성됩니다.
|
|
294
|
+
새 컴포넌트를 추가하는 순서와 PR 절차는 [CONTRIBUTING](./CONTRIBUTING.md)을 참고하세요.
|
|
402
295
|
|
|
403
296
|
## 📤 배포
|
|
404
297
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
### 배포 프로세스
|
|
408
|
-
|
|
409
|
-
1. **버전 업데이트**: `package.json`의 `version`을 올립니다.
|
|
410
|
-
2. **배포 실행**:
|
|
411
|
-
|
|
412
|
-
```bash
|
|
413
|
-
npm run publish:npm
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
이 스크립트는 `npm run build`로 패키지를 빌드한 뒤, `npm publish --access public`으로 `@pylerai/design-system`을 public 스코프로 퍼블리시합니다.
|
|
417
|
-
|
|
418
|
-
> ⚠️ `.github/workflows/release-package.yml`은 GitHub Release가 생성될 때 트리거되어 GitHub Packages(`npm.pkg.github.com`)로도 별도 퍼블리시를 시도하는 워크플로우입니다. 현재 실제 배포는 위 수동 `npm run publish:npm` 경로로만 이루어지고 있어 이 워크플로우와 실제 배포 방식이 어긋나 있습니다. GitHub Release를 생성하면 의도치 않게 GitHub Packages 쪽에도 배포가 실행될 수 있으니 주의하세요 (워크플로우 자체 정리는 별도 후속 작업 — [CONTRIBUTING](./CONTRIBUTING.md) 참고).
|
|
298
|
+
`main`은 브랜치 보호로 직접 push할 수 없습니다. 버전 릴리스 절차(버전 범프 → CHANGELOG → 태그 → GitHub Release 생성 → CI 자동 npm 배포)는 [CONTRIBUTING](./CONTRIBUTING.md)에 정리돼 있습니다.
|
|
419
299
|
|
|
420
300
|
## 🔗 링크
|
|
421
301
|
|
|
302
|
+
- **Storybook**: https://pylerai.github.io/design-system/
|
|
422
303
|
- **Repository**: https://github.com/pylerAI/design-system
|
|
423
304
|
- **Issues**: https://github.com/pylerAI/design-system/issues
|
|
424
|
-
- **Homepage**: https://github.com/pylerAI/design-system#readme
|
|
425
|
-
|
|
426
|
-
## 📄 라이선스
|
|
427
|
-
|
|
428
|
-
ISC
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { DsSize } from '../../lib/size';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
export type BadgeColor = "normal" | "neutral" | "negative" | "positive";
|
|
3
|
-
export type BadgeSize = "
|
|
4
|
+
export type BadgeSize = Extract<DsSize, "md" | "sm">;
|
|
4
5
|
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
5
6
|
color?: BadgeColor;
|
|
6
7
|
size?: BadgeSize;
|