fone-design-system_v2 1.0.99 → 1.0.101
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/components/Dialog/Dialog.d.ts +20 -14
- package/dist/components/Label/Label.d.ts +21 -8
- package/dist/components/NumberField/NumberField.d.ts +34 -0
- package/dist/components/NumberField/index.d.ts +2 -0
- package/dist/components/OutlinedInput/OutlinedInput.d.ts +5 -0
- package/dist/components/OutlinedInput/index.d.ts +2 -0
- package/dist/components/Select/index.d.ts +1 -2
- package/dist/components/Table2/hooks/useElementHeight.d.ts +11 -0
- package/dist/components/TextArea/TextArea.d.ts +12 -0
- package/dist/components/TextArea/index.d.ts +2 -0
- package/dist/components/TextField2/TextField2.d.ts +16 -31
- package/dist/components/TextField2/index.d.ts +1 -2
- package/dist/fone-design-system.es.js +28878 -24910
- package/dist/fone-design-system.umd.js +242 -216
- package/dist/index.d.ts +2 -0
- package/dist/theme/components/OutlinedInput.theme.d.ts +3 -0
- package/package.json +3 -3
- package/dist/components/Select/RHFSelect2Controller.d.ts +0 -12
- package/dist/components/TextField2/RHFTextField2Controller.d.ts +0 -20
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { DialogProps as MuiDialogProps, SxProps, Theme } from '@mui/material';
|
|
3
|
-
|
|
3
|
+
declare const DIALOG_WIDTHS: {
|
|
4
|
+
readonly xs: "300px";
|
|
5
|
+
readonly sm: "480px";
|
|
6
|
+
readonly md: "600px";
|
|
7
|
+
readonly lg: "800px";
|
|
8
|
+
readonly xl: "1000px";
|
|
9
|
+
};
|
|
10
|
+
export type DialogSize = keyof typeof DIALOG_WIDTHS | "auto";
|
|
11
|
+
export type DialogType = "info" | "success" | "warning" | "error" | "confirm";
|
|
12
|
+
type DialogCloseReason = "backdropClick" | "escapeKeyDown";
|
|
13
|
+
interface DialogPropsBase extends Omit<MuiDialogProps, "open" | "onClose" | "sx" | "children" | "scroll" | "fullScreen" | "content" | "title"> {
|
|
4
14
|
/** 다이얼로그 열린 상태 */
|
|
5
15
|
open: boolean;
|
|
6
|
-
/** 다이얼로그 확인 버튼 클릭 이벤트 핸들러 */
|
|
7
16
|
/** 다이얼로그 닫기 이벤트 핸들러 */
|
|
8
|
-
onClose: () => void;
|
|
17
|
+
onClose: (event?: object, reason?: DialogCloseReason) => void;
|
|
9
18
|
/** 다이얼로그 제목 */
|
|
10
|
-
title?:
|
|
19
|
+
title?: React.ReactNode;
|
|
11
20
|
/** 다이얼로그 내용 */
|
|
12
|
-
content?:
|
|
21
|
+
content?: React.ReactNode;
|
|
13
22
|
/** 다이얼로그 액션 버튼 */
|
|
14
23
|
actions?: React.ReactNode;
|
|
15
24
|
/** 최대 너비 */
|
|
16
|
-
size?:
|
|
25
|
+
size?: DialogSize;
|
|
17
26
|
/** 전체 화면 여부 */
|
|
18
27
|
fullScreen?: boolean;
|
|
19
28
|
/** 스크롤 동작 */
|
|
20
29
|
scroll?: "paper" | "body";
|
|
21
|
-
/** 스타일
|
|
22
|
-
sx?: SxProps<Theme
|
|
30
|
+
/** 다이얼로그 Paper 스타일 */
|
|
31
|
+
sx?: SxProps<Theme>;
|
|
23
32
|
/** 영역별 구분선 */
|
|
24
33
|
dividers?: boolean;
|
|
25
34
|
/** 액션 버튼 정렬 */
|
|
26
35
|
actionsAlign?: "center" | "left" | "right";
|
|
27
36
|
/** 자식노드 */
|
|
28
37
|
children?: React.ReactNode;
|
|
38
|
+
/** 배경(backdrop) 클릭 닫기 방지 */
|
|
39
|
+
disableBackdropClose?: boolean;
|
|
29
40
|
}
|
|
30
41
|
export type DialogWithType = (DialogPropsBase & {
|
|
31
42
|
type: "confirm";
|
|
@@ -34,13 +45,8 @@ export type DialogWithType = (DialogPropsBase & {
|
|
|
34
45
|
type?: "info" | "success" | "warning" | "error";
|
|
35
46
|
onOk?: never;
|
|
36
47
|
});
|
|
37
|
-
/** 모달 다이얼로그 컴포넌트
|
|
38
|
-
*
|
|
39
|
-
* 대체적으로 Provider로 사용되는 컴포넌트입니다.
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
48
|
export declare const Dialog: {
|
|
43
|
-
({ open, onClose, title, content, actions, fullScreen, scroll, size, type, onOk, dividers, actionsAlign, children, sx, ...props }: DialogWithType): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
({ open, onClose, title, content, actions, fullScreen, scroll, size, type, onOk, dividers, actionsAlign, children, sx, disableBackdropClose, PaperProps: paperProps, ...props }: DialogWithType): import("react/jsx-runtime").JSX.Element;
|
|
44
50
|
displayName: string;
|
|
45
51
|
};
|
|
46
52
|
export {};
|
|
@@ -1,16 +1,29 @@
|
|
|
1
|
+
import { FormLabelProps } from '@mui/material/FormLabel';
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
type LabelSize = "small" | "medium";
|
|
4
|
+
export interface LabelProps extends Omit<FormLabelProps, "children" | "title" | "color" | "component"> {
|
|
5
|
+
/** 권장 표시 텍스트 */
|
|
6
|
+
label?: React.ReactNode;
|
|
7
|
+
/** label 대신 직접 children으로 넣고 싶을 때 */
|
|
5
8
|
children?: React.ReactNode;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 하위 호환용.
|
|
11
|
+
* 기존 코드에서 title을 표시 텍스트로 썼다면 그대로 동작하게 유지.
|
|
12
|
+
* 새 코드에서는 label 사용 권장.
|
|
13
|
+
*/
|
|
14
|
+
title?: React.ReactNode;
|
|
15
|
+
size?: LabelSize;
|
|
9
16
|
bold?: boolean;
|
|
17
|
+
/** 권장 텍스트 색상 prop */
|
|
18
|
+
textColor?: string;
|
|
19
|
+
/**
|
|
20
|
+
* 하위 호환용.
|
|
21
|
+
* 기존 color prop을 텍스트 색상으로 쓰던 코드 대응.
|
|
22
|
+
* 새 코드에서는 textColor 사용 권장.
|
|
23
|
+
*/
|
|
10
24
|
color?: string;
|
|
11
|
-
required?: boolean;
|
|
12
25
|
requiredColor?: string;
|
|
13
26
|
requiredAlign?: "left" | "right";
|
|
14
27
|
}
|
|
15
|
-
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
28
|
+
declare const Label: React.ForwardRefExoticComponent<Omit<LabelProps, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
16
29
|
export default Label;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TextField2Props } from '../TextField2';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
type NumberValue = number | null;
|
|
4
|
+
type NumberFieldChangeEvent = React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>;
|
|
5
|
+
type NumberFieldFocusEvent = React.FocusEvent<HTMLInputElement | HTMLTextAreaElement>;
|
|
6
|
+
export interface NumberFieldProps extends Omit<TextField2Props, "value" | "defaultValue" | "onChange" | "type" | "multiline" | "rows" | "minRows" | "maxRows" | "inputProps"> {
|
|
7
|
+
/** 숫자 기준 controlled value */
|
|
8
|
+
value?: NumberValue;
|
|
9
|
+
/** 숫자 기준 uncontrolled defaultValue */
|
|
10
|
+
defaultValue?: NumberValue;
|
|
11
|
+
/** 원본 input change event */
|
|
12
|
+
onChange?: (event: NumberFieldChangeEvent) => void;
|
|
13
|
+
/** 입력 중 숫자값이 바뀔 때 호출 */
|
|
14
|
+
onValueChange?: (value: NumberValue, event: NumberFieldChangeEvent | NumberFieldFocusEvent) => void;
|
|
15
|
+
/** blur 후 최종 확정된 숫자값 */
|
|
16
|
+
onValueCommit?: (value: NumberValue, event: NumberFieldFocusEvent) => void;
|
|
17
|
+
/** blur 시 최소/최대 범위 보정용 */
|
|
18
|
+
min?: number;
|
|
19
|
+
max?: number;
|
|
20
|
+
/** blur 시 step 단위 반올림용 */
|
|
21
|
+
step?: number;
|
|
22
|
+
/** 소수 허용 여부 */
|
|
23
|
+
allowDecimal?: boolean;
|
|
24
|
+
/** 음수 허용 여부 */
|
|
25
|
+
allowNegative?: boolean;
|
|
26
|
+
/** blur 시 min/max 범위로 값 보정 여부 */
|
|
27
|
+
clampOnBlur?: boolean;
|
|
28
|
+
/** blur 시 step 기준 반올림 여부 */
|
|
29
|
+
snapToStepOnBlur?: boolean;
|
|
30
|
+
/** 실제 input element에 전달할 native props */
|
|
31
|
+
inputProps?: TextField2Props["inputProps"];
|
|
32
|
+
}
|
|
33
|
+
declare const NumberField: React.ForwardRefExoticComponent<Omit<NumberFieldProps, "ref"> & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
34
|
+
export default NumberField;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OutlinedInputProps as MuiOutlinedInputProps } from '@mui/material';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export type OutlinedInputProps = Omit<MuiOutlinedInputProps, "inputRef">;
|
|
4
|
+
declare const OutlinedInput: React.ForwardRefExoticComponent<Omit<OutlinedInputProps, "ref"> & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
5
|
+
export default OutlinedInput;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { RHFSelect2ControllerProps, default as RHFSelect2Controller } from './RHFSelect2Controller';
|
|
2
1
|
import { default as Select, SelectProps } from './Select';
|
|
3
|
-
export { Select, SelectProps
|
|
2
|
+
export { Select, SelectProps };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RefCallback } from 'react';
|
|
2
|
+
type Options = {
|
|
3
|
+
/** 0이 측정되면 직전 유효값을 유지할지 여부 */
|
|
4
|
+
keepLastNonZero?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* 요소 높이 추적 훅 (탭 전환/언마운트에도 안정)
|
|
8
|
+
* 반환: [callbackRef, height]
|
|
9
|
+
*/
|
|
10
|
+
declare function useElementHeight<T extends HTMLElement = HTMLDivElement>(opts?: Options): [RefCallback<T>, number];
|
|
11
|
+
export default useElementHeight;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TextField2Props } from '../TextField2';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface TextAreaProps extends Omit<TextField2Props, "type" | "multiline"> {
|
|
4
|
+
/**
|
|
5
|
+
* resize 방향
|
|
6
|
+
* - none: 기본 autosize(minRows/maxRows) 사용
|
|
7
|
+
* - vertical/horizontal/both: root 박스를 직접 resize
|
|
8
|
+
*/
|
|
9
|
+
resize?: "none" | "vertical" | "horizontal" | "both";
|
|
10
|
+
}
|
|
11
|
+
declare const TextArea: React.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
12
|
+
export default TextArea;
|
|
@@ -1,34 +1,19 @@
|
|
|
1
|
-
import { default as React
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormHelperTextProps } from '@mui/material';
|
|
3
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
4
|
+
import { LabelProps } from '../Label';
|
|
5
|
+
import { OutlinedInputProps } from '../OutlinedInput';
|
|
6
|
+
export interface TextField2Props extends Omit<OutlinedInputProps, "className" | "sx"> {
|
|
7
|
+
label?: React.ReactNode;
|
|
8
|
+
helperText?: React.ReactNode;
|
|
9
|
+
/** FormControl root */
|
|
9
10
|
className?: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/** MUI 슬롯 전용 prop 전달용 (필요 시 내부 슬롯에 세부 옵션 전달) */
|
|
17
|
-
slotProps?: any;
|
|
18
|
-
/** MUI system `sx` 스타일 오버라이드 (루트 FormControl에 적용) */
|
|
19
|
-
sx?: any;
|
|
20
|
-
/** HTML input type (text, password, number 등) */
|
|
21
|
-
type?: string;
|
|
22
|
-
/** 읽기 전용 여부 */
|
|
23
|
-
readOnly?: boolean;
|
|
24
|
-
/** 필수 입력 여부(브라우저 기본 유효성에 사용) */
|
|
25
|
-
required?: boolean;
|
|
26
|
-
/** HTML id 속성 (label-for 연결 등) */
|
|
27
|
-
id?: string;
|
|
28
|
-
/** forwardRef로 외부에서 인풋에 접근하기 위한 ref
|
|
29
|
-
* - 일반적으로 React.forwardRef 제네릭으로 처리하므로 props에 직접 넣지 않아도 됨
|
|
30
|
-
*/
|
|
31
|
-
ref?: React.ForwardedRef<HTMLInputElement>;
|
|
11
|
+
sx?: SxProps<Theme>;
|
|
12
|
+
/** Input root */
|
|
13
|
+
inputClassName?: string;
|
|
14
|
+
inputSx?: SxProps<Theme>;
|
|
15
|
+
labelProps?: LabelProps;
|
|
16
|
+
helperTextProps?: FormHelperTextProps;
|
|
32
17
|
}
|
|
33
|
-
declare const TextField2: React.ForwardRefExoticComponent<Omit<TextField2Props, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
18
|
+
declare const TextField2: React.ForwardRefExoticComponent<Omit<TextField2Props, "ref"> & React.RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
34
19
|
export default TextField2;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { default as RHFTextField2Controller, RHFTextField2ControllerProps } from './RHFTextField2Controller';
|
|
2
1
|
import { default as TextField2, TextField2Props } from './TextField2';
|
|
3
|
-
export { TextField2, TextField2Props
|
|
2
|
+
export { TextField2, TextField2Props };
|