# KRI UI Registry KRI 공통 shadcn UI Registry 프로젝트입니다. `npm run build`로 생성되는 `dist/r` 정적 JSON 파일을 IIS 또는 Nginx에 배포해서 사용합니다. ## 빌드 및 검증 ```powershell npm ci npm run build npm run verify npm run preview ``` 배포 Registry 주소: ```text https://ui-registry.kric.com/r/registry.json ``` 로컬 preview 주소 (`npm run preview` 실행 후): ```text http://localhost:4100/r/registry.json ``` ## Registry 항목 ```text kri-chart kri-select kri-date-range-picker kri-date-picker kri-date-time-picker kri-time-picker kri-password kri-auto-complete kri-data-table kri-loading-overlay kri-editor kri-layout kri-dialog ``` `kri-data-table`은 TanStack Table v8 API를 사용하며 `@tanstack/react-table@^8.21.3` 범위를 지원합니다. KriUiRegistry에서 별도의 마이그레이션 버전을 제공하기 전에는 v9으로 올리지 않습니다. 개별 설치 예시: ```powershell npx shadcn@latest add https://ui-registry.kric.com/r/kri-chart.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-select.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-password.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-date-range-picker.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-date-picker.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-date-time-picker.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-time-picker.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-auto-complete.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-data-table.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-loading-overlay.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-editor.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-layout.json npx shadcn@latest add https://ui-registry.kric.com/r/kri-dialog.json ``` ## KRI Chart `kri-chart`는 `echarts`, `echarts-for-react` 기반 공통 차트 컴포넌트입니다. 내부적으로 `BaseEChart`를 사용하며, 모든 wrapper는 멀티 시리즈를 지원합니다. 제공 컴포넌트: ```ts BaseEChart KriLineChart KriBarChart KriStackedBarChart KriPieChart KriRadarChart KriScatterChart ``` ### Line ```tsx import { KriLineChart } from '@/components/chart' ``` ### Bar / Horizontal Bar ```tsx import { KriBarChart } from '@/components/chart' ``` ### Stacked Bar ```tsx import { KriStackedBarChart } from '@/components/chart' ``` ### Pie ```tsx import { KriPieChart } from '@/components/chart' ``` ### Radar ```tsx import { KriRadarChart } from '@/components/chart' ``` ### Scatter ```tsx import { KriScatterChart } from '@/components/chart' ``` 공통 props: - `height`: 차트 wrapper 높이, 기본값 `CHART_HEIGHTS.DEFAULT` - `className`, `contentClassName`, `chartClassName`: wrapper className - `notMerge`, `lazyUpdate`, `onEvents`: `echarts-for-react` 전달 옵션 - `option`: wrapper가 생성한 ECharts option을 덮어쓰는 override 옵션 - `normalizeValues`, `decimalPlaces`: 숫자 데이터 반올림 정규화 옵션 ## KriDialog Footer 규칙 기본값은 닫기 버튼이 있는 Footer입니다. ```tsx {/* Body */} ``` 기본 Footer를 제거합니다. ```tsx {/* Body */} ``` 사용자 정의 Footer를 전달합니다. `footer`가 지정되면 기본 Footer보다 우선합니다. ```tsx } > {/* Body */} ``` `footer={null}`을 전달해도 Footer가 표시되지 않습니다. ## Editor 주요 옵션 ```tsx upload(file)} smsMaxBytes={90} lmsMaxBytes={2000} toolbar={{ image: true, table: false, html: true }} /> ``` - 편집 값은 HTML 문자열입니다. - 이미지 업로드 함수는 URL 문자열 또는 `{ url }`을 반환할 수 있습니다. - `toolbar={false}`로 toolbar 전체를 숨길 수 있습니다. - SMS/LMS 기본 제한은 각각 90/2,000바이트입니다.