261116_01_ENH: 색상 선택 컴포넌트(kri-color-palette) 추가 및 선택적 투명도 지원
This commit is contained in:
22
README.md
22
README.md
@@ -39,6 +39,7 @@ kri-loading-overlay
|
||||
kri-editor
|
||||
kri-layout
|
||||
kri-dialog
|
||||
kri-color-palette
|
||||
```
|
||||
|
||||
`kri-data-table`은 TanStack Table v8 API를 사용하며 `@tanstack/react-table@^8.21.3` 범위를 지원합니다. KriUiRegistry에서 별도의 마이그레이션 버전을 제공하기 전에는 v9으로 올리지 않습니다.
|
||||
@@ -59,6 +60,7 @@ 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
|
||||
npx shadcn@latest add https://ui-registry.kric.com/r/kri-color-palette.json
|
||||
```
|
||||
|
||||
## KriAutoComplete 검색 스크롤
|
||||
@@ -274,6 +276,26 @@ import { KriScatterChart } from '@/components/chart'
|
||||
|
||||
`footer={null}`을 전달해도 Footer가 표시되지 않습니다.
|
||||
|
||||
## KriColorPalette
|
||||
|
||||
`kri-color-palette`는 팝오버형 색상 선택 컴포넌트입니다. 기본 색상 버튼, 색상 영역·색조 슬라이더, HEX 입력, 색상 제거를 제공하며 값은 대문자 `#RRGGBB`(투명도 포함 시 `#RRGGBBAA`) 또는 `null`입니다.
|
||||
|
||||
```tsx
|
||||
<KriColorPalette
|
||||
value={color}
|
||||
onChange={setColor}
|
||||
aria-label="헤더 색상"
|
||||
/>
|
||||
```
|
||||
|
||||
- `colors?: readonly string[]`: 기본 색상 버튼 목록. 기본값은 `KRI_COLOR_PALETTE_DEFAULT_COLORS`(16색)입니다.
|
||||
- `allowCustom?: boolean`(기본 `true`): 색상 영역·색조 슬라이더·HEX 입력 노출 여부입니다.
|
||||
- `allowAlpha?: boolean`(기본 `false`): 투명도 슬라이더와 `#RRGGBBAA` 입력을 허용합니다. `false`여도 전달받은 `#RRGGBBAA` 값은 투명도까지 표시·보존하며, 사용자가 색을 바꾸면 불투명한 `#RRGGBB`로 바뀝니다.
|
||||
- `allowClear?: boolean`(기본 `true`), `disabled`, `placeholder`, `className`, `aria-label`을 지원합니다. `disabled`이면 팝오버가 열리지 않습니다.
|
||||
- 색상 해석·정규화와 밝기 판단 함수(`parseHexColor`, `formatHexColor`, `normalizeHexColor`, `isLightHexColor`)는 `color-palette/color.ts`에서 함께 제공합니다.
|
||||
|
||||
색상 영역은 [Dice UI color-picker](https://www.diceui.com/docs/components/radix/color-picker)(Radix 버전, MIT License)를 `color-palette/` 아래에 포함한 것입니다. 별도 npm 패키지 없이 `radix-ui`, `class-variance-authority`, `lucide-react`와 shadcn `button`, `input`, `popover`, `select`에 의존합니다.
|
||||
|
||||
## Editor 주요 옵션
|
||||
|
||||
```tsx
|
||||
|
||||
Reference in New Issue
Block a user