@ceed/ads 1.15.0 → 1.16.0-next.10
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/dist/components/FilterMenu/components/FilterableCheckboxGroup.d.ts +11 -0
- package/dist/components/FilterMenu/types.d.ts +10 -2
- package/dist/components/FilterableCheckboxGroup/FilterableCheckboxGroup.d.ts +23 -0
- package/dist/components/FilterableCheckboxGroup/index.d.ts +3 -0
- package/dist/components/Pagination/Pagination.d.ts +1 -0
- package/dist/components/ProfileMenu/ProfileMenu.d.ts +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/inputs/FilterMenu.md +20 -0
- package/dist/components/inputs/FilterableCheckboxGroup.md +205 -0
- package/dist/components/inputs/llms.txt +1 -0
- package/dist/components/navigation/Pagination.md +11 -2
- package/dist/index.cjs +741 -387
- package/dist/index.d.ts +1 -1
- package/dist/index.js +548 -194
- package/dist/llms.txt +1 -0
- package/framer/index.js +43 -43
- package/package.json +4 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FilterableCheckboxGroupItem } from '../types';
|
|
3
|
+
interface FilterableCheckboxGroupProps extends FilterableCheckboxGroupItem {
|
|
4
|
+
onChange?: (value: string[]) => void;
|
|
5
|
+
}
|
|
6
|
+
declare function FilterableCheckboxGroup(props: FilterableCheckboxGroupProps): React.JSX.Element | null;
|
|
7
|
+
declare namespace FilterableCheckboxGroup {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
10
|
+
export { FilterableCheckboxGroup };
|
|
11
|
+
export default FilterableCheckboxGroup;
|
|
@@ -2,6 +2,7 @@ import type { DateRangePickerProps } from '../DateRangePicker';
|
|
|
2
2
|
import type { CurrencyInputProps } from '../CurrencyInput';
|
|
3
3
|
import type { PercentageInputProps } from '../PercentageInput';
|
|
4
4
|
import type { AutocompleteProps } from '../Autocomplete';
|
|
5
|
+
import type { FilterableCheckboxGroupProps } from '../FilterableCheckboxGroup';
|
|
5
6
|
type DateTime = string;
|
|
6
7
|
export interface FilterBaseItem<V = never> {
|
|
7
8
|
id: string;
|
|
@@ -17,6 +18,13 @@ export interface FilterCheckboxGroupItem extends FilterBaseItem<(string | number
|
|
|
17
18
|
value: string | number;
|
|
18
19
|
}[];
|
|
19
20
|
}
|
|
21
|
+
export interface FilterableCheckboxGroupItem extends FilterBaseItem<string[]>, Pick<FilterableCheckboxGroupProps, 'placeholder' | 'maxHeight'> {
|
|
22
|
+
type: 'filterable-checkbox-group';
|
|
23
|
+
options: {
|
|
24
|
+
label: string;
|
|
25
|
+
value: string;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
20
28
|
export interface FilterRadioGroupItem extends FilterBaseItem<string | number> {
|
|
21
29
|
type: 'radio-group';
|
|
22
30
|
options: {
|
|
@@ -24,7 +32,7 @@ export interface FilterRadioGroupItem extends FilterBaseItem<string | number> {
|
|
|
24
32
|
value: string | number;
|
|
25
33
|
}[];
|
|
26
34
|
}
|
|
27
|
-
export interface FilterDateRangeItem extends FilterBaseItem<[DateTime, DateTime]>, Pick<DateRangePickerProps, 'minDate' | 'maxDate' | 'disableFuture' | 'disablePast' | '
|
|
35
|
+
export interface FilterDateRangeItem extends FilterBaseItem<[DateTime, DateTime]>, Pick<DateRangePickerProps, 'minDate' | 'maxDate' | 'disableFuture' | 'disablePast' | 'displayFormat' | 'inputReadOnly' | 'hideClearButton'> {
|
|
28
36
|
type: 'date-range';
|
|
29
37
|
}
|
|
30
38
|
export interface FilterCurrencyInputItem extends FilterBaseItem<number>, Pick<CurrencyInputProps, 'max' | 'placeholder' | 'useMinorUnit' | 'currency'> {
|
|
@@ -42,5 +50,5 @@ export interface FilterPercentageRangeItem extends FilterBaseItem<[number, numbe
|
|
|
42
50
|
export interface FilterAutocompleteItem extends FilterBaseItem<string | number>, Pick<AutocompleteProps<any, boolean>, 'options' | 'multiple' | 'placeholder'> {
|
|
43
51
|
type: 'autocomplete';
|
|
44
52
|
}
|
|
45
|
-
export type FilterItem = FilterCheckboxGroupItem | FilterRadioGroupItem | FilterDateRangeItem | FilterCurrencyInputItem | FilterCurrencyRangeItem | FilterPercentageInputItem | FilterPercentageRangeItem | FilterAutocompleteItem;
|
|
53
|
+
export type FilterItem = FilterCheckboxGroupItem | FilterableCheckboxGroupItem | FilterRadioGroupItem | FilterDateRangeItem | FilterCurrencyInputItem | FilterCurrencyRangeItem | FilterPercentageInputItem | FilterPercentageRangeItem | FilterAutocompleteItem;
|
|
46
54
|
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface FilterableCheckboxGroupOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type FilterableCheckboxGroupProps = {
|
|
8
|
+
value?: string[];
|
|
9
|
+
options: FilterableCheckboxGroupOption[];
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
helperText?: React.ReactNode;
|
|
13
|
+
size?: 'sm' | 'md' | 'lg';
|
|
14
|
+
required?: boolean;
|
|
15
|
+
onChange?: (value: string[]) => void;
|
|
16
|
+
maxHeight?: string | number;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare function FilterableCheckboxGroup(props: FilterableCheckboxGroupProps): React.JSX.Element;
|
|
20
|
+
declare namespace FilterableCheckboxGroup {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
export { FilterableCheckboxGroup };
|
|
@@ -21,6 +21,7 @@ interface PaginationProps extends React.ComponentProps<typeof PaginationRoot> {
|
|
|
21
21
|
rowCount: number;
|
|
22
22
|
onPageChange: (newPage: number) => void;
|
|
23
23
|
size?: 'sm' | 'md' | 'lg';
|
|
24
|
+
variant?: 'standard' | 'compact';
|
|
24
25
|
}
|
|
25
26
|
declare function Pagination(props: PaginationProps): React.JSX.Element;
|
|
26
27
|
declare namespace Pagination {
|
|
@@ -22,6 +22,7 @@ export { DialogFrame } from './DialogFrame';
|
|
|
22
22
|
export { Divider } from './Divider';
|
|
23
23
|
export { InsetDrawer } from './InsetDrawer';
|
|
24
24
|
export { Dropdown } from './Dropdown';
|
|
25
|
+
export { FilterableCheckboxGroup } from './FilterableCheckboxGroup';
|
|
25
26
|
export { FilterMenu } from './FilterMenu';
|
|
26
27
|
export type * from './FilterMenu';
|
|
27
28
|
export { Uploader } from './Uploader';
|
|
@@ -75,6 +75,26 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
|
|
|
75
75
|
}
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
+
### Filterable Checkbox Group
|
|
79
|
+
|
|
80
|
+
검색 기능이 포함된 체크박스 그룹 필터입니다. 옵션이 많을 때 유용합니다.
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
{
|
|
84
|
+
id: 'categories',
|
|
85
|
+
type: 'filterable-checkbox-group',
|
|
86
|
+
label: 'Categories',
|
|
87
|
+
options: [
|
|
88
|
+
{ label: 'Electronics', value: 'electronics' },
|
|
89
|
+
{ label: 'Clothing', value: 'clothing' },
|
|
90
|
+
{ label: 'Food', value: 'food' },
|
|
91
|
+
{ label: 'Books', value: 'books' },
|
|
92
|
+
],
|
|
93
|
+
placeholder: 'Search categories...',
|
|
94
|
+
maxHeight: 300,
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
78
98
|
### Radio Group
|
|
79
99
|
|
|
80
100
|
단일 선택이 가능한 라디오 버튼 그룹 필터입니다.
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# FilterableCheckboxGroup
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
|
|
5
|
+
FilterableCheckboxGroup 컴포넌트는 대량의 옵션 중에서 여러 항목을 선택할 수 있는 검색 가능한 체크박스 그룹입니다. 검색 필터링과 가상 스크롤링을 통해 많은 수의 옵션을 효율적으로 처리할 수 있으며, "Select all" 기능으로 일괄 선택이 가능합니다. 필터링, 다중 선택 폼, 설정 화면 등에서 유용하게 사용됩니다.
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
<FilterableCheckboxGroup
|
|
9
|
+
label="Select Fruits"
|
|
10
|
+
placeholder="Search fruits..."
|
|
11
|
+
options={defaultOptions}
|
|
12
|
+
/>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
| Field | Description | Default |
|
|
16
|
+
| ----------- | ----------- | ------- |
|
|
17
|
+
| size | — | — |
|
|
18
|
+
| label | — | — |
|
|
19
|
+
| helperText | — | — |
|
|
20
|
+
| required | — | — |
|
|
21
|
+
| value | — | — |
|
|
22
|
+
| onChange | — | — |
|
|
23
|
+
| placeholder | — | — |
|
|
24
|
+
| options | — | — |
|
|
25
|
+
| maxHeight | — | — |
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { FilterableCheckboxGroup } from '@ceed/ads';
|
|
31
|
+
|
|
32
|
+
function MyComponent() {
|
|
33
|
+
const [selectedValues, setSelectedValues] = useState<string[]>([]);
|
|
34
|
+
|
|
35
|
+
const options = [
|
|
36
|
+
{ value: 'apple', label: 'Apple' },
|
|
37
|
+
{ value: 'banana', label: 'Banana' },
|
|
38
|
+
{ value: 'cherry', label: 'Cherry' },
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<FilterableCheckboxGroup
|
|
43
|
+
label="Select Fruits"
|
|
44
|
+
placeholder="Search fruits..."
|
|
45
|
+
options={options}
|
|
46
|
+
value={selectedValues}
|
|
47
|
+
onChange={setSelectedValues}
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
|
|
55
|
+
### Sizes
|
|
56
|
+
|
|
57
|
+
다양한 크기의 FilterableCheckboxGroup을 사용할 수 있습니다.
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
<Stack spacing={3}>
|
|
61
|
+
<FilterableCheckboxGroup {...args} size="lg" label="Large" />
|
|
62
|
+
<FilterableCheckboxGroup {...args} size="md" label="Medium" />
|
|
63
|
+
<FilterableCheckboxGroup {...args} size="sm" label="Small" />
|
|
64
|
+
</Stack>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### With Label
|
|
68
|
+
|
|
69
|
+
라벨을 추가할 수 있습니다.
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
<FilterableCheckboxGroup
|
|
73
|
+
label="Select your favorite fruits"
|
|
74
|
+
placeholder="Search fruits..."
|
|
75
|
+
options={defaultOptions}
|
|
76
|
+
/>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### With Helper Text
|
|
80
|
+
|
|
81
|
+
도움말 텍스트를 추가할 수 있습니다.
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
<FilterableCheckboxGroup
|
|
85
|
+
label="Select Fruits"
|
|
86
|
+
placeholder="Search fruits..."
|
|
87
|
+
helperText="You can select multiple options"
|
|
88
|
+
options={defaultOptions}
|
|
89
|
+
/>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Required Field
|
|
93
|
+
|
|
94
|
+
필수 입력 필드로 표시할 수 있습니다.
|
|
95
|
+
|
|
96
|
+
```tsx
|
|
97
|
+
<FilterableCheckboxGroup
|
|
98
|
+
label="Required Field"
|
|
99
|
+
placeholder="Search..."
|
|
100
|
+
required
|
|
101
|
+
helperText="This field is required"
|
|
102
|
+
options={defaultOptions}
|
|
103
|
+
/>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Custom Max Height
|
|
107
|
+
|
|
108
|
+
목록의 최대 높이를 커스터마이징할 수 있습니다.
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
<Stack spacing={3}>
|
|
112
|
+
<FilterableCheckboxGroup label="Custom Height (150px)" placeholder="Search..." options={defaultOptions} maxHeight={150} />
|
|
113
|
+
<FilterableCheckboxGroup label="Default Height (300px)" placeholder="Search..." options={defaultOptions} />
|
|
114
|
+
</Stack>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Long List
|
|
118
|
+
|
|
119
|
+
많은 수의 옵션을 가상 스크롤링으로 효율적으로 표시합니다.
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
<FilterableCheckboxGroup
|
|
123
|
+
label="Countries"
|
|
124
|
+
placeholder="Search countries..."
|
|
125
|
+
options={countryNames.map(name => ({
|
|
126
|
+
value: name.toLowerCase().replace(/ /g, '-'),
|
|
127
|
+
label: name
|
|
128
|
+
}))}
|
|
129
|
+
/>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### No Options
|
|
133
|
+
|
|
134
|
+
옵션이 없을 때의 상태입니다.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
<FilterableCheckboxGroup
|
|
138
|
+
label="No Options Available"
|
|
139
|
+
placeholder="Search..."
|
|
140
|
+
options={[]}
|
|
141
|
+
/>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Controlled
|
|
145
|
+
|
|
146
|
+
외부에서 값을 제어하는 예제입니다.
|
|
147
|
+
|
|
148
|
+
```tsx
|
|
149
|
+
<Stack spacing={2}>
|
|
150
|
+
<FilterableCheckboxGroup label="Select Fruits" placeholder="Search fruits..." options={defaultOptions} value={value} onChange={setValue} />
|
|
151
|
+
<Typography level="body-sm">
|
|
152
|
+
Selected:{' '}
|
|
153
|
+
{value.length > 0 ? value.map(v => defaultOptions.find(o => o.value === v)?.label).join(', ') : 'None'}
|
|
154
|
+
</Typography>
|
|
155
|
+
</Stack>
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Sorting
|
|
159
|
+
|
|
160
|
+
정렬 동작을 확인할 수 있는 예제입니다. 초기 렌더링 시 선택된 항목이 먼저 표시되고, 그 다음 알파벳 순으로 정렬됩니다.
|
|
161
|
+
|
|
162
|
+
```tsx
|
|
163
|
+
<Stack spacing={2}>
|
|
164
|
+
<button type="button" onClick={() => {
|
|
165
|
+
setKey(prev => prev + 1);
|
|
166
|
+
}} style={{
|
|
167
|
+
padding: '4px 12px',
|
|
168
|
+
cursor: 'pointer'
|
|
169
|
+
}}>
|
|
170
|
+
Force Re-render
|
|
171
|
+
</button>
|
|
172
|
+
<FilterableCheckboxGroup key={key} label="Sorting Demo" placeholder="Search..." helperText="Initial sort: Selected (C,B,A,3,2,1) first, then unselected (X,Y,Z,7,8,9)" options={sortingOptions} value={value} onChange={setValue} />
|
|
173
|
+
<Typography level="body-sm" sx={{
|
|
174
|
+
whiteSpace: 'pre-line'
|
|
175
|
+
}}>
|
|
176
|
+
{`Selected: ${value.length > 0 ? value.join(', ') : 'None'}\n\nClick "Force Re-render" button to remount the component.\nOrder should remain the same (sorted only on initial mount).`}
|
|
177
|
+
</Typography>
|
|
178
|
+
</Stack>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Disabled
|
|
182
|
+
|
|
183
|
+
컴포넌트 전체 또는 특정 옵션을 비활성화할 수 있습니다.
|
|
184
|
+
|
|
185
|
+
- **컴포넌트 전체 비활성화**: `disabled` prop을 사용하여 검색 input, "Select all", 모든 옵션을 비활성화합니다.
|
|
186
|
+
- **특정 옵션 비활성화**: 옵션 객체의 `disabled` 속성을 사용하여 개별 옵션을 비활성화합니다.
|
|
187
|
+
- **"Select all" 동작**: 비활성화된 옵션은 "Select all"의 영향을 받지 않으며, 선택 상태가 유지됩니다.
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
<Stack spacing={3}>
|
|
191
|
+
<FilterableCheckboxGroup label="Entirely Disabled" placeholder="Search..." helperText="All inputs are disabled" options={defaultOptions.slice(0, 5)} disabled />
|
|
192
|
+
<FilterableCheckboxGroup label="Partially Disabled Options" placeholder="Search..." helperText="Some options are disabled" options={disabledOptions} />
|
|
193
|
+
<Stack spacing={2}>
|
|
194
|
+
<FilterableCheckboxGroup label="Controlled + Partially Disabled" placeholder="Search..." helperText="Disabled options (Banana, Date) maintain their selected state" options={disabledOptions} value={controlledValue} onChange={setControlledValue} />
|
|
195
|
+
<Typography level="body-sm">
|
|
196
|
+
Selected: {controlledValue.length > 0 ? controlledValue.join(', ') : 'None'}
|
|
197
|
+
</Typography>
|
|
198
|
+
<Typography level="body-sm" sx={{
|
|
199
|
+
color: 'text.secondary'
|
|
200
|
+
}}>
|
|
201
|
+
Try "Select all" - it will only affect enabled options (Apple, Cherry, Elderberry)
|
|
202
|
+
</Typography>
|
|
203
|
+
</Stack>
|
|
204
|
+
</Stack>
|
|
205
|
+
```
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- [CurrencyInput](./CurrencyInput.md)
|
|
11
11
|
- [DatePicker](./DatePicker.md)
|
|
12
12
|
- [DateRangePicker](./DateRangePicker.md)
|
|
13
|
+
- [FilterableCheckboxGroup](./FilterableCheckboxGroup.md)
|
|
13
14
|
- [FilterMenu](./FilterMenu.md)
|
|
14
15
|
- [IconButton](./IconButton.md)
|
|
15
16
|
- [Input](./Input.md)
|
|
@@ -2,8 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## Introduction
|
|
4
4
|
|
|
5
|
-
```
|
|
6
|
-
|
|
5
|
+
```tsx
|
|
6
|
+
<Stack spacing={4}>
|
|
7
|
+
<Stack spacing={1}>
|
|
8
|
+
<div>Standard</div>
|
|
9
|
+
<Pagination {...args} variant="standard" />
|
|
10
|
+
</Stack>
|
|
11
|
+
<Stack spacing={1}>
|
|
12
|
+
<div>Compact</div>
|
|
13
|
+
<Pagination {...args} variant="compact" />
|
|
14
|
+
</Stack>
|
|
15
|
+
</Stack>
|
|
7
16
|
```
|
|
8
17
|
|
|
9
18
|
| Field | Description | Default |
|