maru_design2 3.0.2 → 3.1.1
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 +20 -0
- package/dist/components/atoms/button/Button.d.ts +2 -0
- package/dist/components/atoms/checkbox/Checkbox.d.ts +4 -1
- package/dist/components/atoms/input/Input.d.ts +2 -0
- package/dist/components/molecules/buttonGroup/ButtonGroup.d.ts +3 -3
- package/dist/components/molecules/calendar/Calendar.d.ts +40 -2
- package/dist/components/molecules/calendar/DatePickerHeader.d.ts +8 -1
- package/dist/components/molecules/calendar/DatePickerWrapper.d.ts +4 -6
- package/dist/components/molecules/calendar/calendar-utils.d.ts +11 -0
- package/dist/components/molecules/dropdown/Dropdown.d.ts +23 -3
- package/dist/components/molecules/dropdown/OverflowText.d.ts +5 -0
- package/dist/components/molecules/dropdown/index.d.ts +1 -0
- package/dist/components/molecules/dropdown/menu/MenuItem.d.ts +5 -7
- package/dist/components/molecules/dropdown/menu/index.d.ts +13 -8
- package/dist/components/molecules/dropdown/toggleButton/Arrow.d.ts +4 -7
- package/dist/components/molecules/dropdown/toggleButton/Clear.d.ts +3 -5
- package/dist/components/molecules/dropdown/toggleButton/index.d.ts +15 -2
- package/dist/components/molecules/dropdown/types.d.ts +28 -0
- package/dist/components/molecules/multiSelectDropdown/MultiSelectDropdown.d.ts +18 -2
- package/dist/components/molecules/multiSelectDropdown/menu/index.d.ts +9 -3
- package/dist/components/molecules/multiSelectDropdown/toggleButton/Clear.d.ts +2 -1
- package/dist/components/molecules/multiSelectDropdown/toggleButton/index.d.ts +9 -2
- package/dist/components/molecules/pagination/Pagination.d.ts +25 -15
- package/dist/components/molecules/table/Table.d.ts +1 -1
- package/dist/components/molecules/table/body/CheckboxTd.d.ts +2 -1
- package/dist/components/molecules/table/body/Tr.d.ts +1 -1
- package/dist/components/molecules/table/body/index.d.ts +1 -1
- package/dist/components/molecules/table/header/index.d.ts +3 -1
- package/dist/components/molecules/table/types.d.ts +8 -0
- package/dist/components/molecules/tabs/Tabs.d.ts +6 -0
- package/dist/constants/color.d.ts +541 -217
- package/dist/constants/figmaColor.d.ts +327 -0
- package/dist/enums/color.d.ts +121 -69
- package/dist/enums/size.d.ts +2 -2
- package/dist/index.js +2826 -1278
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.1.1](https://github.com/42maru-ai/maru-design2/compare/v3.1.0...v3.1.1) (2026-09-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* :bug: Dropdown - quote selected check SVG mask URLs ([512cdb1](https://github.com/42maru-ai/maru-design2/commit/512cdb1329ad754c14142c5c8cf6b80b09c9daa6))
|
|
9
|
+
|
|
10
|
+
## [3.1.0](https://github.com/42maru-ai/maru-design2/compare/v3.0.2...v3.1.0) (2026-09-09)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add single-date calendar mode ([a996bd1](https://github.com/42maru-ai/maru-design2/commit/a996bd1f9e63d6e57d0f5ed343790a57c1bd39b7))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* :sparkles: Design System - UPDATE Figma 토큰과 컴포넌트 및 사용 가이드 ([acf9bf6](https://github.com/42maru-ai/maru-design2/commit/acf9bf6b47f43beca3bc6ddb4141347ee0f896a2))
|
|
21
|
+
* update component variants and harden calendar interactions ([c87cee0](https://github.com/42maru-ai/maru-design2/commit/c87cee0603d738a57e75e5f4666638d4c2518cbc))
|
|
22
|
+
|
|
3
23
|
## [3.0.2](https://github.com/42maru-ai/maru-design2/compare/v3.0.1...v3.0.2) (2026-07-27)
|
|
4
24
|
|
|
5
25
|
|
|
@@ -17,6 +17,8 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
17
17
|
* 사이즈 (@v1 kind)
|
|
18
18
|
* Figma `xxs`/`xs`/`sm`/`md`/`lg` ↔ `xxs`/`xs`/`small`/`normal`/`large`
|
|
19
19
|
* `xs`/`xxs`는 주로 icon-only용
|
|
20
|
+
* `comfortable-small`/`comfortable-normal`/`comfortable-large`는 같은 높이에 좌우 패딩 16px.
|
|
21
|
+
* 라벨이 있는 default/default-light/outline/text/round에 적용하며, 나머지는 대응 기본 크기를 사용합니다.
|
|
20
22
|
*/
|
|
21
23
|
size?: TButtonSize;
|
|
22
24
|
/**
|
|
@@ -5,7 +5,10 @@ import { TCheckboxSize } from '../../../enums/size';
|
|
|
5
5
|
import './checkbox.scss';
|
|
6
6
|
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'checked' | 'type'> {
|
|
7
7
|
checked?: boolean;
|
|
8
|
+
/** 부분 선택 상태. 네이티브 input의 indeterminate에도 반영합니다. */
|
|
9
|
+
indeterminate?: boolean;
|
|
8
10
|
label?: string;
|
|
11
|
+
labelPosition?: 'left' | 'right';
|
|
9
12
|
/**
|
|
10
13
|
* (@v1 variant)
|
|
11
14
|
*/
|
|
@@ -15,7 +18,7 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
15
18
|
*/
|
|
16
19
|
gap?: TGap;
|
|
17
20
|
/**
|
|
18
|
-
*
|
|
21
|
+
* Figma sm: 16, md: 20. 기존 18, 24도 지원합니다.
|
|
19
22
|
*/
|
|
20
23
|
size?: TCheckboxSize;
|
|
21
24
|
}
|
|
@@ -37,14 +37,14 @@ export interface ButtonGroupProps<T extends string> {
|
|
|
37
37
|
buttons: ButtonGroupButton<T>[];
|
|
38
38
|
/**
|
|
39
39
|
* 스타일 타입
|
|
40
|
-
* - segmented:
|
|
41
|
-
* - segmented-secondary:
|
|
40
|
+
* - segmented: 간격 없이 연결된 아웃라인 버튼, 선택 시 브랜드 배경 (기본값).
|
|
41
|
+
* - segmented-secondary: 회색 래퍼 안에 간격을 두고 배치,
|
|
42
42
|
* 선택된 버튼이 흰색 배경 + primary색 텍스트 컬러.
|
|
43
43
|
* - icon: 아웃라인 버튼 안에 간격없이 붙어있는 형태.
|
|
44
44
|
*/
|
|
45
45
|
variant?: 'segmented' | 'segmented-secondary' | 'icon';
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* 사이즈. segmented 기준 sm: 36px (Figma 기본), md: 40px.
|
|
48
48
|
*/
|
|
49
49
|
size?: 'sm' | 'md';
|
|
50
50
|
/**
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './calendar.scss';
|
|
3
|
+
export type CalendarMode = 'range' | 'single';
|
|
4
|
+
export interface CalendarTimeValue {
|
|
5
|
+
/** 시간 설정이 켜져 있으면 HH:mm, 꺼져 있으면 undefined */
|
|
6
|
+
startTime?: string;
|
|
7
|
+
/** 기간 선택의 종료 시간 (HH:mm) */
|
|
8
|
+
endTime?: string;
|
|
9
|
+
}
|
|
3
10
|
export interface CalendarProps {
|
|
4
11
|
/**
|
|
5
12
|
* Maru Datepicker를 띄울 대상이 되는 컴포넌트. setOpen을 변수로 전달해서 외부에서 datepicker를 띄울 수 있도록 설정
|
|
@@ -15,13 +22,44 @@ export interface CalendarProps {
|
|
|
15
22
|
* @example minStartDate를 오늘 날짜로 지정하면 시작일 지정은 오늘 날짜부터 가능
|
|
16
23
|
*/
|
|
17
24
|
minStartDate?: Date | null;
|
|
25
|
+
/**
|
|
26
|
+
* 날짜 선택 방식
|
|
27
|
+
* @default 'range'
|
|
28
|
+
*/
|
|
29
|
+
mode?: CalendarMode;
|
|
30
|
+
/** 선택 가능한 마지막 날짜. 날짜 단위로 제한합니다. */
|
|
31
|
+
maxDate?: Date | null;
|
|
32
|
+
/** 동시에 표시할 월 수. 기본값 1 */
|
|
33
|
+
monthsToShow?: 1 | 2;
|
|
34
|
+
/** 연·월 선택 드롭다운 표시. 기본값 false */
|
|
35
|
+
showMonthYearDropdown?: boolean;
|
|
36
|
+
/** 시간 설정 토글과 시간 선택 표시. 기본값 false */
|
|
37
|
+
showTime?: boolean;
|
|
38
|
+
/** 시간 선택을 필수로 설정합니다. true이면 showTime과 무관하게 시간 UI를 표시하고 끌 수 없게 합니다. 기본값 false */
|
|
39
|
+
timeRequired?: boolean;
|
|
40
|
+
/** 확인 시 실행하는 동기 검증. 오류 문구를 반환하면 표시하고 저장을 막으며, undefined 또는 빈 문자열이면 허용합니다. */
|
|
41
|
+
validate?: (startDate?: string, endDate?: string, time?: CalendarTimeValue) => string | undefined;
|
|
42
|
+
/** 오늘·최근 7/30/90일·이전 3개 연도 프리셋 표시. range에서만 적용됩니다. */
|
|
43
|
+
showPresets?: boolean;
|
|
44
|
+
/** 하단 날짜 직접 입력 표시. 기본값 true */
|
|
45
|
+
showDateInputs?: boolean;
|
|
46
|
+
/** 취소 버튼 표시. 기본값 false */
|
|
47
|
+
showCancelButton?: boolean;
|
|
48
|
+
/** 취소 버튼 문구. 기본값 취소 */
|
|
49
|
+
cancelButtonContent?: string;
|
|
50
|
+
/** 열 때 선택할 시작 날짜. 저장한 값을 넘기면 다시 열 때 복원됩니다. */
|
|
51
|
+
startDate?: Date | null;
|
|
52
|
+
/** 열 때 선택할 종료 날짜. single에서는 무시합니다. */
|
|
53
|
+
endDate?: Date | null;
|
|
54
|
+
/** 열 때 복원할 시간. showTime과 함께 사용합니다. */
|
|
55
|
+
timeValue?: CalendarTimeValue;
|
|
18
56
|
saveButtonContent: string;
|
|
19
57
|
/**
|
|
20
58
|
* 캘린더 하단 버튼을 누르면 동작할 함수, 선택한 startDate와 endDate를 전달
|
|
21
59
|
* @param startDate 시작일
|
|
22
60
|
* @param endDate 마지막일
|
|
23
61
|
*/
|
|
24
|
-
onSaveClick: (startDate?: string, endDate?: string) => void;
|
|
62
|
+
onSaveClick: (startDate?: string, endDate?: string, time?: CalendarTimeValue) => void;
|
|
25
63
|
className?: string;
|
|
26
64
|
}
|
|
27
|
-
export declare function Calendar({ children, minStartDate, saveButtonContent, onSaveClick, className, }: CalendarProps): React.JSX.Element;
|
|
65
|
+
export declare function Calendar({ children, minStartDate, mode, saveButtonContent, onSaveClick, className, ...options }: CalendarProps): React.JSX.Element;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ReactDatePickerCustomHeaderProps } from 'react-datepicker';
|
|
3
|
-
|
|
3
|
+
interface Props extends ReactDatePickerCustomHeaderProps {
|
|
4
|
+
monthsToShow?: 1 | 2;
|
|
5
|
+
showMonthYearDropdown?: boolean;
|
|
6
|
+
minDate?: Date | null;
|
|
7
|
+
maxDate?: Date | null;
|
|
8
|
+
onNavigate?: (date: Date) => void;
|
|
9
|
+
}
|
|
10
|
+
declare function DatePickerHeader({ monthDate, customHeaderCount, decreaseMonth, increaseMonth, prevMonthButtonDisabled, nextMonthButtonDisabled, monthsToShow, showMonthYearDropdown, minDate, maxDate, onNavigate, }: Props): React.JSX.Element;
|
|
4
11
|
export default DatePickerHeader;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { CalendarProps } from './Calendar';
|
|
2
3
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
3
|
-
|
|
4
|
-
minStartDate?: Date | null;
|
|
5
|
-
saveButtonContent?: string;
|
|
6
|
-
onSaveClick: (startDate?: string, endDate?: string) => void;
|
|
4
|
+
type Props = Omit<CalendarProps, 'children' | 'className'> & {
|
|
7
5
|
setOpen: (open: boolean) => void;
|
|
8
|
-
}
|
|
9
|
-
declare function DatePickerWrapper({ minStartDate, saveButtonContent, onSaveClick, setOpen, }: Props): React.JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
declare function DatePickerWrapper({ minStartDate, maxDate, mode, monthsToShow, showMonthYearDropdown, showTime, timeRequired, validate, showPresets, showDateInputs, showCancelButton, cancelButtonContent, startDate: initialStart, endDate: initialEnd, timeValue, saveButtonContent, onSaveClick, setOpen, }: Props): React.JSX.Element;
|
|
10
8
|
export default DatePickerWrapper;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DATE_FORMAT = "yyyy-MM-dd";
|
|
2
|
+
export declare const formatDate: (date: Date | null) => string;
|
|
3
|
+
export declare function validDay(date?: Date | null): Date | null;
|
|
4
|
+
export declare function clampDate(date: Date, min: Date | null, max: Date | null): Date;
|
|
5
|
+
export declare function parseDate(text: string, min: Date | null, max: Date | null): Date | null;
|
|
6
|
+
export declare const validTime: (time?: string) => boolean;
|
|
7
|
+
export declare function calendarPresets(today: Date): {
|
|
8
|
+
label: string;
|
|
9
|
+
start: Date;
|
|
10
|
+
end: Date;
|
|
11
|
+
}[];
|
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DropdownItemOptions, DropdownVariant } from './types';
|
|
2
3
|
import { TColor } from '../../../enums/color';
|
|
3
4
|
import { TDropdownType } from '../../../enums/type';
|
|
4
5
|
import { IconProps } from '../../atoms/icon';
|
|
5
6
|
import './dropdown.scss';
|
|
6
|
-
interface DropdownProps<T extends Record<string, any>> {
|
|
7
|
+
export interface DropdownProps<T extends Record<string, any>> {
|
|
8
|
+
/** Visual variant; independent of the existing search type. */
|
|
9
|
+
variant?: DropdownVariant;
|
|
10
|
+
startIcon?: IconProps;
|
|
11
|
+
customStartIcon?: React.ReactNode;
|
|
12
|
+
badge?: React.ReactNode;
|
|
13
|
+
helperText?: React.ReactNode;
|
|
14
|
+
actionContent?: React.ReactNode;
|
|
15
|
+
onAction?: () => void;
|
|
16
|
+
actionDisabled?: boolean;
|
|
17
|
+
actionAriaLabel?: string;
|
|
18
|
+
clearAriaLabel?: string;
|
|
19
|
+
searchAriaLabel?: string;
|
|
20
|
+
searchClearAriaLabel?: string;
|
|
21
|
+
getItemProps?: (item: T) => DropdownItemOptions;
|
|
22
|
+
/** Menu width, independent of the complete control width. */
|
|
23
|
+
menuWidth?: number;
|
|
24
|
+
/** Accessible name when no visible label is supplied. */
|
|
25
|
+
'aria-label'?: string;
|
|
7
26
|
data: T[];
|
|
8
27
|
/**
|
|
9
28
|
* 선택된 아이디
|
|
@@ -82,6 +101,8 @@ interface DropdownProps<T extends Record<string, any>> {
|
|
|
82
101
|
* 컴포넌트 위치의 기준이 될 엘리먼트 사용자 정의. (@v1 portalAnchor)
|
|
83
102
|
*/
|
|
84
103
|
anchorEl?: HTMLElement | null;
|
|
104
|
+
/** 메뉴를 StyleProvider 루트로 분리합니다. 변형·스크롤이 있는 팝업 내부에서 사용합니다. 기본값 false */
|
|
105
|
+
portal?: boolean;
|
|
85
106
|
/**
|
|
86
107
|
* 메뉴 맨 밑에 버튼
|
|
87
108
|
*/
|
|
@@ -91,5 +112,4 @@ interface DropdownProps<T extends Record<string, any>> {
|
|
|
91
112
|
onClick: () => void;
|
|
92
113
|
};
|
|
93
114
|
}
|
|
94
|
-
export declare function Dropdown<T extends Record<string, any>>({ data, selectedId, onSelect, idKey, displayKey, className, placeholder, searchPlaceholder, disabled, color, stopPropagation, type, errorMessage, label, onClear, noDataMessage, noResultMessage, width, height, gap, customButton, customMenuItem, anchorEl, menuBottomButton, }: DropdownProps<T>): React.JSX.Element;
|
|
95
|
-
export {};
|
|
115
|
+
export declare function Dropdown<T extends Record<string, any>>({ data, selectedId, onSelect, idKey, displayKey, className, placeholder, searchPlaceholder, disabled, color, stopPropagation, type, variant, startIcon, customStartIcon, badge, helperText, actionContent, onAction, actionDisabled, actionAriaLabel, clearAriaLabel, searchAriaLabel, searchClearAriaLabel, getItemProps, menuWidth, 'aria-label': ariaLabel, errorMessage, label, onClear, noDataMessage, noResultMessage, width, height, gap, customButton, customMenuItem, anchorEl, portal, menuBottomButton, }: DropdownProps<T>): React.JSX.Element;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DropdownCustomMenuItem, DropdownItemOptions } from '../types';
|
|
2
3
|
interface Props<T extends Record<string, any>> {
|
|
3
4
|
item: T;
|
|
4
5
|
selectedId: string | undefined;
|
|
5
6
|
onSelect: (id?: string) => void;
|
|
6
7
|
idKey: string;
|
|
7
8
|
displayKey: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
children: React.ReactNode;
|
|
11
|
-
rowId: string | number;
|
|
12
|
-
}) => JSX.Element;
|
|
9
|
+
customMenuItem?: DropdownCustomMenuItem;
|
|
10
|
+
options?: DropdownItemOptions;
|
|
13
11
|
onClose: () => void;
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
export
|
|
13
|
+
export default function MenuItem<T extends Record<string, any>>({ item, selectedId, onSelect, idKey, displayKey, customMenuItem: CustomMenuItem, options, onClose, }: Props<T>): React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DropdownCustomMenuItem, DropdownItemOptions, DropdownItemVariant } from '../types';
|
|
2
3
|
import { TColor } from '../../../../enums/color';
|
|
3
4
|
import { IconProps } from '../../../atoms/icon';
|
|
4
5
|
interface Props<T extends Record<string, any>> {
|
|
6
|
+
id: string;
|
|
7
|
+
labelledBy: string;
|
|
8
|
+
initialFocus: 'selected' | 'first' | 'last';
|
|
5
9
|
data: T[];
|
|
6
10
|
selectedId: string | undefined;
|
|
7
11
|
onSelect: (id?: string) => void;
|
|
@@ -9,23 +13,24 @@ interface Props<T extends Record<string, any>> {
|
|
|
9
13
|
displayKey: string;
|
|
10
14
|
color?: TColor;
|
|
11
15
|
searchPlaceholder?: string;
|
|
16
|
+
searchAriaLabel?: string;
|
|
17
|
+
searchClearAriaLabel?: string;
|
|
12
18
|
noDataMessage?: string;
|
|
13
19
|
noResultMessage?: string;
|
|
14
20
|
width?: number;
|
|
15
21
|
height?: number;
|
|
16
|
-
customMenuItem?:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}) => JSX.Element;
|
|
22
|
+
customMenuItem?: DropdownCustomMenuItem;
|
|
23
|
+
getItemProps?: (item: T) => DropdownItemOptions;
|
|
24
|
+
defaultItemVariant: DropdownItemVariant;
|
|
20
25
|
isSearch: boolean;
|
|
21
26
|
parent: HTMLElement;
|
|
22
|
-
|
|
23
|
-
onClose: () => void;
|
|
27
|
+
alignEnd: boolean;
|
|
28
|
+
onClose: (restoreFocus?: boolean) => void;
|
|
24
29
|
menuBottomButton?: {
|
|
25
30
|
content: string;
|
|
26
31
|
startIcon?: IconProps;
|
|
27
32
|
onClick: () => void;
|
|
28
33
|
};
|
|
29
34
|
}
|
|
30
|
-
|
|
31
|
-
export
|
|
35
|
+
export default function DropdownMenu<T extends Record<string, any>>({ id, labelledBy, initialFocus, data, selectedId, onSelect, idKey, displayKey, color, searchPlaceholder, searchAriaLabel, searchClearAriaLabel, noDataMessage, noResultMessage, width, height, customMenuItem, getItemProps, defaultItemVariant, isSearch, parent, alignEnd, onClose, menuBottomButton, }: Props<T>): React.JSX.Element;
|
|
36
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { DropdownVariant } from '../types';
|
|
3
|
+
export default function Arrow({ open, variant, }: {
|
|
4
4
|
open: boolean;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
declare function Arrow({ open, color, disabled }: Props): React.JSX.Element;
|
|
9
|
-
export default Arrow;
|
|
5
|
+
variant: DropdownVariant;
|
|
6
|
+
}): React.JSX.Element;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
focus: boolean;
|
|
2
|
+
export default function Clear({ onClear, ariaLabel, }: {
|
|
4
3
|
onClear: () => void;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default Clear;
|
|
4
|
+
ariaLabel?: string;
|
|
5
|
+
}): React.JSX.Element;
|
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DropdownVariant } from '../types';
|
|
2
3
|
import { TColor } from '../../../../enums/color';
|
|
4
|
+
import { IconProps } from '../../../atoms/icon';
|
|
3
5
|
interface Props<T extends Record<string, any>> {
|
|
6
|
+
id: string;
|
|
7
|
+
menuId: string;
|
|
8
|
+
triggerRef: React.RefObject<HTMLButtonElement>;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
describedBy?: string;
|
|
4
11
|
displayKey: string;
|
|
5
12
|
placeholder?: string;
|
|
6
13
|
disabled?: boolean;
|
|
7
14
|
color: TColor;
|
|
8
15
|
stopPropagation?: boolean;
|
|
9
|
-
width?: number;
|
|
10
16
|
gap: number;
|
|
11
17
|
customButton?: React.ReactNode;
|
|
18
|
+
variant: DropdownVariant;
|
|
19
|
+
startIcon?: IconProps;
|
|
20
|
+
customStartIcon?: React.ReactNode;
|
|
21
|
+
badge?: React.ReactNode;
|
|
12
22
|
open: boolean;
|
|
13
23
|
selected: T | undefined;
|
|
14
24
|
errored?: boolean;
|
|
15
25
|
hasClearBtn: boolean;
|
|
26
|
+
clearAriaLabel?: string;
|
|
27
|
+
popupRole?: 'menu' | 'dialog';
|
|
16
28
|
onClear: () => void;
|
|
17
29
|
onClick: () => void;
|
|
30
|
+
onKeyDown: React.KeyboardEventHandler<HTMLButtonElement>;
|
|
18
31
|
}
|
|
19
|
-
declare function DropdownToggleButton<T extends Record<string, any>>({ displayKey, placeholder, disabled, color, stopPropagation,
|
|
32
|
+
declare function DropdownToggleButton<T extends Record<string, any>>({ id, menuId, triggerRef, ariaLabel, describedBy, displayKey, placeholder, disabled, color, stopPropagation, gap, customButton, variant, startIcon, customStartIcon, badge, open, selected, errored, hasClearBtn, clearAriaLabel, popupRole, onClear, onClick, onKeyDown, }: Props<T>): React.JSX.Element;
|
|
20
33
|
export default DropdownToggleButton;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconProps } from '../../atoms/icon';
|
|
3
|
+
export type DropdownVariant = 'default' | 'button' | 'button-tag' | 'borderless';
|
|
4
|
+
export type DropdownItemVariant = 'default' | 'model' | 'icon' | 'tag';
|
|
5
|
+
/** Presentation and optional actions for one item; data remains caller-owned. */
|
|
6
|
+
export interface DropdownItemOptions {
|
|
7
|
+
variant?: DropdownItemVariant;
|
|
8
|
+
startIcon?: IconProps;
|
|
9
|
+
customStartIcon?: React.ReactNode;
|
|
10
|
+
endIcon?: IconProps;
|
|
11
|
+
customEndIcon?: React.ReactNode;
|
|
12
|
+
supportingText?: React.ReactNode;
|
|
13
|
+
showDot?: boolean;
|
|
14
|
+
showSelectedCheck?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
action?: {
|
|
17
|
+
content: React.ReactNode;
|
|
18
|
+
ariaLabel: string;
|
|
19
|
+
onClick: () => void;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
};
|
|
22
|
+
onRemove?: () => void;
|
|
23
|
+
removeAriaLabel?: string;
|
|
24
|
+
}
|
|
25
|
+
export type DropdownCustomMenuItem = (props: {
|
|
26
|
+
children: React.ReactNode;
|
|
27
|
+
rowId: string | number;
|
|
28
|
+
}) => JSX.Element;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { DropdownVariant } from '../dropdown/types';
|
|
2
3
|
import { TColor } from '../../../enums/color';
|
|
3
4
|
import { TDropdownType } from '../../../enums/type';
|
|
5
|
+
import '../dropdown/dropdown.scss';
|
|
4
6
|
import './multi-select-dropdown.scss';
|
|
5
7
|
export interface MultiSelectDropdownProps<T extends Record<string, any>> {
|
|
6
8
|
data: T[];
|
|
@@ -20,7 +22,21 @@ export interface MultiSelectDropdownProps<T extends Record<string, any>> {
|
|
|
20
22
|
/**
|
|
21
23
|
* 드롭다운 버튼에 노출할 컨텐츠
|
|
22
24
|
*/
|
|
23
|
-
content
|
|
25
|
+
content?: React.ReactNode;
|
|
26
|
+
/** Optional visual variant; default preserves the existing control. */
|
|
27
|
+
variant?: DropdownVariant;
|
|
28
|
+
/** Called only for two or more selections. No built-in language or i18n dependency. */
|
|
29
|
+
formatSelectedCount?: (count: number) => React.ReactNode;
|
|
30
|
+
actionContent?: React.ReactNode;
|
|
31
|
+
onAction?: () => void;
|
|
32
|
+
actionDisabled?: boolean;
|
|
33
|
+
actionAriaLabel?: string;
|
|
34
|
+
clearAriaLabel?: string;
|
|
35
|
+
searchAriaLabel?: string;
|
|
36
|
+
searchClearAriaLabel?: string;
|
|
37
|
+
helperText?: React.ReactNode;
|
|
38
|
+
menuWidth?: number;
|
|
39
|
+
'aria-label'?: string;
|
|
24
40
|
className?: string;
|
|
25
41
|
/**
|
|
26
42
|
* 드롭다운 버튼의 placeholder
|
|
@@ -74,4 +90,4 @@ export interface MultiSelectDropdownProps<T extends Record<string, any>> {
|
|
|
74
90
|
*/
|
|
75
91
|
anchorEl?: HTMLElement | null;
|
|
76
92
|
}
|
|
77
|
-
export declare function MultiSelectDropdown<T extends Record<string, any>>({ data, selectedIds, onSelect, idKey, displayKey, content, className, placeholder, searchPlaceholder, disabled, color, stopPropagation, type, errorMessage, label, allCheckLabel, onClear, noDataMessage, noResultMessage, width, height, anchorEl, }: MultiSelectDropdownProps<T>): React.JSX.Element;
|
|
93
|
+
export declare function MultiSelectDropdown<T extends Record<string, any>>({ data, selectedIds, onSelect, idKey, displayKey, content, className, placeholder, searchPlaceholder, disabled, color, stopPropagation, type, variant, formatSelectedCount, actionContent, onAction, actionDisabled, actionAriaLabel, clearAriaLabel, searchAriaLabel, searchClearAriaLabel, helperText, menuWidth, 'aria-label': ariaLabel, errorMessage, label, allCheckLabel, onClear, noDataMessage, noResultMessage, width, height, anchorEl, }: MultiSelectDropdownProps<T>): React.JSX.Element;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TColor } from '../../../../enums/color';
|
|
3
3
|
interface Props<T extends Record<string, any>> {
|
|
4
|
+
id: string;
|
|
5
|
+
labelledBy: string;
|
|
6
|
+
initialFocus: 'selected' | 'first' | 'last';
|
|
7
|
+
figmaVariant: boolean;
|
|
8
|
+
alignEnd: boolean;
|
|
9
|
+
searchAriaLabel?: string;
|
|
10
|
+
searchClearAriaLabel?: string;
|
|
4
11
|
data: T[];
|
|
5
12
|
selectedIds: string[];
|
|
6
13
|
onSelect: (ids: string[]) => void;
|
|
@@ -15,8 +22,7 @@ interface Props<T extends Record<string, any>> {
|
|
|
15
22
|
height?: number;
|
|
16
23
|
isSearch: boolean;
|
|
17
24
|
parent: HTMLElement;
|
|
18
|
-
|
|
19
|
-
onClose: () => void;
|
|
25
|
+
onClose: (restoreFocus?: boolean) => void;
|
|
20
26
|
}
|
|
21
|
-
declare function DropdownMenu<T extends Record<string, any>>({ data, selectedIds, onSelect, idKey, displayKey, searchPlaceholder, allCheckLabel, color, noDataMessage, noResultMessage, width, height, isSearch, parent,
|
|
27
|
+
declare function DropdownMenu<T extends Record<string, any>>({ id, labelledBy, initialFocus, figmaVariant, alignEnd, searchAriaLabel, searchClearAriaLabel, data, selectedIds, onSelect, idKey, displayKey, searchPlaceholder, allCheckLabel, color, noDataMessage, noResultMessage, width, height, isSearch, parent, onClose, }: Props<T>): React.JSX.Element;
|
|
22
28
|
export default DropdownMenu;
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
interface Props {
|
|
3
3
|
focus: boolean;
|
|
4
4
|
onClear: () => void;
|
|
5
|
+
ariaLabel?: string;
|
|
5
6
|
}
|
|
6
|
-
declare function Clear({ focus, onClear }: Props): React.JSX.Element;
|
|
7
|
+
declare function Clear({ focus, onClear, ariaLabel }: Props): React.JSX.Element;
|
|
7
8
|
export default Clear;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TColor } from '../../../../enums/color';
|
|
3
3
|
interface Props {
|
|
4
|
-
content:
|
|
4
|
+
content: React.ReactNode;
|
|
5
|
+
id: string;
|
|
6
|
+
menuId: string;
|
|
7
|
+
triggerRef: React.RefObject<HTMLButtonElement>;
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
describedBy?: string;
|
|
10
|
+
clearAriaLabel?: string;
|
|
11
|
+
onKeyDown: React.KeyboardEventHandler<HTMLButtonElement>;
|
|
5
12
|
placeholder?: string;
|
|
6
13
|
disabled?: boolean;
|
|
7
14
|
color: TColor;
|
|
@@ -14,5 +21,5 @@ interface Props {
|
|
|
14
21
|
onClear: () => void;
|
|
15
22
|
onClick: () => void;
|
|
16
23
|
}
|
|
17
|
-
declare function DropdownToggleButton({ content, placeholder, disabled, color, stopPropagation, width, open, selected, errored, hasClearBtn, onClear, onClick, }: Props): React.JSX.Element;
|
|
24
|
+
declare function DropdownToggleButton({ content, id, menuId, triggerRef, ariaLabel, describedBy, clearAriaLabel, onKeyDown, placeholder, disabled, color, stopPropagation, width, open, selected, errored, hasClearBtn, onClear, onClick, }: Props): React.JSX.Element;
|
|
18
25
|
export default DropdownToggleButton;
|
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './pagination.scss';
|
|
3
|
+
export type PaginationVariant = 'default' | 'simple' | 'number';
|
|
3
4
|
export interface PaginationProps {
|
|
4
|
-
/**
|
|
5
|
-
* 현재 페이지. (@v1 page.curPage)
|
|
6
|
-
*/
|
|
5
|
+
/** 현재 페이지 (1부터 시작). */
|
|
7
6
|
page: number;
|
|
8
|
-
/**
|
|
9
|
-
* 현재 페이지 설정 함수. (@v1 page.setPage)
|
|
10
|
-
*/
|
|
7
|
+
/** 페이지 이동 요청. 부모에서 page와 표시 데이터를 갱신합니다. */
|
|
11
8
|
onPageChange: (page: number) => void;
|
|
12
|
-
/**
|
|
13
|
-
* 총 페이지
|
|
14
|
-
*/
|
|
9
|
+
/** 전체 페이지 수. 빈 목록은 0을 전달합니다. */
|
|
15
10
|
totalPage: number;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
/** 기본형 / 페이지 크기 선택형 / 번호형. @default 'default' */
|
|
12
|
+
variant?: PaginationVariant;
|
|
13
|
+
/** 기본형 왼쪽에 표시할 정확한 전체 항목 수. 생략하면 범위를 숨깁니다. */
|
|
14
|
+
totalCount?: number;
|
|
15
|
+
/** 페이지당 항목 수. simple에서는 부모가 관리하는 선택값입니다. @default 30 */
|
|
16
|
+
pageSize?: number;
|
|
17
|
+
/** simple의 페이지당 항목 수 선택지. @default [15, 30, 50, 100] */
|
|
18
|
+
pageSizeOptions?: number[];
|
|
19
|
+
/** simple의 개수 변경 요청. 부모에서 pageSize와 totalPage를 갱신하고 page를 1로 초기화하세요. */
|
|
20
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
21
|
+
/** 위쪽 구분선 표시. @default true */
|
|
22
|
+
divider?: boolean;
|
|
23
|
+
/** 전체 조작 비활성화. @default false */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** visible: 경계의 이동 버튼을 비활성화해 표시. hidden: 공간을 남기고 숨김. */
|
|
20
26
|
buttonVisibility?: 'visible' | 'hidden';
|
|
21
|
-
|
|
27
|
+
/** 전체 페이지 수 뒤에 붙는 문구. @default '페이지' */
|
|
28
|
+
label?: string;
|
|
29
|
+
/** 탐색 영역의 접근성 이름. @default '페이지네이션' */
|
|
30
|
+
'aria-label'?: string;
|
|
31
|
+
className?: string;
|
|
22
32
|
}
|
|
23
|
-
export declare function Pagination({ page, onPageChange, totalPage,
|
|
33
|
+
export declare function Pagination({ page, onPageChange, totalPage, variant, totalCount, pageSize, pageSizeOptions, onPageSizeChange, divider, disabled, buttonVisibility, label, 'aria-label': ariaLabel, className, }: PaginationProps): React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TableProps } from './types';
|
|
3
3
|
import './table.scss';
|
|
4
|
-
export declare function Table({ rowIdKey, data, formats, maxHeight, sort, onSort, checkedIds, onCheck, radioCheckedId, onRadioCheck, filter, kebabMenu, binButton, chartButton, onRowClick, selectedRow, highlightRows, disabledRows, className, id, noData, loading, }: TableProps): React.JSX.Element;
|
|
4
|
+
export declare function Table({ rowIdKey, data, formats, maxHeight, sort, onSort, checkedIds, onCheck, getCheckboxStatus, radioCheckedId, onRadioCheck, filter, kebabMenu, binButton, chartButton, onRowClick, selectedRow, highlightRows, disabledRows, className, id, noData, loading, }: TableProps): React.JSX.Element;
|
|
@@ -2,7 +2,8 @@ import React from 'react';
|
|
|
2
2
|
interface Props {
|
|
3
3
|
checked: boolean;
|
|
4
4
|
disabled?: boolean;
|
|
5
|
+
hidden?: boolean;
|
|
5
6
|
onCheck: (checked: boolean) => void;
|
|
6
7
|
}
|
|
7
|
-
declare function CheckboxTd({ checked, disabled, onCheck }: Props): React.JSX.Element;
|
|
8
|
+
declare function CheckboxTd({ checked, disabled, hidden, onCheck }: Props): React.JSX.Element;
|
|
8
9
|
export default CheckboxTd;
|
|
@@ -4,5 +4,5 @@ interface Props extends TableProps {
|
|
|
4
4
|
row: Record<string, any>;
|
|
5
5
|
hasActionCol: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare function Tr({ row, rowIdKey, formats, checkedIds, onCheck, radioCheckedId, onRadioCheck, hasActionCol, kebabMenu, binButton, chartButton, onRowClick, selectedRow, highlightRows, disabledRows, }: Props): React.JSX.Element;
|
|
7
|
+
declare function Tr({ row, rowIdKey, formats, checkedIds, onCheck, getCheckboxStatus, radioCheckedId, onRadioCheck, hasActionCol, kebabMenu, binButton, chartButton, onRowClick, selectedRow, highlightRows, disabledRows, }: Props): React.JSX.Element;
|
|
8
8
|
export default Tr;
|
|
@@ -4,5 +4,5 @@ interface Props extends TableProps {
|
|
|
4
4
|
hasActionCol: boolean;
|
|
5
5
|
emptyBodyHeight: number;
|
|
6
6
|
}
|
|
7
|
-
declare function TBody({ rowIdKey, formats, data, checkedIds, onCheck, radioCheckedId, onRadioCheck, hasActionCol, kebabMenu, binButton, chartButton, onRowClick, selectedRow, highlightRows, disabledRows, noData, loading, emptyBodyHeight, }: Props): React.JSX.Element;
|
|
7
|
+
declare function TBody({ rowIdKey, formats, data, checkedIds, onCheck, getCheckboxStatus, radioCheckedId, onRadioCheck, hasActionCol, kebabMenu, binButton, chartButton, onRowClick, selectedRow, highlightRows, disabledRows, noData, loading, emptyBodyHeight, }: Props): React.JSX.Element;
|
|
8
8
|
export default TBody;
|
|
@@ -6,6 +6,8 @@ interface Props {
|
|
|
6
6
|
onSortClick: (columnName: string) => () => void;
|
|
7
7
|
hasCheckbox?: boolean;
|
|
8
8
|
allCheckbox: boolean;
|
|
9
|
+
allCheckboxIndeterminate: boolean;
|
|
10
|
+
allCheckboxDisabled: boolean;
|
|
9
11
|
onAllCheck: (checked: boolean) => void;
|
|
10
12
|
hasRadio?: boolean;
|
|
11
13
|
filter?: IFilter;
|
|
@@ -13,5 +15,5 @@ interface Props {
|
|
|
13
15
|
setFilterToggle: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
16
|
hasActionCol: boolean;
|
|
15
17
|
}
|
|
16
|
-
declare function THead({ formats, sort, onSortClick, hasCheckbox, allCheckbox, onAllCheck, hasRadio, filter, filterToggle, setFilterToggle, hasActionCol, }: Props): React.JSX.Element;
|
|
18
|
+
declare function THead({ formats, sort, onSortClick, hasCheckbox, allCheckbox, allCheckboxIndeterminate, allCheckboxDisabled, onAllCheck, hasRadio, filter, filterToggle, setFilterToggle, hasActionCol, }: Props): React.JSX.Element;
|
|
17
19
|
export default THead;
|
|
@@ -50,6 +50,14 @@ export interface TableProps {
|
|
|
50
50
|
* 체크박스에 체크된 아이디들. radioCheckedId와 같이 쓸 수 없음.(@v1 hasCheckbox, checkedArray)
|
|
51
51
|
*/
|
|
52
52
|
checkedIds?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* 행별 체크박스 상태. hidden, disabled의 기본값은 false.
|
|
55
|
+
* 숨김/비활성 체크박스는 전체 선택·해제 대상에서 제외하며 기존 체크 상태는 유지.
|
|
56
|
+
*/
|
|
57
|
+
getCheckboxStatus?: (row: Record<string, any>, rowId: string) => {
|
|
58
|
+
hidden?: boolean;
|
|
59
|
+
disabled?: boolean;
|
|
60
|
+
};
|
|
53
61
|
/**
|
|
54
62
|
* (@v1 setCheckedArray)
|
|
55
63
|
*/
|