@aivex/ui 1.2.0-dev.2 → 1.2.0-dev.21
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/dist/{Switch-c8rHebeK.js → Button-B6WM7faP.js} +2345 -4756
- package/dist/Button-B6WM7faP.js.map +1 -0
- package/dist/Button-C4WtB38c.cjs +2 -0
- package/dist/Button-C4WtB38c.cjs.map +1 -0
- package/dist/IconButton-CuO-3IXh.cjs +2 -0
- package/dist/IconButton-CuO-3IXh.cjs.map +1 -0
- package/dist/IconButton-pgdAaijX.js +560 -0
- package/dist/IconButton-pgdAaijX.js.map +1 -0
- package/dist/Switch-CtjEelTs.cjs +42 -0
- package/dist/Switch-CtjEelTs.cjs.map +1 -0
- package/dist/Switch-rKD8bdwo.js +2537 -0
- package/dist/Switch-rKD8bdwo.js.map +1 -0
- package/dist/comment.cjs +114 -0
- package/dist/comment.cjs.map +1 -0
- package/dist/comment.js +13624 -0
- package/dist/comment.js.map +1 -0
- package/dist/components/Badge/Badge.d.ts +8 -1
- package/dist/components/Coachmark/Coachmark.d.ts +54 -0
- package/dist/components/Coachmark/index.d.ts +2 -0
- package/dist/components/Comment/CommentInput.d.ts +30 -0
- package/dist/components/Comment/CommentPin.d.ts +17 -0
- package/dist/components/Comment/MentionInput.d.ts +30 -0
- package/dist/components/Comment/MentionList.d.ts +14 -0
- package/dist/components/Comment/index.d.ts +4 -0
- package/dist/components/Comment/types.d.ts +12 -0
- package/dist/components/Comment/useMentionSuggestion.d.ts +15 -0
- package/dist/components/DataGrid/DataGrid.d.ts +29 -71
- package/dist/components/DataGrid/DataGridColumnSettings.d.ts +18 -0
- package/dist/components/DataGrid/DataGridPrimitives.d.ts +77 -0
- package/dist/components/DataGrid/DataGridRows.d.ts +25 -0
- package/dist/components/DataGrid/index.d.ts +6 -2
- package/dist/components/DatePicker/DatePicker.d.ts +8 -18
- package/dist/components/DatePicker/date.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/Icon/index.d.ts +3 -1
- package/dist/components/InputBase/InputBase.d.ts +5 -7
- package/dist/components/Logo/index.d.ts +2 -1
- package/dist/components/Modal/Modal.d.ts +9 -2
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/SelectBox/SelectBox.d.ts +7 -4
- package/dist/components/SelectButton/SelectButton.d.ts +18 -0
- package/dist/components/SelectButton/index.d.ts +2 -0
- package/dist/components/ShapeEditor/ShapeEditor.d.ts +1 -1
- package/dist/components/ShapeEditor/ShapeViewer.d.ts +42 -0
- package/dist/components/ShapeEditor/_components/ContextMenu.d.ts +1 -1
- package/dist/components/ShapeEditor/_components/Minimap.d.ts +10 -6
- package/dist/components/ShapeEditor/_components/MinimapShape.d.ts +2 -2
- package/dist/components/ShapeEditor/_components/RegionOverlay.d.ts +21 -0
- package/dist/components/ShapeEditor/_components/SelectionInfo.d.ts +4 -1
- package/dist/components/ShapeEditor/_components/SettingsPanel.d.ts +4 -2
- package/dist/components/ShapeEditor/_constants.d.ts +7 -4
- package/dist/components/ShapeEditor/_model/clipboard.d.ts +22 -0
- package/dist/components/ShapeEditor/_model/clipboard.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_model/geometry.d.ts +22 -1
- package/dist/components/ShapeEditor/_model/geometry.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_model/imageFetch.d.ts +9 -0
- package/dist/components/ShapeEditor/_model/keymap.d.ts +1 -1
- package/dist/components/ShapeEditor/_model/overlays.d.ts +82 -15
- package/dist/components/ShapeEditor/_model/overlays.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_model/props.d.ts +98 -22
- package/dist/components/ShapeEditor/_model/strings.d.ts +2 -3
- package/dist/components/ShapeEditor/_model/viewSettings.d.ts +3 -1
- package/dist/components/ShapeEditor/_renderers/KonvaRenderer.d.ts +28 -7
- package/dist/components/ShapeEditor/_renderers/PixiRenderer.d.ts +38 -11
- package/dist/components/ShapeEditor/_renderers/transformSession.d.ts +5 -0
- package/dist/components/ShapeEditor/_renderers/types.d.ts +55 -22
- package/dist/components/ShapeEditor/_state/createInteractionController.d.ts +4 -0
- package/dist/components/ShapeEditor/_state/createInteractionController.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_state/useDrawSession.d.ts +2 -1
- package/dist/components/ShapeEditor/_state/useEditorHotkeys.d.ts +2 -0
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.d.ts +38 -11
- package/dist/components/ShapeEditor/_state/useEngineLifecycle.test.d.ts +1 -0
- package/dist/components/ShapeEditor/_state/useSelectionActions.d.ts +6 -5
- package/dist/components/ShapeEditor/index.d.ts +3 -1
- package/dist/components/Slider/Slider.d.ts +3 -1
- package/dist/components/Spinner/Spinner.d.ts +15 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +2 -1
- package/dist/components/Tagbox/Tagbox.d.ts +1 -4
- package/dist/components/Textarea/Textarea.d.ts +7 -4
- package/dist/components/Textbox/Textbox.d.ts +1 -5
- package/dist/components/Toast/Toast.d.ts +12 -2
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/index.cjs +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +6430 -3709
- package/dist/index.js.map +1 -1
- package/dist/shape-editor.cjs +1 -1
- package/dist/shape-editor.cjs.map +1 -1
- package/dist/shape-editor.js +3030 -2070
- package/dist/shape-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/tokens/tokens.css +611 -611
- package/package.json +25 -2
- package/dist/Switch-DX-FkCbT.cjs +0 -42
- package/dist/Switch-DX-FkCbT.cjs.map +0 -1
- package/dist/Switch-c8rHebeK.js.map +0 -1
- package/dist/components/ShapeEditor/_components/RoiOverlay.d.ts +0 -21
|
@@ -1,25 +1,41 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
-
import type { Point } from "../_model/geometry";
|
|
3
|
-
import type {
|
|
2
|
+
import type { EditorShape, Point } from "../_model/geometry";
|
|
3
|
+
import type { RegionOverlayData } from "../_model/overlays";
|
|
4
4
|
import { type Tool } from "../_model/tools";
|
|
5
5
|
import type { ViewSettings } from "../_model/viewSettings";
|
|
6
6
|
import type { EditorRenderer, EditorRendererCallbacks } from "../_renderers/types";
|
|
7
|
-
import type { EditorDocument } from "./useEditorDocument";
|
|
8
7
|
export type EditorImageStatus = "loading" | "ready" | "error";
|
|
8
|
+
/**
|
|
9
|
+
* 이미지 전환 판정(테스트가 명세). currentDocId/loadedUrl=엔진 반영 상태,
|
|
10
|
+
* documentId/renderedImageUrl=이번 요청. currentDocId=null이면 항상 문서 전환.
|
|
11
|
+
*/
|
|
12
|
+
export type ImageTransition = {
|
|
13
|
+
kind: "none";
|
|
14
|
+
} | {
|
|
15
|
+
kind: "clear";
|
|
16
|
+
} | {
|
|
17
|
+
kind: "load";
|
|
18
|
+
docChange: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare function classifyImageTransition({ currentDocId, documentId, loadedUrl, renderedImageUrl, }: {
|
|
21
|
+
currentDocId: string | null;
|
|
22
|
+
documentId: string;
|
|
23
|
+
loadedUrl: string | null;
|
|
24
|
+
renderedImageUrl: string;
|
|
25
|
+
}): ImageTransition;
|
|
9
26
|
/**
|
|
10
27
|
* 렌더러 엔진 생명주기 — backend당 1회 생성/파괴, 이미지 전환(문서 전환 vs 화질 스왑),
|
|
11
28
|
* 휠 줌/팬·우클릭 메뉴 네이티브 리스너, 이미지 로딩 상태 프리로드를 소유한다.
|
|
12
29
|
*
|
|
13
|
-
* 이미지 변경은 엔진을 재사용해 setImage로
|
|
14
|
-
*
|
|
15
|
-
* DOM에서 사라졌다 붙는 사이 배경이 번쩍인다.
|
|
30
|
+
* 이미지 변경은 엔진을 재사용해 setImage로 스왑한다. 문서 전환 중에는 이전 문서의
|
|
31
|
+
* 이미지·도형을 비우지만 캔버스 DOM과 렌더러 인스턴스는 유지한다.
|
|
16
32
|
*/
|
|
17
|
-
export declare function useEngineLifecycle<TMeta>({ backend, hostRef, engineRef,
|
|
33
|
+
export declare function useEngineLifecycle<TMeta>({ backend, hostRef, engineRef, documentId, renderedImageUrl, makeCallbacks, viewRef, readOnlyRef, toolRef, renderShapesRef, coordinateSizeRef, imageSizeRef, selRef, maskCanvasRef, regionOverlayRef, dimmedRef, syncMinimap, setImage, setImageVisible, setReady, setImageStatus, onContextMenuRequest, }: {
|
|
18
34
|
backend: "konva" | "pixi";
|
|
19
35
|
hostRef: RefObject<HTMLDivElement | null>;
|
|
20
36
|
engineRef: RefObject<EditorRenderer | null>;
|
|
21
|
-
/** 문서
|
|
22
|
-
|
|
37
|
+
/** 문서 identity — 문서 전환 vs 화질 스왑 구분용(URL 모양과 무관한 명시적 식별자). */
|
|
38
|
+
documentId: string;
|
|
23
39
|
/** 실제 렌더 URL(화질 스왑 반영). */
|
|
24
40
|
renderedImageUrl: string;
|
|
25
41
|
/** 상호작용 컨트롤러(콜백) 팩토리 — 엔진 생성 직전에 1회 호출. */
|
|
@@ -27,10 +43,21 @@ export declare function useEngineLifecycle<TMeta>({ backend, hostRef, engineRef,
|
|
|
27
43
|
viewRef: RefObject<ViewSettings>;
|
|
28
44
|
readOnlyRef: RefObject<boolean>;
|
|
29
45
|
toolRef: RefObject<Tool>;
|
|
30
|
-
|
|
46
|
+
/** 렌더 도형(문서 + 오버라이드 + 장식) — 이미지 전환 시 엔진 재시드용. */
|
|
47
|
+
renderShapesRef: RefObject<EditorShape<TMeta>[]>;
|
|
48
|
+
/** 도형 좌표계 크기(미지정 시 이미지 실제 픽셀 크기). */
|
|
49
|
+
coordinateSizeRef: RefObject<{
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
} | undefined>;
|
|
53
|
+
/** 좌표공간 안에서 이미지가 차지하는 크기(미지정 시 좌표공간 전체). */
|
|
54
|
+
imageSizeRef: RefObject<{
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
} | undefined>;
|
|
31
58
|
selRef: RefObject<string[]>;
|
|
32
59
|
maskCanvasRef: RefObject<HTMLCanvasElement | null>;
|
|
33
|
-
|
|
60
|
+
regionOverlayRef: RefObject<RegionOverlayData | null>;
|
|
34
61
|
dimmedRef: RefObject<boolean>;
|
|
35
62
|
syncMinimap: () => void;
|
|
36
63
|
setImage: (size: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { type RefObject } from "react";
|
|
2
|
-
import { type EditorShape } from "../_model/geometry";
|
|
2
|
+
import { type EditorShape, type Point } from "../_model/geometry";
|
|
3
3
|
import type { EditorDocument } from "./useEditorDocument";
|
|
4
4
|
/**
|
|
5
5
|
* 선택 기반 문서 액션(키보드·컨텍스트메뉴·명령형 핸들 공용) — 복사/붙여넣기/복제/삭제/
|
|
6
|
-
* z
|
|
6
|
+
* z순서/합치기/넛지. 붙여넣기 오프셋 카운터를 소유한다.
|
|
7
7
|
*/
|
|
8
|
-
export declare function useSelectionActions<TMeta>({ doc, selRef, effectiveReadOnly, changeSelection, canMergeSelection, }: {
|
|
8
|
+
export declare function useSelectionActions<TMeta>({ doc, selRef, effectiveReadOnly, changeSelection, canMergeSelection, clipboardDocumentId, clipboardScope, }: {
|
|
9
9
|
doc: EditorDocument<TMeta>;
|
|
10
10
|
selRef: RefObject<string[]>;
|
|
11
11
|
effectiveReadOnly: boolean;
|
|
12
12
|
changeSelection: (ids: string[]) => void;
|
|
13
13
|
canMergeSelection?: (shapes: EditorShape<TMeta>[]) => boolean;
|
|
14
|
+
clipboardDocumentId: string;
|
|
15
|
+
clipboardScope?: string;
|
|
14
16
|
}): {
|
|
15
17
|
selectAll: () => void;
|
|
16
18
|
clearSelection: () => void;
|
|
@@ -18,11 +20,10 @@ export declare function useSelectionActions<TMeta>({ doc, selRef, effectiveReadO
|
|
|
18
20
|
deleteSelection: () => void;
|
|
19
21
|
copySelection: () => void;
|
|
20
22
|
canPaste: () => boolean;
|
|
21
|
-
paste: () => void;
|
|
23
|
+
paste: (at?: Point) => void;
|
|
22
24
|
duplicate: () => void;
|
|
23
25
|
bringToFront: () => void;
|
|
24
26
|
sendToBack: () => void;
|
|
25
|
-
flip: (horizontal: boolean) => void;
|
|
26
27
|
nudgeSelection: (dx: number, dy: number) => void;
|
|
27
28
|
getMergeTargets: () => EditorShape<TMeta>[];
|
|
28
29
|
mergeSelection: () => void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { generateId, SHAPE_TYPE, type ShapeType } from "./_model/geometry";
|
|
2
|
-
export type {
|
|
2
|
+
export type { ExcludedZone, RoiRect } from "./_model/overlays";
|
|
3
|
+
export type { AssistantPrompt, AssistantPromptPoint, BrushScalarMode, ContextMenuItem, DrawSessionChange, DrawSessionKind, EditorAction, EditorAssistant, EditorCanvasViewport, EditorExternalTool, EditorExternalToolContext, EditorOverlayMarker, EditorPointerEvent, EditorSelectionInfo, EditorShape, GuideMaskRaster, KeymapOverrides, MaskPalette, Point, PolygonArea, RectArea, RegionMask, RegionOutlineStyle, ShapeEditorDocument, ShapeEditorHandle, ShapeEditorProps, ShapeStyle, Tool, Viewport, ViewSettings, } from "./_model/props";
|
|
3
4
|
export { DEFAULT_EDITOR_STRINGS, type EditorStrings, type EditorStringsOverride, } from "./_model/strings";
|
|
4
5
|
export { type BuiltInTool, TOOL } from "./_model/tools";
|
|
5
6
|
export { DEFAULT_VIEW_SETTINGS } from "./_model/viewSettings";
|
|
6
7
|
export { default, default as ShapeEditor } from "./ShapeEditor";
|
|
8
|
+
export { default as ShapeViewer, type ShapeViewerProps, } from "./ShapeViewer";
|
|
@@ -2,8 +2,10 @@ import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
|
2
2
|
import type { ComponentPropsWithoutRef, Ref } from "react";
|
|
3
3
|
export interface SliderProps extends ComponentPropsWithoutRef<typeof SliderPrimitive.Root> {
|
|
4
4
|
trackClassName?: string | ((index: number) => string | undefined);
|
|
5
|
+
/** 트랙 자체(높이 등)를 한 번씩 다르게 써야 하는 호스트를 위한 국소 오버라이드. */
|
|
6
|
+
trackRootClassName?: string;
|
|
5
7
|
thumbClassName?: string | ((index: number) => string | undefined);
|
|
6
8
|
ref?: Ref<HTMLSpanElement>;
|
|
7
9
|
}
|
|
8
|
-
declare function Slider({ className, trackClassName, thumbClassName, defaultValue, value, min, max, step, onValueChange, ref, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function Slider({ className, trackClassName, trackRootClassName, thumbClassName, defaultValue, value, min, max, step, onValueChange, ref, ...props }: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
9
11
|
export { Slider };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HTMLAttributes, Ref } from "react";
|
|
2
|
+
export interface SpinnerProps extends Omit<HTMLAttributes<HTMLDivElement>, "color"> {
|
|
3
|
+
/** 링의 바깥 지름(px). */
|
|
4
|
+
size?: number;
|
|
5
|
+
/** 링 색. 미지정 시 부모의 currentColor를 따른다. */
|
|
6
|
+
color?: string;
|
|
7
|
+
/**
|
|
8
|
+
* 스크린리더가 읽을 로딩 상태 문구.
|
|
9
|
+
* 장식용으로만 쓸 때는 null을 넘겨 접근성 트리에서 숨긴다.
|
|
10
|
+
*/
|
|
11
|
+
label?: string | null;
|
|
12
|
+
ref?: Ref<HTMLDivElement>;
|
|
13
|
+
}
|
|
14
|
+
declare function Spinner({ className, size, color, label, style, ref, ...props }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { Spinner };
|
|
@@ -4,8 +4,9 @@ import { type ComponentPropsWithoutRef, type Ref } from "react";
|
|
|
4
4
|
declare const switchTrackVariants: (props?: ({
|
|
5
5
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
-
export interface SwitchProps extends Omit<ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, "asChild" | "children">, VariantProps<typeof switchTrackVariants> {
|
|
7
|
+
export interface SwitchProps extends Omit<ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, "asChild" | "children" | "onCheckedChange">, VariantProps<typeof switchTrackVariants> {
|
|
8
8
|
label?: string;
|
|
9
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
9
10
|
ref?: Ref<HTMLButtonElement>;
|
|
10
11
|
}
|
|
11
12
|
declare function Switch({ className, label, size, disabled, id, ref, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { type InputHTMLAttributes, type ReactNode, type Ref } from "react";
|
|
2
2
|
export interface TagboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size" | "value" | "onChange" | "onPaste"> {
|
|
3
3
|
size?: "sm" | "md";
|
|
4
|
-
label?: string;
|
|
5
|
-
/** 인풋 하단 도움말 텍스트 */
|
|
6
|
-
helperText?: string;
|
|
7
4
|
error?: boolean;
|
|
8
5
|
value?: string[];
|
|
9
6
|
defaultValue?: string[];
|
|
@@ -21,5 +18,5 @@ export interface TagboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
21
18
|
}) => ReactNode;
|
|
22
19
|
ref?: Ref<HTMLInputElement>;
|
|
23
20
|
}
|
|
24
|
-
declare function Tagbox({ className, size,
|
|
21
|
+
declare function Tagbox({ className, size, error, disabled, readOnly, value, defaultValue, onChange, parsePaste, validate, renderTag, placeholder, id, ref, onBlur, onCompositionEnd, onCompositionStart, onFocus, onKeyDown, onPaste, ...props }: TagboxProps): import("react/jsx-runtime").JSX.Element;
|
|
25
22
|
export { Tagbox };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { ReactNode, Ref, TextareaHTMLAttributes } from "react";
|
|
2
2
|
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size"> {
|
|
3
3
|
size?: "sm" | "md";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/**
|
|
5
|
+
* 글자수 카운터용 소프트 리밋. 값이 있으면 인풋 우하단(텍스트 아래)에 `현재 / 최대` 카운터를
|
|
6
|
+
* 표시하고, 초과해도 입력을 막지 않고 에러로 경고만 한다.
|
|
7
|
+
* (카운터/디자인 없이 입력만 하드컷하려면 네이티브 maxLength 를 그대로 사용하면 된다.)
|
|
8
|
+
*/
|
|
9
|
+
maxCount?: number;
|
|
7
10
|
error?: boolean;
|
|
8
11
|
/** 초기 최소 높이 (CSS 값. 예: "120px", "8rem") */
|
|
9
12
|
minHeight?: string | number;
|
|
@@ -15,5 +18,5 @@ export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaE
|
|
|
15
18
|
endContent?: ReactNode;
|
|
16
19
|
ref?: Ref<HTMLTextAreaElement>;
|
|
17
20
|
}
|
|
18
|
-
declare function Textarea({ className,
|
|
21
|
+
declare function Textarea({ className, error, disabled, size, minHeight, fixedHeight, startContent, endContent, id, ref, onFocus, onBlur, maxCount, value, defaultValue, onChange, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
export { Textarea };
|
|
@@ -2,10 +2,6 @@ import type { InputHTMLAttributes, ReactNode, Ref } from "react";
|
|
|
2
2
|
import { inputContainerVariants } from "@/components/InputBase";
|
|
3
3
|
export interface TextboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
4
4
|
size?: "sm" | "md";
|
|
5
|
-
/** @deprecated <Field><FieldLabel>…</FieldLabel><FieldControl><Textbox/></FieldControl></Field> 를 사용하세요. */
|
|
6
|
-
label?: string;
|
|
7
|
-
/** @deprecated Field 의 <FieldDescription> / <FieldError> 를 사용하세요. */
|
|
8
|
-
helperText?: string;
|
|
9
5
|
error?: boolean;
|
|
10
6
|
/** 입력값 전체 삭제 버튼 표시 여부 */
|
|
11
7
|
clearable?: boolean;
|
|
@@ -15,5 +11,5 @@ export interface TextboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>
|
|
|
15
11
|
endContent?: ReactNode;
|
|
16
12
|
ref?: Ref<HTMLInputElement>;
|
|
17
13
|
}
|
|
18
|
-
declare function Textbox({ className,
|
|
14
|
+
declare function Textbox({ className, error, disabled, clearable, startContent, endContent, size, id, ref, value, defaultValue, onChange, onFocus, onBlur, ...props }: TextboxProps): import("react/jsx-runtime").JSX.Element;
|
|
19
15
|
export { inputContainerVariants as inputWrapperVariants, Textbox };
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
|
-
import type { HTMLAttributes, Ref } from "react";
|
|
2
|
+
import type { HTMLAttributes, ReactNode, Ref } from "react";
|
|
3
3
|
import { type ExternalToast, type ToasterProps, toast } from "sonner";
|
|
4
|
+
import { type ButtonProps } from "@/components/Button";
|
|
4
5
|
declare const toastVariants: (props?: ({
|
|
5
6
|
type?: "danger" | "default" | "success" | null | undefined;
|
|
6
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
/** 액션 버튼은 라벨을 children으로 받고, 스타일은 Toast가 고정한다. */
|
|
9
|
+
export interface ToastActionProps extends Omit<ButtonProps, "asChild" | "children" | "className" | "color" | "ref" | "size" | "style" | "variant"> {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
7
12
|
export interface ToastProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof toastVariants> {
|
|
8
13
|
open?: boolean;
|
|
9
14
|
message: string;
|
|
15
|
+
/** 메시지 우측 액션 버튼(예: 실행 취소). */
|
|
16
|
+
action?: ToastActionProps;
|
|
17
|
+
/** 지정하면 우측 끝에 닫기(X) 버튼을 렌더한다. */
|
|
10
18
|
onClose?: () => void;
|
|
19
|
+
/** 닫기 버튼 aria-label. 기본 "닫기". */
|
|
20
|
+
closeAriaLabel?: string;
|
|
11
21
|
ref?: Ref<HTMLDivElement>;
|
|
12
22
|
}
|
|
13
23
|
export type ToastToasterProps = ToasterProps;
|
|
14
24
|
export type ToastOptions = ExternalToast;
|
|
15
|
-
declare function Toast({ className, type, open, message, onClose, ref, ...props }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
|
+
declare function Toast({ className, type, open, message, action, onClose, closeAriaLabel, ref, ...props }: ToastProps): import("react/jsx-runtime").JSX.Element | null;
|
|
16
26
|
declare function ToastToaster({ position, duration, visibleToasts, gap, toastOptions, ...props }: ToastToasterProps): import("react/jsx-runtime").JSX.Element;
|
|
17
27
|
export { Toast, ToastToaster, toast, toastVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { ToastOptions, ToastProps, ToastToasterProps } from "./Toast";
|
|
1
|
+
export type { ToastActionProps, ToastOptions, ToastProps, ToastToasterProps } from "./Toast";
|
|
2
2
|
export { Toast, ToastToaster, toast, toastVariants } from "./Toast";
|