@croquiscom/pds 8.22.7 → 8.23.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/CHANGELOG.md +13 -0
- package/dist/components/chip/Chip.d.ts +3 -1
- package/dist/components/chip/styles.d.ts +1 -1
- package/dist/components/date-picker/DateUnitPicker.stories.d.ts +1 -0
- package/dist/components/form/FormField.d.ts +10 -2
- package/dist/components/form/FormField.stories.d.ts +2 -0
- package/dist/components/input/ChipInput.d.ts +51 -0
- package/dist/components/input/ChipInput.stories.d.ts +11 -0
- package/dist/index.es.js +6 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @croquiscom/pds
|
|
2
2
|
|
|
3
|
+
## 8.23.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fe57fc6: feat: ChipInput 컴포넌트 추가, InputChip 삭제 버튼 optional 처리
|
|
8
|
+
|
|
9
|
+
## 8.22.8
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 3913ac9: DateUnitPicker min/max모두같은 월 설정시 월단위 선택 오류 수정
|
|
14
|
+
- 7f2e511: FormField status를 공유하는 형태로 변경, children type변경
|
|
15
|
+
|
|
3
16
|
## 8.22.7
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -3,6 +3,8 @@ import { InputSize } from '../input/types';
|
|
|
3
3
|
export interface ChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
|
|
4
4
|
/** @default medium */
|
|
5
5
|
size?: InputSize;
|
|
6
|
-
|
|
6
|
+
/** @default true */
|
|
7
|
+
canDelete?: boolean;
|
|
8
|
+
onDelete?: () => void;
|
|
7
9
|
}
|
|
8
10
|
export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -3,6 +3,6 @@ export declare const input_chip_base_css: import("@emotion/utils").SerializedSty
|
|
|
3
3
|
export declare const input_chip_x_enabled_css: import("@emotion/utils").SerializedStyles;
|
|
4
4
|
export declare const input_chip_x_disabled_css: import("@emotion/utils").SerializedStyles;
|
|
5
5
|
export declare const input_chip_height_size_css: Record<InputSize, string>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const getInputChipSizeStyle: (size: InputSize, canDelete?: boolean) => "" | import("@emotion/utils").SerializedStyles;
|
|
7
7
|
export declare const select_chip_base_css: import("@emotion/utils").SerializedStyles;
|
|
8
8
|
export declare const select_chip_selected_css: import("@emotion/utils").SerializedStyles;
|
|
@@ -9,5 +9,6 @@ export declare const Error: Story;
|
|
|
9
9
|
export declare const Size: Story;
|
|
10
10
|
export declare const ShowRemoveButton: Story;
|
|
11
11
|
export declare const MinDate: Story;
|
|
12
|
+
export declare const MinMaxDate: Story;
|
|
12
13
|
export declare const MaxDate: Story;
|
|
13
14
|
export declare const BottomSheetPicker: Story;
|
|
@@ -2,10 +2,17 @@ import React, { ReactNode, PropsWithChildren } 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,7 @@ export interface FormFieldProps {
|
|
|
39
46
|
* @default left
|
|
40
47
|
*/
|
|
41
48
|
position?: FormFieldPosition;
|
|
49
|
+
children?: ReactNode;
|
|
42
50
|
}
|
|
43
|
-
export declare const FormField: ({ className, label, rightAddon, required, helper, formHelperText, labelWidth, alignment, position, children, }: PropsWithChildren<FormFieldProps>) => React.JSX.Element;
|
|
51
|
+
export declare const FormField: ({ className, label, status, rightAddon, required, helper, formHelperText, labelWidth, alignment, position, children, }: PropsWithChildren<FormFieldProps>) => React.JSX.Element;
|
|
44
52
|
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;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { AriaFocusProps } from '../../types/common';
|
|
3
|
+
import { InputSize, InputStatus } from './types';
|
|
4
|
+
export interface ChipInputValue {
|
|
5
|
+
value: string;
|
|
6
|
+
canDelete?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface ChipInputProps extends AriaFocusProps {
|
|
10
|
+
value?: ChipInputValue[];
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
/** @default large */
|
|
14
|
+
size?: InputSize;
|
|
15
|
+
/**
|
|
16
|
+
* `error` 이외에 상태는 별도로 UI상 표시되지 않습니다.
|
|
17
|
+
* @default info
|
|
18
|
+
* */
|
|
19
|
+
status?: InputStatus;
|
|
20
|
+
/**
|
|
21
|
+
* 칩 목록은 한 줄로 제한하거나 개행되도록 할 수 있습니다.
|
|
22
|
+
*
|
|
23
|
+
* - `nowrap`: 칩이 인풋의 너비를 초과하면 수평으로 스크롤됩니다.
|
|
24
|
+
* - `wrap`: 칩이 인풋의 너비를 초과하면 수직으로 스크롤됩니다.
|
|
25
|
+
* @default nowrap
|
|
26
|
+
* */
|
|
27
|
+
wrap?: 'wrap' | 'nowrap';
|
|
28
|
+
width?: number;
|
|
29
|
+
/**
|
|
30
|
+
* `wrap` prop이 `"wrap"`인 경우 최대 높이를 지정할 수 있습니다.
|
|
31
|
+
* 최대 높이를 초과하면 수직으로 스크롤됩니다.
|
|
32
|
+
* `maxHeight` prop이 지정되지 않으면 `size` prop에 따라 기본 높이가 적용됩니다.(small: 66px, medium: 80px, large: 90px)
|
|
33
|
+
*/
|
|
34
|
+
maxHeight?: number;
|
|
35
|
+
className?: string;
|
|
36
|
+
style?: CSSProperties;
|
|
37
|
+
onChange?: (value: ChipInputValue[]) => void;
|
|
38
|
+
}
|
|
39
|
+
export declare const getChipInputPaddingBySize: (size: InputSize) => string;
|
|
40
|
+
/**
|
|
41
|
+
* 입력된 텍스트가 있다면 아래의 경우에 Chip이 생성 됩니다.
|
|
42
|
+
* - 엔터키를 입력
|
|
43
|
+
* - 쉼표(,)를 입력
|
|
44
|
+
* - blur 이벤트가 발생
|
|
45
|
+
* - 붙여넣기시 쉼표(,)로 구분된 값들이 칩으로 추가
|
|
46
|
+
*
|
|
47
|
+
* 아래의 경우에 Chip이 삭제 됩니다.
|
|
48
|
+
* - Chip의 삭제 버튼을 클릭
|
|
49
|
+
* - 입력된 텍스트가 없는 상태에서 백스페이스를 누르면 마지막 Chip이 삭제됩니다.
|
|
50
|
+
*/
|
|
51
|
+
export declare const ChipInput: React.ForwardRefExoticComponent<ChipInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ChipInput } from './ChipInput';
|
|
3
|
+
declare const meta: Meta<typeof ChipInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ChipInput>;
|
|
6
|
+
export declare const Base: Story;
|
|
7
|
+
export declare const Value: Story;
|
|
8
|
+
export declare const Wrapping: Story;
|
|
9
|
+
export declare const Disabled: Story;
|
|
10
|
+
export declare const Size: Story;
|
|
11
|
+
export declare const StatusWithFormField: Story;
|