@gryt/ui 0.4.0 → 0.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/theme/createGrytTheme.ts","../src/GrytProvider.tsx","../src/components/utils/cn.ts","../src/components/Button/Button.tsx","../src/components/utils/styles.ts","../src/components/IconButton/IconButton.tsx","../src/components/Surface/Surface.tsx","../src/components/MessageBubble/MessageBubble.tsx","../src/components/TextField/TextField.tsx","../src/components/Composer/Composer.tsx","../src/components/Avatar/Avatar.tsx","../src/components/ConversationItem/ConversationItem.tsx","../src/components/Badge/Badge.tsx","../src/components/Chip/Chip.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Radio/Radio.tsx","../src/components/Switch/Switch.tsx","../src/components/Slider/Slider.tsx","../src/components/Select/Select.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Divider/Divider.tsx","../src/components/Card/Card.tsx","../src/components/Alert/Alert.tsx","../src/components/Progress/Progress.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Dialog/Dialog.tsx","../src/components/utils/useMediaQuery.ts","../src/components/Drawer/Drawer.tsx","../src/components/Menu/Menu.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Accordion/Accordion.tsx","../src/components/ContextMenu/ContextMenu.tsx","../src/components/Popover/Popover.tsx","../src/components/Toast/Toast.tsx","../src/components/ScrollArea/ScrollArea.tsx","../src/components/Toggle/Toggle.tsx","../src/components/Meter/Meter.tsx","../src/components/AlertDialog/AlertDialog.tsx","../src/components/Combobox/Combobox.tsx","../src/components/Autocomplete/Autocomplete.tsx","../src/components/Checkbox/CheckboxGroup.tsx","../src/components/Collapsible/Collapsible.tsx","../src/components/Form/Form.tsx","../src/components/NavigationMenu/NavigationMenu.tsx","../src/components/NumberField/NumberField.tsx","../src/components/OtpField/OtpField.tsx","../src/components/PreviewCard/PreviewCard.tsx","../src/components/Toolbar/Toolbar.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\nexport const grytTokens = {\n color: {\n bg: \"#111318\",\n surface: \"#1a1d24\",\n surfaceRaised: \"#1e2028\",\n surfaceHover: \"#334155\",\n border: \"#2b303d\",\n text: \"#e0e0e6\",\n muted: \"#888888\",\n accent: \"#968FF8\",\n accentLight: \"#b4afff\",\n secondary: \"#7dd3fc\",\n secondaryLight: \"#bae6fd\",\n success: \"#4ade80\",\n danger: \"#f87171\",\n dangerLight: \"#fca5a5\",\n warning: \"#fbbf24\",\n onAccent: \"#141126\",\n onSecondary: \"#07131c\",\n onDanger: \"#250b0b\"\n },\n radius: {\n sm: 8,\n md: 12,\n lg: 20,\n xl: 28,\n full: 999\n }\n} as const;\n\nexport type GrytTokens = typeof grytTokens;\n\n// Widened off the `as const` token types on purpose. Partial<GrytTokens> would\n// inherit the literal types, so an override could only ever be re-assigned its\n// own current value.\nexport interface GrytThemeOptions {\n color?: Partial<Record<keyof GrytTokens[\"color\"], string>>;\n radius?: Partial<Record<keyof GrytTokens[\"radius\"], number>>;\n}\n\n// This used to return a MUI theme object. There is no theme object now — the\n// components read CSS custom properties, so a theme is the set of variables to\n// put on an element. Returning CSSProperties means it drops straight into a\n// style prop, and overriding one token does not require reproducing the rest.\nexport function createGrytTheme(options: GrytThemeOptions = {}): CSSProperties {\n const color = { ...grytTokens.color, ...options.color };\n const radius = { ...grytTokens.radius, ...options.radius };\n\n return {\n \"--gryt-bg\": color.bg,\n \"--gryt-surface\": color.surface,\n \"--gryt-surface-raised\": color.surfaceRaised,\n \"--gryt-surface-hover\": color.surfaceHover,\n \"--gryt-border\": color.border,\n \"--gryt-text\": color.text,\n \"--gryt-muted\": color.muted,\n \"--gryt-accent\": color.accent,\n \"--gryt-accent-light\": color.accentLight,\n \"--gryt-secondary\": color.secondary,\n \"--gryt-secondary-light\": color.secondaryLight,\n \"--gryt-success\": color.success,\n \"--gryt-danger\": color.danger,\n \"--gryt-danger-light\": color.dangerLight,\n \"--gryt-warning\": color.warning,\n \"--gryt-on-accent\": color.onAccent,\n \"--gryt-on-secondary\": color.onSecondary,\n \"--gryt-on-danger\": color.onDanger,\n\n // Tailwind's @theme emits --color-* names, and the utilities compile\n // against those. Both sets have to move together or an override would\n // change the raw var but not bg-gryt-accent.\n \"--color-gryt-bg\": color.bg,\n \"--color-gryt-surface\": color.surface,\n \"--color-gryt-surface-raised\": color.surfaceRaised,\n \"--color-gryt-surface-hover\": color.surfaceHover,\n \"--color-gryt-border\": color.border,\n \"--color-gryt-text\": color.text,\n \"--color-gryt-muted\": color.muted,\n \"--color-gryt-accent\": color.accent,\n \"--color-gryt-accent-light\": color.accentLight,\n \"--color-gryt-secondary\": color.secondary,\n \"--color-gryt-secondary-light\": color.secondaryLight,\n \"--color-gryt-success\": color.success,\n \"--color-gryt-danger\": color.danger,\n \"--color-gryt-danger-light\": color.dangerLight,\n \"--color-gryt-warning\": color.warning,\n \"--color-gryt-on-accent\": color.onAccent,\n \"--color-gryt-on-secondary\": color.onSecondary,\n \"--color-gryt-on-danger\": color.onDanger,\n\n \"--gryt-radius-sm\": `${radius.sm}px`,\n \"--gryt-radius-md\": `${radius.md}px`,\n \"--gryt-radius-lg\": `${radius.lg}px`,\n \"--gryt-radius-xl\": `${radius.xl}px`,\n \"--gryt-radius-full\": `${radius.full}px`\n } as CSSProperties;\n}\n","import { Tooltip } from \"@base-ui/react/tooltip\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { createGrytTheme } from \"./theme/createGrytTheme\";\nimport type { GrytThemeOptions } from \"./theme/createGrytTheme\";\n\nexport interface GrytProviderProps {\n children: ReactNode;\n // Either the object from createGrytTheme, or the options to build one from.\n theme?: CSSProperties | GrytThemeOptions;\n className?: string;\n // Shared hover delay for every Tooltip below this provider, in milliseconds.\n tooltipDelay?: number;\n}\n\nfunction isCssVariables(value: object): value is CSSProperties {\n return Object.keys(value).some((key) => key.startsWith(\"--\"));\n}\n\n// There is no ThemeProvider and no CssBaseline any more. What a provider still\n// has to do is put the theme variables somewhere the components can read them,\n// and mount Base UI's tooltip provider so hover timing is shared between\n// triggers rather than restarting at every one.\nexport function GrytProvider({\n children,\n className,\n theme,\n tooltipDelay = 400\n}: GrytProviderProps) {\n const style =\n theme && isCssVariables(theme) ? theme : createGrytTheme(theme ?? {});\n\n return (\n <div className={className} style={style}>\n <Tooltip.Provider delay={tooltipDelay}>{children}</Tooltip.Provider>\n </div>\n );\n}\n","import { clsx } from \"clsx\";\nimport type { ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","import { Button as BaseButton } from \"@base-ui/react/button\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\ntype ButtonTone = \"primary\" | \"secondary\" | \"neutral\" | \"danger\" | \"ghost\";\ntype ButtonSize = \"xsmall\" | \"small\" | \"medium\" | \"large\";\n\n// Base UI marks a disabled button with data-disabled rather than the native\n// attribute, because it stays focusable when disabled. Hover and press styles\n// hang off not-data-disabled so they don't fire on a dead button.\nconst toneStyles: Record<ButtonTone, string> = {\n primary:\n \"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light\",\n secondary:\n \"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light\",\n neutral:\n \"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover\",\n danger:\n \"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light\",\n ghost:\n \"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text\"\n};\n\nconst sizeStyles: Record<ButtonSize, string> = {\n xsmall: \"min-h-8 px-3 text-xs\",\n small: \"min-h-9 px-4 text-sm\",\n medium: \"min-h-10 px-5 text-sm\",\n large: \"min-h-12 px-6 text-base\"\n};\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseButton>, \"className\"> {\n tone?: ButtonTone;\n size?: ButtonSize;\n className?: string;\n // Carried over from the MUI-based Button. Base UI has no equivalent, but\n // dropping them would break every existing call site for no gain — the flex\n // gap below already spaces them correctly.\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n children,\n className,\n endIcon,\n size = \"medium\",\n startIcon,\n tone = \"primary\",\n ...props\n },\n ref\n ) {\n return (\n <BaseButton\n ref={ref}\n className={cn(\n \"gryt-button\",\n \"inline-flex items-center justify-center gap-2 border-0 shadow-none\",\n \"rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none\",\n // scale, not transform: Tailwind v4's scale-* utilities set the\n // standalone `scale` property, so transitioning `transform` alone\n // leaves the hover grow snapping instantly.\n \"transition-[scale,background-color,color]\",\n \"duration-(--gryt-dur-spring) ease-spring\",\n\n // Press travels further than hover, so the button reads as being\n // pushed down rather than just acknowledging the cursor.\n \"motion-safe:hover:not-data-disabled:scale-[1.03]\",\n \"motion-safe:active:not-data-disabled:scale-[0.96]\",\n\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n >\n {startIcon}\n {children}\n {endIcon}\n </BaseButton>\n );\n }\n);\n","// Shared class fragments. These exist so that \"flat, Gryt palette\" is decided\n// once rather than 24 times, and so a change to the focus ring or the popup\n// surface lands everywhere at once.\n\nexport const focusRing =\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\";\n\n// Every floating surface: menu, select list, tooltip, dialog, drawer. Flat —\n// a border rather than a shadow.\nexport const popupSurface =\n \"rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text\";\n\n// Base UI sets data-starting-style and data-ending-style for one frame either\n// side of open and close. The element carries the transition itself.\nexport const popupMotion = [\n // scale and translate are named explicitly because Tailwind v4 sets them as\n // standalone CSS properties rather than folding them into `transform`, so\n // transitioning `transform` would leave the popup snapping into place.\n \"transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\"\n].join(\" \");\n\nexport const disabledState =\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\";\n\n// The tones shared by Checkbox, Radio, Switch and Slider. One union so a\n// component cannot invent its own sixth colour. Button and IconButton keep\n// their own lists, because \"ghost\" only makes sense on a button.\nexport type Tone =\n | \"primary\"\n | \"secondary\"\n | \"neutral\"\n | \"danger\"\n | \"success\"\n | \"warning\";\n\nexport const toneAccent: Record<Tone, string> = {\n primary: \"text-gryt-accent\",\n secondary: \"text-gryt-secondary\",\n neutral: \"text-gryt-muted\",\n danger: \"text-gryt-danger\",\n success: \"text-gryt-success\",\n warning: \"text-gryt-warning\"\n};\n\n// Filled backgrounds, for the checked state of a control.\nexport const toneFill: Record<Tone, string> = {\n primary: \"bg-gryt-accent text-gryt-on-accent\",\n secondary: \"bg-gryt-secondary text-gryt-on-secondary\",\n neutral: \"bg-gryt-surface-hover text-gryt-text\",\n danger: \"bg-gryt-danger text-gryt-on-danger\",\n success: \"bg-gryt-success text-gryt-on-accent\",\n warning: \"bg-gryt-warning text-gryt-on-accent\"\n};\n\nexport const toneBorder: Record<Tone, string> = {\n primary: \"border-gryt-accent\",\n secondary: \"border-gryt-secondary\",\n neutral: \"border-gryt-border\",\n danger: \"border-gryt-danger\",\n success: \"border-gryt-success\",\n warning: \"border-gryt-warning\"\n};\n\n// Written out in full rather than composed from toneFill at runtime. Tailwind\n// scans source text for class names, so a class built by interpolation exists\n// on the element and nowhere in the stylesheet.\nexport const toneCheckedFill: Record<Tone, string> = {\n primary: \"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent\",\n secondary:\n \"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary\",\n neutral: \"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text\",\n danger: \"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger\",\n success: \"data-checked:bg-gryt-success data-checked:text-gryt-on-accent\",\n warning: \"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent\"\n};\n\n// Track fill for Switch, and bar fill for Slider.\nexport const toneBg: Record<Tone, string> = {\n primary: \"bg-gryt-accent\",\n secondary: \"bg-gryt-secondary\",\n neutral: \"bg-gryt-surface-hover\",\n danger: \"bg-gryt-danger\",\n success: \"bg-gryt-success\",\n warning: \"bg-gryt-warning\"\n};\n\nexport const toneCheckedBorder: Record<Tone, string> = {\n primary: \"data-checked:border-gryt-accent\",\n secondary: \"data-checked:border-gryt-secondary\",\n neutral: \"data-checked:border-gryt-muted\",\n danger: \"data-checked:border-gryt-danger\",\n success: \"data-checked:border-gryt-success\",\n warning: \"data-checked:border-gryt-warning\"\n};\n\nexport const toneCheckedBg: Record<Tone, string> = {\n primary: \"data-checked:bg-gryt-accent\",\n secondary: \"data-checked:bg-gryt-secondary\",\n neutral: \"data-checked:bg-gryt-surface-hover\",\n danger: \"data-checked:bg-gryt-danger\",\n success: \"data-checked:bg-gryt-success\",\n warning: \"data-checked:bg-gryt-warning\"\n};\n","import { Button as BaseButton } from \"@base-ui/react/button\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing } from \"../utils/styles\";\n\ntype IconButtonTone = \"primary\" | \"secondary\" | \"neutral\" | \"danger\" | \"ghost\";\ntype IconButtonSize = \"xsmall\" | \"small\" | \"medium\" | \"large\";\n\n// The hover fills are the tone colour at low alpha, so an icon button reads as\n// a tinted target rather than a filled one.\nconst toneStyles: Record<IconButtonTone, string> = {\n primary: \"text-gryt-accent hover:not-data-disabled:bg-gryt-accent/10\",\n secondary:\n \"text-gryt-secondary hover:not-data-disabled:bg-gryt-secondary/10\",\n neutral:\n \"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text\",\n danger: \"text-gryt-danger hover:not-data-disabled:bg-gryt-danger/10\",\n ghost:\n \"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text\"\n};\n\nconst sizeStyles: Record<IconButtonSize, string> = {\n xsmall: \"h-8 w-8\",\n small: \"h-9 w-9\",\n medium: \"h-10 w-10\",\n large: \"h-12 w-12\"\n};\n\nexport interface IconButtonProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseButton>, \"className\"> {\n tone?: IconButtonTone;\n size?: IconButtonSize;\n className?: string;\n}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton(\n { className, size = \"medium\", tone = \"neutral\", ...props },\n ref\n ) {\n return (\n <BaseButton\n ref={ref}\n className={cn(\n \"gryt-icon-button\",\n \"inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0\",\n \"rounded-(--gryt-radius-full) select-none\",\n // scale rather than transform — see the note in Button.\n \"transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:not-data-disabled:scale-[1.06]\",\n \"motion-safe:active:not-data-disabled:scale-[0.94]\",\n focusRing,\n disabledState,\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface SurfaceProps extends HTMLAttributes<HTMLDivElement> {\n elevated?: boolean;\n}\n\nexport const Surface = forwardRef<HTMLDivElement, SurfaceProps>(\n function Surface({ className, elevated = false, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text\",\n elevated ? \"bg-gryt-surface-raised\" : \"bg-gryt-surface\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface MessageBubbleProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n from?: \"user\" | \"assistant\" | \"system\";\n}\n\nexport const MessageBubble = forwardRef<HTMLDivElement, MessageBubbleProps>(\n function MessageBubble(\n { children, className, from = \"assistant\", ...props },\n ref\n ) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-message-bubble\",\n from === \"user\" && \"ml-auto bg-gryt-accent text-gryt-on-accent\",\n from === \"assistant\" &&\n \"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text\",\n from === \"system\" &&\n \"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n","import { Field } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type TextFieldSize = \"small\" | \"medium\";\n\nconst sizeStyles: Record<TextFieldSize, string> = {\n small: \"min-h-9 px-3 py-1.5 text-sm\",\n medium: \"min-h-11 px-4 py-2.5 text-sm\"\n};\n\nexport interface TextFieldProps\n extends Omit<\n ComponentPropsWithoutRef<typeof Field.Control>,\n \"className\" | \"size\"\n > {\n label?: ReactNode;\n helperText?: ReactNode;\n error?: boolean;\n size?: TextFieldSize;\n multiline?: boolean;\n minRows?: number;\n className?: string;\n fieldClassName?: string;\n}\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n {\n className,\n error = false,\n fieldClassName,\n helperText,\n label,\n minRows = 3,\n multiline = false,\n size = \"medium\",\n ...props\n },\n ref\n ) {\n const control = (\n <Field.Control\n ref={ref}\n // Field.Control renders an input by default; render swaps the element\n // while keeping the field wiring, which is how label association and\n // aria-describedby survive the switch to a textarea.\n render={multiline ? <textarea rows={minRows} /> : undefined}\n className={cn(\n \"gryt-text-field-control w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised\",\n \"text-gryt-text outline-none placeholder:text-gryt-muted\",\n \"transition-colors duration-150\",\n \"hover:border-gryt-accent-light focus:border-gryt-accent\",\n \"disabled:cursor-not-allowed disabled:opacity-60\",\n multiline && \"resize-y leading-6\",\n error ? \"border-gryt-danger\" : \"border-gryt-border\",\n sizeStyles[size],\n className\n )}\n {...props}\n />\n );\n\n return (\n <Field.Root\n className={cn(\n \"gryt-text-field flex w-full flex-col gap-1.5\",\n fieldClassName\n )}\n >\n {label ? (\n <Field.Label className=\"text-xs font-medium text-gryt-muted\">\n {label}\n </Field.Label>\n ) : null}\n {control}\n {helperText ? (\n <Field.Description\n className={cn(\n \"text-xs\",\n error ? \"text-gryt-danger\" : \"text-gryt-muted\"\n )}\n >\n {helperText}\n </Field.Description>\n ) : null}\n </Field.Root>\n );\n }\n);\n","import { PaperPlaneTilt } from \"@phosphor-icons/react\";\nimport { useCallback, useLayoutEffect, useRef } from \"react\";\nimport type {\n FormEvent,\n FormEventHandler,\n TextareaHTMLAttributes\n} from \"react\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../Button/Button\";\nimport { cn } from \"../utils/cn\";\n\nexport interface ComposerProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, \"onSubmit\"> {\n onSubmit?: FormEventHandler<HTMLFormElement>;\n submitLabel?: string;\n disabled?: boolean;\n minRows?: number;\n maxRows?: number;\n}\n\nexport const Composer = forwardRef<HTMLTextAreaElement, ComposerProps>(\n function Composer(\n {\n className,\n disabled = false,\n maxRows = 8,\n minRows = 1,\n onSubmit,\n placeholder = \"Message Gryt\",\n submitLabel = \"Send\",\n ...props\n },\n ref\n ) {\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n // Replaces MUI's TextareaAutosize. Reset to auto first, otherwise\n // scrollHeight only ever reports the current height and the box can grow\n // but never shrink.\n const resize = useCallback(() => {\n const node = innerRef.current;\n if (!node) {\n return;\n }\n\n const styles = window.getComputedStyle(node);\n const lineHeight = parseFloat(styles.lineHeight) || 24;\n const vertical =\n parseFloat(styles.paddingTop) + parseFloat(styles.paddingBottom);\n\n node.style.height = \"auto\";\n node.style.height = `${Math.min(\n Math.max(node.scrollHeight, lineHeight * minRows + vertical),\n lineHeight * maxRows + vertical\n )}px`;\n }, [maxRows, minRows]);\n\n useLayoutEffect(resize, [resize, props.value]);\n\n function handleSubmit(event: FormEvent<HTMLFormElement>) {\n if (!onSubmit) {\n event.preventDefault();\n return;\n }\n\n onSubmit(event);\n }\n\n return (\n <form className={cn(\"gryt-composer\", className)} onSubmit={handleSubmit}>\n <textarea\n ref={(node) => {\n innerRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n rows={minRows}\n disabled={disabled}\n placeholder={placeholder}\n onInput={resize}\n className=\"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60\"\n {...props}\n />\n <Button\n type=\"submit\"\n disabled={disabled}\n size=\"small\"\n endIcon={<PaperPlaneTilt size={14} weight=\"fill\" />}\n >\n {submitLabel}\n </Button>\n </form>\n );\n }\n);\n","import { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type AvatarSize = \"small\" | \"medium\" | \"large\";\n\nconst sizeStyles: Record<AvatarSize, string> = {\n small: \"h-8 w-8 text-xs\",\n medium: \"h-10 w-10 text-sm\",\n large: \"h-12 w-12 text-base\"\n};\n\nexport interface AvatarProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseAvatar.Root>, \"className\"> {\n src?: string;\n alt?: string;\n size?: AvatarSize;\n className?: string;\n // Shown while the image loads and if it fails. Falls back to children, which\n // is how the old MUI-based Avatar was called: <Avatar>G</Avatar>.\n fallback?: ReactNode;\n}\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { alt, children, className, fallback, size = \"medium\", src, ...props },\n ref\n) {\n return (\n <BaseAvatar.Root\n ref={ref}\n className={cn(\n \"gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none\",\n \"rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border\",\n sizeStyles[size],\n className\n )}\n {...props}\n >\n {src ? (\n <BaseAvatar.Image\n src={src}\n alt={alt}\n className=\"h-full w-full object-cover\"\n />\n ) : null}\n <BaseAvatar.Fallback className=\"flex h-full w-full items-center justify-center\">\n {fallback ?? children}\n </BaseAvatar.Fallback>\n </BaseAvatar.Root>\n );\n});\n","import { Avatar } from \"../Avatar/Avatar\";\nimport type { ButtonHTMLAttributes, ReactNode } from \"react\";\nimport { forwardRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface ConversationItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n title: string;\n subtitle?: string;\n active?: boolean;\n avatar?: ReactNode;\n}\n\nexport const ConversationItem = forwardRef<\n HTMLButtonElement,\n ConversationItemProps\n>(function ConversationItem(\n { active = false, avatar, className, subtitle, title, ...props },\n ref\n) {\n return (\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"gryt-conversation-item\",\n active\n ? \"bg-gryt-accent text-gryt-on-accent\"\n : \"text-gryt-text hover:bg-white/5\",\n className\n )}\n {...props}\n >\n {avatar ?? (\n <Avatar\n size=\"small\"\n className={cn(\n active\n ? \"bg-gryt-on-accent text-gryt-accent ring-transparent\"\n : \"bg-gryt-surface-raised text-gryt-text\"\n )}\n >\n {title.slice(0, 1).toUpperCase()}\n </Avatar>\n )}\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-sm font-semibold\">{title}</span>\n {subtitle ? (\n <span\n className={cn(\n \"block truncate text-xs\",\n active ? \"text-gryt-on-accent/70\" : \"text-gryt-muted\"\n )}\n >\n {subtitle}\n </span>\n ) : null}\n </span>\n </button>\n );\n});\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n // Anchored to the top-right of children. A count, a dot, or anything else.\n badgeContent?: ReactNode;\n // Hide when the count is zero, matching how a notification badge is normally\n // wanted. Set false to keep a literal 0 on screen.\n showZero?: boolean;\n max?: number;\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { badgeContent, children, className, max = 99, showZero = false, ...props },\n ref\n) {\n const numeric = typeof badgeContent === \"number\" ? badgeContent : null;\n const hidden = numeric !== null && numeric === 0 && !showZero;\n const display =\n numeric !== null && numeric > max ? `${max}+` : badgeContent;\n\n return (\n <span\n ref={ref}\n className={cn(\"gryt-badge relative inline-flex\", className)}\n {...props}\n >\n {children}\n {badgeContent !== undefined && !hidden ? (\n <span\n className={cn(\n \"gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center\",\n \"min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5\",\n \"bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent\",\n \"ring-2 ring-gryt-bg\"\n )}\n >\n {display}\n </span>\n ) : null}\n </span>\n );\n});\n","import { X } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type ChipTone =\n | \"neutral\"\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"danger\";\n\nconst toneStyles: Record<ChipTone, string> = {\n neutral: \"border-gryt-border bg-gryt-surface-raised text-gryt-text\",\n primary: \"border-gryt-accent/40 bg-gryt-accent/12 text-gryt-accent\",\n secondary:\n \"border-gryt-secondary/40 bg-gryt-secondary/12 text-gryt-secondary\",\n success: \"border-gryt-success/40 bg-gryt-success/12 text-gryt-success\",\n warning: \"border-gryt-warning/40 bg-gryt-warning/12 text-gryt-warning\",\n danger: \"border-gryt-danger/40 bg-gryt-danger/12 text-gryt-danger\"\n};\n\nexport interface ChipProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"onDelete\"> {\n label?: ReactNode;\n tone?: ChipTone;\n icon?: ReactNode;\n onDelete?: () => void;\n}\n\nexport const Chip = forwardRef<HTMLSpanElement, ChipProps>(function Chip(\n { children, className, icon, label, onDelete, tone = \"neutral\", ...props },\n ref\n) {\n return (\n <span\n ref={ref}\n className={cn(\n \"gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium\",\n toneStyles[tone],\n className\n )}\n {...props}\n >\n {icon}\n {label ?? children}\n {onDelete ? (\n <button\n type=\"button\"\n aria-label=\"Remove\"\n onClick={onDelete}\n className={cn(\n \"-mr-1 inline-flex h-4 w-4 items-center justify-center rounded-(--gryt-radius-full)\",\n \"opacity-70 transition-opacity hover:opacity-100\",\n focusRing\n )}\n >\n <X size={10} weight=\"bold\" aria-hidden=\"true\" />\n </button>\n ) : null}\n </span>\n );\n});\n","import { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { Check } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing, toneCheckedFill } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface CheckboxProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseCheckbox.Root>,\n \"className\"\n > {\n tone?: Tone;\n className?: string;\n}\n\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox({ className, tone = \"primary\", ...props }, ref) {\n return (\n <BaseCheckbox.Root\n ref={ref}\n className={cn(\n \"gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center\",\n \"rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"data-checked:border-transparent\",\n // Same grow-and-press as the buttons, so a control reacts to the\n // cursor before it is clicked rather than only after.\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.08]\",\n \"motion-safe:active:not-data-disabled:scale-[0.92]\",\n focusRing,\n disabledState,\n // Unchecked stays a neutral outline; the tone only paints once checked.\n toneCheckedFill[tone],\n className\n )}\n {...props}\n >\n {/* keepMounted is load-bearing: without it Base UI unmounts the\n indicator whenever the box is unchecked, so data-unchecked never\n applies to anything and there is no element to transition from —\n the tick just appears. Kept in the DOM, it can scale and fade in\n both directions. */}\n <BaseCheckbox.Indicator\n keepMounted\n className={cn(\n \"flex origin-center\",\n \"transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring\",\n // Scaling from 0 rather than from something near 1 is deliberate.\n // The spring's overshoot is a percentage of the travel, so a tick\n // going 0 -> 1 overshoots to 1.12 and visibly springs, while one\n // going 0.95 -> 1 overshoots by 0.006 and does nothing at all.\n \"data-unchecked:scale-0 data-unchecked:opacity-0\",\n \"motion-reduce:transition-none\"\n )}\n >\n <Check size={12} weight=\"bold\" />\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n }\n);\n","import { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport {\n disabledState,\n focusRing,\n toneBg,\n toneCheckedBorder\n} from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface RadioProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseRadio.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n}\n\nexport const Radio = forwardRef<HTMLButtonElement, RadioProps>(function Radio(\n { className, tone = \"primary\", ...props },\n ref\n) {\n return (\n <BaseRadio.Root\n ref={ref}\n className={cn(\n \"gryt-radio flex h-5 w-5 shrink-0 items-center justify-center\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.08]\",\n \"motion-safe:active:not-data-disabled:scale-[0.92]\",\n focusRing,\n disabledState,\n // Border takes the tone when selected; the dot inside carries the fill.\n toneCheckedBorder[tone],\n className\n )}\n {...props}\n >\n {/* keepMounted so there is an element to transition — see Checkbox. */}\n <BaseRadio.Indicator\n keepMounted\n className={cn(\n \"h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)\",\n \"transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring\",\n // From 0, for the same reason as the Checkbox tick — see the note there.\n \"data-unchecked:scale-0 data-unchecked:opacity-0\",\n \"motion-reduce:transition-none\",\n toneBg[tone]\n )}\n />\n </BaseRadio.Root>\n );\n});\n\nexport type RadioGroupProps = ComponentPropsWithoutRef<typeof BaseRadioGroup>;\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup({ className, ...props }, ref) {\n return (\n <BaseRadioGroup\n ref={ref}\n className={cn(\"gryt-radio-group flex flex-col gap-2\", className)}\n {...props}\n />\n );\n }\n);\n","import { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing, toneCheckedBg } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface SwitchProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseSwitch.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(\n function Switch({ className, tone = \"primary\", ...props }, ref) {\n return (\n <BaseSwitch.Root\n ref={ref}\n className={cn(\n \"gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"data-checked:border-transparent\",\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.05]\",\n \"motion-safe:active:not-data-disabled:scale-[0.95]\",\n focusRing,\n disabledState,\n toneCheckedBg[tone],\n className\n )}\n {...props}\n >\n <BaseSwitch.Thumb\n className={cn(\n \"h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text\",\n \"transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-checked:translate-x-4 data-checked:bg-gryt-bg\"\n )}\n />\n </BaseSwitch.Root>\n );\n }\n);\n","import { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, toneBg } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface SliderProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseSlider.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n \"aria-label\"?: string;\n}\n\nexport function Slider({\n className,\n tone = \"primary\",\n \"aria-label\": ariaLabel,\n ...props\n}: SliderProps) {\n return (\n <BaseSlider.Root\n className={cn(\"gryt-slider w-full\", className)}\n {...props}\n >\n <BaseSlider.Control className=\"flex w-full touch-none items-center py-2 select-none\">\n <BaseSlider.Track className=\"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none\">\n <BaseSlider.Indicator\n className={cn(\n \"h-full rounded-(--gryt-radius-full) select-none\",\n toneBg[tone]\n )}\n />\n <BaseSlider.Thumb\n aria-label={ariaLabel}\n className={cn(\n \"h-4 w-4 rounded-(--gryt-radius-full) bg-gryt-text select-none\",\n \"transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"motion-safe:hover:scale-[1.12] motion-safe:active:scale-[0.94]\",\n focusRing\n )}\n />\n </BaseSlider.Track>\n </BaseSlider.Control>\n </BaseSlider.Root>\n );\n}\n","import { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { CaretUpDown, Check } from \"@phosphor-icons/react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\nexport interface SelectOption {\n label: ReactNode;\n value: string | number;\n disabled?: boolean;\n}\n\nexport type SelectSize = \"small\" | \"medium\";\n\nconst sizeStyles: Record<SelectSize, string> = {\n small: \"min-h-9 px-3 text-sm\",\n medium: \"min-h-11 px-4 text-sm\"\n};\n\nexport interface SelectProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseSelect.Root>,\n \"children\" | \"items\"\n > {\n options?: SelectOption[];\n label?: ReactNode;\n placeholder?: string;\n size?: SelectSize;\n className?: string;\n}\n\nexport function Select({\n className,\n label,\n options = [],\n placeholder = \"Select\",\n size = \"medium\",\n ...props\n}: SelectProps) {\n return (\n <BaseSelect.Root items={options} {...props}>\n <div className={cn(\"gryt-select flex w-full flex-col gap-1.5\", className)}>\n {label ? (\n <BaseSelect.Label className=\"text-xs font-medium text-gryt-muted\">\n {label}\n </BaseSelect.Label>\n ) : null}\n <BaseSelect.Trigger\n className={cn(\n \"flex w-full items-center justify-between gap-2\",\n \"rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised\",\n \"text-gryt-text select-none\",\n \"transition-colors duration-150 hover:border-gryt-accent-light\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-60\",\n focusRing,\n sizeStyles[size]\n )}\n >\n <BaseSelect.Value placeholder={placeholder} />\n <BaseSelect.Icon className=\"shrink-0 text-gryt-muted\">\n <CaretUpDown size={16} />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n </div>\n\n <BaseSelect.Portal>\n <BaseSelect.Positioner sideOffset={6} className=\"outline-none\">\n <BaseSelect.Popup\n className={cn(\"min-w-(--anchor-width) p-1\", popupSurface, popupMotion)}\n >\n <BaseSelect.List>\n {options.map((option) => (\n <BaseSelect.Item\n key={String(option.value)}\n value={option.value}\n disabled={option.disabled}\n className={cn(\n \"flex cursor-default items-center justify-between gap-2\",\n \"rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text\",\n \"outline-none select-none data-highlighted:bg-gryt-surface-raised\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\"\n )}\n >\n <BaseSelect.ItemText>{option.label}</BaseSelect.ItemText>\n <BaseSelect.ItemIndicator className=\"text-gryt-accent\">\n <Check size={14} weight=\"bold\" />\n </BaseSelect.ItemIndicator>\n </BaseSelect.Item>\n ))}\n </BaseSelect.List>\n </BaseSelect.Popup>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n </BaseSelect.Root>\n );\n}\n","import { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion } from \"../utils/styles\";\n\nexport interface TooltipProps {\n // Kept as a single-child wrapper rather than exposing Base UI's five parts.\n // Both MUI and Radix Themes spell a tooltip this way, so client call sites\n // move across unchanged, and a tooltip has no useful middle ground to\n // compose anyway.\n title: ReactNode;\n children: ReactElement;\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n sideOffset?: number;\n className?: string;\n}\n\n// Hover delay is not set here — it belongs to Tooltip.Provider, which shares\n// timing across every tooltip so moving between two triggers does not restart\n// the wait. GrytProvider renders one; see its tooltipDelay prop.\nexport function Tooltip({\n children,\n className,\n side = \"top\",\n sideOffset = 8,\n title\n}: TooltipProps) {\n return (\n <BaseTooltip.Root>\n <BaseTooltip.Trigger render={children} />\n <BaseTooltip.Portal>\n <BaseTooltip.Positioner side={side} sideOffset={sideOffset}>\n <BaseTooltip.Popup\n className={cn(\n \"gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised\",\n \"px-2.5 py-1.5 text-xs text-gryt-text\",\n popupMotion,\n className\n )}\n >\n {title}\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n </BaseTooltip.Portal>\n </BaseTooltip.Root>\n );\n}\n\n// Base UI shares hover timing across tooltips through this provider, so moving\n// between two triggers skips the delay the second time. GrytProvider renders\n// one already; this is exported for apps that do not use GrytProvider.\nexport const TooltipProvider = BaseTooltip.Provider;\n","import { Separator } from \"@base-ui/react/separator\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface DividerProps\n extends Omit<ComponentPropsWithoutRef<typeof Separator>, \"className\"> {\n className?: string;\n}\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(\n function Divider({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <Separator\n ref={ref}\n orientation={orientation}\n className={cn(\n \"gryt-divider bg-gryt-border\",\n orientation === \"vertical\" ? \"h-full w-px\" : \"h-px w-full\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type CardProps = HTMLAttributes<HTMLDivElement>;\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, ...props },\n ref\n) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport interface CardHeaderProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n title?: ReactNode;\n subheader?: ReactNode;\n}\n\nexport function CardHeader({\n children,\n className,\n subheader,\n title,\n ...props\n}: CardHeaderProps) {\n return (\n <div\n className={cn(\"gryt-card-header flex flex-col gap-1 p-4\", className)}\n {...props}\n >\n {title ? (\n <span className=\"text-base font-semibold text-gryt-text\">{title}</span>\n ) : null}\n {subheader ? (\n <span className=\"text-sm text-gryt-muted\">{subheader}</span>\n ) : null}\n {children}\n </div>\n );\n}\n\nexport function CardContent({\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n \"gryt-card-content px-4 pb-4 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport function CardActions({\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n \"gryt-card-actions flex items-center gap-2 px-4 pb-4\",\n className\n )}\n {...props}\n />\n );\n}\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type AlertSeverity = \"info\" | \"success\" | \"warning\" | \"error\";\n\n// Tinted background at low alpha with a matching border, rather than a solid\n// fill — an alert should read as a note on the surface, not a block on top of\n// it.\nconst severityStyles: Record<AlertSeverity, string> = {\n info: \"border-gryt-secondary/40 bg-gryt-secondary/10 text-gryt-secondary\",\n success: \"border-gryt-success/40 bg-gryt-success/10 text-gryt-success\",\n warning: \"border-gryt-warning/40 bg-gryt-warning/10 text-gryt-warning\",\n error: \"border-gryt-danger/40 bg-gryt-danger/10 text-gryt-danger\"\n};\n\nexport interface AlertProps extends HTMLAttributes<HTMLDivElement> {\n severity?: AlertSeverity;\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { className, severity = \"info\", ...props },\n ref\n) {\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(\n \"gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm\",\n severityStyles[severity],\n className\n )}\n {...props}\n />\n );\n});\n","import { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport { CircleNotch } from \"@phosphor-icons/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface ProgressProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseProgress.Root>,\n \"className\" | \"value\"\n > {\n className?: string;\n // Optional, unlike Base UI's own prop: omitting it gives an indeterminate\n // bar, which is the common case when there is no measurable total.\n value?: number | null;\n}\n\nexport function Progress({ className, value = null, ...props }: ProgressProps) {\n return (\n <BaseProgress.Root\n // null is Base UI's indeterminate, so the default has to be null rather\n // than undefined — undefined is not assignable to its value prop.\n value={value}\n className={cn(\"gryt-progress w-full\", className)}\n {...props}\n >\n <BaseProgress.Track className=\"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised\">\n <BaseProgress.Indicator className=\"h-full rounded-(--gryt-radius-full) bg-gryt-accent transition-[width] duration-(--gryt-dur-spring-soft) ease-spring motion-reduce:transition-none\" />\n </BaseProgress.Track>\n </BaseProgress.Root>\n );\n}\n\nexport interface SpinnerProps {\n size?: number;\n className?: string;\n \"aria-label\"?: string;\n}\n\n// Base UI has no spinner — an indeterminate circular indicator is animation\n// rather than behaviour. Phosphor's CircleNotch is the shape, and the spin is\n// a Tailwind utility.\nexport function Spinner({\n className,\n size = 24,\n \"aria-label\": ariaLabel = \"Loading\"\n}: SpinnerProps) {\n return (\n <CircleNotch\n role=\"status\"\n aria-label={ariaLabel}\n size={size}\n weight=\"bold\"\n className={cn(\n \"gryt-spinner text-gryt-accent motion-safe:animate-spin\",\n className\n )}\n />\n );\n}\n","import type { CSSProperties, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type SkeletonVariant = \"text\" | \"rounded\" | \"circular\" | \"rectangular\";\n\nconst variantStyles: Record<SkeletonVariant, string> = {\n text: \"h-4 rounded-(--gryt-radius-sm)\",\n rounded: \"rounded-(--gryt-radius-lg)\",\n circular: \"rounded-(--gryt-radius-full)\",\n rectangular: \"rounded-none\"\n};\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n variant?: SkeletonVariant;\n width?: number | string;\n height?: number | string;\n}\n\nexport function Skeleton({\n className,\n height,\n style,\n variant = \"text\",\n width,\n ...props\n}: SkeletonProps) {\n const sizing: CSSProperties = {\n width,\n height,\n ...style\n };\n\n return (\n <div\n aria-hidden=\"true\"\n className={cn(\n \"gryt-skeleton bg-gryt-surface-raised motion-safe:animate-pulse\",\n variantStyles[variant],\n className\n )}\n style={sizing}\n {...props}\n />\n );\n}\n","import { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\n// Base UI drives enter and exit animation through data-starting-style and\n// data-ending-style, which it sets for one frame either side of the transition.\n// The element has to carry the transition itself; there is no JS timing.\nconst motion =\n \"transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\";\n\nexport type DialogBackdropProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Backdrop\n>;\n\nconst Backdrop = forwardRef<HTMLDivElement, DialogBackdropProps>(\n function DialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n motion,\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogPopupProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Popup\n>;\n\nconst Popup = forwardRef<HTMLDivElement, DialogPopupProps>(\n function DialogPopup({ className, ...props }, ref) {\n return (\n <BaseDialog.Popup\n ref={ref}\n className={cn(\n \"gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\",\n \"flex w-96 max-w-[calc(100vw-3rem)] flex-col gap-4\",\n \"rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text\",\n motion,\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogTitleProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Title\n>;\n\nconst Title = forwardRef<HTMLHeadingElement, DialogTitleProps>(\n function DialogTitle({ className, ...props }, ref) {\n return (\n <BaseDialog.Title\n ref={ref}\n className={cn(\n \"gryt-dialog-title text-base font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Description\n>;\n\nconst Description = forwardRef<HTMLParagraphElement, DialogDescriptionProps>(\n function DialogDescription({ className, ...props }, ref) {\n return (\n <BaseDialog.Description\n ref={ref}\n className={cn(\n \"gryt-dialog-description text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogFooterProps = HTMLAttributes<HTMLDivElement>;\n\n// Replaces MUI's DialogActions. Base UI has no equivalent part, because it is\n// a plain row of buttons and nothing about it needs behaviour.\nconst Footer = forwardRef<HTMLDivElement, DialogFooterProps>(\n function DialogFooter({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-dialog-footer flex justify-end gap-3\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport const Dialog = {\n Root: BaseDialog.Root,\n Trigger: BaseDialog.Trigger,\n Portal: BaseDialog.Portal,\n Close: BaseDialog.Close,\n Backdrop,\n Popup,\n Title,\n Description,\n Footer\n};\n","import { useCallback, useSyncExternalStore } from \"react\";\n\nconst noop = () => () => {};\n\n/**\n * Matches a media query, safely on the server.\n *\n * Written here rather than taken from Base UI's `unstable-use-media-query`,\n * because a component library should not put an explicitly unstable export on\n * its public path.\n *\n * useSyncExternalStore rather than useState in an effect: matchMedia is an\n * external store, and reading it into state after mount means an extra render\n * on every consumer plus a frame where the answer is wrong. The server snapshot\n * is false so the first client paint agrees with the server's.\n */\nexport function useMediaQuery(query: string): boolean {\n const subscribe = useCallback(\n (onChange: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return noop();\n const list = window.matchMedia(query);\n list.addEventListener(\"change\", onChange);\n return () => list.removeEventListener(\"change\", onChange);\n },\n [query]\n );\n\n const getSnapshot = useCallback(() => {\n if (typeof window === \"undefined\" || !window.matchMedia) return false;\n return window.matchMedia(query).matches;\n }, [query]);\n\n return useSyncExternalStore(subscribe, getSnapshot, () => false);\n}\n","import { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { useMediaQuery } from \"../utils/useMediaQuery\";\n\nexport type DrawerSide = \"left\" | \"right\" | \"top\" | \"bottom\";\n\n/**\n * A panel pinned to an edge of the screen, and a sheet on small screens.\n *\n * Built on Base UI's `drawer` rather than on `dialog`, which is what this used\n * to be. A dialog pinned to an edge looks like a drawer and does none of what\n * one is for: it cannot be dragged away, it does not follow the finger, and it\n * does not know which edge it belongs to. The primitive brings swipe-to-dismiss,\n * snap points and nested stacking, and it drives the drag through CSS variables\n * so the panel tracks the pointer without a re-render per frame.\n *\n * `side` lives on Root, not on Popup as it used to. It has to: the swipe\n * direction is Root's business, and Viewport and Popup both need to agree with\n * it. Callers passing `side` to Popup will need to move it up one level.\n */\n\n/** Which way you drag to dismiss, per edge. */\nconst swipeBySide = {\n left: \"left\",\n right: \"right\",\n top: \"up\",\n bottom: \"down\"\n} as const;\n\nconst SideContext = createContext<DrawerSide>(\"right\");\n\n/** Where the panel sits inside the viewport. */\nconst viewportBySide: Record<DrawerSide, string> = {\n left: \"items-stretch justify-start\",\n right: \"items-stretch justify-end\",\n top: \"items-start justify-center\",\n bottom: \"items-end justify-center\"\n};\n\n/**\n * Corners are rounded on the edges away from the origin only.\n *\n * A sheet coming up from the bottom is still attached to the bottom of the\n * screen, so rounding its bottom corners would float it off an edge it has not\n * left. Rounding the leading edge alone is what makes it read as attached.\n */\nconst radiusBySide: Record<DrawerSide, string> = {\n left: \"rounded-r-(--gryt-radius-xl)\",\n right: \"rounded-l-(--gryt-radius-xl)\",\n top: \"rounded-b-(--gryt-radius-xl)\",\n bottom: \"rounded-t-(--gryt-radius-xl)\"\n};\n\n/**\n * Size, the overhang, and the off-screen resting transform.\n *\n * The panel runs --gryt-drawer-bleed past its edge and hangs that much\n * off-screen, with matching padding so content sits where it would have. The\n * spring settles onto its target from both directions, and without the overhang\n * a fractional undershoot shows a seam of backdrop down the edge.\n */\nconst popupBySide: Record<DrawerSide, string> = {\n left: [\n \"h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]\",\n \"-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]\",\n \"[transform:translateX(var(--drawer-swipe-movement-x))]\",\n \"data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]\",\n \"data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]\"\n ].join(\" \"),\n right: [\n \"h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]\",\n \"-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]\",\n \"[transform:translateX(var(--drawer-swipe-movement-x))]\",\n \"data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]\",\n \"data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]\"\n ].join(\" \"),\n top: [\n \"w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]\",\n \"-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]\",\n \"[transform:translateY(var(--drawer-swipe-movement-y))]\",\n \"data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]\",\n \"data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]\"\n ].join(\" \"),\n bottom: [\n \"w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]\",\n \"-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]\",\n \"[transform:translateY(var(--drawer-swipe-movement-y))]\",\n \"data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]\",\n \"data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]\"\n ].join(\" \")\n};\n\nexport interface DrawerRootProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseDrawer.Root>,\n \"swipeDirection\"\n > {\n /** Edge the panel is pinned to. Ignored on small screens unless sheetOnMobile is false. */\n side?: DrawerSide;\n /**\n * Become a bottom sheet under 768px.\n *\n * A side panel is a desktop shape. On a phone it eats the width the content\n * needs and puts the drag gesture on the axis the browser uses for back\n * navigation. Set false to keep `side` at every width.\n */\n sheetOnMobile?: boolean;\n children?: ReactNode;\n}\n\nfunction Root({\n side = \"right\",\n sheetOnMobile = true,\n children,\n ...props\n}: DrawerRootProps) {\n const isMobile = useMediaQuery(\"(max-width: 767px)\");\n const resolved: DrawerSide = sheetOnMobile && isMobile ? \"bottom\" : side;\n\n return (\n <SideContext.Provider value={resolved}>\n <BaseDrawer.Root swipeDirection={swipeBySide[resolved]} {...props}>\n {children}\n </BaseDrawer.Root>\n </SideContext.Provider>\n );\n}\n\nexport type DrawerViewportProps = ComponentPropsWithoutRef<\n typeof BaseDrawer.Viewport\n>;\n\nconst Viewport = forwardRef<HTMLDivElement, DrawerViewportProps>(\n function DrawerViewport({ className, ...props }, ref) {\n const side = useContext(SideContext);\n return (\n <BaseDrawer.Viewport\n ref={ref}\n className={cn(\n // z-50 matters: the popup is no longer positioned itself, so the\n // viewport is what has to sit above the page. Without it a sticky\n // site header renders over the panel.\n \"gryt-drawer-viewport fixed inset-0 z-50 flex\",\n viewportBySide[side],\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DrawerPopupProps = ComponentPropsWithoutRef<\n typeof BaseDrawer.Popup\n>;\n\nconst Popup = forwardRef<HTMLDivElement, DrawerPopupProps>(function DrawerPopup(\n { className, ...props },\n ref\n) {\n const side = useContext(SideContext);\n return (\n <BaseDrawer.Popup\n ref={ref}\n className={cn(\n \"gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text\",\n \"overflow-y-auto overscroll-contain outline-none\",\n \"transition-transform duration-(--gryt-dur-spring-soft) ease-spring\",\n // While the finger is down the panel must track it exactly. Any\n // duration here turns a drag into a drag plus lag.\n \"data-swiping:duration-0 data-swiping:select-none\",\n \"motion-reduce:transition-none\",\n popupBySide[side],\n radiusBySide[side],\n className\n )}\n {...props}\n />\n );\n});\n\nconst Backdrop = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseDrawer.Backdrop>\n>(function DrawerBackdrop({ className, ...props }, ref) {\n return (\n <BaseDrawer.Backdrop\n ref={ref}\n className={cn(\n \"gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n // Lightens as the panel is dragged away, so letting go halfway does not\n // leave a full-strength scrim over a half-gone sheet.\n \"[opacity:calc(1-var(--drawer-swipe-progress,0))]\",\n \"transition-opacity duration-(--gryt-dur-spring-soft) ease-spring\",\n \"data-swiping:duration-0\",\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport interface DrawerGrabberProps {\n className?: string;\n}\n\n/**\n * The bar people expect to drag on a sheet.\n *\n * Rendered only for the top and bottom edges: on a left or right panel it would\n * be pointing the wrong way, and a horizontal drawer is a desktop shape where\n * nobody reaches for a grab bar anyway. Decorative — the whole popup is\n * draggable, so this is a hint, not the control.\n */\nfunction Grabber({ className }: DrawerGrabberProps) {\n const side = useContext(SideContext);\n if (side !== \"bottom\" && side !== \"top\") return null;\n\n return (\n <div\n aria-hidden\n className={cn(\n \"gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border\",\n side === \"top\" && \"order-last\",\n className\n )}\n />\n );\n}\n\nexport const Drawer = {\n Root,\n Trigger: BaseDrawer.Trigger,\n Portal: BaseDrawer.Portal,\n Backdrop,\n Viewport,\n Popup,\n Content: BaseDrawer.Content,\n Grabber,\n Close: BaseDrawer.Close,\n Title: BaseDrawer.Title,\n Description: BaseDrawer.Description\n};\n","import { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\nexport type MenuPopupProps = ComponentPropsWithoutRef<typeof BaseMenu.Popup>;\nexport type MenuItemProps = ComponentPropsWithoutRef<typeof BaseMenu.Item>;\nexport type MenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseMenu.Positioner\n>;\n\nconst Positioner = forwardRef<HTMLDivElement, MenuPositionerProps>(\n function MenuPositioner({ className, sideOffset = 8, ...props }, ref) {\n return (\n <BaseMenu.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-menu-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\nconst Popup = forwardRef<HTMLDivElement, MenuPopupProps>(function MenuPopup(\n { className, ...props },\n ref\n) {\n return (\n <BaseMenu.Popup\n ref={ref}\n className={cn(\n \"gryt-menu min-w-44 p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<HTMLDivElement, MenuItemProps>(function MenuItem(\n { className, ...props },\n ref\n) {\n return (\n <BaseMenu.Item\n ref={ref}\n className={cn(\n \"gryt-menu-item flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)\",\n \"px-3 py-2 text-sm text-gryt-text outline-none select-none\",\n // Base UI drives keyboard and pointer highlight through the same\n // attribute, so arrow keys and the mouse land on identical styling.\n \"data-highlighted:bg-gryt-surface-raised\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Separator = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseMenu.Separator>\n>(function MenuSeparator({ className, ...props }, ref) {\n return (\n <BaseMenu.Separator\n ref={ref}\n className={cn(\"gryt-menu-separator my-1 h-px bg-gryt-border\", className)}\n {...props}\n />\n );\n});\n\nexport const Menu = {\n Root: BaseMenu.Root,\n Trigger: BaseMenu.Trigger,\n Portal: BaseMenu.Portal,\n Positioner,\n Popup,\n Item,\n Separator\n};\n","import { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type TabsProps = ComponentPropsWithoutRef<typeof BaseTabs.Root>;\nexport type TabsListProps = ComponentPropsWithoutRef<typeof BaseTabs.List>;\nexport type TabProps = ComponentPropsWithoutRef<typeof BaseTabs.Tab>;\nexport type TabsPanelProps = ComponentPropsWithoutRef<typeof BaseTabs.Panel>;\n\nconst Root = forwardRef<HTMLDivElement, TabsProps>(function TabsRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Root\n ref={ref}\n className={cn(\"gryt-tabs\", className)}\n {...props}\n />\n );\n});\n\nconst List = forwardRef<HTMLDivElement, TabsListProps>(function TabsList(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.List\n ref={ref}\n className={cn(\n \"gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Tab\n ref={ref}\n className={cn(\n \"gryt-tab inline-flex min-h-8 items-center justify-center whitespace-nowrap\",\n \"rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5\",\n \"text-sm font-medium text-gryt-muted select-none\",\n \"relative z-10 transition-colors duration-150 hover:text-gryt-text\",\n // Base UI marks the selected tab with data-active, not data-selected.\n // The fill moved to Indicator so it can travel between tabs; the tab\n // itself only changes its text colour.\n \"data-active:text-gryt-on-accent\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nexport type TabsIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseTabs.Indicator\n>;\n\n// Base UI measures the active tab and publishes --active-tab-left and\n// --active-tab-width, which is what lets the pill slide rather than jump.\n// renderBeforeHydration keeps it positioned on the first paint instead of\n// animating in from the left edge.\nconst Indicator = forwardRef<HTMLSpanElement, TabsIndicatorProps>(\n function TabsIndicator({ className, ...props }, ref) {\n return (\n <BaseTabs.Indicator\n ref={ref}\n renderBeforeHydration\n className={cn(\n \"gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]\",\n \"w-(--active-tab-width) translate-x-(--active-tab-left)\",\n \"rounded-(--gryt-radius-full) bg-gryt-accent\",\n \"transition-[translate,width] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, TabsPanelProps>(function TabsPanel(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Panel\n ref={ref}\n className={cn(\"gryt-tabs-panel pt-3 text-sm text-gryt-text\", className)}\n {...props}\n />\n );\n});\n\nexport const Tabs = Object.assign(Root, { List, Tab, Panel, Indicator });\nexport { Tab };\n","import { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { CaretDown } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type AccordionProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Root\n>;\nexport type AccordionItemProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Item\n>;\nexport type AccordionPanelProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Panel\n>;\n\nconst Root = forwardRef<HTMLDivElement, AccordionProps>(function AccordionRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseAccordion.Root\n ref={ref}\n className={cn(\n \"gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<HTMLDivElement, AccordionItemProps>(\n function AccordionItem({ className, ...props }, ref) {\n return (\n <BaseAccordion.Item\n ref={ref}\n className={cn(\"gryt-accordion-item\", className)}\n {...props}\n />\n );\n }\n);\n\nexport interface AccordionTriggerProps\n extends ComponentPropsWithoutRef<typeof BaseAccordion.Trigger> {\n // Defaults to a caret that rotates when the panel opens. Pass one to\n // override it, or null for no indicator at all.\n expandIcon?: ReactNode;\n}\n\nconst Trigger = forwardRef<HTMLButtonElement, AccordionTriggerProps>(\n function AccordionTrigger({ children, className, expandIcon, ...props }, ref) {\n return (\n <BaseAccordion.Header className=\"gryt-accordion-header m-0\">\n <BaseAccordion.Trigger\n ref={ref}\n className={cn(\n \"gryt-accordion-trigger flex w-full items-center justify-between gap-3\",\n \"rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5\",\n \"text-left text-sm font-medium text-gryt-text select-none\",\n \"transition-colors duration-150 hover:bg-gryt-surface-raised\",\n focusRing,\n className\n )}\n {...props}\n >\n {children}\n {expandIcon === undefined ? (\n <CaretDown\n size={16}\n // Base UI flags the open panel on the trigger, so the caret needs\n // no state of its own.\n className=\"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none\"\n />\n ) : (\n expandIcon\n )}\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel({ children, className, ...props }, ref) {\n return (\n <BaseAccordion.Panel\n ref={ref}\n className={cn(\n \"gryt-accordion-panel overflow-hidden text-sm text-gryt-muted\",\n // Base UI measures the panel and exposes the height as a variable,\n // which is what makes a real open and close transition possible.\n \"h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring\",\n \"data-starting-style:h-0 data-ending-style:h-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n >\n <div className=\"px-3 pt-1 pb-3\">{children}</div>\n </BaseAccordion.Panel>\n );\n }\n);\n\nexport const Accordion = Object.assign(Root, { Item, Trigger, Panel });\n","import { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { Menu } from \"../Menu/Menu\";\n\nexport type ContextMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.Positioner\n>;\n\n/**\n * A right-click menu: a message, a member, a channel.\n *\n * Base UI builds this out of Menu's own parts — its Popup, Item and Separator\n * are literally Menu's components — so this reuses the styled ones rather than\n * restyling them. A context menu that drifted from the dropdown menu would be\n * a bug nobody notices until both are on screen at once.\n */\nconst Positioner = forwardRef<HTMLDivElement, ContextMenuPositionerProps>(\n function ContextMenuPositioner({ className, sideOffset = 2, ...props }, ref) {\n return (\n <BaseContextMenu.Positioner\n ref={ref}\n // Smaller than Menu's 8. This anchors to the pointer rather than to a\n // trigger element, and 8px from the cursor reads as a menu that missed.\n sideOffset={sideOffset}\n className={cn(\"gryt-context-menu-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\nexport const ContextMenu = {\n Root: BaseContextMenu.Root,\n Trigger: BaseContextMenu.Trigger,\n Portal: BaseContextMenu.Portal,\n Positioner,\n Popup: Menu.Popup,\n Item: Menu.Item,\n Separator: Menu.Separator,\n Group: BaseContextMenu.Group,\n GroupLabel: BaseContextMenu.GroupLabel,\n SubmenuRoot: BaseContextMenu.SubmenuRoot,\n SubmenuTrigger: BaseContextMenu.SubmenuTrigger\n};\n","import { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\nexport type PopoverPopupProps = ComponentPropsWithoutRef<\n typeof BasePopover.Popup\n>;\nexport type PopoverPositionerProps = ComponentPropsWithoutRef<\n typeof BasePopover.Positioner\n>;\n\nconst Positioner = forwardRef<HTMLDivElement, PopoverPositionerProps>(\n function PopoverPositioner({ className, sideOffset = 8, ...props }, ref) {\n return (\n <BasePopover.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-popover-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\n// Wider default than Menu: this holds prose and controls — a member card, a\n// permissions summary — rather than a column of one-line items.\nconst Popup = forwardRef<HTMLDivElement, PopoverPopupProps>(\n function PopoverPopup({ className, ...props }, ref) {\n return (\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Title = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof BasePopover.Title>\n>(function PopoverTitle({ className, ...props }, ref) {\n return (\n <BasePopover.Title\n ref={ref}\n className={cn(\n \"gryt-popover-title text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof BasePopover.Description>\n>(function PopoverDescription({ className, ...props }, ref) {\n return (\n <BasePopover.Description\n ref={ref}\n className={cn(\n \"gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Popover = {\n Root: BasePopover.Root,\n Trigger: BasePopover.Trigger,\n Portal: BasePopover.Portal,\n Positioner,\n Popup,\n Title,\n Description,\n Close: BasePopover.Close,\n Arrow: BasePopover.Arrow\n};\n","import { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { X } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupSurface } from \"../utils/styles\";\n\nexport type ToastRootProps = ComponentPropsWithoutRef<typeof BaseToast.Root>;\nexport type ToastViewportProps = ComponentPropsWithoutRef<\n typeof BaseToast.Viewport\n>;\n\n/**\n * Transient notice: connection lost, invite copied, message failed to send.\n *\n * design.md's stance is silent success — most things that worked should say\n * nothing. This is for the cases where the user is not looking at the thing\n * that changed, which in a voice client is most of them.\n */\nconst Viewport = forwardRef<HTMLDivElement, ToastViewportProps>(\n function ToastViewport({ className, ...props }, ref) {\n return (\n <BaseToast.Viewport\n ref={ref}\n className={cn(\n \"gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]\",\n \"flex-col gap-2 outline-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Root = forwardRef<HTMLDivElement, ToastRootProps>(function ToastRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseToast.Root\n ref={ref}\n className={cn(\n \"gryt-toast relative flex flex-col p-3 pr-9\",\n popupSurface,\n // Swiping is a pointer gesture, so the toast follows the finger\n // through Base UI's swipe variables before it animates out.\n \"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring\",\n \"data-starting-style:translate-y-2 data-starting-style:opacity-0\",\n \"data-ending-style:translate-y-2 data-ending-style:opacity-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Title = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToast.Title>\n>(function ToastTitle({ className, ...props }, ref) {\n return (\n <BaseToast.Title\n ref={ref}\n className={cn(\n \"gryt-toast-title text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToast.Description>\n>(function ToastDescription({ className, ...props }, ref) {\n return (\n <BaseToast.Description\n ref={ref}\n className={cn(\n \"gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Close = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseToast.Close>\n>(function ToastClose({ className, children, ...props }, ref) {\n return (\n <BaseToast.Close\n ref={ref}\n aria-label=\"Close\"\n className={cn(\n \"gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center\",\n \"rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted\",\n \"transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n >\n {children ?? <X size={14} weight=\"bold\" />}\n </BaseToast.Close>\n );\n});\n\nconst Action = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseToast.Action>\n>(function ToastAction({ className, ...props }, ref) {\n return (\n <BaseToast.Action\n ref={ref}\n className={cn(\n \"gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0\",\n \"bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent\",\n \"transition-[scale] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Toast = {\n Provider: BaseToast.Provider,\n Portal: BaseToast.Portal,\n Viewport,\n Root,\n Title,\n Description,\n Close,\n Action\n};\n\n/**\n * Raise a toast without importing Base UI directly.\n *\n * Taken off the namespace rather than re-exported from \"@base-ui/react/toast\":\n * at that path the hook is a type-only declaration, and re-exporting it as a\n * value fails under isolatedModules. The value lives on the parts namespace.\n */\nexport const useToastManager = BaseToast.useToastManager;\n","import { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ScrollAreaRootProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Root\n>;\nexport type ScrollAreaViewportProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Viewport\n>;\nexport type ScrollAreaScrollbarProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Scrollbar\n>;\n\nconst Root = forwardRef<HTMLDivElement, ScrollAreaRootProps>(\n function ScrollAreaRoot({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Root\n ref={ref}\n className={cn(\"gryt-scroll-area relative\", className)}\n {...props}\n />\n );\n }\n);\n\n// overscroll-contain so a message list that hits its end does not hand the\n// scroll to the page behind it.\nconst Viewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(\n function ScrollAreaViewport({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Viewport\n ref={ref}\n className={cn(\n \"gryt-scroll-area-viewport h-full w-full overscroll-contain\",\n \"focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Scrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(\n function ScrollAreaScrollbar({ className, orientation, ...props }, ref) {\n return (\n <BaseScrollArea.Scrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none\",\n // Fades in on hover or while scrolling rather than sitting there\n // permanently — a chat sidebar is mostly not being scrolled.\n \"opacity-0 transition-opacity duration-(--gryt-dur-fast)\",\n \"data-hovering:opacity-100 data-scrolling:opacity-100\",\n \"motion-reduce:transition-none\",\n orientation === \"horizontal\" ? \"h-2 flex-col\" : \"w-2\",\n className\n )}\n {...props}\n >\n <BaseScrollArea.Thumb className=\"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none\" />\n </BaseScrollArea.Scrollbar>\n );\n }\n);\n\nexport const ScrollArea = {\n Root,\n Viewport,\n Scrollbar,\n Content: BaseScrollArea.Content,\n Corner: BaseScrollArea.Corner\n};\n","import { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as BaseToggleGroup } from \"@base-ui/react/toggle-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing } from \"../utils/styles\";\n\ntype ToggleTone = \"primary\" | \"secondary\" | \"neutral\" | \"danger\";\ntype ToggleSize = \"xsmall\" | \"small\" | \"medium\" | \"large\";\n\n// Unpressed reads like IconButton's tinted target; pressed fills. A mute button\n// has to be legible as on or off from across the room, so the two states differ\n// in fill rather than only in colour.\nconst toneStyles: Record<ToggleTone, string> = {\n primary: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-accent\"\n ].join(\" \"),\n secondary: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-secondary\"\n ].join(\" \"),\n neutral: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text\"\n ].join(\" \"),\n // For destructive-while-active controls: mic muted, camera off.\n danger: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-danger\"\n ].join(\" \")\n};\n\nconst sizeStyles: Record<ToggleSize, string> = {\n xsmall: \"h-8 min-w-8 px-2 text-xs\",\n small: \"h-9 min-w-9 px-2.5 text-sm\",\n medium: \"h-10 min-w-10 px-3 text-sm\",\n large: \"h-12 min-w-12 px-4 text-base\"\n};\n\nexport interface ToggleProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToggle>, \"className\"> {\n tone?: ToggleTone;\n size?: ToggleSize;\n className?: string;\n}\n\nexport const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(\n function Toggle(\n { className, size = \"medium\", tone = \"primary\", ...props },\n ref\n ) {\n return (\n <BaseToggle\n ref={ref}\n className={cn(\n \"gryt-toggle\",\n \"inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent\",\n \"rounded-(--gryt-radius-full) font-medium select-none\",\n // scale rather than transform — see the note in Button.\n \"transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:not-data-disabled:scale-[1.06]\",\n \"motion-safe:active:not-data-disabled:scale-[0.94]\",\n focusRing,\n disabledState,\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport interface ToggleGroupProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToggleGroup>, \"className\"> {\n className?: string;\n}\n\n// A rail around a set of Toggles. Base UI handles roving focus, so arrow keys\n// move between items and only one tab stop enters the group.\nexport const ToggleGroup = forwardRef<HTMLDivElement, ToggleGroupProps>(\n function ToggleGroup({ className, ...props }, ref) {\n return (\n <BaseToggleGroup\n ref={ref}\n className={cn(\n \"gryt-toggle-group inline-flex items-center gap-1\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { Meter as BaseMeter } from \"@base-ui/react/meter\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type MeterTone = \"primary\" | \"success\" | \"warning\" | \"danger\";\n\nconst toneFill: Record<MeterTone, string> = {\n primary: \"bg-gryt-accent\",\n success: \"bg-gryt-success\",\n warning: \"bg-gryt-warning\",\n danger: \"bg-gryt-danger\"\n};\n\nexport interface MeterProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseMeter.Root>,\n \"className\" | \"value\"\n > {\n value: number;\n label?: ReactNode;\n /** Show the formatted value at the end of the label row. */\n showValue?: boolean;\n tone?: MeterTone;\n className?: string;\n}\n\n/**\n * A measurement inside a known range — mic input level, disk used, how full a\n * server is.\n *\n * Deliberately not Progress. Progress says \"this task is 40% done and heading\n * for 100%\"; a meter says \"this is the reading right now\", and a reading at\n * 100% is often the bad case rather than the finished one. They also announce\n * differently to a screen reader, which is the part that actually matters.\n *\n * No transition on the indicator: the common caller is a mic level updating\n * every animation frame, and easing a value that already changes 60 times a\n * second only makes it lag behind the sound.\n */\nexport function Meter({\n className,\n value,\n label,\n showValue = false,\n tone = \"primary\",\n ...props\n}: MeterProps) {\n return (\n <BaseMeter.Root\n value={value}\n className={cn(\"gryt-meter flex w-full flex-col gap-1.5\", className)}\n {...props}\n >\n {(label || showValue) && (\n <div className=\"flex items-baseline justify-between gap-2\">\n {label ? (\n <BaseMeter.Label className=\"text-sm text-gryt-muted\">\n {label}\n </BaseMeter.Label>\n ) : (\n <span />\n )}\n {showValue && (\n <BaseMeter.Value className=\"font-mono text-xs text-gryt-muted tabular-nums\" />\n )}\n </div>\n )}\n <BaseMeter.Track className=\"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised\">\n <BaseMeter.Indicator\n className={cn(\n \"h-full rounded-(--gryt-radius-full)\",\n toneFill[tone]\n )}\n />\n </BaseMeter.Track>\n </BaseMeter.Root>\n );\n}\n","import { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type AlertDialogPopupProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Popup\n>;\n\n/**\n * A dialog you cannot dismiss by accident — for \"Leave this server?\".\n *\n * Styled identically to Dialog on purpose; the difference is behaviour, not\n * looks. Escape and clicking the backdrop do nothing here, so answering\n * requires picking one of the buttons. Using this where Dialog belongs is worse\n * than not having it, because it takes away the escape people expect.\n */\nconst Popup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n ref={ref}\n className={cn(\n \"gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2\",\n \"flex w-96 max-w-[calc(100vw-3rem)] flex-col gap-4\",\n \"rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text\",\n \"outline-none\",\n \"transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Backdrop = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>\n>(function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n \"transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Title = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>\n>(function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-title text-lg font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Description>\n>(function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-description text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const AlertDialog = {\n Root: BaseAlertDialog.Root,\n Trigger: BaseAlertDialog.Trigger,\n Portal: BaseAlertDialog.Portal,\n Backdrop,\n Popup,\n Title,\n Description,\n Close: BaseAlertDialog.Close\n};\n","import { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * Shared with Autocomplete, which is the same list wearing different\n * semantics. Exported so the two cannot drift, the way ContextMenu shares\n * Menu's item.\n */\nexport const listboxItemClass = [\n \"flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)\",\n \"px-3 py-2 text-sm text-gryt-text outline-none select-none\",\n // Base UI drives keyboard and pointer highlight through one attribute, so\n // arrow keys and the mouse land on identical styling.\n \"data-highlighted:bg-gryt-surface-raised\",\n \"data-selected:text-gryt-accent\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\"\n].join(\" \");\n\nexport const listboxInputClass = [\n \"w-full rounded-(--gryt-radius-input) border border-gryt-border bg-gryt-surface-raised\",\n \"px-3 py-2 text-sm text-gryt-text outline-none placeholder:text-gryt-muted\",\n focusRing\n].join(\" \");\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.Popup\n>;\n\nconst Input = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Input>\n>(function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n ref={ref}\n className={cn(\"gryt-combobox-input\", listboxInputClass, className)}\n {...props}\n />\n );\n});\n\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>\n>(function ComboboxPositioner({ className, sideOffset = 6, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-combobox-positioner outline-none\", className)}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<HTMLDivElement, ComboboxPopupProps>(\n function ComboboxPopup({ className, ...props }, ref) {\n return (\n <BaseCombobox.Popup\n ref={ref}\n className={cn(\n \"gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Item = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Item>\n>(function ComboboxItem({ className, ...props }, ref) {\n return (\n <BaseCombobox.Item\n ref={ref}\n className={cn(\"gryt-combobox-item\", listboxItemClass, className)}\n {...props}\n />\n );\n});\n\nconst Empty = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Empty>\n>(function ComboboxEmpty({ className, ...props }, ref) {\n return (\n <BaseCombobox.Empty\n ref={ref}\n className={cn(\n \"gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\n/**\n * Pick from a list, narrowed by typing. Select with a filter, in effect.\n *\n * Supports multiple selection with chips, which is what a member picker or a\n * role assignment wants. Use Autocomplete instead when the value is free text\n * and the list is only a suggestion.\n */\nexport const Combobox = {\n Root: BaseCombobox.Root,\n Input,\n InputGroup: BaseCombobox.InputGroup,\n Trigger: BaseCombobox.Trigger,\n Icon: BaseCombobox.Icon,\n Clear: BaseCombobox.Clear,\n Value: BaseCombobox.Value,\n Chips: BaseCombobox.Chips,\n Chip: BaseCombobox.Chip,\n ChipRemove: BaseCombobox.ChipRemove,\n Portal: BaseCombobox.Portal,\n Positioner,\n Popup,\n List: BaseCombobox.List,\n Item,\n ItemIndicator: BaseCombobox.ItemIndicator,\n Group: BaseCombobox.Group,\n GroupLabel: BaseCombobox.GroupLabel,\n Empty,\n Separator: BaseCombobox.Separator\n};\n","import { Autocomplete as BaseAutocomplete } from \"@base-ui/react/autocomplete\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { listboxInputClass, listboxItemClass } from \"../Combobox/Combobox\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * A text input that suggests as you type.\n *\n * The difference from Combobox is what the value is allowed to be: here the\n * typed text is the answer and the list is a suggestion, so a search box or a\n * tag input belongs here. Combobox is for when the value must come from the\n * list. They share item and input styling deliberately — two lists that look\n * different for no reason is worse than one that looks the same.\n */\n\nconst Input = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Input>\n>(function AutocompleteInput({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Input\n ref={ref}\n className={cn(\"gryt-autocomplete-input\", listboxInputClass, className)}\n {...props}\n />\n );\n});\n\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Positioner>\n>(function AutocompletePositioner({ className, sideOffset = 6, ...props }, ref) {\n return (\n <BaseAutocomplete.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-autocomplete-positioner outline-none\", className)}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Popup>\n>(function AutocompletePopup({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Popup\n ref={ref}\n className={cn(\n \"gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Item>\n>(function AutocompleteItem({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Item\n ref={ref}\n className={cn(\"gryt-autocomplete-item\", listboxItemClass, className)}\n {...props}\n />\n );\n});\n\nconst Empty = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Empty>\n>(function AutocompleteEmpty({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Empty\n ref={ref}\n className={cn(\n \"gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Autocomplete = {\n Root: BaseAutocomplete.Root,\n Input,\n InputGroup: BaseAutocomplete.InputGroup,\n Trigger: BaseAutocomplete.Trigger,\n Icon: BaseAutocomplete.Icon,\n Clear: BaseAutocomplete.Clear,\n Value: BaseAutocomplete.Value,\n Portal: BaseAutocomplete.Portal,\n Positioner,\n Popup,\n List: BaseAutocomplete.List,\n Item,\n Group: BaseAutocomplete.Group,\n GroupLabel: BaseAutocomplete.GroupLabel,\n Empty,\n Separator: BaseAutocomplete.Separator\n};\n","import { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type CheckboxGroupProps = ComponentPropsWithoutRef<\n typeof BaseCheckboxGroup\n>;\n\n/**\n * A set of checkboxes sharing one value array.\n *\n * Worth having over a hand-rolled array of Checkboxes for the parent case: give\n * it `allValues` and a checkbox marked `parent` becomes a working\n * indeterminate tri-state, which is fiddly to get right by hand and is exactly\n * what a permissions list needs.\n */\nexport const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(\n function CheckboxGroup({ className, ...props }, ref) {\n return (\n <BaseCheckboxGroup\n ref={ref}\n className={cn(\"gryt-checkbox-group flex flex-col gap-2\", className)}\n {...props}\n />\n );\n }\n);\n","import { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type CollapsibleTriggerProps = ComponentPropsWithoutRef<\n typeof BaseCollapsible.Trigger\n>;\nexport type CollapsiblePanelProps = ComponentPropsWithoutRef<\n typeof BaseCollapsible.Panel\n>;\n\n/**\n * One region that opens and closes — a channel category, an advanced section.\n *\n * Accordion is a set of these that know about each other. Reach for this when\n * there is only one, so nothing has to pretend to be a one-item accordion.\n */\nconst Trigger = forwardRef<HTMLButtonElement, CollapsibleTriggerProps>(\n function CollapsibleTrigger({ className, ...props }, ref) {\n return (\n <BaseCollapsible.Trigger\n ref={ref}\n className={cn(\n \"gryt-collapsible-trigger flex w-full items-center justify-between gap-2\",\n \"rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left\",\n \"text-sm font-medium text-gryt-text select-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, CollapsiblePanelProps>(\n function CollapsiblePanel({ className, ...props }, ref) {\n return (\n <BaseCollapsible.Panel\n ref={ref}\n className={cn(\n \"gryt-collapsible-panel overflow-hidden\",\n // Base UI measures the panel and exposes the height as a variable, so\n // this animates to the content's real height rather than to a guess.\n \"h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring\",\n \"data-starting-style:h-0 data-ending-style:h-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport const Collapsible = {\n Root: BaseCollapsible.Root,\n Trigger,\n Panel\n};\n","import { Form as BaseForm } from \"@base-ui/react/form\";\nimport { Fieldset as BaseFieldset } from \"@base-ui/react/fieldset\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type FormProps = ComponentPropsWithoutRef<typeof BaseForm>;\n\n/**\n * Wires server-side errors back to the fields that caused them.\n *\n * Pass `errors` keyed by field name and Base UI routes each message to the\n * matching Field, so a rejected form points at the input rather than printing a\n * paragraph at the top that the user has to map back themselves.\n */\nexport const Form = forwardRef<HTMLFormElement, FormProps>(function Form(\n { className, ...props },\n ref\n) {\n return (\n <BaseForm\n ref={ref}\n className={cn(\"gryt-form flex flex-col gap-(--gryt-space-lg)\", className)}\n {...props}\n />\n );\n});\n\nexport type FieldsetProps = ComponentPropsWithoutRef<typeof BaseFieldset.Root>;\n\nconst FieldsetRoot = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset({ className, ...props }, ref) {\n return (\n <BaseFieldset.Root\n ref={ref}\n className={cn(\n \"gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Legend = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseFieldset.Legend>\n>(function FieldsetLegend({ className, ...props }, ref) {\n return (\n <BaseFieldset.Legend\n ref={ref}\n className={cn(\n \"gryt-fieldset-legend text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Fieldset = { Root: FieldsetRoot, Legend };\n","import { Menubar as BaseMenubar } from \"@base-ui/react/menubar\";\nimport { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * A bar of menus that behave as one — File, Edit, View.\n *\n * Once any menu is open, moving along the bar opens the next without a second\n * click, which is the behaviour that separates a menubar from several\n * independent Menus sitting next to each other.\n */\nexport type MenubarProps = ComponentPropsWithoutRef<typeof BaseMenubar>;\n\nexport const Menubar = forwardRef<HTMLDivElement, MenubarProps>(\n function Menubar({ className, ...props }, ref) {\n return (\n <BaseMenubar\n ref={ref}\n className={cn(\n \"gryt-menubar flex items-center gap-1\",\n \"rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\n/**\n * Site-level navigation whose items open panels.\n *\n * Distinct from Menubar: the items are links first and the panels can hold\n * layout — a column of sections, a promo — rather than a list of commands. The\n * viewport animates between panels so moving along the bar resizes rather than\n * closing and reopening.\n */\nconst Trigger = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Trigger>\n>(function NavigationMenuTrigger({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Trigger\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)\",\n \"border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n \"data-popup-open:bg-gryt-surface-raised\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Popup>\n>(function NavigationMenuPopup({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Popup\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-popup outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Viewport = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Viewport>\n>(function NavigationMenuViewport({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Viewport\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-viewport relative overflow-hidden\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Link = forwardRef<\n HTMLAnchorElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Link>\n>(function NavigationMenuLink({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Link\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2\",\n \"text-sm text-gryt-text no-underline outline-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nexport const NavigationMenu = {\n Root: BaseNavigationMenu.Root,\n List: BaseNavigationMenu.List,\n Item: BaseNavigationMenu.Item,\n Trigger,\n Content: BaseNavigationMenu.Content,\n Portal: BaseNavigationMenu.Portal,\n Positioner: BaseNavigationMenu.Positioner,\n Viewport,\n Popup,\n Link,\n Icon: BaseNavigationMenu.Icon,\n Arrow: BaseNavigationMenu.Arrow\n};\n","import { NumberField as BaseNumberField } from \"@base-ui/react/number-field\";\nimport { Minus, Plus } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing } from \"../utils/styles\";\n\nexport interface NumberFieldProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseNumberField.Root>,\n \"className\"\n > {\n label?: ReactNode;\n className?: string;\n /**\n * Drag the label sideways to change the value.\n *\n * Base UI calls this a scrub area, and it is the reason to use this over a\n * plain input for things like volume or bitrate — coarse adjustment by drag,\n * exact entry by typing, without two controls.\n */\n scrubbable?: boolean;\n}\n\nconst stepButton =\n \"flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50\";\n\nexport const NumberField = forwardRef<HTMLDivElement, NumberFieldProps>(\n function NumberField(\n { className, label, scrubbable = false, ...props },\n ref\n ) {\n return (\n <BaseNumberField.Root\n ref={ref}\n className={cn(\"gryt-number-field flex flex-col gap-1.5\", className)}\n {...props}\n >\n {label &&\n (scrubbable ? (\n <BaseNumberField.ScrubArea className=\"cursor-ew-resize text-sm text-gryt-muted select-none\">\n {label}\n <BaseNumberField.ScrubAreaCursor />\n </BaseNumberField.ScrubArea>\n ) : (\n <span className=\"text-sm text-gryt-muted\">{label}</span>\n ))}\n <BaseNumberField.Group\n className={cn(\n \"flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)\",\n \"border border-gryt-border bg-gryt-surface-raised\",\n \"focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light\",\n disabledState\n )}\n >\n <BaseNumberField.Decrement\n aria-label=\"Decrease\"\n className={cn(stepButton, \"rounded-l-(--gryt-radius-full)\")}\n >\n <Minus size={14} weight=\"bold\" />\n </BaseNumberField.Decrement>\n <BaseNumberField.Input\n className={cn(\n \"w-16 border-0 bg-transparent px-1 py-2 text-center\",\n \"font-mono text-sm text-gryt-text tabular-nums outline-none\",\n focusRing\n )}\n />\n <BaseNumberField.Increment\n aria-label=\"Increase\"\n className={cn(stepButton, \"rounded-r-(--gryt-radius-full)\")}\n >\n <Plus size={14} weight=\"bold\" />\n </BaseNumberField.Increment>\n </BaseNumberField.Group>\n </BaseNumberField.Root>\n );\n }\n);\n","import { OTPField as BaseOtpField } from \"@base-ui/react/otp-field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport interface OtpFieldProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseOtpField.Root>,\n \"className\" | \"length\"\n > {\n /** How many characters the code has. Required by Base UI; defaulted here. */\n length?: number;\n className?: string;\n}\n\n/**\n * A one-time code, one box per character.\n *\n * Base UI handles the parts that are tedious and easy to get wrong: paste a\n * whole code into any box and it distributes across all of them, backspace\n * steps back a box, and the arrow keys move between them.\n */\nexport const OtpField = forwardRef<HTMLDivElement, OtpFieldProps>(\n function OtpField({ className, length = 6, ...props }, ref) {\n return (\n <BaseOtpField.Root\n ref={ref}\n length={length}\n className={cn(\"gryt-otp-field flex gap-2\", className)}\n {...props}\n >\n {/* No index prop: Base UI assigns each input its slot by render order\n and exposes the index through state. */}\n {Array.from({ length }, (_unused, index) => (\n <BaseOtpField.Input\n key={index}\n className={cn(\n \"gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center\",\n \"border border-gryt-border bg-gryt-surface-raised\",\n \"font-mono text-lg text-gryt-text tabular-nums outline-none\",\n \"transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none\",\n \"data-filled:border-gryt-accent\",\n focusRing\n )}\n />\n ))}\n </BaseOtpField.Root>\n );\n }\n);\n","import { PreviewCard as BasePreviewCard } from \"@base-ui/react/preview-card\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\nexport type PreviewCardPopupProps = ComponentPropsWithoutRef<\n typeof BasePreviewCard.Popup\n>;\nexport type PreviewCardPositionerProps = ComponentPropsWithoutRef<\n typeof BasePreviewCard.Positioner\n>;\n\n/**\n * What appears when you hover a username.\n *\n * Not a Tooltip and not a Popover. A tooltip labels a control and opens\n * instantly; this holds real content, so it waits before opening and stays put\n * long enough to move the pointer into it. Popover is the click-to-open\n * equivalent — reach for that when the panel has controls, since content that\n * only appears on hover is unreachable from a keyboard or a touchscreen.\n */\nconst Positioner = forwardRef<HTMLDivElement, PreviewCardPositionerProps>(\n function PreviewCardPositioner({ className, sideOffset = 8, ...props }, ref) {\n return (\n <BasePreviewCard.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-preview-card-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\nconst Popup = forwardRef<HTMLDivElement, PreviewCardPopupProps>(\n function PreviewCardPopup({ className, ...props }, ref) {\n return (\n <BasePreviewCard.Popup\n ref={ref}\n className={cn(\n \"gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport const PreviewCard = {\n Root: BasePreviewCard.Root,\n Trigger: BasePreviewCard.Trigger,\n Portal: BasePreviewCard.Portal,\n Positioner,\n Popup,\n Arrow: BasePreviewCard.Arrow\n};\n","import { Toolbar as BaseToolbar } from \"@base-ui/react/toolbar\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ToolbarRootProps = ComponentPropsWithoutRef<\n typeof BaseToolbar.Root\n>;\n\n/**\n * A strip of controls that share one tab stop.\n *\n * The point is the keyboard model: Tab enters the toolbar once and the arrow\n * keys move between its buttons, so a call bar with eight controls costs one\n * stop on the way to the message box instead of eight.\n */\nconst Root = forwardRef<HTMLDivElement, ToolbarRootProps>(function Toolbar(\n { className, ...props },\n ref\n) {\n return (\n <BaseToolbar.Root\n ref={ref}\n className={cn(\n \"gryt-toolbar flex items-center gap-1\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Separator = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToolbar.Separator>\n>(function ToolbarSeparator({ className, ...props }, ref) {\n return (\n <BaseToolbar.Separator\n ref={ref}\n className={cn(\"gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border\", className)}\n {...props}\n />\n );\n});\n\nexport const Toolbar = {\n Root,\n Group: BaseToolbar.Group,\n Button: BaseToolbar.Button,\n Link: BaseToolbar.Link,\n Input: BaseToolbar.Input,\n Separator\n};\n"],"names":["grytTokens","createGrytTheme","options","color","radius","isCssVariables","value","key","GrytProvider","children","className","theme","tooltipDelay","style","jsx","Tooltip","cn","inputs","twMerge","clsx","toneStyles","sizeStyles","Button","forwardRef","endIcon","size","startIcon","tone","props","ref","jsxs","BaseButton","focusRing","popupSurface","popupMotion","disabledState","toneCheckedFill","toneBg","toneCheckedBorder","toneCheckedBg","IconButton","Surface","elevated","MessageBubble","from","TextField","error","fieldClassName","helperText","label","minRows","multiline","control","Field","Composer","disabled","maxRows","onSubmit","placeholder","submitLabel","innerRef","useRef","resize","useCallback","node","styles","lineHeight","vertical","useLayoutEffect","handleSubmit","event","PaperPlaneTilt","Avatar","alt","fallback","src","BaseAvatar","ConversationItem","active","avatar","subtitle","title","Badge","badgeContent","max","showZero","numeric","hidden","display","Chip","icon","onDelete","X","Checkbox","BaseCheckbox","Check","Radio","BaseRadio","RadioGroup","BaseRadioGroup","Switch","BaseSwitch","Slider","ariaLabel","BaseSlider","Select","BaseSelect","CaretUpDown","option","side","sideOffset","BaseTooltip","TooltipProvider","Divider","orientation","Separator","Card","CardHeader","subheader","CardContent","CardActions","severityStyles","Alert","severity","Progress","BaseProgress","Spinner","CircleNotch","variantStyles","Skeleton","height","variant","width","sizing","motion","Backdrop","BaseDialog","Popup","Title","Description","Footer","Dialog","noop","useMediaQuery","query","subscribe","onChange","list","getSnapshot","useSyncExternalStore","swipeBySide","SideContext","createContext","viewportBySide","radiusBySide","popupBySide","Root","sheetOnMobile","isMobile","resolved","BaseDrawer","Viewport","useContext","Grabber","Drawer","Positioner","BaseMenu","Item","Menu","BaseTabs","List","Tab","Indicator","Panel","Tabs","BaseAccordion","Trigger","expandIcon","CaretDown","Accordion","BaseContextMenu","ContextMenu","BasePopover","Popover","BaseToast","Close","Action","Toast","useToastManager","BaseScrollArea","Scrollbar","ScrollArea","Toggle","BaseToggle","ToggleGroup","BaseToggleGroup","toneFill","Meter","showValue","BaseMeter","BaseAlertDialog","AlertDialog","listboxItemClass","listboxInputClass","Input","BaseCombobox","Empty","Combobox","BaseAutocomplete","Autocomplete","CheckboxGroup","BaseCheckboxGroup","BaseCollapsible","Collapsible","Form","BaseForm","FieldsetRoot","BaseFieldset","Legend","Fieldset","Menubar","BaseMenubar","BaseNavigationMenu","Link","NavigationMenu","stepButton","NumberField","scrubbable","BaseNumberField","Minus","Plus","OtpField","length","BaseOtpField","_unused","index","BasePreviewCard","PreviewCard","BaseToolbar","Toolbar"],"mappings":"mkDAEaA,EAAa,CACxB,MA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f,EAAAA,IAACgO,EAAAA,QAAY,UAAZ,CACC,IAAAjN,EACA,UAAWb,EAAG,sDAAuDN,CAAS,EAC7E,GAAGkB,CAAA,CAAA,CAGV,CAAC,EAEYmN,GAAU,CACrB,KAAAnF,GACA,MAAOkF,EAAAA,QAAY,MACnB,OAAQA,EAAAA,QAAY,OACpB,KAAMA,EAAAA,QAAY,KAClB,MAAOA,EAAAA,QAAY,MACnB,UAAA3H,EACF"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/theme/createGrytTheme.ts","../src/GrytProvider.tsx","../src/components/utils/cn.ts","../src/components/Button/Button.tsx","../src/components/utils/styles.ts","../src/components/IconButton/IconButton.tsx","../src/components/Surface/Surface.tsx","../src/components/MessageBubble/MessageBubble.tsx","../src/components/TextField/TextField.tsx","../src/components/Composer/Composer.tsx","../src/components/Avatar/Avatar.tsx","../src/components/ConversationItem/ConversationItem.tsx","../src/components/Badge/Badge.tsx","../src/components/Chip/Chip.tsx","../src/components/Checkbox/Checkbox.tsx","../src/components/Radio/Radio.tsx","../src/components/Switch/Switch.tsx","../src/components/Slider/Slider.tsx","../src/components/Select/Select.tsx","../src/components/Tooltip/Tooltip.tsx","../src/components/Divider/Divider.tsx","../src/components/Card/Card.tsx","../src/components/Alert/Alert.tsx","../src/components/Progress/Progress.tsx","../src/components/Skeleton/Skeleton.tsx","../src/components/Dialog/Dialog.tsx","../src/components/utils/useMediaQuery.ts","../src/components/Drawer/Drawer.tsx","../src/components/Menu/Menu.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Accordion/Accordion.tsx","../src/components/ContextMenu/ContextMenu.tsx","../src/components/Popover/Popover.tsx","../src/components/Toast/Toast.tsx","../src/components/ScrollArea/ScrollArea.tsx","../src/components/Toggle/Toggle.tsx","../src/components/Meter/Meter.tsx","../src/components/AlertDialog/AlertDialog.tsx","../src/components/Combobox/Combobox.tsx","../src/components/Autocomplete/Autocomplete.tsx","../src/components/Checkbox/CheckboxGroup.tsx","../src/components/Collapsible/Collapsible.tsx","../src/components/Form/Form.tsx","../src/components/NavigationMenu/NavigationMenu.tsx","../src/components/NumberField/NumberField.tsx","../src/components/OtpField/OtpField.tsx","../src/components/PreviewCard/PreviewCard.tsx","../src/components/Toolbar/Toolbar.tsx"],"sourcesContent":["import type { CSSProperties } from \"react\";\n\nexport const grytTokens = {\n color: {\n bg: \"#111318\",\n surface: \"#1a1d24\",\n surfaceRaised: \"#1e2028\",\n surfaceHover: \"#334155\",\n border: \"#2b303d\",\n text: \"#e0e0e6\",\n muted: \"#888888\",\n accent: \"#968FF8\",\n accentLight: \"#b4afff\",\n secondary: \"#7dd3fc\",\n secondaryLight: \"#bae6fd\",\n success: \"#4ade80\",\n danger: \"#f87171\",\n dangerLight: \"#fca5a5\",\n warning: \"#fbbf24\",\n onAccent: \"#141126\",\n onSecondary: \"#07131c\",\n onDanger: \"#250b0b\"\n },\n radius: {\n sm: 8,\n md: 12,\n lg: 20,\n xl: 28,\n full: 999\n }\n} as const;\n\nexport type GrytTokens = typeof grytTokens;\n\n// Widened off the `as const` token types on purpose. Partial<GrytTokens> would\n// inherit the literal types, so an override could only ever be re-assigned its\n// own current value.\nexport interface GrytThemeOptions {\n color?: Partial<Record<keyof GrytTokens[\"color\"], string>>;\n radius?: Partial<Record<keyof GrytTokens[\"radius\"], number>>;\n}\n\n// This used to return a MUI theme object. There is no theme object now — the\n// components read CSS custom properties, so a theme is the set of variables to\n// put on an element. Returning CSSProperties means it drops straight into a\n// style prop, and overriding one token does not require reproducing the rest.\nexport function createGrytTheme(options: GrytThemeOptions = {}): CSSProperties {\n const color = { ...grytTokens.color, ...options.color };\n const radius = { ...grytTokens.radius, ...options.radius };\n\n return {\n \"--gryt-bg\": color.bg,\n \"--gryt-surface\": color.surface,\n \"--gryt-surface-raised\": color.surfaceRaised,\n \"--gryt-surface-hover\": color.surfaceHover,\n \"--gryt-border\": color.border,\n \"--gryt-text\": color.text,\n \"--gryt-muted\": color.muted,\n \"--gryt-accent\": color.accent,\n \"--gryt-accent-light\": color.accentLight,\n \"--gryt-secondary\": color.secondary,\n \"--gryt-secondary-light\": color.secondaryLight,\n \"--gryt-success\": color.success,\n \"--gryt-danger\": color.danger,\n \"--gryt-danger-light\": color.dangerLight,\n \"--gryt-warning\": color.warning,\n \"--gryt-on-accent\": color.onAccent,\n \"--gryt-on-secondary\": color.onSecondary,\n \"--gryt-on-danger\": color.onDanger,\n\n // Tailwind's @theme emits --color-* names, and the utilities compile\n // against those. Both sets have to move together or an override would\n // change the raw var but not bg-gryt-accent.\n \"--color-gryt-bg\": color.bg,\n \"--color-gryt-surface\": color.surface,\n \"--color-gryt-surface-raised\": color.surfaceRaised,\n \"--color-gryt-surface-hover\": color.surfaceHover,\n \"--color-gryt-border\": color.border,\n \"--color-gryt-text\": color.text,\n \"--color-gryt-muted\": color.muted,\n \"--color-gryt-accent\": color.accent,\n \"--color-gryt-accent-light\": color.accentLight,\n \"--color-gryt-secondary\": color.secondary,\n \"--color-gryt-secondary-light\": color.secondaryLight,\n \"--color-gryt-success\": color.success,\n \"--color-gryt-danger\": color.danger,\n \"--color-gryt-danger-light\": color.dangerLight,\n \"--color-gryt-warning\": color.warning,\n \"--color-gryt-on-accent\": color.onAccent,\n \"--color-gryt-on-secondary\": color.onSecondary,\n \"--color-gryt-on-danger\": color.onDanger,\n\n \"--gryt-radius-sm\": `${radius.sm}px`,\n \"--gryt-radius-md\": `${radius.md}px`,\n \"--gryt-radius-lg\": `${radius.lg}px`,\n \"--gryt-radius-xl\": `${radius.xl}px`,\n \"--gryt-radius-full\": `${radius.full}px`\n } as CSSProperties;\n}\n","import { Tooltip } from \"@base-ui/react/tooltip\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { createGrytTheme } from \"./theme/createGrytTheme\";\nimport type { GrytThemeOptions } from \"./theme/createGrytTheme\";\n\nexport interface GrytProviderProps {\n children: ReactNode;\n // Either the object from createGrytTheme, or the options to build one from.\n theme?: CSSProperties | GrytThemeOptions;\n className?: string;\n // Shared hover delay for every Tooltip below this provider, in milliseconds.\n tooltipDelay?: number;\n}\n\nfunction isCssVariables(value: object): value is CSSProperties {\n return Object.keys(value).some((key) => key.startsWith(\"--\"));\n}\n\n// There is no ThemeProvider and no CssBaseline any more. What a provider still\n// has to do is put the theme variables somewhere the components can read them,\n// and mount Base UI's tooltip provider so hover timing is shared between\n// triggers rather than restarting at every one.\nexport function GrytProvider({\n children,\n className,\n theme,\n tooltipDelay = 400\n}: GrytProviderProps) {\n const style =\n theme && isCssVariables(theme) ? theme : createGrytTheme(theme ?? {});\n\n return (\n <div className={className} style={style}>\n <Tooltip.Provider delay={tooltipDelay}>{children}</Tooltip.Provider>\n </div>\n );\n}\n","import { clsx } from \"clsx\";\nimport type { ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}","import { Button as BaseButton } from \"@base-ui/react/button\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\ntype ButtonTone = \"primary\" | \"secondary\" | \"neutral\" | \"danger\" | \"ghost\";\ntype ButtonSize = \"xsmall\" | \"small\" | \"medium\" | \"large\";\n\n// Base UI marks a disabled button with data-disabled rather than the native\n// attribute, because it stays focusable when disabled. Hover and press styles\n// hang off not-data-disabled so they don't fire on a dead button.\nconst toneStyles: Record<ButtonTone, string> = {\n primary:\n \"bg-gryt-accent text-gryt-on-accent hover:not-data-disabled:bg-gryt-accent-light\",\n secondary:\n \"bg-gryt-secondary text-gryt-on-secondary hover:not-data-disabled:bg-gryt-secondary-light\",\n neutral:\n \"bg-gryt-surface-raised text-gryt-text hover:not-data-disabled:bg-gryt-surface-hover\",\n danger:\n \"bg-gryt-danger text-gryt-on-danger hover:not-data-disabled:bg-gryt-danger-light\",\n ghost:\n \"bg-transparent text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text\"\n};\n\nconst sizeStyles: Record<ButtonSize, string> = {\n xsmall: \"min-h-8 px-3 text-xs\",\n small: \"min-h-9 px-4 text-sm\",\n medium: \"min-h-10 px-5 text-sm\",\n large: \"min-h-12 px-6 text-base\"\n};\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseButton>, \"className\"> {\n tone?: ButtonTone;\n size?: ButtonSize;\n className?: string;\n // Carried over from the MUI-based Button. Base UI has no equivalent, but\n // dropping them would break every existing call site for no gain — the flex\n // gap below already spaces them correctly.\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n children,\n className,\n endIcon,\n size = \"medium\",\n startIcon,\n tone = \"primary\",\n ...props\n },\n ref\n ) {\n return (\n <BaseButton\n ref={ref}\n className={cn(\n \"gryt-button\",\n \"inline-flex items-center justify-center gap-2 border-0 shadow-none\",\n \"rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none\",\n // scale, not transform: Tailwind v4's scale-* utilities set the\n // standalone `scale` property, so transitioning `transform` alone\n // leaves the hover grow snapping instantly.\n \"transition-[scale,background-color,color]\",\n \"duration-(--gryt-dur-spring) ease-spring\",\n\n // Press travels further than hover, so the button reads as being\n // pushed down rather than just acknowledging the cursor.\n // A button that opens something does not grow under the cursor.\n // Base UI positions the popup against the trigger's measured box, and\n // it keeps measuring while the popup is open — so a trigger that\n // scales on hover drags its own menu a pixel or two sideways every\n // time the pointer crosses it. aria-haspopup is how the trigger says\n // that is what it is; Base UI puts it there, nothing to pass.\n \"motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]\",\n \"motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]\",\n\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n >\n {startIcon}\n {children}\n {endIcon}\n </BaseButton>\n );\n }\n);\n","// Shared class fragments. These exist so that \"flat, Gryt palette\" is decided\n// once rather than 24 times, and so a change to the focus ring or the popup\n// surface lands everywhere at once.\n\nexport const focusRing =\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\";\n\n// The same ring, for a control whose focusable element is a child rather than\n// itself. Base UI's Slider is the case: the thumb you can see is a div, and\n// the thing that takes focus is a visually hidden input inside it, so\n// focus-visible on the thumb never matches and the ring never appears.\nexport const focusRingWithin =\n \"has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light\";\n\n/**\n * What a text input looks like: TextField, and the typeahead inputs on\n * Combobox and Autocomplete.\n *\n * Shared because they had already drifted. The listbox inputs asked for\n * `rounded-(--gryt-radius-input)`, a token that does not exist — the library\n * ships sm, md, lg, xl and full — so the declaration was invalid and both\n * rendered with square corners in a library where every other control is\n * rounded. That is the kind of thing a shared constant makes impossible rather\n * than merely unlikely.\n *\n * The border *colour* is left to the caller: TextField swaps it for danger when\n * the field is invalid, and baking one in here would mean fighting it back off.\n */\nexport const fieldControl = [\n \"w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised\",\n \"text-gryt-text outline-none placeholder:text-gryt-muted\",\n \"transition-colors duration-150 motion-reduce:transition-none\",\n \"hover:border-gryt-accent-light focus:border-gryt-accent\",\n \"disabled:cursor-not-allowed disabled:opacity-60\"\n].join(\" \");\n\n/** Matching heights and padding for the two sizes a field comes in. */\nexport const fieldSizes = {\n small: \"min-h-9 px-3 py-1.5 text-sm\",\n medium: \"min-h-11 px-4 py-2.5 text-sm\"\n} as const;\n\nexport type FieldSize = keyof typeof fieldSizes;\n\n// Every floating surface: menu, select list, tooltip, dialog, drawer. Flat —\n// a border rather than a shadow.\nexport const popupSurface =\n \"rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text\";\n\n// Base UI sets data-starting-style and data-ending-style for one frame either\n// side of open and close. The element carries the transition itself.\nexport const popupMotion = [\n // scale and translate are named explicitly because Tailwind v4 sets them as\n // standalone CSS properties rather than folding them into `transform`, so\n // transitioning `transform` would leave the popup snapping into place.\n \"transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\"\n].join(\" \");\n\nexport const disabledState =\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\";\n\n// The tones shared by Checkbox, Radio, Switch and Slider. One union so a\n// component cannot invent its own sixth colour. Button and IconButton keep\n// their own lists, because \"ghost\" only makes sense on a button.\nexport type Tone =\n | \"primary\"\n | \"secondary\"\n | \"neutral\"\n | \"danger\"\n | \"success\"\n | \"warning\";\n\nexport const toneAccent: Record<Tone, string> = {\n primary: \"text-gryt-accent\",\n secondary: \"text-gryt-secondary\",\n neutral: \"text-gryt-muted\",\n danger: \"text-gryt-danger\",\n success: \"text-gryt-success\",\n warning: \"text-gryt-warning\"\n};\n\n// Filled backgrounds, for the checked state of a control.\nexport const toneFill: Record<Tone, string> = {\n primary: \"bg-gryt-accent text-gryt-on-accent\",\n secondary: \"bg-gryt-secondary text-gryt-on-secondary\",\n neutral: \"bg-gryt-surface-hover text-gryt-text\",\n danger: \"bg-gryt-danger text-gryt-on-danger\",\n success: \"bg-gryt-success text-gryt-on-accent\",\n warning: \"bg-gryt-warning text-gryt-on-accent\"\n};\n\nexport const toneBorder: Record<Tone, string> = {\n primary: \"border-gryt-accent\",\n secondary: \"border-gryt-secondary\",\n neutral: \"border-gryt-border\",\n danger: \"border-gryt-danger\",\n success: \"border-gryt-success\",\n warning: \"border-gryt-warning\"\n};\n\n// Written out in full rather than composed from toneFill at runtime. Tailwind\n// scans source text for class names, so a class built by interpolation exists\n// on the element and nowhere in the stylesheet.\nexport const toneCheckedFill: Record<Tone, string> = {\n primary: \"data-checked:bg-gryt-accent data-checked:text-gryt-on-accent\",\n secondary:\n \"data-checked:bg-gryt-secondary data-checked:text-gryt-on-secondary\",\n neutral: \"data-checked:bg-gryt-surface-hover data-checked:text-gryt-text\",\n danger: \"data-checked:bg-gryt-danger data-checked:text-gryt-on-danger\",\n success: \"data-checked:bg-gryt-success data-checked:text-gryt-on-accent\",\n warning: \"data-checked:bg-gryt-warning data-checked:text-gryt-on-accent\"\n};\n\n// Track fill for Switch, and bar fill for Slider.\nexport const toneBg: Record<Tone, string> = {\n primary: \"bg-gryt-accent\",\n secondary: \"bg-gryt-secondary\",\n neutral: \"bg-gryt-surface-hover\",\n danger: \"bg-gryt-danger\",\n success: \"bg-gryt-success\",\n warning: \"bg-gryt-warning\"\n};\n\nexport const toneCheckedBorder: Record<Tone, string> = {\n primary: \"data-checked:border-gryt-accent\",\n secondary: \"data-checked:border-gryt-secondary\",\n neutral: \"data-checked:border-gryt-muted\",\n danger: \"data-checked:border-gryt-danger\",\n success: \"data-checked:border-gryt-success\",\n warning: \"data-checked:border-gryt-warning\"\n};\n\nexport const toneCheckedBg: Record<Tone, string> = {\n primary: \"data-checked:bg-gryt-accent\",\n secondary: \"data-checked:bg-gryt-secondary\",\n neutral: \"data-checked:bg-gryt-surface-hover\",\n danger: \"data-checked:bg-gryt-danger\",\n success: \"data-checked:bg-gryt-success\",\n warning: \"data-checked:bg-gryt-warning\"\n};\n","import { Button as BaseButton } from \"@base-ui/react/button\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing } from \"../utils/styles\";\n\ntype IconButtonTone = \"primary\" | \"secondary\" | \"neutral\" | \"danger\" | \"ghost\";\ntype IconButtonSize = \"xsmall\" | \"small\" | \"medium\" | \"large\";\n\n// The hover fills are the tone colour at low alpha, so an icon button reads as\n// a tinted target rather than a filled one.\nconst toneStyles: Record<IconButtonTone, string> = {\n primary: \"text-gryt-accent hover:not-data-disabled:bg-gryt-accent/10\",\n secondary:\n \"text-gryt-secondary hover:not-data-disabled:bg-gryt-secondary/10\",\n neutral:\n \"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text\",\n danger: \"text-gryt-danger hover:not-data-disabled:bg-gryt-danger/10\",\n ghost:\n \"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text\"\n};\n\nconst sizeStyles: Record<IconButtonSize, string> = {\n xsmall: \"h-8 w-8\",\n small: \"h-9 w-9\",\n medium: \"h-10 w-10\",\n large: \"h-12 w-12\"\n};\n\nexport interface IconButtonProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseButton>, \"className\"> {\n tone?: IconButtonTone;\n size?: IconButtonSize;\n className?: string;\n}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton(\n { className, size = \"medium\", tone = \"neutral\", ...props },\n ref\n ) {\n return (\n <BaseButton\n ref={ref}\n className={cn(\n \"gryt-icon-button\",\n \"inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0\",\n \"rounded-(--gryt-radius-full) select-none\",\n // scale rather than transform — see the note in Button.\n \"transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring\",\n // A button that opens something does not grow under the cursor.\n // Base UI positions the popup against the trigger's measured box, and\n // it keeps measuring while the popup is open — so a trigger that\n // scales on hover drags its own menu a pixel or two sideways every\n // time the pointer crosses it. aria-haspopup is how the trigger says\n // that is what it is; Base UI puts it there, nothing to pass.\n \"motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]\",\n \"motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]\",\n focusRing,\n disabledState,\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface SurfaceProps extends HTMLAttributes<HTMLDivElement> {\n elevated?: boolean;\n}\n\nexport const Surface = forwardRef<HTMLDivElement, SurfaceProps>(\n function Surface({ className, elevated = false, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text\",\n elevated ? \"bg-gryt-surface-raised\" : \"bg-gryt-surface\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface MessageBubbleProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n from?: \"user\" | \"assistant\" | \"system\";\n}\n\nexport const MessageBubble = forwardRef<HTMLDivElement, MessageBubbleProps>(\n function MessageBubble(\n { children, className, from = \"assistant\", ...props },\n ref\n ) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-message-bubble\",\n from === \"user\" && \"ml-auto bg-gryt-accent text-gryt-on-accent\",\n from === \"assistant\" &&\n \"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text\",\n from === \"system\" &&\n \"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n","import { Field } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { fieldControl, fieldSizes } from \"../utils/styles\";\n\n// The two sizes live in utils/styles, shared with the Combobox and\n// Autocomplete inputs so all three keep the same shape.\nexport type TextFieldSize = \"small\" | \"medium\";\n\nexport interface TextFieldProps\n extends Omit<\n ComponentPropsWithoutRef<typeof Field.Control>,\n \"className\" | \"size\"\n > {\n label?: ReactNode;\n helperText?: ReactNode;\n error?: boolean;\n size?: TextFieldSize;\n multiline?: boolean;\n minRows?: number;\n className?: string;\n fieldClassName?: string;\n}\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n {\n className,\n error = false,\n fieldClassName,\n helperText,\n label,\n minRows = 3,\n multiline = false,\n size = \"medium\",\n ...props\n },\n ref\n ) {\n const control = (\n <Field.Control\n ref={ref}\n // Field.Control renders an input by default; render swaps the element\n // while keeping the field wiring, which is how label association and\n // aria-describedby survive the switch to a textarea.\n render={multiline ? <textarea rows={minRows} /> : undefined}\n className={cn(\n \"gryt-text-field-control\",\n fieldControl,\n multiline && \"resize-y leading-6\",\n error ? \"border-gryt-danger\" : \"border-gryt-border\",\n fieldSizes[size],\n className\n )}\n {...props}\n />\n );\n\n return (\n <Field.Root\n className={cn(\n \"gryt-text-field flex w-full flex-col gap-1.5\",\n fieldClassName\n )}\n >\n {label ? (\n <Field.Label className=\"text-xs font-medium text-gryt-muted\">\n {label}\n </Field.Label>\n ) : null}\n {control}\n {helperText ? (\n <Field.Description\n className={cn(\n \"text-xs\",\n error ? \"text-gryt-danger\" : \"text-gryt-muted\"\n )}\n >\n {helperText}\n </Field.Description>\n ) : null}\n </Field.Root>\n );\n }\n);\n","import { PaperPlaneTilt } from \"@phosphor-icons/react\";\nimport { useCallback, useLayoutEffect, useRef } from \"react\";\nimport type {\n FormEvent,\n FormEventHandler,\n TextareaHTMLAttributes\n} from \"react\";\nimport { forwardRef } from \"react\";\nimport { Button } from \"../Button/Button\";\nimport { cn } from \"../utils/cn\";\n\nexport interface ComposerProps\n extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, \"onSubmit\"> {\n onSubmit?: FormEventHandler<HTMLFormElement>;\n submitLabel?: string;\n disabled?: boolean;\n minRows?: number;\n maxRows?: number;\n}\n\nexport const Composer = forwardRef<HTMLTextAreaElement, ComposerProps>(\n function Composer(\n {\n className,\n disabled = false,\n maxRows = 8,\n minRows = 1,\n onSubmit,\n placeholder = \"Message Gryt\",\n submitLabel = \"Send\",\n ...props\n },\n ref\n ) {\n const innerRef = useRef<HTMLTextAreaElement | null>(null);\n\n // Replaces MUI's TextareaAutosize. Reset to auto first, otherwise\n // scrollHeight only ever reports the current height and the box can grow\n // but never shrink.\n const resize = useCallback(() => {\n const node = innerRef.current;\n if (!node) {\n return;\n }\n\n const styles = window.getComputedStyle(node);\n const lineHeight = parseFloat(styles.lineHeight) || 24;\n const vertical =\n parseFloat(styles.paddingTop) + parseFloat(styles.paddingBottom);\n\n node.style.height = \"auto\";\n node.style.height = `${Math.min(\n Math.max(node.scrollHeight, lineHeight * minRows + vertical),\n lineHeight * maxRows + vertical\n )}px`;\n }, [maxRows, minRows]);\n\n useLayoutEffect(resize, [resize, props.value]);\n\n function handleSubmit(event: FormEvent<HTMLFormElement>) {\n if (!onSubmit) {\n event.preventDefault();\n return;\n }\n\n onSubmit(event);\n }\n\n return (\n <form className={cn(\"gryt-composer\", className)} onSubmit={handleSubmit}>\n <textarea\n ref={(node) => {\n innerRef.current = node;\n if (typeof ref === \"function\") {\n ref(node);\n } else if (ref) {\n ref.current = node;\n }\n }}\n rows={minRows}\n disabled={disabled}\n placeholder={placeholder}\n onInput={resize}\n className=\"gryt-composer-textarea disabled:cursor-not-allowed disabled:opacity-60\"\n {...props}\n />\n <Button\n type=\"submit\"\n disabled={disabled}\n size=\"small\"\n endIcon={<PaperPlaneTilt size={14} weight=\"fill\" />}\n >\n {submitLabel}\n </Button>\n </form>\n );\n }\n);\n","import { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type AvatarSize = \"small\" | \"medium\" | \"large\";\n\nconst sizeStyles: Record<AvatarSize, string> = {\n small: \"h-8 w-8 text-xs\",\n medium: \"h-10 w-10 text-sm\",\n large: \"h-12 w-12 text-base\"\n};\n\nexport interface AvatarProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseAvatar.Root>, \"className\"> {\n src?: string;\n alt?: string;\n size?: AvatarSize;\n className?: string;\n // Shown while the image loads and if it fails. Falls back to children, which\n // is how the old MUI-based Avatar was called: <Avatar>G</Avatar>.\n fallback?: ReactNode;\n}\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n { alt, children, className, fallback, size = \"medium\", src, ...props },\n ref\n) {\n return (\n <BaseAvatar.Root\n ref={ref}\n className={cn(\n \"gryt-avatar inline-flex shrink-0 items-center justify-center overflow-hidden align-middle select-none\",\n \"rounded-(--gryt-radius-full) bg-gryt-surface-raised font-medium text-gryt-text ring-1 ring-gryt-border\",\n sizeStyles[size],\n className\n )}\n {...props}\n >\n {src ? (\n <BaseAvatar.Image\n src={src}\n alt={alt}\n className=\"h-full w-full object-cover\"\n />\n ) : null}\n <BaseAvatar.Fallback className=\"flex h-full w-full items-center justify-center\">\n {fallback ?? children}\n </BaseAvatar.Fallback>\n </BaseAvatar.Root>\n );\n});\n","import { Avatar } from \"../Avatar/Avatar\";\nimport type { ButtonHTMLAttributes, ReactNode } from \"react\";\nimport { forwardRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface ConversationItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n title: string;\n subtitle?: string;\n active?: boolean;\n avatar?: ReactNode;\n}\n\nexport const ConversationItem = forwardRef<\n HTMLButtonElement,\n ConversationItemProps\n>(function ConversationItem(\n { active = false, avatar, className, subtitle, title, ...props },\n ref\n) {\n return (\n <button\n ref={ref}\n type=\"button\"\n className={cn(\n \"gryt-conversation-item\",\n active\n ? \"bg-gryt-accent text-gryt-on-accent\"\n : \"text-gryt-text hover:bg-white/5\",\n className\n )}\n {...props}\n >\n {avatar ?? (\n <Avatar\n size=\"small\"\n className={cn(\n active\n ? \"bg-gryt-on-accent text-gryt-accent ring-transparent\"\n : \"bg-gryt-surface-raised text-gryt-text\"\n )}\n >\n {title.slice(0, 1).toUpperCase()}\n </Avatar>\n )}\n <span className=\"min-w-0 flex-1\">\n <span className=\"block truncate text-sm font-semibold\">{title}</span>\n {subtitle ? (\n <span\n className={cn(\n \"block truncate text-xs\",\n active ? \"text-gryt-on-accent/70\" : \"text-gryt-muted\"\n )}\n >\n {subtitle}\n </span>\n ) : null}\n </span>\n </button>\n );\n});\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n // Anchored to the top-right of children. A count, a dot, or anything else.\n badgeContent?: ReactNode;\n // Hide when the count is zero, matching how a notification badge is normally\n // wanted. Set false to keep a literal 0 on screen.\n showZero?: boolean;\n max?: number;\n}\n\nexport const Badge = forwardRef<HTMLSpanElement, BadgeProps>(function Badge(\n { badgeContent, children, className, max = 99, showZero = false, ...props },\n ref\n) {\n const numeric = typeof badgeContent === \"number\" ? badgeContent : null;\n const hidden = numeric !== null && numeric === 0 && !showZero;\n const display =\n numeric !== null && numeric > max ? `${max}+` : badgeContent;\n\n return (\n <span\n ref={ref}\n className={cn(\"gryt-badge relative inline-flex\", className)}\n {...props}\n >\n {children}\n {badgeContent !== undefined && !hidden ? (\n <span\n className={cn(\n \"gryt-badge-dot absolute -top-1 -right-1 z-10 inline-flex items-center justify-center\",\n \"min-w-5 rounded-(--gryt-radius-full) px-1.5 py-0.5\",\n \"bg-gryt-accent text-[0.65rem] leading-none font-semibold text-gryt-on-accent\",\n \"ring-2 ring-gryt-bg\"\n )}\n >\n {display}\n </span>\n ) : null}\n </span>\n );\n});\n","import { X } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type ChipTone =\n | \"neutral\"\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"danger\";\n\nconst toneStyles: Record<ChipTone, string> = {\n neutral: \"border-gryt-border bg-gryt-surface-raised text-gryt-text\",\n primary: \"border-gryt-accent/40 bg-gryt-accent/12 text-gryt-accent\",\n secondary:\n \"border-gryt-secondary/40 bg-gryt-secondary/12 text-gryt-secondary\",\n success: \"border-gryt-success/40 bg-gryt-success/12 text-gryt-success\",\n warning: \"border-gryt-warning/40 bg-gryt-warning/12 text-gryt-warning\",\n danger: \"border-gryt-danger/40 bg-gryt-danger/12 text-gryt-danger\"\n};\n\nexport interface ChipProps\n extends Omit<HTMLAttributes<HTMLSpanElement>, \"onDelete\"> {\n label?: ReactNode;\n tone?: ChipTone;\n icon?: ReactNode;\n onDelete?: () => void;\n}\n\nexport const Chip = forwardRef<HTMLSpanElement, ChipProps>(function Chip(\n { children, className, icon, label, onDelete, tone = \"neutral\", ...props },\n ref\n) {\n return (\n <span\n ref={ref}\n className={cn(\n \"gryt-chip inline-flex items-center gap-1.5 rounded-(--gryt-radius-full) border px-3 py-1 text-xs font-medium\",\n toneStyles[tone],\n className\n )}\n {...props}\n >\n {icon}\n {label ?? children}\n {onDelete ? (\n <button\n type=\"button\"\n aria-label=\"Remove\"\n onClick={onDelete}\n className={cn(\n \"-mr-1 inline-flex h-4 w-4 items-center justify-center rounded-(--gryt-radius-full)\",\n \"opacity-70 transition-opacity hover:opacity-100\",\n focusRing\n )}\n >\n <X size={10} weight=\"bold\" aria-hidden=\"true\" />\n </button>\n ) : null}\n </span>\n );\n});\n","import { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { Check } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing, toneCheckedFill } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface CheckboxProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseCheckbox.Root>,\n \"className\"\n > {\n tone?: Tone;\n className?: string;\n}\n\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox({ className, tone = \"primary\", ...props }, ref) {\n return (\n <BaseCheckbox.Root\n ref={ref}\n className={cn(\n \"gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center\",\n \"rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"data-checked:border-transparent\",\n // Same grow-and-press as the buttons, so a control reacts to the\n // cursor before it is clicked rather than only after.\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.08]\",\n \"motion-safe:active:not-data-disabled:scale-[0.92]\",\n focusRing,\n disabledState,\n // Unchecked stays a neutral outline; the tone only paints once checked.\n toneCheckedFill[tone],\n className\n )}\n {...props}\n >\n {/* keepMounted is load-bearing: without it Base UI unmounts the\n indicator whenever the box is unchecked, so data-unchecked never\n applies to anything and there is no element to transition from —\n the tick just appears. Kept in the DOM, it can scale and fade in\n both directions. */}\n <BaseCheckbox.Indicator\n keepMounted\n className={cn(\n \"flex origin-center\",\n \"transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring\",\n // Scaling from 0 rather than from something near 1 is deliberate.\n // The spring's overshoot is a percentage of the travel, so a tick\n // going 0 -> 1 overshoots to 1.12 and visibly springs, while one\n // going 0.95 -> 1 overshoots by 0.006 and does nothing at all.\n \"data-unchecked:scale-0 data-unchecked:opacity-0\",\n \"motion-reduce:transition-none\"\n )}\n >\n <Check size={12} weight=\"bold\" />\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n }\n);\n","import { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport {\n disabledState,\n focusRing,\n toneBg,\n toneCheckedBorder\n} from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface RadioProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseRadio.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n}\n\nexport const Radio = forwardRef<HTMLButtonElement, RadioProps>(function Radio(\n { className, tone = \"primary\", ...props },\n ref\n) {\n return (\n <BaseRadio.Root\n ref={ref}\n className={cn(\n \"gryt-radio flex h-5 w-5 shrink-0 items-center justify-center\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.08]\",\n \"motion-safe:active:not-data-disabled:scale-[0.92]\",\n focusRing,\n disabledState,\n // Border takes the tone when selected; the dot inside carries the fill.\n toneCheckedBorder[tone],\n className\n )}\n {...props}\n >\n {/* keepMounted so there is an element to transition — see Checkbox. */}\n <BaseRadio.Indicator\n keepMounted\n className={cn(\n \"h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)\",\n \"transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring\",\n // From 0, for the same reason as the Checkbox tick — see the note there.\n \"data-unchecked:scale-0 data-unchecked:opacity-0\",\n \"motion-reduce:transition-none\",\n toneBg[tone]\n )}\n />\n </BaseRadio.Root>\n );\n});\n\nexport type RadioGroupProps = ComponentPropsWithoutRef<typeof BaseRadioGroup>;\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup({ className, ...props }, ref) {\n return (\n <BaseRadioGroup\n ref={ref}\n className={cn(\"gryt-radio-group flex flex-col gap-2\", className)}\n {...props}\n />\n );\n }\n);\n","import { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing, toneCheckedBg } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface SwitchProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseSwitch.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(\n function Switch({ className, tone = \"primary\", ...props }, ref) {\n return (\n <BaseSwitch.Root\n ref={ref}\n className={cn(\n \"gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"data-checked:border-transparent\",\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.05]\",\n \"motion-safe:active:not-data-disabled:scale-[0.95]\",\n focusRing,\n disabledState,\n toneCheckedBg[tone],\n className\n )}\n {...props}\n >\n <BaseSwitch.Thumb\n className={cn(\n \"h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text\",\n \"transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-checked:translate-x-4 data-checked:bg-gryt-bg\"\n )}\n />\n </BaseSwitch.Root>\n );\n }\n);\n","import { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, PointerEvent as ReactPointerEvent } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRingWithin, toneBg } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface SliderProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseSlider.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n \"aria-label\"?: string;\n}\n\n/** How far the pointer has to move before a press counts as a drag. */\nconst DRAG_SLOP = 3;\n\n/**\n * The travel is animated, on the spring.\n *\n * Two things about that are worth reading before changing it.\n *\n * It uses --ease-spring-tight rather than --ease-spring. The overshoot in the\n * standard spring is a percentage of the travel, which is texture on a control\n * that scales in place and a problem on one whose travel is its own width: a\n * full-track jump measured 110% along a 919px track, putting the thumb 96px\n * outside the slider before it came back. The thumb still scales on the\n * standard spring, where the overshoot belongs.\n *\n * And it animates on a click or an arrow key but not under a dragging pointer,\n * where a transition means the thumb lags behind the cursor. Base UI's\n * data-dragging is not the right signal for that: it appears on pointerdown,\n * which is also how you click the track, so keying off it would kill the\n * animation for the most common interaction there is. What matters is whether\n * the pointer has actually moved, so that is what is tracked here — with a few\n * pixels of slop, because a mouse rarely stays perfectly still through a click.\n */\nexport function Slider({\n className,\n tone = \"primary\",\n \"aria-label\": ariaLabel,\n ...props\n}: SliderProps) {\n const [dragging, setDragging] = useState(false);\n const origin = useRef<{ x: number; y: number } | null>(null);\n\n useEffect(() => {\n if (!dragging && origin.current === null) {\n return;\n }\n\n // On window rather than the control: the pointer is very often released\n // outside a 6px-tall track, and a pointerup we never hear about leaves the\n // slider stuck in its dragging state with the animation off for good.\n const end = () => {\n origin.current = null;\n setDragging(false);\n };\n\n window.addEventListener(\"pointerup\", end);\n window.addEventListener(\"pointercancel\", end);\n\n return () => {\n window.removeEventListener(\"pointerup\", end);\n window.removeEventListener(\"pointercancel\", end);\n };\n }, [dragging]);\n\n function handlePointerDown(event: ReactPointerEvent<HTMLDivElement>) {\n origin.current = { x: event.clientX, y: event.clientY };\n }\n\n function handlePointerMove(event: ReactPointerEvent<HTMLDivElement>) {\n const start = origin.current;\n if (start === null || dragging) {\n return;\n }\n\n const moved =\n Math.abs(event.clientX - start.x) > DRAG_SLOP ||\n Math.abs(event.clientY - start.y) > DRAG_SLOP;\n\n if (moved) {\n setDragging(true);\n }\n }\n\n // Base UI positions the thumb with inset-inline-start and sizes the fill with\n // width, so those are the properties that move. `translate` stays out of it:\n // that holds the -50% centring offset, and animating it would drift the thumb\n // off the track rather than along it.\n const travel = dragging\n ? \"transition-none\"\n : \"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none\";\n\n return (\n <BaseSlider.Root className={cn(\"gryt-slider w-full\", className)} {...props}>\n <BaseSlider.Control\n className=\"flex w-full touch-none items-center py-2 select-none\"\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n >\n <BaseSlider.Track className=\"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none\">\n <BaseSlider.Indicator\n className={cn(\n \"h-full rounded-(--gryt-radius-full) select-none\",\n \"transition-[width]\",\n travel,\n toneBg[tone]\n )}\n />\n {/* Two elements because they animate on two curves, and one element\n gets one timing function. The thumb travels on the tight spring;\n the dot inside it scales on the standard one, so the press still\n has the overshoot every other control here has. */}\n <BaseSlider.Thumb\n aria-label={ariaLabel}\n className={cn(\n \"group h-4 w-4 rounded-(--gryt-radius-full) select-none\",\n \"transition-[inset-inline-start]\",\n travel,\n // The ring goes on the thumb but the focus lands on the visually\n // hidden input inside it, so this has to match a descendant.\n // Without it the slider is the one control here you cannot see\n // yourself tab to.\n focusRingWithin\n )}\n >\n <span\n className={cn(\n \"block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text\",\n \"transition-[scale] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]\",\n \"motion-reduce:transition-none\"\n )}\n />\n </BaseSlider.Thumb>\n </BaseSlider.Track>\n </BaseSlider.Control>\n </BaseSlider.Root>\n );\n}\n","import { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { CaretUpDown, Check } from \"@phosphor-icons/react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\nexport interface SelectOption {\n label: ReactNode;\n value: string | number;\n disabled?: boolean;\n}\n\nexport type SelectSize = \"small\" | \"medium\";\n\nconst sizeStyles: Record<SelectSize, string> = {\n small: \"min-h-9 px-3 text-sm\",\n medium: \"min-h-11 px-4 text-sm\"\n};\n\nexport interface SelectProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseSelect.Root>,\n \"children\" | \"items\"\n > {\n options?: SelectOption[];\n label?: ReactNode;\n placeholder?: string;\n size?: SelectSize;\n className?: string;\n}\n\nexport function Select({\n className,\n label,\n options = [],\n placeholder = \"Select\",\n size = \"medium\",\n ...props\n}: SelectProps) {\n return (\n <BaseSelect.Root items={options} {...props}>\n <div className={cn(\"gryt-select flex w-full flex-col gap-1.5\", className)}>\n {label ? (\n <BaseSelect.Label className=\"text-xs font-medium text-gryt-muted\">\n {label}\n </BaseSelect.Label>\n ) : null}\n <BaseSelect.Trigger\n className={cn(\n \"flex w-full items-center justify-between gap-2\",\n \"rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface-raised\",\n \"text-gryt-text select-none\",\n \"transition-colors duration-150 hover:border-gryt-accent-light\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-60\",\n focusRing,\n sizeStyles[size]\n )}\n >\n <BaseSelect.Value placeholder={placeholder} />\n <BaseSelect.Icon className=\"shrink-0 text-gryt-muted\">\n <CaretUpDown size={16} />\n </BaseSelect.Icon>\n </BaseSelect.Trigger>\n </div>\n\n <BaseSelect.Portal>\n <BaseSelect.Positioner sideOffset={6} className=\"outline-none\">\n <BaseSelect.Popup\n className={cn(\"min-w-(--anchor-width) p-1\", popupSurface, popupMotion)}\n >\n <BaseSelect.List>\n {options.map((option) => (\n <BaseSelect.Item\n key={String(option.value)}\n value={option.value}\n disabled={option.disabled}\n className={cn(\n \"flex cursor-default items-center justify-between gap-2\",\n \"rounded-(--gryt-radius-md) px-3 py-2 text-sm text-gryt-text\",\n \"outline-none select-none data-highlighted:bg-gryt-surface-raised\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\"\n )}\n >\n <BaseSelect.ItemText>{option.label}</BaseSelect.ItemText>\n <BaseSelect.ItemIndicator className=\"text-gryt-accent\">\n <Check size={14} weight=\"bold\" />\n </BaseSelect.ItemIndicator>\n </BaseSelect.Item>\n ))}\n </BaseSelect.List>\n </BaseSelect.Popup>\n </BaseSelect.Positioner>\n </BaseSelect.Portal>\n </BaseSelect.Root>\n );\n}\n","import { Tooltip as BaseTooltip } from \"@base-ui/react/tooltip\";\nimport type { ReactElement, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion } from \"../utils/styles\";\n\nexport interface TooltipProps {\n // Kept as a single-child wrapper rather than exposing Base UI's five parts.\n // Both MUI and Radix Themes spell a tooltip this way, so client call sites\n // move across unchanged, and a tooltip has no useful middle ground to\n // compose anyway.\n title: ReactNode;\n children: ReactElement;\n side?: \"top\" | \"bottom\" | \"left\" | \"right\";\n sideOffset?: number;\n className?: string;\n}\n\n// Hover delay is not set here — it belongs to Tooltip.Provider, which shares\n// timing across every tooltip so moving between two triggers does not restart\n// the wait. GrytProvider renders one; see its tooltipDelay prop.\nexport function Tooltip({\n children,\n className,\n side = \"top\",\n sideOffset = 8,\n title\n}: TooltipProps) {\n return (\n <BaseTooltip.Root>\n <BaseTooltip.Trigger render={children} />\n <BaseTooltip.Portal>\n <BaseTooltip.Positioner side={side} sideOffset={sideOffset}>\n <BaseTooltip.Popup\n className={cn(\n \"gryt-tooltip rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface-raised\",\n \"px-2.5 py-1.5 text-xs text-gryt-text\",\n popupMotion,\n className\n )}\n >\n {title}\n </BaseTooltip.Popup>\n </BaseTooltip.Positioner>\n </BaseTooltip.Portal>\n </BaseTooltip.Root>\n );\n}\n\n// Base UI shares hover timing across tooltips through this provider, so moving\n// between two triggers skips the delay the second time. GrytProvider renders\n// one already; this is exported for apps that do not use GrytProvider.\nexport const TooltipProvider = BaseTooltip.Provider;\n","import { Separator } from \"@base-ui/react/separator\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface DividerProps\n extends Omit<ComponentPropsWithoutRef<typeof Separator>, \"className\"> {\n className?: string;\n}\n\nexport const Divider = forwardRef<HTMLDivElement, DividerProps>(\n function Divider({ className, orientation = \"horizontal\", ...props }, ref) {\n return (\n <Separator\n ref={ref}\n orientation={orientation}\n className={cn(\n \"gryt-divider bg-gryt-border\",\n orientation === \"vertical\" ? \"h-full w-px\" : \"h-px w-full\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type CardProps = HTMLAttributes<HTMLDivElement>;\n\nexport const Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n { className, ...props },\n ref\n) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-card rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport interface CardHeaderProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"title\"> {\n title?: ReactNode;\n subheader?: ReactNode;\n}\n\nexport function CardHeader({\n children,\n className,\n subheader,\n title,\n ...props\n}: CardHeaderProps) {\n return (\n <div\n className={cn(\"gryt-card-header flex flex-col gap-1 p-4\", className)}\n {...props}\n >\n {title ? (\n <span className=\"text-base font-semibold text-gryt-text\">{title}</span>\n ) : null}\n {subheader ? (\n <span className=\"text-sm text-gryt-muted\">{subheader}</span>\n ) : null}\n {children}\n </div>\n );\n}\n\nexport function CardContent({\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n \"gryt-card-content px-4 pb-4 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport function CardActions({\n className,\n ...props\n}: HTMLAttributes<HTMLDivElement>) {\n return (\n <div\n className={cn(\n \"gryt-card-actions flex items-center gap-2 px-4 pb-4\",\n className\n )}\n {...props}\n />\n );\n}\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type AlertSeverity = \"info\" | \"success\" | \"warning\" | \"error\";\n\n// Tinted background at low alpha with a matching border, rather than a solid\n// fill — an alert should read as a note on the surface, not a block on top of\n// it.\nconst severityStyles: Record<AlertSeverity, string> = {\n info: \"border-gryt-secondary/40 bg-gryt-secondary/10 text-gryt-secondary\",\n success: \"border-gryt-success/40 bg-gryt-success/10 text-gryt-success\",\n warning: \"border-gryt-warning/40 bg-gryt-warning/10 text-gryt-warning\",\n error: \"border-gryt-danger/40 bg-gryt-danger/10 text-gryt-danger\"\n};\n\nexport interface AlertProps extends HTMLAttributes<HTMLDivElement> {\n severity?: AlertSeverity;\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { className, severity = \"info\", ...props },\n ref\n) {\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(\n \"gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm\",\n severityStyles[severity],\n className\n )}\n {...props}\n />\n );\n});\n","import { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport { CircleNotch } from \"@phosphor-icons/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface ProgressProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseProgress.Root>,\n \"className\" | \"value\"\n > {\n className?: string;\n // Optional, unlike Base UI's own prop: omitting it gives an indeterminate\n // bar, which is the common case when there is no measurable total.\n value?: number | null;\n}\n\nexport function Progress({ className, value = null, ...props }: ProgressProps) {\n return (\n <BaseProgress.Root\n // null is Base UI's indeterminate, so the default has to be null rather\n // than undefined — undefined is not assignable to its value prop.\n value={value}\n className={cn(\"gryt-progress w-full\", className)}\n {...props}\n >\n <BaseProgress.Track className=\"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised\">\n {/* ease-out, not the spring.\n A progress bar is a reading, and the spring overshoots 12% of the\n travel — so a jump to 100% ran past the end of the track and came\n back, which says the job finished, then unfinished, then finished.\n Bouncing is for controls the user just pushed. */}\n <BaseProgress.Indicator className=\"h-full rounded-(--gryt-radius-full) bg-gryt-accent transition-[width] duration-300 ease-out motion-reduce:transition-none\" />\n </BaseProgress.Track>\n </BaseProgress.Root>\n );\n}\n\nexport interface SpinnerProps {\n size?: number;\n className?: string;\n \"aria-label\"?: string;\n}\n\n// Base UI has no spinner — an indeterminate circular indicator is animation\n// rather than behaviour. Phosphor's CircleNotch is the shape, and the spin is\n// a Tailwind utility.\nexport function Spinner({\n className,\n size = 24,\n \"aria-label\": ariaLabel = \"Loading\"\n}: SpinnerProps) {\n return (\n <CircleNotch\n role=\"status\"\n aria-label={ariaLabel}\n size={size}\n weight=\"bold\"\n className={cn(\n \"gryt-spinner text-gryt-accent motion-safe:animate-spin\",\n className\n )}\n />\n );\n}\n","import type { CSSProperties, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type SkeletonVariant = \"text\" | \"rounded\" | \"circular\" | \"rectangular\";\n\nconst variantStyles: Record<SkeletonVariant, string> = {\n text: \"h-4 rounded-(--gryt-radius-sm)\",\n rounded: \"rounded-(--gryt-radius-lg)\",\n circular: \"rounded-(--gryt-radius-full)\",\n rectangular: \"rounded-none\"\n};\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n variant?: SkeletonVariant;\n width?: number | string;\n height?: number | string;\n}\n\nexport function Skeleton({\n className,\n height,\n style,\n variant = \"text\",\n width,\n ...props\n}: SkeletonProps) {\n const sizing: CSSProperties = {\n width,\n height,\n ...style\n };\n\n return (\n <div\n aria-hidden=\"true\"\n className={cn(\n // Not bg-gryt-surface-raised. #1e2028 against #1a1d24 is four points of\n // luminance, which is invisible on a laptop screen at an angle — the\n // placeholder that is meant to say \"something is coming\" said nothing.\n // A white wash instead of a fixed colour, so it stays visible on any of\n // the surfaces it can land on rather than only the one it was picked\n // against, and it dims rather than brightens as it pulses.\n \"gryt-skeleton bg-white/9 motion-safe:animate-pulse\",\n variantStyles[variant],\n className\n )}\n style={sizing}\n {...props}\n />\n );\n}\n","import { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\n// Base UI drives enter and exit animation through data-starting-style and\n// data-ending-style, which it sets for one frame either side of the transition.\n// The element has to carry the transition itself; there is no JS timing.\nconst motion =\n \"transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\";\n\nexport type DialogBackdropProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Backdrop\n>;\n\nconst Backdrop = forwardRef<HTMLDivElement, DialogBackdropProps>(\n function DialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n motion,\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogPopupProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Popup\n>;\n\nconst Popup = forwardRef<HTMLDivElement, DialogPopupProps>(\n function DialogPopup({ className, ...props }, ref) {\n return (\n <BaseDialog.Popup\n ref={ref}\n className={cn(\n \"gryt-dialog fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2\",\n \"flex w-96 max-w-[calc(100vw-3rem)] flex-col gap-4\",\n \"rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text\",\n motion,\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogTitleProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Title\n>;\n\nconst Title = forwardRef<HTMLHeadingElement, DialogTitleProps>(\n function DialogTitle({ className, ...props }, ref) {\n return (\n <BaseDialog.Title\n ref={ref}\n className={cn(\n \"gryt-dialog-title text-base font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Description\n>;\n\nconst Description = forwardRef<HTMLParagraphElement, DialogDescriptionProps>(\n function DialogDescription({ className, ...props }, ref) {\n return (\n <BaseDialog.Description\n ref={ref}\n className={cn(\n \"gryt-dialog-description text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogFooterProps = HTMLAttributes<HTMLDivElement>;\n\n// Replaces MUI's DialogActions. Base UI has no equivalent part, because it is\n// a plain row of buttons and nothing about it needs behaviour.\nconst Footer = forwardRef<HTMLDivElement, DialogFooterProps>(\n function DialogFooter({ className, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-dialog-footer flex justify-end gap-3\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport const Dialog = {\n Root: BaseDialog.Root,\n Trigger: BaseDialog.Trigger,\n Portal: BaseDialog.Portal,\n Close: BaseDialog.Close,\n Backdrop,\n Popup,\n Title,\n Description,\n Footer\n};\n","import { useCallback, useSyncExternalStore } from \"react\";\n\nconst noop = () => () => {};\n\n/**\n * Matches a media query, safely on the server.\n *\n * Written here rather than taken from Base UI's `unstable-use-media-query`,\n * because a component library should not put an explicitly unstable export on\n * its public path.\n *\n * useSyncExternalStore rather than useState in an effect: matchMedia is an\n * external store, and reading it into state after mount means an extra render\n * on every consumer plus a frame where the answer is wrong. The server snapshot\n * is false so the first client paint agrees with the server's.\n */\nexport function useMediaQuery(query: string): boolean {\n const subscribe = useCallback(\n (onChange: () => void) => {\n if (typeof window === \"undefined\" || !window.matchMedia) return noop();\n const list = window.matchMedia(query);\n list.addEventListener(\"change\", onChange);\n return () => list.removeEventListener(\"change\", onChange);\n },\n [query]\n );\n\n const getSnapshot = useCallback(() => {\n if (typeof window === \"undefined\" || !window.matchMedia) return false;\n return window.matchMedia(query).matches;\n }, [query]);\n\n return useSyncExternalStore(subscribe, getSnapshot, () => false);\n}\n","import { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { useMediaQuery } from \"../utils/useMediaQuery\";\n\nexport type DrawerSide = \"left\" | \"right\" | \"top\" | \"bottom\";\n\n/**\n * A panel pinned to an edge of the screen, and a sheet on small screens.\n *\n * Built on Base UI's `drawer` rather than on `dialog`, which is what this used\n * to be. A dialog pinned to an edge looks like a drawer and does none of what\n * one is for: it cannot be dragged away, it does not follow the finger, and it\n * does not know which edge it belongs to. The primitive brings swipe-to-dismiss,\n * snap points and nested stacking, and it drives the drag through CSS variables\n * so the panel tracks the pointer without a re-render per frame.\n *\n * `side` lives on Root, not on Popup as it used to. It has to: the swipe\n * direction is Root's business, and Viewport and Popup both need to agree with\n * it. Callers passing `side` to Popup will need to move it up one level.\n */\n\n/** Which way you drag to dismiss, per edge. */\nconst swipeBySide = {\n left: \"left\",\n right: \"right\",\n top: \"up\",\n bottom: \"down\"\n} as const;\n\nconst SideContext = createContext<DrawerSide>(\"right\");\n\n/** Where the panel sits inside the viewport. */\nconst viewportBySide: Record<DrawerSide, string> = {\n left: \"items-stretch justify-start\",\n right: \"items-stretch justify-end\",\n top: \"items-start justify-center\",\n bottom: \"items-end justify-center\"\n};\n\n/**\n * Corners are rounded on the edges away from the origin only.\n *\n * A sheet coming up from the bottom is still attached to the bottom of the\n * screen, so rounding its bottom corners would float it off an edge it has not\n * left. Rounding the leading edge alone is what makes it read as attached.\n */\nconst radiusBySide: Record<DrawerSide, string> = {\n left: \"rounded-r-(--gryt-radius-xl)\",\n right: \"rounded-l-(--gryt-radius-xl)\",\n top: \"rounded-b-(--gryt-radius-xl)\",\n bottom: \"rounded-t-(--gryt-radius-xl)\"\n};\n\n/**\n * Size, the overhang, and the off-screen resting transform.\n *\n * The panel runs --gryt-drawer-bleed past its edge and hangs that much\n * off-screen, with matching padding so content sits where it would have. The\n * spring settles onto its target from both directions, and without the overhang\n * a fractional undershoot shows a seam of backdrop down the edge.\n */\nconst popupBySide: Record<DrawerSide, string> = {\n left: [\n \"h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]\",\n \"-ml-(--gryt-drawer-bleed) border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))]\",\n \"[transform:translateX(var(--drawer-swipe-movement-x))]\",\n \"data-starting-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]\",\n \"data-ending-style:[transform:translateX(calc(-100%+var(--gryt-drawer-bleed)))]\"\n ].join(\" \"),\n right: [\n \"h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))]\",\n \"-mr-(--gryt-drawer-bleed) border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))]\",\n \"[transform:translateX(var(--drawer-swipe-movement-x))]\",\n \"data-starting-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]\",\n \"data-ending-style:[transform:translateX(calc(100%-var(--gryt-drawer-bleed)))]\"\n ].join(\" \"),\n top: [\n \"w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]\",\n \"-mt-(--gryt-drawer-bleed) border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))]\",\n \"[transform:translateY(var(--drawer-swipe-movement-y))]\",\n \"data-starting-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]\",\n \"data-ending-style:[transform:translateY(calc(-100%+var(--gryt-drawer-bleed)))]\"\n ].join(\" \"),\n bottom: [\n \"w-full max-h-[calc(85vh+var(--gryt-drawer-bleed))]\",\n \"-mb-(--gryt-drawer-bleed) border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))]\",\n \"[transform:translateY(var(--drawer-swipe-movement-y))]\",\n \"data-starting-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]\",\n \"data-ending-style:[transform:translateY(calc(100%-var(--gryt-drawer-bleed)))]\"\n ].join(\" \")\n};\n\nexport interface DrawerRootProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseDrawer.Root>,\n \"swipeDirection\"\n > {\n /** Edge the panel is pinned to. Ignored on small screens unless sheetOnMobile is false. */\n side?: DrawerSide;\n /**\n * Become a bottom sheet under 768px.\n *\n * A side panel is a desktop shape. On a phone it eats the width the content\n * needs and puts the drag gesture on the axis the browser uses for back\n * navigation. Set false to keep `side` at every width.\n */\n sheetOnMobile?: boolean;\n children?: ReactNode;\n}\n\nfunction Root({\n side = \"right\",\n sheetOnMobile = true,\n children,\n ...props\n}: DrawerRootProps) {\n const isMobile = useMediaQuery(\"(max-width: 767px)\");\n const resolved: DrawerSide = sheetOnMobile && isMobile ? \"bottom\" : side;\n\n return (\n <SideContext.Provider value={resolved}>\n <BaseDrawer.Root swipeDirection={swipeBySide[resolved]} {...props}>\n {children}\n </BaseDrawer.Root>\n </SideContext.Provider>\n );\n}\n\nexport type DrawerViewportProps = ComponentPropsWithoutRef<\n typeof BaseDrawer.Viewport\n>;\n\nconst Viewport = forwardRef<HTMLDivElement, DrawerViewportProps>(\n function DrawerViewport({ className, ...props }, ref) {\n const side = useContext(SideContext);\n return (\n <BaseDrawer.Viewport\n ref={ref}\n className={cn(\n // z-50 matters: the popup is no longer positioned itself, so the\n // viewport is what has to sit above the page. Without it a sticky\n // site header renders over the panel.\n \"gryt-drawer-viewport fixed inset-0 z-50 flex\",\n viewportBySide[side],\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DrawerPopupProps = ComponentPropsWithoutRef<\n typeof BaseDrawer.Popup\n>;\n\nconst Popup = forwardRef<HTMLDivElement, DrawerPopupProps>(function DrawerPopup(\n { className, ...props },\n ref\n) {\n const side = useContext(SideContext);\n return (\n <BaseDrawer.Popup\n ref={ref}\n className={cn(\n \"gryt-drawer flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text\",\n \"overflow-y-auto overscroll-contain outline-none\",\n \"transition-transform duration-(--gryt-dur-spring-soft) ease-spring\",\n // While the finger is down the panel must track it exactly. Any\n // duration here turns a drag into a drag plus lag.\n \"data-swiping:duration-0 data-swiping:select-none\",\n \"motion-reduce:transition-none\",\n popupBySide[side],\n radiusBySide[side],\n className\n )}\n {...props}\n />\n );\n});\n\nconst Backdrop = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseDrawer.Backdrop>\n>(function DrawerBackdrop({ className, ...props }, ref) {\n return (\n <BaseDrawer.Backdrop\n ref={ref}\n className={cn(\n \"gryt-drawer-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n // Lightens as the panel is dragged away, so letting go halfway does not\n // leave a full-strength scrim over a half-gone sheet.\n \"[opacity:calc(1-var(--drawer-swipe-progress,0))]\",\n \"transition-opacity duration-(--gryt-dur-spring-soft) ease-spring\",\n \"data-swiping:duration-0\",\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport interface DrawerGrabberProps {\n className?: string;\n}\n\n/**\n * The bar people expect to drag on a sheet.\n *\n * Rendered only for the top and bottom edges: on a left or right panel it would\n * be pointing the wrong way, and a horizontal drawer is a desktop shape where\n * nobody reaches for a grab bar anyway. Decorative — the whole popup is\n * draggable, so this is a hint, not the control.\n */\nfunction Grabber({ className }: DrawerGrabberProps) {\n const side = useContext(SideContext);\n if (side !== \"bottom\" && side !== \"top\") return null;\n\n return (\n <div\n aria-hidden\n className={cn(\n \"gryt-drawer-grabber mx-auto h-1.5 w-10 shrink-0 rounded-(--gryt-radius-full) bg-gryt-border\",\n side === \"top\" && \"order-last\",\n className\n )}\n />\n );\n}\n\nexport const Drawer = {\n Root,\n Trigger: BaseDrawer.Trigger,\n Portal: BaseDrawer.Portal,\n Backdrop,\n Viewport,\n Popup,\n Content: BaseDrawer.Content,\n Grabber,\n Close: BaseDrawer.Close,\n Title: BaseDrawer.Title,\n Description: BaseDrawer.Description\n};\n","import { Menu as BaseMenu } from \"@base-ui/react/menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\nexport type MenuPopupProps = ComponentPropsWithoutRef<typeof BaseMenu.Popup>;\nexport type MenuItemProps = ComponentPropsWithoutRef<typeof BaseMenu.Item>;\nexport type MenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseMenu.Positioner\n>;\n\nconst Positioner = forwardRef<HTMLDivElement, MenuPositionerProps>(\n function MenuPositioner({ className, sideOffset = 8, ...props }, ref) {\n return (\n <BaseMenu.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-menu-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\nconst Popup = forwardRef<HTMLDivElement, MenuPopupProps>(function MenuPopup(\n { className, ...props },\n ref\n) {\n return (\n <BaseMenu.Popup\n ref={ref}\n className={cn(\n \"gryt-menu min-w-44 p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<HTMLDivElement, MenuItemProps>(function MenuItem(\n { className, ...props },\n ref\n) {\n return (\n <BaseMenu.Item\n ref={ref}\n className={cn(\n \"gryt-menu-item flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)\",\n \"px-3 py-2 text-sm text-gryt-text outline-none select-none\",\n // Base UI drives keyboard and pointer highlight through the same\n // attribute, so arrow keys and the mouse land on identical styling.\n \"data-highlighted:bg-gryt-surface-raised\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Separator = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseMenu.Separator>\n>(function MenuSeparator({ className, ...props }, ref) {\n return (\n <BaseMenu.Separator\n ref={ref}\n className={cn(\"gryt-menu-separator my-1 h-px bg-gryt-border\", className)}\n {...props}\n />\n );\n});\n\nexport const Menu = {\n Root: BaseMenu.Root,\n Trigger: BaseMenu.Trigger,\n Portal: BaseMenu.Portal,\n Positioner,\n Popup,\n Item,\n Separator\n};\n","import { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type TabsProps = ComponentPropsWithoutRef<typeof BaseTabs.Root>;\nexport type TabsListProps = ComponentPropsWithoutRef<typeof BaseTabs.List>;\nexport type TabProps = ComponentPropsWithoutRef<typeof BaseTabs.Tab>;\nexport type TabsPanelProps = ComponentPropsWithoutRef<typeof BaseTabs.Panel>;\n\n/**\n * Orientation is Base UI's `orientation` prop on Root, and every part below\n * styles itself from the `data-orientation` it puts on the DOM rather than from\n * a prop of ours. That is why none of these take an orientation of their own:\n * setting it in two places is how a list ends up vertical and its indicator\n * still travelling sideways.\n *\n * Vertical is the same visual language turned ninety degrees — the accent pill\n * still slides between rows. It suits a rail of five or six destinations. Past\n * about a dozen the filled pill becomes a block of accent parked in the corner\n * of the screen, and a quieter marker is the better call; the docs sidebar is\n * that case and deliberately does not use this.\n */\nconst Root = forwardRef<HTMLDivElement, TabsProps>(function TabsRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Root\n ref={ref}\n className={cn(\n \"gryt-tabs\",\n // Vertical puts the rail and the panel side by side. min-w-0 on the\n // panel does the rest; without the flex here the panel lands under the\n // rail and the layout reads as a very tall accordion.\n \"data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst List = forwardRef<HTMLDivElement, TabsListProps>(function TabsList(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.List\n ref={ref}\n className={cn(\n \"gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1\",\n // A rail, not a pill: rows are full width and the corner radius drops\n // to lg, because a 999px radius on a tall box bows its short edges.\n \"data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch\",\n \"data-[orientation=vertical]:rounded-(--gryt-radius-lg)\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Tab\n ref={ref}\n className={cn(\n \"gryt-tab inline-flex min-h-8 items-center justify-center whitespace-nowrap\",\n \"rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5\",\n \"text-sm font-medium text-gryt-muted select-none\",\n \"relative z-10 transition-colors duration-150 hover:text-gryt-text\",\n // Base UI marks the selected tab with data-active, not data-selected.\n // The fill moved to Indicator so it can travel between tabs; the tab\n // itself only changes its text colour.\n \"data-active:text-gryt-on-accent\",\n // Left-aligned and taller in a rail. Centred labels in a vertical list\n // leave the text edge ragged, which is what makes a rail look untidy.\n \"data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start\",\n \"data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3\",\n \"data-[orientation=vertical]:rounded-(--gryt-radius-md)\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nexport type TabsIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseTabs.Indicator\n>;\n\n// Base UI measures the active tab and publishes --active-tab-left and\n// --active-tab-width, plus --active-tab-top and --active-tab-height, which is\n// what lets the pill slide rather than jump. renderBeforeHydration keeps it\n// positioned on the first paint instead of animating in from the left edge.\n//\n// The vertical rules hang off the ancestor's data-orientation rather than the\n// indicator's own. Root is the part guaranteed to carry it, and an indicator\n// that reads its orientation from somewhere other than the root it belongs to\n// is a bug waiting for someone to nest two sets of tabs.\nconst Indicator = forwardRef<HTMLSpanElement, TabsIndicatorProps>(\n function TabsIndicator({ className, ...props }, ref) {\n return (\n <BaseTabs.Indicator\n ref={ref}\n renderBeforeHydration\n className={cn(\n \"gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]\",\n \"w-(--active-tab-width) translate-x-(--active-tab-left)\",\n \"rounded-(--gryt-radius-full) bg-gryt-accent\",\n \"transition-[translate,width] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-reduce:transition-none\",\n // Same pill, travelling down the rail instead of across the row.\n \"[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1\",\n \"[[data-orientation=vertical]_&]:h-(--active-tab-height)\",\n \"[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]\",\n \"[[data-orientation=vertical]_&]:translate-x-0\",\n \"[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)\",\n \"[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)\",\n \"[[data-orientation=vertical]_&]:transition-[translate,height]\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, TabsPanelProps>(function TabsPanel(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Panel\n ref={ref}\n className={cn(\n \"gryt-tabs-panel pt-3 text-sm text-gryt-text\",\n // Beside the rail rather than under it, and allowed to shrink so long\n // content wraps instead of pushing the rail off screen.\n \"data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1\",\n \"data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Tabs = Object.assign(Root, { List, Tab, Panel, Indicator });\nexport { Tab };\n","import { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { CaretDown } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type AccordionProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Root\n>;\nexport type AccordionItemProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Item\n>;\nexport type AccordionPanelProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Panel\n>;\n\nconst Root = forwardRef<HTMLDivElement, AccordionProps>(function AccordionRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseAccordion.Root\n ref={ref}\n className={cn(\n \"gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<HTMLDivElement, AccordionItemProps>(\n function AccordionItem({ className, ...props }, ref) {\n return (\n <BaseAccordion.Item\n ref={ref}\n className={cn(\"gryt-accordion-item\", className)}\n {...props}\n />\n );\n }\n);\n\nexport interface AccordionTriggerProps\n extends ComponentPropsWithoutRef<typeof BaseAccordion.Trigger> {\n // Defaults to a caret that rotates when the panel opens. Pass one to\n // override it, or null for no indicator at all.\n expandIcon?: ReactNode;\n}\n\nconst Trigger = forwardRef<HTMLButtonElement, AccordionTriggerProps>(\n function AccordionTrigger({ children, className, expandIcon, ...props }, ref) {\n return (\n <BaseAccordion.Header className=\"gryt-accordion-header m-0\">\n <BaseAccordion.Trigger\n ref={ref}\n className={cn(\n \"gryt-accordion-trigger flex w-full items-center justify-between gap-3\",\n \"rounded-(--gryt-radius-lg) border-0 bg-transparent px-3 py-2.5\",\n \"text-left text-sm font-medium text-gryt-text select-none\",\n \"transition-colors duration-150 hover:bg-gryt-surface-raised\",\n focusRing,\n className\n )}\n {...props}\n >\n {children}\n {expandIcon === undefined ? (\n <CaretDown\n size={16}\n // Base UI flags the open panel on the trigger, so the caret needs\n // no state of its own.\n className=\"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none\"\n />\n ) : (\n expandIcon\n )}\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel({ children, className, ...props }, ref) {\n return (\n <BaseAccordion.Panel\n ref={ref}\n className={cn(\n \"gryt-accordion-panel overflow-hidden text-sm text-gryt-muted\",\n // Base UI measures the panel and exposes the height as a variable,\n // which is what makes a real open and close transition possible.\n \"h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring\",\n \"data-starting-style:h-0 data-ending-style:h-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n >\n <div className=\"px-3 pt-1 pb-3\">{children}</div>\n </BaseAccordion.Panel>\n );\n }\n);\n\nexport const Accordion = Object.assign(Root, { Item, Trigger, Panel });\n","import { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { Menu } from \"../Menu/Menu\";\n\nexport type ContextMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.Positioner\n>;\n\n/**\n * A right-click menu: a message, a member, a channel.\n *\n * Base UI builds this out of Menu's own parts — its Popup, Item and Separator\n * are literally Menu's components — so this reuses the styled ones rather than\n * restyling them. A context menu that drifted from the dropdown menu would be\n * a bug nobody notices until both are on screen at once.\n */\nconst Positioner = forwardRef<HTMLDivElement, ContextMenuPositionerProps>(\n function ContextMenuPositioner({ className, sideOffset = 2, ...props }, ref) {\n return (\n <BaseContextMenu.Positioner\n ref={ref}\n // Smaller than Menu's 8. This anchors to the pointer rather than to a\n // trigger element, and 8px from the cursor reads as a menu that missed.\n sideOffset={sideOffset}\n className={cn(\"gryt-context-menu-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\nexport const ContextMenu = {\n Root: BaseContextMenu.Root,\n Trigger: BaseContextMenu.Trigger,\n Portal: BaseContextMenu.Portal,\n Positioner,\n Popup: Menu.Popup,\n Item: Menu.Item,\n Separator: Menu.Separator,\n Group: BaseContextMenu.Group,\n GroupLabel: BaseContextMenu.GroupLabel,\n SubmenuRoot: BaseContextMenu.SubmenuRoot,\n SubmenuTrigger: BaseContextMenu.SubmenuTrigger\n};\n","import { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\nexport type PopoverPopupProps = ComponentPropsWithoutRef<\n typeof BasePopover.Popup\n>;\nexport type PopoverPositionerProps = ComponentPropsWithoutRef<\n typeof BasePopover.Positioner\n>;\n\nconst Positioner = forwardRef<HTMLDivElement, PopoverPositionerProps>(\n function PopoverPositioner({ className, sideOffset = 8, ...props }, ref) {\n return (\n <BasePopover.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-popover-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\n// Wider default than Menu: this holds prose and controls — a member card, a\n// permissions summary — rather than a column of one-line items.\nconst Popup = forwardRef<HTMLDivElement, PopoverPopupProps>(\n function PopoverPopup({ className, ...props }, ref) {\n return (\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Title = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof BasePopover.Title>\n>(function PopoverTitle({ className, ...props }, ref) {\n return (\n <BasePopover.Title\n ref={ref}\n className={cn(\n \"gryt-popover-title text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof BasePopover.Description>\n>(function PopoverDescription({ className, ...props }, ref) {\n return (\n <BasePopover.Description\n ref={ref}\n className={cn(\n \"gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Popover = {\n Root: BasePopover.Root,\n Trigger: BasePopover.Trigger,\n Portal: BasePopover.Portal,\n Positioner,\n Popup,\n Title,\n Description,\n Close: BasePopover.Close,\n Arrow: BasePopover.Arrow\n};\n","import { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { X } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ToastSeverity =\n | \"neutral\"\n | \"info\"\n | \"success\"\n | \"warning\"\n | \"danger\";\n\n/**\n * Severity is a tinted edge and a wash, not a filled card.\n *\n * Alert tints its whole surface, and that is right for something sitting in\n * the page where it has to compete with the content around it. A toast is\n * already floating over everything with nothing to compete with, so the same\n * treatment reads as shouting. The border carries the colour and the fill stays\n * near the surface underneath.\n */\nconst severityStyles: Record<ToastSeverity, string> = {\n neutral: \"border-white/8 bg-gryt-surface\",\n info: \"border-gryt-secondary/30 bg-gryt-secondary/8\",\n success: \"border-gryt-success/30 bg-gryt-success/8\",\n warning: \"border-gryt-warning/30 bg-gryt-warning/8\",\n danger: \"border-gryt-danger/30 bg-gryt-danger/8\"\n};\n\nexport interface ToastRootProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToast.Root>, \"className\"> {\n severity?: ToastSeverity;\n className?: string;\n}\nexport type ToastViewportProps = ComponentPropsWithoutRef<\n typeof BaseToast.Viewport\n>;\n\n/**\n * Transient notice: connection lost, invite copied, message failed to send.\n *\n * design.md's stance is silent success — most things that worked should say\n * nothing. This is for the cases where the user is not looking at the thing\n * that changed, which in a voice client is most of them.\n */\nconst Viewport = forwardRef<HTMLDivElement, ToastViewportProps>(\n function ToastViewport({ className, ...props }, ref) {\n return (\n <BaseToast.Viewport\n ref={ref}\n className={cn(\n \"gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]\",\n \"flex-col gap-2 outline-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Root = forwardRef<HTMLDivElement, ToastRootProps>(function ToastRoot(\n { className, severity = \"neutral\", ...props },\n ref\n) {\n return (\n <BaseToast.Root\n ref={ref}\n className={cn(\n \"gryt-toast relative flex flex-col p-3 pr-9\",\n // Not popupSurface. That border is --gryt-border, a solid slate line\n // that is right for a menu anchored to the thing that opened it and too\n // heavy for a card floating in the corner with nothing behind it. A\n // white hairline separates it from the page without drawing a box\n // around it.\n \"rounded-(--gryt-radius-xl) border text-gryt-text\",\n severityStyles[severity],\n // Swiping is a pointer gesture, so the toast follows the finger\n // through Base UI's swipe variables before it animates out.\n \"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring\",\n \"data-starting-style:translate-y-2 data-starting-style:opacity-0\",\n \"data-ending-style:translate-y-2 data-ending-style:opacity-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Title = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToast.Title>\n>(function ToastTitle({ className, ...props }, ref) {\n return (\n <BaseToast.Title\n ref={ref}\n className={cn(\n \"gryt-toast-title text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToast.Description>\n>(function ToastDescription({ className, ...props }, ref) {\n return (\n <BaseToast.Description\n ref={ref}\n className={cn(\n \"gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Close = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseToast.Close>\n>(function ToastClose({ className, children, ...props }, ref) {\n return (\n <BaseToast.Close\n ref={ref}\n aria-label=\"Close\"\n className={cn(\n \"gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center\",\n \"rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted\",\n \"transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n >\n {children ?? <X size={14} weight=\"bold\" />}\n </BaseToast.Close>\n );\n});\n\nconst Action = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseToast.Action>\n>(function ToastAction({ className, ...props }, ref) {\n return (\n <BaseToast.Action\n ref={ref}\n className={cn(\n \"gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0\",\n \"bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent\",\n \"transition-[scale] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Toast = {\n Provider: BaseToast.Provider,\n Portal: BaseToast.Portal,\n Viewport,\n Root,\n Title,\n Description,\n Close,\n Action\n};\n\n/**\n * Raise a toast without importing Base UI directly.\n *\n * Taken off the namespace rather than re-exported from \"@base-ui/react/toast\":\n * at that path the hook is a type-only declaration, and re-exporting it as a\n * value fails under isolatedModules. The value lives on the parts namespace.\n */\nexport const useToastManager = BaseToast.useToastManager;\n","import { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ScrollAreaRootProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Root\n>;\nexport type ScrollAreaViewportProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Viewport\n>;\nexport type ScrollAreaScrollbarProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Scrollbar\n>;\n\nconst Root = forwardRef<HTMLDivElement, ScrollAreaRootProps>(\n function ScrollAreaRoot({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Root\n ref={ref}\n className={cn(\"gryt-scroll-area relative\", className)}\n {...props}\n />\n );\n }\n);\n\n// overscroll-contain so a message list that hits its end does not hand the\n// scroll to the page behind it.\nconst Viewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(\n function ScrollAreaViewport({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Viewport\n ref={ref}\n className={cn(\n \"gryt-scroll-area-viewport h-full w-full overscroll-contain\",\n \"focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Scrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(\n function ScrollAreaScrollbar({ className, orientation, ...props }, ref) {\n return (\n <BaseScrollArea.Scrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none\",\n // Fades in on hover or while scrolling rather than sitting there\n // permanently — a chat sidebar is mostly not being scrolled.\n \"opacity-0 transition-opacity duration-(--gryt-dur-fast)\",\n \"data-hovering:opacity-100 data-scrolling:opacity-100\",\n \"motion-reduce:transition-none\",\n orientation === \"horizontal\" ? \"h-2 flex-col\" : \"w-2\",\n className\n )}\n {...props}\n >\n <BaseScrollArea.Thumb className=\"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none\" />\n </BaseScrollArea.Scrollbar>\n );\n }\n);\n\nexport const ScrollArea = {\n Root,\n Viewport,\n Scrollbar,\n Content: BaseScrollArea.Content,\n Corner: BaseScrollArea.Corner\n};\n","import { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as BaseToggleGroup } from \"@base-ui/react/toggle-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing } from \"../utils/styles\";\n\ntype ToggleTone = \"primary\" | \"secondary\" | \"neutral\" | \"danger\";\ntype ToggleSize = \"xsmall\" | \"small\" | \"medium\" | \"large\";\n\n// Unpressed reads like IconButton's tinted target; pressed fills. A mute button\n// has to be legible as on or off from across the room, so the two states differ\n// in fill rather than only in colour.\nconst toneStyles: Record<ToggleTone, string> = {\n primary: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-accent\"\n ].join(\" \"),\n secondary: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-secondary\"\n ].join(\" \"),\n neutral: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text\"\n ].join(\" \"),\n // For destructive-while-active controls: mic muted, camera off.\n danger: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-danger\"\n ].join(\" \")\n};\n\nconst sizeStyles: Record<ToggleSize, string> = {\n xsmall: \"h-8 min-w-8 px-2 text-xs\",\n small: \"h-9 min-w-9 px-2.5 text-sm\",\n medium: \"h-10 min-w-10 px-3 text-sm\",\n large: \"h-12 min-w-12 px-4 text-base\"\n};\n\nexport interface ToggleProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToggle>, \"className\"> {\n tone?: ToggleTone;\n size?: ToggleSize;\n className?: string;\n}\n\nexport const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(\n function Toggle(\n { className, size = \"medium\", tone = \"primary\", ...props },\n ref\n ) {\n return (\n <BaseToggle\n ref={ref}\n className={cn(\n \"gryt-toggle\",\n \"inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent\",\n \"rounded-(--gryt-radius-full) font-medium select-none\",\n // scale rather than transform — see the note in Button.\n \"transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:not-data-disabled:scale-[1.06]\",\n \"motion-safe:active:not-data-disabled:scale-[0.94]\",\n focusRing,\n disabledState,\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport interface ToggleGroupProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToggleGroup>, \"className\"> {\n className?: string;\n}\n\n// A rail around a set of Toggles. Base UI handles roving focus, so arrow keys\n// move between items and only one tab stop enters the group.\nexport const ToggleGroup = forwardRef<HTMLDivElement, ToggleGroupProps>(\n function ToggleGroup({ className, ...props }, ref) {\n return (\n <BaseToggleGroup\n ref={ref}\n className={cn(\n \"gryt-toggle-group inline-flex items-center gap-1\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { Meter as BaseMeter } from \"@base-ui/react/meter\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type MeterTone = \"primary\" | \"success\" | \"warning\" | \"danger\";\n\nconst toneFill: Record<MeterTone, string> = {\n primary: \"bg-gryt-accent\",\n success: \"bg-gryt-success\",\n warning: \"bg-gryt-warning\",\n danger: \"bg-gryt-danger\"\n};\n\nexport interface MeterProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseMeter.Root>,\n \"className\" | \"value\"\n > {\n value: number;\n label?: ReactNode;\n /** Show the formatted value at the end of the label row. */\n showValue?: boolean;\n tone?: MeterTone;\n className?: string;\n}\n\n/**\n * A measurement inside a known range — mic input level, disk used, how full a\n * server is.\n *\n * Deliberately not Progress. Progress says \"this task is 40% done and heading\n * for 100%\"; a meter says \"this is the reading right now\", and a reading at\n * 100% is often the bad case rather than the finished one. They also announce\n * differently to a screen reader, which is the part that actually matters.\n *\n * The indicator moves rather than snapping, but only just — 120ms and ease-out,\n * no spring. This used to have no transition at all, on the grounds that the\n * common caller is a mic level updating every animation frame and easing a\n * value that changes 60 times a second only makes it lag behind the sound.\n * That reasoning holds for the mic and nothing else: disk used, server\n * capacity, a level polled a few times a second all read as broken when they\n * teleport. 120ms is shorter than the gap between polls at 4Hz, so a fast feed\n * still lands on every value it is handed.\n */\nexport function Meter({\n className,\n value,\n label,\n showValue = false,\n tone = \"primary\",\n ...props\n}: MeterProps) {\n return (\n <BaseMeter.Root\n value={value}\n className={cn(\"gryt-meter flex w-full flex-col gap-1.5\", className)}\n {...props}\n >\n {(label || showValue) && (\n <div className=\"flex items-baseline justify-between gap-2\">\n {label ? (\n <BaseMeter.Label className=\"text-sm text-gryt-muted\">\n {label}\n </BaseMeter.Label>\n ) : (\n <span />\n )}\n {showValue && (\n <BaseMeter.Value className=\"font-mono text-xs text-gryt-muted tabular-nums\" />\n )}\n </div>\n )}\n <BaseMeter.Track className=\"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised\">\n {/* Short and linear-ish, so the bar moves rather than snapping.\n The note above says no transition, and that was written for a mic\n level updating every frame — easing a value that changes 60 times a\n second only makes it lag. But most meters are not that: disk used,\n how full a server is, a level polled a few times a second, and those\n all read as broken when they teleport. 120ms is under the gap\n between polls at 4Hz, so a fast feed still lands on every value it\n is given; it just gets there over two frames instead of one. */}\n <BaseMeter.Indicator\n className={cn(\n \"h-full rounded-(--gryt-radius-full)\",\n \"transition-[width] duration-120 ease-out motion-reduce:transition-none\",\n toneFill[tone]\n )}\n />\n </BaseMeter.Track>\n </BaseMeter.Root>\n );\n}\n","import { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type AlertDialogPopupProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Popup\n>;\n\n/**\n * A dialog you cannot dismiss by accident — for \"Leave this server?\".\n *\n * Styled identically to Dialog on purpose; the difference is behaviour, not\n * looks. Escape and clicking the backdrop do nothing here, so answering\n * requires picking one of the buttons. Using this where Dialog belongs is worse\n * than not having it, because it takes away the escape people expect.\n */\nconst Popup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n ref={ref}\n className={cn(\n \"gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2\",\n \"flex w-96 max-w-[calc(100vw-3rem)] flex-col gap-4\",\n \"rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text\",\n \"outline-none\",\n \"transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Backdrop = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>\n>(function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n \"transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Title = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>\n>(function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-title text-lg font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Description>\n>(function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-description text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const AlertDialog = {\n Root: BaseAlertDialog.Root,\n Trigger: BaseAlertDialog.Trigger,\n Portal: BaseAlertDialog.Portal,\n Backdrop,\n Popup,\n Title,\n Description,\n Close: BaseAlertDialog.Close\n};\n","import { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport {\n fieldControl,\n fieldSizes,\n focusRing,\n popupMotion,\n popupSurface\n} from \"../utils/styles\";\n\n/**\n * Shared with Autocomplete, which is the same list wearing different\n * semantics. Exported so the two cannot drift, the way ContextMenu shares\n * Menu's item.\n */\nexport const listboxItemClass = [\n \"flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)\",\n \"px-3 py-2 text-sm text-gryt-text outline-none select-none\",\n // Base UI drives keyboard and pointer highlight through one attribute, so\n // arrow keys and the mouse land on identical styling.\n \"data-highlighted:bg-gryt-surface-raised\",\n \"data-selected:text-gryt-accent\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\"\n].join(\" \");\n\n/**\n * The typeahead input on both Combobox and Autocomplete.\n *\n * This is TextField's control, through the same shared constant, so the three\n * places you can type in this library are the same shape. It used to be its own\n * class list asking for `rounded-(--gryt-radius-input)` — a token that has never\n * existed — so it rendered with square corners next to a fully rounded\n * TextField.\n */\nexport const listboxInputClass = [\n fieldControl,\n fieldSizes.medium,\n \"border-gryt-border\",\n focusRing\n].join(\" \");\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.Popup\n>;\n\nconst Input = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Input>\n>(function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n ref={ref}\n className={cn(\"gryt-combobox-input\", listboxInputClass, className)}\n {...props}\n />\n );\n});\n\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>\n>(function ComboboxPositioner({ className, sideOffset = 6, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-combobox-positioner outline-none\", className)}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<HTMLDivElement, ComboboxPopupProps>(\n function ComboboxPopup({ className, ...props }, ref) {\n return (\n <BaseCombobox.Popup\n ref={ref}\n className={cn(\n \"gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Item = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Item>\n>(function ComboboxItem({ className, ...props }, ref) {\n return (\n <BaseCombobox.Item\n ref={ref}\n className={cn(\"gryt-combobox-item\", listboxItemClass, className)}\n {...props}\n />\n );\n});\n\nconst Empty = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Empty>\n>(function ComboboxEmpty({ className, ...props }, ref) {\n return (\n <BaseCombobox.Empty\n ref={ref}\n className={cn(\n \"gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\n/**\n * Pick from a list, narrowed by typing. Select with a filter, in effect.\n *\n * Supports multiple selection with chips, which is what a member picker or a\n * role assignment wants. Use Autocomplete instead when the value is free text\n * and the list is only a suggestion.\n */\nexport const Combobox = {\n Root: BaseCombobox.Root,\n Input,\n InputGroup: BaseCombobox.InputGroup,\n Trigger: BaseCombobox.Trigger,\n Icon: BaseCombobox.Icon,\n Clear: BaseCombobox.Clear,\n Value: BaseCombobox.Value,\n Chips: BaseCombobox.Chips,\n Chip: BaseCombobox.Chip,\n ChipRemove: BaseCombobox.ChipRemove,\n Portal: BaseCombobox.Portal,\n Positioner,\n Popup,\n List: BaseCombobox.List,\n Item,\n ItemIndicator: BaseCombobox.ItemIndicator,\n Group: BaseCombobox.Group,\n GroupLabel: BaseCombobox.GroupLabel,\n Empty,\n Separator: BaseCombobox.Separator\n};\n","import { Autocomplete as BaseAutocomplete } from \"@base-ui/react/autocomplete\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { listboxInputClass, listboxItemClass } from \"../Combobox/Combobox\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * A text input that suggests as you type.\n *\n * The difference from Combobox is what the value is allowed to be: here the\n * typed text is the answer and the list is a suggestion, so a search box or a\n * tag input belongs here. Combobox is for when the value must come from the\n * list. They share item and input styling deliberately — two lists that look\n * different for no reason is worse than one that looks the same.\n */\n\nconst Input = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Input>\n>(function AutocompleteInput({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Input\n ref={ref}\n className={cn(\"gryt-autocomplete-input\", listboxInputClass, className)}\n {...props}\n />\n );\n});\n\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Positioner>\n>(function AutocompletePositioner({ className, sideOffset = 6, ...props }, ref) {\n return (\n <BaseAutocomplete.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-autocomplete-positioner outline-none\", className)}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Popup>\n>(function AutocompletePopup({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Popup\n ref={ref}\n className={cn(\n \"gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Item>\n>(function AutocompleteItem({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Item\n ref={ref}\n className={cn(\"gryt-autocomplete-item\", listboxItemClass, className)}\n {...props}\n />\n );\n});\n\nconst Empty = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Empty>\n>(function AutocompleteEmpty({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Empty\n ref={ref}\n className={cn(\n \"gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Autocomplete = {\n Root: BaseAutocomplete.Root,\n Input,\n InputGroup: BaseAutocomplete.InputGroup,\n Trigger: BaseAutocomplete.Trigger,\n Icon: BaseAutocomplete.Icon,\n Clear: BaseAutocomplete.Clear,\n Value: BaseAutocomplete.Value,\n Portal: BaseAutocomplete.Portal,\n Positioner,\n Popup,\n List: BaseAutocomplete.List,\n Item,\n Group: BaseAutocomplete.Group,\n GroupLabel: BaseAutocomplete.GroupLabel,\n Empty,\n Separator: BaseAutocomplete.Separator\n};\n","import { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type CheckboxGroupProps = ComponentPropsWithoutRef<\n typeof BaseCheckboxGroup\n>;\n\n/**\n * A set of checkboxes sharing one value array.\n *\n * Worth having over a hand-rolled array of Checkboxes for the parent case: give\n * it `allValues` and a checkbox marked `parent` becomes a working\n * indeterminate tri-state, which is fiddly to get right by hand and is exactly\n * what a permissions list needs.\n */\nexport const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(\n function CheckboxGroup({ className, ...props }, ref) {\n return (\n <BaseCheckboxGroup\n ref={ref}\n className={cn(\"gryt-checkbox-group flex flex-col gap-2\", className)}\n {...props}\n />\n );\n }\n);\n","import { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type CollapsibleTriggerProps = ComponentPropsWithoutRef<\n typeof BaseCollapsible.Trigger\n>;\nexport type CollapsiblePanelProps = ComponentPropsWithoutRef<\n typeof BaseCollapsible.Panel\n>;\n\n/**\n * One region that opens and closes — a channel category, an advanced section.\n *\n * Accordion is a set of these that know about each other. Reach for this when\n * there is only one, so nothing has to pretend to be a one-item accordion.\n */\nconst Trigger = forwardRef<HTMLButtonElement, CollapsibleTriggerProps>(\n function CollapsibleTrigger({ className, ...props }, ref) {\n return (\n <BaseCollapsible.Trigger\n ref={ref}\n className={cn(\n \"gryt-collapsible-trigger flex w-full items-center justify-between gap-2\",\n \"rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left\",\n \"text-sm font-medium text-gryt-text select-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, CollapsiblePanelProps>(\n function CollapsiblePanel({ className, ...props }, ref) {\n return (\n <BaseCollapsible.Panel\n ref={ref}\n className={cn(\n \"gryt-collapsible-panel overflow-hidden\",\n // Base UI measures the panel and exposes the height as a variable, so\n // this animates to the content's real height rather than to a guess.\n \"h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring\",\n \"data-starting-style:h-0 data-ending-style:h-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport const Collapsible = {\n Root: BaseCollapsible.Root,\n Trigger,\n Panel\n};\n","import { Form as BaseForm } from \"@base-ui/react/form\";\nimport { Fieldset as BaseFieldset } from \"@base-ui/react/fieldset\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type FormProps = ComponentPropsWithoutRef<typeof BaseForm>;\n\n/**\n * Wires server-side errors back to the fields that caused them.\n *\n * Pass `errors` keyed by field name and Base UI routes each message to the\n * matching Field, so a rejected form points at the input rather than printing a\n * paragraph at the top that the user has to map back themselves.\n */\nexport const Form = forwardRef<HTMLFormElement, FormProps>(function Form(\n { className, ...props },\n ref\n) {\n return (\n <BaseForm\n ref={ref}\n className={cn(\"gryt-form flex flex-col gap-(--gryt-space-lg)\", className)}\n {...props}\n />\n );\n});\n\nexport type FieldsetProps = ComponentPropsWithoutRef<typeof BaseFieldset.Root>;\n\nconst FieldsetRoot = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset({ className, ...props }, ref) {\n return (\n <BaseFieldset.Root\n ref={ref}\n className={cn(\n \"gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Legend = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseFieldset.Legend>\n>(function FieldsetLegend({ className, ...props }, ref) {\n return (\n <BaseFieldset.Legend\n ref={ref}\n className={cn(\n \"gryt-fieldset-legend text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Fieldset = { Root: FieldsetRoot, Legend };\n","import { Menubar as BaseMenubar } from \"@base-ui/react/menubar\";\nimport { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * A bar of menus that behave as one — File, Edit, View.\n *\n * Once any menu is open, moving along the bar opens the next without a second\n * click, which is the behaviour that separates a menubar from several\n * independent Menus sitting next to each other.\n */\nexport type MenubarProps = ComponentPropsWithoutRef<typeof BaseMenubar>;\n\nexport const Menubar = forwardRef<HTMLDivElement, MenubarProps>(\n function Menubar({ className, ...props }, ref) {\n return (\n <BaseMenubar\n ref={ref}\n className={cn(\n \"gryt-menubar flex items-center gap-1\",\n \"rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\n/**\n * Site-level navigation whose items open panels.\n *\n * Distinct from Menubar: the items are links first and the panels can hold\n * layout — a column of sections, a promo — rather than a list of commands. The\n * viewport animates between panels so moving along the bar resizes rather than\n * closing and reopening.\n */\nconst Trigger = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Trigger>\n>(function NavigationMenuTrigger({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Trigger\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)\",\n \"border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n \"data-popup-open:bg-gryt-surface-raised\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Popup>\n>(function NavigationMenuPopup({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Popup\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-popup outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Viewport = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Viewport>\n>(function NavigationMenuViewport({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Viewport\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-viewport relative overflow-hidden\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Link = forwardRef<\n HTMLAnchorElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Link>\n>(function NavigationMenuLink({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Link\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-link block rounded-(--gryt-radius-md) px-3 py-2\",\n \"text-sm text-gryt-text no-underline outline-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nexport const NavigationMenu = {\n Root: BaseNavigationMenu.Root,\n List: BaseNavigationMenu.List,\n Item: BaseNavigationMenu.Item,\n Trigger,\n Content: BaseNavigationMenu.Content,\n Portal: BaseNavigationMenu.Portal,\n Positioner: BaseNavigationMenu.Positioner,\n Viewport,\n Popup,\n Link,\n Icon: BaseNavigationMenu.Icon,\n Arrow: BaseNavigationMenu.Arrow\n};\n","import { NumberField as BaseNumberField } from \"@base-ui/react/number-field\";\nimport { Minus, Plus } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing } from \"../utils/styles\";\n\nexport interface NumberFieldProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseNumberField.Root>,\n \"className\"\n > {\n label?: ReactNode;\n className?: string;\n /**\n * Drag the label sideways to change the value.\n *\n * Base UI calls this a scrub area, and it is the reason to use this over a\n * plain input for things like volume or bitrate — coarse adjustment by drag,\n * exact entry by typing, without two controls.\n */\n scrubbable?: boolean;\n}\n\nconst stepButton =\n \"flex h-9 w-9 shrink-0 items-center justify-center border-0 bg-transparent text-gryt-muted transition-colors hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text motion-reduce:transition-none disabled:cursor-not-allowed disabled:opacity-50\";\n\nexport const NumberField = forwardRef<HTMLDivElement, NumberFieldProps>(\n function NumberField(\n { className, label, scrubbable = false, ...props },\n ref\n ) {\n return (\n <BaseNumberField.Root\n ref={ref}\n className={cn(\"gryt-number-field flex flex-col gap-1.5\", className)}\n {...props}\n >\n {label &&\n (scrubbable ? (\n <BaseNumberField.ScrubArea className=\"cursor-ew-resize text-sm text-gryt-muted select-none\">\n {label}\n <BaseNumberField.ScrubAreaCursor />\n </BaseNumberField.ScrubArea>\n ) : (\n <span className=\"text-sm text-gryt-muted\">{label}</span>\n ))}\n <BaseNumberField.Group\n className={cn(\n \"flex w-fit items-center overflow-hidden rounded-(--gryt-radius-full)\",\n \"border border-gryt-border bg-gryt-surface-raised\",\n \"focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-gryt-accent-light\",\n disabledState\n )}\n >\n <BaseNumberField.Decrement\n aria-label=\"Decrease\"\n className={cn(stepButton, \"rounded-l-(--gryt-radius-full)\")}\n >\n <Minus size={14} weight=\"bold\" />\n </BaseNumberField.Decrement>\n <BaseNumberField.Input\n className={cn(\n \"w-16 border-0 bg-transparent px-1 py-2 text-center\",\n \"font-mono text-sm text-gryt-text tabular-nums outline-none\",\n focusRing\n )}\n />\n <BaseNumberField.Increment\n aria-label=\"Increase\"\n className={cn(stepButton, \"rounded-r-(--gryt-radius-full)\")}\n >\n <Plus size={14} weight=\"bold\" />\n </BaseNumberField.Increment>\n </BaseNumberField.Group>\n </BaseNumberField.Root>\n );\n }\n);\n","import { OTPField as BaseOtpField } from \"@base-ui/react/otp-field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport interface OtpFieldProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseOtpField.Root>,\n \"className\" | \"length\"\n > {\n /** How many characters the code has. Required by Base UI; defaulted here. */\n length?: number;\n className?: string;\n}\n\n/**\n * A one-time code, one box per character.\n *\n * Base UI handles the parts that are tedious and easy to get wrong: paste a\n * whole code into any box and it distributes across all of them, backspace\n * steps back a box, and the arrow keys move between them.\n */\nexport const OtpField = forwardRef<HTMLDivElement, OtpFieldProps>(\n function OtpField({ className, length = 6, ...props }, ref) {\n return (\n <BaseOtpField.Root\n ref={ref}\n length={length}\n className={cn(\"gryt-otp-field flex gap-2\", className)}\n {...props}\n >\n {/* No index prop: Base UI assigns each input its slot by render order\n and exposes the index through state. */}\n {Array.from({ length }, (_unused, index) => (\n <BaseOtpField.Input\n key={index}\n className={cn(\n \"gryt-otp-input h-12 w-10 rounded-(--gryt-radius-md) text-center\",\n \"border border-gryt-border bg-gryt-surface-raised\",\n \"font-mono text-lg text-gryt-text tabular-nums outline-none\",\n \"transition-colors duration-(--gryt-dur-fast) motion-reduce:transition-none\",\n \"data-filled:border-gryt-accent\",\n focusRing\n )}\n />\n ))}\n </BaseOtpField.Root>\n );\n }\n);\n","import { PreviewCard as BasePreviewCard } from \"@base-ui/react/preview-card\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\nexport type PreviewCardPopupProps = ComponentPropsWithoutRef<\n typeof BasePreviewCard.Popup\n>;\nexport type PreviewCardPositionerProps = ComponentPropsWithoutRef<\n typeof BasePreviewCard.Positioner\n>;\n\n/**\n * What appears when you hover a username.\n *\n * Not a Tooltip and not a Popover. A tooltip labels a control and opens\n * instantly; this holds real content, so it waits before opening and stays put\n * long enough to move the pointer into it. Popover is the click-to-open\n * equivalent — reach for that when the panel has controls, since content that\n * only appears on hover is unreachable from a keyboard or a touchscreen.\n */\nconst Positioner = forwardRef<HTMLDivElement, PreviewCardPositionerProps>(\n function PreviewCardPositioner({ className, sideOffset = 8, ...props }, ref) {\n return (\n <BasePreviewCard.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-preview-card-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\nconst Popup = forwardRef<HTMLDivElement, PreviewCardPopupProps>(\n function PreviewCardPopup({ className, ...props }, ref) {\n return (\n <BasePreviewCard.Popup\n ref={ref}\n className={cn(\n \"gryt-preview-card w-64 max-w-[calc(100vw-2rem)] p-4 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport const PreviewCard = {\n Root: BasePreviewCard.Root,\n Trigger: BasePreviewCard.Trigger,\n Portal: BasePreviewCard.Portal,\n Positioner,\n Popup,\n Arrow: BasePreviewCard.Arrow\n};\n","import { Toolbar as BaseToolbar } from \"@base-ui/react/toolbar\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ToolbarRootProps = ComponentPropsWithoutRef<\n typeof BaseToolbar.Root\n>;\n\n/**\n * A strip of controls that share one tab stop.\n *\n * The point is the keyboard model: Tab enters the toolbar once and the arrow\n * keys move between its buttons, so a call bar with eight controls costs one\n * stop on the way to the message box instead of eight.\n */\nconst Root = forwardRef<HTMLDivElement, ToolbarRootProps>(function Toolbar(\n { className, ...props },\n ref\n) {\n return (\n <BaseToolbar.Root\n ref={ref}\n className={cn(\n \"gryt-toolbar flex items-center gap-1\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Separator = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToolbar.Separator>\n>(function ToolbarSeparator({ className, ...props }, ref) {\n return (\n <BaseToolbar.Separator\n ref={ref}\n className={cn(\"gryt-toolbar-separator mx-1 h-6 w-px bg-gryt-border\", className)}\n {...props}\n />\n );\n});\n\nexport const Toolbar = {\n Root,\n Group: BaseToolbar.Group,\n Button: BaseToolbar.Button,\n Link: BaseToolbar.Link,\n Input: BaseToolbar.Input,\n Separator\n};\n"],"names":["grytTokens","createGrytTheme","options","color","radius","isCssVariables","value","key","GrytProvider","children","className","theme","tooltipDelay","style","jsx","Tooltip","cn","inputs","twMerge","clsx","toneStyles","sizeStyles","Button","forwardRef","endIcon","size","startIcon","tone","props","ref","jsxs","BaseButton","focusRing","focusRingWithin","fieldControl","fieldSizes","popupSurface","popupMotion","disabledState","toneCheckedFill","toneBg","toneCheckedBorder","toneCheckedBg","IconButton","Surface","elevated","MessageBubble","from","TextField","error","fieldClassName","helperText","label","minRows","multiline","control","Field","Composer","disabled","maxRows","onSubmit","placeholder","submitLabel","innerRef","useRef","resize","useCallback","node","styles","lineHeight","vertical","useLayoutEffect","handleSubmit","event","PaperPlaneTilt","Avatar","alt","fallback","src","BaseAvatar","ConversationItem","active","avatar","subtitle","title","Badge","badgeContent","max","showZero","numeric","hidden","display","Chip","icon","onDelete","X","Checkbox","BaseCheckbox","Check","Radio","BaseRadio","RadioGroup","BaseRadioGroup","Switch","BaseSwitch","DRAG_SLOP","Slider","ariaLabel","dragging","setDragging","useState","origin","useEffect","end","handlePointerDown","handlePointerMove","start","travel","BaseSlider","Select","BaseSelect","CaretUpDown","option","side","sideOffset","BaseTooltip","TooltipProvider","Divider","orientation","Separator","Card","CardHeader","subheader","CardContent","CardActions","severityStyles","Alert","severity","Progress","BaseProgress","Spinner","CircleNotch","variantStyles","Skeleton","height","variant","width","sizing","motion","Backdrop","BaseDialog","Popup","Title","Description","Footer","Dialog","noop","useMediaQuery","query","subscribe","onChange","list","getSnapshot","useSyncExternalStore","swipeBySide","SideContext","createContext","viewportBySide","radiusBySide","popupBySide","Root","sheetOnMobile","isMobile","resolved","BaseDrawer","Viewport","useContext","Grabber","Drawer","Positioner","BaseMenu","Item","Menu","BaseTabs","List","Tab","Indicator","Panel","Tabs","BaseAccordion","Trigger","expandIcon","CaretDown","Accordion","BaseContextMenu","ContextMenu","BasePopover","Popover","BaseToast","Close","Action","Toast","useToastManager","BaseScrollArea","Scrollbar","ScrollArea","Toggle","BaseToggle","ToggleGroup","BaseToggleGroup","toneFill","Meter","showValue","BaseMeter","BaseAlertDialog","AlertDialog","listboxItemClass","listboxInputClass","Input","BaseCombobox","Empty","Combobox","BaseAutocomplete","Autocomplete","CheckboxGroup","BaseCheckboxGroup","BaseCollapsible","Collapsible","Form","BaseForm","FieldsetRoot","BaseFieldset","Legend","Fieldset","Menubar","BaseMenubar","BaseNavigationMenu","Link","NavigationMenu","stepButton","NumberField","scrubbable","BaseNumberField","Minus","Plus","OtpField","length","BaseOtpField","_unused","index","BasePreviewCard","PreviewCard","BaseToolbar","Toolbar"],"mappings":"okDAEaA,EAAa,CACxB,MAAO,CACL,GAAI,UACJ,QAAS,UACT,cAAe,UACf,aAAc,UACd,OAAQ,UACR,KAAM,UACN,MAAO,UACP,OAAQ,UACR,YAAa,UACb,UAAW,UACX,eAAgB,UAChB,QAAS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