@molecule/app-ui-react-native 1.0.10 → 2.1.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/README.md +211 -331
- 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/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/elements/Anchor.d.ts +15 -0
- package/dist/elements/Anchor.d.ts.map +1 -0
- package/dist/elements/Anchor.js +57 -0
- package/dist/elements/Box.d.ts +19 -0
- package/dist/elements/Box.d.ts.map +1 -0
- package/dist/elements/Box.js +150 -0
- package/dist/elements/CheckField.d.ts +18 -0
- package/dist/elements/CheckField.d.ts.map +1 -0
- package/dist/elements/CheckField.js +103 -0
- package/dist/elements/Disclosure.d.ts +11 -0
- package/dist/elements/Disclosure.d.ts.map +1 -0
- package/dist/elements/Disclosure.js +67 -0
- package/dist/elements/Fieldset.d.ts +16 -0
- package/dist/elements/Fieldset.d.ts.map +1 -0
- package/dist/elements/Fieldset.js +34 -0
- package/dist/elements/FileField.d.ts +12 -0
- package/dist/elements/FileField.d.ts.map +1 -0
- package/dist/elements/FileField.js +111 -0
- package/dist/elements/FormArea.d.ts +18 -0
- package/dist/elements/FormArea.d.ts.map +1 -0
- package/dist/elements/FormArea.js +42 -0
- package/dist/elements/GlyphIcon.d.ts +19 -0
- package/dist/elements/GlyphIcon.d.ts.map +1 -0
- package/dist/elements/GlyphIcon.js +43 -0
- package/dist/elements/Image.d.ts +17 -0
- package/dist/elements/Image.d.ts.map +1 -0
- package/dist/elements/Image.js +26 -0
- package/dist/elements/Link.d.ts +20 -0
- package/dist/elements/Link.d.ts.map +1 -0
- package/dist/elements/Link.js +53 -0
- package/dist/elements/Pressable.d.ts +18 -0
- package/dist/elements/Pressable.d.ts.map +1 -0
- package/dist/elements/Pressable.js +107 -0
- package/dist/elements/PulseDots.d.ts +15 -0
- package/dist/elements/PulseDots.d.ts.map +1 -0
- package/dist/elements/PulseDots.js +78 -0
- package/dist/elements/RangeField.d.ts +11 -0
- package/dist/elements/RangeField.d.ts.map +1 -0
- package/dist/elements/RangeField.js +259 -0
- package/dist/elements/RichText.d.ts +23 -0
- package/dist/elements/RichText.d.ts.map +1 -0
- package/dist/elements/RichText.js +55 -0
- package/dist/elements/Rule.d.ts +11 -0
- package/dist/elements/Rule.d.ts.map +1 -0
- package/dist/elements/Rule.js +19 -0
- package/dist/elements/ScrollArea.d.ts +21 -0
- package/dist/elements/ScrollArea.d.ts.map +1 -0
- package/dist/elements/ScrollArea.js +101 -0
- package/dist/elements/SelectAction.d.ts +20 -0
- package/dist/elements/SelectAction.d.ts.map +1 -0
- package/dist/elements/SelectAction.js +113 -0
- package/dist/elements/SelectField.d.ts +11 -0
- package/dist/elements/SelectField.d.ts.map +1 -0
- package/dist/elements/SelectField.js +220 -0
- package/dist/elements/SelectMenu.d.ts +19 -0
- package/dist/elements/SelectMenu.d.ts.map +1 -0
- package/dist/elements/SelectMenu.js +122 -0
- package/dist/elements/Svg.d.ts +155 -0
- package/dist/elements/Svg.d.ts.map +1 -0
- package/dist/elements/Svg.js +525 -0
- package/dist/elements/TableBox.d.ts +19 -0
- package/dist/elements/TableBox.d.ts.map +1 -0
- package/dist/elements/TableBox.js +87 -0
- package/dist/elements/TableCell.d.ts +16 -0
- package/dist/elements/TableCell.d.ts.map +1 -0
- package/dist/elements/TableCell.js +69 -0
- package/dist/elements/Text.d.ts +17 -0
- package/dist/elements/Text.d.ts.map +1 -0
- package/dist/elements/Text.js +96 -0
- package/dist/elements/TextField.d.ts +25 -0
- package/dist/elements/TextField.d.ts.map +1 -0
- package/dist/elements/TextField.js +257 -0
- package/dist/elements/accessibility.d.ts +36 -0
- package/dist/elements/accessibility.d.ts.map +1 -0
- package/dist/elements/accessibility.js +239 -0
- package/dist/elements/className.d.ts +45 -0
- package/dist/elements/className.d.ts.map +1 -0
- package/dist/elements/className.js +8 -0
- package/dist/elements/decimal.d.ts +5 -0
- package/dist/elements/decimal.d.ts.map +1 -0
- package/dist/elements/decimal.js +11 -0
- package/dist/elements/documentUrl.d.ts +35 -0
- package/dist/elements/documentUrl.d.ts.map +1 -0
- package/dist/elements/documentUrl.js +89 -0
- package/dist/elements/drag-drop.d.ts +11 -0
- package/dist/elements/drag-drop.d.ts.map +1 -0
- package/dist/elements/drag-drop.js +277 -0
- package/dist/elements/drag.d.ts +47 -0
- package/dist/elements/drag.d.ts.map +1 -0
- package/dist/elements/drag.js +362 -0
- package/dist/elements/events.d.ts +45 -0
- package/dist/elements/events.d.ts.map +1 -0
- package/dist/elements/events.js +101 -0
- package/dist/elements/fieldBounds.d.ts +5 -0
- package/dist/elements/fieldBounds.d.ts.map +1 -0
- package/dist/elements/fieldBounds.js +60 -0
- package/dist/elements/flow.d.ts +36 -0
- package/dist/elements/flow.d.ts.map +1 -0
- package/dist/elements/flow.js +47 -0
- package/dist/elements/form.d.ts +48 -0
- package/dist/elements/form.d.ts.map +1 -0
- package/dist/elements/form.js +112 -0
- package/dist/elements/grid.d.ts +96 -0
- package/dist/elements/grid.d.ts.map +1 -0
- package/dist/elements/grid.js +272 -0
- package/dist/elements/index.d.ts +36 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/index.js +35 -0
- package/dist/elements/inherited.d.ts +181 -0
- package/dist/elements/inherited.d.ts.map +1 -0
- package/dist/elements/inherited.js +512 -0
- package/dist/elements/labels.d.ts +39 -0
- package/dist/elements/labels.d.ts.map +1 -0
- package/dist/elements/labels.js +163 -0
- package/dist/elements/measure.d.ts +27 -0
- package/dist/elements/measure.d.ts.map +1 -0
- package/dist/elements/measure.js +24 -0
- package/dist/elements/outsidePress.d.ts +31 -0
- package/dist/elements/outsidePress.d.ts.map +1 -0
- package/dist/elements/outsidePress.js +94 -0
- package/dist/elements/paste.d.ts +22 -0
- package/dist/elements/paste.d.ts.map +1 -0
- package/dist/elements/paste.js +49 -0
- package/dist/elements/press.d.ts +41 -0
- package/dist/elements/press.d.ts.map +1 -0
- package/dist/elements/press.js +131 -0
- package/dist/elements/rangeKeyboard.d.ts +41 -0
- package/dist/elements/rangeKeyboard.d.ts.map +1 -0
- package/dist/elements/rangeKeyboard.js +58 -0
- package/dist/elements/rangeValues.d.ts +20 -0
- package/dist/elements/rangeValues.d.ts.map +1 -0
- package/dist/elements/rangeValues.js +101 -0
- package/dist/elements/ref.d.ts +16 -0
- package/dist/elements/ref.d.ts.map +1 -0
- package/dist/elements/ref.js +22 -0
- package/dist/elements/reveal.d.ts +8 -0
- package/dist/elements/reveal.d.ts.map +1 -0
- package/dist/elements/reveal.js +10 -0
- package/dist/elements/scrollReveal.d.ts +19 -0
- package/dist/elements/scrollReveal.d.ts.map +1 -0
- package/dist/elements/scrollReveal.js +52 -0
- package/dist/elements/selectOptions.d.ts +25 -0
- package/dist/elements/selectOptions.d.ts.map +1 -0
- package/dist/elements/selectOptions.js +60 -0
- package/dist/elements/style.d.ts +30 -0
- package/dist/elements/style.d.ts.map +1 -0
- package/dist/elements/style.js +363 -0
- package/dist/elements/svgHover.d.ts +41 -0
- package/dist/elements/svgHover.d.ts.map +1 -0
- package/dist/elements/svgHover.js +152 -0
- package/dist/elements/table.d.ts +52 -0
- package/dist/elements/table.d.ts.map +1 -0
- package/dist/elements/table.js +104 -0
- package/dist/elements/types.d.ts +25 -0
- package/dist/elements/types.d.ts.map +1 -0
- package/dist/elements/types.js +8 -0
- package/dist/elements/viewport.d.ts +53 -0
- package/dist/elements/viewport.d.ts.map +1 -0
- package/dist/elements/viewport.js +62 -0
- package/dist/elements/wheelZoom.d.ts +11 -0
- package/dist/elements/wheelZoom.d.ts.map +1 -0
- package/dist/elements/wheelZoom.js +7 -0
- package/dist/index.d.ts +11 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/platform/focus.d.ts +31 -0
- package/dist/platform/focus.d.ts.map +1 -0
- package/dist/platform/focus.js +86 -0
- package/dist/platform/index.d.ts +31 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +179 -0
- package/dist/platform/layout.d.ts +13 -0
- package/dist/platform/layout.d.ts.map +1 -0
- package/dist/platform/layout.js +15 -0
- package/dist/platform/position.d.ts +5 -0
- package/dist/platform/position.d.ts.map +1 -0
- package/dist/platform/position.js +177 -0
- package/dist/platform/stack.d.ts +86 -0
- package/dist/platform/stack.d.ts.map +1 -0
- package/dist/platform/stack.js +318 -0
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/package.json +66 -8
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-27T11:42:37.242Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-ui-react-native
|
|
@@ -11,13 +11,13 @@ Generated: 2026-11-16T01:09:21.575Z
|
|
|
11
11
|
React Native UI components for molecule.dev.
|
|
12
12
|
|
|
13
13
|
Provides React Native implementations (View/Pressable/Text-based) of the
|
|
14
|
-
core `@molecule/app-ui` component interfaces
|
|
14
|
+
core `@molecule/app-ui` component interfaces, including Accordion,
|
|
15
15
|
Alert, Avatar, Badge, Button, Card (+ CardHeader/CardTitle/CardDescription/
|
|
16
|
-
CardContent/CardFooter), Checkbox, Container, Dropdown, Flex, Form,
|
|
16
|
+
CardContent/CardFooter), Checkbox, Container, Dropdown, FileField, 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,8 @@ 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-clipboard @molecule/app-drag-drop @molecule/app-file-picker @molecule/app-filesystem @molecule/app-fonts @molecule/app-i18n @molecule/app-logger @molecule/app-react @molecule/app-routing @molecule/app-ui react
|
|
60
|
+
npm install -D @types/react
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
## API
|
|
@@ -67,6 +68,12 @@ npm install @molecule/app-ui-react-native @molecule/app-i18n @molecule/app-icons
|
|
|
67
68
|
|
|
68
69
|
Base props shared by all components.
|
|
69
70
|
|
|
71
|
+
Ref element: a component that renders one main element gives the caller that element, the one
|
|
72
|
+
that takes `className` and `style`. Each UI kit hands it over in its framework's own way: React
|
|
73
|
+
and Solid a `ref`, Vue a template ref's `$el`, Svelte `bind:ref`, Angular the component's
|
|
74
|
+
`element()` signal. It is empty while the element is not rendered (a closed Tooltip, Dropdown or
|
|
75
|
+
Modal). A component's own doc names the element when it is not the outermost one.
|
|
76
|
+
|
|
70
77
|
```typescript
|
|
71
78
|
interface BaseProps {
|
|
72
79
|
/**
|
|
@@ -93,260 +100,16 @@ interface BaseProps {
|
|
|
93
100
|
automationId?: string
|
|
94
101
|
|
|
95
102
|
/**
|
|
96
|
-
*
|
|
103
|
+
* Disables the controls the component renders: a disabled Button, Input, Textarea, Select,
|
|
104
|
+
* Checkbox, Switch, RadioGroup, Tabs, Accordion or Pagination takes no input, a disabled
|
|
105
|
+
* Dropdown never opens, and a disabled Card never calls `onClick` (an interactive one is
|
|
106
|
+
* announced as disabled and leaves the tab order). A component that renders no control
|
|
107
|
+
* (Badge, Spinner, Skeleton, a layout box) ignores it.
|
|
97
108
|
*/
|
|
98
109
|
disabled?: boolean
|
|
99
110
|
}
|
|
100
111
|
```
|
|
101
112
|
|
|
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
113
|
#### `RadioGroupProps`
|
|
351
114
|
|
|
352
115
|
Props for the RadioGroup component.
|
|
@@ -400,38 +163,12 @@ interface RadioGroupProps<T = string> extends BaseProps {
|
|
|
400
163
|
}
|
|
401
164
|
```
|
|
402
165
|
|
|
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
166
|
#### `ModalProps`
|
|
432
167
|
|
|
433
168
|
Props for the Modal/Dialog component.
|
|
434
169
|
|
|
170
|
+
Ref element: the dialog (`role="dialog"`), empty while closed.
|
|
171
|
+
|
|
435
172
|
```typescript
|
|
436
173
|
interface ModalProps extends HTMLElementProps {
|
|
437
174
|
/**
|
|
@@ -494,6 +231,14 @@ interface ModalProps extends HTMLElementProps {
|
|
|
494
231
|
* @default 'Close'
|
|
495
232
|
*/
|
|
496
233
|
closeLabel?: string
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* The control that takes focus when the modal opens, such as the field a dialog exists to fill.
|
|
237
|
+
* Without it, focus goes to the first focusable control, or to the dialog when it has none. The
|
|
238
|
+
* modal reads it once the open dialog is in the document, so a control rendered in the
|
|
239
|
+
* children can be named here.
|
|
240
|
+
*/
|
|
241
|
+
initialFocus?: OverlayTarget
|
|
497
242
|
}
|
|
498
243
|
```
|
|
499
244
|
|
|
@@ -600,6 +345,8 @@ interface BadgeProps extends HTMLElementProps {
|
|
|
600
345
|
|
|
601
346
|
Props for the Tooltip component (hover/focus popover with informational text).
|
|
602
347
|
|
|
348
|
+
Ref element: the `role="tooltip"` box, empty while hidden.
|
|
349
|
+
|
|
603
350
|
```typescript
|
|
604
351
|
interface TooltipProps extends HTMLElementProps {
|
|
605
352
|
/**
|
|
@@ -629,34 +376,6 @@ interface TooltipProps extends HTMLElementProps {
|
|
|
629
376
|
}
|
|
630
377
|
```
|
|
631
378
|
|
|
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
379
|
#### `FormProps`
|
|
661
380
|
|
|
662
381
|
Props for the Form component (wraps inputs with submission handling and validation).
|
|
@@ -906,6 +625,8 @@ interface AccordionProps<T = string> extends BaseProps {
|
|
|
906
625
|
|
|
907
626
|
Props for the Table component.
|
|
908
627
|
|
|
628
|
+
Ref element: the `<table>`.
|
|
629
|
+
|
|
909
630
|
```typescript
|
|
910
631
|
interface TableProps<T> extends HTMLElementProps {
|
|
911
632
|
/**
|
|
@@ -1067,6 +788,8 @@ interface SkeletonProps extends BaseProps {
|
|
|
1067
788
|
|
|
1068
789
|
Props for the Dropdown menu component.
|
|
1069
790
|
|
|
791
|
+
Ref element: the `role="menu"` element, empty while closed (`testId` and `automationId` go to the trigger).
|
|
792
|
+
|
|
1070
793
|
```typescript
|
|
1071
794
|
interface DropdownProps<T = string> extends BaseProps {
|
|
1072
795
|
/**
|
|
@@ -1112,6 +835,72 @@ interface DropdownProps<T = string> extends BaseProps {
|
|
|
1112
835
|
}
|
|
1113
836
|
```
|
|
1114
837
|
|
|
838
|
+
### Types
|
|
839
|
+
|
|
840
|
+
#### `ButtonProps`
|
|
841
|
+
|
|
842
|
+
Native button props. `onClick` signals activation.
|
|
843
|
+
|
|
844
|
+
```typescript
|
|
845
|
+
type ButtonProps = NativeControlProps<UI.ButtonProps, 'onClick'>
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
#### `CardProps`
|
|
849
|
+
|
|
850
|
+
Native card props. `onClick` signals activation.
|
|
851
|
+
|
|
852
|
+
```typescript
|
|
853
|
+
type CardProps = NativeControlProps<UI.CardProps, 'onClick'>
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
#### `CheckboxProps`
|
|
857
|
+
|
|
858
|
+
Native checkbox props. Use `onCheckedChange` to receive the new checked state.
|
|
859
|
+
|
|
860
|
+
```typescript
|
|
861
|
+
type CheckboxProps = NativeControlProps<UI.CheckboxProps>
|
|
862
|
+
```
|
|
863
|
+
|
|
864
|
+
#### `FlexProps`
|
|
865
|
+
|
|
866
|
+
Native layout props. `onClick` signals touch release.
|
|
867
|
+
|
|
868
|
+
```typescript
|
|
869
|
+
type FlexProps = NativeControlProps<UI.FlexProps, 'onClick'>
|
|
870
|
+
```
|
|
871
|
+
|
|
872
|
+
#### `InputProps`
|
|
873
|
+
|
|
874
|
+
Native input props. `onValueChange` receives the text, including an empty string on clear.
|
|
875
|
+
|
|
876
|
+
```typescript
|
|
877
|
+
type InputProps = NativeControlProps<UI.InputProps, 'onFocus' | 'onBlur'>
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
#### `SelectProps`
|
|
881
|
+
|
|
882
|
+
Native picker props. Use `onValueChange` to receive the selected value.
|
|
883
|
+
|
|
884
|
+
```typescript
|
|
885
|
+
type SelectProps<T = string> = NativeControlProps<UI.SelectProps<T>>
|
|
886
|
+
```
|
|
887
|
+
|
|
888
|
+
#### `SwitchProps`
|
|
889
|
+
|
|
890
|
+
Native switch props. Use `onCheckedChange` to receive the new checked state.
|
|
891
|
+
|
|
892
|
+
```typescript
|
|
893
|
+
type SwitchProps = NativeControlProps<UI.SwitchProps>
|
|
894
|
+
```
|
|
895
|
+
|
|
896
|
+
#### `TextareaProps`
|
|
897
|
+
|
|
898
|
+
Native textarea props. Use `onValueChange` to receive the new text.
|
|
899
|
+
|
|
900
|
+
```typescript
|
|
901
|
+
type TextareaProps = NativeControlProps<UI.TextareaProps, 'onFocus' | 'onBlur'>
|
|
902
|
+
```
|
|
903
|
+
|
|
1115
904
|
### Functions
|
|
1116
905
|
|
|
1117
906
|
#### `Accordion(props)`
|
|
@@ -1265,7 +1054,7 @@ function Button({
|
|
|
1265
1054
|
- `props.className` — CSS class name override.
|
|
1266
1055
|
- `props.testId` — Test identifier.
|
|
1267
1056
|
- `props.disabled` — Whether disabled.
|
|
1268
|
-
- `props.onClick` —
|
|
1057
|
+
- `props.onClick` — Called when the button is pressed.
|
|
1269
1058
|
|
|
1270
1059
|
**Returns:** The rendered Button element.
|
|
1271
1060
|
|
|
@@ -1283,6 +1072,7 @@ function Card({
|
|
|
1283
1072
|
style,
|
|
1284
1073
|
testId,
|
|
1285
1074
|
onClick,
|
|
1075
|
+
disabled,
|
|
1286
1076
|
}: CardProps): React.JSX.Element
|
|
1287
1077
|
```
|
|
1288
1078
|
|
|
@@ -1294,7 +1084,8 @@ function Card({
|
|
|
1294
1084
|
- `props.className` — CSS class name override.
|
|
1295
1085
|
- `props.style` — Inline style object.
|
|
1296
1086
|
- `props.testId` — Test identifier.
|
|
1297
|
-
- `props.onClick` —
|
|
1087
|
+
- `props.onClick` — Called when the card is pressed.
|
|
1088
|
+
- `props.disabled` — Whether the card is disabled.
|
|
1298
1089
|
|
|
1299
1090
|
**Returns:** The rendered Card element.
|
|
1300
1091
|
|
|
@@ -1407,7 +1198,7 @@ function Checkbox({
|
|
|
1407
1198
|
label,
|
|
1408
1199
|
checked,
|
|
1409
1200
|
indeterminate,
|
|
1410
|
-
|
|
1201
|
+
onCheckedChange,
|
|
1411
1202
|
error,
|
|
1412
1203
|
disabled,
|
|
1413
1204
|
className,
|
|
@@ -1419,7 +1210,7 @@ function Checkbox({
|
|
|
1419
1210
|
- `props.label` — Checkbox label text.
|
|
1420
1211
|
- `props.checked` — Whether checked.
|
|
1421
1212
|
- `props.indeterminate` — Whether indeterminate.
|
|
1422
|
-
- `props.
|
|
1213
|
+
- `props.onCheckedChange` — Receives the new checked state.
|
|
1423
1214
|
- `props.error` — Error message.
|
|
1424
1215
|
- `props.disabled` — Whether disabled.
|
|
1425
1216
|
- `props.className` — CSS class name override.
|
|
@@ -1586,7 +1377,7 @@ function Flex({
|
|
|
1586
1377
|
- `props.className` — CSS class name override.
|
|
1587
1378
|
- `props.style` — Inline style object.
|
|
1588
1379
|
- `props.testId` — Test identifier.
|
|
1589
|
-
- `props.onClick` —
|
|
1380
|
+
- `props.onClick` — Called on touch release.
|
|
1590
1381
|
|
|
1591
1382
|
**Returns:** The rendered Flex element.
|
|
1592
1383
|
|
|
@@ -1762,7 +1553,7 @@ function Select({
|
|
|
1762
1553
|
label,
|
|
1763
1554
|
options = [],
|
|
1764
1555
|
value,
|
|
1765
|
-
|
|
1556
|
+
onValueChange,
|
|
1766
1557
|
placeholder,
|
|
1767
1558
|
error,
|
|
1768
1559
|
hint,
|
|
@@ -1771,14 +1562,14 @@ function Select({
|
|
|
1771
1562
|
required,
|
|
1772
1563
|
className,
|
|
1773
1564
|
testId,
|
|
1774
|
-
}: SelectProps
|
|
1565
|
+
}: SelectProps): React.JSX.Element
|
|
1775
1566
|
```
|
|
1776
1567
|
|
|
1777
1568
|
- `props` — Component props.
|
|
1778
1569
|
- `props.label` — Select label text.
|
|
1779
1570
|
- `props.options` — Select options array.
|
|
1780
1571
|
- `props.value` — Selected value.
|
|
1781
|
-
- `props.
|
|
1572
|
+
- `props.onValueChange` — Receives the selected value.
|
|
1782
1573
|
- `props.placeholder` — Placeholder text.
|
|
1783
1574
|
- `props.error` — Error message.
|
|
1784
1575
|
- `props.hint` — Hint text.
|
|
@@ -1905,7 +1696,7 @@ Renders a Switch component.
|
|
|
1905
1696
|
function Switch({
|
|
1906
1697
|
label,
|
|
1907
1698
|
checked,
|
|
1908
|
-
|
|
1699
|
+
onCheckedChange,
|
|
1909
1700
|
size: _size = 'md',
|
|
1910
1701
|
disabled,
|
|
1911
1702
|
className,
|
|
@@ -1916,7 +1707,7 @@ function Switch({
|
|
|
1916
1707
|
- `props` — Component props.
|
|
1917
1708
|
- `props.label` — Switch label text.
|
|
1918
1709
|
- `props.checked` — Whether checked.
|
|
1919
|
-
- `props.
|
|
1710
|
+
- `props.onCheckedChange` — Receives the new checked state.
|
|
1920
1711
|
- `props.size` — Switch size (unused in RN).
|
|
1921
1712
|
- `props.disabled` — Whether disabled.
|
|
1922
1713
|
- `props.className` — CSS class name override.
|
|
@@ -2092,7 +1883,34 @@ function Tooltip({ children, content, className, testId }: TooltipProps): React.
|
|
|
2092
1883
|
Text input component.
|
|
2093
1884
|
|
|
2094
1885
|
```typescript
|
|
2095
|
-
const Input: React.ForwardRefExoticComponent<
|
|
1886
|
+
const Input: React.ForwardRefExoticComponent<
|
|
1887
|
+
Omit<
|
|
1888
|
+
InputProps,
|
|
1889
|
+
| 'onClick'
|
|
1890
|
+
| 'onDoubleClick'
|
|
1891
|
+
| 'onMouseEnter'
|
|
1892
|
+
| 'onMouseLeave'
|
|
1893
|
+
| 'onFocus'
|
|
1894
|
+
| 'onBlur'
|
|
1895
|
+
| 'onKeyDown'
|
|
1896
|
+
| 'onKeyUp'
|
|
1897
|
+
| 'onKeyPress'
|
|
1898
|
+
| 'onChange'
|
|
1899
|
+
| 'onInput'
|
|
1900
|
+
> & {
|
|
1901
|
+
onClick?: undefined
|
|
1902
|
+
onDoubleClick?: undefined
|
|
1903
|
+
onMouseEnter?: undefined
|
|
1904
|
+
onMouseLeave?: undefined
|
|
1905
|
+
onFocus?: (() => void) | undefined
|
|
1906
|
+
onBlur?: (() => void) | undefined
|
|
1907
|
+
onKeyDown?: undefined
|
|
1908
|
+
onKeyUp?: undefined
|
|
1909
|
+
onKeyPress?: undefined
|
|
1910
|
+
onChange?: undefined
|
|
1911
|
+
onInput?: undefined
|
|
1912
|
+
} & React.RefAttributes<TextInput>
|
|
1913
|
+
>
|
|
2096
1914
|
```
|
|
2097
1915
|
|
|
2098
1916
|
#### `Textarea`
|
|
@@ -2100,7 +1918,44 @@ const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<Te
|
|
|
2100
1918
|
Multi-line text input component.
|
|
2101
1919
|
|
|
2102
1920
|
```typescript
|
|
2103
|
-
const Textarea: React.ForwardRefExoticComponent<
|
|
1921
|
+
const Textarea: React.ForwardRefExoticComponent<
|
|
1922
|
+
Omit<
|
|
1923
|
+
TextareaProps,
|
|
1924
|
+
| 'onClick'
|
|
1925
|
+
| 'onDoubleClick'
|
|
1926
|
+
| 'onMouseEnter'
|
|
1927
|
+
| 'onMouseLeave'
|
|
1928
|
+
| 'onFocus'
|
|
1929
|
+
| 'onBlur'
|
|
1930
|
+
| 'onKeyDown'
|
|
1931
|
+
| 'onKeyUp'
|
|
1932
|
+
| 'onKeyPress'
|
|
1933
|
+
| 'onChange'
|
|
1934
|
+
| 'onInput'
|
|
1935
|
+
> & {
|
|
1936
|
+
onClick?: undefined
|
|
1937
|
+
onDoubleClick?: undefined
|
|
1938
|
+
onMouseEnter?: undefined
|
|
1939
|
+
onMouseLeave?: undefined
|
|
1940
|
+
onFocus?: (() => void) | undefined
|
|
1941
|
+
onBlur?: (() => void) | undefined
|
|
1942
|
+
onKeyDown?: undefined
|
|
1943
|
+
onKeyUp?: undefined
|
|
1944
|
+
onKeyPress?: undefined
|
|
1945
|
+
onChange?: undefined
|
|
1946
|
+
onInput?: undefined
|
|
1947
|
+
} & React.RefAttributes<TextInput>
|
|
1948
|
+
>
|
|
1949
|
+
```
|
|
1950
|
+
|
|
1951
|
+
#### `FileField`
|
|
1952
|
+
|
|
1953
|
+
Opens the bonded device picker from its browse target or the caller's `pick()` handle.
|
|
1954
|
+
|
|
1955
|
+
```typescript
|
|
1956
|
+
const FileField: ForwardRefExoticComponent<
|
|
1957
|
+
FileFieldProps<ReactNode> & RefAttributes<FileFieldHandle>
|
|
1958
|
+
>
|
|
2104
1959
|
```
|
|
2105
1960
|
|
|
2106
1961
|
## Injection Notes
|
|
@@ -2109,29 +1964,54 @@ const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttribu
|
|
|
2109
1964
|
|
|
2110
1965
|
Peer dependencies:
|
|
2111
1966
|
|
|
2112
|
-
- `@molecule/app-
|
|
2113
|
-
- `@molecule/app-
|
|
2114
|
-
- `@molecule/app-
|
|
2115
|
-
- `@molecule/app-
|
|
1967
|
+
- `@molecule/app-clipboard` ^1.0.5
|
|
1968
|
+
- `@molecule/app-drag-drop` ^1.2.0
|
|
1969
|
+
- `@molecule/app-file-picker` ^1.0.0
|
|
1970
|
+
- `@molecule/app-filesystem` ^1.1.0
|
|
1971
|
+
- `@molecule/app-fonts` ^1.4.1
|
|
1972
|
+
- `@molecule/app-i18n` ^1.3.0
|
|
1973
|
+
- `@molecule/app-icons` ^1.0.1 _(optional)_
|
|
1974
|
+
- `@molecule/app-logger` ^1.1.0
|
|
1975
|
+
- `@molecule/app-react` ^4.17.0
|
|
1976
|
+
- `@molecule/app-routing` ^1.5.3
|
|
1977
|
+
- `@molecule/app-ui` ^1.14.0
|
|
1978
|
+
- `@react-native-community/slider` ^4.5.6 _(optional)_
|
|
2116
1979
|
- `react` ^18.0.0 || ^19.0.0
|
|
2117
|
-
- `react-native` >=0.72.0
|
|
1980
|
+
- `react-native` >=0.72.0 _(optional)_
|
|
1981
|
+
- `react-native-safe-area-context` ^5.4.0 _(optional)_
|
|
1982
|
+
- `react-native-svg` ^15.11.2 _(optional)_
|
|
1983
|
+
- `react-native-url-polyfill` ^3.0.0 _(optional)_
|
|
2118
1984
|
|
|
2119
1985
|
### Runtime Dependencies
|
|
2120
1986
|
|
|
1987
|
+
- `@molecule/app-clipboard`
|
|
1988
|
+
- `@molecule/app-drag-drop`
|
|
1989
|
+
- `@molecule/app-file-picker`
|
|
1990
|
+
- `@molecule/app-filesystem`
|
|
1991
|
+
- `@molecule/app-fonts`
|
|
2121
1992
|
- `@molecule/app-i18n`
|
|
2122
|
-
- `@molecule/app-icons`
|
|
1993
|
+
- `@molecule/app-icons` _(optional)_
|
|
1994
|
+
- `@molecule/app-logger`
|
|
2123
1995
|
- `@molecule/app-react`
|
|
1996
|
+
- `@molecule/app-routing`
|
|
2124
1997
|
- `@molecule/app-ui`
|
|
1998
|
+
- `@react-native-community/slider` _(optional)_
|
|
2125
1999
|
- `react`
|
|
2126
|
-
- `react-native`
|
|
2000
|
+
- `react-native` _(optional)_
|
|
2001
|
+
- `react-native-safe-area-context` _(optional)_
|
|
2002
|
+
- `react-native-svg` _(optional)_
|
|
2003
|
+
- `react-native-url-polyfill` _(optional)_
|
|
2127
2004
|
|
|
2005
|
+
- Use `@molecule/app-ui-react-native/elements` for renderer-neutral device elements and
|
|
2006
|
+
`@molecule/app-ui-react-native/platform` for the device overlay host.
|
|
2128
2007
|
- **Styling requires NativeWind, not just setClassMap.** Components apply ClassMap classes via
|
|
2129
2008
|
`className` on React Native primitives — that prop only has an effect when the NativeWind
|
|
2130
2009
|
babel preset + Tailwind config are wired into the app AND `setClassMap(classMap)` from
|
|
2131
2010
|
`@molecule/app-ui-nativewind` has run. Missing either half renders the whole UI unstyled
|
|
2132
2011
|
with NO error. `getClassMap()` itself throws until `setClassMap` is called.
|
|
2133
|
-
-
|
|
2134
|
-
|
|
2012
|
+
- Fields report text and choices with `onValueChange` and checked state with
|
|
2013
|
+
`onCheckedChange`. Use eventless `onClick`, `onFocus`, `onBlur` and `onClear` callbacks
|
|
2014
|
+
to share handlers with the web kits.
|
|
2135
2015
|
- Toasts need `ToastProvider` mounted at the root; `useToast()` throws outside it.
|
|
2136
2016
|
|
|
2137
2017
|
## Translations
|