@simplysm/solid 13.0.98 → 13.0.99

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.
@@ -1,117 +1,154 @@
1
- # Form Controls
1
+ # Form Control
2
2
 
3
- Source: `src/components/form-control/**/*.tsx`
3
+ Source: `src/components/form-control/**`
4
4
 
5
- ## Button
5
+ ## `Button`
6
6
 
7
- Themed button with ripple effect. Extends `JSX.ButtonHTMLAttributes<HTMLButtonElement>`.
7
+ Styled button component with theme, variant, and size support. Includes ripple effect.
8
8
 
9
- ```ts
10
- interface ButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
11
- theme?: SemanticTheme; // "primary" | "info" | "success" | "warning" | "danger" | "base" (default: "base")
12
- variant?: "solid" | "outline" | "ghost"; // default: "outline"
13
- size?: ComponentSize; // "xs" | "sm" | "md" | "lg" | "xl" (default: "md")
14
- inset?: boolean; // borderless style
9
+ ```typescript
10
+ export interface ButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
11
+ theme?: ButtonTheme;
12
+ variant?: ButtonVariant;
13
+ size?: ButtonSize;
14
+ inset?: boolean;
15
15
  }
16
16
  ```
17
17
 
18
- ## Select
18
+ | Prop | Type | Description |
19
+ |------|------|-------------|
20
+ | `theme` | `SemanticTheme` | Color theme. Default: `"base"` |
21
+ | `variant` | `"solid" \| "outline" \| "ghost"` | Visual variant. Default: `"outline"` |
22
+ | `size` | `ComponentSize` | Button size. Default: `"md"` |
23
+ | `inset` | `boolean` | Removes border and border-radius for embedded usage |
19
24
 
20
- Single or multiple select dropdown. Supports two modes: `items` prop mode and `children` mode.
25
+ ---
21
26
 
22
- ```ts
23
- // Common props
24
- interface SelectCommonProps<TValue> {
25
- disabled?: boolean;
26
- required?: boolean;
27
- placeholder?: string;
28
- size?: ComponentSize;
29
- inset?: boolean;
30
- validate?: (value: unknown) => string | undefined;
31
- lazyValidation?: boolean;
32
- itemSearchText?: (item: TValue) => string; // enables search input
33
- isItemHidden?: (item: TValue) => boolean;
34
- class?: string;
35
- style?: JSX.CSSProperties;
36
- }
27
+ ## `Select`
37
28
 
38
- // Single select
39
- interface SelectSingleProps<TValue> extends SelectCommonProps<TValue> {
40
- multiple?: false;
41
- value?: TValue;
42
- onValueChange?: (value: TValue | undefined) => void;
43
- }
29
+ Dropdown select component supporting single and multiple selection, search filtering, hierarchical items, and custom rendering via slots.
44
30
 
45
- // Multiple select
46
- interface SelectMultipleProps<TValue> extends SelectCommonProps<TValue> {
47
- multiple: true;
48
- value?: TValue[];
49
- onValueChange?: (value: TValue[]) => void;
50
- tagDirection?: "horizontal" | "vertical";
51
- hideSelectAll?: boolean;
52
- }
53
-
54
- // Items mode: pass items array + ItemTemplate
55
- // Children mode: pass children + renderValue
31
+ ```typescript
32
+ export type SelectProps<TValue = unknown> =
33
+ | (SelectSingleBaseProps<TValue> & SelectWithItemsPropsBase<TValue>)
34
+ | (SelectSingleBaseProps<TValue> & SelectWithChildrenPropsBase<TValue>)
35
+ | (SelectMultipleBaseProps<TValue> & SelectWithItemsPropsBase<TValue>)
36
+ | (SelectMultipleBaseProps<TValue> & SelectWithChildrenPropsBase<TValue>);
56
37
  ```
57
38
 
