@molecule/app-ui 1.0.0 → 1.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 +3079 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +6 -5
package/README.md
ADDED
|
@@ -0,0 +1,3079 @@
|
|
|
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-13T00:16:07.131Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-ui
|
|
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
|
+
UI component interfaces for molecule.dev.
|
|
16
|
+
|
|
17
|
+
Provides standardized prop interfaces for common UI components
|
|
18
|
+
that can be implemented by different UI libraries (styled-components,
|
|
19
|
+
Tailwind, Ionic, etc.).
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { getClassMap, molIdProps } from '@molecule/app-ui'
|
|
25
|
+
const cm = getClassMap()
|
|
26
|
+
|
|
27
|
+
<button
|
|
28
|
+
className={cm.cn(cm.surface, cm.textSize('sm'))} // resolved classes — never a raw "px-3 text-sm"
|
|
29
|
+
{...molIdProps('save-button')} // data-mol-id for agents/tests
|
|
30
|
+
>…</button>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Type
|
|
34
|
+
|
|
35
|
+
`core`
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install @molecule/app-ui @molecule/app-bond @molecule/app-i18n
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## API
|
|
44
|
+
|
|
45
|
+
### Interfaces
|
|
46
|
+
|
|
47
|
+
#### `AccordionClassOptions`
|
|
48
|
+
|
|
49
|
+
Options for resolving accordion CSS classes via UIClassMap.
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
interface AccordionClassOptions {
|
|
53
|
+
variant?: string
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### `AccordionItem`
|
|
58
|
+
|
|
59
|
+
A single item in an Accordion component.
|
|
60
|
+
|
|
61
|
+
```typescript
|
|
62
|
+
interface AccordionItem<T = string> {
|
|
63
|
+
/**
|
|
64
|
+
* Item value/id.
|
|
65
|
+
*/
|
|
66
|
+
value: T
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Item header/trigger.
|
|
70
|
+
*/
|
|
71
|
+
header: Children
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Item content.
|
|
75
|
+
*/
|
|
76
|
+
content: Children
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Whether the item is disabled.
|
|
80
|
+
*/
|
|
81
|
+
disabled?: boolean
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### `AccordionProps`
|
|
86
|
+
|
|
87
|
+
Props for the Accordion component.
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
interface AccordionProps<T = string> extends BaseProps {
|
|
91
|
+
/**
|
|
92
|
+
* Accordion items.
|
|
93
|
+
*/
|
|
94
|
+
items: AccordionItem<T>[]
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Expanded item(s).
|
|
98
|
+
*/
|
|
99
|
+
value?: T | T[]
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Default expanded item(s).
|
|
103
|
+
*/
|
|
104
|
+
defaultValue?: T | T[]
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Change handler.
|
|
108
|
+
*/
|
|
109
|
+
onChange?: (value: T | T[]) => void
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Whether multiple items can be expanded.
|
|
113
|
+
*/
|
|
114
|
+
multiple?: boolean
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Whether items can be collapsed.
|
|
118
|
+
*/
|
|
119
|
+
collapsible?: boolean
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### `AlertClassOptions`
|
|
124
|
+
|
|
125
|
+
Options for resolving alert CSS classes via UIClassMap.
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
interface AlertClassOptions {
|
|
129
|
+
variant?: 'default' | 'info' | 'success' | 'warning' | 'error'
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
#### `AlertProps`
|
|
134
|
+
|
|
135
|
+
Props for the Alert component.
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
interface AlertProps extends HTMLElementProps {
|
|
139
|
+
/**
|
|
140
|
+
* Alert content.
|
|
141
|
+
*/
|
|
142
|
+
children?: Children
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Alert title.
|
|
146
|
+
*/
|
|
147
|
+
title?: string
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Alert status/type.
|
|
151
|
+
*/
|
|
152
|
+
status?: ColorVariant
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Alert variant.
|
|
156
|
+
*/
|
|
157
|
+
variant?: 'solid' | 'subtle' | 'outline' | 'left-accent'
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Whether the alert is dismissible.
|
|
161
|
+
*/
|
|
162
|
+
dismissible?: boolean
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Called when dismissed.
|
|
166
|
+
*/
|
|
167
|
+
onDismiss?: () => void
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Icon to display.
|
|
171
|
+
*/
|
|
172
|
+
icon?: Children
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Accessible label for the dismiss button.
|
|
176
|
+
* @default 'Dismiss'
|
|
177
|
+
*/
|
|
178
|
+
dismissLabel?: string
|
|
179
|
+
}
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### `AvatarClassOptions`
|
|
183
|
+
|
|
184
|
+
Options for resolving avatar CSS classes via UIClassMap.
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
interface AvatarClassOptions {
|
|
188
|
+
size?: Size
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
#### `AvatarProps`
|
|
193
|
+
|
|
194
|
+
Props for the Avatar component.
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
interface AvatarProps extends HTMLElementProps {
|
|
198
|
+
/**
|
|
199
|
+
* Image source URL.
|
|
200
|
+
*/
|
|
201
|
+
src?: string
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Alt text for the image.
|
|
205
|
+
*/
|
|
206
|
+
alt?: string
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Name for fallback initials.
|
|
210
|
+
*/
|
|
211
|
+
name?: string
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Avatar size.
|
|
215
|
+
*/
|
|
216
|
+
size?: Size | number
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Whether the avatar is rounded.
|
|
220
|
+
*/
|
|
221
|
+
rounded?: boolean
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Fallback element when no image.
|
|
225
|
+
*/
|
|
226
|
+
fallback?: Children
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### `BadgeClassOptions`
|
|
231
|
+
|
|
232
|
+
Options for resolving badge CSS classes via UIClassMap.
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
interface BadgeClassOptions {
|
|
236
|
+
variant?: ColorVariant
|
|
237
|
+
size?: Size
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
#### `BadgeProps`
|
|
242
|
+
|
|
243
|
+
Props for the Badge component (status labels, counts, tags).
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
interface BadgeProps extends HTMLElementProps {
|
|
247
|
+
/**
|
|
248
|
+
* Badge content.
|
|
249
|
+
*/
|
|
250
|
+
children?: Children
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Badge color.
|
|
254
|
+
*/
|
|
255
|
+
color?: ColorVariant
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Badge variant.
|
|
259
|
+
*/
|
|
260
|
+
variant?: 'solid' | 'outline' | 'subtle'
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Badge size.
|
|
264
|
+
*/
|
|
265
|
+
size?: Size
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Whether the badge is rounded.
|
|
269
|
+
*/
|
|
270
|
+
rounded?: boolean
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
#### `BaseProps`
|
|
275
|
+
|
|
276
|
+
Base props shared by all components.
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
interface BaseProps {
|
|
280
|
+
/**
|
|
281
|
+
* Additional CSS class name(s).
|
|
282
|
+
*/
|
|
283
|
+
className?: string
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Inline styles.
|
|
287
|
+
*/
|
|
288
|
+
style?: CSSProperties
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Test ID for automated testing.
|
|
292
|
+
*/
|
|
293
|
+
testId?: string
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Automation ID for AI agents and E2E tests. Maps to the `data-mol-id`
|
|
297
|
+
* HTML attribute. Use `molId()` from `./automation.js` to generate
|
|
298
|
+
* semantic IDs. (Tooling only — screen readers do not expose `data-*`
|
|
299
|
+
* attributes; accessible names come from labels/`aria-*`.)
|
|
300
|
+
*/
|
|
301
|
+
automationId?: string
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* Whether the component is disabled.
|
|
305
|
+
*/
|
|
306
|
+
disabled?: boolean
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### `ButtonClassOptions`
|
|
311
|
+
|
|
312
|
+
Options for resolving button CSS classes via UIClassMap.
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
interface ButtonClassOptions {
|
|
316
|
+
variant?: ButtonVariant
|
|
317
|
+
color?: ColorVariant
|
|
318
|
+
size?: ButtonSize
|
|
319
|
+
fullWidth?: boolean
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
#### `ButtonElementProps`
|
|
324
|
+
|
|
325
|
+
Base props for button elements.
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
interface ButtonElementProps extends HTMLElementProps {
|
|
329
|
+
type?: 'button' | 'submit' | 'reset'
|
|
330
|
+
name?: string
|
|
331
|
+
value?: string
|
|
332
|
+
form?: string
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
#### `ButtonProps`
|
|
337
|
+
|
|
338
|
+
Props for the Button component.
|
|
339
|
+
|
|
340
|
+
```typescript
|
|
341
|
+
interface ButtonProps extends ButtonElementProps {
|
|
342
|
+
/**
|
|
343
|
+
* Button content.
|
|
344
|
+
*/
|
|
345
|
+
children?: Children
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Visual variant.
|
|
349
|
+
*/
|
|
350
|
+
variant?: ButtonVariant
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Color scheme.
|
|
354
|
+
*/
|
|
355
|
+
color?: ColorVariant
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Button size.
|
|
359
|
+
*/
|
|
360
|
+
size?: ButtonSize
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Whether the button is in a loading state.
|
|
364
|
+
*/
|
|
365
|
+
loading?: boolean
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Loading text to display.
|
|
369
|
+
*/
|
|
370
|
+
loadingText?: string
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Whether the button takes full width.
|
|
374
|
+
*/
|
|
375
|
+
fullWidth?: boolean
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Icon to display before the label.
|
|
379
|
+
*/
|
|
380
|
+
leftIcon?: Children
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Icon to display after the label.
|
|
384
|
+
*/
|
|
385
|
+
rightIcon?: Children
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
#### `CardClassOptions`
|
|
390
|
+
|
|
391
|
+
Options for resolving card CSS classes via UIClassMap.
|
|
392
|
+
|
|
393
|
+
```typescript
|
|
394
|
+
interface CardClassOptions {
|
|
395
|
+
variant?: 'default' | 'elevated' | 'outline' | 'ghost'
|
|
396
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
#### `CardProps`
|
|
400
|
+
|
|
401
|
+
Props for the Card container component (elevated, outlined, or filled surface).
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
interface CardProps extends HTMLElementProps {
|
|
405
|
+
/**
|
|
406
|
+
* Card content.
|
|
407
|
+
*/
|
|
408
|
+
children?: Children
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Card variant.
|
|
412
|
+
*/
|
|
413
|
+
variant?: 'elevated' | 'outlined' | 'filled'
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Whether the card is interactive (clickable).
|
|
417
|
+
*/
|
|
418
|
+
interactive?: boolean
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Padding size.
|
|
422
|
+
*/
|
|
423
|
+
padding?: Size | 'none'
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
#### `CheckboxClassOptions`
|
|
428
|
+
|
|
429
|
+
Options for resolving checkbox CSS classes via UIClassMap.
|
|
430
|
+
|
|
431
|
+
```typescript
|
|
432
|
+
interface CheckboxClassOptions {
|
|
433
|
+
error?: boolean
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
#### `CheckboxProps`
|
|
438
|
+
|
|
439
|
+
Props for the Checkbox component.
|
|
440
|
+
|
|
441
|
+
```typescript
|
|
442
|
+
interface CheckboxProps extends InputElementProps {
|
|
443
|
+
/**
|
|
444
|
+
* Checkbox label.
|
|
445
|
+
*/
|
|
446
|
+
label?: Children
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Whether the checkbox is checked.
|
|
450
|
+
*/
|
|
451
|
+
checked?: boolean
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Whether the checkbox is in an indeterminate state.
|
|
455
|
+
*/
|
|
456
|
+
indeterminate?: boolean
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Checkbox size.
|
|
460
|
+
*/
|
|
461
|
+
size?: Size
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Error message.
|
|
465
|
+
*/
|
|
466
|
+
error?: string
|
|
467
|
+
}
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
#### `ContainerClassOptions`
|
|
471
|
+
|
|
472
|
+
Options for container class resolution.
|
|
473
|
+
|
|
474
|
+
```typescript
|
|
475
|
+
interface ContainerClassOptions {
|
|
476
|
+
size?: Size | '2xl' | 'full'
|
|
477
|
+
}
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
#### `ContainerProps`
|
|
481
|
+
|
|
482
|
+
Props for the Container layout component.
|
|
483
|
+
|
|
484
|
+
```typescript
|
|
485
|
+
interface ContainerProps extends HTMLElementProps {
|
|
486
|
+
/**
|
|
487
|
+
* Container content.
|
|
488
|
+
*/
|
|
489
|
+
children?: Children
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Maximum width.
|
|
493
|
+
*/
|
|
494
|
+
maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | string
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Whether to center the container.
|
|
498
|
+
*/
|
|
499
|
+
centered?: boolean
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Horizontal padding.
|
|
503
|
+
*/
|
|
504
|
+
paddingX?: Size | string
|
|
505
|
+
}
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
#### `CSSProperties`
|
|
509
|
+
|
|
510
|
+
Framework-agnostic CSS properties.
|
|
511
|
+
Mirrors React.CSSProperties but without React dependency.
|
|
512
|
+
|
|
513
|
+
```typescript
|
|
514
|
+
interface CSSProperties {
|
|
515
|
+
[key: string]: string | number | undefined
|
|
516
|
+
}
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
#### `DropdownItem`
|
|
520
|
+
|
|
521
|
+
Dropdown menu item.
|
|
522
|
+
|
|
523
|
+
```typescript
|
|
524
|
+
interface DropdownItem<T = string> {
|
|
525
|
+
/**
|
|
526
|
+
* Item value/id.
|
|
527
|
+
*/
|
|
528
|
+
value: T
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* Display label.
|
|
532
|
+
*/
|
|
533
|
+
label: Children
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Whether the item is disabled.
|
|
537
|
+
*/
|
|
538
|
+
disabled?: boolean
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Icon to display.
|
|
542
|
+
*/
|
|
543
|
+
icon?: Children
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Keyboard shortcut display.
|
|
547
|
+
*/
|
|
548
|
+
shortcut?: string
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Whether this is a separator.
|
|
552
|
+
*/
|
|
553
|
+
separator?: boolean
|
|
554
|
+
|
|
555
|
+
/**
|
|
556
|
+
* Nested items (for submenus).
|
|
557
|
+
*/
|
|
558
|
+
items?: DropdownItem<T>[]
|
|
559
|
+
}
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
#### `DropdownProps`
|
|
563
|
+
|
|
564
|
+
Props for the Dropdown menu component.
|
|
565
|
+
|
|
566
|
+
```typescript
|
|
567
|
+
interface DropdownProps<T = string> extends BaseProps {
|
|
568
|
+
/**
|
|
569
|
+
* Dropdown trigger element.
|
|
570
|
+
*/
|
|
571
|
+
trigger: Children
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Dropdown items.
|
|
575
|
+
*/
|
|
576
|
+
items: DropdownItem<T>[]
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Called when an item is selected.
|
|
580
|
+
*/
|
|
581
|
+
onSelect?: (value: T) => void
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Dropdown placement.
|
|
585
|
+
*/
|
|
586
|
+
placement?:
|
|
587
|
+
'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'right'
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Whether the dropdown is open (controlled).
|
|
591
|
+
*/
|
|
592
|
+
open?: boolean
|
|
593
|
+
|
|
594
|
+
/**
|
|
595
|
+
* Called when open state changes.
|
|
596
|
+
*/
|
|
597
|
+
onOpenChange?: (open: boolean) => void
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Menu alignment.
|
|
601
|
+
*/
|
|
602
|
+
align?: 'start' | 'center' | 'end'
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* Menu width.
|
|
606
|
+
*/
|
|
607
|
+
width?: 'trigger' | 'auto' | number | string
|
|
608
|
+
}
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
#### `EmptyStateProps`
|
|
612
|
+
|
|
613
|
+
Props for the EmptyState component — shown when a list or section has no data.
|
|
614
|
+
|
|
615
|
+
```typescript
|
|
616
|
+
interface EmptyStateProps extends BaseProps {
|
|
617
|
+
/** Icon or illustration to display. */
|
|
618
|
+
icon?: Children
|
|
619
|
+
/** Main heading text. */
|
|
620
|
+
title: string
|
|
621
|
+
/** Description text. */
|
|
622
|
+
description?: string
|
|
623
|
+
/** Primary action button (e.g., "Create first item"). */
|
|
624
|
+
action?: Children
|
|
625
|
+
}
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
#### `FlexClassOptions`
|
|
629
|
+
|
|
630
|
+
Options for flex class resolution.
|
|
631
|
+
|
|
632
|
+
```typescript
|
|
633
|
+
interface FlexClassOptions {
|
|
634
|
+
direction?: 'row' | 'col' | 'row-reverse' | 'col-reverse'
|
|
635
|
+
align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline'
|
|
636
|
+
justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly'
|
|
637
|
+
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse'
|
|
638
|
+
/** Named tokens or Tailwind spacing scale index (e.g. `3` → `gap-3`). */
|
|
639
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number
|
|
640
|
+
}
|
|
641
|
+
```
|
|
642
|
+
|
|
643
|
+
#### `FlexProps`
|
|
644
|
+
|
|
645
|
+
Flex container props.
|
|
646
|
+
|
|
647
|
+
```typescript
|
|
648
|
+
interface FlexProps extends HTMLElementProps {
|
|
649
|
+
/**
|
|
650
|
+
* Flex content.
|
|
651
|
+
*/
|
|
652
|
+
children?: Children
|
|
653
|
+
|
|
654
|
+
/**
|
|
655
|
+
* Flex direction.
|
|
656
|
+
*/
|
|
657
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Justify content.
|
|
661
|
+
*/
|
|
662
|
+
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'
|
|
663
|
+
|
|
664
|
+
/**
|
|
665
|
+
* Align items.
|
|
666
|
+
*/
|
|
667
|
+
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Flex wrap.
|
|
671
|
+
*/
|
|
672
|
+
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse'
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Gap between items.
|
|
676
|
+
*/
|
|
677
|
+
gap?: Size | string | number
|
|
678
|
+
}
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
#### `FormElementProps`
|
|
682
|
+
|
|
683
|
+
Base props for form elements.
|
|
684
|
+
|
|
685
|
+
```typescript
|
|
686
|
+
interface FormElementProps extends HTMLElementProps {
|
|
687
|
+
action?: string
|
|
688
|
+
method?: 'get' | 'post'
|
|
689
|
+
encType?: string
|
|
690
|
+
target?: string
|
|
691
|
+
noValidate?: boolean
|
|
692
|
+
autoComplete?: 'on' | 'off'
|
|
693
|
+
onSubmit?: FormEventHandler
|
|
694
|
+
onReset?: FormEventHandler
|
|
695
|
+
}
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
#### `FormFieldProps`
|
|
699
|
+
|
|
700
|
+
Form field wrapper props.
|
|
701
|
+
|
|
702
|
+
```typescript
|
|
703
|
+
interface FormFieldProps extends HTMLElementProps {
|
|
704
|
+
/**
|
|
705
|
+
* Field content.
|
|
706
|
+
*/
|
|
707
|
+
children?: Children
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Field label.
|
|
711
|
+
*/
|
|
712
|
+
label?: string
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Field name.
|
|
716
|
+
*/
|
|
717
|
+
name?: string
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Error message.
|
|
721
|
+
*/
|
|
722
|
+
error?: string
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Hint/help text.
|
|
726
|
+
*/
|
|
727
|
+
hint?: string
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Whether the field is required.
|
|
731
|
+
*/
|
|
732
|
+
required?: boolean
|
|
733
|
+
}
|
|
734
|
+
```
|
|
735
|
+
|
|
736
|
+
#### `FormProps`
|
|
737
|
+
|
|
738
|
+
Props for the Form component (wraps inputs with submission handling and validation).
|
|
739
|
+
|
|
740
|
+
```typescript
|
|
741
|
+
interface FormProps extends FormElementProps {
|
|
742
|
+
/**
|
|
743
|
+
* Form content.
|
|
744
|
+
*/
|
|
745
|
+
children?: Children
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Submit handler with form data.
|
|
749
|
+
*/
|
|
750
|
+
onFormSubmit?: (data: Record<string, unknown>) => void | Promise<void>
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Whether the form is submitting.
|
|
754
|
+
*/
|
|
755
|
+
submitting?: boolean
|
|
756
|
+
}
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
#### `GridClassOptions`
|
|
760
|
+
|
|
761
|
+
Options for grid class resolution.
|
|
762
|
+
|
|
763
|
+
```typescript
|
|
764
|
+
interface GridClassOptions {
|
|
765
|
+
cols?: number
|
|
766
|
+
/** Named tokens or Tailwind spacing scale index (e.g. `10` → `gap-10`). */
|
|
767
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | number
|
|
768
|
+
/**
|
|
769
|
+
* Mobile-first responsive collapse. When omitted (the default), a grid of
|
|
770
|
+
* `cols >= 2` starts at a single column on small screens and steps up to
|
|
771
|
+
* `cols` at larger breakpoints, so cards don't overflow on mobile. Pass
|
|
772
|
+
* `false` for a FIXED `cols`-column grid at every viewport width. Ignored
|
|
773
|
+
* for `cols <= 1` (always single-column) and by ClassMap bonds without a
|
|
774
|
+
* breakpoint system (e.g. NativeWind).
|
|
775
|
+
*/
|
|
776
|
+
responsive?: boolean
|
|
777
|
+
}
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
#### `GridProps`
|
|
781
|
+
|
|
782
|
+
Grid container props.
|
|
783
|
+
|
|
784
|
+
```typescript
|
|
785
|
+
interface GridProps extends HTMLElementProps {
|
|
786
|
+
/**
|
|
787
|
+
* Grid content.
|
|
788
|
+
*/
|
|
789
|
+
children?: Children
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Number of columns.
|
|
793
|
+
*/
|
|
794
|
+
columns?: number | string
|
|
795
|
+
|
|
796
|
+
/**
|
|
797
|
+
* Number of rows.
|
|
798
|
+
*/
|
|
799
|
+
rows?: number | string
|
|
800
|
+
|
|
801
|
+
/**
|
|
802
|
+
* Gap between items.
|
|
803
|
+
*/
|
|
804
|
+
gap?: Size | string | number
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* Column gap.
|
|
808
|
+
*/
|
|
809
|
+
columnGap?: Size | string | number
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Row gap.
|
|
813
|
+
*/
|
|
814
|
+
rowGap?: Size | string | number
|
|
815
|
+
}
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
#### `HTMLElementProps`
|
|
819
|
+
|
|
820
|
+
Base props for HTML elements.
|
|
821
|
+
Framework bindings should extend this with framework-specific attributes.
|
|
822
|
+
|
|
823
|
+
```typescript
|
|
824
|
+
interface HTMLElementProps extends BaseProps {
|
|
825
|
+
id?: string
|
|
826
|
+
title?: string
|
|
827
|
+
tabIndex?: number
|
|
828
|
+
role?: string
|
|
829
|
+
'aria-label'?: string
|
|
830
|
+
'aria-labelledby'?: string
|
|
831
|
+
'aria-describedby'?: string
|
|
832
|
+
'aria-hidden'?: boolean
|
|
833
|
+
'aria-disabled'?: boolean
|
|
834
|
+
'aria-expanded'?: boolean
|
|
835
|
+
'aria-selected'?: boolean
|
|
836
|
+
'aria-checked'?: boolean | 'mixed'
|
|
837
|
+
'aria-pressed'?: boolean | 'mixed'
|
|
838
|
+
'aria-invalid'?: boolean
|
|
839
|
+
'aria-required'?: boolean
|
|
840
|
+
'aria-readonly'?: boolean
|
|
841
|
+
'aria-busy'?: boolean
|
|
842
|
+
'aria-live'?: 'off' | 'polite' | 'assertive'
|
|
843
|
+
onClick?: MouseEventHandler
|
|
844
|
+
onDoubleClick?: MouseEventHandler
|
|
845
|
+
onMouseEnter?: MouseEventHandler
|
|
846
|
+
onMouseLeave?: MouseEventHandler
|
|
847
|
+
onFocus?: FocusEventHandler
|
|
848
|
+
onBlur?: FocusEventHandler
|
|
849
|
+
onKeyDown?: KeyboardEventHandler
|
|
850
|
+
onKeyUp?: KeyboardEventHandler
|
|
851
|
+
onKeyPress?: KeyboardEventHandler
|
|
852
|
+
}
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
#### `InputClassOptions`
|
|
856
|
+
|
|
857
|
+
Options for resolving input CSS classes via UIClassMap.
|
|
858
|
+
|
|
859
|
+
```typescript
|
|
860
|
+
interface InputClassOptions {
|
|
861
|
+
error?: boolean
|
|
862
|
+
size?: Size
|
|
863
|
+
/**
|
|
864
|
+
* Horizontal text alignment inside the input. Bonds may default to a
|
|
865
|
+
* centered aesthetic (e.g. the Tailwind bond's floating-label style);
|
|
866
|
+
* `'left'` opts a specific field out — e.g. a form field sitting next to
|
|
867
|
+
* left-aligned textareas.
|
|
868
|
+
*/
|
|
869
|
+
align?: 'left' | 'center'
|
|
870
|
+
}
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
#### `InputElementProps`
|
|
874
|
+
|
|
875
|
+
Base props for input elements.
|
|
876
|
+
|
|
877
|
+
```typescript
|
|
878
|
+
interface InputElementProps extends HTMLElementProps {
|
|
879
|
+
name?: string
|
|
880
|
+
value?: string | number | readonly string[]
|
|
881
|
+
defaultValue?: string | number | readonly string[]
|
|
882
|
+
placeholder?: string
|
|
883
|
+
required?: boolean
|
|
884
|
+
readOnly?: boolean
|
|
885
|
+
autoFocus?: boolean
|
|
886
|
+
autoComplete?: string
|
|
887
|
+
maxLength?: number
|
|
888
|
+
minLength?: number
|
|
889
|
+
pattern?: string
|
|
890
|
+
onChange?: ChangeEventHandler
|
|
891
|
+
onInput?: FormEventHandler
|
|
892
|
+
}
|
|
893
|
+
```
|
|
894
|
+
|
|
895
|
+
#### `InputProps`
|
|
896
|
+
|
|
897
|
+
Props for the Input component (text field, email, password, etc.).
|
|
898
|
+
|
|
899
|
+
```typescript
|
|
900
|
+
interface InputProps extends InputElementProps {
|
|
901
|
+
/**
|
|
902
|
+
* Input type.
|
|
903
|
+
*/
|
|
904
|
+
type?: InputType
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* Input size.
|
|
908
|
+
*/
|
|
909
|
+
size?: Size
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Horizontal text alignment inside the input (see
|
|
913
|
+
* {@link InputClassOptions.align}). Defaults to the bond's own style.
|
|
914
|
+
*/
|
|
915
|
+
align?: 'left' | 'center'
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Label text.
|
|
919
|
+
*/
|
|
920
|
+
label?: string
|
|
921
|
+
|
|
922
|
+
/**
|
|
923
|
+
* Error message.
|
|
924
|
+
*/
|
|
925
|
+
error?: string
|
|
926
|
+
|
|
927
|
+
/**
|
|
928
|
+
* Hint/help text.
|
|
929
|
+
*/
|
|
930
|
+
hint?: string
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Element to display on the left.
|
|
934
|
+
*/
|
|
935
|
+
leftElement?: Children
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Element to display on the right.
|
|
939
|
+
*/
|
|
940
|
+
rightElement?: Children
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Whether to show a clear button.
|
|
944
|
+
*/
|
|
945
|
+
clearable?: boolean
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Called when the clear button is clicked.
|
|
949
|
+
*/
|
|
950
|
+
onClear?: () => void
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Accessible label for the clear button.
|
|
954
|
+
* @default 'Clear'
|
|
955
|
+
*/
|
|
956
|
+
clearLabel?: string
|
|
957
|
+
}
|
|
958
|
+
```
|
|
959
|
+
|
|
960
|
+
#### `LabelClassOptions`
|
|
961
|
+
|
|
962
|
+
Options for label class resolution.
|
|
963
|
+
|
|
964
|
+
```typescript
|
|
965
|
+
interface LabelClassOptions {
|
|
966
|
+
required?: boolean
|
|
967
|
+
}
|
|
968
|
+
```
|
|
969
|
+
|
|
970
|
+
#### `ModalClassOptions`
|
|
971
|
+
|
|
972
|
+
Options for resolving modal/dialog CSS classes via UIClassMap.
|
|
973
|
+
|
|
974
|
+
```typescript
|
|
975
|
+
interface ModalClassOptions {
|
|
976
|
+
size?: ModalSize
|
|
977
|
+
}
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
#### `ModalProps`
|
|
981
|
+
|
|
982
|
+
Props for the Modal/Dialog component.
|
|
983
|
+
|
|
984
|
+
```typescript
|
|
985
|
+
interface ModalProps extends HTMLElementProps {
|
|
986
|
+
/**
|
|
987
|
+
* Whether the modal is open.
|
|
988
|
+
*/
|
|
989
|
+
open: boolean
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Called when the modal should close.
|
|
993
|
+
*/
|
|
994
|
+
onClose: () => void
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* Modal title.
|
|
998
|
+
*/
|
|
999
|
+
title?: string
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Modal content.
|
|
1003
|
+
*/
|
|
1004
|
+
children?: Children
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* Modal size.
|
|
1008
|
+
*/
|
|
1009
|
+
size?: ModalSize
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* Whether to show a close button.
|
|
1013
|
+
*/
|
|
1014
|
+
showCloseButton?: boolean
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Whether clicking the overlay closes the modal.
|
|
1018
|
+
*/
|
|
1019
|
+
closeOnOverlayClick?: boolean
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Whether pressing Escape closes the modal.
|
|
1023
|
+
*/
|
|
1024
|
+
closeOnEscape?: boolean
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Footer content (typically action buttons).
|
|
1028
|
+
*/
|
|
1029
|
+
footer?: Children
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Whether the modal is centered vertically.
|
|
1033
|
+
*/
|
|
1034
|
+
centered?: boolean
|
|
1035
|
+
|
|
1036
|
+
/**
|
|
1037
|
+
* Whether to prevent body scroll when open.
|
|
1038
|
+
*/
|
|
1039
|
+
preventScroll?: boolean
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Accessible label for the close button.
|
|
1043
|
+
* @default 'Close'
|
|
1044
|
+
*/
|
|
1045
|
+
closeLabel?: string
|
|
1046
|
+
}
|
|
1047
|
+
```
|
|
1048
|
+
|
|
1049
|
+
#### `PageHeaderProps`
|
|
1050
|
+
|
|
1051
|
+
Props for the PageHeader component — consistent page title area.
|
|
1052
|
+
|
|
1053
|
+
```typescript
|
|
1054
|
+
interface PageHeaderProps extends BaseProps {
|
|
1055
|
+
/** Page title. */
|
|
1056
|
+
title: string
|
|
1057
|
+
/** Page description. */
|
|
1058
|
+
description?: string
|
|
1059
|
+
/** Action buttons (e.g., "Create", "Export"). */
|
|
1060
|
+
actions?: Children
|
|
1061
|
+
/** Breadcrumb trail. */
|
|
1062
|
+
breadcrumbs?: Array<{ label: string; href?: string }>
|
|
1063
|
+
}
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
#### `PageShellProps`
|
|
1067
|
+
|
|
1068
|
+
Props for the PageShell component — authenticated page wrapper with navigation.
|
|
1069
|
+
|
|
1070
|
+
```typescript
|
|
1071
|
+
interface PageShellProps extends BaseProps {
|
|
1072
|
+
/** Sidebar content (navigation links). */
|
|
1073
|
+
sidebar?: Children
|
|
1074
|
+
/** Top bar content (breadcrumbs, user menu). */
|
|
1075
|
+
topbar?: Children
|
|
1076
|
+
/** Whether the sidebar is collapsed. */
|
|
1077
|
+
sidebarCollapsed?: boolean
|
|
1078
|
+
/** Callback when sidebar toggle is clicked. */
|
|
1079
|
+
onSidebarToggle?: () => void
|
|
1080
|
+
/** Main content. */
|
|
1081
|
+
children?: Children
|
|
1082
|
+
}
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
#### `PaginationClassOptions`
|
|
1086
|
+
|
|
1087
|
+
Options for pagination item class resolution.
|
|
1088
|
+
|
|
1089
|
+
```typescript
|
|
1090
|
+
interface PaginationClassOptions {
|
|
1091
|
+
active?: boolean
|
|
1092
|
+
size?: Size
|
|
1093
|
+
}
|
|
1094
|
+
```
|
|
1095
|
+
|
|
1096
|
+
#### `PaginationProps`
|
|
1097
|
+
|
|
1098
|
+
Props for the Pagination component (page navigation with current page, total, page size, and change callbacks).
|
|
1099
|
+
|
|
1100
|
+
```typescript
|
|
1101
|
+
interface PaginationProps extends BaseProps {
|
|
1102
|
+
/**
|
|
1103
|
+
* Current page (1-indexed).
|
|
1104
|
+
*/
|
|
1105
|
+
page: number
|
|
1106
|
+
|
|
1107
|
+
/**
|
|
1108
|
+
* Total number of pages.
|
|
1109
|
+
*/
|
|
1110
|
+
totalPages: number
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Page change handler.
|
|
1114
|
+
*/
|
|
1115
|
+
onChange: (page: number) => void
|
|
1116
|
+
|
|
1117
|
+
/**
|
|
1118
|
+
* Number of sibling pages to show.
|
|
1119
|
+
*/
|
|
1120
|
+
siblings?: number
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Number of boundary pages to show.
|
|
1124
|
+
*/
|
|
1125
|
+
boundaries?: number
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* Pagination size.
|
|
1129
|
+
*/
|
|
1130
|
+
size?: Size
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* Whether to show first/last buttons.
|
|
1134
|
+
*/
|
|
1135
|
+
showFirstLast?: boolean
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Whether to show previous/next buttons.
|
|
1139
|
+
*/
|
|
1140
|
+
showPrevNext?: boolean
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* Accessible labels for pagination controls.
|
|
1144
|
+
*/
|
|
1145
|
+
labels?: {
|
|
1146
|
+
nav?: string
|
|
1147
|
+
first?: string
|
|
1148
|
+
previous?: string
|
|
1149
|
+
next?: string
|
|
1150
|
+
last?: string
|
|
1151
|
+
goToPage?: (page: number) => string
|
|
1152
|
+
}
|
|
1153
|
+
}
|
|
1154
|
+
```
|
|
1155
|
+
|
|
1156
|
+
#### `RadioClassOptions`
|
|
1157
|
+
|
|
1158
|
+
Options for resolving radio CSS classes via UIClassMap.
|
|
1159
|
+
|
|
1160
|
+
```typescript
|
|
1161
|
+
interface RadioClassOptions {
|
|
1162
|
+
error?: boolean
|
|
1163
|
+
}
|
|
1164
|
+
```
|
|
1165
|
+
|
|
1166
|
+
#### `RadioGroupProps`
|
|
1167
|
+
|
|
1168
|
+
Props for the RadioGroup component.
|
|
1169
|
+
|
|
1170
|
+
```typescript
|
|
1171
|
+
interface RadioGroupProps<T = string> extends BaseProps {
|
|
1172
|
+
/**
|
|
1173
|
+
* Radio options.
|
|
1174
|
+
*/
|
|
1175
|
+
options: RadioOption<T>[]
|
|
1176
|
+
|
|
1177
|
+
/**
|
|
1178
|
+
* Current value.
|
|
1179
|
+
*/
|
|
1180
|
+
value?: T
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Change handler.
|
|
1184
|
+
*/
|
|
1185
|
+
onChange?: (value: T) => void
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* Radio size.
|
|
1189
|
+
*/
|
|
1190
|
+
size?: Size
|
|
1191
|
+
|
|
1192
|
+
/**
|
|
1193
|
+
* Group label.
|
|
1194
|
+
*/
|
|
1195
|
+
label?: string
|
|
1196
|
+
|
|
1197
|
+
/**
|
|
1198
|
+
* Shared `name` attribute for the group's radio inputs (used for native
|
|
1199
|
+
* form submission). When omitted, a unique per-instance name is generated
|
|
1200
|
+
* so separate groups never merge — the visible `label` is deliberately
|
|
1201
|
+
* NOT used as the name, because two groups with the same label (e.g. two
|
|
1202
|
+
* "Size" pickers) would otherwise form ONE native radio group and
|
|
1203
|
+
* deselect each other.
|
|
1204
|
+
*/
|
|
1205
|
+
name?: string
|
|
1206
|
+
|
|
1207
|
+
/**
|
|
1208
|
+
* Layout direction.
|
|
1209
|
+
*/
|
|
1210
|
+
direction?: 'horizontal' | 'vertical'
|
|
1211
|
+
|
|
1212
|
+
/**
|
|
1213
|
+
* Error message.
|
|
1214
|
+
*/
|
|
1215
|
+
error?: string
|
|
1216
|
+
}
|
|
1217
|
+
```
|
|
1218
|
+
|
|
1219
|
+
#### `RadioOption`
|
|
1220
|
+
|
|
1221
|
+
A single option in a RadioGroup.
|
|
1222
|
+
|
|
1223
|
+
```typescript
|
|
1224
|
+
interface RadioOption<T = string> {
|
|
1225
|
+
/**
|
|
1226
|
+
* Option value.
|
|
1227
|
+
*/
|
|
1228
|
+
value: T
|
|
1229
|
+
|
|
1230
|
+
/**
|
|
1231
|
+
* Display label.
|
|
1232
|
+
*/
|
|
1233
|
+
label: Children
|
|
1234
|
+
|
|
1235
|
+
/**
|
|
1236
|
+
* Whether the option is disabled.
|
|
1237
|
+
*/
|
|
1238
|
+
disabled?: boolean
|
|
1239
|
+
}
|
|
1240
|
+
```
|
|
1241
|
+
|
|
1242
|
+
#### `SelectClassOptions`
|
|
1243
|
+
|
|
1244
|
+
Options for resolving select CSS classes via UIClassMap.
|
|
1245
|
+
|
|
1246
|
+
```typescript
|
|
1247
|
+
interface SelectClassOptions {
|
|
1248
|
+
error?: boolean
|
|
1249
|
+
size?: Size
|
|
1250
|
+
}
|
|
1251
|
+
```
|
|
1252
|
+
|
|
1253
|
+
#### `SelectElementProps`
|
|
1254
|
+
|
|
1255
|
+
Base props for select elements.
|
|
1256
|
+
|
|
1257
|
+
```typescript
|
|
1258
|
+
interface SelectElementProps extends HTMLElementProps {
|
|
1259
|
+
name?: string
|
|
1260
|
+
required?: boolean
|
|
1261
|
+
autoFocus?: boolean
|
|
1262
|
+
multiple?: boolean
|
|
1263
|
+
onChange?: ChangeEventHandler
|
|
1264
|
+
}
|
|
1265
|
+
```
|
|
1266
|
+
|
|
1267
|
+
#### `SelectOption`
|
|
1268
|
+
|
|
1269
|
+
A single option in a Select dropdown.
|
|
1270
|
+
|
|
1271
|
+
```typescript
|
|
1272
|
+
interface SelectOption<T = string> {
|
|
1273
|
+
/**
|
|
1274
|
+
* Option value.
|
|
1275
|
+
*/
|
|
1276
|
+
value: T
|
|
1277
|
+
|
|
1278
|
+
/**
|
|
1279
|
+
* Display label.
|
|
1280
|
+
*/
|
|
1281
|
+
label: string
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* Whether the option is disabled.
|
|
1285
|
+
*/
|
|
1286
|
+
disabled?: boolean
|
|
1287
|
+
|
|
1288
|
+
/**
|
|
1289
|
+
* Option group (for grouped selects).
|
|
1290
|
+
*/
|
|
1291
|
+
group?: string
|
|
1292
|
+
}
|
|
1293
|
+
```
|
|
1294
|
+
|
|
1295
|
+
#### `SelectProps`
|
|
1296
|
+
|
|
1297
|
+
Props for the Select dropdown component (single or multi-select).
|
|
1298
|
+
|
|
1299
|
+
```typescript
|
|
1300
|
+
interface SelectProps<T = string> extends SelectElementProps {
|
|
1301
|
+
/**
|
|
1302
|
+
* Select options.
|
|
1303
|
+
*/
|
|
1304
|
+
options: SelectOption<T>[]
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* Current value.
|
|
1308
|
+
*/
|
|
1309
|
+
value?: T
|
|
1310
|
+
|
|
1311
|
+
/**
|
|
1312
|
+
* Change handler (with typed value).
|
|
1313
|
+
*/
|
|
1314
|
+
onValueChange?: (value: T) => void
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* Select size.
|
|
1318
|
+
*/
|
|
1319
|
+
size?: Size
|
|
1320
|
+
|
|
1321
|
+
/**
|
|
1322
|
+
* Label text.
|
|
1323
|
+
*/
|
|
1324
|
+
label?: string
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Placeholder text.
|
|
1328
|
+
*/
|
|
1329
|
+
placeholder?: string
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Error message.
|
|
1333
|
+
*/
|
|
1334
|
+
error?: string
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* Hint/help text.
|
|
1338
|
+
*/
|
|
1339
|
+
hint?: string
|
|
1340
|
+
|
|
1341
|
+
/**
|
|
1342
|
+
* Whether to allow clearing the selection.
|
|
1343
|
+
*/
|
|
1344
|
+
clearable?: boolean
|
|
1345
|
+
}
|
|
1346
|
+
```
|
|
1347
|
+
|
|
1348
|
+
#### `SeparatorClassOptions`
|
|
1349
|
+
|
|
1350
|
+
Options for resolving separator CSS classes via UIClassMap.
|
|
1351
|
+
|
|
1352
|
+
```typescript
|
|
1353
|
+
interface SeparatorClassOptions {
|
|
1354
|
+
orientation?: 'horizontal' | 'vertical'
|
|
1355
|
+
}
|
|
1356
|
+
```
|
|
1357
|
+
|
|
1358
|
+
#### `SeparatorProps`
|
|
1359
|
+
|
|
1360
|
+
Props for the Separator/Divider component.
|
|
1361
|
+
|
|
1362
|
+
```typescript
|
|
1363
|
+
interface SeparatorProps extends BaseProps {
|
|
1364
|
+
/**
|
|
1365
|
+
* Separator orientation.
|
|
1366
|
+
*/
|
|
1367
|
+
orientation?: 'horizontal' | 'vertical'
|
|
1368
|
+
|
|
1369
|
+
/**
|
|
1370
|
+
* Whether the separator is decorative only.
|
|
1371
|
+
*/
|
|
1372
|
+
decorative?: boolean
|
|
1373
|
+
}
|
|
1374
|
+
```
|
|
1375
|
+
|
|
1376
|
+
#### `SkeletonProps`
|
|
1377
|
+
|
|
1378
|
+
Props for the Skeleton loading placeholder component.
|
|
1379
|
+
|
|
1380
|
+
```typescript
|
|
1381
|
+
interface SkeletonProps extends BaseProps {
|
|
1382
|
+
/**
|
|
1383
|
+
* Skeleton width.
|
|
1384
|
+
*/
|
|
1385
|
+
width?: string | number
|
|
1386
|
+
|
|
1387
|
+
/**
|
|
1388
|
+
* Skeleton height.
|
|
1389
|
+
*/
|
|
1390
|
+
height?: string | number
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* Whether the skeleton is circular.
|
|
1394
|
+
*/
|
|
1395
|
+
circle?: boolean
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Border radius.
|
|
1399
|
+
*/
|
|
1400
|
+
borderRadius?: string | number
|
|
1401
|
+
|
|
1402
|
+
/**
|
|
1403
|
+
* Animation type.
|
|
1404
|
+
*/
|
|
1405
|
+
animation?: 'pulse' | 'wave' | 'none'
|
|
1406
|
+
}
|
|
1407
|
+
```
|
|
1408
|
+
|
|
1409
|
+
#### `SpacerProps`
|
|
1410
|
+
|
|
1411
|
+
Props for the Spacer layout component (adds whitespace between elements).
|
|
1412
|
+
|
|
1413
|
+
```typescript
|
|
1414
|
+
interface SpacerProps extends BaseProps {
|
|
1415
|
+
/**
|
|
1416
|
+
* Space size.
|
|
1417
|
+
*/
|
|
1418
|
+
size?: Size | string | number
|
|
1419
|
+
|
|
1420
|
+
/**
|
|
1421
|
+
* Whether the spacer is horizontal.
|
|
1422
|
+
*/
|
|
1423
|
+
horizontal?: boolean
|
|
1424
|
+
}
|
|
1425
|
+
```
|
|
1426
|
+
|
|
1427
|
+
#### `SpinnerClassOptions`
|
|
1428
|
+
|
|
1429
|
+
Options for resolving spinner CSS classes via UIClassMap.
|
|
1430
|
+
|
|
1431
|
+
```typescript
|
|
1432
|
+
interface SpinnerClassOptions {
|
|
1433
|
+
size?: Size
|
|
1434
|
+
}
|
|
1435
|
+
```
|
|
1436
|
+
|
|
1437
|
+
#### `SpinnerProps`
|
|
1438
|
+
|
|
1439
|
+
Props for the Spinner/loading indicator component.
|
|
1440
|
+
|
|
1441
|
+
```typescript
|
|
1442
|
+
interface SpinnerProps extends BaseProps {
|
|
1443
|
+
/**
|
|
1444
|
+
* Spinner size.
|
|
1445
|
+
*/
|
|
1446
|
+
size?: Size
|
|
1447
|
+
|
|
1448
|
+
/**
|
|
1449
|
+
* Spinner color.
|
|
1450
|
+
*/
|
|
1451
|
+
color?: ColorVariant | string
|
|
1452
|
+
|
|
1453
|
+
/**
|
|
1454
|
+
* Loading label (for accessibility).
|
|
1455
|
+
*/
|
|
1456
|
+
label?: string
|
|
1457
|
+
|
|
1458
|
+
/**
|
|
1459
|
+
* Spinner thickness.
|
|
1460
|
+
*/
|
|
1461
|
+
thickness?: number
|
|
1462
|
+
}
|
|
1463
|
+
```
|
|
1464
|
+
|
|
1465
|
+
#### `SwitchClassOptions`
|
|
1466
|
+
|
|
1467
|
+
Options for switch class resolution.
|
|
1468
|
+
|
|
1469
|
+
```typescript
|
|
1470
|
+
interface SwitchClassOptions {
|
|
1471
|
+
size?: Size
|
|
1472
|
+
/**
|
|
1473
|
+
* Color used for the checked/on track. Reuses the same semantic color
|
|
1474
|
+
* scale as `ButtonClassOptions.color`/`BadgeClassOptions.variant`.
|
|
1475
|
+
* @default 'primary'
|
|
1476
|
+
*/
|
|
1477
|
+
color?: ColorVariant
|
|
1478
|
+
}
|
|
1479
|
+
```
|
|
1480
|
+
|
|
1481
|
+
#### `SwitchProps`
|
|
1482
|
+
|
|
1483
|
+
Props for the Switch/Toggle component.
|
|
1484
|
+
|
|
1485
|
+
```typescript
|
|
1486
|
+
interface SwitchProps extends InputElementProps {
|
|
1487
|
+
/**
|
|
1488
|
+
* Switch label.
|
|
1489
|
+
*/
|
|
1490
|
+
label?: Children
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* Whether the switch is on.
|
|
1494
|
+
*/
|
|
1495
|
+
checked?: boolean
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* Switch size.
|
|
1499
|
+
*/
|
|
1500
|
+
size?: Size
|
|
1501
|
+
|
|
1502
|
+
/**
|
|
1503
|
+
* Color when on.
|
|
1504
|
+
*/
|
|
1505
|
+
color?: ColorVariant
|
|
1506
|
+
}
|
|
1507
|
+
```
|
|
1508
|
+
|
|
1509
|
+
#### `TabItem`
|
|
1510
|
+
|
|
1511
|
+
A single tab in a Tabs component.
|
|
1512
|
+
|
|
1513
|
+
```typescript
|
|
1514
|
+
interface TabItem<T = string> {
|
|
1515
|
+
/**
|
|
1516
|
+
* Tab value/id.
|
|
1517
|
+
*/
|
|
1518
|
+
value: T
|
|
1519
|
+
|
|
1520
|
+
/**
|
|
1521
|
+
* Tab label.
|
|
1522
|
+
*/
|
|
1523
|
+
label: Children
|
|
1524
|
+
|
|
1525
|
+
/**
|
|
1526
|
+
* Tab content.
|
|
1527
|
+
*/
|
|
1528
|
+
content?: Children
|
|
1529
|
+
|
|
1530
|
+
/**
|
|
1531
|
+
* Whether the tab is disabled.
|
|
1532
|
+
*/
|
|
1533
|
+
disabled?: boolean
|
|
1534
|
+
|
|
1535
|
+
/**
|
|
1536
|
+
* Icon to display.
|
|
1537
|
+
*/
|
|
1538
|
+
icon?: Children
|
|
1539
|
+
}
|
|
1540
|
+
```
|
|
1541
|
+
|
|
1542
|
+
#### `TableColumn`
|
|
1543
|
+
|
|
1544
|
+
Table column definition.
|
|
1545
|
+
|
|
1546
|
+
```typescript
|
|
1547
|
+
interface TableColumn<T> {
|
|
1548
|
+
/**
|
|
1549
|
+
* Column key (data property).
|
|
1550
|
+
*/
|
|
1551
|
+
key: keyof T | string
|
|
1552
|
+
|
|
1553
|
+
/**
|
|
1554
|
+
* Column header.
|
|
1555
|
+
*/
|
|
1556
|
+
header: Children
|
|
1557
|
+
|
|
1558
|
+
/**
|
|
1559
|
+
* Custom cell renderer.
|
|
1560
|
+
*/
|
|
1561
|
+
render?: (value: unknown, row: T, index: number) => Children
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* Column width.
|
|
1565
|
+
*/
|
|
1566
|
+
width?: string | number
|
|
1567
|
+
|
|
1568
|
+
/**
|
|
1569
|
+
* Whether the column is sortable.
|
|
1570
|
+
*/
|
|
1571
|
+
sortable?: boolean
|
|
1572
|
+
|
|
1573
|
+
/**
|
|
1574
|
+
* Text alignment.
|
|
1575
|
+
*/
|
|
1576
|
+
align?: 'left' | 'center' | 'right'
|
|
1577
|
+
}
|
|
1578
|
+
```
|
|
1579
|
+
|
|
1580
|
+
#### `TableProps`
|
|
1581
|
+
|
|
1582
|
+
Props for the Table component.
|
|
1583
|
+
|
|
1584
|
+
```typescript
|
|
1585
|
+
interface TableProps<T> extends HTMLElementProps {
|
|
1586
|
+
/**
|
|
1587
|
+
* Table data.
|
|
1588
|
+
*/
|
|
1589
|
+
data: T[]
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* Column definitions.
|
|
1593
|
+
*/
|
|
1594
|
+
columns: TableColumn<T>[]
|
|
1595
|
+
|
|
1596
|
+
/**
|
|
1597
|
+
* Row key extractor.
|
|
1598
|
+
*/
|
|
1599
|
+
rowKey?: keyof T | ((row: T) => string | number)
|
|
1600
|
+
|
|
1601
|
+
/**
|
|
1602
|
+
* Whether to show borders.
|
|
1603
|
+
*/
|
|
1604
|
+
bordered?: boolean
|
|
1605
|
+
|
|
1606
|
+
/**
|
|
1607
|
+
* Whether rows are striped.
|
|
1608
|
+
*/
|
|
1609
|
+
striped?: boolean
|
|
1610
|
+
|
|
1611
|
+
/**
|
|
1612
|
+
* Whether rows are hoverable.
|
|
1613
|
+
*/
|
|
1614
|
+
hoverable?: boolean
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* Table size.
|
|
1618
|
+
*/
|
|
1619
|
+
size?: Size
|
|
1620
|
+
|
|
1621
|
+
/**
|
|
1622
|
+
* Empty state content.
|
|
1623
|
+
*/
|
|
1624
|
+
emptyContent?: Children
|
|
1625
|
+
|
|
1626
|
+
/**
|
|
1627
|
+
* Loading state.
|
|
1628
|
+
*/
|
|
1629
|
+
loading?: boolean
|
|
1630
|
+
|
|
1631
|
+
/**
|
|
1632
|
+
* Sort configuration.
|
|
1633
|
+
*/
|
|
1634
|
+
sort?: { key: string; direction: 'asc' | 'desc' }
|
|
1635
|
+
|
|
1636
|
+
/**
|
|
1637
|
+
* Sort change handler.
|
|
1638
|
+
*/
|
|
1639
|
+
onSort?: (key: string, direction: 'asc' | 'desc') => void
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* Row click handler.
|
|
1643
|
+
*/
|
|
1644
|
+
onRowClick?: (row: T, index: number) => void
|
|
1645
|
+
}
|
|
1646
|
+
```
|
|
1647
|
+
|
|
1648
|
+
#### `TabsClassOptions`
|
|
1649
|
+
|
|
1650
|
+
Options for resolving tabs (`tabsList`/`tabsTrigger`/`tabsContent`) CSS
|
|
1651
|
+
classes via UIClassMap. Active vs inactive trigger styling is NOT one of
|
|
1652
|
+
these options — it is expressed as `data-[state=active]` CSS attribute
|
|
1653
|
+
selectors baked into the returned class string, driven by the
|
|
1654
|
+
`data-state="active"|"inactive"` attribute the framework binding already
|
|
1655
|
+
sets on the trigger element (see `@molecule/app-ui-react`'s `Tabs`).
|
|
1656
|
+
|
|
1657
|
+
```typescript
|
|
1658
|
+
interface TabsClassOptions {
|
|
1659
|
+
/**
|
|
1660
|
+
* Visual style: underline indicator, bordered/filled boxes, a soft-bg
|
|
1661
|
+
* pill, or a solid-bg pill.
|
|
1662
|
+
*/
|
|
1663
|
+
variant?: 'line' | 'enclosed' | 'soft-rounded' | 'solid-rounded'
|
|
1664
|
+
size?: Size
|
|
1665
|
+
}
|
|
1666
|
+
```
|
|
1667
|
+
|
|
1668
|
+
#### `TabsProps`
|
|
1669
|
+
|
|
1670
|
+
Props for the Tabs component (switchable tabbed content panels).
|
|
1671
|
+
|
|
1672
|
+
```typescript
|
|
1673
|
+
interface TabsProps<T = string> extends BaseProps {
|
|
1674
|
+
/**
|
|
1675
|
+
* Tab items.
|
|
1676
|
+
*/
|
|
1677
|
+
items: TabItem<T>[]
|
|
1678
|
+
|
|
1679
|
+
/**
|
|
1680
|
+
* Current active tab.
|
|
1681
|
+
*/
|
|
1682
|
+
value?: T
|
|
1683
|
+
|
|
1684
|
+
/**
|
|
1685
|
+
* Default active tab.
|
|
1686
|
+
*/
|
|
1687
|
+
defaultValue?: T
|
|
1688
|
+
|
|
1689
|
+
/**
|
|
1690
|
+
* Change handler.
|
|
1691
|
+
*/
|
|
1692
|
+
onChange?: (value: T) => void
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* Tab variant.
|
|
1696
|
+
*/
|
|
1697
|
+
variant?: 'line' | 'enclosed' | 'soft-rounded' | 'solid-rounded'
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* Tab size.
|
|
1701
|
+
*/
|
|
1702
|
+
size?: Size
|
|
1703
|
+
|
|
1704
|
+
/**
|
|
1705
|
+
* Whether tabs are fitted (take full width).
|
|
1706
|
+
*/
|
|
1707
|
+
fitted?: boolean
|
|
1708
|
+
}
|
|
1709
|
+
```
|
|
1710
|
+
|
|
1711
|
+
#### `TextareaClassOptions`
|
|
1712
|
+
|
|
1713
|
+
Options for textarea class resolution.
|
|
1714
|
+
|
|
1715
|
+
```typescript
|
|
1716
|
+
interface TextareaClassOptions {
|
|
1717
|
+
error?: boolean
|
|
1718
|
+
/**
|
|
1719
|
+
* Text size tier, matching {@link InputClassOptions.size} — a same-`size`
|
|
1720
|
+
* input + textarea pair renders identical font sizes. Bonds default to
|
|
1721
|
+
* their historic textarea size when omitted.
|
|
1722
|
+
*/
|
|
1723
|
+
size?: Size
|
|
1724
|
+
}
|
|
1725
|
+
```
|
|
1726
|
+
|
|
1727
|
+
#### `TextareaElementProps`
|
|
1728
|
+
|
|
1729
|
+
Base props for textarea elements.
|
|
1730
|
+
|
|
1731
|
+
```typescript
|
|
1732
|
+
interface TextareaElementProps extends HTMLElementProps {
|
|
1733
|
+
name?: string
|
|
1734
|
+
value?: string
|
|
1735
|
+
defaultValue?: string
|
|
1736
|
+
placeholder?: string
|
|
1737
|
+
required?: boolean
|
|
1738
|
+
readOnly?: boolean
|
|
1739
|
+
autoFocus?: boolean
|
|
1740
|
+
rows?: number
|
|
1741
|
+
cols?: number
|
|
1742
|
+
maxLength?: number
|
|
1743
|
+
minLength?: number
|
|
1744
|
+
wrap?: 'hard' | 'soft' | 'off'
|
|
1745
|
+
onChange?: ChangeEventHandler
|
|
1746
|
+
onInput?: FormEventHandler
|
|
1747
|
+
}
|
|
1748
|
+
```
|
|
1749
|
+
|
|
1750
|
+
#### `TextareaProps`
|
|
1751
|
+
|
|
1752
|
+
Props for the Textarea component.
|
|
1753
|
+
|
|
1754
|
+
```typescript
|
|
1755
|
+
interface TextareaProps extends TextareaElementProps {
|
|
1756
|
+
/**
|
|
1757
|
+
* Text size tier (see {@link TextareaClassOptions.size}) — pass the same
|
|
1758
|
+
* `size` as a neighboring Input for identical font sizes.
|
|
1759
|
+
*/
|
|
1760
|
+
size?: Size
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* Label text.
|
|
1764
|
+
*/
|
|
1765
|
+
label?: string
|
|
1766
|
+
|
|
1767
|
+
/**
|
|
1768
|
+
* Error message.
|
|
1769
|
+
*/
|
|
1770
|
+
error?: string
|
|
1771
|
+
|
|
1772
|
+
/**
|
|
1773
|
+
* Hint/help text.
|
|
1774
|
+
*/
|
|
1775
|
+
hint?: string
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* Whether the textarea auto-resizes.
|
|
1779
|
+
*/
|
|
1780
|
+
autoResize?: boolean
|
|
1781
|
+
|
|
1782
|
+
/**
|
|
1783
|
+
* Minimum number of rows.
|
|
1784
|
+
*/
|
|
1785
|
+
minRows?: number
|
|
1786
|
+
|
|
1787
|
+
/**
|
|
1788
|
+
* Maximum number of rows.
|
|
1789
|
+
*/
|
|
1790
|
+
maxRows?: number
|
|
1791
|
+
}
|
|
1792
|
+
```
|
|
1793
|
+
|
|
1794
|
+
#### `ToastClassOptions`
|
|
1795
|
+
|
|
1796
|
+
Options for toast class resolution.
|
|
1797
|
+
|
|
1798
|
+
```typescript
|
|
1799
|
+
interface ToastClassOptions {
|
|
1800
|
+
variant?: 'default' | 'success' | 'warning' | 'error' | 'info'
|
|
1801
|
+
}
|
|
1802
|
+
```
|
|
1803
|
+
|
|
1804
|
+
#### `ToastProps`
|
|
1805
|
+
|
|
1806
|
+
Props for the Toast/notification component.
|
|
1807
|
+
|
|
1808
|
+
```typescript
|
|
1809
|
+
interface ToastProps extends HTMLElementProps {
|
|
1810
|
+
/**
|
|
1811
|
+
* Toast content.
|
|
1812
|
+
*/
|
|
1813
|
+
children?: Children
|
|
1814
|
+
|
|
1815
|
+
/**
|
|
1816
|
+
* Toast title.
|
|
1817
|
+
*/
|
|
1818
|
+
title?: string
|
|
1819
|
+
|
|
1820
|
+
/**
|
|
1821
|
+
* Toast description.
|
|
1822
|
+
*/
|
|
1823
|
+
description?: string
|
|
1824
|
+
|
|
1825
|
+
/**
|
|
1826
|
+
* Toast status/type.
|
|
1827
|
+
*/
|
|
1828
|
+
status?: ColorVariant
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* Duration in milliseconds (0 for persistent).
|
|
1832
|
+
*/
|
|
1833
|
+
duration?: number
|
|
1834
|
+
|
|
1835
|
+
/**
|
|
1836
|
+
* Whether the toast is dismissible.
|
|
1837
|
+
*/
|
|
1838
|
+
dismissible?: boolean
|
|
1839
|
+
|
|
1840
|
+
/**
|
|
1841
|
+
* Called when dismissed.
|
|
1842
|
+
*/
|
|
1843
|
+
onDismiss?: () => void
|
|
1844
|
+
|
|
1845
|
+
/**
|
|
1846
|
+
* Toast position.
|
|
1847
|
+
*/
|
|
1848
|
+
position?: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
|
|
1849
|
+
|
|
1850
|
+
/**
|
|
1851
|
+
* Accessible label for the close button.
|
|
1852
|
+
* @default 'Close'
|
|
1853
|
+
*/
|
|
1854
|
+
closeLabel?: string
|
|
1855
|
+
}
|
|
1856
|
+
```
|
|
1857
|
+
|
|
1858
|
+
#### `TooltipProps`
|
|
1859
|
+
|
|
1860
|
+
Props for the Tooltip component (hover/focus popover with informational text).
|
|
1861
|
+
|
|
1862
|
+
```typescript
|
|
1863
|
+
interface TooltipProps extends HTMLElementProps {
|
|
1864
|
+
/**
|
|
1865
|
+
* Tooltip content.
|
|
1866
|
+
*/
|
|
1867
|
+
content: Children
|
|
1868
|
+
|
|
1869
|
+
/**
|
|
1870
|
+
* Element that triggers the tooltip.
|
|
1871
|
+
*/
|
|
1872
|
+
children: Children
|
|
1873
|
+
|
|
1874
|
+
/**
|
|
1875
|
+
* Tooltip placement.
|
|
1876
|
+
*/
|
|
1877
|
+
placement?: TooltipPlacement
|
|
1878
|
+
|
|
1879
|
+
/**
|
|
1880
|
+
* Delay before showing (ms).
|
|
1881
|
+
*/
|
|
1882
|
+
delay?: number
|
|
1883
|
+
|
|
1884
|
+
/**
|
|
1885
|
+
* Whether the tooltip has an arrow.
|
|
1886
|
+
*/
|
|
1887
|
+
hasArrow?: boolean
|
|
1888
|
+
}
|
|
1889
|
+
```
|
|
1890
|
+
|
|
1891
|
+
#### `UIClassMap`
|
|
1892
|
+
|
|
1893
|
+
UIClassMap interface — the contract for styling-agnostic class resolution.
|
|
1894
|
+
|
|
1895
|
+
Each styling library (Tailwind, Bootstrap, etc.) provides its own UIClassMap
|
|
1896
|
+
implementation. Component resolvers accept GENERIC variant names from
|
|
1897
|
+
`@molecule/app-ui` types and map to library-specific classes internally.
|
|
1898
|
+
|
|
1899
|
+
Framework UI packages (`@molecule/app-ui-react`, etc.) call getClassMap()
|
|
1900
|
+
at render time to resolve classes without knowing which styling library
|
|
1901
|
+
is active.
|
|
1902
|
+
|
|
1903
|
+
```typescript
|
|
1904
|
+
interface UIClassMap {
|
|
1905
|
+
/**
|
|
1906
|
+
* Merges class names with library-specific conflict resolution
|
|
1907
|
+
* (e.g. tailwind-merge for Tailwind).
|
|
1908
|
+
*/
|
|
1909
|
+
cn(...classes: ClassMapValue[]): string
|
|
1910
|
+
|
|
1911
|
+
// ---- Component resolvers (functions) ----
|
|
1912
|
+
|
|
1913
|
+
button(opts?: ButtonClassOptions): string
|
|
1914
|
+
input(opts?: InputClassOptions): string
|
|
1915
|
+
textarea(opts?: TextareaClassOptions): string
|
|
1916
|
+
select(opts?: SelectClassOptions): string
|
|
1917
|
+
checkbox(opts?: CheckboxClassOptions): string
|
|
1918
|
+
radio(opts?: RadioClassOptions): string
|
|
1919
|
+
switchBase(opts?: SwitchClassOptions): string
|
|
1920
|
+
switchThumb(opts?: SwitchClassOptions): string
|
|
1921
|
+
label(opts?: LabelClassOptions): string
|
|
1922
|
+
card(opts?: CardClassOptions): string
|
|
1923
|
+
badge(opts?: BadgeClassOptions): string
|
|
1924
|
+
alert(opts?: AlertClassOptions): string
|
|
1925
|
+
avatar(opts?: AvatarClassOptions): string
|
|
1926
|
+
modal(opts?: ModalClassOptions): string
|
|
1927
|
+
spinner(opts?: SpinnerClassOptions): string
|
|
1928
|
+
toast(opts?: ToastClassOptions): string
|
|
1929
|
+
separator(opts?: SeparatorClassOptions): string
|
|
1930
|
+
accordion(opts?: AccordionClassOptions): string
|
|
1931
|
+
pagination(opts?: PaginationClassOptions): string
|
|
1932
|
+
tabsList(opts?: TabsClassOptions): string
|
|
1933
|
+
tabsTrigger(opts?: TabsClassOptions): string
|
|
1934
|
+
tabsContent(opts?: TabsClassOptions): string
|
|
1935
|
+
tooltip(): string
|
|
1936
|
+
progress(): string
|
|
1937
|
+
progressBar(): string
|
|
1938
|
+
skeleton(): string
|
|
1939
|
+
container(opts?: ContainerClassOptions): string
|
|
1940
|
+
flex(opts?: FlexClassOptions): string
|
|
1941
|
+
grid(opts?: GridClassOptions): string
|
|
1942
|
+
|
|
1943
|
+
// ---- Variant resolvers (parameterized sub-component classes) ----
|
|
1944
|
+
|
|
1945
|
+
/**
|
|
1946
|
+
* Returns card padding class for the given size ('none' removes padding).
|
|
1947
|
+
*/
|
|
1948
|
+
cardPadding(size?: Size | 'none'): string
|
|
1949
|
+
/**
|
|
1950
|
+
* Returns progress bar height class for the given size.
|
|
1951
|
+
*/
|
|
1952
|
+
progressHeight(size?: Size): string
|
|
1953
|
+
/**
|
|
1954
|
+
* Returns progress bar fill color class for the given color variant.
|
|
1955
|
+
*/
|
|
1956
|
+
progressColor(color?: ColorVariant): string
|
|
1957
|
+
/**
|
|
1958
|
+
* Returns toast container positioning class for the given position.
|
|
1959
|
+
*/
|
|
1960
|
+
toastContainer(opts?: { position?: ToastPosition }): string
|
|
1961
|
+
/**
|
|
1962
|
+
* Returns radio group layout class for horizontal or vertical direction.
|
|
1963
|
+
*/
|
|
1964
|
+
radioGroupLayout(direction?: 'horizontal' | 'vertical'): string
|
|
1965
|
+
/**
|
|
1966
|
+
* Returns spacer element class (block or inline with configurable size).
|
|
1967
|
+
*/
|
|
1968
|
+
spacer(opts?: { size?: Size; horizontal?: boolean }): string
|
|
1969
|
+
|
|
1970
|
+
// ---- Static class strings (sub-components without variants) ----
|
|
1971
|
+
|
|
1972
|
+
formError: string
|
|
1973
|
+
formHint: string
|
|
1974
|
+
cardHeader: string
|
|
1975
|
+
cardTitle: string
|
|
1976
|
+
cardDescription: string
|
|
1977
|
+
cardContent: string
|
|
1978
|
+
cardFooter: string
|
|
1979
|
+
alertTitle: string
|
|
1980
|
+
alertDescription: string
|
|
1981
|
+
avatarImage: string
|
|
1982
|
+
avatarFallback: string
|
|
1983
|
+
dialogOverlay: string
|
|
1984
|
+
dialogHeader: string
|
|
1985
|
+
dialogFooter: string
|
|
1986
|
+
dialogTitle: string
|
|
1987
|
+
dialogDescription: string
|
|
1988
|
+
dialogClose: string
|
|
1989
|
+
/**
|
|
1990
|
+
* Floating close button for title-less dialogs: overlays the top-right
|
|
1991
|
+
* corner of the dialog box instead of occupying a full-width header row
|
|
1992
|
+
* that pushes the body down.
|
|
1993
|
+
*/
|
|
1994
|
+
dialogCloseFloating: string
|
|
1995
|
+
/** Modal centering wrapper: fixed full-screen flex container for centering content. */
|
|
1996
|
+
dialogWrapper: string
|
|
1997
|
+
/** Modal scrollable body area with padding. */
|
|
1998
|
+
dialogBody: string
|
|
1999
|
+
/** Bottom-anchored sheet panel for pickers and action menus (mobile pattern). */
|
|
2000
|
+
actionSheet: string
|
|
2001
|
+
/** Header section of an action sheet with bottom border. */
|
|
2002
|
+
actionSheetHeader: string
|
|
2003
|
+
dropdownContent: string
|
|
2004
|
+
dropdownItem: string
|
|
2005
|
+
dropdownSeparator: string
|
|
2006
|
+
dropdownLabel: string
|
|
2007
|
+
table: string
|
|
2008
|
+
tableHeader: string
|
|
2009
|
+
tableBody: string
|
|
2010
|
+
tableFooter: string
|
|
2011
|
+
tableRow: string
|
|
2012
|
+
tableHead: string
|
|
2013
|
+
tableCell: string
|
|
2014
|
+
tableCaption: string
|
|
2015
|
+
tooltipContent: string
|
|
2016
|
+
toastViewport: string
|
|
2017
|
+
toastTitle: string
|
|
2018
|
+
toastDescription: string
|
|
2019
|
+
toastClose: string
|
|
2020
|
+
toastAction: string
|
|
2021
|
+
accordionRoot: string
|
|
2022
|
+
accordionItem: string
|
|
2023
|
+
accordionContent: string
|
|
2024
|
+
accordionContentInner: string
|
|
2025
|
+
paginationRoot: string
|
|
2026
|
+
paginationContent: string
|
|
2027
|
+
paginationLink: string
|
|
2028
|
+
paginationPrevious: string
|
|
2029
|
+
paginationNext: string
|
|
2030
|
+
paginationEllipsis: string
|
|
2031
|
+
center: string
|
|
2032
|
+
srOnly: string
|
|
2033
|
+
notSrOnly: string
|
|
2034
|
+
|
|
2035
|
+
// ---- Icon size tokens ----
|
|
2036
|
+
|
|
2037
|
+
/** Extra-small icon (e.g. 12×12). */
|
|
2038
|
+
iconXs: string
|
|
2039
|
+
/** Small icon (e.g. 16×16). Used for close buttons, sort indicators. */
|
|
2040
|
+
iconSm: string
|
|
2041
|
+
/** Medium icon (e.g. 20×20). Used for status icons, alerts, toasts. */
|
|
2042
|
+
iconMd: string
|
|
2043
|
+
|
|
2044
|
+
// ---- Button sub-element tokens ----
|
|
2045
|
+
|
|
2046
|
+
/** Left icon spacing inside buttons. */
|
|
2047
|
+
buttonIconLeft: string
|
|
2048
|
+
/** Right icon spacing inside buttons. */
|
|
2049
|
+
buttonIconRight: string
|
|
2050
|
+
/** Inline spinner inside loading buttons. */
|
|
2051
|
+
buttonSpinner: string
|
|
2052
|
+
|
|
2053
|
+
// ---- Card sub-element tokens ----
|
|
2054
|
+
|
|
2055
|
+
/** Interactive card hover/cursor behavior. */
|
|
2056
|
+
cardInteractive: string
|
|
2057
|
+
|
|
2058
|
+
// ---- Alert sub-element tokens ----
|
|
2059
|
+
|
|
2060
|
+
/** Alert icon wrapper (prevents shrinking). */
|
|
2061
|
+
alertIconWrapper: string
|
|
2062
|
+
/** Alert content area (fills remaining space). */
|
|
2063
|
+
alertContent: string
|
|
2064
|
+
/** Alert dismiss button styling. */
|
|
2065
|
+
alertDismiss: string
|
|
2066
|
+
|
|
2067
|
+
// ---- Theme toggle tokens ----
|
|
2068
|
+
|
|
2069
|
+
/** Theme toggle button (icon-only, transparent). */
|
|
2070
|
+
themeToggleButton: string
|
|
2071
|
+
|
|
2072
|
+
// ---- OAuth tokens ----
|
|
2073
|
+
|
|
2074
|
+
/** OAuth section "or continue with" divider container. */
|
|
2075
|
+
oauthDivider: string
|
|
2076
|
+
/** OAuth divider horizontal line. */
|
|
2077
|
+
oauthDividerLine: string
|
|
2078
|
+
/** OAuth divider text span (with background to mask line). */
|
|
2079
|
+
oauthDividerText: string
|
|
2080
|
+
/** OAuth button group (flex wrap container). */
|
|
2081
|
+
oauthButtonGroup: string
|
|
2082
|
+
/** Individual OAuth provider button. */
|
|
2083
|
+
oauthButton: string
|
|
2084
|
+
/** OAuth button icon wrapper (opacity transition). */
|
|
2085
|
+
oauthButtonIcon: string
|
|
2086
|
+
|
|
2087
|
+
// ---- Auth page tokens ----
|
|
2088
|
+
|
|
2089
|
+
/** Auth form error message. */
|
|
2090
|
+
authFormError: string
|
|
2091
|
+
/** Forgot password link button. */
|
|
2092
|
+
forgotPasswordLink: string
|
|
2093
|
+
|
|
2094
|
+
// ---- Floating input sub-element tokens ----
|
|
2095
|
+
|
|
2096
|
+
/** Floating input wrapper (relative inline-block). */
|
|
2097
|
+
floatingInputWrapper: string
|
|
2098
|
+
/** Floating input field class (sibling-selector hook for floating label). */
|
|
2099
|
+
floatingInput: string
|
|
2100
|
+
/** Floating input label/placeholder (absolute positioned). */
|
|
2101
|
+
floatingLabel: string
|
|
2102
|
+
|
|
2103
|
+
// ---- Input sub-element tokens ----
|
|
2104
|
+
|
|
2105
|
+
/** Input outer wrapper (full-width block). */
|
|
2106
|
+
inputWrapper: string
|
|
2107
|
+
/** Input inner wrapper (relative positioning for icons). */
|
|
2108
|
+
inputInner: string
|
|
2109
|
+
/** Left icon/element container inside input. */
|
|
2110
|
+
inputLeftElement: string
|
|
2111
|
+
/** Right icon/element container inside input. */
|
|
2112
|
+
inputRightElement: string
|
|
2113
|
+
/** Clear button inside input. */
|
|
2114
|
+
inputClearButton: string
|
|
2115
|
+
/** Input left padding when left element is present. */
|
|
2116
|
+
inputPadLeft: string
|
|
2117
|
+
/** Input right padding when right element is present. */
|
|
2118
|
+
inputPadRight: string
|
|
2119
|
+
|
|
2120
|
+
// ---- Select sub-element tokens ----
|
|
2121
|
+
|
|
2122
|
+
/** Native select arrow area. */
|
|
2123
|
+
selectNative: string
|
|
2124
|
+
|
|
2125
|
+
// ---- Label/Form sub-element tokens ----
|
|
2126
|
+
|
|
2127
|
+
/** Block label with bottom margin (for use above inputs). */
|
|
2128
|
+
labelBlock: string
|
|
2129
|
+
/** Form fieldset wrapper. */
|
|
2130
|
+
formFieldset: string
|
|
2131
|
+
/** Fieldset with display:contents — invisible wrapper for disabled state. */
|
|
2132
|
+
formFieldsetContents: string
|
|
2133
|
+
/** Form field group wrapper. */
|
|
2134
|
+
formField: string
|
|
2135
|
+
/** Flex column wrapper around control + error message. */
|
|
2136
|
+
formFieldWrapper: string
|
|
2137
|
+
|
|
2138
|
+
// ---- Control (Checkbox/Switch/Radio) shared tokens ----
|
|
2139
|
+
|
|
2140
|
+
/** Control wrapper label (flex + gap + cursor). */
|
|
2141
|
+
controlLabel: string
|
|
2142
|
+
/** Inner control container (for checkbox/radio indicator). */
|
|
2143
|
+
controlContainer: string
|
|
2144
|
+
/** Control label text styling (font size, color, etc.). */
|
|
2145
|
+
controlText: string
|
|
2146
|
+
/** Disabled state for control wrappers. */
|
|
2147
|
+
controlDisabled: string
|
|
2148
|
+
|
|
2149
|
+
// ---- Radio group tokens ----
|
|
2150
|
+
|
|
2151
|
+
/** Radio group label/legend. */
|
|
2152
|
+
radioGroupLabel: string
|
|
2153
|
+
|
|
2154
|
+
// ---- Accordion sub-element tokens ----
|
|
2155
|
+
|
|
2156
|
+
/** Accordion trigger chevron icon (animated rotation). */
|
|
2157
|
+
accordionChevron: string
|
|
2158
|
+
/** Accordion trigger base (full-width, left-aligned). */
|
|
2159
|
+
accordionTriggerBase: string
|
|
2160
|
+
|
|
2161
|
+
// ---- Tabs sub-element tokens ----
|
|
2162
|
+
|
|
2163
|
+
/** Tabs list fitted variant (full-width). */
|
|
2164
|
+
tabsFitted: string
|
|
2165
|
+
/** Tab trigger fitted variant (flex-1). */
|
|
2166
|
+
tabTriggerFitted: string
|
|
2167
|
+
/** Tab trigger icon spacing. */
|
|
2168
|
+
tabTriggerIcon: string
|
|
2169
|
+
|
|
2170
|
+
// ---- Pagination tokens ----
|
|
2171
|
+
|
|
2172
|
+
/** Pagination button interactive classes (cursor). */
|
|
2173
|
+
paginationInteractive: string
|
|
2174
|
+
|
|
2175
|
+
// ---- Progress sub-element tokens ----
|
|
2176
|
+
|
|
2177
|
+
/** Progress outer wrapper (full-width). */
|
|
2178
|
+
progressWrapper: string
|
|
2179
|
+
/** Progress label container (flex between). */
|
|
2180
|
+
progressLabelContainer: string
|
|
2181
|
+
/** Progress label text styling. */
|
|
2182
|
+
progressLabelText: string
|
|
2183
|
+
/** Progress indeterminate animation. */
|
|
2184
|
+
progressIndeterminate: string
|
|
2185
|
+
|
|
2186
|
+
// ---- Table sub-element tokens ----
|
|
2187
|
+
|
|
2188
|
+
/** Table scrollable wrapper. */
|
|
2189
|
+
tableWrapper: string
|
|
2190
|
+
/** Table loading overlay. */
|
|
2191
|
+
tableLoadingOverlay: string
|
|
2192
|
+
/** Table empty state cell. */
|
|
2193
|
+
tableEmptyCell: string
|
|
2194
|
+
/** Table sort indicator wrapper. */
|
|
2195
|
+
tableSortWrapper: string
|
|
2196
|
+
/** Table sort icon spacing. */
|
|
2197
|
+
tableSortIcon: string
|
|
2198
|
+
/** Table striped row. */
|
|
2199
|
+
tableRowStriped: string
|
|
2200
|
+
/** Table hoverable row. */
|
|
2201
|
+
tableRowHoverable: string
|
|
2202
|
+
/** Table clickable row. */
|
|
2203
|
+
tableRowClickable: string
|
|
2204
|
+
/** Table sortable header. */
|
|
2205
|
+
tableHeadSortable: string
|
|
2206
|
+
/** Table bordered variant. */
|
|
2207
|
+
tableBordered: string
|
|
2208
|
+
|
|
2209
|
+
// ---- Toast sub-element tokens ----
|
|
2210
|
+
|
|
2211
|
+
/** Toast icon wrapper (prevents shrinking). */
|
|
2212
|
+
toastIconWrapper: string
|
|
2213
|
+
/** Toast content wrapper (fills remaining space). */
|
|
2214
|
+
toastContentWrapper: string
|
|
2215
|
+
|
|
2216
|
+
// ---- Dropdown sub-element tokens ----
|
|
2217
|
+
|
|
2218
|
+
/** Dropdown trigger wrapper. */
|
|
2219
|
+
dropdownTrigger: string
|
|
2220
|
+
/** Dropdown item icon spacing. */
|
|
2221
|
+
dropdownItemIcon: string
|
|
2222
|
+
/** Dropdown item label (fills remaining space). */
|
|
2223
|
+
dropdownItemLabel: string
|
|
2224
|
+
/** Dropdown item shortcut text. */
|
|
2225
|
+
dropdownItemShortcut: string
|
|
2226
|
+
/** Dropdown item disabled state. */
|
|
2227
|
+
dropdownItemDisabled: string
|
|
2228
|
+
|
|
2229
|
+
// ---- Tooltip tokens ----
|
|
2230
|
+
|
|
2231
|
+
/** Tooltip trigger wrapper. */
|
|
2232
|
+
tooltipTrigger: string
|
|
2233
|
+
|
|
2234
|
+
// ---- Avatar sub-element tokens ----
|
|
2235
|
+
|
|
2236
|
+
/** Avatar initials text styling. */
|
|
2237
|
+
avatarInitials: string
|
|
2238
|
+
/** Avatar fallback icon sizing. */
|
|
2239
|
+
avatarFallbackIcon: string
|
|
2240
|
+
/** Avatar square (non-rounded) variant. */
|
|
2241
|
+
avatarSquare: string
|
|
2242
|
+
|
|
2243
|
+
// ---- Badge tokens ----
|
|
2244
|
+
|
|
2245
|
+
/** Badge square (non-rounded) variant. */
|
|
2246
|
+
badgeSquare: string
|
|
2247
|
+
|
|
2248
|
+
// ---- Skeleton sub-element tokens ----
|
|
2249
|
+
|
|
2250
|
+
/** Skeleton text line container. */
|
|
2251
|
+
skeletonTextContainer: string
|
|
2252
|
+
/** Skeleton circle shape. */
|
|
2253
|
+
skeletonCircle: string
|
|
2254
|
+
/** Skeleton wave animation variant. */
|
|
2255
|
+
skeletonWave: string
|
|
2256
|
+
/** Skeleton no-animation variant. */
|
|
2257
|
+
skeletonNone: string
|
|
2258
|
+
|
|
2259
|
+
// ---- Typography utility tokens ----
|
|
2260
|
+
|
|
2261
|
+
/** Right-aligned text. */
|
|
2262
|
+
textRight: string
|
|
2263
|
+
|
|
2264
|
+
// ---- Theme surface tokens ----
|
|
2265
|
+
|
|
2266
|
+
/** Full-page background with default text color (light/dark aware). */
|
|
2267
|
+
page: string
|
|
2268
|
+
/** Card/panel surface background (light/dark aware). */
|
|
2269
|
+
surface: string
|
|
2270
|
+
/** Recessed/secondary surface background (e.g. tab bars, inputs, sidebars). */
|
|
2271
|
+
surfaceSecondary: string
|
|
2272
|
+
/** App header bar: surface + bottom border + subtle shadow. */
|
|
2273
|
+
headerBar: string
|
|
2274
|
+
/** Right-side drawer panel: fixed, full-height, scrollable. */
|
|
2275
|
+
drawer: string
|
|
2276
|
+
|
|
2277
|
+
// ---- Text color tokens ----
|
|
2278
|
+
|
|
2279
|
+
/** De-emphasized text (e.g. labels, secondary info). */
|
|
2280
|
+
textMuted: string
|
|
2281
|
+
/** Very subtle text (e.g. footer, icon color). */
|
|
2282
|
+
textSubtle: string
|
|
2283
|
+
/** Primary brand color text (e.g. links, active labels). */
|
|
2284
|
+
textPrimary: string
|
|
2285
|
+
/**
|
|
2286
|
+
* Readable text colour for content sitting on {@link bgPrimaryContainer}.
|
|
2287
|
+
*
|
|
2288
|
+
* The counterpart the theme guarantees contrast against — see the note on
|
|
2289
|
+
* `bgPrimaryContainer`. Note it is NOT interchangeable with `textPrimary`:
|
|
2290
|
+
* some themes build a dark primary container and give this a light value, so
|
|
2291
|
+
* pairing it with a light tint inverts the problem (measured at 1.07:1 in one
|
|
2292
|
+
* flagship). Always use the two together.
|
|
2293
|
+
*/
|
|
2294
|
+
textOnPrimaryContainer: string
|
|
2295
|
+
/** Success state text color. */
|
|
2296
|
+
textSuccess: string
|
|
2297
|
+
/** Warning state text color. */
|
|
2298
|
+
textWarning: string
|
|
2299
|
+
/** Error-state text color. */
|
|
2300
|
+
textError: string
|
|
2301
|
+
|
|
2302
|
+
// ---- Border tokens ----
|
|
2303
|
+
|
|
2304
|
+
/** Bottom border in theme border color. */
|
|
2305
|
+
borderB: string
|
|
2306
|
+
/** Top border in theme border color. */
|
|
2307
|
+
borderT: string
|
|
2308
|
+
/** Right border in theme border color. */
|
|
2309
|
+
borderR: string
|
|
2310
|
+
/** All-sides border in theme border color. */
|
|
2311
|
+
borderAll: string
|
|
2312
|
+
/** Primary-colored bottom border (e.g. active tab indicator). */
|
|
2313
|
+
borderBPrimary: string
|
|
2314
|
+
/** Primary-colored top border accent (e.g. highlighted pricing card). */
|
|
2315
|
+
borderTPrimary: string
|
|
2316
|
+
|
|
2317
|
+
// ---- Background utility tokens ----
|
|
2318
|
+
|
|
2319
|
+
/** Subtle error background for banners/notifications. */
|
|
2320
|
+
bgErrorSubtle: string
|
|
2321
|
+
/** Border color used as element background (e.g. resize handles, separators). */
|
|
2322
|
+
bgBorder: string
|
|
2323
|
+
/** Subtle primary-tinted background (e.g. icon halo, callout banner). */
|
|
2324
|
+
bgPrimarySubtle: string
|
|
2325
|
+
/**
|
|
2326
|
+
* Primary-tinted container background, paired with {@link textOnPrimaryContainer}.
|
|
2327
|
+
*
|
|
2328
|
+
* Use this pair — never `bgPrimarySubtle` + `textPrimary` — whenever TEXT sits
|
|
2329
|
+
* on a primary tint. The brand colour as text on a 10% tint of itself is only
|
|
2330
|
+
* legible when the brand is already dark: measured across the flagship themes,
|
|
2331
|
+
* an amber brand scores 1.98:1 there and no shade of the hue fixes it, because
|
|
2332
|
+
* darkening enough for the tint breaks the button fill it also has to serve.
|
|
2333
|
+
* The container pair is defined per theme precisely so both sides move
|
|
2334
|
+
* together, and it clears 4.5:1 in 130 of 133 flagship themes.
|
|
2335
|
+
*/
|
|
2336
|
+
bgPrimaryContainer: string
|
|
2337
|
+
/** Solid primary background (e.g. CTA fill). */
|
|
2338
|
+
bgPrimary: string
|
|
2339
|
+
/** Pure white background (uses `--color-surface-container-lowest` if defined). */
|
|
2340
|
+
bgWhite: string
|
|
2341
|
+
|
|
2342
|
+
// ---- Premium typography utilities ----
|
|
2343
|
+
|
|
2344
|
+
/** Italic style for emphasized headlines (e.g. tier name in pricing card). */
|
|
2345
|
+
italic: string
|
|
2346
|
+
/** ALL CAPS letter transform for eyebrow labels. */
|
|
2347
|
+
uppercase: string
|
|
2348
|
+
/** Wide letter-spacing for caps eyebrow / button labels. */
|
|
2349
|
+
trackingWide: string
|
|
2350
|
+
|
|
2351
|
+
// ---- Premium decoration tokens ----
|
|
2352
|
+
|
|
2353
|
+
/** Linear gradient using the app's primary color (e.g. hero CTAs). */
|
|
2354
|
+
gradientPrimary: string
|
|
2355
|
+
/** Soft elevation suitable for "lifted" cards (e.g. popular pricing tier). */
|
|
2356
|
+
shadowLifted: string
|
|
2357
|
+
|
|
2358
|
+
// ---- Composite style tokens ----
|
|
2359
|
+
|
|
2360
|
+
/** Settings section heading (small, muted). */
|
|
2361
|
+
sectionHeading: string
|
|
2362
|
+
/** Standard form label (block, small, medium weight, bottom margin). */
|
|
2363
|
+
formLabel: string
|
|
2364
|
+
/** Small form label variant (extra-small, muted). */
|
|
2365
|
+
formLabelSmall: string
|
|
2366
|
+
/** Inline text link appearance (hover effect). */
|
|
2367
|
+
link: string
|
|
2368
|
+
/** Rich text / long-form prose content. */
|
|
2369
|
+
prose: string
|
|
2370
|
+
/** Thin horizontal divider line. */
|
|
2371
|
+
dividerLine: string
|
|
2372
|
+
/** Modal overlay backdrop. */
|
|
2373
|
+
overlay: string
|
|
2374
|
+
/** Fixed bottom footer bar. */
|
|
2375
|
+
footerBar: string
|
|
2376
|
+
/** Footer link styling (muted, hover highlight). */
|
|
2377
|
+
footerLink: string
|
|
2378
|
+
/** Footer button styling (borderless, muted, hover highlight). */
|
|
2379
|
+
footerButton: string
|
|
2380
|
+
|
|
2381
|
+
// ---- Language selector tokens ----
|
|
2382
|
+
|
|
2383
|
+
/** Language selector grid container (responsive columns, scrollable). */
|
|
2384
|
+
languageGrid: string
|
|
2385
|
+
/** Language option item (default/inactive state). */
|
|
2386
|
+
languageOption: string
|
|
2387
|
+
/** Language option item (active/selected state). */
|
|
2388
|
+
languageActive: string
|
|
2389
|
+
/** Trigger button for `<LanguagePicker />` (globe icon + current locale name). */
|
|
2390
|
+
languagePickerTrigger: string
|
|
2391
|
+
|
|
2392
|
+
// ---- Spacing utilities ----
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* Returns a spacing class for the given property and scale.
|
|
2396
|
+
*/
|
|
2397
|
+
sp(property: SpacingProperty, scale: SpacingScale): string
|
|
2398
|
+
/**
|
|
2399
|
+
* Returns a style object resolved from a compound spacing spec.
|
|
2400
|
+
* Use on the `style` prop — avoids CSS class ordering conflicts entirely.
|
|
2401
|
+
* More specific properties override less specific ones (e.g. `pr` overrides `px` overrides `p`).
|
|
2402
|
+
*/
|
|
2403
|
+
sp(overrides: SpacingOverrides): Record<string, string>
|
|
2404
|
+
/**
|
|
2405
|
+
* Returns vertical space-between class (e.g. `space-y-*` in Tailwind).
|
|
2406
|
+
*/
|
|
2407
|
+
stack(scale: SpacingScale): string
|
|
2408
|
+
|
|
2409
|
+
// ---- Typography utilities ----
|
|
2410
|
+
|
|
2411
|
+
/**
|
|
2412
|
+
* Returns font size class for the given scale.
|
|
2413
|
+
*/
|
|
2414
|
+
textSize(size: TextScale): string
|
|
2415
|
+
/**
|
|
2416
|
+
* Returns font weight class for the given weight.
|
|
2417
|
+
*/
|
|
2418
|
+
fontWeight(weight: FontWeightScale): string
|
|
2419
|
+
/** Center-aligned text. */
|
|
2420
|
+
textCenter: string
|
|
2421
|
+
|
|
2422
|
+
// ---- Sizing utilities ----
|
|
2423
|
+
|
|
2424
|
+
/**
|
|
2425
|
+
* Returns width class — fractional (`'1/2'`), keyword (`'full'`), or numeric.
|
|
2426
|
+
*/
|
|
2427
|
+
w(value: WidthValue | number): string
|
|
2428
|
+
/**
|
|
2429
|
+
* Returns height class — keyword (`'full'`, `'screen'`) or numeric.
|
|
2430
|
+
*/
|
|
2431
|
+
h(value: HeightValue | number): string
|
|
2432
|
+
/**
|
|
2433
|
+
* Returns minimum height class.
|
|
2434
|
+
*/
|
|
2435
|
+
minH(value: HeightValue): string
|
|
2436
|
+
/**
|
|
2437
|
+
* Returns maximum width constraint class.
|
|
2438
|
+
*/
|
|
2439
|
+
maxW(value: MaxWidthScale): string
|
|
2440
|
+
/** Prevent flex shrinking. */
|
|
2441
|
+
shrink0: string
|
|
2442
|
+
|
|
2443
|
+
// ---- Touch / pointer utilities ----
|
|
2444
|
+
|
|
2445
|
+
/**
|
|
2446
|
+
* Minimum interactive hit-area for touch (coarse-pointer) devices — WCAG 2.5.5
|
|
2447
|
+
* "Target Size". Resolves to a `>=44x44px` minimum that applies ONLY on
|
|
2448
|
+
* coarse-pointer devices, so fine-pointer (mouse) layouts keep their compact
|
|
2449
|
+
* control sizing. Compose onto small icon buttons/controls that would otherwise
|
|
2450
|
+
* be too small to tap reliably on phones/tablets (e.g. the preview toolbar's
|
|
2451
|
+
* back/forward/refresh/open and device-frame buttons). On React Native (touch
|
|
2452
|
+
* by definition) the bond applies the minimum unconditionally.
|
|
2453
|
+
*/
|
|
2454
|
+
touchTarget: string
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* Compact coarse-pointer hit-area floor (`>=36x36px`) for inline CTAs inside
|
|
2458
|
+
* dense surfaces — banner/notice-card action buttons, chat-card actions —
|
|
2459
|
+
* where the full 44px {@link touchTarget} visibly overwhelms the strip or
|
|
2460
|
+
* card that hosts them. 36px is still comfortably tappable; reserve the full
|
|
2461
|
+
* 44px floor for standalone controls. Like {@link touchTarget} it applies
|
|
2462
|
+
* only on coarse-pointer devices (unconditionally on React Native).
|
|
2463
|
+
*/
|
|
2464
|
+
touchTargetCompact: string
|
|
2465
|
+
|
|
2466
|
+
// ---- Position utilities ----
|
|
2467
|
+
|
|
2468
|
+
// ---- Display utilities ----
|
|
2469
|
+
|
|
2470
|
+
/** Block display. */
|
|
2471
|
+
displayBlock: string
|
|
2472
|
+
/** Inline-block display. */
|
|
2473
|
+
displayInlineBlock: string
|
|
2474
|
+
/** Contents display (invisible wrapper). */
|
|
2475
|
+
displayContents: string
|
|
2476
|
+
|
|
2477
|
+
// ---- Layout utilities ----
|
|
2478
|
+
|
|
2479
|
+
/** Horizontal auto margin (centering). */
|
|
2480
|
+
mxAuto: string
|
|
2481
|
+
/** Pointer cursor. */
|
|
2482
|
+
cursorPointer: string
|
|
2483
|
+
/** Full border radius (circle). */
|
|
2484
|
+
roundedFull: string
|
|
2485
|
+
|
|
2486
|
+
// ---- Grid utilities ----
|
|
2487
|
+
|
|
2488
|
+
/**
|
|
2489
|
+
* Returns grid-template-rows class for the given row count.
|
|
2490
|
+
*/
|
|
2491
|
+
gridRows(rows: number): string
|
|
2492
|
+
|
|
2493
|
+
// ---- Position utilities ----
|
|
2494
|
+
|
|
2495
|
+
/**
|
|
2496
|
+
* Returns CSS position class for the given value.
|
|
2497
|
+
*/
|
|
2498
|
+
position(value: 'relative' | 'absolute' | 'fixed' | 'sticky'): string
|
|
2499
|
+
/** Full inset (inset: 0). */
|
|
2500
|
+
inset0: string
|
|
2501
|
+
|
|
2502
|
+
// ---- Logo / brand identity tokens ----
|
|
2503
|
+
|
|
2504
|
+
/** Logo wordmark text styling (size, tracking, case). */
|
|
2505
|
+
logoText: string
|
|
2506
|
+
/** Logo icon color (primary brand color). */
|
|
2507
|
+
logoIcon: string
|
|
2508
|
+
|
|
2509
|
+
// ---- Header layout tokens ----
|
|
2510
|
+
|
|
2511
|
+
/** Fixed header positioning (fixed, full-width, high z-index). */
|
|
2512
|
+
headerFixed: string
|
|
2513
|
+
/** Main header inner container (max-width, height, padding). */
|
|
2514
|
+
headerInner: string
|
|
2515
|
+
|
|
2516
|
+
// ---- Auth page layout tokens ----
|
|
2517
|
+
|
|
2518
|
+
/** Auth page header inner container (full-width, no max-width). */
|
|
2519
|
+
authHeaderInner: string
|
|
2520
|
+
/** Auth page body: centered content area. */
|
|
2521
|
+
authPageBody: string
|
|
2522
|
+
/** Auth form narrow container (max-width, centered). */
|
|
2523
|
+
authFormWrapper: string
|
|
2524
|
+
/** Auth form field spacing (bottom margin). */
|
|
2525
|
+
authField: string
|
|
2526
|
+
/** Spacing after auth submit area (top margin). */
|
|
2527
|
+
authAfterSubmit: string
|
|
2528
|
+
|
|
2529
|
+
// ---- Auth button layout tokens ----
|
|
2530
|
+
|
|
2531
|
+
/** Flex row container for auth form buttons. */
|
|
2532
|
+
authButtonRow: string
|
|
2533
|
+
/** Back button sizing in auth forms. */
|
|
2534
|
+
authBackButton: string
|
|
2535
|
+
/** Submit button sizing next to back button. */
|
|
2536
|
+
authSubmitButton: string
|
|
2537
|
+
/** Login page signup button (half-width, left). */
|
|
2538
|
+
authLoginSignup: string
|
|
2539
|
+
/** Login page submit button (half-width, right). */
|
|
2540
|
+
authLoginSubmit: string
|
|
2541
|
+
/** Login submit full-width (when logging in). */
|
|
2542
|
+
authLoginSubmitFull: string
|
|
2543
|
+
/** Hidden state for login signup button. */
|
|
2544
|
+
authHidden: string
|
|
2545
|
+
/** Forward arrow icon spacing. */
|
|
2546
|
+
authArrowIcon: string
|
|
2547
|
+
|
|
2548
|
+
// ---- App layout tokens ----
|
|
2549
|
+
|
|
2550
|
+
/** Main app content padding (header/footer offsets). */
|
|
2551
|
+
appLayout: string
|
|
2552
|
+
|
|
2553
|
+
/** Flex grow to fill available space (`flex: 1`). */
|
|
2554
|
+
flex1: string
|
|
2555
|
+
|
|
2556
|
+
// ---- OAuth tokens ----
|
|
2557
|
+
|
|
2558
|
+
/** OAuth provider name label (fallback when no icon). */
|
|
2559
|
+
oauthProviderLabel: string
|
|
2560
|
+
|
|
2561
|
+
// ---- Layout pattern tokens ----
|
|
2562
|
+
|
|
2563
|
+
/** PageShell root container (flex, full screen). */
|
|
2564
|
+
pageShell: string
|
|
2565
|
+
/** PageShell sidebar panel. */
|
|
2566
|
+
pageShellSidebar: string
|
|
2567
|
+
/** PageShell sidebar collapsed state (narrow width). */
|
|
2568
|
+
pageShellSidebarCollapsed: string
|
|
2569
|
+
/** PageShell top bar strip. */
|
|
2570
|
+
pageShellTopbar: string
|
|
2571
|
+
/** PageShell main content area (scrollable). */
|
|
2572
|
+
pageShellContent: string
|
|
2573
|
+
/** PageShell sidebar toggle button. */
|
|
2574
|
+
pageShellSidebarToggle: string
|
|
2575
|
+
/** EmptyState root container (centered column). */
|
|
2576
|
+
emptyState: string
|
|
2577
|
+
/** EmptyState icon/illustration wrapper. */
|
|
2578
|
+
emptyStateIcon: string
|
|
2579
|
+
/** EmptyState heading text. */
|
|
2580
|
+
emptyStateTitle: string
|
|
2581
|
+
/** EmptyState description text. */
|
|
2582
|
+
emptyStateDescription: string
|
|
2583
|
+
/** EmptyState action slot. */
|
|
2584
|
+
emptyStateAction: string
|
|
2585
|
+
/** PageHeader root container. */
|
|
2586
|
+
pageHeader: string
|
|
2587
|
+
/** PageHeader title text. */
|
|
2588
|
+
pageHeaderTitle: string
|
|
2589
|
+
/** PageHeader description text. */
|
|
2590
|
+
pageHeaderDescription: string
|
|
2591
|
+
/** PageHeader action buttons container. */
|
|
2592
|
+
pageHeaderActions: string
|
|
2593
|
+
/** PageHeader breadcrumb trail container. */
|
|
2594
|
+
pageHeaderBreadcrumbs: string
|
|
2595
|
+
/** PageHeader breadcrumb item link/text. */
|
|
2596
|
+
pageHeaderBreadcrumbItem: string
|
|
2597
|
+
/** PageHeader breadcrumb separator character. */
|
|
2598
|
+
pageHeaderBreadcrumbSeparator: string
|
|
2599
|
+
}
|
|
2600
|
+
```
|
|
2601
|
+
|
|
2602
|
+
#### `UIProvider`
|
|
2603
|
+
|
|
2604
|
+
Identifies the bonded UI styling library. Providers set `name`
|
|
2605
|
+
to indicate which library is active (e.g. `"tailwind"`, `"bootstrap"`).
|
|
2606
|
+
|
|
2607
|
+
```typescript
|
|
2608
|
+
interface UIProvider {
|
|
2609
|
+
/**
|
|
2610
|
+
* Identifier for the styling library (e.g. `"tailwind"`, `"ionic"`).
|
|
2611
|
+
*/
|
|
2612
|
+
name: string
|
|
2613
|
+
}
|
|
2614
|
+
```
|
|
2615
|
+
|
|
2616
|
+
### Types
|
|
2617
|
+
|
|
2618
|
+
#### `ButtonSize`
|
|
2619
|
+
|
|
2620
|
+
Button size variants (extends Size with 'icon' for square icon-only buttons).
|
|
2621
|
+
|
|
2622
|
+
```typescript
|
|
2623
|
+
type ButtonSize = Size | 'icon'
|
|
2624
|
+
```
|
|
2625
|
+
|
|
2626
|
+
#### `ButtonVariant`
|
|
2627
|
+
|
|
2628
|
+
Button visual variant styles.
|
|
2629
|
+
|
|
2630
|
+
```typescript
|
|
2631
|
+
type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link'
|
|
2632
|
+
```
|
|
2633
|
+
|
|
2634
|
+
#### `ChangeEventHandler`
|
|
2635
|
+
|
|
2636
|
+
Framework-agnostic change event handler.
|
|
2637
|
+
|
|
2638
|
+
```typescript
|
|
2639
|
+
type ChangeEventHandler = EventHandler<Event>
|
|
2640
|
+
```
|
|
2641
|
+
|
|
2642
|
+
#### `Children`
|
|
2643
|
+
|
|
2644
|
+
Framework-agnostic child content.
|
|
2645
|
+
Use `unknown` to allow any framework's node type (ReactNode, VNode, etc.).
|
|
2646
|
+
|
|
2647
|
+
```typescript
|
|
2648
|
+
type Children = unknown
|
|
2649
|
+
```
|
|
2650
|
+
|
|
2651
|
+
#### `ClassMapOverrides`
|
|
2652
|
+
|
|
2653
|
+
Overrides for extending a UIClassMap.
|
|
2654
|
+
|
|
2655
|
+
Can be a partial map of token replacements, or a function that receives
|
|
2656
|
+
the base ClassMap and returns overrides (useful for extending resolver
|
|
2657
|
+
functions while preserving the base behavior).
|
|
2658
|
+
|
|
2659
|
+
```typescript
|
|
2660
|
+
type ClassMapOverrides = Partial<UIClassMap> | ((base: UIClassMap) => Partial<UIClassMap>)
|
|
2661
|
+
```
|
|
2662
|
+
|
|
2663
|
+
#### `ClassMapValue`
|
|
2664
|
+
|
|
2665
|
+
Class value types accepted by the UIClassMap `cn()` function.
|
|
2666
|
+
Supports strings, booleans, arrays, and conditional objects.
|
|
2667
|
+
|
|
2668
|
+
```typescript
|
|
2669
|
+
type ClassMapValue =
|
|
2670
|
+
| string
|
|
2671
|
+
| number
|
|
2672
|
+
| boolean
|
|
2673
|
+
| undefined
|
|
2674
|
+
| null
|
|
2675
|
+
| ClassMapValue[]
|
|
2676
|
+
| Record<string, boolean | undefined | null>
|
|
2677
|
+
```
|
|
2678
|
+
|
|
2679
|
+
#### `ColorVariant`
|
|
2680
|
+
|
|
2681
|
+
Semantic color variants used across components for status indication.
|
|
2682
|
+
|
|
2683
|
+
```typescript
|
|
2684
|
+
type ColorVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info'
|
|
2685
|
+
```
|
|
2686
|
+
|
|
2687
|
+
#### `EventHandler`
|
|
2688
|
+
|
|
2689
|
+
Framework-agnostic event handler.
|
|
2690
|
+
|
|
2691
|
+
```typescript
|
|
2692
|
+
type EventHandler<E = Event> = (event: E) => void
|
|
2693
|
+
```
|
|
2694
|
+
|
|
2695
|
+
#### `FocusEventHandler`
|
|
2696
|
+
|
|
2697
|
+
Framework-agnostic focus event handler.
|
|
2698
|
+
|
|
2699
|
+
```typescript
|
|
2700
|
+
type FocusEventHandler = EventHandler<FocusEvent>
|
|
2701
|
+
```
|
|
2702
|
+
|
|
2703
|
+
#### `FontWeightScale`
|
|
2704
|
+
|
|
2705
|
+
Font weight scale.
|
|
2706
|
+
|
|
2707
|
+
```typescript
|
|
2708
|
+
type FontWeightScale = 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold'
|
|
2709
|
+
```
|
|
2710
|
+
|
|
2711
|
+
#### `FormEventHandler`
|
|
2712
|
+
|
|
2713
|
+
Framework-agnostic form event handler.
|
|
2714
|
+
|
|
2715
|
+
```typescript
|
|
2716
|
+
type FormEventHandler = EventHandler<Event>
|
|
2717
|
+
```
|
|
2718
|
+
|
|
2719
|
+
#### `HeightValue`
|
|
2720
|
+
|
|
2721
|
+
Height value — fractional, keyword, or numeric (mapped to spacing scale).
|
|
2722
|
+
|
|
2723
|
+
```typescript
|
|
2724
|
+
type HeightValue =
|
|
2725
|
+
'full' | 'screen' | 'auto' | '1/2' | '1/3' | '2/3' | '1/4' | '3/4' | TailwindArbitraryBracket
|
|
2726
|
+
```
|
|
2727
|
+
|
|
2728
|
+
#### `InputType`
|
|
2729
|
+
|
|
2730
|
+
Allowed HTML input type attribute values for the Input component.
|
|
2731
|
+
|
|
2732
|
+
```typescript
|
|
2733
|
+
type InputType =
|
|
2734
|
+
| 'text'
|
|
2735
|
+
| 'email'
|
|
2736
|
+
| 'password'
|
|
2737
|
+
| 'number'
|
|
2738
|
+
| 'tel'
|
|
2739
|
+
| 'url'
|
|
2740
|
+
| 'search'
|
|
2741
|
+
| 'date'
|
|
2742
|
+
| 'time'
|
|
2743
|
+
| 'datetime-local'
|
|
2744
|
+
```
|
|
2745
|
+
|
|
2746
|
+
#### `KeyboardEventHandler`
|
|
2747
|
+
|
|
2748
|
+
Framework-agnostic keyboard event handler.
|
|
2749
|
+
|
|
2750
|
+
```typescript
|
|
2751
|
+
type KeyboardEventHandler = EventHandler<KeyboardEvent>
|
|
2752
|
+
```
|
|
2753
|
+
|
|
2754
|
+
#### `MaxWidthScale`
|
|
2755
|
+
|
|
2756
|
+
Max-width scale for constraining content.
|
|
2757
|
+
|
|
2758
|
+
```typescript
|
|
2759
|
+
type MaxWidthScale =
|
|
2760
|
+
| 'none'
|
|
2761
|
+
| 'xs'
|
|
2762
|
+
| 'sm'
|
|
2763
|
+
| 'md'
|
|
2764
|
+
| 'lg'
|
|
2765
|
+
| 'xl'
|
|
2766
|
+
| '2xl'
|
|
2767
|
+
| '3xl'
|
|
2768
|
+
| '4xl'
|
|
2769
|
+
| '5xl'
|
|
2770
|
+
| '6xl'
|
|
2771
|
+
| '7xl'
|
|
2772
|
+
| 'full'
|
|
2773
|
+
| 'screen-2xl'
|
|
2774
|
+
| TailwindArbitraryBracket
|
|
2775
|
+
```
|
|
2776
|
+
|
|
2777
|
+
#### `ModalSize`
|
|
2778
|
+
|
|
2779
|
+
Modal size variants including full-screen.
|
|
2780
|
+
|
|
2781
|
+
```typescript
|
|
2782
|
+
type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'
|
|
2783
|
+
```
|
|
2784
|
+
|
|
2785
|
+
#### `MouseEventHandler`
|
|
2786
|
+
|
|
2787
|
+
Framework-agnostic mouse event handler.
|
|
2788
|
+
|
|
2789
|
+
```typescript
|
|
2790
|
+
type MouseEventHandler = EventHandler<MouseEvent>
|
|
2791
|
+
```
|
|
2792
|
+
|
|
2793
|
+
#### `Size`
|
|
2794
|
+
|
|
2795
|
+
Standard size scale used across all molecule UI components (buttons, inputs, badges, etc.).
|
|
2796
|
+
|
|
2797
|
+
```typescript
|
|
2798
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
2799
|
+
```
|
|
2800
|
+
|
|
2801
|
+
#### `SpacingOverrides`
|
|
2802
|
+
|
|
2803
|
+
Compound spacing specification for conflict-free overrides.
|
|
2804
|
+
|
|
2805
|
+
Pass to `sp()` to get a style object (for use on the `style` prop).
|
|
2806
|
+
More specific properties override less specific ones:
|
|
2807
|
+
`pr` overrides `px` overrides `p` (same cascade as CSS shorthand).
|
|
2808
|
+
|
|
2809
|
+
Returns `Record<string, string>` so it is compatible with any framework's
|
|
2810
|
+
inline style API without requiring a React-specific import.
|
|
2811
|
+
|
|
2812
|
+
```typescript
|
|
2813
|
+
type SpacingOverrides = Partial<Record<SpacingProperty, SpacingScale>>
|
|
2814
|
+
```
|
|
2815
|
+
|
|
2816
|
+
#### `SpacingProperty`
|
|
2817
|
+
|
|
2818
|
+
CSS spacing property shorthand (padding/margin with direction).
|
|
2819
|
+
|
|
2820
|
+
```typescript
|
|
2821
|
+
type SpacingProperty =
|
|
2822
|
+
'p' | 'px' | 'py' | 'pt' | 'pb' | 'pl' | 'pr' | 'm' | 'mx' | 'my' | 'mt' | 'mb' | 'ml' | 'mr'
|
|
2823
|
+
```
|
|
2824
|
+
|
|
2825
|
+
#### `SpacingScale`
|
|
2826
|
+
|
|
2827
|
+
Abstract spacing scale. Each styling library maps these to its own units.
|
|
2828
|
+
For Tailwind: 0 → 0, 1 → 0.25rem, 4 → 1rem, 8 → 2rem, etc.
|
|
2829
|
+
|
|
2830
|
+
```typescript
|
|
2831
|
+
type SpacingScale = 0 | 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24
|
|
2832
|
+
```
|
|
2833
|
+
|
|
2834
|
+
#### `TailwindArbitraryBracket`
|
|
2835
|
+
|
|
2836
|
+
Tailwind arbitrary value in bracket notation (e.g. `[440px]`, `[65%]`).
|
|
2837
|
+
|
|
2838
|
+
```typescript
|
|
2839
|
+
type TailwindArbitraryBracket = `[${string}]`
|
|
2840
|
+
```
|
|
2841
|
+
|
|
2842
|
+
#### `TextScale`
|
|
2843
|
+
|
|
2844
|
+
Text size scale from extra-small to 4xl.
|
|
2845
|
+
|
|
2846
|
+
```typescript
|
|
2847
|
+
type TextScale = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl'
|
|
2848
|
+
```
|
|
2849
|
+
|
|
2850
|
+
#### `ToastPosition`
|
|
2851
|
+
|
|
2852
|
+
Toast position values for screen placement.
|
|
2853
|
+
|
|
2854
|
+
```typescript
|
|
2855
|
+
type ToastPosition = 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
|
|
2856
|
+
```
|
|
2857
|
+
|
|
2858
|
+
#### `TooltipPlacement`
|
|
2859
|
+
|
|
2860
|
+
Position where a tooltip renders relative to its trigger element (top, bottom, left, right, and corner variants).
|
|
2861
|
+
|
|
2862
|
+
```typescript
|
|
2863
|
+
type TooltipPlacement =
|
|
2864
|
+
'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'
|
|
2865
|
+
```
|
|
2866
|
+
|
|
2867
|
+
#### `WidthValue`
|
|
2868
|
+
|
|
2869
|
+
Width value — fractional, keyword, or numeric (mapped to spacing scale).
|
|
2870
|
+
|
|
2871
|
+
```typescript
|
|
2872
|
+
type WidthValue =
|
|
2873
|
+
| 'full'
|
|
2874
|
+
| '1/2'
|
|
2875
|
+
| '1/3'
|
|
2876
|
+
| '2/3'
|
|
2877
|
+
| '1/4'
|
|
2878
|
+
| '3/4'
|
|
2879
|
+
| 'auto'
|
|
2880
|
+
| 'screen'
|
|
2881
|
+
| 'fit'
|
|
2882
|
+
| TailwindArbitraryBracket
|
|
2883
|
+
```
|
|
2884
|
+
|
|
2885
|
+
### Functions
|
|
2886
|
+
|
|
2887
|
+
#### `extendClassMap(base, overrides)`
|
|
2888
|
+
|
|
2889
|
+
Creates a new UIClassMap by extending a base ClassMap with overrides.
|
|
2890
|
+
|
|
2891
|
+
Overrides can be a plain object (for replacing specific tokens/resolvers)
|
|
2892
|
+
or a function that receives the base map (for extending resolvers while
|
|
2893
|
+
preserving base behavior).
|
|
2894
|
+
|
|
2895
|
+
```typescript
|
|
2896
|
+
function extendClassMap(base: UIClassMap, overrides: ClassMapOverrides): UIClassMap
|
|
2897
|
+
```
|
|
2898
|
+
|
|
2899
|
+
- `base` — The base UIClassMap to extend
|
|
2900
|
+
- `overrides` — Token overrides (object or function returning object)
|
|
2901
|
+
|
|
2902
|
+
**Returns:** A new UIClassMap with overrides applied
|
|
2903
|
+
|
|
2904
|
+
#### `getClassMap()`
|
|
2905
|
+
|
|
2906
|
+
Retrieves the bonded UIClassMap, throwing if none is configured.
|
|
2907
|
+
Use this to resolve styling-agnostic class names in components.
|
|
2908
|
+
|
|
2909
|
+
```typescript
|
|
2910
|
+
function getClassMap(): UIClassMap
|
|
2911
|
+
```
|
|
2912
|
+
|
|
2913
|
+
**Returns:** The bonded UIClassMap implementation.
|
|
2914
|
+
|
|
2915
|
+
#### `getProvider()`
|
|
2916
|
+
|
|
2917
|
+
Retrieves the bonded UI provider, or `undefined` if none is configured.
|
|
2918
|
+
|
|
2919
|
+
```typescript
|
|
2920
|
+
function getProvider(): UIProvider | undefined
|
|
2921
|
+
```
|
|
2922
|
+
|
|
2923
|
+
**Returns:** The bonded UI provider, or `undefined`.
|
|
2924
|
+
|
|
2925
|
+
#### `hasClassMap()`
|
|
2926
|
+
|
|
2927
|
+
Checks whether a UIClassMap is currently bonded.
|
|
2928
|
+
|
|
2929
|
+
```typescript
|
|
2930
|
+
function hasClassMap(): boolean
|
|
2931
|
+
```
|
|
2932
|
+
|
|
2933
|
+
**Returns:** `true` if a UIClassMap is bonded.
|
|
2934
|
+
|
|
2935
|
+
#### `hasProvider()`
|
|
2936
|
+
|
|
2937
|
+
Checks whether a UI provider is currently bonded.
|
|
2938
|
+
|
|
2939
|
+
```typescript
|
|
2940
|
+
function hasProvider(): boolean
|
|
2941
|
+
```
|
|
2942
|
+
|
|
2943
|
+
**Returns:** `true` if a UI provider is bonded.
|
|
2944
|
+
|
|
2945
|
+
#### `molId(component, context, qualifier)`
|
|
2946
|
+
|
|
2947
|
+
Generate a semantic automation ID for a component.
|
|
2948
|
+
|
|
2949
|
+
```typescript
|
|
2950
|
+
function molId(component: string, context: string, qualifier?: string): string
|
|
2951
|
+
```
|
|
2952
|
+
|
|
2953
|
+
- `component` — Component type (e.g., 'button', 'input', 'card')
|
|
2954
|
+
- `context` — Context within the page (e.g., 'login', 'product', 'settings')
|
|
2955
|
+
- `qualifier` — Optional qualifier (e.g., 'submit', 'cancel', item ID)
|
|
2956
|
+
|
|
2957
|
+
**Returns:** The joined automation ID string.
|
|
2958
|
+
|
|
2959
|
+
#### `molIdProps(id)`
|
|
2960
|
+
|
|
2961
|
+
Generate the props object for spreading onto an element.
|
|
2962
|
+
|
|
2963
|
+
```typescript
|
|
2964
|
+
function molIdProps(id: string): Record<string, string>
|
|
2965
|
+
```
|
|
2966
|
+
|
|
2967
|
+
- `id` — The automation ID string.
|
|
2968
|
+
|
|
2969
|
+
**Returns:** An object with the `data-mol-id` attribute set.
|
|
2970
|
+
|
|
2971
|
+
#### `molSelector(id)`
|
|
2972
|
+
|
|
2973
|
+
Playwright/testing selector for finding elements by automation ID.
|
|
2974
|
+
|
|
2975
|
+
```typescript
|
|
2976
|
+
function molSelector(id: string): string
|
|
2977
|
+
```
|
|
2978
|
+
|
|
2979
|
+
- `id` — The automation ID to find.
|
|
2980
|
+
|
|
2981
|
+
**Returns:** A CSS attribute selector string.
|
|
2982
|
+
|
|
2983
|
+
#### `molSelectorPrefix(prefix)`
|
|
2984
|
+
|
|
2985
|
+
Playwright/testing selector for finding elements by partial automation ID.
|
|
2986
|
+
Useful for finding all elements of a type: molSelectorPrefix('button-login')
|
|
2987
|
+
|
|
2988
|
+
```typescript
|
|
2989
|
+
function molSelectorPrefix(prefix: string): string
|
|
2990
|
+
```
|
|
2991
|
+
|
|
2992
|
+
- `prefix` — The automation ID prefix to match.
|
|
2993
|
+
|
|
2994
|
+
**Returns:** A CSS attribute prefix selector string.
|
|
2995
|
+
|
|
2996
|
+
#### `setClassMap(classMap)`
|
|
2997
|
+
|
|
2998
|
+
Registers a UIClassMap as the active styling resolver. Called at
|
|
2999
|
+
app startup to wire a styling library (e.g. Tailwind, Bootstrap).
|
|
3000
|
+
|
|
3001
|
+
```typescript
|
|
3002
|
+
function setClassMap(classMap: UIClassMap): void
|
|
3003
|
+
```
|
|
3004
|
+
|
|
3005
|
+
- `classMap` — The UIClassMap implementation to bond.
|
|
3006
|
+
|
|
3007
|
+
#### `setProvider(provider)`
|
|
3008
|
+
|
|
3009
|
+
Registers a UI provider as the active singleton.
|
|
3010
|
+
|
|
3011
|
+
```typescript
|
|
3012
|
+
function setProvider(provider: UIProvider): void
|
|
3013
|
+
```
|
|
3014
|
+
|
|
3015
|
+
- `provider` — The UI provider implementation to bond.
|
|
3016
|
+
|
|
3017
|
+
### Constants
|
|
3018
|
+
|
|
3019
|
+
#### `MOL_ID_ATTR`
|
|
3020
|
+
|
|
3021
|
+
The HTML attribute name for automation IDs.
|
|
3022
|
+
|
|
3023
|
+
```typescript
|
|
3024
|
+
const MOL_ID_ATTR: 'data-mol-id'
|
|
3025
|
+
```
|
|
3026
|
+
|
|
3027
|
+
## Available Providers
|
|
3028
|
+
|
|
3029
|
+
| Provider | Package |
|
|
3030
|
+
| --------------- | --------------------------------- |
|
|
3031
|
+
| Angular UI | `@molecule/app-ui-angular` |
|
|
3032
|
+
| NativeWind | `@molecule/app-ui-nativewind` |
|
|
3033
|
+
| React UI | `@molecule/app-ui-react` |
|
|
3034
|
+
| React Native UI | `@molecule/app-ui-react-native` |
|
|
3035
|
+
| Solid UI | `@molecule/app-ui-solid` |
|
|
3036
|
+
| Svelte UI | `@molecule/app-ui-svelte` |
|
|
3037
|
+
| Tailwind UI | `@molecule/app-ui-tailwind` |
|
|
3038
|
+
| Tailwind Glass | `@molecule/app-ui-tailwind-glass` |
|
|
3039
|
+
| Vue UI | `@molecule/app-ui-vue` |
|
|
3040
|
+
|
|
3041
|
+
## Injection Notes
|
|
3042
|
+
|
|
3043
|
+
### Requirements
|
|
3044
|
+
|
|
3045
|
+
Peer dependencies:
|
|
3046
|
+
|
|
3047
|
+
- `@molecule/app-bond` ^1.0.1
|
|
3048
|
+
- `@molecule/app-i18n` ^1.0.1
|
|
3049
|
+
|
|
3050
|
+
### Runtime Dependencies
|
|
3051
|
+
|
|
3052
|
+
- `@molecule/app-bond`
|
|
3053
|
+
- `@molecule/app-i18n`
|
|
3054
|
+
|
|
3055
|
+
**Style through {@link getClassMap} — NEVER write raw CSS/Tailwind class names in a
|
|
3056
|
+
component.** `const cm = getClassMap()` returns the resolver; use its helpers (`cm.flex`,
|
|
3057
|
+
`cm.surface`, `cm.textSize(size)`, the component helpers like `cm.button`/`cm.card`, and
|
|
3058
|
+
`cm.cn(...)` to compose) and pass the result to `className`. Class-name STRINGS live only in
|
|
3059
|
+
the ClassMap bond (`@molecule/app-ui-tailwind`), so swapping the styling library touches
|
|
3060
|
+
only the bond — a literal `"flex p-4"` in a component defeats that and is the #1 styling
|
|
3061
|
+
mistake.
|
|
3062
|
+
|
|
3063
|
+
- **Inline styles must not fight ClassMap.** An inline `style` has higher specificity and
|
|
3064
|
+
SILENTLY overrides the class controlling the same property (e.g. `style={{ background }}`
|
|
3065
|
+
kills `cm.surface`). Use inline only for what ClassMap can't express (a specific pixel
|
|
3066
|
+
width, an SVG attribute, a one-off accent color).
|
|
3067
|
+
- **Check what a class resolves to before using it** — read the bond definition, don't guess
|
|
3068
|
+
a helper name or option value; an invalid `cm.*` value is a type error or a silent no-op.
|
|
3069
|
+
- **Every interactive element needs a stable `data-mol-id`** — spread {@link molIdProps} (or
|
|
3070
|
+
set {@link MOL_ID_ATTR} via {@link molId}) so AI agents and tests can target it.
|
|
3071
|
+
- **`tabsList`/`tabsTrigger`/`tabsContent` are resolver functions**, not static strings —
|
|
3072
|
+
call `cm.tabsList(opts)`/`cm.tabsTrigger(opts)`/`cm.tabsContent(opts)` with an optional
|
|
3073
|
+
{@link TabsClassOptions} (`variant`/`size`). Active-tab styling stays a `data-state`
|
|
3074
|
+
attribute selector the caller sets, not one of these options. `cm.switchBase(opts)` also
|
|
3075
|
+
accepts a `color` ({@link SwitchClassOptions}) alongside `size`.
|
|
3076
|
+
|
|
3077
|
+
## Translations
|
|
3078
|
+
|
|
3079
|
+
Translation strings are provided by `@molecule/app-locales-ui`.
|