@croquiscom/pds 5.4.1 → 5.5.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @croquiscom/pds
2
2
 
3
+ ## 5.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 672f21d: CategorySelector, Chip 추가 및 Popover.padding 추가
8
+
3
9
  ## 5.4.1
4
10
 
5
11
  ### Patch Changes
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" />
2
+ export interface Category {
3
+ /**
4
+ * 루트 ~ 해당 카테고리 텍스트
5
+ * ex) 패션의류/아우터/코트/트렌치코트
6
+ * @see DropdownChip - label
7
+ */
8
+ label: string;
9
+ /**
10
+ * 해당 카테고리 텍스트
11
+ * ex) 트렌치코트
12
+ * @see ListItem - category.name
13
+ */
14
+ name: string;
15
+ key: string;
16
+ parentKey: string;
17
+ childrenKeys?: Array<string>;
18
+ level: number;
19
+ }
20
+ export interface CategorySelectorProps {
21
+ className?: string;
22
+ /**
23
+ * 레벨별 카테고리 데이터
24
+ * @see CategorySelector.stories - categories_by_levels
25
+ */
26
+ categoriesByLevels: Array<Array<Category>>;
27
+ selectedKeys: Array<string>;
28
+ /**
29
+ * 선택값 변경 이벤트
30
+ * @param selectedKeys 선택된 카테고리 키 리스트
31
+ * @param isLeaf selectedKeys의 리프 여부 (multiple == false 일 때만 내려감)
32
+ * @returns
33
+ */
34
+ onSelectedKeysChange: (selectedKeys: Array<string>, isLeaf?: boolean) => void;
35
+ /**
36
+ * 체크박스 사용여부
37
+ * true일 경우 멀티 셀렉트 가능
38
+ * @default false
39
+ */
40
+ multiple?: boolean;
41
+ /**
42
+ * @default false
43
+ */
44
+ disabled?: boolean;
45
+ /**
46
+ * 각 ListItem의 너비
47
+ * @default 240
48
+ */
49
+ width?: number;
50
+ /**
51
+ * 각 List의 높이
52
+ * @default 332
53
+ */
54
+ height?: number;
55
+ }
56
+ export declare const CategorySelector: ({ className, categoriesByLevels, selectedKeys, onSelectedKeysChange, multiple, disabled, width, height, }: CategorySelectorProps) => JSX.Element;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
3
+ import { CategorySelector } from './CategorySelector';
4
+ declare const _default: ComponentMeta<({ className, categoriesByLevels, selectedKeys, onSelectedKeysChange, multiple, disabled, width, height, }: import("./CategorySelector").CategorySelectorProps) => JSX.Element>;
5
+ export default _default;
6
+ export declare const Base: any;
7
+ export declare const MultiSelectable: any;
8
+ export declare const Disabled: any;
9
+ export declare const WithDropdownChip: ComponentStory<typeof CategorySelector>;
@@ -0,0 +1,28 @@
1
+ import React, { PropsWithChildren } from 'react';
2
+ import { CSSValueWithLength } from '../../styles';
3
+ import { DropdownLabelProps } from '../dropdown/DropdownLabel';
4
+ import { InputSize } from '../input/types';
5
+ export interface ChipsDropdownOption<OptionValue> {
6
+ label: string;
7
+ value: OptionValue;
8
+ }
9
+ export interface ChipsDropdownProps<OptionValue> {
10
+ /**
11
+ * Input 너비를 지정할 수 있습니다.
12
+ * @default 240
13
+ */
14
+ width?: CSSValueWithLength;
15
+ /**
16
+ * 기본값으로 [ZIndexOrder](https://github.com/croquiscom/pds/blob/main/src/styles/zIndex.ts) 규칙을 적용합니다.
17
+ * @default 1030
18
+ */
19
+ zIndex?: number;
20
+ /** @default large */
21
+ size?: InputSize;
22
+ disabled?: boolean;
23
+ selectedOptions: Array<ChipsDropdownOption<OptionValue>>;
24
+ onOptionValuesChange?: (values: Array<OptionValue>) => void;
25
+ placeholder?: string;
26
+ status?: DropdownLabelProps['status'];
27
+ }
28
+ export declare const ChipsDropdown: <OptionValue extends string | number>({ children, width, zIndex, disabled, selectedOptions, onOptionValuesChange, placeholder, status, size: sizeProp, }: React.PropsWithChildren<ChipsDropdownProps<OptionValue>>) => JSX.Element;
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { Category } from './CategorySelector';
3
+ export interface ListProps {
4
+ level: number;
5
+ categories: Array<Category>;
6
+ selectedKeys: Array<string>;
7
+ onSelect: (category: Category) => void;
8
+ onClick: (category: Category) => void;
9
+ isSelected: (category: Category) => boolean;
10
+ isIndeterminate: (category: Category) => boolean;
11
+ multiple?: boolean;
12
+ disabled?: boolean;
13
+ }
14
+ export declare const List: ({ level, categories, selectedKeys, onSelect, onClick, isSelected, isIndeterminate, multiple, disabled, }: ListProps) => JSX.Element;
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import { Category } from './CategorySelector';
3
+ export interface ListItemProps {
4
+ category: Category;
5
+ selectedKeys: Array<string>;
6
+ onSelect: (category: Category) => void;
7
+ onClick: (category: Category) => void;
8
+ isSelected: (category: Category) => boolean;
9
+ isIndeterminate: (category: Category) => boolean;
10
+ multiple?: boolean;
11
+ disabled?: boolean;
12
+ }
13
+ export declare const ListItem: ({ category, multiple, disabled, selectedKeys, onSelect, onClick, isSelected, isIndeterminate, }: ListItemProps) => JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './CategorySelector';
@@ -0,0 +1,6 @@
1
+ import { InputSize } from '../input/types';
2
+ export declare const input_chip_base_css: import("@emotion/utils").SerializedStyles;
3
+ export declare const list_item_enabled_css: import("@emotion/utils").SerializedStyles;
4
+ export declare const list_item_selected_css: import("@emotion/utils").SerializedStyles;
5
+ export declare const list_item_disabled_css: import("@emotion/utils").SerializedStyles;
6
+ export declare const input_chip_size_css: Record<InputSize, string>;
@@ -0,0 +1,8 @@
1
+ import React, { ButtonHTMLAttributes } from 'react';
2
+ import { InputSize } from '../input/types';
3
+ export interface ChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
4
+ /** @default medium */
5
+ size?: InputSize;
6
+ onDelete: () => void;
7
+ }
8
+ export declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,7 @@
1
+ import { ComponentMeta, ComponentStory } from '@storybook/react';
2
+ import React from 'react';
3
+ import { Chip } from './Chip';
4
+ declare const _default: ComponentMeta<React.ForwardRefExoticComponent<import("./Chip").ChipProps & React.RefAttributes<HTMLButtonElement>>>;
5
+ export default _default;
6
+ export declare const InputChip: any;
7
+ export declare const InputChipDelete: ComponentStory<typeof Chip>;
@@ -0,0 +1 @@
1
+ export * from './Chip';
@@ -0,0 +1,6 @@
1
+ import { InputSize } from '../input/types';
2
+ export declare const input_chip_base_css: import("@emotion/utils").SerializedStyles;
3
+ export declare const input_chip_x_enabled_css: import("@emotion/utils").SerializedStyles;
4
+ export declare const input_chip_x_disabled_css: import("@emotion/utils").SerializedStyles;
5
+ export declare const input_chip_height_size_css: Record<InputSize, string>;
6
+ export declare const input_chip_size_css: Record<InputSize, string>;
@@ -52,6 +52,11 @@ export interface PopoverProps {
52
52
  * @default true
53
53
  */
54
54
  arrow?: boolean;
55
+ /**
56
+ * 팝오버 내부여백
57
+ * @default 16,20(arrow)
58
+ */
59
+ padding?: number;
55
60
  }
56
61
  export declare const Popover: React.FC<PopoverProps>;
57
62
  export {};