anvilui 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +483 -0
- package/README.md +60 -40
- package/bin/anvilui.mjs +83 -0
- package/dist/colors/colors.d.ts +10 -2
- package/dist/components/Accordion/Accordion.d.ts +36 -0
- package/dist/components/AnimatedNumber/AnimatedNumber.d.ts +17 -0
- package/dist/components/AnvilRoot/AnvilContext.d.ts +22 -2
- package/dist/components/AnvilRoot/AnvilRoot.d.ts +44 -6
- package/dist/components/AppBar/AppBar.d.ts +13 -2
- package/dist/components/Avatar/Avatar.d.ts +6 -2
- package/dist/components/Avatar/AvatarGroupContext.d.ts +1 -0
- package/dist/components/AvatarGroup/AvatarGroup.d.ts +25 -0
- package/dist/components/Badge/Badge.d.ts +4 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +22 -0
- package/dist/components/Button/Button.d.ts +17 -0
- package/dist/components/Calendar/Calendar.d.ts +19 -0
- package/dist/components/Card/Card.d.ts +36 -0
- package/dist/components/Carousel/Carousel.d.ts +21 -0
- package/dist/components/Checkbox/Checkbox.d.ts +10 -0
- package/dist/components/Chip/Chip.d.ts +25 -2
- package/dist/components/Combobox/Combobox.d.ts +48 -0
- package/dist/components/Confetti/Confetti.d.ts +31 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +24 -0
- package/dist/components/DateInput/DateInput.d.ts +39 -0
- package/dist/components/Dialog/Dialog.d.ts +32 -0
- package/dist/components/Divider/Divider.d.ts +8 -0
- package/dist/components/FAB/FAB.d.ts +4 -0
- package/dist/components/FAB/magnet.d.ts +2 -0
- package/dist/components/FABMenu/FABMenu.d.ts +55 -0
- package/dist/components/Field/Field.d.ts +20 -0
- package/dist/components/FloatingToolbar/FloatingToolbar.d.ts +15 -0
- package/dist/components/HoldButton/HoldButton.d.ts +4 -1
- package/dist/components/Icon/Icon.d.ts +14 -0
- package/dist/components/IconButton/IconButton.d.ts +14 -1
- package/dist/components/Input/Input.d.ts +14 -3
- package/dist/components/Kbd/Kbd.d.ts +21 -0
- package/dist/components/List/List.d.ts +10 -1
- package/dist/components/Menu/Menu.d.ts +32 -0
- package/dist/components/Menubar/Menubar.d.ts +17 -0
- package/dist/components/NavigationBar/NavigationBar.d.ts +10 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +22 -0
- package/dist/components/NavigationList/NavigationList.d.ts +27 -0
- package/dist/components/NavigationRail/NavigationRail.d.ts +25 -9
- package/dist/components/PinInput/PinInput.d.ts +33 -0
- package/dist/components/Popover/Popover.d.ts +30 -2
- package/dist/components/PreviewCard/PreviewCard.d.ts +31 -0
- package/dist/components/Progress/Progress.d.ts +12 -2
- package/dist/components/RadioGroup/RadioGroup.d.ts +14 -2
- package/dist/components/Search/Search.d.ts +55 -0
- package/dist/components/Select/Select.d.ts +21 -4
- package/dist/components/Skeleton/Skeleton.d.ts +20 -0
- package/dist/components/Slider/Slider.d.ts +7 -1
- package/dist/components/Snackbar/Snackbar.d.ts +7 -2
- package/dist/components/SplitButton/SplitButton.d.ts +13 -0
- package/dist/components/SquigglyWave/SquigglyWave.d.ts +26 -4
- package/dist/components/Sticker/Sticker.d.ts +21 -0
- package/dist/components/Switch/Switch.d.ts +11 -0
- package/dist/components/Table/Table.d.ts +36 -0
- package/dist/components/Tabs/Tabs.d.ts +17 -0
- package/dist/components/Textarea/Textarea.d.ts +14 -3
- package/dist/components/TimePicker/TimePicker.d.ts +47 -0
- package/dist/components/Toggle/Toggle.d.ts +42 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +16 -4
- package/dist/components/Tooltip/Tooltip.d.ts +10 -1
- package/dist/components/Typography/Typography.d.ts +13 -1
- package/dist/datetime.d.ts +12 -0
- package/dist/dev.d.ts +15 -0
- package/dist/index.cjs +3365 -654
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1443 -367
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +50 -4
- package/dist/index.js +3362 -667
- package/dist/index.js.map +1 -1
- package/dist/themes/baseTheme.d.ts +2 -0
- package/dist/themes/createTheme.d.ts +22 -0
- package/dist/themes/monochromeTheme.d.ts +2 -0
- package/dist/themes/types.d.ts +13 -8
- package/dist/tokens/baseTokens.d.ts +4 -0
- package/dist/tokens/types.d.ts +34 -0
- package/dist/utils.d.ts +4 -0
- package/docs/accordion.md +47 -0
- package/docs/animated-number.md +31 -0
- package/docs/app-bar.md +53 -0
- package/docs/avatar-group.md +35 -0
- package/docs/avatar.md +34 -0
- package/docs/badge.md +41 -0
- package/docs/bottom-sheet.md +65 -0
- package/docs/button.md +63 -0
- package/docs/calendar.md +26 -0
- package/docs/card.md +71 -0
- package/docs/carousel.md +43 -0
- package/docs/checkbox.md +37 -0
- package/docs/chip.md +48 -0
- package/docs/combobox.md +73 -0
- package/docs/composition.md +80 -0
- package/docs/confetti.md +30 -0
- package/docs/context-menu.md +42 -0
- package/docs/date-input.md +42 -0
- package/docs/dialog.md +106 -0
- package/docs/divider.md +31 -0
- package/docs/fab-menu.md +55 -0
- package/docs/fab.md +43 -0
- package/docs/field.md +59 -0
- package/docs/floating-toolbar.md +48 -0
- package/docs/forms.md +81 -0
- package/docs/hold-button.md +32 -0
- package/docs/icon-button.md +55 -0
- package/docs/icons.md +38 -0
- package/docs/input.md +51 -0
- package/docs/kbd.md +25 -0
- package/docs/list.md +65 -0
- package/docs/llms-index.md +82 -0
- package/docs/menu.md +88 -0
- package/docs/menubar.md +34 -0
- package/docs/morph.md +54 -0
- package/docs/navigation-bar.md +48 -0
- package/docs/navigation-drawer.md +72 -0
- package/docs/navigation-list.md +40 -0
- package/docs/navigation-rail.md +53 -0
- package/docs/pin-input.md +38 -0
- package/docs/popover.md +78 -0
- package/docs/preview-card.md +40 -0
- package/docs/progress.md +37 -0
- package/docs/radio-group.md +64 -0
- package/docs/search.md +77 -0
- package/docs/select.md +65 -0
- package/docs/setup.md +106 -0
- package/docs/skeleton.md +33 -0
- package/docs/slider.md +49 -0
- package/docs/snackbar.md +50 -0
- package/docs/split-button.md +44 -0
- package/docs/sticker.md +27 -0
- package/docs/switch.md +44 -0
- package/docs/table.md +66 -0
- package/docs/tabs.md +51 -0
- package/docs/textarea.md +23 -0
- package/docs/theming.md +183 -0
- package/docs/time-picker.md +39 -0
- package/docs/toggle-group.md +70 -0
- package/docs/toggle.md +49 -0
- package/docs/tooltip.md +42 -0
- package/docs/typography.md +41 -0
- package/package.json +25 -5
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../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":["export { AppBar } from './components/AppBar/AppBar'\nexport type { AppBarProps } from './components/AppBar/AppBar'\n\nexport { Avatar } from './components/Avatar/Avatar'\nexport type { AvatarProps } from './components/Avatar/Avatar'\n\nexport { Badge } from './components/Badge/Badge'\nexport type { BadgeProps } from './components/Badge/Badge'\n\nexport {\n BottomSheet,\n BottomSheetTrigger,\n BottomSheetPopup,\n BottomSheetTitle,\n BottomSheetDescription,\n BottomSheetClose,\n} from './components/BottomSheet/BottomSheet'\nexport type {\n BottomSheetProps,\n BottomSheetTriggerProps,\n BottomSheetPopupProps,\n BottomSheetTitleProps,\n BottomSheetDescriptionProps,\n BottomSheetCloseProps,\n} from './components/BottomSheet/BottomSheet'\n\nexport { Button } from './components/Button/Button'\nexport type { ButtonProps } from './components/Button/Button'\n\nexport { SplitButton } from './components/SplitButton/SplitButton'\nexport type { SplitButtonProps } from './components/SplitButton/SplitButton'\n\nexport { HoldButton } from './components/HoldButton/HoldButton'\nexport type { HoldButtonProps } from './components/HoldButton/HoldButton'\n\nexport {\n Card,\n CardTitle,\n CardContent,\n CardActions,\n} from './components/Card/Card'\nexport type {\n CardProps,\n CardTitleProps,\n CardContentProps,\n CardActionsProps,\n} from './components/Card/Card'\n\nexport { Chip, FilterChip, InputChip } from './components/Chip/Chip'\nexport type {\n ChipProps,\n FilterChipProps,\n InputChipProps,\n} from './components/Chip/Chip'\n\nexport { Checkbox } from './components/Checkbox/Checkbox'\nexport type { CheckboxProps } from './components/Checkbox/Checkbox'\n\nexport {\n Dialog,\n DialogTrigger,\n DialogPopup,\n DialogTitle,\n DialogDescription,\n DialogActions,\n DialogClose,\n} from './components/Dialog/Dialog'\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPopupProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogActionsProps,\n DialogCloseProps,\n} from './components/Dialog/Dialog'\n\nexport { Divider } from './components/Divider/Divider'\nexport type { DividerProps } from './components/Divider/Divider'\n\nexport { FAB } from './components/FAB/FAB'\nexport type { FABProps } from './components/FAB/FAB'\n\nexport { Field, FieldDescription, FieldError } from './components/Field/Field'\nexport type {\n FieldProps,\n FieldDescriptionProps,\n FieldErrorProps,\n} from './components/Field/Field'\n\nexport { Icon } from './components/Icon/Icon'\nexport type { IconProps } from './components/Icon/Icon'\n\nexport { IconButton } from './components/IconButton/IconButton'\nexport type { IconButtonProps } from './components/IconButton/IconButton'\n\nexport { Input } from './components/Input/Input'\nexport type { InputProps } from './components/Input/Input'\n\nexport { List, ListItem } from './components/List/List'\nexport type { ListProps, ListItemProps } from './components/List/List'\n\nexport {\n Menu,\n MenuTrigger,\n MenuPopup,\n MenuItem,\n MenuGroup,\n MenuSubmenu,\n MenuSubmenuTrigger,\n} from './components/Menu/Menu'\nexport type {\n MenuProps,\n MenuTriggerProps,\n MenuPopupProps,\n MenuItemProps,\n MenuGroupProps,\n MenuSubmenuProps,\n MenuSubmenuTriggerProps,\n} from './components/Menu/Menu'\n\nexport {\n Popover,\n PopoverTrigger,\n PopoverPopup,\n PopoverTitle,\n PopoverDescription,\n PopoverClose,\n} from './components/Popover/Popover'\nexport type {\n PopoverProps,\n PopoverTriggerProps,\n PopoverPopupProps,\n PopoverTitleProps,\n PopoverDescriptionProps,\n PopoverCloseProps,\n} from './components/Popover/Popover'\n\nexport { Progress } from './components/Progress/Progress'\nexport type { ProgressProps } from './components/Progress/Progress'\n\nexport {\n ToggleGroup,\n ToggleGroupItem,\n} from './components/ToggleGroup/ToggleGroup'\nexport type {\n ToggleGroupProps,\n ToggleGroupItemProps,\n} from './components/ToggleGroup/ToggleGroup'\n\nexport { RadioGroup, Radio } from './components/RadioGroup/RadioGroup'\nexport type {\n RadioGroupProps,\n RadioProps,\n} from './components/RadioGroup/RadioGroup'\n\nexport { Select, SelectItem } from './components/Select/Select'\nexport type { SelectProps, SelectItemProps } from './components/Select/Select'\n\nexport { Slider } from './components/Slider/Slider'\nexport type { SliderProps } from './components/Slider/Slider'\n\nexport { useSnackbar } from './components/Snackbar/Snackbar'\nexport type { SnackbarOptions } from './components/Snackbar/Snackbar'\n\nexport { Switch } from './components/Switch/Switch'\nexport type { SwitchProps } from './components/Switch/Switch'\n\nexport { Tabs, TabsList, TabsTab, TabsPanel } from './components/Tabs/Tabs'\nexport type {\n TabsProps,\n TabsListProps,\n TabsTabProps,\n TabsPanelProps,\n} from './components/Tabs/Tabs'\n\nexport { Textarea } from './components/Textarea/Textarea'\nexport type { TextareaProps } from './components/Textarea/Textarea'\n\nexport {\n FloatingToolbar,\n FloatingToolbarButton,\n FloatingToolbarSeparator,\n} from './components/FloatingToolbar/FloatingToolbar'\nexport type {\n FloatingToolbarProps,\n FloatingToolbarButtonProps,\n FloatingToolbarSeparatorProps,\n} from './components/FloatingToolbar/FloatingToolbar'\n\nexport { Tooltip } from './components/Tooltip/Tooltip'\nexport type { TooltipProps } from './components/Tooltip/Tooltip'\n\nexport { Typography } from './components/Typography/Typography'\nexport type {\n TypographyProps,\n TypographyType,\n TypographyTag,\n} from './components/Typography/Typography'\n\nexport {\n NavigationBar,\n NavigationBarItem,\n} from './components/NavigationBar/NavigationBar'\nexport type {\n NavigationBarProps,\n NavigationBarItemProps,\n} from './components/NavigationBar/NavigationBar'\n\nexport {\n NavigationDrawer,\n NavigationDrawerTrigger,\n NavigationDrawerPopup,\n NavigationDrawerTitle,\n NavigationDrawerItem,\n} from './components/NavigationDrawer/NavigationDrawer'\nexport type {\n NavigationDrawerProps,\n NavigationDrawerTriggerProps,\n NavigationDrawerPopupProps,\n NavigationDrawerTitleProps,\n NavigationDrawerItemProps,\n} from './components/NavigationDrawer/NavigationDrawer'\n\nexport {\n NavigationRail,\n NavigationRailItem,\n} from './components/NavigationRail/NavigationRail'\nexport type {\n NavigationRailProps,\n NavigationRailItemProps,\n} from './components/NavigationRail/NavigationRail'\n\nexport type { ComponentColor } from './colors/colors'\nexport type { ComponentFillType, ColorProps } from './colors/colors'\n\nexport { baseDesignTokens } from './tokens/baseTokens'\nexport type {\n DesignTokens,\n Font,\n FontSize,\n Ease,\n EaseLength,\n} from './tokens/types'\n\nexport { baseLightTheme, baseDarkTheme } from './themes/baseTheme'\nexport {\n monochromeLightTheme,\n monochromeDarkTheme,\n} from './themes/monochromeTheme'\nexport type { Theme } from './themes/types'\n\nexport { AnvilRoot } from './components/AnvilRoot/AnvilRoot'\nexport type { AnvilRootProps } from './components/AnvilRoot/AnvilRoot'\n\nexport { AnvilContext } from './components/AnvilRoot/AnvilContext'\nexport type { ColorType } from './components/AnvilRoot/AnvilContext'\n\nexport { morph, morphBetween } from './morph'\nexport type { MorphOptions } from './morph'\n","/** 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 }\n }\n\n return cssVars\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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e,OAAO,GAClB;AAAA,kBAAM;AAAA,YACP,8CAAC,oBAAiB;AAAA,aACtB,GACJ;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AAER;","names":["import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","BaseAvatar","import_jsx_runtime","count","import_react","import_jsx_runtime","import_react","import_jsx_runtime","BaseButton","import_jsx_runtime","import_react","import_jsx_runtime","import_button","import_jsx_runtime","BaseButton","import_button","import_jsx_runtime","BaseButton","import_jsx_runtime","BaseCheckbox","import_react","import_react","morph","import_jsx_runtime","morph","BaseDialog","import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_button","import_jsx_runtime","BaseButton","import_jsx_runtime","BaseField","import_button","import_jsx_runtime","BaseButton","import_jsx_runtime","BaseInput","import_jsx_runtime","import_react","import_jsx_runtime","BaseMenu","import_react","import_jsx_runtime","morph","BasePopover","import_jsx_runtime","BaseProgress","import_react","import_toggle","import_jsx_runtime","BaseToggleGroup","BaseRadioGroup","BaseToggle","BaseRadio","import_radio","import_radio_group","import_jsx_runtime","BaseRadioGroup","BaseRadio","import_react","import_jsx_runtime","BaseSelect","import_jsx_runtime","BaseSlider","import_react","import_jsx_runtime","import_jsx_runtime","BaseSwitch","import_jsx_runtime","BaseTabs","import_input","import_jsx_runtime","BaseInput","import_jsx_runtime","BaseToolbar","import_react","import_tooltip","import_jsx_runtime","BaseTooltip","import_use_render","import_merge_props","import_jsx_runtime","import_react","import_drawer","import_jsx_runtime","import_react","import_use_render","import_merge_props","import_jsx_runtime","import_react","import_toast","import_tooltip","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/components/AnimatedNumber/AnimatedNumber.tsx","../src/utils.ts","../src/colors/colors.ts","../src/components/Typography/Typography.tsx","../src/components/AnvilRoot/AnvilContext.ts","../src/dev.ts","../src/components/AppBar/AppBar.tsx","../src/components/Avatar/Avatar.tsx","../src/components/Icon/Icon.tsx","../src/components/Avatar/AvatarGroupContext.ts","../src/components/AvatarGroup/AvatarGroup.tsx","../src/components/Badge/Badge.tsx","../src/components/BottomSheet/BottomSheet.tsx","../src/components/Button/Button.tsx","../src/components/SplitButton/SplitButton.tsx","../src/components/HoldButton/HoldButton.tsx","../src/components/Card/Card.tsx","../src/components/Calendar/Calendar.tsx","../src/components/IconButton/IconButton.tsx","../src/datetime.ts","../src/components/Carousel/Carousel.tsx","../src/components/Chip/Chip.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Dialog/Dialog.tsx","../src/morph.ts","../src/components/Confetti/Confetti.tsx","../src/components/Divider/Divider.tsx","../src/components/SquigglyWave/SquigglyWave.tsx","../src/components/FAB/FAB.tsx","../src/components/FAB/magnet.ts","../src/components/FABMenu/FABMenu.tsx","../src/components/Field/Field.tsx","../src/components/Input/Input.tsx","../src/components/Kbd/Kbd.tsx","../src/components/List/List.tsx","../src/components/Menu/Menu.tsx","../src/components/Menubar/Menubar.tsx","../src/components/Accordion/Accordion.tsx","../src/components/ContextMenu/ContextMenu.tsx","../src/components/Popover/Popover.tsx","../src/components/PreviewCard/PreviewCard.tsx","../src/components/Progress/Progress.tsx","../src/components/ToggleGroup/ToggleGroup.tsx","../src/components/RadioGroup/RadioGroup.tsx","../src/components/Select/Select.tsx","../src/components/TimePicker/TimePicker.tsx","../src/components/DateInput/DateInput.tsx","../src/components/Combobox/Combobox.tsx","../src/components/PinInput/PinInput.tsx","../src/components/Toggle/Toggle.tsx","../src/components/Search/Search.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Slider/Slider.tsx","../src/components/Snackbar/Snackbar.tsx","../src/components/Sticker/Sticker.tsx","../src/components/Switch/Switch.tsx","../src/components/Table/Table.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/NavigationRail/NavigationRail.tsx","../src/components/NavigationList/NavigationList.tsx","../src/components/NavigationDrawer/NavigationDrawer.tsx","../src/tokens/baseTokens.ts","../src/themes/baseTheme.ts","../src/themes/createTheme.ts","../src/themes/monochromeTheme.ts","../src/components/AnvilRoot/AnvilRoot.tsx","../src/themes/toCssVariables.ts","../src/tokens/toCssVariables.ts"],"sourcesContent":["export { AnimatedNumber } from './components/AnimatedNumber/AnimatedNumber'\nexport type { AnimatedNumberProps } from './components/AnimatedNumber/AnimatedNumber'\n\nexport { AppBar } from './components/AppBar/AppBar'\nexport type { AppBarProps } from './components/AppBar/AppBar'\n\nexport { Avatar } from './components/Avatar/Avatar'\nexport type { AvatarProps } from './components/Avatar/Avatar'\n\nexport { AvatarGroup } from './components/AvatarGroup/AvatarGroup'\nexport type { AvatarGroupProps } from './components/AvatarGroup/AvatarGroup'\n\nexport { Badge } from './components/Badge/Badge'\nexport type { BadgeProps } from './components/Badge/Badge'\n\nexport {\n BottomSheet,\n BottomSheetTrigger,\n BottomSheetPopup,\n BottomSheetTitle,\n BottomSheetDescription,\n BottomSheetClose,\n} from './components/BottomSheet/BottomSheet'\nexport type {\n BottomSheetProps,\n BottomSheetTriggerProps,\n BottomSheetPopupProps,\n BottomSheetTitleProps,\n BottomSheetDescriptionProps,\n BottomSheetCloseProps,\n} from './components/BottomSheet/BottomSheet'\n\nexport { Button } from './components/Button/Button'\nexport type { ButtonProps } from './components/Button/Button'\n\nexport { SplitButton } from './components/SplitButton/SplitButton'\nexport type { SplitButtonProps } from './components/SplitButton/SplitButton'\n\nexport { HoldButton } from './components/HoldButton/HoldButton'\nexport type { HoldButtonProps } from './components/HoldButton/HoldButton'\n\nexport {\n Card,\n CardTitle,\n CardContent,\n CardActions,\n} from './components/Card/Card'\nexport type {\n CardProps,\n CardTitleProps,\n CardContentProps,\n CardActionsProps,\n} from './components/Card/Card'\n\nexport { Calendar } from './components/Calendar/Calendar'\nexport type { CalendarProps } from './components/Calendar/Calendar'\nexport { Carousel, CarouselItem } from './components/Carousel/Carousel'\nexport type {\n CarouselProps,\n CarouselItemProps,\n} from './components/Carousel/Carousel'\n\nexport { Chip, FilterChip, InputChip } from './components/Chip/Chip'\nexport type {\n ChipProps,\n FilterChipProps,\n InputChipProps,\n} from './components/Chip/Chip'\n\nexport { Checkbox } from './components/Checkbox/Checkbox'\nexport type { CheckboxProps } from './components/Checkbox/Checkbox'\n\nexport {\n Dialog,\n DialogTrigger,\n DialogPopup,\n DialogTitle,\n DialogDescription,\n DialogActions,\n DialogClose,\n} from './components/Dialog/Dialog'\nexport type {\n DialogProps,\n DialogTriggerProps,\n DialogPopupProps,\n DialogTitleProps,\n DialogDescriptionProps,\n DialogActionsProps,\n DialogCloseProps,\n} from './components/Dialog/Dialog'\n\nexport { useConfetti } from './components/Confetti/Confetti'\nexport type {\n ConfettiOptions,\n ConfettiOrigin,\n} from './components/Confetti/Confetti'\n\nexport { Divider } from './components/Divider/Divider'\nexport type { DividerProps } from './components/Divider/Divider'\n\nexport { FAB } from './components/FAB/FAB'\nexport type { FABProps } from './components/FAB/FAB'\n\nexport { FABMenu, FABMenuItem } from './components/FABMenu/FABMenu'\nexport type {\n FABMenuProps,\n FABMenuItemProps,\n} from './components/FABMenu/FABMenu'\n\nexport { Field, FieldDescription, FieldError } from './components/Field/Field'\nexport type {\n FieldProps,\n FieldDescriptionProps,\n FieldErrorProps,\n} from './components/Field/Field'\n\nexport { Icon } from './components/Icon/Icon'\nexport type { IconProps } from './components/Icon/Icon'\n\nexport { IconButton } from './components/IconButton/IconButton'\nexport type { IconButtonProps } from './components/IconButton/IconButton'\n\nexport { Input } from './components/Input/Input'\nexport type { InputProps } from './components/Input/Input'\n\nexport { Kbd } from './components/Kbd/Kbd'\nexport type { KbdProps } from './components/Kbd/Kbd'\n\nexport { List, ListItem } from './components/List/List'\nexport type { ListProps, ListItemProps } from './components/List/List'\n\nexport {\n Menu,\n MenuTrigger,\n MenuPopup,\n MenuItem,\n MenuGroup,\n MenuSubmenu,\n MenuSubmenuTrigger,\n} from './components/Menu/Menu'\nexport type {\n MenuProps,\n MenuTriggerProps,\n MenuPopupProps,\n MenuItemProps,\n MenuGroupProps,\n MenuSubmenuProps,\n MenuSubmenuTriggerProps,\n} from './components/Menu/Menu'\n\nexport { Menubar } from './components/Menubar/Menubar'\nexport type { MenubarProps } from './components/Menubar/Menubar'\n\nexport {\n Accordion,\n AccordionItem,\n AccordionTrigger,\n AccordionPanel,\n} from './components/Accordion/Accordion'\nexport type {\n AccordionProps,\n AccordionItemProps,\n AccordionTriggerProps,\n AccordionPanelProps,\n} from './components/Accordion/Accordion'\n\nexport {\n ContextMenu,\n ContextMenuTrigger,\n} from './components/ContextMenu/ContextMenu'\nexport type {\n ContextMenuProps,\n ContextMenuTriggerProps,\n} from './components/ContextMenu/ContextMenu'\n\nexport {\n Popover,\n PopoverTrigger,\n PopoverPopup,\n PopoverTitle,\n PopoverDescription,\n PopoverClose,\n} from './components/Popover/Popover'\nexport type {\n PopoverProps,\n PopoverTriggerProps,\n PopoverPopupProps,\n PopoverTitleProps,\n PopoverDescriptionProps,\n PopoverCloseProps,\n} from './components/Popover/Popover'\n\nexport {\n PreviewCard,\n PreviewCardTrigger,\n PreviewCardPopup,\n} from './components/PreviewCard/PreviewCard'\nexport type {\n PreviewCardProps,\n PreviewCardTriggerProps,\n PreviewCardPopupProps,\n} from './components/PreviewCard/PreviewCard'\n\nexport { Progress } from './components/Progress/Progress'\nexport type { ProgressProps } from './components/Progress/Progress'\n\nexport {\n ToggleGroup,\n ToggleGroupItem,\n} from './components/ToggleGroup/ToggleGroup'\nexport type {\n ToggleGroupProps,\n ToggleGroupItemProps,\n} from './components/ToggleGroup/ToggleGroup'\n\nexport { RadioGroup, Radio } from './components/RadioGroup/RadioGroup'\nexport type {\n RadioGroupProps,\n RadioProps,\n} from './components/RadioGroup/RadioGroup'\n\nexport { Select, SelectItem } from './components/Select/Select'\nexport type { SelectProps, SelectItemProps } from './components/Select/Select'\n\nexport { TimePicker } from './components/TimePicker/TimePicker'\nexport type { TimePickerProps } from './components/TimePicker/TimePicker'\n\nexport { DateInput } from './components/DateInput/DateInput'\nexport type { DateInputProps } from './components/DateInput/DateInput'\n\nexport { Combobox, ComboboxItem } from './components/Combobox/Combobox'\n\nexport { PinInput } from './components/PinInput/PinInput'\nexport type { PinInputProps } from './components/PinInput/PinInput'\nexport type {\n ComboboxProps,\n ComboboxItemProps,\n} from './components/Combobox/Combobox'\n\nexport { Toggle } from './components/Toggle/Toggle'\nexport type { ToggleProps } from './components/Toggle/Toggle'\n\nexport { Search, SearchItem } from './components/Search/Search'\nexport type { SearchProps, SearchItemProps } from './components/Search/Search'\n\nexport { Skeleton } from './components/Skeleton/Skeleton'\nexport type { SkeletonProps } from './components/Skeleton/Skeleton'\n\nexport { Slider } from './components/Slider/Slider'\nexport type { SliderProps } from './components/Slider/Slider'\n\nexport { useSnackbar } from './components/Snackbar/Snackbar'\nexport type { SnackbarOptions } from './components/Snackbar/Snackbar'\n\nexport { Sticker } from './components/Sticker/Sticker'\nexport type { StickerProps } from './components/Sticker/Sticker'\n\nexport { Switch } from './components/Switch/Switch'\nexport type { SwitchProps } from './components/Switch/Switch'\n\nexport {\n Table,\n TableCaption,\n TableHead,\n TableBody,\n TableRow,\n TableHeaderCell,\n TableCell,\n} from './components/Table/Table'\nexport type {\n TableProps,\n TableCaptionProps,\n TableHeadProps,\n TableBodyProps,\n TableRowProps,\n TableHeaderCellProps,\n TableCellProps,\n} from './components/Table/Table'\n\nexport { Tabs, TabsList, TabsTab, TabsPanel } from './components/Tabs/Tabs'\nexport type {\n TabsProps,\n TabsListProps,\n TabsTabProps,\n TabsPanelProps,\n} from './components/Tabs/Tabs'\n\nexport { Textarea } from './components/Textarea/Textarea'\nexport type { TextareaProps } from './components/Textarea/Textarea'\n\nexport {\n FloatingToolbar,\n FloatingToolbarButton,\n FloatingToolbarSeparator,\n} from './components/FloatingToolbar/FloatingToolbar'\nexport type {\n FloatingToolbarProps,\n FloatingToolbarButtonProps,\n FloatingToolbarSeparatorProps,\n} from './components/FloatingToolbar/FloatingToolbar'\n\nexport { Tooltip } from './components/Tooltip/Tooltip'\nexport type { TooltipProps } from './components/Tooltip/Tooltip'\n\nexport { Typography } from './components/Typography/Typography'\nexport type {\n TypographyProps,\n TypographyType,\n TypographyTag,\n} from './components/Typography/Typography'\n\nexport {\n NavigationBar,\n NavigationBarItem,\n} from './components/NavigationBar/NavigationBar'\nexport type {\n NavigationBarProps,\n NavigationBarItemProps,\n} from './components/NavigationBar/NavigationBar'\n\nexport {\n NavigationRail,\n NavigationRailToggle,\n NavigationRailItem,\n} from './components/NavigationRail/NavigationRail'\nexport type {\n NavigationRailProps,\n NavigationRailToggleProps,\n NavigationRailItemProps,\n} from './components/NavigationRail/NavigationRail'\n\nexport {\n NavigationList,\n NavigationListItem,\n} from './components/NavigationList/NavigationList'\nexport type {\n NavigationListProps,\n NavigationListItemProps,\n} from './components/NavigationList/NavigationList'\n\nexport {\n NavigationDrawer,\n NavigationDrawerTrigger,\n NavigationDrawerPopup,\n NavigationDrawerTitle,\n NavigationDrawerItem,\n} from './components/NavigationDrawer/NavigationDrawer'\nexport type {\n NavigationDrawerProps,\n NavigationDrawerTriggerProps,\n NavigationDrawerPopupProps,\n NavigationDrawerTitleProps,\n NavigationDrawerItemProps,\n} from './components/NavigationDrawer/NavigationDrawer'\n\n/** Every Material Symbols icon name, the type of `icon`, `startIcon`, `endIcon` and `Icon`'s `name`. */\nexport type { MaterialSymbol } from 'material-symbols'\n\nexport type { ComponentColor } from './colors/colors'\nexport type { ComponentFillType, ColorProps } from './colors/colors'\n\nexport { baseDesignTokens } from './tokens/baseTokens'\nexport type {\n DesignTokens,\n Font,\n FontSize,\n Ease,\n EaseLength,\n} from './tokens/types'\n\nexport { baseLightTheme, baseDarkTheme } from './themes/baseTheme'\nexport { createTheme, createThemeFromImage } from './themes/createTheme'\nexport type { ThemePair, CreateThemeOptions } from './themes/createTheme'\nexport {\n monochromeLightTheme,\n monochromeDarkTheme,\n} from './themes/monochromeTheme'\nexport type { Theme } from './themes/types'\n\nexport { AnvilRoot } from './components/AnvilRoot/AnvilRoot'\nexport type { AnvilRootProps } from './components/AnvilRoot/AnvilRoot'\n\nexport { AnvilContext, useAnvil } from './components/AnvilRoot/AnvilContext'\nexport type {\n ColorType,\n ColorModeSetting,\n} from './components/AnvilRoot/AnvilContext'\n\nexport { morph, morphBetween } from './morph'\nexport type { MorphOptions } from './morph'\n","import {\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type TransitionEvent,\n} from 'react'\nimport { cx } from '../../utils'\nimport './animated-number.css'\n\nexport type AnimatedNumberProps = Omit<\n React.ComponentProps<'span'>,\n 'children'\n> & {\n /** The number to show. Digits roll to the new value when it changes. */\n value: number\n /** How to format the number: decimals, currency, percent, compact, ... */\n format?: Intl.NumberFormatOptions\n /** Locale for formatting. @default the browser's */\n locales?: Intl.LocalesArgument\n}\n\nconst digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']\n// 0-9 three times. A digit rests in the middle copy, so it can roll past\n// 9 into the next 0 (or back past 0 into 9) and still have digits to show.\nconst strip = [...digits, ...digits, ...digits]\nconst HOME = 10\n\n/**\n * A number whose digits roll like an odometer when `value` changes.\n * Screen readers hear the formatted number, not the individual digits.\n *\n * @example\n * <AnimatedNumber value={price} format={{ style: 'currency', currency: 'USD' }} />\n */\nexport function AnimatedNumber({\n value,\n format,\n locales,\n className,\n ...props\n}: AnimatedNumberProps) {\n const text = useMemo(\n // Latin digits, so every digit gets a rolling column\n () =>\n new Intl.NumberFormat(locales, {\n ...format,\n numberingSystem: 'latn',\n }).format(value),\n [value, format, locales]\n )\n const chars = [...text]\n\n // Which way the digits roll: forward when the number goes up\n const [previous, setPrevious] = useState(value)\n const [direction, setDirection] = useState<1 | -1>(1)\n if (value !== previous) {\n setPrevious(value)\n setDirection(value > previous ? 1 : -1)\n }\n\n return (\n <span {...props} className={cx('avl-animated-number', className)}>\n <span className=\"avl-animated-number-label\">{text}</span>\n <span aria-hidden=\"true\">\n {chars.map((char, i) => {\n // Keyed from the right, so the ones stay the ones when\n // the number grows a digit (99 -> 100 rolls, not rebuilds)\n const fromEnd = chars.length - i\n const digit = digits.indexOf(char)\n if (digit === -1)\n return <span key={`s${fromEnd}`}>{char}</span>\n return (\n <Digit\n key={`d${fromEnd}`}\n digit={digit}\n direction={direction}\n />\n )\n })}\n </span>\n </span>\n )\n}\n\n// One rolling column. `position` is where the strip sits (0-29); it rolls\n// the short way round in `direction`, then quietly jumps back to the same\n// digit in the middle copy so the next roll has room either way.\nfunction Digit(props: { digit: number; direction: 1 | -1 }) {\n const { digit, direction } = props\n const ref = useRef<HTMLSpanElement>(null)\n const [shown, setShown] = useState(digit)\n const [position, setPosition] = useState(HOME + digit)\n\n if (digit !== shown) {\n const steps =\n direction > 0\n ? (digit - shown + 10) % 10\n : -((shown - digit + 10) % 10)\n let next = position + steps\n // Changes too quick to settle in between can run off the strip\n if (next < 0 || next >= strip.length) next = HOME + digit\n setShown(digit)\n setPosition(next)\n }\n\n const settle = (event: TransitionEvent) => {\n const el = ref.current\n if (!el || event.target !== el) return\n const home = HOME + shown\n if (position === home) return\n // Same digit one copy over, so the jump can't be seen. No\n // transition for it, and a reflow so the browser doesn't animate it.\n el.style.transition = 'none'\n el.style.setProperty('--avl-digit', String(home))\n void el.offsetHeight\n el.style.transition = ''\n setPosition(home)\n }\n\n return (\n <span className=\"avl-animated-number-digit\">\n {/* Invisible, sizes the column to one digit */}\n <span className=\"avl-animated-number-sizer\">{digit}</span>\n <span\n ref={ref}\n className=\"avl-animated-number-strip\"\n style={{ '--avl-digit': position } as CSSProperties}\n onTransitionEnd={settle}\n >\n {strip.map((d, i) => (\n <span key={i}>{d}</span>\n ))}\n </span>\n </span>\n )\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\n// Field-like components put `className` and `style` on their wrapper and\n// ARIA and data attributes on the control itself (the input, or the trigger\n// button), never on a wrapper or a Base UI Root that renders no element\nexport function splitControlProps<P extends object>(props: P) {\n const control: Record<string, unknown> = {}\n const rest: Record<string, unknown> = {}\n for (const [key, value] of Object.entries(props)) {\n if (key.startsWith('aria-') || key.startsWith('data-'))\n control[key] = value\n else rest[key] = value\n }\n return { control, rest: rest as P }\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","/**\n * A color role from the theme. `primary` is the brand color, `tonal` a\n * softer accent for selected and secondary actions, `container` the neutral\n * one (use it for \"secondary\" or \"default\" buttons), and `surface` the\n * background of navigation and popups. There is no `secondary`, `danger` or\n * `destructive`: use `tonal` or `container`, and `error`.\n */\nexport type ComponentColor =\n | 'primary'\n | 'tonal'\n | 'success'\n | 'warning'\n | 'error'\n | 'container'\n | 'surface'\n\n/**\n * How a color is applied. Takes the place of the `variant` prop other\n * libraries use.\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 { cx } from '../../utils'\nimport { useContext } from 'react'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { checkProp, checkRoot, OUTSIDE_ROOT } from '../../dev'\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 /**\n * The look (what other libraries call `variant`). Also picks the tag:\n * `h1`–`h6` render that heading, `body` a `<p>`, `caption` a `<span>`.\n * @default 'body'\n */\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\n/**\n * Text in the theme's type scale.\n *\n * @example\n * <Typography type=\"h1\">Settings</Typography>\n * <Typography type=\"h6\" as=\"h2\">Notifications</Typography>\n * <Typography type=\"caption\">Updated 2 min ago</Typography>\n */\nexport function Typography({\n type = 'body',\n as,\n className,\n ...props\n}: TypographyProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'Typography', OUTSIDE_ROOT)\n checkProp(\n props,\n 'variant',\n 'Typography',\n 'Use `type` for the look and `as` for the tag.',\n '<Typography type=\"h4\" as=\"h1\">Title</Typography>\\n// type: body | caption | h1 | h2 | h3 | h4 | h5 | h6',\n 'typography.md'\n )\n }\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 {\n createContext,\n Dispatch,\n RefObject,\n SetStateAction,\n useContext,\n} from 'react'\nimport { Theme } from '../../themes/types'\nimport { DesignTokens } from '../../tokens/types'\n\n/** The mode actually shown. */\nexport type ColorType = 'light' | 'dark'\n/** What the user picked; `'system'` follows the OS setting live. */\nexport type ColorModeSetting = ColorType | 'system'\n\ntype AnvilContextValues = {\n /** The mode being shown, with `'system'` already resolved. */\n colorMode: ColorType\n /** What was picked, which may be `'system'`. */\n colorModeSetting: ColorModeSetting\n /** Changes the color mode, like a `useState` setter. Saved under `storageKey` if set. */\n setColorMode: Dispatch<SetStateAction<ColorModeSetting>>\n /** The theme used in dark mode. */\n darkTheme: Theme\n /** The theme used in light mode. */\n lightTheme: Theme\n /** The design tokens in use, defaults filled in. */\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\n/** The raw context behind `useAnvil()`: `null` outside AnvilRoot. Prefer `useAnvil()`. */\nexport const AnvilContext = createContext<AnvilContextValues | null>(null)\n\n/**\n * The current color mode, its setter, themes and tokens. Must be used inside\n * `AnvilRoot`.\n *\n * @example\n * const { colorMode, setColorMode } = useAnvil()\n * <Switch checked={colorMode === 'dark'} onCheckedChange={(dark) => setColorMode(dark ? 'dark' : 'light')} />\n */\nexport function useAnvil() {\n const avl = useContext(AnvilContext)\n if (!avl)\n throw new Error(\n '[anvilui] useAnvil() was called outside <AnvilRoot>.\\n\\n' +\n 'Fix: call it from a component rendered inside <AnvilRoot>, not in the component that renders AnvilRoot:\\n' +\n '<AnvilRoot><App /></AnvilRoot> // useAnvil() inside App works\\n\\n' +\n 'Docs: node_modules/anvilui/docs/theming.md'\n )\n return avl\n}\n","// Development-only checks for setup mistakes. Each message says what's\n// wrong, shows the fix, and names the doc page in the installed package.\n// Every call site is wrapped in `process.env.NODE_ENV !== 'production'`,\n// which bundlers replace, so all of this drops out of production builds.\n\nconst reported = new Set<string>()\n\n/** Logs once per distinct message, so a list of 100 items logs one error. */\nexport function devError(message: string, fix: string, doc: string) {\n const text =\n `[anvilui] ${message}\\n\\nFix:\\n${fix}\\n\\n` +\n `Docs: node_modules/anvilui/docs/${doc}`\n if (reported.has(text)) return\n reported.add(text)\n console.error(text)\n}\n\n/** Base UI's `render` prop replaces Radix-style `asChild`. */\nexport function checkAsChild(\n props: object,\n component: string,\n doc: string,\n fix = `<${component} render={<Button />}>Open</${component}>`\n) {\n if (!('asChild' in props)) return\n devError(\n `<${component}> has no \\`asChild\\` prop. AnvilUI uses Base UI's \\`render\\` prop instead.`,\n fix,\n doc\n )\n}\n\n/** A prop name borrowed from another library (`variant`, `label`, ...). */\nexport function checkProp(\n props: object,\n prop: string,\n component: string,\n instead: string,\n fix: string,\n doc: string\n) {\n if (!(prop in props)) return\n devError(`<${component}> has no \\`${prop}\\` prop. ${instead}`, fix, doc)\n}\n\nexport const POPUP_OUTSIDE_ROOT =\n 'Its popup portals to <body>, outside the theme, so it shows unstyled.'\nexport const OUTSIDE_ROOT =\n 'The theme variables only exist inside AnvilRoot, so it shows without colors, spacing or fonts.'\n\n/** Components need AnvilRoot for the theme and as the portal target. */\nexport function checkRoot(\n found: boolean,\n component: string,\n reason = POPUP_OUTSIDE_ROOT\n) {\n if (found) return\n devError(\n `<${component}> is rendered outside <AnvilRoot>. ${reason}`,\n `import { AnvilRoot } from 'anvilui'\\nimport 'anvilui/styles.css'\\n\\n<AnvilRoot>\\n <App />\\n</AnvilRoot>`,\n 'setup.md'\n )\n}\n\n/** For controls with no visible text: their name must come from aria-label. */\nexport function checkName(\n props: { 'aria-label'?: unknown; 'aria-labelledby'?: unknown },\n component: string,\n example: string,\n doc: string\n) {\n if (props['aria-label'] || props['aria-labelledby']) return\n devError(\n `<${component}> has no accessible name. It shows no text, so screen readers need an \\`aria-label\\`.`,\n example,\n doc\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 `surface`), 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/**\n * The bar across the top of a page or screen: title, navigation and actions.\n * The title is the `label` prop, not children.\n *\n * @example\n * <AppBar\n * label=\"Inbox\"\n * labelAs=\"h1\"\n * start={<IconButton icon=\"menu\" aria-label=\"Menu\" fillType=\"text\" color=\"container\" />}\n * end={<IconButton icon=\"search\" aria-label=\"Search\" fillType=\"text\" color=\"container\" />}\n * />\n */\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 { useContext } from 'react'\nimport { 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 { AvatarGroupContext } from './AvatarGroupContext'\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', or the AvatarGroup's size */\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 *\n * @example\n * <Avatar name=\"Ada Lovelace\" src=\"/ada.jpg\" />\n * <Avatar name=\"Ada Lovelace\" color=\"tonal\" size=\"big\" />\n */\nexport function Avatar({\n src,\n name,\n icon = 'person',\n size: sizeProp,\n color,\n fillType,\n className,\n children,\n ...props\n}: AvatarProps) {\n const groupSize = useContext(AvatarGroupContext)\n const size = sizeProp ?? groupSize ?? 'normal'\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 /**\n * Material Symbols (Rounded) name in snake_case, e.g. `'home'`,\n * `'arrow_back'`, `'more_vert'`. Browse them at fonts.google.com/icons.\n */\n name: MaterialSymbol\n}\n\n/**\n * A Material Symbols icon. It's hidden from screen readers unless you give\n * it an `aria-label`. Size follows `font-size`, color follows `color`.\n * Other components take icon names directly (`startIcon=\"add\"`), so you\n * rarely need this.\n *\n * @example\n * <Icon name=\"favorite\" />\n * <Icon name=\"warning\" aria-label=\"Warning\" style={{ fontSize: 32 }} />\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 { createContext } from 'react'\nimport type { AvatarProps } from './Avatar'\n\n// An AvatarGroup's size, so the avatars inside match it without each\n// setting `size`. Its own file so Avatar and AvatarGroup can both use it.\nexport const AvatarGroupContext = createContext<AvatarProps['size'] | null>(\n null\n)\n","import { Children, type ComponentProps } from 'react'\nimport { Avatar, type AvatarProps } from '../Avatar/Avatar'\nimport { AvatarGroupContext } from '../Avatar/AvatarGroupContext'\nimport { AnimatedNumber } from '../AnimatedNumber/AnimatedNumber'\nimport { cx } from '../../utils'\nimport './avatar-group.css'\n\nexport type AvatarGroupProps = ComponentProps<'div'> & {\n /**\n * Most avatars to show. Past it, the last spot becomes a \"+N\" counter,\n * so the group never takes more than `max` spots. @default no limit\n */\n max?: number\n /** Size of every avatar inside, unless one sets its own. @default 'normal' */\n size?: AvatarProps['size']\n /** Spread the avatars apart on hover and keyboard focus. @default true */\n fan?: boolean\n}\n\n/**\n * A row of overlapping `Avatar`s that fans out on hover. Give it an\n * `aria-label` (\"Project members\") so screen readers know what the\n * avatars are.\n *\n * @example\n * <AvatarGroup max={4} aria-label=\"Project members\">\n * {people.map((p) => <Avatar key={p.id} name={p.name} src={p.photo} />)}\n * </AvatarGroup>\n */\nexport function AvatarGroup({\n max,\n size = 'normal',\n fan = true,\n className,\n children,\n ...props\n}: AvatarGroupProps) {\n const avatars = Children.toArray(children)\n const overflow = max !== undefined && avatars.length > max\n // The counter takes the last spot\n const shown = overflow ? avatars.slice(0, Math.max(0, max - 1)) : avatars\n const hidden = avatars.length - shown.length\n\n return (\n <AvatarGroupContext value={size}>\n <div\n role=\"group\"\n {...props}\n className={cx(\n 'avl-avatar-group',\n fan && 'avl-avatar-group-fan',\n className\n )}\n >\n {shown}\n {overflow && (\n <Avatar name={`${hidden} more`} color=\"container\">\n +<AnimatedNumber value={hidden} />\n </Avatar>\n )}\n </div>\n </AvatarGroupContext>\n )\n}\n","import type { ComponentProps } from 'react'\nimport { colorClass, type ComponentColor } from '../../colors/colors'\nimport { cx } from '../../utils'\nimport { AnimatedNumber } from '../AnimatedNumber/AnimatedNumber'\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 *\n * @example\n * <Badge count={3}><IconButton icon=\"mail\" aria-label=\"Inbox, 3 unread\" /></Badge>\n * <Badge><Icon name=\"notifications\" /></Badge> // a dot\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 {/* Digits roll when the count changes */}\n {count !== undefined && (\n <>\n <AnimatedNumber value={Math.min(count, max)} />\n {count > max && '+'}\n </>\n )}\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 { checkAsChild, checkRoot } from '../../dev'\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\n/**\n * A panel that slides up from the bottom. Parts: `BottomSheetTrigger`,\n * `BottomSheetPopup` (includes portal, backdrop and drag handle),\n * `BottomSheetTitle`, `BottomSheetDescription`, `BottomSheetClose`.\n *\n * @example\n * <BottomSheet>\n * <BottomSheetTrigger render={<Button />}>Share</BottomSheetTrigger>\n * <BottomSheetPopup>\n * <BottomSheetTitle>Share</BottomSheetTitle>\n * <List>...</List>\n * </BottomSheetPopup>\n * </BottomSheet>\n */\nexport function BottomSheet(props: BottomSheetProps) {\n return <Drawer.Root {...props} swipeDirection=\"down\" />\n}\n\nexport type BottomSheetTriggerProps = Drawer.Trigger.Props\n\n/** Opens the sheet. Renders a bare `<button>`; pass `render={<Button />}` to use the library's. */\nexport function BottomSheetTrigger({\n className,\n ...props\n}: BottomSheetTriggerProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(props, 'BottomSheetTrigger', 'bottom-sheet.md')\n }\n return (\n <Drawer.Trigger\n {...props}\n className={withClass('avl-bottom-sheet-trigger', className)}\n />\n )\n}\n\nexport type BottomSheetPopupProps = Drawer.Popup.Props\n\n/**\n * The sheet. Also renders the portal, the dimmed backdrop and the drag\n * handle. Its children scroll when the sheet is taller than the screen allows.\n */\nexport function BottomSheetPopup({\n className,\n children,\n ...props\n}: BottomSheetPopupProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'BottomSheetPopup')\n }\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\nexport type BottomSheetTitleProps = Drawer.Title.Props\n\n/** Names the sheet for screen readers. Renders an `<h2>`. */\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\n/** Supporting text under the title. */\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\nexport type BottomSheetCloseProps = Drawer.Close.Props\n\n/** Closes the sheet. Renders a bare `<button>`; pass `render={<Button />}` to use the library's. */\nexport function BottomSheetClose({\n className,\n ...props\n}: BottomSheetCloseProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(props, 'BottomSheetClose', 'bottom-sheet.md')\n }\n return (\n <Drawer.Close\n {...props}\n className={withClass('avl-bottom-sheet-close', className)}\n />\n )\n}\n","import { useContext, 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 { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { checkAsChild, checkProp, checkRoot, OUTSIDE_ROOT } from '../../dev'\nimport './button.css'\n\nexport type ButtonProps = BaseButtonProps & {\n /** Height and text size: 32px, 40px or 48px tall. @default 'normal' */\n size?: 'small' | 'normal' | 'big'\n /**\n * How the color is applied: solid, bordered, or text only. This is the\n * prop other libraries call `variant`. @default 'filled'\n */\n fillType?: ComponentFillType\n /** Color role from the theme. @default 'primary' */\n color?: ComponentColor\n /** Material Symbol name shown before the label, e.g. `'add'`. */\n startIcon?: MaterialSymbol\n /** Material Symbol name shown after the label, e.g. `'arrow_forward'`. */\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\n/**\n * A button with a text label and optional icons. Renders a `<button>`; for a\n * link, pass `render={<a href=\"/x\" />}` and `nativeButton={false}`.\n *\n * @example\n * <Button startIcon=\"add\" onClick={create}>New</Button>\n * <Button fillType=\"outlined\" color=\"error\">Delete</Button>\n * <Button loading={saving}>{saving ? 'Saving' : 'Save'}</Button>\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 const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'Button', OUTSIDE_ROOT)\n checkProp(\n props,\n 'variant',\n 'Button',\n 'Use `fillType` for the style and `color` for the theme role.',\n \"<Button fillType=\\\"outlined\\\" color=\\\"error\\\">Delete</Button>\\n// fillType: 'filled' | 'outlined' | 'text'\\n// color: 'primary' | 'tonal' | 'success' | 'warning' | 'error' | 'container' | 'surface'\",\n 'button.md'\n )\n checkAsChild(\n props,\n 'Button',\n 'button.md',\n '<Button render={<a href=\"/settings\" />} nativeButton={false}>Settings</Button>'\n )\n }\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\n/**\n * Joins `Button`s (and `IconButton`s) into one segmented group with shared\n * rounded ends. Style each button yourself; the group only lays them out.\n *\n * @example\n * <SplitButton>\n * <Button>Save</Button>\n * <Menu>\n * <MenuTrigger render={<IconButton icon=\"arrow_drop_down\" aria-label=\"More save options\" />} />\n * <MenuPopup>...</MenuPopup>\n * </Menu>\n * </SplitButton>\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. Use `onConfirm`, not `onClick`.\n *\n * @example\n * <HoldButton color=\"error\" startIcon=\"delete\" onConfirm={deleteAll}>Hold to delete</HoldButton>\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 { useContext } from 'react'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { checkRoot, OUTSIDE_ROOT } from '../../dev'\nimport './card.css'\n\ntype CardStyleProps = {\n /** How the color is applied. @default 'filled' */\n fillType?: ComponentFillType\n /**\n * Color role from the theme. Neutral by default, so primary buttons\n * inside still stand out. @default 'container'\n */\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 & {\n /**\n * Make the whole card one button (or a link, with\n * `render={<a href=\"...\" />}`). Buttons and links inside still\n * work on their own. @default false\n */\n clickable?: false\n })\n | (Omit<BaseButtonProps, 'color'> &\n CardStyleProps & {\n /**\n * Make the whole card one button (or a link, with\n * `render={<a href=\"...\" />}`). Buttons and links inside still\n * work on their own. @default false\n */\n clickable: true\n })\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/**\n * A rounded surface that groups related content. Compose it from\n * `CardTitle`, `CardContent` and `CardActions` (there is no CardHeader or\n * CardFooter). Neutral `container` color by default.\n *\n * @example\n * <Card>\n * <CardTitle as=\"h2\">Storage</CardTitle>\n * <CardContent>You've used 80% of your space.</CardContent>\n * <CardActions>\n * <Button fillType=\"text\">Dismiss</Button>\n * <Button>Upgrade</Button>\n * </CardActions>\n * </Card>\n */\nexport function Card(props: CardProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'Card', OUTSIDE_ROOT)\n }\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/**\n * The card's title. Looks like an h6 but renders a `<div>`: pass `as=\"h2\"`\n * (or the level that fits the page) to make it a heading.\n */\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\n/** The card's body, with padding. */\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\n/** A row of buttons at the bottom of the card, aligned to the end. */\nexport function CardActions({ className, ...props }: CardActionsProps) {\n return <div {...props} className={cx('avl-card-actions', className)} />\n}\n","import { useEffect, useRef, useState } from 'react'\nimport { IconButton } from '../IconButton/IconButton'\nimport { cx } from '../../utils'\nimport { fromIso, toIso } from '../../datetime'\nimport './calendar.css'\n\nexport type CalendarProps = Omit<\n React.ComponentProps<'div'>,\n 'defaultValue' | 'onChange'\n> & {\n /** The picked date as `\"YYYY-MM-DD\"` (like `<input type=\"date\">`), or `null` for none. */\n value?: string | null\n /** Starting date when `value` isn't controlled. @default null */\n defaultValue?: string | null\n /** Called with the picked `\"YYYY-MM-DD\"`. */\n onValueChange?: (value: string) => void\n}\n\n// 0 = Sunday. Intl.Locale's week info isn't in every browser yet.\nfunction localeWeekStart(): number {\n try {\n const locale = new Intl.Locale(navigator.language) as Intl.Locale & {\n getWeekInfo?: () => { firstDay: number }\n weekInfo?: { firstDay: number }\n }\n const info = locale.getWeekInfo?.() ?? locale.weekInfo\n return info ? info.firstDay % 7 : 0\n } catch {\n return 0\n }\n}\n\n/**\n * A month grid to pick a date from. Arrow keys move by day and week, Page\n * Up/Down by month (with Shift, by year), Home/End to the ends of the week.\n * The first weekday and all names follow the user's locale. Values are\n * `\"YYYY-MM-DD\"` strings, not `Date` objects.\n *\n * @example\n * <Calendar value={date} onValueChange={setDate} />\n */\nexport function Calendar({\n value: valueProp,\n defaultValue = null,\n onValueChange,\n className,\n ...props\n}: CalendarProps) {\n const [internal, setInternal] = useState(defaultValue)\n const selected = fromIso(valueProp !== undefined ? valueProp : internal)\n const [focused, setFocused] = useState(() => {\n const now = new Date()\n return (\n selected ??\n new Date(now.getFullYear(), now.getMonth(), now.getDate())\n )\n })\n const [weekStart] = useState(localeWeekStart)\n const dayRef = useRef<HTMLButtonElement>(null)\n const moveFocus = useRef(false)\n const year = focused.getFullYear()\n const month = focused.getMonth()\n\n // Keyboard moves take focus along; the arrow buttons leave it where it is\n useEffect(() => {\n if (moveFocus.current) dayRef.current?.focus()\n moveFocus.current = false\n }, [focused])\n\n const go = (d: Date, focus = true) => {\n moveFocus.current = focus\n setFocused(d)\n }\n\n // Same day in another month, or its last day if that's shorter\n const shiftMonths = (n: number, focus = false) => {\n const first = new Date(year, month + n, 1)\n const last = new Date(first.getFullYear(), first.getMonth() + 1, 0)\n go(\n new Date(\n first.getFullYear(),\n first.getMonth(),\n Math.min(focused.getDate(), last.getDate())\n ),\n focus\n )\n }\n\n const select = (d: Date) => {\n const iso = toIso(d)\n setInternal(iso)\n setFocused(d)\n onValueChange?.(iso)\n }\n\n const today = toIso(new Date())\n const selectedIso = selected && toIso(selected)\n const focusedIso = toIso(focused)\n\n const offset = (new Date(year, month, 1).getDay() - weekStart + 7) % 7\n const daysInMonth = new Date(year, month + 1, 0).getDate()\n const cells: (Date | null)[] = [\n ...Array<null>(offset).fill(null),\n ...Array.from(\n { length: daysInMonth },\n (_, i) => new Date(year, month, i + 1)\n ),\n ]\n while (cells.length % 7) cells.push(null)\n const weeks = Array.from({ length: cells.length / 7 }, (_, i) =>\n cells.slice(i * 7, i * 7 + 7)\n )\n\n // 1 Jan 2023 was a Sunday\n const weekdays = Array.from(\n { length: 7 },\n (_, i) => new Date(2023, 0, 1 + ((weekStart + i) % 7))\n )\n const weekdayShort = new Intl.DateTimeFormat(undefined, {\n weekday: 'narrow',\n })\n const weekdayLong = new Intl.DateTimeFormat(undefined, { weekday: 'long' })\n const dayName = new Intl.DateTimeFormat(undefined, { dateStyle: 'full' })\n const monthName = new Intl.DateTimeFormat(undefined, { month: 'short' })\n const monthYear = new Intl.DateTimeFormat(undefined, {\n month: 'long',\n year: 'numeric',\n })\n\n const onKeyDown = (e: React.KeyboardEvent) => {\n const steps: Record<string, number> = {\n ArrowLeft: -1,\n ArrowRight: 1,\n ArrowUp: -7,\n ArrowDown: 7,\n }\n const day = focused.getDate()\n const intoWeek = (focused.getDay() - weekStart + 7) % 7\n if (e.key in steps) go(new Date(year, month, day + steps[e.key]))\n else if (e.key === 'PageUp') shiftMonths(e.shiftKey ? -12 : -1, true)\n else if (e.key === 'PageDown') shiftMonths(e.shiftKey ? 12 : 1, true)\n else if (e.key === 'Home') go(new Date(year, month, day - intoWeek))\n else if (e.key === 'End') go(new Date(year, month, day + 6 - intoWeek))\n else return\n e.preventDefault()\n }\n\n return (\n <div {...props} className={cx('avl-calendar', className)}>\n <div className=\"avl-calendar-header\">\n <div className=\"avl-calendar-nav\">\n <IconButton\n icon=\"chevron_left\"\n fillType=\"text\"\n color=\"container\"\n aria-label=\"Previous month\"\n onClick={() => shiftMonths(-1)}\n />\n <span className=\"avl-calendar-nav-label\" aria-live=\"polite\">\n {monthName.format(focused)}\n </span>\n <IconButton\n icon=\"chevron_right\"\n fillType=\"text\"\n color=\"container\"\n aria-label=\"Next month\"\n onClick={() => shiftMonths(1)}\n />\n </div>\n <div className=\"avl-calendar-nav\">\n <IconButton\n icon=\"chevron_left\"\n fillType=\"text\"\n color=\"container\"\n aria-label=\"Previous year\"\n onClick={() => shiftMonths(-12)}\n />\n <span className=\"avl-calendar-nav-label\" aria-live=\"polite\">\n {year}\n </span>\n <IconButton\n icon=\"chevron_right\"\n fillType=\"text\"\n color=\"container\"\n aria-label=\"Next year\"\n onClick={() => shiftMonths(12)}\n />\n </div>\n </div>\n <table\n className=\"avl-calendar-grid\"\n role=\"grid\"\n aria-label={monthYear.format(focused)}\n onKeyDown={onKeyDown}\n >\n <thead>\n <tr>\n {weekdays.map((d) => (\n <th\n key={d.getDay()}\n scope=\"col\"\n abbr={weekdayLong.format(d)}\n className=\"avl-calendar-weekday\"\n >\n {weekdayShort.format(d)}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week, w) => (\n <tr key={w}>\n {week.map((d, i) => {\n if (!d) return <td key={i} />\n const iso = toIso(d)\n const isFocused = iso === focusedIso\n return (\n <td\n key={i}\n role=\"gridcell\"\n aria-selected={iso === selectedIso}\n >\n <button\n ref={isFocused ? dayRef : undefined}\n type=\"button\"\n className=\"avl-calendar-day\"\n tabIndex={isFocused ? 0 : -1}\n aria-label={dayName.format(d)}\n aria-current={\n iso === today\n ? 'date'\n : undefined\n }\n data-selected={\n iso === selectedIso || undefined\n }\n onClick={() => select(d)}\n >\n {d.getDate()}\n </button>\n </td>\n )\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\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 { useContext } from 'react'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport {\n checkAsChild,\n checkName,\n checkProp,\n checkRoot,\n OUTSIDE_ROOT,\n} from '../../dev'\nimport './icon-button.css'\n\nexport type IconButtonProps = Omit<BaseButtonProps, 'children'> & {\n /** Material Symbol name to show, e.g. `'delete'`. Takes no children. */\n icon: MaterialSymbol\n /** How the color is applied. @default 'filled' */\n fillType?: ComponentFillType\n /** Color role from the theme. @default 'primary' */\n color?: ComponentColor\n /** 32px, 40px or 48px, the same heights as `Button`. @default 'normal' */\n size?: 'small' | 'normal' | 'big'\n /** Required: there is no visible text, so screen readers read this. */\n 'aria-label': string\n}\n\n/**\n * A round button that shows only an icon.\n *\n * @example\n * <IconButton icon=\"delete\" aria-label=\"Delete\" fillType=\"text\" color=\"container\" />\n * <IconButton icon=\"add\" aria-label=\"Add\" size=\"big\" />\n */\nexport function IconButton({\n icon,\n color,\n fillType,\n size = 'normal',\n className,\n ...props\n}: IconButtonProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'IconButton', OUTSIDE_ROOT)\n checkName(\n props,\n 'IconButton',\n '<IconButton icon=\"delete\" aria-label=\"Delete\" />',\n 'icon-button.md'\n )\n checkProp(\n props,\n 'variant',\n 'IconButton',\n 'Use `fillType` (filled | outlined | text) and `color`.',\n '<IconButton icon=\"close\" aria-label=\"Close\" fillType=\"text\" color=\"container\" />',\n 'icon-button.md'\n )\n checkAsChild(\n props,\n 'IconButton',\n 'icon-button.md',\n '<IconButton icon=\"home\" aria-label=\"Home\" render={<a href=\"/\" />} nativeButton={false} />'\n )\n }\n return (\n <BaseButton\n {...props}\n className={withClass(\n `avl-icon-button ${colorClass(color, fillType)} avl-icon-button-size-${size}`,\n className\n )}\n >\n <Icon name={icon} />\n </BaseButton>\n )\n}\n","// Date and time helpers for Calendar, DateInput and TimePicker. Kept free of\n// React and CSS imports, so they can be run and checked in plain Node.\n\nconst pad = (n: number, length = 2) => String(n).padStart(length, '0')\n\nexport const toIso = (d: Date) =>\n `${pad(d.getFullYear(), 4)}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`\n\n// new Date() rolls 31 Feb over into March; reject that instead\nexport function makeDate(y: number, m: number, d: number): Date | null {\n const date = new Date(y, m, d)\n return date.getFullYear() === y &&\n date.getMonth() === m &&\n date.getDate() === d\n ? date\n : null\n}\n\nexport function fromIso(value: string | null | undefined): Date | null {\n const match = value ? /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value) : null\n return match ? makeDate(+match[1], +match[2] - 1, +match[3]) : null\n}\n\nexport type DateField = 'year' | 'month' | 'day'\n\n// Which order the locale writes year, month and day in\nexport const fieldOrder = (fmt: Intl.DateTimeFormat) =>\n fmt\n .formatToParts(new Date(2000, 10, 22))\n .filter(\n (p) => p.type === 'year' || p.type === 'month' || p.type === 'day'\n )\n .map((p) => p.type as DateField)\n\n// \"MM/DD/YYYY\" in the locale's order and separators\nexport function placeholderFor(fmt: Intl.DateTimeFormat) {\n const hint = { year: 'YYYY', month: 'MM', day: 'DD' }\n return fmt\n .formatToParts(new Date(2000, 10, 22))\n .map((p) =>\n p.type === 'literal'\n ? p.value\n : (hint[p.type as keyof typeof hint] ?? '')\n )\n .join('')\n}\n\n// Any separator works; the year needs all 4 digits so \"26\" isn't guessed\nexport function parseTyped(text: string, order: DateField[]) {\n const numbers = text.match(/\\d+/g)\n if (numbers?.length !== 3) return null\n const parts = Object.fromEntries(order.map((type, i) => [type, numbers[i]]))\n if (parts.year.length !== 4) return null\n return makeDate(+parts.year, +parts.month - 1, +parts.day)\n}\n\nexport type Time = { h: number; m: number }\n\n// \"HH:mm\" (or \"H:mm\") to hours and minutes\nexport function parseTime(value: string | null | undefined): Time | null {\n const match = value ? /^(\\d{1,2}):(\\d{2})/.exec(value) : null\n return match ? { h: +match[1] % 24, m: +match[2] % 60 } : null\n}\n","import { useEffect, useRef, type RefObject } from 'react'\nimport { cx, mergeRefs } from '../../utils'\nimport './carousel.css'\n\nexport type CarouselProps = React.ComponentProps<'div'> & {\n /** What the carousel shows, for screen readers (\"Featured albums\"). */\n 'aria-label': string\n}\n\n/**\n * A horizontally scrolling row of `CarouselItem`s.\n * Items running off an edge are masked with rounded corners instead of being\n * cut off flat, and their content slides to stay centered in what's visible\n * (in browsers with scroll-driven animations; Firefox cuts them off flat).\n * With a mouse, it can be dragged and thrown like on a touch screen.\n *\n * @example\n * <Carousel aria-label=\"Featured albums\">\n * {albums.map((a) => <CarouselItem key={a.id}><img src={a.cover} alt={a.title} /></CarouselItem>)}\n * </Carousel>\n */\nexport function Carousel({\n className,\n ref,\n children,\n ...props\n}: CarouselProps) {\n const local = useRef<HTMLDivElement>(null)\n useDragScroll(local)\n\n return (\n <div\n role=\"region\"\n aria-roledescription=\"carousel\"\n // Focusable, so arrow keys scroll it without a mouse\n tabIndex={0}\n {...props}\n ref={mergeRefs(local, ref)}\n className={cx('avl-carousel', className)}\n >\n {children}\n </div>\n )\n}\n\nexport type CarouselItemProps = React.ComponentProps<'div'>\n\n/** One item in a `Carousel`. Set its width with CSS; 240px by default. */\nexport function CarouselItem({\n className,\n children,\n ...props\n}: CarouselItemProps) {\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n {...props}\n className={cx('avl-carousel-item', className)}\n >\n <div className=\"avl-carousel-item-content\">{children}</div>\n </div>\n )\n}\n\n// How far the mouse moves before a press becomes a drag, so clicks on\n// links and buttons inside items still work\nconst DRAG_THRESHOLD = 5\n// Share of the glide speed kept every 16ms after a throw\nconst FRICTION = 0.95\n\n// Mouse drag-to-scroll with momentum. Touch and trackpads already scroll\n// natively, so this only handles the mouse.\nfunction useDragScroll(ref: RefObject<HTMLElement | null>) {\n useEffect(() => {\n const el = ref.current\n if (!el) return\n\n let startX = 0\n let startScroll = 0\n let pointer: number | null = null\n let dragging = false\n // Recent positions, to measure the throw speed on release\n let samples: { x: number; t: number }[] = []\n let glide = 0\n\n const stopGlide = () => cancelAnimationFrame(glide)\n\n const onDown = (event: PointerEvent) => {\n if (event.pointerType !== 'mouse' || event.button !== 0) return\n stopGlide()\n // A press on the scrollbar belongs to the scrollbar\n const top = el.getBoundingClientRect().top + el.clientTop\n if (event.clientY > top + el.clientHeight) return\n pointer = event.pointerId\n startX = event.clientX\n startScroll = el.scrollLeft\n dragging = false\n samples = [{ x: event.clientX, t: event.timeStamp }]\n }\n\n const onMove = (event: PointerEvent) => {\n if (event.pointerId !== pointer) return\n const dx = event.clientX - startX\n if (!dragging) {\n if (Math.abs(dx) < DRAG_THRESHOLD) return\n dragging = true\n el.setPointerCapture(event.pointerId)\n el.toggleAttribute('data-dragging', true)\n // Text selected in the first few pixels would stay selected\n window.getSelection()?.removeAllRanges()\n }\n el.scrollLeft = startScroll - dx\n samples.push({ x: event.clientX, t: event.timeStamp })\n // Only the last 100ms count toward the throw\n while (samples.length > 2 && event.timeStamp - samples[0].t > 100)\n samples.shift()\n }\n\n const onUp = (event: PointerEvent) => {\n if (event.pointerId !== pointer) return\n pointer = null\n if (!dragging) return\n el.removeAttribute('data-dragging')\n // The click after a drag would land on whatever is under the\n // mouse; swallow it\n el.addEventListener('click', swallowClick, {\n capture: true,\n once: true,\n })\n setTimeout(\n () => el.removeEventListener('click', swallowClick, true),\n 0\n )\n const first = samples[0]\n const last = samples[samples.length - 1]\n const elapsed = last.t - first.t\n if (\n event.type === 'pointerup' &&\n elapsed > 0 &&\n !matchMedia('(prefers-reduced-motion: reduce)').matches\n )\n startGlide((last.x - first.x) / elapsed)\n }\n\n // Keeps scrolling after a throw, slowing down until it stops\n const startGlide = (speed: number) => {\n let previous = performance.now()\n const step = (now: number) => {\n const dt = now - previous\n previous = now\n speed *= FRICTION ** (dt / 16)\n const before = el.scrollLeft\n el.scrollLeft -= speed * dt\n // Stop when it's nearly still or has hit an end\n if (Math.abs(speed) > 0.02 && el.scrollLeft !== before)\n glide = requestAnimationFrame(step)\n }\n glide = requestAnimationFrame(step)\n }\n\n // Images and links would start a native drag instead\n const onDragStart = (event: DragEvent) => event.preventDefault()\n\n el.addEventListener('pointerdown', onDown)\n el.addEventListener('pointermove', onMove)\n el.addEventListener('pointerup', onUp)\n el.addEventListener('pointercancel', onUp)\n el.addEventListener('dragstart', onDragStart)\n // Any other scrolling takes over from a glide\n el.addEventListener('wheel', stopGlide, { passive: true })\n el.addEventListener('keydown', stopGlide)\n\n return () => {\n stopGlide()\n el.removeEventListener('pointerdown', onDown)\n el.removeEventListener('pointermove', onMove)\n el.removeEventListener('pointerup', onUp)\n el.removeEventListener('pointercancel', onUp)\n el.removeEventListener('dragstart', onDragStart)\n el.removeEventListener('wheel', stopGlide)\n el.removeEventListener('keydown', stopGlide)\n }\n }, [ref])\n}\n\nfunction swallowClick(event: MouseEvent) {\n event.preventDefault()\n event.stopPropagation()\n}\n","import { useRef, useState, 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, mergeRefs, 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\n/**\n * A compact button for suggestions and quick actions. For on/off filters\n * use `FilterChip`; for removable values (tags) use `InputChip`.\n *\n * @example\n * <Chip startIcon=\"event\" onClick={addToCalendar}>Add to calendar</Chip>\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\n/**\n * A chip that toggles on and off, showing a checkmark while on. State:\n * `pressed` / `defaultPressed` / `onPressedChange`.\n *\n * @example\n * <FilterChip pressed={vegan} onPressedChange={setVegan}>Vegan</FilterChip>\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\n/**\n * A removable value, like a tag or recipient. Plays an exit animation, then\n * calls `onRemove`: remove it from your list there.\n *\n * @example\n * {tags.map((t) => (\n * <InputChip key={t} removeLabel={`Remove ${t}`} onRemove={() => setTags(tags.filter((x) => x !== t))}>{t}</InputChip>\n * ))}\n */\nexport function InputChip({\n onRemove,\n removeLabel = 'Remove',\n startIcon,\n disabled,\n className,\n ref,\n children,\n ...props\n}: InputChipProps) {\n const local = useRef<HTMLSpanElement>(null)\n const [removing, setRemoving] = useState(false)\n\n // Shrinks and fades out first, and only then asks to be removed\n const remove = () => {\n const el = local.current\n if (!el || removing) return\n setRemoving(true)\n const exit = el.animate(collapse(el), {\n ...tokenTiming(el),\n fill: 'forwards',\n })\n exit.onfinish = () => {\n onRemove()\n // Still here a frame later: the parent kept it, so show it again\n requestAnimationFrame(() => {\n if (!el.isConnected) return\n exit.cancel()\n setRemoving(false)\n })\n }\n }\n\n return (\n <span\n {...props}\n ref={mergeRefs(local, ref)}\n className={cx(\n 'avl-chip avl-input-chip',\n startIcon && 'avl-chip-has-icon',\n className\n )}\n data-disabled={disabled || undefined}\n data-removing={removing || undefined}\n >\n {startIcon && <Icon name={startIcon} />}\n {children}\n <BaseButton\n className=\"avl-input-chip-remove\"\n aria-label={removeLabel}\n disabled={disabled || removing}\n onClick={remove}\n >\n <Icon name=\"close\" />\n </BaseButton>\n </span>\n )\n}\n\n// Keyframes that shrink a chip away. Its width and the gap after it close\n// up too, so the chips after it slide over instead of jumping.\nfunction collapse(el: HTMLElement): Keyframe[] {\n const parent = el.parentElement\n const gap = parent ? parseFloat(getComputedStyle(parent).columnGap) || 0 : 0\n return [\n { width: `${el.offsetWidth}px`, opacity: 1, scale: 1 },\n {\n width: '0px',\n paddingInline: '0px',\n borderInlineWidth: '0px',\n marginInlineEnd: `${-gap}px`,\n opacity: 0,\n scale: 0.6,\n },\n ]\n}\n\n// The theme's normal duration and smooth ease, so reduced motion (which\n// zeroes the durations) removes the chip straight away\nfunction tokenTiming(el: HTMLElement) {\n const style = getComputedStyle(el)\n const length = style.getPropertyValue('--avl-ease-length-normal').trim()\n const duration = length.endsWith('ms')\n ? parseFloat(length)\n : parseFloat(length) * 1000\n return {\n duration: Number.isFinite(duration) ? duration : 300,\n easing: style.getPropertyValue('--avl-ease-smooth').trim() || 'ease',\n }\n}\n","import { Checkbox as BaseCheckbox } from '@base-ui/react/checkbox'\nimport { withClass } from '../../utils'\nimport { checkProp } from '../../dev'\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\n/**\n * A checkbox. State: `checked` / `defaultChecked` / `onCheckedChange`, plus\n * `indeterminate`. It has no `label` prop: wrap it in a `<label>` with the text.\n *\n * @example\n * <label style={{ display: 'flex', gap: 8, alignItems: 'center' }}>\n * <Checkbox checked={agreed} onCheckedChange={setAgreed} />\n * I agree to the terms\n * </label>\n */\nexport function Checkbox({ className, ...props }: CheckboxProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkProp(\n props,\n 'label',\n 'Checkbox',\n 'Wrap it in a <label> with the text instead.',\n '<label>\\n <Checkbox name=\"terms\" />\\n I agree to the terms\\n</label>',\n 'checkbox.md'\n )\n }\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 { checkAsChild, checkRoot } from '../../dev'\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\n/**\n * A modal dialog. Holds the open state: `open` / `defaultOpen` /\n * `onOpenChange`. Parts: `DialogTrigger`, `DialogPopup` (already includes the\n * portal and backdrop; there is no DialogContent or DialogOverlay),\n * `DialogTitle`, `DialogDescription`, `DialogActions` (the footer row) and\n * `DialogClose`.\n *\n * @example\n * <Dialog>\n * <DialogTrigger render={<Button />}>Delete</DialogTrigger>\n * <DialogPopup>\n * <DialogTitle>Delete file?</DialogTitle>\n * <DialogDescription>This can't be undone.</DialogDescription>\n * <DialogActions>\n * <DialogClose render={<Button fillType=\"text\" />}>Cancel</DialogClose>\n * <Button color=\"error\" onClick={remove}>Delete</Button>\n * </DialogActions>\n * </DialogPopup>\n * </Dialog>\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\nexport type DialogTriggerProps = BaseDialog.Trigger.Props\n\n/**\n * Opens the dialog. Renders a bare, unstyled `<button>`: pass\n * `render={<Button />}` to use the library's button (not `asChild`).\n */\nexport function DialogTrigger({\n className,\n ref,\n ...props\n}: DialogTriggerProps) {\n const morph = useContext(MorphContext)\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(props, 'DialogTrigger', 'dialog.md')\n }\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\nexport type DialogPopupProps = BaseDialog.Popup.Props\n\n/** The dialog box. Also renders the portal and the dimmed backdrop behind it. */\nexport function DialogPopup({ className, ref, ...props }: DialogPopupProps) {\n const avl = useContext(AnvilContext)\n const morph = useContext(MorphContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'DialogPopup')\n }\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\nexport type DialogTitleProps = BaseDialog.Title.Props\n\n/** Names the dialog for screen readers. Renders an `<h2>`. */\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\n/** Supporting text under the title; screen readers read it as the description. */\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\nexport type DialogActionsProps = ComponentProps<'div'>\n\n/** The row of buttons at the bottom, aligned to the end (the \"footer\"). */\nexport function DialogActions({ className, ...props }: DialogActionsProps) {\n return <div {...props} className={cx('avl-dialog-actions', className)} />\n}\n\nexport type DialogCloseProps = BaseDialog.Close.Props\n\n/**\n * Closes the dialog. Renders a bare `<button>`; pass `render={<Button />}`\n * to use the library's.\n */\nexport function DialogClose({ className, ...props }: DialogCloseProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(props, 'DialogClose', 'dialog.md')\n }\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 { useCallback, useContext } from 'react'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport type { ComponentColor } from '../../colors/colors'\nimport { checkRoot } from '../../dev'\nimport './confetti.css'\n\nexport type ConfettiOptions = {\n /** How many pieces to throw. @default 80 */\n count?: number\n /** Direction of the burst in degrees, 0 is straight up. @default 0 */\n angle?: number\n /** How wide the burst fans out, in degrees. @default 70 */\n spread?: number\n /** How hard the pieces are thrown. @default 1 */\n power?: number\n /** Theme color roles the pieces are picked from. @default ['primary', 'tonal', 'success', 'warning', 'error'] */\n colors?: ComponentColor[]\n}\n\n/** Where the burst starts: an element's center, or a point in the viewport. */\nexport type ConfettiOrigin = Element | { x: number; y: number }\n\nconst defaultColors: ComponentColor[] = [\n 'primary',\n 'tonal',\n 'success',\n 'warning',\n 'error',\n]\nconst shapes = ['rect', 'circle', 'strip'] as const\n\n// Pieces fall against air drag, so they slow to a flutter instead of\n// dropping like stones. Units are px and seconds.\nconst gravity = 900\nconst drag = 2.6\n\nconst random = (min: number, max: number) => min + Math.random() * (max - min)\n\n/**\n * Returns a function that fires a burst of confetti in the theme's colors.\n * Pass the element that triggered it (a button, say) to burst from there.\n * The pieces are decorative: hidden from screen readers, they don't catch\n * the pointer, and nothing fires when the user prefers reduced motion.\n *\n * ```tsx\n * const fire = useConfetti()\n * <Button onClick={(e) => fire(e.currentTarget)}>Celebrate</Button>\n * ```\n */\nexport function useConfetti() {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(\n avl !== null,\n 'useConfetti',\n 'It draws into the AnvilRoot element, so without one nothing fires.'\n )\n }\n\n return useCallback(\n (origin?: ConfettiOrigin, options: ConfettiOptions = {}) => {\n const root = avl?.rootRef.current\n if (!root) return\n if (window.matchMedia('(prefers-reduced-motion: reduce)').matches)\n return\n\n const {\n count = 80,\n angle = 0,\n spread = 70,\n power = 1,\n colors = defaultColors,\n } = options\n const { x, y } = originPoint(origin)\n\n const layer = document.createElement('div')\n layer.className = 'avl-confetti'\n layer.setAttribute('aria-hidden', 'true')\n root.append(layer)\n\n const animations = Array.from({ length: count }, (_, i) => {\n const piece = document.createElement('span')\n piece.className = 'avl-confetti-piece'\n piece.dataset.shape = shapes[i % shapes.length]\n const color = colors[Math.floor(Math.random() * colors.length)]\n piece.style.backgroundColor = `var(--avl-color-${color})`\n piece.style.left = `${x}px`\n piece.style.top = `${y}px`\n layer.append(piece)\n\n const direction =\n ((angle + random(-spread, spread) / 2) * Math.PI) / 180\n const speed = random(700, 1800) * power\n return piece.animate(\n flight(\n Math.sin(direction) * speed,\n -Math.cos(direction) * speed\n ),\n { duration: random(1800, 2800), fill: 'forwards' }\n )\n })\n\n Promise.all(animations.map((a) => a.finished))\n .catch(() => {})\n .finally(() => layer.remove())\n },\n [avl]\n )\n}\n\nfunction originPoint(origin?: ConfettiOrigin) {\n if (!origin)\n return { x: window.innerWidth / 2, y: window.innerHeight * 0.6 }\n if (!(origin instanceof Element)) return origin\n const rect = origin.getBoundingClientRect()\n return { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 }\n}\n\n// Keyframes for one piece. Position comes from projectile motion with\n// linear drag; the sideways sway and the 3D tumble make it look like paper.\nfunction flight(vx: number, vy: number): Keyframe[] {\n const seconds = 2.5\n const steps = 30\n const spin = random(-720, 720)\n const tumble = random(360, 1080)\n const sway = random(10, 30)\n const swayRate = random(4, 8)\n const frames: Keyframe[] = []\n\n for (let i = 0; i <= steps; i++) {\n const progress = i / steps\n const t = progress * seconds\n const slowdown = (1 - Math.exp(-drag * t)) / drag\n const px =\n vx * slowdown + Math.sin(t * swayRate) * sway * Math.min(t, 1)\n const py = (vy - gravity / drag) * slowdown + (gravity / drag) * t\n frames.push({\n offset: progress,\n transform: `translate(${px}px, ${py}px) rotate(${spin * progress}deg) rotateX(${tumble * progress}deg)`,\n opacity: progress < 0.75 ? 1 : 1 - (progress - 0.75) / 0.25,\n })\n }\n return frames\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\n/**\n * A thin line between groups of content. Renders a separator `<div>`.\n *\n * @example\n * <Divider />\n * <Divider label=\"or\" />\n * <div style={{ display: 'flex' }}>A<Divider orientation=\"vertical\" />B</div>\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, useState } 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 /** 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 * Ease into a straight line as thick as `--avl-wave-flat-stroke`, ready\n * to be swapped for the plain track. Needs `still` off. @default false\n */\n flat?: boolean\n /** Start out flat, to ease into a wave from the plain track. */\n startFlat?: boolean\n /** Called once the wave has gone fully flat. */\n onFlat?: () => void\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_STROKE = 4\nconst WAVE_PERIOD = 1500 // ms for the ripple to travel one wavelength\n\n/** Where and how to draw this frame. `cap` is how far round caps reach. */\ntype Shape = { middle: number; amplitude: number; cap: number }\n\nconst K = (2 * Math.PI) / WAVE_LENGTH\n\n// Height of the wave at x, and its slope there\nconst waveY = (x: number, phase: number, shape: Shape) =>\n // + phase: the ripple travels from the leading end back to the start\n shape.middle + shape.amplitude * Math.sin(K * x + phase)\nconst waveSlope = (x: number, phase: number, shape: Shape) =>\n shape.amplitude * K * Math.cos(K * x + phase)\n\nfunction wavePath(from: number, to: number, phase: number, shape: Shape) {\n // Keep the caps inside the drawn range\n const start = from + shape.cap\n const end = to - shape.cap\n if (end < start) return ''\n\n const y = (x: number) => waveY(x, phase, shape)\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, shape: Shape) {\n const start = from + shape.cap\n const end = to - shape.cap\n return end < start ? '' : `M${start} ${shape.middle}L${end} ${shape.middle}`\n}\n\n/**\n * The theme's `--avl-ease-smooth` as a function, so the wave flattens in\n * step with the CSS transitions that resize the track around it. Falls back\n * to Material's standard curve for anything but cubic-bezier().\n */\nfunction smoothEasing(style: CSSStyleDeclaration) {\n const match = style\n .getPropertyValue('--avl-ease-smooth')\n .match(/cubic-bezier\\(([^)]+)\\)/)\n const parts = match?.[1].split(',').map(Number)\n const [x1, y1, x2, y2] =\n parts?.length === 4 && parts.every((n) => !Number.isNaN(n))\n ? parts\n : [0.2, 0, 0, 1]\n const bezier = (a: number, b: number, t: number) =>\n 3 * a * t * (1 - t) ** 2 + 3 * b * t ** 2 * (1 - t) + t ** 3\n return (x: number) => {\n if (x <= 0 || x >= 1) return x\n // Find t where the curve's x matches, by bisection: x(t) only grows\n let lo = 0\n let hi = 1\n for (let i = 0; i < 20; i++) {\n const mid = (lo + hi) / 2\n if (bezier(x1, x2, mid) < x) lo = mid\n else hi = mid\n }\n return bezier(y1, y2, (lo + hi) / 2)\n }\n}\n\n// A plain number, or a time in ms, from a custom property\nfunction cssNumber(style: CSSStyleDeclaration, name: string, fallback: number) {\n const raw = style.getPropertyValue(name).trim()\n const n = parseFloat(raw)\n if (Number.isNaN(n)) return fallback\n return raw.endsWith('ms') ? n : raw.endsWith('s') ? n * 1000 : n\n}\n\n// A length custom property in px. Measured, not parsed: custom properties\n// keep calc() unresolved, so parsing \"calc(4px * 1.5)\" would fail.\nfunction cssLength(el: Element, name: string, fallback: number) {\n const host = el.parentElement\n if (!host || !getComputedStyle(el).getPropertyValue(name).trim())\n return fallback\n const probe = document.createElement('div')\n probe.style.cssText = `position:absolute;visibility:hidden;width:var(${name})`\n host.append(probe)\n const px = probe.getBoundingClientRect().width\n probe.remove()\n return px\n}\n\n/**\n * One end of a piece, drawn as a shape rather than a round line cap, so its\n * corners can ease from fully round (`radius` = half the thickness) to the\n * plain track's nearly square ones. Sits at (x, y), pointing along the\n * piece's slope, outward (`dir` 1) or backward (`dir` -1).\n */\nfunction capPath(\n x: number,\n y: number,\n slope: number,\n dir: 1 | -1,\n half: number,\n length: number,\n radius: number\n) {\n const norm = Math.hypot(1, slope)\n const tx = dir / norm\n const ty = (dir * slope) / norm\n // A rotation of the page's axes, so the arcs always bend the same way\n const p = (u: number, v: number) =>\n `${x + u * tx - v * ty} ${y + u * ty + v * tx}`\n const r = Math.max(0, Math.min(radius, length, half))\n // Starts slightly inside the piece's body, so no seam shows between them\n return (\n `M${p(-0.5, -half)}L${p(length - r, -half)}` +\n `A${r} ${r} 0 0 1 ${p(length, r - half)}L${p(length, half - r)}` +\n `A${r} ${r} 0 0 1 ${p(length - r, half)}L${p(-0.5, half)}Z`\n )\n}\n\n/**\n * Keeps a squiggly part's wave mounted while it flattens out, so turning\n * `squiggly` off eases into the plain track instead of jumping, and turning\n * it on eases out of it. Spread `wave` onto SquigglyWave, and draw the plain\n * track when `show` is false.\n */\nexport function useWaveMorph(squiggly: boolean) {\n const [previous, setPrevious] = useState(squiggly)\n const [leaving, setLeaving] = useState(false)\n // A wave that's there from the first render just appears\n const [changed, setChanged] = useState(false)\n if (squiggly !== previous) {\n setPrevious(squiggly)\n setLeaving(!squiggly)\n setChanged(true)\n }\n return {\n show: squiggly || leaving,\n wave: {\n flat: !squiggly,\n startFlat: changed,\n onFlat: () => setLeaving(false),\n },\n }\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, to ease toward its new span and\n * to flatten out or back (`flat`); with reduced motion it holds still and\n * 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 waveCapsRef = useRef<SVGPathElement>(null)\n const restCapsRef = useRef<SVGPathElement>(null)\n const span = useRef(props.span)\n span.current = props.span\n const flat = useRef(props.flat ?? false)\n flat.current = props.flat ?? false\n const onFlat = useRef(props.onFlat)\n onFlat.current = props.onFlat\n // Read once, on mount\n const startFlat = useRef(props.startFlat ?? false)\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 waveCaps = waveCapsRef.current\n const restCaps = restCapsRef.current\n if (!svg || !wave || !rest || !waveCaps || !restCaps) return\n\n const reduced =\n still || matchMedia('(prefers-reduced-motion: reduce)').matches\n const style = getComputedStyle(svg)\n const gap = cssLength(svg, '--avl-wave-gap', 0)\n // The plain track that flattening heads toward\n const flatStroke = cssLength(svg, '--avl-wave-flat-stroke', WAVE_STROKE)\n // The plain track's inside corners, where a piece stops short of a\n // handle. Unset means round, which plain line caps already draw.\n const flatRadius = cssLength(svg, '--avl-wave-flat-radius', -1)\n const flatRestRadius = cssLength(svg, '--avl-wave-flat-rest-radius', -1)\n const shapedCaps = flatRadius >= 0 || flatRestRadius >= 0\n const linecap = shapedCaps ? 'butt' : ''\n wave.style.strokeLinecap = linecap\n rest.style.strokeLinecap = linecap\n const duration = cssNumber(style, '--avl-ease-length-slow', 300)\n const ease = smoothEasing(style)\n\n let current: { from: number; to: number } | null = null\n let frame = 0\n // 0 is a full wave, 1 a straight line\n let flatness = startFlat.current ? 1 : 0\n let notified = false\n let last: number | null = null\n\n const draw = (now: number) => {\n const target = flat.current ? 1 : 0\n const step =\n reduced || last === null || duration <= 0\n ? 1\n : (now - last) / duration\n // The first frame only sets the clock, so the morph starts at 0\n if (last === null && !reduced) {\n last = now\n } else {\n last = now\n flatness =\n target > flatness\n ? Math.min(target, flatness + step)\n : Math.max(target, flatness - step)\n }\n if (flatness < 1) notified = false\n // Eased from wherever this direction started, like the CSS\n // transitions that resize the track\n const eased = target === 1 ? ease(flatness) : 1 - ease(1 - flatness)\n const stroke = WAVE_STROKE + (flatStroke - WAVE_STROKE) * eased\n svg.style.setProperty('--avl-wave-stroke', `${stroke}px`)\n\n // The wave math is all horizontal; vertical swaps the axes below\n const width = vertical ? svg.clientHeight : svg.clientWidth\n const shape: Shape = {\n middle: (vertical ? svg.clientWidth : svg.clientHeight) / 2,\n amplitude: WAVE_AMPLITUDE * (1 - eased),\n cap: stroke / 2,\n }\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 / WAVE_PERIOD) * 2 * Math.PI\n\n wave.setAttribute(\n 'd',\n wavePath(current.from, current.to, phase, shape)\n )\n rest.setAttribute(\n 'd',\n (next.rest ?? [])\n .map(([a, b]) =>\n next.restWave\n ? wavePath(a, b, phase, shape)\n : linePath(a, b, shape)\n )\n .join('')\n )\n if (shapedCaps) {\n const half = stroke / 2\n // Both ends of a piece. Ends at the track's own ends stay\n // round; inside ends ease toward `insideRadius`.\n const caps = (\n a: number,\n b: number,\n wavy: boolean,\n insideRadius: number\n ) => {\n if (b - a <= 0) return ''\n const length = Math.min(half, (b - a) / 2)\n const radius = (inside: boolean) =>\n inside && insideRadius >= 0\n ? half + (insideRadius - half) * eased\n : half\n const at = (x: number) =>\n wavy\n ? [\n waveY(x, phase, shape),\n waveSlope(x, phase, shape),\n ]\n : [shape.middle, 0]\n const [y0, s0] = at(a + length)\n const [y1, s1] = at(b - length)\n return (\n capPath(\n a + length,\n y0,\n s0,\n -1,\n half,\n length,\n radius(a > 0.5)\n ) +\n capPath(\n b - length,\n y1,\n s1,\n 1,\n half,\n length,\n radius(b < width - 0.5)\n )\n )\n }\n waveCaps.setAttribute(\n 'd',\n caps(current.from, current.to, true, flatRadius)\n )\n restCaps.setAttribute(\n 'd',\n (next.rest ?? [])\n .map(([a, b]) =>\n caps(a, b, next.restWave ?? false, flatRestRadius)\n )\n .join('')\n )\n }\n\n if (flatness === 1 && target === 1 && !notified) {\n notified = true\n onFlat.current?.()\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\n ref={restCapsRef}\n className=\"avl-squiggly-wave-cap avl-squiggly-wave-rest\"\n />\n <path ref={waveRef} />\n <path ref={waveCapsRef} className=\"avl-squiggly-wave-cap\" />\n </g>\n </svg>\n )\n}\n","import { useRef } 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 { useMagnet } from './magnet'\nimport { cx, mergeRefs, withClass } from '../../utils'\nimport { checkName } from '../../dev'\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 *\n * @example\n * <FAB icon=\"edit\" aria-label=\"Compose\" style={{ position: 'fixed', insetInlineEnd: 16, bottom: 16 }} />\n * <FAB icon=\"edit\" label=\"Compose\" />\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 if (process.env.NODE_ENV !== 'production' && !label) {\n checkName(\n props,\n 'FAB',\n '<FAB icon=\"add\" aria-label=\"Create\" /> // or <FAB icon=\"add\" label=\"Create\" />',\n 'fab.md'\n )\n }\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","import { useEffect, type RefObject } from 'react'\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`.\nexport function useMagnet(\n ref: RefObject<HTMLElement | null>,\n enabled: boolean\n) {\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 { createContext, useContext, useRef, useState } 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 { useMagnet } from '../FAB/magnet'\nimport {\n colorClass,\n type ComponentColor,\n type ComponentFillType,\n} from '../../colors/colors'\nimport { cx, withClass } from '../../utils'\nimport { checkRoot } from '../../dev'\nimport '../FAB/fab.css'\nimport './fab-menu.css'\n\n// The FAB's color, so the items can take its softer container shade\nconst FABMenuColorContext = createContext<ComponentColor>('primary')\n\nexport type FABMenuProps = Omit<\n BaseMenu.Root.Props,\n 'children' | 'orientation'\n> & {\n /** Material Symbol on the closed FAB. */\n icon: MaterialSymbol\n /** Material Symbol on the open FAB. @default 'close' */\n closeIcon?: MaterialSymbol\n /** Screen reader name for the FAB, which has no visible text. */\n 'aria-label': string\n /**\n * Theme color role for the FAB. Its items use the same role's container\n * shade (`primary-container` for `primary`). @default 'primary'\n */\n color?: ComponentColor\n /** How the FAB's color is applied. @default 'filled' */\n fillType?: ComponentFillType\n /** Which side of the FAB the items open on. @default 'top' */\n side?: BaseMenu.Positioner.Props['side']\n /** How the items line up with the FAB. @default 'end' */\n align?: BaseMenu.Positioner.Props['align']\n /** Stick to a mouse cursor that comes close, while closed. @default true */\n sticky?: boolean\n /** Extra classes for the FAB itself. */\n className?: string\n /** `FABMenuItem`s, listed top to bottom. */\n children: React.ReactNode\n}\n\n/**\n * A FAB that splits into a stack of labeled actions. The FAB turns into\n * a close button while open. Place it yourself, like a FAB, usually\n * `position: fixed` in the bottom-end corner.\n *\n * @example\n * <FABMenu icon=\"add\" aria-label=\"Create\">\n * <FABMenuItem icon=\"description\" onClick={newDoc}>Document</FABMenuItem>\n * <FABMenuItem icon=\"folder\" onClick={newFolder}>Folder</FABMenuItem>\n * </FABMenu>\n */\nexport function FABMenu({\n icon,\n closeIcon = 'close',\n 'aria-label': ariaLabel,\n color = 'primary',\n fillType,\n side = 'top',\n align = 'end',\n sticky = true,\n className,\n children,\n ...props\n}: FABMenuProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'FABMenu')\n }\n // Mirrors the open state, controlled or not, to turn the magnet off\n // while open: a FAB sliding around would drag the items along with it\n const [localOpen, setLocalOpen] = useState(props.defaultOpen ?? false)\n const open = props.open ?? localOpen\n const trigger = useRef<HTMLButtonElement>(null)\n useMagnet(trigger, sticky && !open && !props.disabled)\n\n return (\n <FABMenuColorContext value={color}>\n <BaseMenu.Root\n {...props}\n onOpenChange={(next, details) => {\n setLocalOpen(next)\n props.onOpenChange?.(next, details)\n }}\n >\n <BaseMenu.Trigger\n ref={trigger}\n aria-label={ariaLabel}\n className={cx(\n 'avl-fab avl-fab-size-normal avl-fab-menu-trigger',\n colorClass(color, fillType),\n className\n )}\n >\n <Icon name={icon} className=\"avl-fab-menu-icon-open\" />\n <Icon\n name={closeIcon}\n className=\"avl-fab-menu-icon-close\"\n />\n </BaseMenu.Trigger>\n {/* Into the AnvilRoot, not `body`, so it sees the theme */}\n <BaseMenu.Portal container={avl?.rootRef}>\n <BaseMenu.Positioner\n className=\"avl-menu-positioner\"\n side={side}\n align={align}\n sideOffset={8}\n >\n <BaseMenu.Popup className=\"avl-fab-menu-popup\">\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n </BaseMenu.Root>\n </FABMenuColorContext>\n )\n}\n\nexport type FABMenuItemProps = Omit<BaseMenu.Item.Props, 'children'> & {\n /** Material Symbol before the label. */\n icon: MaterialSymbol\n /** The visible label. */\n children: React.ReactNode\n /**\n * Theme color role, shown in its softer container shade.\n * @default the FABMenu's color\n */\n color?: ComponentColor\n}\n\n/** One labeled action in a `FABMenu`. Use `onClick` to act on it. */\nexport function FABMenuItem({\n icon,\n color,\n className,\n children,\n ...props\n}: FABMenuItemProps) {\n const menuColor = useContext(FABMenuColorContext)\n\n return (\n <BaseMenu.Item\n {...props}\n // fab-menu.css maps this to the role's container shade\n data-color={color ?? menuColor}\n className={withClass('avl-fab-menu-item', className)}\n >\n <Icon name={icon} />\n {children}\n </BaseMenu.Item>\n )\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\n/**\n * Wraps one control to add helper text, an error message and validation.\n * The control keeps its own `label`; there is no FieldLabel.\n *\n * @example\n * <Field name=\"email\" validationMode=\"onBlur\">\n * <Input label=\"Email\" type=\"email\" required />\n * <FieldDescription>We never share it.</FieldDescription>\n * <FieldError />\n * </Field>\n */\nexport function Field({ className, ...props }: FieldProps) {\n return (\n <BaseField.Root\n {...props}\n className={withClass('avl-field', className)}\n />\n )\n}\n\nexport type FieldDescriptionProps = BaseField.Description.Props\n\n/** Helper text under the control. Hidden while a FieldError is showing. */\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\nexport type FieldErrorProps = BaseField.Error.Props\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.\n *\n * @example\n * <FieldError match=\"valueMissing\">Enter your email.</FieldError>\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 type { CSSProperties, ReactNode } from 'react'\nimport { Input as BaseInput } from '@base-ui/react/input'\nimport { cx } from '../../utils'\nimport { useContext } from 'react'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { checkRoot, OUTSIDE_ROOT } from '../../dev'\nimport './input.css'\n\nexport type InputProps = Omit<\n BaseInput.Props,\n 'className' | 'style' | 'size'\n> & {\n /** Applied to the outer wrapper, with `className`. */\n style?: CSSProperties\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\n/**\n * A text field with a floating label. `value` / `defaultValue` with either\n * `onChange` (event) or `onValueChange` (string). `className` goes on the\n * wrapper; `ref` and other props go on the `<input>`. Wrap it in a `Field`\n * for helper text and validation.\n *\n * @example\n * <Input label=\"Email\" type=\"email\" value={email} onValueChange={setEmail} />\n */\nexport function Input({\n label,\n size = 'normal',\n className,\n style,\n placeholder,\n ...props\n}: InputProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'Input', OUTSIDE_ROOT)\n }\n return (\n <label\n style={style}\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 { useEffect, useState, type ComponentProps, type ReactNode } from 'react'\nimport { cx } from '../../utils'\nimport './kbd.css'\n\nexport type KbdProps = ComponentProps<'kbd'> & {\n /** Press down while the user holds the key. @default true */\n listen?: boolean\n /**\n * The key that presses this one down, as a `KeyboardEvent.key` value\n * like `'k'`, `'Meta'` or `'Enter'`.\n * @default worked out from the text: 'K', '⌘', 'Ctrl', 'Esc', '↵', ...\n */\n listenFor?: string\n}\n\n/**\n * A keyboard key, for shortcuts like ⌘ K. It presses down while the user\n * holds that key on their own keyboard. Put one per key, with a `+` or a\n * space between them for combinations.\n *\n * @example\n * <Kbd>⌘</Kbd> + <Kbd>K</Kbd>\n */\nexport function Kbd({\n listen = true,\n listenFor,\n className,\n children,\n ...props\n}: KbdProps) {\n const key = listen ? (listenFor ?? keyFromText(children)) : null\n const pressed = useKeyHeld(key)\n\n return (\n <kbd\n {...props}\n data-pressed={pressed || undefined}\n className={cx('avl-kbd', className)}\n >\n {children}\n </kbd>\n )\n}\n\n// Symbols and names people write on keys, mapped to KeyboardEvent.key\nconst aliases: Record<string, string> = {\n '⌘': 'meta',\n cmd: 'meta',\n command: 'meta',\n win: 'meta',\n '⌥': 'alt',\n opt: 'alt',\n option: 'alt',\n '⇧': 'shift',\n '⌃': 'control',\n ctrl: 'control',\n '↵': 'enter',\n '⏎': 'enter',\n return: 'enter',\n '⎋': 'escape',\n esc: 'escape',\n '⌫': 'backspace',\n del: 'delete',\n '⇥': 'tab',\n space: ' ',\n '␣': ' ',\n '←': 'arrowleft',\n '→': 'arrowright',\n '↑': 'arrowup',\n '↓': 'arrowdown',\n}\n\nfunction keyFromText(children: ReactNode) {\n if (typeof children !== 'string' && typeof children !== 'number')\n return null\n const text = String(children).trim().toLowerCase()\n return aliases[text] ?? (text || null)\n}\n\n// True while `key` is held down anywhere on the page\nfunction useKeyHeld(key: string | null) {\n const [held, setHeld] = useState(false)\n\n useEffect(() => {\n if (!key) return\n const target = key.toLowerCase()\n const matches = (event: KeyboardEvent) =>\n event.key.toLowerCase() === target\n const down = (event: KeyboardEvent) => {\n if (matches(event)) setHeld(true)\n }\n const up = (event: KeyboardEvent) => {\n // macOS sends no keyup for other keys while ⌘ is held, so\n // letting go of ⌘ releases everything\n if (matches(event) || event.key === 'Meta') setHeld(false)\n }\n // Switching windows mid-press never sends the keyup\n const release = () => setHeld(false)\n\n document.addEventListener('keydown', down)\n document.addEventListener('keyup', up)\n window.addEventListener('blur', release)\n return () => {\n document.removeEventListener('keydown', down)\n document.removeEventListener('keyup', up)\n window.removeEventListener('blur', release)\n setHeld(false)\n }\n }, [key])\n\n return held\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/**\n * A column of `ListItem`s. Renders a `<ul>`.\n *\n * @example\n * <List divided>\n * <ListItem label=\"Wi-Fi\" description=\"Connected\" start={<Icon name=\"wifi\" />} end={<Switch defaultChecked />} render={<label />} />\n * <ListItem label=\"Account\" end={<Icon name=\"chevron_right\" />} render={<a href=\"/account\" />} />\n * </List>\n */\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\n/** One row: `label`, optional `description`, and `start` / `end` slots. Takes no children. */\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 { checkAsChild, checkRoot } from '../../dev'\nimport './menu.css'\n\nexport type MenuProps = BaseMenu.Root.Props\n\n/**\n * A dropdown menu of actions. Holds the open state (`open` / `defaultOpen` /\n * `onOpenChange`). Parts: `MenuTrigger`, `MenuPopup` (includes portal and\n * positioner), `MenuItem`, `MenuGroup` (there is no MenuSeparator: groups\n * are split visually), `MenuSubmenu` + `MenuSubmenuTrigger`.\n *\n * @example\n * <Menu>\n * <MenuTrigger render={<IconButton icon=\"more_vert\" aria-label=\"More\" fillType=\"text\" color=\"container\" />} />\n * <MenuPopup align=\"end\">\n * <MenuItem startIcon=\"edit\" onClick={rename}>Rename</MenuItem>\n * <MenuItem startIcon=\"delete\" onClick={remove}>Delete</MenuItem>\n * </MenuPopup>\n * </Menu>\n */\nexport function Menu(props: MenuProps) {\n return <BaseMenu.Root {...props} />\n}\n\nexport type MenuTriggerProps = BaseMenu.Trigger.Props\n\n/** Opens the menu. Renders a bare `<button>`; pass `render={<Button />}` to use the library's. */\nexport function MenuTrigger({ className, ...props }: MenuTriggerProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(props, 'MenuTrigger', 'menu.md')\n }\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/** The menu panel. 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\n/** The menu panel, holding the items. Takes `side`, `align`, `sideOffset`, `alignOffset`. */\nexport function MenuPopup({\n side,\n align,\n sideOffset,\n alignOffset,\n className,\n ...props\n}: MenuPopupProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'MenuPopup')\n }\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\nexport type MenuSubmenuProps = BaseMenu.SubmenuRoot.Props\n\n/**\n * A menu nested in another one: put a `MenuSubmenuTrigger` and a\n * `MenuPopup` in it, and place the whole thing among the parent's items.\n */\nexport function MenuSubmenu(props: MenuSubmenuProps) {\n return (\n <SubmenuContext value={true}>\n <BaseMenu.SubmenuRoot {...props} />\n </SubmenuContext>\n )\n}\n\nexport type MenuSubmenuTriggerProps = BaseMenu.SubmenuTrigger.Props & {\n /** Material Symbol before the label. */\n startIcon?: MaterialSymbol\n}\n\n/** Looks like a `MenuItem`, with an arrow at the end. Opens its submenu on hover or click. */\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\nexport type MenuGroupProps = BaseMenu.Group.Props\n\n/**\n * Splits the menu: each group is its own container, with a gap between\n * them. Use it where other libraries use a separator. Items placed straight\n * in the popup, outside any group, share a single container.\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 /** Material Symbol before the label. */\n startIcon?: MaterialSymbol\n /** Material Symbol after the label. */\n endIcon?: MaterialSymbol\n}\n\n/** One action. Use `onClick` (there is no onSelect); the menu closes after it. */\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 { Menubar as BaseMenubar } from '@base-ui/react/menubar'\nimport { withClass } from '../../utils'\nimport './menubar.css'\n\nexport type MenubarProps = BaseMenubar.Props\n\n/**\n * A row of menus, like File / Edit / View in a desktop app. Put a `Menu` per\n * entry inside, each with a `MenuTrigger` and a `MenuPopup`. Arrow keys move\n * between menus, and once one is open, hovering another opens it instead.\n *\n * @example\n * <Menubar>\n * <Menu>\n * <MenuTrigger>File</MenuTrigger>\n * <MenuPopup><MenuItem onClick={save}>Save</MenuItem></MenuPopup>\n * </Menu>\n * </Menubar>\n */\nexport function Menubar({ className, ...props }: MenubarProps) {\n return (\n <BaseMenubar\n {...props}\n className={withClass('avl-menubar', className)}\n />\n )\n}\n","import { Accordion as BaseAccordion } from '@base-ui/react/accordion'\nimport { Icon } from '../Icon/Icon'\nimport { withClass } from '../../utils'\nimport './accordion.css'\n\n/**\n * A stack of sections that each expand to show their content. Fill it with\n * `AccordionItem`s. Holds which are open (`value` / `defaultValue` /\n * `onValueChange`); pass `multiple` to allow more than one at a time.\n */\nexport type AccordionProps = BaseAccordion.Root.Props\n\n/**\n * A stack of expandable sections. `value` is an array of open item values\n * (even when only one can be open). Pass `multiple` to allow several.\n *\n * @example\n * <Accordion defaultValue={['shipping']}>\n * <AccordionItem value=\"shipping\">\n * <AccordionTrigger>Shipping</AccordionTrigger>\n * <AccordionPanel>Ships in 2 days.</AccordionPanel>\n * </AccordionItem>\n * </Accordion>\n */\nexport function Accordion({ className, ...props }: AccordionProps) {\n return (\n <BaseAccordion.Root\n {...props}\n className={withClass('avl-accordion', className)}\n />\n )\n}\n\nexport type AccordionItemProps = BaseAccordion.Item.Props\n\n/**\n * One section: an `AccordionTrigger`, then an `AccordionPanel`. Give it a\n * `value` to control it from the Accordion.\n */\nexport function AccordionItem({ className, ...props }: AccordionItemProps) {\n return (\n <BaseAccordion.Item\n {...props}\n className={withClass('avl-accordion-item', className)}\n />\n )\n}\n\nexport type AccordionTriggerProps = BaseAccordion.Trigger.Props & {\n /** The heading level that wraps the button, to fit the page's outline. @default 'h3' */\n as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n}\n\n/** The section's title row. Renders a button inside an `<h3>` (change with `as`). */\nexport function AccordionTrigger({\n as: Heading = 'h3',\n className,\n children,\n ...props\n}: AccordionTriggerProps) {\n return (\n <BaseAccordion.Header\n className=\"avl-accordion-header\"\n render={<Heading />}\n >\n <BaseAccordion.Trigger\n {...props}\n className={withClass('avl-accordion-trigger', className)}\n >\n <span className=\"avl-accordion-trigger-label\">{children}</span>\n <Icon name=\"keyboard_arrow_down\" />\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n )\n}\n\nexport type AccordionPanelProps = BaseAccordion.Panel.Props\n\n/** The section's content, shown while it's open. */\nexport function AccordionPanel({\n className,\n children,\n ...props\n}: AccordionPanelProps) {\n return (\n <BaseAccordion.Panel\n {...props}\n className={withClass('avl-accordion-panel', className)}\n >\n {/* Padding lives inside, so the panel can shrink to 0 height */}\n <div className=\"avl-accordion-panel-content\">{children}</div>\n </BaseAccordion.Panel>\n )\n}\n","import { ContextMenu as BaseContextMenu } from '@base-ui/react/context-menu'\nimport { withClass } from '../../utils'\nimport { checkAsChild } from '../../dev'\n\n/**\n * A menu that opens at the pointer on right-click (or long-press on touch).\n * Put a `ContextMenuTrigger` around the area, then a `MenuPopup` with\n * `MenuItem`s, `MenuGroup`s and `MenuSubmenu`s, the same parts as `Menu`.\n * Holds the open state (`open` / `defaultOpen` / `onOpenChange`).\n */\nexport type ContextMenuProps = BaseContextMenu.Root.Props\n\n/**\n * A menu that opens at the pointer on right-click or long-press. Uses\n * `Menu`'s `MenuPopup` and `MenuItem` for its content.\n *\n * @example\n * <ContextMenu>\n * <ContextMenuTrigger>Right-click here</ContextMenuTrigger>\n * <MenuPopup>\n * <MenuItem onClick={copy}>Copy</MenuItem>\n * </MenuPopup>\n * </ContextMenu>\n */\nexport function ContextMenu(props: ContextMenuProps) {\n return <BaseContextMenu.Root {...props} />\n}\n\nexport type ContextMenuTriggerProps = BaseContextMenu.Trigger.Props\n\n/** The area that opens the menu. Renders a `<div>`, or pass `render`. */\nexport function ContextMenuTrigger({\n className,\n ...props\n}: ContextMenuTriggerProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(\n props,\n 'ContextMenuTrigger',\n 'context-menu.md',\n '<ContextMenuTrigger render={<Card />}>...</ContextMenuTrigger>'\n )\n }\n return (\n <BaseContextMenu.Trigger\n {...props}\n className={withClass('avl-context-menu-trigger', className)}\n />\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 { checkAsChild, checkRoot } from '../../dev'\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\n/**\n * A floating panel anchored to its trigger, for content users interact with\n * (forms, details). Holds the open state: `open` / `defaultOpen` /\n * `onOpenChange`. Parts: `PopoverTrigger`, `PopoverPopup` (includes portal\n * and positioner; takes `side` / `align`), `PopoverTitle`,\n * `PopoverDescription`, `PopoverClose`.\n *\n * @example\n * <Popover>\n * <PopoverTrigger render={<IconButton icon=\"info\" aria-label=\"Details\" />} />\n * <PopoverPopup side=\"bottom\" align=\"start\">\n * <PopoverTitle>Details</PopoverTitle>\n * <PopoverDescription>Last edited today.</PopoverDescription>\n * </PopoverPopup>\n * </Popover>\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\nexport type PopoverTriggerProps = BasePopover.Trigger.Props\n\n/** Opens the popover. Renders a bare `<button>`; pass `render={<Button />}` to use the library's. */\nexport function PopoverTrigger({\n className,\n ref,\n ...props\n}: PopoverTriggerProps) {\n const morph = useContext(MorphContext)\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(props, 'PopoverTrigger', 'popover.md')\n }\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/** The panel. 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' | 'anchor'\n >\n\n/** The panel. Takes `side`, `align`, `sideOffset`, `alignOffset` and `anchor`. */\nexport function PopoverPopup({\n anchor,\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 if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'PopoverPopup')\n }\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 anchor={anchor}\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\nexport type PopoverTitleProps = BasePopover.Title.Props\n\n/**\n * Names the popup for screen readers. Renders an `<h2>`; pass\n * `render={<h3 />}` (or another level) to fit the page's headings.\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\n/** Supporting text in the popover. */\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\nexport type PopoverCloseProps = BasePopover.Close.Props\n\n/**\n * Closes the popover. Renders a bare `<button>`; pass `render={<Button />}`\n * or `render={<IconButton ... />}` to use the library's.\n */\nexport function PopoverClose({ className, ...props }: PopoverCloseProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(props, 'PopoverClose', 'popover.md')\n }\n return (\n <BasePopover.Close\n {...props}\n className={withClass('avl-popover-close', className)}\n />\n )\n}\n","import { useContext } from 'react'\nimport { PreviewCard as BasePreviewCard } from '@base-ui/react/preview-card'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { withClass } from '../../utils'\nimport { checkAsChild, checkRoot } from '../../dev'\nimport '../Menu/menu.css'\nimport '../Popover/popover.css'\nimport './preview-card.css'\n\n/**\n * A card that appears while hovering or focusing a link, showing a preview of\n * where it goes. Put a `PreviewCardTrigger` and a `PreviewCardPopup` inside.\n * Hover-only, so the popup must not hold anything a user needs to reach;\n * use `Popover` for that.\n */\nexport type PreviewCardProps = BasePreviewCard.Root.Props\n\n/**\n * A card shown while hovering or focusing a link. Use `Popover` if the\n * content has anything to click.\n *\n * @example\n * <PreviewCard>\n * <PreviewCardTrigger href=\"/users/ada\">@ada</PreviewCardTrigger>\n * <PreviewCardPopup>Ada Lovelace, 12 posts</PreviewCardPopup>\n * </PreviewCard>\n */\nexport function PreviewCard(props: PreviewCardProps) {\n return <BasePreviewCard.Root {...props} />\n}\n\nexport type PreviewCardTriggerProps = BasePreviewCard.Trigger.Props\n\n/**\n * The link. Renders an `<a>`, so give it `href`; pass `render={<Link />}`\n * for a router link. `delay` / `closeDelay` set the hover timing.\n */\nexport function PreviewCardTrigger({\n className,\n ...props\n}: PreviewCardTriggerProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(\n props,\n 'PreviewCardTrigger',\n 'preview-card.md',\n '<PreviewCardTrigger render={<Link to=\"/users/ada\" />}>@ada</PreviewCardTrigger>'\n )\n }\n return (\n <BasePreviewCard.Trigger\n {...props}\n className={withClass('avl-preview-card-trigger', className)}\n />\n )\n}\n\n// Also renders the portal and positioner, so it takes their placement props.\nexport type PreviewCardPopupProps = BasePreviewCard.Popup.Props &\n Pick<\n BasePreviewCard.Positioner.Props,\n 'side' | 'align' | 'sideOffset' | 'alignOffset'\n >\n\n/** The card. Also renders the portal and positioner; takes `side` / `align`. */\nexport function PreviewCardPopup({\n side,\n align,\n sideOffset,\n alignOffset,\n className,\n ...props\n}: PreviewCardPopupProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'PreviewCardPopup')\n }\n\n return (\n // Into the AnvilRoot, not body, so the popup sees the theme variables\n <BasePreviewCard.Portal container={avl?.rootRef}>\n <BasePreviewCard.Positioner\n className=\"avl-menu-positioner\"\n side={side}\n align={align}\n sideOffset={sideOffset ?? 8}\n alignOffset={alignOffset}\n >\n {/* Popover's surface, padding and open/close animation */}\n <BasePreviewCard.Popup\n {...props}\n className={withClass(\n 'avl-menu-popup avl-popover-popup',\n className\n )}\n />\n </BasePreviewCard.Positioner>\n </BasePreviewCard.Portal>\n )\n}\n","import type { CSSProperties, ReactNode } from 'react'\nimport { Progress as BaseProgress } from '@base-ui/react/progress'\nimport {\n SquigglyWave,\n useWaveMorph,\n type WaveSpan,\n} from '../SquigglyWave/SquigglyWave'\nimport { cx, withClass } from '../../utils'\nimport { checkName } from '../../dev'\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 /**\n * Draw the filled part of a linear bar as a moving wave. Changing it\n * animates between the wave and the plain bar. @default false\n */\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/**\n * Shows how far along a task is: `value` from 0 to 100 (or `min`/`max`).\n * Pass `value={null}` while the amount of work is unknown.\n *\n * @example\n * <Progress label=\"Uploading\" value={progress} />\n * <Progress type=\"circular\" aria-label=\"Loading\" value={null} />\n */\nexport function Progress({\n type = 'linear',\n squiggly = false,\n label,\n className,\n style,\n children,\n ...props\n}: ProgressProps) {\n if (process.env.NODE_ENV !== 'production' && label == null) {\n checkName(\n props,\n 'Progress',\n '<Progress label=\"Uploading\" value={40} /> // or aria-label=\"Uploading\"',\n 'progress.md'\n )\n }\n const { value, min = 0, max = 100 } = props\n const wavy = squiggly && type === 'linear'\n const morph = useWaveMorph(wavy)\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 wavy && 'avl-progress-squiggly',\n // Also while flattening into the plain bar\n morph.show && 'avl-progress-wave'\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 {morph.show ? (\n <SquigglyWave\n {...morph.wave}\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 { devError } from '../../dev'\nimport './toggle-group.css'\n\ntype ToggleGroupCommonProps = ColorProps & {\n /** Same heights as `Button`. @default 'normal' */\n size?: 'small' | 'normal' | 'big'\n}\n\nexport type ToggleGroupProps<Value = unknown> = ToggleGroupCommonProps &\n (\n | (BaseRadioGroup.Props<Value> & {\n /**\n * Let several segments be on at once. `value` is then an array\n * of strings. Without it, `value` is a single value, not an\n * array. @default false\n */\n multiple?: false\n })\n | (BaseToggleGroup.Props<string> & {\n /**\n * Let several segments be on at once. `value` is then an array\n * of strings. Without it, `value` is a single value, not an\n * array. @default false\n */\n multiple: true\n })\n )\n\n// Items render as radios or as toggles depending on the group; null outside one\nconst MultipleContext = createContext<boolean | null>(null)\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 *\n * @example\n * <ToggleGroup aria-label=\"View\" value={view} onValueChange={setView}>\n * <ToggleGroupItem value=\"list\" startIcon=\"list\">List</ToggleGroupItem>\n * <ToggleGroupItem value=\"grid\" startIcon=\"grid_view\">Grid</ToggleGroupItem>\n * </ToggleGroup>\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 = unknown> =\n 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 group = useContext(MultipleContext)\n if (process.env.NODE_ENV !== 'production' && group === null) {\n devError(\n '<ToggleGroupItem> is rendered outside a <ToggleGroup>.',\n '<ToggleGroup aria-label=\"View\" defaultValue=\"list\">\\n <ToggleGroupItem value=\"list\">List</ToggleGroupItem>\\n <ToggleGroupItem value=\"grid\">Grid</ToggleGroupItem>\\n</ToggleGroup>',\n 'toggle-group.md'\n )\n }\n const multiple = group ?? false\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 { checkProp } from '../../dev'\nimport './radio-group.css'\n\nexport type RadioGroupProps<Value = unknown> = BaseRadioGroup.Props<Value>\n\n/**\n * A group of `Radio`s where exactly one is picked. State: `value` /\n * `defaultValue` / `onValueChange` on the group; each `Radio` has a `value`.\n * Give the group an `aria-label` or `aria-labelledby`.\n *\n * @example\n * <RadioGroup aria-label=\"Plan\" defaultValue=\"free\">\n * <label><Radio value=\"free\" /> Free</label>\n * <label><Radio value=\"pro\" /> Pro</label>\n * </RadioGroup>\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 = unknown> = BaseRadio.Root.Props<Value>\n\n/** One option in a `RadioGroup`. Needs a `value`. Wrap it in a `<label>` with its text. */\nexport function Radio<Value>({ className, ...props }: RadioProps<Value>) {\n if (process.env.NODE_ENV !== 'production') {\n checkProp(\n props,\n 'label',\n 'Radio',\n 'Wrap it in a <label> with the text instead.',\n '<label>\\n <Radio value=\"pro\" />\\n Pro\\n</label>',\n 'radio-group.md'\n )\n }\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 CSSProperties, type ReactNode, type Ref } from 'react'\nimport { Select as BaseSelect } from '@base-ui/react/select'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { Icon } from '../Icon/Icon'\nimport { cx, splitControlProps, withClass } from '../../utils'\nimport { checkRoot } from '../../dev'\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 /** Applied to the outer wrapper, with `className`. */\n style?: CSSProperties\n /** The field's button (the part that opens the list). */\n ref?: Ref<HTMLButtonElement>\n}\n\n/**\n * A dropdown to pick one option (or several, with `multiple`). Put\n * `SelectItem`s inside. Pass `items` (value → label) so the field shows the\n * selected item's label rather than its raw value. `onValueChange` gets the\n * value, not an event. Other props go to Base UI's `Select.Root`, which\n * renders no element: use `className` for styling the field.\n *\n * @example\n * const fruits = { apple: 'Apple', banana: 'Banana' }\n *\n * <Select label=\"Fruit\" items={fruits} value={fruit} onValueChange={setFruit}>\n * {Object.entries(fruits).map(([value, label]) => (\n * <SelectItem key={value} value={value}>{label}</SelectItem>\n * ))}\n * </Select>\n */\nexport function Select<Value, Multiple extends boolean | undefined = false>({\n label,\n placeholder,\n size = 'normal',\n className,\n style,\n ref,\n children,\n ...allProps\n}: SelectProps<Value, Multiple>) {\n // ARIA and data attributes describe the button; the Root renders no element\n const { control, rest: props } = splitControlProps(allProps)\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'Select')\n }\n\n return (\n <BaseSelect.Root {...props}>\n {/* Same structure and classes as Input, so it looks the same */}\n <div\n style={style}\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\n {...control}\n ref={ref}\n className=\"avl-input-field avl-select-trigger\"\n >\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\n/** One option in a `Select`. Needs a `value`; children are its label. */\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 { useId, useRef, useState, type ReactNode, type Ref } from 'react'\nimport { Icon } from '../Icon/Icon'\nimport { Button } from '../Button/Button'\nimport {\n Popover,\n PopoverClose,\n PopoverPopup,\n PopoverTrigger,\n type PopoverProps,\n} from '../Popover/Popover'\nimport { ToggleGroup, ToggleGroupItem } from '../ToggleGroup/ToggleGroup'\nimport { cx, splitControlProps } from '../../utils'\nimport { parseTime, type Time } from '../../datetime'\nimport '../Input/input.css'\nimport '../Select/select.css'\nimport './time-picker.css'\n\nexport type TimePickerProps = Omit<\n React.ComponentProps<'div'>,\n 'children' | 'defaultValue' | 'ref'\n> &\n Pick<PopoverProps, 'open' | 'defaultOpen' | 'onOpenChange'> & {\n /**\n * `dial`: tap or drag a clock face, hour then minute.\n * `input`: type into the hour and minute boxes. @default 'dial'\n */\n type?: 'dial' | 'input'\n /** The time as 24-hour `\"HH:mm\"` (like `<input type=\"time\">`), or `null` for none. */\n value?: string | null\n /** Starting time when `value` isn't controlled. @default null */\n defaultValue?: string | null\n /** Called with the new `\"HH:mm\"` on every change, or `null` once it's cleared. */\n onValueChange?: (value: string | null) => void\n /** 12 shows AM/PM. @default the user's locale */\n hourCycle?: 12 | 24\n /** @default false */\n disabled?: boolean\n /**\n * `small` is shorter, and its label works like a placeholder: it hides\n * once a time is picked. @default 'normal'\n */\n size?: 'small' | 'normal'\n /** Submits the value with a form, as `\"HH:mm\"`. */\n name?: string\n /** The field's button (the part that opens the picker). */\n ref?: Ref<HTMLButtonElement>\n } & (\n | {\n /** Floating label, like Input's. */\n label: ReactNode\n 'aria-label'?: never\n }\n | {\n label?: undefined\n /** Without a visible `label`, the field needs a name for screen readers. */\n 'aria-label': string\n }\n )\n\ntype Mode = 'hour' | 'minute'\n\nconst pad = (n: number) => String(n).padStart(2, '0')\n\nfunction localeHourCycle(): 12 | 24 {\n const { hour12 } = new Intl.DateTimeFormat(undefined, {\n hour: 'numeric',\n }).resolvedOptions()\n return hour12 ? 12 : 24\n}\n\nconst displayHour = (h: number, cycle: 12 | 24) =>\n cycle === 12 ? h % 12 || 12 : h\n\n/**\n * A field that opens a Material 3 time picker. The value is a 24-hour\n * `\"HH:mm\"` string, the same format as `<input type=\"time\">`.\n *\n * @example\n * <TimePicker label=\"Alarm\" defaultValue=\"07:30\" onValueChange={setTime} />\n */\nexport function TimePicker({\n type = 'dial',\n value: valueProp,\n defaultValue = null,\n onValueChange,\n hourCycle,\n label,\n 'aria-label': ariaLabel,\n disabled,\n size = 'normal',\n name,\n open,\n defaultOpen,\n onOpenChange,\n className,\n ref,\n id,\n ...allProps\n}: TimePickerProps) {\n // ARIA and data attributes, `id` and `ref` describe the button, not the wrapper\n const { control, rest: props } = splitControlProps(allProps)\n const [internal, setInternal] = useState(defaultValue)\n const value = valueProp !== undefined ? valueProp : internal\n const time = parseTime(value)\n const cycle = hourCycle ?? localeHourCycle()\n const labelId = useId()\n const valueId = useId()\n\n const setTime = (t: Time | null) => {\n const next = t && `${pad(t.h)}:${pad(t.m)}`\n setInternal(next)\n onValueChange?.(next)\n }\n\n const shown =\n time &&\n new Intl.DateTimeFormat(undefined, {\n hour: 'numeric',\n minute: '2-digit',\n hourCycle: cycle === 12 ? 'h12' : 'h23',\n }).format(new Date(2000, 0, 1, time.h, time.m))\n\n return (\n <Popover\n open={open}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n >\n {/* Same structure and classes as Select, so it looks the same */}\n <div\n {...props}\n className={cx(\n 'avl-input',\n 'avl-select',\n 'avl-time-picker',\n `avl-input-size-${size}`,\n label != null && 'avl-input-labeled',\n className\n )}\n >\n <PopoverTrigger\n {...control}\n ref={ref}\n id={id}\n disabled={disabled}\n className=\"avl-input-field avl-select-trigger\"\n // select.css rests the label while this is set\n data-placeholder={time ? undefined : ''}\n aria-labelledby={`${labelId} ${valueId}`}\n >\n <span id={valueId} className=\"avl-select-value\">\n {shown}\n </span>\n <Icon name=\"schedule\" className=\"avl-time-picker-icon\" />\n </PopoverTrigger>\n {label != null ? (\n <span id={labelId} className=\"avl-input-label\">\n {label}\n </span>\n ) : (\n <span id={labelId} hidden>\n {ariaLabel}\n </span>\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 {name != null && (\n <input type=\"hidden\" name={name} value={value ?? ''} />\n )}\n </div>\n <PopoverPopup aria-labelledby={labelId}>\n <TimePanel\n type={type}\n time={time}\n cycle={cycle}\n onChange={setTime}\n onClear={() => setTime(null)}\n />\n </PopoverPopup>\n </Popover>\n )\n}\n\n// The popup's contents. Mounts on open, so it always starts on the hour.\nfunction TimePanel(props: {\n type: 'dial' | 'input'\n time: Time | null\n cycle: 12 | 24\n onChange: (t: Time) => void\n onClear: () => void\n}) {\n const { type, time, cycle, onChange, onClear } = props\n const [mode, setMode] = useState<Mode>('hour')\n const pm = time ? time.h >= 12 : false\n const hourText = time ? pad(displayHour(time.h, cycle)) : '--'\n const minuteText = time ? pad(time.m) : '--'\n\n // Hours typed in 12-hour mode keep the current AM/PM\n const setHour = (shownHour: number) =>\n onChange({\n h: cycle === 12 ? (shownHour % 12) + (pm ? 12 : 0) : shownHour,\n m: time?.m ?? 0,\n })\n const setMinute = (m: number) => onChange({ h: time?.h ?? 0, m })\n\n return (\n <div className=\"avl-time-picker-panel\">\n <div className=\"avl-time-picker-header\">\n {type === 'dial' ? (\n <>\n <button\n type=\"button\"\n className=\"avl-time-picker-box\"\n data-selected={mode === 'hour' || undefined}\n aria-pressed={mode === 'hour'}\n aria-label={`Hour ${hourText}`}\n onClick={() => setMode('hour')}\n >\n {hourText}\n </button>\n <span className=\"avl-time-picker-colon\" aria-hidden>\n :\n </span>\n <button\n type=\"button\"\n className=\"avl-time-picker-box\"\n data-selected={mode === 'minute' || undefined}\n aria-pressed={mode === 'minute'}\n aria-label={`Minute ${minuteText}`}\n onClick={() => setMode('minute')}\n >\n {minuteText}\n </button>\n </>\n ) : (\n <>\n <SpinInput\n label=\"Hour\"\n value={time && displayHour(time.h, cycle)}\n min={cycle === 12 ? 1 : 0}\n max={cycle === 12 ? 12 : 23}\n onChange={setHour}\n />\n <span className=\"avl-time-picker-colon\" aria-hidden>\n :\n </span>\n <SpinInput\n label=\"Minute\"\n value={time && time.m}\n min={0}\n max={59}\n onChange={setMinute}\n />\n </>\n )}\n {cycle === 12 && (\n <ToggleGroup\n size=\"small\"\n fillType=\"outlined\"\n aria-label=\"AM or PM\"\n className=\"avl-time-picker-period\"\n value={time ? (pm ? 'pm' : 'am') : null}\n onValueChange={(period) =>\n onChange({\n h:\n ((time?.h ?? 0) % 12) +\n (period === 'pm' ? 12 : 0),\n m: time?.m ?? 0,\n })\n }\n >\n <ToggleGroupItem value=\"am\">AM</ToggleGroupItem>\n <ToggleGroupItem value=\"pm\">PM</ToggleGroupItem>\n </ToggleGroup>\n )}\n </div>\n {type === 'dial' && (\n <Dial\n mode={mode}\n time={time}\n cycle={cycle}\n onChange={onChange}\n onHourDone={() => setMode('minute')}\n />\n )}\n {time && (\n <div className=\"avl-time-picker-actions\">\n <PopoverClose\n render={<Button fillType=\"text\" size=\"small\" />}\n onClick={onClear}\n >\n Clear\n </PopoverClose>\n </div>\n )}\n </div>\n )\n}\n\n// A typeable box. Arrow keys step and wrap; digits commit as soon as they\n// make a number in range, so \"0\" then \"9\" gives 9.\nfunction SpinInput(props: {\n label: string\n value: number | null\n min: number\n max: number\n onChange: (n: number) => void\n}) {\n const { label, value, min, max, onChange } = props\n const [draft, setDraft] = useState<string | null>(null)\n const range = max - min + 1\n\n return (\n <input\n className=\"avl-time-picker-box\"\n role=\"spinbutton\"\n aria-label={label}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-valuenow={value ?? undefined}\n inputMode=\"numeric\"\n autoComplete=\"off\"\n placeholder=\"--\"\n value={draft ?? (value == null ? '' : pad(value))}\n onFocus={(e) => e.currentTarget.select()}\n onBlur={() => setDraft(null)}\n onChange={(e) => {\n const digits = e.target.value.replace(/\\D/g, '').slice(-2)\n setDraft(digits)\n const n = Number(digits)\n if (digits && n >= min && n <= max) onChange(n)\n }}\n onKeyDown={(e) => {\n const step =\n e.key === 'ArrowUp' ? 1 : e.key === 'ArrowDown' ? -1 : 0\n if (!step) return\n e.preventDefault()\n setDraft(null)\n onChange(\n value == null\n ? min\n : ((value - min + step + range) % range) + min\n )\n }}\n />\n )\n}\n\n// Clock face in a 256-unit square. 24-hour mode puts 12-23 on an inner ring.\nconst SIZE = 256\nconst C = SIZE / 2\nconst OUTER = 100\nconst INNER = 64\nconst KNOB = 20\n\nconst point = (index: number, of: number, radius: number) => {\n const a = (index / of) * 2 * Math.PI\n return { x: C + radius * Math.sin(a), y: C - radius * Math.cos(a) }\n}\n\n// A role=\"slider\": arrow keys step, Enter moves on from the hour\nfunction Dial(props: {\n mode: Mode\n time: Time | null\n cycle: 12 | 24\n onChange: (t: Time) => void\n onHourDone: () => void\n}) {\n const { mode, time, cycle, onChange, onHourDone } = props\n const h = time?.h ?? 0\n const m = time?.m ?? 0\n const isHour = mode === 'hour'\n const [dragging, setDragging] = useState(false)\n\n const labels = Array.from({ length: 12 }, (_, i) =>\n !isHour\n ? [{ value: i * 5, text: pad(i * 5), inner: false }]\n : cycle === 12\n ? [{ value: i, text: String(i || 12), inner: false }]\n : [\n { value: i, text: i ? String(i) : '00', inner: false },\n { value: i + 12, text: String(i + 12), inner: true },\n ]\n ).flat()\n\n const radius = isHour && cycle === 24 && h >= 12 ? INNER : OUTER\n\n // The hand turns with a CSS transition. Keep the angle continuous\n // (350deg to 360deg, not back to 0deg) so it always takes the short way.\n const target = isHour ? (h % 12) * 30 : m * 6\n const angleRef = useRef<number | null>(null)\n const prev = angleRef.current\n const angle =\n prev == null\n ? target\n : prev + ((((target - prev) % 360) + 540) % 360) - 180\n angleRef.current = angle\n\n const isSelected = (value: number) =>\n time != null &&\n (isHour ? value === (cycle === 12 ? h % 12 : h) : value === m)\n\n const pick = (e: React.PointerEvent<SVGSVGElement>) => {\n const rect = e.currentTarget.getBoundingClientRect()\n const x = ((e.clientX - rect.left) / rect.width) * SIZE - C\n const y = ((e.clientY - rect.top) / rect.height) * SIZE - C\n // Clockwise from 12 o'clock, 0 to 1\n const turn = (Math.atan2(x, -y) / (2 * Math.PI) + 1) % 1\n if (!isHour) {\n onChange({ h, m: Math.round(turn * 60) % 60 })\n return\n }\n const i = Math.round(turn * 12) % 12\n const inner = cycle === 24 && Math.hypot(x, y) < (OUTER + INNER) / 2\n onChange({\n h: cycle === 12 ? i + (h >= 12 ? 12 : 0) : i + (inner ? 12 : 0),\n m,\n })\n }\n\n const step = (d: number) =>\n onChange(\n isHour ? { h: (h + d + 24) % 24, m } : { h, m: (m + d + 60) % 60 }\n )\n\n const valueText = !time\n ? undefined\n : isHour\n ? `${displayHour(h, cycle)}${cycle === 12 ? (h >= 12 ? ' PM' : ' AM') : ''}`\n : `${m} minutes`\n\n return (\n <svg\n className=\"avl-time-picker-dial\"\n data-dragging={dragging || undefined}\n viewBox={`0 0 ${SIZE} ${SIZE}`}\n tabIndex={0}\n role=\"slider\"\n aria-label={isHour ? 'Hour' : 'Minute'}\n aria-valuemin={0}\n aria-valuemax={isHour ? 23 : 59}\n aria-valuenow={time ? (isHour ? h : m) : undefined}\n aria-valuetext={valueText}\n onPointerDown={(e) => {\n e.currentTarget.setPointerCapture(e.pointerId)\n setDragging(true)\n pick(e)\n }}\n onPointerMove={(e) => {\n if (e.currentTarget.hasPointerCapture(e.pointerId)) pick(e)\n }}\n onPointerUp={() => {\n setDragging(false)\n if (isHour) onHourDone()\n }}\n onPointerCancel={() => setDragging(false)}\n onKeyDown={(e) => {\n if (e.key === 'ArrowUp' || e.key === 'ArrowRight') step(1)\n else if (e.key === 'ArrowDown' || e.key === 'ArrowLeft')\n step(-1)\n else if (e.key === 'Enter' && isHour) onHourDone()\n else return\n e.preventDefault()\n }}\n >\n <circle className=\"avl-time-picker-dial-face\" cx={C} cy={C} r={C} />\n {time && (\n <>\n <circle\n className=\"avl-time-picker-dial-knob\"\n cx={C}\n cy={C}\n r={3}\n />\n <g\n className=\"avl-time-picker-dial-hand\"\n style={{\n transformOrigin: `${C}px ${C}px`,\n transform: `rotate(${angle}deg)`,\n }}\n >\n {/* 1 unit tall, stretched to the radius, so its length animates too */}\n <rect\n className=\"avl-time-picker-dial-arm\"\n x={C - 1}\n y={C - 1}\n width={2}\n height={1}\n style={{\n transformOrigin: `${C}px ${C}px`,\n transform: `scaleY(${radius})`,\n }}\n />\n <g\n className=\"avl-time-picker-dial-tip\"\n style={{ transform: `translateY(${-radius}px)` }}\n >\n <circle\n className=\"avl-time-picker-dial-knob\"\n cx={C}\n cy={C}\n r={KNOB}\n />\n {/* Between labels: a dot marks the exact minute */}\n {!isHour && m % 5 !== 0 && (\n <circle\n className=\"avl-time-picker-dial-dot\"\n cx={C}\n cy={C}\n r={2}\n />\n )}\n </g>\n </g>\n </>\n )}\n {labels.map((l) => {\n const p = isHour\n ? point(l.value % 12, 12, l.inner ? INNER : OUTER)\n : point(l.value, 60, OUTER)\n return (\n <text\n key={l.value}\n className={cx(\n 'avl-time-picker-dial-label',\n l.inner && 'avl-time-picker-dial-label-inner'\n )}\n data-selected={isSelected(l.value) || undefined}\n x={p.x}\n y={p.y}\n aria-hidden\n >\n {l.text}\n </text>\n )\n })}\n </svg>\n )\n}\n","import {\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from 'react'\nimport { Input as BaseInput } from '@base-ui/react/input'\nimport { IconButton } from '../IconButton/IconButton'\nimport { Calendar } from '../Calendar/Calendar'\nimport { Popover, PopoverPopup, PopoverTrigger } from '../Popover/Popover'\nimport { cx, mergeRefs } from '../../utils'\nimport {\n fieldOrder,\n fromIso,\n parseTyped,\n placeholderFor,\n toIso,\n} from '../../datetime'\nimport '../Input/input.css'\nimport './date-input.css'\n\nexport type DateInputProps = Omit<\n BaseInput.Props,\n | 'value'\n | 'defaultValue'\n | 'onValueChange'\n | 'type'\n | 'size'\n | 'className'\n | 'style'\n | 'placeholder'\n> & {\n /** Applied to the outer wrapper, with `className`. */\n style?: CSSProperties\n /** The date as `\"YYYY-MM-DD\"` (like `<input type=\"date\">`), or `null` for none. */\n value?: string | null\n /** Starting date when `value` isn't controlled. @default null */\n defaultValue?: string | null\n /** Called with the new `\"YYYY-MM-DD\"`, or `null` once the field is cleared. */\n onValueChange?: (value: string | null) => void\n /**\n * `small` is shorter, and its label works like a placeholder: it hides\n * once there's text. @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 /** Floating label, like Input's. */\n label: ReactNode\n 'aria-label'?: never\n }\n | {\n label?: undefined\n /** Without a visible `label`, the field needs a name for screen readers. */\n 'aria-label': string\n }\n )\n\n// The locale's numeric date format, e.g. 10/29/2026 or 29.10.2026\nconst numericFormat = () =>\n new Intl.DateTimeFormat(undefined, {\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n })\n\n/**\n * A text field for a date, typed in the locale's format (10/29/2026,\n * 29.10.2026, ...) or picked from a calendar. The value is `\"YYYY-MM-DD\"`,\n * the same format as `<input type=\"date\">`, not a `Date`.\n *\n * @example\n * const [date, setDate] = useState<string | null>(null)\n * <DateInput label=\"Start date\" value={date} onValueChange={setDate} />\n */\nexport function DateInput({\n value: valueProp,\n defaultValue = null,\n onValueChange,\n label,\n size = 'normal',\n disabled,\n id,\n onBlur,\n className,\n style,\n ref,\n ...props\n}: DateInputProps) {\n const [internal, setInternal] = useState(defaultValue)\n const value = valueProp !== undefined ? valueProp : internal\n const date = fromIso(value)\n // What's typed, while it differs from the value\n const [draft, setDraft] = useState<string | null>(null)\n const [open, setOpen] = useState(false)\n const fieldRef = useRef<HTMLDivElement>(null)\n const popupRef = useRef<HTMLDivElement>(null)\n const generatedId = useId()\n const inputId = id ?? generatedId\n const inputRef = useRef<HTMLInputElement>(null)\n\n // The input shows the locale's text (\"11/06/2026\"). Forms get the\n // \"YYYY-MM-DD\" value instead, under whatever name the input has (its own,\n // or a Field's), including `new FormData(form)` and server actions.\n const iso = useRef('')\n iso.current = date ? toIso(date) : ''\n useEffect(() => {\n const form = inputRef.current?.form\n if (!form) return\n const onFormData = (event: FormDataEvent) => {\n const input = inputRef.current\n if (input?.name && !input.disabled)\n event.formData.set(input.name, iso.current)\n }\n form.addEventListener('formdata', onFormData)\n return () => form.removeEventListener('formdata', onFormData)\n }, [])\n\n const fmt = numericFormat()\n const order = fieldOrder(fmt)\n const invalid =\n draft != null && draft.trim() !== '' && !parseTyped(draft, order)\n\n const commit = (d: Date | null) => {\n const next = d && toIso(d)\n setInternal(next)\n onValueChange?.(next)\n }\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <div\n ref={fieldRef}\n style={style}\n className={cx(\n 'avl-input',\n 'avl-date-input',\n `avl-input-size-${size}`,\n label != null && 'avl-input-labeled',\n className\n )}\n >\n <BaseInput\n {...props}\n ref={mergeRefs(inputRef, ref)}\n id={inputId}\n disabled={disabled}\n className=\"avl-input-field\"\n inputMode=\"numeric\"\n autoComplete=\"off\"\n placeholder={placeholderFor(fmt)}\n aria-invalid={invalid || undefined}\n value={draft ?? (date ? fmt.format(date) : '')}\n onChange={(e) => {\n const text = e.target.value\n setDraft(text)\n if (!text.trim()) commit(null)\n else {\n const typed = parseTyped(text, order)\n if (typed) commit(typed)\n }\n }}\n onBlur={(e) => {\n // Tidy a valid entry into the locale format; keep a bad one to fix\n if (!invalid) setDraft(null)\n onBlur?.(e)\n }}\n />\n {label != null && (\n <label htmlFor={inputId} className=\"avl-input-label\">\n {label}\n </label>\n )}\n <PopoverTrigger\n disabled={disabled}\n render={\n <IconButton\n icon=\"calendar_today\"\n fillType=\"text\"\n color=\"container\"\n aria-label=\"Choose date\"\n />\n }\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 <PopoverPopup\n anchor={fieldRef}\n align=\"start\"\n ref={popupRef}\n // the picked day, or today: the one day that's tabbable\n initialFocus={() =>\n popupRef.current?.querySelector<HTMLElement>(\n '.avl-calendar-day[tabindex=\"0\"]'\n ) ?? true\n }\n aria-label=\"Choose date\"\n >\n <Calendar\n value={date && toIso(date)}\n onValueChange={(iso) => {\n commit(fromIso(iso))\n setDraft(null)\n setOpen(false)\n }}\n />\n </PopoverPopup>\n </Popover>\n )\n}\n","import {\n useContext,\n useId,\n type CSSProperties,\n type ReactNode,\n type Ref,\n} from 'react'\nimport { Combobox as BaseCombobox } from '@base-ui/react/combobox'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { Icon } from '../Icon/Icon'\nimport { cx, splitControlProps, withClass } from '../../utils'\nimport { checkRoot, devError } from '../../dev'\nimport '../Input/input.css'\nimport '../Menu/menu.css'\nimport '../Select/select.css'\nimport './combobox.css'\n\nexport type ComboboxProps<Item> = Omit<\n BaseCombobox.Root.Props<Item>,\n 'children' | 'items'\n> & {\n /** The options. Filtered against what's typed. */\n items?: readonly Item[]\n /** Renders each option, e.g. `(item) => <ComboboxItem key={item} value={item}>{item}</ComboboxItem>`. */\n children: (item: Item, index: number) => ReactNode\n /** Floating label. Sits inside the field and moves onto the border once it has focus or a value. */\n label?: ReactNode\n /** Hint text inside the field. With a `label`, only once the label has moved up. */\n placeholder?: string\n /** Shown in the popup when nothing matches. Without it, the popup hides. */\n empty?: 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 /** Applied to the outer wrapper, with `className`. */\n style?: CSSProperties\n /** The text `<input>`. */\n ref?: Ref<HTMLInputElement>\n /** The text `<input>`'s id. */\n id?: string\n}\n\n/**\n * A text field that filters a list of options as you type, and picks one.\n * The picked option is `value` / `defaultValue` / `onValueChange`. For\n * object items, pass `itemToStringLabel` so the field shows a readable label.\n * Children must be a function that renders one item.\n *\n * @example\n * <Combobox label=\"Country\" items={countries} empty=\"No matches\">\n * {(country: string) => (\n * <ComboboxItem key={country} value={country}>{country}</ComboboxItem>\n * )}\n * </Combobox>\n */\nexport function Combobox<Item>({\n children,\n label,\n placeholder,\n empty,\n size = 'normal',\n className,\n style,\n ref,\n id,\n ...allProps\n}: ComboboxProps<Item>) {\n // ARIA and data attributes describe the input; the Root renders no element\n const { control, rest: props } = splitControlProps(allProps)\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'Combobox')\n if (typeof children !== 'function')\n devError(\n '<Combobox> children must be a function that renders one item, plus an `items` array to filter.',\n '<Combobox label=\"Fruit\" items={fruits}>\\n {(fruit: string) => <ComboboxItem key={fruit} value={fruit}>{fruit}</ComboboxItem>}\\n</Combobox>',\n 'combobox.md'\n )\n }\n const generatedId = useId()\n const inputId = id ?? generatedId\n const labelId = useId()\n\n return (\n <BaseCombobox.Root {...props}>\n {/* Same structure and classes as Input, so it looks the same */}\n <BaseCombobox.InputGroup\n style={style}\n className={cx(\n 'avl-input',\n 'avl-combobox',\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 <BaseCombobox.Input\n {...control}\n ref={ref}\n id={inputId}\n className=\"avl-input-field\"\n placeholder={placeholder ?? ' '}\n />\n {label != null && (\n <label\n id={labelId}\n htmlFor={inputId}\n className=\"avl-input-label\"\n >\n {label}\n </label>\n )}\n <BaseCombobox.Trigger\n className=\"avl-combobox-trigger\"\n aria-labelledby={label != null ? labelId : undefined}\n >\n <Icon name=\"arrow_drop_down\" className=\"avl-select-icon\" />\n </BaseCombobox.Trigger>\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 </BaseCombobox.InputGroup>\n {/* Into the AnvilRoot, not body, so the popup sees the theme variables */}\n <BaseCombobox.Portal container={avl?.rootRef}>\n <BaseCombobox.Positioner\n className=\"avl-menu-positioner\"\n sideOffset={4}\n >\n <BaseCombobox.Popup className=\"avl-menu-popup avl-select-popup avl-combobox-popup\">\n {empty != null && (\n <BaseCombobox.Empty className=\"avl-combobox-empty\">\n {empty}\n </BaseCombobox.Empty>\n )}\n <BaseCombobox.List>{children}</BaseCombobox.List>\n </BaseCombobox.Popup>\n </BaseCombobox.Positioner>\n </BaseCombobox.Portal>\n </BaseCombobox.Root>\n )\n}\n\nexport type ComboboxItemProps = BaseCombobox.Item.Props\n\n/** One option in a `Combobox`. Needs a `value` (the item); children are its label. */\nexport function ComboboxItem({\n className,\n children,\n ...props\n}: ComboboxItemProps) {\n return (\n <BaseCombobox.Item\n {...props}\n className={withClass('avl-menu-item avl-select-item', className)}\n >\n <span className=\"avl-menu-item-label\">{children}</span>\n <BaseCombobox.ItemIndicator className=\"avl-select-item-indicator\">\n <Icon name=\"check\" />\n </BaseCombobox.ItemIndicator>\n </BaseCombobox.Item>\n )\n}\n","import { useId, type CSSProperties, type ReactNode } from 'react'\nimport { OTPField as BaseOTPField } from '@base-ui/react/otp-field'\nimport { cx } from '../../utils'\nimport './pin-input.css'\n\nexport type PinInputProps = Omit<\n BaseOTPField.Root.Props,\n 'className' | 'style' | 'children' | 'size'\n> & {\n /** Applied to the outer wrapper, with `className`. */\n style?: CSSProperties\n /** `filled` gives each box a tinted background and a bottom line instead of a full border. @default 'outlined' */\n fillType?: 'filled' | 'outlined'\n /** Boxes are 40px tall instead of 56px. @default 'normal' */\n size?: 'small' | 'normal'\n /** Screen reader name of each box after the first. @default (index, length) => `Character ${index + 1} of ${length}` */\n slotLabel?: (index: number, length: number) => string\n /** Applied to the outer wrapper, so width and margins work as expected. */\n className?: string\n} & (\n | {\n /** Visible label above the boxes. */\n label: ReactNode\n 'aria-label'?: never\n }\n | {\n label?: undefined\n /** Without a visible `label`, the field needs a name for screen readers. */\n 'aria-label': string\n }\n )\n\nconst defaultSlotLabel = (index: number, length: number) =>\n `Character ${index + 1} of ${length}`\n\n/**\n * One box per character, for verification codes and PINs. Typing, paste,\n * backspace and arrow keys move between boxes. Digits only by default; set\n * `validationType` for letters. `mask` hides what's typed. `length` is\n * required.\n *\n * @example\n * <PinInput label=\"Verification code\" length={6} onValueChange={setCode} />\n */\nexport function PinInput({\n label,\n 'aria-label': ariaLabel,\n fillType = 'outlined',\n size = 'normal',\n slotLabel = defaultSlotLabel,\n className,\n style,\n id,\n length,\n ...props\n}: PinInputProps) {\n const generatedId = useId()\n const inputId = id ?? generatedId\n const labelId = `${inputId}-label`\n\n return (\n <div\n style={style}\n className={cx(\n 'avl-pin-input',\n `avl-pin-input-size-${size}`,\n `avl-pin-input-fill-${fillType}`,\n className\n )}\n >\n {label != null ? (\n <label\n id={labelId}\n htmlFor={inputId}\n className=\"avl-pin-input-label\"\n >\n {label}\n </label>\n ) : (\n // Base UI ignores aria-label on the first box, but aria-labelledby\n // still reads hidden elements\n <span id={labelId} hidden>\n {ariaLabel}\n </span>\n )}\n <BaseOTPField.Root\n {...props}\n id={inputId}\n length={length}\n aria-labelledby={labelId}\n className=\"avl-pin-input-slots\"\n >\n {Array.from({ length }, (_, i) => (\n <BaseOTPField.Input\n key={i}\n className=\"avl-pin-input-slot\"\n aria-label={i > 0 ? slotLabel(i, length) : undefined}\n aria-labelledby={\n i === 0 && label == null ? labelId : undefined\n }\n />\n ))}\n </BaseOTPField.Root>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Toggle as BaseToggle } from '@base-ui/react/toggle'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { colorClass, type ColorProps } from '../../colors/colors'\nimport { Icon } from '../Icon/Icon'\nimport { cx } from '../../utils'\nimport { checkName } from '../../dev'\nimport '../Button/button.css'\nimport '../IconButton/icon-button.css'\nimport './toggle.css'\n\nexport type ToggleProps = Omit<BaseToggle.Props, 'children'> &\n ColorProps & {\n /**\n * Off, it's neutral in this fill type; on, it fills with `color`.\n * @default 'filled'\n */\n fillType?: ColorProps['fillType']\n } & (\n | {\n /** The visible label. */\n children: ReactNode\n /** Material Symbol before the label. */\n startIcon?: MaterialSymbol\n /** Material Symbol after the label. */\n endIcon?: MaterialSymbol\n /** Same heights as `Button`. @default 'normal' */\n size?: 'small' | 'normal' | 'big'\n icon?: never\n }\n | {\n /** Material Symbol to show: makes it an icon toggle. Filled while on. */\n icon: MaterialSymbol\n // No visible text, so it needs a name for screen readers\n 'aria-label': string\n children?: never\n startIcon?: never\n endIcon?: never\n /** 32px, 40px or 48px, like `IconButton`. @default 'normal' */\n size?: 'small' | 'normal' | 'big'\n }\n )\n\n/**\n * A button that stays on or off, like Bold or Favorite. Holds its state\n * (`pressed` / `defaultPressed` / `onPressedChange`) and sets aria-pressed.\n *\n * @example\n * <Toggle startIcon=\"format_bold\" defaultPressed>Bold</Toggle>\n * <Toggle icon=\"favorite\" aria-label=\"Favorite\" pressed={fav} onPressedChange={setFav} />\n */\nexport function Toggle({\n icon,\n startIcon,\n endIcon,\n size = 'normal',\n color,\n fillType,\n children,\n className,\n ...props\n}: ToggleProps) {\n if (process.env.NODE_ENV !== 'production' && icon) {\n checkName(\n props,\n 'Toggle',\n '<Toggle icon=\"favorite\" aria-label=\"Favorite\" />',\n 'toggle.md'\n )\n }\n return (\n <BaseToggle\n {...props}\n className={(state) =>\n cx(\n 'avl-toggle',\n icon\n ? `avl-icon-button avl-icon-button-size-${size}`\n : `avl-button avl-button-size-${size}`,\n state.pressed\n ? colorClass(color, 'filled')\n : colorClass('container', fillType),\n typeof className === 'function'\n ? className(state)\n : className\n )\n }\n >\n {icon ? (\n <Icon name={icon} />\n ) : (\n <>\n {startIcon && <Icon name={startIcon} />}\n {children}\n {endIcon && <Icon name={endIcon} />}\n </>\n )}\n </BaseToggle>\n )\n}\n","import { useContext, type CSSProperties, type ReactNode, type Ref } from 'react'\nimport { Autocomplete as BaseAutocomplete } from '@base-ui/react/autocomplete'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { colorClass } from '../../colors/colors'\nimport { Icon } from '../Icon/Icon'\nimport { IconButton } from '../IconButton/IconButton'\nimport { cx, splitControlProps, withClass } from '../../utils'\nimport { checkName, checkRoot, devError } from '../../dev'\nimport '../Menu/menu.css'\nimport './search.css'\n\nexport type SearchProps<Item> = Omit<\n BaseAutocomplete.Root.Props<Item>,\n 'children' | 'items'\n> & {\n /** The suggestions. Filtered against what's typed. */\n items?: readonly Item[]\n /**\n * Renders each suggestion, e.g. `(item) => <SearchItem key={item} value={item}>{item}</SearchItem>`.\n * Leave it out for a plain search bar with no suggestion list.\n */\n children?: (item: Item, index: number) => ReactNode\n /** Hint text inside the bar, e.g. \"Search mail\". */\n placeholder?: string\n /** There's no visible label, so the input needs a name for screen readers. */\n 'aria-label': string\n /** Shown in the popup when nothing matches. Without it, the popup hides. */\n empty?: ReactNode\n /**\n * The bar's background. Use `'container'` when the bar sits on a\n * `surface` panel, like a navigation drawer, so it doesn't blend in.\n * @default 'surface'\n */\n color?: 'surface' | 'container'\n /** Accessible name of the clear button. @default 'Clear' */\n clearLabel?: string\n /** Applied to the bar, so width and margins work as expected. */\n className?: string\n /** Applied to the bar, with `className`. */\n style?: CSSProperties\n /** The text `<input>`. */\n ref?: Ref<HTMLInputElement>\n /** The text `<input>`'s id. */\n id?: string\n}\n\n/**\n * Material 3 search bar with a list of suggestions under it. Pass `items`\n * and it filters them as you type. The typed text is `value` /\n * `defaultValue` / `onValueChange`. Children are a function that renders one\n * suggestion; without them it's a plain search bar that never opens a list.\n *\n * @example\n * <Search aria-label=\"Filter people\" value={query} onValueChange={setQuery} />\n * <Search aria-label=\"Search mail\" placeholder=\"Search mail\" items={recent} value={query} onValueChange={setQuery}>\n * {(item: string) => <SearchItem key={item} value={item} startIcon=\"history\">{item}</SearchItem>}\n * </Search>\n */\nexport function Search<Item>({\n children,\n placeholder,\n 'aria-label': ariaLabel,\n empty,\n color = 'surface',\n clearLabel = 'Clear',\n className,\n style,\n ref,\n id,\n ...allProps\n}: SearchProps<Item>) {\n // ARIA and data attributes describe the input; the Root renders no element\n const { control, rest: props } = splitControlProps(allProps)\n const avl = useContext(AnvilContext)\n // No children: a plain search bar, whose list stays closed\n const suggests = children !== undefined\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'Search')\n checkName(\n { 'aria-label': ariaLabel },\n 'Search',\n '<Search aria-label=\"Search mail\" items={items}>{(item) => ...}</Search>',\n 'search.md'\n )\n if (children !== undefined && typeof children !== 'function')\n devError(\n '<Search> children must be a function that renders one suggestion, plus an `items` array to filter.',\n '<Search aria-label=\"Search\" items={items}>\\n {(item: string) => <SearchItem key={item} value={item}>{item}</SearchItem>}\\n</Search>',\n 'search.md'\n )\n if (children === undefined && props.items?.length)\n devError(\n '<Search> has `items` but no children, so the suggestions never show.',\n '<Search aria-label=\"Search\" items={items}>\\n {(item: string) => <SearchItem key={item} value={item}>{item}</SearchItem>}\\n</Search>',\n 'search.md'\n )\n }\n\n return (\n <BaseAutocomplete.Root {...props} {...(!suggests && { open: false })}>\n <BaseAutocomplete.InputGroup\n style={style}\n className={cx(\n 'avl-search',\n colorClass(color, 'filled'),\n className\n )}\n >\n <Icon name=\"search\" />\n <BaseAutocomplete.Input\n {...control}\n ref={ref}\n id={id}\n className=\"avl-search-input\"\n placeholder={placeholder}\n aria-label={ariaLabel}\n />\n <BaseAutocomplete.Clear\n render={\n <IconButton\n icon=\"close\"\n fillType=\"text\"\n color={color}\n aria-label={clearLabel}\n />\n }\n />\n </BaseAutocomplete.InputGroup>\n {/* Into the AnvilRoot, not body, so the popup sees the theme variables */}\n {suggests && (\n <BaseAutocomplete.Portal container={avl?.rootRef}>\n <BaseAutocomplete.Positioner\n className=\"avl-menu-positioner\"\n sideOffset={4}\n >\n <BaseAutocomplete.Popup className=\"avl-menu-popup avl-search-popup\">\n {empty != null && (\n <BaseAutocomplete.Empty className=\"avl-search-empty\">\n {empty}\n </BaseAutocomplete.Empty>\n )}\n <BaseAutocomplete.List>\n {children}\n </BaseAutocomplete.List>\n </BaseAutocomplete.Popup>\n </BaseAutocomplete.Positioner>\n </BaseAutocomplete.Portal>\n )}\n </BaseAutocomplete.Root>\n )\n}\n\nexport type SearchItemProps = BaseAutocomplete.Item.Props & {\n /** Material Symbol before the text, e.g. `history` for a recent search. */\n startIcon?: MaterialSymbol\n}\n\n/** One suggestion in a `Search`. Needs a `value`. Picking it fills the bar with its text. */\nexport function SearchItem({\n startIcon,\n className,\n children,\n ...props\n}: SearchItemProps) {\n return (\n <BaseAutocomplete.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 </BaseAutocomplete.Item>\n )\n}\n","import { cx } from '../../utils'\nimport './skeleton.css'\n\nexport type SkeletonProps = React.ComponentProps<'span'> & {\n /**\n * Shape of the placeholder: a line of text, a circle (avatars, icons) or\n * a rounded box (images, cards). Set the size with `style`.\n * @default 'text'\n */\n variant?: 'text' | 'circular' | 'rectangular'\n /** Fades in and out while loading. @default 'pulse' */\n animation?: 'pulse' | 'none'\n}\n\n/**\n * A placeholder shown while content loads. It's hidden from screen readers:\n * put `aria-busy` on the region that's loading.\n *\n * @example\n * <Skeleton variant=\"circular\" style={{ width: 40, height: 40 }} />\n * <Skeleton style={{ width: '60%' }} />\n */\nexport function Skeleton({\n variant = 'text',\n animation = 'pulse',\n className,\n ...props\n}: SkeletonProps) {\n return (\n <span\n aria-hidden\n {...props}\n className={cx(\n 'avl-skeleton',\n `avl-skeleton-${variant}`,\n animation === 'pulse' && 'avl-skeleton-pulse',\n className\n )}\n />\n )\n}\n","import type { ReactNode } from 'react'\nimport { Slider as BaseSlider } from '@base-ui/react/slider'\nimport {\n SquigglyWave,\n useWaveMorph,\n type WaveSpan,\n} from '../SquigglyWave/SquigglyWave'\nimport { cx, withClass } from '../../utils'\nimport { checkName } from '../../dev'\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. Changing it animates between the\n * wave and the plain track, e.g. `squiggly={playing}`. @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 * `onValueChange` gets a number (or an array for a range), not an event.\n *\n * @example\n * <Slider label=\"Volume\" defaultValue={50} />\n * <Slider aria-label=\"Price\" value={range} onValueChange={setRange} min={0} max={500} />\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 if (process.env.NODE_ENV !== 'production' && label == null) {\n checkName(\n { 'aria-label': ariaLabel, ...props },\n 'Slider',\n '<Slider label=\"Volume\" /> // or <Slider aria-label=\"Volume\" />',\n 'slider.md'\n )\n }\n const initial = props.value ?? props.defaultValue\n const thumbCount = Array.isArray(initial) ? initial.length : 1\n const wavy = squiggly && props.orientation !== 'vertical'\n const morph = useWaveMorph(wavy)\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 {morph.show ? (\n <SquigglyWave span={handleSpan} {...morph.wave} />\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 {/* The indicator's ::before and ::after draw the\n selected part and the part after it. A range\n needs a third piece, before its first handle. */}\n {thumbCount > 1 && (\n <BaseSlider.Indicator className=\"avl-slider-indicator-start\" />\n )}\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 // Base UI marks every handle as dragging, so mark\n // the one being moved: only its track pinches\n render={(thumbProps, state) => (\n <div\n {...thumbProps}\n data-active={\n state.activeThumbIndex === i\n ? ''\n : undefined\n }\n />\n )}\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 snap: true,\n }\n}\n","import { useContext, useEffect, useRef, useState, type ReactNode } from 'react'\nimport { Toast } from '@base-ui/react/toast'\nimport { Icon } from '../Icon/Icon'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\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 (toasts). There is no Snackbar or Toast component to\n * render: AnvilRoot already renders the viewport. Works anywhere inside\n * `AnvilRoot`.\n *\n * @example\n * const snackbar = useSnackbar()\n * snackbar.show({ message: 'Deleted', action: { label: 'Undo', onClick: undo } })\n */\nexport function useSnackbar() {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production' && !avl)\n throw new Error(\n '[anvilui] useSnackbar() was called outside <AnvilRoot>.\\n\\n' +\n 'Fix: call it from a component rendered inside <AnvilRoot>, not in the component that renders AnvilRoot:\\n' +\n '<AnvilRoot><App /></AnvilRoot> // useSnackbar() inside App works\\n\\n' +\n 'Docs: node_modules/anvilui/docs/snackbar.md'\n )\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 type { CSSProperties, ComponentProps } from 'react'\nimport type { MaterialSymbol } from 'material-symbols'\nimport { colorClass, type ComponentColor } from '../../colors/colors'\nimport { Icon } from '../Icon/Icon'\nimport { cx } from '../../utils'\nimport './sticker.css'\n\nexport type StickerProps = ComponentProps<'span'> & {\n /** Color role from the theme. @default 'primary' */\n color?: ComponentColor\n /** Material Symbol before the text. */\n startIcon?: MaterialSymbol\n /** How far it's tilted, in degrees. Negative leans left. @default -4 */\n tilt?: number\n}\n\n/**\n * A small tilted label that looks like a die-cut sticker (\"NEW\", \"BETA\",\n * \"50% off\"). Straightens up on hover. Purely visual: its text is read\n * like any other text.\n *\n * @example\n * <Sticker color=\"warning\" startIcon=\"bolt\">NEW</Sticker>\n */\nexport function Sticker({\n color = 'primary',\n startIcon,\n tilt = -4,\n className,\n style,\n children,\n ...props\n}: StickerProps) {\n return (\n <span\n {...props}\n className={cx(\n 'avl-sticker',\n colorClass(color, 'filled'),\n className\n )}\n style={\n {\n '--avl-sticker-tilt': `${tilt}deg`,\n ...style,\n } as CSSProperties\n }\n >\n {startIcon && <Icon name={startIcon} />}\n {children}\n </span>\n )\n}\n","import { Switch as BaseSwitch } from '@base-ui/react/switch'\nimport { withClass } from '../../utils'\nimport { checkProp } from '../../dev'\nimport './switch.css'\n\nexport type SwitchProps = BaseSwitch.Root.Props\n\n/**\n * An on/off switch. State: `checked` / `defaultChecked` / `onCheckedChange`.\n * It has no `label` prop: wrap it in a `<label>`, or put it in a `ListItem`'s\n * `end` with `render={<label />}`.\n *\n * @example\n * <label style={{ display: 'flex', gap: 8, alignItems: 'center' }}>\n * <Switch checked={wifi} onCheckedChange={setWifi} />\n * Wi-Fi\n * </label>\n */\nexport function Switch({ className, ...props }: SwitchProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkProp(\n props,\n 'label',\n 'Switch',\n 'Wrap it in a <label> with the text instead.',\n '<label>\\n <Switch defaultChecked />\\n Wi-Fi\\n</label>',\n 'switch.md'\n )\n }\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 { cx } from '../../utils'\nimport './table.css'\n\nexport type TableProps = React.ComponentProps<'table'>\n\n/**\n * A styled HTML table. Each part renders its native element (`TableHead` is\n * `<thead>`, `TableHeaderCell` is `<th>`), so it has no sorting or paging.\n *\n * @example\n * <Table>\n * <TableCaption>Invoices</TableCaption>\n * <TableHead>\n * <TableRow><TableHeaderCell>Number</TableHeaderCell><TableHeaderCell>Total</TableHeaderCell></TableRow>\n * </TableHead>\n * <TableBody>\n * <TableRow><TableCell>#1001</TableCell><TableCell>$40</TableCell></TableRow>\n * </TableBody>\n * </Table>\n */\nexport function Table({ className, ...props }: TableProps) {\n return <table {...props} className={cx('avl-table', className)} />\n}\n\nexport type TableCaptionProps = React.ComponentProps<'caption'>\n\n/** The table's accessible name. Without one, give `Table` an `aria-label`. */\nexport function TableCaption({ className, ...props }: TableCaptionProps) {\n return <caption {...props} className={cx('avl-table-caption', className)} />\n}\n\nexport type TableHeadProps = React.ComponentProps<'thead'>\n\n/** `<thead>`: the header rows. */\nexport function TableHead({ className, ...props }: TableHeadProps) {\n return <thead {...props} className={cx('avl-table-head', className)} />\n}\n\nexport type TableBodyProps = React.ComponentProps<'tbody'>\n\n/** `<tbody>`: the data rows. */\nexport function TableBody({ className, ...props }: TableBodyProps) {\n return <tbody {...props} className={cx('avl-table-body', className)} />\n}\n\nexport type TableRowProps = React.ComponentProps<'tr'>\n\n/** `<tr>`. */\nexport function TableRow({ className, ...props }: TableRowProps) {\n return <tr {...props} className={cx('avl-table-row', className)} />\n}\n\nexport type TableHeaderCellProps = React.ComponentProps<'th'>\n\n/** `<th>`, with `scope=\"col\"` by default; pass `scope=\"row\"` for a header at the start of a row. */\nexport function TableHeaderCell({\n scope = 'col',\n className,\n ...props\n}: TableHeaderCellProps) {\n return (\n <th\n {...props}\n scope={scope}\n className={cx('avl-table-header-cell', className)}\n />\n )\n}\n\nexport type TableCellProps = React.ComponentProps<'td'>\n\n/** `<td>`. */\nexport function TableCell({ className, ...props }: TableCellProps) {\n return <td {...props} className={cx('avl-table-cell', className)} />\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\n/**\n * Tabs. Put a `TabsList` of `TabsTab`s, then one `TabsPanel` per tab with\n * the same `value`. There is no TabsTrigger or TabsContent.\n *\n * @example\n * <Tabs defaultValue=\"account\">\n * <TabsList>\n * <TabsTab value=\"account\">Account</TabsTab>\n * <TabsTab value=\"billing\">Billing</TabsTab>\n * </TabsList>\n * <TabsPanel value=\"account\">...</TabsPanel>\n * <TabsPanel value=\"billing\">...</TabsPanel>\n * </Tabs>\n */\nexport function Tabs({ className, ...props }: TabsProps) {\n return (\n <BaseTabs.Root\n {...props}\n className={withClass('avl-tabs', className)}\n />\n )\n}\n\nexport type TabsListProps = BaseTabs.List.Props\n\n/** The row of tabs. Draws the sliding underline under the selected one. */\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\n/** One tab button. Give it a `value` matching its `TabsPanel`. */\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\nexport type TabsPanelProps = BaseTabs.Panel.Props\n\n/** Content for one tab: give it the same `value` as its `TabsTab`. */\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, CSSProperties, 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<\n ComponentProps<'textarea'>,\n 'className' | 'style'\n> & {\n /** Applied to the outer wrapper, with `className`. */\n style?: CSSProperties\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\n/**\n * A multi-line text field with a floating label. Same API as `Input`:\n * `onChange` (event) or `onValueChange` (string); `className` goes on the\n * wrapper, other props on the `<textarea>`.\n *\n * @example\n * <Textarea label=\"Bio\" rows={4} defaultValue=\"\" />\n */\nexport function Textarea({\n label,\n size = 'normal',\n className,\n style,\n placeholder,\n ...props\n}: TextareaProps) {\n return (\n <label\n style={style}\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\n/**\n * A floating pill of icon buttons.\n *\n * @example\n * <FloatingToolbar aria-label=\"Formatting\" style={{ position: 'fixed', bottom: 16, left: '50%', translate: '-50%' }}>\n * <FloatingToolbarButton icon=\"format_bold\" aria-label=\"Bold\" />\n * <FloatingToolbarSeparator />\n * <FloatingToolbarButton icon=\"send\" aria-label=\"Send\" fillType=\"filled\" />\n * </FloatingToolbar>\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\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 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\nexport type FloatingToolbarSeparatorProps = BaseToolbar.Separator.Props\n\n/** A thin line between groups of buttons. */\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 {\n isValidElement,\n useContext,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { Tooltip as BaseTooltip } from '@base-ui/react/tooltip'\nimport { AnvilContext } from '../AnvilRoot/AnvilContext'\nimport { withClass } from '../../utils'\nimport { checkProp, checkRoot, devError } from '../../dev'\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/**\n * A short hint shown on hover or keyboard focus. One component, no parts:\n * the text is `label`, and the single child element is the trigger.\n * `className` goes on the bubble.\n *\n * @example\n * <Tooltip label=\"Delete\">\n * <IconButton icon=\"delete\" aria-label=\"Delete\" />\n * </Tooltip>\n */\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 if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'Tooltip')\n checkProp(\n props,\n 'content',\n 'Tooltip',\n 'The text goes in `label`.',\n '<Tooltip label=\"Delete\">\\n <IconButton icon=\"delete\" aria-label=\"Delete\" />\\n</Tooltip>',\n 'tooltip.md'\n )\n checkProp(\n props,\n 'title',\n 'Tooltip',\n 'The text goes in `label`.',\n '<Tooltip label=\"Delete\">\\n <IconButton icon=\"delete\" aria-label=\"Delete\" />\\n</Tooltip>',\n 'tooltip.md'\n )\n if (!isValidElement(children))\n devError(\n '<Tooltip> needs exactly one element child (the trigger), not text or several elements.',\n '<Tooltip label=\"Delete\">\\n <IconButton icon=\"delete\" aria-label=\"Delete\" />\\n</Tooltip>\\n// for plain text: <Tooltip label=\"...\"><span tabIndex={0}>text</span></Tooltip>',\n 'tooltip.md'\n )\n }\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\n/**\n * Bottom navigation for small screens.\n *\n * @example\n * <NavigationBar aria-label=\"Main\">\n * <NavigationBarItem icon=\"home\" label=\"Home\" href=\"/\" active />\n * <NavigationBarItem icon=\"search\" label=\"Search\" render={<Link to=\"/search\" />} />\n * </NavigationBar>\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\n/** One destination: an `<a>` by default (give it `href`), or a router link via `render`. */\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 {\n createContext,\n useContext,\n useState,\n type ComponentProps,\n type ReactNode,\n} 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 { IconButton, type IconButtonProps } from '../IconButton/IconButton'\nimport { cx, withClass } from '../../utils'\nimport { devError } from '../../dev'\nimport './navigation-rail.css'\n\nconst RailContext = createContext<{\n expanded: boolean\n setExpanded: (expanded: boolean) => void\n} | null>(null)\n\n/**\n * Side navigation between an app's top-level pages, for medium and large\n * screens. Collapsed, it shows icons with small labels under them; expanded,\n * labels sit next to the icons. Put a `NavigationRailToggle` first, then\n * `NavigationRailItem`s, and give it an `aria-label` (e.g. \"Main\").\n */\nexport type NavigationRailProps = ComponentProps<'nav'> & {\n /** Whether labels sit next to the icons. Pair with `onExpandedChange`. */\n expanded?: boolean\n /** Starting state when `expanded` isn't controlled. @default false */\n defaultExpanded?: boolean\n /** Called when a `NavigationRailToggle` is pressed. */\n onExpandedChange?: (expanded: boolean) => void\n}\n\n/**\n * Side navigation for medium and large screens.\n *\n * @example\n * <NavigationRail aria-label=\"Main\">\n * <NavigationRailToggle aria-label=\"Toggle navigation\" />\n * <NavigationRailItem icon=\"inbox\" label=\"Inbox\" href=\"/inbox\" active end=\"3\" />\n * <NavigationRailItem icon=\"send\" label=\"Sent\" href=\"/sent\" />\n * </NavigationRail>\n */\nexport function NavigationRail({\n expanded: expandedProp,\n defaultExpanded = false,\n onExpandedChange,\n className,\n ...props\n}: NavigationRailProps) {\n const [internal, setInternal] = useState(defaultExpanded)\n const expanded = expandedProp ?? internal\n const setExpanded = (next: boolean) => {\n setInternal(next)\n onExpandedChange?.(next)\n }\n\n return (\n <RailContext.Provider value={{ expanded, setExpanded }}>\n <nav\n {...props}\n data-expanded={expanded || undefined}\n className={cx('avl-navigation-rail', className)}\n />\n </RailContext.Provider>\n )\n}\n\nexport type NavigationRailToggleProps = Omit<IconButtonProps, 'icon'>\n\n/** The menu button at the top that expands and collapses the rail. Needs an `aria-label`. */\nexport function NavigationRailToggle({\n className,\n onClick,\n ...props\n}: NavigationRailToggleProps) {\n const rail = useContext(RailContext)\n if (process.env.NODE_ENV !== 'production' && !rail) {\n devError(\n '<NavigationRailToggle> is rendered outside a <NavigationRail>, so it has nothing to expand.',\n '<NavigationRail aria-label=\"Main\">\\n <NavigationRailToggle aria-label=\"Toggle navigation\" />\\n <NavigationRailItem icon=\"home\" label=\"Home\" href=\"/\" />\\n</NavigationRail>',\n 'navigation-rail.md'\n )\n }\n const expanded = rail?.expanded ?? false\n\n return (\n <IconButton\n fillType=\"text\"\n color=\"container\"\n {...props}\n icon={expanded ? 'menu_open' : 'menu'}\n aria-expanded={expanded}\n onClick={(e) => {\n onClick?.(e)\n rail?.setExpanded(!expanded)\n }}\n className={withClass('avl-navigation-rail-toggle', className)}\n />\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\n/** One destination: an `<a>` by default (give it `href`), or a router link via `render`. */\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 <span className=\"avl-navigation-rail-item-indicator\" />\n <Icon name={icon} />\n <span className=\"avl-navigation-rail-item-label\">\n {label}\n </span>\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 type { ComponentProps } from 'react'\nimport { useRender } from '@base-ui/react/use-render'\nimport { mergeProps } from '@base-ui/react/merge-props'\nimport { cx } from '../../utils'\nimport './navigation-list.css'\n\n/**\n * A column of text-only navigation links, like a docs sidebar. Looks like an\n * expanded `NavigationRail` without icons. Fill it with\n * `NavigationListItem`s and give it an `aria-label` (e.g. \"Components\").\n */\nexport type NavigationListProps = ComponentProps<'nav'>\n\n/**\n * A column of text-only navigation links.\n *\n * @example\n * <NavigationList aria-label=\"Settings\">\n * <NavigationListItem label=\"Profile\" href=\"/settings/profile\" active />\n * <NavigationListItem label=\"Billing\" href=\"/settings/billing\" />\n * </NavigationList>\n */\nexport function NavigationList({ className, ...props }: NavigationListProps) {\n return <nav {...props} className={cx('avl-navigation-list', 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 NavigationListItemProps = useRender.ComponentProps<'a'> & {\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\n/** One link: an `<a>` by default (give it `href`), or a router link via `render`. The text is `label`. */\nexport function NavigationListItem({\n label,\n active = false,\n render,\n className,\n ...props\n}: NavigationListItemProps) {\n return useRender({\n defaultTagName: 'a',\n render,\n state: { active },\n props: mergeProps<'a'>(\n {\n className: cx('avl-navigation-list-item', className),\n 'aria-current': active ? 'page' : undefined,\n children: label,\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 { checkAsChild, checkRoot } from '../../dev'\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\n/**\n * Side navigation that slides in over the page, for small screens.\n *\n * @example\n * <NavigationDrawer>\n * <NavigationDrawerTrigger render={<IconButton icon=\"menu\" aria-label=\"Open navigation\" />} />\n * <NavigationDrawerPopup>\n * <NavigationDrawerTitle>Mail</NavigationDrawerTitle>\n * <NavigationDrawerItem icon=\"inbox\" label=\"Inbox\" href=\"/inbox\" active />\n * </NavigationDrawerPopup>\n * </NavigationDrawer>\n */\nexport function NavigationDrawer(props: NavigationDrawerProps) {\n return <Drawer.Root {...props} swipeDirection=\"left\" />\n}\n\nexport type NavigationDrawerTriggerProps = Drawer.Trigger.Props\n\n/** Opens the drawer. Renders a bare `<button>`; usually `render={<IconButton icon=\"menu\" aria-label=\"...\" />}`. */\nexport function NavigationDrawerTrigger({\n className,\n ...props\n}: NavigationDrawerTriggerProps) {\n if (process.env.NODE_ENV !== 'production') {\n checkAsChild(\n props,\n 'NavigationDrawerTrigger',\n 'navigation-drawer.md',\n '<NavigationDrawerTrigger render={<IconButton icon=\"menu\" aria-label=\"Open navigation\" />} />'\n )\n }\n return (\n <Drawer.Trigger\n {...props}\n className={withClass('avl-navigation-drawer-trigger', className)}\n />\n )\n}\n\nexport type NavigationDrawerPopupProps = Drawer.Popup.Props\n\n/**\n * The drawer panel. Also renders the portal and the dimmed backdrop. Put a\n * `NavigationDrawerTitle` first (it names the drawer), then the items.\n */\nexport function NavigationDrawerPopup({\n className,\n ...props\n}: NavigationDrawerPopupProps) {\n const avl = useContext(AnvilContext)\n if (process.env.NODE_ENV !== 'production') {\n checkRoot(avl !== null, 'NavigationDrawerPopup')\n }\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\nexport type NavigationDrawerTitleProps = Drawer.Title.Props\n\n/** The heading at the top, e.g. the app's name. Renders an `<h2>`. */\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\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\n/**\n * A link that also closes the drawer. Give it `href`, or pass `render` for a\n * router link, e.g. `render={<Link to=\"/photos\" />}`.\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 { DesignTokens } from './types'\n\n/**\n * The default design tokens. To change some, pass only those categories to\n * AnvilRoot: `tokens={{ radius: { ...baseDesignTokens.radius, medium: '8px' } }}`.\n */\nexport const baseDesignTokens: DesignTokens = {\n font: {\n main: '\"Google Sans\", system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif',\n title: '\"Google Sans\", system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif',\n mono: '\"Google Sans Code\", ui-monospace, \"Cascadia Code\", Menlo, Consolas, 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 disabledOpacity: '0.5',\n fontWeight: {\n regular: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n },\n shadow: {\n small: '0 2px 6px var(--avl-color-shadow)',\n medium: '0 3px 8px var(--avl-color-shadow)',\n large: '0 4px 16px var(--avl-color-shadow)',\n },\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 // A damped spring, sampled into linear() points\n bounce: 'linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 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\n/** The default light theme (purple). AnvilRoot uses it unless you pass `lightTheme`. */\nexport const baseLightTheme: Theme = {\n background: '#FDF7FF',\n onBackground: '#1D1B20',\n onBackgroundMuted: '#49454E',\n container: '#F2ECF4',\n onContainer: '#1D1B20',\n surface: '#F8F2FA',\n onSurface: '#49454E',\n outline: '#CAC4CF',\n divider: '#E6E0E9',\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\n/** The default dark theme (purple). AnvilRoot uses it unless you pass `darkTheme`. */\nexport const baseDarkTheme: Theme = {\n background: '#141218',\n onBackground: '#E6E0E9',\n onBackgroundMuted: '#CAC4CF',\n container: '#2B292F',\n onContainer: '#E6E0E9',\n surface: '#1D1B20',\n onSurface: '#E6E0E9',\n outline: '#948F99',\n divider: '#49454E',\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 shadow: 'rgb(0 0 0 / 0.6)',\n scrim: 'rgb(0 0 0 / 0.6)',\n}\n","import { baseDarkTheme, baseLightTheme } from './baseTheme'\nimport { Theme } from './types'\n\nexport type ThemePair = { light: Theme; dark: Theme }\n\nexport type CreateThemeOptions = {\n /**\n * Seed for the tonal roles (selected states, tonal buttons), as\n * hex. @default the primary color\n */\n tonal?: string\n}\n\n/**\n * Builds a light and a dark theme from one hex color, e.g. `'#0B6E4F'`.\n * Pass the result to `AnvilRoot` as `lightTheme={t.light} darkTheme={t.dark}`.\n */\nexport function createTheme(\n primary: string,\n options: CreateThemeOptions = {}\n): ThemePair {\n const p = toOklch(parseHex(primary))\n const s = options.tonal ? toOklch(parseHex(options.tonal)) : p\n return {\n light: generate(baseLightTheme, p, s),\n dark: generate(baseDarkTheme, p, s),\n }\n}\n\n/**\n * Builds a light and a dark theme from the main colors of an image: an\n * `<img>`, a `File`/`Blob`, or a URL (which must allow CORS). Browser only.\n */\nexport async function createThemeFromImage(\n image: ImageBitmapSource | string\n): Promise<ThemePair> {\n const source =\n typeof image === 'string' ? await (await fetch(image)).blob() : image\n // Colors are all that matter, so a tiny, squashed copy is plenty\n const size = 64\n const bitmap = await createImageBitmap(source, {\n resizeWidth: size,\n resizeHeight: size,\n })\n const ctx = new OffscreenCanvas(size, size).getContext('2d')!\n ctx.drawImage(bitmap, 0, 0)\n bitmap.close()\n const [primary, secondary] = mainColors(\n ctx.getImageData(0, 0, size, size).data\n )\n return createTheme(primary, { tonal: secondary })\n}\n\n// ---- Generation ----------------------------------------------------------\n\ntype Lch = { l: number; c: number; h: number }\n\nconst primaryRoles = [\n 'primary',\n 'onPrimary',\n 'primaryContainer',\n 'onPrimaryContainer',\n 'inversePrimary',\n]\nconst tonalRoles = ['tonal', 'onTonal', 'tonalContainer', 'onTonalContainer']\nconst neutralRoles = [\n 'background',\n 'onBackground',\n 'onBackgroundMuted',\n 'container',\n 'onContainer',\n 'surface',\n 'onSurface',\n 'outline',\n 'divider',\n 'inverseSurface',\n 'inverseOnSurface',\n]\n\n// The base themes are the template: each role keeps its lightness, and its\n// hue and chroma move with the seed relative to the base primary. Status\n// colors (error, warning, success), shadow and scrim are copied unchanged.\nconst reference = toOklch(parseHex(baseLightTheme.primary))\n\nfunction generate(base: Theme, primary: Lch, secondary: Lch): Theme {\n const theme: Theme = { ...base }\n const set = (keys: string[], seed: Lch, neutral: boolean) => {\n // A grey seed gives grey accents and untinted neutrals\n const scale = seed.c / reference.c\n for (const key of keys) {\n const role = toOklch(parseHex(base[key as keyof Theme]!))\n const c = role.c * (neutral ? Math.min(scale, 1) : scale)\n const h = seed.h + role.h - reference.h\n ;(theme as Record<string, string>)[key] = toHex(role.l, c, h)\n }\n }\n set(primaryRoles, primary, false)\n set(tonalRoles, secondary, false)\n set(neutralRoles, primary, true)\n return theme\n}\n\n// ---- Picking colors from an image ----------------------------------------\n\n/** The most prominent hue, plus a second clearly different one if there is one. */\nfunction mainColors(pixels: Uint8ClampedArray): [string, string] {\n // 36 hue buckets of 10°. Colorful pixels count for more, so a small\n // vivid subject beats a large dull background.\n const bins = Array.from({ length: 36 }, () => ({ w: 0, l: 0, a: 0, b: 0 }))\n const grey = { w: 0, l: 0, a: 0, b: 0 }\n for (let i = 0; i < pixels.length; i += 4) {\n if (pixels[i + 3] < 128) continue\n const [l, a, b] = toOklab([pixels[i], pixels[i + 1], pixels[i + 2]])\n const c = Math.hypot(a, b)\n const bin =\n c < 0.03 || l < 0.15 || l > 0.97\n ? grey\n : bins[Math.floor(hueOf(a, b) / 10) % 36]\n const w = bin === grey ? 1 : c\n bin.w += w\n bin.l += l * w\n bin.a += a * w\n bin.b += b * w\n }\n\n const toColor = (bin: typeof grey) => {\n const a = bin.a / bin.w\n const b = bin.b / bin.w\n return toHex(bin.l / bin.w, Math.hypot(a, b), hueOf(a, b))\n }\n const ranked = bins\n .map((bin, i) => ({ bin, hue: i * 10 + 5 }))\n .filter((x) => x.bin.w > 0)\n .sort((x, y) => y.bin.w - x.bin.w)\n\n // No colorful pixels: a grey theme from the average grey\n if (!ranked.length) {\n const color = grey.w ? toColor(grey) : baseLightTheme.primary\n return [color, color]\n }\n const first = ranked[0]\n const second = ranked.find(\n (x) =>\n hueDistance(x.hue, first.hue) >= 60 && x.bin.w >= first.bin.w * 0.1\n )\n const primary = toColor(first.bin)\n return [primary, second ? toColor(second.bin) : primary]\n}\n\nfunction hueOf(a: number, b: number) {\n return ((Math.atan2(b, a) * 180) / Math.PI + 360) % 360\n}\n\nfunction hueDistance(x: number, y: number) {\n const d = Math.abs(x - y) % 360\n return d > 180 ? 360 - d : d\n}\n\n// ---- Color conversion (sRGB <-> OKLab/OKLCH) -----------------------------\n\nfunction parseHex(hex: string): [number, number, number] {\n const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim())\n if (!m)\n throw new TypeError(`Expected a hex color like '#4355B9', got '${hex}'`)\n const full = m[1].length === 3 ? m[1].replace(/./g, '$&$&') : m[1]\n const n = parseInt(full, 16)\n return [(n >> 16) & 255, (n >> 8) & 255, n & 255]\n}\n\n// Declarations, not arrow consts: `reference` above runs these at import time\nfunction toLinear(v: number) {\n v /= 255\n return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4\n}\n\nfunction fromLinear(v: number) {\n return v <= 0.0031308 ? v * 12.92 : 1.055 * v ** (1 / 2.4) - 0.055\n}\n\nfunction toOklab([r8, g8, b8]: number[]): [number, number, number] {\n const r = toLinear(r8)\n const g = toLinear(g8)\n const b = toLinear(b8)\n const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b)\n const m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b)\n const s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b)\n return [\n 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,\n 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,\n 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,\n ]\n}\n\nfunction toOklch(rgb: number[]): Lch {\n const [l, a, b] = toOklab(rgb)\n return { l, c: Math.hypot(a, b), h: hueOf(a, b) }\n}\n\n/** Linear sRGB for an OKLCH color; may fall outside 0–1 if out of gamut. */\nfunction oklchToLinear(L: number, C: number, H: number) {\n const a = C * Math.cos((H * Math.PI) / 180)\n const b = C * Math.sin((H * Math.PI) / 180)\n const l = (L + 0.3963377774 * a + 0.2158037573 * b) ** 3\n const m = (L - 0.1055613458 * a - 0.0638541728 * b) ** 3\n const s = (L - 0.0894841775 * a - 1.291485548 * b) ** 3\n return [\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\n -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s,\n ]\n}\n\nfunction inGamut(rgb: number[]) {\n return rgb.every((v) => v >= -1e-4 && v <= 1 + 1e-4)\n}\n\n/** Hex for an OKLCH color, lowering chroma until it fits in sRGB. */\nfunction toHex(L: number, C: number, H: number): string {\n L = Math.min(Math.max(L, 0), 1)\n let rgb = oklchToLinear(L, C, H)\n if (!inGamut(rgb)) {\n let lo = 0\n let hi = C\n for (let i = 0; i < 20; i++) {\n const mid = (lo + hi) / 2\n if (inGamut(oklchToLinear(L, mid, H))) lo = mid\n else hi = mid\n }\n rgb = oklchToLinear(L, lo, H)\n }\n return (\n '#' +\n rgb\n .map((v) =>\n Math.round(Math.min(Math.max(fromLinear(v), 0), 1) * 255)\n .toString(16)\n .padStart(2, '0')\n )\n .join('')\n .toUpperCase()\n )\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\n/** A black-and-white light theme. Pass as `<AnvilRoot lightTheme={monochromeLightTheme}>`. */\nexport const monochromeLightTheme: Theme = {\n ...baseLightTheme,\n background: '#FFFFFF',\n onBackground: '#111111',\n onBackgroundMuted: '#5E5E5E',\n container: '#EEEEEE',\n onContainer: '#111111',\n surface: '#F6F6F6',\n onSurface: '#474747',\n outline: '#C8C8C8',\n divider: '#E4E4E4',\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\n/** A black-and-white dark theme. Pass as `<AnvilRoot darkTheme={monochromeDarkTheme}>`. */\nexport const monochromeDarkTheme: Theme = {\n ...baseDarkTheme,\n background: '#0F0F0F',\n onBackground: '#E8E8E8',\n onBackgroundMuted: '#B4B4B4',\n container: '#2A2A2A',\n onContainer: '#E8E8E8',\n surface: '#1A1A1A',\n onSurface: '#E8E8E8',\n outline: '#8E8E8E',\n divider: '#3A3A3A',\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 Dispatch,\n ReactNode,\n SetStateAction,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n useSyncExternalStore,\n} from 'react'\nimport { Toast } from '@base-ui/react/toast'\nimport { Tooltip } from '@base-ui/react/tooltip'\nimport { SnackbarViewport } from '../Snackbar/Snackbar'\nimport { AnvilContext, ColorModeSetting, 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 { cx } from '../../utils'\nimport { devError } from '../../dev'\nimport '../../colors/colors.css'\nimport './global.css'\n\nexport type AnvilRootProps = {\n /** Your app. Every AnvilUI component must be somewhere inside. */\n children: ReactNode\n /** Extra classes for the root element, e.g. to make it fill the viewport. */\n className?: string\n /** Controlled color mode. Pair with `onColorModeChange`. */\n colorMode?: ColorModeSetting\n /**\n * Starting color mode when `colorMode` isn't controlled and nothing is\n * saved under `storageKey`. `'system'` follows the OS setting live.\n * @default 'system'\n */\n defaultColorMode?: ColorModeSetting\n /** Called whenever the color mode is changed. */\n onColorModeChange?: (colorMode: ColorModeSetting) => void\n /**\n * When set, the color mode is saved in `localStorage` under this key and\n * restored on the next visit. With server rendering, a small inline script\n * applies it before the first paint, so there's no flash (a strict CSP\n * must allow inline scripts for that).\n */\n storageKey?: string\n /** Colors used in light mode. @default baseLightTheme */\n lightTheme?: Theme\n /** Colors used in dark mode. @default baseDarkTheme */\n darkTheme?: Theme\n /**\n * Spacing, radius, font, motion and shadow tokens. Categories you pass\n * replace the base ones; the rest keep their defaults.\n * @default baseDesignTokens\n */\n tokens?: Partial<DesignTokens>\n}\n\nconst isSetting = (v: unknown): v is ColorModeSetting =>\n v === 'light' || v === 'dark' || v === 'system'\n\nfunction readStored(key: string): ColorModeSetting | undefined {\n try {\n const stored = localStorage.getItem(key)\n if (isSetting(stored)) return stored\n } catch {\n // Storage can be blocked (private mode, disabled cookies)\n }\n}\n\nconst darkQuery = '(prefers-color-scheme: dark)'\n\nfunction subscribeToOs(onChange: () => void) {\n const query = matchMedia(darkQuery)\n query.addEventListener('change', onChange)\n return () => query.removeEventListener('change', onChange)\n}\n\nconst getOsMode = (): ColorType =>\n matchMedia(darkQuery).matches ? 'dark' : 'light'\n\nconst declarations = (vars: Record<string, string>) =>\n Object.entries(vars)\n .map(([name, value]) => `${name}:${value};`)\n .join('')\n\n/**\n * Required at the top of the app. Provides the theme, color mode, tooltip\n * and snackbar providers, and the element that menus, dialogs and other\n * popups portal into. Also import `'anvilui/styles.css'` once.\n *\n * Only the root's own box is themed; to color the whole page, make it fill\n * the viewport via `className`.\n *\n * @example\n * import { AnvilRoot } from 'anvilui'\n * import 'anvilui/styles.css'\n *\n * <AnvilRoot defaultColorMode=\"system\" storageKey=\"color-mode\">\n * <App />\n * </AnvilRoot>\n */\nexport function AnvilRoot(props: AnvilRootProps) {\n // Server and first client render agree on this; the saved value is\n // applied right after (and before paint by the inline script on SSR)\n const [internalSetting, setInternalSetting] = useState<ColorModeSetting>(\n props.defaultColorMode ?? 'system'\n )\n const setting = props.colorMode ?? internalSetting\n const osMode = useSyncExternalStore<ColorType>(\n subscribeToOs,\n getOsMode,\n () => 'light'\n )\n const colorMode: ColorType = setting === 'system' ? osMode : setting\n\n // Function updates resolve against this, so two calls in one tick both apply\n const latestSetting = useRef(setting)\n latestSetting.current = setting\n\n useLayoutEffect(() => {\n if (!props.storageKey) return\n const stored = readStored(props.storageKey)\n if (stored) {\n latestSetting.current = stored\n setInternalSetting(stored)\n }\n }, [props.storageKey])\n\n const setColorMode: Dispatch<SetStateAction<ColorModeSetting>> = (next) => {\n const value =\n typeof next === 'function' ? next(latestSetting.current) : next\n latestSetting.current = value\n setInternalSetting(value)\n props.onColorModeChange?.(value)\n if (props.storageKey) {\n try {\n localStorage.setItem(props.storageKey, value)\n } catch {\n // Not being able to remember the mode is not worth surfacing\n }\n }\n }\n\n const tokens: DesignTokens = { ...baseDesignTokens, ...props.tokens }\n const lightTheme = props.lightTheme || baseLightTheme\n const darkTheme = props.darkTheme || baseDarkTheme\n const rootRef = useRef<HTMLDivElement>(null)\n\n useEffect(() => {\n if (process.env.NODE_ENV === 'production') return\n // Late enough for a stylesheet <link> to have loaded\n const timer = setTimeout(() => {\n const root = rootRef.current\n if (!root) return\n const loaded = getComputedStyle(root)\n .getPropertyValue('--avl-styles-loaded')\n .trim()\n if (!loaded)\n devError(\n \"The AnvilUI stylesheet isn't loaded, so components show unstyled.\",\n \"// once, in your entry file (main.tsx, app/layout.tsx, ...)\\nimport 'anvilui/styles.css'\",\n 'setup.md'\n )\n }, 1000)\n return () => clearTimeout(timer)\n }, [])\n\n // The colors live in CSS, not inline styles, so the right mode shows\n // before any JavaScript runs: `system` resolves through a media query,\n // and a saved mode is set on data-color-mode by the inline script below\n const id = useId()\n const root = `[data-avl-root=\"${id}\"]`\n const light = `color-scheme:light;${declarations(themeToCssVariables(lightTheme))}`\n const dark = `color-scheme:dark;${declarations(themeToCssVariables(darkTheme))}`\n const css =\n `${root}{${declarations(tokensToCssVariables(tokens))}${light}}` +\n `${root}[data-color-mode=\"dark\"]{${dark}}` +\n `@media ${darkQuery}{${root}[data-color-mode=\"system\"]{${dark}}}`\n\n const restoreScript =\n props.storageKey && props.colorMode === undefined\n ? `try{var m=localStorage.getItem(${JSON.stringify(props.storageKey)});` +\n `if(m==='light'||m==='dark'||m==='system')document.currentScript.parentElement.dataset.colorMode=m}catch(e){}`\n : undefined\n\n return (\n <AnvilContext\n value={{\n colorMode,\n colorModeSetting: setting,\n setColorMode,\n tokens,\n lightTheme,\n darkTheme,\n rootRef,\n }}\n >\n <div\n ref={rootRef}\n className={cx('avl-root', props.className)}\n data-avl-root={id}\n data-color-mode={setting}\n // The inline script may change data-color-mode before hydration\n suppressHydrationWarning\n >\n {restoreScript && (\n <script\n // Only server HTML needs it to run; on the client a\n // non-JS type keeps React from warning about it\n type={\n typeof window === 'undefined'\n ? undefined\n : 'text/plain'\n }\n suppressHydrationWarning\n dangerouslySetInnerHTML={{ __html: restoreScript }}\n />\n )}\n <style>{css}</style>\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, shadow and scrim roles are optional; themes without them get the page's\n // colors swapped, so existing themes keep working\n const filled: Theme = {\n inverseSurface: theme.onBackground,\n inverseOnSurface: theme.background,\n inversePrimary: `color-mix(in srgb, ${theme.primary} 55%, ${theme.background})`,\n shadow: 'rgb(0 0 0 / 0.3)',\n scrim: 'rgb(0 0 0 / 0.4)',\n ...theme,\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 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 }\n }\n\n return cssVars\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAMO;;;ACHA,SAAS,MAAM,OAA8C;AAChE,SAAO,MAAM,OAAO,OAAO,EAAE,KAAK,GAAG;AACzC;AAIO,SAAS,UACZ,MACA,WACF;AACE,SAAO,CAAC,UACJ,GAAG,MAAM,OAAO,cAAc,aAAa,UAAU,KAAK,IAAI,SAAS;AAC/E;AAKO,SAAS,kBAAoC,OAAU;AAC1D,QA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AAQ,UAAR,EAEG,yDAAC,oBAAM,UAAN,EAAe,OAAO,GAClB;AAAA,oBAAM;AAAA,cACP,8CAAC,oBAAiB;AAAA,eACtB,GACJ;AAAA;AAAA;AAAA,MACJ;AAAA;AAAA,EACJ;AAER;","names":["Toggle","import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","BaseAvatar","import_react","import_jsx_runtime","import_jsx_runtime","count","import_react","import_jsx_runtime","import_react","import_jsx_runtime","BaseButton","import_jsx_runtime","import_react","import_jsx_runtime","import_button","import_react","import_jsx_runtime","BaseButton","import_react","import_button","import_react","import_jsx_runtime","BaseButton","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_button","import_jsx_runtime","BaseButton","import_jsx_runtime","BaseCheckbox","import_react","import_react","morph","import_jsx_runtime","morph","BaseDialog","import_react","count","import_react","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_button","import_react","import_jsx_runtime","BaseButton","import_react","import_jsx_runtime","BaseMenu","import_jsx_runtime","BaseField","import_react","import_jsx_runtime","BaseInput","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_menu","import_jsx_runtime","BaseMenu","import_jsx_runtime","BaseMenubar","import_jsx_runtime","BaseAccordion","import_jsx_runtime","BaseContextMenu","import_react","import_jsx_runtime","morph","BasePopover","import_react","import_jsx_runtime","BasePreviewCard","import_jsx_runtime","morph","BaseProgress","import_react","import_toggle","import_jsx_runtime","BaseToggleGroup","BaseRadioGroup","BaseToggle","BaseRadio","import_radio","import_radio_group","import_jsx_runtime","BaseRadioGroup","BaseRadio","import_react","import_jsx_runtime","BaseSelect","import_react","import_jsx_runtime","pad","digits","import_react","import_input","import_jsx_runtime","BaseInput","iso","import_react","import_jsx_runtime","BaseCombobox","import_react","import_jsx_runtime","BaseOTPField","import_toggle","import_jsx_runtime","Toggle","BaseToggle","import_react","import_jsx_runtime","BaseAutocomplete","import_jsx_runtime","import_jsx_runtime","morph","BaseSlider","import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","BaseSwitch","import_jsx_runtime","import_jsx_runtime","BaseTabs","import_input","import_jsx_runtime","BaseInput","import_jsx_runtime","BaseToolbar","import_react","import_tooltip","import_jsx_runtime","BaseTooltip","import_use_render","import_merge_props","import_jsx_runtime","import_react","import_use_render","import_merge_props","import_jsx_runtime","import_use_render","import_merge_props","import_jsx_runtime","import_react","import_drawer","import_jsx_runtime","C","import_react","import_toast","import_tooltip","import_jsx_runtime","root"]}
|