kku-ui 0.1.4 → 0.2.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 +56 -43
- package/lib/es/common/hooks/index.d.ts +7 -0
- package/lib/es/common/hooks/useCleanId.d.ts +1 -0
- package/lib/es/common/hooks/useDropdownPosition.d.ts +16 -0
- package/lib/es/common/hooks/useDynamicRefs.d.ts +4 -0
- package/lib/es/common/hooks/useEscapeKey.d.ts +2 -0
- package/lib/es/common/hooks/useSafePortalContainer.d.ts +1 -0
- package/lib/es/common/util/keyboard.d.ts +2 -0
- package/lib/es/components/{button → actions/button}/KButton.d.ts +1 -1
- package/lib/es/components/actions/button/KButton.interface.d.ts +18 -0
- package/lib/es/components/actions/button-group/KButtonGroup.d.ts +6 -0
- package/lib/es/components/actions/button-group/KButtonGroup.interface.d.ts +6 -0
- package/lib/es/components/actions/button-group/index.d.ts +2 -0
- package/lib/es/components/actions/index.d.ts +4 -0
- package/lib/es/components/actions/switch/KSwitch.interface.d.ts +8 -0
- package/lib/es/components/actions/toggle-button/KToggleButton.d.ts +6 -0
- package/lib/es/components/actions/toggle-button/KToggleButton.interface.d.ts +7 -0
- package/lib/es/components/actions/toggle-button/index.d.ts +2 -0
- package/lib/es/components/{accordion → data-display/accordion}/KAccordion.d.ts +1 -1
- package/lib/es/components/data-display/accordion/KAccordion.interface.d.ts +9 -0
- package/lib/es/components/data-display/dropdown/KDropdown.context.d.ts +3 -0
- package/lib/es/components/data-display/dropdown/KDropdown.d.ts +10 -0
- package/lib/es/components/data-display/dropdown/KDropdown.interface.d.ts +43 -0
- package/lib/es/components/data-display/dropdown/KDropdownContent.d.ts +3 -0
- package/lib/es/components/data-display/dropdown/KDropdownTrigger.d.ts +3 -0
- package/lib/es/components/data-display/dropdown/index.d.ts +2 -0
- package/lib/es/components/data-display/index.d.ts +4 -0
- package/lib/es/components/data-display/menu/KMenu.d.ts +12 -0
- package/lib/es/components/data-display/menu/KMenu.interface.d.ts +19 -0
- package/lib/es/components/data-display/menu/KMenuItem.d.ts +3 -0
- package/lib/es/components/data-display/menu/KMenuItemDivider.d.ts +3 -0
- package/lib/es/components/data-display/menu/KMenuItemSelectable.d.ts +3 -0
- package/lib/es/components/data-display/menu/index.d.ts +2 -0
- package/lib/es/components/data-display/skeleton/KSkeleton.d.ts +6 -0
- package/lib/es/components/data-display/skeleton/KSkeleton.interface.d.ts +8 -0
- package/lib/es/components/data-display/skeleton/index.d.ts +2 -0
- package/lib/es/components/feedback/backdrop/KBackdrop.d.ts +6 -0
- package/lib/es/components/feedback/backdrop/KBackdrop.motion.d.ts +3 -0
- package/lib/es/components/feedback/backdrop/index.d.ts +2 -0
- package/lib/es/components/feedback/index.d.ts +3 -0
- package/lib/es/components/feedback/modal/KModal.context.d.ts +3 -0
- package/lib/es/components/feedback/modal/KModal.d.ts +12 -0
- package/lib/es/components/feedback/modal/KModal.interface.d.ts +34 -0
- package/lib/es/components/feedback/modal/KModal.motion.d.ts +2 -0
- package/lib/es/components/feedback/modal/KModalContent.d.ts +3 -0
- package/lib/es/components/feedback/modal/KModalFooter.d.ts +3 -0
- package/lib/es/components/feedback/modal/KModalHeader.d.ts +3 -0
- package/lib/es/components/feedback/spinner/KSpinner.d.ts +3 -0
- package/lib/es/components/feedback/spinner/index.d.ts +2 -0
- package/lib/es/components/{icon → foundations/icon}/KIcon.interface.d.ts +4 -8
- package/lib/es/components/foundations/index.d.ts +1 -0
- package/lib/es/components/index.d.ts +5 -9
- package/lib/es/components/input/index.d.ts +2 -0
- package/lib/es/components/input/select/KSelect.interface.d.ts +16 -8
- package/lib/es/components/input/textfield/KTextField.d.ts +2 -2
- package/lib/es/components/input/textfield/KTextField.interface.d.ts +14 -18
- package/lib/es/core/accordion/Accordion.context.d.ts +3 -0
- package/lib/es/core/accordion/Accordion.d.ts +10 -0
- package/lib/es/core/accordion/Accordion.interface.d.ts +21 -0
- package/lib/es/core/accordion/AccordionContent.d.ts +6 -0
- package/lib/es/core/accordion/AccordionSummary.d.ts +6 -0
- package/lib/es/core/accordion/index.d.ts +2 -0
- package/lib/es/core/button/Button.d.ts +3 -0
- package/lib/es/core/button/index.d.ts +2 -0
- package/lib/es/core/index.d.ts +7 -0
- package/lib/es/core/menu/Menu.d.ts +3 -0
- package/lib/es/core/menu/Menu.interface.d.ts +11 -0
- package/lib/es/core/menu/index.d.ts +2 -0
- package/lib/es/core/menu-item/MenuItem.d.ts +3 -0
- package/lib/es/core/menu-item/MenuItem.interface.d.ts +12 -0
- package/lib/es/core/menu-item/index.d.ts +2 -0
- package/lib/es/core/switch/Switch.d.ts +3 -0
- package/lib/es/core/switch/index.d.ts +2 -0
- package/lib/es/core/text-field/TextField.d.ts +3 -0
- package/lib/es/core/text-field/index.d.ts +2 -0
- package/lib/es/core/transition/Transition.d.ts +6 -0
- package/lib/es/core/transition/index.d.ts +2 -0
- package/lib/es/hooks.js +22 -0
- package/lib/es/index.d.ts +1 -1
- package/lib/es/index.js +6441 -6087
- package/lib/es/index.js.br +0 -0
- package/lib/es/index.js.gz +0 -0
- package/lib/index.css +1 -1
- package/package.json +30 -20
- package/lib/cjs/index.js +0 -32
- package/lib/cjs/index.js.gz +0 -0
- package/lib/cjs/index.js.map +0 -1
- package/lib/es/common/hook/useCleanId.d.ts +0 -1
- package/lib/es/common/util/variation.d.ts +0 -4
- package/lib/es/components/accordion/KAccordion.interface.d.ts +0 -17
- package/lib/es/components/button/KButton.interface.d.ts +0 -26
- package/lib/es/components/card/KCard.d.ts +0 -6
- package/lib/es/components/card/KCard.interface.d.ts +0 -13
- package/lib/es/components/card/index.d.ts +0 -2
- package/lib/es/components/drop-holder/KDropHolder.d.ts +0 -3
- package/lib/es/components/drop-holder/KDropHolder.interface.d.ts +0 -25
- package/lib/es/components/drop-holder/KDropHolder.motion.d.ts +0 -3
- package/lib/es/components/drop-holder/index.d.ts +0 -2
- package/lib/es/components/input/select/KSelect.motion.d.ts +0 -3
- package/lib/es/components/input/select/KSelectList.d.ts +0 -3
- package/lib/es/components/input/switch/KSwitch.interface.d.ts +0 -10
- package/lib/es/components/modal/KModal.d.ts +0 -6
- package/lib/es/components/modal/KModal.interface.d.ts +0 -26
- package/lib/es/components/modal/KModal.motion.d.ts +0 -2
- package/lib/es/index.js.map +0 -1
- /package/lib/es/common/{hook → hooks}/useClickOutside.d.ts +0 -0
- /package/lib/es/common/{hook → hooks/useRipple}/useRipple.d.ts +0 -0
- /package/lib/es/components/{button → actions/button}/index.d.ts +0 -0
- /package/lib/es/components/{input → actions}/switch/KSwitch.d.ts +0 -0
- /package/lib/es/components/{input → actions}/switch/index.d.ts +0 -0
- /package/lib/es/components/{accordion → data-display/accordion}/index.d.ts +0 -0
- /package/lib/es/components/{modal → feedback/modal}/index.d.ts +0 -0
- /package/lib/es/components/{icon → foundations/icon}/KIcon.d.ts +0 -0
- /package/lib/es/components/{icon → foundations/icon}/index.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,36 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
# ✨ KKU-UI ✨
|
|
2
|
+
### React Component Library for Modern UI Development<br>
|
|
3
|
+
|
|
4
|
+
### 🎨 스토리북
|
|
5
|
+
|
|
6
|
+
🔗 [Link](https://macjjuni.github.io/kku-ui)
|
|
7
|
+
|
|
8
|
+
### 소개
|
|
9
|
+
|
|
10
|
+
kku-ui는 React 기반의 컴포넌트 라이브러리로, 컴포넌트 간 유연한 조합을 위해 컴파운드 패턴과 동적인 UI 구성을 위한 Render Props 패턴이 적용되어 있습니다.
|
|
11
|
+
이를 통해 재사용성과 확장성을 높이며, 가볍게 사용할 수 있도록 만들어졌습니다.
|
|
12
|
+
|
|
13
|
+
### 컴포넌트 구조
|
|
14
|
+
|
|
15
|
+
프로젝트 내 컴포넌트는 크게 **Main 컴포넌트**와 **Core 컴포넌트**로 분리되어 있습니다.
|
|
16
|
+
|
|
17
|
+
#### **Main 컴포넌트**
|
|
18
|
+
다지안이 적용된 최종 UI 컴포넌트입니다.
|
|
19
|
+
|
|
20
|
+
| 컴포넌트 | 기능 | 스토리북 | a11y |
|
|
21
|
+
|:-------------------|:----:|:--------:|:----:|
|
|
22
|
+
| `<KButton/>` | ✅ | ✅ | ✅ |
|
|
23
|
+
| `<KButtonGroup/>` | ✅ | ✅ | ✅ |
|
|
24
|
+
| `<KToggleButton/>` | ✅ | ✅ | ✅ |
|
|
25
|
+
| `<KSwitch/>` | ✅ | ✅ | ✅ |
|
|
26
|
+
| `<KTextField/>` | ✅ | ✅ | ✅ |
|
|
27
|
+
| `<KSelect/>` | ✅ | ✅ | ✅ |
|
|
28
|
+
| `<KAccordion/>` | ✅ | ✅ | ✅ |
|
|
29
|
+
| `<KMenu/>` | ✅ | ✅ | ✅ |
|
|
30
|
+
| `<KDropdown/>` | ✅ | ✅ | ✅ |
|
|
31
|
+
| `<KBackdrop/>` | ✅ | ✅ | ✅ |
|
|
32
|
+
| `<KModal/>` | ✅ | ✅ | ✅ |
|
|
33
|
+
| `<KSpinner/>` | ✅ | ✅ | ✅ |
|
|
34
|
+
| `<KIcon/>` | ✅ | ✅ | ✅ |
|
|
35
|
+
| 🏃🏻♂
|
|
36
|
+
|
|
37
|
+
#### **Core 컴포넌트**
|
|
38
|
+
디자인 없이 기본 로직과 접근성(A11y) 처리만 포함된 단일 컴포넌트입니다.
|
|
39
|
+
Main 컴포넌트 내부에서 재사용되며, 재사용성과 별도의 디자인을 적용하기 위해 만들어 졌습니다.
|
|
40
|
+
|
|
41
|
+
| 컴포넌트 | 기능 | 스토리북 | a11y |
|
|
42
|
+
|:------------------------|:----:|:--------:|:----:|
|
|
43
|
+
| `<Button/>` | ✅ | ✅ | ✅ |
|
|
44
|
+
| `<TextField/>` | ✅ | ✅ | ✅ |
|
|
45
|
+
| `<Switch/>` | ✅ | ✅ | ✅ |
|
|
46
|
+
| `<Menu/>` | ✅ | ✅ | ✅ |
|
|
47
|
+
| `<MenuItem/>` | ✅ | ✅ | ✅ |
|
|
48
|
+
| `<Accordion/>` | ✅ | ✅ | ✅ |
|
|
49
|
+
| `<Accordion.Summary/>` | ✅ | ✅ | ✅ |
|
|
50
|
+
| `<Accordion.Content/>` | ✅ | ✅ | ✅ |
|
|
2
51
|
|
|
3
|
-
<br>
|
|
4
|
-
|
|
5
|
-
<div align="center">
|
|
6
|
-
<img width="360" height="360" src="https://github.com/macjjuni/kku-ui/assets/38034518/9b93b70e-a5d5-4d5e-8794-e4b206bff57a" alt="kku-ui thumbnail" >
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
## 🎁 Components
|
|
10
|
-
|
|
11
|
-
| 컴포넌트 \ 지원 | 기능 | 디자인 | 접근성 |테스트 코드| 스토리북 | 사용/배포 |
|
|
12
|
-
|:-----------------------|:---:|:-------------------------:|:---:|:----:|:---:|:-----:|
|
|
13
|
-
| `<KButton />` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
14
|
-
| `<KTextField /> ` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
15
|
-
| `<KIcon />` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
16
|
-
| `<KSelect />` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
17
|
-
| `<KDropHolder />` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
18
|
-
| `<KSwitch />` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
19
|
-
| `<KCard />` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
20
|
-
| `<KAccordion />` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
21
|
-
| `<KModal />` |✅| ✅ | ✅ | ✅ |✅|✅|
|
|
22
|
-
| 🏃🏻♂️.. |✨| ✨ | ✨ | ✨ |✨|✨|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
✅ Good ⚠️ Not Good 🧑🏻💻 Trying
|
|
26
|
-
|
|
27
|
-
<br>
|
|
28
|
-
|
|
29
|
-
## 📆 Planning
|
|
30
|
-
|
|
31
|
-
### 📌 <a href="https://github.com/users/macjjuni/projects/1/views/1" target="_blank" >GitHub Project</a>
|
|
32
|
-
|
|
33
|
-
<br>
|
|
34
52
|
|
|
35
53
|
## 📦 Install
|
|
36
54
|
```
|
|
@@ -39,8 +57,9 @@ npm install kku-ui
|
|
|
39
57
|
```
|
|
40
58
|
yarn add kku-ui
|
|
41
59
|
```
|
|
42
|
-
|
|
43
|
-
|
|
60
|
+
```
|
|
61
|
+
pnpm add kku-ui
|
|
62
|
+
```
|
|
44
63
|
|
|
45
64
|
## ⚙️ Initial Setting
|
|
46
65
|
```typescript
|
|
@@ -49,23 +68,17 @@ yarn add kku-ui
|
|
|
49
68
|
import 'kku-ui/lib/styles/index.css'
|
|
50
69
|
```
|
|
51
70
|
|
|
52
|
-
<br>
|
|
53
|
-
|
|
54
71
|
## 🧑🏻💻 Use Examples
|
|
55
72
|
|
|
56
73
|
```typescript
|
|
57
74
|
import { KButton } from 'kku-ui'
|
|
58
75
|
|
|
59
76
|
export default function Component() {
|
|
60
|
-
|
|
77
|
+
return (
|
|
78
|
+
<KButton label="Hello World!"/>
|
|
79
|
+
);
|
|
61
80
|
}
|
|
62
81
|
```
|
|
63
82
|
|
|
64
|
-
<br>
|
|
65
|
-
|
|
66
|
-
## 🕺🏻 Preview
|
|
67
|
-
|
|
68
|
-
### 🔗 [StoryBook](https://macjjuni.github.io/kku-ui)
|
|
69
|
-
|
|
70
83
|
|
|
71
84
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as useRipple } from './useRipple/useRipple';
|
|
2
|
+
export { default as useCleanId } from './useCleanId';
|
|
3
|
+
export { default as useClickOutside } from './useClickOutside';
|
|
4
|
+
export { default as useDynamicRefs } from './useDynamicRefs';
|
|
5
|
+
export { default as useDropdownPosition } from './useDropdownPosition';
|
|
6
|
+
export { default as useSafePortalContainer } from './useSafePortalContainer';
|
|
7
|
+
export { default as useEscapeKey } from './useEscapeKey';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useCleanId(text: string): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { KDropdownOffsetType, KDropdownPositionType } from '../../components/data-display/dropdown/KDropdown.interface';
|
|
3
|
+
interface Position {
|
|
4
|
+
top: number;
|
|
5
|
+
left: number;
|
|
6
|
+
}
|
|
7
|
+
interface UseDropdownPositionParams {
|
|
8
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
9
|
+
contentRef: RefObject<HTMLElement | null>;
|
|
10
|
+
position: KDropdownPositionType;
|
|
11
|
+
open: boolean;
|
|
12
|
+
offset?: KDropdownOffsetType;
|
|
13
|
+
gap?: number;
|
|
14
|
+
}
|
|
15
|
+
export default function useDropdownPosition({ triggerRef, contentRef, position, open, offset, gap, }: UseDropdownPositionParams): Position;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useSafePortalContainer(Element?: HTMLElement): HTMLElement | null;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SizeType } from '../../../common/base/base.interface';
|
|
3
|
+
import { ButtonProps } from '../../../core';
|
|
4
|
+
export declare const BUTTON_VARIANTS: readonly ["outlined", "solid", "primary", "subtle", "plain"];
|
|
5
|
+
export type KButtonVariantType = (typeof BUTTON_VARIANTS)[number];
|
|
6
|
+
export interface KButtonProps extends ButtonProps {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
size?: SizeType;
|
|
9
|
+
variant?: KButtonVariantType;
|
|
10
|
+
isDanger?: boolean;
|
|
11
|
+
width?: number | string;
|
|
12
|
+
height?: number | string;
|
|
13
|
+
}
|
|
14
|
+
export interface KButtonRefs {
|
|
15
|
+
focus: () => void;
|
|
16
|
+
blur: () => void;
|
|
17
|
+
click: () => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SwitchProps } from '../../../core/switch/Switch.interface';
|
|
2
|
+
import { SizeType } from '../../../common/base/base.interface';
|
|
3
|
+
export interface KSwitchProps extends SwitchProps {
|
|
4
|
+
size?: SizeType;
|
|
5
|
+
}
|
|
6
|
+
export interface KSwitchRefs {
|
|
7
|
+
toggle: () => void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { KToggleButtonProps } from './KToggleButton.interface';
|
|
2
|
+
declare const _default: import('react').MemoExoticComponent<{
|
|
3
|
+
({ multiple, className, variant, children, ...restProps }: KToggleButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
displayName: string;
|
|
5
|
+
}>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { KButtonVariantType } from '../..';
|
|
3
|
+
export interface KToggleButtonProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
4
|
+
variant?: KButtonVariantType;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
multiple?: boolean;
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KAccordionProps } from './KAccordion.interface';
|
|
2
2
|
declare const KAccordion: import('react').MemoExoticComponent<{
|
|
3
|
-
(
|
|
3
|
+
(props: KAccordionProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
}>;
|
|
6
6
|
export default KAccordion;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { SizeType } from '../../../common/base/base.interface';
|
|
3
|
+
import { AccordionProps } from '../../../core/accordion';
|
|
4
|
+
export interface KAccordionProps extends AccordionProps {
|
|
5
|
+
summary: string | ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
size?: SizeType;
|
|
8
|
+
width?: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
import { default as DropdownTrigger } from './KDropdownTrigger';
|
|
3
|
+
import { default as DropdownContent } from './KDropdownContent';
|
|
4
|
+
import { KDropdownProps } from './KDropdown.interface';
|
|
5
|
+
interface DropdownNamespace extends ForwardRefExoticComponent<KDropdownProps & RefAttributes<HTMLElement>> {
|
|
6
|
+
Trigger: typeof DropdownTrigger;
|
|
7
|
+
Content: typeof DropdownContent;
|
|
8
|
+
}
|
|
9
|
+
declare const KDropdown: DropdownNamespace;
|
|
10
|
+
export default KDropdown;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { HTMLAttributes, KeyboardEvent, ReactNode, RefObject } from 'react';
|
|
2
|
+
export declare const K_DROPDOWN_POSITIONS: readonly ["top-start", "top", "top-end", "right-start", "right", "right-end", "bottom-start", "bottom", "bottom-end", "left-start", "left", "left-end"];
|
|
3
|
+
export type KDropdownPositionType = typeof K_DROPDOWN_POSITIONS[number];
|
|
4
|
+
export type KDropdownTriggerType = 'hover' | 'click';
|
|
5
|
+
export interface KDropdownOffsetType {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
}
|
|
9
|
+
export interface KDropdownContextProps {
|
|
10
|
+
open: boolean;
|
|
11
|
+
onOpen: () => void;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onFocusContent: () => void;
|
|
14
|
+
onBlurContent: (e: KeyboardEvent<HTMLElement>) => void;
|
|
15
|
+
id: string;
|
|
16
|
+
triggerRef: RefObject<HTMLDivElement | null>;
|
|
17
|
+
contentRef: RefObject<HTMLDivElement | null>;
|
|
18
|
+
trigger: KDropdownTriggerType;
|
|
19
|
+
position: KDropdownPositionType;
|
|
20
|
+
}
|
|
21
|
+
export interface KDropdownRefs {
|
|
22
|
+
onOpen: () => void;
|
|
23
|
+
onClose: () => void;
|
|
24
|
+
}
|
|
25
|
+
export type DropdownElementType = 'div' | 'ul' | 'li' | 'p' | 'span';
|
|
26
|
+
export interface KDropdownProps extends HTMLAttributes<HTMLElement> {
|
|
27
|
+
as?: DropdownElementType;
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
trigger?: KDropdownTriggerType;
|
|
30
|
+
position?: KDropdownPositionType;
|
|
31
|
+
}
|
|
32
|
+
export interface KDropdownTriggerProps extends HTMLAttributes<HTMLDivElement> {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface KDropdownContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
37
|
+
children: ReactNode;
|
|
38
|
+
autoClose?: boolean;
|
|
39
|
+
gap?: number;
|
|
40
|
+
offset?: KDropdownOffsetType;
|
|
41
|
+
container?: HTMLElement;
|
|
42
|
+
zIndex?: number;
|
|
43
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
import { KMenuProps } from './KMenu.interface';
|
|
3
|
+
import { default as KMenuItem } from './KMenuItem';
|
|
4
|
+
import { default as KMenuItemSelectable } from './KMenuItemSelectable';
|
|
5
|
+
import { default as KMenuItemDivider } from './KMenuItemDivider';
|
|
6
|
+
interface KMenuNamespace extends ForwardRefExoticComponent<KMenuProps & RefAttributes<HTMLUListElement>> {
|
|
7
|
+
Item: typeof KMenuItem;
|
|
8
|
+
ItemSelectable: typeof KMenuItemSelectable;
|
|
9
|
+
ItemDivider: typeof KMenuItemDivider;
|
|
10
|
+
}
|
|
11
|
+
declare const KMenu: KMenuNamespace;
|
|
12
|
+
export default KMenu;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { MenuItemProps, MenuProps } from '../../../core';
|
|
3
|
+
import { SizeType } from '../../../common/base/base.interface';
|
|
4
|
+
export interface KMenuProps extends Omit<MenuProps, 'as'> {
|
|
5
|
+
size?: SizeType;
|
|
6
|
+
width?: number | string;
|
|
7
|
+
}
|
|
8
|
+
export interface KMenuItemProps extends Omit<MenuItemProps, 'as'> {
|
|
9
|
+
leftContent?: ReactNode;
|
|
10
|
+
rightContent?: ReactNode;
|
|
11
|
+
shortcut?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
size?: SizeType;
|
|
14
|
+
}
|
|
15
|
+
export interface KMenuItemSelectableProps extends Omit<KMenuItemProps, 'leftContent'> {
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface KMenuItemDividerProps extends HTMLAttributes<HTMLLIElement> {
|
|
19
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KBaseProp } from '../../../common/base/base.interface';
|
|
2
|
+
export interface KSkeletonProps extends KBaseProp {
|
|
3
|
+
width?: string | number;
|
|
4
|
+
height?: string | number;
|
|
5
|
+
borderRadius: string | number;
|
|
6
|
+
animation?: 'pulse' | 'wave';
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
2
|
+
import { KModalProps } from './KModal.interface';
|
|
3
|
+
import { default as KModalHeader } from './KModalHeader';
|
|
4
|
+
import { default as KModalContent } from './KModalContent';
|
|
5
|
+
import { default as KModalFooter } from './KModalFooter';
|
|
6
|
+
interface KModalNamespace extends ForwardRefExoticComponent<KModalProps> {
|
|
7
|
+
Header: typeof KModalHeader;
|
|
8
|
+
Content: typeof KModalContent;
|
|
9
|
+
Footer: typeof KModalFooter;
|
|
10
|
+
}
|
|
11
|
+
declare const KModal: KModalNamespace;
|
|
12
|
+
export default KModal;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Dispatch, HTMLAttributes, ReactNode, SetStateAction } from 'react';
|
|
2
|
+
export declare const KMODAL_SIZES: readonly ["medium", "small", "large"];
|
|
3
|
+
export type KModalSizeType = (typeof KMODAL_SIZES)[number];
|
|
4
|
+
export interface KModalContextProps {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
title: string | null;
|
|
7
|
+
setTitle: Dispatch<SetStateAction<string | null>>;
|
|
8
|
+
}
|
|
9
|
+
export interface KModalProps extends HTMLAttributes<HTMLElement> {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
setIsOpen?: Dispatch<SetStateAction<boolean>>;
|
|
12
|
+
onClose?: () => void;
|
|
13
|
+
container?: HTMLElement;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
size?: KModalSizeType;
|
|
16
|
+
animation?: 'slide' | 'fade' | 'scale';
|
|
17
|
+
width?: number | string;
|
|
18
|
+
height?: number | string;
|
|
19
|
+
isOverlay?: boolean;
|
|
20
|
+
overlayOpacity?: number;
|
|
21
|
+
overlayClosable?: boolean;
|
|
22
|
+
escClosable?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface KModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
25
|
+
title?: string;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export interface KModalContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export interface KModalFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
align?: 'left' | 'center' | 'right';
|
|
34
|
+
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { MouseEvent, KeyboardEvent } from 'react';
|
|
2
|
-
import { KBaseProp } from '
|
|
3
|
-
export declare const ICON_SIZES:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
readonly small: "small";
|
|
7
|
-
};
|
|
8
|
-
export type KIconSize = keyof typeof ICON_SIZES;
|
|
9
|
-
export declare const KIconSizeList: ("small" | "medium" | "large")[];
|
|
2
|
+
import { KBaseProp } from '../../../common/base/base.interface';
|
|
3
|
+
export declare const ICON_SIZES: readonly ["xsmall", "small", "medium", "large", "xlarge"];
|
|
4
|
+
export type KIconSize = (typeof ICON_SIZES)[number];
|
|
5
|
+
export declare const KIconSizeList: ("small" | "medium" | "large" | "xsmall" | "xlarge")[];
|
|
10
6
|
export interface KIconProps extends KBaseProp {
|
|
11
7
|
icon: string;
|
|
12
8
|
size?: KIconSize | number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './icon';
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './input/switch';
|
|
7
|
-
export * from './card';
|
|
8
|
-
export * from './accordion';
|
|
9
|
-
export * from './modal';
|
|
1
|
+
export * from './actions';
|
|
2
|
+
export * from './data-display';
|
|
3
|
+
export * from './feedback';
|
|
4
|
+
export * from './foundations';
|
|
5
|
+
export * from './input';
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import { KeyboardEvent } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { CSSProperties, HTMLAttributes, KeyboardEvent } from 'react';
|
|
2
|
+
import { SizeType } from '../../../common/base/base.interface';
|
|
3
|
+
import { KInputValidateType } from '../..';
|
|
3
4
|
export interface KSelectItemType {
|
|
4
|
-
['value']: string;
|
|
5
|
+
['value']: string | number;
|
|
5
6
|
['label']: string;
|
|
6
7
|
}
|
|
7
|
-
export interface KSelectProps extends
|
|
8
|
-
value?: string;
|
|
8
|
+
export interface KSelectProps extends KInputValidateType, Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
9
|
+
value?: string | number;
|
|
9
10
|
items: KSelectItemType[];
|
|
11
|
+
label?: string;
|
|
10
12
|
placeholder?: string;
|
|
11
13
|
noDataText?: string;
|
|
12
14
|
disabled?: boolean;
|
|
13
|
-
|
|
15
|
+
required?: boolean;
|
|
16
|
+
onChange: (val: string | number) => void;
|
|
14
17
|
onFocus?: () => void;
|
|
15
18
|
onBlur?: () => void;
|
|
19
|
+
size?: SizeType;
|
|
16
20
|
width?: number;
|
|
21
|
+
id?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
style?: CSSProperties;
|
|
17
24
|
}
|
|
18
25
|
export interface KSelectRefs {
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
onOpen: () => void;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
onValidate: () => Promise<boolean> | boolean;
|
|
21
29
|
}
|
|
22
30
|
export interface KSelectListProps {
|
|
23
31
|
value?: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { KTextFieldProps, KTextFieldRefs } from './KTextField.interface';
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
2
|
+
declare const _default: import('react').NamedExoticComponent<KTextFieldProps & import('react').RefAttributes<KTextFieldRefs>>;
|
|
3
|
+
export default _default;
|