@ceed/ads 1.25.1-next.3 → 1.26.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.
Files changed (60) hide show
  1. package/dist/chunks/rehype-accent-FZRUD7VI.js +39 -0
  2. package/dist/components/CurrencyInput/CurrencyInput.d.ts +1 -1
  3. package/dist/components/CurrencyInput/hooks/use-currency-setting.d.ts +2 -2
  4. package/dist/components/DataTable/components.d.ts +2 -1
  5. package/dist/components/DataTable/styled.d.ts +3 -1
  6. package/dist/components/DataTable/types.d.ts +1 -0
  7. package/dist/components/ProfileMenu/ProfileMenu.d.ts +1 -1
  8. package/dist/components/data-display/Badge.md +71 -39
  9. package/dist/components/data-display/DataTable.md +77 -1
  10. package/dist/components/data-display/InfoSign.md +74 -98
  11. package/dist/components/data-display/Typography.md +363 -97
  12. package/dist/components/feedback/CircularProgress.md +257 -0
  13. package/dist/components/feedback/Dialog.md +76 -62
  14. package/dist/components/feedback/Modal.md +259 -44
  15. package/dist/components/feedback/Skeleton.md +280 -0
  16. package/dist/components/feedback/llms.txt +2 -0
  17. package/dist/components/inputs/Autocomplete.md +356 -107
  18. package/dist/components/inputs/ButtonGroup.md +115 -106
  19. package/dist/components/inputs/Calendar.md +98 -459
  20. package/dist/components/inputs/CurrencyInput.md +183 -5
  21. package/dist/components/inputs/DatePicker.md +108 -431
  22. package/dist/components/inputs/DateRangePicker.md +131 -492
  23. package/dist/components/inputs/FilterMenu.md +169 -19
  24. package/dist/components/inputs/FilterableCheckboxGroup.md +123 -23
  25. package/dist/components/inputs/FormControl.md +361 -0
  26. package/dist/components/inputs/IconButton.md +137 -88
  27. package/dist/components/inputs/Input.md +5 -0
  28. package/dist/components/inputs/MonthPicker.md +95 -422
  29. package/dist/components/inputs/MonthRangePicker.md +89 -466
  30. package/dist/components/inputs/PercentageInput.md +185 -16
  31. package/dist/components/inputs/RadioButton.md +163 -35
  32. package/dist/components/inputs/RadioList.md +241 -0
  33. package/dist/components/inputs/RadioTileGroup.md +150 -61
  34. package/dist/components/inputs/Select.md +222 -326
  35. package/dist/components/inputs/Slider.md +334 -0
  36. package/dist/components/inputs/Switch.md +136 -376
  37. package/dist/components/inputs/Textarea.md +213 -10
  38. package/dist/components/inputs/Uploader/Uploader.md +145 -66
  39. package/dist/components/inputs/llms.txt +3 -0
  40. package/dist/components/navigation/Breadcrumbs.md +80 -322
  41. package/dist/components/navigation/Dropdown.md +92 -221
  42. package/dist/components/navigation/IconMenuButton.md +40 -502
  43. package/dist/components/navigation/InsetDrawer.md +68 -738
  44. package/dist/components/navigation/Link.md +39 -298
  45. package/dist/components/navigation/Menu.md +92 -285
  46. package/dist/components/navigation/MenuButton.md +55 -448
  47. package/dist/components/navigation/Pagination.md +47 -338
  48. package/dist/components/navigation/ProfileMenu.md +45 -268
  49. package/dist/components/navigation/Stepper.md +160 -28
  50. package/dist/components/navigation/Tabs.md +57 -316
  51. package/dist/components/surfaces/Sheet.md +151 -334
  52. package/dist/guides/ThemeProvider.md +116 -0
  53. package/dist/guides/llms.txt +9 -0
  54. package/dist/index.browser.js +16 -18
  55. package/dist/index.browser.js.map +4 -4
  56. package/dist/index.cjs +303 -209
  57. package/dist/index.js +381 -343
  58. package/dist/llms.txt +8 -0
  59. package/framer/index.js +1 -166
  60. package/package.json +15 -16
@@ -2,7 +2,9 @@
2
2
 
3
3
  ## Introduction
4
4
 
