@croquiscom/pds 8.22.2 → 8.22.3
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/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import React, { ReactNode, PropsWithChildren } from 'react';
|
|
1
|
+
import React, { ReactNode, PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
import { HelpTextProps } from '../text';
|
|
3
3
|
import { VerticalAlignment } from '../stack';
|
|
4
4
|
import { CSSValueWithLength } from '../../styles';
|
|
5
|
+
import { InputStatus } from '../input/types';
|
|
5
6
|
type FormFieldAlignment = Extract<VerticalAlignment, 'top' | 'center'>;
|
|
6
7
|
type FormFieldPosition = 'left' | 'top';
|
|
7
8
|
export interface FormFieldProps {
|
|
8
9
|
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* FormField의 상태를 지정하면 children과 formHelperText 상태를 공유합니다.
|
|
12
|
+
* PDS의 Input, Dropdown, DropdownInput, NumericInput 컴포넌트만 공유하도록 제한합니다.
|
|
13
|
+
* 다른 컴포넌트는 사용하더라도 formHelperText에만 status가 적용됩니다.
|
|
14
|
+
*/
|
|
15
|
+
status?: InputStatus;
|
|
9
16
|
label?: ReactNode;
|
|
10
17
|
/**
|
|
11
18
|
* 라벨 우측 렌더링될 Addon 요소
|
|
@@ -20,7 +27,7 @@ export interface FormFieldProps {
|
|
|
20
27
|
*/
|
|
21
28
|
helper?: HelpTextProps;
|
|
22
29
|
/**
|
|
23
|
-
* FormHelperText 컴포넌트로
|
|
30
|
+
* FormHelperText 컴포넌트로 children 아래에 메세지를 표시합니다.
|
|
24
31
|
*/
|
|
25
32
|
formHelperText?: ReactNode;
|
|
26
33
|
/**
|
|
@@ -39,6 +46,9 @@ export interface FormFieldProps {
|
|
|
39
46
|
* @default left
|
|
40
47
|
*/
|
|
41
48
|
position?: FormFieldPosition;
|
|
49
|
+
children?: ReactElement<{
|
|
50
|
+
status?: InputStatus;
|
|
51
|
+
}>;
|
|
42
52
|
}
|
|
43
|
-
export declare const FormField: ({ className, label, rightAddon, required, helper, formHelperText, labelWidth, alignment, position, children, }: PropsWithChildren<FormFieldProps>) => React.JSX.Element;
|
|
53
|
+
export declare const FormField: ({ className, label, status, rightAddon, required, helper, formHelperText, labelWidth, alignment, position, children, }: PropsWithChildren<FormFieldProps>) => React.JSX.Element;
|
|
44
54
|
export {};
|
|
@@ -10,7 +10,9 @@ export declare const WithCheckboxGroup: Story;
|
|
|
10
10
|
export declare const WithHelpPopover: Story;
|
|
11
11
|
export declare const TopAlign: Story;
|
|
12
12
|
export declare const TopPosition: Story;
|
|
13
|
+
export declare const SuccessCheckboxGroup: Story;
|
|
13
14
|
export declare const Error: Story;
|
|
15
|
+
export declare const ErrorDropdown: Story;
|
|
14
16
|
export declare const ErrorLongLabel: Story;
|
|
15
17
|
export declare const ErrorOverflowLabel: Story;
|
|
16
18
|
export declare const ErrorTop: Story;
|