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/docs/theming.md
CHANGED
|
@@ -37,7 +37,7 @@ import type {
|
|
|
37
37
|
| `darkTheme` | `Theme` | `baseDarkTheme` | Colors in dark mode. |
|
|
38
38
|
| `tokens` | `Partial<DesignTokens>` | `baseDesignTokens` | Spacing, radius, fonts, motion, shadows. Each category you pass **replaces** the whole default category. |
|
|
39
39
|
|
|
40
|
-
AnvilRoot renders a `<div
|
|
40
|
+
AnvilRoot renders a `<div>`, and other `<div>` props (`style`, `id`, `ref`, `data-*`, ...) go on it. There is no `theme` prop: use `lightTheme` / `darkTheme`.
|
|
41
41
|
|
|
42
42
|
## Color mode
|
|
43
43
|
|
|
@@ -100,8 +100,9 @@ export function App() {
|
|
|
100
100
|
|
|
101
101
|
- `createTheme(primaryHex, { tonal?: hex })` returns `{ light: Theme, dark: Theme }`. Hex only (`'#0B6E4F'` or `'#0B6'`); other formats throw.
|
|
102
102
|
- `createThemeFromImage(img | File | Blob | url)` returns `Promise<ThemePair>`, browser only. URLs must allow CORS.
|
|
103
|
-
- Error, warning and success colors stay the same.
|
|
103
|
+
- Each role keeps the lightness of the base theme, so text stays readable; only hue and colorfulness change. Error, warning and success colors stay the same.
|
|
104
104
|
- Tweak one role by spreading: `{ ...brand.light, primary: '#…' }`.
|
|
105
|
+
- To switch themes at runtime, keep them in state and pass them as `lightTheme` / `darkTheme`.
|
|
105
106
|
- Ready-made: `baseLightTheme` / `baseDarkTheme` (purple, the default), `monochromeLightTheme` / `monochromeDarkTheme`.
|
|
106
107
|
|
|
107
108
|
## Theme roles
|
package/docs/time-picker.md
CHANGED
|
@@ -10,15 +10,16 @@ import type { TimePickerProps } from 'anvilui'
|
|
|
10
10
|
| Prop | Type | Default | Description |
|
|
11
11
|
| --- | --- | --- | --- |
|
|
12
12
|
| `value` / `defaultValue` | `string \| null` | `null` | `"HH:mm"`, e.g. `"07:30"`, `"19:05"`. |
|
|
13
|
-
| `onValueChange` | `(value: string) => void` | | On every change.
|
|
13
|
+
| `onValueChange` | `(value: string \| null) => void` | | On every change. `null` when the user clears it with the picker's Clear button. |
|
|
14
14
|
| `type` | `'dial' \| 'input'` | `'dial'` | |
|
|
15
15
|
| `hourCycle` | `12 \| 24` | user's locale | 12 shows AM/PM. |
|
|
16
16
|
| `label` | `ReactNode` | | Either this or `aria-label`. |
|
|
17
|
-
| `name` | `string` | | Submits `"HH:mm"` with a form. |
|
|
17
|
+
| `name` | `string` | | Submits `"HH:mm"` with a form. Put it on TimePicker itself: it doesn't work inside a `Field`. |
|
|
18
18
|
| `size` | `'small' \| 'normal'` | `'normal'` | |
|
|
19
19
|
| `disabled` | `boolean` | `false` | |
|
|
20
20
|
| `open` / `defaultOpen` / `onOpenChange` | | | The popup. |
|
|
21
|
-
| `
|
|
21
|
+
| `ref`, `id`, `aria-*`, `data-*` | | | On the field's button. |
|
|
22
|
+
| `className`, `style`, other `<div>` props | | | On the wrapper. |
|
|
22
23
|
|
|
23
24
|
```tsx
|
|
24
25
|
import { useState } from 'react'
|
package/docs/toggle-group.md
CHANGED
|
@@ -20,7 +20,7 @@ import type { ToggleGroupProps, ToggleGroupItemProps } from 'anvilui'
|
|
|
20
20
|
| `disabled` | `boolean` | | |
|
|
21
21
|
| `aria-label` / `aria-labelledby` | `string` | | Name the group (both are passed through). |
|
|
22
22
|
|
|
23
|
-
Single mode is a Base UI RadioGroup; multiple mode is a Base UI ToggleGroup. `Value` is inferred from `value`, so a union-typed `useState<'list' | 'grid'>` setter can be passed straight to `onValueChange`.
|
|
23
|
+
Single mode is a Base UI RadioGroup; multiple mode is a Base UI ToggleGroup. `Value` is inferred from `value`, so a union-typed `useState<'list' | 'grid'>` setter can be passed straight to `onValueChange`. With no `value` / `defaultValue`, or in a wrapper typed with `ToggleGroupProps`, it's `unknown`: write `ToggleGroupProps<'list' | 'grid'>`.
|
|
24
24
|
|
|
25
25
|
## ToggleGroupItem props
|
|
26
26
|
|
package/docs/toggle.md
CHANGED
|
@@ -17,8 +17,8 @@ import type { ToggleProps } from 'anvilui'
|
|
|
17
17
|
| `fillType` | `'filled' \| 'outlined' \| 'text'` | `'filled'` | Look while off. |
|
|
18
18
|
| `children` | `ReactNode` | | Label (text toggle). |
|
|
19
19
|
| `startIcon`, `endIcon` | `MaterialSymbol` | | Text toggle only. |
|
|
20
|
-
| `size` | `'small' \| 'normal' \| 'big'` | `'normal'` |
|
|
21
|
-
| `icon` | `MaterialSymbol` | | Makes it a round icon toggle. Requires `aria-label`; no children
|
|
20
|
+
| `size` | `'small' \| 'normal' \| 'big'` | `'normal'` | 32, 40 or 48px, for text and icon toggles. |
|
|
21
|
+
| `icon` | `MaterialSymbol` | | Makes it a round icon toggle. Requires `aria-label`; no children. |
|
|
22
22
|
| `value` | `string` | | Identifies it in a Base UI ToggleGroup. |
|
|
23
23
|
|
|
24
24
|
Either `children` or `icon` + `aria-label`, not both.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anvilui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Material 3
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Material 3 Expressive for React, pushed further: playful, accessible components built on Base UI. Ships agent docs in AGENTS.md and docs/.",
|
|
5
5
|
"author": "itayvak",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|