58
- ### Sub-components
39
+ | Prop | Type | Description |
40
+ |------|------|-------------|
41
+ | `value` | `TValue \| TValue[]` | Currently selected value(s) |
42
+ | `onValueChange` | `(value) => void` | Value change callback |
43
+ | `multiple` | `boolean` | Enable multiple selection mode |
44
+ | `disabled` | `boolean` | Disabled state |
45
+ | `required` | `boolean` | Required input |
46
+ | `placeholder` | `string` | Placeholder text |
47
+ | `size` | `ComponentSize` | Trigger size. Default: `"md"` |
48
+ | `inset` | `boolean` | Borderless style |
49
+ | `validate` | `(value) => string \| undefined` | Custom validation function |
50
+ | `lazyValidation` | `boolean` | Show error only after blur |
51
+ | `itemSearchText` | `(item: TValue) => string` | Search text extraction (shows search input when set) |
52
+ | `isItemHidden` | `(item: TValue) => boolean` | Determine if item is hidden |
53
+ | `items` | `TValue[]` | Items array (items mode) |
54
+ | `itemChildren` | `(item, index, depth) => TValue[] \| undefined` | Child items for tree structure |
55
+ | `renderValue` | `(value: TValue) => JSX.Element` | Custom value renderer (required in children mode) |
56
+ | `tagDirection` | `"horizontal" \| "vertical"` | Multiple selection tag direction |
57
+ | `hideSelectAll` | `boolean` | Hide select all button (multiple mode) |
59
58
 
60
- - **`Select.Item<TValue>`** -- Selectable item. Props: `value: TValue`, `disabled?: boolean`. Supports nested items via `Select.Item.Children`.
61
- - **`Select.Header`** -- Custom header slot rendered above dropdown list.
62
- - **`Select.Action`** -- Action button appended to the trigger. Extends button attributes.
63
- - **`Select.ItemTemplate`** -- Render template for `items` mode. Child is a function: `(item, index, depth) => JSX.Element`.
59
+ ### Sub-components
64
60
 
65
- ## Combobox
61
+ - **`Select.Item`** -- Selectable item in dropdown. Props: `value: TValue`, `disabled?: boolean`
62
+ - **`Select.Item.Children`** -- Nested children slot for hierarchical items
63
+ - **`Select.Header`** -- Custom header slot in dropdown
64
+ - **`Select.Action`** -- Action button appended to trigger
65
+ - **`Select.ItemTemplate`** -- Template function for items mode rendering
66
+
67
+ ### `SelectContextValue`
68
+
69
+ ```typescript
70
+ export interface SelectContextValue<TValue = unknown> {
71
+ multiple: Accessor<boolean>;
72
+ isSelected: (value: TValue) => boolean;
73
+ toggleValue: (value: TValue) => void;
74
+ closeDropdown: () => void;
75
+ setItemTemplate: (fn: ((...args: unknown[]) => JSX.Element) | undefined) => void;
76
+ size: Accessor<ComponentSize>;
77
+ }
78
+ ```
66
79
 
67
- Autocomplete component with async search and debounced loading.
80
+ ### `SelectItemProps`
68
81
 
69
- ```ts
70
- interface ComboboxBaseProps<TValue> {
71
- value?: TValue;
72
- onValueChange?: (value: TValue) => void;
73
- loadItems: (query: string) => TValue[] | Promise<TValue[]>; // required
74
- debounceMs?: number; // default: 300
75
- renderValue: (value: TValue) => JSX.Element; // required
82
+ ```typescript
83
+ export interface SelectItemProps<TValue = unknown> {
84
+ value: TValue;
76
85
  disabled?: boolean;
77
- required?: boolean;
78
- validate?: (value: TValue | undefined) => string | undefined;
79
- lazyValidation?: boolean;
80
- placeholder?: string;
81
- size?: ComponentSize;
82
- inset?: boolean;
83
- class?: string;
84
- style?: JSX.CSSProperties;
85
- children?: JSX.Element;
86
86
  }