5
- FilterMenu 다양한 필터 타입을 지원하는 모달 형태의 필터 컴포넌트입니다. 여러 종류의 필터를 조합하여 복잡한 필터링 UI를 쉽게 구성할 있습니다.
5
+ FilterMenu is a comprehensive filtering component that supports multiple filter types within a single dropdown panel. It enables users to apply, combine, and reset various filters -- including checkboxes, radio buttons, date ranges, currency inputs, percentage inputs, and autocomplete fields -- through a consistent, organized interface.
6
+
7
+ FilterMenu is ideal for data-heavy admin interfaces such as tables, lists, and dashboards where users need to narrow down results based on multiple criteria. It supports both controlled and uncontrolled state management, allowing flexible integration with different state architectures.
6
8
 
7
9
  ```tsx
8
10
  <FilterMenu {...args} defaultValues={values} onChange={newValues => {
@@ -57,11 +59,11 @@ function MyComponent() {
57
59
 
58
60
  ## Filter Types
59
61
 
60
- FilterMenu 다음과 같은 필터 타입을 지원합니다:
62
+ FilterMenu supports the following filter types. Each type is configured through the `filters` array prop.
61
63
 
62
64
  ### Checkbox Group
63
65
 
64
- 다중 선택이 가능한 체크박스 그룹 필터입니다.
66
+ Multi-select filter with checkboxes. The selected values are stored as an array.
65
67
 
66
68
  ```tsx
