@molecule/app-ui-angular 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +115 -0
- package/README.md +1591 -0
- package/dist/components/alert.component.d.ts +71 -0
- package/dist/components/alert.component.d.ts.map +1 -0
- package/dist/components/alert.component.js +222 -0
- package/dist/components/alert.component.js.map +1 -0
- package/dist/components/badge.component.d.ts +27 -0
- package/dist/components/badge.component.d.ts.map +1 -0
- package/dist/components/badge.component.js +78 -0
- package/dist/components/badge.component.js.map +1 -0
- package/dist/components/button.component.d.ts +38 -0
- package/dist/components/button.component.d.ts.map +1 -0
- package/dist/components/button.component.js +136 -0
- package/dist/components/button.component.js.map +1 -0
- package/dist/components/checkbox.component.d.ts +53 -0
- package/dist/components/checkbox.component.d.ts.map +1 -0
- package/dist/components/checkbox.component.js +165 -0
- package/dist/components/checkbox.component.js.map +1 -0
- package/dist/components/index.d.ts +18 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +18 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/input.component.d.ts +87 -0
- package/dist/components/input.component.d.ts.map +1 -0
- package/dist/components/input.component.js +307 -0
- package/dist/components/input.component.js.map +1 -0
- package/dist/components/modal.component.d.ts +142 -0
- package/dist/components/modal.component.d.ts.map +1 -0
- package/dist/components/modal.component.js +375 -0
- package/dist/components/modal.component.js.map +1 -0
- package/dist/components/radio-group.component.d.ts +63 -0
- package/dist/components/radio-group.component.d.ts.map +1 -0
- package/dist/components/radio-group.component.js +207 -0
- package/dist/components/radio-group.component.js.map +1 -0
- package/dist/components/select.component.d.ts +72 -0
- package/dist/components/select.component.d.ts.map +1 -0
- package/dist/components/select.component.js +273 -0
- package/dist/components/select.component.js.map +1 -0
- package/dist/components/spinner.component.d.ts +36 -0
- package/dist/components/spinner.component.d.ts.map +1 -0
- package/dist/components/spinner.component.js +115 -0
- package/dist/components/spinner.component.js.map +1 -0
- package/dist/components/switch.component.d.ts +54 -0
- package/dist/components/switch.component.d.ts.map +1 -0
- package/dist/components/switch.component.js +147 -0
- package/dist/components/switch.component.js.map +1 -0
- package/dist/components/toast.component.d.ts +92 -0
- package/dist/components/toast.component.d.ts.map +1 -0
- package/dist/components/toast.component.js +298 -0
- package/dist/components/toast.component.js.map +1 -0
- package/dist/components/tooltip.component.d.ts +77 -0
- package/dist/components/tooltip.component.d.ts.map +1 -0
- package/dist/components/tooltip.component.js +315 -0
- package/dist/components/tooltip.component.js.map +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/utilities/index.d.ts +8 -0
- package/dist/utilities/index.d.ts.map +1 -0
- package/dist/utilities/index.js +8 -0
- package/dist/utilities/index.js.map +1 -0
- package/dist/utilities/render-icon.d.ts +15 -0
- package/dist/utilities/render-icon.d.ts.map +1 -0
- package/dist/utilities/render-icon.js +44 -0
- package/dist/utilities/render-icon.js.map +1 -0
- package/dist/utilities/utilities.d.ts +12 -0
- package/dist/utilities/utilities.d.ts.map +1 -0
- package/dist/utilities/utilities.js +14 -0
- package/dist/utilities/utilities.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,1591 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-04T00:41:30.090Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-ui-angular
|
|
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
|
+
Angular UI components for molecule.dev.
|
|
16
|
+
|
|
17
|
+
Provides standalone Angular components implementing a SUBSET of the
|
|
18
|
+
`@molecule/app-ui` component interfaces, styled through the UIClassMap
|
|
19
|
+
abstraction. Ships 12 components — `MoleculeAlert`, `MoleculeBadge`,
|
|
20
|
+
`MoleculeButton`, `MoleculeCheckbox`, `MoleculeInput`, `MoleculeModal`,
|
|
21
|
+
`MoleculeRadioGroup`, `MoleculeSelect`, `MoleculeSpinner`,
|
|
22
|
+
`MoleculeSwitch`, `MoleculeToast`, `MoleculeTooltip` — each a standalone
|
|
23
|
+
component with a `mol-*` selector. Layout/data components (Card, Table,
|
|
24
|
+
Tabs, Accordion, Dropdown, Icon, …) are not implemented for Angular yet;
|
|
25
|
+
compose them from ClassMap classes via `getClassMap()`.
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import { Component } from '@angular/core'
|
|
31
|
+
import { setClassMap } from '@molecule/app-ui'
|
|
32
|
+
import { classMap } from '@molecule/app-ui-tailwind'
|
|
33
|
+
import { MoleculeButton, MoleculeInput } from '@molecule/app-ui-angular'
|
|
34
|
+
|
|
35
|
+
// Once at startup, before the first component renders:
|
|
36
|
+
setClassMap(classMap)
|
|
37
|
+
|
|
38
|
+
@Component({
|
|
39
|
+
selector: 'app-save-panel',
|
|
40
|
+
standalone: true,
|
|
41
|
+
imports: [MoleculeButton, MoleculeInput],
|
|
42
|
+
template: `
|
|
43
|
+
<mol-input placeholder="Name" [value]="name" (handleInput)="onName($event)"></mol-input>
|
|
44
|
+
<mol-button color="primary" [loading]="saving" (handleClick)="save()">Save</mol-button>
|
|
45
|
+
`,
|
|
46
|
+
})
|
|
47
|
+
class SavePanel {
|
|
48
|
+
name = ''
|
|
49
|
+
saving = false
|
|
50
|
+
onName(event: Event): void {
|
|
51
|
+
this.name = (event.target as HTMLInputElement).value
|
|
52
|
+
}
|
|
53
|
+
save(): void {}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Type
|
|
58
|
+
|
|
59
|
+
`framework`
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npm install @molecule/app-ui-angular @angular/core @angular/platform-browser @molecule/app-i18n @molecule/app-icons @molecule/app-ui
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## API
|
|
68
|
+
|
|
69
|
+
### Interfaces
|
|
70
|
+
|
|
71
|
+
#### `AccordionItem`
|
|
72
|
+
|
|
73
|
+
A single item in an Accordion component.
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
interface AccordionItem<T = string> {
|
|
77
|
+
/**
|
|
78
|
+
* Item value/id.
|
|
79
|
+
*/
|
|
80
|
+
value: T
|
|
81
|
+
/**
|
|
82
|
+
* Item header/trigger.
|
|
83
|
+
*/
|
|
84
|
+
header: Children
|
|
85
|
+
/**
|
|
86
|
+
* Item content.
|
|
87
|
+
*/
|
|
88
|
+
content: Children
|
|
89
|
+
/**
|
|
90
|
+
* Whether the item is disabled.
|
|
91
|
+
*/
|
|
92
|
+
disabled?: boolean
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### `AccordionProps`
|
|
97
|
+
|
|
98
|
+
Props for the Accordion component.
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
interface AccordionProps<T = string> extends BaseProps {
|
|
102
|
+
/**
|
|
103
|
+
* Accordion items.
|
|
104
|
+
*/
|
|
105
|
+
items: AccordionItem<T>[]
|
|
106
|
+
/**
|
|
107
|
+
* Expanded item(s).
|
|
108
|
+
*/
|
|
109
|
+
value?: T | T[]
|
|
110
|
+
/**
|
|
111
|
+
* Default expanded item(s).
|
|
112
|
+
*/
|
|
113
|
+
defaultValue?: T | T[]
|
|
114
|
+
/**
|
|
115
|
+
* Change handler.
|
|
116
|
+
*/
|
|
117
|
+
onChange?: (value: T | T[]) => void
|
|
118
|
+
/**
|
|
119
|
+
* Whether multiple items can be expanded.
|
|
120
|
+
*/
|
|
121
|
+
multiple?: boolean
|
|
122
|
+
/**
|
|
123
|
+
* Whether items can be collapsed.
|
|
124
|
+
*/
|
|
125
|
+
collapsible?: boolean
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### `AlertProps`
|
|
130
|
+
|
|
131
|
+
Props for the Alert component.
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
interface AlertProps extends HTMLElementProps {
|
|
135
|
+
/**
|
|
136
|
+
* Alert content.
|
|
137
|
+
*/
|
|
138
|
+
children?: Children
|
|
139
|
+
/**
|
|
140
|
+
* Alert title.
|
|
141
|
+
*/
|
|
142
|
+
title?: string
|
|
143
|
+
/**
|
|
144
|
+
* Alert status/type.
|
|
145
|
+
*/
|
|
146
|
+
status?: ColorVariant
|
|
147
|
+
/**
|
|
148
|
+
* Alert variant.
|
|
149
|
+
*/
|
|
150
|
+
variant?: 'solid' | 'subtle' | 'outline' | 'left-accent'
|
|
151
|
+
/**
|
|
152
|
+
* Whether the alert is dismissible.
|
|
153
|
+
*/
|
|
154
|
+
dismissible?: boolean
|
|
155
|
+
/**
|
|
156
|
+
* Called when dismissed.
|
|
157
|
+
*/
|
|
158
|
+
onDismiss?: () => void
|
|
159
|
+
/**
|
|
160
|
+
* Icon to display.
|
|
161
|
+
*/
|
|
162
|
+
icon?: Children
|
|
163
|
+
/**
|
|
164
|
+
* Accessible label for the dismiss button.
|
|
165
|
+
* @default 'Dismiss'
|
|
166
|
+
*/
|
|
167
|
+
dismissLabel?: string
|
|
168
|
+
}
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
#### `AvatarProps`
|
|
172
|
+
|
|
173
|
+
Props for the Avatar component.
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
interface AvatarProps extends HTMLElementProps {
|
|
177
|
+
/**
|
|
178
|
+
* Image source URL.
|
|
179
|
+
*/
|
|
180
|
+
src?: string
|
|
181
|
+
/**
|
|
182
|
+
* Alt text for the image.
|
|
183
|
+
*/
|
|
184
|
+
alt?: string
|
|
185
|
+
/**
|
|
186
|
+
* Name for fallback initials.
|
|
187
|
+
*/
|
|
188
|
+
name?: string
|
|
189
|
+
/**
|
|
190
|
+
* Avatar size.
|
|
191
|
+
*/
|
|
192
|
+
size?: Size | number
|
|
193
|
+
/**
|
|
194
|
+
* Whether the avatar is rounded.
|
|
195
|
+
*/
|
|
196
|
+
rounded?: boolean
|
|
197
|
+
/**
|
|
198
|
+
* Fallback element when no image.
|
|
199
|
+
*/
|
|
200
|
+
fallback?: Children
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
#### `BadgeProps`
|
|
205
|
+
|
|
206
|
+
Props for the Badge component (status labels, counts, tags).
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
interface BadgeProps extends HTMLElementProps {
|
|
210
|
+
/**
|
|
211
|
+
* Badge content.
|
|
212
|
+
*/
|
|
213
|
+
children?: Children
|
|
214
|
+
/**
|
|
215
|
+
* Badge color.
|
|
216
|
+
*/
|
|
217
|
+
color?: ColorVariant
|
|
218
|
+
/**
|
|
219
|
+
* Badge variant.
|
|
220
|
+
*/
|
|
221
|
+
variant?: 'solid' | 'outline' | 'subtle'
|
|
222
|
+
/**
|
|
223
|
+
* Badge size.
|
|
224
|
+
*/
|
|
225
|
+
size?: Size
|
|
226
|
+
/**
|
|
227
|
+
* Whether the badge is rounded.
|
|
228
|
+
*/
|
|
229
|
+
rounded?: boolean
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### `BaseProps`
|
|
234
|
+
|
|
235
|
+
Base props shared by all components.
|
|
236
|
+
|
|
237
|
+
```typescript
|
|
238
|
+
interface BaseProps {
|
|
239
|
+
/**
|
|
240
|
+
* Additional CSS class name(s).
|
|
241
|
+
*/
|
|
242
|
+
className?: string
|
|
243
|
+
/**
|
|
244
|
+
* Inline styles.
|
|
245
|
+
*/
|
|
246
|
+
style?: CSSProperties
|
|
247
|
+
/**
|
|
248
|
+
* Test ID for automated testing.
|
|
249
|
+
*/
|
|
250
|
+
testId?: string
|
|
251
|
+
/**
|
|
252
|
+
* Automation ID for AI agents and E2E tests. Maps to the `data-mol-id`
|
|
253
|
+
* HTML attribute. Use `molId()` from `./automation.js` to generate
|
|
254
|
+
* semantic IDs. (Tooling only — screen readers do not expose `data-*`
|
|
255
|
+
* attributes; accessible names come from labels/`aria-*`.)
|
|
256
|
+
*/
|
|
257
|
+
automationId?: string
|
|
258
|
+
/**
|
|
259
|
+
* Whether the component is disabled.
|
|
260
|
+
*/
|
|
261
|
+
disabled?: boolean
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
#### `ButtonElementProps`
|
|
266
|
+
|
|
267
|
+
Base props for button elements.
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
interface ButtonElementProps extends HTMLElementProps {
|
|
271
|
+
type?: 'button' | 'submit' | 'reset'
|
|
272
|
+
name?: string
|
|
273
|
+
value?: string
|
|
274
|
+
form?: string
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
#### `ButtonProps`
|
|
279
|
+
|
|
280
|
+
Props for the Button component.
|
|
281
|
+
|
|
282
|
+
```typescript
|
|
283
|
+
interface ButtonProps extends ButtonElementProps {
|
|
284
|
+
/**
|
|
285
|
+
* Button content.
|
|
286
|
+
*/
|
|
287
|
+
children?: Children
|
|
288
|
+
/**
|
|
289
|
+
* Visual variant.
|
|
290
|
+
*/
|
|
291
|
+
variant?: ButtonVariant
|
|
292
|
+
/**
|
|
293
|
+
* Color scheme.
|
|
294
|
+
*/
|
|
295
|
+
color?: ColorVariant
|
|
296
|
+
/**
|
|
297
|
+
* Button size.
|
|
298
|
+
*/
|
|
299
|
+
size?: ButtonSize
|
|
300
|
+
/**
|
|
301
|
+
* Whether the button is in a loading state.
|
|
302
|
+
*/
|
|
303
|
+
loading?: boolean
|
|
304
|
+
/**
|
|
305
|
+
* Loading text to display.
|
|
306
|
+
*/
|
|
307
|
+
loadingText?: string
|
|
308
|
+
/**
|
|
309
|
+
* Whether the button takes full width.
|
|
310
|
+
*/
|
|
311
|
+
fullWidth?: boolean
|
|
312
|
+
/**
|
|
313
|
+
* Icon to display before the label.
|
|
314
|
+
*/
|
|
315
|
+
leftIcon?: Children
|
|
316
|
+
/**
|
|
317
|
+
* Icon to display after the label.
|
|
318
|
+
*/
|
|
319
|
+
rightIcon?: Children
|
|
320
|
+
}
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
#### `CardProps`
|
|
324
|
+
|
|
325
|
+
Props for the Card container component (elevated, outlined, or filled surface).
|
|
326
|
+
|
|
327
|
+
```typescript
|
|
328
|
+
interface CardProps extends HTMLElementProps {
|
|
329
|
+
/**
|
|
330
|
+
* Card content.
|
|
331
|
+
*/
|
|
332
|
+
children?: Children
|
|
333
|
+
/**
|
|
334
|
+
* Card variant.
|
|
335
|
+
*/
|
|
336
|
+
variant?: 'elevated' | 'outlined' | 'filled'
|
|
337
|
+
/**
|
|
338
|
+
* Whether the card is interactive (clickable).
|
|
339
|
+
*/
|
|
340
|
+
interactive?: boolean
|
|
341
|
+
/**
|
|
342
|
+
* Padding size.
|
|
343
|
+
*/
|
|
344
|
+
padding?: Size | 'none'
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
#### `CheckboxProps`
|
|
349
|
+
|
|
350
|
+
Props for the Checkbox component.
|
|
351
|
+
|
|
352
|
+
```typescript
|
|
353
|
+
interface CheckboxProps extends InputElementProps {
|
|
354
|
+
/**
|
|
355
|
+
* Checkbox label.
|
|
356
|
+
*/
|
|
357
|
+
label?: Children
|
|
358
|
+
/**
|
|
359
|
+
* Whether the checkbox is checked.
|
|
360
|
+
*/
|
|
361
|
+
checked?: boolean
|
|
362
|
+
/**
|
|
363
|
+
* Whether the checkbox is in an indeterminate state.
|
|
364
|
+
*/
|
|
365
|
+
indeterminate?: boolean
|
|
366
|
+
/**
|
|
367
|
+
* Checkbox size.
|
|
368
|
+
*/
|
|
369
|
+
size?: Size
|
|
370
|
+
/**
|
|
371
|
+
* Error message.
|
|
372
|
+
*/
|
|
373
|
+
error?: string
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
#### `ContainerProps`
|
|
378
|
+
|
|
379
|
+
Props for the Container layout component.
|
|
380
|
+
|
|
381
|
+
```typescript
|
|
382
|
+
interface ContainerProps extends HTMLElementProps {
|
|
383
|
+
/**
|
|
384
|
+
* Container content.
|
|
385
|
+
*/
|
|
386
|
+
children?: Children
|
|
387
|
+
/**
|
|
388
|
+
* Maximum width.
|
|
389
|
+
*/
|
|
390
|
+
maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | string
|
|
391
|
+
/**
|
|
392
|
+
* Whether to center the container.
|
|
393
|
+
*/
|
|
394
|
+
centered?: boolean
|
|
395
|
+
/**
|
|
396
|
+
* Horizontal padding.
|
|
397
|
+
*/
|
|
398
|
+
paddingX?: Size | string
|
|
399
|
+
}
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
#### `CSSProperties`
|
|
403
|
+
|
|
404
|
+
Framework-agnostic CSS properties.
|
|
405
|
+
Mirrors React.CSSProperties but without React dependency.
|
|
406
|
+
|
|
407
|
+
```typescript
|
|
408
|
+
interface CSSProperties {
|
|
409
|
+
[key: string]: string | number | undefined
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
#### `FlexProps`
|
|
414
|
+
|
|
415
|
+
Flex container props.
|
|
416
|
+
|
|
417
|
+
```typescript
|
|
418
|
+
interface FlexProps extends HTMLElementProps {
|
|
419
|
+
/**
|
|
420
|
+
* Flex content.
|
|
421
|
+
*/
|
|
422
|
+
children?: Children
|
|
423
|
+
/**
|
|
424
|
+
* Flex direction.
|
|
425
|
+
*/
|
|
426
|
+
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'
|
|
427
|
+
/**
|
|
428
|
+
* Justify content.
|
|
429
|
+
*/
|
|
430
|
+
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'
|
|
431
|
+
/**
|
|
432
|
+
* Align items.
|
|
433
|
+
*/
|
|
434
|
+
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'
|
|
435
|
+
/**
|
|
436
|
+
* Flex wrap.
|
|
437
|
+
*/
|
|
438
|
+
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse'
|
|
439
|
+
/**
|
|
440
|
+
* Gap between items.
|
|
441
|
+
*/
|
|
442
|
+
gap?: Size | string | number
|
|
443
|
+
}
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
#### `FormElementProps`
|
|
447
|
+
|
|
448
|
+
Base props for form elements.
|
|
449
|
+
|
|
450
|
+
```typescript
|
|
451
|
+
interface FormElementProps extends HTMLElementProps {
|
|
452
|
+
action?: string
|
|
453
|
+
method?: 'get' | 'post'
|
|
454
|
+
encType?: string
|
|
455
|
+
target?: string
|
|
456
|
+
noValidate?: boolean
|
|
457
|
+
autoComplete?: 'on' | 'off'
|
|
458
|
+
onSubmit?: FormEventHandler
|
|
459
|
+
onReset?: FormEventHandler
|
|
460
|
+
}
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
#### `FormFieldProps`
|
|
464
|
+
|
|
465
|
+
Form field wrapper props.
|
|
466
|
+
|
|
467
|
+
```typescript
|
|
468
|
+
interface FormFieldProps extends HTMLElementProps {
|
|
469
|
+
/**
|
|
470
|
+
* Field content.
|
|
471
|
+
*/
|
|
472
|
+
children?: Children
|
|
473
|
+
/**
|
|
474
|
+
* Field label.
|
|
475
|
+
*/
|
|
476
|
+
label?: string
|
|
477
|
+
/**
|
|
478
|
+
* Field name.
|
|
479
|
+
*/
|
|
480
|
+
name?: string
|
|
481
|
+
/**
|
|
482
|
+
* Error message.
|
|
483
|
+
*/
|
|
484
|
+
error?: string
|
|
485
|
+
/**
|
|
486
|
+
* Hint/help text.
|
|
487
|
+
*/
|
|
488
|
+
hint?: string
|
|
489
|
+
/**
|
|
490
|
+
* Whether the field is required.
|
|
491
|
+
*/
|
|
492
|
+
required?: boolean
|
|
493
|
+
}
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
#### `FormProps`
|
|
497
|
+
|
|
498
|
+
Props for the Form component (wraps inputs with submission handling and validation).
|
|
499
|
+
|
|
500
|
+
```typescript
|
|
501
|
+
interface FormProps extends FormElementProps {
|
|
502
|
+
/**
|
|
503
|
+
* Form content.
|
|
504
|
+
*/
|
|
505
|
+
children?: Children
|
|
506
|
+
/**
|
|
507
|
+
* Submit handler with form data.
|
|
508
|
+
*/
|
|
509
|
+
onFormSubmit?: (data: Record<string, unknown>) => void | Promise<void>
|
|
510
|
+
/**
|
|
511
|
+
* Whether the form is submitting.
|
|
512
|
+
*/
|
|
513
|
+
submitting?: boolean
|
|
514
|
+
}
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
#### `GridProps`
|
|
518
|
+
|
|
519
|
+
Grid container props.
|
|
520
|
+
|
|
521
|
+
```typescript
|
|
522
|
+
interface GridProps extends HTMLElementProps {
|
|
523
|
+
/**
|
|
524
|
+
* Grid content.
|
|
525
|
+
*/
|
|
526
|
+
children?: Children
|
|
527
|
+
/**
|
|
528
|
+
* Number of columns.
|
|
529
|
+
*/
|
|
530
|
+
columns?: number | string
|
|
531
|
+
/**
|
|
532
|
+
* Number of rows.
|
|
533
|
+
*/
|
|
534
|
+
rows?: number | string
|
|
535
|
+
/**
|
|
536
|
+
* Gap between items.
|
|
537
|
+
*/
|
|
538
|
+
gap?: Size | string | number
|
|
539
|
+
/**
|
|
540
|
+
* Column gap.
|
|
541
|
+
*/
|
|
542
|
+
columnGap?: Size | string | number
|
|
543
|
+
/**
|
|
544
|
+
* Row gap.
|
|
545
|
+
*/
|
|
546
|
+
rowGap?: Size | string | number
|
|
547
|
+
}
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
#### `HTMLElementProps`
|
|
551
|
+
|
|
552
|
+
Base props for HTML elements.
|
|
553
|
+
Framework bindings should extend this with framework-specific attributes.
|
|
554
|
+
|
|
555
|
+
```typescript
|
|
556
|
+
interface HTMLElementProps extends BaseProps {
|
|
557
|
+
id?: string
|
|
558
|
+
title?: string
|
|
559
|
+
tabIndex?: number
|
|
560
|
+
role?: string
|
|
561
|
+
'aria-label'?: string
|
|
562
|
+
'aria-labelledby'?: string
|
|
563
|
+
'aria-describedby'?: string
|
|
564
|
+
'aria-hidden'?: boolean
|
|
565
|
+
'aria-disabled'?: boolean
|
|
566
|
+
'aria-expanded'?: boolean
|
|
567
|
+
'aria-selected'?: boolean
|
|
568
|
+
'aria-checked'?: boolean | 'mixed'
|
|
569
|
+
'aria-pressed'?: boolean | 'mixed'
|
|
570
|
+
'aria-invalid'?: boolean
|
|
571
|
+
'aria-required'?: boolean
|
|
572
|
+
'aria-readonly'?: boolean
|
|
573
|
+
'aria-busy'?: boolean
|
|
574
|
+
'aria-live'?: 'off' | 'polite' | 'assertive'
|
|
575
|
+
onClick?: MouseEventHandler
|
|
576
|
+
onDoubleClick?: MouseEventHandler
|
|
577
|
+
onMouseEnter?: MouseEventHandler
|
|
578
|
+
onMouseLeave?: MouseEventHandler
|
|
579
|
+
onFocus?: FocusEventHandler
|
|
580
|
+
onBlur?: FocusEventHandler
|
|
581
|
+
onKeyDown?: KeyboardEventHandler
|
|
582
|
+
onKeyUp?: KeyboardEventHandler
|
|
583
|
+
onKeyPress?: KeyboardEventHandler
|
|
584
|
+
}
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
#### `InputElementProps`
|
|
588
|
+
|
|
589
|
+
Base props for input elements.
|
|
590
|
+
|
|
591
|
+
```typescript
|
|
592
|
+
interface InputElementProps extends HTMLElementProps {
|
|
593
|
+
name?: string
|
|
594
|
+
value?: string | number | readonly string[]
|
|
595
|
+
defaultValue?: string | number | readonly string[]
|
|
596
|
+
placeholder?: string
|
|
597
|
+
required?: boolean
|
|
598
|
+
readOnly?: boolean
|
|
599
|
+
autoFocus?: boolean
|
|
600
|
+
autoComplete?: string
|
|
601
|
+
maxLength?: number
|
|
602
|
+
minLength?: number
|
|
603
|
+
pattern?: string
|
|
604
|
+
onChange?: ChangeEventHandler
|
|
605
|
+
onInput?: FormEventHandler
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
#### `InputProps`
|
|
610
|
+
|
|
611
|
+
Props for the Input component (text field, email, password, etc.).
|
|
612
|
+
|
|
613
|
+
```typescript
|
|
614
|
+
interface InputProps extends InputElementProps {
|
|
615
|
+
/**
|
|
616
|
+
* Input type.
|
|
617
|
+
*/
|
|
618
|
+
type?: InputType
|
|
619
|
+
/**
|
|
620
|
+
* Input size.
|
|
621
|
+
*/
|
|
622
|
+
size?: Size
|
|
623
|
+
/**
|
|
624
|
+
* Horizontal text alignment inside the input (see
|
|
625
|
+
* {@link InputClassOptions.align}). Defaults to the bond's own style.
|
|
626
|
+
*/
|
|
627
|
+
align?: 'left' | 'center'
|
|
628
|
+
/**
|
|
629
|
+
* Label text.
|
|
630
|
+
*/
|
|
631
|
+
label?: string
|
|
632
|
+
/**
|
|
633
|
+
* Error message.
|
|
634
|
+
*/
|
|
635
|
+
error?: string
|
|
636
|
+
/**
|
|
637
|
+
* Hint/help text.
|
|
638
|
+
*/
|
|
639
|
+
hint?: string
|
|
640
|
+
/**
|
|
641
|
+
* Element to display on the left.
|
|
642
|
+
*/
|
|
643
|
+
leftElement?: Children
|
|
644
|
+
/**
|
|
645
|
+
* Element to display on the right.
|
|
646
|
+
*/
|
|
647
|
+
rightElement?: Children
|
|
648
|
+
/**
|
|
649
|
+
* Whether to show a clear button.
|
|
650
|
+
*/
|
|
651
|
+
clearable?: boolean
|
|
652
|
+
/**
|
|
653
|
+
* Called when the clear button is clicked.
|
|
654
|
+
*/
|
|
655
|
+
onClear?: () => void
|
|
656
|
+
/**
|
|
657
|
+
* Accessible label for the clear button.
|
|
658
|
+
* @default 'Clear'
|
|
659
|
+
*/
|
|
660
|
+
clearLabel?: string
|
|
661
|
+
}
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
#### `ModalProps`
|
|
665
|
+
|
|
666
|
+
Props for the Modal/Dialog component.
|
|
667
|
+
|
|
668
|
+
```typescript
|
|
669
|
+
interface ModalProps extends HTMLElementProps {
|
|
670
|
+
/**
|
|
671
|
+
* Whether the modal is open.
|
|
672
|
+
*/
|
|
673
|
+
open: boolean
|
|
674
|
+
/**
|
|
675
|
+
* Called when the modal should close.
|
|
676
|
+
*/
|
|
677
|
+
onClose: () => void
|
|
678
|
+
/**
|
|
679
|
+
* Modal title.
|
|
680
|
+
*/
|
|
681
|
+
title?: string
|
|
682
|
+
/**
|
|
683
|
+
* Modal content.
|
|
684
|
+
*/
|
|
685
|
+
children?: Children
|
|
686
|
+
/**
|
|
687
|
+
* Modal size.
|
|
688
|
+
*/
|
|
689
|
+
size?: ModalSize
|
|
690
|
+
/**
|
|
691
|
+
* Whether to show a close button.
|
|
692
|
+
*/
|
|
693
|
+
showCloseButton?: boolean
|
|
694
|
+
/**
|
|
695
|
+
* Whether clicking the overlay closes the modal.
|
|
696
|
+
*/
|
|
697
|
+
closeOnOverlayClick?: boolean
|
|
698
|
+
/**
|
|
699
|
+
* Whether pressing Escape closes the modal.
|
|
700
|
+
*/
|
|
701
|
+
closeOnEscape?: boolean
|
|
702
|
+
/**
|
|
703
|
+
* Footer content (typically action buttons).
|
|
704
|
+
*/
|
|
705
|
+
footer?: Children
|
|
706
|
+
/**
|
|
707
|
+
* Whether the modal is centered vertically.
|
|
708
|
+
*/
|
|
709
|
+
centered?: boolean
|
|
710
|
+
/**
|
|
711
|
+
* Whether to prevent body scroll when open.
|
|
712
|
+
*/
|
|
713
|
+
preventScroll?: boolean
|
|
714
|
+
/**
|
|
715
|
+
* Accessible label for the close button.
|
|
716
|
+
* @default 'Close'
|
|
717
|
+
*/
|
|
718
|
+
closeLabel?: string
|
|
719
|
+
}
|
|
720
|
+
```
|
|
721
|
+
|
|
722
|
+
#### `PaginationProps`
|
|
723
|
+
|
|
724
|
+
Props for the Pagination component (page navigation with current page, total, page size, and change callbacks).
|
|
725
|
+
|
|
726
|
+
```typescript
|
|
727
|
+
interface PaginationProps extends BaseProps {
|
|
728
|
+
/**
|
|
729
|
+
* Current page (1-indexed).
|
|
730
|
+
*/
|
|
731
|
+
page: number
|
|
732
|
+
/**
|
|
733
|
+
* Total number of pages.
|
|
734
|
+
*/
|
|
735
|
+
totalPages: number
|
|
736
|
+
/**
|
|
737
|
+
* Page change handler.
|
|
738
|
+
*/
|
|
739
|
+
onChange: (page: number) => void
|
|
740
|
+
/**
|
|
741
|
+
* Number of sibling pages to show.
|
|
742
|
+
*/
|
|
743
|
+
siblings?: number
|
|
744
|
+
/**
|
|
745
|
+
* Number of boundary pages to show.
|
|
746
|
+
*/
|
|
747
|
+
boundaries?: number
|
|
748
|
+
/**
|
|
749
|
+
* Pagination size.
|
|
750
|
+
*/
|
|
751
|
+
size?: Size
|
|
752
|
+
/**
|
|
753
|
+
* Whether to show first/last buttons.
|
|
754
|
+
*/
|
|
755
|
+
showFirstLast?: boolean
|
|
756
|
+
/**
|
|
757
|
+
* Whether to show previous/next buttons.
|
|
758
|
+
*/
|
|
759
|
+
showPrevNext?: boolean
|
|
760
|
+
/**
|
|
761
|
+
* Accessible labels for pagination controls.
|
|
762
|
+
*/
|
|
763
|
+
labels?: {
|
|
764
|
+
nav?: string
|
|
765
|
+
first?: string
|
|
766
|
+
previous?: string
|
|
767
|
+
next?: string
|
|
768
|
+
last?: string
|
|
769
|
+
goToPage?: (page: number) => string
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
#### `RadioGroupProps`
|
|
775
|
+
|
|
776
|
+
Props for the RadioGroup component.
|
|
777
|
+
|
|
778
|
+
```typescript
|
|
779
|
+
interface RadioGroupProps<T = string> extends BaseProps {
|
|
780
|
+
/**
|
|
781
|
+
* Radio options.
|
|
782
|
+
*/
|
|
783
|
+
options: RadioOption<T>[]
|
|
784
|
+
/**
|
|
785
|
+
* Current value.
|
|
786
|
+
*/
|
|
787
|
+
value?: T
|
|
788
|
+
/**
|
|
789
|
+
* Change handler.
|
|
790
|
+
*/
|
|
791
|
+
onChange?: (value: T) => void
|
|
792
|
+
/**
|
|
793
|
+
* Radio size.
|
|
794
|
+
*/
|
|
795
|
+
size?: Size
|
|
796
|
+
/**
|
|
797
|
+
* Group label.
|
|
798
|
+
*/
|
|
799
|
+
label?: string
|
|
800
|
+
/**
|
|
801
|
+
* Shared `name` attribute for the group's radio inputs (used for native
|
|
802
|
+
* form submission). When omitted, a unique per-instance name is generated
|
|
803
|
+
* so separate groups never merge — the visible `label` is deliberately
|
|
804
|
+
* NOT used as the name, because two groups with the same label (e.g. two
|
|
805
|
+
* "Size" pickers) would otherwise form ONE native radio group and
|
|
806
|
+
* deselect each other.
|
|
807
|
+
*/
|
|
808
|
+
name?: string
|
|
809
|
+
/**
|
|
810
|
+
* Layout direction.
|
|
811
|
+
*/
|
|
812
|
+
direction?: 'horizontal' | 'vertical'
|
|
813
|
+
/**
|
|
814
|
+
* Error message.
|
|
815
|
+
*/
|
|
816
|
+
error?: string
|
|
817
|
+
}
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
#### `RadioOption`
|
|
821
|
+
|
|
822
|
+
A single option in a RadioGroup.
|
|
823
|
+
|
|
824
|
+
```typescript
|
|
825
|
+
interface RadioOption<T = string> {
|
|
826
|
+
/**
|
|
827
|
+
* Option value.
|
|
828
|
+
*/
|
|
829
|
+
value: T
|
|
830
|
+
/**
|
|
831
|
+
* Display label.
|
|
832
|
+
*/
|
|
833
|
+
label: Children
|
|
834
|
+
/**
|
|
835
|
+
* Whether the option is disabled.
|
|
836
|
+
*/
|
|
837
|
+
disabled?: boolean
|
|
838
|
+
}
|
|
839
|
+
```
|
|
840
|
+
|
|
841
|
+
#### `SelectElementProps`
|
|
842
|
+
|
|
843
|
+
Base props for select elements.
|
|
844
|
+
|
|
845
|
+
```typescript
|
|
846
|
+
interface SelectElementProps extends HTMLElementProps {
|
|
847
|
+
name?: string
|
|
848
|
+
required?: boolean
|
|
849
|
+
autoFocus?: boolean
|
|
850
|
+
multiple?: boolean
|
|
851
|
+
onChange?: ChangeEventHandler
|
|
852
|
+
}
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
#### `SelectOption`
|
|
856
|
+
|
|
857
|
+
A single option in a Select dropdown.
|
|
858
|
+
|
|
859
|
+
```typescript
|
|
860
|
+
interface SelectOption<T = string> {
|
|
861
|
+
/**
|
|
862
|
+
* Option value.
|
|
863
|
+
*/
|
|
864
|
+
value: T
|
|
865
|
+
/**
|
|
866
|
+
* Display label.
|
|
867
|
+
*/
|
|
868
|
+
label: string
|
|
869
|
+
/**
|
|
870
|
+
* Whether the option is disabled.
|
|
871
|
+
*/
|
|
872
|
+
disabled?: boolean
|
|
873
|
+
/**
|
|
874
|
+
* Option group (for grouped selects).
|
|
875
|
+
*/
|
|
876
|
+
group?: string
|
|
877
|
+
}
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
#### `SelectProps`
|
|
881
|
+
|
|
882
|
+
Props for the Select dropdown component (single or multi-select).
|
|
883
|
+
|
|
884
|
+
```typescript
|
|
885
|
+
interface SelectProps<T = string> extends SelectElementProps {
|
|
886
|
+
/**
|
|
887
|
+
* Select options.
|
|
888
|
+
*/
|
|
889
|
+
options: SelectOption<T>[]
|
|
890
|
+
/**
|
|
891
|
+
* Current value.
|
|
892
|
+
*/
|
|
893
|
+
value?: T
|
|
894
|
+
/**
|
|
895
|
+
* Change handler (with typed value).
|
|
896
|
+
*/
|
|
897
|
+
onValueChange?: (value: T) => void
|
|
898
|
+
/**
|
|
899
|
+
* Select size.
|
|
900
|
+
*/
|
|
901
|
+
size?: Size
|
|
902
|
+
/**
|
|
903
|
+
* Label text.
|
|
904
|
+
*/
|
|
905
|
+
label?: string
|
|
906
|
+
/**
|
|
907
|
+
* Placeholder text.
|
|
908
|
+
*/
|
|
909
|
+
placeholder?: string
|
|
910
|
+
/**
|
|
911
|
+
* Error message.
|
|
912
|
+
*/
|
|
913
|
+
error?: string
|
|
914
|
+
/**
|
|
915
|
+
* Hint/help text.
|
|
916
|
+
*/
|
|
917
|
+
hint?: string
|
|
918
|
+
/**
|
|
919
|
+
* Whether to allow clearing the selection.
|
|
920
|
+
*/
|
|
921
|
+
clearable?: boolean
|
|
922
|
+
}
|
|
923
|
+
```
|
|
924
|
+
|
|
925
|
+
#### `SkeletonProps`
|
|
926
|
+
|
|
927
|
+
Props for the Skeleton loading placeholder component.
|
|
928
|
+
|
|
929
|
+
```typescript
|
|
930
|
+
interface SkeletonProps extends BaseProps {
|
|
931
|
+
/**
|
|
932
|
+
* Skeleton width.
|
|
933
|
+
*/
|
|
934
|
+
width?: string | number
|
|
935
|
+
/**
|
|
936
|
+
* Skeleton height.
|
|
937
|
+
*/
|
|
938
|
+
height?: string | number
|
|
939
|
+
/**
|
|
940
|
+
* Whether the skeleton is circular.
|
|
941
|
+
*/
|
|
942
|
+
circle?: boolean
|
|
943
|
+
/**
|
|
944
|
+
* Border radius.
|
|
945
|
+
*/
|
|
946
|
+
borderRadius?: string | number
|
|
947
|
+
/**
|
|
948
|
+
* Animation type.
|
|
949
|
+
*/
|
|
950
|
+
animation?: 'pulse' | 'wave' | 'none'
|
|
951
|
+
}
|
|
952
|
+
```
|
|
953
|
+
|
|
954
|
+
#### `SpacerProps`
|
|
955
|
+
|
|
956
|
+
Props for the Spacer layout component (adds whitespace between elements).
|
|
957
|
+
|
|
958
|
+
```typescript
|
|
959
|
+
interface SpacerProps extends BaseProps {
|
|
960
|
+
/**
|
|
961
|
+
* Space size.
|
|
962
|
+
*/
|
|
963
|
+
size?: Size | string | number
|
|
964
|
+
/**
|
|
965
|
+
* Whether the spacer is horizontal.
|
|
966
|
+
*/
|
|
967
|
+
horizontal?: boolean
|
|
968
|
+
}
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
#### `SpinnerProps`
|
|
972
|
+
|
|
973
|
+
Props for the Spinner/loading indicator component.
|
|
974
|
+
|
|
975
|
+
```typescript
|
|
976
|
+
interface SpinnerProps extends BaseProps {
|
|
977
|
+
/**
|
|
978
|
+
* Spinner size.
|
|
979
|
+
*/
|
|
980
|
+
size?: Size
|
|
981
|
+
/**
|
|
982
|
+
* Spinner color.
|
|
983
|
+
*/
|
|
984
|
+
color?: ColorVariant | string
|
|
985
|
+
/**
|
|
986
|
+
* Loading label (for accessibility).
|
|
987
|
+
*/
|
|
988
|
+
label?: string
|
|
989
|
+
/**
|
|
990
|
+
* Spinner thickness.
|
|
991
|
+
*/
|
|
992
|
+
thickness?: number
|
|
993
|
+
}
|
|
994
|
+
```
|
|
995
|
+
|
|
996
|
+
#### `SwitchProps`
|
|
997
|
+
|
|
998
|
+
Props for the Switch/Toggle component.
|
|
999
|
+
|
|
1000
|
+
```typescript
|
|
1001
|
+
interface SwitchProps extends InputElementProps {
|
|
1002
|
+
/**
|
|
1003
|
+
* Switch label.
|
|
1004
|
+
*/
|
|
1005
|
+
label?: Children
|
|
1006
|
+
/**
|
|
1007
|
+
* Whether the switch is on.
|
|
1008
|
+
*/
|
|
1009
|
+
checked?: boolean
|
|
1010
|
+
/**
|
|
1011
|
+
* Switch size.
|
|
1012
|
+
*/
|
|
1013
|
+
size?: Size
|
|
1014
|
+
/**
|
|
1015
|
+
* Color when on.
|
|
1016
|
+
*/
|
|
1017
|
+
color?: ColorVariant
|
|
1018
|
+
}
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
#### `TabItem`
|
|
1022
|
+
|
|
1023
|
+
A single tab in a Tabs component.
|
|
1024
|
+
|
|
1025
|
+
```typescript
|
|
1026
|
+
interface TabItem<T = string> {
|
|
1027
|
+
/**
|
|
1028
|
+
* Tab value/id.
|
|
1029
|
+
*/
|
|
1030
|
+
value: T
|
|
1031
|
+
/**
|
|
1032
|
+
* Tab label.
|
|
1033
|
+
*/
|
|
1034
|
+
label: Children
|
|
1035
|
+
/**
|
|
1036
|
+
* Tab content.
|
|
1037
|
+
*/
|
|
1038
|
+
content?: Children
|
|
1039
|
+
/**
|
|
1040
|
+
* Whether the tab is disabled.
|
|
1041
|
+
*/
|
|
1042
|
+
disabled?: boolean
|
|
1043
|
+
/**
|
|
1044
|
+
* Icon to display.
|
|
1045
|
+
*/
|
|
1046
|
+
icon?: Children
|
|
1047
|
+
}
|
|
1048
|
+
```
|
|
1049
|
+
|
|
1050
|
+
#### `TableColumn`
|
|
1051
|
+
|
|
1052
|
+
Table column definition.
|
|
1053
|
+
|
|
1054
|
+
```typescript
|
|
1055
|
+
interface TableColumn<T> {
|
|
1056
|
+
/**
|
|
1057
|
+
* Column key (data property).
|
|
1058
|
+
*/
|
|
1059
|
+
key: keyof T | string
|
|
1060
|
+
/**
|
|
1061
|
+
* Column header.
|
|
1062
|
+
*/
|
|
1063
|
+
header: Children
|
|
1064
|
+
/**
|
|
1065
|
+
* Custom cell renderer.
|
|
1066
|
+
*/
|
|
1067
|
+
render?: (value: unknown, row: T, index: number) => Children
|
|
1068
|
+
/**
|
|
1069
|
+
* Column width.
|
|
1070
|
+
*/
|
|
1071
|
+
width?: string | number
|
|
1072
|
+
/**
|
|
1073
|
+
* Whether the column is sortable.
|
|
1074
|
+
*/
|
|
1075
|
+
sortable?: boolean
|
|
1076
|
+
/**
|
|
1077
|
+
* Text alignment.
|
|
1078
|
+
*/
|
|
1079
|
+
align?: 'left' | 'center' | 'right'
|
|
1080
|
+
}
|
|
1081
|
+
```
|
|
1082
|
+
|
|
1083
|
+
#### `TableProps`
|
|
1084
|
+
|
|
1085
|
+
Props for the Table component.
|
|
1086
|
+
|
|
1087
|
+
```typescript
|
|
1088
|
+
interface TableProps<T> extends HTMLElementProps {
|
|
1089
|
+
/**
|
|
1090
|
+
* Table data.
|
|
1091
|
+
*/
|
|
1092
|
+
data: T[]
|
|
1093
|
+
/**
|
|
1094
|
+
* Column definitions.
|
|
1095
|
+
*/
|
|
1096
|
+
columns: TableColumn<T>[]
|
|
1097
|
+
/**
|
|
1098
|
+
* Row key extractor.
|
|
1099
|
+
*/
|
|
1100
|
+
rowKey?: keyof T | ((row: T) => string | number)
|
|
1101
|
+
/**
|
|
1102
|
+
* Whether to show borders.
|
|
1103
|
+
*/
|
|
1104
|
+
bordered?: boolean
|
|
1105
|
+
/**
|
|
1106
|
+
* Whether rows are striped.
|
|
1107
|
+
*/
|
|
1108
|
+
striped?: boolean
|
|
1109
|
+
/**
|
|
1110
|
+
* Whether rows are hoverable.
|
|
1111
|
+
*/
|
|
1112
|
+
hoverable?: boolean
|
|
1113
|
+
/**
|
|
1114
|
+
* Table size.
|
|
1115
|
+
*/
|
|
1116
|
+
size?: Size
|
|
1117
|
+
/**
|
|
1118
|
+
* Empty state content.
|
|
1119
|
+
*/
|
|
1120
|
+
emptyContent?: Children
|
|
1121
|
+
/**
|
|
1122
|
+
* Loading state.
|
|
1123
|
+
*/
|
|
1124
|
+
loading?: boolean
|
|
1125
|
+
/**
|
|
1126
|
+
* Sort configuration.
|
|
1127
|
+
*/
|
|
1128
|
+
sort?: {
|
|
1129
|
+
key: string
|
|
1130
|
+
direction: 'asc' | 'desc'
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* Sort change handler.
|
|
1134
|
+
*/
|
|
1135
|
+
onSort?: (key: string, direction: 'asc' | 'desc') => void
|
|
1136
|
+
/**
|
|
1137
|
+
* Row click handler.
|
|
1138
|
+
*/
|
|
1139
|
+
onRowClick?: (row: T, index: number) => void
|
|
1140
|
+
}
|
|
1141
|
+
```
|
|
1142
|
+
|
|
1143
|
+
#### `TabsProps`
|
|
1144
|
+
|
|
1145
|
+
Props for the Tabs component (switchable tabbed content panels).
|
|
1146
|
+
|
|
1147
|
+
```typescript
|
|
1148
|
+
interface TabsProps<T = string> extends BaseProps {
|
|
1149
|
+
/**
|
|
1150
|
+
* Tab items.
|
|
1151
|
+
*/
|
|
1152
|
+
items: TabItem<T>[]
|
|
1153
|
+
/**
|
|
1154
|
+
* Current active tab.
|
|
1155
|
+
*/
|
|
1156
|
+
value?: T
|
|
1157
|
+
/**
|
|
1158
|
+
* Default active tab.
|
|
1159
|
+
*/
|
|
1160
|
+
defaultValue?: T
|
|
1161
|
+
/**
|
|
1162
|
+
* Change handler.
|
|
1163
|
+
*/
|
|
1164
|
+
onChange?: (value: T) => void
|
|
1165
|
+
/**
|
|
1166
|
+
* Tab variant.
|
|
1167
|
+
*/
|
|
1168
|
+
variant?: 'line' | 'enclosed' | 'soft-rounded' | 'solid-rounded'
|
|
1169
|
+
/**
|
|
1170
|
+
* Tab size.
|
|
1171
|
+
*/
|
|
1172
|
+
size?: Size
|
|
1173
|
+
/**
|
|
1174
|
+
* Whether tabs are fitted (take full width).
|
|
1175
|
+
*/
|
|
1176
|
+
fitted?: boolean
|
|
1177
|
+
}
|
|
1178
|
+
```
|
|
1179
|
+
|
|
1180
|
+
#### `TextareaElementProps`
|
|
1181
|
+
|
|
1182
|
+
Base props for textarea elements.
|
|
1183
|
+
|
|
1184
|
+
```typescript
|
|
1185
|
+
interface TextareaElementProps extends HTMLElementProps {
|
|
1186
|
+
name?: string
|
|
1187
|
+
value?: string
|
|
1188
|
+
defaultValue?: string
|
|
1189
|
+
placeholder?: string
|
|
1190
|
+
required?: boolean
|
|
1191
|
+
readOnly?: boolean
|
|
1192
|
+
autoFocus?: boolean
|
|
1193
|
+
rows?: number
|
|
1194
|
+
cols?: number
|
|
1195
|
+
maxLength?: number
|
|
1196
|
+
minLength?: number
|
|
1197
|
+
wrap?: 'hard' | 'soft' | 'off'
|
|
1198
|
+
onChange?: ChangeEventHandler
|
|
1199
|
+
onInput?: FormEventHandler
|
|
1200
|
+
}
|
|
1201
|
+
```
|
|
1202
|
+
|
|
1203
|
+
#### `TextareaProps`
|
|
1204
|
+
|
|
1205
|
+
Props for the Textarea component.
|
|
1206
|
+
|
|
1207
|
+
```typescript
|
|
1208
|
+
interface TextareaProps extends TextareaElementProps {
|
|
1209
|
+
/**
|
|
1210
|
+
* Text size tier (see {@link TextareaClassOptions.size}) — pass the same
|
|
1211
|
+
* `size` as a neighboring Input for identical font sizes.
|
|
1212
|
+
*/
|
|
1213
|
+
size?: Size
|
|
1214
|
+
/**
|
|
1215
|
+
* Label text.
|
|
1216
|
+
*/
|
|
1217
|
+
label?: string
|
|
1218
|
+
/**
|
|
1219
|
+
* Error message.
|
|
1220
|
+
*/
|
|
1221
|
+
error?: string
|
|
1222
|
+
/**
|
|
1223
|
+
* Hint/help text.
|
|
1224
|
+
*/
|
|
1225
|
+
hint?: string
|
|
1226
|
+
/**
|
|
1227
|
+
* Whether the textarea auto-resizes.
|
|
1228
|
+
*/
|
|
1229
|
+
autoResize?: boolean
|
|
1230
|
+
/**
|
|
1231
|
+
* Minimum number of rows.
|
|
1232
|
+
*/
|
|
1233
|
+
minRows?: number
|
|
1234
|
+
/**
|
|
1235
|
+
* Maximum number of rows.
|
|
1236
|
+
*/
|
|
1237
|
+
maxRows?: number
|
|
1238
|
+
}
|
|
1239
|
+
```
|
|
1240
|
+
|
|
1241
|
+
#### `ToastProps`
|
|
1242
|
+
|
|
1243
|
+
Props for the Toast/notification component.
|
|
1244
|
+
|
|
1245
|
+
```typescript
|
|
1246
|
+
interface ToastProps extends HTMLElementProps {
|
|
1247
|
+
/**
|
|
1248
|
+
* Toast content.
|
|
1249
|
+
*/
|
|
1250
|
+
children?: Children
|
|
1251
|
+
/**
|
|
1252
|
+
* Toast title.
|
|
1253
|
+
*/
|
|
1254
|
+
title?: string
|
|
1255
|
+
/**
|
|
1256
|
+
* Toast description.
|
|
1257
|
+
*/
|
|
1258
|
+
description?: string
|
|
1259
|
+
/**
|
|
1260
|
+
* Toast status/type.
|
|
1261
|
+
*/
|
|
1262
|
+
status?: ColorVariant
|
|
1263
|
+
/**
|
|
1264
|
+
* Duration in milliseconds (0 for persistent).
|
|
1265
|
+
*/
|
|
1266
|
+
duration?: number
|
|
1267
|
+
/**
|
|
1268
|
+
* Whether the toast is dismissible.
|
|
1269
|
+
*/
|
|
1270
|
+
dismissible?: boolean
|
|
1271
|
+
/**
|
|
1272
|
+
* Called when dismissed.
|
|
1273
|
+
*/
|
|
1274
|
+
onDismiss?: () => void
|
|
1275
|
+
/**
|
|
1276
|
+
* Toast position.
|
|
1277
|
+
*/
|
|
1278
|
+
position?: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
|
|
1279
|
+
/**
|
|
1280
|
+
* Accessible label for the close button.
|
|
1281
|
+
* @default 'Close'
|
|
1282
|
+
*/
|
|
1283
|
+
closeLabel?: string
|
|
1284
|
+
}
|
|
1285
|
+
```
|
|
1286
|
+
|
|
1287
|
+
#### `TooltipProps`
|
|
1288
|
+
|
|
1289
|
+
Props for the Tooltip component (hover/focus popover with informational text).
|
|
1290
|
+
|
|
1291
|
+
```typescript
|
|
1292
|
+
interface TooltipProps extends HTMLElementProps {
|
|
1293
|
+
/**
|
|
1294
|
+
* Tooltip content.
|
|
1295
|
+
*/
|
|
1296
|
+
content: Children
|
|
1297
|
+
/**
|
|
1298
|
+
* Element that triggers the tooltip.
|
|
1299
|
+
*/
|
|
1300
|
+
children: Children
|
|
1301
|
+
/**
|
|
1302
|
+
* Tooltip placement.
|
|
1303
|
+
*/
|
|
1304
|
+
placement?: TooltipPlacement
|
|
1305
|
+
/**
|
|
1306
|
+
* Delay before showing (ms).
|
|
1307
|
+
*/
|
|
1308
|
+
delay?: number
|
|
1309
|
+
/**
|
|
1310
|
+
* Whether the tooltip has an arrow.
|
|
1311
|
+
*/
|
|
1312
|
+
hasArrow?: boolean
|
|
1313
|
+
}
|
|
1314
|
+
```
|
|
1315
|
+
|
|
1316
|
+
### Types
|
|
1317
|
+
|
|
1318
|
+
#### `ButtonVariant`
|
|
1319
|
+
|
|
1320
|
+
Button visual variant styles.
|
|
1321
|
+
|
|
1322
|
+
```typescript
|
|
1323
|
+
type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link'
|
|
1324
|
+
```
|
|
1325
|
+
|
|
1326
|
+
#### `ChangeEventHandler`
|
|
1327
|
+
|
|
1328
|
+
Framework-agnostic change event handler.
|
|
1329
|
+
|
|
1330
|
+
```typescript
|
|
1331
|
+
type ChangeEventHandler = EventHandler<Event>
|
|
1332
|
+
```
|
|
1333
|
+
|
|
1334
|
+
#### `Children`
|
|
1335
|
+
|
|
1336
|
+
Framework-agnostic child content.
|
|
1337
|
+
Use `unknown` to allow any framework's node type (ReactNode, VNode, etc.).
|
|
1338
|
+
|
|
1339
|
+
```typescript
|
|
1340
|
+
type Children = unknown
|
|
1341
|
+
```
|
|
1342
|
+
|
|
1343
|
+
#### `ColorVariant`
|
|
1344
|
+
|
|
1345
|
+
Semantic color variants used across components for status indication.
|
|
1346
|
+
|
|
1347
|
+
```typescript
|
|
1348
|
+
type ColorVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info'
|
|
1349
|
+
```
|
|
1350
|
+
|
|
1351
|
+
#### `EventHandler`
|
|
1352
|
+
|
|
1353
|
+
Framework-agnostic event handler.
|
|
1354
|
+
|
|
1355
|
+
```typescript
|
|
1356
|
+
type EventHandler<E = Event> = (event: E) => void
|
|
1357
|
+
```
|
|
1358
|
+
|
|
1359
|
+
#### `FocusEventHandler`
|
|
1360
|
+
|
|
1361
|
+
Framework-agnostic focus event handler.
|
|
1362
|
+
|
|
1363
|
+
```typescript
|
|
1364
|
+
type FocusEventHandler = EventHandler<FocusEvent>
|
|
1365
|
+
```
|
|
1366
|
+
|
|
1367
|
+
#### `FormEventHandler`
|
|
1368
|
+
|
|
1369
|
+
Framework-agnostic form event handler.
|
|
1370
|
+
|
|
1371
|
+
```typescript
|
|
1372
|
+
type FormEventHandler = EventHandler<Event>
|
|
1373
|
+
```
|
|
1374
|
+
|
|
1375
|
+
#### `InputType`
|
|
1376
|
+
|
|
1377
|
+
Allowed HTML input type attribute values for the Input component.
|
|
1378
|
+
|
|
1379
|
+
```typescript
|
|
1380
|
+
type InputType =
|
|
1381
|
+
| 'text'
|
|
1382
|
+
| 'email'
|
|
1383
|
+
| 'password'
|
|
1384
|
+
| 'number'
|
|
1385
|
+
| 'tel'
|
|
1386
|
+
| 'url'
|
|
1387
|
+
| 'search'
|
|
1388
|
+
| 'date'
|
|
1389
|
+
| 'time'
|
|
1390
|
+
| 'datetime-local'
|
|
1391
|
+
```
|
|
1392
|
+
|
|
1393
|
+
#### `KeyboardEventHandler`
|
|
1394
|
+
|
|
1395
|
+
Framework-agnostic keyboard event handler.
|
|
1396
|
+
|
|
1397
|
+
```typescript
|
|
1398
|
+
type KeyboardEventHandler = EventHandler<KeyboardEvent>
|
|
1399
|
+
```
|
|
1400
|
+
|
|
1401
|
+
#### `ModalSize`
|
|
1402
|
+
|
|
1403
|
+
Modal size variants including full-screen.
|
|
1404
|
+
|
|
1405
|
+
```typescript
|
|
1406
|
+
type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'
|
|
1407
|
+
```
|
|
1408
|
+
|
|
1409
|
+
#### `MouseEventHandler`
|
|
1410
|
+
|
|
1411
|
+
Framework-agnostic mouse event handler.
|
|
1412
|
+
|
|
1413
|
+
```typescript
|
|
1414
|
+
type MouseEventHandler = EventHandler<MouseEvent>
|
|
1415
|
+
```
|
|
1416
|
+
|
|
1417
|
+
#### `Size`
|
|
1418
|
+
|
|
1419
|
+
Standard size scale used across all molecule UI components (buttons, inputs, badges, etc.).
|
|
1420
|
+
|
|
1421
|
+
```typescript
|
|
1422
|
+
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
#### `TooltipPlacement`
|
|
1426
|
+
|
|
1427
|
+
Position where a tooltip renders relative to its trigger element (top, bottom, left, right, and corner variants).
|
|
1428
|
+
|
|
1429
|
+
```typescript
|
|
1430
|
+
type TooltipPlacement =
|
|
1431
|
+
'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'
|
|
1432
|
+
```
|
|
1433
|
+
|
|
1434
|
+
### Classes
|
|
1435
|
+
|
|
1436
|
+
#### `MoleculeAlert`
|
|
1437
|
+
|
|
1438
|
+
Angular Alert UI component with UIClassMap-driven styling.
|
|
1439
|
+
|
|
1440
|
+
#### `MoleculeBadge`
|
|
1441
|
+
|
|
1442
|
+
Angular Badge UI component with UIClassMap-driven styling.
|
|
1443
|
+
|
|
1444
|
+
#### `MoleculeButton`
|
|
1445
|
+
|
|
1446
|
+
Angular Button UI component with UIClassMap-driven styling.
|
|
1447
|
+
|
|
1448
|
+
#### `MoleculeCheckbox`
|
|
1449
|
+
|
|
1450
|
+
Angular Checkbox UI component with UIClassMap-driven styling.
|
|
1451
|
+
|
|
1452
|
+
#### `MoleculeInput`
|
|
1453
|
+
|
|
1454
|
+
Angular Input UI component with UIClassMap-driven styling.
|
|
1455
|
+
|
|
1456
|
+
#### `MoleculeModal`
|
|
1457
|
+
|
|
1458
|
+
Angular Modal UI component with UIClassMap-driven styling.
|
|
1459
|
+
|
|
1460
|
+
`centered` (default `true`) vertically centers the dialog; `centered:
|
|
1461
|
+
false` top-anchors it instead, via `getModalWrapperStyle()`.
|
|
1462
|
+
|
|
1463
|
+
#### `MoleculeRadioGroup`
|
|
1464
|
+
|
|
1465
|
+
Angular RadioGroup UI component with UIClassMap-driven styling.
|
|
1466
|
+
|
|
1467
|
+
#### `MoleculeSelect`
|
|
1468
|
+
|
|
1469
|
+
Angular Select UI component with UIClassMap-driven styling.
|
|
1470
|
+
|
|
1471
|
+
#### `MoleculeSpinner`
|
|
1472
|
+
|
|
1473
|
+
Angular Spinner UI component with UIClassMap-driven styling.
|
|
1474
|
+
|
|
1475
|
+
#### `MoleculeSwitch`
|
|
1476
|
+
|
|
1477
|
+
Angular Switch UI component with UIClassMap-driven styling.
|
|
1478
|
+
|
|
1479
|
+
#### `MoleculeToast`
|
|
1480
|
+
|
|
1481
|
+
Angular Toast UI component with UIClassMap-driven styling.
|
|
1482
|
+
|
|
1483
|
+
#### `MoleculeTooltip`
|
|
1484
|
+
|
|
1485
|
+
Angular Tooltip UI component with UIClassMap-driven styling.
|
|
1486
|
+
|
|
1487
|
+
Wraps child content and shows a tooltip on hover/focus. `hasArrow` renders
|
|
1488
|
+
a small themed pointer at the resolved `placement` edge.
|
|
1489
|
+
|
|
1490
|
+
### Functions
|
|
1491
|
+
|
|
1492
|
+
#### `cn(inputs)`
|
|
1493
|
+
|
|
1494
|
+
Merge class names, filtering out falsy values.
|
|
1495
|
+
|
|
1496
|
+
```typescript
|
|
1497
|
+
function cn(inputs?: (string | false | null | undefined)[]): string
|
|
1498
|
+
```
|
|
1499
|
+
|
|
1500
|
+
- `inputs` — The inputs.
|
|
1501
|
+
|
|
1502
|
+
**Returns:** The resulting string.
|
|
1503
|
+
|
|
1504
|
+
#### `getIconSvg(name, className)`
|
|
1505
|
+
|
|
1506
|
+
Generates SVG markup string from an icon name.
|
|
1507
|
+
|
|
1508
|
+
```typescript
|
|
1509
|
+
function getIconSvg(name: IconName, className: string): string
|
|
1510
|
+
```
|
|
1511
|
+
|
|
1512
|
+
- `name` — Icon name from the icon set
|
|
1513
|
+
- `className` — CSS class for sizing
|
|
1514
|
+
|
|
1515
|
+
**Returns:** SVG markup string
|
|
1516
|
+
|
|
1517
|
+
#### `getModalWrapperStyle(centered)`
|
|
1518
|
+
|
|
1519
|
+
Get the inline style for the modal centering wrapper. `dialogWrapper` has
|
|
1520
|
+
no dedicated ClassMap resolver option (it's a fixed token, not a
|
|
1521
|
+
`{ centered }`-parameterized one), so a top-anchored (non-centered) layout
|
|
1522
|
+
is expressed via the one inline-style exception the workspace styling rule
|
|
1523
|
+
allows for values ClassMap genuinely cannot express.
|
|
1524
|
+
|
|
1525
|
+
A standalone function (rather than a class member) so it's unit-testable
|
|
1526
|
+
without constructing `MoleculeModal` — the class can't be `new`'d outside
|
|
1527
|
+
an Angular injection context (`sanitizer = inject(DomSanitizer)` runs at
|
|
1528
|
+
field-initializer time).
|
|
1529
|
+
|
|
1530
|
+
```typescript
|
|
1531
|
+
function getModalWrapperStyle(centered: boolean): Record<string, string> | undefined
|
|
1532
|
+
```
|
|
1533
|
+
|
|
1534
|
+
- `centered` — Whether the modal is vertically centered.
|
|
1535
|
+
|
|
1536
|
+
**Returns:** An inline style object, or `undefined` when centered.
|
|
1537
|
+
|
|
1538
|
+
#### `getTooltipArrowStyle(placement)`
|
|
1539
|
+
|
|
1540
|
+
Returns the arrow's inline position style for a given placement. The arrow
|
|
1541
|
+
has no dedicated ClassMap resolver (`tooltip()` takes no options), so its
|
|
1542
|
+
shape/position is expressed via a small inline style — the sanctioned
|
|
1543
|
+
exception for values ClassMap cannot express. Its color is NOT hardcoded:
|
|
1544
|
+
`var(--color-surface)` / `var(--color-border)` are the same CSS custom
|
|
1545
|
+
properties the `bg-surface`/`border` classes in `tooltipContent` resolve
|
|
1546
|
+
to, so the arrow always matches the tooltip body in both themes.
|
|
1547
|
+
|
|
1548
|
+
A standalone function (rather than a class member) so it's unit-testable
|
|
1549
|
+
in isolation, matching `getModalWrapperStyle()` in `modal.component.ts`.
|
|
1550
|
+
|
|
1551
|
+
```typescript
|
|
1552
|
+
function getTooltipArrowStyle(placement: TooltipPlacement): Record<string, string>
|
|
1553
|
+
```
|
|
1554
|
+
|
|
1555
|
+
- `placement` — The tooltip's resolved placement.
|
|
1556
|
+
|
|
1557
|
+
**Returns:** Inline style positioning the rotated-square arrow for that placement.
|
|
1558
|
+
|
|
1559
|
+
## Injection Notes
|
|
1560
|
+
|
|
1561
|
+
### Requirements
|
|
1562
|
+
|
|
1563
|
+
Peer dependencies:
|
|
1564
|
+
|
|
1565
|
+
- `@angular/core` 22.0.0
|
|
1566
|
+
- `@angular/platform-browser` 22.0.0
|
|
1567
|
+
- `@molecule/app-i18n` ^1.0.0
|
|
1568
|
+
- `@molecule/app-icons` ^1.0.0
|
|
1569
|
+
- `@molecule/app-ui` ^1.0.0
|
|
1570
|
+
|
|
1571
|
+
### Runtime Dependencies
|
|
1572
|
+
|
|
1573
|
+
- `@angular/core`
|
|
1574
|
+
- `@angular/platform-browser`
|
|
1575
|
+
- `@molecule/app-i18n`
|
|
1576
|
+
- `@molecule/app-icons`
|
|
1577
|
+
- `@molecule/app-ui`
|
|
1578
|
+
|
|
1579
|
+
- **`setClassMap()` must run before any component renders** — every component resolves its
|
|
1580
|
+
classes through `getClassMap()`, which THROWS until a ClassMap bond (e.g.
|
|
1581
|
+
`@molecule/app-ui-tailwind`) is set. Call it in `main.ts` before `bootstrapApplication`.
|
|
1582
|
+
- Components are standalone — add them to the `imports` array of the consuming component or
|
|
1583
|
+
route; there is no NgModule.
|
|
1584
|
+
- Event outputs are `handle*`, not the DOM names: `(handleClick)` on `mol-button`,
|
|
1585
|
+
`(handleInput)`/`(handleChange)` on `mol-input` (both emit the raw DOM event — read the
|
|
1586
|
+
value from `$event.target`). The host element uses `display: contents`, so the real
|
|
1587
|
+
`<button>`/`<input>` lives inside the template.
|
|
1588
|
+
|
|
1589
|
+
## Translations
|
|
1590
|
+
|
|
1591
|
+
Translation strings are provided by `@molecule/app-locales-ui`.
|