@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.
- package/README.md +166 -259
- package/docs/data.md +246 -120
- package/docs/disclosure.md +85 -61
- package/docs/display.md +87 -44
- package/docs/features.md +186 -155
- package/docs/feedback.md +130 -107
- package/docs/form-control.md +337 -254
- package/docs/helpers.md +120 -82
- package/docs/hooks.md +69 -70
- package/docs/layout.md +115 -85
- package/docs/providers.md +130 -110
- package/docs/styles.md +91 -85
- package/package.json +5 -5
package/docs/form-control.md
CHANGED
|
@@ -1,117 +1,154 @@
|
|
|
1
|
-
# Form
|
|
1
|
+
# Form Control
|
|
2
2
|
|
|
3
|
-
Source: `src/components/form-control
|
|
3
|
+
Source: `src/components/form-control/**`
|
|
4
4
|
|
|
5
|
-
## Button
|
|
5
|
+
## `Button`
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Styled button component with theme, variant, and size support. Includes ripple effect.
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
interface ButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
|
-
theme?:
|
|
12
|
-
variant?:
|
|
13
|
-
size?:
|
|
14
|
-
inset?: boolean;
|
|
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
|
-
|
|
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
|
-
|
|
25
|
+
---
|
|
21
26
|
|
|
22
|
-
|
|
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
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
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
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
80
|
+
### `SelectItemProps`
|
|
68
81
|
|
|
69
|
-
```
|
|
70
|
-
interface
|
|
71
|
-
value
|
|
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
|
-
|
|
89
|
-
interface ComboboxCustomParserProps<TValue> extends ComboboxBaseProps<TValue> {
|
|
90
|
-
allowsCustomValue: true;
|
|
91
|
-
parseCustomValue: (text: string) => TValue;
|
|
92
|
-
}
|
|
89
|
+
---
|
|
93
90
|
|
|
94
|
-
|
|
95
|
-
allowsCustomValue: true;
|
|
96
|
-
parseCustomValue?: undefined; // TValue must be string
|
|
97
|
-
}
|
|
91
|
+
## `Combobox`
|
|
98
92
|
|
|
99
|
-
|
|
100
|
-
|
|
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
|
|
107
|
-
- **`Combobox.ItemTemplate`** --
|
|
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
|
-
|
|
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
|
-
|
|
135
|
+
### `ComboboxItemProps`
|
|
112
136
|
|
|
113
|
-
```
|
|
114
|
-
interface
|
|
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;
|
|
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;
|
|
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
|
|
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
|
|
197
|
+
Numeric input field with thousand separator, decimal formatting, and prefix slot.
|
|
145
198
|
|
|
146
|
-
```
|
|
147
|
-
interface NumberInputProps {
|
|
199
|
+
```typescript
|
|
200
|
+
export interface NumberInputProps {
|
|
148
201
|
value?: number;
|
|
149
202
|
onValueChange?: (value: number | undefined) => void;
|
|
150
|
-
useGrouping?: boolean;
|
|
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;
|
|
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
|
|
230
|
+
- **`NumberInput.Prefix`** -- Prefix slot
|
|
231
|
+
|
|
232
|
+
### Standalone Export
|
|
172
233
|
|
|
173
|
-
|
|
234
|
+
- **`NumberInputPrefix`** -- The slot component
|
|
174
235
|
|
|
175
|
-
|
|
236
|
+
---
|
|
176
237
|
|
|
177
|
-
|
|
178
|
-
type DatePickerUnit = "year" | "month" | "date";
|
|
238
|
+
## `DatePicker`
|
|
179
239
|
|
|
180
|
-
|
|
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?:
|
|
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
|
-
|
|
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
|
-
|
|
269
|
+
## `DateTimePicker`
|
|
202
270
|
|
|
203
|
-
|
|
204
|
-
type DateTimePickerUnit = "minute" | "second";
|
|
271
|
+
DateTime input field supporting minute and second units with `DateTime` type.
|
|
205
272
|
|
|
206
|
-
|
|
273
|
+
```typescript
|
|
274
|
+
export interface DateTimePickerProps {
|
|
207
275
|
value?: DateTime;
|
|
208
276
|
onValueChange?: (value: DateTime | undefined) => void;
|
|
209
|
-
unit?:
|
|
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
|
-
|
|
293
|
+
| Prop | Type | Description |
|
|
294
|
+
|------|------|-------------|
|
|
295
|
+
| `unit` | `"minute" \| "second"` | DateTime unit. Default: `"minute"` |
|
|
226
296
|
|
|
227
|
-
|
|
297
|
+
---
|
|
228
298
|
|
|
229
|
-
|
|
230
|
-
type TimePickerUnit = "minute" | "second";
|
|
299
|
+
## `TimePicker`
|
|
231
300
|
|
|
232
|
-
|
|
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?:
|
|
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
|
-
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## `Textarea`
|
|
252
326
|
|
|
253
|
-
Auto-resizing textarea with IME handling.
|
|
327
|
+
Auto-resizing textarea with IME composition handling.
|
|
254
328
|
|
|
255
|
-
```
|
|
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;
|
|
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
|
-
|
|
350
|
+
| Prop | Type | Description |
|
|
351
|
+
|------|------|-------------|
|
|
352
|
+
| `minRows` | `number` | Minimum visible rows. Default: `1` |
|
|
277
353
|
|
|
278
|
-
|
|
354
|
+
---
|
|
279
355
|
|
|
280
|
-
|
|
281
|
-
|
|
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?:
|
|
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
|
-
|
|
377
|
+
---
|
|
298
378
|
|
|
299
|
-
Radio
|
|
379
|
+
## `Radio`
|
|
300
380
|
|
|
301
|
-
|
|
302
|
-
|
|
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?:
|
|
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
|
-
|
|
400
|
+
---
|
|
319
401
|
|
|
320
|
-
|
|
402
|
+
## `CheckboxGroup`
|
|
321
403
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
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
|
|
420
|
+
- **`CheckboxGroup.Item`** -- Individual item. Props: `value: TValue`, `disabled?: boolean`, `children?: JSX.Element`
|
|
342
421
|
|
|
343
|
-
|
|
422
|
+
---
|
|
344
423
|
|
|
345
|
-
|
|
424
|
+
## `RadioGroup`
|
|
346
425
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
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
|
|
442
|
+
- **`RadioGroup.Item`** -- Individual item. Props: `value: TValue`, `disabled?: boolean`, `children?: JSX.Element`
|
|
367
443
|
|
|
368
|
-
|
|
444
|
+
---
|
|
369
445
|
|
|
370
|
-
|
|
446
|
+
## `ColorPicker`
|
|
371
447
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
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
|
-
|
|
466
|
+
---
|
|
389
467
|
|
|
390
|
-
|
|
468
|
+
## `DateRangePicker`
|
|
391
469
|
|
|
392
|
-
|
|
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
|
-
|
|
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
|
-
|
|
488
|
+
### `DateRangePeriodType`
|
|
489
|
+
|
|
490
|
+
```typescript
|
|
491
|
+
export type DateRangePeriodType = "day" | "month" | "range";
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
---
|
|
411
495
|
|
|
412
|
-
|
|
496
|
+
## `RichTextEditor`
|
|
413
497
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
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
|
-
|
|
511
|
+
---
|
|
426
512
|
|
|
427
|
-
|
|
513
|
+
## `Numpad`
|
|
428
514
|
|
|
429
|
-
|
|
430
|
-
|
|
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;
|
|
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
|
-
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## `StatePreset`
|
|
446
536
|
|
|
447
|
-
Save
|
|
537
|
+
Save/restore named state presets to sync storage. Displays preset chips with restore, overwrite, and delete actions.
|
|
448
538
|
|
|
449
|
-
```
|
|
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
|
-
|
|
550
|
+
---
|
|
461
551
|
|
|
462
|
-
|
|
552
|
+
## `ThemeToggle`
|
|
463
553
|
|
|
464
|
-
|
|
465
|
-
|
|
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
|
-
|
|
565
|
+
---
|
|
566
|
+
|
|
567
|
+
## `Invalid`
|
|
471
568
|
|
|
472
|
-
Validation
|
|
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
|
-
```
|
|
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
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
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 |
|