@simplysm/solid 13.0.97 → 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.
- package/README.md +256 -0
- package/docs/data.md +342 -0
- package/docs/disclosure.md +188 -0
- package/docs/display.md +137 -0
- package/docs/features.md +310 -0
- package/docs/feedback.md +233 -0
- package/docs/form-control.md +620 -0
- package/docs/helpers.md +206 -0
- package/docs/hooks.md +142 -0
- package/docs/layout.md +212 -0
- package/docs/providers.md +197 -0
- package/docs/styles.md +133 -0
- package/package.json +5 -5
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
# Form Control
|
|
2
|
+
|
|
3
|
+
Source: `src/components/form-control/**`
|
|
4
|
+
|
|
5
|
+
## `Button`
|
|
6
|
+
|
|
7
|
+
Styled button component with theme, variant, and size support. Includes ripple effect.
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
export interface ButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
|
+
theme?: ButtonTheme;
|
|
12
|
+
variant?: ButtonVariant;
|
|
13
|
+
size?: ButtonSize;
|
|
14
|
+
inset?: boolean;
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
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 |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## `Select`
|
|
28
|
+
|
|
29
|
+
Dropdown select component supporting single and multiple selection, search filtering, hierarchical items, and custom rendering via slots.
|
|
30
|
+
|
|
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>);
|
|
37
|
+
```
|
|
38
|
+
|
|
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) |
|
|
58
|
+
|
|
59
|
+
### Sub-components
|
|
60
|
+
|
|
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
|
+
```
|
|
79
|
+
|
|
80
|
+
### `SelectItemProps`
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
export interface SelectItemProps<TValue = unknown> {
|
|
84
|
+
value: TValue;
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## `Combobox`
|
|
92
|
+
|
|
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>;
|
|
100
|
+
```
|
|
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
|
+
|
|
119
|
+
### Sub-components
|
|
120
|
+
|
|
121
|
+
- **`Combobox.Item`** -- Selectable item in dropdown. Props: `value: TValue`, `disabled?: boolean`
|
|
122
|
+
- **`Combobox.ItemTemplate`** -- Template function for item rendering
|
|
123
|
+
|
|
124
|
+
### `ComboboxContextValue`
|
|
125
|
+
|
|
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
|
+
```
|
|
134
|
+
|
|
135
|
+
### `ComboboxItemProps`
|
|
136
|
+
|
|
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 {
|
|
152
|
+
value?: string;
|
|
153
|
+
onValueChange?: (value: string) => void;
|
|
154
|
+
type?: "text" | "password" | "email";
|
|
155
|
+
placeholder?: string;
|
|
156
|
+
title?: string;
|
|
157
|
+
autocomplete?: JSX.HTMLAutocomplete;
|
|
158
|
+
disabled?: boolean;
|
|
159
|
+
readOnly?: boolean;
|
|
160
|
+
size?: ComponentSize;
|
|
161
|
+
inset?: boolean;
|
|
162
|
+
format?: string;
|
|
163
|
+
required?: boolean;
|
|
164
|
+
minLength?: number;
|
|
165
|
+
maxLength?: number;
|
|
166
|
+
pattern?: string | RegExp;
|
|
167
|
+
validate?: (value: string) => string | undefined;
|
|
168
|
+
lazyValidation?: boolean;
|
|
169
|
+
class?: string;
|
|
170
|
+
style?: JSX.CSSProperties;
|
|
171
|
+
children?: JSX.Element;
|
|
172
|
+
}
|
|
173
|
+
```
|
|
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
|
+
|
|
185
|
+
### Sub-components
|
|
186
|
+
|
|
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
|
+
---
|
|
194
|
+
|
|
195
|
+
## `NumberInput`
|
|
196
|
+
|
|
197
|
+
Numeric input field with thousand separator, decimal formatting, and prefix slot.
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
export interface NumberInputProps {
|
|
201
|
+
value?: number;
|
|
202
|
+
onValueChange?: (value: number | undefined) => void;
|
|
203
|
+
useGrouping?: boolean;
|
|
204
|
+
minimumFractionDigits?: number;
|
|
205
|
+
placeholder?: string;
|
|
206
|
+
title?: string;
|
|
207
|
+
disabled?: boolean;
|
|
208
|
+
readOnly?: boolean;
|
|
209
|
+
size?: ComponentSize;
|
|
210
|
+
inset?: boolean;
|
|
211
|
+
class?: string;
|
|
212
|
+
style?: JSX.CSSProperties;
|
|
213
|
+
required?: boolean;
|
|
214
|
+
min?: number;
|
|
215
|
+
max?: number;
|
|
216
|
+
validate?: (value: number | undefined) => string | undefined;
|
|
217
|
+
lazyValidation?: boolean;
|
|
218
|
+
children?: JSX.Element;
|
|
219
|
+
}
|
|
220
|
+
```
|
|
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
|
+
|
|
228
|
+
### Sub-components
|
|
229
|
+
|
|
230
|
+
- **`NumberInput.Prefix`** -- Prefix slot
|
|
231
|
+
|
|
232
|
+
### Standalone Export
|
|
233
|
+
|
|
234
|
+
- **`NumberInputPrefix`** -- The slot component
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## `DatePicker`
|
|
239
|
+
|
|
240
|
+
Date input field supporting year, month, and date units with `DateOnly` type.
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
export interface DatePickerProps {
|
|
244
|
+
value?: DateOnly;
|
|
245
|
+
onValueChange?: (value: DateOnly | undefined) => void;
|
|
246
|
+
unit?: "year" | "month" | "date";
|
|
247
|
+
min?: DateOnly;
|
|
248
|
+
max?: DateOnly;
|
|
249
|
+
title?: string;
|
|
250
|
+
disabled?: boolean;
|
|
251
|
+
readOnly?: boolean;
|
|
252
|
+
size?: ComponentSize;
|
|
253
|
+
inset?: boolean;
|
|
254
|
+
class?: string;
|
|
255
|
+
style?: JSX.CSSProperties;
|
|
256
|
+
required?: boolean;
|
|
257
|
+
validate?: (value: DateOnly | undefined) => string | undefined;
|
|
258
|
+
lazyValidation?: boolean;
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
| Prop | Type | Description |
|
|
263
|
+
|------|------|-------------|
|
|
264
|
+
| `unit` | `"year" \| "month" \| "date"` | Date unit. Default: `"date"` |
|
|
265
|
+
| `min` / `max` | `DateOnly` | Date range constraints |
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## `DateTimePicker`
|
|
270
|
+
|
|
271
|
+
DateTime input field supporting minute and second units with `DateTime` type.
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
export interface DateTimePickerProps {
|
|
275
|
+
value?: DateTime;
|
|
276
|
+
onValueChange?: (value: DateTime | undefined) => void;
|
|
277
|
+
unit?: "minute" | "second";
|
|
278
|
+
min?: DateTime;
|
|
279
|
+
max?: DateTime;
|
|
280
|
+
title?: string;
|
|
281
|
+
disabled?: boolean;
|
|
282
|
+
readOnly?: boolean;
|
|
283
|
+
size?: ComponentSize;
|
|
284
|
+
inset?: boolean;
|
|
285
|
+
class?: string;
|
|
286
|
+
style?: JSX.CSSProperties;
|
|
287
|
+
required?: boolean;
|
|
288
|
+
validate?: (value: DateTime | undefined) => string | undefined;
|
|
289
|
+
lazyValidation?: boolean;
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
| Prop | Type | Description |
|
|
294
|
+
|------|------|-------------|
|
|
295
|
+
| `unit` | `"minute" \| "second"` | DateTime unit. Default: `"minute"` |
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## `TimePicker`
|
|
300
|
+
|
|
301
|
+
Time input field supporting minute and second units with `Time` type.
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
export interface TimePickerProps {
|
|
305
|
+
value?: Time;
|
|
306
|
+
onValueChange?: (value: Time | undefined) => void;
|
|
307
|
+
unit?: "minute" | "second";
|
|
308
|
+
title?: string;
|
|
309
|
+
disabled?: boolean;
|
|
310
|
+
readOnly?: boolean;
|
|
311
|
+
size?: ComponentSize;
|
|
312
|
+
inset?: boolean;
|
|
313
|
+
class?: string;
|
|
314
|
+
style?: JSX.CSSProperties;
|
|
315
|
+
min?: Time;
|
|
316
|
+
max?: Time;
|
|
317
|
+
required?: boolean;
|
|
318
|
+
validate?: (value: Time | undefined) => string | undefined;
|
|
319
|
+
lazyValidation?: boolean;
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## `Textarea`
|
|
326
|
+
|
|
327
|
+
Auto-resizing textarea with IME composition handling.
|
|
328
|
+
|
|
329
|
+
```typescript
|
|
330
|
+
export interface TextareaProps {
|
|
331
|
+
value?: string;
|
|
332
|
+
onValueChange?: (value: string) => void;
|
|
333
|
+
placeholder?: string;
|
|
334
|
+
title?: string;
|
|
335
|
+
disabled?: boolean;
|
|
336
|
+
readOnly?: boolean;
|
|
337
|
+
size?: ComponentSize;
|
|
338
|
+
inset?: boolean;
|
|
339
|
+
minRows?: number;
|
|
340
|
+
required?: boolean;
|
|
341
|
+
minLength?: number;
|
|
342
|
+
maxLength?: number;
|
|
343
|
+
validate?: (value: string) => string | undefined;
|
|
344
|
+
lazyValidation?: boolean;
|
|
345
|
+
class?: string;
|
|
346
|
+
style?: JSX.CSSProperties;
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
| Prop | Type | Description |
|
|
351
|
+
|------|------|-------------|
|
|
352
|
+
| `minRows` | `number` | Minimum visible rows. Default: `1` |
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## `Checkbox`
|
|
357
|
+
|
|
358
|
+
Checkbox toggle component with square indicator and check icon.
|
|
359
|
+
|
|
360
|
+
```typescript
|
|
361
|
+
export interface CheckboxProps {
|
|
362
|
+
checked?: boolean;
|
|
363
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
364
|
+
disabled?: boolean;
|
|
365
|
+
size?: CheckboxSize;
|
|
366
|
+
inset?: boolean;
|
|
367
|
+
inline?: boolean;
|
|
368
|
+
required?: boolean;
|
|
369
|
+
validate?: (checked: boolean) => string | undefined;
|
|
370
|
+
lazyValidation?: boolean;
|
|
371
|
+
class?: string;
|
|
372
|
+
style?: JSX.CSSProperties;
|
|
373
|
+
children?: JSX.Element;
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
## `Radio`
|
|
380
|
+
|
|
381
|
+
Radio button component with circular indicator. Always selects to `true` (cannot deselect).
|
|
382
|
+
|
|
383
|
+
```typescript
|
|
384
|
+
export interface RadioProps {
|
|
385
|
+
checked?: boolean;
|
|
386
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
387
|
+
disabled?: boolean;
|
|
388
|
+
size?: CheckboxSize;
|
|
389
|
+
inset?: boolean;
|
|
390
|
+
inline?: boolean;
|
|
391
|
+
required?: boolean;
|
|
392
|
+
validate?: (checked: boolean) => string | undefined;
|
|
393
|
+
lazyValidation?: boolean;
|
|
394
|
+
class?: string;
|
|
395
|
+
style?: JSX.CSSProperties;
|
|
396
|
+
children?: JSX.Element;
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## `CheckboxGroup`
|
|
403
|
+
|
|
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 |
|
|
417
|
+
|
|
418
|
+
### Sub-components
|
|
419
|
+
|
|
420
|
+
- **`CheckboxGroup.Item`** -- Individual item. Props: `value: TValue`, `disabled?: boolean`, `children?: JSX.Element`
|
|
421
|
+
|
|
422
|
+
---
|
|
423
|
+
|
|
424
|
+
## `RadioGroup`
|
|
425
|
+
|
|
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 |
|
|
439
|
+
|
|
440
|
+
### Sub-components
|
|
441
|
+
|
|
442
|
+
- **`RadioGroup.Item`** -- Individual item. Props: `value: TValue`, `disabled?: boolean`, `children?: JSX.Element`
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## `ColorPicker`
|
|
447
|
+
|
|
448
|
+
Color picker input using native `<input type="color">`.
|
|
449
|
+
|
|
450
|
+
```typescript
|
|
451
|
+
export interface ColorPickerProps {
|
|
452
|
+
value?: string;
|
|
453
|
+
onValueChange?: (value: string | undefined) => void;
|
|
454
|
+
title?: string;
|
|
455
|
+
disabled?: boolean;
|
|
456
|
+
size?: ComponentSize;
|
|
457
|
+
inset?: boolean;
|
|
458
|
+
required?: boolean;
|
|
459
|
+
validate?: (value: string | undefined) => string | undefined;
|
|
460
|
+
lazyValidation?: boolean;
|
|
461
|
+
class?: string;
|
|
462
|
+
style?: JSX.CSSProperties;
|
|
463
|
+
}
|
|
464
|
+
```
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
468
|
+
## `DateRangePicker`
|
|
469
|
+
|
|
470
|
+
Date range picker with period type selector (day/month/range). Automatically adjusts from/to when period type changes.
|
|
471
|
+
|
|
472
|
+
```typescript
|
|
473
|
+
export interface DateRangePickerProps {
|
|
474
|
+
periodType?: DateRangePeriodType;
|
|
475
|
+
onPeriodTypeChange?: (value: DateRangePeriodType) => void;
|
|
476
|
+
from?: DateOnly;
|
|
477
|
+
onFromChange?: (value: DateOnly | undefined) => void;
|
|
478
|
+
to?: DateOnly;
|
|
479
|
+
onToChange?: (value: DateOnly | undefined) => void;
|
|
480
|
+
required?: boolean;
|
|
481
|
+
disabled?: boolean;
|
|
482
|
+
size?: ComponentSize;
|
|
483
|
+
class?: string;
|
|
484
|
+
style?: JSX.CSSProperties;
|
|
485
|
+
}
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### `DateRangePeriodType`
|
|
489
|
+
|
|
490
|
+
```typescript
|
|
491
|
+
export type DateRangePeriodType = "day" | "month" | "range";
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
## `RichTextEditor`
|
|
497
|
+
|
|
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;
|
|
503
|
+
onValueChange?: (value: string) => void;
|
|
504
|
+
disabled?: boolean;
|
|
505
|
+
size?: ComponentSize;
|
|
506
|
+
class?: string;
|
|
507
|
+
style?: JSX.CSSProperties;
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
---
|
|
512
|
+
|
|
513
|
+
## `Numpad`
|
|
514
|
+
|
|
515
|
+
On-screen numpad with digit buttons, clear, backspace, and optional enter/minus buttons.
|
|
516
|
+
|
|
517
|
+
```typescript
|
|
518
|
+
export interface NumpadProps {
|
|
519
|
+
value?: number;
|
|
520
|
+
onValueChange?: (value: number | undefined) => void;
|
|
521
|
+
placeholder?: string;
|
|
522
|
+
required?: boolean;
|
|
523
|
+
inputDisabled?: boolean;
|
|
524
|
+
withEnterButton?: boolean;
|
|
525
|
+
withMinusButton?: boolean;
|
|
526
|
+
onEnterButtonClick?: () => void;
|
|
527
|
+
size?: ComponentSize;
|
|
528
|
+
class?: string;
|
|
529
|
+
style?: JSX.CSSProperties;
|
|
530
|
+
}
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## `StatePreset`
|
|
536
|
+
|
|
537
|
+
Save/restore named state presets to sync storage. Displays preset chips with restore, overwrite, and delete actions.
|
|
538
|
+
|
|
539
|
+
```typescript
|
|
540
|
+
export interface StatePresetProps<TValue> {
|
|
541
|
+
storageKey: string;
|
|
542
|
+
value: TValue;
|
|
543
|
+
onValueChange: (value: TValue) => void;
|
|
544
|
+
size?: ComponentSize;
|
|
545
|
+
class?: string;
|
|
546
|
+
style?: JSX.CSSProperties;
|
|
547
|
+
}
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
---
|
|
551
|
+
|
|
552
|
+
## `ThemeToggle`
|
|
553
|
+
|
|
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
|
+
> {
|
|
561
|
+
size?: ComponentSize;
|
|
562
|
+
}
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
## `Invalid`
|
|
568
|
+
|
|
569
|
+
Validation wrapper that displays error indicators (border highlight or dot) on child elements. Integrates with native form validation via hidden input.
|
|
570
|
+
|
|
571
|
+
```typescript
|
|
572
|
+
export interface InvalidProps {
|
|
573
|
+
message?: string;
|
|
574
|
+
variant?: "border" | "dot";
|
|
575
|
+
lazyValidation?: boolean;
|
|
576
|
+
}
|
|
577
|
+
```
|
|
578
|
+
|
|
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 |
|