@molecule/app-ui-react-native 1.0.9 → 2.0.1
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 +172 -327
- package/dist/components/Button.d.ts +2 -2
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +2 -2
- package/dist/components/Card.d.ts +3 -2
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/Card.js +11 -3
- package/dist/components/Checkbox.d.ts +2 -2
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +4 -7
- package/dist/components/Input.d.ts +13 -2
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +5 -11
- package/dist/components/Layout.d.ts +3 -2
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/components/Layout.js +2 -2
- package/dist/components/Select.d.ts +2 -2
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js +4 -6
- package/dist/components/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton.js +4 -2
- package/dist/components/Switch.d.ts +2 -2
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +3 -7
- package/dist/components/Textarea.d.ts +13 -2
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea.js +2 -6
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +4 -2
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
|
3
3
|
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
4
|
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
5
|
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
-
Generated: 2026-11-
|
|
6
|
+
Generated: 2026-11-26T04:13:56.392Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ui-react-native
|
|
@@ -17,7 +17,7 @@ CardContent/CardFooter), Checkbox, Container, Dropdown, Flex, Form,
|
|
|
17
17
|
FormField, Grid, Input, Label, Modal, Pagination, Progress, RadioGroup,
|
|
18
18
|
Select, Separator, Skeleton, Spacer, Spinner, Switch, Table, Tabs,
|
|
19
19
|
Textarea, Toast (+ ToastProvider / ToastContainer / useToast), Tooltip.
|
|
20
|
-
Prop types
|
|
20
|
+
Prop types build on `@molecule/app-ui`. Web-only extras (Icon,
|
|
21
21
|
UserMenu, ThemeToggle, PageHeader, …) live in `@molecule/app-ui-react` and
|
|
22
22
|
are NOT available here.
|
|
23
23
|
|
|
@@ -56,7 +56,7 @@ function Greeting() {
|
|
|
56
56
|
## Installation
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
|
-
npm install @molecule/app-ui-react-native @molecule/app-i18n @molecule/app-
|
|
59
|
+
npm install @molecule/app-ui-react-native @molecule/app-i18n @molecule/app-react @molecule/app-ui react
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
## API
|
|
@@ -67,6 +67,12 @@ npm install @molecule/app-ui-react-native @molecule/app-i18n @molecule/app-icons
|
|
|
67
67
|
|
|
68
68
|
Base props shared by all components.
|
|
69
69
|
|
|
70
|
+
Ref element: a component that renders one main element gives the caller that element, the one
|
|
71
|
+
that takes `className` and `style`. Each UI kit hands it over in its framework's own way: React
|
|
72
|
+
and Solid a `ref`, Vue a template ref's `$el`, Svelte `bind:ref`, Angular the component's
|
|
73
|
+
`element()` signal. It is empty while the element is not rendered (a closed Tooltip, Dropdown or
|
|
74
|
+
Modal). A component's own doc names the element when it is not the outermost one.
|
|
75
|
+
|
|
70
76
|
```typescript
|
|
71
77
|
interface BaseProps {
|
|
72
78
|
/**
|
|
@@ -93,260 +99,16 @@ interface BaseProps {
|
|
|
93
99
|
automationId?: string
|
|
94
100
|
|
|
95
101
|
/**
|
|
96
|
-
*
|
|
102
|
+
* Disables the controls the component renders: a disabled Button, Input, Textarea, Select,
|
|
103
|
+
* Checkbox, Switch, RadioGroup, Tabs, Accordion or Pagination takes no input, a disabled
|
|
104
|
+
* Dropdown never opens, and a disabled Card never calls `onClick` (an interactive one is
|
|
105
|
+
* announced as disabled and leaves the tab order). A component that renders no control
|
|
106
|
+
* (Badge, Spinner, Skeleton, a layout box) ignores it.
|
|
97
107
|
*/
|
|
98
108
|
disabled?: boolean
|
|
99
109
|
}
|
|
100
110
|
```
|
|
101
111
|
|
|
102
|
-
#### `ButtonProps`
|
|
103
|
-
|
|
104
|
-
Props for the Button component.
|
|
105
|
-
|
|
106
|
-
```typescript
|
|
107
|
-
interface ButtonProps extends ButtonElementProps {
|
|
108
|
-
/**
|
|
109
|
-
* Button content.
|
|
110
|
-
*/
|
|
111
|
-
children?: Children
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Visual variant.
|
|
115
|
-
*/
|
|
116
|
-
variant?: ButtonVariant
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Color scheme.
|
|
120
|
-
*/
|
|
121
|
-
color?: ColorVariant
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Button size.
|
|
125
|
-
*/
|
|
126
|
-
size?: ButtonSize
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Whether the button is in a loading state.
|
|
130
|
-
*/
|
|
131
|
-
loading?: boolean
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Loading text to display.
|
|
135
|
-
*/
|
|
136
|
-
loadingText?: string
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Whether the button takes full width.
|
|
140
|
-
*/
|
|
141
|
-
fullWidth?: boolean
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Icon to display before the label.
|
|
145
|
-
*/
|
|
146
|
-
leftIcon?: Children
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Icon to display after the label.
|
|
150
|
-
*/
|
|
151
|
-
rightIcon?: Children
|
|
152
|
-
}
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
#### `InputProps`
|
|
156
|
-
|
|
157
|
-
Props for the Input component (text field, email, password, etc.).
|
|
158
|
-
|
|
159
|
-
```typescript
|
|
160
|
-
interface InputProps extends InputElementProps {
|
|
161
|
-
/**
|
|
162
|
-
* Input type.
|
|
163
|
-
*/
|
|
164
|
-
type?: InputType
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Input size.
|
|
168
|
-
*/
|
|
169
|
-
size?: Size
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Horizontal text alignment inside the input (see
|
|
173
|
-
* {@link InputClassOptions.align}). Defaults to the bond's own style.
|
|
174
|
-
*/
|
|
175
|
-
align?: 'left' | 'center'
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Label text.
|
|
179
|
-
*/
|
|
180
|
-
label?: string
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Error message.
|
|
184
|
-
*/
|
|
185
|
-
error?: string
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Hint/help text.
|
|
189
|
-
*/
|
|
190
|
-
hint?: string
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Element to display on the left.
|
|
194
|
-
*/
|
|
195
|
-
leftElement?: Children
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Element to display on the right.
|
|
199
|
-
*/
|
|
200
|
-
rightElement?: Children
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Whether to show a clear button.
|
|
204
|
-
*/
|
|
205
|
-
clearable?: boolean
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* Called when the clear button is clicked.
|
|
209
|
-
*/
|
|
210
|
-
onClear?: () => void
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Accessible label for the clear button.
|
|
214
|
-
* @default 'Clear'
|
|
215
|
-
*/
|
|
216
|
-
clearLabel?: string
|
|
217
|
-
}
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
#### `TextareaProps`
|
|
221
|
-
|
|
222
|
-
Props for the Textarea component.
|
|
223
|
-
|
|
224
|
-
```typescript
|
|
225
|
-
interface TextareaProps extends TextareaElementProps {
|
|
226
|
-
/**
|
|
227
|
-
* Text size tier (see {@link TextareaClassOptions.size}) — pass the same
|
|
228
|
-
* `size` as a neighboring Input for identical font sizes.
|
|
229
|
-
*/
|
|
230
|
-
size?: Size
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Label text.
|
|
234
|
-
*/
|
|
235
|
-
label?: string
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Error message.
|
|
239
|
-
*/
|
|
240
|
-
error?: string
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Hint/help text.
|
|
244
|
-
*/
|
|
245
|
-
hint?: string
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Whether the textarea auto-resizes.
|
|
249
|
-
*/
|
|
250
|
-
autoResize?: boolean
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Minimum number of rows.
|
|
254
|
-
*/
|
|
255
|
-
minRows?: number
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Maximum number of rows.
|
|
259
|
-
*/
|
|
260
|
-
maxRows?: number
|
|
261
|
-
}
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
#### `SelectProps`
|
|
265
|
-
|
|
266
|
-
Props for the Select dropdown component (single or multi-select).
|
|
267
|
-
|
|
268
|
-
```typescript
|
|
269
|
-
interface SelectProps<T = string> extends SelectElementProps {
|
|
270
|
-
/**
|
|
271
|
-
* Select options.
|
|
272
|
-
*/
|
|
273
|
-
options: SelectOption<T>[]
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Current value.
|
|
277
|
-
*/
|
|
278
|
-
value?: T
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Change handler (with typed value).
|
|
282
|
-
*/
|
|
283
|
-
onValueChange?: (value: T) => void
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Select size.
|
|
287
|
-
*/
|
|
288
|
-
size?: Size
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Label text.
|
|
292
|
-
*/
|
|
293
|
-
label?: string
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Placeholder text.
|
|
297
|
-
*/
|
|
298
|
-
placeholder?: string
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Error message.
|
|
302
|
-
*/
|
|
303
|
-
error?: string
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Hint/help text.
|
|
307
|
-
*/
|
|
308
|
-
hint?: string
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Whether to allow clearing the selection.
|
|
312
|
-
*/
|
|
313
|
-
clearable?: boolean
|
|
314
|
-
}
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
#### `CheckboxProps`
|
|
318
|
-
|
|
319
|
-
Props for the Checkbox component.
|
|
320
|
-
|
|
321
|
-
```typescript
|
|
322
|
-
interface CheckboxProps extends InputElementProps {
|
|
323
|
-
/**
|
|
324
|
-
* Checkbox label.
|
|
325
|
-
*/
|
|
326
|
-
label?: Children
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Whether the checkbox is checked.
|
|
330
|
-
*/
|
|
331
|
-
checked?: boolean
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* Whether the checkbox is in an indeterminate state.
|
|
335
|
-
*/
|
|
336
|
-
indeterminate?: boolean
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Checkbox size.
|
|
340
|
-
*/
|
|
341
|
-
size?: Size
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Error message.
|
|
345
|
-
*/
|
|
346
|
-
error?: string
|
|
347
|
-
}
|
|
348
|
-
```
|
|
349
|
-
|
|
350
112
|
#### `RadioGroupProps`
|
|
351
113
|
|
|
352
114
|
Props for the RadioGroup component.
|
|
@@ -400,38 +162,12 @@ interface RadioGroupProps<T = string> extends BaseProps {
|
|
|
400
162
|
}
|
|
401
163
|
```
|
|
402
164
|
|
|
403
|
-
#### `SwitchProps`
|
|
404
|
-
|
|
405
|
-
Props for the Switch/Toggle component.
|
|
406
|
-
|
|
407
|
-
```typescript
|
|
408
|
-
interface SwitchProps extends InputElementProps {
|
|
409
|
-
/**
|
|
410
|
-
* Switch label.
|
|
411
|
-
*/
|
|
412
|
-
label?: Children
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Whether the switch is on.
|
|
416
|
-
*/
|
|
417
|
-
checked?: boolean
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Switch size.
|
|
421
|
-
*/
|
|
422
|
-
size?: Size
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Color when on.
|
|
426
|
-
*/
|
|
427
|
-
color?: ColorVariant
|
|
428
|
-
}
|
|
429
|
-
```
|
|
430
|
-
|
|
431
165
|
#### `ModalProps`
|
|
432
166
|
|
|
433
167
|
Props for the Modal/Dialog component.
|
|
434
168
|
|
|
169
|
+
Ref element: the dialog (`role="dialog"`), empty while closed.
|
|
170
|
+
|
|
435
171
|
```typescript
|
|
436
172
|
interface ModalProps extends HTMLElementProps {
|
|
437
173
|
/**
|
|
@@ -494,6 +230,14 @@ interface ModalProps extends HTMLElementProps {
|
|
|
494
230
|
* @default 'Close'
|
|
495
231
|
*/
|
|
496
232
|
closeLabel?: string
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* The control that takes focus when the modal opens, such as the field a dialog exists to fill.
|
|
236
|
+
* Without it, focus goes to the first focusable control, or to the dialog when it has none. The
|
|
237
|
+
* modal reads it once the open dialog is in the document, so a control rendered in the
|
|
238
|
+
* children can be named here.
|
|
239
|
+
*/
|
|
240
|
+
initialFocus?: OverlayTarget
|
|
497
241
|
}
|
|
498
242
|
```
|
|
499
243
|
|
|
@@ -600,6 +344,8 @@ interface BadgeProps extends HTMLElementProps {
|
|
|
600
344
|
|
|
601
345
|
Props for the Tooltip component (hover/focus popover with informational text).
|
|
602
346
|
|
|
347
|
+
Ref element: the `role="tooltip"` box, empty while hidden.
|
|
348
|
+
|
|
603
349
|
```typescript
|
|
604
350
|
interface TooltipProps extends HTMLElementProps {
|
|
605
351
|
/**
|
|
@@ -629,34 +375,6 @@ interface TooltipProps extends HTMLElementProps {
|
|
|
629
375
|
}
|
|
630
376
|
```
|
|
631
377
|
|
|
632
|
-
#### `CardProps`
|
|
633
|
-
|
|
634
|
-
Props for the Card container component (elevated, outlined, or filled surface).
|
|
635
|
-
|
|
636
|
-
```typescript
|
|
637
|
-
interface CardProps extends HTMLElementProps {
|
|
638
|
-
/**
|
|
639
|
-
* Card content.
|
|
640
|
-
*/
|
|
641
|
-
children?: Children
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* Card variant.
|
|
645
|
-
*/
|
|
646
|
-
variant?: 'elevated' | 'outlined' | 'filled'
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Whether the card is interactive (clickable).
|
|
650
|
-
*/
|
|
651
|
-
interactive?: boolean
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* Padding size.
|
|
655
|
-
*/
|
|
656
|
-
padding?: Size | 'none'
|
|
657
|
-
}
|
|
658
|
-
```
|
|
659
|
-
|
|
660
378
|
#### `FormProps`
|
|
661
379
|
|
|
662
380
|
Props for the Form component (wraps inputs with submission handling and validation).
|
|
@@ -906,6 +624,8 @@ interface AccordionProps<T = string> extends BaseProps {
|
|
|
906
624
|
|
|
907
625
|
Props for the Table component.
|
|
908
626
|
|
|
627
|
+
Ref element: the `<table>`.
|
|
628
|
+
|
|
909
629
|
```typescript
|
|
910
630
|
interface TableProps<T> extends HTMLElementProps {
|
|
911
631
|
/**
|
|
@@ -1067,6 +787,8 @@ interface SkeletonProps extends BaseProps {
|
|
|
1067
787
|
|
|
1068
788
|
Props for the Dropdown menu component.
|
|
1069
789
|
|
|
790
|
+
Ref element: the `role="menu"` element, empty while closed (`testId` and `automationId` go to the trigger).
|
|
791
|
+
|
|
1070
792
|
```typescript
|
|
1071
793
|
interface DropdownProps<T = string> extends BaseProps {
|
|
1072
794
|
/**
|
|
@@ -1112,6 +834,72 @@ interface DropdownProps<T = string> extends BaseProps {
|
|
|
1112
834
|
}
|
|
1113
835
|
```
|
|
1114
836
|
|
|
837
|
+
### Types
|
|
838
|
+
|
|
839
|
+
#### `ButtonProps`
|
|
840
|
+
|
|
841
|
+
Native button props. `onClick` signals activation.
|
|
842
|
+
|
|
843
|
+
```typescript
|
|
844
|
+
type ButtonProps = NativeControlProps<UI.ButtonProps, 'onClick'>
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
#### `CardProps`
|
|
848
|
+
|
|
849
|
+
Native card props. `onClick` signals activation.
|
|
850
|
+
|
|
851
|
+
```typescript
|
|
852
|
+
type CardProps = NativeControlProps<UI.CardProps, 'onClick'>
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
#### `CheckboxProps`
|
|
856
|
+
|
|
857
|
+
Native checkbox props. Use `onCheckedChange` to receive the new checked state.
|
|
858
|
+
|
|
859
|
+
```typescript
|
|
860
|
+
type CheckboxProps = NativeControlProps<UI.CheckboxProps>
|
|
861
|
+
```
|
|
862
|
+
|
|
863
|
+
#### `FlexProps`
|
|
864
|
+
|
|
865
|
+
Native layout props. `onClick` signals touch release.
|
|
866
|
+
|
|
867
|
+
```typescript
|
|
868
|
+
type FlexProps = NativeControlProps<UI.FlexProps, 'onClick'>
|
|
869
|
+
```
|
|
870
|
+
|
|
871
|
+
#### `InputProps`
|
|
872
|
+
|
|
873
|
+
Native input props. `onValueChange` receives the text, including an empty string on clear.
|
|
874
|
+
|
|
875
|
+
```typescript
|
|
876
|
+
type InputProps = NativeControlProps<UI.InputProps, 'onFocus' | 'onBlur'>
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
#### `SelectProps`
|
|
880
|
+
|
|
881
|
+
Native picker props. Use `onValueChange` to receive the selected value.
|
|
882
|
+
|
|
883
|
+
```typescript
|
|
884
|
+
type SelectProps<T = string> = NativeControlProps<UI.SelectProps<T>>
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
#### `SwitchProps`
|
|
888
|
+
|
|
889
|
+
Native switch props. Use `onCheckedChange` to receive the new checked state.
|
|
890
|
+
|
|
891
|
+
```typescript
|
|
892
|
+
type SwitchProps = NativeControlProps<UI.SwitchProps>
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
#### `TextareaProps`
|
|
896
|
+
|
|
897
|
+
Native textarea props. Use `onValueChange` to receive the new text.
|
|
898
|
+
|
|
899
|
+
```typescript
|
|
900
|
+
type TextareaProps = NativeControlProps<UI.TextareaProps, 'onFocus' | 'onBlur'>
|
|
901
|
+
```
|
|
902
|
+
|
|
1115
903
|
### Functions
|
|
1116
904
|
|
|
1117
905
|
#### `Accordion(props)`
|
|
@@ -1265,7 +1053,7 @@ function Button({
|
|
|
1265
1053
|
- `props.className` — CSS class name override.
|
|
1266
1054
|
- `props.testId` — Test identifier.
|
|
1267
1055
|
- `props.disabled` — Whether disabled.
|
|
1268
|
-
- `props.onClick` —
|
|
1056
|
+
- `props.onClick` — Called when the button is pressed.
|
|
1269
1057
|
|
|
1270
1058
|
**Returns:** The rendered Button element.
|
|
1271
1059
|
|
|
@@ -1283,6 +1071,7 @@ function Card({
|
|
|
1283
1071
|
style,
|
|
1284
1072
|
testId,
|
|
1285
1073
|
onClick,
|
|
1074
|
+
disabled,
|
|
1286
1075
|
}: CardProps): React.JSX.Element
|
|
1287
1076
|
```
|
|
1288
1077
|
|
|
@@ -1294,7 +1083,8 @@ function Card({
|
|
|
1294
1083
|
- `props.className` — CSS class name override.
|
|
1295
1084
|
- `props.style` — Inline style object.
|
|
1296
1085
|
- `props.testId` — Test identifier.
|
|
1297
|
-
- `props.onClick` —
|
|
1086
|
+
- `props.onClick` — Called when the card is pressed.
|
|
1087
|
+
- `props.disabled` — Whether the card is disabled.
|
|
1298
1088
|
|
|
1299
1089
|
**Returns:** The rendered Card element.
|
|
1300
1090
|
|
|
@@ -1407,7 +1197,7 @@ function Checkbox({
|
|
|
1407
1197
|
label,
|
|
1408
1198
|
checked,
|
|
1409
1199
|
indeterminate,
|
|
1410
|
-
|
|
1200
|
+
onCheckedChange,
|
|
1411
1201
|
error,
|
|
1412
1202
|
disabled,
|
|
1413
1203
|
className,
|
|
@@ -1419,7 +1209,7 @@ function Checkbox({
|
|
|
1419
1209
|
- `props.label` — Checkbox label text.
|
|
1420
1210
|
- `props.checked` — Whether checked.
|
|
1421
1211
|
- `props.indeterminate` — Whether indeterminate.
|
|
1422
|
-
- `props.
|
|
1212
|
+
- `props.onCheckedChange` — Receives the new checked state.
|
|
1423
1213
|
- `props.error` — Error message.
|
|
1424
1214
|
- `props.disabled` — Whether disabled.
|
|
1425
1215
|
- `props.className` — CSS class name override.
|
|
@@ -1586,7 +1376,7 @@ function Flex({
|
|
|
1586
1376
|
- `props.className` — CSS class name override.
|
|
1587
1377
|
- `props.style` — Inline style object.
|
|
1588
1378
|
- `props.testId` — Test identifier.
|
|
1589
|
-
- `props.onClick` —
|
|
1379
|
+
- `props.onClick` — Called on touch release.
|
|
1590
1380
|
|
|
1591
1381
|
**Returns:** The rendered Flex element.
|
|
1592
1382
|
|
|
@@ -1762,7 +1552,7 @@ function Select({
|
|
|
1762
1552
|
label,
|
|
1763
1553
|
options = [],
|
|
1764
1554
|
value,
|
|
1765
|
-
|
|
1555
|
+
onValueChange,
|
|
1766
1556
|
placeholder,
|
|
1767
1557
|
error,
|
|
1768
1558
|
hint,
|
|
@@ -1771,14 +1561,14 @@ function Select({
|
|
|
1771
1561
|
required,
|
|
1772
1562
|
className,
|
|
1773
1563
|
testId,
|
|
1774
|
-
}: SelectProps
|
|
1564
|
+
}: SelectProps): React.JSX.Element
|
|
1775
1565
|
```
|
|
1776
1566
|
|
|
1777
1567
|
- `props` — Component props.
|
|
1778
1568
|
- `props.label` — Select label text.
|
|
1779
1569
|
- `props.options` — Select options array.
|
|
1780
1570
|
- `props.value` — Selected value.
|
|
1781
|
-
- `props.
|
|
1571
|
+
- `props.onValueChange` — Receives the selected value.
|
|
1782
1572
|
- `props.placeholder` — Placeholder text.
|
|
1783
1573
|
- `props.error` — Error message.
|
|
1784
1574
|
- `props.hint` — Hint text.
|
|
@@ -1905,7 +1695,7 @@ Renders a Switch component.
|
|
|
1905
1695
|
function Switch({
|
|
1906
1696
|
label,
|
|
1907
1697
|
checked,
|
|
1908
|
-
|
|
1698
|
+
onCheckedChange,
|
|
1909
1699
|
size: _size = 'md',
|
|
1910
1700
|
disabled,
|
|
1911
1701
|
className,
|
|
@@ -1916,7 +1706,7 @@ function Switch({
|
|
|
1916
1706
|
- `props` — Component props.
|
|
1917
1707
|
- `props.label` — Switch label text.
|
|
1918
1708
|
- `props.checked` — Whether checked.
|
|
1919
|
-
- `props.
|
|
1709
|
+
- `props.onCheckedChange` — Receives the new checked state.
|
|
1920
1710
|
- `props.size` — Switch size (unused in RN).
|
|
1921
1711
|
- `props.disabled` — Whether disabled.
|
|
1922
1712
|
- `props.className` — CSS class name override.
|
|
@@ -2092,7 +1882,34 @@ function Tooltip({ children, content, className, testId }: TooltipProps): React.
|
|
|
2092
1882
|
Text input component.
|
|
2093
1883
|
|
|
2094
1884
|
```typescript
|
|
2095
|
-
const Input: React.ForwardRefExoticComponent<
|
|
1885
|
+
const Input: React.ForwardRefExoticComponent<
|
|
1886
|
+
Omit<
|
|
1887
|
+
InputProps,
|
|
1888
|
+
| 'onClick'
|
|
1889
|
+
| 'onDoubleClick'
|
|
1890
|
+
| 'onMouseEnter'
|
|
1891
|
+
| 'onMouseLeave'
|
|
1892
|
+
| 'onFocus'
|
|
1893
|
+
| 'onBlur'
|
|
1894
|
+
| 'onKeyDown'
|
|
1895
|
+
| 'onKeyUp'
|
|
1896
|
+
| 'onKeyPress'
|
|
1897
|
+
| 'onChange'
|
|
1898
|
+
| 'onInput'
|
|
1899
|
+
> & {
|
|
1900
|
+
onClick?: undefined
|
|
1901
|
+
onDoubleClick?: undefined
|
|
1902
|
+
onMouseEnter?: undefined
|
|
1903
|
+
onMouseLeave?: undefined
|
|
1904
|
+
onFocus?: (() => void) | undefined
|
|
1905
|
+
onBlur?: (() => void) | undefined
|
|
1906
|
+
onKeyDown?: undefined
|
|
1907
|
+
onKeyUp?: undefined
|
|
1908
|
+
onKeyPress?: undefined
|
|
1909
|
+
onChange?: undefined
|
|
1910
|
+
onInput?: undefined
|
|
1911
|
+
} & React.RefAttributes<TextInput>
|
|
1912
|
+
>
|
|
2096
1913
|
```
|
|
2097
1914
|
|
|
2098
1915
|
#### `Textarea`
|
|
@@ -2100,7 +1917,34 @@ const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<Te
|
|
|
2100
1917
|
Multi-line text input component.
|
|
2101
1918
|
|
|
2102
1919
|
```typescript
|
|
2103
|
-
const Textarea: React.ForwardRefExoticComponent<
|
|
1920
|
+
const Textarea: React.ForwardRefExoticComponent<
|
|
1921
|
+
Omit<
|
|
1922
|
+
TextareaProps,
|
|
1923
|
+
| 'onClick'
|
|
1924
|
+
| 'onDoubleClick'
|
|
1925
|
+
| 'onMouseEnter'
|
|
1926
|
+
| 'onMouseLeave'
|
|
1927
|
+
| 'onFocus'
|
|
1928
|
+
| 'onBlur'
|
|
1929
|
+
| 'onKeyDown'
|
|
1930
|
+
| 'onKeyUp'
|
|
1931
|
+
| 'onKeyPress'
|
|
1932
|
+
| 'onChange'
|
|
1933
|
+
| 'onInput'
|
|
1934
|
+
> & {
|
|
1935
|
+
onClick?: undefined
|
|
1936
|
+
onDoubleClick?: undefined
|
|
1937
|
+
onMouseEnter?: undefined
|
|
1938
|
+
onMouseLeave?: undefined
|
|
1939
|
+
onFocus?: (() => void) | undefined
|
|
1940
|
+
onBlur?: (() => void) | undefined
|
|
1941
|
+
onKeyDown?: undefined
|
|
1942
|
+
onKeyUp?: undefined
|
|
1943
|
+
onKeyPress?: undefined
|
|
1944
|
+
onChange?: undefined
|
|
1945
|
+
onInput?: undefined
|
|
1946
|
+
} & React.RefAttributes<TextInput>
|
|
1947
|
+
>
|
|
2104
1948
|
```
|
|
2105
1949
|
|
|
2106
1950
|
## Injection Notes
|
|
@@ -2110,28 +1954,29 @@ const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttribu
|
|
|
2110
1954
|
Peer dependencies:
|
|
2111
1955
|
|
|
2112
1956
|
- `@molecule/app-i18n` ^1.0.1
|
|
2113
|
-
- `@molecule/app-icons` ^1.0.1
|
|
1957
|
+
- `@molecule/app-icons` ^1.0.1 _(optional)_
|
|
2114
1958
|
- `@molecule/app-react` ^4.4.0
|
|
2115
|
-
- `@molecule/app-ui` ^1.
|
|
1959
|
+
- `@molecule/app-ui` ^1.13.0
|
|
2116
1960
|
- `react` ^18.0.0 || ^19.0.0
|
|
2117
|
-
- `react-native` >=0.72.0
|
|
1961
|
+
- `react-native` >=0.72.0 _(optional)_
|
|
2118
1962
|
|
|
2119
1963
|
### Runtime Dependencies
|
|
2120
1964
|
|
|
2121
1965
|
- `@molecule/app-i18n`
|
|
2122
|
-
- `@molecule/app-icons`
|
|
1966
|
+
- `@molecule/app-icons` _(optional)_
|
|
2123
1967
|
- `@molecule/app-react`
|
|
2124
1968
|
- `@molecule/app-ui`
|
|
2125
1969
|
- `react`
|
|
2126
|
-
- `react-native`
|
|
1970
|
+
- `react-native` _(optional)_
|
|
2127
1971
|
|
|
2128
1972
|
- **Styling requires NativeWind, not just setClassMap.** Components apply ClassMap classes via
|
|
2129
1973
|
`className` on React Native primitives — that prop only has an effect when the NativeWind
|
|
2130
1974
|
babel preset + Tailwind config are wired into the app AND `setClassMap(classMap)` from
|
|
2131
1975
|
`@molecule/app-ui-nativewind` has run. Missing either half renders the whole UI unstyled
|
|
2132
1976
|
with NO error. `getClassMap()` itself throws until `setClassMap` is called.
|
|
2133
|
-
-
|
|
2134
|
-
|
|
1977
|
+
- Fields report text and choices with `onValueChange` and checked state with
|
|
1978
|
+
`onCheckedChange`. Use eventless `onClick`, `onFocus`, `onBlur` and `onClear` callbacks
|
|
1979
|
+
to share handlers with the web kits.
|
|
2135
1980
|
- Toasts need `ToastProvider` mounted at the root; `useToast()` throws outside it.
|
|
2136
1981
|
|
|
2137
1982
|
## Translations
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import type { ButtonProps } from '
|
|
7
|
+
import type { ButtonProps } from '../types.js';
|
|
8
8
|
/**
|
|
9
9
|
* Renders a Button component.
|
|
10
10
|
* @param root0 - Component props.
|
|
@@ -20,7 +20,7 @@ import type { ButtonProps } from '@molecule/app-ui';
|
|
|
20
20
|
* @param root0.className - CSS class name override.
|
|
21
21
|
* @param root0.testId - Test identifier.
|
|
22
22
|
* @param root0.disabled - Whether disabled.
|
|
23
|
-
* @param root0.onClick -
|
|
23
|
+
* @param root0.onClick - Called when the button is pressed.
|
|
24
24
|
* @returns The rendered Button element.
|
|
25
25
|
*/
|
|
26
26
|
export declare const Button: React.FC<ButtonProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/components/Button.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqCxC,CAAA"}
|