87
+ ```
87
88
 
88
- // Custom value variants
89
- interface ComboboxCustomParserProps<TValue> extends ComboboxBaseProps<TValue> {
90
- allowsCustomValue: true;
91
- parseCustomValue: (text: string) => TValue;
92
- }
89
+ ---
93
90
 
94
- interface ComboboxCustomStringProps extends ComboboxBaseProps<string> {
95
- allowsCustomValue: true;
96
- parseCustomValue?: undefined; // TValue must be string
97
- }
91
+ ## `Combobox`
98
92
 
99
- interface ComboboxDefaultProps<TValue> extends ComboboxBaseProps<TValue> {
100
- allowsCustomValue?: false;
101
- }
93
+ Autocomplete component supporting async search, custom value parsing, and item selection.
94
+
95
+ ```typescript
96
+ export type ComboboxProps<TValue = unknown> =
97
+ | ComboboxCustomParserProps<TValue>
98
+ | ComboboxCustomStringProps
99
+ | ComboboxDefaultProps<TValue>;
102
100
  ```
103
101
 
102
+ | Prop | Type | Description |
103
+ |------|------|-------------|
104
+ | `value` | `TValue` | Currently selected value |
105
+ | `onValueChange` | `(value: TValue) => void` | Value change callback |
106
+ | `loadItems` | `(query: string) => TValue[] \| Promise<TValue[]>` | Item load function (required) |
107
+ | `debounceMs` | `number` | Debounce delay. Default: `300` |
108
+ | `renderValue` | `(value: TValue) => JSX.Element` | Render selected value (required) |
109
+ | `disabled` | `boolean` | Disabled state |
110
+ | `required` | `boolean` | Required input |
111
+ | `validate` | `(value) => string \| undefined` | Custom validation |
112
+ | `lazyValidation` | `boolean` | Show error only after blur |
113
+ | `placeholder` | `string` | Placeholder text |
114
+ | `size` | `ComponentSize` | Trigger size |
115
+ | `inset` | `boolean` | Borderless style |
116
+ | `allowsCustomValue` | `boolean` | Allow custom text value |
117
+ | `parseCustomValue` | `(text: string) => TValue` | Parse custom text to TValue |
118
+
104
119
  ### Sub-components
105
120
 
106
- - **`Combobox.Item<TValue>`** -- Selectable item. Props: `value: TValue`, `disabled?: boolean`.
107
- - **`Combobox.ItemTemplate`** -- Render template for loaded items. Child is a function: `(item, index) => JSX.Element`.
121
+ - **`Combobox.Item`** -- Selectable item in dropdown. Props: `value: TValue`, `disabled?: boolean`
122
+ - **`Combobox.ItemTemplate`** -- Template function for item rendering
123
+
124
+ ### `ComboboxContextValue`
108
125
 
109
- ## TextInput
126
+ ```typescript
127
+ export interface ComboboxContextValue<TValue = unknown> {
128
+ isSelected: (value: TValue) => boolean;
129
+ selectValue: (value: TValue) => void;
130
+ closeDropdown: () => void;
131
+ setItemTemplate: (fn: ((...args: unknown[]) => JSX.Element) | undefined) => void;
132
+ }
133
+ ```
110
134
 
111
- Text input field with format support and IME handling.
135
+ ### `ComboboxItemProps`
112
136
 
113
- ```ts
114
- interface TextInputProps {
137
+ ```typescript
138
+ export interface ComboboxItemProps<TValue = unknown> {
139
+ value: TValue;
140
+ disabled?: boolean;
141
+ }
142
+ ```
143
+
144
+ ---
145
+
146
+ ## `TextInput`
147
+
148
+ Text input field with format masking, prefix slot, and IME composition handling.
149
+
150
+ ```typescript
151
+ export interface TextInputProps {
115
152
  value?: string;
116
153
  onValueChange?: (value: string) => void;
117
154
  type?: "text" | "password" | "email";
@@ -122,7 +159,7 @@ interface TextInputProps {
122
159
  readOnly?: boolean;
123
160
  size?: ComponentSize;
124
161
  inset?: boolean;
125
- format?: string; // e.g., "XXX-XXXX-XXXX"
162
+ format?: string;
126
163
  required?: boolean;
127
164
  minLength?: number;
128
165
  maxLength?: number;
@@ -131,23 +168,39 @@ interface TextInputProps {
131
168
  lazyValidation?: boolean;
132
169
  class?: string;
133
170
  style?: JSX.CSSProperties;
134
- children?: JSX.Element; // TextInput.Prefix slot
171
+ children?: JSX.Element;
135
172
  }
136
173
  ```
137
174
 
175
+ | Prop | Type | Description |
176
+ |------|------|-------------|
177
+ | `value` | `string` | Input value |
178
+ | `onValueChange` | `(value: string) => void` | Value change callback |
179
+ | `type` | `"text" \| "password" \| "email"` | Input type. Default: `"text"` |
180
+ | `format` | `string` | Input format mask (e.g., `"XXX-XXXX-XXXX"`) |
181
+ | `required` | `boolean` | Required input |
182
+ | `minLength` / `maxLength` | `number` | Length constraints |
183
+ | `pattern` | `string \| RegExp` | Input validation pattern |
184
+
138
185
  ### Sub-components
139
186
 
140
- - **`TextInput.Prefix`** -- Prefix content displayed before the input.
187
+ - **`TextInput.Prefix`** -- Prefix slot (e.g., icon or currency symbol)
188
+
189
+ ### Standalone Export
190
+
191
+ - **`TextInputPrefix`** -- The slot component, also accessible via `TextInput.Prefix`
192
+
193
+ ---
141
194
 
142
- ## NumberInput
195
+ ## `NumberInput`
143
196
 
144
- Numeric input with thousand separator and decimal formatting.
197
+ Numeric input field with thousand separator, decimal formatting, and prefix slot.
145
198
 
146
- ```ts
147
- interface NumberInputProps {
199
+ ```typescript
200
+ export interface NumberInputProps {
148
201
  value?: number;
149
202
  onValueChange?: (value: number | undefined) => void;
150
- useGrouping?: boolean; // default: true
203
+ useGrouping?: boolean;
151
204
  minimumFractionDigits?: number;
152
205
  placeholder?: string;
153
206
  title?: string;
@@ -162,25 +215,35 @@ interface NumberInputProps {
162
215
  max?: number;
163
216
  validate?: (value: number | undefined) => string | undefined;
164
217
  lazyValidation?: boolean;
165
- children?: JSX.Element; // NumberInput.Prefix slot
218
+ children?: JSX.Element;
166
219
  }
167
220
  ```
168
221
 
222
+ | Prop | Type | Description |
223
+ |------|------|-------------|
224
+ | `useGrouping` | `boolean` | Show thousand separator. Default: `true` |
225
+ | `minimumFractionDigits` | `number` | Minimum decimal places |
226
+ | `min` / `max` | `number` | Value range constraints |
227
+
169
228
  ### Sub-components
170
229
 
171
- - **`NumberInput.Prefix`** -- Prefix content displayed before the input.
230
+ - **`NumberInput.Prefix`** -- Prefix slot
231
+
232
+ ### Standalone Export
172
233
 
173
- ## DatePicker
234
+ - **`NumberInputPrefix`** -- The slot component
174
235
 
175
- Date input supporting year, month, and date units. Uses `DateOnly` from `@simplysm/core-common`.
236
+ ---
176
237
 
177
- ```ts
178
- type DatePickerUnit = "year" | "month" | "date";
238
+ ## `DatePicker`
179
239
 
180
- interface DatePickerProps {
240
+ Date input field supporting year, month, and date units with `DateOnly` type.
241
+
242
+ ```typescript
243
+ export interface DatePickerProps {
181
244
  value?: DateOnly;
182
245
  onValueChange?: (value: DateOnly | undefined) => void;
183
- unit?: DatePickerUnit; // default: "date"
246
+ unit?: "year" | "month" | "date";
184
247
  min?: DateOnly;
185
248
  max?: DateOnly;
186
249
  title?: string;
@@ -196,17 +259,22 @@ interface DatePickerProps {
196
259
  }
197
260
  ```
198
261
 
199
- ## DateTimePicker
262
+ | Prop | Type | Description |
263
+ |------|------|-------------|
264
+ | `unit` | `"year" \| "month" \| "date"` | Date unit. Default: `"date"` |
265
+ | `min` / `max` | `DateOnly` | Date range constraints |
266
+
267
+ ---
200
268
 
201
- DateTime input supporting minute and second units. Uses `DateTime` from `@simplysm/core-common`.
269
+ ## `DateTimePicker`
202
270
 
203
- ```ts
204
- type DateTimePickerUnit = "minute" | "second";
271
+ DateTime input field supporting minute and second units with `DateTime` type.
205
272
 
206
- interface DateTimePickerProps {
273
+ ```typescript
274
+ export interface DateTimePickerProps {
207
275
  value?: DateTime;
208
276
  onValueChange?: (value: DateTime | undefined) => void;
209
- unit?: DateTimePickerUnit; // default: "minute"
277
+ unit?: "minute" | "second";
210
278
  min?: DateTime;
211
279
  max?: DateTime;
212
280
  title?: string;
@@ -222,17 +290,21 @@ interface DateTimePickerProps {
222
290
  }
223
291
  ```
224
292
 
225
- ## TimePicker
293
+ | Prop | Type | Description |
294
+ |------|------|-------------|
295
+ | `unit` | `"minute" \| "second"` | DateTime unit. Default: `"minute"` |
226
296
 
227
- Time input supporting minute and second units. Uses `Time` from `@simplysm/core-common`.
297
+ ---
228
298
 
229
- ```ts
230
- type TimePickerUnit = "minute" | "second";
299
+ ## `TimePicker`
231
300
 
232
- interface TimePickerProps {
301
+ Time input field supporting minute and second units with `Time` type.
302
+
303
+ ```typescript
304
+ export interface TimePickerProps {
233
305
  value?: Time;
234
306
  onValueChange?: (value: Time | undefined) => void;
235
- unit?: TimePickerUnit; // default: "minute"
307
+ unit?: "minute" | "second";
236
308
  title?: string;
237
309
  disabled?: boolean;
238
310
  readOnly?: boolean;
@@ -248,12 +320,14 @@ interface TimePickerProps {
248
320
  }
249
321
  ```
250
322
 
251
- ## Textarea
323
+ ---
324
+
325
+ ## `Textarea`
252
326
 
253
- Auto-resizing textarea with IME handling.
327
+ Auto-resizing textarea with IME composition handling.
254
328
 
255
- ```ts
256
- interface TextareaProps {
329
+ ```typescript
330
+ export interface TextareaProps {
257
331
  value?: string;
258
332
  onValueChange?: (value: string) => void;
259
333
  placeholder?: string;
@@ -262,7 +336,7 @@ interface TextareaProps {
262
336
  readOnly?: boolean;
263
337
  size?: ComponentSize;
264
338
  inset?: boolean;
265
- minRows?: number; // default: 1
339
+ minRows?: number;
266
340
  required?: boolean;
267
341
  minLength?: number;
268
342
  maxLength?: number;
@@ -273,16 +347,22 @@ interface TextareaProps {
273
347
  }
274
348
  ```
275
349
 
276
- ## Checkbox
350
+ | Prop | Type | Description |
351
+ |------|------|-------------|
352
+ | `minRows` | `number` | Minimum visible rows. Default: `1` |
277
353
 
278
- Checkbox with check indicator. Renders via `SelectableBase`.
354
+ ---
279
355
 
280
- ```ts
281
- interface CheckboxProps {
356
+ ## `Checkbox`
357
+
358
+ Checkbox toggle component with square indicator and check icon.
359
+
360
+ ```typescript
361
+ export interface CheckboxProps {
282
362
  checked?: boolean;
283
363
  onCheckedChange?: (checked: boolean) => void;
284
364
  disabled?: boolean;
285
- size?: ComponentSize;
365
+ size?: CheckboxSize;
286
366
  inset?: boolean;
287
367
  inline?: boolean;
288
368
  required?: boolean;
@@ -294,16 +374,18 @@ interface CheckboxProps {
294
374
  }
295
375
  ```
296
376
 
297
- ## Radio
377
+ ---
298
378
 
299
- Radio button with dot indicator. Always selects on click (never deselects).
379
+ ## `Radio`
300
380
 
301
- ```ts
302
- interface RadioProps {
381
+ Radio button component with circular indicator. Always selects to `true` (cannot deselect).
382
+
383
+ ```typescript
384
+ export interface RadioProps {
303
385
  checked?: boolean;
304
386
  onCheckedChange?: (checked: boolean) => void;
305
387
  disabled?: boolean;
306
- size?: ComponentSize;
388
+ size?: CheckboxSize;
307
389
  inset?: boolean;
308
390
  inline?: boolean;
309
391
  required?: boolean;
@@ -315,63 +397,59 @@ interface RadioProps {
315
397
  }
316
398
  ```
317
399
 
318
- ## CheckboxGroup
400
+ ---
319
401
 
320
- Multi-select group of checkboxes.
402
+ ## `CheckboxGroup`
321
403
 
322
- ```ts
323
- interface CheckboxGroupProps<TValue> {
324
- value?: TValue[];
325
- onValueChange?: (value: TValue[]) => void;
326
- disabled?: boolean;
327
- size?: ComponentSize;
328
- inline?: boolean;
329
- inset?: boolean;
330
- required?: boolean;
331
- validate?: (value: TValue[]) => string | undefined;
332
- lazyValidation?: boolean;
333
- class?: string;
334
- style?: JSX.CSSProperties;
335
- children?: JSX.Element;
336
- }
337
- ```
404
+ Group component for multi-value checkbox selection.
405
+
406
+ | Prop | Type | Description |
407
+ |------|------|-------------|
408
+ | `value` | `TValue[]` | Selected values |
409
+ | `onValueChange` | `(value: TValue[]) => void` | Change callback |
410
+ | `disabled` | `boolean` | Disable all items |
411
+ | `size` | `CheckboxSize` | Size for all items |
412
+ | `inline` | `boolean` | Inline display |
413
+ | `inset` | `boolean` | Inset style |
414
+ | `required` | `boolean` | Required (at least one selected) |
415
+ | `validate` | `(value: TValue[]) => string \| undefined` | Custom validation |
416
+ | `lazyValidation` | `boolean` | Lazy validation |
338
417
 
339
418
  ### Sub-components
340
419
 
341
- - **`CheckboxGroup.Item<TValue>`** -- Props: `value: TValue`, `disabled?: boolean`, `children?: JSX.Element`.
420
+ - **`CheckboxGroup.Item`** -- Individual item. Props: `value: TValue`, `disabled?: boolean`, `children?: JSX.Element`
342
421
 
343
- ## RadioGroup
422
+ ---
344
423
 
345
- Single-select group of radio buttons.
424
+ ## `RadioGroup`
346
425
 
347
- ```ts
348
- interface RadioGroupProps<TValue> {
349
- value?: TValue;
350
- onValueChange?: (value: TValue) => void;
351
- disabled?: boolean;
352
- size?: ComponentSize;
353
- inline?: boolean;
354
- inset?: boolean;
355
- required?: boolean;
356
- validate?: (value: TValue | undefined) => string | undefined;
357
- lazyValidation?: boolean;
358
- class?: string;
359
- style?: JSX.CSSProperties;
360
- children?: JSX.Element;
361
- }
362
- ```
426
+ Group component for single-value radio selection.
427
+
428
+ | Prop | Type | Description |
429
+ |------|------|-------------|
430
+ | `value` | `TValue` | Selected value |
431
+ | `onValueChange` | `(value: TValue) => void` | Change callback |
432
+ | `disabled` | `boolean` | Disable all items |
433
+ | `size` | `CheckboxSize` | Size for all items |
434
+ | `inline` | `boolean` | Inline display |
435
+ | `inset` | `boolean` | Inset style |
436
+ | `required` | `boolean` | Required |
437
+ | `validate` | `(value: TValue \| undefined) => string \| undefined` | Custom validation |
438
+ | `lazyValidation` | `boolean` | Lazy validation |
363
439
 
364
440
  ### Sub-components
365
441
 
366
- - **`RadioGroup.Item<TValue>`** -- Props: `value: TValue`, `disabled?: boolean`, `children?: JSX.Element`.
442
+ - **`RadioGroup.Item`** -- Individual item. Props: `value: TValue`, `disabled?: boolean`, `children?: JSX.Element`
367
443
 
368
- ## ColorPicker
444
+ ---
369
445
 
370
- Native HTML color picker input.
446
+ ## `ColorPicker`
371
447
 
372
- ```ts
373
- interface ColorPickerProps {
374
- value?: string; // #RRGGBB format
448
+ Color picker input using native `<input type="color">`.
449
+
450
+ ```typescript
451
+ export interface ColorPickerProps {
452
+ value?: string;
375
453
  onValueChange?: (value: string | undefined) => void;
376
454
  title?: string;
377
455
  disabled?: boolean;
@@ -385,14 +463,14 @@ interface ColorPickerProps {
385
463
  }
386
464
  ```
387
465
 
388
- ## DateRangePicker
466
+ ---
389
467
 
390
- Date range input with period type selector (day/month/range).
468
+ ## `DateRangePicker`
391
469
 
392
- ```ts
393
- type DateRangePeriodType = "day" | "month" | "range";
470
+ Date range picker with period type selector (day/month/range). Automatically adjusts from/to when period type changes.
394
471
 
395
- interface DateRangePickerProps {
472
+ ```typescript
473
+ export interface DateRangePickerProps {
396
474
  periodType?: DateRangePeriodType;
397
475
  onPeriodTypeChange?: (value: DateRangePeriodType) => void;
398
476
  from?: DateOnly;
@@ -407,13 +485,21 @@ interface DateRangePickerProps {
407
485
  }
408
486
  ```
409
487
 
410
- ## RichTextEditor
488
+ ### `DateRangePeriodType`
489
+
490
+ ```typescript
491
+ export type DateRangePeriodType = "day" | "month" | "range";
492
+ ```
493
+
494
+ ---
411
495
 
412
- Tiptap-based rich text editor with toolbar (text formatting, alignment, colors, tables, images).
496
+ ## `RichTextEditor`
413
497
 
414
- ```ts
415
- interface RichTextEditorProps {
416
- value?: string; // HTML string
498
+ WYSIWYG rich text editor powered by TipTap with toolbar. Supports text alignment, color, highlight, tables, and images.
499
+
500
+ ```typescript
501
+ export interface RichTextEditorProps {
502
+ value?: string;
417
503
  onValueChange?: (value: string) => void;
418
504
  disabled?: boolean;
419
505
  size?: ComponentSize;
@@ -422,17 +508,19 @@ interface RichTextEditorProps {
422
508
  }
423
509
  ```
424
510
 
425
- ## Numpad
511
+ ---
426
512
 
427
- Numeric keypad for touch-friendly number input.
513
+ ## `Numpad`
428
514
 
429
- ```ts
430
- interface NumpadProps {
515
+ On-screen numpad with digit buttons, clear, backspace, and optional enter/minus buttons.
516
+
517
+ ```typescript
518
+ export interface NumpadProps {
431
519
  value?: number;
432
520
  onValueChange?: (value: number | undefined) => void;
433
521
  placeholder?: string;
434
522
  required?: boolean;
435
- inputDisabled?: boolean; // disable direct text field input
523
+ inputDisabled?: boolean;
436
524
  withEnterButton?: boolean;
437
525
  withMinusButton?: boolean;
438
526
  onEnterButtonClick?: () => void;
@@ -442,12 +530,14 @@ interface NumpadProps {
442
530
  }
443
531
  ```
444
532
 
445
- ## StatePreset
533
+ ---
534
+
535
+ ## `StatePreset`
446
536
 
447
- Save and restore named state presets to synced storage.
537
+ Save/restore named state presets to sync storage. Displays preset chips with restore, overwrite, and delete actions.
448
538
 
449
- ```ts
450
- interface StatePresetProps<TValue> {
539
+ ```typescript
540
+ export interface StatePresetProps<TValue> {
451
541
  storageKey: string;
452
542
  value: TValue;
453
543
  onValueChange: (value: TValue) => void;
@@ -457,81 +547,74 @@ interface StatePresetProps<TValue> {
457
547
  }
458
548
  ```
459
549
 
460
- ## ThemeToggle
550
+ ---
461
551
 
462
- Theme cycle button (light -> system -> dark -> light). Must be used inside `ThemeProvider`.
552
+ ## `ThemeToggle`
463
553
 
464
- ```ts
465
- interface ThemeToggleProps extends Omit<JSX.ButtonHTMLAttributes<HTMLButtonElement>, "children"> {
554
+ Theme toggle button cycling through light, system, dark modes. Must be used inside `ThemeProvider`.
555
+
556
+ ```typescript
557
+ export interface ThemeToggleProps extends Omit<
558
+ JSX.ButtonHTMLAttributes<HTMLButtonElement>,
559
+ "children"
560
+ > {
466
561
  size?: ComponentSize;
467
562
  }
468
563
  ```
469
564
 
470
- ## Invalid
565
+ ---
566
+
567
+ ## `Invalid`
471
568
 
472
- Validation indicator wrapper. Wraps a child element and shows a validation error via dot or border.
569
+ Validation wrapper that displays error indicators (border highlight or dot) on child elements. Integrates with native form validation via hidden input.
473
570
 
474
- ```ts
475
- interface InvalidProps {
476
- /** Validation error message. Non-empty = invalid. */
571
+ ```typescript
572
+ export interface InvalidProps {
477
573
  message?: string;
478
- /** Visual indicator variant */
479
574
  variant?: "border" | "dot";
480
- /** When true, visual display only appears after target loses focus */
481
575
  lazyValidation?: boolean;
482
576
  }
483
577
  ```
484
578
 
485
- ## Field Style Exports
486
-
487
- Exported from `src/components/form-control/field/Field.styles.ts`:
488
-
489
- ```ts
490
- const fieldSurface: string; // bg + text + border + focus-within
491
- const fieldBaseClass: string; // inline-flex + fieldSurface
492
- const fieldSizeClasses: Record<ComponentSize, string>;
493
- const fieldInputClass: string; // input element styles
494
- function getFieldWrapperClass(options: {
495
- size?: ComponentSize;
496
- disabled?: boolean;
497
- inset?: boolean;
498
- includeCustomClass?: string | false;
499
- extra?: string | false;
500
- }): string;
501
- function getTextareaWrapperClass(options: {
502
- size?: ComponentSize;
503
- disabled?: boolean;
504
- inset?: boolean;
505
- includeCustomClass?: string | false;
506
- }): string;
507
- ```
508
-
509
- ## Checkbox Style Exports
510
-
511
- Exported from `src/components/form-control/checkbox/Checkbox.styles.ts`:
512
-
513
- ```ts
514
- type CheckboxSize = ComponentSize;
515
- const checkboxBaseClass: string;
516
- const indicatorBaseClass: string;
517
- const checkedClass: string;
518
- const checkboxSizeClasses: Record<CheckboxSize, string>;
519
- ```
520
-
521
- ## DropdownTrigger Style Exports
522
-
523
- Exported from `src/components/form-control/DropdownTrigger.styles.ts`:
524
-
525
- ```ts
526
- const triggerBaseClass: string;
527
- const triggerDisabledClass: string;
528
- const triggerInsetClass: string;
529
- const triggerSizeClasses: Record<ComponentSize, string>;
530
- const chevronWrapperClass: string;
531
- function getTriggerClass(options: {
532
- size?: ComponentSize;
533
- disabled?: boolean;
534
- inset?: boolean;
535
- class?: string;
536
- }): string;
537
- ```
579
+ | Prop | Type | Description |
580
+ |------|------|-------------|
581
+ | `message` | `string` | Validation error message. Non-empty means invalid |
582
+ | `variant` | `"border" \| "dot"` | Visual indicator style. Default: `"dot"` |
583
+ | `lazyValidation` | `boolean` | Show error only after the target loses focus |
584
+
585
+ ---
586
+
587
+ ## Style Exports
588
+
589
+ ### `Field.styles`
590
+
591
+ Shared style constants and utility functions for form field components.
592
+
593
+ | Export | Type | Description |
594
+ |--------|------|-------------|
595
+ | `fieldSurface` | `string` | Common field surface class |
596
+ | `fieldBaseClass` | `string` | Base wrapper class |
597
+ | `fieldSizeClasses` | `Record<ComponentSize, string>` | Size-specific classes |
598
+ | `fieldInsetClass` | `string` | Inset mode styles |
599
+ | `fieldInsetSizeHeightClasses` | `Record<ComponentSize, string>` | Inset height classes |
600
+ | `fieldDisabledClass` | `string` | Disabled styles |
601
+ | `textAreaBaseClass` | `string` | Textarea base class |
602
+ | `textAreaSizeClasses` | `Record<ComponentSize, string>` | Textarea size classes |
603
+ | `fieldInputClass` | `string` | Inner input element class |
604
+ | `fieldGapClasses` | `Record<ComponentSize, string>` | Gap classes for prefix icons |
605
+ | `getFieldWrapperClass` | `(options) => string` | Generate wrapper class |
606
+ | `getTextareaWrapperClass` | `(options) => string` | Generate textarea wrapper class |
607
+
608
+ ### `Checkbox.styles`
609
+
610
+ | Export | Type | Description |
611
+ |--------|------|-------------|
612
+ | `CheckboxSize` | `ComponentSize` | Size type alias |
613
+ | `checkboxBaseClass` | `string` | Wrapper base class |
614
+ | `indicatorBaseClass` | `string` | Indicator base class |
615
+ | `checkedClass` | `string` | Checked state class |
616
+ | `checkboxSizeClasses` | `Record<CheckboxSize, string>` | Size classes |
617
+ | `checkboxInsetClass` | `string` | Inset class |
618
+ | `checkboxInsetSizeHeightClasses` | `Record<CheckboxSize, string>` | Inset height classes |
619
+ | `checkboxInlineClass` | `string` | Inline class |
620
+ | `checkboxDisabledClass` | `string` | Disabled class |