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
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/colors/colors.ts","../src/utils.ts","../src/components/Typography/Typography.tsx","../src/components/AppBar/AppBar.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Icon/Icon.tsx","../src/components/Badge/Badge.tsx","../src/components/BottomSheet/BottomSheet.tsx","../src/components/AnvilRoot/AnvilContext.ts","../src/components/Button/Button.tsx","../src/components/SplitButton/SplitButton.tsx","../src/components/HoldButton/HoldButton.tsx","../src/components/Card/Card.tsx","../src/components/Chip/Chip.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Dialog/Dialog.tsx","../src/morph.ts","../src/components/Divider/Divider.tsx","../src/components/SquigglyWave/SquigglyWave.tsx","../src/components/FAB/FAB.tsx","../src/components/Field/Field.tsx","../src/components/IconButton/IconButton.tsx","../src/components/Input/Input.tsx","../src/components/List/List.tsx","../src/components/Menu/Menu.tsx","../src/components/Popover/Popover.tsx","../src/components/Progress/Progress.tsx","../src/components/ToggleGroup/ToggleGroup.tsx","../src/components/RadioGroup/RadioGroup.tsx","../src/components/Select/Select.tsx","../src/components/Slider/Slider.tsx","../src/components/Snackbar/Snackbar.tsx","../src/components/Switch/Switch.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Textarea/Textarea.tsx","../src/components/FloatingToolbar/FloatingToolbar.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/NavigationBar/NavigationBar.tsx","../src/components/NavigationDrawer/NavigationDrawer.tsx","../src/components/NavigationRail/NavigationRail.tsx","../src/tokens/baseTokens.ts","../src/themes/baseTheme.ts","../src/themes/monochromeTheme.ts","../src/components/AnvilRoot/AnvilRoot.tsx","../src/themes/toCssVariables.ts","../src/tokens/toCssVariables.ts"],"sourcesContent":["/** A color role from the theme. `container` is the neutral one. */\nexport type ComponentColor =\n 'primary' | 'tonal' | 'success' | 'warning' | 'error' | 'container'\n\n/**\n * - `filled`: solid background in the color\n * - `outlined`: transparent with a border, text in the color\n * - `text`: transparent, no border, text in the color\n */\nexport type ComponentFillType = 'filled' | 'outlined' | 'text'\n\n/** The `color` and `fillType` props shared by colored components. */\nexport type ColorProps = {\n /** Color role from the theme. @default 'primary' */\n color?: ComponentColor\n /** How the color is applied. @default 'filled' */\n fillType?: ComponentFillType\n}\n\nexport function colorClass(\n color: ComponentColor = 'primary',\n fillType: ComponentFillType = 'filled'\n) {\n return `avl-color-${color} avl-fill-${fillType} `\n}\n","import type { Ref, RefCallback } from 'react'\n\n// Joins class names, skipping empty ones.\nexport function cx(...parts: (string | false | null | undefined)[]) {\n return parts.filter(Boolean).join(' ')\n}\n\n// Base UI's className is a string or a function of the state; keep both\n// working and append the caller's after ours.\nexport function withClass<State>(\n base: string,\n className: string | ((state: State) => string | undefined) | undefined\n) {\n return (state: State) =>\n cx(base, typeof className === 'function' ? className(state) : className)\n}\n\nexport function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): RefCallback<T> {\n return (value) => {\n for (const ref of refs) {\n if (typeof ref === 'function') ref(value)\n else if (ref) ref.current = value\n }\n }\n}\n","import { cx } from '../../utils'\nimport './typography.css'\n\nexport type TypographyType =\n 'body' | 'caption' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\nexport type TypographyTag =\n 'p' | 'span' | 'div' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n\nexport type TypographyProps = React.ComponentProps<'p'> & {\n /** The look. */\n type?: TypographyType\n /** The HTML tag, when it should differ from the look (e.g. an h2 styled as h6). */\n as?: TypographyTag\n}\n\nconst tags = {\n body: 'p',\n caption: 'span',\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n} as const\n\nexport function Typography({\n type = 'body',\n as,\n className,\n ...props\n}: TypographyProps) {\n // All these tags share the same props; tell JSX so it can type `ref`.\n const Tag = (as ?? tags[type]) as 'p'\n\n return (\n <Tag\n {...props}\n className={cx(`avl-typography avl-typography-${type}`, className)}\n />\n )\n}\n","import type { ComponentProps, ReactNode } from 'react'\nimport type { ComponentColor, ComponentFillType } from '../../colors/colors'\nimport { colorClass } from '../../colors/colors'\nimport { Typography, type TypographyTag } from '../Typography/Typography'\nimport { cx } from '../../utils'\nimport './app-bar.css'\n\nexport type AppBarProps = ComponentProps<'header'> & {\n /** The page or screen title. */\n label: ReactNode\n /**\n * HTML tag for the title. A div by default; use `'h1'` when the bar's\n * title is the page's main heading. @default 'div'\n */\n labelAs?: TypographyTag\n /** Before the title, usually a navigation `IconButton` (menu or back). */\n start?: ReactNode\n /** After the title, usually a few action `IconButton`s. */\n end?: ReactNode\n /** `big` puts the title on its own, larger row below the buttons. @default 'normal' */\n size?: 'normal' | 'big'\n /** Center the title. Only for `size=\"normal\"`. @default false */\n centered?: boolean\n /**\n * Color role from the theme. The default `container` gives the bar the\n * navigation color (the theme's `containerLow`), so it matches a\n * NavigationRail or NavigationDrawer beside it. @default 'container'\n */\n color?: ComponentColor\n /**\n * `filled` gives the bar a solid background. `text` makes it colorless,\n * the same color as the page. @default 'filled'\n */\n fillType?: ComponentFillType\n}\n\n/** The bar across the top of a page or screen: title, navigation and actions. */\nexport function AppBar({\n label,\n labelAs = 'div',\n start,\n end,\n size = 'normal',\n centered = false,\n // Not the library's usual primary: the bar frames the page, like navigation\n color = 'container',\n fillType = 'filled',\n className,\n ...props\n}: AppBarProps) {\n return (\n <header\n {...props}\n className={cx(\n 'avl-app-bar',\n colorClass(color, fillType),\n `avl-app-bar-size-${size}`,\n centered && size === 'normal' && 'avl-app-bar-centered',\n className\n )}\n >\n <div className=\"avl-app-bar-start\">{start}</div>\n <Typography\n as={labelAs}\n type={size === 'big' ? 'h5' : 'h6'}\n className=\"avl-app-bar-label\"\n >\n {label}\n </Typography>\n <div className=\"avl-app-bar-end\">{end}</div>\n </header>\n )\n}\n","import { Avatar as BaseAvatar } from '@base-ui/react/avatar'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { colorClass, type ColorProps } from '../../colors/colors'\nimport { Icon } from '../Icon/Icon'\nimport { cx, withClass } from '../../utils'\nimport './avatar.css'\n\nexport type AvatarProps = BaseAvatar.Root.Props &\n ColorProps & {\n /** Image URL. While it loads, or if it fails, the fallback shows. */\n src?: string\n /**\n * The person's (or thing's) name. Read by screen readers, and its\n * initials are the fallback: \"Ada Lovelace\" shows \"AL\". Leave it out\n * when the name is already shown next to the avatar.\n */\n name?: string\n /** Fallback icon when there's no `name`. @default 'person' */\n icon?: MaterialSymbol\n /** 32px, 40px or 56px. @default 'normal' */\n size?: 'small' | 'normal' | 'big'\n }\n\n// First letter of the first and last words: \"Ada Lovelace\" -> \"AL\", \"Plato\" -> \"P\".\n// [...word] splits by character rather than UTF-16 unit, so emoji and\n// non-Latin letters aren't cut in half.\nfunction initials(name: string) {\n const words = name.trim().split(/\\s+/).filter(Boolean)\n if (words.length === 0) return ''\n const first = [...words[0]][0]\n const last = words.length > 1 ? [...words[words.length - 1]][0] : ''\n return (first + last).toUpperCase()\n}\n\n/**\n * A picture, initials or an icon that stands for a person or thing.\n * `children` replaces the initials/icon fallback.\n */\nexport function Avatar({\n src,\n name,\n icon = 'person',\n size = 'normal',\n color,\n fillType,\n className,\n children,\n ...props\n}: AvatarProps) {\n const letters = name ? initials(name) : ''\n\n return (\n <BaseAvatar.Root\n // With a name it's one image to screen readers, named by it;\n // without one it's decoration\n role={name ? 'img' : undefined}\n aria-label={name}\n aria-hidden={name ? undefined : true}\n {...props}\n className={withClass(\n cx(\n 'avl-avatar',\n colorClass(color, fillType),\n `avl-avatar-size-${size}`\n ),\n className\n )}\n >\n {src && (\n <BaseAvatar.Image\n src={src}\n alt=\"\"\n className=\"avl-avatar-image\"\n />\n )}\n {/* Waiting a moment avoids flashing the fallback on fast loads */}\n <BaseAvatar.Fallback\n delay={src ? 600 : undefined}\n className=\"avl-avatar-fallback\"\n aria-hidden\n >\n {children ?? (letters || <Icon name={icon} />)}\n </BaseAvatar.Fallback>\n </BaseAvatar.Root>\n )\n}\n","import type { MaterialSymbol } from 'material-symbols'\nimport 'material-symbols/rounded.css'\nimport { cx } from '../../utils'\nimport './icon.css'\n\nexport type IconProps = Omit<React.ComponentProps<'span'>, 'children'> & {\n name: MaterialSymbol\n}\n\nexport function Icon({ name, ...props }: IconProps) {\n const labelled = props['aria-label'] || props['aria-labelledby']\n\n return (\n <span\n aria-hidden={labelled ? undefined : true}\n role={labelled ? 'img' : undefined}\n {...props}\n className={cx('avl-icon material-symbols-rounded', props.className)}\n >\n {name}\n </span>\n )\n}\n","import type { ComponentProps } from 'react'\nimport { colorClass, type ComponentColor } from '../../colors/colors'\nimport { cx } from '../../utils'\nimport './badge.css'\n\nexport type BadgeProps = ComponentProps<'span'> & {\n /** Number to show. Leave out for a small dot; `0` hides the badge. */\n count?: number\n /** Higher counts show as \"999+\". @default 999 */\n max?: number\n /** Color role from the theme. @default 'error' */\n color?: ComponentColor\n}\n\n/**\n * A dot or count on the corner of what it wraps (an `Icon`, `IconButton`,\n * `Avatar`, ...), or inline on its own when it wraps nothing.\n *\n * It's hidden from screen readers: put the count in the wrapped element's\n * name too, e.g. `aria-label=\"Inbox, 3 unread\"`.\n */\nexport function Badge({\n count,\n max = 999,\n // Not the library's usual primary: Material badges are error-colored\n color = 'error',\n className,\n children,\n ...props\n}: BadgeProps) {\n const badge =\n count === 0 ? null : (\n <span\n aria-hidden\n className={cx(\n 'avl-badge',\n colorClass(color, 'filled'),\n count === undefined && 'avl-badge-dot',\n !children && className\n )}\n {...(!children && props)}\n >\n {count !== undefined && (count > max ? `${max}+` : count)}\n </span>\n )\n\n if (!children) return badge\n\n return (\n <span {...props} className={cx('avl-badge-anchor', className)}>\n {children}\n {badge}\n </span>\n )\n}\n","import { useContext } from 'react'\nimport { Drawer } from '@base-ui/react/drawer'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { withClass } from '../../utils'\nimport './bottom-sheet.css'\n\n/**\n * A panel that slides up from the bottom; swipe it down or tap outside to\n * close. Holds the open state (`open` / `defaultOpen` / `onOpenChange`).\n * Pass `snapPoints` (e.g. `[0.5, 1]`) for a sheet that can stop part way.\n */\nexport type BottomSheetProps = Omit<Drawer.Root.Props, 'swipeDirection'>\n\nexport function BottomSheet(props: BottomSheetProps) {\n return <Drawer.Root {...props} swipeDirection=\"down\" />\n}\n\n// Renders a bare button. Pass `render={<Button />}` to use the library button.\nexport type BottomSheetTriggerProps = Drawer.Trigger.Props\n\nexport function BottomSheetTrigger({\n className,\n ...props\n}: BottomSheetTriggerProps) {\n return (\n <Drawer.Trigger\n {...props}\n className={withClass('avl-bottom-sheet-trigger', className)}\n />\n )\n}\n\n// Also renders the portal, the dimmed backdrop and the drag handle. Its\n// children scroll when the sheet is taller than the screen allows.\nexport type BottomSheetPopupProps = Drawer.Popup.Props\n\nexport function BottomSheetPopup({\n className,\n children,\n ...props\n}: BottomSheetPopupProps) {\n const avl = useContext(AnvilContext)\n\n return (\n // Into the AnvilRoot, not body, so the sheet sees the theme variables\n <Drawer.Portal container={avl?.rootRef}>\n <Drawer.Backdrop className=\"avl-bottom-sheet-backdrop\" />\n <Drawer.Viewport className=\"avl-bottom-sheet-viewport\">\n <Drawer.Popup\n {...props}\n className={withClass('avl-bottom-sheet-popup', className)}\n >\n <div className=\"avl-bottom-sheet-handle\" aria-hidden />\n {/* Lets mouse users select text here without starting a swipe */}\n <Drawer.Content className=\"avl-bottom-sheet-content\">\n {children}\n </Drawer.Content>\n </Drawer.Popup>\n </Drawer.Viewport>\n </Drawer.Portal>\n )\n}\n\n// Names the sheet for screen readers. Renders an <h2>.\nexport type BottomSheetTitleProps = Drawer.Title.Props\n\nexport function BottomSheetTitle({\n className,\n ...props\n}: BottomSheetTitleProps) {\n return (\n <Drawer.Title\n {...props}\n className={withClass('avl-bottom-sheet-title', className)}\n />\n )\n}\n\nexport type BottomSheetDescriptionProps = Drawer.Description.Props\n\nexport function BottomSheetDescription({\n className,\n ...props\n}: BottomSheetDescriptionProps) {\n return (\n <Drawer.Description\n {...props}\n className={withClass('avl-bottom-sheet-description', className)}\n />\n )\n}\n\n// Closes the sheet. Renders a bare button; pass `render={<Button />}` to use\n// the library's.\nexport type BottomSheetCloseProps = Drawer.Close.Props\n\nexport function BottomSheetClose({\n className,\n ...props\n}: BottomSheetCloseProps) {\n return (\n <Drawer.Close\n {...props}\n className={withClass('avl-bottom-sheet-close', className)}\n />\n )\n}\n","import { createContext, Dispatch, RefObject, SetStateAction } from 'react'\nimport { Theme } from '../../themes/types'\nimport { DesignTokens } from '../../tokens/types'\n\nexport type ColorType = 'light' | 'dark'\n\ntype AnvilContextValues = {\n colorMode: 'light' | 'dark'\n setColorMode: Dispatch<SetStateAction<ColorType>>\n darkTheme: Theme\n lightTheme: Theme\n tokens: DesignTokens\n // The element that carries the theme variables. Portaled components (menus,\n // dialogs, ...) render into it, since `body` sits outside the theme.\n rootRef: RefObject<HTMLDivElement | null>\n}\n\nexport const AnvilContext = createContext<AnvilContextValues | null>(null)\n","import { useLayoutEffect, useRef } from 'react'\nimport {\n Button as BaseButton,\n ButtonProps as BaseButtonProps,\n} from '@base-ui/react/button'\nimport type { MaterialSymbol } from 'material-symbols'\nimport {\n ComponentColor,\n ComponentFillType,\n colorClass,\n} from '../../colors/colors'\nimport { Icon } from '../Icon/Icon'\nimport { mergeRefs, withClass } from '../../utils'\nimport './button.css'\n\nexport type ButtonProps = BaseButtonProps & {\n size?: 'small' | 'normal' | 'big'\n fillType?: ComponentFillType\n color?: ComponentColor\n startIcon?: MaterialSymbol\n endIcon?: MaterialSymbol\n /**\n * Shows a spinner in place of `startIcon` and ignores clicks. Pass the\n * text to show meanwhile as children (`{saving ? 'Saving' : 'Save'}`);\n * the button animates between the two widths. @default false\n */\n loading?: boolean\n}\n\nexport function Button({\n size,\n fillType,\n color,\n startIcon,\n endIcon,\n loading,\n disabled,\n children,\n className,\n ref,\n ...props\n}: ButtonProps) {\n const local = useRef<HTMLButtonElement>(null)\n // Only buttons that use `loading` resize smoothly; the rest skip the\n // measuring\n useAnimatedWidth(local, loading !== undefined)\n\n return (\n <BaseButton\n {...props}\n ref={mergeRefs(local, ref)}\n disabled={disabled || loading}\n // Keeps focus on it while loading, instead of dropping it to\n // <body>. An explicit `disabled` still wins and dims it.\n focusableWhenDisabled={\n (loading && !disabled) || props.focusableWhenDisabled\n }\n aria-busy={loading || undefined}\n className={withClass(\n `avl-button ${colorClass(color, fillType)} avl-button-size-${size || 'normal'}`,\n className\n )}\n >\n {loading ? (\n <svg\n className=\"avl-button-spinner\"\n viewBox=\"0 0 24 24\"\n aria-hidden\n >\n <circle cx=\"12\" cy=\"12\" r=\"8\" pathLength={100} />\n </svg>\n ) : (\n startIcon && <Icon name={startIcon} />\n )}\n {children}\n {endIcon && <Icon name={endIcon} />}\n </BaseButton>\n )\n}\n\n// Width can't transition between two \"as wide as the content\" sizes in CSS,\n// so after each render compare the new width with the old one and animate\n// between them\nfunction useAnimatedWidth(\n ref: React.RefObject<HTMLButtonElement | null>,\n enabled: boolean\n) {\n const lastWidth = useRef<number | null>(null)\n const running = useRef<Animation | null>(null)\n\n useLayoutEffect(() => {\n const el = ref.current\n if (!el || !enabled) return\n // Changed again mid-animation: carry on from where it is now\n const from =\n running.current?.playState === 'running'\n ? el.offsetWidth\n : lastWidth.current\n running.current?.cancel()\n const to = el.offsetWidth\n lastWidth.current = to\n if (from == null || Math.abs(from - to) < 1) return\n\n const style = getComputedStyle(el)\n const length = style.getPropertyValue('--avl-ease-length-normal').trim()\n const animation = el.animate(\n { width: [`${from}px`, `${to}px`] },\n {\n duration:\n (parseFloat(length) || 0) *\n (length.endsWith('ms') ? 1 : 1000),\n easing: style.getPropertyValue('--avl-ease-out'),\n }\n )\n running.current = animation\n // While it's narrower than its content: clip, rather than wrap the\n // text onto two lines\n el.style.overflow = 'hidden'\n el.style.whiteSpace = 'nowrap'\n const done = () => {\n // A newer animation owns these styles now\n if (running.current !== animation) return\n el.style.overflow = ''\n el.style.whiteSpace = ''\n }\n animation.onfinish = done\n animation.oncancel = done\n })\n}\n","import { cx } from '../../utils'\nimport './split-button.css'\n\nexport type SplitButtonProps = React.ComponentProps<'div'>\n\nexport function SplitButton({ className, ...props }: SplitButtonProps) {\n return (\n <div\n role=\"group\"\n {...props}\n className={cx('avl-split-button', className)}\n />\n )\n}\n","import { useEffect, useRef, useState, type CSSProperties } from 'react'\nimport { Button, type ButtonProps } from '../Button/Button'\nimport { cx } from '../../utils'\nimport './hold-button.css'\n\nexport type HoldButtonProps = Omit<ButtonProps, 'loading'> & {\n /** Called once the button has been held down for `holdDuration`. */\n onConfirm: () => void\n /** How long to hold, in milliseconds. @default 1500 */\n holdDuration?: number\n}\n\n/**\n * A button for destructive actions: press and hold until the fill sweeps\n * across, instead of a confirm dialog. Letting go early cancels. Works with\n * Space and Enter too; a screen reader's click, which can't be held,\n * confirms straight away.\n */\nexport function HoldButton({\n onConfirm,\n holdDuration = 1500,\n className,\n style,\n disabled,\n onPointerDown,\n onPointerUp,\n onPointerLeave,\n onPointerCancel,\n onKeyDown,\n onKeyUp,\n onClick,\n onContextMenu,\n ...props\n}: HoldButtonProps) {\n const [state, setState] = useState<'idle' | 'holding' | 'confirmed'>('idle')\n // Bumped on each early release, to replay the \"no\" wobble\n const [nudges, setNudges] = useState(0)\n const timer = useRef<ReturnType<typeof setTimeout>>(undefined)\n // A pointer press is followed by a click, which the hold already\n // handled; keys don't click (their default is prevented)\n const pressed = useRef(false)\n\n useEffect(() => () => clearTimeout(timer.current), [])\n\n const confirm = () => {\n setState('confirmed')\n onConfirm()\n // Long enough for the pop to play, then ready again\n timer.current = setTimeout(() => setState('idle'), 600)\n }\n\n const start = () => {\n if (disabled || state !== 'idle') return\n setState('holding')\n timer.current = setTimeout(confirm, holdDuration)\n }\n\n const cancel = () => {\n if (state !== 'holding') return\n clearTimeout(timer.current)\n setState('idle')\n setNudges((n) => n + 1)\n }\n\n return (\n <Button\n {...props}\n disabled={disabled}\n aria-description=\"Press and hold to confirm\"\n data-hold={state === 'idle' ? undefined : state}\n // Restarts the wobble animation on each early release\n data-nudge={nudges % 2 === 0 ? 'even' : 'odd'}\n className={(buttonState) =>\n cx(\n 'avl-hold-button',\n nudges > 0 && 'avl-hold-button-nudged',\n typeof className === 'function'\n ? className(buttonState)\n : className\n )\n }\n style={(buttonState) =>\n ({\n '--avl-hold-duration': `${holdDuration}ms`,\n ...(typeof style === 'function'\n ? style(buttonState)\n : style),\n }) as CSSProperties\n }\n onPointerDown={(event) => {\n onPointerDown?.(event)\n if (event.button !== 0) return\n pressed.current = true\n start()\n }}\n onPointerUp={(event) => {\n onPointerUp?.(event)\n cancel()\n }}\n // Sliding off the button cancels too\n onPointerLeave={(event) => {\n onPointerLeave?.(event)\n // No click follows once the pointer is off the button\n pressed.current = false\n cancel()\n }}\n onPointerCancel={(event) => {\n onPointerCancel?.(event)\n pressed.current = false\n cancel()\n }}\n onKeyDown={(event) => {\n onKeyDown?.(event)\n if (event.key !== ' ' && event.key !== 'Enter') return\n // Stop Enter's instant click; the hold decides\n event.preventDefault()\n if (!event.repeat) start()\n }}\n onKeyUp={(event) => {\n onKeyUp?.(event)\n if (event.key !== ' ' && event.key !== 'Enter') return\n event.preventDefault()\n cancel()\n }}\n // A long press on Android opens the context menu; it's a hold here\n onContextMenu={(event) => {\n onContextMenu?.(event)\n if (state === 'holding') event.preventDefault()\n }}\n onClick={(event) => {\n onClick?.(event)\n if (pressed.current) {\n pressed.current = false\n return\n }\n // No press came first, so it's assistive tech, which can't\n // hold: confirm directly\n if (!disabled && state === 'idle') confirm()\n }}\n />\n )\n}\n","import {\n Button as BaseButton,\n ButtonProps as BaseButtonProps,\n} from '@base-ui/react/button'\nimport {\n ComponentColor,\n ComponentFillType,\n colorClass,\n} from '../../colors/colors'\nimport { Typography, TypographyProps } from '../Typography/Typography'\nimport { cx, withClass } from '../../utils'\nimport './card.css'\n\ntype CardStyleProps = {\n fillType?: ComponentFillType\n color?: ComponentColor\n}\n\n// A plain card takes div props. A clickable card is a Base UI button, so it\n// takes button props (disabled, focusableWhenDisabled, render, ...) instead.\nexport type CardProps =\n | (Omit<React.ComponentProps<'div'>, 'color'> &\n CardStyleProps & { clickable?: false })\n | (Omit<BaseButtonProps, 'color'> & CardStyleProps & { clickable: true })\n\ntype StaticCardProps = Extract<CardProps, { clickable?: false }>\ntype ClickableCardProps = Extract<CardProps, { clickable: true }>\n\n// Clicks that start inside one of these belong to that element, not the card.\nconst nestedControls = [\n 'a[href]',\n 'button',\n 'input',\n 'select',\n 'textarea',\n 'label',\n 'summary',\n '[contenteditable]',\n ...[\n 'button',\n 'link',\n 'checkbox',\n 'radio',\n 'switch',\n 'tab',\n 'menuitem',\n 'option',\n 'combobox',\n 'slider',\n 'textbox',\n 'spinbutton',\n ].map((role) => `[role=\"${role}\"]`),\n].join(',')\n\nfunction isFromNestedControl(event: React.MouseEvent) {\n if (!(event.target instanceof Element)) return false\n const control = event.target.closest(nestedControls)\n return control !== null && control !== event.currentTarget\n}\n\n// Defaults to the neutral container color: a filled primary card would swallow\n// the primary buttons that usually sit inside it.\nexport function Card(props: CardProps) {\n if (props.clickable) return <ClickableCard {...props} />\n return <StaticCard {...props} />\n}\n\nfunction StaticCard({\n clickable,\n color = 'container',\n fillType = 'filled',\n className,\n ...props\n}: StaticCardProps) {\n return (\n <div\n {...props}\n className={cx('avl-card ' + colorClass(color, fillType), className)}\n />\n )\n}\n\nfunction ClickableCard({\n clickable,\n color = 'container',\n fillType,\n className,\n onClick,\n ...props\n}: ClickableCardProps) {\n return (\n <BaseButton\n // a div, so buttons and links can sit inside; pass `render` for a link\n nativeButton={false}\n render={<div />}\n {...props}\n onClick={(event) => {\n if (!isFromNestedControl(event)) onClick?.(event)\n }}\n className={withClass(\n 'avl-card avl-card-clickable ' + colorClass(color, fillType),\n className\n )}\n />\n )\n}\n\nexport type CardTitleProps = TypographyProps\n\n// Looks like an h6 but renders a div: the right heading level depends on the\n// page, so pass `as` to make it one.\nexport function CardTitle({\n type = 'h6',\n as = 'div',\n className,\n ...props\n}: CardTitleProps) {\n return (\n <Typography\n {...props}\n type={type}\n as={as}\n className={cx('avl-card-title', className)}\n />\n )\n}\n\nexport type CardContentProps = React.ComponentProps<'div'>\n\nexport function CardContent({ className, ...props }: CardContentProps) {\n return <div {...props} className={cx('avl-card-content', className)} />\n}\n\nexport type CardActionsProps = React.ComponentProps<'div'>\n\nexport function CardActions({ className, ...props }: CardActionsProps) {\n return <div {...props} className={cx('avl-card-actions', className)} />\n}\n","import type { ComponentProps } from 'react'\nimport {\n Button as BaseButton,\n type ButtonProps as BaseButtonProps,\n} from '@base-ui/react/button'\nimport { Toggle } from '@base-ui/react/toggle'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { Icon } from '../Icon/Icon'\nimport { cx, withClass } from '../../utils'\nimport './chip.css'\n\n// Material's assist and suggestion chips: a compact button.\nexport type ChipProps = BaseButtonProps & {\n /** Material Symbol before the label. */\n startIcon?: MaterialSymbol\n}\n\nexport function Chip({ startIcon, className, children, ...props }: ChipProps) {\n return (\n <BaseButton\n {...props}\n className={withClass(\n cx('avl-chip', startIcon && 'avl-chip-has-icon'),\n className\n )}\n >\n {startIcon && <Icon name={startIcon} />}\n {children}\n </BaseButton>\n )\n}\n\n// Toggles on and off: `pressed` / `defaultPressed` / `onPressedChange`.\n// Shows a checkmark while on.\nexport type FilterChipProps = Toggle.Props\n\nexport function FilterChip({ className, children, ...props }: FilterChipProps) {\n return (\n <Toggle\n {...props}\n className={withClass('avl-chip avl-filter-chip', className)}\n >\n <Icon name=\"check\" className=\"avl-filter-chip-check\" />\n {children}\n </Toggle>\n )\n}\n\n// A value the user entered or picked, like a tag or a recipient, with a\n// button to remove it. Not a button itself: the remove button is inside it.\nexport type InputChipProps = ComponentProps<'span'> & {\n /** Called when the remove (×) button is clicked. */\n onRemove: () => void\n /** Accessible name of the remove button, e.g. \"Remove Alice\". @default 'Remove' */\n removeLabel?: string\n /** Material Symbol before the label. */\n startIcon?: MaterialSymbol\n /** Disables the remove button and dims the chip. */\n disabled?: boolean\n}\n\nexport function InputChip({\n onRemove,\n removeLabel = 'Remove',\n startIcon,\n disabled,\n className,\n children,\n ...props\n}: InputChipProps) {\n return (\n <span\n {...props}\n className={cx(\n 'avl-chip avl-input-chip',\n startIcon && 'avl-chip-has-icon',\n className\n )}\n data-disabled={disabled || undefined}\n >\n {startIcon && <Icon name={startIcon} />}\n {children}\n <BaseButton\n className=\"avl-input-chip-remove\"\n aria-label={removeLabel}\n disabled={disabled}\n onClick={onRemove}\n >\n <Icon name=\"close\" />\n </BaseButton>\n </span>\n )\n}\n","import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox'\nimport { withClass } from '../../utils'\nimport './checkbox.css'\n\nexport type CheckboxProps = BaseCheckbox.Root.Props\n\n// Both paths have the same commands, so CSS can morph one into the other\nconst CHECK = 'M5 12.5 L9.5 17 L19 7.5'\nconst DASH = 'M6 12 L12 12 L18 12'\n\nexport function Checkbox({ className, ...props }: CheckboxProps) {\n return (\n <BaseCheckbox.Root\n {...props}\n className={withClass('avl-checkbox', className)}\n >\n <BaseCheckbox.Indicator className=\"avl-checkbox-indicator\">\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <path\n d={props.indeterminate ? DASH : CHECK}\n pathLength={1}\n />\n </svg>\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n )\n}\n","import { useContext, type ComponentProps, type Ref } from 'react'\nimport { Dialog as BaseDialog } from '@base-ui/react/dialog'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { cx, mergeRefs, withClass } from '../../utils'\nimport { MorphContext, useMorphOpen } from '../../morph'\nimport './dialog.css'\n\nexport type DialogProps = BaseDialog.Root.Props & {\n /**\n * Grow the dialog out of its trigger, and shrink it back into it on\n * close (Material's container transform). Works best when the trigger\n * is a surface, like a clickable `Card`. @default false\n */\n morph?: boolean\n}\n\nexport function Dialog({\n morph = false,\n defaultOpen = false,\n ...props\n}: DialogProps) {\n const state = useMorphOpen({\n morph,\n open: props.open,\n defaultOpen,\n onOpenChange: props.onOpenChange,\n })\n\n return (\n <MorphContext value={state.refs}>\n <BaseDialog.Root\n {...props}\n open={state.open}\n onOpenChange={state.onOpenChange}\n />\n </MorphContext>\n )\n}\n\n// Renders a bare button. Pass `render={<Button />}` to use the library button.\nexport type DialogTriggerProps = BaseDialog.Trigger.Props\n\nexport function DialogTrigger({\n className,\n ref,\n ...props\n}: DialogTriggerProps) {\n const morph = useContext(MorphContext)\n\n return (\n <BaseDialog.Trigger\n {...props}\n ref={mergeRefs(morph?.trigger, ref as Ref<HTMLElement>)}\n className={withClass('avl-dialog-trigger', className)}\n />\n )\n}\n\n// Also renders the portal and the dimmed backdrop behind the dialog.\nexport type DialogPopupProps = BaseDialog.Popup.Props\n\nexport function DialogPopup({ className, ref, ...props }: DialogPopupProps) {\n const avl = useContext(AnvilContext)\n const morph = useContext(MorphContext)\n\n return (\n // Into the AnvilRoot, not body, so the popup sees the theme variables\n <BaseDialog.Portal container={avl?.rootRef}>\n <BaseDialog.Backdrop className=\"avl-dialog-backdrop\" />\n <BaseDialog.Popup\n {...props}\n ref={mergeRefs(morph?.popup, ref as Ref<HTMLElement>)}\n className={withClass('avl-dialog-popup', className)}\n />\n </BaseDialog.Portal>\n )\n}\n\n// Names the dialog for screen readers. Renders an <h2>.\nexport type DialogTitleProps = BaseDialog.Title.Props\n\nexport function DialogTitle({ className, ...props }: DialogTitleProps) {\n return (\n <BaseDialog.Title\n {...props}\n className={withClass('avl-dialog-title', className)}\n />\n )\n}\n\nexport type DialogDescriptionProps = BaseDialog.Description.Props\n\nexport function DialogDescription({\n className,\n ...props\n}: DialogDescriptionProps) {\n return (\n <BaseDialog.Description\n {...props}\n className={withClass('avl-dialog-description', className)}\n />\n )\n}\n\n// The row of buttons at the bottom, aligned to the end.\nexport type DialogActionsProps = ComponentProps<'div'>\n\nexport function DialogActions({ className, ...props }: DialogActionsProps) {\n return <div {...props} className={cx('avl-dialog-actions', className)} />\n}\n\n// Closes the dialog. Renders a bare button; pass `render={<Button />}` to use\n// the library's.\nexport type DialogCloseProps = BaseDialog.Close.Props\n\nexport function DialogClose({ className, ...props }: DialogCloseProps) {\n return (\n <BaseDialog.Close\n {...props}\n className={withClass('avl-dialog-close', className)}\n />\n )\n}\n","import {\n createContext,\n useLayoutEffect,\n useRef,\n useState,\n type RefObject,\n} from 'react'\nimport { flushSync } from 'react-dom'\n\n/** The trigger and popup a morphing Dialog or Popover animates between. */\nexport type MorphRefs = {\n trigger: RefObject<HTMLElement | null>\n popup: RefObject<HTMLElement | null>\n}\n\n/**\n * Set by a Dialog or Popover root with `morph`, `null` without, so a nested\n * root's trigger or popup never picks up an outer one's refs.\n */\nexport const MorphContext = createContext<MorphRefs | null>(null)\n\n/**\n * Open state for a Base UI root that can morph between its trigger and its\n * popup. Held here, not in Base UI, so the change can happen inside the view\n * transition. `open` / `defaultOpen` / `onOpenChange` keep working,\n * including cancelling from `onOpenChange`.\n */\nexport function useMorphOpen<Details extends { isCanceled: boolean }>({\n morph,\n open: controlledOpen,\n defaultOpen,\n onOpenChange,\n}: {\n morph: boolean\n open: boolean | undefined\n defaultOpen: boolean\n onOpenChange: ((open: boolean, details: Details) => void) | undefined\n}) {\n const trigger = useRef<HTMLElement>(null)\n const popup = useRef<HTMLElement>(null)\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen)\n const open = controlledOpen ?? uncontrolledOpen\n\n // The trigger became the popup, so it's hidden until the popup shrinks\n // back into it. Set by hand, right as the browser takes its snapshot:\n // Base UI's data-popup-open lands a moment later, which showed up as a\n // flash at the end of the morph.\n const hideTrigger = (hidden: boolean) =>\n trigger.current?.toggleAttribute('data-morph-hidden', hidden)\n\n // Closed some other way (like `open` set to false from outside): show\n // the trigger again\n useLayoutEffect(() => {\n if (!open) hideTrigger(false)\n }, [open])\n\n const handleOpenChange = (next: boolean, details: Details) => {\n const update = () => {\n onOpenChange?.(next, details)\n if (details.isCanceled) return\n setUncontrolledOpen(next)\n if (morph) hideTrigger(next)\n }\n const from = next ? trigger.current : popup.current\n if (!morph || !from) {\n update()\n return\n }\n morphBetween(from, update, () =>\n next ? popup.current : trigger.current\n )\n }\n\n return {\n open,\n onOpenChange: handleOpenChange,\n refs: morph ? { trigger, popup } : null,\n }\n}\n\nexport type MorphOptions = {\n /** Length of the morph in milliseconds. @default the theme's `easeLength.slow` */\n duration?: number\n /** CSS easing for the box's size, position, corners and color. @default the theme's `ease.smooth` */\n easing?: string\n}\n\n/**\n * Morphs one element into another while the view changes: the element with\n * `data-morph-id={id}` grows (or shrinks) into the element that has the same\n * id after `update` runs, like a list row opening into its detail page.\n * Call it again with the same id to morph back.\n *\n * `update` must change the view synchronously: set React state, or call a\n * router with its sync option (React Router: `navigate(to, { flushSync:\n * true })`). Falls back to a plain `update()` without View Transitions\n * support or with reduced motion.\n *\n * Resolves once the morph has finished (right away when it falls back), so\n * you can move focus or start something else afterwards.\n */\nexport function morph(id: string, update: () => void, options?: MorphOptions) {\n const from = findMorphTarget(id)\n if (!from) {\n update()\n return Promise.resolve()\n }\n return morphBetween(from, update, () => findMorphTarget(id, from), options)\n}\n\n// The first visible element with this id, other than `except`\nfunction findMorphTarget(id: string, except?: Element) {\n const all = document.querySelectorAll<HTMLElement>(\n `[data-morph-id=\"${CSS.escape(id)}\"]`\n )\n return (\n Array.from(all).find(\n (el) => el !== except && el.getClientRects().length > 0\n ) ?? null\n )\n}\n\nlet count = 0\n\n/**\n * Like `morph`, but takes the elements instead of a `data-morph-id`. `from`\n * grows into whatever `getTo` returns after `update` runs; it's a function\n * because the target usually doesn't exist until then.\n *\n * The browser snapshots `from`, runs `update`, snapshots `to`, and animates\n * one box into the other. Everything else on the page just crossfades.\n * Both elements get `data-morphing` meanwhile, so they can switch off their\n * own enter and exit animations.\n */\nexport function morphBetween(\n from: HTMLElement,\n update: () => void,\n getTo: () => HTMLElement | null,\n options: MorphOptions = {}\n): Promise<void> {\n if (\n !document.startViewTransition ||\n matchMedia('(prefers-reduced-motion: reduce)').matches\n ) {\n update()\n return Promise.resolve()\n }\n\n const name = `avl-morph-${++count}`\n const html = document.documentElement\n const fromStyle = getComputedStyle(from)\n // The transition is drawn on <html>, outside AnvilRoot, so read the\n // theme's motion tokens here\n const length =\n fromStyle.getPropertyValue('--avl-ease-length-slow').trim() || '300ms'\n const duration =\n options.duration ??\n (parseFloat(length) || 300) * (length.endsWith('ms') ? 1 : 1000)\n // No overshoot by default: the box travels a long way, and a spring\n // would also flash odd shades as the colors blend\n const easing =\n options.easing ??\n (fromStyle.getPropertyValue('--avl-ease-smooth').trim() || 'ease')\n // Captured now: by the time the animation starts, `from` has changed\n const fromSurface = surfaceOf(from, fromStyle)\n\n // Per-name rules, injected for this one transition. A shared\n // view-transition-class would do, but not every browser supports it.\n const style = document.createElement('style')\n style.textContent = morphStyles(name, duration, easing)\n document.head.append(style)\n\n from.setAttribute('data-morphing', '')\n from.style.setProperty('view-transition-name', name)\n let to: HTMLElement | null = null\n\n const transition = document.startViewTransition(async () => {\n // React has to render now, before the browser takes the \"after\" shot\n flushSync(update)\n // Popups anchored to a trigger (Popover) get their position a moment\n // after they mount; wait for it so the morph heads to the right spot\n await new Promise((resolve) => setTimeout(resolve))\n from.style.removeProperty('view-transition-name')\n to = getTo()\n if (!to) return\n to.style.setProperty('view-transition-name', name)\n to.setAttribute('data-morphing', '')\n })\n\n // The snapshots are flat pictures that fade out and in. The box under\n // them is what morphs: it grows, recolors and rounds from one element's\n // look into the other's, so there's always one continuous surface.\n transition.ready\n .then(() => {\n if (!to) return\n const toSurface = surfaceOf(to, getComputedStyle(to))\n const group = `::view-transition-group(${name})`\n // A see-through end has no shape of its own (a plain list row),\n // so the box keeps the other end's corners\n html.animate(\n {\n borderRadius: [\n fromSurface.color\n ? fromSurface.radius\n : toSurface.radius,\n toSurface.color ? toSurface.radius : fromSurface.radius,\n ],\n },\n { duration, easing, fill: 'both', pseudoElement: group }\n )\n // Starting see-through, the box takes the other end's color, so it\n // doesn't fade in from nothing. Ending see-through, it holds its\n // color, then fades out as the new content fades in.\n const color = toSurface.color\n ? [\n { backgroundColor: fromSurface.color ?? toSurface.color },\n { backgroundColor: toSurface.color },\n ]\n : [\n { backgroundColor: fromSurface.color ?? 'transparent' },\n {\n backgroundColor: fromSurface.color ?? 'transparent',\n offset: 0.4,\n },\n { backgroundColor: 'transparent' },\n ]\n html.animate(\n color.map((frame, i) => ({\n ...frame,\n ...(i === 0 && { boxShadow: fromSurface.shadow }),\n ...(i === color.length - 1 && {\n boxShadow: toSurface.shadow,\n }),\n })),\n {\n duration,\n easing,\n fill: 'both',\n pseudoElement: group,\n }\n )\n })\n .catch(() => {})\n\n return transition.finished.finally(() => {\n for (const el of [from, to]) {\n el?.style.removeProperty('view-transition-name')\n el?.removeAttribute('data-morphing')\n }\n style.remove()\n })\n}\n\nfunction surfaceOf(el: HTMLElement, style: CSSStyleDeclaration) {\n const color = style.backgroundColor\n const clear = color === 'transparent' || color === 'rgba(0, 0, 0, 0)'\n // A \"fully round\" radius is a huge number (1000px). Cap it at what\n // actually shows, half the shorter side, or the corners would stay\n // round for most of the animation and then snap square at the end.\n const { width, height } = el.getBoundingClientRect()\n const radius = Math.min(\n parseFloat(style.borderRadius) || 0,\n Math.min(width, height) / 2\n )\n return {\n color: clear ? null : color,\n radius: `${radius}px`,\n shadow:\n style.boxShadow === 'none' ? '0 0 0 transparent' : style.boxShadow,\n }\n}\n\n// Crop the snapshots instead of stretching them to the changing box, so text\n// never squashes. The old content clears out early and the new fades in\n// late, so mid-way it's just the surface changing shape. The keyframes are\n// in AnvilRoot's global.css.\nfunction morphStyles(name: string, duration: number, easing: string) {\n return `\n::view-transition-group(${name}) {\n overflow: clip;\n animation-duration: ${duration}ms;\n animation-timing-function: ${easing};\n}\n::view-transition-image-pair(${name}),\n::view-transition-old(${name}),\n::view-transition-new(${name}) {\n animation-duration: ${duration}ms;\n}\n::view-transition-old(${name}),\n::view-transition-new(${name}) {\n width: 100%;\n height: 100%;\n object-fit: none;\n object-position: 50% 0;\n mix-blend-mode: normal;\n animation-timing-function: linear;\n}\n::view-transition-old(${name}) { animation-name: avl-morph-out; }\n::view-transition-new(${name}) { animation-name: avl-morph-in; }\n`\n}\n","import { useId, type ReactNode } from 'react'\nimport { Separator } from '@base-ui/react/separator'\nimport { SquigglyWave } from '../SquigglyWave/SquigglyWave'\nimport { cx, withClass } from '../../utils'\nimport './divider.css'\n\n/**\n * A thin line between groups of content. `orientation=\"vertical\"` stretches\n * to the height of its row, so put it in a flex row.\n */\nexport type DividerProps = Separator.Props & {\n /** Text in the middle of the line, with the line on both sides. */\n label?: ReactNode\n /**\n * Draw the line as a wave, like squiggly Progress. @default false\n */\n squiggly?: boolean\n}\n\nexport function Divider({\n label,\n squiggly = false,\n className,\n ...props\n}: DividerProps) {\n const labelId = useId()\n const hasLabel = label != null\n const vertical = props.orientation === 'vertical'\n // Pseudo-elements can't hold the wave, so squiggly lines are real elements\n const wave = squiggly && (\n <span className=\"avl-divider-wave\">\n <SquigglyWave\n still\n vertical={vertical}\n span={(width) => ({ from: 0, to: width, snap: true })}\n />\n </span>\n )\n\n return (\n <Separator\n // A separator's contents are hidden from screen readers, so name\n // it after the label instead\n aria-labelledby={hasLabel ? labelId : undefined}\n {...props}\n className={withClass(\n cx(\n 'avl-divider',\n hasLabel && 'avl-divider-labeled',\n squiggly && 'avl-divider-squiggly'\n ),\n className\n )}\n >\n {wave}\n {hasLabel && (\n <span id={labelId} className=\"avl-divider-label\">\n {label}\n </span>\n )}\n {hasLabel && wave}\n </Separator>\n )\n}\n","import { useEffect, useRef } from 'react'\nimport './squiggly-wave.css'\n\n// Internal: the wave drawn by squiggly Progress and Slider. Not exported.\n\n/** What to draw this frame, in px from the start of the track. */\nexport type WaveSpan = {\n /** Where the wave starts and ends (round caps included). */\n from: number\n to: number\n /** Flat track pieces to draw alongside it, as [start, end] pairs. */\n rest?: [number, number][]\n /** Draw the `rest` pieces as waves in step with the main one, not flat. */\n restWave?: boolean\n /** Draw the stop dot at the far end. */\n dot?: boolean\n /** Jump straight to `from`/`to` instead of easing toward them. */\n snap?: boolean\n}\n\nexport type SquigglyWaveProps = {\n /**\n * Called every frame with the track width, `--avl-wave-gap` in px, the\n * SVG and the frame time. Reads its inputs fresh each time, so it can\n * follow things that move between renders, like a dragged handle.\n */\n span: (\n width: number,\n gap: number,\n svg: SVGSVGElement,\n now: number\n ) => WaveSpan\n /**\n * Hold the wave still and only redraw when the size changes, for spans\n * that never move. @default false\n */\n still?: boolean\n /** Run top to bottom instead of left to right. @default false */\n vertical?: boolean\n}\n\n// Wave shape, in px: matches the 12px-tall squiggly track and 4px stroke\nconst WAVE_LENGTH = 40\nconst WAVE_AMPLITUDE = 3\nconst WAVE_MIDDLE = 6\nconst STROKE_CAP = 2 // round caps reach this far past each end\n\nfunction wavePath(from: number, to: number, phase: number) {\n // Keep the round caps inside the drawn range\n const start = from + STROKE_CAP\n const end = to - STROKE_CAP\n if (end < start) return ''\n\n const y = (x: number) =>\n WAVE_MIDDLE +\n // + phase: the ripple travels from the leading end back to the start\n WAVE_AMPLITUDE * Math.sin((2 * Math.PI * x) / WAVE_LENGTH + phase)\n let d = `M${start} ${y(start)}`\n for (let x = start + 2; x < end; x += 2) d += `L${x} ${y(x)}`\n return d + `L${end} ${y(end)}`\n}\n\n// A flat line through the middle, or nothing if too short for its caps.\n// Zero length still draws: round caps turn it into a dot.\nfunction linePath(from: number, to: number) {\n const start = from + STROKE_CAP\n const end = to - STROKE_CAP\n return end < start ? '' : `M${start} ${WAVE_MIDDLE}L${end} ${WAVE_MIDDLE}`\n}\n\n/**\n * One continuous wave drawn to an exact length, so it has no seams and gets\n * round ends. Redrawn every frame to ripple and to ease toward its new span;\n * with reduced motion it holds still and jumps.\n */\nexport function SquigglyWave(props: SquigglyWaveProps) {\n const svgRef = useRef<SVGSVGElement>(null)\n const waveRef = useRef<SVGPathElement>(null)\n const restRef = useRef<SVGPathElement>(null)\n const dotRef = useRef<SVGPathElement>(null)\n const span = useRef(props.span)\n span.current = props.span\n const still = props.still ?? false\n const vertical = props.vertical ?? false\n\n useEffect(() => {\n const svg = svgRef.current\n const wave = waveRef.current\n const rest = restRef.current\n const dot = dotRef.current\n if (!svg || !wave || !rest || !dot) return\n\n const reduced =\n still || matchMedia('(prefers-reduced-motion: reduce)').matches\n const gap =\n parseFloat(\n getComputedStyle(svg).getPropertyValue('--avl-wave-gap')\n ) || 0\n let current: { from: number; to: number } | null = null\n let frame = 0\n\n const draw = (now: number) => {\n // The wave math is all horizontal; vertical swaps the axes below\n const width = vertical ? svg.clientHeight : svg.clientWidth\n const next = span.current(width, gap, svg, now)\n if (!current || next.snap || reduced) {\n current = { from: next.from, to: next.to }\n } else {\n current.from += (next.from - current.from) * 0.15\n current.to += (next.to - current.to) * 0.15\n }\n const phase = reduced ? 0 : (now / 1000) * 2 * Math.PI\n\n wave.setAttribute('d', wavePath(current.from, current.to, phase))\n rest.setAttribute(\n 'd',\n (next.rest ?? [])\n .map(([a, b]) =>\n next.restWave ? wavePath(a, b, phase) : linePath(a, b)\n )\n .join('')\n )\n dot.setAttribute(\n 'd',\n next.dot ? linePath(width - 2 * STROKE_CAP, width) : ''\n )\n if (!still) frame = requestAnimationFrame(draw)\n }\n\n if (still) {\n // Fires once on observe too, for the first draw\n const observer = new ResizeObserver(() => draw(0))\n observer.observe(svg)\n return () => observer.disconnect()\n }\n frame = requestAnimationFrame(draw)\n return () => cancelAnimationFrame(frame)\n }, [still, vertical])\n\n return (\n <svg ref={svgRef} className=\"avl-squiggly-wave\" aria-hidden>\n <g transform={vertical ? 'matrix(0 1 1 0 0 0)' : undefined}>\n <path ref={restRef} className=\"avl-squiggly-wave-rest\" />\n <path ref={waveRef} />\n <path ref={dotRef} />\n </g>\n </svg>\n )\n}\n","import { useEffect, useRef, type RefObject } from 'react'\nimport {\n Button as BaseButton,\n type ButtonProps as BaseButtonProps,\n} from '@base-ui/react/button'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { colorClass, type ColorProps } from '../../colors/colors'\nimport { Icon } from '../Icon/Icon'\nimport { cx, mergeRefs, withClass } from '../../utils'\nimport './fab.css'\n\nexport type FABProps = Omit<BaseButtonProps, 'children'> &\n ColorProps & {\n /** Material Symbol to show. */\n icon: MaterialSymbol\n /** 40px, 56px or 96px tall. @default 'normal' */\n size?: 'small' | 'normal' | 'big'\n /** Stick to a mouse cursor that comes close. @default true */\n sticky?: boolean\n } & (\n | {\n /** Visible text next to the icon: makes it an extended FAB. */\n label: string\n 'aria-label'?: string\n }\n | {\n label?: never\n // No visible text, so it needs a name for screen readers\n 'aria-label': string\n }\n )\n\n/**\n * The floating action button: the screen's main action. Place it yourself,\n * usually `position: fixed` in the bottom-end corner.\n */\nexport function FAB({\n icon,\n label,\n size = 'normal',\n sticky = true,\n color,\n fillType,\n className,\n ref,\n ...props\n}: FABProps) {\n const local = useRef<HTMLButtonElement>(null)\n useMagnet(local, sticky && !props.disabled)\n\n return (\n <BaseButton\n {...props}\n ref={mergeRefs(local, ref)}\n className={withClass(\n cx(\n 'avl-fab',\n colorClass(color, fillType),\n `avl-fab-size-${size}`,\n label && 'avl-fab-extended'\n ),\n className\n )}\n >\n <Icon name={icon} />\n {label}\n </BaseButton>\n )\n}\n\n// How near the cursor has to come (px from the FAB's edge) to grab it, and\n// how much of the way toward the cursor the FAB moves (1 = centered on it)\nconst STICK_RANGE = 24\nconst STICK_STRENGTH = 0.35\n\n// Once the cursor is close, the FAB sticks to it: it follows the cursor part\n// of the way until the cursor moves out of range, then it springs back. Sets\n// --avl-fab-pull-x/y (and data-stuck); the CSS turns them into `translate`.\nfunction useMagnet(ref: RefObject<HTMLElement | null>, enabled: boolean) {\n useEffect(() => {\n const el = ref.current\n if (!el || !enabled) return\n // A mouse or trackpad only: touch has no cursor hovering near it\n if (!matchMedia('(pointer: fine)').matches) return\n if (matchMedia('(prefers-reduced-motion: reduce)').matches) return\n\n let pull = { x: 0, y: 0 }\n let frame = 0\n\n const set = (x: number, y: number, stuck: boolean) => {\n pull = { x, y }\n el.style.setProperty('--avl-fab-pull-x', `${x}px`)\n el.style.setProperty('--avl-fab-pull-y', `${y}px`)\n el.toggleAttribute('data-stuck', stuck)\n }\n\n const onMove = (event: PointerEvent) => {\n if (event.pointerType === 'touch') return\n cancelAnimationFrame(frame)\n frame = requestAnimationFrame(() => {\n // Where it sits without the pull, so moving doesn't feed back\n const rect = el.getBoundingClientRect()\n const left = rect.left - pull.x\n const top = rect.top - pull.y\n const dx = event.clientX - (left + rect.width / 2)\n const dy = event.clientY - (top + rect.height / 2)\n // Measured from its resting edge, so a wide extended FAB can\n // be grabbed anywhere along its length\n const gapX = Math.max(0, Math.abs(dx) - rect.width / 2)\n const gapY = Math.max(0, Math.abs(dy) - rect.height / 2)\n if (Math.hypot(gapX, gapY) > STICK_RANGE) {\n if (pull.x || pull.y) set(0, 0, false)\n return\n }\n // Follow the cursor, but only as far as a round FAB would\n // go, so an extended one doesn't slide along under its label\n const reach = rect.height / 2 + STICK_RANGE\n const clamp = (d: number) =>\n Math.max(-reach, Math.min(reach, d))\n set(\n clamp(dx) * STICK_STRENGTH,\n clamp(dy) * STICK_STRENGTH,\n true\n )\n })\n }\n\n const release = () => {\n cancelAnimationFrame(frame)\n set(0, 0, false)\n }\n\n document.addEventListener('pointermove', onMove, { passive: true })\n document.documentElement.addEventListener('pointerleave', release)\n return () => {\n cancelAnimationFrame(frame)\n document.removeEventListener('pointermove', onMove)\n document.documentElement.removeEventListener(\n 'pointerleave',\n release\n )\n el.style.removeProperty('--avl-fab-pull-x')\n el.style.removeProperty('--avl-fab-pull-y')\n el.removeAttribute('data-stuck')\n }\n }, [ref, enabled])\n}\n","import { Field as BaseField } from '@base-ui/react/field'\nimport { withClass } from '../../utils'\nimport './field.css'\n\n/**\n * Wraps one control (`Input`, `Textarea`, `Select`, ...) to add helper text,\n * an error message and validation. Takes `name`, `validate`, `invalid`,\n * `disabled` and `validationMode`.\n *\n * Validation runs on form submit by default. Outside a `<form>`, or to check\n * earlier, set `validationMode=\"onBlur\"` or `\"onChange\"`.\n */\nexport type FieldProps = BaseField.Root.Props\n\nexport function Field({ className, ...props }: FieldProps) {\n return (\n <BaseField.Root\n {...props}\n className={withClass('avl-field', className)}\n />\n )\n}\n\n// Helper text under the control. Hidden while a FieldError is showing.\nexport type FieldDescriptionProps = BaseField.Description.Props\n\nexport function FieldDescription({\n className,\n ...props\n}: FieldDescriptionProps) {\n return (\n <BaseField.Description\n {...props}\n className={withClass('avl-field-description', className)}\n />\n )\n}\n\n// Shows while the field is invalid. Without children it shows the browser's\n// message or the one `validate` returned. Pass `match` (e.g. \"valueMissing\")\n// to show it only for one kind of problem.\nexport type FieldErrorProps = BaseField.Error.Props\n\nexport function FieldError({ className, ...props }: FieldErrorProps) {\n return (\n <BaseField.Error\n {...props}\n className={withClass('avl-field-error', className)}\n />\n )\n}\n","import {\n Button as BaseButton,\n ButtonProps as BaseButtonProps,\n} from '@base-ui/react/button'\nimport type { MaterialSymbol } from 'material-symbols'\nimport {\n ComponentColor,\n ComponentFillType,\n colorClass,\n} from '../../colors/colors'\nimport { Icon } from '../Icon/Icon'\nimport { withClass } from '../../utils'\nimport './icon-button.css'\n\nexport type IconButtonProps = Omit<BaseButtonProps, 'children'> & {\n icon: MaterialSymbol\n fillType?: ComponentFillType\n color?: ComponentColor\n // There is no visible text, so the button needs a name for screen readers.\n 'aria-label': string\n}\n\nexport function IconButton({\n icon,\n color,\n fillType,\n className,\n ...props\n}: IconButtonProps) {\n return (\n <BaseButton\n {...props}\n className={withClass(\n `avl-icon-button ${colorClass(color, fillType)}`,\n className\n )}\n >\n <Icon name={icon} />\n </BaseButton>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Input as BaseInput } from '@base-ui/react/input'\nimport { cx } from '../../utils'\nimport './input.css'\n\nexport type InputProps = Omit<BaseInput.Props, 'className' | 'size'> & {\n /** Floating label. Sits inside the field and moves onto the border once it has focus or a value. */\n label?: ReactNode\n /**\n * `small` is shorter, and its label works like a placeholder: it hides\n * once there's text instead of moving onto the border. @default 'normal'\n */\n size?: 'small' | 'normal'\n /** Applied to the outer wrapper, so width and margins work as expected. */\n className?: string\n}\n\nexport function Input({\n label,\n size = 'normal',\n className,\n placeholder,\n ...props\n}: InputProps) {\n return (\n <label\n className={cx(\n 'avl-input',\n `avl-input-size-${size}`,\n label != null && 'avl-input-labeled',\n className\n )}\n >\n {/* A placeholder is needed for :placeholder-shown, which floats the label. */}\n <BaseInput\n {...props}\n placeholder={placeholder ?? ' '}\n className=\"avl-input-field\"\n />\n {label != null && <span className=\"avl-input-label\">{label}</span>}\n {/* The border. Its <legend> holds a hidden copy of the label so the\n browser cuts a gap in the border exactly as wide as the label. */}\n <fieldset aria-hidden className=\"avl-input-outline\">\n <legend>\n {label != null && size === 'normal' && <span>{label}</span>}\n </legend>\n </fieldset>\n </label>\n )\n}\n","import type { ComponentProps, ReactNode } from 'react'\nimport { useRender } from '@base-ui/react/use-render'\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { cx } from '../../utils'\nimport './list.css'\n\nexport type ListProps = ComponentProps<'ul'> & {\n /** Thin lines between the items. @default false */\n divided?: boolean\n}\n\n/** A column of `ListItem`s. */\nexport function List({ divided = false, className, ...props }: ListProps) {\n return (\n <ul\n {...props}\n className={cx('avl-list', divided && 'avl-list-divided', className)}\n />\n )\n}\n\n/**\n * One row. Static by default; pass `render` to make the whole row\n * interactive: `render={<a href=\"/settings\" />}` for a link, or\n * `render={<label />}` so clicking anywhere toggles a Switch or Checkbox\n * in `start` or `end`.\n */\nexport type ListItemProps = Omit<\n useRender.ComponentProps<'div'>,\n 'children'\n> & {\n /** The main text. */\n label: ReactNode\n /** Supporting text under the label, up to two lines. */\n description?: ReactNode\n /** Before the text: an `Icon`, `Avatar`, `Checkbox`, ... */\n start?: ReactNode\n /** After the text: a `Switch`, `Badge`, short text, an `Icon`, ... */\n end?: ReactNode\n}\n\nexport function ListItem({\n label,\n description,\n start,\n end,\n render,\n className,\n ...props\n}: ListItemProps) {\n const row = useRender({\n defaultTagName: 'div',\n render,\n props: mergeProps<'div'>(\n {\n className: cx(\n 'avl-list-item',\n description != null && 'avl-list-item-two-line',\n className\n ),\n children: (\n <>\n {start != null && (\n <span className=\"avl-list-item-start\">{start}</span>\n )}\n <span className=\"avl-list-item-text\">\n <span className=\"avl-list-item-label\">{label}</span>\n {description != null && (\n <span className=\"avl-list-item-description\">\n {description}\n </span>\n )}\n </span>\n {end != null && (\n <span className=\"avl-list-item-end\">{end}</span>\n )}\n </>\n ),\n },\n props\n ),\n })\n\n // The <li> stays, so it's still a list to screen readers when the row\n // itself is a link or label\n return <li className=\"avl-list-item-wrapper\">{row}</li>\n}\n","import { createContext, useContext } from 'react'\nimport { Menu as BaseMenu } from '@base-ui/react/menu'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { Icon } from '../Icon/Icon'\nimport { withClass } from '../../utils'\nimport './menu.css'\n\nexport type MenuProps = BaseMenu.Root.Props\n\nexport function Menu(props: MenuProps) {\n return <BaseMenu.Root {...props} />\n}\n\n// Renders a bare button. Pass `render={<Button />}` to use the library button.\nexport type MenuTriggerProps = BaseMenu.Trigger.Props\n\nexport function MenuTrigger({ className, ...props }: MenuTriggerProps) {\n return (\n <BaseMenu.Trigger\n {...props}\n className={withClass('avl-menu-trigger', className)}\n />\n )\n}\n\n// True inside a MenuSubmenu, so its popup can space itself from the parent's\nconst SubmenuContext = createContext(false)\n\n// Also renders the portal and positioner, so it takes their placement props.\nexport type MenuPopupProps = BaseMenu.Popup.Props &\n Pick<\n BaseMenu.Positioner.Props,\n 'side' | 'align' | 'sideOffset' | 'alignOffset'\n >\n\nexport function MenuPopup({\n side,\n align,\n sideOffset,\n alignOffset,\n className,\n ...props\n}: MenuPopupProps) {\n const avl = useContext(AnvilContext)\n const isSubmenu = useContext(SubmenuContext)\n\n return (\n // Into the AnvilRoot, not `body`, so the popup sees the theme variables\n <BaseMenu.Portal container={avl?.rootRef}>\n <BaseMenu.Positioner\n className=\"avl-menu-positioner\"\n side={side}\n align={align}\n // A submenu clears its parent's padding and lines its first\n // item up with the trigger\n sideOffset={sideOffset ?? (isSubmenu ? 8 : 4)}\n alignOffset={alignOffset ?? (isSubmenu ? -4 : undefined)}\n >\n <BaseMenu.Popup\n {...props}\n className={withClass('avl-menu-popup', className)}\n />\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n )\n}\n\n// A menu nested in another one: put a MenuSubmenuTrigger and a MenuPopup in it,\n// and place the whole thing among the parent's items.\nexport type MenuSubmenuProps = BaseMenu.SubmenuRoot.Props\n\nexport function MenuSubmenu(props: MenuSubmenuProps) {\n return (\n <SubmenuContext value={true}>\n <BaseMenu.SubmenuRoot {...props} />\n </SubmenuContext>\n )\n}\n\n// Looks like a MenuItem, with an arrow at the end. Opens on hover or click.\nexport type MenuSubmenuTriggerProps = BaseMenu.SubmenuTrigger.Props & {\n startIcon?: MaterialSymbol\n}\n\nexport function MenuSubmenuTrigger({\n startIcon,\n className,\n children,\n ...props\n}: MenuSubmenuTriggerProps) {\n return (\n <BaseMenu.SubmenuTrigger\n {...props}\n className={withClass('avl-menu-item', className)}\n >\n {startIcon && <Icon name={startIcon} />}\n <span className=\"avl-menu-item-label\">{children}</span>\n <Icon name=\"arrow_right\" />\n </BaseMenu.SubmenuTrigger>\n )\n}\n\n// Splits the menu: each group is its own container, with a gap between them.\n// Items placed straight in the popup, outside any group, share a single one.\nexport type MenuGroupProps = BaseMenu.Group.Props\n\nexport function MenuGroup({ className, ...props }: MenuGroupProps) {\n return (\n <BaseMenu.Group\n {...props}\n className={withClass('avl-menu-group', className)}\n />\n )\n}\n\nexport type MenuItemProps = BaseMenu.Item.Props & {\n startIcon?: MaterialSymbol\n endIcon?: MaterialSymbol\n}\n\nexport function MenuItem({\n startIcon,\n endIcon,\n className,\n children,\n ...props\n}: MenuItemProps) {\n return (\n <BaseMenu.Item\n {...props}\n className={withClass('avl-menu-item', className)}\n >\n {startIcon && <Icon name={startIcon} />}\n <span className=\"avl-menu-item-label\">{children}</span>\n {endIcon && <Icon name={endIcon} />}\n </BaseMenu.Item>\n )\n}\n","import { useContext, type Ref } from 'react'\nimport { Popover as BasePopover } from '@base-ui/react/popover'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { mergeRefs, withClass } from '../../utils'\nimport { MorphContext, useMorphOpen } from '../../morph'\nimport '../Menu/menu.css'\nimport './popover.css'\n\nexport type PopoverProps = BasePopover.Root.Props & {\n /**\n * Grow the popover out of its trigger, and shrink it back into it on\n * close, like an avatar opening into a profile card. @default false\n */\n morph?: boolean\n}\n\nexport function Popover({\n morph = false,\n defaultOpen = false,\n ...props\n}: PopoverProps) {\n const state = useMorphOpen({\n morph,\n open: props.open,\n defaultOpen,\n onOpenChange: props.onOpenChange,\n })\n\n return (\n <MorphContext value={state.refs}>\n <BasePopover.Root\n {...props}\n open={state.open}\n onOpenChange={state.onOpenChange}\n />\n </MorphContext>\n )\n}\n\n// Renders a bare button. Pass `render={<Button />}` to use the library button.\nexport type PopoverTriggerProps = BasePopover.Trigger.Props\n\nexport function PopoverTrigger({\n className,\n ref,\n ...props\n}: PopoverTriggerProps) {\n const morph = useContext(MorphContext)\n\n return (\n <BasePopover.Trigger\n {...props}\n ref={mergeRefs(morph?.trigger, ref as Ref<HTMLElement>)}\n className={withClass('avl-popover-trigger', className)}\n />\n )\n}\n\n// Also renders the portal and positioner, so it takes their placement props.\nexport type PopoverPopupProps = BasePopover.Popup.Props &\n Pick<\n BasePopover.Positioner.Props,\n 'side' | 'align' | 'sideOffset' | 'alignOffset'\n >\n\nexport function PopoverPopup({\n side,\n align,\n sideOffset,\n alignOffset,\n className,\n ref,\n ...props\n}: PopoverPopupProps) {\n const avl = useContext(AnvilContext)\n const morph = useContext(MorphContext)\n\n return (\n // Into the AnvilRoot, not body, so the popup sees the theme variables\n <BasePopover.Portal container={avl?.rootRef}>\n <BasePopover.Positioner\n className=\"avl-menu-positioner\"\n side={side}\n align={align}\n sideOffset={sideOffset ?? 4}\n alignOffset={alignOffset}\n >\n {/* Menu's surface and open/close animation, with more room inside */}\n <BasePopover.Popup\n {...props}\n ref={mergeRefs(morph?.popup, ref as Ref<HTMLElement>)}\n className={withClass(\n 'avl-menu-popup avl-popover-popup',\n className\n )}\n />\n </BasePopover.Positioner>\n </BasePopover.Portal>\n )\n}\n\n// Names the popup for screen readers. Renders an <h2>; pass `render={<h3 />}`\n// (or another level) to fit the page's headings.\nexport type PopoverTitleProps = BasePopover.Title.Props\n\nexport function PopoverTitle({ className, ...props }: PopoverTitleProps) {\n return (\n <BasePopover.Title\n {...props}\n className={withClass('avl-popover-title', className)}\n />\n )\n}\n\nexport type PopoverDescriptionProps = BasePopover.Description.Props\n\nexport function PopoverDescription({\n className,\n ...props\n}: PopoverDescriptionProps) {\n return (\n <BasePopover.Description\n {...props}\n className={withClass('avl-popover-description', className)}\n />\n )\n}\n\n// Closes the popover. Renders a bare button; pass `render={<Button />}` or\n// `render={<IconButton ... />}` to use the library's.\nexport type PopoverCloseProps = BasePopover.Close.Props\n\nexport function PopoverClose({ className, ...props }: PopoverCloseProps) {\n return (\n <BasePopover.Close\n {...props}\n className={withClass('avl-popover-close', className)}\n />\n )\n}\n","import type { CSSProperties, ReactNode } from 'react'\nimport { Progress as BaseProgress } from '@base-ui/react/progress'\nimport { SquigglyWave, type WaveSpan } from '../SquigglyWave/SquigglyWave'\nimport { cx, withClass } from '../../utils'\nimport './progress.css'\n\nexport type ProgressProps = BaseProgress.Root.Props & {\n /**\n * A bar, a ring, or a small ring the size of the surrounding text, to\n * place inside a line of text. @default 'linear'\n */\n type?: 'linear' | 'circular' | 'inline'\n /** Draw the filled part of a linear bar as a moving wave. @default false */\n squiggly?: boolean\n} & (\n | {\n /** Visible label above the indicator. */\n label: ReactNode\n 'aria-label'?: never\n }\n | {\n label?: never\n /** Accessible name, when there's no visible `label`. */\n 'aria-label': string\n }\n )\n\n// Circle drawn with pathLength=100, so dash lengths are percentages.\n// Round caps stick out past each dash end, so the gap has to cover them too.\n// The inline ring has a thicker stroke (see progress.css), so it needs a\n// smaller radius to fit the 48 viewBox and a wider gap for the bigger caps.\nconst RING = { r: 20, gap: 8 }\nconst INLINE_RING = { r: 18, gap: 12 }\n\n/** Pass `value={null}` while the amount of work is unknown. */\nexport function Progress({\n type = 'linear',\n squiggly = false,\n label,\n className,\n style,\n children,\n ...props\n}: ProgressProps) {\n const { value, min = 0, max = 100 } = props\n const fraction =\n value == null\n ? 0\n : Math.min(1, Math.max(0, (value - min) / (max - min)))\n const pct = fraction * 100\n // No filled part yet: the ring is whole, without a gap\n const ring = type === 'inline' ? INLINE_RING : RING\n const ringGap = pct > 0 ? ring.gap : 0\n\n return (\n <BaseProgress.Root\n {...props}\n className={withClass(\n cx(\n 'avl-progress',\n `avl-progress-${type}`,\n // Inline is a smaller ring, so it shares the circular styles\n type === 'inline' && 'avl-progress-circular',\n squiggly && type === 'linear' && 'avl-progress-squiggly'\n ),\n className\n )}\n // Base UI's style may be a function of state; keep both forms working\n style={(state) =>\n ({\n '--avl-progress-fraction': fraction,\n ...(typeof style === 'function' ? style(state) : style),\n }) as CSSProperties\n }\n >\n {label != null && (\n <BaseProgress.Label className=\"avl-progress-label\">\n {label}\n </BaseProgress.Label>\n )}\n {type === 'linear' ? (\n <BaseProgress.Track className=\"avl-progress-track\">\n {squiggly ? (\n <SquigglyWave\n span={(width, gap, _svg, now) =>\n value == null\n ? loadingSpan(width, gap, now)\n : // Fill up to the value; .avl-progress-rest\n // draws the track one gap after it\n { from: 0, to: fraction * width }\n }\n />\n ) : (\n <BaseProgress.Indicator className=\"avl-progress-indicator\" />\n )}\n <span className=\"avl-progress-rest\" />\n </BaseProgress.Track>\n ) : (\n <BaseProgress.Track\n className=\"avl-progress-ring\"\n render={<svg viewBox=\"0 0 48 48\" />}\n >\n <circle\n className=\"avl-progress-ring-rest\"\n cx=\"24\"\n cy=\"24\"\n r={ring.r}\n pathLength={100}\n strokeDasharray={`${Math.max(0, 100 - pct - 2 * ringGap)} 100`}\n strokeDashoffset={-(pct + ringGap)}\n />\n <circle\n className=\"avl-progress-ring-indicator\"\n cx=\"24\"\n cy=\"24\"\n r={ring.r}\n pathLength={100}\n strokeDasharray={\n value == null ? '25 100' : `${pct} 100`\n }\n />\n </BaseProgress.Track>\n )}\n {children}\n </BaseProgress.Root>\n )\n}\n\n// Unknown duration: a wave segment 40% wide sweeps from off the start to off\n// the end, and the track is drawn around it as the same wave, with a gap on\n// each side\nfunction loadingSpan(width: number, gap: number, now: number): WaveSpan {\n const reduced = matchMedia('(prefers-reduced-motion: reduce)').matches\n const period = reduced ? 4000 : 1500\n const segment = width * 0.4\n const left = -segment + ((now % period) / period) * (width + segment)\n const from = Math.max(0, left)\n const to = Math.min(width, left + segment)\n const visible = to - from > 0\n return {\n from,\n to,\n rest: visible\n ? [\n [0, from - gap],\n [to + gap, width],\n ]\n : [[0, width]],\n restWave: true,\n snap: true,\n }\n}\n","import { createContext, useContext, useLayoutEffect, useRef } from 'react'\nimport { Radio as BaseRadio } from '@base-ui/react/radio'\nimport { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group'\nimport { Toggle as BaseToggle } from '@base-ui/react/toggle'\nimport { ToggleGroup as BaseToggleGroup } from '@base-ui/react/toggle-group'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { ColorProps, colorClass } from '../../colors/colors'\nimport { Icon } from '../Icon/Icon'\nimport { mergeRefs, withClass } from '../../utils'\nimport './toggle-group.css'\n\ntype ToggleGroupCommonProps = ColorProps & {\n /** @default 'normal' */\n size?: 'small' | 'normal' | 'big'\n}\n\nexport type ToggleGroupProps<Value = any> = ToggleGroupCommonProps &\n (\n | (BaseRadioGroup.Props<Value> & {\n /**\n * Let several segments be on at once. `value` is then an array\n * of strings. @default false\n */\n multiple?: false\n })\n | (BaseToggleGroup.Props<string> & { multiple: true })\n )\n\n// Items render as radios or as toggles depending on the group\nconst MultipleContext = createContext(false)\n\n/**\n * A segmented control: buttons in a row. By default exactly one is selected,\n * with a pill that stretches over to it. With `multiple`, each one toggles on\n * and off. Use it for 2-5 short options; for longer lists or forms, use\n * `RadioGroup` or checkboxes.\n */\nexport function ToggleGroup<Value>({\n size = 'normal',\n color,\n fillType,\n multiple = false,\n children,\n className,\n ref,\n ...props\n}: ToggleGroupProps<Value>) {\n const groupRef = useRef<HTMLDivElement>(null)\n const indicatorRef = useRef<HTMLDivElement>(null)\n\n // The pill follows whichever radio has [data-checked]. Watching the DOM\n // covers controlled, uncontrolled and resizes without mirroring state.\n useLayoutEffect(() => {\n const group = groupRef.current\n const indicator = indicatorRef.current\n if (!group || !indicator) return\n let previousLeft: number | null = null\n\n const place = () => {\n const checked = group.querySelector<HTMLElement>(\n '.avl-toggle-group-item[data-checked]'\n )\n indicator.style.opacity = checked ? '1' : '0'\n if (!checked) return\n const left = checked.offsetLeft\n // The leading edge moves first and the trailing one follows, so\n // the pill stretches toward the new option, then catches up\n if (previousLeft != null && left !== previousLeft) {\n indicator.dataset.direction =\n left > previousLeft ? 'forward' : 'backward'\n }\n previousLeft = left\n indicator.style.left = `${left}px`\n indicator.style.right = `${group.clientWidth - left - checked.offsetWidth}px`\n }\n\n place()\n // only slide after the first placement, so it doesn't fly in from 0\n const frame = requestAnimationFrame(() =>\n group.setAttribute('data-ready', '')\n )\n\n const mutations = new MutationObserver(place)\n mutations.observe(group, {\n subtree: true,\n childList: true,\n attributeFilter: ['data-checked'],\n })\n const resizes = new ResizeObserver(place)\n resizes.observe(group)\n\n return () => {\n cancelAnimationFrame(frame)\n mutations.disconnect()\n resizes.disconnect()\n }\n }, [multiple])\n\n const classes = withClass(\n 'avl-toggle-group ' +\n colorClass(color, fillType) +\n `avl-toggle-group-size-${size}`,\n // Its state type depends on which group renders; both take a string\n className as string | undefined\n )\n\n return (\n <MultipleContext value={multiple}>\n {multiple ? (\n <BaseToggleGroup\n {...(props as BaseToggleGroup.Props<string>)}\n multiple\n ref={ref}\n className={classes}\n >\n {children}\n </BaseToggleGroup>\n ) : (\n <BaseRadioGroup\n {...(props as BaseRadioGroup.Props<Value>)}\n ref={mergeRefs(groupRef, ref)}\n className={classes}\n >\n <div\n ref={indicatorRef}\n className=\"avl-toggle-group-indicator\"\n aria-hidden\n />\n {children}\n </BaseRadioGroup>\n )}\n </MultipleContext>\n )\n}\n\nexport type ToggleGroupItemProps<Value = any> = BaseRadio.Root.Props<Value> & {\n /** Material Symbol shown before the label. */\n startIcon?: MaterialSymbol\n /** Material Symbol shown after the label. */\n endIcon?: MaterialSymbol\n}\n\n/**\n * One option in a `ToggleGroup`. Requires a `value` (a string when the\n * group is `multiple`).\n */\nexport function ToggleGroupItem<Value>({\n startIcon,\n endIcon,\n children,\n className,\n value,\n ...props\n}: ToggleGroupItemProps<Value>) {\n const multiple = useContext(MultipleContext)\n const classes = withClass(\n 'avl-toggle-group-item',\n className as string | undefined\n )\n const content = (\n <>\n {startIcon && <Icon name={startIcon} />}\n {children}\n {endIcon && <Icon name={endIcon} />}\n </>\n )\n\n if (multiple) {\n return (\n <BaseToggle\n {...(props as BaseToggle.Props)}\n value={String(value)}\n className={classes}\n >\n {/* Grows in when pressed, so it's clear which ones are on */}\n <Icon name=\"check\" className=\"avl-toggle-group-check\" />\n {content}\n </BaseToggle>\n )\n }\n\n return (\n <BaseRadio.Root\n {...props}\n value={value}\n nativeButton\n render={<button />}\n className={classes}\n >\n {content}\n </BaseRadio.Root>\n )\n}\n","import { Radio as BaseRadio } from '@base-ui/react/radio'\nimport { RadioGroup as BaseRadioGroup } from '@base-ui/react/radio-group'\nimport { withClass } from '../../utils'\nimport './radio-group.css'\n\nexport type RadioGroupProps<Value = any> = BaseRadioGroup.Props<Value>\n\nexport function RadioGroup<Value>({\n className,\n ...props\n}: RadioGroupProps<Value>) {\n return (\n <BaseRadioGroup\n {...props}\n className={withClass('avl-radio-group', className)}\n />\n )\n}\n\nexport type RadioProps<Value = any> = BaseRadio.Root.Props<Value>\n\nexport function Radio<Value>({ className, ...props }: RadioProps<Value>) {\n return (\n <BaseRadio.Root\n {...props}\n className={withClass('avl-radio', className)}\n >\n <BaseRadio.Indicator className=\"avl-radio-indicator\" />\n </BaseRadio.Root>\n )\n}\n","import { useContext, type ReactNode } from 'react'\nimport { Select as BaseSelect } from '@base-ui/react/select'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { Icon } from '../Icon/Icon'\nimport { cx, withClass } from '../../utils'\nimport '../Input/input.css'\nimport '../Menu/menu.css'\nimport './select.css'\n\nexport type SelectProps<\n Value,\n Multiple extends boolean | undefined = false,\n> = BaseSelect.Root.Props<Value, Multiple> & {\n /** Floating label. Sits inside the field and moves onto the border once it's focused or has a value. */\n label?: ReactNode\n /** Shown when nothing is selected. With a `label`, only once the label has moved up. */\n placeholder?: ReactNode\n /**\n * `small` is shorter, and its label works like a placeholder: it hides\n * once a value is selected instead of moving onto the border. @default 'normal'\n */\n size?: 'small' | 'normal'\n /** Applied to the outer wrapper, so width and margins work as expected. */\n className?: string\n}\n\n/**\n * Put `SelectItem`s inside. Pass `items` (value → label) so the field shows\n * the selected item's label rather than its raw value.\n */\nexport function Select<Value, Multiple extends boolean | undefined = false>({\n label,\n placeholder,\n size = 'normal',\n className,\n children,\n ...props\n}: SelectProps<Value, Multiple>) {\n const avl = useContext(AnvilContext)\n\n return (\n <BaseSelect.Root {...props}>\n {/* Same structure and classes as Input, so it looks the same */}\n <div\n className={cx(\n 'avl-input',\n 'avl-select',\n `avl-input-size-${size}`,\n label != null && 'avl-input-labeled',\n className\n )}\n >\n <BaseSelect.Trigger className=\"avl-input-field avl-select-trigger\">\n <BaseSelect.Value\n className=\"avl-select-value\"\n placeholder={placeholder}\n />\n <BaseSelect.Icon className=\"avl-select-icon\">\n <Icon name=\"arrow_drop_down\" />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n {label != null && (\n <BaseSelect.Label className=\"avl-input-label\">\n {label}\n </BaseSelect.Label>\n )}\n <fieldset aria-hidden className=\"avl-input-outline\">\n <legend>\n {label != null && size === 'normal' && (\n <span>{label}</span>\n )}\n </legend>\n </fieldset>\n </div>\n {/* Into the AnvilRoot, not body, so the popup sees the theme variables */}\n <BaseSelect.Portal container={avl?.rootRef}>\n <BaseSelect.Positioner\n className=\"avl-menu-positioner\"\n // Open below the field like Material, not over it like macOS\n alignItemWithTrigger={false}\n sideOffset={4}\n >\n <BaseSelect.Popup className=\"avl-menu-popup avl-select-popup\">\n {children}\n </BaseSelect.Popup>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n </BaseSelect.Root>\n )\n}\n\nexport type SelectItemProps = BaseSelect.Item.Props\n\nexport function SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <BaseSelect.Item\n {...props}\n className={withClass('avl-menu-item avl-select-item', className)}\n >\n <BaseSelect.ItemText className=\"avl-menu-item-label\">\n {children}\n </BaseSelect.ItemText>\n <BaseSelect.ItemIndicator className=\"avl-select-item-indicator\">\n <Icon name=\"check\" />\n </BaseSelect.ItemIndicator>\n </BaseSelect.Item>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Slider as BaseSlider } from '@base-ui/react/slider'\nimport { SquigglyWave, type WaveSpan } from '../SquigglyWave/SquigglyWave'\nimport { cx, withClass } from '../../utils'\nimport '../Tooltip/tooltip.css'\nimport './slider.css'\n\nexport type SliderProps<\n Value extends number | readonly number[] = number | readonly number[],\n> = BaseSlider.Root.Props<Value> & {\n /** Show the value in a bubble above the handle while it's dragged or focused. @default true */\n showValue?: boolean\n /**\n * Thin track with the selected part drawn as a moving wave, like a\n * squiggly `Progress`. Horizontal only. @default false\n */\n squiggly?: boolean\n} &\n // Something has to name the slider for screen readers\n (\n | {\n /** Visible label above the slider. */\n label: ReactNode\n 'aria-label'?: never\n }\n | {\n label?: never\n /** Accessible name, when there's no visible `label`. */\n 'aria-label': string\n }\n )\n\n/**\n * Pass an array as `value` / `defaultValue` for a range with several handles.\n * `orientation=\"vertical\"` is 160px tall by default; set a height via `className`.\n */\nexport function Slider<Value extends number | readonly number[]>({\n label,\n 'aria-label': ariaLabel,\n showValue = true,\n squiggly = false,\n className,\n ...props\n}: SliderProps<Value>) {\n const initial = props.value ?? props.defaultValue\n const thumbCount = Array.isArray(initial) ? initial.length : 1\n const wavy = squiggly && props.orientation !== 'vertical'\n\n return (\n <BaseSlider.Root\n {...(props as BaseSlider.Root.Props<Value>)}\n className={withClass(\n cx(\n 'avl-slider',\n thumbCount > 1 && 'avl-slider-range',\n wavy && 'avl-slider-squiggly'\n ),\n className\n )}\n >\n {label != null && (\n <BaseSlider.Label className=\"avl-slider-label\">\n {label}\n </BaseSlider.Label>\n )}\n <BaseSlider.Control className=\"avl-slider-control\">\n <BaseSlider.Track className=\"avl-slider-track\">\n {wavy ? (\n <SquigglyWave span={handleSpan} />\n ) : (\n // Clips the track pieces to the rounded track, without\n // also clipping the handles, which are taller\n <div className=\"avl-slider-rail\">\n <BaseSlider.Indicator className=\"avl-slider-indicator\" />\n </div>\n )}\n {Array.from({ length: thumbCount }, (_, i) => (\n <BaseSlider.Thumb\n key={i}\n index={i}\n aria-label={ariaLabel}\n className=\"avl-slider-thumb\"\n >\n {showValue && (\n <BaseSlider.Value className=\"avl-tooltip avl-slider-value\">\n {(formatted) => formatted[i]}\n </BaseSlider.Value>\n )}\n </BaseSlider.Thumb>\n ))}\n </BaseSlider.Track>\n </BaseSlider.Control>\n </BaseSlider.Root>\n )\n}\n\n// Squiggly: the wave runs between the handles (or from the start to the only\n// one), and the track fills the rest, each stopping a gap short of a handle.\n// Measures the handles every frame, so it follows a drag exactly.\nfunction handleSpan(width: number, gap: number, svg: SVGSVGElement): WaveSpan {\n const box = svg.getBoundingClientRect()\n const centers = Array.from(\n svg.parentElement?.querySelectorAll('.avl-slider-thumb') ?? [],\n (thumb) => {\n const rect = thumb.getBoundingClientRect()\n return rect.left + rect.width / 2 - box.left\n }\n )\n if (centers.length === 0) return { from: 0, to: 0, snap: true }\n\n const first = centers[0]\n const last = centers[centers.length - 1]\n const range = centers.length > 1\n return {\n from: range ? first + gap : 0,\n to: last - gap,\n rest: range\n ? [\n [0, first - gap],\n [last + gap, width],\n ]\n : [[last + gap, width]],\n dot: last + gap < width - gap,\n snap: true,\n }\n}\n","import { useEffect, useRef, useState, type ReactNode } from 'react'\nimport { Toast } from '@base-ui/react/toast'\nimport { Icon } from '../Icon/Icon'\nimport './snackbar.css'\n\nexport type SnackbarOptions = {\n /** The text shown. Keep it to a line or two. */\n message: ReactNode\n /** One text button, like \"Undo\". Clicking it also closes the snackbar. */\n action?: { label: ReactNode; onClick: () => void }\n /** Show a close (×) button. @default false */\n closeButton?: boolean\n /** Milliseconds before it closes on its own; `0` keeps it open. @default 5000 */\n timeout?: number\n /** `high` makes screen readers announce it right away. @default 'low' */\n priority?: 'low' | 'high'\n /** Called once it has closed, however that happened. */\n onClose?: () => void\n}\n\ntype SnackbarData = { closeButton?: boolean }\n\n/**\n * Shows snackbars: `const snackbar = useSnackbar()`, then\n * `snackbar.show({ message: 'Saved' })`. Works anywhere inside `AnvilRoot`.\n */\nexport function useSnackbar() {\n const manager = Toast.useToastManager<SnackbarData>()\n\n return {\n /** Shows a snackbar at the bottom; open ones move up. Returns its id. */\n show: ({ message, action, closeButton, ...options }: SnackbarOptions) =>\n manager.add({\n ...options,\n description: message,\n actionProps: action && {\n children: action.label,\n onClick: action.onClick,\n },\n data: { closeButton },\n }),\n /** Closes one snackbar by id, or all of them. */\n close: manager.close,\n }\n}\n\n// Rendered once by AnvilRoot, inside its Toast.Provider.\nexport function SnackbarViewport() {\n const { toasts } = Toast.useToastManager<SnackbarData>()\n const viewportRef = useRef<HTMLDivElement>(null)\n // Opens on hover, and stays open after a click or tap (no hover on touch)\n const [expanded, setExpanded] = useState(false)\n const [hovered, setHovered] = useState(false)\n const visibleCount = toasts.filter(\n (toast) => toast.transitionStatus !== 'ending'\n ).length\n const collapsed = visibleCount > 1 && !expanded && !hovered\n\n // Start collapsed again the next time a stack builds up\n useEffect(() => {\n if (visibleCount <= 1) setExpanded(false)\n }, [visibleCount])\n\n // Clicking or focusing anywhere else folds the list back up\n useEffect(() => {\n if (!expanded) return\n const viewport = viewportRef.current\n const close = (event: Event) => {\n if (!viewport?.contains(event.target as Node)) setExpanded(false)\n }\n document.addEventListener('pointerdown', close)\n document.addEventListener('focusin', close)\n return () => {\n document.removeEventListener('pointerdown', close)\n document.removeEventListener('focusin', close)\n }\n }, [expanded])\n\n let visibleIndex = 0\n\n return (\n <Toast.Viewport\n ref={viewportRef}\n className=\"avl-snackbar-viewport\"\n data-collapsed={collapsed || undefined}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={(event) => {\n // Buttons do their own thing; anywhere else opens the stack\n if (!(event.target as Element).closest('button')) {\n setExpanded(true)\n }\n }}\n onFocus={(event) => {\n // Keyboard users can't see what's behind, so open it for them\n if (event.target.matches(':focus-visible')) setExpanded(true)\n }}\n >\n {toasts.map((toast) => {\n const behind =\n toast.transitionStatus !== 'ending' && visibleIndex++ > 0\n return (\n <Toast.Root\n key={toast.id}\n toast={toast}\n swipeDirection={['left', 'right', 'down']}\n className=\"avl-snackbar\"\n data-behind={behind || undefined}\n // Hidden under the newest one: keep its buttons from\n // being clicked or reached while you can't see them\n inert={(collapsed && behind) || undefined}\n >\n <Toast.Description className=\"avl-snackbar-message\" />\n {toast.actionProps && (\n <Toast.Action className=\"avl-snackbar-action\" />\n )}\n {toast.data?.closeButton && (\n <Toast.Close\n className=\"avl-snackbar-close\"\n aria-label=\"Close\"\n >\n <Icon name=\"close\" />\n </Toast.Close>\n )}\n </Toast.Root>\n )\n })}\n </Toast.Viewport>\n )\n}\n","import { Switch as BaseSwitch } from '@base-ui/react/switch'\nimport { withClass } from '../../utils'\nimport './switch.css'\n\nexport type SwitchProps = BaseSwitch.Root.Props\n\nexport function Switch({ className, ...props }: SwitchProps) {\n return (\n <BaseSwitch.Root\n {...props}\n className={withClass('avl-switch', className)}\n >\n <BaseSwitch.Thumb className=\"avl-switch-thumb\" />\n </BaseSwitch.Root>\n )\n}\n","import { Tabs as BaseTabs } from '@base-ui/react/tabs'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { Icon } from '../Icon/Icon'\nimport { withClass } from '../../utils'\nimport './tabs.css'\n\n/** Holds the selected tab: `value` / `defaultValue` / `onValueChange`. Horizontal only. */\nexport type TabsProps = Omit<BaseTabs.Root.Props, 'orientation'>\n\nexport function Tabs({ className, ...props }: TabsProps) {\n return (\n <BaseTabs.Root\n {...props}\n className={withClass('avl-tabs', className)}\n />\n )\n}\n\n// The row of tabs. Draws the sliding underline under the selected one.\nexport type TabsListProps = BaseTabs.List.Props\n\nexport function TabsList({ className, children, ...props }: TabsListProps) {\n return (\n <BaseTabs.List\n {...props}\n className={withClass('avl-tabs-list', className)}\n >\n {children}\n <BaseTabs.Indicator className=\"avl-tabs-indicator\" />\n </BaseTabs.List>\n )\n}\n\nexport type TabsTabProps = BaseTabs.Tab.Props & {\n /** Material Symbol shown above the label. */\n icon?: MaterialSymbol\n}\n\nexport function TabsTab({ icon, className, children, ...props }: TabsTabProps) {\n return (\n <BaseTabs.Tab\n {...props}\n className={withClass('avl-tabs-tab', className)}\n >\n {/* Hover and press tint this, not the whole tab */}\n <span className=\"avl-tabs-tab-content\">\n {icon && <Icon name={icon} />}\n <span className=\"avl-tabs-tab-label\">{children}</span>\n </span>\n </BaseTabs.Tab>\n )\n}\n\n// Content for one tab: give it the same `value` as its TabsTab.\nexport type TabsPanelProps = BaseTabs.Panel.Props\n\nexport function TabsPanel({ className, ...props }: TabsPanelProps) {\n return (\n <BaseTabs.Panel\n {...props}\n className={withClass('avl-tabs-panel', className)}\n />\n )\n}\n","import type { ComponentProps, ReactNode } from 'react'\nimport { Input as BaseInput } from '@base-ui/react/input'\nimport { cx } from '../../utils'\nimport '../Input/input.css'\nimport './textarea.css'\n\nexport type TextareaProps = Omit<ComponentProps<'textarea'>, 'className'> &\n Pick<BaseInput.Props, 'onValueChange'> & {\n /** Floating label. Sits on the first line and moves onto the border once it has focus or a value. */\n label?: ReactNode\n /**\n * `small` has less padding, and its label works like a placeholder: it\n * hides once there's text instead of moving onto the border. @default 'normal'\n */\n size?: 'small' | 'normal'\n /** Applied to the outer wrapper, so width and margins work as expected. */\n className?: string\n }\n\nexport function Textarea({\n label,\n size = 'normal',\n className,\n placeholder,\n ...props\n}: TextareaProps) {\n return (\n <label\n className={cx(\n 'avl-input',\n 'avl-textarea',\n `avl-input-size-${size}`,\n label != null && 'avl-input-labeled',\n className\n )}\n >\n {/* Base UI's Input is typed for <input>, but renders any element and\n keeps Field integration, so a <textarea> works at runtime. */}\n <BaseInput\n {...(props as BaseInput.Props)}\n render={<textarea />}\n placeholder={placeholder ?? ' '}\n className=\"avl-input-field\"\n />\n {label != null && <span className=\"avl-input-label\">{label}</span>}\n <fieldset aria-hidden className=\"avl-input-outline\">\n <legend>\n {label != null && size === 'normal' && <span>{label}</span>}\n </legend>\n </fieldset>\n </label>\n )\n}\n","import { Toolbar as BaseToolbar } from '@base-ui/react/toolbar'\nimport { IconButton, type IconButtonProps } from '../IconButton/IconButton'\nimport { cx, withClass } from '../../utils'\nimport '../Divider/divider.css'\nimport './floating-toolbar.css'\n\n/**\n * A floating pill of icon buttons. Arrow keys move between them; Tab enters\n * and leaves as one stop. Give it an `aria-label`, and place it yourself,\n * e.g. `position: fixed` at the bottom center.\n */\nexport type FloatingToolbarProps = BaseToolbar.Root.Props & {\n /** Use the theme's inverse colors, so it stands out over busy content. @default false */\n inverseColor?: boolean\n}\n\nexport function FloatingToolbar({\n inverseColor = false,\n className,\n ...props\n}: FloatingToolbarProps) {\n return (\n <BaseToolbar.Root\n {...props}\n className={withClass(\n cx(\n 'avl-floating-toolbar',\n inverseColor && 'avl-floating-toolbar-inverse'\n ),\n className\n )}\n />\n )\n}\n\n/**\n * An `IconButton` that joins the toolbar's arrow-key navigation. Text style\n * by default; `fillType=\"filled\"` makes it the wider, highlighted one.\n */\nexport type FloatingToolbarButtonProps = IconButtonProps\n\nexport function FloatingToolbarButton({\n fillType = 'text',\n // Filled means highlighted: primary stands out on the toolbar's surface\n color = fillType === 'filled' ? 'primary' : 'container',\n disabled,\n ...props\n}: FloatingToolbarButtonProps) {\n return (\n <BaseToolbar.Button\n disabled={disabled}\n render={<IconButton {...props} color={color} fillType={fillType} />}\n />\n )\n}\n\n// A thin line between groups of buttons.\nexport type FloatingToolbarSeparatorProps = BaseToolbar.Separator.Props\n\nexport function FloatingToolbarSeparator({\n className,\n ...props\n}: FloatingToolbarSeparatorProps) {\n return (\n <BaseToolbar.Separator\n {...props}\n className={withClass(\n 'avl-divider avl-floating-toolbar-separator',\n className\n )}\n />\n )\n}\n","import { useContext, type ReactElement, type ReactNode } from 'react'\nimport { Tooltip as BaseTooltip } from '@base-ui/react/tooltip'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { withClass } from '../../utils'\nimport './tooltip.css'\n\nexport type TooltipProps = Omit<BaseTooltip.Root.Props, 'children'> &\n Pick<BaseTooltip.Trigger.Props, 'delay' | 'closeDelay'> &\n Pick<\n BaseTooltip.Positioner.Props,\n 'side' | 'align' | 'sideOffset' | 'alignOffset'\n > &\n Pick<BaseTooltip.Popup.Props, 'className'> & {\n /** Text shown in the tooltip. Keep it short; nothing in it can be clicked. */\n label: ReactNode\n /**\n * The element the tooltip describes. It must take a ref and pass its\n * props through, as the library's components do.\n */\n children: ReactElement\n }\n\n/** A short hint shown on hover or keyboard focus. `className` goes on the bubble. */\nexport function Tooltip({\n label,\n children,\n delay,\n closeDelay,\n side,\n align,\n sideOffset,\n alignOffset,\n className,\n ...props\n}: TooltipProps) {\n const avl = useContext(AnvilContext)\n\n return (\n <BaseTooltip.Root {...props}>\n <BaseTooltip.Trigger\n render={children}\n delay={delay}\n closeDelay={closeDelay}\n />\n {/* Into the AnvilRoot, not body, so the popup sees the theme variables */}\n <BaseTooltip.Portal container={avl?.rootRef}>\n <BaseTooltip.Positioner\n className=\"avl-tooltip-positioner\"\n side={side}\n align={align}\n sideOffset={sideOffset ?? 4}\n alignOffset={alignOffset}\n >\n <BaseTooltip.Popup\n className={withClass('avl-tooltip', className)}\n >\n {label}\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n </BaseTooltip.Portal>\n </BaseTooltip.Root>\n )\n}\n","import type { ComponentProps } from 'react'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { useRender } from '@base-ui/react/use-render'\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { Icon } from '../Icon/Icon'\nimport { cx } from '../../utils'\nimport './navigation-bar.css'\n\n/**\n * Bottom navigation between an app's top-level pages, for small screens.\n * Fill it with 3–5 `NavigationBarItem`s and give it an `aria-label` (e.g.\n * \"Main\"). Place it yourself, e.g. `position: sticky; bottom: 0`.\n */\nexport type NavigationBarProps = ComponentProps<'nav'>\n\nexport function NavigationBar({ className, ...props }: NavigationBarProps) {\n return <nav {...props} className={cx('avl-navigation-bar', className)} />\n}\n\n// A link by default. Pass `render` to use a router link instead, e.g.\n// render={<Link to=\"/photos\" />}.\nexport type NavigationBarItemProps = useRender.ComponentProps<'a'> & {\n /** Material Symbol to show. */\n icon: MaterialSymbol\n /** Visible text, also the link's accessible name. */\n label: string\n /** The current page. Sets aria-current=\"page\". */\n active?: boolean\n}\n\nexport function NavigationBarItem({\n icon,\n label,\n active = false,\n render,\n className,\n ...props\n}: NavigationBarItemProps) {\n return useRender({\n defaultTagName: 'a',\n render,\n state: { active },\n props: mergeProps<'a'>(\n {\n className: cx('avl-navigation-bar-item', className),\n 'aria-current': active ? 'page' : undefined,\n children: (\n <>\n <span className=\"avl-navigation-bar-item-indicator\">\n <Icon name={icon} />\n </span>\n <span className=\"avl-navigation-bar-item-label\">\n {label}\n </span>\n </>\n ),\n },\n props\n ),\n })\n}\n","import { useContext, type ReactNode } from 'react'\nimport { Drawer } from '@base-ui/react/drawer'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { Icon } from '../Icon/Icon'\nimport { withClass } from '../../utils'\nimport './navigation-drawer.css'\n\n/**\n * Side navigation that slides in over the page, for small screens. Swipe it\n * back or tap outside to close. Holds the open state (`open` /\n * `defaultOpen` / `onOpenChange`).\n */\nexport type NavigationDrawerProps = Omit<Drawer.Root.Props, 'swipeDirection'>\n\nexport function NavigationDrawer(props: NavigationDrawerProps) {\n return <Drawer.Root {...props} swipeDirection=\"left\" />\n}\n\n// Renders a bare button. Usually `render={<IconButton icon=\"menu\" ... />}`.\nexport type NavigationDrawerTriggerProps = Drawer.Trigger.Props\n\nexport function NavigationDrawerTrigger({\n className,\n ...props\n}: NavigationDrawerTriggerProps) {\n return (\n <Drawer.Trigger\n {...props}\n className={withClass('avl-navigation-drawer-trigger', className)}\n />\n )\n}\n\n// Also renders the portal and the dimmed backdrop. Put a NavigationDrawerTitle\n// first (it names the drawer for screen readers), then the items.\nexport type NavigationDrawerPopupProps = Drawer.Popup.Props\n\nexport function NavigationDrawerPopup({\n className,\n ...props\n}: NavigationDrawerPopupProps) {\n const avl = useContext(AnvilContext)\n\n return (\n // Into the AnvilRoot, not body, so the drawer sees the theme variables\n <Drawer.Portal container={avl?.rootRef}>\n <Drawer.Backdrop className=\"avl-navigation-drawer-backdrop\" />\n <Drawer.Viewport className=\"avl-navigation-drawer-viewport\">\n <Drawer.Popup\n {...props}\n className={withClass(\n 'avl-navigation-drawer-popup',\n className\n )}\n />\n </Drawer.Viewport>\n </Drawer.Portal>\n )\n}\n\n// The heading at the top, e.g. the app's name. Renders an <h2>.\nexport type NavigationDrawerTitleProps = Drawer.Title.Props\n\nexport function NavigationDrawerTitle({\n className,\n ...props\n}: NavigationDrawerTitleProps) {\n return (\n <Drawer.Title\n {...props}\n className={withClass('avl-navigation-drawer-title', className)}\n />\n )\n}\n\n// A link that also closes the drawer. Pass `render` to use a router link\n// instead, e.g. render={<Link to=\"/photos\" />}.\nexport type NavigationDrawerItemProps = Omit<Drawer.Close.Props, 'children'> & {\n /** Material Symbol to show. */\n icon: MaterialSymbol\n /** Visible text, also the link's accessible name. */\n label: string\n /** The current page. Sets aria-current=\"page\". */\n active?: boolean\n /** After the label, e.g. an unread count. */\n end?: ReactNode\n /** Where the default link goes. Not needed with a router `render`. */\n href?: string\n}\n\nexport function NavigationDrawerItem({\n icon,\n label,\n active = false,\n end,\n href,\n render = <a href={href} />,\n className,\n ...props\n}: NavigationDrawerItemProps) {\n return (\n <Drawer.Close\n {...props}\n render={render}\n nativeButton={false}\n aria-current={active ? 'page' : undefined}\n className={withClass('avl-navigation-drawer-item', className)}\n >\n <Icon name={icon} />\n <span className=\"avl-navigation-drawer-item-label\">{label}</span>\n {end != null && (\n <span className=\"avl-navigation-drawer-item-end\">{end}</span>\n )}\n </Drawer.Close>\n )\n}\n","import { useLayoutEffect, useRef, useState, type ReactNode } from 'react'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { useRender } from '@base-ui/react/use-render'\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { IconButton } from '../IconButton/IconButton'\nimport { Icon } from '../Icon/Icon'\nimport { Typography } from '../Typography/Typography'\nimport { cx, mergeRefs } from '../../utils'\nimport './navigation-rail.css'\n\nexport type NavigationRailProps = React.ComponentProps<'nav'> & {\n /** Shows a button that toggles between the collapsed and expanded layouts. */\n hasExpandButton?: boolean\n /** Controlled expanded state. Pair with `onExpandedChange`. */\n expanded?: boolean\n /** Starting state when `expanded` isn't controlled. */\n defaultExpanded?: boolean\n onExpandedChange?: (expanded: boolean) => void\n}\n\nconst FLIP_ID = 'avl-navigation-rail-flip'\n\ntype FlipPart = {\n el: HTMLElement\n /** ancestor that is animated too, whose transform this one compounds with */\n parent?: HTMLElement\n fade?: boolean\n}\n\nfunction collectParts(rail: HTMLElement): FlipPart[] {\n const parts: FlipPart[] = []\n const button = rail.querySelector<HTMLElement>(\n '.avl-navigation-rail-expand-button'\n )\n if (button) parts.push({ el: button })\n\n for (const item of rail.querySelectorAll<HTMLElement>(\n '.avl-navigation-rail-item'\n )) {\n parts.push({ el: item })\n const icon = item.querySelector<HTMLElement>(\n '.avl-navigation-rail-item-icon'\n )\n const text = item.querySelector<HTMLElement>(\n '.avl-navigation-rail-item-text'\n )\n if (icon) parts.push({ el: icon, parent: item })\n // the label re-wraps between the two layouts, so it cross-fades on top\n // of the move instead of visibly reflowing\n if (text) parts.push({ el: text, parent: item, fade: true })\n const end = item.querySelector<HTMLElement>(\n '.avl-navigation-rail-item-end'\n )\n if (end) parts.push({ el: end, parent: item, fade: true })\n }\n return parts\n}\n\n/**\n * Side navigation between an app's top-level pages. Fill it with\n * `NavigationRailItem`s and give it an `aria-label` (e.g. \"Main\").\n */\nexport function NavigationRail({\n hasExpandButton,\n expanded: expandedProp,\n defaultExpanded = true,\n onExpandedChange,\n children,\n className,\n ref,\n ...props\n}: NavigationRailProps) {\n const [internalExpanded, setInternalExpanded] = useState(defaultExpanded)\n const expanded = expandedProp ?? internalExpanded\n const toggleExpanded = () => {\n setInternalExpanded(!expanded)\n onExpandedChange?.(!expanded)\n }\n const railRef = useRef<HTMLDivElement>(null)\n const lastRects = useRef(new Map<HTMLElement, DOMRect>())\n\n // FLIP: the collapsed and expanded layouts differ in ways CSS cannot\n // interpolate (flex-direction, text wrapping), so the new layout is applied\n // at once and every moved piece is animated back from where it just was.\n useLayoutEffect(() => {\n const rail = railRef.current\n if (!rail) return\n\n const style = getComputedStyle(rail)\n const duration =\n parseFloat(\n style.getPropertyValue('--avl-navigation-rail-duration')\n ) || 0\n const easing =\n style.getPropertyValue('--avl-navigation-rail-ease').trim() ||\n 'ease'\n\n const before = lastRects.current\n const after = new Map<HTMLElement, DOMRect>()\n const parts = collectParts(rail)\n\n // measure everything first: cancelling a running flip changes layout\n // ponytail: toggling mid-flight restarts from the resting layout (small\n // pop). Read the live transforms here if that ever shows up in use.\n for (const { el } of parts) {\n for (const animation of el.getAnimations()) {\n if (animation.id === FLIP_ID) animation.cancel()\n }\n after.set(el, el.getBoundingClientRect())\n }\n lastRects.current = after\n\n if (!before.size || !duration) return\n\n for (const { el, parent, fade } of parts) {\n const from = before.get(el)\n if (!from) continue\n const to = after.get(el)!\n let x = from.left - to.left\n let y = from.top - to.top\n\n const parentFrom = parent && before.get(parent)\n if (parentFrom) {\n // this transform compounds with the parent's, so take it back out\n const parentTo = after.get(parent)!\n x -= parentFrom.left - parentTo.left\n y -= parentFrom.top - parentTo.top\n }\n if (fade) {\n // labels don't slide: they stay hidden while the layout moves,\n // then fade in where they land\n el.animate(\n [\n { opacity: 0 },\n { opacity: 0, offset: 0.4 },\n { opacity: 1 },\n ],\n { duration, easing: 'ease-out', id: FLIP_ID }\n )\n continue\n }\n if (!x && !y) continue\n\n el.animate(\n [\n { transform: `translate(${x}px, ${y}px)` },\n { transform: 'none' },\n ],\n { duration, easing, id: FLIP_ID }\n )\n }\n }, [expanded])\n\n return (\n <nav\n {...props}\n ref={mergeRefs(railRef, ref)}\n className={cx('avl-navigation-rail', className)}\n data-expanded={expanded}\n >\n <div className=\"avl-navigation-rail-content\">\n {hasExpandButton && (\n <IconButton\n className=\"avl-navigation-rail-expand-button\"\n icon={expanded ? 'menu_open' : 'menu'}\n aria-label={expanded ? 'Collapse menu' : 'Expand menu'}\n aria-expanded={expanded}\n fillType=\"text\"\n color=\"container\"\n data-expanded={expanded}\n onClick={toggleExpanded}\n />\n )}\n <div className=\"avl-navigation-rail-item-list\">{children}</div>\n </div>\n </nav>\n )\n}\n\n// A link by default. Pass `render` to use a router link instead, e.g.\n// render={<Link to=\"/photos\" />}.\nexport type NavigationRailItemProps = useRender.ComponentProps<'a'> & {\n /** Material Symbol to show. */\n icon: MaterialSymbol\n /** Visible text, also the link's accessible name. */\n label: string\n /** The current page. Sets aria-current=\"page\". */\n active?: boolean\n /**\n * Short content after the label, like an unread count. Shown as a badge\n * on the icon while the rail is collapsed, so keep it to a few characters.\n */\n end?: ReactNode\n}\n\nexport function NavigationRailItem({\n icon,\n label,\n active = false,\n end,\n render,\n className,\n ...props\n}: NavigationRailItemProps) {\n return useRender({\n defaultTagName: 'a',\n render,\n state: { active },\n props: mergeProps<'a'>(\n {\n className: cx('avl-navigation-rail-item', className),\n 'aria-current': active ? 'page' : undefined,\n children: (\n <>\n <Icon\n name={icon}\n className=\"avl-navigation-rail-item-icon\"\n />\n <Typography\n as=\"span\"\n className=\"avl-navigation-rail-item-text\"\n >\n {label}\n </Typography>\n {end != null && (\n <span className=\"avl-navigation-rail-item-end\">\n {end}\n </span>\n )}\n </>\n ),\n },\n props\n ),\n })\n}\n","import { DesignTokens } from './types'\n\nexport const baseDesignTokens: DesignTokens = {\n font: {\n main: '\"Google Sans\", sans-serif',\n title: '\"Google Sans\", sans-serif',\n mono: '\"Google Sans Code\", monospace',\n },\n fontSize: {\n body: '16px',\n caption: '12px',\n labelSmall: '12px',\n label: '14px',\n labelLarge: '18px',\n h1: '57px',\n h2: '45px',\n h3: '36px',\n h4: '32px',\n h5: '28px',\n h6: '24px',\n },\n spacing: 4,\n radius: {\n small: '4px',\n medium: '16px',\n large: '32px',\n button: '1000px',\n full: '1000px',\n },\n outlineSize: '1.5px',\n ease: {\n out: 'cubic-bezier(0.34, 1.56, 0.64, 1)',\n in: 'cubic-bezier(0.36, 0, 0.66, -0.56)',\n // Material 3's standard curve\n smooth: 'cubic-bezier(0.2, 0, 0, 1)',\n },\n easeLength: {\n short: '100ms',\n normal: '200ms',\n slow: '300ms',\n },\n}\n","import { Theme } from './types'\n\n// Generated with Material Theme Builder (seed #654F9E) and mapped onto\n// AnvilUI's roles. Warning and success aren't part of the export, so they're\n// kept from the previous theme.\n\nexport const baseLightTheme: Theme = {\n background: '#FDF7FF',\n onBackground: '#1D1B20',\n container: '#F2ECF4',\n onContainer: '#1D1B20',\n containerLow: '#F8F2FA',\n onContainerLow: '#49454E',\n outline: '#CAC4CF',\n primary: '#65558F',\n onPrimary: '#FFFFFF',\n primaryContainer: '#E9DDFF',\n onPrimaryContainer: '#4D3D75',\n tonal: '#E8DEF8',\n onTonal: '#4A4458',\n tonalContainer: '#E8DEF8',\n onTonalContainer: '#1E192B',\n error: '#BA1A1A',\n onError: '#FFFFFF',\n errorContainer: '#FFDAD6',\n onErrorContainer: '#93000A',\n warning: '#8A5300',\n onWarning: '#FFFFFF',\n warningContainer: '#FFDDB3',\n onWarningContainer: '#2B1700',\n success: '#1E6E33',\n onSuccess: '#FFFFFF',\n successContainer: '#A6F5AE',\n onSuccessContainer: '#00210A',\n inverseSurface: '#322F35',\n inverseOnSurface: '#F5EFF7',\n inversePrimary: '#CFBDFE',\n}\n\nexport const baseDarkTheme: Theme = {\n background: '#141218',\n onBackground: '#E6E0E9',\n container: '#2B292F',\n onContainer: '#E6E0E9',\n containerLow: '#1D1B20',\n onContainerLow: '#E6E0E9',\n outline: '#948F99',\n primary: '#CFBDFE',\n onPrimary: '#36265D',\n primaryContainer: '#4D3D75',\n onPrimaryContainer: '#E9DDFF',\n tonal: '#4A4458',\n onTonal: '#E8DEF8',\n tonalContainer: '#4A4458',\n onTonalContainer: '#E8DEF8',\n error: '#FFB4AB',\n onError: '#690005',\n errorContainer: '#93000A',\n onErrorContainer: '#FFDAD6',\n warning: '#FFB95C',\n onWarning: '#472A00',\n warningContainer: '#663D00',\n onWarningContainer: '#FFDDB3',\n success: '#8CDA9B',\n onSuccess: '#00390F',\n successContainer: '#00531D',\n onSuccessContainer: '#A6F5AE',\n inverseSurface: '#E6E0E9',\n inverseOnSurface: '#322F35',\n inversePrimary: '#65558F',\n}\n","import { baseDarkTheme, baseLightTheme } from './baseTheme'\nimport { Theme } from './types'\n\n// Black and white with neutral greys. Error, warning and success keep the\n// base theme's hues so they still read as status colors.\n\nexport const monochromeLightTheme: Theme = {\n ...baseLightTheme,\n background: '#FFFFFF',\n onBackground: '#111111',\n container: '#EEEEEE',\n onContainer: '#111111',\n containerLow: '#F6F6F6',\n onContainerLow: '#474747',\n outline: '#C8C8C8',\n primary: '#000000',\n onPrimary: '#FFFFFF',\n primaryContainer: '#E2E2E2',\n onPrimaryContainer: '#1B1B1B',\n tonal: '#E8E8E8',\n onTonal: '#3B3B3B',\n tonalContainer: '#E8E8E8',\n onTonalContainer: '#1B1B1B',\n inverseSurface: '#2A2A2A',\n inverseOnSurface: '#F2F2F2',\n inversePrimary: '#FFFFFF',\n}\n\nexport const monochromeDarkTheme: Theme = {\n ...baseDarkTheme,\n background: '#0F0F0F',\n onBackground: '#E8E8E8',\n container: '#2A2A2A',\n onContainer: '#E8E8E8',\n containerLow: '#1A1A1A',\n onContainerLow: '#E8E8E8',\n outline: '#8E8E8E',\n primary: '#FFFFFF',\n onPrimary: '#000000',\n primaryContainer: '#3A3A3A',\n onPrimaryContainer: '#EDEDED',\n tonal: '#3F3F3F',\n onTonal: '#E2E2E2',\n tonalContainer: '#3F3F3F',\n onTonalContainer: '#E2E2E2',\n inverseSurface: '#E8E8E8',\n inverseOnSurface: '#2A2A2A',\n inversePrimary: '#000000',\n}\n","import {\n CSSProperties,\n Dispatch,\n ReactNode,\n SetStateAction,\n useRef,\n useState,\n} from 'react'\nimport { Toast } from '@base-ui/react/toast'\nimport { Tooltip } from '@base-ui/react/tooltip'\nimport { SnackbarViewport } from '../Snackbar/Snackbar'\nimport { AnvilContext, ColorType } from './AnvilContext'\nimport { baseDarkTheme, baseLightTheme } from '../../themes/baseTheme'\nimport { Theme } from '../../themes/types'\nimport { themeToCssVariables } from '../../themes/toCssVariables'\nimport { DesignTokens } from '../../tokens/types'\nimport { baseDesignTokens } from '../../tokens/baseTokens'\nimport { tokensToCssVariables } from '../../tokens/toCssVariables'\nimport '../../colors/colors.css'\nimport './global.css'\n\nexport type AnvilRootProps = {\n children: ReactNode\n /** Controlled color mode. Pair with `onColorModeChange`. */\n colorMode?: ColorType\n /** Starting color mode when `colorMode` isn't controlled. */\n defaultColorMode?: ColorType\n onColorModeChange?: (colorMode: ColorType) => void\n lightTheme?: Theme\n darkTheme?: Theme\n tokens?: DesignTokens\n}\n\nexport function AnvilRoot(props: AnvilRootProps) {\n const [internalColorMode, setInternalColorMode] = useState<ColorType>(\n props.defaultColorMode || 'light'\n )\n const colorMode = props.colorMode ?? internalColorMode\n const setColorMode: Dispatch<SetStateAction<ColorType>> = (next) => {\n const value = typeof next === 'function' ? next(colorMode) : next\n setInternalColorMode(value)\n props.onColorModeChange?.(value)\n }\n const tokens = props.tokens || baseDesignTokens\n const lightTheme = props.lightTheme || baseLightTheme\n const darkTheme = props.darkTheme || baseDarkTheme\n const activeTheme = colorMode === 'light' ? lightTheme : darkTheme\n const rootRef = useRef<HTMLDivElement>(null)\n\n const cssVars = {\n ...tokensToCssVariables(tokens),\n ...themeToCssVariables(activeTheme),\n }\n\n return (\n <AnvilContext\n value={{\n colorMode,\n setColorMode,\n tokens,\n lightTheme,\n darkTheme,\n rootRef,\n }}\n >\n <div\n ref={rootRef}\n className=\"avl-root\"\n style={cssVars as CSSProperties}\n >\n {/* Lets the pointer move between tooltips without waiting\n out the open delay each time */}\n <Tooltip.Provider>\n {/* Up to 3 snackbars stack; a 4th pushes the oldest out */}\n <Toast.Provider limit={3}>\n {props.children}\n <SnackbarViewport />\n </Toast.Provider>\n </Tooltip.Provider>\n </div>\n </AnvilContext>\n )\n}\n","import { Theme } from './types'\n\nexport function themeToCssVariables(theme: Theme): Record<string, string> {\n const cssVars: Record<string, string> = {}\n\n // The inverse roles are optional; themes without them get the page's\n // colors swapped, so existing themes keep working\n // Themes written before the rename still work: their surfaceVariant\n // pair stands in for containerLow\n const { surfaceVariant, onSurfaceVariant, ...rest } = theme\n const filled: Theme = {\n inverseSurface: theme.onBackground,\n inverseOnSurface: theme.background,\n inversePrimary: `color-mix(in srgb, ${theme.primary} 55%, ${theme.background})`,\n ...rest,\n containerLow: rest.containerLow ?? surfaceVariant,\n onContainerLow: rest.onContainerLow ?? onSurfaceVariant,\n }\n\n for (const [key, value] of Object.entries(filled)) {\n if (value === undefined) continue\n const kebabKey = key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()\n cssVars[`--avl-color-${kebabKey}`] = value\n }\n\n // The old variable names, for custom CSS written before the rename\n cssVars['--avl-color-surface-variant'] = 'var(--avl-color-container-low)'\n cssVars['--avl-color-on-surface-variant'] =\n 'var(--avl-color-on-container-low)'\n\n return cssVars\n}\n","import { DesignTokens } from './types'\n\nconst kebab = (s: string) =>\n s.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase()\n\nexport function tokensToCssVariables(\n tokens: DesignTokens\n): Record<string, string> {\n const cssVars: Record<string, string> = {}\n\n for (let i = 1; i <= 20; i++) {\n cssVars[`--avl-spacing-x${i}`] = `${tokens.spacing * i}px`\n }\n\n for (const [category, values] of Object.entries(tokens)) {\n if (category === 'spacing') continue\n\n const kebabCategory = kebab(category)\n\n if (typeof values === 'string') {\n cssVars[`--avl-${kebabCategory}`] = values\n continue\n }\n\n for (const [key, value] of Object.entries(values)) {\n cssVars[`--avl-${kebabCategory}-${kebab(key)}`] = String(value)\n }\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B,KAAK;AAC1B,UAAM,oBAAoB,KAAK;AAAA,EACnC;AACA,QAAM,SAAS,MAAM,UAAU;AAC/B,QAAM,aAAa,MAAM,cAAc;AACvC,QAAM,YAAY,MAAM,aAAa;AACrC,QAAM,cAAc,cAAc,UAAU,aAAa;AACzD,QAAM,UAAUC,QAAuB,IAAI;AAE3C,QAAM,UAAU;AAAA,IACZ,GAAG,qBAAqB,MAAM;AAAA,IAC9B,GAAG,oBAAoB,WAAW;AAAA,EACtC;AAEA,SACI,gBAAAH;AAAA,IAAC;AAAA;AAAA,MACG,OAAO;AAAA,QACH;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,MAEA,0BAAAA;AAAA,QAAC;AAAA;AAAA,UACG,KAAK;AAAA,UACL,WAAU;AAAA,UACV,OAAO;AAAA,UAIP,0BAAAA,MAACI,SAAQ,UAAR,EAEG,0BAAAH,OAACI,OAAM,UAAN,EAAe,OAAO,GAClB;AAAA,kBAAM;AAAA,YACP,gBAAAL,MAAC,oBAAiB;AAAA,aACtB,GACJ;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AAER;","names":["jsx","jsx","jsx","jsxs","jsx","jsxs","count","jsx","jsxs","jsx","jsxs","jsx","useRef","jsx","useRef","BaseButton","jsx","BaseButton","BaseButton","jsx","jsxs","BaseButton","jsx","useContext","createContext","useLayoutEffect","useRef","useState","morph","jsx","jsxs","morph","useContext","useEffect","useRef","jsx","jsxs","useRef","useEffect","jsx","jsxs","useEffect","useRef","BaseButton","jsx","jsxs","useRef","BaseButton","useEffect","jsx","BaseButton","jsx","BaseButton","jsx","jsxs","jsx","jsxs","createContext","useContext","jsx","jsxs","createContext","useContext","useContext","jsx","morph","useContext","jsx","jsxs","createContext","useContext","useLayoutEffect","useRef","Fragment","jsx","jsxs","createContext","useRef","useLayoutEffect","useContext","BaseRadio","BaseRadioGroup","jsx","BaseRadioGroup","BaseRadio","useContext","jsx","jsxs","useContext","jsx","jsxs","useEffect","useRef","useState","jsx","jsxs","useRef","useState","useEffect","jsx","jsx","jsxs","BaseInput","jsx","jsxs","BaseInput","jsx","useContext","jsx","jsxs","useContext","useRender","mergeProps","Fragment","jsx","jsxs","useRender","mergeProps","useContext","Drawer","jsx","jsxs","Drawer","useContext","useLayoutEffect","useRef","useState","useRender","mergeProps","Fragment","jsx","jsxs","useState","useRef","useLayoutEffect","useRender","mergeProps","useRef","useState","Toast","Tooltip","jsx","jsxs","useState","useRef","Tooltip","Toast"]}
@@ -0,0 +1,64 @@
1
+ import { type RefObject } from 'react';
2
+ /** The trigger and popup a morphing Dialog or Popover animates between. */
3
+ export type MorphRefs = {
4
+ trigger: RefObject<HTMLElement | null>;
5
+ popup: RefObject<HTMLElement | null>;
6
+ };
7
+ /**
8
+ * Set by a Dialog or Popover root with `morph`, `null` without, so a nested
9
+ * root's trigger or popup never picks up an outer one's refs.
10
+ */
11
+ export declare const MorphContext: import("react").Context<MorphRefs | null>;
12
+ /**
13
+ * Open state for a Base UI root that can morph between its trigger and its
14
+ * popup. Held here, not in Base UI, so the change can happen inside the view
15
+ * transition. `open` / `defaultOpen` / `onOpenChange` keep working,
16
+ * including cancelling from `onOpenChange`.
17
+ */
18
+ export declare function useMorphOpen<Details extends {
19
+ isCanceled: boolean;
20
+ }>({ morph, open: controlledOpen, defaultOpen, onOpenChange, }: {
21
+ morph: boolean;
22
+ open: boolean | undefined;
23
+ defaultOpen: boolean;
24
+ onOpenChange: ((open: boolean, details: Details) => void) | undefined;
25
+ }): {
26
+ open: boolean;
27
+ onOpenChange: (next: boolean, details: Details) => void;
28
+ refs: {
29
+ trigger: RefObject<HTMLElement | null>;
30
+ popup: RefObject<HTMLElement | null>;
31
+ } | null;
32
+ };
33
+ export type MorphOptions = {
34
+ /** Length of the morph in milliseconds. @default the theme's `easeLength.slow` */
35
+ duration?: number;
36
+ /** CSS easing for the box's size, position, corners and color. @default the theme's `ease.smooth` */
37
+ easing?: string;
38
+ };
39
+ /**
40
+ * Morphs one element into another while the view changes: the element with
41
+ * `data-morph-id={id}` grows (or shrinks) into the element that has the same
42
+ * id after `update` runs, like a list row opening into its detail page.
43
+ * Call it again with the same id to morph back.
44
+ *
45
+ * `update` must change the view synchronously: set React state, or call a
46
+ * router with its sync option (React Router: `navigate(to, { flushSync:
47
+ * true })`). Falls back to a plain `update()` without View Transitions
48
+ * support or with reduced motion.
49
+ *
50
+ * Resolves once the morph has finished (right away when it falls back), so
51
+ * you can move focus or start something else afterwards.
52
+ */
53
+ export declare function morph(id: string, update: () => void, options?: MorphOptions): Promise<void>;
54
+ /**
55
+ * Like `morph`, but takes the elements instead of a `data-morph-id`. `from`
56
+ * grows into whatever `getTo` returns after `update` runs; it's a function
57
+ * because the target usually doesn't exist until then.
58
+ *
59
+ * The browser snapshots `from`, runs `update`, snapshots `to`, and animates
60
+ * one box into the other. Everything else on the page just crossfades.
61
+ * Both elements get `data-morphing` meanwhile, so they can switch off their
62
+ * own enter and exit animations.
63
+ */
64
+ export declare function morphBetween(from: HTMLElement, update: () => void, getTo: () => HTMLElement | null, options?: MorphOptions): Promise<void>;
@@ -0,0 +1,3 @@
1
+ import { Theme } from './types';
2
+ export declare const baseLightTheme: Theme;
3
+ export declare const baseDarkTheme: Theme;
@@ -0,0 +1,3 @@
1
+ import { Theme } from './types';
2
+ export declare const monochromeLightTheme: Theme;
3
+ export declare const monochromeDarkTheme: Theme;
@@ -0,0 +1,2 @@
1
+ import { Theme } from './types';
2
+ export declare function themeToCssVariables(theme: Theme): Record<string, string>;