anvilui 0.2.0 → 0.4.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/AGENTS.md +34 -33
- package/README.md +42 -89
- package/dist/components/AnvilRoot/AnvilRoot.d.ts +2 -2
- package/dist/components/Combobox/Combobox.d.ts +8 -2
- package/dist/components/DateInput/DateInput.d.ts +5 -3
- package/dist/components/FABMenu/FABMenu.d.ts +4 -1
- package/dist/components/IconButton/IconButton.d.ts +5 -3
- package/dist/components/Input/Input.d.ts +5 -3
- package/dist/components/NavigationBar/NavigationBar.d.ts +1 -1
- package/dist/components/NavigationList/NavigationList.d.ts +1 -1
- package/dist/components/NavigationRail/NavigationRail.d.ts +1 -1
- package/dist/components/PinInput/PinInput.d.ts +5 -3
- package/dist/components/Progress/Progress.d.ts +4 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +3 -3
- package/dist/components/Search/Search.d.ts +22 -6
- package/dist/components/Select/Select.d.ts +6 -2
- package/dist/components/Skeleton/Skeleton.d.ts +3 -3
- package/dist/components/Slider/Slider.d.ts +9 -2
- package/dist/components/SquigglyWave/SquigglyWave.d.ts +26 -4
- package/dist/components/Textarea/Textarea.d.ts +6 -3
- package/dist/components/TimePicker/TimePicker.d.ts +7 -5
- package/dist/components/Toggle/Toggle.d.ts +2 -1
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -2
- package/dist/dev.d.ts +7 -2
- package/dist/index.cjs +528 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +55 -26
- package/dist/index.css.map +1 -1
- package/dist/index.js +533 -141
- package/dist/index.js.map +1 -1
- package/dist/themes/types.d.ts +0 -4
- package/dist/utils.d.ts +5 -1
- package/docs/avatar.md +1 -1
- package/docs/badge.md +41 -41
- package/docs/calendar.md +1 -1
- package/docs/combobox.md +2 -1
- package/docs/composition.md +1 -1
- package/docs/date-input.md +4 -3
- package/docs/fab-menu.md +1 -0
- package/docs/forms.md +2 -2
- package/docs/icon-button.md +3 -2
- package/docs/input.md +1 -0
- package/docs/morph.md +4 -1
- package/docs/navigation-bar.md +1 -1
- package/docs/navigation-rail.md +1 -1
- package/docs/pin-input.md +1 -1
- package/docs/progress.md +37 -37
- package/docs/radio-group.md +18 -1
- package/docs/search.md +7 -7
- package/docs/select.md +3 -2
- package/docs/skeleton.md +33 -33
- package/docs/slider.md +51 -49
- package/docs/textarea.md +1 -1
- package/docs/theming.md +3 -2
- package/docs/time-picker.md +4 -3
- package/docs/toggle-group.md +1 -1
- package/docs/toggle.md +2 -2
- package/package.json +2 -2
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AnvilUI: reference for AI coding agents
|
|
2
2
|
|
|
3
|
-
`anvilui` is a React 19 component library
|
|
3
|
+
`anvilui` is a React 19 component library implementing Material 3 Expressive (with extra motion beyond the spec), built on [Base UI](https://base-ui.com) (`@base-ui/react`). It has ~50 accessible components (buttons, inputs, selects, dialogs, menus, navigation, …), a theme system driven by CSS variables, and Material Symbols icons referenced by name. It is **not** shadcn/ui, Radix or MUI: names and props differ. This file matches the installed version. Read it before writing code; per-component pages are in [`docs/`](docs/llms-index.md) (`node_modules/anvilui/docs/<name>.md`).
|
|
4
4
|
|
|
5
5
|
## Rules that prevent most errors
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
6. Callbacks get **values, not events**: `onValueChange(value)`, `onCheckedChange(checked)`, `onOpenChange(open)`, `onPressedChange(pressed)`. No `onChange` except on `Input`/`Textarea` (native).
|
|
13
13
|
7. `Checkbox`, `Switch`, `Radio` have **no `label` prop**: wrap them in `<label>`. Most other controls take `label`.
|
|
14
14
|
8. Titles and text often go in **`label`, not children**: `AppBar`, `ListItem`, `Tooltip`, nav items, `Input`, `Select`, `Slider`, `Progress`.
|
|
15
|
-
9. Icon-only controls require `aria-label` (`IconButton`, `FAB` without `label`, icon `Toggle`, `Slider`/`Progress` without `label`, `Search`, `Carousel`).
|
|
15
|
+
9. Icon-only controls require `aria-label` (`IconButton`, `FAB` without `label`, icon `Toggle`, `Slider`/`Progress` without `label`, `Search`, `Carousel`). Groups and navigation need one too: `ToggleGroup`, `RadioGroup` (or a `<fieldset>` with `<legend>`), `FloatingToolbar`, `AvatarGroup`, `NavigationBar`/`Rail`/`List`.
|
|
16
16
|
10. `Button` defaults to `type="button"`. Use `type="submit"` in forms.
|
|
17
17
|
11. Dates are `"YYYY-MM-DD"` strings, times `"HH:mm"` strings. Not `Date` objects.
|
|
18
18
|
12. No layout components (`Box`, `Stack`, `Grid`, `Container`, `Flex`) and no `sx`. Use plain elements with `style` / CSS and theme variables like `var(--avl-spacing-x4)`.
|
|
@@ -66,22 +66,22 @@ Nothing else is exported. Not in the library: `Box`, `Stack`, `Grid`, `Container
|
|
|
66
66
|
|
|
67
67
|
## Component reference
|
|
68
68
|
|
|
69
|
-
Props marked
|
|
69
|
+
Props marked \* are required. All components also take `className`, `style`, `ref` and the props of their underlying element / Base UI part. Full tables: `docs/<name>.md`.
|
|
70
70
|
|
|
71
71
|
### Buttons
|
|
72
72
|
|
|
73
73
|
| Component | Key props | Usage |
|
|
74
74
|
| --- | --- | --- |
|
|
75
75
|
| `Button` | `fillType`, `color`, `size: 'small'\|'normal'\|'big'`, `startIcon`, `endIcon`, `loading`, `disabled`, `type`, `render` | `<Button startIcon="add" onClick={create}>New</Button>` |
|
|
76
|
-
| `IconButton` | `icon
|
|
76
|
+
| `IconButton` | `icon`\*, `aria-label`\*, `fillType`, `color`, `size`. No children | `<IconButton icon="close" aria-label="Close" fillType="text" color="container" />` |
|
|
77
77
|
| `SplitButton` | `<div>` props | `<SplitButton><Button>Save</Button><IconButton icon="arrow_drop_down" aria-label="More" /></SplitButton>` |
|
|
78
|
-
| `HoldButton` | `onConfirm
|
|
78
|
+
| `HoldButton` | `onConfirm`\*, `holdDuration` (1500), Button props | `<HoldButton color="error" onConfirm={del}>Hold to delete</HoldButton>` |
|
|
79
79
|
| `Toggle` | `pressed`/`defaultPressed`/`onPressedChange`, `color`, `fillType`; text: `children`, `startIcon`, `size`; icon: `icon` + `aria-label` | `<Toggle icon="favorite" aria-label="Favorite" />` |
|
|
80
80
|
| `ToggleGroup` | `value`/`defaultValue`/`onValueChange` (single value; array with `multiple`), `multiple`, `color`, `fillType`, `size` | `<ToggleGroup aria-label="View" defaultValue="list">…</ToggleGroup>` |
|
|
81
|
-
| `ToggleGroupItem` | `value
|
|
82
|
-
| `FAB` | `icon
|
|
83
|
-
| `FABMenu` | `icon
|
|
84
|
-
| `Chip` / `FilterChip` / `InputChip` | `startIcon`; FilterChip `pressed`/`onPressedChange`; InputChip `onRemove
|
|
81
|
+
| `ToggleGroupItem` | `value`\*, `startIcon`, `endIcon`, `children` | `<ToggleGroupItem value="list">List</ToggleGroupItem>` |
|
|
82
|
+
| `FAB` | `icon`\*, `label` or `aria-label`\*, `size`, `color`, `fillType`, `sticky` | `<FAB icon="add" aria-label="New" style={{ position: 'fixed', right: 16, bottom: 16 }} />` |
|
|
83
|
+
| `FABMenu` | `icon`\*, `aria-label`\*, `children`\* (`FABMenuItem`s), `side`, `align`, `color` | `<FABMenu icon="add" aria-label="Create"><FABMenuItem icon="folder">Folder</FABMenuItem></FABMenu>` |
|
|
84
|
+
| `Chip` / `FilterChip` / `InputChip` | `startIcon`; FilterChip `pressed`/`onPressedChange`; InputChip `onRemove`\*, `removeLabel` | `<FilterChip pressed={on} onPressedChange={setOn}>Vegan</FilterChip>` |
|
|
85
85
|
|
|
86
86
|
### Form controls
|
|
87
87
|
|
|
@@ -90,17 +90,17 @@ Props marked * are required. All components also take `className`, `style`, `ref
|
|
|
90
90
|
| `Input` | `label`, `size: 'small'\|'normal'`, `value`/`defaultValue`, `onValueChange(string)` or `onChange(event)`, input attrs | `<Input label="Email" type="email" value={v} onValueChange={setV} />` |
|
|
91
91
|
| `Textarea` | same as Input + `rows` | `<Textarea label="Bio" rows={4} />` |
|
|
92
92
|
| `Select` | `items` (map or `{value,label}[]`), `value`/`defaultValue`/`onValueChange(value)`, `label`, `placeholder`, `multiple`, `name` | `<Select label="Fruit" items={fruits} defaultValue="apple">{…SelectItem}</Select>` |
|
|
93
|
-
| `SelectItem` | `value
|
|
94
|
-
| `Combobox` | `items`, `children
|
|
95
|
-
| `Search` | `aria-label`
|
|
93
|
+
| `SelectItem` | `value`\*, children = label | `<SelectItem value="apple">Apple</SelectItem>` |
|
|
94
|
+
| `Combobox` | `items`, `children`\* = `(item) => <ComboboxItem/>`, `value`/`onValueChange(item)`, `itemToStringLabel`, `label`, `empty` | `<Combobox label="Fruit" items={list}>{(f: string) => <ComboboxItem key={f} value={f}>{f}</ComboboxItem>}</Combobox>` |
|
|
95
|
+
| `Search` | `aria-label`\*, `value`/`onValueChange(text)`, `placeholder`, `color` (`surface`/`container`); suggestions: `items` + `children` = `(item) => <SearchItem/>`, `empty` | `<Search aria-label="Filter" value={q} onValueChange={setQ} />` |
|
|
96
96
|
| `Checkbox` | `checked`/`defaultChecked`/`onCheckedChange(boolean)`, `indeterminate`, `name` | `<label><Checkbox checked={c} onCheckedChange={setC} /> Remember me</label>` |
|
|
97
97
|
| `Switch` | `checked`/`defaultChecked`/`onCheckedChange(boolean)`, `name` | `<label><Switch defaultChecked /> Wi-Fi</label>` |
|
|
98
|
-
| `RadioGroup` / `Radio` | group: `value`/`defaultValue`/`onValueChange(value)`, `name`; radio: `value
|
|
99
|
-
| `Slider` | `label` or `aria-label
|
|
100
|
-
| `DateInput` | `value`/`defaultValue` `"YYYY-MM-DD" \| null`, `onValueChange`, `label` or `aria-label
|
|
101
|
-
| `TimePicker` | `value`/`defaultValue` `"HH:mm" \| null`, `onValueChange`, `type: 'dial'\|'input'`, `hourCycle: 12\|24`, `label` or `aria-label
|
|
98
|
+
| `RadioGroup` / `Radio` | group: `value`/`defaultValue`/`onValueChange(value)`, `name`; radio: `value`\* | `<RadioGroup aria-label="Plan" defaultValue="a"><label><Radio value="a" /> A</label></RadioGroup>` |
|
|
99
|
+
| `Slider` | `label` or `aria-label`\*, `value`/`defaultValue` (number or number[]), `onValueChange(number)`, `min`, `max`, `step`, `showValue`, `format`, `getAriaLabel(index)` (names each handle of a range) | `<Slider label="Volume" defaultValue={50} />` |
|
|
100
|
+
| `DateInput` | `value`/`defaultValue` `"YYYY-MM-DD" \| null`, `onValueChange`, `label` or `aria-label`\* | `<DateInput label="Due" value={d} onValueChange={setD} />` |
|
|
101
|
+
| `TimePicker` | `value`/`defaultValue` `"HH:mm" \| null`, `onValueChange`, `type: 'dial'\|'input'`, `hourCycle: 12\|24`, `label` or `aria-label`\*, `name` (own, not inside `Field`) | `<TimePicker label="Start" defaultValue="09:00" />` |
|
|
102
102
|
| `Calendar` | `value`/`defaultValue` `"YYYY-MM-DD" \| null`, `onValueChange` | `<Calendar value={d} onValueChange={setD} />` |
|
|
103
|
-
| `PinInput` | `length
|
|
103
|
+
| `PinInput` | `length`\*, `label` or `aria-label`\*, `value`/`onValueChange`, `onValueComplete`, `mask`, `validationType` | `<PinInput label="Code" length={6} />` |
|
|
104
104
|
| `Field` | `name`, `validate`, `validationMode: 'onSubmit'\|'onBlur'\|'onChange'`, `invalid`, `disabled` | `<Field name="email"><Input label="Email" required /><FieldError /></Field>` |
|
|
105
105
|
| `FieldDescription` / `FieldError` | FieldError `match` | `<FieldError match="valueMissing">Required</FieldError>` |
|
|
106
106
|
|
|
@@ -112,7 +112,7 @@ Props marked * are required. All components also take `className`, `style`, `ref
|
|
|
112
112
|
| `BottomSheet` | same shape: `BottomSheetTrigger`, `BottomSheetPopup`, `BottomSheetTitle`, `BottomSheetDescription`, `BottomSheetClose`; `snapPoints` | |
|
|
113
113
|
| `Popover` | `PopoverTrigger`, `PopoverPopup` (`side`, `align`, `sideOffset`), `PopoverTitle`, `PopoverDescription`, `PopoverClose` | |
|
|
114
114
|
| `PreviewCard` | `PreviewCardTrigger` (an `<a href>`), `PreviewCardPopup` | |
|
|
115
|
-
| `Tooltip` | `label
|
|
115
|
+
| `Tooltip` | `label`\*, one element child_, `side`, `align`, `delay` | `<Tooltip label="Delete"><IconButton icon="delete" aria-label="Delete" /></Tooltip>` |
|
|
116
116
|
| `Menu` | `MenuTrigger`, `MenuPopup` (`side`, `align`), `MenuItem` (`onClick`, `startIcon`, `endIcon`, `disabled`), `MenuGroup`, `MenuSubmenu` + `MenuSubmenuTrigger` | see Patterns |
|
|
117
117
|
| `ContextMenu` | `ContextMenuTrigger` (area) + `MenuPopup` / `MenuItem` | |
|
|
118
118
|
| `Menubar` | contains `Menu`s | |
|
|
@@ -122,18 +122,18 @@ Props marked * are required. All components also take `className`, `style`, `ref
|
|
|
122
122
|
|
|
123
123
|
| Component | Key props | Usage |
|
|
124
124
|
| --- | --- | --- |
|
|
125
|
-
| `AppBar` | `label
|
|
126
|
-
| `NavigationBar` / `NavigationBarItem` | item: `icon
|
|
127
|
-
| `NavigationRail` / `NavigationRailToggle` / `NavigationRailItem` | rail: `expanded`/`defaultExpanded`/`onExpandedChange`; toggle: `aria-label
|
|
128
|
-
| `NavigationList` / `NavigationListItem` | item: `label
|
|
129
|
-
| `NavigationDrawer` | `NavigationDrawerTrigger`, `NavigationDrawerPopup`, `NavigationDrawerTitle`, `NavigationDrawerItem` (`icon
|
|
130
|
-
| `Tabs` | `value`/`defaultValue`/`onValueChange`; `TabsList`, `TabsTab` (`value
|
|
125
|
+
| `AppBar` | `label`\*, `labelAs`, `start`, `end`, `size: 'normal'\|'big'`, `centered`, `color` ('container') | `<AppBar label="Inbox" start={…} end={…} />` |
|
|
126
|
+
| `NavigationBar` / `NavigationBarItem` | item: `icon`\*, `label`\*, `active`, `href` or `render={<Link/>}` | `<NavigationBarItem icon="home" label="Home" href="/" active />` |
|
|
127
|
+
| `NavigationRail` / `NavigationRailToggle` / `NavigationRailItem` | rail: `expanded`/`defaultExpanded`/`onExpandedChange`; toggle: `aria-label`\*; item: `icon`\*, `label`\*, `active`, `end`, `href` | |
|
|
128
|
+
| `NavigationList` / `NavigationListItem` | item: `label`\*, `active`, `href`, `render` | |
|
|
129
|
+
| `NavigationDrawer` | `NavigationDrawerTrigger`, `NavigationDrawerPopup`, `NavigationDrawerTitle`, `NavigationDrawerItem` (`icon`\*, `label`\*, `active`, `href`) | |
|
|
130
|
+
| `Tabs` | `value`/`defaultValue`/`onValueChange`; `TabsList`, `TabsTab` (`value`\*, `icon`), `TabsPanel` (`value`\*). Always set `defaultValue` | see Patterns |
|
|
131
131
|
| `FloatingToolbar` | `inverseColor`; `FloatingToolbarButton` (IconButton props), `FloatingToolbarSeparator` | |
|
|
132
132
|
| `Card` | `color` ('container'), `fillType`, `clickable`; `CardTitle` (`as`), `CardContent`, `CardActions` | |
|
|
133
|
-
| `List` / `ListItem` | list: `divided`; item: `label
|
|
133
|
+
| `List` / `ListItem` | list: `divided`; item: `label`\*, `description`, `start`, `end`, `render`. No children | `<ListItem label="Wi-Fi" end={<Switch />} render={<label />} />` |
|
|
134
134
|
| `Table` | `TableCaption`, `TableHead`, `TableBody`, `TableRow`, `TableHeaderCell`, `TableCell` (native elements) | |
|
|
135
135
|
| `Accordion` | `value`/`defaultValue` (array), `multiple`; `AccordionItem` (`value`), `AccordionTrigger` (`as`), `AccordionPanel` | |
|
|
136
|
-
| `Carousel` / `CarouselItem` | `aria-label
|
|
136
|
+
| `Carousel` / `CarouselItem` | `aria-label`\* | |
|
|
137
137
|
| `Divider` | `orientation`, `label`, `squiggly` | `<Divider label="or" />` |
|
|
138
138
|
| `Typography` | `type: 'body'\|'caption'\|'h1'…'h6'` (not `variant`), `as` | `<Typography type="h5" as="h1">Settings</Typography>` |
|
|
139
139
|
|
|
@@ -141,14 +141,14 @@ Props marked * are required. All components also take `className`, `style`, `ref
|
|
|
141
141
|
|
|
142
142
|
| Component | Key props | Usage |
|
|
143
143
|
| --- | --- | --- |
|
|
144
|
-
| `Avatar` | `name
|
|
144
|
+
| `Avatar` | `name` (or `aria-label`), `src`, `icon`, `size` (32/40/56px), `color` | `<Avatar name="Ada Lovelace" src={url} />` |
|
|
145
145
|
| `AvatarGroup` | `max`, `size`, `fan`, `aria-label` | `<AvatarGroup max={3} aria-label="Team">{avatars}</AvatarGroup>` |
|
|
146
146
|
| `Badge` | `count` (omit for dot, 0 hides), `max`, `color` ('error'), wraps children | `<Badge count={3}><IconButton icon="mail" aria-label="Mail, 3 new" /></Badge>` |
|
|
147
|
-
| `Icon` | `name
|
|
148
|
-
| `Progress` | `value
|
|
149
|
-
| `Skeleton` | `
|
|
147
|
+
| `Icon` | `name`\* | `<Icon name="star" />` |
|
|
148
|
+
| `Progress` | `value`\* (`number \| null`), `type: 'linear'\|'circular'\|'inline'`, `label` or `aria-label`\*, `squiggly` | `<Progress type="circular" value={null} aria-label="Loading" />` |
|
|
149
|
+
| `Skeleton` | `type: 'text'\|'circular'\|'rectangular'` (not `variant`), `animation`; size via `style` | `<Skeleton style={{ width: 120 }} />` |
|
|
150
150
|
| `Sticker` | `color`, `startIcon`, `tilt` | `<Sticker>NEW</Sticker>` |
|
|
151
|
-
| `AnimatedNumber` | `value
|
|
151
|
+
| `AnimatedNumber` | `value`\*, `format`, `locales` | `<AnimatedNumber value={n} />` |
|
|
152
152
|
| `Kbd` | `children`, `listen`, `listenFor` | `<Kbd>⌘</Kbd><Kbd>K</Kbd>` |
|
|
153
153
|
|
|
154
154
|
## Patterns
|
|
@@ -434,7 +434,7 @@ Inside AnvilRoot: `var(--avl-color-background)`, `var(--avl-color-on-background)
|
|
|
434
434
|
| `<Button size="lg">` / `size="sm"` | `size="big"` / `size="small"` |
|
|
435
435
|
| `<Button><Plus /> Add</Button>` | `<Button startIcon="add">Add</Button>` |
|
|
436
436
|
| `<IconButton><DeleteIcon /></IconButton>` | `<IconButton icon="delete" aria-label="Delete" />` |
|
|
437
|
-
| `<IconButton icon="
|
|
437
|
+
| `<IconButton icon="close" size="sm" />` | `size="small"` (`'small' \| 'normal' \| 'big'`) |
|
|
438
438
|
| `<DialogTrigger asChild><Button>Open</Button></DialogTrigger>` | `<DialogTrigger render={<Button />}>Open</DialogTrigger>` |
|
|
439
439
|
| `<DialogTrigger>Open</DialogTrigger>` expecting a styled button | It's a bare `<button>`; add `render={<Button />}` |
|
|
440
440
|
| `<DialogContent>`, `<DialogHeader>`, `<DialogFooter>` | `<DialogPopup>`, (nothing), `<DialogActions>` |
|
|
@@ -455,6 +455,7 @@ Inside AnvilRoot: `var(--avl-color-background)`, `var(--avl-color-on-background)
|
|
|
455
455
|
| `toast('Saved')`, `<Toaster />`, `<Snackbar open>` | `const snackbar = useSnackbar(); snackbar.show({ message: 'Saved' })` |
|
|
456
456
|
| `snackbar.show({ message, severity: 'success' })` | no severity; put it in the message |
|
|
457
457
|
| `<Typography variant="h4">` | `<Typography type="h4">` |
|
|
458
|
+
| `<Skeleton variant="circular">` | `<Skeleton type="circular">` |
|
|
458
459
|
| `<AppBar title="Inbox">` / `<AppBar>Inbox</AppBar>` | `<AppBar label="Inbox" />` |
|
|
459
460
|
| `<ListItem>Text</ListItem>` / `primary=` / `secondary=` | `<ListItem label="Text" description="More" />` |
|
|
460
461
|
| `<ListItem onClick={…} />` expecting a button | `<ListItem label="…" render={<button type="button" onClick={…} />} />` |
|
|
@@ -474,7 +475,7 @@ Inside AnvilRoot: `var(--avl-color-background)`, `var(--avl-color-on-background)
|
|
|
474
475
|
|
|
475
476
|
## Errors you may see
|
|
476
477
|
|
|
477
|
-
In development, AnvilUI logs `[anvilui] …` errors with a fix and a doc path for: a missing stylesheet, components outside `AnvilRoot`, `asChild`, `variant` on Button/IconButton/Typography, `label` on Checkbox/Switch/Radio, missing `aria-label`, non-function Combobox/Search children, a Tooltip without one element child, and parts outside their parent. Base UI's own errors look like `Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>`. `<Menu.Root>` there means AnvilUI's `<Menu>` (likewise `<Tabs.Root>` → `<Tabs>`, `<Dialog.Root>` → `<Dialog>`).
|
|
478
|
+
In development, AnvilUI logs `[anvilui] …` errors with a fix and a doc path for: a missing stylesheet, components outside `AnvilRoot`, `asChild`, `variant` on Button/IconButton/Typography/Skeleton, `label` on Checkbox/Switch/Radio, missing `aria-label` (also on groups and navigation), a range Slider without `getAriaLabel`, a TimePicker inside a Field, non-function Combobox/Search children, a Tooltip without one element child, and parts outside their parent. Base UI's own errors look like `Base UI: MenuRootContext is missing. Menu parts must be placed within <Menu.Root>`. `<Menu.Root>` there means AnvilUI's `<Menu>` (likewise `<Tabs.Root>` → `<Tabs>`, `<Dialog.Root>` → `<Dialog>`).
|
|
478
479
|
|
|
479
480
|
## More
|
|
480
481
|
|
package/README.md
CHANGED
|
@@ -1,49 +1,22 @@
|
|
|
1
1
|
# anvilui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Material 3 Expressive for the web, pushed further.**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
npm install anvilui
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Using with AI coding agents
|
|
5
|
+
React components that bounce, stretch, roll and react. AnvilUI brings Google's [Material 3 Expressive](https://m3.material.io/) to React, then keeps going where the spec stops: buttons with weight, selections that stretch, numbers that roll and progress that ripples. Around 50 components, all built on [Base UI](https://base-ui.com), so keyboard, focus and screen reader support come built in.
|
|
10
6
|
|
|
11
|
-
|
|
7
|
+
<img src="https://raw.githubusercontent.com/itayvak/anvilui/main/.github/assets/showcase.png" alt="AnvilUI components in light and dark mode" width="900" />
|
|
12
8
|
|
|
13
|
-
|
|
9
|
+
## Install
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
## AnvilUI
|
|
17
|
-
|
|
18
|
-
This project uses the `anvilui` React component library. Its API differs from shadcn/ui, Radix and MUI, so don't guess it. Before writing or changing UI code that uses it, read `node_modules/anvilui/AGENTS.md`, then the page for each component you use in `node_modules/anvilui/docs/` (index: `node_modules/anvilui/docs/llms-index.md`). These docs match the installed version; prefer them over memory.
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Or run this once in your project, which appends that note to whichever of those files exist (or creates `AGENTS.md`):
|
|
11
|
+
Requires React 19.
|
|
22
12
|
|
|
23
13
|
```sh
|
|
24
|
-
|
|
14
|
+
npm install anvilui
|
|
25
15
|
```
|
|
26
16
|
|
|
27
|
-
In development, mistakes like a missing stylesheet, `asChild`, `variant` or a missing `aria-label` log an `[anvilui]` error that shows the fix and names the doc page, so pasting the console output back to your agent is enough. These checks are removed from production builds.
|
|
28
|
-
|
|
29
17
|
## Setup
|
|
30
18
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
AnvilUI does not load any fonts by itself. The default theme uses Google Sans and Google Sans Code - if you intend to use them, add this to your HTML `<head>`:
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
37
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
38
|
-
<link
|
|
39
|
-
rel="stylesheet"
|
|
40
|
-
href="https://fonts.googleapis.com/css2?family=Google+Sans+Code:ital,wght,MONO@0,300..800,1;1,300..800,1&family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap"
|
|
41
|
-
/>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
To use different fonts, pass `tokens.font` to `AnvilRoot` and load the font yourself instead of Google Sans.
|
|
45
|
-
|
|
46
|
-
### 2. Wrap your app in `AnvilRoot`
|
|
19
|
+
Import the stylesheet once and wrap your app in `AnvilRoot`. That's the only provider: it handles theming, color mode, tooltips and snackbars.
|
|
47
20
|
|
|
48
21
|
```tsx
|
|
49
22
|
import { AnvilRoot, Button } from 'anvilui'
|
|
@@ -51,79 +24,59 @@ import 'anvilui/styles.css'
|
|
|
51
24
|
|
|
52
25
|
export function App() {
|
|
53
26
|
return (
|
|
54
|
-
<AnvilRoot defaultColorMode="
|
|
55
|
-
<Button>Hello</Button>
|
|
27
|
+
<AnvilRoot defaultColorMode="system">
|
|
28
|
+
<Button startIcon="rocket_launch">Hello</Button>
|
|
56
29
|
</AnvilRoot>
|
|
57
30
|
)
|
|
58
31
|
}
|
|
59
32
|
```
|
|
60
33
|
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
## Color mode and themes
|
|
34
|
+
- Styles only apply inside `AnvilRoot`. To theme the whole page, give it a `className` that fills the viewport (`min-height: 100vh`).
|
|
35
|
+
- Icons come from the `material-symbols` font, so your bundler needs to handle CSS and font files from `node_modules` (Vite, Next.js and webpack do by default).
|
|
36
|
+
- The default theme uses Google Sans, which AnvilUI doesn't load for you. See [setup](https://github.com/itayvak/anvilui/blob/main/core/docs/setup.md) for the font link, Next.js and more.
|
|
65
37
|
|
|
66
|
-
|
|
38
|
+
## Make it yours
|
|
67
39
|
|
|
68
40
|
```tsx
|
|
69
|
-
|
|
70
|
-
const { colorMode, colorModeSetting, setColorMode } = useAnvil()
|
|
71
|
-
```
|
|
41
|
+
import { AnvilRoot, createTheme } from 'anvilui'
|
|
72
42
|
|
|
73
|
-
|
|
43
|
+
const brand = createTheme('#0B6E4F') // or: await createThemeFromImage(file)
|
|
74
44
|
|
|
75
|
-
|
|
45
|
+
<AnvilRoot lightTheme={brand.light} darkTheme={brand.dark} storageKey="color-mode">
|
|
46
|
+
<App />
|
|
47
|
+
</AnvilRoot>
|
|
48
|
+
```
|
|
76
49
|
|
|
77
|
-
|
|
50
|
+
One color becomes a full light and dark palette. Color mode follows the OS by default, and with `storageKey` the user's choice is remembered and applied before first paint. Spacing, radius, fonts and motion are tokens you can override too. See [theming](https://github.com/itayvak/anvilui/blob/main/core/docs/theming.md).
|
|
78
51
|
|
|
79
|
-
|
|
80
|
-
import { createTheme, createThemeFromImage } from 'anvilui'
|
|
52
|
+
## Using with AI coding agents
|
|
81
53
|
|
|
82
|
-
|
|
83
|
-
// or, in the browser: from an <img>, a File/Blob, or a CORS-enabled URL
|
|
84
|
-
const theme = await createThemeFromImage(file)
|
|
54
|
+
AnvilUI is new, so AI models don't know its API and will guess it from other libraries. The package ships accurate, version-matched docs for agents: [`AGENTS.md`](https://github.com/itayvak/anvilui/blob/main/core/AGENTS.md) plus one page per component in `docs/`.
|
|
85
55
|
|
|
86
|
-
|
|
87
|
-
```
|
|
56
|
+
Run this once in your project to point your agent at them:
|
|
88
57
|
|
|
89
|
-
|
|
58
|
+
```sh
|
|
59
|
+
npx anvilui setup-agents
|
|
60
|
+
```
|
|
90
61
|
|
|
91
|
-
|
|
62
|
+
It appends a short note to whichever of `AGENTS.md`, `CLAUDE.md`, `.cursorrules` or `.github/copilot-instructions.md` exist, or creates `AGENTS.md`. To add it by hand, paste this:
|
|
92
63
|
|
|
93
|
-
|
|
64
|
+
```md
|
|
65
|
+
## AnvilUI
|
|
94
66
|
|
|
95
|
-
|
|
96
|
-
import { morph } from 'anvilui'
|
|
97
|
-
|
|
98
|
-
function Albums() {
|
|
99
|
-
const [open, setOpen] = useState<string | null>(null)
|
|
100
|
-
|
|
101
|
-
if (open) {
|
|
102
|
-
return (
|
|
103
|
-
<section data-morph-id={open}>
|
|
104
|
-
<button onClick={() => morph(open, () => setOpen(null))}>
|
|
105
|
-
Back
|
|
106
|
-
</button>
|
|
107
|
-
</section>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
return albums.map((a) => (
|
|
111
|
-
<button
|
|
112
|
-
key={a.id}
|
|
113
|
-
data-morph-id={a.id}
|
|
114
|
-
onClick={() => morph(a.id, () => setOpen(a.id))}
|
|
115
|
-
>
|
|
116
|
-
{a.title}
|
|
117
|
-
</button>
|
|
118
|
-
))
|
|
119
|
-
}
|
|
67
|
+
This project uses the `anvilui` React component library. Its API differs from shadcn/ui, Radix and MUI, so don't guess it. Before writing or changing UI code that uses it, read `node_modules/anvilui/AGENTS.md`, then the page for each component you use in `node_modules/anvilui/docs/` (index: `node_modules/anvilui/docs/llms-index.md`). These docs match the installed version; prefer them over memory.
|
|
120
68
|
```
|
|
121
69
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
70
|
+
In development, mistakes like a missing stylesheet, `asChild`, `variant` or a missing `aria-label` log an `[anvilui]` error that shows the fix and names the doc page, so pasting the console output back to your agent is enough. These checks are removed from production builds.
|
|
71
|
+
|
|
72
|
+
## Documentation
|
|
73
|
+
|
|
74
|
+
- [Component docs](https://github.com/itayvak/anvilui/blob/main/core/docs/llms-index.md): one page per component, with props and examples
|
|
75
|
+
- [Theming and color mode](https://github.com/itayvak/anvilui/blob/main/core/docs/theming.md)
|
|
76
|
+
- [Forms and validation](https://github.com/itayvak/anvilui/blob/main/core/docs/forms.md)
|
|
77
|
+
- [Morphing between views](https://github.com/itayvak/anvilui/blob/main/core/docs/morph.md) with `morph()`
|
|
78
|
+
- [API reference](https://github.com/itayvak/anvilui/blob/main/core/AGENTS.md): every export on one page
|
|
79
|
+
|
|
80
|
+
## License
|
|
128
81
|
|
|
129
|
-
|
|
82
|
+
MIT
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
2
|
import { ColorModeSetting } from './AnvilContext';
|
|
3
3
|
import { Theme } from '../../themes/types';
|
|
4
4
|
import { DesignTokens } from '../../tokens/types';
|
|
5
5
|
import '../../colors/colors.css';
|
|
6
6
|
import './global.css';
|
|
7
|
-
export type AnvilRootProps = {
|
|
7
|
+
export type AnvilRootProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
8
8
|
/** Your app. Every AnvilUI component must be somewhere inside. */
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
/** Extra classes for the root element, e.g. to make it fill the viewport. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import { type CSSProperties, type ReactNode, type Ref } from 'react';
|
|
2
2
|
import { Combobox as BaseCombobox } from '@base-ui/react/combobox';
|
|
3
3
|
import '../Input/input.css';
|
|
4
4
|
import '../Menu/menu.css';
|
|
@@ -22,6 +22,12 @@ export type ComboboxProps<Item> = Omit<BaseCombobox.Root.Props<Item>, 'children'
|
|
|
22
22
|
size?: 'small' | 'normal';
|
|
23
23
|
/** Applied to the outer wrapper, so width and margins work as expected. */
|
|
24
24
|
className?: string;
|
|
25
|
+
/** Applied to the outer wrapper, with `className`. */
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
/** The text `<input>`. */
|
|
28
|
+
ref?: Ref<HTMLInputElement>;
|
|
29
|
+
/** The text `<input>`'s id. */
|
|
30
|
+
id?: string;
|
|
25
31
|
};
|
|
26
32
|
/**
|
|
27
33
|
* A text field that filters a list of options as you type, and picks one.
|
|
@@ -36,7 +42,7 @@ export type ComboboxProps<Item> = Omit<BaseCombobox.Root.Props<Item>, 'children'
|
|
|
36
42
|
* )}
|
|
37
43
|
* </Combobox>
|
|
38
44
|
*/
|
|
39
|
-
export declare function Combobox<Item>({ children, label, placeholder, empty, size, className, ...
|
|
45
|
+
export declare function Combobox<Item>({ children, label, placeholder, empty, size, className, style, ref, id, ...allProps }: ComboboxProps<Item>): import("react").JSX.Element;
|
|
40
46
|
export type ComboboxItemProps = BaseCombobox.Item.Props;
|
|
41
47
|
/** One option in a `Combobox`. Needs a `value` (the item); children are its label. */
|
|
42
48
|
export declare function ComboboxItem({ className, children, ...props }: ComboboxItemProps): import("react").JSX.Element;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
import { Input as BaseInput } from '@base-ui/react/input';
|
|
3
3
|
import '../Input/input.css';
|
|
4
4
|
import './date-input.css';
|
|
5
|
-
export type DateInputProps = Omit<BaseInput.Props, 'value' | 'defaultValue' | 'onValueChange' | 'type' | 'size' | 'className' | 'placeholder'> & {
|
|
5
|
+
export type DateInputProps = Omit<BaseInput.Props, 'value' | 'defaultValue' | 'onValueChange' | 'type' | 'size' | 'className' | 'style' | 'placeholder'> & {
|
|
6
|
+
/** Applied to the outer wrapper, with `className`. */
|
|
7
|
+
style?: CSSProperties;
|
|
6
8
|
/** The date as `"YYYY-MM-DD"` (like `<input type="date">`), or `null` for none. */
|
|
7
9
|
value?: string | null;
|
|
8
10
|
/** Starting date when `value` isn't controlled. @default null */
|
|
@@ -34,4 +36,4 @@ export type DateInputProps = Omit<BaseInput.Props, 'value' | 'defaultValue' | 'o
|
|
|
34
36
|
* const [date, setDate] = useState<string | null>(null)
|
|
35
37
|
* <DateInput label="Start date" value={date} onValueChange={setDate} />
|
|
36
38
|
*/
|
|
37
|
-
export declare function DateInput({ value: valueProp, defaultValue, onValueChange, label, size, disabled, id, onBlur, className, ...props }: DateInputProps): import("react").JSX.Element;
|
|
39
|
+
export declare function DateInput({ value: valueProp, defaultValue, onValueChange, label, size, disabled, id, onChange, onBlur, className, style, ref, ...props }: DateInputProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
1
2
|
import { Menu as BaseMenu } from '@base-ui/react/menu';
|
|
2
3
|
import type { MaterialSymbol } from 'material-symbols';
|
|
3
4
|
import { type ComponentColor, type ComponentFillType } from '../../colors/colors';
|
|
@@ -25,6 +26,8 @@ export type FABMenuProps = Omit<BaseMenu.Root.Props, 'children' | 'orientation'>
|
|
|
25
26
|
sticky?: boolean;
|
|
26
27
|
/** Extra classes for the FAB itself. */
|
|
27
28
|
className?: string;
|
|
29
|
+
/** The FAB's `<button>`. */
|
|
30
|
+
ref?: Ref<HTMLButtonElement>;
|
|
28
31
|
/** `FABMenuItem`s, listed top to bottom. */
|
|
29
32
|
children: React.ReactNode;
|
|
30
33
|
};
|
|
@@ -39,7 +42,7 @@ export type FABMenuProps = Omit<BaseMenu.Root.Props, 'children' | 'orientation'>
|
|
|
39
42
|
* <FABMenuItem icon="folder" onClick={newFolder}>Folder</FABMenuItem>
|
|
40
43
|
* </FABMenu>
|
|
41
44
|
*/
|
|
42
|
-
export declare function FABMenu({ icon, closeIcon, 'aria-label': ariaLabel, color, fillType, side, align, sticky, className, children, ...props }: FABMenuProps): import("react").JSX.Element;
|
|
45
|
+
export declare function FABMenu({ icon, closeIcon, 'aria-label': ariaLabel, color, fillType, side, align, sticky, className, ref, children, ...props }: FABMenuProps): import("react").JSX.Element;
|
|
43
46
|
export type FABMenuItemProps = Omit<BaseMenu.Item.Props, 'children'> & {
|
|
44
47
|
/** Material Symbol before the label. */
|
|
45
48
|
icon: MaterialSymbol;
|
|
@@ -9,14 +9,16 @@ export type IconButtonProps = Omit<BaseButtonProps, 'children'> & {
|
|
|
9
9
|
fillType?: ComponentFillType;
|
|
10
10
|
/** Color role from the theme. @default 'primary' */
|
|
11
11
|
color?: ComponentColor;
|
|
12
|
+
/** 32px, 40px or 48px, the same heights as `Button`. @default 'normal' */
|
|
13
|
+
size?: 'small' | 'normal' | 'big';
|
|
12
14
|
/** Required: there is no visible text, so screen readers read this. */
|
|
13
15
|
'aria-label': string;
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
|
-
* A round
|
|
17
|
-
* `size` prop.
|
|
18
|
+
* A round button that shows only an icon.
|
|
18
19
|
*
|
|
19
20
|
* @example
|
|
20
21
|
* <IconButton icon="delete" aria-label="Delete" fillType="text" color="container" />
|
|
22
|
+
* <IconButton icon="add" aria-label="Add" size="big" />
|
|
21
23
|
*/
|
|
22
|
-
export declare function IconButton({ icon, color, fillType, className, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
24
|
+
export declare function IconButton({ icon, color, fillType, size, className, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { Input as BaseInput } from '@base-ui/react/input';
|
|
3
3
|
import './input.css';
|
|
4
|
-
export type InputProps = Omit<BaseInput.Props, 'className' | 'size'> & {
|
|
4
|
+
export type InputProps = Omit<BaseInput.Props, 'className' | 'style' | 'size'> & {
|
|
5
|
+
/** Applied to the outer wrapper, with `className`. */
|
|
6
|
+
style?: CSSProperties;
|
|
5
7
|
/** Floating label. Sits inside the field and moves onto the border once it has focus or a value. */
|
|
6
8
|
label?: ReactNode;
|
|
7
9
|
/**
|
|
@@ -21,4 +23,4 @@ export type InputProps = Omit<BaseInput.Props, 'className' | 'size'> & {
|
|
|
21
23
|
* @example
|
|
22
24
|
* <Input label="Email" type="email" value={email} onValueChange={setEmail} />
|
|
23
25
|
*/
|
|
24
|
-
export declare function Input({ label, size, className, placeholder, ...props }: InputProps): import("react").JSX.Element;
|
|
26
|
+
export declare function Input({ label, size, className, style, placeholder, ...props }: InputProps): import("react").JSX.Element;
|
|
@@ -18,7 +18,7 @@ export type NavigationBarProps = ComponentProps<'nav'>;
|
|
|
18
18
|
* </NavigationBar>
|
|
19
19
|
*/
|
|
20
20
|
export declare function NavigationBar({ className, ...props }: NavigationBarProps): import("react").JSX.Element;
|
|
21
|
-
export type NavigationBarItemProps = useRender.ComponentProps<'a'> & {
|
|
21
|
+
export type NavigationBarItemProps = Omit<useRender.ComponentProps<'a'>, 'children'> & {
|
|
22
22
|
/** Material Symbol to show. */
|
|
23
23
|
icon: MaterialSymbol;
|
|
24
24
|
/** Visible text, also the link's accessible name. */
|
|
@@ -17,7 +17,7 @@ export type NavigationListProps = ComponentProps<'nav'>;
|
|
|
17
17
|
* </NavigationList>
|
|
18
18
|
*/
|
|
19
19
|
export declare function NavigationList({ className, ...props }: NavigationListProps): import("react").JSX.Element;
|
|
20
|
-
export type NavigationListItemProps = useRender.ComponentProps<'a'> & {
|
|
20
|
+
export type NavigationListItemProps = Omit<useRender.ComponentProps<'a'>, 'children'> & {
|
|
21
21
|
/** Visible text, also the link's accessible name. */
|
|
22
22
|
label: string;
|
|
23
23
|
/** The current page. Sets aria-current="page". */
|
|
@@ -31,7 +31,7 @@ export declare function NavigationRail({ expanded: expandedProp, defaultExpanded
|
|
|
31
31
|
export type NavigationRailToggleProps = Omit<IconButtonProps, 'icon'>;
|
|
32
32
|
/** The menu button at the top that expands and collapses the rail. Needs an `aria-label`. */
|
|
33
33
|
export declare function NavigationRailToggle({ className, onClick, ...props }: NavigationRailToggleProps): import("react").JSX.Element;
|
|
34
|
-
export type NavigationRailItemProps = useRender.ComponentProps<'a'> & {
|
|
34
|
+
export type NavigationRailItemProps = Omit<useRender.ComponentProps<'a'>, 'children'> & {
|
|
35
35
|
/** Material Symbol to show. */
|
|
36
36
|
icon: MaterialSymbol;
|
|
37
37
|
/** Visible text, also the link's accessible name. */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
import { OTPField as BaseOTPField } from '@base-ui/react/otp-field';
|
|
3
3
|
import './pin-input.css';
|
|
4
|
-
export type PinInputProps = Omit<BaseOTPField.Root.Props, 'className' | 'children' | 'size'> & {
|
|
4
|
+
export type PinInputProps = Omit<BaseOTPField.Root.Props, 'className' | 'style' | 'children' | 'size'> & {
|
|
5
|
+
/** Applied to the outer wrapper, with `className`. */
|
|
6
|
+
style?: CSSProperties;
|
|
5
7
|
/** `filled` gives each box a tinted background and a bottom line instead of a full border. @default 'outlined' */
|
|
6
8
|
fillType?: 'filled' | 'outlined';
|
|
7
9
|
/** Boxes are 40px tall instead of 56px. @default 'normal' */
|
|
@@ -28,4 +30,4 @@ export type PinInputProps = Omit<BaseOTPField.Root.Props, 'className' | 'childre
|
|
|
28
30
|
* @example
|
|
29
31
|
* <PinInput label="Verification code" length={6} onValueChange={setCode} />
|
|
30
32
|
*/
|
|
31
|
-
export declare function PinInput({ label, 'aria-label': ariaLabel, fillType, size, slotLabel, className, id, length, ...props }: PinInputProps): import("react").JSX.Element;
|
|
33
|
+
export declare function PinInput({ label, 'aria-label': ariaLabel, fillType, size, slotLabel, className, style, id, length, ...props }: PinInputProps): import("react").JSX.Element;
|
|
@@ -7,7 +7,10 @@ export type ProgressProps = BaseProgress.Root.Props & {
|
|
|
7
7
|
* place inside a line of text. @default 'linear'
|
|
8
8
|
*/
|
|
9
9
|
type?: 'linear' | 'circular' | 'inline';
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Draw the filled part of a linear bar as a moving wave. Changing it
|
|
12
|
+
* animates between the wave and the plain bar. @default false
|
|
13
|
+
*/
|
|
11
14
|
squiggly?: boolean;
|
|
12
15
|
} & ({
|
|
13
16
|
/** Visible label above the indicator. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Radio as BaseRadio } from '@base-ui/react/radio';
|
|
2
2
|
import { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group';
|
|
3
3
|
import './radio-group.css';
|
|
4
|
-
export type RadioGroupProps<Value =
|
|
4
|
+
export type RadioGroupProps<Value = unknown> = BaseRadioGroup.Props<Value>;
|
|
5
5
|
/**
|
|
6
6
|
* A group of `Radio`s where exactly one is picked. State: `value` /
|
|
7
7
|
* `defaultValue` / `onValueChange` on the group; each `Radio` has a `value`.
|
|
@@ -13,7 +13,7 @@ export type RadioGroupProps<Value = any> = BaseRadioGroup.Props<Value>;
|
|
|
13
13
|
* <label><Radio value="pro" /> Pro</label>
|
|
14
14
|
* </RadioGroup>
|
|
15
15
|
*/
|
|
16
|
-
export declare function RadioGroup<Value>({ className, ...props }: RadioGroupProps<Value>): import("react").JSX.Element;
|
|
17
|
-
export type RadioProps<Value =
|
|
16
|
+
export declare function RadioGroup<Value>({ className, ref, ...props }: RadioGroupProps<Value>): import("react").JSX.Element;
|
|
17
|
+
export type RadioProps<Value = unknown> = BaseRadio.Root.Props<Value>;
|
|
18
18
|
/** One option in a `RadioGroup`. Needs a `value`. Wrap it in a `<label>` with its text. */
|
|
19
19
|
export declare function Radio<Value>({ className, ...props }: RadioProps<Value>): import("react").JSX.Element;
|