@ceed/ads 1.16.0-next.1 → 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.
@@ -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' | 'format' | 'displayFormat' | 'inputReadOnly' | 'hideClearButton'> {
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 {};
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  interface FilterableCheckboxGroupOption {
3
3
  value: string;
4
4
  label: string;
5
+ disabled?: boolean;
5
6
  }
6
7
  export type FilterableCheckboxGroupProps = {
7
8
  value?: string[];
@@ -13,6 +14,7 @@ export type FilterableCheckboxGroupProps = {
13
14
  required?: boolean;
14
15
  onChange?: (value: string[]) => void;
15
16
  maxHeight?: string | number;
17
+ disabled?: boolean;
16
18
  };
17
19
  declare function FilterableCheckboxGroup(props: FilterableCheckboxGroupProps): React.JSX.Element;
18
20
  declare namespace 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 {
@@ -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
  단일 선택이 가능한 라디오 버튼 그룹 필터입니다.
@@ -177,3 +177,29 @@ function MyComponent() {
177
177
  </Typography>
178
178
  </Stack>
179
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
+ ```
@@ -2,8 +2,17 @@
2
2
 
3
3
  ## Introduction
4
4
 
5
- ```text
6
- // Unable to derive source for Playground
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 |