@thewrong/ui 0.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/README.md +65 -0
- package/dist/index.cjs.js +40 -0
- package/dist/index.es.js +8066 -0
- package/dist/src/components/_shared/form-size-tokens.d.ts +16 -0
- package/dist/src/components/action-toast/ActionToast.d.ts +56 -0
- package/dist/src/components/action-toast/index.d.ts +2 -0
- package/dist/src/components/animated-height/AnimatedHeight.d.ts +30 -0
- package/dist/src/components/animated-height/index.d.ts +2 -0
- package/dist/src/components/badge/Badge.d.ts +2 -0
- package/dist/src/components/badge/index.d.ts +2 -0
- package/dist/src/components/badge/types.d.ts +56 -0
- package/dist/src/components/badge/utils.d.ts +13 -0
- package/dist/src/components/button/Button.d.ts +2 -0
- package/dist/src/components/button/index.d.ts +2 -0
- package/dist/src/components/button/types.d.ts +22 -0
- package/dist/src/components/button/utils.d.ts +6 -0
- package/dist/src/components/checkbox/Checkbox.d.ts +33 -0
- package/dist/src/components/checkbox/index.d.ts +2 -0
- package/dist/src/components/checkbox/types.d.ts +33 -0
- package/dist/src/components/checkbox/utils.d.ts +33 -0
- package/dist/src/components/collapsible/Collapsible.d.ts +36 -0
- package/dist/src/components/collapsible/index.d.ts +2 -0
- package/dist/src/components/date-input/DateInput.d.ts +27 -0
- package/dist/src/components/date-input/index.d.ts +1 -0
- package/dist/src/components/date-picker/date-picker.d.ts +34 -0
- package/dist/src/components/date-picker/date-range-picker.d.ts +21 -0
- package/dist/src/components/date-picker/index.d.ts +5 -0
- package/dist/src/components/date-picker/month-picker.d.ts +25 -0
- package/dist/src/components/drawer/Drawer.d.ts +18 -0
- package/dist/src/components/drawer/index.d.ts +2 -0
- package/dist/src/components/info-tooltip/InfoTooltip.d.ts +11 -0
- package/dist/src/components/info-tooltip/index.d.ts +2 -0
- package/dist/src/components/input/Input.d.ts +10 -0
- package/dist/src/components/input/PasswordInput.d.ts +8 -0
- package/dist/src/components/input/format.d.ts +38 -0
- package/dist/src/components/input/index.d.ts +4 -0
- package/dist/src/components/input/types.d.ts +131 -0
- package/dist/src/components/input/utils.d.ts +17 -0
- package/dist/src/components/loading-spinner/LoadingSpinner.d.ts +16 -0
- package/dist/src/components/loading-spinner/index.d.ts +2 -0
- package/dist/src/components/modal/Modal.d.ts +51 -0
- package/dist/src/components/modal/ModalSubView.d.ts +61 -0
- package/dist/src/components/modal/StandardModal.d.ts +59 -0
- package/dist/src/components/modal/index.d.ts +6 -0
- package/dist/src/components/page-title/PageTitle.d.ts +17 -0
- package/dist/src/components/page-title/index.d.ts +1 -0
- package/dist/src/components/popover/Popover.d.ts +28 -0
- package/dist/src/components/popover/index.d.ts +2 -0
- package/dist/src/components/search-box/ExactMatchToggle.d.ts +14 -0
- package/dist/src/components/search-box/SearchBox.d.ts +35 -0
- package/dist/src/components/search-box/SearchBoxChips.d.ts +12 -0
- package/dist/src/components/search-box/SearchBoxDateRange.d.ts +20 -0
- package/dist/src/components/search-box/SearchBoxDateSingle.d.ts +17 -0
- package/dist/src/components/search-box/SearchBoxField.d.ts +11 -0
- package/dist/src/components/search-box/SearchBoxFloatingInput.d.ts +24 -0
- package/dist/src/components/search-box/SearchBoxFloatingSelect.d.ts +19 -0
- package/dist/src/components/search-box/SearchBoxMonth.d.ts +14 -0
- package/dist/src/components/search-box/SearchBoxMultiSelect.d.ts +25 -0
- package/dist/src/components/search-box/SearchBoxSheetContext.d.ts +8 -0
- package/dist/src/components/search-box/dateRangePresets.d.ts +10 -0
- package/dist/src/components/search-box/index.d.ts +5 -0
- package/dist/src/components/search-box/parseDateRange.d.ts +15 -0
- package/dist/src/components/search-box/parseSearchValues.d.ts +38 -0
- package/dist/src/components/search-box/types.d.ts +67 -0
- package/dist/src/components/search-box/useSearchBoxState.d.ts +30 -0
- package/dist/src/components/select/MultiSelect.d.ts +69 -0
- package/dist/src/components/select/Select.d.ts +81 -0
- package/dist/src/components/select/index.d.ts +4 -0
- package/dist/src/components/select/loading-dots.d.ts +9 -0
- package/dist/src/components/select/types.d.ts +141 -0
- package/dist/src/components/select/utils.d.ts +16 -0
- package/dist/src/components/switch/Switch.d.ts +17 -0
- package/dist/src/components/switch/index.d.ts +2 -0
- package/dist/src/components/switch/types.d.ts +10 -0
- package/dist/src/components/switch/utils.d.ts +14 -0
- package/dist/src/components/table/accordion-table.d.ts +31 -0
- package/dist/src/components/table/column-group-utils.d.ts +49 -0
- package/dist/src/components/table/components/ColumnPresetSelector.d.ts +36 -0
- package/dist/src/components/table/components/ColumnSettingsTable.d.ts +25 -0
- package/dist/src/components/table/components/KeyboardNavButton.d.ts +12 -0
- package/dist/src/components/table/components/PageJumpInput.d.ts +16 -0
- package/dist/src/components/table/components/Pagination.d.ts +38 -0
- package/dist/src/components/table/components/PaginationFooter.d.ts +28 -0
- package/dist/src/components/table/components/SortableHeaderCell.d.ts +27 -0
- package/dist/src/components/table/hooks/useColumnPresets.d.ts +48 -0
- package/dist/src/components/table/hooks/useColumnResize.d.ts +99 -0
- package/dist/src/components/table/hooks/useFillEmptyRows.d.ts +51 -0
- package/dist/src/components/table/hooks/useInfiniteScroll.d.ts +58 -0
- package/dist/src/components/table/hooks/useTableColumnState.d.ts +30 -0
- package/dist/src/components/table/hooks/useTableDragSelection.d.ts +35 -0
- package/dist/src/components/table/hooks/useTableSort.d.ts +47 -0
- package/dist/src/components/table/hooks/useVirtualTable.d.ts +49 -0
- package/dist/src/components/table/index.d.ts +27 -0
- package/dist/src/components/table/mini-table.d.ts +44 -0
- package/dist/src/components/table/paginated-mini-table.d.ts +28 -0
- package/dist/src/components/table/paginated-table.d.ts +8 -0
- package/dist/src/components/table/table.d.ts +10 -0
- package/dist/src/components/table/types.d.ts +409 -0
- package/dist/src/components/table/utils.d.ts +47 -0
- package/dist/src/components/table-checkbox/TableCheckbox.d.ts +16 -0
- package/dist/src/components/table-checkbox/index.d.ts +1 -0
- package/dist/src/components/table-page-layout/TablePageLayout.d.ts +22 -0
- package/dist/src/components/table-page-layout/index.d.ts +1 -0
- package/dist/src/components/textarea/Textarea.d.ts +10 -0
- package/dist/src/components/textarea/index.d.ts +2 -0
- package/dist/src/components/textarea/types.d.ts +38 -0
- package/dist/src/components/toast/ToastProvider.d.ts +26 -0
- package/dist/src/components/toast/index.d.ts +3 -0
- package/dist/src/components/toolbar/Toolbar.d.ts +114 -0
- package/dist/src/components/toolbar/index.d.ts +2 -0
- package/dist/src/components/tooltip/Tooltip.d.ts +18 -0
- package/dist/src/components/tooltip/index.d.ts +2 -0
- package/dist/src/hooks/index.d.ts +4 -0
- package/dist/src/hooks/useBottomSheetDrag.d.ts +41 -0
- package/dist/src/hooks/useClickOutside.d.ts +16 -0
- package/dist/src/hooks/useMediaQuery.d.ts +15 -0
- package/dist/src/hooks/useScrollLock.d.ts +8 -0
- package/dist/src/index.d.ts +27 -0
- package/dist/src/lib/Portal.d.ts +12 -0
- package/dist/src/lib/column-preset-storage.d.ts +54 -0
- package/dist/src/lib/index.d.ts +6 -0
- package/dist/src/lib/overlay-stack.d.ts +13 -0
- package/dist/src/lib/utils.d.ts +11 -0
- package/dist/ui.css +3 -0
- package/package.json +128 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 폼 컴포넌트(Input/Select/Textarea) 우측 슬롯의 size 토큰.
|
|
3
|
+
*
|
|
4
|
+
* Button/Input/Select/Textarea의 size 토큰 정렬을 단일 출처로 관리한다.
|
|
5
|
+
*/
|
|
6
|
+
export type FormFieldSize = "mini" | "small" | "medium" | "large";
|
|
7
|
+
/** 빌트인 clearable의 X 아이콘과 호출부 trailingIcon의 svg에 적용할 height/width 클래스. */
|
|
8
|
+
export declare const SLOT_ICON_SIZE_CLASS: Record<FormFieldSize, string>;
|
|
9
|
+
/** Select의 chevron 전용 사이즈 — 일반 슬롯 아이콘과 동일 비율. */
|
|
10
|
+
export declare const CHEVRON_SIZE_CLASS: Record<FormFieldSize, string>;
|
|
11
|
+
/** trailingIcon/badge wrapper에 깔아 안의 svg가 자동으로 따라가게 하는 arbitrary selector. */
|
|
12
|
+
export declare const SLOT_CHILD_ICON_CLASS: Record<FormFieldSize, string>;
|
|
13
|
+
/** badge wrapper에 적용할 텍스트 사이즈 — 호출부가 inline className으로 명시 시 override. */
|
|
14
|
+
export declare const SLOT_BADGE_TEXT_CLASS: Record<FormFieldSize, string>;
|
|
15
|
+
/** 슬롯 간 gap — 디자인 시안 medium 기준 12px. */
|
|
16
|
+
export declare const SLOT_GAP_CLASS: Record<FormFieldSize, string>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { Button } from '../../../components/button';
|
|
3
|
+
type ButtonVisualProps = Partial<Pick<ComponentProps<typeof Button>, "variant" | "appearance" | "size" | "leadingIcon" | "trailingIcon">>;
|
|
4
|
+
export interface ActionToastButton extends ButtonVisualProps {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* 클릭 시 호출. 호출 후 토스트는 자동으로 닫힌다.
|
|
8
|
+
* 닫지 않고 유지하려면 `closeOnClick: false`.
|
|
9
|
+
*
|
|
10
|
+
* 콜백이 입력값(prompt/textarea)을 인자로 받음. input이 없으면 빈 문자열.
|
|
11
|
+
*/
|
|
12
|
+
onClick: (inputValue: string) => void;
|
|
13
|
+
closeOnClick?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type ActionToastInput = {
|
|
17
|
+
type: "text";
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
} | {
|
|
21
|
+
type: "textarea";
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
rows?: number;
|
|
25
|
+
};
|
|
26
|
+
interface ShowActionToastArgs {
|
|
27
|
+
message: ReactNode;
|
|
28
|
+
actions: ActionToastButton[];
|
|
29
|
+
/** 톤. 좌측 아이콘 색상에만 반영(배경/텍스트는 일반 토스트와 동일한 다크 그레이). */
|
|
30
|
+
tone?: "warning" | "info" | "danger";
|
|
31
|
+
/** 좌측 아이콘 커스텀. 미지정 시 톤별 기본 아이콘. null이면 아이콘 숨김. */
|
|
32
|
+
icon?: ReactNode | null;
|
|
33
|
+
input?: ActionToastInput;
|
|
34
|
+
/** 토스트 폭(px) 커스텀. 기본 680(일반 토스트와 동일). 모바일은 viewport-32px로 자동 fit. */
|
|
35
|
+
widthPx?: number;
|
|
36
|
+
/**
|
|
37
|
+
* 백드롭 노출 여부. 기본 true(모달 위 결정 강제용).
|
|
38
|
+
* 단순 알림(예: 새 버전 안내)처럼 사용자 동작을 막을 필요 없을 때 false.
|
|
39
|
+
* false면 클릭-아웃 dismiss도 비활성.
|
|
40
|
+
*/
|
|
41
|
+
backdrop?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 사용자 결정이 필요한 액션 토스트. 자동 dismiss 없음.
|
|
45
|
+
* 위치는 전역 Toaster를 따름(데스크탑=bottom-center, 모바일=top-center).
|
|
46
|
+
* 한 번에 최대 1개만 노출(같은 id로 덮어쓰기).
|
|
47
|
+
*
|
|
48
|
+
* 컨벤션: 다크 시트 위에서 outlined 버튼은 border가 묻혀 가독성이 떨어진다.
|
|
49
|
+
* 액션 버튼은 `appearance: "filled"`로 통일할 것.
|
|
50
|
+
*
|
|
51
|
+
* 사용 전 앱 루트에 `react-hot-toast`의 `<Toaster />`가 마운트돼 있어야 한다.
|
|
52
|
+
*/
|
|
53
|
+
export declare function showActionToast({ message, actions, tone, icon, input, widthPx, backdrop, }: ShowActionToastArgs): string;
|
|
54
|
+
export declare function dismissActionToast(): void;
|
|
55
|
+
export declare function isActionToastActive(): boolean;
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface AnimatedHeightProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/** 트랜지션 시간(ms). 기본 220. */
|
|
5
|
+
durationMs?: number;
|
|
6
|
+
/** cubic-bezier 커브(motion). 기본 ease-out. */
|
|
7
|
+
ease?: [number, number, number, number];
|
|
8
|
+
/** 외부 wrapper 추가 className. */
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 자식 콘텐츠 높이가 변할 때 부드럽게 이행시키는 wrapper.
|
|
13
|
+
*
|
|
14
|
+
* 모드 토글이나 행 추가/삭제 같은 가벼운 변화에 부드러운 트랜지션으로 UX 품질을 높인다.
|
|
15
|
+
* 구현은 ResizeObserver로 자식 높이를 측정해 motion height로 이행. **첫 측정은 transition 0**으로
|
|
16
|
+
* 적용해 진입 시점 점프를 방지한다 (motion-discussions#1884의 표준 패턴).
|
|
17
|
+
*
|
|
18
|
+
* 모달 외곽이 아니라 **모달 안의 콘텐츠 영역**을 감싸야 한다. 외곽 모달에 직접 적용하면 진입/퇴장
|
|
19
|
+
* 모션과 충돌한다.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <AnimatedHeight>
|
|
24
|
+
* <ModeToggle />
|
|
25
|
+
* {showAdvanced && <AdvancedOptions />}
|
|
26
|
+
* <RowList rows={rows} />
|
|
27
|
+
* </AnimatedHeight>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function AnimatedHeight({ children, durationMs, ease, className, }: AnimatedHeightProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Badge 컴포넌트의 크기 타입
|
|
4
|
+
*/
|
|
5
|
+
export type BadgeSize = "xsmall" | "small" | "medium" | "large";
|
|
6
|
+
/**
|
|
7
|
+
* Badge 컴포넌트의 스타일 변형 타입
|
|
8
|
+
*/
|
|
9
|
+
export type BadgeVariant = "fill" | "weak";
|
|
10
|
+
/**
|
|
11
|
+
* Badge 컴포넌트의 색상 타입
|
|
12
|
+
*/
|
|
13
|
+
export type BadgeColor = "primary" | "secondary" | "success" | "error" | "warning" | "info" | "neutral";
|
|
14
|
+
/**
|
|
15
|
+
* Badge 컴포넌트의 공통 Props
|
|
16
|
+
*/
|
|
17
|
+
export interface BadgeCommonProps {
|
|
18
|
+
/**
|
|
19
|
+
* Badge의 크기
|
|
20
|
+
*/
|
|
21
|
+
size?: BadgeSize;
|
|
22
|
+
/**
|
|
23
|
+
* Badge의 스타일 (모양)
|
|
24
|
+
*/
|
|
25
|
+
variant?: BadgeVariant;
|
|
26
|
+
/**
|
|
27
|
+
* Badge의 색상
|
|
28
|
+
*/
|
|
29
|
+
color?: BadgeColor;
|
|
30
|
+
/**
|
|
31
|
+
* Badge의 내용
|
|
32
|
+
*/
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Badge 컴포넌트의 Props (span 태그용)
|
|
37
|
+
*/
|
|
38
|
+
export interface BadgeBaseProps extends Omit<ComponentPropsWithoutRef<"span">, "color" | "children">, BadgeCommonProps {
|
|
39
|
+
/**
|
|
40
|
+
* `as` prop이 없으면 span 태그로 렌더링돼요.
|
|
41
|
+
*/
|
|
42
|
+
as?: never;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Badge 컴포넌트의 Props (div 태그용)
|
|
46
|
+
*/
|
|
47
|
+
export interface BadgeDivProps extends Omit<ComponentPropsWithoutRef<"div">, "color" | "children">, BadgeCommonProps {
|
|
48
|
+
/**
|
|
49
|
+
* `as` prop을 통해 Badge의 태그를 변경할 수 있어요.
|
|
50
|
+
*/
|
|
51
|
+
as: "div";
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Badge 컴포넌트의 Props
|
|
55
|
+
*/
|
|
56
|
+
export type BadgeProps = BadgeBaseProps | BadgeDivProps;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BadgeColor, BadgeVariant, BadgeSize } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Badge 색상에 따른 Tailwind 클래스 매핑
|
|
4
|
+
*/
|
|
5
|
+
export declare const getBadgeColorClasses: (color?: BadgeColor, variant?: BadgeVariant) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Badge 크기에 따른 Tailwind 클래스 매핑
|
|
8
|
+
*/
|
|
9
|
+
export declare const getBadgeSizeClasses: (size?: BadgeSize) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Badge의 기본 클래스 (공통 스타일)
|
|
12
|
+
*/
|
|
13
|
+
export declare const getBadgeBaseClasses: () => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "tertiary" | "danger";
|
|
3
|
+
export type ButtonAppearance = "filled" | "outlined" | "transparent";
|
|
4
|
+
export type ButtonSize = "mini" | "small" | "medium" | "large";
|
|
5
|
+
export type ButtonDisplay = "inline" | "block";
|
|
6
|
+
export interface ButtonCommonProps {
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
appearance?: ButtonAppearance;
|
|
9
|
+
size?: ButtonSize;
|
|
10
|
+
display?: ButtonDisplay;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
/** 클릭 후 N ms 동안 추가 클릭 무시 — 더블클릭 방지 */
|
|
13
|
+
clickThrottleMs?: number;
|
|
14
|
+
leadingIcon?: ReactNode;
|
|
15
|
+
trailingIcon?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export interface ButtonBaseProps extends Omit<ComponentPropsWithoutRef<"button">, "color">, ButtonCommonProps {
|
|
18
|
+
}
|
|
19
|
+
export interface ButtonLinkProps extends Omit<ComponentPropsWithoutRef<"a">, "color">, ButtonCommonProps {
|
|
20
|
+
as: "a";
|
|
21
|
+
}
|
|
22
|
+
export type ButtonProps = ButtonBaseProps | ButtonLinkProps;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ButtonAppearance, ButtonDisplay, ButtonSize, ButtonVariant } from './types';
|
|
2
|
+
export declare const getButtonColorClasses: (variant?: ButtonVariant, appearance?: ButtonAppearance) => string;
|
|
3
|
+
export declare const getButtonSizeClasses: (size?: ButtonSize) => string;
|
|
4
|
+
export declare const getButtonDisplayClasses: (display?: ButtonDisplay) => string;
|
|
5
|
+
export declare const getButtonBaseClasses: () => string;
|
|
6
|
+
export declare const getButtonFocusRing: (variant?: ButtonVariant) => string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CheckboxProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Checkbox.Circle 컴포넌트 — 원형 아이콘을 사용하는 체크박스
|
|
4
|
+
*/
|
|
5
|
+
export declare const CheckboxCircle: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
6
|
+
/**
|
|
7
|
+
* Checkbox.Line 컴포넌트 — 라인 스타일의 체크박스
|
|
8
|
+
*/
|
|
9
|
+
export declare const CheckboxLine: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
10
|
+
/**
|
|
11
|
+
* Checkbox.LineTransparent 컴포넌트 — 투명한 라인 스타일의 체크박스
|
|
12
|
+
*/
|
|
13
|
+
export declare const CheckboxLineTransparent: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
14
|
+
/**
|
|
15
|
+
* Checkbox 컴포넌트
|
|
16
|
+
*
|
|
17
|
+
* 세 가지 변형을 제공합니다.
|
|
18
|
+
* - Circle: 원형 스타일
|
|
19
|
+
* - Line: 라인 스타일
|
|
20
|
+
* - LineTransparent: 투명 라인 스타일
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <Checkbox.Circle size={24} checked={isChecked} />
|
|
25
|
+
* <Checkbox.Line size={24} checked={isAgreed} />
|
|
26
|
+
* <Checkbox.LineTransparent size={24} checked={isSelected} />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const Checkbox: {
|
|
30
|
+
Circle: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
31
|
+
Line: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
32
|
+
LineTransparent: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Checkbox 컴포넌트의 공통 Props
|
|
4
|
+
*/
|
|
5
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size"> {
|
|
6
|
+
/**
|
|
7
|
+
* input 태그의 `type` 속성을 결정해요.
|
|
8
|
+
* @default 'checkbox'
|
|
9
|
+
*/
|
|
10
|
+
inputType?: "checkbox" | "radio";
|
|
11
|
+
/**
|
|
12
|
+
* Checkbox 컴포넌트의 크기를 결정해요.
|
|
13
|
+
* @default 24
|
|
14
|
+
*/
|
|
15
|
+
size?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Checkbox 컴포넌트의 선택 상태가 바뀔 때 실행되는 함수예요.
|
|
18
|
+
*/
|
|
19
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Label 텍스트
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Checkbox의 기본 색상
|
|
26
|
+
* @default 'primary'
|
|
27
|
+
*/
|
|
28
|
+
baseColor?: "primary" | "secondary" | "neutral";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Checkbox 변형 타입
|
|
32
|
+
*/
|
|
33
|
+
export type CheckboxVariant = "circle" | "line" | "lineTransparent";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CheckboxProps, CheckboxVariant } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Checkbox의 기본 스타일 클래스를 반환합니다.
|
|
4
|
+
*/
|
|
5
|
+
export declare function getCheckboxBaseClasses(): string;
|
|
6
|
+
/**
|
|
7
|
+
* Checkbox input의 기본 스타일 클래스를 반환합니다.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCheckboxInputBaseClasses(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Checkbox Circle 변형의 스타일 클래스를 반환합니다.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getCheckboxCircleClasses(baseColor?: CheckboxProps["baseColor"]): string;
|
|
14
|
+
/**
|
|
15
|
+
* Checkbox Line 변형의 스타일 클래스를 반환합니다.
|
|
16
|
+
*/
|
|
17
|
+
export declare function getCheckboxLineClasses(baseColor?: CheckboxProps["baseColor"]): string;
|
|
18
|
+
/**
|
|
19
|
+
* Checkbox LineTransparent 변형의 스타일 클래스를 반환합니다.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getCheckboxLineTransparentClasses(baseColor?: CheckboxProps["baseColor"]): string;
|
|
22
|
+
/**
|
|
23
|
+
* variant에 따른 Checkbox 스타일 클래스를 반환합니다.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getCheckboxVariantClasses(variant: CheckboxVariant, baseColor?: CheckboxProps["baseColor"]): string;
|
|
26
|
+
/**
|
|
27
|
+
* Checkbox 크기에 따른 스타일을 반환합니다.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getCheckboxSizeStyle(size?: number): React.CSSProperties;
|
|
30
|
+
/**
|
|
31
|
+
* Label 스타일 클래스를 반환합니다.
|
|
32
|
+
*/
|
|
33
|
+
export declare function getLabelClasses(): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface CollapsibleProps {
|
|
3
|
+
/** true면 펼침, false면 접힘. */
|
|
4
|
+
open: boolean;
|
|
5
|
+
/** 접힘 → 펼침/그 반대 모션 시간. 기본 200ms. */
|
|
6
|
+
durationMs?: number;
|
|
7
|
+
/** ease. 기본 ease-out. */
|
|
8
|
+
ease?: string;
|
|
9
|
+
/**
|
|
10
|
+
* 접힘 상태에서 콘텐츠를 DOM에서 제거할지 여부. 기본 false(렌더 유지 + height 0).
|
|
11
|
+
* true면 unmount하면서 모션은 사라진다(다음 펼침 때 처음부터).
|
|
12
|
+
*/
|
|
13
|
+
unmountWhenClosed?: boolean;
|
|
14
|
+
/** 접힘 상태에서 opacity 0으로 만들지 여부. 기본 true. */
|
|
15
|
+
fade?: boolean;
|
|
16
|
+
/** 추가 className(외부 wrapper에 적용). */
|
|
17
|
+
className?: string;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 자식 콘텐츠 높이를 부드럽게 펼치고 접는 컴포넌트.
|
|
22
|
+
*
|
|
23
|
+
* 구현은 CSS grid의 `grid-template-rows: 0fr ↔ 1fr` 트릭이라 JS 측정 없이도 height auto
|
|
24
|
+
* 트랜지션이 동작한다 (Chrome 117+ / Safari 17.4+ / Firefox 117+).
|
|
25
|
+
*
|
|
26
|
+
* 모달 안에서 영역을 부드럽게 늘리고 줄일 때 사용. 모달 외곽 자체는 Collapsible로 감싸지 말 것
|
|
27
|
+
* (시트 위치/스크롤 컨테이너 동작과 충돌 가능). 모달 안의 내용 블록을 감싸는 용도.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Collapsible open={showDetail}>
|
|
32
|
+
* <div className="px-4 py-3">상세 정보</div>
|
|
33
|
+
* </Collapsible>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function Collapsible({ open, durationMs, ease, unmountWhenClosed, fade, className, children, }: CollapsibleProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** yyyy-MM-dd 또는 빈 문자열. */
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (next: string) => void;
|
|
5
|
+
size?: "mini" | "small";
|
|
6
|
+
ariaLabel?: string;
|
|
7
|
+
/**
|
|
8
|
+
* SearchBox 플로팅 라벨 패턴을 적용한다. 지정하면 상단에 작은 라벨이 부유로 떠 다른 검색 필드와
|
|
9
|
+
* 같은 톤. 값 없음 + 미포커스면 인풋 중앙 placeholder 위치, 포커스/값 있음이면 상단 보더 위.
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* true면 trailing 캘린더 버튼이 모바일에서도 popover로만 떠 자체 바텀시트를 만들지 않는다.
|
|
15
|
+
* 호출부가 이미 시트(예: SearchBox 모바일 바텀시트) 안에 있을 때 시트 두 개 겹침 회피.
|
|
16
|
+
*/
|
|
17
|
+
disableMobileSheet?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 단일 날짜 입력 — `<input type="date">` + 우측 trailing 캘린더 버튼(DatePicker popover).
|
|
21
|
+
*
|
|
22
|
+
* 네이티브 캘린더 indicator는 `.search-box-date-input` 클래스 + globals CSS로 숨김.
|
|
23
|
+
* 사용자는 직접 타이핑(브라우저가 yyyy-MM-dd 형식 강제) 또는 trailing 버튼으로 캘린더 선택.
|
|
24
|
+
* value 빈 값일 땐 placeholder(브라우저 기본 "연도-월-일")가 회색으로 표기.
|
|
25
|
+
*/
|
|
26
|
+
export declare function DateInput({ value, onChange, size, ariaLabel, label, className, disableMobileSheet, }: Props): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DateInput } from './DateInput';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface DatePickerProps {
|
|
3
|
+
/** 트리거 — children 자체가 클릭 대상. */
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** yyyy-MM-dd. 빈 문자열/null이면 미선택. */
|
|
6
|
+
value?: string | null;
|
|
7
|
+
onApply: (date: string) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* true면 모바일에서도 자체 바텀시트 대신 데스크톱과 동일한 popover로 표시.
|
|
11
|
+
* 호출부가 이미 바텀시트(예: SearchBox 모바일 시트) 안에 있어 시트 두 개가 겹치는 걸 피할 때 사용.
|
|
12
|
+
*/
|
|
13
|
+
disableMobileSheet?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 단일 날짜 선택 popover.
|
|
17
|
+
*
|
|
18
|
+
* 위치 계산은 floating-ui 위임 — autoUpdate가 스크롤/리사이즈 시 좌표 자동 갱신.
|
|
19
|
+
* 모바일에선 바텀시트로 풀스크린 전환(트리거 위치 계산 무시).
|
|
20
|
+
*/
|
|
21
|
+
export declare function DatePicker({ children, value, onApply, disabled, disableMobileSheet, }: DatePickerProps): import("react").JSX.Element;
|
|
22
|
+
interface DatePickerBodyProps {
|
|
23
|
+
initialValue?: string | null;
|
|
24
|
+
onApply: (date: string) => void;
|
|
25
|
+
onClose: () => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* DatePicker 본체(캘린더 + 닫기/적용 버튼)만 — 컨테이너(popover/시트) 없이.
|
|
29
|
+
*
|
|
30
|
+
* SearchBox 바텀시트 안처럼 부모 컨테이너(ModalSubView 등)에 직접 캘린더만 마운트하고 싶을 때 쓴다.
|
|
31
|
+
* 일반 사용처는 `<DatePicker>`를 그대로 사용.
|
|
32
|
+
*/
|
|
33
|
+
export declare function DatePickerBody({ initialValue, onApply, onClose }: DatePickerBodyProps): import("react").JSX.Element;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface DateRange {
|
|
3
|
+
from: string | null;
|
|
4
|
+
to: string | null;
|
|
5
|
+
}
|
|
6
|
+
interface DateRangePickerProps {
|
|
7
|
+
/** 트리거 (버튼/탭 등). asChild처럼 children을 클릭 가능한 요소로 받음 */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
value?: DateRange;
|
|
10
|
+
onApply: (range: DateRange) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 날짜 범위 선택 popover.
|
|
15
|
+
*
|
|
16
|
+
* 위치 계산은 floating-ui 위임 — autoUpdate가 스크롤/리사이즈 시 좌표 자동 갱신.
|
|
17
|
+
* 모바일에선 바텀시트로 풀스크린 전환(트리거 위치 계산 무시) + 단일 캘린더.
|
|
18
|
+
* 데스크탑은 두 달 가로 배치.
|
|
19
|
+
*/
|
|
20
|
+
export declare function DateRangePicker({ children, value, onApply, disabled, }: DateRangePickerProps): import("react").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { DateRangePicker } from './date-range-picker';
|
|
2
|
+
export type { DateRange } from './date-range-picker';
|
|
3
|
+
export { DatePicker, DatePickerBody } from './date-picker';
|
|
4
|
+
export { MonthPicker } from './month-picker';
|
|
5
|
+
export type { MonthValue } from './month-picker';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface MonthValue {
|
|
3
|
+
year: number;
|
|
4
|
+
month: number;
|
|
5
|
+
}
|
|
6
|
+
interface MonthPickerProps {
|
|
7
|
+
/** 트리거 요소. children에 클릭 가능한 노드를 넘긴다. */
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
value?: MonthValue;
|
|
10
|
+
onChange: (value: MonthValue) => void;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* true면 모바일에서도 바텀시트 대신 popover로 뜬다. 이미 바텀시트(SearchBox 필터 등) 안에
|
|
14
|
+
* 있을 때 시트가 겹치는 걸 막는다.
|
|
15
|
+
*/
|
|
16
|
+
disableMobileSheet?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* 월(YYYY.MM) 선택 popover.
|
|
20
|
+
*
|
|
21
|
+
* 위치 계산은 floating-ui 위임 — autoUpdate가 스크롤/리사이즈 시 좌표 자동 갱신.
|
|
22
|
+
* 모바일에선 바텀시트로 풀스크린 전환(disableMobileSheet면 popover 유지).
|
|
23
|
+
*/
|
|
24
|
+
export declare function MonthPicker({ children, value, onChange, disabled, disableMobileSheet, }: MonthPickerProps): import("react").JSX.Element;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface DrawerProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
title?: string;
|
|
5
|
+
/** 데스크탑(sm+) 드로어 폭(px). 기본 480. 모바일은 무관 (바텀시트). */
|
|
6
|
+
widthPx?: number;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 데스크탑(`sm`+)에서는 화면 우측에서 슬라이드 인 하는 사이드 드로어,
|
|
11
|
+
* 모바일에서는 화면 하단에서 올라오는 bottom-sheet으로 동작.
|
|
12
|
+
*
|
|
13
|
+
* 모바일 분기·드래그-다운 닫기·바텀시트 하단 틈 방지 패턴은 Modal과 동일.
|
|
14
|
+
*
|
|
15
|
+
* **레이어드 오버레이**: ESC/백드롭은 `overlayStack`에서 자신이 top일 때만 반응한다.
|
|
16
|
+
* ActionToast가 위에 떠 있으면(priority) 자동으로 양보된다.
|
|
17
|
+
*/
|
|
18
|
+
export declare function Drawer({ open, onClose, title, widthPx, children, }: DrawerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface InfoTooltipProps {
|
|
3
|
+
content: ReactNode;
|
|
4
|
+
position?: "top" | "bottom" | "left" | "right";
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 정보 툴팁 컴포넌트
|
|
8
|
+
*
|
|
9
|
+
* `?` 아이콘에 마우스 호버 시 툴팁을 표시해요. CSS group-hover 기반의 단순 구현.
|
|
10
|
+
*/
|
|
11
|
+
export declare function InfoTooltip({ content, position }: InfoTooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Input 컴포넌트
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <Input variant="box" label="이름" placeholder="이름을 입력하세요" />
|
|
7
|
+
* <Input variant="box" hasError help="에러 메시지" />
|
|
8
|
+
* <Input variant="box" disabled />
|
|
9
|
+
*/
|
|
10
|
+
export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InputProps } from './types';
|
|
2
|
+
type PasswordInputProps = Omit<InputProps, "type" | "trailingIcon">;
|
|
3
|
+
/**
|
|
4
|
+
* 비밀번호 입력 — 마스킹 토글(눈 아이콘) 내장.
|
|
5
|
+
* `Input`을 그대로 감싸서 type/trailingIcon만 제어. 다른 prop은 모두 통과.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PasswordInput: import('react').ForwardRefExoticComponent<PasswordInputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { InputFormat, InputValue } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 전화번호에 하이픈을 추가해요
|
|
4
|
+
* @example "01012345678" → "010-1234-5678"
|
|
5
|
+
*/
|
|
6
|
+
export declare function transformToPhoneNumber(value: InputValue): string;
|
|
7
|
+
/**
|
|
8
|
+
* 전화번호에서 하이픈을 제거해요
|
|
9
|
+
* @example "010-1234-5678" → "01012345678"
|
|
10
|
+
*/
|
|
11
|
+
export declare function resetFromPhoneNumber(value: InputValue): string;
|
|
12
|
+
/**
|
|
13
|
+
* 금액에 콤마를 추가해요
|
|
14
|
+
* @example "1000000" → "1,000,000"
|
|
15
|
+
*/
|
|
16
|
+
export declare function transformToPrice(value: InputValue): string;
|
|
17
|
+
/**
|
|
18
|
+
* 금액에서 콤마를 제거해요
|
|
19
|
+
* @example "1,000,000" → "1000000"
|
|
20
|
+
*/
|
|
21
|
+
export declare function resetFromPrice(value: InputValue): string;
|
|
22
|
+
/**
|
|
23
|
+
* 내장 Format 객체
|
|
24
|
+
*/
|
|
25
|
+
export declare const inputFormats: {
|
|
26
|
+
/**
|
|
27
|
+
* 전화번호 포맷
|
|
28
|
+
* transform: "01012345678" → "010-1234-5678"
|
|
29
|
+
* reset: "010-1234-5678" → "01012345678"
|
|
30
|
+
*/
|
|
31
|
+
readonly phoneNumber: InputFormat;
|
|
32
|
+
/**
|
|
33
|
+
* 금액 포맷
|
|
34
|
+
* transform: "1000000" → "1,000,000"
|
|
35
|
+
* reset: "1,000,000" → "1000000"
|
|
36
|
+
*/
|
|
37
|
+
readonly price: InputFormat;
|
|
38
|
+
};
|