@molecule/app-ui-react-native 1.0.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.
- package/LICENSE +115 -0
- package/README.md +1997 -0
- package/dist/components/Accordion.d.ts +22 -0
- package/dist/components/Accordion.d.ts.map +1 -0
- package/dist/components/Accordion.js +58 -0
- package/dist/components/Alert.d.ts +23 -0
- package/dist/components/Alert.d.ts.map +1 -0
- package/dist/components/Alert.js +25 -0
- package/dist/components/Avatar.d.ts +22 -0
- package/dist/components/Avatar.d.ts.map +1 -0
- package/dist/components/Avatar.js +38 -0
- package/dist/components/Badge.d.ts +21 -0
- package/dist/components/Badge.d.ts.map +1 -0
- package/dist/components/Badge.js +20 -0
- package/dist/components/Button.d.ts +27 -0
- package/dist/components/Button.d.ts.map +1 -0
- package/dist/components/Button.js +26 -0
- package/dist/components/Card.d.ts +77 -0
- package/dist/components/Card.d.ts.map +1 -0
- package/dist/components/Card.js +77 -0
- package/dist/components/Checkbox.d.ts +22 -0
- package/dist/components/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox.js +31 -0
- package/dist/components/Dropdown.d.ts +35 -0
- package/dist/components/Dropdown.d.ts.map +1 -0
- package/dist/components/Dropdown.js +54 -0
- package/dist/components/Form.d.ts +48 -0
- package/dist/components/Form.d.ts.map +1 -0
- package/dist/components/Form.js +46 -0
- package/dist/components/Input.d.ts +13 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +36 -0
- package/dist/components/Layout.d.ts +59 -0
- package/dist/components/Layout.d.ts.map +1 -0
- package/dist/components/Layout.js +92 -0
- package/dist/components/Modal.d.ts +22 -0
- package/dist/components/Modal.d.ts.map +1 -0
- package/dist/components/Modal.js +22 -0
- package/dist/components/Pagination.d.ts +23 -0
- package/dist/components/Pagination.d.ts.map +1 -0
- package/dist/components/Pagination.js +46 -0
- package/dist/components/Progress.d.ts +34 -0
- package/dist/components/Progress.d.ts.map +1 -0
- package/dist/components/Progress.js +29 -0
- package/dist/components/RadioGroup.d.ts +23 -0
- package/dist/components/RadioGroup.d.ts.map +1 -0
- package/dist/components/RadioGroup.js +35 -0
- package/dist/components/Select.d.ts +29 -0
- package/dist/components/Select.d.ts.map +1 -0
- package/dist/components/Select.js +52 -0
- package/dist/components/Separator.d.ts +18 -0
- package/dist/components/Separator.d.ts.map +1 -0
- package/dist/components/Separator.js +17 -0
- package/dist/components/Skeleton.d.ts +46 -0
- package/dist/components/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton.js +65 -0
- package/dist/components/Spinner.d.ts +17 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner.js +24 -0
- package/dist/components/Switch.d.ts +21 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +23 -0
- package/dist/components/Table.d.ts +29 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Table.js +46 -0
- package/dist/components/Tabs.d.ts +21 -0
- package/dist/components/Tabs.d.ts.map +1 -0
- package/dist/components/Tabs.js +34 -0
- package/dist/components/Textarea.d.ts +13 -0
- package/dist/components/Textarea.d.ts.map +1 -0
- package/dist/components/Textarea.js +21 -0
- package/dist/components/Toast.d.ts +54 -0
- package/dist/components/Toast.d.ts.map +1 -0
- package/dist/components/Toast.js +89 -0
- package/dist/components/Tooltip.d.ts +20 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/Tooltip.js +29 -0
- package/dist/components/index.d.ts +31 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +30 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,1997 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-04T00:41:31.628Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-ui-react-native
|
|
10
|
+
|
|
11
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
+
|
|
15
|
+
React Native UI components for molecule.dev.
|
|
16
|
+
|
|
17
|
+
Provides React Native implementations (View/Pressable/Text-based) of the
|
|
18
|
+
core `@molecule/app-ui` component interfaces — 30 components: Accordion,
|
|
19
|
+
Alert, Avatar, Badge, Button, Card (+ CardHeader/CardTitle/CardDescription/
|
|
20
|
+
CardContent/CardFooter), Checkbox, Container, Dropdown, Flex, Form,
|
|
21
|
+
FormField, Grid, Input, Label, Modal, Pagination, Progress, RadioGroup,
|
|
22
|
+
Select, Separator, Skeleton, Spacer, Spinner, Switch, Table, Tabs,
|
|
23
|
+
Textarea, Toast (+ ToastProvider / ToastContainer / useToast), Tooltip.
|
|
24
|
+
Prop types are re-exported from `@molecule/app-ui`. Web-only extras (Icon,
|
|
25
|
+
UserMenu, ThemeToggle, PageHeader, …) live in `@molecule/app-ui-react` and
|
|
26
|
+
are NOT available here.
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { setClassMap } from '@molecule/app-ui'
|
|
32
|
+
import { classMap } from '@molecule/app-ui-nativewind'
|
|
33
|
+
import { Button, Card, CardContent, CardTitle } from '@molecule/app-ui-react-native'
|
|
34
|
+
|
|
35
|
+
// Once at startup, before first render:
|
|
36
|
+
setClassMap(classMap)
|
|
37
|
+
|
|
38
|
+
function Greeting() {
|
|
39
|
+
return (
|
|
40
|
+
<Card>
|
|
41
|
+
<CardTitle>Hello</CardTitle>
|
|
42
|
+
<CardContent>
|
|
43
|
+
<Button color="primary" onClick={() => {}}>
|
|
44
|
+
Tap me
|
|
45
|
+
</Button>
|
|
46
|
+
</CardContent>
|
|
47
|
+
</Card>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Type
|
|
53
|
+
|
|
54
|
+
`framework`
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install @molecule/app-ui-react-native @molecule/app-i18n @molecule/app-icons @molecule/app-ui react react-native
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## API
|
|
63
|
+
|
|
64
|
+
### Interfaces
|
|
65
|
+
|
|
66
|
+
#### `AccordionProps`
|
|
67
|
+
|
|
68
|
+
Props for the Accordion component.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
interface AccordionProps<T = string> extends BaseProps {
|
|
72
|
+
/**
|
|
73
|
+
* Accordion items.
|
|
74
|
+
*/
|
|
75
|
+
items: AccordionItem<T>[]
|
|
76
|
+
/**
|
|
77
|
+
* Expanded item(s).
|
|
78
|
+
*/
|
|
79
|
+
value?: T | T[]
|
|
80
|
+
/**
|
|
81
|
+
* Default expanded item(s).
|
|
82
|
+
*/
|
|
83
|
+
defaultValue?: T | T[]
|
|
84
|
+
/**
|
|
85
|
+
* Change handler.
|
|
86
|
+
*/
|
|
87
|
+
onChange?: (value: T | T[]) => void
|
|
88
|
+
/**
|
|
89
|
+
* Whether multiple items can be expanded.
|
|
90
|
+
*/
|
|
91
|
+
multiple?: boolean
|
|
92
|
+
/**
|
|
93
|
+
* Whether items can be collapsed.
|
|
94
|
+
*/
|
|
95
|
+
collapsible?: boolean
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### `AlertProps`
|
|
100
|
+
|
|
101
|
+
Props for the Alert component.
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
interface AlertProps extends HTMLElementProps {
|
|
105
|
+
/**
|
|
106
|
+
* Alert content.
|
|
107
|
+
*/
|
|
108
|
+
children?: Children
|
|
109
|
+
/**
|
|
110
|
+
* Alert title.
|
|
111
|
+
*/
|
|
112
|
+
title?: string
|
|
113
|
+
/**
|
|
114
|
+
* Alert status/type.
|
|
115
|
+
*/
|
|
116
|
+
status?: ColorVariant
|
|
117
|
+
/**
|
|
118
|
+
* Alert variant.
|
|
119
|
+
*/
|
|
120
|
+
variant?: 'solid' | 'subtle' | 'outline' | 'left-accent'
|
|
121
|
+
/**
|
|
122
|
+
* Whether the alert is dismissible.
|
|
123
|
+
*/
|
|
124
|
+
dismissible?: boolean
|
|
125
|
+
/**
|
|
126
|
+
* Called when dismissed.
|
|
127
|
+
*/
|
|
128
|
+
onDismiss?: () => void
|
|
129
|
+
/**
|
|
130
|
+
* Icon to display.
|
|
131
|
+
*/
|
|
132
|
+
icon?: Children
|
|
133
|
+
/**
|
|
134
|
+
* Accessible label for the dismiss button.
|
|
135
|
+
* @default 'Dismiss'
|
|
136
|
+
*/
|
|
137
|
+
dismissLabel?: string
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
#### `AvatarProps`
|
|
142
|
+
|
|
143
|
+
Props for the Avatar component.
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
interface AvatarProps extends HTMLElementProps {
|
|
147
|
+
/**
|
|
148
|
+
* Image source URL.
|
|
149
|
+
*/
|
|
150
|
+
src?: string
|
|
151
|
+
/**
|
|
152
|
+
* Alt text for the image.
|
|
153
|
+
*/
|
|
154
|
+
alt?: string
|
|
155
|
+
/**
|
|
156
|
+
* Name for fallback initials.
|
|
157
|
+
*/
|
|
158
|
+
name?: string
|
|
159
|
+
/**
|
|
160
|
+
* Avatar size.
|
|
161
|
+
*/
|
|
162
|
+
size?: Size | number
|
|
163
|
+
/**
|
|
164
|
+
* Whether the avatar is rounded.
|
|
165
|
+
*/
|
|
166
|
+
rounded?: boolean
|
|
167
|
+
/**
|
|
168
|
+
* Fallback element when no image.
|
|
169
|
+
*/
|
|
170
|
+
fallback?: Children
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
#### `BadgeProps`
|
|
175
|
+
|
|
176
|
+
Props for the Badge component (status labels, counts, tags).
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
interface BadgeProps extends HTMLElementProps {
|
|
180
|
+
/**
|
|
181
|
+
* Badge content.
|
|
182
|
+
*/
|
|
183
|
+
children?: Children
|
|
184
|
+
/**
|
|
185
|
+
* Badge color.
|
|
186
|
+
*/
|
|
187
|
+
color?: ColorVariant
|
|
188
|
+
/**
|
|
189
|
+
* Badge variant.
|
|
190
|
+
*/
|
|
191
|
+
variant?: 'solid' | 'outline' | 'subtle'
|
|
192
|
+
/**
|
|
193
|
+
* Badge size.
|
|
194
|
+
*/
|
|
195
|
+
size?: Size
|
|
196
|
+
/**
|
|
197
|
+
* Whether the badge is rounded.
|
|
198
|
+
*/
|
|
199
|
+
rounded?: boolean
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
#### `BaseProps`
|
|
204
|
+
|
|
205
|
+
Base props shared by all components.
|
|
206
|
+
|
|
207
|
+
```typescript
|
|
208
|
+
interface BaseProps {
|
|
209
|
+
/**
|
|
210
|
+
* Additional CSS class name(s).
|
|
211
|
+
*/
|
|
212
|
+
className?: string
|
|
213
|
+
/**
|
|
214
|
+
* Inline styles.
|
|
215
|
+
*/
|
|
216
|
+
style?: CSSProperties
|
|
217
|
+
/**
|
|
218
|
+
* Test ID for automated testing.
|
|
219
|
+
*/
|
|
220
|
+
testId?: string
|
|
221
|
+
/**
|
|
222
|
+
* Automation ID for AI agents and E2E tests. Maps to the `data-mol-id`
|
|
223
|
+
* HTML attribute. Use `molId()` from `./automation.js` to generate
|
|
224
|
+
* semantic IDs. (Tooling only — screen readers do not expose `data-*`
|
|
225
|
+
* attributes; accessible names come from labels/`aria-*`.)
|
|
226
|
+
*/
|
|
227
|
+
automationId?: string
|
|
228
|
+
/**
|
|
229
|
+
* Whether the component is disabled.
|
|
230
|
+
*/
|
|
231
|
+
disabled?: boolean
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
#### `ButtonProps`
|
|
236
|
+
|
|
237
|
+
Props for the Button component.
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
interface ButtonProps extends ButtonElementProps {
|
|
241
|
+
/**
|
|
242
|
+
* Button content.
|
|
243
|
+
*/
|
|
244
|
+
children?: Children
|
|
245
|
+
/**
|
|
246
|
+
* Visual variant.
|
|
247
|
+
*/
|
|
248
|
+
variant?: ButtonVariant
|
|
249
|
+
/**
|
|
250
|
+
* Color scheme.
|
|
251
|
+
*/
|
|
252
|
+
color?: ColorVariant
|
|
253
|
+
/**
|
|
254
|
+
* Button size.
|
|
255
|
+
*/
|
|
256
|
+
size?: ButtonSize
|
|
257
|
+
/**
|
|
258
|
+
* Whether the button is in a loading state.
|
|
259
|
+
*/
|
|
260
|
+
loading?: boolean
|
|
261
|
+
/**
|
|
262
|
+
* Loading text to display.
|
|
263
|
+
*/
|
|
264
|
+
loadingText?: string
|
|
265
|
+
/**
|
|
266
|
+
* Whether the button takes full width.
|
|
267
|
+
*/
|
|
268
|
+
fullWidth?: boolean
|
|
269
|
+
/**
|
|
270
|
+
* Icon to display before the label.
|
|
271
|
+
*/
|
|
272
|
+
leftIcon?: Children
|
|
273
|
+
/**
|
|
274
|
+
* Icon to display after the label.
|
|
275
|
+
*/
|
|
276
|
+
rightIcon?: Children
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### `CardProps`
|
|
281
|
+
|
|
282
|
+
Props for the Card container component (elevated, outlined, or filled surface).
|
|
283
|
+
|
|
284
|
+
```typescript
|
|
285
|
+
interface CardProps extends HTMLElementProps {
|
|
286
|
+
/**
|
|
287
|
+
* Card content.
|
|
288
|
+
*/
|
|
289
|
+
children?: Children
|
|
290
|
+
/**
|
|
291
|
+
* Card variant.
|
|
292
|
+
*/
|
|
293
|
+
variant?: 'elevated' | 'outlined' | 'filled'
|
|
294
|
+
/**
|
|
295
|
+
* Whether the card is interactive (clickable).
|
|
296
|
+
*/
|
|
297
|
+
interactive?: boolean
|
|
298
|
+
/**
|
|
299
|
+
* Padding size.
|
|
300
|
+
*/
|
|
301
|
+
padding?: Size | 'none'
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
#### `CheckboxProps`
|
|
306
|
+
|
|
307
|
+
Props for the Checkbox component.
|
|
308
|
+
|
|
309
|
+
```typescript
|
|
310
|
+
interface CheckboxProps extends InputElementProps {
|
|
311
|
+
/**
|
|
312
|
+
* Checkbox label.
|
|
313
|
+
*/
|
|
314
|
+
label?: Children
|
|
315
|
+
/**
|
|
316
|
+
* Whether the checkbox is checked.
|
|
317
|
+
*/
|
|
318
|
+
checked?: boolean
|
|
319
|
+
/**
|
|
320
|
+
* Whether the checkbox is in an indeterminate state.
|
|
321
|
+
*/
|
|
322
|
+
indeterminate?: boolean
|
|
323
|
+
/**
|
|
324
|
+
* Checkbox size.
|
|
325
|
+
*/
|
|
326
|
+
size?: Size
|
|
327
|
+
/**
|
|
328
|
+
* Error message.
|
|
329
|
+
*/
|
|
330
|
+
error?: string
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
#### `DropdownProps`
|
|
335
|
+
|
|
336
|
+
Props for the Dropdown menu component.
|
|
337
|
+
|
|
338
|
+
```typescript
|
|
339
|
+
interface DropdownProps<T = string> extends BaseProps {
|
|
340
|
+
/**
|
|
341
|
+
* Dropdown trigger element.
|
|
342
|
+
*/
|
|
343
|
+
trigger: Children
|
|
344
|
+
/**
|
|
345
|
+
* Dropdown items.
|
|
346
|
+
*/
|
|
347
|
+
items: DropdownItem<T>[]
|
|
348
|
+
/**
|
|
349
|
+
* Called when an item is selected.
|
|
350
|
+
*/
|
|
351
|
+
onSelect?: (value: T) => void
|
|
352
|
+
/**
|
|
353
|
+
* Dropdown placement.
|
|
354
|
+
*/
|
|
355
|
+
placement?:
|
|
356
|
+
'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right'
|
|
357
|
+
/**
|
|
358
|
+
* Whether the dropdown is open (controlled).
|
|
359
|
+
*/
|
|
360
|
+
open?: boolean
|
|
361
|
+
/**
|
|
362
|
+
* Called when open state changes.
|
|
363
|
+
*/
|
|
364
|
+
onOpenChange?: (open: boolean) => void
|
|
365
|
+
/**
|
|
366
|
+
* Menu alignment.
|
|
367
|
+
*/
|
|
368
|
+
align?: 'start' | 'center' | 'end'
|
|
369
|
+
/**
|
|
370
|
+
* Menu width.
|
|
371
|
+
*/
|
|
372
|
+
width?: 'trigger' | 'auto' | number | string
|
|
373
|
+
}
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
#### `FormFieldProps`
|
|
377
|
+
|
|
378
|
+
Form field wrapper props.
|
|
379
|
+
|
|
380
|
+
```typescript
|
|
381
|
+
interface FormFieldProps extends HTMLElementProps {
|
|
382
|
+
/**
|
|
383
|
+
* Field content.
|
|
384
|
+
*/
|
|
385
|
+
children?: Children
|
|
386
|
+
/**
|
|
387
|
+
* Field label.
|
|
388
|
+
*/
|
|
389
|
+
label?: string
|
|
390
|
+
/**
|
|
391
|
+
* Field name.
|
|
392
|
+
*/
|
|
393
|
+
name?: string
|
|
394
|
+
/**
|
|
395
|
+
* Error message.
|
|
396
|
+
*/
|
|
397
|
+
error?: string
|
|
398
|
+
/**
|
|
399
|
+
* Hint/help text.
|
|
400
|
+
*/
|
|
401
|
+
hint?: string
|
|
402
|
+
/**
|
|
403
|
+
* Whether the field is required.
|
|
404
|
+
*/
|
|
405
|
+
required?: boolean
|
|
406
|
+
}
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
#### `FormProps`
|
|
410
|
+
|
|
411
|
+
Props for the Form component (wraps inputs with submission handling and validation).
|
|
412
|
+
|
|
413
|
+
```typescript
|
|
414
|
+
interface FormProps extends FormElementProps {
|
|
415
|
+
/**
|
|
416
|
+
* Form content.
|
|
417
|
+
*/
|
|
418
|
+
children?: Children
|
|
419
|
+
/**
|
|
420
|
+
* Submit handler with form data.
|
|
421
|
+
*/
|
|
422
|
+
onFormSubmit?: (data: Record<string, unknown>) => void | Promise<void>
|
|
423
|
+
/**
|
|
424
|
+
* Whether the form is submitting.
|
|
425
|
+
*/
|
|
426
|
+
submitting?: boolean
|
|
427
|
+
}
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
#### `InputProps`
|
|
431
|
+
|
|
432
|
+
Props for the Input component (text field, email, password, etc.).
|
|
433
|
+
|
|
434
|
+
```typescript
|
|
435
|
+
interface InputProps extends InputElementProps {
|
|
436
|
+
/**
|
|
437
|
+
* Input type.
|
|
438
|
+
*/
|
|
439
|
+
type?: InputType
|
|
440
|
+
/**
|
|
441
|
+
* Input size.
|
|
442
|
+
*/
|
|
443
|
+
size?: Size
|
|
444
|
+
/**
|
|
445
|
+
* Horizontal text alignment inside the input (see
|
|
446
|
+
* {@link InputClassOptions.align}). Defaults to the bond's own style.
|
|
447
|
+
*/
|
|
448
|
+
align?: 'left' | 'center'
|
|
449
|
+
/**
|
|
450
|
+
* Label text.
|
|
451
|
+
*/
|
|
452
|
+
label?: string
|
|
453
|
+
/**
|
|
454
|
+
* Error message.
|
|
455
|
+
*/
|
|
456
|
+
error?: string
|
|
457
|
+
/**
|
|
458
|
+
* Hint/help text.
|
|
459
|
+
*/
|
|
460
|
+
hint?: string
|
|
461
|
+
/**
|
|
462
|
+
* Element to display on the left.
|
|
463
|
+
*/
|
|
464
|
+
leftElement?: Children
|
|
465
|
+
/**
|
|
466
|
+
* Element to display on the right.
|
|
467
|
+
*/
|
|
468
|
+
rightElement?: Children
|
|
469
|
+
/**
|
|
470
|
+
* Whether to show a clear button.
|
|
471
|
+
*/
|
|
472
|
+
clearable?: boolean
|
|
473
|
+
/**
|
|
474
|
+
* Called when the clear button is clicked.
|
|
475
|
+
*/
|
|
476
|
+
onClear?: () => void
|
|
477
|
+
/**
|
|
478
|
+
* Accessible label for the clear button.
|
|
479
|
+
* @default 'Clear'
|
|
480
|
+
*/
|
|
481
|
+
clearLabel?: string
|
|
482
|
+
}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
#### `ModalProps`
|
|
486
|
+
|
|
487
|
+
Props for the Modal/Dialog component.
|
|
488
|
+
|
|
489
|
+
```typescript
|
|
490
|
+
interface ModalProps extends HTMLElementProps {
|
|
491
|
+
/**
|
|
492
|
+
* Whether the modal is open.
|
|
493
|
+
*/
|
|
494
|
+
open: boolean
|
|
495
|
+
/**
|
|
496
|
+
* Called when the modal should close.
|
|
497
|
+
*/
|
|
498
|
+
onClose: () => void
|
|
499
|
+
/**
|
|
500
|
+
* Modal title.
|
|
501
|
+
*/
|
|
502
|
+
title?: string
|
|
503
|
+
/**
|
|
504
|
+
* Modal content.
|
|
505
|
+
*/
|
|
506
|
+
children?: Children
|
|
507
|
+
/**
|
|
508
|
+
* Modal size.
|
|
509
|
+
*/
|
|
510
|
+
size?: ModalSize
|
|
511
|
+
/**
|
|
512
|
+
* Whether to show a close button.
|
|
513
|
+
*/
|
|
514
|
+
showCloseButton?: boolean
|
|
515
|
+
/**
|
|
516
|
+
* Whether clicking the overlay closes the modal.
|
|
517
|
+
*/
|
|
518
|
+
closeOnOverlayClick?: boolean
|
|
519
|
+
/**
|
|
520
|
+
* Whether pressing Escape closes the modal.
|
|
521
|
+
*/
|
|
522
|
+
closeOnEscape?: boolean
|
|
523
|
+
/**
|
|
524
|
+
* Footer content (typically action buttons).
|
|
525
|
+
*/
|
|
526
|
+
footer?: Children
|
|
527
|
+
/**
|
|
528
|
+
* Whether the modal is centered vertically.
|
|
529
|
+
*/
|
|
530
|
+
centered?: boolean
|
|
531
|
+
/**
|
|
532
|
+
* Whether to prevent body scroll when open.
|
|
533
|
+
*/
|
|
534
|
+
preventScroll?: boolean
|
|
535
|
+
/**
|
|
536
|
+
* Accessible label for the close button.
|
|
537
|
+
* @default 'Close'
|
|
538
|
+
*/
|
|
539
|
+
closeLabel?: string
|
|
540
|
+
}
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
#### `PaginationProps`
|
|
544
|
+
|
|
545
|
+
Props for the Pagination component (page navigation with current page, total, page size, and change callbacks).
|
|
546
|
+
|
|
547
|
+
```typescript
|
|
548
|
+
interface PaginationProps extends BaseProps {
|
|
549
|
+
/**
|
|
550
|
+
* Current page (1-indexed).
|
|
551
|
+
*/
|
|
552
|
+
page: number
|
|
553
|
+
/**
|
|
554
|
+
* Total number of pages.
|
|
555
|
+
*/
|
|
556
|
+
totalPages: number
|
|
557
|
+
/**
|
|
558
|
+
* Page change handler.
|
|
559
|
+
*/
|
|
560
|
+
onChange: (page: number) => void
|
|
561
|
+
/**
|
|
562
|
+
* Number of sibling pages to show.
|
|
563
|
+
*/
|
|
564
|
+
siblings?: number
|
|
565
|
+
/**
|
|
566
|
+
* Number of boundary pages to show.
|
|
567
|
+
*/
|
|
568
|
+
boundaries?: number
|
|
569
|
+
/**
|
|
570
|
+
* Pagination size.
|
|
571
|
+
*/
|
|
572
|
+
size?: Size
|
|
573
|
+
/**
|
|
574
|
+
* Whether to show first/last buttons.
|
|
575
|
+
*/
|
|
576
|
+
showFirstLast?: boolean
|
|
577
|
+
/**
|
|
578
|
+
* Whether to show previous/next buttons.
|
|
579
|
+
*/
|
|
580
|
+
showPrevNext?: boolean
|
|
581
|
+
/**
|
|
582
|
+
* Accessible labels for pagination controls.
|
|
583
|
+
*/
|
|
584
|
+
labels?: {
|
|
585
|
+
nav?: string
|
|
586
|
+
first?: string
|
|
587
|
+
previous?: string
|
|
588
|
+
next?: string
|
|
589
|
+
last?: string
|
|
590
|
+
goToPage?: (page: number) => string
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
#### `RadioGroupProps`
|
|
596
|
+
|
|
597
|
+
Props for the RadioGroup component.
|
|
598
|
+
|
|
599
|
+
```typescript
|
|
600
|
+
interface RadioGroupProps<T = string> extends BaseProps {
|
|
601
|
+
/**
|
|
602
|
+
* Radio options.
|
|
603
|
+
*/
|
|
604
|
+
options: RadioOption<T>[]
|
|
605
|
+
/**
|
|
606
|
+
* Current value.
|
|
607
|
+
*/
|
|
608
|
+
value?: T
|
|
609
|
+
/**
|
|
610
|
+
* Change handler.
|
|
611
|
+
*/
|
|
612
|
+
onChange?: (value: T) => void
|
|
613
|
+
/**
|
|
614
|
+
* Radio size.
|
|
615
|
+
*/
|
|
616
|
+
size?: Size
|
|
617
|
+
/**
|
|
618
|
+
* Group label.
|
|
619
|
+
*/
|
|
620
|
+
label?: string
|
|
621
|
+
/**
|
|
622
|
+
* Shared `name` attribute for the group's radio inputs (used for native
|
|
623
|
+
* form submission). When omitted, a unique per-instance name is generated
|
|
624
|
+
* so separate groups never merge — the visible `label` is deliberately
|
|
625
|
+
* NOT used as the name, because two groups with the same label (e.g. two
|
|
626
|
+
* "Size" pickers) would otherwise form ONE native radio group and
|
|
627
|
+
* deselect each other.
|
|
628
|
+
*/
|
|
629
|
+
name?: string
|
|
630
|
+
/**
|
|
631
|
+
* Layout direction.
|
|
632
|
+
*/
|
|
633
|
+
direction?: 'horizontal' | 'vertical'
|
|
634
|
+
/**
|
|
635
|
+
* Error message.
|
|
636
|
+
*/
|
|
637
|
+
error?: string
|
|
638
|
+
}
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
#### `SelectProps`
|
|
642
|
+
|
|
643
|
+
Props for the Select dropdown component (single or multi-select).
|
|
644
|
+
|
|
645
|
+
```typescript
|
|
646
|
+
interface SelectProps<T = string> extends SelectElementProps {
|
|
647
|
+
/**
|
|
648
|
+
* Select options.
|
|
649
|
+
*/
|
|
650
|
+
options: SelectOption<T>[]
|
|
651
|
+
/**
|
|
652
|
+
* Current value.
|
|
653
|
+
*/
|
|
654
|
+
value?: T
|
|
655
|
+
/**
|
|
656
|
+
* Change handler (with typed value).
|
|
657
|
+
*/
|
|
658
|
+
onValueChange?: (value: T) => void
|
|
659
|
+
/**
|
|
660
|
+
* Select size.
|
|
661
|
+
*/
|
|
662
|
+
size?: Size
|
|
663
|
+
/**
|
|
664
|
+
* Label text.
|
|
665
|
+
*/
|
|
666
|
+
label?: string
|
|
667
|
+
/**
|
|
668
|
+
* Placeholder text.
|
|
669
|
+
*/
|
|
670
|
+
placeholder?: string
|
|
671
|
+
/**
|
|
672
|
+
* Error message.
|
|
673
|
+
*/
|
|
674
|
+
error?: string
|
|
675
|
+
/**
|
|
676
|
+
* Hint/help text.
|
|
677
|
+
*/
|
|
678
|
+
hint?: string
|
|
679
|
+
/**
|
|
680
|
+
* Whether to allow clearing the selection.
|
|
681
|
+
*/
|
|
682
|
+
clearable?: boolean
|
|
683
|
+
}
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
#### `SkeletonProps`
|
|
687
|
+
|
|
688
|
+
Props for the Skeleton loading placeholder component.
|
|
689
|
+
|
|
690
|
+
```typescript
|
|
691
|
+
interface SkeletonProps extends BaseProps {
|
|
692
|
+
/**
|
|
693
|
+
* Skeleton width.
|
|
694
|
+
*/
|
|
695
|
+
width?: string | number
|
|
696
|
+
/**
|
|
697
|
+
* Skeleton height.
|
|
698
|
+
*/
|
|
699
|
+
height?: string | number
|
|
700
|
+
/**
|
|
701
|
+
* Whether the skeleton is circular.
|
|
702
|
+
*/
|
|
703
|
+
circle?: boolean
|
|
704
|
+
/**
|
|
705
|
+
* Border radius.
|
|
706
|
+
*/
|
|
707
|
+
borderRadius?: string | number
|
|
708
|
+
/**
|
|
709
|
+
* Animation type.
|
|
710
|
+
*/
|
|
711
|
+
animation?: 'pulse' | 'wave' | 'none'
|
|
712
|
+
}
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
#### `SpinnerProps`
|
|
716
|
+
|
|
717
|
+
Props for the Spinner/loading indicator component.
|
|
718
|
+
|
|
719
|
+
```typescript
|
|
720
|
+
interface SpinnerProps extends BaseProps {
|
|
721
|
+
/**
|
|
722
|
+
* Spinner size.
|
|
723
|
+
*/
|
|
724
|
+
size?: Size
|
|
725
|
+
/**
|
|
726
|
+
* Spinner color.
|
|
727
|
+
*/
|
|
728
|
+
color?: ColorVariant | string
|
|
729
|
+
/**
|
|
730
|
+
* Loading label (for accessibility).
|
|
731
|
+
*/
|
|
732
|
+
label?: string
|
|
733
|
+
/**
|
|
734
|
+
* Spinner thickness.
|
|
735
|
+
*/
|
|
736
|
+
thickness?: number
|
|
737
|
+
}
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
#### `SwitchProps`
|
|
741
|
+
|
|
742
|
+
Props for the Switch/Toggle component.
|
|
743
|
+
|
|
744
|
+
```typescript
|
|
745
|
+
interface SwitchProps extends InputElementProps {
|
|
746
|
+
/**
|
|
747
|
+
* Switch label.
|
|
748
|
+
*/
|
|
749
|
+
label?: Children
|
|
750
|
+
/**
|
|
751
|
+
* Whether the switch is on.
|
|
752
|
+
*/
|
|
753
|
+
checked?: boolean
|
|
754
|
+
/**
|
|
755
|
+
* Switch size.
|
|
756
|
+
*/
|
|
757
|
+
size?: Size
|
|
758
|
+
/**
|
|
759
|
+
* Color when on.
|
|
760
|
+
*/
|
|
761
|
+
color?: ColorVariant
|
|
762
|
+
}
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
#### `TableProps`
|
|
766
|
+
|
|
767
|
+
Props for the Table component.
|
|
768
|
+
|
|
769
|
+
```typescript
|
|
770
|
+
interface TableProps<T> extends HTMLElementProps {
|
|
771
|
+
/**
|
|
772
|
+
* Table data.
|
|
773
|
+
*/
|
|
774
|
+
data: T[]
|
|
775
|
+
/**
|
|
776
|
+
* Column definitions.
|
|
777
|
+
*/
|
|
778
|
+
columns: TableColumn<T>[]
|
|
779
|
+
/**
|
|
780
|
+
* Row key extractor.
|
|
781
|
+
*/
|
|
782
|
+
rowKey?: keyof T | ((row: T) => string | number)
|
|
783
|
+
/**
|
|
784
|
+
* Whether to show borders.
|
|
785
|
+
*/
|
|
786
|
+
bordered?: boolean
|
|
787
|
+
/**
|
|
788
|
+
* Whether rows are striped.
|
|
789
|
+
*/
|
|
790
|
+
striped?: boolean
|
|
791
|
+
/**
|
|
792
|
+
* Whether rows are hoverable.
|
|
793
|
+
*/
|
|
794
|
+
hoverable?: boolean
|
|
795
|
+
/**
|
|
796
|
+
* Table size.
|
|
797
|
+
*/
|
|
798
|
+
size?: Size
|
|
799
|
+
/**
|
|
800
|
+
* Empty state content.
|
|
801
|
+
*/
|
|
802
|
+
emptyContent?: Children
|
|
803
|
+
/**
|
|
804
|
+
* Loading state.
|
|
805
|
+
*/
|
|
806
|
+
loading?: boolean
|
|
807
|
+
/**
|
|
808
|
+
* Sort configuration.
|
|
809
|
+
*/
|
|
810
|
+
sort?: {
|
|
811
|
+
key: string
|
|
812
|
+
direction: 'asc' | 'desc'
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Sort change handler.
|
|
816
|
+
*/
|
|
817
|
+
onSort?: (key: string, direction: 'asc' | 'desc') => void
|
|
818
|
+
/**
|
|
819
|
+
* Row click handler.
|
|
820
|
+
*/
|
|
821
|
+
onRowClick?: (row: T, index: number) => void
|
|
822
|
+
}
|
|
823
|
+
```
|
|
824
|
+
|
|
825
|
+
#### `TabsProps`
|
|
826
|
+
|
|
827
|
+
Props for the Tabs component (switchable tabbed content panels).
|
|
828
|
+
|
|
829
|
+
```typescript
|
|
830
|
+
interface TabsProps<T = string> extends BaseProps {
|
|
831
|
+
/**
|
|
832
|
+
* Tab items.
|
|
833
|
+
*/
|
|
834
|
+
items: TabItem<T>[]
|
|
835
|
+
/**
|
|
836
|
+
* Current active tab.
|
|
837
|
+
*/
|
|
838
|
+
value?: T
|
|
839
|
+
/**
|
|
840
|
+
* Default active tab.
|
|
841
|
+
*/
|
|
842
|
+
defaultValue?: T
|
|
843
|
+
/**
|
|
844
|
+
* Change handler.
|
|
845
|
+
*/
|
|
846
|
+
onChange?: (value: T) => void
|
|
847
|
+
/**
|
|
848
|
+
* Tab variant.
|
|
849
|
+
*/
|
|
850
|
+
variant?: 'line' | 'enclosed' | 'soft-rounded' | 'solid-rounded'
|
|
851
|
+
/**
|
|
852
|
+
* Tab size.
|
|
853
|
+
*/
|
|
854
|
+
size?: Size
|
|
855
|
+
/**
|
|
856
|
+
* Whether tabs are fitted (take full width).
|
|
857
|
+
*/
|
|
858
|
+
fitted?: boolean
|
|
859
|
+
}
|
|
860
|
+
```
|
|
861
|
+
|
|
862
|
+
#### `TextareaProps`
|
|
863
|
+
|
|
864
|
+
Props for the Textarea component.
|
|
865
|
+
|
|
866
|
+
```typescript
|
|
867
|
+
interface TextareaProps extends TextareaElementProps {
|
|
868
|
+
/**
|
|
869
|
+
* Text size tier (see {@link TextareaClassOptions.size}) — pass the same
|
|
870
|
+
* `size` as a neighboring Input for identical font sizes.
|
|
871
|
+
*/
|
|
872
|
+
size?: Size
|
|
873
|
+
/**
|
|
874
|
+
* Label text.
|
|
875
|
+
*/
|
|
876
|
+
label?: string
|
|
877
|
+
/**
|
|
878
|
+
* Error message.
|
|
879
|
+
*/
|
|
880
|
+
error?: string
|
|
881
|
+
/**
|
|
882
|
+
* Hint/help text.
|
|
883
|
+
*/
|
|
884
|
+
hint?: string
|
|
885
|
+
/**
|
|
886
|
+
* Whether the textarea auto-resizes.
|
|
887
|
+
*/
|
|
888
|
+
autoResize?: boolean
|
|
889
|
+
/**
|
|
890
|
+
* Minimum number of rows.
|
|
891
|
+
*/
|
|
892
|
+
minRows?: number
|
|
893
|
+
/**
|
|
894
|
+
* Maximum number of rows.
|
|
895
|
+
*/
|
|
896
|
+
maxRows?: number
|
|
897
|
+
}
|
|
898
|
+
```
|
|
899
|
+
|
|
900
|
+
#### `ToastProps`
|
|
901
|
+
|
|
902
|
+
Props for the Toast/notification component.
|
|
903
|
+
|
|
904
|
+
```typescript
|
|
905
|
+
interface ToastProps extends HTMLElementProps {
|
|
906
|
+
/**
|
|
907
|
+
* Toast content.
|
|
908
|
+
*/
|
|
909
|
+
children?: Children
|
|
910
|
+
/**
|
|
911
|
+
* Toast title.
|
|
912
|
+
*/
|
|
913
|
+
title?: string
|
|
914
|
+
/**
|
|
915
|
+
* Toast description.
|
|
916
|
+
*/
|
|
917
|
+
description?: string
|
|
918
|
+
/**
|
|
919
|
+
* Toast status/type.
|
|
920
|
+
*/
|
|
921
|
+
status?: ColorVariant
|
|
922
|
+
/**
|
|
923
|
+
* Duration in milliseconds (0 for persistent).
|
|
924
|
+
*/
|
|
925
|
+
duration?: number
|
|
926
|
+
/**
|
|
927
|
+
* Whether the toast is dismissible.
|
|
928
|
+
*/
|
|
929
|
+
dismissible?: boolean
|
|
930
|
+
/**
|
|
931
|
+
* Called when dismissed.
|
|
932
|
+
*/
|
|
933
|
+
onDismiss?: () => void
|
|
934
|
+
/**
|
|
935
|
+
* Toast position.
|
|
936
|
+
*/
|
|
937
|
+
position?: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
|
|
938
|
+
/**
|
|
939
|
+
* Accessible label for the close button.
|
|
940
|
+
* @default 'Close'
|
|
941
|
+
*/
|
|
942
|
+
closeLabel?: string
|
|
943
|
+
}
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
#### `TooltipProps`
|
|
947
|
+
|
|
948
|
+
Props for the Tooltip component (hover/focus popover with informational text).
|
|
949
|
+
|
|
950
|
+
```typescript
|
|
951
|
+
interface TooltipProps extends HTMLElementProps {
|
|
952
|
+
/**
|
|
953
|
+
* Tooltip content.
|
|
954
|
+
*/
|
|
955
|
+
content: Children
|
|
956
|
+
/**
|
|
957
|
+
* Element that triggers the tooltip.
|
|
958
|
+
*/
|
|
959
|
+
children: Children
|
|
960
|
+
/**
|
|
961
|
+
* Tooltip placement.
|
|
962
|
+
*/
|
|
963
|
+
placement?: TooltipPlacement
|
|
964
|
+
/**
|
|
965
|
+
* Delay before showing (ms).
|
|
966
|
+
*/
|
|
967
|
+
delay?: number
|
|
968
|
+
/**
|
|
969
|
+
* Whether the tooltip has an arrow.
|
|
970
|
+
*/
|
|
971
|
+
hasArrow?: boolean
|
|
972
|
+
}
|
|
973
|
+
```
|
|
974
|
+
|
|
975
|
+
### Functions
|
|
976
|
+
|
|
977
|
+
#### `Accordion(props)`
|
|
978
|
+
|
|
979
|
+
Renders an Accordion component.
|
|
980
|
+
|
|
981
|
+
```typescript
|
|
982
|
+
function Accordion({
|
|
983
|
+
items = [],
|
|
984
|
+
multiple = false,
|
|
985
|
+
defaultValue,
|
|
986
|
+
value: controlledValue,
|
|
987
|
+
onChange,
|
|
988
|
+
collapsible = true,
|
|
989
|
+
className,
|
|
990
|
+
testId,
|
|
991
|
+
}: AccordionProps<string>): React.JSX.Element
|
|
992
|
+
```
|
|
993
|
+
|
|
994
|
+
- `props` — Component props.
|
|
995
|
+
- `props.items` — Accordion items array.
|
|
996
|
+
- `props.multiple` — Whether multiple items can be open.
|
|
997
|
+
- `props.defaultValue` — Initial open value.
|
|
998
|
+
- `props.value` — Controlled open value.
|
|
999
|
+
- `props.onChange` — Change handler.
|
|
1000
|
+
- `props.collapsible` — Whether items collapse.
|
|
1001
|
+
- `props.className` — CSS class name override.
|
|
1002
|
+
- `props.testId` — Test identifier.
|
|
1003
|
+
|
|
1004
|
+
**Returns:** The rendered Accordion element.
|
|
1005
|
+
|
|
1006
|
+
#### `Alert(props)`
|
|
1007
|
+
|
|
1008
|
+
Renders an Alert component.
|
|
1009
|
+
|
|
1010
|
+
```typescript
|
|
1011
|
+
function Alert({
|
|
1012
|
+
children,
|
|
1013
|
+
title,
|
|
1014
|
+
variant: _variant = 'subtle',
|
|
1015
|
+
status,
|
|
1016
|
+
icon,
|
|
1017
|
+
dismissible,
|
|
1018
|
+
onDismiss,
|
|
1019
|
+
className,
|
|
1020
|
+
testId,
|
|
1021
|
+
}: AlertProps): React.JSX.Element
|
|
1022
|
+
```
|
|
1023
|
+
|
|
1024
|
+
- `props` — Component props.
|
|
1025
|
+
- `props.children` — Alert body content.
|
|
1026
|
+
- `props.title` — Alert title text.
|
|
1027
|
+
- `props.variant` — Visual variant.
|
|
1028
|
+
- `props.status` — Status type.
|
|
1029
|
+
- `props.icon` — Leading icon element.
|
|
1030
|
+
- `props.dismissible` — Whether dismissible.
|
|
1031
|
+
- `props.onDismiss` — Dismiss handler.
|
|
1032
|
+
- `props.className` — CSS class name override.
|
|
1033
|
+
- `props.testId` — Test identifier.
|
|
1034
|
+
|
|
1035
|
+
**Returns:** The rendered Alert element.
|
|
1036
|
+
|
|
1037
|
+
#### `Avatar(props)`
|
|
1038
|
+
|
|
1039
|
+
Renders an Avatar component.
|
|
1040
|
+
|
|
1041
|
+
```typescript
|
|
1042
|
+
function Avatar({
|
|
1043
|
+
src,
|
|
1044
|
+
alt,
|
|
1045
|
+
name,
|
|
1046
|
+
fallback,
|
|
1047
|
+
size = 'md',
|
|
1048
|
+
rounded = true,
|
|
1049
|
+
className,
|
|
1050
|
+
testId,
|
|
1051
|
+
}: AvatarProps): React.JSX.Element
|
|
1052
|
+
```
|
|
1053
|
+
|
|
1054
|
+
- `props` — Component props.
|
|
1055
|
+
- `props.src` — Image source URL.
|
|
1056
|
+
- `props.alt` — Alt text for image.
|
|
1057
|
+
- `props.name` — Display name for initials.
|
|
1058
|
+
- `props.fallback` — Fallback element when image unavailable.
|
|
1059
|
+
- `props.size` — Avatar size.
|
|
1060
|
+
- `props.rounded` — Whether rounded (circular).
|
|
1061
|
+
- `props.className` — CSS class name override.
|
|
1062
|
+
- `props.testId` — Test identifier.
|
|
1063
|
+
|
|
1064
|
+
**Returns:** The rendered Avatar element.
|
|
1065
|
+
|
|
1066
|
+
#### `Badge(props)`
|
|
1067
|
+
|
|
1068
|
+
Renders a Badge component.
|
|
1069
|
+
|
|
1070
|
+
```typescript
|
|
1071
|
+
function Badge({
|
|
1072
|
+
children,
|
|
1073
|
+
color = 'primary',
|
|
1074
|
+
variant: _variant = 'solid',
|
|
1075
|
+
size = 'md',
|
|
1076
|
+
rounded = true,
|
|
1077
|
+
className,
|
|
1078
|
+
testId,
|
|
1079
|
+
}: BadgeProps): React.JSX.Element
|
|
1080
|
+
```
|
|
1081
|
+
|
|
1082
|
+
- `props` — Component props.
|
|
1083
|
+
- `props.children` — Badge content.
|
|
1084
|
+
- `props.color` — Badge color.
|
|
1085
|
+
- `props.variant` — Visual variant style.
|
|
1086
|
+
- `props.size` — Badge size.
|
|
1087
|
+
- `props.rounded` — Whether rounded.
|
|
1088
|
+
- `props.className` — CSS class name override.
|
|
1089
|
+
- `props.testId` — Test identifier.
|
|
1090
|
+
|
|
1091
|
+
**Returns:** The rendered Badge element.
|
|
1092
|
+
|
|
1093
|
+
#### `Button(props)`
|
|
1094
|
+
|
|
1095
|
+
Renders a Button component.
|
|
1096
|
+
|
|
1097
|
+
```typescript
|
|
1098
|
+
function Button({
|
|
1099
|
+
children,
|
|
1100
|
+
variant = 'solid',
|
|
1101
|
+
color = 'primary',
|
|
1102
|
+
size = 'md',
|
|
1103
|
+
loading = false,
|
|
1104
|
+
loadingText,
|
|
1105
|
+
fullWidth = false,
|
|
1106
|
+
leftIcon,
|
|
1107
|
+
rightIcon,
|
|
1108
|
+
className,
|
|
1109
|
+
testId,
|
|
1110
|
+
disabled,
|
|
1111
|
+
onClick,
|
|
1112
|
+
}: ButtonProps): React.JSX.Element
|
|
1113
|
+
```
|
|
1114
|
+
|
|
1115
|
+
- `props` — Component props.
|
|
1116
|
+
- `props.children` — Button content.
|
|
1117
|
+
- `props.variant` — Visual variant.
|
|
1118
|
+
- `props.color` — Color theme.
|
|
1119
|
+
- `props.size` — Button size.
|
|
1120
|
+
- `props.loading` — Whether loading.
|
|
1121
|
+
- `props.loadingText` — Text while loading.
|
|
1122
|
+
- `props.fullWidth` — Whether full width.
|
|
1123
|
+
- `props.leftIcon` — Left icon element.
|
|
1124
|
+
- `props.rightIcon` — Right icon element.
|
|
1125
|
+
- `props.className` — CSS class name override.
|
|
1126
|
+
- `props.testId` — Test identifier.
|
|
1127
|
+
- `props.disabled` — Whether disabled.
|
|
1128
|
+
- `props.onClick` — Click handler.
|
|
1129
|
+
|
|
1130
|
+
**Returns:** The rendered Button element.
|
|
1131
|
+
|
|
1132
|
+
#### `Card(props)`
|
|
1133
|
+
|
|
1134
|
+
Renders a Card component.
|
|
1135
|
+
|
|
1136
|
+
```typescript
|
|
1137
|
+
function Card({
|
|
1138
|
+
children,
|
|
1139
|
+
variant = 'elevated',
|
|
1140
|
+
padding = 'md',
|
|
1141
|
+
interactive,
|
|
1142
|
+
className,
|
|
1143
|
+
style,
|
|
1144
|
+
testId,
|
|
1145
|
+
onClick,
|
|
1146
|
+
}: CardProps): React.JSX.Element
|
|
1147
|
+
```
|
|
1148
|
+
|
|
1149
|
+
- `props` — Component props.
|
|
1150
|
+
- `props.children` — Card content.
|
|
1151
|
+
- `props.variant` — Visual variant.
|
|
1152
|
+
- `props.padding` — Padding size.
|
|
1153
|
+
- `props.interactive` — Whether interactive.
|
|
1154
|
+
- `props.className` — CSS class name override.
|
|
1155
|
+
- `props.style` — Inline style object.
|
|
1156
|
+
- `props.testId` — Test identifier.
|
|
1157
|
+
- `props.onClick` — Click handler.
|
|
1158
|
+
|
|
1159
|
+
**Returns:** The rendered Card element.
|
|
1160
|
+
|
|
1161
|
+
#### `CardContent(props)`
|
|
1162
|
+
|
|
1163
|
+
Renders a CardContent component.
|
|
1164
|
+
|
|
1165
|
+
```typescript
|
|
1166
|
+
function CardContent({
|
|
1167
|
+
children,
|
|
1168
|
+
className,
|
|
1169
|
+
}: {
|
|
1170
|
+
children: unknown
|
|
1171
|
+
className?: string
|
|
1172
|
+
}): React.JSX.Element
|
|
1173
|
+
```
|
|
1174
|
+
|
|
1175
|
+
- `props` — Component props.
|
|
1176
|
+
- `props.children` — Body content.
|
|
1177
|
+
- `props.className` — CSS class name override.
|
|
1178
|
+
|
|
1179
|
+
**Returns:** The rendered CardContent element.
|
|
1180
|
+
|
|
1181
|
+
#### `CardDescription(props)`
|
|
1182
|
+
|
|
1183
|
+
Renders a CardDescription component.
|
|
1184
|
+
|
|
1185
|
+
```typescript
|
|
1186
|
+
function CardDescription({
|
|
1187
|
+
children,
|
|
1188
|
+
className,
|
|
1189
|
+
}: {
|
|
1190
|
+
children: unknown
|
|
1191
|
+
className?: string
|
|
1192
|
+
}): React.JSX.Element
|
|
1193
|
+
```
|
|
1194
|
+
|
|
1195
|
+
- `props` — Component props.
|
|
1196
|
+
- `props.children` — Description content.
|
|
1197
|
+
- `props.className` — CSS class name override.
|
|
1198
|
+
|
|
1199
|
+
**Returns:** The rendered CardDescription element.
|
|
1200
|
+
|
|
1201
|
+
#### `CardFooter(props)`
|
|
1202
|
+
|
|
1203
|
+
Renders a CardFooter component.
|
|
1204
|
+
|
|
1205
|
+
```typescript
|
|
1206
|
+
function CardFooter({
|
|
1207
|
+
children,
|
|
1208
|
+
className,
|
|
1209
|
+
}: {
|
|
1210
|
+
children: unknown
|
|
1211
|
+
className?: string
|
|
1212
|
+
}): React.JSX.Element
|
|
1213
|
+
```
|
|
1214
|
+
|
|
1215
|
+
- `props` — Component props.
|
|
1216
|
+
- `props.children` — Footer content.
|
|
1217
|
+
- `props.className` — CSS class name override.
|
|
1218
|
+
|
|
1219
|
+
**Returns:** The rendered CardFooter element.
|
|
1220
|
+
|
|
1221
|
+
#### `CardHeader(props)`
|
|
1222
|
+
|
|
1223
|
+
Renders a CardHeader component.
|
|
1224
|
+
|
|
1225
|
+
```typescript
|
|
1226
|
+
function CardHeader({
|
|
1227
|
+
children,
|
|
1228
|
+
className,
|
|
1229
|
+
}: {
|
|
1230
|
+
children: unknown
|
|
1231
|
+
className?: string
|
|
1232
|
+
}): React.JSX.Element
|
|
1233
|
+
```
|
|
1234
|
+
|
|
1235
|
+
- `props` — Component props.
|
|
1236
|
+
- `props.children` — Header content.
|
|
1237
|
+
- `props.className` — CSS class name override.
|
|
1238
|
+
|
|
1239
|
+
**Returns:** The rendered CardHeader element.
|
|
1240
|
+
|
|
1241
|
+
#### `CardTitle(props)`
|
|
1242
|
+
|
|
1243
|
+
Renders a CardTitle component.
|
|
1244
|
+
|
|
1245
|
+
```typescript
|
|
1246
|
+
function CardTitle({
|
|
1247
|
+
children,
|
|
1248
|
+
className,
|
|
1249
|
+
}: {
|
|
1250
|
+
children: unknown
|
|
1251
|
+
className?: string
|
|
1252
|
+
}): React.JSX.Element
|
|
1253
|
+
```
|
|
1254
|
+
|
|
1255
|
+
- `props` — Component props.
|
|
1256
|
+
- `props.children` — Title content.
|
|
1257
|
+
- `props.className` — CSS class name override.
|
|
1258
|
+
|
|
1259
|
+
**Returns:** The rendered CardTitle element.
|
|
1260
|
+
|
|
1261
|
+
#### `Checkbox(props)`
|
|
1262
|
+
|
|
1263
|
+
Renders a Checkbox component.
|
|
1264
|
+
|
|
1265
|
+
```typescript
|
|
1266
|
+
function Checkbox({
|
|
1267
|
+
label,
|
|
1268
|
+
checked,
|
|
1269
|
+
indeterminate,
|
|
1270
|
+
onChange,
|
|
1271
|
+
error,
|
|
1272
|
+
disabled,
|
|
1273
|
+
className,
|
|
1274
|
+
testId,
|
|
1275
|
+
}: CheckboxProps): React.JSX.Element
|
|
1276
|
+
```
|
|
1277
|
+
|
|
1278
|
+
- `props` — Component props.
|
|
1279
|
+
- `props.label` — Checkbox label text.
|
|
1280
|
+
- `props.checked` — Whether checked.
|
|
1281
|
+
- `props.indeterminate` — Whether indeterminate.
|
|
1282
|
+
- `props.onChange` — Change handler.
|
|
1283
|
+
- `props.error` — Error message.
|
|
1284
|
+
- `props.disabled` — Whether disabled.
|
|
1285
|
+
- `props.className` — CSS class name override.
|
|
1286
|
+
- `props.testId` — Test identifier.
|
|
1287
|
+
|
|
1288
|
+
**Returns:** The rendered Checkbox element.
|
|
1289
|
+
|
|
1290
|
+
#### `Container(props)`
|
|
1291
|
+
|
|
1292
|
+
Renders a Container component.
|
|
1293
|
+
|
|
1294
|
+
```typescript
|
|
1295
|
+
function Container({
|
|
1296
|
+
children,
|
|
1297
|
+
maxWidth = 'lg',
|
|
1298
|
+
centered = true,
|
|
1299
|
+
className,
|
|
1300
|
+
style,
|
|
1301
|
+
testId,
|
|
1302
|
+
}: ContainerProps): React.JSX.Element
|
|
1303
|
+
```
|
|
1304
|
+
|
|
1305
|
+
- `props` — Component props.
|
|
1306
|
+
- `props.children` — Container content.
|
|
1307
|
+
- `props.maxWidth` — Maximum width constraint.
|
|
1308
|
+
- `props.centered` — Whether centered.
|
|
1309
|
+
- `props.className` — CSS class name override.
|
|
1310
|
+
- `props.style` — Inline style object.
|
|
1311
|
+
- `props.testId` — Test identifier.
|
|
1312
|
+
|
|
1313
|
+
**Returns:** The rendered Container element.
|
|
1314
|
+
|
|
1315
|
+
#### `Dropdown(props)`
|
|
1316
|
+
|
|
1317
|
+
Renders a Dropdown component.
|
|
1318
|
+
|
|
1319
|
+
```typescript
|
|
1320
|
+
function Dropdown({
|
|
1321
|
+
trigger,
|
|
1322
|
+
items = [],
|
|
1323
|
+
onSelect,
|
|
1324
|
+
className,
|
|
1325
|
+
testId,
|
|
1326
|
+
}: DropdownProps<string>): React.JSX.Element
|
|
1327
|
+
```
|
|
1328
|
+
|
|
1329
|
+
- `props` — Component props.
|
|
1330
|
+
- `props.trigger` — Trigger element.
|
|
1331
|
+
- `props.items` — Menu items array.
|
|
1332
|
+
- `props.onSelect` — Item selection handler.
|
|
1333
|
+
- `props.className` — CSS class name override.
|
|
1334
|
+
- `props.testId` — Test identifier.
|
|
1335
|
+
|
|
1336
|
+
**Returns:** The rendered Dropdown element.
|
|
1337
|
+
|
|
1338
|
+
#### `DropdownLabel(props)`
|
|
1339
|
+
|
|
1340
|
+
Renders a DropdownLabel component.
|
|
1341
|
+
|
|
1342
|
+
```typescript
|
|
1343
|
+
function DropdownLabel({ children }: { children: unknown }): React.JSX.Element
|
|
1344
|
+
```
|
|
1345
|
+
|
|
1346
|
+
- `props` — Component props.
|
|
1347
|
+
- `props.children` — Label content.
|
|
1348
|
+
|
|
1349
|
+
**Returns:** The rendered DropdownLabel element.
|
|
1350
|
+
|
|
1351
|
+
#### `DropdownSeparator()`
|
|
1352
|
+
|
|
1353
|
+
Renders a DropdownSeparator component.
|
|
1354
|
+
|
|
1355
|
+
```typescript
|
|
1356
|
+
function DropdownSeparator(): React.JSX.Element
|
|
1357
|
+
```
|
|
1358
|
+
|
|
1359
|
+
**Returns:** The rendered DropdownSeparator element.
|
|
1360
|
+
|
|
1361
|
+
#### `Flex(props)`
|
|
1362
|
+
|
|
1363
|
+
Renders a Flex component.
|
|
1364
|
+
|
|
1365
|
+
```typescript
|
|
1366
|
+
function Flex({
|
|
1367
|
+
children,
|
|
1368
|
+
direction = 'row',
|
|
1369
|
+
justify,
|
|
1370
|
+
align,
|
|
1371
|
+
wrap,
|
|
1372
|
+
gap,
|
|
1373
|
+
className,
|
|
1374
|
+
style,
|
|
1375
|
+
testId,
|
|
1376
|
+
onClick,
|
|
1377
|
+
}: FlexProps): React.JSX.Element
|
|
1378
|
+
```
|
|
1379
|
+
|
|
1380
|
+
- `props` — Component props.
|
|
1381
|
+
- `props.children` — Flex content.
|
|
1382
|
+
- `props.direction` — Flex direction.
|
|
1383
|
+
- `props.justify` — Justify content.
|
|
1384
|
+
- `props.align` — Align items.
|
|
1385
|
+
- `props.wrap` — Flex wrap behavior.
|
|
1386
|
+
- `props.gap` — Gap between items.
|
|
1387
|
+
- `props.className` — CSS class name override.
|
|
1388
|
+
- `props.style` — Inline style object.
|
|
1389
|
+
- `props.testId` — Test identifier.
|
|
1390
|
+
- `props.onClick` — Click handler.
|
|
1391
|
+
|
|
1392
|
+
**Returns:** The rendered Flex element.
|
|
1393
|
+
|
|
1394
|
+
#### `Form(props)`
|
|
1395
|
+
|
|
1396
|
+
Renders a Form component.
|
|
1397
|
+
|
|
1398
|
+
In React Native there is no `<form>` element. This is a View wrapper
|
|
1399
|
+
that provides consistent spacing.
|
|
1400
|
+
|
|
1401
|
+
```typescript
|
|
1402
|
+
function Form({ children, onSubmit: _onSubmit, className, testId }: FormProps): React.JSX.Element
|
|
1403
|
+
```
|
|
1404
|
+
|
|
1405
|
+
- `props` — Component props.
|
|
1406
|
+
- `props.children` — Form content.
|
|
1407
|
+
- `props.onSubmit` — Submit handler (unused in RN).
|
|
1408
|
+
- `props.className` — CSS class name override.
|
|
1409
|
+
- `props.testId` — Test identifier.
|
|
1410
|
+
|
|
1411
|
+
**Returns:** The rendered Form element.
|
|
1412
|
+
|
|
1413
|
+
#### `FormField(props)`
|
|
1414
|
+
|
|
1415
|
+
Renders a FormField component.
|
|
1416
|
+
|
|
1417
|
+
```typescript
|
|
1418
|
+
function FormField({
|
|
1419
|
+
children,
|
|
1420
|
+
label,
|
|
1421
|
+
error,
|
|
1422
|
+
hint,
|
|
1423
|
+
required,
|
|
1424
|
+
className,
|
|
1425
|
+
}: FormFieldProps): React.JSX.Element
|
|
1426
|
+
```
|
|
1427
|
+
|
|
1428
|
+
- `props` — Component props.
|
|
1429
|
+
- `props.children` — Field input content.
|
|
1430
|
+
- `props.label` — Field label text.
|
|
1431
|
+
- `props.error` — Error message.
|
|
1432
|
+
- `props.hint` — Hint text.
|
|
1433
|
+
- `props.required` — Whether required.
|
|
1434
|
+
- `props.className` — CSS class name override.
|
|
1435
|
+
|
|
1436
|
+
**Returns:** The rendered FormField element.
|
|
1437
|
+
|
|
1438
|
+
#### `Grid(props)`
|
|
1439
|
+
|
|
1440
|
+
Renders a Grid component.
|
|
1441
|
+
|
|
1442
|
+
```typescript
|
|
1443
|
+
function Grid({ children, columns, gap, className, style, testId }: GridProps): React.JSX.Element
|
|
1444
|
+
```
|
|
1445
|
+
|
|
1446
|
+
- `props` — Component props.
|
|
1447
|
+
- `props.children` — Grid content.
|
|
1448
|
+
- `props.columns` — Number of columns.
|
|
1449
|
+
- `props.gap` — Gap between items.
|
|
1450
|
+
- `props.className` — CSS class name override.
|
|
1451
|
+
- `props.style` — Inline style object.
|
|
1452
|
+
- `props.testId` — Test identifier.
|
|
1453
|
+
|
|
1454
|
+
**Returns:** The rendered Grid element.
|
|
1455
|
+
|
|
1456
|
+
#### `Label(props)`
|
|
1457
|
+
|
|
1458
|
+
Renders a Label component.
|
|
1459
|
+
|
|
1460
|
+
```typescript
|
|
1461
|
+
function Label({ children, required, className }: LabelProps): React.JSX.Element
|
|
1462
|
+
```
|
|
1463
|
+
|
|
1464
|
+
- `props` — Component props.
|
|
1465
|
+
- `props.children` — Label content.
|
|
1466
|
+
- `props.required` — Whether required.
|
|
1467
|
+
- `props.className` — CSS class name override.
|
|
1468
|
+
|
|
1469
|
+
**Returns:** The rendered Label element.
|
|
1470
|
+
|
|
1471
|
+
#### `Modal(props)`
|
|
1472
|
+
|
|
1473
|
+
Renders a Modal component.
|
|
1474
|
+
|
|
1475
|
+
```typescript
|
|
1476
|
+
function Modal({
|
|
1477
|
+
children,
|
|
1478
|
+
open,
|
|
1479
|
+
onClose,
|
|
1480
|
+
title,
|
|
1481
|
+
size = 'md',
|
|
1482
|
+
footer,
|
|
1483
|
+
className,
|
|
1484
|
+
testId,
|
|
1485
|
+
}: ModalProps): React.JSX.Element
|
|
1486
|
+
```
|
|
1487
|
+
|
|
1488
|
+
- `props` — Component props.
|
|
1489
|
+
- `props.children` — Modal body content.
|
|
1490
|
+
- `props.open` — Whether open.
|
|
1491
|
+
- `props.onClose` — Close handler.
|
|
1492
|
+
- `props.title` — Modal title text.
|
|
1493
|
+
- `props.size` — Modal size.
|
|
1494
|
+
- `props.footer` — Footer content.
|
|
1495
|
+
- `props.className` — CSS class name override.
|
|
1496
|
+
- `props.testId` — Test identifier.
|
|
1497
|
+
|
|
1498
|
+
**Returns:** The rendered Modal element.
|
|
1499
|
+
|
|
1500
|
+
#### `Pagination(props)`
|
|
1501
|
+
|
|
1502
|
+
Renders a Pagination component.
|
|
1503
|
+
|
|
1504
|
+
```typescript
|
|
1505
|
+
function Pagination({
|
|
1506
|
+
page,
|
|
1507
|
+
totalPages,
|
|
1508
|
+
onChange,
|
|
1509
|
+
siblings = 1,
|
|
1510
|
+
boundaries = 1,
|
|
1511
|
+
size = 'md',
|
|
1512
|
+
showFirstLast,
|
|
1513
|
+
className,
|
|
1514
|
+
testId,
|
|
1515
|
+
}: PaginationProps): React.JSX.Element
|
|
1516
|
+
```
|
|
1517
|
+
|
|
1518
|
+
- `props` — Component props.
|
|
1519
|
+
- `props.page` — Current page number.
|
|
1520
|
+
- `props.totalPages` — Total number of pages.
|
|
1521
|
+
- `props.onChange` — Page change handler.
|
|
1522
|
+
- `props.siblings` — Visible sibling pages.
|
|
1523
|
+
- `props.boundaries` — Boundary page count.
|
|
1524
|
+
- `props.size` — Pagination size.
|
|
1525
|
+
- `props.showFirstLast` — Show first/last buttons.
|
|
1526
|
+
- `props.className` — CSS class name override.
|
|
1527
|
+
- `props.testId` — Test identifier.
|
|
1528
|
+
|
|
1529
|
+
**Returns:** The rendered Pagination element.
|
|
1530
|
+
|
|
1531
|
+
#### `Progress(props)`
|
|
1532
|
+
|
|
1533
|
+
Renders a Progress component.
|
|
1534
|
+
|
|
1535
|
+
```typescript
|
|
1536
|
+
function Progress({
|
|
1537
|
+
value = 0,
|
|
1538
|
+
max = 100,
|
|
1539
|
+
label,
|
|
1540
|
+
showValue,
|
|
1541
|
+
color = 'primary',
|
|
1542
|
+
size = 'md',
|
|
1543
|
+
indeterminate,
|
|
1544
|
+
className,
|
|
1545
|
+
testId,
|
|
1546
|
+
}: ProgressProps): React.JSX.Element
|
|
1547
|
+
```
|
|
1548
|
+
|
|
1549
|
+
- `props` — Component props.
|
|
1550
|
+
- `props.value` — Current progress value.
|
|
1551
|
+
- `props.max` — Maximum progress value.
|
|
1552
|
+
- `props.label` — Progress label text.
|
|
1553
|
+
- `props.showValue` — Whether to show value.
|
|
1554
|
+
- `props.color` — Progress bar color.
|
|
1555
|
+
- `props.size` — Progress bar size.
|
|
1556
|
+
- `props.indeterminate` — Whether indeterminate.
|
|
1557
|
+
- `props.className` — CSS class name override.
|
|
1558
|
+
- `props.testId` — Test identifier.
|
|
1559
|
+
|
|
1560
|
+
**Returns:** The rendered Progress element.
|
|
1561
|
+
|
|
1562
|
+
#### `RadioGroup(props)`
|
|
1563
|
+
|
|
1564
|
+
Renders a RadioGroup component.
|
|
1565
|
+
|
|
1566
|
+
```typescript
|
|
1567
|
+
function RadioGroup({
|
|
1568
|
+
label,
|
|
1569
|
+
options = [],
|
|
1570
|
+
value,
|
|
1571
|
+
onChange,
|
|
1572
|
+
direction = 'vertical',
|
|
1573
|
+
error,
|
|
1574
|
+
disabled,
|
|
1575
|
+
className,
|
|
1576
|
+
testId,
|
|
1577
|
+
}: RadioGroupProps<string>): React.JSX.Element
|
|
1578
|
+
```
|
|
1579
|
+
|
|
1580
|
+
- `props` — Component props.
|
|
1581
|
+
- `props.label` — Group label text.
|
|
1582
|
+
- `props.options` — Radio options array.
|
|
1583
|
+
- `props.value` — Selected value.
|
|
1584
|
+
- `props.onChange` — Change handler.
|
|
1585
|
+
- `props.direction` — Layout direction.
|
|
1586
|
+
- `props.error` — Error message.
|
|
1587
|
+
- `props.disabled` — Whether disabled.
|
|
1588
|
+
- `props.className` — CSS class name override.
|
|
1589
|
+
- `props.testId` — Test identifier.
|
|
1590
|
+
|
|
1591
|
+
**Returns:** The rendered RadioGroup element.
|
|
1592
|
+
|
|
1593
|
+
#### `Select(props)`
|
|
1594
|
+
|
|
1595
|
+
Renders a Select component.
|
|
1596
|
+
|
|
1597
|
+
```typescript
|
|
1598
|
+
function Select({
|
|
1599
|
+
label,
|
|
1600
|
+
options = [],
|
|
1601
|
+
value,
|
|
1602
|
+
onChange,
|
|
1603
|
+
placeholder,
|
|
1604
|
+
error,
|
|
1605
|
+
hint,
|
|
1606
|
+
size = 'md',
|
|
1607
|
+
disabled,
|
|
1608
|
+
required,
|
|
1609
|
+
className,
|
|
1610
|
+
testId,
|
|
1611
|
+
}: SelectProps<string>): React.JSX.Element
|
|
1612
|
+
```
|
|
1613
|
+
|
|
1614
|
+
- `props` — Component props.
|
|
1615
|
+
- `props.label` — Select label text.
|
|
1616
|
+
- `props.options` — Select options array.
|
|
1617
|
+
- `props.value` — Selected value.
|
|
1618
|
+
- `props.onChange` — Change handler.
|
|
1619
|
+
- `props.placeholder` — Placeholder text.
|
|
1620
|
+
- `props.error` — Error message.
|
|
1621
|
+
- `props.hint` — Hint text.
|
|
1622
|
+
- `props.size` — Select size.
|
|
1623
|
+
- `props.disabled` — Whether disabled.
|
|
1624
|
+
- `props.required` — Whether required.
|
|
1625
|
+
- `props.className` — CSS class name override.
|
|
1626
|
+
- `props.testId` — Test identifier.
|
|
1627
|
+
|
|
1628
|
+
**Returns:** The rendered Select element.
|
|
1629
|
+
|
|
1630
|
+
#### `Separator(props)`
|
|
1631
|
+
|
|
1632
|
+
Renders a Separator component.
|
|
1633
|
+
|
|
1634
|
+
```typescript
|
|
1635
|
+
function Separator({
|
|
1636
|
+
orientation = 'horizontal',
|
|
1637
|
+
decorative = true,
|
|
1638
|
+
className,
|
|
1639
|
+
testId,
|
|
1640
|
+
}: SeparatorProps): React.JSX.Element
|
|
1641
|
+
```
|
|
1642
|
+
|
|
1643
|
+
- `props` — Component props.
|
|
1644
|
+
- `props.orientation` — Horizontal or vertical.
|
|
1645
|
+
- `props.decorative` — Whether purely decorative.
|
|
1646
|
+
- `props.className` — CSS class name override.
|
|
1647
|
+
- `props.testId` — Test identifier.
|
|
1648
|
+
|
|
1649
|
+
**Returns:** The rendered Separator element.
|
|
1650
|
+
|
|
1651
|
+
#### `Skeleton(props)`
|
|
1652
|
+
|
|
1653
|
+
Renders a Skeleton component.
|
|
1654
|
+
|
|
1655
|
+
```typescript
|
|
1656
|
+
function Skeleton({
|
|
1657
|
+
width,
|
|
1658
|
+
height,
|
|
1659
|
+
circle,
|
|
1660
|
+
animation = 'pulse',
|
|
1661
|
+
className,
|
|
1662
|
+
testId,
|
|
1663
|
+
}: SkeletonProps): React.JSX.Element
|
|
1664
|
+
```
|
|
1665
|
+
|
|
1666
|
+
- `props` — Component props.
|
|
1667
|
+
- `props.width` — Skeleton width.
|
|
1668
|
+
- `props.height` — Skeleton height.
|
|
1669
|
+
- `props.circle` — Whether circular.
|
|
1670
|
+
- `props.animation` — Animation type.
|
|
1671
|
+
- `props.className` — CSS class name override.
|
|
1672
|
+
- `props.testId` — Test identifier.
|
|
1673
|
+
|
|
1674
|
+
**Returns:** The rendered Skeleton element.
|
|
1675
|
+
|
|
1676
|
+
#### `SkeletonCircle(props)`
|
|
1677
|
+
|
|
1678
|
+
Renders a SkeletonCircle component.
|
|
1679
|
+
|
|
1680
|
+
```typescript
|
|
1681
|
+
function SkeletonCircle({
|
|
1682
|
+
size = 40,
|
|
1683
|
+
className,
|
|
1684
|
+
testId,
|
|
1685
|
+
}: {
|
|
1686
|
+
size?: number
|
|
1687
|
+
className?: string
|
|
1688
|
+
testId?: string
|
|
1689
|
+
}): React.JSX.Element
|
|
1690
|
+
```
|
|
1691
|
+
|
|
1692
|
+
- `props` — Component props.
|
|
1693
|
+
- `props.size` — Circle diameter.
|
|
1694
|
+
- `props.className` — CSS class name override.
|
|
1695
|
+
- `props.testId` — Test identifier.
|
|
1696
|
+
|
|
1697
|
+
**Returns:** The rendered SkeletonCircle element.
|
|
1698
|
+
|
|
1699
|
+
#### `SkeletonText(props)`
|
|
1700
|
+
|
|
1701
|
+
Renders a SkeletonText component.
|
|
1702
|
+
|
|
1703
|
+
```typescript
|
|
1704
|
+
function SkeletonText({
|
|
1705
|
+
lines = 3,
|
|
1706
|
+
className,
|
|
1707
|
+
testId,
|
|
1708
|
+
}: {
|
|
1709
|
+
lines?: number
|
|
1710
|
+
className?: string
|
|
1711
|
+
testId?: string
|
|
1712
|
+
}): React.JSX.Element
|
|
1713
|
+
```
|
|
1714
|
+
|
|
1715
|
+
- `props` — Component props.
|
|
1716
|
+
- `props.lines` — Number of text lines.
|
|
1717
|
+
- `props.className` — CSS class name override.
|
|
1718
|
+
- `props.testId` — Test identifier.
|
|
1719
|
+
|
|
1720
|
+
**Returns:** The rendered SkeletonText element.
|
|
1721
|
+
|
|
1722
|
+
#### `Spacer(props)`
|
|
1723
|
+
|
|
1724
|
+
Renders a Spacer component.
|
|
1725
|
+
|
|
1726
|
+
```typescript
|
|
1727
|
+
function Spacer({
|
|
1728
|
+
size = 'md',
|
|
1729
|
+
horizontal,
|
|
1730
|
+
className,
|
|
1731
|
+
style,
|
|
1732
|
+
testId,
|
|
1733
|
+
}: SpacerProps): React.JSX.Element
|
|
1734
|
+
```
|
|
1735
|
+
|
|
1736
|
+
- `props` — Component props.
|
|
1737
|
+
- `props.size` — Spacer size.
|
|
1738
|
+
- `props.horizontal` — Whether horizontal.
|
|
1739
|
+
- `props.className` — CSS class name override.
|
|
1740
|
+
- `props.style` — Inline style object.
|
|
1741
|
+
- `props.testId` — Test identifier.
|
|
1742
|
+
|
|
1743
|
+
**Returns:** The rendered Spacer element.
|
|
1744
|
+
|
|
1745
|
+
#### `Spinner(props)`
|
|
1746
|
+
|
|
1747
|
+
Renders a Spinner component.
|
|
1748
|
+
|
|
1749
|
+
```typescript
|
|
1750
|
+
function Spinner({ size = 'md', className, testId }: SpinnerProps): React.JSX.Element
|
|
1751
|
+
```
|
|
1752
|
+
|
|
1753
|
+
- `props` — Component props.
|
|
1754
|
+
- `props.size` — Spinner size.
|
|
1755
|
+
- `props.className` — CSS class name override.
|
|
1756
|
+
- `props.testId` — Test identifier.
|
|
1757
|
+
|
|
1758
|
+
**Returns:** The rendered Spinner element.
|
|
1759
|
+
|
|
1760
|
+
#### `Switch(props)`
|
|
1761
|
+
|
|
1762
|
+
Renders a Switch component.
|
|
1763
|
+
|
|
1764
|
+
```typescript
|
|
1765
|
+
function Switch({
|
|
1766
|
+
label,
|
|
1767
|
+
checked,
|
|
1768
|
+
onChange,
|
|
1769
|
+
size: _size = 'md',
|
|
1770
|
+
disabled,
|
|
1771
|
+
className,
|
|
1772
|
+
testId,
|
|
1773
|
+
}: SwitchProps): React.JSX.Element
|
|
1774
|
+
```
|
|
1775
|
+
|
|
1776
|
+
- `props` — Component props.
|
|
1777
|
+
- `props.label` — Switch label text.
|
|
1778
|
+
- `props.checked` — Whether checked.
|
|
1779
|
+
- `props.onChange` — Change handler.
|
|
1780
|
+
- `props.size` — Switch size (unused in RN).
|
|
1781
|
+
- `props.disabled` — Whether disabled.
|
|
1782
|
+
- `props.className` — CSS class name override.
|
|
1783
|
+
- `props.testId` — Test identifier.
|
|
1784
|
+
|
|
1785
|
+
**Returns:** The rendered Switch element.
|
|
1786
|
+
|
|
1787
|
+
#### `Table(props)`
|
|
1788
|
+
|
|
1789
|
+
Renders a Table component.
|
|
1790
|
+
|
|
1791
|
+
```typescript
|
|
1792
|
+
function Table({
|
|
1793
|
+
columns = [],
|
|
1794
|
+
data = [],
|
|
1795
|
+
rowKey,
|
|
1796
|
+
onRowClick,
|
|
1797
|
+
striped,
|
|
1798
|
+
bordered,
|
|
1799
|
+
hoverable,
|
|
1800
|
+
loading,
|
|
1801
|
+
emptyContent: emptyMessage,
|
|
1802
|
+
sort,
|
|
1803
|
+
onSort,
|
|
1804
|
+
className,
|
|
1805
|
+
testId,
|
|
1806
|
+
}: TableProps<Record<string, unknown>>): React.JSX.Element
|
|
1807
|
+
```
|
|
1808
|
+
|
|
1809
|
+
- `props` — Component props.
|
|
1810
|
+
- `props.columns` — Column definitions.
|
|
1811
|
+
- `props.data` — Table row data.
|
|
1812
|
+
- `props.rowKey` — Row key accessor.
|
|
1813
|
+
- `props.onRowClick` — Row click handler.
|
|
1814
|
+
- `props.striped` — Whether striped rows.
|
|
1815
|
+
- `props.bordered` — Whether bordered.
|
|
1816
|
+
- `props.hoverable` — Whether rows hoverable.
|
|
1817
|
+
- `props.loading` — Whether loading.
|
|
1818
|
+
- `props.emptyContent` — Empty state message.
|
|
1819
|
+
- `props.sort` — Active sort state.
|
|
1820
|
+
- `props.onSort` — Sort handler.
|
|
1821
|
+
- `props.className` — CSS class name override.
|
|
1822
|
+
- `props.testId` — Test identifier.
|
|
1823
|
+
|
|
1824
|
+
**Returns:** The rendered Table element.
|
|
1825
|
+
|
|
1826
|
+
#### `Tabs(props)`
|
|
1827
|
+
|
|
1828
|
+
Renders a Tabs component.
|
|
1829
|
+
|
|
1830
|
+
```typescript
|
|
1831
|
+
function Tabs({
|
|
1832
|
+
items = [],
|
|
1833
|
+
value: controlledValue,
|
|
1834
|
+
defaultValue,
|
|
1835
|
+
onChange,
|
|
1836
|
+
fitted,
|
|
1837
|
+
className,
|
|
1838
|
+
testId,
|
|
1839
|
+
}: TabsProps<string>): React.JSX.Element
|
|
1840
|
+
```
|
|
1841
|
+
|
|
1842
|
+
- `props` — Component props.
|
|
1843
|
+
- `props.items` — Tab items array.
|
|
1844
|
+
- `props.value` — Controlled active tab.
|
|
1845
|
+
- `props.defaultValue` — Default active tab.
|
|
1846
|
+
- `props.onChange` — Tab change handler.
|
|
1847
|
+
- `props.fitted` — Whether tabs fill width.
|
|
1848
|
+
- `props.className` — CSS class name override.
|
|
1849
|
+
- `props.testId` — Test identifier.
|
|
1850
|
+
|
|
1851
|
+
**Returns:** The rendered Tabs element.
|
|
1852
|
+
|
|
1853
|
+
#### `Toast(props)`
|
|
1854
|
+
|
|
1855
|
+
Renders a Toast component.
|
|
1856
|
+
|
|
1857
|
+
```typescript
|
|
1858
|
+
function Toast({
|
|
1859
|
+
title,
|
|
1860
|
+
description,
|
|
1861
|
+
status,
|
|
1862
|
+
duration = 5000,
|
|
1863
|
+
dismissible = true,
|
|
1864
|
+
onDismiss,
|
|
1865
|
+
className,
|
|
1866
|
+
testId,
|
|
1867
|
+
}: ToastProps): React.JSX.Element
|
|
1868
|
+
```
|
|
1869
|
+
|
|
1870
|
+
- `props` — Component props.
|
|
1871
|
+
- `props.title` — Toast title text.
|
|
1872
|
+
- `props.description` — Toast description text.
|
|
1873
|
+
- `props.status` — Status type.
|
|
1874
|
+
- `props.duration` — Auto-dismiss duration (ms).
|
|
1875
|
+
- `props.dismissible` — Whether dismissible.
|
|
1876
|
+
- `props.onDismiss` — Dismiss handler.
|
|
1877
|
+
- `props.className` — CSS class name override.
|
|
1878
|
+
- `props.testId` — Test identifier.
|
|
1879
|
+
|
|
1880
|
+
**Returns:** The rendered Toast element.
|
|
1881
|
+
|
|
1882
|
+
#### `ToastContainer(props)`
|
|
1883
|
+
|
|
1884
|
+
Renders a ToastContainer component.
|
|
1885
|
+
|
|
1886
|
+
```typescript
|
|
1887
|
+
function ToastContainer({
|
|
1888
|
+
children,
|
|
1889
|
+
position = 'bottom-right',
|
|
1890
|
+
}: {
|
|
1891
|
+
children: React.ReactNode
|
|
1892
|
+
position?: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
|
|
1893
|
+
}): React.JSX.Element
|
|
1894
|
+
```
|
|
1895
|
+
|
|
1896
|
+
- `props` — Component props.
|
|
1897
|
+
- `props.children` — Toast elements.
|
|
1898
|
+
- `props.position` — Screen position.
|
|
1899
|
+
|
|
1900
|
+
**Returns:** The rendered ToastContainer element.
|
|
1901
|
+
|
|
1902
|
+
#### `ToastProvider(props)`
|
|
1903
|
+
|
|
1904
|
+
Renders a ToastProvider component.
|
|
1905
|
+
|
|
1906
|
+
```typescript
|
|
1907
|
+
function ToastProvider({
|
|
1908
|
+
children,
|
|
1909
|
+
position = 'bottom-right',
|
|
1910
|
+
}: {
|
|
1911
|
+
children: React.ReactNode
|
|
1912
|
+
position?: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
|
|
1913
|
+
}): React.JSX.Element
|
|
1914
|
+
```
|
|
1915
|
+
|
|
1916
|
+
- `props` — Component props.
|
|
1917
|
+
- `props.children` — App content.
|
|
1918
|
+
- `props.position` — Toast position.
|
|
1919
|
+
|
|
1920
|
+
**Returns:** The rendered ToastProvider element.
|
|
1921
|
+
|
|
1922
|
+
#### `Tooltip(props)`
|
|
1923
|
+
|
|
1924
|
+
Renders a Tooltip component.
|
|
1925
|
+
|
|
1926
|
+
```typescript
|
|
1927
|
+
function Tooltip({ children, content, className, testId }: TooltipProps): React.JSX.Element
|
|
1928
|
+
```
|
|
1929
|
+
|
|
1930
|
+
- `props` — Component props.
|
|
1931
|
+
- `props.children` — Trigger element.
|
|
1932
|
+
- `props.content` — Tooltip content.
|
|
1933
|
+
- `props.className` — CSS class name override.
|
|
1934
|
+
- `props.testId` — Test identifier.
|
|
1935
|
+
|
|
1936
|
+
**Returns:** The rendered Tooltip element.
|
|
1937
|
+
|
|
1938
|
+
#### `useToast()`
|
|
1939
|
+
|
|
1940
|
+
Hook for toast notifications.
|
|
1941
|
+
|
|
1942
|
+
```typescript
|
|
1943
|
+
function useToast(): ToastContextValue
|
|
1944
|
+
```
|
|
1945
|
+
|
|
1946
|
+
**Returns:** The toast context value.
|
|
1947
|
+
|
|
1948
|
+
### Constants
|
|
1949
|
+
|
|
1950
|
+
#### `Input`
|
|
1951
|
+
|
|
1952
|
+
Text input component.
|
|
1953
|
+
|
|
1954
|
+
```typescript
|
|
1955
|
+
const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInput>>
|
|
1956
|
+
```
|
|
1957
|
+
|
|
1958
|
+
#### `Textarea`
|
|
1959
|
+
|
|
1960
|
+
Multi-line text input component.
|
|
1961
|
+
|
|
1962
|
+
```typescript
|
|
1963
|
+
const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<TextInput>>
|
|
1964
|
+
```
|
|
1965
|
+
|
|
1966
|
+
## Injection Notes
|
|
1967
|
+
|
|
1968
|
+
### Requirements
|
|
1969
|
+
|
|
1970
|
+
Peer dependencies:
|
|
1971
|
+
|
|
1972
|
+
- `@molecule/app-i18n` ^1.0.0
|
|
1973
|
+
- `@molecule/app-icons` ^1.0.0
|
|
1974
|
+
- `@molecule/app-ui` ^1.0.0
|
|
1975
|
+
- `react` ^18.0.0 || ^19.0.0
|
|
1976
|
+
- `react-native` >=0.72.0
|
|
1977
|
+
|
|
1978
|
+
### Runtime Dependencies
|
|
1979
|
+
|
|
1980
|
+
- `@molecule/app-i18n`
|
|
1981
|
+
- `@molecule/app-icons`
|
|
1982
|
+
- `@molecule/app-ui`
|
|
1983
|
+
- `react`
|
|
1984
|
+
- `react-native`
|
|
1985
|
+
|
|
1986
|
+
- **Styling requires NativeWind, not just setClassMap.** Components apply ClassMap classes via
|
|
1987
|
+
`className` on React Native primitives — that prop only has an effect when the NativeWind
|
|
1988
|
+
babel preset + Tailwind config are wired into the app AND `setClassMap(classMap)` from
|
|
1989
|
+
`@molecule/app-ui-nativewind` has run. Missing either half renders the whole UI unstyled
|
|
1990
|
+
with NO error. `getClassMap()` itself throws until `setClassMap` is called.
|
|
1991
|
+
- Event props follow the shared `@molecule/app-ui` interfaces (`onClick`, not `onPress`) so
|
|
1992
|
+
components stay swappable with the web implementations.
|
|
1993
|
+
- Toasts need `ToastProvider` mounted at the root; `useToast()` throws outside it.
|
|
1994
|
+
|
|
1995
|
+
## Translations
|
|
1996
|
+
|
|
1997
|
+
Translation strings are provided by `@molecule/app-locales-ui`.
|