anvilui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +61 -2
  3. package/dist/colors/colors.d.ts +16 -0
  4. package/dist/components/AnvilRoot/AnvilContext.d.ts +14 -0
  5. package/dist/components/AnvilRoot/AnvilRoot.d.ts +18 -0
  6. package/dist/components/AppBar/AppBar.d.ts +34 -0
  7. package/dist/components/Avatar/Avatar.d.ts +23 -0
  8. package/dist/components/Badge/Badge.d.ts +19 -0
  9. package/dist/components/BottomSheet/BottomSheet.d.ts +19 -0
  10. package/dist/components/Button/Button.d.ts +18 -0
  11. package/dist/components/Card/Card.d.ts +21 -0
  12. package/dist/components/Checkbox/Checkbox.d.ts +4 -0
  13. package/dist/components/Chip/Chip.d.ts +23 -0
  14. package/dist/components/Dialog/Dialog.d.ts +24 -0
  15. package/dist/components/Divider/Divider.d.ts +16 -0
  16. package/dist/components/FAB/FAB.d.ts +24 -0
  17. package/dist/components/Field/Field.d.ts +16 -0
  18. package/dist/components/FloatingToolbar/FloatingToolbar.d.ts +22 -0
  19. package/dist/components/HoldButton/HoldButton.d.ts +15 -0
  20. package/dist/components/Icon/Icon.d.ts +7 -0
  21. package/dist/components/IconButton/IconButton.d.ts +11 -0
  22. package/dist/components/Input/Input.d.ts +15 -0
  23. package/dist/components/List/List.d.ts +26 -0
  24. package/dist/components/Menu/Menu.d.ts +22 -0
  25. package/dist/components/NavigationBar/NavigationBar.d.ts +20 -0
  26. package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +30 -0
  27. package/dist/components/NavigationRail/NavigationRail.d.ts +32 -0
  28. package/dist/components/Popover/Popover.d.ts +21 -0
  29. package/dist/components/Progress/Progress.d.ts +22 -0
  30. package/dist/components/RadioGroup/RadioGroup.d.ts +7 -0
  31. package/dist/components/Select/Select.d.ts +25 -0
  32. package/dist/components/Slider/Slider.d.ts +26 -0
  33. package/dist/components/Snackbar/Snackbar.d.ts +30 -0
  34. package/dist/components/SplitButton/SplitButton.d.ts +3 -0
  35. package/dist/components/SquigglyWave/SquigglyWave.d.ts +36 -0
  36. package/dist/components/Switch/Switch.d.ts +4 -0
  37. package/dist/components/Tabs/Tabs.d.ts +15 -0
  38. package/dist/components/Textarea/Textarea.d.ts +16 -0
  39. package/dist/components/ToggleGroup/ToggleGroup.d.ts +38 -0
  40. package/dist/components/Tooltip/Tooltip.d.ts +14 -0
  41. package/dist/components/Typography/Typography.d.ts +10 -0
  42. package/dist/index.cjs +2948 -0
  43. package/dist/index.cjs.map +1 -0
  44. package/dist/index.css +2671 -0
  45. package/dist/index.css.map +1 -0
  46. package/dist/index.d.ts +83 -0
  47. package/dist/index.js +2852 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/morph.d.ts +64 -0
  50. package/dist/themes/baseTheme.d.ts +3 -0
  51. package/dist/themes/monochromeTheme.d.ts +3 -0
  52. package/dist/themes/toCssVariables.d.ts +2 -0
  53. package/dist/themes/types.d.ts +51 -0
  54. package/dist/tokens/baseTokens.d.ts +2 -0
  55. package/dist/tokens/toCssVariables.d.ts +2 -0
  56. package/dist/tokens/types.d.ts +46 -0
  57. package/dist/utils.d.ts +4 -0
  58. package/package.json +45 -5
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 itayvak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,62 @@
1
- # Temporary Holding Version
1
+ # anvilui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React components built on [Base UI](https://base-ui.com).
4
+
5
+ ## Setup
6
+
7
+ ```tsx
8
+ import { AnvilRoot, Button } from 'anvilui'
9
+ import 'anvilui/styles.css'
10
+
11
+ export function App() {
12
+ return (
13
+ <AnvilRoot defaultColorMode="light">
14
+ <Button>Hello</Button>
15
+ </AnvilRoot>
16
+ )
17
+ }
18
+ ```
19
+
20
+ - **Fonts:** the base tokens use Google Sans and Google Sans Code, which the library doesn't load. Add them yourself (e.g. a Google Fonts `<link>`), or pass your own `tokens.font` to `AnvilRoot`.
21
+ - **Icons:** components import `material-symbols/rounded.css`, so your bundler needs to handle CSS and font files from `node_modules` (Vite, Next and webpack setups do by default).
22
+ - Styles only apply inside `AnvilRoot`; nothing outside it is touched.
23
+
24
+ ## Morphing between views
25
+
26
+ `morph(id, update)` grows one element into another while the view changes, like a list row opening into its detail page. Give both elements the same `data-morph-id`. They can be any elements, including your own markup.
27
+
28
+ ```tsx
29
+ import { morph } from 'anvilui'
30
+
31
+ function Albums() {
32
+ const [open, setOpen] = useState<string | null>(null)
33
+
34
+ if (open) {
35
+ return (
36
+ <section data-morph-id={open}>
37
+ <button onClick={() => morph(open, () => setOpen(null))}>
38
+ Back
39
+ </button>
40
+ </section>
41
+ )
42
+ }
43
+ return albums.map((a) => (
44
+ <button
45
+ key={a.id}
46
+ data-morph-id={a.id}
47
+ onClick={() => morph(a.id, () => setOpen(a.id))}
48
+ >
49
+ {a.title}
50
+ </button>
51
+ ))
52
+ }
53
+ ```
54
+
55
+ - The box's size, position, background, corners and shadow animate from one element to the other. Their content crossfades.
56
+ - `update` must change the view synchronously: set React state, or call your router with its sync option (React Router: `navigate(to, { flushSync: true })`). A view that waits on data or a lazy route has nothing to morph into yet.
57
+ - It returns a promise that resolves when the morph ends, e.g. to move focus afterwards: `await morph(id, close); row.focus()`.
58
+ - Pass `{ duration, easing }` as a third argument to override the theme's `easeLength.slow` and `ease.smooth`.
59
+ - Have the elements themselves rather than an id? Use `morphBetween(fromEl, update, () => toEl, options)`. The target is a function because it usually only exists after `update` runs.
60
+ - Without View Transitions support, or with reduced motion on, `update` just runs.
61
+
62
+ `Dialog` and `Popover` take a `morph` prop that does this between the trigger and the popup.
@@ -0,0 +1,16 @@
1
+ /** A color role from the theme. `container` is the neutral one. */
2
+ export type ComponentColor = 'primary' | 'tonal' | 'success' | 'warning' | 'error' | 'container';
3
+ /**
4
+ * - `filled`: solid background in the color
5
+ * - `outlined`: transparent with a border, text in the color
6
+ * - `text`: transparent, no border, text in the color
7
+ */
8
+ export type ComponentFillType = 'filled' | 'outlined' | 'text';
9
+ /** The `color` and `fillType` props shared by colored components. */
10
+ export type ColorProps = {
11
+ /** Color role from the theme. @default 'primary' */
12
+ color?: ComponentColor;
13
+ /** How the color is applied. @default 'filled' */
14
+ fillType?: ComponentFillType;
15
+ };
16
+ export declare function colorClass(color?: ComponentColor, fillType?: ComponentFillType): string;
@@ -0,0 +1,14 @@
1
+ import { Dispatch, RefObject, SetStateAction } from 'react';
2
+ import { Theme } from '../../themes/types';
3
+ import { DesignTokens } from '../../tokens/types';
4
+ export type ColorType = 'light' | 'dark';
5
+ type AnvilContextValues = {
6
+ colorMode: 'light' | 'dark';
7
+ setColorMode: Dispatch<SetStateAction<ColorType>>;
8
+ darkTheme: Theme;
9
+ lightTheme: Theme;
10
+ tokens: DesignTokens;
11
+ rootRef: RefObject<HTMLDivElement | null>;
12
+ };
13
+ export declare const AnvilContext: import("react").Context<AnvilContextValues | null>;
14
+ export {};
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { ColorType } from './AnvilContext';
3
+ import { Theme } from '../../themes/types';
4
+ import { DesignTokens } from '../../tokens/types';
5
+ import '../../colors/colors.css';
6
+ import './global.css';
7
+ export type AnvilRootProps = {
8
+ children: ReactNode;
9
+ /** Controlled color mode. Pair with `onColorModeChange`. */
10
+ colorMode?: ColorType;
11
+ /** Starting color mode when `colorMode` isn't controlled. */
12
+ defaultColorMode?: ColorType;
13
+ onColorModeChange?: (colorMode: ColorType) => void;
14
+ lightTheme?: Theme;
15
+ darkTheme?: Theme;
16
+ tokens?: DesignTokens;
17
+ };
18
+ export declare function AnvilRoot(props: AnvilRootProps): import("react").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import type { ComponentColor, ComponentFillType } from '../../colors/colors';
3
+ import { type TypographyTag } from '../Typography/Typography';
4
+ import './app-bar.css';
5
+ export type AppBarProps = ComponentProps<'header'> & {
6
+ /** The page or screen title. */
7
+ label: ReactNode;
8
+ /**
9
+ * HTML tag for the title. A div by default; use `'h1'` when the bar's
10
+ * title is the page's main heading. @default 'div'
11
+ */
12
+ labelAs?: TypographyTag;
13
+ /** Before the title, usually a navigation `IconButton` (menu or back). */
14
+ start?: ReactNode;
15
+ /** After the title, usually a few action `IconButton`s. */
16
+ end?: ReactNode;
17
+ /** `big` puts the title on its own, larger row below the buttons. @default 'normal' */
18
+ size?: 'normal' | 'big';
19
+ /** Center the title. Only for `size="normal"`. @default false */
20
+ centered?: boolean;
21
+ /**
22
+ * Color role from the theme. The default `container` gives the bar the
23
+ * navigation color (the theme's `containerLow`), so it matches a
24
+ * NavigationRail or NavigationDrawer beside it. @default 'container'
25
+ */
26
+ color?: ComponentColor;
27
+ /**
28
+ * `filled` gives the bar a solid background. `text` makes it colorless,
29
+ * the same color as the page. @default 'filled'
30
+ */
31
+ fillType?: ComponentFillType;
32
+ };
33
+ /** The bar across the top of a page or screen: title, navigation and actions. */
34
+ export declare function AppBar({ label, labelAs, start, end, size, centered, color, fillType, className, ...props }: AppBarProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { Avatar as BaseAvatar } from '@base-ui/react/avatar';
2
+ import type { MaterialSymbol } from 'material-symbols';
3
+ import { type ColorProps } from '../../colors/colors';
4
+ import './avatar.css';
5
+ export type AvatarProps = BaseAvatar.Root.Props & ColorProps & {
6
+ /** Image URL. While it loads, or if it fails, the fallback shows. */
7
+ src?: string;
8
+ /**
9
+ * The person's (or thing's) name. Read by screen readers, and its
10
+ * initials are the fallback: "Ada Lovelace" shows "AL". Leave it out
11
+ * when the name is already shown next to the avatar.
12
+ */
13
+ name?: string;
14
+ /** Fallback icon when there's no `name`. @default 'person' */
15
+ icon?: MaterialSymbol;
16
+ /** 32px, 40px or 56px. @default 'normal' */
17
+ size?: 'small' | 'normal' | 'big';
18
+ };
19
+ /**
20
+ * A picture, initials or an icon that stands for a person or thing.
21
+ * `children` replaces the initials/icon fallback.
22
+ */
23
+ export declare function Avatar({ src, name, icon, size, color, fillType, className, children, ...props }: AvatarProps): import("react").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { type ComponentColor } from '../../colors/colors';
3
+ import './badge.css';
4
+ export type BadgeProps = ComponentProps<'span'> & {
5
+ /** Number to show. Leave out for a small dot; `0` hides the badge. */
6
+ count?: number;
7
+ /** Higher counts show as "999+". @default 999 */
8
+ max?: number;
9
+ /** Color role from the theme. @default 'error' */
10
+ color?: ComponentColor;
11
+ };
12
+ /**
13
+ * A dot or count on the corner of what it wraps (an `Icon`, `IconButton`,
14
+ * `Avatar`, ...), or inline on its own when it wraps nothing.
15
+ *
16
+ * It's hidden from screen readers: put the count in the wrapped element's
17
+ * name too, e.g. `aria-label="Inbox, 3 unread"`.
18
+ */
19
+ export declare function Badge({ count, max, color, className, children, ...props }: BadgeProps): import("react").JSX.Element | null;
@@ -0,0 +1,19 @@
1
+ import { Drawer } from '@base-ui/react/drawer';
2
+ import './bottom-sheet.css';
3
+ /**
4
+ * A panel that slides up from the bottom; swipe it down or tap outside to
5
+ * close. Holds the open state (`open` / `defaultOpen` / `onOpenChange`).
6
+ * Pass `snapPoints` (e.g. `[0.5, 1]`) for a sheet that can stop part way.
7
+ */
8
+ export type BottomSheetProps = Omit<Drawer.Root.Props, 'swipeDirection'>;
9
+ export declare function BottomSheet(props: BottomSheetProps): import("react").JSX.Element;
10
+ export type BottomSheetTriggerProps = Drawer.Trigger.Props;
11
+ export declare function BottomSheetTrigger({ className, ...props }: BottomSheetTriggerProps): import("react").JSX.Element;
12
+ export type BottomSheetPopupProps = Drawer.Popup.Props;
13
+ export declare function BottomSheetPopup({ className, children, ...props }: BottomSheetPopupProps): import("react").JSX.Element;
14
+ export type BottomSheetTitleProps = Drawer.Title.Props;
15
+ export declare function BottomSheetTitle({ className, ...props }: BottomSheetTitleProps): import("react").JSX.Element;
16
+ export type BottomSheetDescriptionProps = Drawer.Description.Props;
17
+ export declare function BottomSheetDescription({ className, ...props }: BottomSheetDescriptionProps): import("react").JSX.Element;
18
+ export type BottomSheetCloseProps = Drawer.Close.Props;
19
+ export declare function BottomSheetClose({ className, ...props }: BottomSheetCloseProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { ButtonProps as BaseButtonProps } from '@base-ui/react/button';
2
+ import type { MaterialSymbol } from 'material-symbols';
3
+ import { ComponentColor, ComponentFillType } from '../../colors/colors';
4
+ import './button.css';
5
+ export type ButtonProps = BaseButtonProps & {
6
+ size?: 'small' | 'normal' | 'big';
7
+ fillType?: ComponentFillType;
8
+ color?: ComponentColor;
9
+ startIcon?: MaterialSymbol;
10
+ endIcon?: MaterialSymbol;
11
+ /**
12
+ * Shows a spinner in place of `startIcon` and ignores clicks. Pass the
13
+ * text to show meanwhile as children (`{saving ? 'Saving' : 'Save'}`);
14
+ * the button animates between the two widths. @default false
15
+ */
16
+ loading?: boolean;
17
+ };
18
+ export declare function Button({ size, fillType, color, startIcon, endIcon, loading, disabled, children, className, ref, ...props }: ButtonProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { ButtonProps as BaseButtonProps } from '@base-ui/react/button';
2
+ import { ComponentColor, ComponentFillType } from '../../colors/colors';
3
+ import { TypographyProps } from '../Typography/Typography';
4
+ import './card.css';
5
+ type CardStyleProps = {
6
+ fillType?: ComponentFillType;
7
+ color?: ComponentColor;
8
+ };
9
+ export type CardProps = (Omit<React.ComponentProps<'div'>, 'color'> & CardStyleProps & {
10
+ clickable?: false;
11
+ }) | (Omit<BaseButtonProps, 'color'> & CardStyleProps & {
12
+ clickable: true;
13
+ });
14
+ export declare function Card(props: CardProps): import("react").JSX.Element;
15
+ export type CardTitleProps = TypographyProps;
16
+ export declare function CardTitle({ type, as, className, ...props }: CardTitleProps): import("react").JSX.Element;
17
+ export type CardContentProps = React.ComponentProps<'div'>;
18
+ export declare function CardContent({ className, ...props }: CardContentProps): import("react").JSX.Element;
19
+ export type CardActionsProps = React.ComponentProps<'div'>;
20
+ export declare function CardActions({ className, ...props }: CardActionsProps): import("react").JSX.Element;
21
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox';
2
+ import './checkbox.css';
3
+ export type CheckboxProps = BaseCheckbox.Root.Props;
4
+ export declare function Checkbox({ className, ...props }: CheckboxProps): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import type { ComponentProps } from 'react';
2
+ import { type ButtonProps as BaseButtonProps } from '@base-ui/react/button';
3
+ import { Toggle } from '@base-ui/react/toggle';
4
+ import type { MaterialSymbol } from 'material-symbols';
5
+ import './chip.css';
6
+ export type ChipProps = BaseButtonProps & {
7
+ /** Material Symbol before the label. */
8
+ startIcon?: MaterialSymbol;
9
+ };
10
+ export declare function Chip({ startIcon, className, children, ...props }: ChipProps): import("react").JSX.Element;
11
+ export type FilterChipProps = Toggle.Props;
12
+ export declare function FilterChip({ className, children, ...props }: FilterChipProps): import("react").JSX.Element;
13
+ export type InputChipProps = ComponentProps<'span'> & {
14
+ /** Called when the remove (×) button is clicked. */
15
+ onRemove: () => void;
16
+ /** Accessible name of the remove button, e.g. "Remove Alice". @default 'Remove' */
17
+ removeLabel?: string;
18
+ /** Material Symbol before the label. */
19
+ startIcon?: MaterialSymbol;
20
+ /** Disables the remove button and dims the chip. */
21
+ disabled?: boolean;
22
+ };
23
+ export declare function InputChip({ onRemove, removeLabel, startIcon, disabled, className, children, ...props }: InputChipProps): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { type ComponentProps } from 'react';
2
+ import { Dialog as BaseDialog } from '@base-ui/react/dialog';
3
+ import './dialog.css';
4
+ export type DialogProps = BaseDialog.Root.Props & {
5
+ /**
6
+ * Grow the dialog out of its trigger, and shrink it back into it on
7
+ * close (Material's container transform). Works best when the trigger
8
+ * is a surface, like a clickable `Card`. @default false
9
+ */
10
+ morph?: boolean;
11
+ };
12
+ export declare function Dialog({ morph, defaultOpen, ...props }: DialogProps): import("react").JSX.Element;
13
+ export type DialogTriggerProps = BaseDialog.Trigger.Props;
14
+ export declare function DialogTrigger({ className, ref, ...props }: DialogTriggerProps): import("react").JSX.Element;
15
+ export type DialogPopupProps = BaseDialog.Popup.Props;
16
+ export declare function DialogPopup({ className, ref, ...props }: DialogPopupProps): import("react").JSX.Element;
17
+ export type DialogTitleProps = BaseDialog.Title.Props;
18
+ export declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react").JSX.Element;
19
+ export type DialogDescriptionProps = BaseDialog.Description.Props;
20
+ export declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react").JSX.Element;
21
+ export type DialogActionsProps = ComponentProps<'div'>;
22
+ export declare function DialogActions({ className, ...props }: DialogActionsProps): import("react").JSX.Element;
23
+ export type DialogCloseProps = BaseDialog.Close.Props;
24
+ export declare function DialogClose({ className, ...props }: DialogCloseProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { type ReactNode } from 'react';
2
+ import { Separator } from '@base-ui/react/separator';
3
+ import './divider.css';
4
+ /**
5
+ * A thin line between groups of content. `orientation="vertical"` stretches
6
+ * to the height of its row, so put it in a flex row.
7
+ */
8
+ export type DividerProps = Separator.Props & {
9
+ /** Text in the middle of the line, with the line on both sides. */
10
+ label?: ReactNode;
11
+ /**
12
+ * Draw the line as a wave, like squiggly Progress. @default false
13
+ */
14
+ squiggly?: boolean;
15
+ };
16
+ export declare function Divider({ label, squiggly, className, ...props }: DividerProps): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { type ButtonProps as BaseButtonProps } from '@base-ui/react/button';
2
+ import type { MaterialSymbol } from 'material-symbols';
3
+ import { type ColorProps } from '../../colors/colors';
4
+ import './fab.css';
5
+ export type FABProps = Omit<BaseButtonProps, 'children'> & ColorProps & {
6
+ /** Material Symbol to show. */
7
+ icon: MaterialSymbol;
8
+ /** 40px, 56px or 96px tall. @default 'normal' */
9
+ size?: 'small' | 'normal' | 'big';
10
+ /** Stick to a mouse cursor that comes close. @default true */
11
+ sticky?: boolean;
12
+ } & ({
13
+ /** Visible text next to the icon: makes it an extended FAB. */
14
+ label: string;
15
+ 'aria-label'?: string;
16
+ } | {
17
+ label?: never;
18
+ 'aria-label': string;
19
+ });
20
+ /**
21
+ * The floating action button: the screen's main action. Place it yourself,
22
+ * usually `position: fixed` in the bottom-end corner.
23
+ */
24
+ export declare function FAB({ icon, label, size, sticky, color, fillType, className, ref, ...props }: FABProps): import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { Field as BaseField } from '@base-ui/react/field';
2
+ import './field.css';
3
+ /**
4
+ * Wraps one control (`Input`, `Textarea`, `Select`, ...) to add helper text,
5
+ * an error message and validation. Takes `name`, `validate`, `invalid`,
6
+ * `disabled` and `validationMode`.
7
+ *
8
+ * Validation runs on form submit by default. Outside a `<form>`, or to check
9
+ * earlier, set `validationMode="onBlur"` or `"onChange"`.
10
+ */
11
+ export type FieldProps = BaseField.Root.Props;
12
+ export declare function Field({ className, ...props }: FieldProps): import("react").JSX.Element;
13
+ export type FieldDescriptionProps = BaseField.Description.Props;
14
+ export declare function FieldDescription({ className, ...props }: FieldDescriptionProps): import("react").JSX.Element;
15
+ export type FieldErrorProps = BaseField.Error.Props;
16
+ export declare function FieldError({ className, ...props }: FieldErrorProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { Toolbar as BaseToolbar } from '@base-ui/react/toolbar';
2
+ import { type IconButtonProps } from '../IconButton/IconButton';
3
+ import '../Divider/divider.css';
4
+ import './floating-toolbar.css';
5
+ /**
6
+ * A floating pill of icon buttons. Arrow keys move between them; Tab enters
7
+ * and leaves as one stop. Give it an `aria-label`, and place it yourself,
8
+ * e.g. `position: fixed` at the bottom center.
9
+ */
10
+ export type FloatingToolbarProps = BaseToolbar.Root.Props & {
11
+ /** Use the theme's inverse colors, so it stands out over busy content. @default false */
12
+ inverseColor?: boolean;
13
+ };
14
+ export declare function FloatingToolbar({ inverseColor, className, ...props }: FloatingToolbarProps): import("react").JSX.Element;
15
+ /**
16
+ * An `IconButton` that joins the toolbar's arrow-key navigation. Text style
17
+ * by default; `fillType="filled"` makes it the wider, highlighted one.
18
+ */
19
+ export type FloatingToolbarButtonProps = IconButtonProps;
20
+ export declare function FloatingToolbarButton({ fillType, color, disabled, ...props }: FloatingToolbarButtonProps): import("react").JSX.Element;
21
+ export type FloatingToolbarSeparatorProps = BaseToolbar.Separator.Props;
22
+ export declare function FloatingToolbarSeparator({ className, ...props }: FloatingToolbarSeparatorProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { type ButtonProps } from '../Button/Button';
2
+ import './hold-button.css';
3
+ export type HoldButtonProps = Omit<ButtonProps, 'loading'> & {
4
+ /** Called once the button has been held down for `holdDuration`. */
5
+ onConfirm: () => void;
6
+ /** How long to hold, in milliseconds. @default 1500 */
7
+ holdDuration?: number;
8
+ };
9
+ /**
10
+ * A button for destructive actions: press and hold until the fill sweeps
11
+ * across, instead of a confirm dialog. Letting go early cancels. Works with
12
+ * Space and Enter too; a screen reader's click, which can't be held,
13
+ * confirms straight away.
14
+ */
15
+ export declare function HoldButton({ onConfirm, holdDuration, className, style, disabled, onPointerDown, onPointerUp, onPointerLeave, onPointerCancel, onKeyDown, onKeyUp, onClick, onContextMenu, ...props }: HoldButtonProps): import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { MaterialSymbol } from 'material-symbols';
2
+ import 'material-symbols/rounded.css';
3
+ import './icon.css';
4
+ export type IconProps = Omit<React.ComponentProps<'span'>, 'children'> & {
5
+ name: MaterialSymbol;
6
+ };
7
+ export declare function Icon({ name, ...props }: IconProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { ButtonProps as BaseButtonProps } from '@base-ui/react/button';
2
+ import type { MaterialSymbol } from 'material-symbols';
3
+ import { ComponentColor, ComponentFillType } from '../../colors/colors';
4
+ import './icon-button.css';
5
+ export type IconButtonProps = Omit<BaseButtonProps, 'children'> & {
6
+ icon: MaterialSymbol;
7
+ fillType?: ComponentFillType;
8
+ color?: ComponentColor;
9
+ 'aria-label': string;
10
+ };
11
+ export declare function IconButton({ icon, color, fillType, className, ...props }: IconButtonProps): import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from 'react';
2
+ import { Input as BaseInput } from '@base-ui/react/input';
3
+ import './input.css';
4
+ export type InputProps = Omit<BaseInput.Props, 'className' | 'size'> & {
5
+ /** Floating label. Sits inside the field and moves onto the border once it has focus or a value. */
6
+ label?: ReactNode;
7
+ /**
8
+ * `small` is shorter, and its label works like a placeholder: it hides
9
+ * once there's text instead of moving onto the border. @default 'normal'
10
+ */
11
+ size?: 'small' | 'normal';
12
+ /** Applied to the outer wrapper, so width and margins work as expected. */
13
+ className?: string;
14
+ };
15
+ export declare function Input({ label, size, className, placeholder, ...props }: InputProps): import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import type { ComponentProps, ReactNode } from 'react';
2
+ import { useRender } from '@base-ui/react/use-render';
3
+ import './list.css';
4
+ export type ListProps = ComponentProps<'ul'> & {
5
+ /** Thin lines between the items. @default false */
6
+ divided?: boolean;
7
+ };
8
+ /** A column of `ListItem`s. */
9
+ export declare function List({ divided, className, ...props }: ListProps): import("react").JSX.Element;
10
+ /**
11
+ * One row. Static by default; pass `render` to make the whole row
12
+ * interactive: `render={<a href="/settings" />}` for a link, or
13
+ * `render={<label />}` so clicking anywhere toggles a Switch or Checkbox
14
+ * in `start` or `end`.
15
+ */
16
+ export type ListItemProps = Omit<useRender.ComponentProps<'div'>, 'children'> & {
17
+ /** The main text. */
18
+ label: ReactNode;
19
+ /** Supporting text under the label, up to two lines. */
20
+ description?: ReactNode;
21
+ /** Before the text: an `Icon`, `Avatar`, `Checkbox`, ... */
22
+ start?: ReactNode;
23
+ /** After the text: a `Switch`, `Badge`, short text, an `Icon`, ... */
24
+ end?: ReactNode;
25
+ };
26
+ export declare function ListItem({ label, description, start, end, render, className, ...props }: ListItemProps): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { Menu as BaseMenu } from '@base-ui/react/menu';
2
+ import type { MaterialSymbol } from 'material-symbols';
3
+ import './menu.css';
4
+ export type MenuProps = BaseMenu.Root.Props;
5
+ export declare function Menu(props: MenuProps): import("react").JSX.Element;
6
+ export type MenuTriggerProps = BaseMenu.Trigger.Props;
7
+ export declare function MenuTrigger({ className, ...props }: MenuTriggerProps): import("react").JSX.Element;
8
+ export type MenuPopupProps = BaseMenu.Popup.Props & Pick<BaseMenu.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset'>;
9
+ export declare function MenuPopup({ side, align, sideOffset, alignOffset, className, ...props }: MenuPopupProps): import("react").JSX.Element;
10
+ export type MenuSubmenuProps = BaseMenu.SubmenuRoot.Props;
11
+ export declare function MenuSubmenu(props: MenuSubmenuProps): import("react").JSX.Element;
12
+ export type MenuSubmenuTriggerProps = BaseMenu.SubmenuTrigger.Props & {
13
+ startIcon?: MaterialSymbol;
14
+ };
15
+ export declare function MenuSubmenuTrigger({ startIcon, className, children, ...props }: MenuSubmenuTriggerProps): import("react").JSX.Element;
16
+ export type MenuGroupProps = BaseMenu.Group.Props;
17
+ export declare function MenuGroup({ className, ...props }: MenuGroupProps): import("react").JSX.Element;
18
+ export type MenuItemProps = BaseMenu.Item.Props & {
19
+ startIcon?: MaterialSymbol;
20
+ endIcon?: MaterialSymbol;
21
+ };
22
+ export declare function MenuItem({ startIcon, endIcon, className, children, ...props }: MenuItemProps): import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import type { ComponentProps } from 'react';
2
+ import type { MaterialSymbol } from 'material-symbols';
3
+ import { useRender } from '@base-ui/react/use-render';
4
+ import './navigation-bar.css';
5
+ /**
6
+ * Bottom navigation between an app's top-level pages, for small screens.
7
+ * Fill it with 3–5 `NavigationBarItem`s and give it an `aria-label` (e.g.
8
+ * "Main"). Place it yourself, e.g. `position: sticky; bottom: 0`.
9
+ */
10
+ export type NavigationBarProps = ComponentProps<'nav'>;
11
+ export declare function NavigationBar({ className, ...props }: NavigationBarProps): import("react").JSX.Element;
12
+ export type NavigationBarItemProps = useRender.ComponentProps<'a'> & {
13
+ /** Material Symbol to show. */
14
+ icon: MaterialSymbol;
15
+ /** Visible text, also the link's accessible name. */
16
+ label: string;
17
+ /** The current page. Sets aria-current="page". */
18
+ active?: boolean;
19
+ };
20
+ export declare function NavigationBarItem({ icon, label, active, render, className, ...props }: NavigationBarItemProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -0,0 +1,30 @@
1
+ import { type ReactNode } from 'react';
2
+ import { Drawer } from '@base-ui/react/drawer';
3
+ import type { MaterialSymbol } from 'material-symbols';
4
+ import './navigation-drawer.css';
5
+ /**
6
+ * Side navigation that slides in over the page, for small screens. Swipe it
7
+ * back or tap outside to close. Holds the open state (`open` /
8
+ * `defaultOpen` / `onOpenChange`).
9
+ */
10
+ export type NavigationDrawerProps = Omit<Drawer.Root.Props, 'swipeDirection'>;
11
+ export declare function NavigationDrawer(props: NavigationDrawerProps): import("react").JSX.Element;
12
+ export type NavigationDrawerTriggerProps = Drawer.Trigger.Props;
13
+ export declare function NavigationDrawerTrigger({ className, ...props }: NavigationDrawerTriggerProps): import("react").JSX.Element;
14
+ export type NavigationDrawerPopupProps = Drawer.Popup.Props;
15
+ export declare function NavigationDrawerPopup({ className, ...props }: NavigationDrawerPopupProps): import("react").JSX.Element;
16
+ export type NavigationDrawerTitleProps = Drawer.Title.Props;
17
+ export declare function NavigationDrawerTitle({ className, ...props }: NavigationDrawerTitleProps): import("react").JSX.Element;
18
+ export type NavigationDrawerItemProps = Omit<Drawer.Close.Props, 'children'> & {
19
+ /** Material Symbol to show. */
20
+ icon: MaterialSymbol;
21
+ /** Visible text, also the link's accessible name. */
22
+ label: string;
23
+ /** The current page. Sets aria-current="page". */
24
+ active?: boolean;
25
+ /** After the label, e.g. an unread count. */
26
+ end?: ReactNode;
27
+ /** Where the default link goes. Not needed with a router `render`. */
28
+ href?: string;
29
+ };
30
+ export declare function NavigationDrawerItem({ icon, label, active, end, href, render, className, ...props }: NavigationDrawerItemProps): import("react").JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { MaterialSymbol } from 'material-symbols';
3
+ import { useRender } from '@base-ui/react/use-render';
4
+ import './navigation-rail.css';
5
+ export type NavigationRailProps = React.ComponentProps<'nav'> & {
6
+ /** Shows a button that toggles between the collapsed and expanded layouts. */
7
+ hasExpandButton?: boolean;
8
+ /** Controlled expanded state. Pair with `onExpandedChange`. */
9
+ expanded?: boolean;
10
+ /** Starting state when `expanded` isn't controlled. */
11
+ defaultExpanded?: boolean;
12
+ onExpandedChange?: (expanded: boolean) => void;
13
+ };
14
+ /**
15
+ * Side navigation between an app's top-level pages. Fill it with
16
+ * `NavigationRailItem`s and give it an `aria-label` (e.g. "Main").
17
+ */
18
+ export declare function NavigationRail({ hasExpandButton, expanded: expandedProp, defaultExpanded, onExpandedChange, children, className, ref, ...props }: NavigationRailProps): import("react").JSX.Element;
19
+ export type NavigationRailItemProps = useRender.ComponentProps<'a'> & {
20
+ /** Material Symbol to show. */
21
+ icon: MaterialSymbol;
22
+ /** Visible text, also the link's accessible name. */
23
+ label: string;
24
+ /** The current page. Sets aria-current="page". */
25
+ active?: boolean;
26
+ /**
27
+ * Short content after the label, like an unread count. Shown as a badge
28
+ * on the icon while the rail is collapsed, so keep it to a few characters.
29
+ */
30
+ end?: ReactNode;
31
+ };
32
+ export declare function NavigationRailItem({ icon, label, active, end, render, className, ...props }: NavigationRailItemProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -0,0 +1,21 @@
1
+ import { Popover as BasePopover } from '@base-ui/react/popover';
2
+ import '../Menu/menu.css';
3
+ import './popover.css';
4
+ export type PopoverProps = BasePopover.Root.Props & {
5
+ /**
6
+ * Grow the popover out of its trigger, and shrink it back into it on
7
+ * close, like an avatar opening into a profile card. @default false
8
+ */
9
+ morph?: boolean;
10
+ };
11
+ export declare function Popover({ morph, defaultOpen, ...props }: PopoverProps): import("react").JSX.Element;
12
+ export type PopoverTriggerProps = BasePopover.Trigger.Props;
13
+ export declare function PopoverTrigger({ className, ref, ...props }: PopoverTriggerProps): import("react").JSX.Element;
14
+ export type PopoverPopupProps = BasePopover.Popup.Props & Pick<BasePopover.Positioner.Props, 'side' | 'align' | 'sideOffset' | 'alignOffset'>;
15
+ export declare function PopoverPopup({ side, align, sideOffset, alignOffset, className, ref, ...props }: PopoverPopupProps): import("react").JSX.Element;
16
+ export type PopoverTitleProps = BasePopover.Title.Props;
17
+ export declare function PopoverTitle({ className, ...props }: PopoverTitleProps): import("react").JSX.Element;
18
+ export type PopoverDescriptionProps = BasePopover.Description.Props;
19
+ export declare function PopoverDescription({ className, ...props }: PopoverDescriptionProps): import("react").JSX.Element;
20
+ export type PopoverCloseProps = BasePopover.Close.Props;
21
+ export declare function PopoverClose({ className, ...props }: PopoverCloseProps): import("react").JSX.Element;