@gryt/ui 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/AlertDialog/AlertDialog.d.ts +14 -0
  2. package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -0
  3. package/dist/components/Autocomplete/Autocomplete.d.ts +20 -0
  4. package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -0
  5. package/dist/components/Checkbox/CheckboxGroup.d.ts +13 -0
  6. package/dist/components/Checkbox/CheckboxGroup.d.ts.map +1 -0
  7. package/dist/components/Collapsible/Collapsible.d.ts +10 -0
  8. package/dist/components/Collapsible/Collapsible.d.ts.map +1 -0
  9. package/dist/components/Combobox/Combobox.d.ts +40 -0
  10. package/dist/components/Combobox/Combobox.d.ts.map +1 -0
  11. package/dist/components/ContextMenu/ContextMenu.d.ts +17 -0
  12. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -0
  13. package/dist/components/Drawer/Drawer.d.ts +41 -14
  14. package/dist/components/Drawer/Drawer.d.ts.map +1 -1
  15. package/dist/components/Form/Form.d.ts +20 -0
  16. package/dist/components/Form/Form.d.ts.map +1 -0
  17. package/dist/components/Meter/Meter.d.ts +26 -0
  18. package/dist/components/Meter/Meter.d.ts.map +1 -0
  19. package/dist/components/NavigationMenu/NavigationMenu.d.ts +27 -0
  20. package/dist/components/NavigationMenu/NavigationMenu.d.ts.map +1 -0
  21. package/dist/components/NumberField/NumberField.d.ts +16 -0
  22. package/dist/components/NumberField/NumberField.d.ts.map +1 -0
  23. package/dist/components/OtpField/OtpField.d.ts +16 -0
  24. package/dist/components/OtpField/OtpField.d.ts.map +1 -0
  25. package/dist/components/Popover/Popover.d.ts +16 -0
  26. package/dist/components/Popover/Popover.d.ts.map +1 -0
  27. package/dist/components/PreviewCard/PreviewCard.d.ts +13 -0
  28. package/dist/components/PreviewCard/PreviewCard.d.ts.map +1 -0
  29. package/dist/components/ScrollArea/ScrollArea.d.ts +13 -0
  30. package/dist/components/ScrollArea/ScrollArea.d.ts.map +1 -0
  31. package/dist/components/Toast/Toast.d.ts +23 -0
  32. package/dist/components/Toast/Toast.d.ts.map +1 -0
  33. package/dist/components/Toggle/Toggle.d.ts +17 -0
  34. package/dist/components/Toggle/Toggle.d.ts.map +1 -0
  35. package/dist/components/Toolbar/Toolbar.d.ts +12 -0
  36. package/dist/components/Toolbar/Toolbar.d.ts.map +1 -0
  37. package/dist/components/utils/useMediaQuery.d.ts +14 -0
  38. package/dist/components/utils/useMediaQuery.d.ts.map +1 -0
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.cjs.map +1 -1
  41. package/dist/index.d.cts +35 -1
  42. package/dist/index.d.ts +35 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +1547 -504
  45. package/dist/index.js.map +1 -1
  46. package/dist/styles.css +1 -1
  47. package/dist/theme.css +101 -0
  48. package/package.json +2 -1
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","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/Drawer/Drawer.tsx","../src/components/Menu/Menu.tsx","../src/components/Tabs/Tabs.tsx","../src/components/Accordion/Accordion.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 { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type DrawerSide = \"left\" | \"right\" | \"top\" | \"bottom\";\n\n// Base UI has no drawer part. A drawer is a dialog pinned to an edge, and it\n// wants the same focus trap, escape handling and scroll lock, so it is built\n// on Dialog rather than reinvented.\n// The panel is --gryt-drawer-bleed longer than it looks and hangs that much\n// off-screen, with matching padding so the content sits where it would have.\n// A spring settles onto its target from both directions; without the bleed,\n// the moment it sits a fraction short of flush you get a seam of backdrop down\n// the edge. Overrunning the edge means an undershoot reveals more drawer.\nconst sideStyles: Record<DrawerSide, string> = {\n left: \"inset-y-0 -left-(--gryt-drawer-bleed) h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))] border-r py-5 pr-5 pl-[calc(1.25rem+var(--gryt-drawer-bleed))] data-starting-style:-translate-x-full data-ending-style:-translate-x-full\",\n right:\n \"inset-y-0 -right-(--gryt-drawer-bleed) h-full w-[calc(20rem+var(--gryt-drawer-bleed))] max-w-[calc(85vw+var(--gryt-drawer-bleed))] border-l py-5 pl-5 pr-[calc(1.25rem+var(--gryt-drawer-bleed))] data-starting-style:translate-x-full data-ending-style:translate-x-full\",\n top: \"inset-x-0 -top-(--gryt-drawer-bleed) h-auto max-h-[calc(85vh+var(--gryt-drawer-bleed))] w-full border-b px-5 pb-5 pt-[calc(1.25rem+var(--gryt-drawer-bleed))] data-starting-style:-translate-y-full data-ending-style:-translate-y-full\",\n bottom:\n \"inset-x-0 -bottom-(--gryt-drawer-bleed) h-auto max-h-[calc(85vh+var(--gryt-drawer-bleed))] w-full border-t px-5 pt-5 pb-[calc(1.25rem+var(--gryt-drawer-bleed))] data-starting-style:translate-y-full data-ending-style:translate-y-full\"\n};\n\nexport type DrawerPopupProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Popup\n> & {\n side?: DrawerSide;\n};\n\nconst Popup = forwardRef<HTMLDivElement, DrawerPopupProps>(function DrawerPopup(\n { className, side = \"right\", ...props },\n ref\n) {\n return (\n <BaseDialog.Popup\n ref={ref}\n className={cn(\n \"gryt-drawer fixed z-50 flex flex-col gap-4 border-gryt-border bg-gryt-surface text-gryt-text\",\n \"transition-transform duration-(--gryt-dur-spring-soft) ease-spring motion-reduce:transition-none\",\n sideStyles[side],\n className\n )}\n {...props}\n />\n );\n});\n\nconst Backdrop = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseDialog.Backdrop>\n>(function DrawerBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-drawer-backdrop fixed inset-0 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n \"transition-opacity duration-(--gryt-dur-spring-soft) 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\nexport const Drawer = {\n Root: BaseDialog.Root,\n Trigger: BaseDialog.Trigger,\n Portal: BaseDialog.Portal,\n Close: BaseDialog.Close,\n Title: BaseDialog.Title,\n Description: BaseDialog.Description,\n Backdrop,\n Popup\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"],"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","sideStyles","Drawer","Positioner","BaseMenu","Item","Menu","Root","BaseTabs","List","Tab","Indicator","Panel","Tabs","BaseAccordion","Trigger","expandIcon","CaretDown","Accordion"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,IAAa;AAAA,EACxB,OAAO;AAAA,IACL,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,eAAe;AAAA,IACf,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb,UAAU;AAAA,EAAA;AAAA,EAEZ,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EAAA;AAEV;AAgBO,SAASC,GAAgBC,IAA4B,IAAmB;AAC7E,QAAMC,IAAQ,EAAE,GAAGH,EAAW,OAAO,GAAGE,EAAQ,MAAA,GAC1CE,IAAS,EAAE,GAAGJ,EAAW,QAAQ,GAAGE,EAAQ,OAAA;AAElD,SAAO;AAAA,IACL,aAAaC,EAAM;AAAA,IACnB,kBAAkBA,EAAM;AAAA,IACxB,yBAAyBA,EAAM;AAAA,IAC/B,wBAAwBA,EAAM;AAAA,IAC9B,iBAAiBA,EAAM;AAAA,IACvB,eAAeA,EAAM;AAAA,IACrB,gBAAgBA,EAAM;AAAA,IACtB,iBAAiBA,EAAM;AAAA,IACvB,uBAAuBA,EAAM;AAAA,IAC7B,oBAAoBA,EA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AA,MAAA;AAAA,IAAA,GAGN;AAAA,EAEJ;AACF,GAEMJ,KAAQlI;AAAA,EACZ,SAAwB,EAAE,UAAAd,GAAU,WAAAC,GAAW,GAAGkB,EAAA,GAASC,GAAK;AAC9D,WACE,gBAAAf;AAAA,MAAC6I,EAAc;AAAA,MAAd;AAAA,QACC,KAAA9H;AAAA,QACA,WAAWb;AAAA,UACT;AAAA;AAAA;AAAA,UAGA;AAAA,UACA;AAAA,UACA;AAAA,UACAN;AAAA,QAAA;AAAA,QAED,GAAGkB;AAAA,QAEJ,UAAA,gBAAAd,EAAC,OAAA,EAAI,WAAU,kBAAkB,UAAAL,EAAA,CAAS;AAAA,MAAA;AAAA,IAAA;AAAA,EAGhD;AACF,GAEasJ,KAAY,OAAO,OAAOX,IAAM,EAAE,MAAAF,IAAM,SAAAU,IAAS,OAAAH,IAAO;"}
1
+ {"version":3,"file":"index.js","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEO,MAAMA,KAAa;AAAA,EACxB,OAAO;AAAA,IACL,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,eAAe;AAAA,IACf,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,SAAS;AAAA,IACT,UAAU;AAAA,IACV,aAAa;AAAA,IACb,UAAU;AAAA,EAAA;AAAA,EAEZ,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EAAA;AAEV;AAgBO,SAASC,GAAgBC,IAA4B,IAAmB;AAC7E,QAAMC,IAAQ,EAAE,GAAGH,GAAW,OAAO,GAAGE,EAAQ,MAAA,GAC1CE,IAAS,EAAE,GAAGJ,GAAW,QAAQ,GAAGE,EAAQ,OAAA;AAElD,SAAO;AAAA,IACL,aAAaC,EAAM;AAAA,IACnB,kBAAkBA,EAAM;AAAA,IACxB,yBAAyBA,EAAM;AAAA,IAC/B,wBAAwBA,EAAM;AAAA,IAC9B,iBAAiBA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