67
69
  {
@@ -77,7 +79,7 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
77
79
 
78
80
  ### Filterable Checkbox Group
79
81
 
80
- 검색 기능이 포함된 체크박스 그룹 필터입니다. 옵션이 많을 유용합니다.
82
+ A searchable checkbox group for long option lists. Includes a text input to filter visible options.
81
83
 
82
84
  ```tsx
83
85
  {
@@ -87,7 +89,6 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
87
89
  options: [
88
90
  { label: 'Electronics', value: 'electronics' },
89
91
  { label: 'Clothing', value: 'clothing' },
90
- { label: 'Food', value: 'food' },
91
92
  { label: 'Books', value: 'books' },
92
93
  ],
93
94
  placeholder: 'Search categories...',
@@ -97,7 +98,7 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
97
98
 
98
99
  ### Radio Group
99
100
 
100
- 단일 선택이 가능한 라디오 버튼 그룹 필터입니다.
101
+ Single-select filter with radio buttons. The selected value is stored as a single string.
101
102
 
102
103
  ```tsx
103
104
  {
@@ -114,7 +115,7 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
114
115
 
115
116
  ### Date Range
116
117
 
117
- 날짜 범위를 선택할 있는 필터입니다.
118
+ A date range picker filter. The value is stored as a two-element array of date strings.
118
119
 
119
120
  ```tsx
120
121
  {
@@ -129,7 +130,7 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
129
130
 
130
131
  ### Currency Input
131
132
 
132
- 단일 통화 값을 입력할 있는 필터입니다.
133
+ A single currency value input field.
133
134
 
134
135
  ```tsx
135
136
  {
@@ -143,7 +144,7 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
143
144
 
144
145
  ### Currency Range
145
146
 
146
- 통화 범위를 입력할 있는 필터입니다.
147
+ A currency range filter with min and max inputs.
147
148
 
148
149
  ```tsx
149
150
  {
@@ -157,7 +158,7 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
157
158
 
158
159
  ### Percentage Input
159
160
 
160
- 단일 퍼센트 값을 입력할 있는 필터입니다.
161
+ A single percentage value input field.
161
162
 
162
163
  ```tsx
163
164
  {
@@ -172,7 +173,7 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
172
173
 
173
174
  ### Percentage Range
174
175
 
175
- 퍼센트 범위를 입력할 있는 필터입니다.
176
+ A percentage range filter with min and max inputs.
176
177
 
177
178
  ```tsx
178
179
  {
@@ -186,7 +187,7 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
186
187
 
187
188
  ### Autocomplete
188
189
 
189
- 자동완성을 지원하는 선택 필터입니다.
190
+ A searchable single-select filter with autocomplete support.
190
191
 
191
192
  ```tsx
192
193
  {
@@ -202,6 +203,8 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
202
203
 
203
204
  ### Controlled Mode
204
205
 
206
+ In controlled mode, you manage the filter state externally using `values` (or `defaultValues` with an `onChange` handler).
207
+
205
208
  ```tsx
206
209
  <FilterMenu {...args} defaultValues={values} onChange={newValues => {
207
210
  setValues(newValues);
@@ -211,20 +214,167 @@ FilterMenu는 다음과 같은 필터 타입을 지원합니다:
211
214
 
212
215
  ### Uncontrolled Mode
213
216
 
217
+ In uncontrolled mode, FilterMenu manages its own internal state. This is useful when you only need the final filter values on submission.
218
+
214
219
  ```tsx
215
220
  <FilterMenu />
216
221
  ```
217
222
 
223
+ ## Common Use Cases
224
+
225
+ ### Table Filters
226
+
227
+ ```tsx
228
+ function DataTable() {
229
+ const [filters, setFilters] = useState({});
230
+ const { data } = useQuery(['items', filters], () => fetchItems(filters));
231
+
232
+ return (
233
+ <Box>
234
+ <FilterMenu
235
+ filters={[
236
+ {
237
+ id: 'status',
238
+ type: 'checkbox-group',
239
+ label: 'Status',
240
+ options: [
241
+ { label: 'Active', value: 'active' },
242
+ { label: 'Pending', value: 'pending' },
243
+ { label: 'Archived', value: 'archived' },
244
+ ],
245
+ },
246
+ {
247
+ id: 'dateRange',
248
+ type: 'date-range',
249
+ label: 'Created Date',
250
+ displayFormat: 'MM/DD/YYYY',
251
+ },
252
+ {
253
+ id: 'amount',
254
+ type: 'currency-range',
255
+ label: 'Amount',
256
+ currency: 'USD',
257
+ },
258
+ ]}
259
+ defaultValues={filters}
260
+ onChange={setFilters}
261
+ useReset
262
+ />
263
+ <Table data={data} />
264
+ </Box>
265
+ );
266
+ }
267
+ ```
268
+
269
+ ### Dashboard Filters
270
+
271
+ ```tsx
272
+ function DashboardFilters({ onFilterChange }) {
273
+ return (
274
+ <FilterMenu
275
+ filters={[
276
+ {
277
+ id: 'region',
278
+ type: 'filterable-checkbox-group',
279
+ label: 'Region',
280
+ options: regions.map((r) => ({ label: r.name, value: r.id })),
281
+ placeholder: 'Search regions...',
282
+ maxHeight: 200,
283
+ },
284
+ {
285
+ id: 'period',
286
+ type: 'radio-group',
287
+ label: 'Time Period',
288
+ options: [
289
+ { label: 'Last 7 days', value: '7d' },
290
+ { label: 'Last 30 days', value: '30d' },
291
+ { label: 'Last 90 days', value: '90d' },
292
+ { label: 'Custom', value: 'custom' },
293
+ ],
294
+ },
295
+ ]}
296
+ onChange={onFilterChange}
297
+ useReset
298
+ />
299
+ );
300
+ }
301
+ ```
302
+
303
+ ### Invoice Filters
304
+
305
+ ```tsx
306
+ function InvoiceFilters({ onFilterChange }) {
307
+ return (
308
+ <FilterMenu
309
+ filters={[
310
+ {
311
+ id: 'status',
312
+ type: 'checkbox-group',
313
+ label: 'Invoice Status',
314
+ options: [
315
+ { label: 'Paid', value: 'paid' },
316
+ { label: 'Pending', value: 'pending' },
317
+ { label: 'Overdue', value: 'overdue' },
318
+ ],
319
+ },
320
+ {
321
+ id: 'amount',
322
+ type: 'currency-range',
323
+ label: 'Amount Range',
324
+ currency: 'USD',
325
+ useMinorUnit: true,
326
+ },
327
+ {
328
+ id: 'date',
329
+ type: 'date-range',
330
+ label: 'Invoice Date',
331
+ displayFormat: 'MM/DD/YYYY',
332
+ },
333
+ ]}
334
+ onChange={onFilterChange}
335
+ useReset
336
+ />
337
+ );
338
+ }
339
+ ```
340
+
218
341
  ## Best Practices
219
342
 
220
- 1. **필터 ID 관리**: 필터의 `id`는 고유해야 하며, 상태 관리의 키로 사용됩니다.
343
+ 1. **Use unique filter IDs**: Each filter's `id` must be unique since it serves as the key for state management.
344
+
345
+ ```tsx
346
+ // ✅ Good: Unique IDs
347
+ filters={[
348
+ { id: 'status', type: 'checkbox-group', ... },
349
+ { id: 'priority', type: 'radio-group', ... },
350
+ ]}
351
+
352
+ // ❌ Bad: Duplicate IDs cause state conflicts
353
+ filters={[
354
+ { id: 'filter1', type: 'checkbox-group', ... },
355
+ { id: 'filter1', type: 'radio-group', ... },
356
+ ]}
357
+ ```
358
+
359
+ 2. **Choose the right reset strategy**: Use `useReset` when the FilterMenu contains multiple filters that users may want to clear all at once. Use `useClear` for single-filter scenarios.
360
+
361
+ 3. **Provide descriptive labels**: Each filter should have a clear `label` that tells users what they are filtering. Avoid generic names like "Filter 1".
362
+
363
+ ```tsx
364
+ // ✅ Good: Descriptive labels
365
+ { id: 'invoiceStatus', type: 'checkbox-group', label: 'Invoice Status', ... }
366
+
367
+ // ❌ Bad: Vague labels
368
+ { id: 'filter1', type: 'checkbox-group', label: 'Options', ... }
369
+ ```
221
370
 
222
- 2. **타입 안전성**: TypeScript를 사용할 FilterItem 타입을 활용하여 타입 안전성을 보장하세요.
371
+ 4. **Use filterable checkbox groups for long lists**: When an option list exceeds 8-10 items, switch from `checkbox-group` to `filterable-checkbox-group` so users can search rather than scroll.
223
372
 
224
- 3. **Reset vs Clear**:
225
- - `useReset`: 여러 필터가 있을 때 모든 필터를 초기화
226
- - `useClear`: 단일 필터만 있을 때 해당 필터를 초기화
373
+ 5. **Prefer controlled mode for complex state**: When filter values need to be synced with URL parameters, API requests, or other UI elements, use the controlled pattern with `values` and `onChange`.
227
374
 
228
- 4. **상태 관리**: 제어 모드(`values` prop 사용) 또는 비제어 모드(`defaultValues` prop 사용) 중 하나를 선택하여 사용하세요.
375
+ ## Accessibility
229
376
 
230
- 5. **접근성**: 필터에는 적절한 `label`을 제공하여 접근성을 보장하세요.
377
+ - Each filter section is labeled with its `label` prop, providing clear context for screen readers.
378
+ - Checkbox and radio groups follow standard form control patterns with proper labeling.
379
+ - The reset button is keyboard-accessible and clearly labeled, allowing users to quickly clear all filters.
380
+ - Use the `placeholder` prop on filterable checkbox groups and autocomplete filters to provide instructional text for assistive technology users.
@@ -2,7 +2,14 @@
2
2
 
3
3
  ## Introduction
4
4
 
5
- FilterableCheckboxGroup 컴포넌트는 대량의 옵션 중에서 여러 항목을 선택할 있는 검색 가능한 체크박스 그룹입니다. 검색 필터링과 가상 스크롤링을 통해 많은 수의 옵션을 효율적으로 처리할 있으며, "Select all" 기능으로 일괄 선택이 가능합니다. 필터링, 다중 선택 폼, 설정 화면 등에서 유용하게 사용됩니다.
5
+ FilterableCheckboxGroup is a multi-select component that combines a search input with a scrollable list of checkboxes. It is designed for scenarios where users need to select multiple items from a potentially large dataset. The built-in search filter narrows down visible options in real time, and virtual scrolling ensures smooth performance even with hundreds of items.
6
+
7
+ Key capabilities include a "Select all" toggle for bulk selection, automatic sorting (selected items first, then alphabetical), customizable list height, and built-in form integration via `label`, `helperText`, and `required` props. The component accepts options as either simple strings or `{ value, label }` objects.
8
+
9
+ > **Form 구성 시 내장 prop 사용을 권장합니다**
10
+ >
11
+ > 이 컴포넌트는 `label`, `helperText` 등의 Form 요소를 자체적으로 지원합니다.
12
+ > Form을 구성할 때 Typography로 별도의 label이나 helperText를 만드는 대신, 컴포넌트의 내장 prop을 사용하세요.
6
13
 
7
14
  ```tsx
8
15
  <FilterableCheckboxGroup
@@ -50,11 +57,9 @@ function MyComponent() {
50
57
  }
51
58
  ```
52
59
 
53
- ## Examples
54
-
55
- ### Sizes
60
+ ## Sizes
56
61
 
57
- 다양한 크기의 FilterableCheckboxGroup을 사용할 있습니다.
62
+ Three sizes are available: `sm`, `md`, and `lg`. The size affects the search input, checkboxes, and overall spacing.
58
63
 
59
64
  ```tsx
60
65
  <Stack spacing={3}>
@@ -64,9 +69,11 @@ function MyComponent() {
64
69
  </Stack>
65
70
  ```
66
71
 
72
+ ## Label and Helper Text
73
+
67
74
  ### With Label
68
75
 
69
- 라벨을 추가할 있습니다.
76
+ Use the `label` prop to describe the purpose of the checkbox group.
70
77
 
71
78
  ```tsx
72
79
  <FilterableCheckboxGroup
@@ -78,7 +85,7 @@ function MyComponent() {
78
85
 
79
86
  ### With Helper Text
80
87
 
81
- 도움말 텍스트를 추가할 있습니다.
88
+ Add a `helperText` prop to provide additional guidance below the component.
82
89
 
83
90
  ```tsx
84
91
  <FilterableCheckboxGroup
@@ -91,7 +98,7 @@ function MyComponent() {
91
98
 
92
99
  ### Required Field
93
100
 
94
- 필수 입력 필드로 표시할 있습니다.
101
+ Set `required` to append a required indicator to the label.
95
102
 
96
103
  ```tsx
97
104
  <FilterableCheckboxGroup
@@ -103,9 +110,9 @@ function MyComponent() {
103
110
  />
104
111
  ```
105
112
 
106
- ### Custom Max Height
113
+ ## Custom Max Height
107
114
 
108
- 목록의 최대 높이를 커스터마이징할 있습니다.
115
+ Control the visible height of the options list with the `maxHeight` prop (default: 300px). A smaller height is useful when screen space is limited.
109
116
 
110
117
  ```tsx
111
118
  <Stack spacing={3}>
@@ -114,9 +121,9 @@ function MyComponent() {
114
121
  </Stack>
115
122
  ```
116
123
 
117
- ### Long List
124
+ ## Long List with Virtual Scrolling
118
125
 
119
- 많은 수의 옵션을 가상 스크롤링으로 효율적으로 표시합니다.
126
+ When the options list is large, the component uses virtual scrolling to render only the visible items. This keeps the UI performant regardless of the total number of options.
120
127
 
121
128
  ```tsx
122
129
  <FilterableCheckboxGroup
@@ -129,9 +136,9 @@ function MyComponent() {
129
136
  />
130
137
  ```
131
138
 
132
- ### No Options
139
+ ## Empty State
133
140
 
134
- 옵션이 없을 때의 상태입니다.
141
+ When no options are provided, the component displays an empty state. This is useful for dynamically loaded option lists that may start empty.
135
142
 
136
143
  ```tsx
137
144
  <FilterableCheckboxGroup
@@ -141,9 +148,9 @@ function MyComponent() {
141
148
  />
142
149
  ```
143
150
 
144
- ### Controlled
151
+ ## Controlled Mode
145
152
 
146
- 외부에서 값을 제어하는 예제입니다.
153
+ Pass `value` and `onChange` to manage the selection state externally. This is the recommended approach when the component is part of a form or when the selected values need to be used by other parts of the UI.
147
154
 
148
155
  ```tsx
149
156
  <Stack spacing={2}>
@@ -155,9 +162,9 @@ function MyComponent() {
155
162
  </Stack>
156
163
  ```
157
164
 
158
- ### Sorting
165
+ ## Sorting Behavior
159
166
 
160
- 정렬 동작을 확인할 있는 예제입니다. 초기 렌더링 선택된 항목이 먼저 표시되고, 다음 알파벳 순으로 정렬됩니다.
167
+ The component automatically sorts options on initial render: selected items appear first, followed by unselected items in alphabetical order. When new options are added dynamically, they are inserted in the correct sorted position.
161
168
 
162
169
  ```tsx
163
170
  <Stack spacing={2}>
@@ -191,13 +198,13 @@ function MyComponent() {
191
198
  </Stack>
192
199
  ```
193
200
 
194
- ### Disabled
201
+ ## Disabled State
195
202
 
196
- 컴포넌트 전체 또는 특정 옵션을 비활성화할 있습니다.
203
+ The component supports both full and partial disabling.
197
204
 
198
- - **컴포넌트 전체 비활성화**: `disabled` prop을 사용하여 검색 input, "Select all", 모든 옵션을 비활성화합니다.
199
- - **특정 옵션 비활성화**: 옵션 객체의 `disabled` 속성을 사용하여 개별 옵션을 비활성화합니다.
200
- - **"Select all" 동작**: 비활성화된 옵션은 "Select all" 영향을 받지 않으며, 선택 상태가 유지됩니다.
205
+ - **Full disable**: Set `disabled` on the component to disable the search input, "Select all" toggle, and all checkboxes.
206
+ - **Partial disable**: Set `disabled: true` on individual option objects to disable specific items while keeping the rest interactive.
207
+ - **"Select all" behavior**: Disabled options are excluded from the "Select all" toggle. Their selected state is preserved regardless of bulk actions.
201
208
 
202
209
  ```tsx
203
210
  <Stack spacing={3}>
@@ -216,3 +223,96 @@ function MyComponent() {
216
223
  </Stack>
217
224
  </Stack>
218
225
  ```
226
+
227
+ ## Common Use Cases
228
+
229
+ ### Filter Panel
230
+
231
+ Use FilterableCheckboxGroup in a sidebar or panel to let users filter a data table or list by multiple criteria.
232
+
233
+ ```tsx
234
+ import { FilterableCheckboxGroup } from '@ceed/ads';
235
+
236
+ function FilterPanel({ categories, onFilterChange }) {
237
+ const [selected, setSelected] = useState<string[]>([]);
238
+
239
+ const handleChange = (values: string[]) => {
240
+ setSelected(values);
241
+ onFilterChange(values);
242
+ };
243
+
244
+ return (
245
+ <FilterableCheckboxGroup
246
+ label="Categories"
247
+ placeholder="Search categories..."
248
+ options={categories}
249
+ value={selected}
250
+ onChange={handleChange}
251
+ maxHeight={200}
252
+ />
253
+ );
254
+ }
255
+ ```
256
+
257
+ ### User Role Assignment
258
+
259
+ Assign multiple roles to a user from a searchable list.
260
+
261
+ ```tsx
262
+ <FilterableCheckboxGroup
263
+ label="Assign Roles"
264
+ placeholder="Search roles..."
265
+ helperText="Select all roles that apply to this user"
266
+ options={[
267
+ { value: 'admin', label: 'Administrator' },
268
+ { value: 'editor', label: 'Editor' },
269
+ { value: 'viewer', label: 'Viewer' },
270
+ { value: 'moderator', label: 'Moderator' },
271
+ { value: 'billing', label: 'Billing Manager' },
272
+ ]}
273
+ required
274
+ value={selectedRoles}
275
+ onChange={setSelectedRoles}
276
+ />
277
+ ```
278
+
279
+ ### Region / Country Selection
280
+
281
+ When dealing with a large set of options like countries, the search filter and virtual scrolling work together for fast selection.
282
+
283
+ ```tsx
284
+ <FilterableCheckboxGroup
285
+ label="Service Regions"
286
+ placeholder="Search countries..."
287
+ options={allCountries.map((c) => ({ value: c.code, label: c.name }))}
288
+ value={selectedCountries}
289
+ onChange={setSelectedCountries}
290
+ />
291
+ ```
292
+
293
+ ## Best Practices
294
+
295
+ 1. **Provide a meaningful placeholder.** The search input placeholder should hint at the type of content being filtered (e.g., "Search countries..." instead of a generic "Search...").
296
+
297
+ ```tsx
298
+ // ✅ Specific and helpful
299
+ <FilterableCheckboxGroup placeholder="Search countries..." />
300
+
301
+ // ❌ Too generic
302
+ <FilterableCheckboxGroup placeholder="Type here..." />
303
+ ```
304
+
305
+ 2. **Use `maxHeight` to fit the layout.** In tight spaces like sidebars or modals, set a smaller `maxHeight` to prevent the component from dominating the layout.
306
+
307
+ 3. **Prefer controlled mode for form integration.** Always pass `value` and `onChange` when the selected values participate in form submission or affect other UI state.
308
+
309
+ 4. **Leverage individual `disabled` for permissions.** When some options should be visible but not selectable (e.g., due to user permissions), disable them individually rather than hiding them. This communicates availability without surprising users.
310
+
311
+ 5. **Keep option labels concise.** Long labels will be truncated with an ellipsis. If detailed descriptions are needed, consider using a tooltip or a separate detail view.
312
+
313
+ ## Accessibility
314
+
315
+ - The search input is labeled by the component's `label` prop, ensuring screen readers announce its purpose.
316
+ - Each checkbox option uses a native `<input type="checkbox">` with an associated `<label>`, enabling click-on-label and proper screen reader announcements.
317
+ - The "Select all" toggle clearly communicates its tri-state behavior (all, none, indeterminate) to assistive technologies.
318
+ - Keyboard navigation is fully supported: Tab to move between the search input and the checkbox list, Space to toggle individual checkboxes, and standard arrow keys to navigate within the list.