@idbrnd/design-system 1.6.3 → 1.7.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.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type CSSProperties, type MouseEventHandler, type ReactNode } from "react";
|
|
2
|
+
export type ChipVariant = "fillWeak" | "fill" | "outline" | "outlineSurface";
|
|
3
|
+
export type ChipSize = "large" | "medium" | "small" | "xsmall";
|
|
4
|
+
export interface ChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "style" | "type" | "onClick"> {
|
|
5
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
+
variant?: ChipVariant;
|
|
7
|
+
size?: ChipSize;
|
|
8
|
+
selected?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
leadingSlot?: ReactNode;
|
|
11
|
+
trailingSlot?: ReactNode;
|
|
12
|
+
customStyle?: CSSProperties;
|
|
13
|
+
}
|
|
14
|
+
declare function Chip({ variant, size, selected, disabled, leadingSlot, trailingSlot, customStyle, className, onClick, children, ...rest }: ChipProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default Chip;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
export type ChipGroupType = "selection" | "suggestion";
|
|
3
|
+
export type ChipGroupSize = "large" | "medium" | "small" | "xsmall";
|
|
4
|
+
export interface ChipGroupProps {
|
|
5
|
+
/**
|
|
6
|
+
* 칩 목록의 overflow 처리 방식.
|
|
7
|
+
* - `selection`: 줄바꿈 (기본값)
|
|
8
|
+
* - `suggestion`: Embla 캐러셀 (가로 드래그 스크롤)
|
|
9
|
+
*/
|
|
10
|
+
type?: ChipGroupType;
|
|
11
|
+
/** 칩 목록 앞에 표시할 텍스트/라벨 콘텐츠 */
|
|
12
|
+
leadingSlot?: ReactNode;
|
|
13
|
+
/** 칩 목록 앞에 구분선과 함께 표시할 엘리먼트 (아이콘, 아바타 등) */
|
|
14
|
+
leadingElementSlot?: ReactNode;
|
|
15
|
+
/** 그룹 내 칩 간격 및 칩 크기 */
|
|
16
|
+
size?: ChipGroupSize;
|
|
17
|
+
/**
|
|
18
|
+
* suggestion 타입에서 스크롤 여부에 따라 양끝에 그라데이션 오버레이 표시
|
|
19
|
+
*/
|
|
20
|
+
gradient?: boolean;
|
|
21
|
+
/** 루트 엘리먼트 인라인 스타일 */
|
|
22
|
+
customStyle?: CSSProperties;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
declare function ChipGroup({ type, leadingSlot, leadingElementSlot, size, gradient, customStyle, children, }: ChipGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export default ChipGroup;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
+
export type FilterBarSize = "large" | "medium" | "small" | "xsmall";
|
|
3
|
+
export interface FilterBarProps {
|
|
4
|
+
/** 필터 칩 목록 앞에 구분선과 함께 표시할 엘리먼트 (아이콘, 아바타 등) */
|
|
5
|
+
leadingElementSlot?: ReactNode;
|
|
6
|
+
/** 필터 칩 목록 뒤에 표시할 엘리먼트 */
|
|
7
|
+
trailingElementSlot?: ReactNode;
|
|
8
|
+
/** 칩 간격 크기 */
|
|
9
|
+
size?: FilterBarSize;
|
|
10
|
+
/**
|
|
11
|
+
* true: 위아래 8px 패딩, 그라데이션 없음
|
|
12
|
+
* false(기본값): 그라데이션 사용, 패딩 없음
|
|
13
|
+
*/
|
|
14
|
+
verticalPadding?: boolean;
|
|
15
|
+
/** 루트 엘리먼트 인라인 스타일 */
|
|
16
|
+
customStyle?: CSSProperties;
|
|
17
|
+
children?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare function FilterBar({ leadingElementSlot, trailingElementSlot, size, verticalPadding, customStyle, children, }: FilterBarProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export default FilterBar;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DropdownAlign, DropdownOption, DropdownType } from "../../Dropdown/Dropdown.types";
|
|
2
|
+
import { type ChipProps } from "../Chip/Chip";
|
|
3
|
+
export interface FilterChipProps extends Omit<ChipProps, "onSelect" | "trailingSlot"> {
|
|
4
|
+
/** 드롭다운에 표시할 옵션 목록 */
|
|
5
|
+
options: DropdownOption[];
|
|
6
|
+
/**
|
|
7
|
+
* 옵션 선택/해제 콜백.
|
|
8
|
+
* - 새로운 옵션 선택 시: 선택된 `DropdownOption` 전달
|
|
9
|
+
* - 이미 선택된 옵션 재클릭 시: `undefined` 전달 (선택 해제)
|
|
10
|
+
*/
|
|
11
|
+
onSelect: (option: DropdownOption | undefined) => void;
|
|
12
|
+
/** 현재 선택된 옵션의 value */
|
|
13
|
+
selectedValue?: string;
|
|
14
|
+
/** 드롭다운 형태. `basic`(기본) | `search`(검색 포함) */
|
|
15
|
+
dropdownType?: DropdownType;
|
|
16
|
+
/** 옵션 정렬 방향 */
|
|
17
|
+
dropdownAlign?: DropdownAlign;
|
|
18
|
+
/** 드롭다운 목록 너비 (px) */
|
|
19
|
+
dropdownWidth?: number;
|
|
20
|
+
/**
|
|
21
|
+
* true면 선택된 옵션의 label을 children 옆에 함께 표시.
|
|
22
|
+
* ex) children="소속", 선택값="4공장 C조" → "소속 4공장 C조"
|
|
23
|
+
*/
|
|
24
|
+
showSelectedLabel?: boolean;
|
|
25
|
+
}
|
|
26
|
+
declare function FilterChip({ options, onSelect, selectedValue, dropdownType, dropdownAlign, dropdownWidth, showSelectedLabel, variant, size, disabled, selected, children, ...chipRest }: FilterChipProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export default FilterChip;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idbrnd/design-system",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"vite-plugin-lib-inject-css": "^2.2.2"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
+
"embla-carousel-react": "^8.6.0",
|
|
52
53
|
"style-dictionary": "^5.3.1"
|
|
53
54
|
}
|
|
54
55
|
}
|