@weing-dev/ui-kit-primitive 0.5.0 → 0.5.1
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/README.md +86 -49
- package/dist/chart.d.ts +2 -1
- package/dist/chart.js +614 -442
- package/dist/components/Chart/Chart.gradient.d.ts +10 -0
- package/dist/components/Chart/Chart.options.d.ts +7 -2
- package/dist/components/Chart/Chart.type.d.ts +51 -4
- package/dist/components/Chart/charts/RadarChart.d.ts +3 -0
- package/dist/entry/chart.d.ts +2 -1
- package/docs/ui-kit-agent-guide.md +574 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,65 +1,102 @@
|
|
|
1
1
|
# `@weing-dev/ui-kit-primitive`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
weing 어드민/서비스 프런트의 **공통 UI 프리미티브** 패키지. 폼·네비게이션·피드백·표시·데이터(차트/테이블/캘린더/에디터/비디오)까지 화면 구성에 필요한 컴포넌트를 한곳에서 제공한다. 대부분 **Compound 컴포넌트 패턴**(`Button.Root` + `Button.Text` …)과 **CSS 변수 토큰 테마**로 만들어져 있다.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> **화면/마크업 작업 전 필독 (사람·에이전트 공통)**
|
|
6
|
+
> 새 컴포넌트를 만들기 전에 **[에이전트 UI 가이드 → `docs/ui-kit-agent-guide.md`](./docs/ui-kit-agent-guide.md)** 를 먼저 확인하라.
|
|
7
|
+
> 아래 카탈로그의 40개 컴포넌트가 대부분의 화면 요구를 이미 커버한다. 중복 구현은 피한다.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
관련 문서:
|
|
10
|
+
- **[에이전트 UI 가이드](./docs/ui-kit-agent-guide.md)** — 목적→컴포넌트 매핑, 전체 API 카탈로그, 합성 예시, 소비 컨벤션, 금지/함정. (마크업 에이전트의 1차 참조 문서)
|
|
11
|
+
- **[서브패스 import 가이드](./docs/subpath-imports.md)** — 번들 분리를 위한 서브패스별 import 규칙.
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
---
|
|
10
14
|
|
|
11
|
-
|
|
15
|
+
## 컴포넌트 인덱스
|
|
16
|
+
|
|
17
|
+
import 서브패스는 `@weing-dev/ui-kit-primitive/<서브패스>`. 자세한 props·예시는 [에이전트 UI 가이드](./docs/ui-kit-agent-guide.md) 참조.
|
|
18
|
+
|
|
19
|
+
### Form — `/form`
|
|
20
|
+
| 컴포넌트 | 용도 | 구조 |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `Button` | 액션 버튼(로딩·아이콘·텍스트 합성) | `Root / Text / Icon` |
|
|
23
|
+
| `TextInput` | 한 줄 텍스트 입력(라벨·지우기·아이콘) | `Root / Label / Input / Erase / HelperText` |
|
|
24
|
+
| `TextArea` | 여러 줄 입력(자동 높이·글자수) | `Root / Label / Input / Erase / HelperText / TextCount` |
|
|
25
|
+
| `Dropdown` | 단일/다중 셀렉트(검색·popper) | `Root / Trigger / Menu / Item` |
|
|
26
|
+
| `CheckBox` | 체크박스(단일/다중) | `Root / Trigger / Label / HelperText` |
|
|
27
|
+
| `Radio` | 라디오(그룹 단일 선택) | `Root / Trigger / Label / HelperText` |
|
|
28
|
+
| `Switch` | on/off 토글 | `Root / Trigger / Label` |
|
|
29
|
+
| `Cascader` | 계층형 다단계 선택 | `Root / Menu / Column / Item` |
|
|
30
|
+
| `OTPInput` | 고정 자리수 코드 입력 | `Root / Input` |
|
|
31
|
+
| `Slider` | 단일/범위 슬라이더 | `Root / Progress / Thumb / Marks` |
|
|
32
|
+
| `Stepper` | 다단계 진행 표시 | `Root / Step` |
|
|
33
|
+
| `TimeInput` | 시작~종료 시간 범위 | `Root / Label / InputWrapper / Input / Colon / Separator / TimeRange / HelperText` |
|
|
34
|
+
| `MobilePicker` | 휠(드럼) 피커 | `Root / Column / Item` |
|
|
35
|
+
| `HelperText` | 입력 하단 상태 안내 문구 | 단일 |
|
|
36
|
+
|
|
37
|
+
### Navigation — `/navigation`
|
|
38
|
+
| 컴포넌트 | 용도 | 구조 |
|
|
39
|
+
| --- | --- | --- |
|
|
40
|
+
| `Tab` | 탭 + 패널 전환 | `Root / List / Item / Panels / Panel` |
|
|
41
|
+
| `Accordion` | 펼침/접힘 영역 | `Root / Trigger / Item` |
|
|
42
|
+
| `Breadcrumb` | 경로 내비게이션 | `List / Link / Separator / Ellipsis` |
|
|
43
|
+
| `Pagination` | 페이지네이션(offset/limit) | `Root / PageList / PageItem / Prev / Next` |
|
|
44
|
+
| `LNB` | 좌측 글로벌 메뉴(+`makeNavigation`) | `Root / Logo / List / Item` |
|
|
45
|
+
| `List` | 단일 행 리스트 아이템 | 단일 |
|
|
46
|
+
| `ScrollSpy` | 스크롤 위치 추적 훅 | `useScrollSpy` 훅 |
|
|
47
|
+
|
|
48
|
+
### Feedback — `/feedback`
|
|
49
|
+
| 컴포넌트 | 용도 | 구조 |
|
|
50
|
+
| --- | --- | --- |
|
|
51
|
+
| `Modal` | 포털 딤드 모달 | 단일(`visible/onClose/dimmedColor`) |
|
|
52
|
+
| `Popup` | Popover API 팝업(+`usePopup`) | `Root / Layer / Dimmed / Contents` |
|
|
53
|
+
| `Sheet` | 드래그 가능한 4방향 시트 | `Root / Content / Dimmed` |
|
|
54
|
+
|
|
55
|
+
### Display — `/display`
|
|
56
|
+
| 컴포넌트 | 용도 | 구조 |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| `Label` | 상태/카테고리 라벨(태그) | 단일 |
|
|
59
|
+
| `Chips` | 선택 가능한 칩 | 단일 |
|
|
60
|
+
| `Badge` | 카운트/점 배지 오버레이 | 단일 |
|
|
61
|
+
| `Avatar` | 프로필 이미지(+그룹) | `Item / Group` |
|
|
62
|
+
| `Thumbnail` | 업로드·수정·삭제 썸네일 | `Root / Image / Upload / EmptyImage / RemoveButton / EditButton` |
|
|
63
|
+
| `Comment` | 상태 아이콘 + 보조 메시지 | 단일 |
|
|
64
|
+
| `Divider` | 구분선 | 단일 |
|
|
65
|
+
| `LazyImage` | 지연 로딩 이미지 | 단일 |
|
|
66
|
+
| `QRCode` | QR 코드 | 단일 |
|
|
67
|
+
| `BarCode` | EAN8/EAN13 바코드 | 단일 |
|
|
68
|
+
|
|
69
|
+
### Data / Heavy (전용 서브패스 + 일부 CSS 별도)
|
|
70
|
+
| 컴포넌트 | 서브패스 | 비고 |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| `Table` | `/table` | `@tanstack/react-table`와 조합, 렌더 전용 |
|
|
73
|
+
| `BarChart` `LineChart` `PieChart` `DoughnutChart` | `/chart` | chart.js 기반, `ChartThemeProvider` |
|
|
74
|
+
| `Calendar` `ScrollCalendar` `WeeklyCalendar` | `/calendar` | dayjs 기반 |
|
|
75
|
+
| `Editor` | `/editor` | Quill, **`editor/style.css` 별도 import 필수** |
|
|
76
|
+
| `VideoPlayer` | `/video-player` | Video.js, **`video-player/style.css` 별도 import 필수** |
|
|
77
|
+
| `Icon` `IconProvider` `ICON_NAMES` | `/icon` | 레지스트리 기반, 앱 루트를 `IconProvider`로 감싸야 함 |
|
|
78
|
+
|
|
79
|
+
> **미사용/비공개(쓰지 말 것)**: `Dialog`(빈 스텁), `WisywygEditor`(레거시, 미export — 신규는 `Editor` 사용), `radar` 차트(미export).
|
|
12
80
|
|
|
13
|
-
|
|
14
|
-
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
81
|
+
---
|
|
15
82
|
|
|
16
|
-
##
|
|
83
|
+
## 임포트 시 실제 로드량 확인 방법
|
|
17
84
|
|
|
18
|
-
|
|
85
|
+
특정 export만 import 했을 때 실제 로드량을 확인하려면:
|
|
19
86
|
|
|
20
|
-
|
|
87
|
+
1. 소비 앱에서 production 빌드 후 번들 분석기로 청크 크기 확인
|
|
88
|
+
2. 빌드 산출물을 서빙한 뒤 브라우저 Network 탭에서 JS 파일 크기 비교
|
|
21
89
|
|
|
22
|
-
|
|
23
|
-
export default tseslint.config({
|
|
24
|
-
languageOptions: {
|
|
25
|
-
// other options...
|
|
26
|
-
parserOptions: {
|
|
27
|
-
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
28
|
-
tsconfigRootDir: import.meta.dirname,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
})
|
|
32
|
-
```
|
|
90
|
+
모노레포에서 이 패키지를 **소스로** 참조하면 번들러가 tree-shaking으로 필요한 부분만 포함한다. 무거운 의존성(차트·에디터·비디오·테이블)은 서브패스가 의도적으로 분리돼 있으니 **루트 배럴 대신 서브패스 import**를 권장한다([근거](./docs/subpath-imports.md)).
|
|
33
91
|
|
|
34
|
-
|
|
35
|
-
- Optionally add `...tseslint.configs.stylisticTypeChecked`
|
|
36
|
-
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:
|
|
37
|
-
|
|
38
|
-
```js
|
|
39
|
-
// eslint.config.js
|
|
40
|
-
import react from 'eslint-plugin-react'
|
|
41
|
-
|
|
42
|
-
export default tseslint.config({
|
|
43
|
-
// Set the react version
|
|
44
|
-
settings: { react: { version: '18.3' } },
|
|
45
|
-
plugins: {
|
|
46
|
-
// Add the react plugin
|
|
47
|
-
react,
|
|
48
|
-
},
|
|
49
|
-
rules: {
|
|
50
|
-
// other rules...
|
|
51
|
-
// Enable its recommended rules
|
|
52
|
-
...react.configs.recommended.rules,
|
|
53
|
-
...react.configs['jsx-runtime'].rules,
|
|
54
|
-
},
|
|
55
|
-
})
|
|
56
|
-
```
|
|
92
|
+
## 아이콘 추가
|
|
57
93
|
|
|
58
|
-
|
|
94
|
+
`public/static/icon`에 SVG를 넣고 `pnpm icons:create` 실행 → svgr이 `src/components/Icons/*.tsx`를 생성하고 `generate-icon-names.cjs`가 `ICON_NAMES`를 재생성한다. `ICON_NAMES`는 수기 작성하지 않는다.
|
|
59
95
|
|
|
60
|
-
|
|
96
|
+
## 빌드
|
|
61
97
|
|
|
62
|
-
|
|
63
|
-
|
|
98
|
+
```bash
|
|
99
|
+
pnpm build # tsc -b && vite build && vite build --config vite.icon.config.ts
|
|
100
|
+
```
|
|
64
101
|
|
|
65
|
-
|
|
102
|
+
메인 라이브러리는 `vite.config.ts`, 서브패스 청크는 `vite.icon.config.ts`(이름은 icon이지만 chart·form 등 전 엔트리 포함).
|
package/dist/chart.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ export { default as BarChart } from '../components/Chart/charts/BarChart';
|
|
|
2
2
|
export { default as LineChart } from '../components/Chart/charts/LineChart';
|
|
3
3
|
export { default as PieChart } from '../components/Chart/charts/PieChart';
|
|
4
4
|
export { default as DoughnutChart } from '../components/Chart/charts/DoughnutChart';
|
|
5
|
+
export { default as RadarChart } from '../components/Chart/charts/RadarChart';
|
|
5
6
|
export { ChartThemeProvider } from '../components/Chart/Chart.theme';
|
|
6
|
-
export type { BarChartProps, LineChartProps, PieChartProps, DoughnutChartProps, ChartBaseProps, ChartThemeValue, ChartPreset, ChartStyleDefaults, SimpleDatum, ChartSeries, SeriesData, CategoricalData, ProportionData, PaletteInput, } from '../components/Chart/Chart.type';
|
|
7
|
+
export type { BarChartProps, LineChartProps, PieChartProps, DoughnutChartProps, RadarChartProps, ChartBaseProps, AxisConfig, ChartThemeValue, ChartPreset, ChartStyleDefaults, SimpleDatum, ChartSeries, SeriesData, CategoricalData, ProportionData, PaletteInput, } from '../components/Chart/Chart.type';
|