@gryt/ui 0.13.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/theme/oklch.ts","../src/theme/createGrytTheme.ts","../src/GrytProvider.tsx","../src/theme/theme.ts","../src/theme/presets.ts","../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":["/**\n * sRGB and OKLCH, and the scale generator that runs on both sides of the build.\n *\n * This exists at runtime rather than only in a script because overriding a\n * colour has to regenerate that colour's whole scale. A theme that set\n * --gryt-accent and left --gryt-accent-9 alone would change almost nothing:\n * the components read the scale.\n *\n * No dependency. The conversions are the published OKLab matrices, and the\n * whole file is about eighty lines of arithmetic — a colour library would be\n * more weight than the maths it replaces.\n */\n\nexport interface Oklch {\n l: number;\n c: number;\n h: number;\n}\n\nfunction srgbToLinear(c: number): number {\n return c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;\n}\n\nfunction linearToSrgb(c: number): number {\n return c <= 0.0031308 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055;\n}\n\nfunction clamp01(value: number): number {\n return Math.min(1, Math.max(0, value));\n}\n\nexport function hexToRgb(hex: string): [number, number, number] {\n const h = hex.replace(\"#\", \"\");\n const full =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h;\n return [\n parseInt(full.slice(0, 2), 16) / 255,\n parseInt(full.slice(2, 4), 16) / 255,\n parseInt(full.slice(4, 6), 16) / 255\n ];\n}\n\nexport function rgbToHex([r, g, b]: [number, number, number]): string {\n const part = (c: number) =>\n Math.round(clamp01(c) * 255)\n .toString(16)\n .padStart(2, \"0\");\n return `#${part(r)}${part(g)}${part(b)}`;\n}\n\nexport function hexToOklch(hex: string): Oklch {\n const [r0, g0, b0] = hexToRgb(hex).map(srgbToLinear) as [\n number,\n number,\n number\n ];\n const l = Math.cbrt(\n 0.4122214708 * r0 + 0.5363325363 * g0 + 0.0514459929 * b0\n );\n const m = Math.cbrt(\n 0.2119034982 * r0 + 0.6806995451 * g0 + 0.1073969566 * b0\n );\n const s = Math.cbrt(\n 0.0883024619 * r0 + 0.2817188376 * g0 + 0.6299787005 * b0\n );\n const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;\n const a = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;\n const b = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;\n return {\n l: L,\n c: Math.hypot(a, b),\n h: ((Math.atan2(b, a) * 180) / Math.PI + 360) % 360\n };\n}\n\nexport function oklchToHex({ l, c, h }: Oklch): string {\n const a = c * Math.cos((h * Math.PI) / 180);\n const b = c * Math.sin((h * Math.PI) / 180);\n const l3 = (l + 0.3963377774 * a + 0.2158037573 * b) ** 3;\n const m3 = (l - 0.1055613458 * a - 0.0638541728 * b) ** 3;\n const s3 = (l - 0.0894841775 * a - 1.291485548 * b) ** 3;\n return rgbToHex([\n linearToSrgb(clamp01(4.0767416621 * l3 - 3.3077115913 * m3 + 0.2309699292 * s3)),\n linearToSrgb(clamp01(-1.2684380046 * l3 + 2.6097574011 * m3 - 0.3413193965 * s3)),\n linearToSrgb(clamp01(-0.0041960863 * l3 - 0.7034186147 * m3 + 1.707614701 * s3))\n ]);\n}\n\n/** The lightness and chroma of each step on a hue scale, dark theme. */\nconst HUE_L = [0.195, 0.24, 0.27, 0.3, 0.33, 0.37, 0.43, 0.52];\nconst HUE_C = [0.014, 0.026, 0.04, 0.052, 0.062, 0.072, 0.084, 0.1];\n\n/**\n * Twelve steps for a hue, from its solid step and the lighter one beside it.\n *\n * Steps 1 to 8 are the hue sunk into the dark end of the ramp — backgrounds,\n * then borders. 9 and 10 are the anchors themselves. 11 and 12 are text, and\n * they are placed relative to 10 rather than at a fixed lightness: the -light\n * tokens differ family to family, so a fixed value puts the text step above the\n * fill in one scale and below it in another.\n */\nexport function hueScale(solid: string, solidHover: string): string[] {\n const { h } = hexToOklch(solid);\n const steps = HUE_L.map((l, i) => oklchToHex({ l, c: HUE_C[i], h }));\n steps.push(solid, solidHover);\n\n const l10 = hexToOklch(solidHover).l;\n const l11 = Math.min(0.95, Math.max(0.84, l10 + 0.04));\n const l12 = Math.min(0.98, Math.max(l11 + 0.06, 0.93));\n steps.push(oklchToHex({ l: l11, c: 0.11, h }));\n steps.push(oklchToHex({ l: l12, c: 0.055, h }));\n return steps;\n}\n\nconst NEUTRAL_L = [\n 0.187, 0.231, 0.245, 0.268, 0.289, 0.31, 0.355, 0.425, 0.52, 0.57, 0.627,\n 0.908\n];\nconst NEUTRAL_C = [\n 0.011, 0.014, 0.016, 0.019, 0.022, 0.024, 0.026, 0.026, 0.02, 0.012, 0.0,\n 0.008\n];\n\n/**\n * Twelve neutral steps, from the six an app names directly.\n *\n * Those six are kept exactly — a theme that says its background is #0b0b0f\n * means it, and interpolating through it would move it by a shade.\n */\nexport function neutralScale(anchors: {\n bg: string;\n surface: string;\n surfaceRaised: string;\n border: string;\n muted: string;\n text: string;\n}): string[] {\n const fixed: Record<number, string> = {\n 0: anchors.bg,\n 1: anchors.surface,\n 2: anchors.surfaceRaised,\n 5: anchors.border,\n 10: anchors.muted,\n 11: anchors.text\n };\n const hue = hexToOklch(anchors.border).h;\n return NEUTRAL_L.map(\n (l, i) => fixed[i] ?? oklchToHex({ l, c: NEUTRAL_C[i], h: hue })\n );\n}\n\n/**\n * The same steps as translucent overlays.\n *\n * Solved rather than guessed: the smallest alpha whose overlay colour is still\n * inside the gamut, which is what makes a tinted hover composite to the same\n * value over an avatar as it does over the app background.\n */\nexport function alphaScale(scale: string[], background: string): string[] {\n const bg = hexToRgb(background);\n return scale.map((hex) => {\n const target = hexToRgb(hex);\n let alpha = 0;\n for (let i = 0; i < 3; i++) {\n const t = target[i];\n const b = bg[i];\n if (t > b) alpha = Math.max(alpha, b < 1 ? (t - b) / (1 - b) : 0);\n else if (t < b) alpha = Math.max(alpha, b > 0 ? (b - t) / b : 0);\n }\n if (alpha < 1e-6) return \"transparent\";\n const overlay = rgbToHex(\n target.map((t, i) => clamp01(bg[i] + (t - bg[i]) / alpha)) as [\n number,\n number,\n number\n ]\n );\n const [r, g, b] = hexToRgb(overlay).map((c) => Math.round(c * 255));\n return `rgb(${r} ${g} ${b} / ${(alpha * 100).toFixed(1)}%)`;\n });\n}\n\n/* ── light ──────────────────────────────────────────────────────────────\n Not a mirror of the dark ramps, because elevation does not mirror. In dark,\n a surface sitting on the page is lighter than the page; in light it is\n whiter and the page is the grey one. So step 1 is a light grey page and step\n 2 is white, and the ramp is deliberately not monotonic across those two —\n that non-monotonicity *is* the elevation.\n\n The text steps are the ones that had to be measured. In dark they need to be\n light enough on near-black; here they need to be dark enough on white, which\n is a different and tighter constraint because step 2 is pure white. */\n\nconst LIGHT_NEUTRAL_L = [\n 0.962, 1.0, 0.978, 0.952, 0.928, 0.898, 0.855, 0.79, 0.66, 0.61, 0.48, 0.25\n];\nconst LIGHT_NEUTRAL_C = [\n 0.006, 0.0, 0.004, 0.007, 0.01, 0.013, 0.016, 0.018, 0.016, 0.014, 0.012,\n 0.014\n];\n\nconst LIGHT_HUE_L = [0.975, 0.955, 0.93, 0.905, 0.878, 0.845, 0.795, 0.72];\nconst LIGHT_HUE_C = [0.012, 0.024, 0.038, 0.05, 0.062, 0.074, 0.09, 0.11];\n\n/** Twelve light neutral steps. Anchors are kept exactly, as in the dark set. */\nexport function neutralScaleLight(anchors: {\n bg: string;\n surface: string;\n surfaceRaised: string;\n border: string;\n muted: string;\n text: string;\n}): string[] {\n const fixed: Record<number, string> = {\n 0: anchors.bg,\n 1: anchors.surface,\n 2: anchors.surfaceRaised,\n 5: anchors.border,\n 10: anchors.muted,\n 11: anchors.text\n };\n const hue = hexToOklch(anchors.border).h;\n return LIGHT_NEUTRAL_L.map(\n (l, i) => fixed[i] ?? oklchToHex({ l, c: LIGHT_NEUTRAL_C[i], h: hue })\n );\n}\n\n/**\n * Twelve light steps for a hue.\n *\n * Step 9 stays the brand colour, so a filled button is the same colour in both\n * appearances and Gryt looks like Gryt either way. 10 goes *darker* for hover,\n * which is the light-mode direction — the dark set goes lighter. 11 and 12 are\n * text, dark enough to read on white.\n */\nexport function hueScaleLight(solid: string): string[] {\n const { l, c, h } = hexToOklch(solid);\n const steps = LIGHT_HUE_L.map((sl, i) =>\n oklchToHex({ l: sl, c: LIGHT_HUE_C[i], h })\n );\n steps.push(solid);\n steps.push(oklchToHex({ l: Math.max(0, l - 0.07), c, h }));\n // 0.46 rather than 0.5, which is where this started. Step 11 has to carry\n // text on step 3 as well as on the page — a Chip, an Alert and a Toast are\n // all that pairing — and at 0.5 the secondary hue measured 4.48:1 against its\n // own tint. Four hundredths of lightness is not visible; failing AA is.\n steps.push(oklchToHex({ l: 0.46, c: 0.15, h }));\n steps.push(oklchToHex({ l: 0.33, c: 0.1, h }));\n return steps;\n}\n\n/** WCAG relative luminance, for asserting contrast rather than eyeballing it. */\nfunction luminance(hex: string): number {\n const [r, g, b] = hexToRgb(hex).map(srgbToLinear);\n return 0.2126 * r + 0.7152 * g + 0.0722 * b;\n}\n\n/** WCAG contrast ratio. 4.5 is AA for body text, 3 for large text and UI. */\nexport function contrast(a: string, b: string): number {\n const la = luminance(a);\n const lb = luminance(b);\n return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);\n}\n","import type { CSSProperties } from \"react\";\nimport {\n alphaScale,\n hueScale,\n hueScaleLight,\n neutralScale,\n neutralScaleLight\n} from \"./oklch\";\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 // The fill's own hue, dark enough to clear 7:1 against it. See the note in\n // theme.css: these are the only text in the library that always sits on a\n // saturated colour, so they are held to AAA rather than AA.\n onAccent: \"#0c0a20\",\n onSecondary: \"#02121a\",\n onDanger: \"#1f0405\"\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 * Which set of ramps to build. Dark is the default because it is what the\n * library ships on :root; an app toggling appearance calls this twice and\n * puts each result behind its own selector.\n */\n appearance?: \"dark\" | \"light\";\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.\n/**\n * The scales, computed rather than written down.\n *\n * There is one generator, and this is it — theme.css is emitted from these same\n * functions by scripts/generate-theme.ts, and a test asserts the stylesheet\n * still matches. Two hand-maintained copies of a twelve-step ramp would drift\n * the first time somebody nudged a colour.\n */\n/**\n * The light anchors.\n *\n * Picked for this palette rather than computed from the dark ones. The page is\n * a light grey and panels are white, which is the arrangement the client\n * already used and the one people expect of a light UI.\n */\nexport const grytLightTokens = {\n bg: \"#f1f2f7\",\n surface: \"#ffffff\",\n surfaceRaised: \"#f7f8fb\",\n border: \"#dadde6\",\n muted: \"#5b5d65\",\n text: \"#1f2129\"\n} as const;\n\nexport const grytScales = {\n neutral: neutralScale({\n bg: grytTokens.color.bg,\n surface: grytTokens.color.surface,\n surfaceRaised: grytTokens.color.surfaceRaised,\n border: grytTokens.color.border,\n muted: grytTokens.color.muted,\n text: grytTokens.color.text\n }),\n accent: hueScale(grytTokens.color.accent, grytTokens.color.accentLight),\n secondary: hueScale(\n grytTokens.color.secondary,\n grytTokens.color.secondaryLight\n ),\n success: hueScale(grytTokens.color.success, grytTokens.color.success),\n danger: hueScale(grytTokens.color.danger, grytTokens.color.dangerLight),\n warning: hueScale(grytTokens.color.warning, grytTokens.color.warning)\n} as const;\n\n/** The same six families, light. */\nexport const grytScalesLight = {\n neutral: neutralScaleLight(grytLightTokens),\n accent: hueScaleLight(grytTokens.color.accent),\n secondary: hueScaleLight(grytTokens.color.secondary),\n success: hueScaleLight(grytTokens.color.success),\n danger: hueScaleLight(grytTokens.color.danger),\n warning: hueScaleLight(grytTokens.color.warning)\n} as const;\n\n/**\n * The light hover fill.\n *\n * Not one of the six anchors, because it is not a colour anybody picks: it is\n * step 4, the step that means \"component background, hovered\", and writing it\n * down as a literal would be a second definition of a value the ramp already\n * has. It exists at all because `.light` never set surface-hover, so a neutral\n * Button in a light app hovered to the dark slate the @theme block declares —\n * a slate block on a white panel.\n */\nexport const grytLightSurfaceHover = grytScalesLight.neutral[3];\n\nexport const grytAlphaScales = {\n neutral: alphaScale(grytScales.neutral, grytTokens.color.bg),\n accent: alphaScale(grytScales.accent, grytTokens.color.bg)\n} as const;\n\nexport const grytAlphaScalesLight = {\n neutral: alphaScale(grytScalesLight.neutral, grytLightTokens.bg),\n accent: alphaScale(grytScalesLight.accent, grytLightTokens.bg)\n} as const;\n\nexport function createGrytTheme(options: GrytThemeOptions = {}): CSSProperties {\n const light = options.appearance === \"light\";\n const defaults = light\n ? {\n ...grytTokens.color,\n ...grytLightTokens,\n surfaceHover: grytLightSurfaceHover\n }\n : grytTokens.color;\n const color = { ...defaults, ...options.color };\n const radius = { ...grytTokens.radius, ...options.radius };\n\n /**\n * Overriding a colour regenerates its scale.\n *\n * The components read the scale, not the flat name — bg-gryt-neutral-4 for a\n * hover, text-gryt-accent-11 for a link — so a theme that set --gryt-accent\n * and stopped there would change almost nothing on screen. The same\n * generator that produced the defaults runs here on whatever anchors the\n * caller passed, which is what makes one line of override recolour the app\n * coherently rather than in patches.\n */\n const anchors = {\n bg: color.bg,\n surface: color.surface,\n surfaceRaised: color.surfaceRaised,\n border: color.border,\n muted: color.muted,\n text: color.text\n };\n const scales: Record<string, string[]> = light\n ? {\n neutral: neutralScaleLight(anchors),\n accent: hueScaleLight(color.accent),\n secondary: hueScaleLight(color.secondary),\n success: hueScaleLight(color.success),\n danger: hueScaleLight(color.danger),\n warning: hueScaleLight(color.warning)\n }\n : {\n neutral: neutralScale(anchors),\n accent: hueScale(color.accent, color.accentLight),\n secondary: hueScale(color.secondary, color.secondaryLight),\n success: hueScale(color.success, color.success),\n danger: hueScale(color.danger, color.dangerLight),\n warning: hueScale(color.warning, color.warning)\n };\n\n const scaleVars: Record<string, string> = {};\n for (const [name, steps] of Object.entries(scales)) {\n steps.forEach((value, index) => {\n scaleVars[`--gryt-${name}-${index + 1}`] = value;\n scaleVars[`--color-gryt-${name}-${index + 1}`] = value;\n });\n }\n for (const name of [\"neutral\", \"accent\"] as const) {\n alphaScale(scales[name], color.bg).forEach((value, index) => {\n scaleVars[`--gryt-${name}-a${index + 1}`] = value;\n scaleVars[`--color-gryt-${name}-a${index + 1}`] = value;\n });\n }\n\n return {\n ...scaleVars,\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 /**\n * No theme, no variables.\n *\n * This used to paint the full default palette onto the wrapper whenever the\n * prop was absent, which looked harmless and was not: the stylesheet already\n * declares those values on :root, so the copy added nothing, and it sat below\n * the root in the cascade — an app that themed itself the documented way, by\n * putting variables on the root element where overlays can reach them, found\n * every one of them overridden by a provider re-stating the defaults.\n *\n * It cost this site an afternoon. The header can put the docs in Nord now,\n * and the reason it could not before was one div.\n */\n const style =\n theme === undefined\n ? undefined\n : isCssVariables(theme)\n ? theme\n : createGrytTheme(theme);\n\n return (\n <div className={className} style={style}>\n <Tooltip.Provider delay={tooltipDelay}>{children}</Tooltip.Provider>\n </div>\n );\n}\n","/* A whole theme, as a thing you can hand to somebody.\n *\n * createGrytTheme takes the colours for one appearance. That is the right shape\n * for the caller who wants one theme, and the wrong shape for a theme that\n * travels: dark and light do not derive from each other, so a theme somebody\n * shares has to carry both.\n *\n * Two sets of neutrals, then, and one set of hues — because step 9 is the same\n * colour in both appearances by design, so a filled button does not change\n * colour when somebody switches. `lightHue` is the exception, for palettes\n * where that is not true. Catppuccin's mauve is #cba6f7 in Mocha and #8839ef in\n * Latte; forcing one on it would make the theme wrong in one half.\n *\n * The encoding is a query string because that is the useful property of a\n * palette this small: a theme is a couple of dozen hex values, which fits in a\n * link, and a link is the thing people actually send each other. Only what\n * differs from Gryt's own values is carried, so a theme that changed one colour\n * is a link with one parameter in it.\n */\n\nimport { grytLightSurfaceHover, grytLightTokens, grytTokens } from \"./createGrytTheme\";\nimport type { GrytThemeOptions } from \"./createGrytTheme\";\n\nexport type GrytAppearance = \"dark\" | \"light\";\n\nexport const GRYT_HUE_KEYS = [\n \"accent\",\n \"accentLight\",\n \"secondary\",\n \"secondaryLight\",\n \"success\",\n \"danger\",\n \"dangerLight\",\n \"warning\",\n \"onAccent\",\n \"onSecondary\",\n \"onDanger\"\n] as const;\n\nexport const GRYT_NEUTRAL_KEYS = [\n \"bg\",\n \"surface\",\n \"surfaceRaised\",\n \"surfaceHover\",\n \"border\",\n \"muted\",\n \"text\"\n] as const;\n\nexport const GRYT_RADIUS_KEYS = [\"sm\", \"md\", \"lg\", \"xl\", \"full\"] as const;\n\nexport type GrytHueKey = (typeof GRYT_HUE_KEYS)[number];\nexport type GrytNeutralKey = (typeof GRYT_NEUTRAL_KEYS)[number];\nexport type GrytRadiusKey = (typeof GRYT_RADIUS_KEYS)[number];\n\nexport type GrytHues = Record<GrytHueKey, string>;\nexport type GrytNeutrals = Record<GrytNeutralKey, string>;\n\nexport interface GrytTheme {\n /**\n * What its author called it, if they called it anything.\n *\n * Metadata rather than a colour: nothing about how a theme looks depends on\n * it, and grytThemeToOptions drops it. It exists because a link full of hex\n * values says nothing about what it is, and the person who made it already\n * knew — so the receiving end should not have to ask.\n */\n name?: string;\n hue: GrytHues;\n /** Null when light borrows the hues above, which is the usual case. */\n lightHue: GrytHues | null;\n dark: GrytNeutrals;\n light: GrytNeutrals;\n radius: Record<GrytRadiusKey, number>;\n}\n\n/** Long enough for a name, short enough not to be a payload. */\nexport const GRYT_THEME_NAME_MAX = 60;\n\nexport function normalizeThemeName(value: string): string {\n return value.replace(/\\s+/g, \" \").trim().slice(0, GRYT_THEME_NAME_MAX);\n}\n\n/** What the library ships, as a document. */\nexport const grytTheme: GrytTheme = {\n hue: {\n accent: grytTokens.color.accent,\n accentLight: grytTokens.color.accentLight,\n secondary: grytTokens.color.secondary,\n secondaryLight: grytTokens.color.secondaryLight,\n success: grytTokens.color.success,\n danger: grytTokens.color.danger,\n dangerLight: grytTokens.color.dangerLight,\n warning: grytTokens.color.warning,\n onAccent: grytTokens.color.onAccent,\n onSecondary: grytTokens.color.onSecondary,\n onDanger: grytTokens.color.onDanger\n },\n lightHue: null,\n dark: {\n bg: grytTokens.color.bg,\n surface: grytTokens.color.surface,\n surfaceRaised: grytTokens.color.surfaceRaised,\n surfaceHover: grytTokens.color.surfaceHover,\n border: grytTokens.color.border,\n muted: grytTokens.color.muted,\n text: grytTokens.color.text\n },\n light: {\n bg: grytLightTokens.bg,\n surface: grytLightTokens.surface,\n surfaceRaised: grytLightTokens.surfaceRaised,\n surfaceHover: grytLightSurfaceHover,\n border: grytLightTokens.border,\n muted: grytLightTokens.muted,\n text: grytLightTokens.text\n },\n radius: { ...grytTokens.radius }\n};\n\nexport function cloneGrytTheme(theme: GrytTheme): GrytTheme {\n return {\n ...(theme.name === undefined ? {} : { name: theme.name }),\n hue: { ...theme.hue },\n lightHue: theme.lightHue === null ? null : { ...theme.lightHue },\n dark: { ...theme.dark },\n light: { ...theme.light },\n radius: { ...theme.radius }\n };\n}\n\n/** Which hues this appearance reads. */\nexport function grytThemeHues(\n theme: GrytTheme,\n appearance: GrytAppearance\n): GrytHues {\n return appearance === \"light\" && theme.lightHue !== null\n ? theme.lightHue\n : theme.hue;\n}\n\n/**\n * One appearance of a theme, in the shape createGrytTheme takes.\n *\n * The name does not come along: createGrytTheme returns CSS variables, and a\n * name is not one.\n */\nexport function grytThemeToOptions(\n theme: GrytTheme,\n appearance: GrytAppearance\n): GrytThemeOptions {\n return {\n appearance,\n color: { ...grytThemeHues(theme, appearance), ...theme[appearance] },\n radius: { ...theme.radius }\n };\n}\n\n/* ── the link ─────────────────────────────────────────────────────────── */\n\nconst HUE_PARAM: Record<GrytHueKey, string> = {\n accent: \"accent\",\n accentLight: \"accent-light\",\n secondary: \"secondary\",\n secondaryLight: \"secondary-light\",\n success: \"success\",\n danger: \"danger\",\n dangerLight: \"danger-light\",\n warning: \"warning\",\n onAccent: \"on-accent\",\n onSecondary: \"on-secondary\",\n onDanger: \"on-danger\"\n};\n\nconst NEUTRAL_PARAM: Record<GrytNeutralKey, string> = {\n bg: \"bg\",\n surface: \"surface\",\n surfaceRaised: \"raised\",\n surfaceHover: \"hover\",\n border: \"border\",\n muted: \"muted\",\n text: \"text\"\n};\n\nconst HEX = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;\n\nexport function isHexColor(value: string): boolean {\n return HEX.test(value.trim());\n}\n\n/** #abc to #aabbcc, lower case, so two of the same colour compare equal. */\nexport function normalizeHexColor(value: string): string {\n const hex = value.trim().toLowerCase();\n return hex.length === 4\n ? `#${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`\n : hex;\n}\n\n/**\n * The theme as query parameters, carrying only what differs from Gryt's own.\n *\n * `appearance` is which half the sender was looking at, and it rides along\n * because a shared link that opens on the other one is showing something the\n * sender never saw.\n */\nexport function encodeGrytTheme(\n theme: GrytTheme,\n appearance?: GrytAppearance\n): URLSearchParams {\n const params = new URLSearchParams();\n const bare = (hex: string) => normalizeHexColor(hex).slice(1);\n\n const name = normalizeThemeName(theme.name ?? \"\");\n if (name !== \"\") params.set(\"name\", name);\n\n for (const key of GRYT_HUE_KEYS) {\n if (theme.hue[key] !== grytTheme.hue[key]) {\n params.set(HUE_PARAM[key], bare(theme.hue[key]));\n }\n }\n // A split light set is carried whole rather than diffed. It is only there\n // when somebody meant it, and diffing it against the dark hues would drop\n // exactly the values that make it a split.\n if (theme.lightHue !== null) {\n for (const key of GRYT_HUE_KEYS) {\n params.set(`lh-${HUE_PARAM[key]}`, bare(theme.lightHue[key]));\n }\n }\n for (const half of [\"dark\", \"light\"] as const) {\n const prefix = half === \"dark\" ? \"d\" : \"l\";\n for (const key of GRYT_NEUTRAL_KEYS) {\n if (theme[half][key] !== grytTheme[half][key]) {\n params.set(`${prefix}-${NEUTRAL_PARAM[key]}`, bare(theme[half][key]));\n }\n }\n }\n for (const key of GRYT_RADIUS_KEYS) {\n if (theme.radius[key] !== grytTheme.radius[key]) {\n params.set(`r-${key}`, String(theme.radius[key]));\n }\n }\n if (appearance === \"light\") params.set(\"mode\", \"light\");\n\n return params;\n}\n\nexport interface DecodedGrytTheme {\n theme: GrytTheme;\n /** Which half the link was sent from. Dark unless it says otherwise. */\n appearance: GrytAppearance;\n}\n\n/**\n * Whatever somebody pasted.\n *\n * A whole URL, a bare query string, or the JSON form — one function, because\n * from the outside they are the same act. Null when there is no theme in it at\n * all; a value it cannot parse is left at Gryt's, so one mistyped colour does\n * not throw the rest away.\n */\nexport function decodeGrytTheme(input: string): DecodedGrytTheme | null {\n const text = input.trim();\n if (text === \"\") return null;\n if (text.startsWith(\"{\")) return decodeJson(text);\n\n const query = text.includes(\"?\") ? text.slice(text.indexOf(\"?\") + 1) : text;\n return decodeParams(new URLSearchParams(query));\n}\n\nfunction decodeParams(params: URLSearchParams): DecodedGrytTheme | null {\n const theme = cloneGrytTheme(grytTheme);\n let present = false;\n\n const read = (name: string): string | null => {\n const raw = params.get(name);\n if (raw === null) return null;\n const hex = raw.startsWith(\"#\") ? raw : `#${raw}`;\n if (!isHexColor(hex)) return null;\n present = true;\n return normalizeHexColor(hex);\n };\n\n const name = normalizeThemeName(params.get(\"name\") ?? \"\");\n if (name !== \"\") {\n theme.name = name;\n present = true;\n }\n\n for (const key of GRYT_HUE_KEYS) {\n const value = read(HUE_PARAM[key]);\n if (value !== null) theme.hue[key] = value;\n }\n if (params.has(`lh-${HUE_PARAM.accent}`)) {\n const light = { ...theme.hue };\n for (const key of GRYT_HUE_KEYS) {\n const value = read(`lh-${HUE_PARAM[key]}`);\n if (value !== null) light[key] = value;\n }\n theme.lightHue = light;\n }\n for (const half of [\"dark\", \"light\"] as const) {\n const prefix = half === \"dark\" ? \"d\" : \"l\";\n for (const key of GRYT_NEUTRAL_KEYS) {\n const value = read(`${prefix}-${NEUTRAL_PARAM[key]}`);\n if (value !== null) theme[half][key] = value;\n }\n }\n for (const key of GRYT_RADIUS_KEYS) {\n const value = Number(params.get(`r-${key}`));\n // Anything outside this is a typo or somebody having a laugh, and a\n // 40000px radius makes an app look broken rather than themed.\n if (Number.isFinite(value) && value >= 0 && value <= 999 && params.has(`r-${key}`)) {\n theme.radius[key] = Math.round(value);\n present = true;\n }\n }\n\n if (!present) return null;\n return {\n theme,\n appearance: params.get(\"mode\") === \"light\" ? \"light\" : \"dark\"\n };\n}\n\nfunction decodeJson(text: string): DecodedGrytTheme | null {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return null;\n }\n if (typeof parsed !== \"object\" || parsed === null) return null;\n const source = parsed as Record<string, unknown>;\n\n const theme = cloneGrytTheme(grytTheme);\n let present = false;\n\n const colors = (value: unknown, target: Record<string, string>) => {\n if (typeof value !== \"object\" || value === null) return;\n for (const [key, raw] of Object.entries(value as Record<string, unknown>)) {\n if (typeof raw === \"string\" && isHexColor(raw) && key in target) {\n target[key] = normalizeHexColor(raw);\n present = true;\n }\n }\n };\n\n if (typeof source.name === \"string\") {\n const named = normalizeThemeName(source.name);\n if (named !== \"\") {\n theme.name = named;\n present = true;\n }\n }\n\n colors(source.hue, theme.hue);\n colors(source.dark, theme.dark);\n colors(source.light, theme.light);\n\n if (typeof source.lightHue === \"object\" && source.lightHue !== null) {\n const light = { ...theme.hue };\n colors(source.lightHue, light);\n theme.lightHue = light;\n }\n\n if (typeof source.radius === \"object\" && source.radius !== null) {\n for (const [key, raw] of Object.entries(\n source.radius as Record<string, unknown>\n )) {\n const value = Number(raw);\n if (\n (GRYT_RADIUS_KEYS as readonly string[]).includes(key) &&\n Number.isFinite(value) &&\n value >= 0 &&\n value <= 999\n ) {\n theme.radius[key as GrytRadiusKey] = Math.round(value);\n present = true;\n }\n }\n }\n\n if (!present) return null;\n return { theme, appearance: \"dark\" };\n}\n","/* Themes to start from.\n *\n * Two kinds. The Gryt ones show the range — warm, near-monochrome,\n * high-contrast, and the palette the library ships. The ported ones are\n * well-known palettes, because \"can it look like the thing I already use?\" is\n * the question people arrive with, and a paragraph claiming yes is worth less\n * than a click.\n *\n * Every ported value is the published one, taken from the source named in the\n * comment above each preset rather than from memory. Where a palette defines\n * both a dark and a light variant — Alucard, Latte, Snow Storm, GitHub Light,\n * Solarized Light — both are here, which is why lightHue exists: Catppuccin's\n * mauve and GitHub's blue are genuinely different colours in each half, and\n * sharing one would make the preset wrong in the other.\n *\n * Two honest limits, and the page says both:\n *\n * - Gryt names seven neutral anchors. Most palettes name fewer, so the steps\n * in between are derived — marked `derived` where that happens. Nothing\n * derived is invented out of nowhere; it sits between two published values.\n * - A palette is a set of names with colours behind them, and mapping those\n * names onto \"page, surface, border, muted, text\" is a judgement. Somebody\n * else mapping the same palette would put a couple of them elsewhere.\n *\n * Radius is part of a preset too. GitHub's buttons are not pills and\n * Solarized's are square; a preset that got the colours right and left\n * everything fully rounded would not look like the thing it names.\n *\n * Names belong to their projects. Dracula, Nord, Catppuccin, Solarized and\n * shadcn/ui are MIT-licensed; the rest are referenced by name only.\n *\n * These ship with the library rather than with the docs site, because the docs\n * site is not the only thing that lists them: the client offers the same set,\n * and it should get a new one by taking a newer @gryt/ui rather than by\n * somebody copying eleven palettes across by hand.\n */\n\nimport type { GrytRadiusKey, GrytTheme } from \"./theme\";\nimport { grytTheme } from \"./theme\";\n\nexport interface GrytThemePreset {\n id: string;\n name: string;\n /** One line under the name: what makes this one different. */\n note: string;\n group: \"Gryt\" | \"Ported\";\n /** Where the values came from. Shown as the attribution line. */\n source?: string;\n theme: GrytTheme;\n}\n\ntype Radius = Record<GrytRadiusKey, number>;\n\nconst ROUND: Radius = { sm: 8, md: 12, lg: 20, xl: 28, full: 999 };\nconst SOFT: Radius = { sm: 6, md: 8, lg: 14, xl: 18, full: 999 };\n/** Buttons that are not pills. `full` is what controls use, so it does the work. */\nconst CRISP: Radius = { sm: 4, md: 6, lg: 10, xl: 14, full: 6 };\nconst SHADCN: Radius = { sm: 6, md: 8, lg: 10, xl: 14, full: 10 };\nconst SQUARE: Radius = { sm: 2, md: 4, lg: 6, xl: 8, full: 4 };\n\nexport const grytPresets: GrytThemePreset[] = [\n {\n id: \"gryt\",\n name: \"Gryt\",\n note: \"What the library ships, from the Gryt code-theme.\",\n group: \"Gryt\",\n source: \"github.com/Gryt-chat/code-theme\",\n theme: grytTheme\n },\n {\n id: \"ember\",\n name: \"Ember\",\n note: \"Warm all the way down — the neutrals are brown, not blue.\",\n group: \"Gryt\",\n theme: {\n name: \"Ember\",\n hue: {\n accent: \"#f0803c\",\n accentLight: \"#ff9f66\",\n secondary: \"#d9a441\",\n secondaryLight: \"#ecc06a\",\n success: \"#8bb056\",\n danger: \"#e35d55\",\n dangerLight: \"#ef8079\",\n warning: \"#e8b33e\",\n onAccent: \"#231004\",\n onSecondary: \"#241a04\",\n onDanger: \"#2b0a08\"\n },\n lightHue: null,\n dark: {\n bg: \"#17110e\",\n surface: \"#1f1815\",\n surfaceRaised: \"#251d19\",\n surfaceHover: \"#33261f\",\n border: \"#352822\",\n muted: \"#a48f81\",\n text: \"#f5ece5\"\n },\n light: {\n bg: \"#f6efe8\",\n surface: \"#fffdfb\",\n surfaceRaised: \"#faf3ec\",\n surfaceHover: \"#efe3d8\",\n border: \"#e0d2c4\",\n muted: \"#6b5b50\",\n text: \"#241a14\"\n },\n radius: ROUND\n }\n },\n {\n id: \"paper\",\n name: \"Paper\",\n note: \"Near-monochrome. One quiet slate accent and nothing else.\",\n group: \"Gryt\",\n theme: {\n name: \"Paper\",\n hue: {\n accent: \"#8390a8\",\n accentLight: \"#a3aec2\",\n secondary: \"#93a0a0\",\n secondaryLight: \"#b1bcbc\",\n success: \"#7f9b7f\",\n danger: \"#b56b6b\",\n dangerLight: \"#c98d8d\",\n warning: \"#b39a6a\",\n onAccent: \"#11151c\",\n onSecondary: \"#121717\",\n onDanger: \"#1d0e0e\"\n },\n lightHue: null,\n dark: {\n bg: \"#101011\",\n surface: \"#17171a\",\n surfaceRaised: \"#1d1d20\",\n surfaceHover: \"#282a2e\",\n border: \"#2a2a2e\",\n muted: \"#8e8e94\",\n text: \"#ededf0\"\n },\n light: {\n bg: \"#f0f0f2\",\n surface: \"#ffffff\",\n surfaceRaised: \"#f7f7f9\",\n surfaceHover: \"#e6e6ea\",\n border: \"#d6d6dc\",\n muted: \"#5b5b63\",\n text: \"#17171a\"\n },\n radius: SOFT\n }\n },\n {\n id: \"signal\",\n name: \"Signal\",\n note: \"Black, white, and a yellow that cannot be missed.\",\n group: \"Gryt\",\n theme: {\n name: \"Signal\",\n hue: {\n accent: \"#ffd400\",\n accentLight: \"#ffe454\",\n secondary: \"#00d0ff\",\n secondaryLight: \"#66e2ff\",\n success: \"#00e06a\",\n danger: \"#ff453a\",\n dangerLight: \"#ff7a72\",\n warning: \"#ffab00\",\n onAccent: \"#161200\",\n onSecondary: \"#001a20\",\n onDanger: \"#1a0300\"\n },\n lightHue: null,\n dark: {\n bg: \"#000000\",\n surface: \"#0c0c0c\",\n surfaceRaised: \"#151515\",\n surfaceHover: \"#242424\",\n border: \"#454545\",\n muted: \"#bcbcbc\",\n text: \"#ffffff\"\n },\n light: {\n bg: \"#f0f0f0\",\n surface: \"#ffffff\",\n surfaceRaised: \"#f8f8f8\",\n surfaceHover: \"#e3e3e3\",\n border: \"#6f6f6f\",\n muted: \"#3d3d3d\",\n text: \"#000000\"\n },\n radius: SQUARE\n }\n },\n {\n /* Dracula's eleven, and Alucard's eleven for the light half, from the\n palette tables in dracula/dracula-theme. Background, Current Line,\n Foreground and Comment are exact; the two steps between Background and\n Current Line are derived, because Dracula does not name them. */\n id: \"dracula\",\n name: \"Dracula\",\n note: \"The purple-and-pink dark theme, with Alucard as its light half.\",\n group: \"Ported\",\n source: \"draculatheme.com, MIT\",\n theme: {\n name: \"Dracula\",\n hue: {\n accent: \"#bd93f9\",\n accentLight: \"#d0b3fb\",\n secondary: \"#8be9fd\",\n secondaryLight: \"#aff0fe\",\n success: \"#50fa7b\",\n danger: \"#ff5555\",\n dangerLight: \"#ff7979\",\n warning: \"#ffb86c\",\n onAccent: \"#282a36\",\n onSecondary: \"#282a36\",\n onDanger: \"#282a36\"\n },\n lightHue: {\n accent: \"#644ac9\",\n accentLight: \"#7b64d6\",\n secondary: \"#036a96\",\n secondaryLight: \"#0b83b5\",\n success: \"#14710a\",\n danger: \"#cb3a2a\",\n dangerLight: \"#d95445\",\n warning: \"#a34d14\",\n onAccent: \"#fffbeb\",\n onSecondary: \"#fffbeb\",\n onDanger: \"#fffbeb\"\n },\n dark: {\n bg: \"#282a36\",\n surface: \"#31323f\",\n surfaceRaised: \"#383a49\",\n surfaceHover: \"#44475a\",\n border: \"#44475a\",\n muted: \"#6272a4\",\n text: \"#f8f8f2\"\n },\n light: {\n bg: \"#f5f1e1\",\n surface: \"#fffbeb\",\n surfaceRaised: \"#faf6e6\",\n surfaceHover: \"#ece7d4\",\n border: \"#dcd6bf\",\n muted: \"#6c664b\",\n text: \"#1f1f1f\"\n },\n radius: SOFT\n }\n },\n {\n /* nord0-nord15, exactly as nordtheme.com publishes them. Polar Night is\n the dark neutrals, Snow Storm the light ones, Frost the accents and\n Aurora the status colours. Nothing here is derived. */\n id: \"nord\",\n name: \"Nord\",\n note: \"Polar Night and Snow Storm, with Frost on top.\",\n group: \"Ported\",\n source: \"nordtheme.com, MIT\",\n theme: {\n name: \"Nord\",\n hue: {\n accent: \"#88c0d0\",\n accentLight: \"#8fbcbb\",\n secondary: \"#81a1c1\",\n secondaryLight: \"#a3b8d4\",\n success: \"#a3be8c\",\n danger: \"#bf616a\",\n dangerLight: \"#d08770\",\n warning: \"#ebcb8b\",\n onAccent: \"#2e3440\",\n onSecondary: \"#2e3440\",\n onDanger: \"#eceff4\"\n },\n lightHue: {\n accent: \"#5e81ac\",\n accentLight: \"#81a1c1\",\n secondary: \"#8fbcbb\",\n secondaryLight: \"#88c0d0\",\n success: \"#a3be8c\",\n danger: \"#bf616a\",\n dangerLight: \"#d08770\",\n warning: \"#ebcb8b\",\n onAccent: \"#eceff4\",\n onSecondary: \"#2e3440\",\n onDanger: \"#eceff4\"\n },\n dark: {\n bg: \"#2e3440\",\n surface: \"#3b4252\",\n surfaceRaised: \"#434c5e\",\n surfaceHover: \"#4c566a\",\n border: \"#4c566a\",\n muted: \"#d8dee9\",\n text: \"#eceff4\"\n },\n light: {\n bg: \"#e5e9f0\",\n surface: \"#eceff4\",\n surfaceRaised: \"#e9edf2\",\n surfaceHover: \"#d8dee9\",\n border: \"#c9d1de\",\n muted: \"#4c566a\",\n text: \"#2e3440\"\n },\n radius: SOFT\n }\n },\n {\n /* Mocha and Latte from catppuccin/palette's palette.json. base, mantle,\n surface0/1/2, text and subtext0 are exact; the border step is derived\n from surface1 and surface2, which is where a border sits in their own\n ports. */\n id: \"catppuccin\",\n name: \"Catppuccin\",\n note: \"Mocha for dark, Latte for light. Mauve does the accent work.\",\n group: \"Ported\",\n source: \"catppuccin/palette, MIT\",\n theme: {\n name: \"Catppuccin\",\n hue: {\n accent: \"#cba6f7\",\n accentLight: \"#dcc0fa\",\n secondary: \"#89b4fa\",\n secondaryLight: \"#a8c8fb\",\n success: \"#a6e3a1\",\n danger: \"#f38ba8\",\n dangerLight: \"#eba0ac\",\n warning: \"#f9e2af\",\n onAccent: \"#1e1e2e\",\n onSecondary: \"#1e1e2e\",\n onDanger: \"#1e1e2e\"\n },\n lightHue: {\n accent: \"#8839ef\",\n accentLight: \"#9a55f2\",\n secondary: \"#1e66f5\",\n secondaryLight: \"#4680f7\",\n success: \"#40a02b\",\n danger: \"#d20f39\",\n dangerLight: \"#e64553\",\n warning: \"#df8e1d\",\n onAccent: \"#eff1f5\",\n onSecondary: \"#eff1f5\",\n onDanger: \"#eff1f5\"\n },\n dark: {\n bg: \"#1e1e2e\",\n surface: \"#313244\",\n surfaceRaised: \"#45475a\",\n surfaceHover: \"#585b70\",\n border: \"#45475a\",\n muted: \"#a6adc8\",\n text: \"#cdd6f4\"\n },\n light: {\n bg: \"#e6e9ef\",\n surface: \"#eff1f5\",\n surfaceRaised: \"#eaedf3\",\n surfaceHover: \"#dce0e8\",\n border: \"#ccd0da\",\n muted: \"#6c6f85\",\n text: \"#4c4f69\"\n },\n radius: ROUND\n }\n },\n {\n /* Primer's functional tokens, from @primer/primitives' compiled themes:\n bgColor-default, bgColor-muted, borderColor-default, fgColor-default,\n fgColor-muted, and the -emphasis fills for accent, danger, success,\n attention and done. The raised and hover steps are derived — Primer\n expresses those as translucent overlays rather than as solid colours. */\n id: \"github\",\n name: \"GitHub\",\n note: \"Primer's own tokens, six-pixel corners included.\",\n group: \"Ported\",\n source: \"@primer/primitives\",\n theme: {\n name: \"GitHub\",\n hue: {\n accent: \"#1f6feb\",\n accentLight: \"#4493f8\",\n secondary: \"#8957e5\",\n secondaryLight: \"#a371f7\",\n success: \"#238636\",\n danger: \"#da3633\",\n dangerLight: \"#f85149\",\n warning: \"#9e6a03\",\n onAccent: \"#ffffff\",\n onSecondary: \"#ffffff\",\n onDanger: \"#ffffff\"\n },\n lightHue: {\n accent: \"#0969da\",\n accentLight: \"#218bff\",\n secondary: \"#8250df\",\n secondaryLight: \"#a475f9\",\n success: \"#1f883d\",\n danger: \"#cf222e\",\n dangerLight: \"#d1242f\",\n warning: \"#9a6700\",\n onAccent: \"#ffffff\",\n onSecondary: \"#ffffff\",\n onDanger: \"#ffffff\"\n },\n dark: {\n bg: \"#0d1117\",\n surface: \"#151b23\",\n surfaceRaised: \"#1c222b\",\n surfaceHover: \"#262c36\",\n border: \"#3d444d\",\n muted: \"#9198a1\",\n text: \"#f0f6fc\"\n },\n light: {\n bg: \"#f6f8fa\",\n surface: \"#ffffff\",\n surfaceRaised: \"#fbfcfd\",\n surfaceHover: \"#eef1f4\",\n border: \"#d1d9e0\",\n muted: \"#59636e\",\n text: \"#1f2328\"\n },\n radius: CRISP\n }\n },\n {\n /* Read off anthropic.com's own stylesheet: the clay #d97757, the cream\n #f0eee6 and #faf9f5, the ink #141413, and the neutrals #3d3d3a,\n #87867f, #b0aea5, #c6c4ba, #e8e6dc. Anthropic publishes no token file,\n so the status hues have no published counterpart and are Gryt's own —\n this is the one preset that is a likeness rather than a port. */\n id: \"claude\",\n name: \"Claude\",\n note: \"Anthropic's clay orange on cream and near-black.\",\n group: \"Ported\",\n source: \"anthropic.com — a likeness, not a published palette\",\n theme: {\n name: \"Claude\",\n hue: {\n accent: \"#d97757\",\n accentLight: \"#e59275\",\n secondary: \"#7d9ec4\",\n secondaryLight: \"#9db8d6\",\n success: \"#6ba368\",\n danger: \"#bf4d43\",\n dangerLight: \"#d4726a\",\n warning: \"#d9a441\",\n onAccent: \"#241009\",\n onSecondary: \"#0c1720\",\n onDanger: \"#faf9f5\"\n },\n lightHue: null,\n dark: {\n bg: \"#141413\",\n surface: \"#1f1e1d\",\n surfaceRaised: \"#262624\",\n surfaceHover: \"#3d3d3a\",\n border: \"#3d3d3a\",\n muted: \"#b0aea5\",\n text: \"#faf9f5\"\n },\n light: {\n bg: \"#f0eee6\",\n surface: \"#faf9f5\",\n surfaceRaised: \"#f5f3ec\",\n surfaceHover: \"#e8e6dc\",\n border: \"#d5d2c5\",\n muted: \"#87867f\",\n text: \"#141413\"\n },\n radius: ROUND\n }\n },\n {\n /* The zinc theme from shadcn-ui/ui's registry, converted from its OKLCH\n values. One deliberate departure: shadcn's primary is monochrome —\n near-white in dark, near-black in light — which cannot be a Gryt accent,\n because the accent is also the colour every link and focus ring is drawn\n from. Its destructive red is the accent here, and the neutrals are the\n theme's own. */\n id: \"shadcn\",\n name: \"shadcn/ui\",\n note: \"Zinc neutrals and a ten-pixel radius. No pills anywhere.\",\n group: \"Ported\",\n source: \"ui.shadcn.com, MIT — accent adapted\",\n theme: {\n name: \"shadcn/ui\",\n hue: {\n accent: \"#a1a1aa\",\n accentLight: \"#d4d4d8\",\n secondary: \"#71717a\",\n secondaryLight: \"#a1a1aa\",\n success: \"#4ade80\",\n danger: \"#e7000b\",\n dangerLight: \"#fb2c36\",\n warning: \"#fd9a00\",\n onAccent: \"#18181b\",\n onSecondary: \"#fafafa\",\n onDanger: \"#fafafa\"\n },\n lightHue: {\n accent: \"#3f3f46\",\n accentLight: \"#52525b\",\n secondary: \"#71717a\",\n secondaryLight: \"#a1a1aa\",\n success: \"#00a63e\",\n danger: \"#e7000b\",\n dangerLight: \"#fb2c36\",\n warning: \"#e17100\",\n onAccent: \"#fafafa\",\n onSecondary: \"#fafafa\",\n onDanger: \"#fafafa\"\n },\n dark: {\n bg: \"#18181b\",\n surface: \"#27272a\",\n surfaceRaised: \"#3f3f46\",\n surfaceHover: \"#3f3f46\",\n border: \"#3f3f46\",\n muted: \"#a1a1aa\",\n text: \"#fafafa\"\n },\n light: {\n bg: \"#f4f4f5\",\n surface: \"#ffffff\",\n surfaceRaised: \"#fafafa\",\n surfaceHover: \"#e4e4e7\",\n border: \"#e4e4e7\",\n muted: \"#71717a\",\n text: \"#18181b\"\n },\n radius: SHADCN\n }\n },\n {\n /* Ethan Schoonover's sixteen, exactly. base03 and base02 are the dark\n page and surface, base2 and base3 the light ones, and the accent hues\n are shared between the two halves — which is the whole point of\n Solarized. The steps between base03 and base02 are derived. */\n id: \"solarized\",\n name: \"Solarized\",\n note: \"Both halves on one set of accents, as designed.\",\n group: \"Ported\",\n source: \"ethanschoonover.com/solarized, MIT\",\n theme: {\n name: \"Solarized\",\n hue: {\n accent: \"#268bd2\",\n accentLight: \"#4ba3e3\",\n secondary: \"#2aa198\",\n secondaryLight: \"#43bbb1\",\n success: \"#859900\",\n danger: \"#dc322f\",\n dangerLight: \"#cb4b16\",\n warning: \"#b58900\",\n onAccent: \"#fdf6e3\",\n onSecondary: \"#002b36\",\n onDanger: \"#fdf6e3\"\n },\n lightHue: null,\n dark: {\n bg: \"#002b36\",\n surface: \"#073642\",\n surfaceRaised: \"#0b414f\",\n surfaceHover: \"#134b5a\",\n border: \"#0f4757\",\n muted: \"#93a1a1\",\n text: \"#eee8d5\"\n },\n light: {\n bg: \"#eee8d5\",\n surface: \"#fdf6e3\",\n surfaceRaised: \"#f7f0dc\",\n surfaceHover: \"#e4dcc4\",\n border: \"#d9d0b4\",\n muted: \"#586e75\",\n text: \"#073642\"\n },\n radius: SQUARE\n }\n }\n];\n\nexport const grytPresetsById = new Map(\n grytPresets.map((preset) => [preset.id, preset])\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 cursor-pointer items-center justify-center gap-2 border-0 shadow-none\",\n \"rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none\",\n // scale, not transform: Tailwind v4's scale-* utilities set the\n // standalone `scale` property, so transitioning `transform` alone\n // leaves the hover grow snapping instantly.\n \"transition-[scale,background-color,color]\",\n \"duration-(--gryt-dur-spring) ease-spring\",\n\n // Press travels further than hover, so the button reads as being\n // pushed down rather than just acknowledging the cursor.\n // A button that opens something does not grow under the cursor.\n // Base UI positions the popup against the trigger's measured box, and\n // it keeps measuring while the popup is open — so a trigger that\n // scales on hover drags its own menu a pixel or two sideways every\n // time the pointer crosses it. aria-haspopup is how the trigger says\n // that is what it is; Base UI puts it there, nothing to pass.\n \"motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]\",\n \"motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]\",\n\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n >\n {startIcon}\n {children}\n {endIcon}\n </BaseButton>\n );\n }\n);\n","// Shared class fragments. These exist so that \"flat, Gryt palette\" is decided\n// once rather than 24 times, and so a change to the focus ring or the popup\n// surface lands everywhere at once.\n\nexport const focusRing =\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\";\n\n// The same ring, for a control whose focusable element is a child rather than\n// itself. Base UI's Slider is the case: the thumb you can see is a div, and\n// the thing that takes focus is a visually hidden input inside it, so\n// focus-visible on the thumb never matches and the ring never appears.\nexport const focusRingWithin =\n \"has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light\";\n\n/**\n * What a text input looks like: TextField, and the typeahead inputs on\n * Combobox and Autocomplete.\n *\n * Shared because they had already drifted. The listbox inputs asked for\n * `rounded-(--gryt-radius-input)`, a token that does not exist — the library\n * ships sm, md, lg, xl and full — so the declaration was invalid and both\n * rendered with square corners in a library where every other control is\n * rounded. That is the kind of thing a shared constant makes impossible rather\n * than merely unlikely.\n *\n * The border *colour* is left to the caller: TextField swaps it for danger when\n * the field is invalid, and baking one in here would mean fighting it back off.\n */\nexport const fieldControl = [\n \"w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised\",\n \"text-gryt-text outline-none placeholder:text-gryt-muted\",\n \"transition-colors duration-150 motion-reduce:transition-none\",\n \"hover:border-gryt-accent-light focus:border-gryt-accent\",\n \"disabled:cursor-not-allowed disabled:opacity-60\"\n].join(\" \");\n\n/** Matching heights and padding for the two sizes a field comes in. */\nexport const fieldSizes = {\n small: \"min-h-9 px-3 py-1.5 text-sm\",\n medium: \"min-h-11 px-4 py-2.5 text-sm\"\n} as const;\n\nexport type FieldSize = keyof typeof fieldSizes;\n\n// Every floating surface: menu, select list, tooltip, dialog, drawer. Flat —\n// a border rather than a shadow.\nexport const popupSurface =\n \"rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text\";\n\n// Base UI sets data-starting-style and data-ending-style for one frame either\n// side of open and close. The element carries the transition itself.\nexport const popupMotion = [\n // scale and translate are named explicitly because Tailwind v4 sets them as\n // standalone CSS properties rather than folding them into `transform`, so\n // transitioning `transform` would leave the popup snapping into place.\n \"transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\"\n].join(\" \");\n\nexport const disabledState =\n \"cursor-pointer 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\n// Step 11, the text step, not the flat name. The flat name is step 9 — the\n// solid fill, the same colour in both appearances — which reads on a dark page\n// and disappears on a white one.\nexport const toneAccent: Record<Tone, string> = {\n primary: \"text-gryt-accent-11\",\n secondary: \"text-gryt-secondary-11\",\n neutral: \"text-gryt-muted\",\n danger: \"text-gryt-danger-11\",\n success: \"text-gryt-success-11\",\n warning: \"text-gryt-warning-11\"\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-11 hover:not-data-disabled:bg-gryt-accent-3\",\n secondary:\n \"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3\",\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-11 hover:not-data-disabled:bg-gryt-danger-3\",\n ghost:\n \"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text\"\n};\n\nconst sizeStyles: Record<IconButtonSize, string> = {\n xsmall: \"h-8 w-8\",\n small: \"h-9 w-9\",\n medium: \"h-10 w-10\",\n large: \"h-12 w-12\"\n};\n\nexport interface IconButtonProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseButton>, \"className\"> {\n tone?: IconButtonTone;\n size?: IconButtonSize;\n className?: string;\n}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton(\n { className, size = \"medium\", tone = \"neutral\", ...props },\n ref\n ) {\n return (\n <BaseButton\n ref={ref}\n className={cn(\n \"gryt-icon-button\",\n \"inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0\",\n \"rounded-(--gryt-radius-full) select-none\",\n // scale rather than transform — see the note in Button.\n \"transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring\",\n // A button that opens something does not grow under the cursor.\n // Base UI positions the popup against the trigger's measured box, and\n // it keeps measuring while the popup is open — so a trigger that\n // scales on hover drags its own menu a pixel or two sideways every\n // time the pointer crosses it. aria-haspopup is how the trigger says\n // that is what it is; Base UI puts it there, nothing to pass.\n \"motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]\",\n \"motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]\",\n focusRing,\n disabledState,\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface SurfaceProps extends HTMLAttributes<HTMLDivElement> {\n elevated?: boolean;\n}\n\nexport const Surface = forwardRef<HTMLDivElement, SurfaceProps>(\n function Surface({ className, elevated = false, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text\",\n elevated ? \"bg-gryt-surface-raised\" : \"bg-gryt-surface\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface MessageBubbleProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n from?: \"user\" | \"assistant\" | \"system\";\n}\n\nexport const MessageBubble = forwardRef<HTMLDivElement, MessageBubbleProps>(\n function MessageBubble(\n { children, className, from = \"assistant\", ...props },\n ref\n ) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-message-bubble\",\n from === \"user\" && \"ml-auto bg-gryt-accent text-gryt-on-accent\",\n from === \"assistant\" &&\n \"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text\",\n from === \"system\" &&\n \"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n","import { Field } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { fieldControl, fieldSizes } from \"../utils/styles\";\n\n// The two sizes live in utils/styles, shared with the Combobox and\n// Autocomplete inputs so all three keep the same shape.\nexport type TextFieldSize = \"small\" | \"medium\";\n\nexport interface TextFieldProps\n extends Omit<\n ComponentPropsWithoutRef<typeof Field.Control>,\n \"className\" | \"size\"\n > {\n label?: ReactNode;\n helperText?: ReactNode;\n error?: boolean;\n size?: TextFieldSize;\n multiline?: boolean;\n minRows?: number;\n className?: string;\n fieldClassName?: string;\n}\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n {\n className,\n error = false,\n fieldClassName,\n helperText,\n label,\n minRows = 3,\n multiline = false,\n size = \"medium\",\n ...props\n },\n ref\n ) {\n const control = (\n <Field.Control\n ref={ref}\n // Field.Control renders an input by default; render swaps the element\n // while keeping the field wiring, which is how label association and\n // aria-describedby survive the switch to a textarea.\n render={multiline ? <textarea rows={minRows} /> : undefined}\n className={cn(\n \"gryt-text-field-control\",\n fieldControl,\n multiline && \"resize-y leading-6\",\n error ? \"border-gryt-danger\" : \"border-gryt-border\",\n fieldSizes[size],\n className\n )}\n {...props}\n />\n );\n\n return (\n <Field.Root\n className={cn(\n \"gryt-text-field flex w-full flex-col gap-1.5\",\n fieldClassName\n )}\n >\n {label ? (\n <Field.Label className=\"text-xs font-medium text-gryt-muted\">\n {label}\n </Field.Label>\n ) : null}\n {control}\n {helperText ? (\n <Field.Description\n className={cn(\n \"text-xs\",\n error ? \"text-gryt-danger-11\" : \"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 enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50\",\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 // Step 9 by number rather than by its flat name: this is the\n // filled-button pair inverted — the accent as ink on the ink\n // colour it normally carries — and naming the step says so.\n ? \"bg-gryt-on-accent text-gryt-accent-9 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/85\" : \"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\n/**\n * Three steps of one scale, rather than three alphas of the fill.\n *\n * The flat name is step 9, the solid step, and it is the same colour in both\n * appearances on purpose. That makes it right for a filled button and wrong for\n * text: on a white panel a success chip came out bright green on pale green.\n * Step 3 is the component background, 6 the hairline and 11 the text, each\n * defined per appearance and each measured.\n */\nconst toneStyles: Record<ChipTone, string> = {\n neutral: \"border-gryt-border bg-gryt-surface-raised text-gryt-text\",\n primary: \"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11\",\n secondary:\n \"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11\",\n success: \"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11\",\n warning: \"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11\",\n danger: \"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11\"\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 cursor-pointer items-center justify-center rounded-(--gryt-radius-full)\",\n \"opacity-70 transition-opacity hover:opacity-100\",\n focusRing\n )}\n >\n <X size={10} weight=\"bold\" aria-hidden=\"true\" />\n </button>\n ) : null}\n </span>\n );\n});\n","import { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { Check } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing, toneCheckedFill } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface CheckboxProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseCheckbox.Root>,\n \"className\"\n > {\n tone?: Tone;\n className?: string;\n}\n\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox({ className, tone = \"primary\", ...props }, ref) {\n return (\n <BaseCheckbox.Root\n ref={ref}\n className={cn(\n \"gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center\",\n \"rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"data-checked:border-transparent\",\n // Same grow-and-press as the buttons, so a control reacts to the\n // cursor before it is clicked rather than only after.\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.08]\",\n \"motion-safe:active:not-data-disabled:scale-[0.92]\",\n focusRing,\n disabledState,\n // Unchecked stays a neutral outline; the tone only paints once checked.\n toneCheckedFill[tone],\n className\n )}\n {...props}\n >\n {/* keepMounted is load-bearing: without it Base UI unmounts the\n indicator whenever the box is unchecked, so data-unchecked never\n applies to anything and there is no element to transition from —\n the tick just appears. Kept in the DOM, it can scale and fade in\n both directions. */}\n <BaseCheckbox.Indicator\n keepMounted\n className={cn(\n \"flex origin-center\",\n \"transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring\",\n // Scaling from 0 rather than from something near 1 is deliberate.\n // The spring's overshoot is a percentage of the travel, so a tick\n // going 0 -> 1 overshoots to 1.12 and visibly springs, while one\n // going 0.95 -> 1 overshoots by 0.006 and does nothing at all.\n \"data-unchecked:scale-0 data-unchecked:opacity-0\",\n \"motion-reduce:transition-none\"\n )}\n >\n <Check size={12} weight=\"bold\" />\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n }\n);\n","import { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport {\n disabledState,\n focusRing,\n toneBg,\n toneCheckedBorder\n} from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface RadioProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseRadio.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n}\n\nexport const Radio = forwardRef<HTMLButtonElement, RadioProps>(function Radio(\n { className, tone = \"primary\", ...props },\n ref\n) {\n return (\n <BaseRadio.Root\n ref={ref}\n className={cn(\n \"gryt-radio flex h-5 w-5 shrink-0 items-center justify-center\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.08]\",\n \"motion-safe:active:not-data-disabled:scale-[0.92]\",\n focusRing,\n disabledState,\n // Border takes the tone when selected; the dot inside carries the fill.\n toneCheckedBorder[tone],\n className\n )}\n {...props}\n >\n {/* keepMounted so there is an element to transition — see Checkbox. */}\n <BaseRadio.Indicator\n keepMounted\n className={cn(\n \"h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)\",\n \"transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring\",\n // From 0, for the same reason as the Checkbox tick — see the note there.\n \"data-unchecked:scale-0 data-unchecked:opacity-0\",\n \"motion-reduce:transition-none\",\n toneBg[tone]\n )}\n />\n </BaseRadio.Root>\n );\n});\n\nexport type RadioGroupProps = ComponentPropsWithoutRef<typeof BaseRadioGroup>;\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup({ className, ...props }, ref) {\n return (\n <BaseRadioGroup\n ref={ref}\n className={cn(\"gryt-radio-group flex flex-col gap-2\", className)}\n {...props}\n />\n );\n }\n);\n","import { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing, toneCheckedBg } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface SwitchProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseSwitch.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(\n function Switch({ className, tone = \"primary\", ...props }, ref) {\n return (\n <BaseSwitch.Root\n ref={ref}\n className={cn(\n \"gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"data-checked:border-transparent\",\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.05]\",\n \"motion-safe:active:not-data-disabled:scale-[0.95]\",\n focusRing,\n disabledState,\n toneCheckedBg[tone],\n className\n )}\n {...props}\n >\n <BaseSwitch.Thumb\n className={cn(\n \"h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text\",\n \"transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-checked:translate-x-4 data-checked:bg-gryt-bg\"\n )}\n />\n </BaseSwitch.Root>\n );\n }\n);\n","import { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, PointerEvent as ReactPointerEvent } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRingWithin, toneBg } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface SliderProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseSlider.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n \"aria-label\"?: string;\n}\n\n/** How far the pointer has to move before a press counts as a drag. */\nconst DRAG_SLOP = 3;\n\n/**\n * The travel is animated, on the spring.\n *\n * Two things about that are worth reading before changing it.\n *\n * It uses --ease-spring-tight rather than --ease-spring. The overshoot in the\n * standard spring is a percentage of the travel, which is texture on a control\n * that scales in place and a problem on one whose travel is its own width: a\n * full-track jump measured 110% along a 919px track, putting the thumb 96px\n * outside the slider before it came back. The thumb still scales on the\n * standard spring, where the overshoot belongs.\n *\n * And it animates on a click or an arrow key but not under a dragging pointer,\n * where a transition means the thumb lags behind the cursor. Base UI's\n * data-dragging is not the right signal for that: it appears on pointerdown,\n * which is also how you click the track, so keying off it would kill the\n * animation for the most common interaction there is. What matters is whether\n * the pointer has actually moved, so that is what is tracked here — with a few\n * pixels of slop, because a mouse rarely stays perfectly still through a click.\n */\nexport function Slider({\n className,\n tone = \"primary\",\n \"aria-label\": ariaLabel,\n ...props\n}: SliderProps) {\n const [dragging, setDragging] = useState(false);\n const origin = useRef<{ x: number; y: number } | null>(null);\n\n useEffect(() => {\n if (!dragging && origin.current === null) {\n return;\n }\n\n // On window rather than the control: the pointer is very often released\n // outside a 6px-tall track, and a pointerup we never hear about leaves the\n // slider stuck in its dragging state with the animation off for good.\n const end = () => {\n origin.current = null;\n setDragging(false);\n };\n\n window.addEventListener(\"pointerup\", end);\n window.addEventListener(\"pointercancel\", end);\n\n return () => {\n window.removeEventListener(\"pointerup\", end);\n window.removeEventListener(\"pointercancel\", end);\n };\n }, [dragging]);\n\n function handlePointerDown(event: ReactPointerEvent<HTMLDivElement>) {\n origin.current = { x: event.clientX, y: event.clientY };\n }\n\n function handlePointerMove(event: ReactPointerEvent<HTMLDivElement>) {\n const start = origin.current;\n if (start === null || dragging) {\n return;\n }\n\n const moved =\n Math.abs(event.clientX - start.x) > DRAG_SLOP ||\n Math.abs(event.clientY - start.y) > DRAG_SLOP;\n\n if (moved) {\n setDragging(true);\n }\n }\n\n // Base UI positions the thumb with inset-inline-start and sizes the fill with\n // width, so those are the properties that move. `translate` stays out of it:\n // that holds the -50% centring offset, and animating it would drift the thumb\n // off the track rather than along it.\n const travel = dragging\n ? \"transition-none\"\n : \"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none\";\n\n return (\n <BaseSlider.Root className={cn(\"gryt-slider w-full\", className)} {...props}>\n <BaseSlider.Control\n className=\"flex w-full cursor-pointer touch-none items-center py-2 select-none\"\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n >\n <BaseSlider.Track className=\"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none\">\n <BaseSlider.Indicator\n className={cn(\n \"h-full rounded-(--gryt-radius-full) select-none\",\n \"transition-[width]\",\n travel,\n toneBg[tone]\n )}\n />\n {/* Two elements because they animate on two curves, and one element\n gets one timing function. The thumb travels on the tight spring;\n the dot inside it scales on the standard one, so the press still\n has the overshoot every other control here has. */}\n <BaseSlider.Thumb\n aria-label={ariaLabel}\n className={cn(\n \"group h-4 w-4 rounded-(--gryt-radius-full) select-none\",\n \"transition-[inset-inline-start]\",\n travel,\n // The ring goes on the thumb but the focus lands on the visually\n // hidden input inside it, so this has to match a descendant.\n // Without it the slider is the one control here you cannot see\n // yourself tab to.\n focusRingWithin\n )}\n >\n <span\n className={cn(\n \"block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text\",\n \"transition-[scale] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]\",\n \"motion-reduce:transition-none\"\n )}\n />\n </BaseSlider.Thumb>\n </BaseSlider.Track>\n </BaseSlider.Control>\n </BaseSlider.Root>\n );\n}\n","import { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { CaretUpDown, Check } from \"@phosphor-icons/react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\nexport interface SelectOption {\n label: ReactNode;\n value: string | number;\n disabled?: boolean;\n}\n\nexport type SelectSize = \"small\" | \"medium\";\n\nconst sizeStyles: Record<SelectSize, string> = {\n small: \"min-h-9 px-3 text-sm\",\n medium: \"min-h-11 px-4 text-sm\"\n};\n\nexport interface SelectProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseSelect.Root>,\n \"children\" | \"items\"\n > {\n options?: SelectOption[];\n label?: ReactNode;\n placeholder?: string;\n size?: SelectSize;\n className?: string;\n}\n\n/*\n * The popup portals to the document body, and there is deliberately no way to\n * change that.\n *\n * A `portalContainer` prop existed briefly so a Select inside a dialog could\n * render into it rather than beside it. It does not work, and it caused the\n * dropdowns in the client's server settings to open in the wrong place.\n *\n * Base UI positions the popup by computing coordinates against the viewport. A\n * dialog is `position: fixed` and centres itself with `translate: -50% -50%`,\n * and both of those make it a containing block for positioned descendants — so\n * the coordinates get resolved against the dialog and its own offset is counted\n * twice. Measured in a browser, with the dialog at (16, 226): the popup landed\n * 227px too low and 17px too far right, matching the dialog's origin.\n *\n * Neither escape works. `positionMethod=\"fixed\"` changes nothing. Removing the\n * translate fixes the vertical error and leaves the horizontal one, because the\n * dialog is still positioned.\n *\n * Portalling to the body is correct on both axes and already renders above the\n * dialog, so there was never a stacking problem to solve.\n *\n * If a popup ever genuinely needs to live inside a themed subtree — previewing\n * one theme inside another, which is the other half of GRYT-242 — that wants\n * its own mechanism rather than this prop back.\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 cursor-pointer 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\n sideOffset={6}\n className=\"gryt-select-positioner outline-none\"\n >\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-pointer 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-11\">\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\n side={side}\n sideOffset={sideOffset}\n className=\"gryt-tooltip-positioner\"\n >\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-6 bg-gryt-secondary-3 text-gryt-secondary-11\",\n success: \"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11\",\n warning: \"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11\",\n error: \"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11\"\n};\n\nexport interface AlertProps extends HTMLAttributes<HTMLDivElement> {\n severity?: AlertSeverity;\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { className, severity = \"info\", ...props },\n ref\n) {\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(\n \"gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm\",\n severityStyles[severity],\n className\n )}\n {...props}\n />\n );\n});\n","import { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport { CircleNotch } from \"@phosphor-icons/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface ProgressProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseProgress.Root>,\n \"className\" | \"value\"\n > {\n className?: string;\n // Optional, unlike Base UI's own prop: omitting it gives an indeterminate\n // bar, which is the common case when there is no measurable total.\n value?: number | null;\n}\n\nexport function Progress({ className, value = null, ...props }: ProgressProps) {\n return (\n <BaseProgress.Root\n // null is Base UI's indeterminate, so the default has to be null rather\n // than undefined — undefined is not assignable to its value prop.\n value={value}\n className={cn(\"gryt-progress w-full\", className)}\n {...props}\n >\n <BaseProgress.Track className=\"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised\">\n {/* ease-out, not the spring.\n A progress bar is a reading, and the spring overshoots 12% of the\n travel — so a jump to 100% ran past the end of the track and came\n back, which says the job finished, then unfinished, then finished.\n Bouncing is for controls the user just pushed. */}\n <BaseProgress.Indicator className=\"h-full rounded-(--gryt-radius-full) bg-gryt-accent transition-[width] duration-300 ease-out motion-reduce:transition-none\" />\n </BaseProgress.Track>\n </BaseProgress.Root>\n );\n}\n\nexport interface SpinnerProps {\n size?: number;\n className?: string;\n \"aria-label\"?: string;\n}\n\n// Base UI has no spinner — an indeterminate circular indicator is animation\n// rather than behaviour. Phosphor's CircleNotch is the shape, and the spin is\n// a Tailwind utility.\nexport function Spinner({\n className,\n size = 24,\n \"aria-label\": ariaLabel = \"Loading\"\n}: SpinnerProps) {\n return (\n <CircleNotch\n role=\"status\"\n aria-label={ariaLabel}\n size={size}\n weight=\"bold\"\n className={cn(\n \"gryt-spinner text-gryt-accent-11 motion-safe:animate-spin\",\n className\n )}\n />\n );\n}\n","import type { CSSProperties, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type SkeletonVariant = \"text\" | \"rounded\" | \"circular\" | \"rectangular\";\n\nconst variantStyles: Record<SkeletonVariant, string> = {\n text: \"h-4 rounded-(--gryt-radius-sm)\",\n rounded: \"rounded-(--gryt-radius-lg)\",\n circular: \"rounded-(--gryt-radius-full)\",\n rectangular: \"rounded-none\"\n};\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n variant?: SkeletonVariant;\n width?: number | string;\n height?: number | string;\n}\n\nexport function Skeleton({\n className,\n height,\n style,\n variant = \"text\",\n width,\n ...props\n}: SkeletonProps) {\n const sizing: CSSProperties = {\n width,\n height,\n ...style\n };\n\n return (\n <div\n aria-hidden=\"true\"\n className={cn(\n // Not bg-gryt-surface-raised. #1e2028 against #1a1d24 is four points of\n // luminance, which is invisible on a laptop screen at an angle — the\n // placeholder that is meant to say \"something is coming\" said nothing.\n // A white wash instead of a fixed colour, so it stays visible on any of\n // the surfaces it can land on rather than only the one it was picked\n // against, and it dims rather than brightens as it pulses.\n \"gryt-skeleton bg-white/9 motion-safe:animate-pulse\",\n variantStyles[variant],\n className\n )}\n style={sizing}\n {...props}\n />\n );\n}\n","import { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\n// Base UI drives enter and exit animation through data-starting-style and\n// data-ending-style, which it sets for one frame either side of the transition.\n// The element has to carry the transition itself; there is no JS timing.\nconst motion =\n \"transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\";\n\nexport type DialogBackdropProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Backdrop\n>;\n\nconst Backdrop = forwardRef<HTMLDivElement, DialogBackdropProps>(\n function DialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n motion,\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogPopupProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Popup\n>;\n\n// 32rem, not the 24rem this used to be. Radix Themes, which the client is\n// migrating off, gives Dialog.Content 600px, so a dialog ported across to this\n// one shrank by a third for no reason anybody chose — and the client had grown\n// a w-[27rem]..w-[30rem] override on every dialog to claw some of it back.\n// tailwind-merge means those overrides still win, so this only moves the ones\n// that never said anything. AlertDialog carries the same width deliberately.\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-[32rem] 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-pointer items-center gap-2 rounded-(--gryt-radius-md)\",\n \"px-3 py-2 text-sm text-gryt-text outline-none select-none\",\n // Base UI drives keyboard and pointer highlight through the same\n // attribute, so arrow keys and the mouse land on identical styling.\n \"data-highlighted:bg-gryt-surface-raised\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Separator = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseMenu.Separator>\n>(function MenuSeparator({ className, ...props }, ref) {\n return (\n <BaseMenu.Separator\n ref={ref}\n className={cn(\"gryt-menu-separator my-1 h-px bg-gryt-border\", className)}\n {...props}\n />\n );\n});\n\nexport const Menu = {\n Root: BaseMenu.Root,\n Trigger: BaseMenu.Trigger,\n Portal: BaseMenu.Portal,\n Positioner,\n Popup,\n Item,\n Separator\n};\n","import { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type TabsProps = ComponentPropsWithoutRef<typeof BaseTabs.Root>;\nexport type TabsListProps = ComponentPropsWithoutRef<typeof BaseTabs.List>;\nexport type TabProps = ComponentPropsWithoutRef<typeof BaseTabs.Tab>;\nexport type TabsPanelProps = ComponentPropsWithoutRef<typeof BaseTabs.Panel>;\n\n/**\n * Orientation is Base UI's `orientation` prop on Root, and every part below\n * styles itself from the `data-orientation` it puts on the DOM rather than from\n * a prop of ours. That is why none of these take an orientation of their own:\n * setting it in two places is how a list ends up vertical and its indicator\n * still travelling sideways.\n *\n * Vertical is the same visual language turned ninety degrees — the accent pill\n * still slides between rows. It suits a rail of five or six destinations. Past\n * about a dozen the filled pill becomes a block of accent parked in the corner\n * of the screen, and a quieter marker is the better call; the docs sidebar is\n * that case and deliberately does not use this.\n */\nconst Root = forwardRef<HTMLDivElement, TabsProps>(function TabsRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Root\n ref={ref}\n className={cn(\n \"gryt-tabs\",\n // Vertical puts the rail and the panel side by side. min-w-0 on the\n // panel does the rest; without the flex here the panel lands under the\n // rail and the layout reads as a very tall accordion.\n \"data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst List = forwardRef<HTMLDivElement, TabsListProps>(function TabsList(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.List\n ref={ref}\n className={cn(\n \"gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1\",\n // A rail, not a pill: rows are full width and the corner radius drops\n // to lg, because a 999px radius on a tall box bows its short edges.\n \"data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch\",\n \"data-[orientation=vertical]:rounded-(--gryt-radius-lg)\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Tab\n ref={ref}\n className={cn(\n \"gryt-tab inline-flex min-h-8 cursor-pointer items-center justify-center whitespace-nowrap\",\n \"rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5\",\n \"text-sm font-medium text-gryt-muted select-none\",\n \"relative z-10 transition-colors duration-150 hover:text-gryt-text\",\n // Base UI marks the selected tab with data-active, not data-selected.\n // The fill moved to Indicator so it can travel between tabs; the tab\n // itself only changes its text colour.\n \"data-active:text-gryt-on-accent\",\n // Left-aligned and taller in a rail. Centred labels in a vertical list\n // leave the text edge ragged, which is what makes a rail look untidy.\n \"data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start\",\n \"data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3\",\n \"data-[orientation=vertical]:rounded-(--gryt-radius-md)\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nexport type TabsIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseTabs.Indicator\n>;\n\n// Base UI measures the active tab and publishes --active-tab-left and\n// --active-tab-width, plus --active-tab-top and --active-tab-height, which is\n// what lets the pill slide rather than jump. renderBeforeHydration keeps it\n// positioned on the first paint instead of animating in from the left edge.\n//\n// The vertical rules hang off the ancestor's data-orientation rather than the\n// indicator's own. Root is the part guaranteed to carry it, and an indicator\n// that reads its orientation from somewhere other than the root it belongs to\n// is a bug waiting for someone to nest two sets of tabs.\nconst Indicator = forwardRef<HTMLSpanElement, TabsIndicatorProps>(\n function TabsIndicator({ className, ...props }, ref) {\n return (\n <BaseTabs.Indicator\n ref={ref}\n renderBeforeHydration\n className={cn(\n \"gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]\",\n \"w-(--active-tab-width) translate-x-(--active-tab-left)\",\n \"rounded-(--gryt-radius-full) bg-gryt-accent\",\n \"transition-[translate,width] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-reduce:transition-none\",\n // Same pill, travelling down the rail instead of across the row.\n \"[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1\",\n \"[[data-orientation=vertical]_&]:h-(--active-tab-height)\",\n \"[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]\",\n \"[[data-orientation=vertical]_&]:translate-x-0\",\n \"[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)\",\n \"[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)\",\n \"[[data-orientation=vertical]_&]:transition-[translate,height]\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, TabsPanelProps>(function TabsPanel(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Panel\n ref={ref}\n className={cn(\n \"gryt-tabs-panel pt-3 text-sm text-gryt-text\",\n // Beside the rail rather than under it, and allowed to shrink so long\n // content wraps instead of pushing the rail off screen.\n \"data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1\",\n \"data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Tabs = Object.assign(Root, { List, Tab, Panel, Indicator });\nexport { Tab };\n","import { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { CaretDown } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type AccordionProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Root\n>;\nexport type AccordionItemProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Item\n>;\nexport type AccordionPanelProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Panel\n>;\n\nconst Root = forwardRef<HTMLDivElement, AccordionProps>(function AccordionRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseAccordion.Root\n ref={ref}\n className={cn(\n \"gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<HTMLDivElement, AccordionItemProps>(\n function AccordionItem({ className, ...props }, ref) {\n return (\n <BaseAccordion.Item\n ref={ref}\n className={cn(\"gryt-accordion-item\", className)}\n {...props}\n />\n );\n }\n);\n\nexport interface AccordionTriggerProps\n extends ComponentPropsWithoutRef<typeof BaseAccordion.Trigger> {\n // Defaults to a caret that rotates when the panel opens. Pass one to\n // override it, or null for no indicator at all.\n expandIcon?: ReactNode;\n}\n\nconst Trigger = forwardRef<HTMLButtonElement, AccordionTriggerProps>(\n function AccordionTrigger({ children, className, expandIcon, ...props }, ref) {\n return (\n <BaseAccordion.Header className=\"gryt-accordion-header m-0\">\n <BaseAccordion.Trigger\n ref={ref}\n className={cn(\n \"gryt-accordion-trigger flex w-full cursor-pointer 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 \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n focusRing,\n className\n )}\n {...props}\n >\n {children}\n {expandIcon === undefined ? (\n <CaretDown\n size={16}\n // Base UI flags the open panel on the trigger, so the caret needs\n // no state of its own.\n className=\"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none\"\n />\n ) : (\n expandIcon\n )}\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel({ children, className, ...props }, ref) {\n return (\n <BaseAccordion.Panel\n ref={ref}\n className={cn(\n \"gryt-accordion-panel overflow-hidden text-sm text-gryt-muted\",\n // Base UI measures the panel and exposes the height as a variable,\n // which is what makes a real open and close transition possible.\n \"h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring\",\n \"data-starting-style:h-0 data-ending-style:h-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n >\n <div className=\"px-3 pt-1 pb-3\">{children}</div>\n </BaseAccordion.Panel>\n );\n }\n);\n\nexport const Accordion = Object.assign(Root, { Item, Trigger, Panel });\n","import { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { Menu } from \"../Menu/Menu\";\n\nexport type ContextMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.Positioner\n>;\n\n/**\n * A right-click menu: a message, a member, a channel.\n *\n * Base UI builds this out of Menu's own parts — its Popup, Item and Separator\n * are literally Menu's components — so this reuses the styled ones rather than\n * restyling them. A context menu that drifted from the dropdown menu would be\n * a bug nobody notices until both are on screen at once.\n */\nconst Positioner = forwardRef<HTMLDivElement, ContextMenuPositionerProps>(\n function ContextMenuPositioner({ className, sideOffset = 2, ...props }, ref) {\n return (\n <BaseContextMenu.Positioner\n ref={ref}\n // Smaller than Menu's 8. This anchors to the pointer rather than to a\n // trigger element, and 8px from the cursor reads as a menu that missed.\n sideOffset={sideOffset}\n className={cn(\"gryt-context-menu-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\nexport const ContextMenu = {\n Root: BaseContextMenu.Root,\n Trigger: BaseContextMenu.Trigger,\n Portal: BaseContextMenu.Portal,\n Positioner,\n Popup: Menu.Popup,\n Item: Menu.Item,\n Separator: Menu.Separator,\n Group: BaseContextMenu.Group,\n GroupLabel: BaseContextMenu.GroupLabel,\n SubmenuRoot: BaseContextMenu.SubmenuRoot,\n SubmenuTrigger: BaseContextMenu.SubmenuTrigger\n};\n","import { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\nexport type PopoverPopupProps = ComponentPropsWithoutRef<\n typeof BasePopover.Popup\n>;\nexport type PopoverPositionerProps = ComponentPropsWithoutRef<\n typeof BasePopover.Positioner\n>;\n\nconst Positioner = forwardRef<HTMLDivElement, PopoverPositionerProps>(\n function PopoverPositioner({ className, sideOffset = 8, ...props }, ref) {\n return (\n <BasePopover.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-popover-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\n// Wider default than Menu: this holds prose and controls — a member card, a\n// permissions summary — rather than a column of one-line items.\nconst Popup = forwardRef<HTMLDivElement, PopoverPopupProps>(\n function PopoverPopup({ className, ...props }, ref) {\n return (\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Title = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof BasePopover.Title>\n>(function PopoverTitle({ className, ...props }, ref) {\n return (\n <BasePopover.Title\n ref={ref}\n className={cn(\n \"gryt-popover-title text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof BasePopover.Description>\n>(function PopoverDescription({ className, ...props }, ref) {\n return (\n <BasePopover.Description\n ref={ref}\n className={cn(\n \"gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Popover = {\n Root: BasePopover.Root,\n Trigger: BasePopover.Trigger,\n Portal: BasePopover.Portal,\n Positioner,\n Popup,\n Title,\n Description,\n Close: BasePopover.Close,\n Arrow: BasePopover.Arrow\n};\n","import { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { X } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ToastSeverity =\n | \"neutral\"\n | \"info\"\n | \"success\"\n | \"warning\"\n | \"danger\";\n\n/**\n * Severity is a tinted edge and a wash, not a filled card.\n *\n * Alert tints its whole surface, and that is right for something sitting in\n * the page where it has to compete with the content around it. A toast is\n * already floating over everything with nothing to compete with, so the same\n * treatment reads as shouting. The border carries the colour and the fill stays\n * near the surface underneath.\n */\nconst severityStyles: Record<ToastSeverity, string> = {\n neutral: \"border-white/8 bg-gryt-surface\",\n info: \"border-gryt-secondary-6 bg-gryt-secondary-2\",\n success: \"border-gryt-success-6 bg-gryt-success-2\",\n warning: \"border-gryt-warning-6 bg-gryt-warning-2\",\n danger: \"border-gryt-danger-6 bg-gryt-danger-2\"\n};\n\nexport interface ToastRootProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToast.Root>, \"className\"> {\n severity?: ToastSeverity;\n className?: string;\n}\nexport type ToastViewportProps = ComponentPropsWithoutRef<\n typeof BaseToast.Viewport\n>;\n\n/**\n * Transient notice: connection lost, invite copied, message failed to send.\n *\n * design.md's stance is silent success — most things that worked should say\n * nothing. This is for the cases where the user is not looking at the thing\n * that changed, which in a voice client is most of them.\n */\nconst Viewport = forwardRef<HTMLDivElement, ToastViewportProps>(\n function ToastViewport({ className, ...props }, ref) {\n return (\n <BaseToast.Viewport\n ref={ref}\n className={cn(\n \"gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]\",\n \"flex-col gap-2 outline-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Root = forwardRef<HTMLDivElement, ToastRootProps>(function ToastRoot(\n { className, severity = \"neutral\", ...props },\n ref\n) {\n return (\n <BaseToast.Root\n ref={ref}\n className={cn(\n \"gryt-toast relative flex flex-col p-3 pr-9\",\n // Not popupSurface. That border is --gryt-border, a solid slate line\n // that is right for a menu anchored to the thing that opened it and too\n // heavy for a card floating in the corner with nothing behind it. A\n // white hairline separates it from the page without drawing a box\n // around it.\n \"rounded-(--gryt-radius-xl) border text-gryt-text\",\n severityStyles[severity],\n // Swiping is a pointer gesture, so the toast follows the finger\n // through Base UI's swipe variables before it animates out.\n \"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring\",\n \"data-starting-style:translate-y-2 data-starting-style:opacity-0\",\n \"data-ending-style:translate-y-2 data-ending-style:opacity-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Title = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToast.Title>\n>(function ToastTitle({ className, ...props }, ref) {\n return (\n <BaseToast.Title\n ref={ref}\n className={cn(\n \"gryt-toast-title text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToast.Description>\n>(function ToastDescription({ className, ...props }, ref) {\n return (\n <BaseToast.Description\n ref={ref}\n className={cn(\n \"gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Close = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseToast.Close>\n>(function ToastClose({ className, children, ...props }, ref) {\n return (\n <BaseToast.Close\n ref={ref}\n aria-label=\"Close\"\n className={cn(\n \"gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center\",\n \"rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted\",\n \"transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n >\n {children ?? <X size={14} weight=\"bold\" />}\n </BaseToast.Close>\n );\n});\n\nconst Action = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseToast.Action>\n>(function ToastAction({ className, ...props }, ref) {\n return (\n <BaseToast.Action\n ref={ref}\n className={cn(\n \"gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0\",\n \"bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent\",\n \"transition-[scale] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Toast = {\n Provider: BaseToast.Provider,\n Portal: BaseToast.Portal,\n Viewport,\n Root,\n Title,\n Description,\n Close,\n Action\n};\n\n/**\n * Raise a toast without importing Base UI directly.\n *\n * Taken off the namespace rather than re-exported from \"@base-ui/react/toast\":\n * at that path the hook is a type-only declaration, and re-exporting it as a\n * value fails under isolatedModules. The value lives on the parts namespace.\n */\nexport const useToastManager = BaseToast.useToastManager;\n","import { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ScrollAreaRootProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Root\n>;\nexport type ScrollAreaViewportProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Viewport\n>;\nexport type ScrollAreaScrollbarProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Scrollbar\n>;\n\nconst Root = forwardRef<HTMLDivElement, ScrollAreaRootProps>(\n function ScrollAreaRoot({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Root\n ref={ref}\n className={cn(\"gryt-scroll-area relative\", className)}\n {...props}\n />\n );\n }\n);\n\n// overscroll-contain so a message list that hits its end does not hand the\n// scroll to the page behind it.\nconst Viewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(\n function ScrollAreaViewport({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Viewport\n ref={ref}\n className={cn(\n \"gryt-scroll-area-viewport h-full w-full overscroll-contain\",\n \"focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Scrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(\n function ScrollAreaScrollbar({ className, orientation, ...props }, ref) {\n return (\n <BaseScrollArea.Scrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none\",\n // Fades in on hover or while scrolling rather than sitting there\n // permanently — a chat sidebar is mostly not being scrolled.\n \"opacity-0 transition-opacity duration-(--gryt-dur-fast)\",\n \"data-hovering:opacity-100 data-scrolling:opacity-100\",\n \"motion-reduce:transition-none\",\n orientation === \"horizontal\" ? \"h-2 flex-col\" : \"w-2\",\n className\n )}\n {...props}\n >\n <BaseScrollArea.Thumb className=\"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none\" />\n </BaseScrollArea.Scrollbar>\n );\n }\n);\n\nexport const ScrollArea = {\n Root,\n Viewport,\n Scrollbar,\n Content: BaseScrollArea.Content,\n Corner: BaseScrollArea.Corner\n};\n","import { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as BaseToggleGroup } from \"@base-ui/react/toggle-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing } from \"../utils/styles\";\n\ntype ToggleTone = \"primary\" | \"secondary\" | \"neutral\" | \"danger\";\ntype ToggleSize = \"xsmall\" | \"small\" | \"medium\" | \"large\";\n\n// Unpressed reads like IconButton's tinted target; pressed fills. A mute button\n// has to be legible as on or off from across the room, so the two states differ\n// in fill rather than only in colour.\nconst toneStyles: Record<ToggleTone, string> = {\n primary: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-accent\"\n ].join(\" \"),\n secondary: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-secondary\"\n ].join(\" \"),\n neutral: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text\"\n ].join(\" \"),\n // For destructive-while-active controls: mic muted, camera off.\n danger: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-danger\"\n ].join(\" \")\n};\n\nconst sizeStyles: Record<ToggleSize, string> = {\n xsmall: \"h-8 min-w-8 px-2 text-xs\",\n small: \"h-9 min-w-9 px-2.5 text-sm\",\n medium: \"h-10 min-w-10 px-3 text-sm\",\n large: \"h-12 min-w-12 px-4 text-base\"\n};\n\nexport interface ToggleProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToggle>, \"className\"> {\n tone?: ToggleTone;\n size?: ToggleSize;\n className?: string;\n}\n\nexport const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(\n function Toggle(\n { className, size = \"medium\", tone = \"primary\", ...props },\n ref\n ) {\n return (\n <BaseToggle\n ref={ref}\n className={cn(\n \"gryt-toggle\",\n \"inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent\",\n \"rounded-(--gryt-radius-full) font-medium select-none\",\n // scale rather than transform — see the note in Button.\n \"transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:not-data-disabled:scale-[1.06]\",\n \"motion-safe:active:not-data-disabled:scale-[0.94]\",\n focusRing,\n disabledState,\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport interface ToggleGroupProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToggleGroup>, \"className\"> {\n className?: string;\n}\n\n// A rail around a set of Toggles. Base UI handles roving focus, so arrow keys\n// move between items and only one tab stop enters the group.\nexport const ToggleGroup = forwardRef<HTMLDivElement, ToggleGroupProps>(\n function ToggleGroup({ className, ...props }, ref) {\n return (\n <BaseToggleGroup\n ref={ref}\n className={cn(\n \"gryt-toggle-group inline-flex items-center gap-1\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { Meter as BaseMeter } from \"@base-ui/react/meter\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type MeterTone = \"primary\" | \"success\" | \"warning\" | \"danger\";\n\nconst toneFill: Record<MeterTone, string> = {\n primary: \"bg-gryt-accent\",\n success: \"bg-gryt-success\",\n warning: \"bg-gryt-warning\",\n danger: \"bg-gryt-danger\"\n};\n\nexport interface MeterProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseMeter.Root>,\n \"className\" | \"value\"\n > {\n value: number;\n label?: ReactNode;\n /** Show the formatted value at the end of the label row. */\n showValue?: boolean;\n tone?: MeterTone;\n className?: string;\n}\n\n/**\n * A measurement inside a known range — mic input level, disk used, how full a\n * server is.\n *\n * Deliberately not Progress. Progress says \"this task is 40% done and heading\n * for 100%\"; a meter says \"this is the reading right now\", and a reading at\n * 100% is often the bad case rather than the finished one. They also announce\n * differently to a screen reader, which is the part that actually matters.\n *\n * The indicator moves rather than snapping, but only just — 120ms and ease-out,\n * no spring. This used to have no transition at all, on the grounds that the\n * common caller is a mic level updating every animation frame and easing a\n * value that changes 60 times a second only makes it lag behind the sound.\n * That reasoning holds for the mic and nothing else: disk used, server\n * capacity, a level polled a few times a second all read as broken when they\n * teleport. 120ms is shorter than the gap between polls at 4Hz, so a fast feed\n * still lands on every value it is handed.\n */\nexport function Meter({\n className,\n value,\n label,\n showValue = false,\n tone = \"primary\",\n ...props\n}: MeterProps) {\n return (\n <BaseMeter.Root\n value={value}\n className={cn(\"gryt-meter flex w-full flex-col gap-1.5\", className)}\n {...props}\n >\n {(label || showValue) && (\n <div className=\"flex items-baseline justify-between gap-2\">\n {label ? (\n <BaseMeter.Label className=\"text-sm text-gryt-muted\">\n {label}\n </BaseMeter.Label>\n ) : (\n <span />\n )}\n {showValue && (\n <BaseMeter.Value className=\"font-mono text-xs text-gryt-muted tabular-nums\" />\n )}\n </div>\n )}\n <BaseMeter.Track className=\"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised\">\n {/* Short and linear-ish, so the bar moves rather than snapping.\n The note above says no transition, and that was written for a mic\n level updating every frame — easing a value that changes 60 times a\n second only makes it lag. But most meters are not that: disk used,\n how full a server is, a level polled a few times a second, and those\n all read as broken when they teleport. 120ms is under the gap\n between polls at 4Hz, so a fast feed still lands on every value it\n is given; it just gets there over two frames instead of one. */}\n <BaseMeter.Indicator\n className={cn(\n \"h-full rounded-(--gryt-radius-full)\",\n \"transition-[width] duration-120 ease-out motion-reduce:transition-none\",\n toneFill[tone]\n )}\n />\n </BaseMeter.Track>\n </BaseMeter.Root>\n );\n}\n","import { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type AlertDialogPopupProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Popup\n>;\n\n/**\n * A dialog you cannot dismiss by accident — for \"Leave this server?\".\n *\n * Styled identically to Dialog on purpose; the difference is behaviour, not\n * looks. Escape and clicking the backdrop do nothing here, so answering\n * requires picking one of the buttons. Using this where Dialog belongs is worse\n * than not having it, because it takes away the escape people expect.\n */\nconst Popup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n ref={ref}\n className={cn(\n \"gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2\",\n \"flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4\",\n \"rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text\",\n \"outline-none\",\n \"transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Backdrop = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>\n>(function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n \"transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Title = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>\n>(function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-title text-lg font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Description>\n>(function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-description text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const AlertDialog = {\n Root: BaseAlertDialog.Root,\n Trigger: BaseAlertDialog.Trigger,\n Portal: BaseAlertDialog.Portal,\n Backdrop,\n Popup,\n Title,\n Description,\n Close: BaseAlertDialog.Close\n};\n","import { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport {\n fieldControl,\n fieldSizes,\n focusRing,\n popupMotion,\n popupSurface\n} from \"../utils/styles\";\n\n/**\n * Shared with Autocomplete, which is the same list wearing different\n * semantics. Exported so the two cannot drift, the way ContextMenu shares\n * Menu's item.\n */\nexport const listboxItemClass = [\n \"flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)\",\n \"px-3 py-2 text-sm text-gryt-text outline-none select-none\",\n // Base UI drives keyboard and pointer highlight through one attribute, so\n // arrow keys and the mouse land on identical styling.\n \"data-highlighted:bg-gryt-surface-raised\",\n \"data-selected:text-gryt-accent-11\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\"\n].join(\" \");\n\n/**\n * The typeahead input on both Combobox and Autocomplete.\n *\n * This is TextField's control, through the same shared constant, so the three\n * places you can type in this library are the same shape. It used to be its own\n * class list asking for `rounded-(--gryt-radius-input)` — a token that has never\n * existed — so it rendered with square corners next to a fully rounded\n * TextField.\n */\nexport const listboxInputClass = [\n fieldControl,\n fieldSizes.medium,\n \"border-gryt-border\",\n focusRing\n].join(\" \");\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.Popup\n>;\n\nconst Input = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Input>\n>(function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n ref={ref}\n className={cn(\"gryt-combobox-input\", listboxInputClass, className)}\n {...props}\n />\n );\n});\n\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>\n>(function ComboboxPositioner({ className, sideOffset = 6, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-combobox-positioner outline-none\", className)}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<HTMLDivElement, ComboboxPopupProps>(\n function ComboboxPopup({ className, ...props }, ref) {\n return (\n <BaseCombobox.Popup\n ref={ref}\n className={cn(\n \"gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Item = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Item>\n>(function ComboboxItem({ className, ...props }, ref) {\n return (\n <BaseCombobox.Item\n ref={ref}\n className={cn(\"gryt-combobox-item\", listboxItemClass, className)}\n {...props}\n />\n );\n});\n\nconst Empty = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Empty>\n>(function ComboboxEmpty({ className, ...props }, ref) {\n return (\n <BaseCombobox.Empty\n ref={ref}\n className={cn(\n \"gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\n/**\n * Pick from a list, narrowed by typing. Select with a filter, in effect.\n *\n * Supports multiple selection with chips, which is what a member picker or a\n * role assignment wants. Use Autocomplete instead when the value is free text\n * and the list is only a suggestion.\n */\nexport const Combobox = {\n Root: BaseCombobox.Root,\n Input,\n InputGroup: BaseCombobox.InputGroup,\n Trigger: BaseCombobox.Trigger,\n Icon: BaseCombobox.Icon,\n Clear: BaseCombobox.Clear,\n Value: BaseCombobox.Value,\n Chips: BaseCombobox.Chips,\n Chip: BaseCombobox.Chip,\n ChipRemove: BaseCombobox.ChipRemove,\n Portal: BaseCombobox.Portal,\n Positioner,\n Popup,\n List: BaseCombobox.List,\n Item,\n ItemIndicator: BaseCombobox.ItemIndicator,\n Group: BaseCombobox.Group,\n GroupLabel: BaseCombobox.GroupLabel,\n Empty,\n Separator: BaseCombobox.Separator\n};\n","import { Autocomplete as BaseAutocomplete } from \"@base-ui/react/autocomplete\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { listboxInputClass, listboxItemClass } from \"../Combobox/Combobox\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * A text input that suggests as you type.\n *\n * The difference from Combobox is what the value is allowed to be: here the\n * typed text is the answer and the list is a suggestion, so a search box or a\n * tag input belongs here. Combobox is for when the value must come from the\n * list. They share item and input styling deliberately — two lists that look\n * different for no reason is worse than one that looks the same.\n */\n\nconst Input = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Input>\n>(function AutocompleteInput({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Input\n ref={ref}\n className={cn(\"gryt-autocomplete-input\", listboxInputClass, className)}\n {...props}\n />\n );\n});\n\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Positioner>\n>(function AutocompletePositioner({ className, sideOffset = 6, ...props }, ref) {\n return (\n <BaseAutocomplete.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-autocomplete-positioner outline-none\", className)}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Popup>\n>(function AutocompletePopup({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Popup\n ref={ref}\n className={cn(\n \"gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Item>\n>(function AutocompleteItem({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Item\n ref={ref}\n className={cn(\"gryt-autocomplete-item\", listboxItemClass, className)}\n {...props}\n />\n );\n});\n\nconst Empty = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Empty>\n>(function AutocompleteEmpty({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Empty\n ref={ref}\n className={cn(\n \"gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Autocomplete = {\n Root: BaseAutocomplete.Root,\n Input,\n InputGroup: BaseAutocomplete.InputGroup,\n Trigger: BaseAutocomplete.Trigger,\n Icon: BaseAutocomplete.Icon,\n Clear: BaseAutocomplete.Clear,\n Value: BaseAutocomplete.Value,\n Portal: BaseAutocomplete.Portal,\n Positioner,\n Popup,\n List: BaseAutocomplete.List,\n Item,\n Group: BaseAutocomplete.Group,\n GroupLabel: BaseAutocomplete.GroupLabel,\n Empty,\n Separator: BaseAutocomplete.Separator\n};\n","import { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type CheckboxGroupProps = ComponentPropsWithoutRef<\n typeof BaseCheckboxGroup\n>;\n\n/**\n * A set of checkboxes sharing one value array.\n *\n * Worth having over a hand-rolled array of Checkboxes for the parent case: give\n * it `allValues` and a checkbox marked `parent` becomes a working\n * indeterminate tri-state, which is fiddly to get right by hand and is exactly\n * what a permissions list needs.\n */\nexport const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(\n function CheckboxGroup({ className, ...props }, ref) {\n return (\n <BaseCheckboxGroup\n ref={ref}\n className={cn(\"gryt-checkbox-group flex flex-col gap-2\", className)}\n {...props}\n />\n );\n }\n);\n","import { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type CollapsibleTriggerProps = ComponentPropsWithoutRef<\n typeof BaseCollapsible.Trigger\n>;\nexport type CollapsiblePanelProps = ComponentPropsWithoutRef<\n typeof BaseCollapsible.Panel\n>;\n\n/**\n * One region that opens and closes — a channel category, an advanced section.\n *\n * Accordion is a set of these that know about each other. Reach for this when\n * there is only one, so nothing has to pretend to be a one-item accordion.\n */\nconst Trigger = forwardRef<HTMLButtonElement, CollapsibleTriggerProps>(\n function CollapsibleTrigger({ className, ...props }, ref) {\n return (\n <BaseCollapsible.Trigger\n ref={ref}\n className={cn(\n \"gryt-collapsible-trigger flex w-full items-center justify-between gap-2\",\n \"rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left\",\n \"text-sm font-medium text-gryt-text select-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, CollapsiblePanelProps>(\n function CollapsiblePanel({ className, ...props }, ref) {\n return (\n <BaseCollapsible.Panel\n ref={ref}\n className={cn(\n \"gryt-collapsible-panel overflow-hidden\",\n // Base UI measures the panel and exposes the height as a variable, so\n // this animates to the content's real height rather than to a guess.\n \"h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring\",\n \"data-starting-style:h-0 data-ending-style:h-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport const Collapsible = {\n Root: BaseCollapsible.Root,\n Trigger,\n Panel\n};\n","import { Form as BaseForm } from \"@base-ui/react/form\";\nimport { Fieldset as BaseFieldset } from \"@base-ui/react/fieldset\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type FormProps = ComponentPropsWithoutRef<typeof BaseForm>;\n\n/**\n * Wires server-side errors back to the fields that caused them.\n *\n * Pass `errors` keyed by field name and Base UI routes each message to the\n * matching Field, so a rejected form points at the input rather than printing a\n * paragraph at the top that the user has to map back themselves.\n */\nexport const Form = forwardRef<HTMLFormElement, FormProps>(function Form(\n { className, ...props },\n ref\n) {\n return (\n <BaseForm\n ref={ref}\n className={cn(\"gryt-form flex flex-col gap-(--gryt-space-lg)\", className)}\n {...props}\n />\n );\n});\n\nexport type FieldsetProps = ComponentPropsWithoutRef<typeof BaseFieldset.Root>;\n\nconst FieldsetRoot = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset({ className, ...props }, ref) {\n return (\n <BaseFieldset.Root\n ref={ref}\n className={cn(\n \"gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Legend = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseFieldset.Legend>\n>(function FieldsetLegend({ className, ...props }, ref) {\n return (\n <BaseFieldset.Legend\n ref={ref}\n className={cn(\n \"gryt-fieldset-legend text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Fieldset = { Root: FieldsetRoot, Legend };\n","import { Menubar as BaseMenubar } from \"@base-ui/react/menubar\";\nimport { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * A bar of menus that behave as one — File, Edit, View.\n *\n * Once any menu is open, moving along the bar opens the next without a second\n * click, which is the behaviour that separates a menubar from several\n * independent Menus sitting next to each other.\n */\nexport type MenubarProps = ComponentPropsWithoutRef<typeof BaseMenubar>;\n\nexport const Menubar = forwardRef<HTMLDivElement, MenubarProps>(\n function Menubar({ className, ...props }, ref) {\n return (\n <BaseMenubar\n ref={ref}\n className={cn(\n \"gryt-menubar flex items-center gap-1\",\n \"rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\n/**\n * Site-level navigation whose items open panels.\n *\n * Distinct from Menubar: the items are links first and the panels can hold\n * layout — a column of sections, a promo — rather than a list of commands. The\n * viewport animates between panels so moving along the bar resizes rather than\n * closing and reopening.\n */\nconst Trigger = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Trigger>\n>(function NavigationMenuTrigger({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Trigger\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)\",\n \"border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n \"data-popup-open:bg-gryt-surface-raised\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Popup>\n>(function NavigationMenuPopup({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Popup\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-popup outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\n// Wrapped rather than re-exported raw, so it carries a class the app can hang a\n// z-index on. Every other popup in here already has one; this was the last\n// positioner without, and a consumer cannot style what it cannot select.\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Positioner>\n>(function NavigationMenuPositioner({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Positioner\n ref={ref}\n className={cn(\"gryt-navigation-menu-positioner outline-none\", className)}\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,\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":["srgbToLinear","c","linearToSrgb","clamp01","value","hexToRgb","hex","h","full","rgbToHex","r","g","b","part","hexToOklch","r0","g0","b0","l","m","s","L","a","oklchToHex","l3","m3","s3","HUE_L","HUE_C","hueScale","solid","solidHover","steps","i","l10","l11","l12","NEUTRAL_L","NEUTRAL_C","neutralScale","anchors","fixed","hue","alphaScale","scale","background","bg","target","alpha","t","overlay","LIGHT_NEUTRAL_L","LIGHT_NEUTRAL_C","LIGHT_HUE_L","LIGHT_HUE_C","neutralScaleLight","hueScaleLight","sl","luminance","contrast","la","lb","grytTokens","grytLightTokens","grytScales","grytScalesLight","grytLightSurfaceHover","grytAlphaScales","grytAlphaScalesLight","createGrytTheme","options","light","color","radius","scales","scaleVars","name","index","isCssVariables","key","GrytProvider","children","className","theme","tooltipDelay","style","jsx","Tooltip","GRYT_HUE_KEYS","GRYT_NEUTRAL_KEYS","GRYT_RADIUS_KEYS","GRYT_THEME_NAME_MAX","normalizeThemeName","grytTheme","cloneGrytTheme","grytThemeHues","appearance","grytThemeToOptions","HUE_PARAM","NEUTRAL_PARAM","HEX","isHexColor","normalizeHexColor","encodeGrytTheme","params","bare","half","prefix","decodeGrytTheme","input","text","decodeJson","query","decodeParams","present","read","raw","parsed","source","colors","named","ROUND","SOFT","CRISP","SHADCN","SQUARE","grytPresets","grytPresetsById","preset","cn","inputs","twMerge","clsx","toneStyles","sizeStyles","Button","forwardRef","endIcon","size","startIcon","tone","props","ref","jsxs","BaseButton","focusRing","focusRingWithin","fieldControl","fieldSizes","popupSurface","popupMotion","disabledState","toneCheckedFill","toneBg","toneCheckedBorder","toneCheckedBg","IconButton","Surface","elevated","MessageBubble","from","TextField","error","fieldClassName","helperText","label","minRows","multiline","control","Field","Composer","disabled","maxRows","onSubmit","placeholder","submitLabel","innerRef","useRef","resize","useCallback","node","styles","lineHeight","vertical","useLayoutEffect","handleSubmit","event","PaperPlaneTilt","Avatar","alt","fallback","src","BaseAvatar","ConversationItem","active","avatar","subtitle","title","Badge","badgeContent","max","showZero","numeric","hidden","display","Chip","icon","onDelete","X","Checkbox","BaseCheckbox","Check","Radio","BaseRadio","RadioGroup","BaseRadioGroup","Switch","BaseSwitch","DRAG_SLOP","Slider","ariaLabel","dragging","setDragging","useState","origin","useEffect","end","handlePointerDown","handlePointerMove","start","travel","BaseSlider","Select","BaseSelect","CaretUpDown","option","side","sideOffset","BaseTooltip","TooltipProvider","Divider","orientation","Separator","Card","CardHeader","subheader","CardContent","CardActions","severityStyles","Alert","severity","Progress","BaseProgress","Spinner","CircleNotch","variantStyles","Skeleton","height","variant","width","sizing","motion","Backdrop","BaseDialog","Popup","Title","Description","Footer","Dialog","noop","useMediaQuery","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","BasePreviewCard","PreviewCard","BaseToolbar","Toolbar"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,SAASA,GAAaC,GAAmB;AACvC,SAAOA,KAAK,UAAUA,IAAI,UAAUA,IAAI,SAAS,UAAU;AAC7D;AAEA,SAASC,GAAaD,GAAmB;AACvC,SAAOA,KAAK,WAAY,QAAQA,IAAI,QAAQA,MAAM,IAAI,OAAO;AAC/D;AAEA,SAASE,EAAQC,GAAuB;AACtC,SAAO,KAAK,IAAI,GAAG,KAAK,IAAI,GAAGA,CAAK,CAAC;AACvC;AAEO,SAASC,EAASC,GAAuC;AAC9D,QAAMC,IAAID,EAAI,QAAQ,KAAK,EAAE,GACvBE,IACJD,EAAE,WAAW,IACTA,EACG,MAAM,EAAE,EACR,IAAI,CAACN,MAAMA,IAAIA,CAAC,EAChB,KAAK,EAAE,IACVM;AACN,SAAO;AAAA,IACL,SAASC,EAAK,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI;AAAA,IACjC,SAASA,EAAK,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI;AAAA,IACjC,SAASA,EAAK,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI;AAAA,EAAA;AAErC;AAEO,SAASC,GAAS,CAACC,GAAGC,GAAGC,CAAC,GAAqC;AACpE,QAAMC,IAAO,CAACZ,MACZ,KAAK,MAAME,EAAQF,CAAC,IAAI,GAAG,EACxB,SAAS,EAAE,EACX,SAAS,GAAG,GAAG;AACpB,SAAO,IAAIY,EAAKH,CAAC,CAAC,GAAGG,EAAKF,CAAC,CAAC,GAAGE,EAAKD,CAAC,CAAC;AACxC;AAEO,SAASE,EAAWR,GAAoB;AAC7C,Q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AA,QACT;AAAA,QACA;AAAA,QACA/C;AAAA,MAAA;AAAA,MAED,GAAG2D;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC,GAEKqG,KAAY1G,EAGhB,SAA0B,EAAE,WAAAtD,GAAW,GAAG2D,EAAA,GAASC,GAAK;AACxD,SACE,gBAAAxD;AAAA,IAACqR,EAAY;AAAA,IAAZ;AAAA,MACC,KAAA7N;AAAA,MACA,WAAWb,EAAG,uDAAuD/C,CAAS;AAAA,MAC7E,GAAG2D;AAAA,IAAA;AAAA,EAAA;AAGV,CAAC,GAEY+N,KAAU;AAAA,EACrB,MAAAlF;AAAA,EACA,OAAOiF,EAAY;AAAA,EACnB,QAAQA,EAAY;AAAA,EACpB,MAAMA,EAAY;AAAA,EAClB,OAAOA,EAAY;AAAA,EACnB,WAAAzH;AACF;"}
1
+ {"version":3,"file":"index.js","sources":["../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 { Tooltip } from \"@base-ui/react/tooltip\";\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { createGrytTheme } from \"@gryt/theme\";\nimport type { GrytThemeOptions } from \"@gryt/theme\";\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 /**\n * No theme, no variables.\n *\n * This used to paint the full default palette onto the wrapper whenever the\n * prop was absent, which looked harmless and was not: the stylesheet already\n * declares those values on :root, so the copy added nothing, and it sat below\n * the root in the cascade — an app that themed itself the documented way, by\n * putting variables on the root element where overlays can reach them, found\n * every one of them overridden by a provider re-stating the defaults.\n *\n * It cost this site an afternoon. The header can put the docs in Nord now,\n * and the reason it could not before was one div.\n */\n const style =\n theme === undefined\n ? undefined\n : isCssVariables(theme)\n ? theme\n : 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 cursor-pointer items-center justify-center gap-2 border-0 shadow-none\",\n \"rounded-(--gryt-radius-full) font-semibold whitespace-nowrap select-none\",\n // scale, not transform: Tailwind v4's scale-* utilities set the\n // standalone `scale` property, so transitioning `transform` alone\n // leaves the hover grow snapping instantly.\n \"transition-[scale,background-color,color]\",\n \"duration-(--gryt-dur-spring) ease-spring\",\n\n // Press travels further than hover, so the button reads as being\n // pushed down rather than just acknowledging the cursor.\n // A button that opens something does not grow under the cursor.\n // Base UI positions the popup against the trigger's measured box, and\n // it keeps measuring while the popup is open — so a trigger that\n // scales on hover drags its own menu a pixel or two sideways every\n // time the pointer crosses it. aria-haspopup is how the trigger says\n // that is what it is; Base UI puts it there, nothing to pass.\n \"motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.03]\",\n \"motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.96]\",\n\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n >\n {startIcon}\n {children}\n {endIcon}\n </BaseButton>\n );\n }\n);\n","// Shared class fragments. These exist so that \"flat, Gryt palette\" is decided\n// once rather than 24 times, and so a change to the focus ring or the popup\n// surface lands everywhere at once.\n\nexport const focusRing =\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\";\n\n// The same ring, for a control whose focusable element is a child rather than\n// itself. Base UI's Slider is the case: the thumb you can see is a div, and\n// the thing that takes focus is a visually hidden input inside it, so\n// focus-visible on the thumb never matches and the ring never appears.\nexport const focusRingWithin =\n \"has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-gryt-accent-light\";\n\n/**\n * What a text input looks like: TextField, and the typeahead inputs on\n * Combobox and Autocomplete.\n *\n * Shared because they had already drifted. The listbox inputs asked for\n * `rounded-(--gryt-radius-input)`, a token that does not exist — the library\n * ships sm, md, lg, xl and full — so the declaration was invalid and both\n * rendered with square corners in a library where every other control is\n * rounded. That is the kind of thing a shared constant makes impossible rather\n * than merely unlikely.\n *\n * The border *colour* is left to the caller: TextField swaps it for danger when\n * the field is invalid, and baking one in here would mean fighting it back off.\n */\nexport const fieldControl = [\n \"w-full rounded-(--gryt-radius-xl) border bg-gryt-surface-raised\",\n \"text-gryt-text outline-none placeholder:text-gryt-muted\",\n \"transition-colors duration-150 motion-reduce:transition-none\",\n \"hover:border-gryt-accent-light focus:border-gryt-accent\",\n \"disabled:cursor-not-allowed disabled:opacity-60\"\n].join(\" \");\n\n/** Matching heights and padding for the two sizes a field comes in. */\nexport const fieldSizes = {\n small: \"min-h-9 px-3 py-1.5 text-sm\",\n medium: \"min-h-11 px-4 py-2.5 text-sm\"\n} as const;\n\nexport type FieldSize = keyof typeof fieldSizes;\n\n// Every floating surface: menu, select list, tooltip, dialog, drawer. Flat —\n// a border rather than a shadow.\nexport const popupSurface =\n \"rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface text-gryt-text\";\n\n// Base UI sets data-starting-style and data-ending-style for one frame either\n// side of open and close. The element carries the transition itself.\nexport const popupMotion = [\n // scale and translate are named explicitly because Tailwind v4 sets them as\n // standalone CSS properties rather than folding them into `transform`, so\n // transitioning `transform` would leave the popup snapping into place.\n \"transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\"\n].join(\" \");\n\nexport const disabledState =\n \"cursor-pointer 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\n// Step 11, the text step, not the flat name. The flat name is step 9 — the\n// solid fill, the same colour in both appearances — which reads on a dark page\n// and disappears on a white one.\nexport const toneAccent: Record<Tone, string> = {\n primary: \"text-gryt-accent-11\",\n secondary: \"text-gryt-secondary-11\",\n neutral: \"text-gryt-muted\",\n danger: \"text-gryt-danger-11\",\n success: \"text-gryt-success-11\",\n warning: \"text-gryt-warning-11\"\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-11 hover:not-data-disabled:bg-gryt-accent-3\",\n secondary:\n \"text-gryt-secondary-11 hover:not-data-disabled:bg-gryt-secondary-3\",\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-11 hover:not-data-disabled:bg-gryt-danger-3\",\n ghost:\n \"text-gryt-muted hover:not-data-disabled:bg-white/8 hover:not-data-disabled:text-gryt-text\"\n};\n\nconst sizeStyles: Record<IconButtonSize, string> = {\n xsmall: \"h-8 w-8\",\n small: \"h-9 w-9\",\n medium: \"h-10 w-10\",\n large: \"h-12 w-12\"\n};\n\nexport interface IconButtonProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseButton>, \"className\"> {\n tone?: IconButtonTone;\n size?: IconButtonSize;\n className?: string;\n}\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton(\n { className, size = \"medium\", tone = \"neutral\", ...props },\n ref\n ) {\n return (\n <BaseButton\n ref={ref}\n className={cn(\n \"gryt-icon-button\",\n \"inline-flex shrink-0 items-center justify-center border-0 bg-transparent p-0\",\n \"rounded-(--gryt-radius-full) select-none\",\n // scale rather than transform — see the note in Button.\n \"transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring\",\n // A button that opens something does not grow under the cursor.\n // Base UI positions the popup against the trigger's measured box, and\n // it keeps measuring while the popup is open — so a trigger that\n // scales on hover drags its own menu a pixel or two sideways every\n // time the pointer crosses it. aria-haspopup is how the trigger says\n // that is what it is; Base UI puts it there, nothing to pass.\n \"motion-safe:not-[[aria-haspopup]]:hover:not-data-disabled:scale-[1.06]\",\n \"motion-safe:not-[[aria-haspopup]]:active:not-data-disabled:scale-[0.94]\",\n focusRing,\n disabledState,\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface SurfaceProps extends HTMLAttributes<HTMLDivElement> {\n elevated?: boolean;\n}\n\nexport const Surface = forwardRef<HTMLDivElement, SurfaceProps>(\n function Surface({ className, elevated = false, ...props }, ref) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-surface rounded-(--gryt-radius-lg) border border-gryt-border p-4 text-gryt-text\",\n elevated ? \"bg-gryt-surface-raised\" : \"bg-gryt-surface\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface MessageBubbleProps extends HTMLAttributes<HTMLDivElement> {\n children: ReactNode;\n from?: \"user\" | \"assistant\" | \"system\";\n}\n\nexport const MessageBubble = forwardRef<HTMLDivElement, MessageBubbleProps>(\n function MessageBubble(\n { children, className, from = \"assistant\", ...props },\n ref\n ) {\n return (\n <div\n ref={ref}\n className={cn(\n \"gryt-message-bubble\",\n from === \"user\" && \"ml-auto bg-gryt-accent text-gryt-on-accent\",\n from === \"assistant\" &&\n \"mr-auto border border-gryt-border bg-gryt-surface text-gryt-text\",\n from === \"system\" &&\n \"mx-auto border border-dashed border-gryt-border bg-transparent text-gryt-muted\",\n className\n )}\n {...props}\n >\n {children}\n </div>\n );\n }\n);\n","import { Field } from \"@base-ui/react/field\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { fieldControl, fieldSizes } from \"../utils/styles\";\n\n// The two sizes live in utils/styles, shared with the Combobox and\n// Autocomplete inputs so all three keep the same shape.\nexport type TextFieldSize = \"small\" | \"medium\";\n\nexport interface TextFieldProps\n extends Omit<\n ComponentPropsWithoutRef<typeof Field.Control>,\n \"className\" | \"size\"\n > {\n label?: ReactNode;\n helperText?: ReactNode;\n error?: boolean;\n size?: TextFieldSize;\n multiline?: boolean;\n minRows?: number;\n className?: string;\n fieldClassName?: string;\n}\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n {\n className,\n error = false,\n fieldClassName,\n helperText,\n label,\n minRows = 3,\n multiline = false,\n size = \"medium\",\n ...props\n },\n ref\n ) {\n const control = (\n <Field.Control\n ref={ref}\n // Field.Control renders an input by default; render swaps the element\n // while keeping the field wiring, which is how label association and\n // aria-describedby survive the switch to a textarea.\n render={multiline ? <textarea rows={minRows} /> : undefined}\n className={cn(\n \"gryt-text-field-control\",\n fieldControl,\n multiline && \"resize-y leading-6\",\n error ? \"border-gryt-danger\" : \"border-gryt-border\",\n fieldSizes[size],\n className\n )}\n {...props}\n />\n );\n\n return (\n <Field.Root\n className={cn(\n \"gryt-text-field flex w-full flex-col gap-1.5\",\n fieldClassName\n )}\n >\n {label ? (\n <Field.Label className=\"text-xs font-medium text-gryt-muted\">\n {label}\n </Field.Label>\n ) : null}\n {control}\n {helperText ? (\n <Field.Description\n className={cn(\n \"text-xs\",\n error ? \"text-gryt-danger-11\" : \"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 enabled:cursor-pointer disabled:cursor-not-allowed disabled:opacity-50\",\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 // Step 9 by number rather than by its flat name: this is the\n // filled-button pair inverted — the accent as ink on the ink\n // colour it normally carries — and naming the step says so.\n ? \"bg-gryt-on-accent text-gryt-accent-9 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/85\" : \"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\n/**\n * Three steps of one scale, rather than three alphas of the fill.\n *\n * The flat name is step 9, the solid step, and it is the same colour in both\n * appearances on purpose. That makes it right for a filled button and wrong for\n * text: on a white panel a success chip came out bright green on pale green.\n * Step 3 is the component background, 6 the hairline and 11 the text, each\n * defined per appearance and each measured.\n */\nconst toneStyles: Record<ChipTone, string> = {\n neutral: \"border-gryt-border bg-gryt-surface-raised text-gryt-text\",\n primary: \"border-gryt-accent-6 bg-gryt-accent-3 text-gryt-accent-11\",\n secondary:\n \"border-gryt-secondary-6 bg-gryt-secondary-3 text-gryt-secondary-11\",\n success: \"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11\",\n warning: \"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11\",\n danger: \"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11\"\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 cursor-pointer items-center justify-center rounded-(--gryt-radius-full)\",\n \"opacity-70 transition-opacity hover:opacity-100\",\n focusRing\n )}\n >\n <X size={10} weight=\"bold\" aria-hidden=\"true\" />\n </button>\n ) : null}\n </span>\n );\n});\n","import { Checkbox as BaseCheckbox } from \"@base-ui/react/checkbox\";\nimport { Check } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing, toneCheckedFill } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface CheckboxProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseCheckbox.Root>,\n \"className\"\n > {\n tone?: Tone;\n className?: string;\n}\n\nexport const Checkbox = forwardRef<HTMLButtonElement, CheckboxProps>(\n function Checkbox({ className, tone = \"primary\", ...props }, ref) {\n return (\n <BaseCheckbox.Root\n ref={ref}\n className={cn(\n \"gryt-checkbox flex h-5 w-5 shrink-0 items-center justify-center\",\n \"rounded-(--gryt-radius-sm) border border-gryt-border bg-gryt-surface-raised\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"data-checked:border-transparent\",\n // Same grow-and-press as the buttons, so a control reacts to the\n // cursor before it is clicked rather than only after.\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.08]\",\n \"motion-safe:active:not-data-disabled:scale-[0.92]\",\n focusRing,\n disabledState,\n // Unchecked stays a neutral outline; the tone only paints once checked.\n toneCheckedFill[tone],\n className\n )}\n {...props}\n >\n {/* keepMounted is load-bearing: without it Base UI unmounts the\n indicator whenever the box is unchecked, so data-unchecked never\n applies to anything and there is no element to transition from —\n the tick just appears. Kept in the DOM, it can scale and fade in\n both directions. */}\n <BaseCheckbox.Indicator\n keepMounted\n className={cn(\n \"flex origin-center\",\n \"transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring\",\n // Scaling from 0 rather than from something near 1 is deliberate.\n // The spring's overshoot is a percentage of the travel, so a tick\n // going 0 -> 1 overshoots to 1.12 and visibly springs, while one\n // going 0.95 -> 1 overshoots by 0.006 and does nothing at all.\n \"data-unchecked:scale-0 data-unchecked:opacity-0\",\n \"motion-reduce:transition-none\"\n )}\n >\n <Check size={12} weight=\"bold\" />\n </BaseCheckbox.Indicator>\n </BaseCheckbox.Root>\n );\n }\n);\n","import { Radio as BaseRadio } from \"@base-ui/react/radio\";\nimport { RadioGroup as BaseRadioGroup } from \"@base-ui/react/radio-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport {\n disabledState,\n focusRing,\n toneBg,\n toneCheckedBorder\n} from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface RadioProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseRadio.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n}\n\nexport const Radio = forwardRef<HTMLButtonElement, RadioProps>(function Radio(\n { className, tone = \"primary\", ...props },\n ref\n) {\n return (\n <BaseRadio.Root\n ref={ref}\n className={cn(\n \"gryt-radio flex h-5 w-5 shrink-0 items-center justify-center\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.08]\",\n \"motion-safe:active:not-data-disabled:scale-[0.92]\",\n focusRing,\n disabledState,\n // Border takes the tone when selected; the dot inside carries the fill.\n toneCheckedBorder[tone],\n className\n )}\n {...props}\n >\n {/* keepMounted so there is an element to transition — see Checkbox. */}\n <BaseRadio.Indicator\n keepMounted\n className={cn(\n \"h-2.5 w-2.5 origin-center rounded-(--gryt-radius-full)\",\n \"transition-[scale,opacity] duration-(--gryt-dur-spring) ease-spring\",\n // From 0, for the same reason as the Checkbox tick — see the note there.\n \"data-unchecked:scale-0 data-unchecked:opacity-0\",\n \"motion-reduce:transition-none\",\n toneBg[tone]\n )}\n />\n </BaseRadio.Root>\n );\n});\n\nexport type RadioGroupProps = ComponentPropsWithoutRef<typeof BaseRadioGroup>;\n\nexport const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(\n function RadioGroup({ className, ...props }, ref) {\n return (\n <BaseRadioGroup\n ref={ref}\n className={cn(\"gryt-radio-group flex flex-col gap-2\", className)}\n {...props}\n />\n );\n }\n);\n","import { Switch as BaseSwitch } from \"@base-ui/react/switch\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing, toneCheckedBg } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface SwitchProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseSwitch.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n}\n\nexport const Switch = forwardRef<HTMLButtonElement, SwitchProps>(\n function Switch({ className, tone = \"primary\", ...props }, ref) {\n return (\n <BaseSwitch.Root\n ref={ref}\n className={cn(\n \"gryt-switch relative inline-flex h-6 w-10 shrink-0 items-center\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface-raised p-0.5\",\n \"transition-[scale,background-color,border-color] duration-(--gryt-dur-spring) ease-spring\",\n \"data-checked:border-transparent\",\n \"hover:not-data-disabled:border-gryt-accent-light\",\n \"motion-safe:hover:not-data-disabled:scale-[1.05]\",\n \"motion-safe:active:not-data-disabled:scale-[0.95]\",\n focusRing,\n disabledState,\n toneCheckedBg[tone],\n className\n )}\n {...props}\n >\n <BaseSwitch.Thumb\n className={cn(\n \"h-4.5 w-4.5 rounded-(--gryt-radius-full) bg-gryt-text\",\n \"transition-transform duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-checked:translate-x-4 data-checked:bg-gryt-bg\"\n )}\n />\n </BaseSwitch.Root>\n );\n }\n);\n","import { Slider as BaseSlider } from \"@base-ui/react/slider\";\nimport { useEffect, useRef, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, PointerEvent as ReactPointerEvent } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRingWithin, toneBg } from \"../utils/styles\";\nimport type { Tone } from \"../utils/styles\";\n\nexport interface SliderProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseSlider.Root>, \"className\"> {\n tone?: Tone;\n className?: string;\n \"aria-label\"?: string;\n}\n\n/** How far the pointer has to move before a press counts as a drag. */\nconst DRAG_SLOP = 3;\n\n/**\n * The travel is animated, on the spring.\n *\n * Two things about that are worth reading before changing it.\n *\n * It uses --ease-spring-tight rather than --ease-spring. The overshoot in the\n * standard spring is a percentage of the travel, which is texture on a control\n * that scales in place and a problem on one whose travel is its own width: a\n * full-track jump measured 110% along a 919px track, putting the thumb 96px\n * outside the slider before it came back. The thumb still scales on the\n * standard spring, where the overshoot belongs.\n *\n * And it animates on a click or an arrow key but not under a dragging pointer,\n * where a transition means the thumb lags behind the cursor. Base UI's\n * data-dragging is not the right signal for that: it appears on pointerdown,\n * which is also how you click the track, so keying off it would kill the\n * animation for the most common interaction there is. What matters is whether\n * the pointer has actually moved, so that is what is tracked here — with a few\n * pixels of slop, because a mouse rarely stays perfectly still through a click.\n */\nexport function Slider({\n className,\n tone = \"primary\",\n \"aria-label\": ariaLabel,\n ...props\n}: SliderProps) {\n const [dragging, setDragging] = useState(false);\n const origin = useRef<{ x: number; y: number } | null>(null);\n\n useEffect(() => {\n if (!dragging && origin.current === null) {\n return;\n }\n\n // On window rather than the control: the pointer is very often released\n // outside a 6px-tall track, and a pointerup we never hear about leaves the\n // slider stuck in its dragging state with the animation off for good.\n const end = () => {\n origin.current = null;\n setDragging(false);\n };\n\n window.addEventListener(\"pointerup\", end);\n window.addEventListener(\"pointercancel\", end);\n\n return () => {\n window.removeEventListener(\"pointerup\", end);\n window.removeEventListener(\"pointercancel\", end);\n };\n }, [dragging]);\n\n function handlePointerDown(event: ReactPointerEvent<HTMLDivElement>) {\n origin.current = { x: event.clientX, y: event.clientY };\n }\n\n function handlePointerMove(event: ReactPointerEvent<HTMLDivElement>) {\n const start = origin.current;\n if (start === null || dragging) {\n return;\n }\n\n const moved =\n Math.abs(event.clientX - start.x) > DRAG_SLOP ||\n Math.abs(event.clientY - start.y) > DRAG_SLOP;\n\n if (moved) {\n setDragging(true);\n }\n }\n\n // Base UI positions the thumb with inset-inline-start and sizes the fill with\n // width, so those are the properties that move. `translate` stays out of it:\n // that holds the -50% centring offset, and animating it would drift the thumb\n // off the track rather than along it.\n const travel = dragging\n ? \"transition-none\"\n : \"duration-(--gryt-dur-spring) ease-spring-tight motion-reduce:transition-none\";\n\n return (\n <BaseSlider.Root className={cn(\"gryt-slider w-full\", className)} {...props}>\n <BaseSlider.Control\n className=\"flex w-full cursor-pointer touch-none items-center py-2 select-none\"\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n >\n <BaseSlider.Track className=\"h-1.5 w-full rounded-(--gryt-radius-full) bg-gryt-surface-raised select-none\">\n <BaseSlider.Indicator\n className={cn(\n \"h-full rounded-(--gryt-radius-full) select-none\",\n \"transition-[width]\",\n travel,\n toneBg[tone]\n )}\n />\n {/* Two elements because they animate on two curves, and one element\n gets one timing function. The thumb travels on the tight spring;\n the dot inside it scales on the standard one, so the press still\n has the overshoot every other control here has. */}\n <BaseSlider.Thumb\n aria-label={ariaLabel}\n className={cn(\n \"group h-4 w-4 rounded-(--gryt-radius-full) select-none\",\n \"transition-[inset-inline-start]\",\n travel,\n // The ring goes on the thumb but the focus lands on the visually\n // hidden input inside it, so this has to match a descendant.\n // Without it the slider is the one control here you cannot see\n // yourself tab to.\n focusRingWithin\n )}\n >\n <span\n className={cn(\n \"block h-full w-full rounded-(--gryt-radius-full) bg-gryt-text\",\n \"transition-[scale] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:group-hover:scale-[1.12] motion-safe:group-active:scale-[0.94]\",\n \"motion-reduce:transition-none\"\n )}\n />\n </BaseSlider.Thumb>\n </BaseSlider.Track>\n </BaseSlider.Control>\n </BaseSlider.Root>\n );\n}\n","import { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { CaretUpDown, Check } from \"@phosphor-icons/react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\nexport interface SelectOption {\n label: ReactNode;\n value: string | number;\n disabled?: boolean;\n}\n\nexport type SelectSize = \"small\" | \"medium\";\n\nconst sizeStyles: Record<SelectSize, string> = {\n small: \"min-h-9 px-3 text-sm\",\n medium: \"min-h-11 px-4 text-sm\"\n};\n\nexport interface SelectProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseSelect.Root>,\n \"children\" | \"items\"\n > {\n options?: SelectOption[];\n label?: ReactNode;\n placeholder?: string;\n size?: SelectSize;\n className?: string;\n}\n\n/*\n * The popup portals to the document body, and there is deliberately no way to\n * change that.\n *\n * A `portalContainer` prop existed briefly so a Select inside a dialog could\n * render into it rather than beside it. It does not work, and it caused the\n * dropdowns in the client's server settings to open in the wrong place.\n *\n * Base UI positions the popup by computing coordinates against the viewport. A\n * dialog is `position: fixed` and centres itself with `translate: -50% -50%`,\n * and both of those make it a containing block for positioned descendants — so\n * the coordinates get resolved against the dialog and its own offset is counted\n * twice. Measured in a browser, with the dialog at (16, 226): the popup landed\n * 227px too low and 17px too far right, matching the dialog's origin.\n *\n * Neither escape works. `positionMethod=\"fixed\"` changes nothing. Removing the\n * translate fixes the vertical error and leaves the horizontal one, because the\n * dialog is still positioned.\n *\n * Portalling to the body is correct on both axes and already renders above the\n * dialog, so there was never a stacking problem to solve.\n *\n * If a popup ever genuinely needs to live inside a themed subtree — previewing\n * one theme inside another, which is the other half of GRYT-242 — that wants\n * its own mechanism rather than this prop back.\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 cursor-pointer 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\n sideOffset={6}\n className=\"gryt-select-positioner outline-none\"\n >\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-pointer 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-11\">\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\n side={side}\n sideOffset={sideOffset}\n className=\"gryt-tooltip-positioner\"\n >\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-6 bg-gryt-secondary-3 text-gryt-secondary-11\",\n success: \"border-gryt-success-6 bg-gryt-success-3 text-gryt-success-11\",\n warning: \"border-gryt-warning-6 bg-gryt-warning-3 text-gryt-warning-11\",\n error: \"border-gryt-danger-6 bg-gryt-danger-3 text-gryt-danger-11\"\n};\n\nexport interface AlertProps extends HTMLAttributes<HTMLDivElement> {\n severity?: AlertSeverity;\n}\n\nexport const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(\n { className, severity = \"info\", ...props },\n ref\n) {\n return (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(\n \"gryt-alert rounded-(--gryt-radius-lg) border px-4 py-3 text-sm\",\n severityStyles[severity],\n className\n )}\n {...props}\n />\n );\n});\n","import { Progress as BaseProgress } from \"@base-ui/react/progress\";\nimport { CircleNotch } from \"@phosphor-icons/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface ProgressProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseProgress.Root>,\n \"className\" | \"value\"\n > {\n className?: string;\n // Optional, unlike Base UI's own prop: omitting it gives an indeterminate\n // bar, which is the common case when there is no measurable total.\n value?: number | null;\n}\n\nexport function Progress({ className, value = null, ...props }: ProgressProps) {\n return (\n <BaseProgress.Root\n // null is Base UI's indeterminate, so the default has to be null rather\n // than undefined — undefined is not assignable to its value prop.\n value={value}\n className={cn(\"gryt-progress w-full\", className)}\n {...props}\n >\n <BaseProgress.Track className=\"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised\">\n {/* ease-out, not the spring.\n A progress bar is a reading, and the spring overshoots 12% of the\n travel — so a jump to 100% ran past the end of the track and came\n back, which says the job finished, then unfinished, then finished.\n Bouncing is for controls the user just pushed. */}\n <BaseProgress.Indicator className=\"h-full rounded-(--gryt-radius-full) bg-gryt-accent transition-[width] duration-300 ease-out motion-reduce:transition-none\" />\n </BaseProgress.Track>\n </BaseProgress.Root>\n );\n}\n\nexport interface SpinnerProps {\n size?: number;\n className?: string;\n \"aria-label\"?: string;\n}\n\n// Base UI has no spinner — an indeterminate circular indicator is animation\n// rather than behaviour. Phosphor's CircleNotch is the shape, and the spin is\n// a Tailwind utility.\nexport function Spinner({\n className,\n size = 24,\n \"aria-label\": ariaLabel = \"Loading\"\n}: SpinnerProps) {\n return (\n <CircleNotch\n role=\"status\"\n aria-label={ariaLabel}\n size={size}\n weight=\"bold\"\n className={cn(\n \"gryt-spinner text-gryt-accent-11 motion-safe:animate-spin\",\n className\n )}\n />\n );\n}\n","import type { CSSProperties, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type SkeletonVariant = \"text\" | \"rounded\" | \"circular\" | \"rectangular\";\n\nconst variantStyles: Record<SkeletonVariant, string> = {\n text: \"h-4 rounded-(--gryt-radius-sm)\",\n rounded: \"rounded-(--gryt-radius-lg)\",\n circular: \"rounded-(--gryt-radius-full)\",\n rectangular: \"rounded-none\"\n};\n\nexport interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {\n variant?: SkeletonVariant;\n width?: number | string;\n height?: number | string;\n}\n\nexport function Skeleton({\n className,\n height,\n style,\n variant = \"text\",\n width,\n ...props\n}: SkeletonProps) {\n const sizing: CSSProperties = {\n width,\n height,\n ...style\n };\n\n return (\n <div\n aria-hidden=\"true\"\n className={cn(\n // Not bg-gryt-surface-raised. #1e2028 against #1a1d24 is four points of\n // luminance, which is invisible on a laptop screen at an angle — the\n // placeholder that is meant to say \"something is coming\" said nothing.\n // A white wash instead of a fixed colour, so it stays visible on any of\n // the surfaces it can land on rather than only the one it was picked\n // against, and it dims rather than brightens as it pulses.\n \"gryt-skeleton bg-white/9 motion-safe:animate-pulse\",\n variantStyles[variant],\n className\n )}\n style={sizing}\n {...props}\n />\n );\n}\n","import { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, HTMLAttributes } from \"react\";\nimport { cn } from \"../utils/cn\";\n\n// Base UI drives enter and exit animation through data-starting-style and\n// data-ending-style, which it sets for one frame either side of the transition.\n// The element has to carry the transition itself; there is no JS timing.\nconst motion =\n \"transition-[opacity,scale,translate] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\";\n\nexport type DialogBackdropProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Backdrop\n>;\n\nconst Backdrop = forwardRef<HTMLDivElement, DialogBackdropProps>(\n function DialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-dialog-backdrop fixed inset-0 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n motion,\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport type DialogPopupProps = ComponentPropsWithoutRef<\n typeof BaseDialog.Popup\n>;\n\n// 32rem, not the 24rem this used to be. Radix Themes, which the client is\n// migrating off, gives Dialog.Content 600px, so a dialog ported across to this\n// one shrank by a third for no reason anybody chose — and the client had grown\n// a w-[27rem]..w-[30rem] override on every dialog to claw some of it back.\n// tailwind-merge means those overrides still win, so this only moves the ones\n// that never said anything. AlertDialog carries the same width deliberately.\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-[32rem] 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-pointer items-center gap-2 rounded-(--gryt-radius-md)\",\n \"px-3 py-2 text-sm text-gryt-text outline-none select-none\",\n // Base UI drives keyboard and pointer highlight through the same\n // attribute, so arrow keys and the mouse land on identical styling.\n \"data-highlighted:bg-gryt-surface-raised\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Separator = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseMenu.Separator>\n>(function MenuSeparator({ className, ...props }, ref) {\n return (\n <BaseMenu.Separator\n ref={ref}\n className={cn(\"gryt-menu-separator my-1 h-px bg-gryt-border\", className)}\n {...props}\n />\n );\n});\n\nexport const Menu = {\n Root: BaseMenu.Root,\n Trigger: BaseMenu.Trigger,\n Portal: BaseMenu.Portal,\n Positioner,\n Popup,\n Item,\n Separator\n};\n","import { Tabs as BaseTabs } from \"@base-ui/react/tabs\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type TabsProps = ComponentPropsWithoutRef<typeof BaseTabs.Root>;\nexport type TabsListProps = ComponentPropsWithoutRef<typeof BaseTabs.List>;\nexport type TabProps = ComponentPropsWithoutRef<typeof BaseTabs.Tab>;\nexport type TabsPanelProps = ComponentPropsWithoutRef<typeof BaseTabs.Panel>;\n\n/**\n * Orientation is Base UI's `orientation` prop on Root, and every part below\n * styles itself from the `data-orientation` it puts on the DOM rather than from\n * a prop of ours. That is why none of these take an orientation of their own:\n * setting it in two places is how a list ends up vertical and its indicator\n * still travelling sideways.\n *\n * Vertical is the same visual language turned ninety degrees — the accent pill\n * still slides between rows. It suits a rail of five or six destinations. Past\n * about a dozen the filled pill becomes a block of accent parked in the corner\n * of the screen, and a quieter marker is the better call; the docs sidebar is\n * that case and deliberately does not use this.\n */\nconst Root = forwardRef<HTMLDivElement, TabsProps>(function TabsRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Root\n ref={ref}\n className={cn(\n \"gryt-tabs\",\n // Vertical puts the rail and the panel side by side. min-w-0 on the\n // panel does the rest; without the flex here the panel lands under the\n // rail and the layout reads as a very tall accordion.\n \"data-[orientation=vertical]:flex data-[orientation=vertical]:items-stretch\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst List = forwardRef<HTMLDivElement, TabsListProps>(function TabsList(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.List\n ref={ref}\n className={cn(\n \"gryt-tabs-list relative inline-flex items-center gap-1 rounded-(--gryt-radius-full) bg-gryt-surface-raised p-1\",\n // A rail, not a pill: rows are full width and the corner radius drops\n // to lg, because a 999px radius on a tall box bows its short edges.\n \"data-[orientation=vertical]:flex data-[orientation=vertical]:shrink-0\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch\",\n \"data-[orientation=vertical]:rounded-(--gryt-radius-lg)\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Tab = forwardRef<HTMLButtonElement, TabProps>(function Tab(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Tab\n ref={ref}\n className={cn(\n \"gryt-tab inline-flex min-h-8 cursor-pointer items-center justify-center whitespace-nowrap\",\n \"rounded-(--gryt-radius-full) border-0 bg-transparent px-4 py-1.5\",\n \"text-sm font-medium text-gryt-muted select-none\",\n \"relative z-10 transition-colors duration-150 hover:text-gryt-text\",\n // Base UI marks the selected tab with data-active, not data-selected.\n // The fill moved to Indicator so it can travel between tabs; the tab\n // itself only changes its text colour.\n \"data-active:text-gryt-on-accent\",\n // Left-aligned and taller in a rail. Centred labels in a vertical list\n // leave the text edge ragged, which is what makes a rail look untidy.\n \"data-[orientation=vertical]:min-h-9 data-[orientation=vertical]:justify-start\",\n \"data-[orientation=vertical]:gap-2.5 data-[orientation=vertical]:px-3\",\n \"data-[orientation=vertical]:rounded-(--gryt-radius-md)\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nexport type TabsIndicatorProps = ComponentPropsWithoutRef<\n typeof BaseTabs.Indicator\n>;\n\n// Base UI measures the active tab and publishes --active-tab-left and\n// --active-tab-width, plus --active-tab-top and --active-tab-height, which is\n// what lets the pill slide rather than jump. renderBeforeHydration keeps it\n// positioned on the first paint instead of animating in from the left edge.\n//\n// The vertical rules hang off the ancestor's data-orientation rather than the\n// indicator's own. Root is the part guaranteed to carry it, and an indicator\n// that reads its orientation from somewhere other than the root it belongs to\n// is a bug waiting for someone to nest two sets of tabs.\nconst Indicator = forwardRef<HTMLSpanElement, TabsIndicatorProps>(\n function TabsIndicator({ className, ...props }, ref) {\n return (\n <BaseTabs.Indicator\n ref={ref}\n renderBeforeHydration\n className={cn(\n \"gryt-tabs-indicator absolute top-1 left-0 z-0 h-[calc(100%-0.5rem)]\",\n \"w-(--active-tab-width) translate-x-(--active-tab-left)\",\n \"rounded-(--gryt-radius-full) bg-gryt-accent\",\n \"transition-[translate,width] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-reduce:transition-none\",\n // Same pill, travelling down the rail instead of across the row.\n \"[[data-orientation=vertical]_&]:top-0 [[data-orientation=vertical]_&]:left-1\",\n \"[[data-orientation=vertical]_&]:h-(--active-tab-height)\",\n \"[[data-orientation=vertical]_&]:w-[calc(100%-0.5rem)]\",\n \"[[data-orientation=vertical]_&]:translate-x-0\",\n \"[[data-orientation=vertical]_&]:translate-y-(--active-tab-top)\",\n \"[[data-orientation=vertical]_&]:rounded-(--gryt-radius-md)\",\n \"[[data-orientation=vertical]_&]:transition-[translate,height]\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, TabsPanelProps>(function TabsPanel(\n { className, ...props },\n ref\n) {\n return (\n <BaseTabs.Panel\n ref={ref}\n className={cn(\n \"gryt-tabs-panel pt-3 text-sm text-gryt-text\",\n // Beside the rail rather than under it, and allowed to shrink so long\n // content wraps instead of pushing the rail off screen.\n \"data-[orientation=vertical]:min-w-0 data-[orientation=vertical]:flex-1\",\n \"data-[orientation=vertical]:pt-0 data-[orientation=vertical]:pl-4\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Tabs = Object.assign(Root, { List, Tab, Panel, Indicator });\nexport { Tab };\n","import { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { CaretDown } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type AccordionProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Root\n>;\nexport type AccordionItemProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Item\n>;\nexport type AccordionPanelProps = ComponentPropsWithoutRef<\n typeof BaseAccordion.Panel\n>;\n\nconst Root = forwardRef<HTMLDivElement, AccordionProps>(function AccordionRoot(\n { className, ...props },\n ref\n) {\n return (\n <BaseAccordion.Root\n ref={ref}\n className={cn(\n \"gryt-accordion flex w-full flex-col gap-2 rounded-(--gryt-radius-xl) border border-gryt-border bg-gryt-surface p-2\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<HTMLDivElement, AccordionItemProps>(\n function AccordionItem({ className, ...props }, ref) {\n return (\n <BaseAccordion.Item\n ref={ref}\n className={cn(\"gryt-accordion-item\", className)}\n {...props}\n />\n );\n }\n);\n\nexport interface AccordionTriggerProps\n extends ComponentPropsWithoutRef<typeof BaseAccordion.Trigger> {\n // Defaults to a caret that rotates when the panel opens. Pass one to\n // override it, or null for no indicator at all.\n expandIcon?: ReactNode;\n}\n\nconst Trigger = forwardRef<HTMLButtonElement, AccordionTriggerProps>(\n function AccordionTrigger({ children, className, expandIcon, ...props }, ref) {\n return (\n <BaseAccordion.Header className=\"gryt-accordion-header m-0\">\n <BaseAccordion.Trigger\n ref={ref}\n className={cn(\n \"gryt-accordion-trigger flex w-full cursor-pointer 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 \"data-disabled:cursor-not-allowed data-disabled:opacity-50\",\n focusRing,\n className\n )}\n {...props}\n >\n {children}\n {expandIcon === undefined ? (\n <CaretDown\n size={16}\n // Base UI flags the open panel on the trigger, so the caret needs\n // no state of its own.\n className=\"shrink-0 transition-transform duration-(--gryt-dur-spring) ease-spring data-panel-open:rotate-180 motion-reduce:transition-none\"\n />\n ) : (\n expandIcon\n )}\n </BaseAccordion.Trigger>\n </BaseAccordion.Header>\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel({ children, className, ...props }, ref) {\n return (\n <BaseAccordion.Panel\n ref={ref}\n className={cn(\n \"gryt-accordion-panel overflow-hidden text-sm text-gryt-muted\",\n // Base UI measures the panel and exposes the height as a variable,\n // which is what makes a real open and close transition possible.\n \"h-[var(--accordion-panel-height)] transition-[height] duration-(--gryt-dur-spring-soft) ease-spring\",\n \"data-starting-style:h-0 data-ending-style:h-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n >\n <div className=\"px-3 pt-1 pb-3\">{children}</div>\n </BaseAccordion.Panel>\n );\n }\n);\n\nexport const Accordion = Object.assign(Root, { Item, Trigger, Panel });\n","import { ContextMenu as BaseContextMenu } from \"@base-ui/react/context-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { Menu } from \"../Menu/Menu\";\n\nexport type ContextMenuPositionerProps = ComponentPropsWithoutRef<\n typeof BaseContextMenu.Positioner\n>;\n\n/**\n * A right-click menu: a message, a member, a channel.\n *\n * Base UI builds this out of Menu's own parts — its Popup, Item and Separator\n * are literally Menu's components — so this reuses the styled ones rather than\n * restyling them. A context menu that drifted from the dropdown menu would be\n * a bug nobody notices until both are on screen at once.\n */\nconst Positioner = forwardRef<HTMLDivElement, ContextMenuPositionerProps>(\n function ContextMenuPositioner({ className, sideOffset = 2, ...props }, ref) {\n return (\n <BaseContextMenu.Positioner\n ref={ref}\n // Smaller than Menu's 8. This anchors to the pointer rather than to a\n // trigger element, and 8px from the cursor reads as a menu that missed.\n sideOffset={sideOffset}\n className={cn(\"gryt-context-menu-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\nexport const ContextMenu = {\n Root: BaseContextMenu.Root,\n Trigger: BaseContextMenu.Trigger,\n Portal: BaseContextMenu.Portal,\n Positioner,\n Popup: Menu.Popup,\n Item: Menu.Item,\n Separator: Menu.Separator,\n Group: BaseContextMenu.Group,\n GroupLabel: BaseContextMenu.GroupLabel,\n SubmenuRoot: BaseContextMenu.SubmenuRoot,\n SubmenuTrigger: BaseContextMenu.SubmenuTrigger\n};\n","import { Popover as BasePopover } from \"@base-ui/react/popover\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\nexport type PopoverPopupProps = ComponentPropsWithoutRef<\n typeof BasePopover.Popup\n>;\nexport type PopoverPositionerProps = ComponentPropsWithoutRef<\n typeof BasePopover.Positioner\n>;\n\nconst Positioner = forwardRef<HTMLDivElement, PopoverPositionerProps>(\n function PopoverPositioner({ className, sideOffset = 8, ...props }, ref) {\n return (\n <BasePopover.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-popover-positioner outline-none\", className)}\n {...props}\n />\n );\n }\n);\n\n// Wider default than Menu: this holds prose and controls — a member card, a\n// permissions summary — rather than a column of one-line items.\nconst Popup = forwardRef<HTMLDivElement, PopoverPopupProps>(\n function PopoverPopup({ className, ...props }, ref) {\n return (\n <BasePopover.Popup\n ref={ref}\n className={cn(\n \"gryt-popover max-w-[min(20rem,calc(100vw-2rem))] p-4 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Title = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof BasePopover.Title>\n>(function PopoverTitle({ className, ...props }, ref) {\n return (\n <BasePopover.Title\n ref={ref}\n className={cn(\n \"gryt-popover-title text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof BasePopover.Description>\n>(function PopoverDescription({ className, ...props }, ref) {\n return (\n <BasePopover.Description\n ref={ref}\n className={cn(\n \"gryt-popover-description mt-1 text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Popover = {\n Root: BasePopover.Root,\n Trigger: BasePopover.Trigger,\n Portal: BasePopover.Portal,\n Positioner,\n Popup,\n Title,\n Description,\n Close: BasePopover.Close,\n Arrow: BasePopover.Arrow\n};\n","import { Toast as BaseToast } from \"@base-ui/react/toast\";\nimport { X } from \"@phosphor-icons/react\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ToastSeverity =\n | \"neutral\"\n | \"info\"\n | \"success\"\n | \"warning\"\n | \"danger\";\n\n/**\n * Severity is a tinted edge and a wash, not a filled card.\n *\n * Alert tints its whole surface, and that is right for something sitting in\n * the page where it has to compete with the content around it. A toast is\n * already floating over everything with nothing to compete with, so the same\n * treatment reads as shouting. The border carries the colour and the fill stays\n * near the surface underneath.\n */\nconst severityStyles: Record<ToastSeverity, string> = {\n neutral: \"border-white/8 bg-gryt-surface\",\n info: \"border-gryt-secondary-6 bg-gryt-secondary-2\",\n success: \"border-gryt-success-6 bg-gryt-success-2\",\n warning: \"border-gryt-warning-6 bg-gryt-warning-2\",\n danger: \"border-gryt-danger-6 bg-gryt-danger-2\"\n};\n\nexport interface ToastRootProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToast.Root>, \"className\"> {\n severity?: ToastSeverity;\n className?: string;\n}\nexport type ToastViewportProps = ComponentPropsWithoutRef<\n typeof BaseToast.Viewport\n>;\n\n/**\n * Transient notice: connection lost, invite copied, message failed to send.\n *\n * design.md's stance is silent success — most things that worked should say\n * nothing. This is for the cases where the user is not looking at the thing\n * that changed, which in a voice client is most of them.\n */\nconst Viewport = forwardRef<HTMLDivElement, ToastViewportProps>(\n function ToastViewport({ className, ...props }, ref) {\n return (\n <BaseToast.Viewport\n ref={ref}\n className={cn(\n \"gryt-toast-viewport fixed right-4 bottom-4 z-50 flex w-[min(22rem,calc(100vw-2rem))]\",\n \"flex-col gap-2 outline-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Root = forwardRef<HTMLDivElement, ToastRootProps>(function ToastRoot(\n { className, severity = \"neutral\", ...props },\n ref\n) {\n return (\n <BaseToast.Root\n ref={ref}\n className={cn(\n \"gryt-toast relative flex flex-col p-3 pr-9\",\n // Not popupSurface. That border is --gryt-border, a solid slate line\n // that is right for a menu anchored to the thing that opened it and too\n // heavy for a card floating in the corner with nothing behind it. A\n // white hairline separates it from the page without drawing a box\n // around it.\n \"rounded-(--gryt-radius-xl) border text-gryt-text\",\n severityStyles[severity],\n // Swiping is a pointer gesture, so the toast follows the finger\n // through Base UI's swipe variables before it animates out.\n \"transition-[opacity,transform] duration-(--gryt-dur-spring) ease-spring\",\n \"data-starting-style:translate-y-2 data-starting-style:opacity-0\",\n \"data-ending-style:translate-y-2 data-ending-style:opacity-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Title = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToast.Title>\n>(function ToastTitle({ className, ...props }, ref) {\n return (\n <BaseToast.Title\n ref={ref}\n className={cn(\n \"gryt-toast-title text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseToast.Description>\n>(function ToastDescription({ className, ...props }, ref) {\n return (\n <BaseToast.Description\n ref={ref}\n className={cn(\n \"gryt-toast-description mt-0.5 text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Close = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseToast.Close>\n>(function ToastClose({ className, children, ...props }, ref) {\n return (\n <BaseToast.Close\n ref={ref}\n aria-label=\"Close\"\n className={cn(\n \"gryt-toast-close absolute top-2.5 right-2.5 inline-flex h-6 w-6 items-center justify-center\",\n \"rounded-(--gryt-radius-full) border-0 bg-transparent text-gryt-muted\",\n \"transition-colors hover:bg-white/8 hover:text-gryt-text motion-reduce:transition-none\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n >\n {children ?? <X size={14} weight=\"bold\" />}\n </BaseToast.Close>\n );\n});\n\nconst Action = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseToast.Action>\n>(function ToastAction({ className, ...props }, ref) {\n return (\n <BaseToast.Action\n ref={ref}\n className={cn(\n \"gryt-toast-action mt-2 self-start rounded-(--gryt-radius-full) border-0\",\n \"bg-gryt-accent px-3 py-1.5 text-sm font-medium text-gryt-on-accent\",\n \"transition-[scale] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:scale-[1.04] motion-safe:active:scale-[0.96]\",\n \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Toast = {\n Provider: BaseToast.Provider,\n Portal: BaseToast.Portal,\n Viewport,\n Root,\n Title,\n Description,\n Close,\n Action\n};\n\n/**\n * Raise a toast without importing Base UI directly.\n *\n * Taken off the namespace rather than re-exported from \"@base-ui/react/toast\":\n * at that path the hook is a type-only declaration, and re-exporting it as a\n * value fails under isolatedModules. The value lives on the parts namespace.\n */\nexport const useToastManager = BaseToast.useToastManager;\n","import { ScrollArea as BaseScrollArea } from \"@base-ui/react/scroll-area\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type ScrollAreaRootProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Root\n>;\nexport type ScrollAreaViewportProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Viewport\n>;\nexport type ScrollAreaScrollbarProps = ComponentPropsWithoutRef<\n typeof BaseScrollArea.Scrollbar\n>;\n\nconst Root = forwardRef<HTMLDivElement, ScrollAreaRootProps>(\n function ScrollAreaRoot({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Root\n ref={ref}\n className={cn(\"gryt-scroll-area relative\", className)}\n {...props}\n />\n );\n }\n);\n\n// overscroll-contain so a message list that hits its end does not hand the\n// scroll to the page behind it.\nconst Viewport = forwardRef<HTMLDivElement, ScrollAreaViewportProps>(\n function ScrollAreaViewport({ className, ...props }, ref) {\n return (\n <BaseScrollArea.Viewport\n ref={ref}\n className={cn(\n \"gryt-scroll-area-viewport h-full w-full overscroll-contain\",\n \"focus-visible:outline-2 focus-visible:-outline-offset-1 focus-visible:outline-gryt-accent-light\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Scrollbar = forwardRef<HTMLDivElement, ScrollAreaScrollbarProps>(\n function ScrollAreaScrollbar({ className, orientation, ...props }, ref) {\n return (\n <BaseScrollArea.Scrollbar\n ref={ref}\n orientation={orientation}\n className={cn(\n \"gryt-scroll-area-scrollbar flex touch-none p-0.5 select-none\",\n // Fades in on hover or while scrolling rather than sitting there\n // permanently — a chat sidebar is mostly not being scrolled.\n \"opacity-0 transition-opacity duration-(--gryt-dur-fast)\",\n \"data-hovering:opacity-100 data-scrolling:opacity-100\",\n \"motion-reduce:transition-none\",\n orientation === \"horizontal\" ? \"h-2 flex-col\" : \"w-2\",\n className\n )}\n {...props}\n >\n <BaseScrollArea.Thumb className=\"flex-1 rounded-(--gryt-radius-full) bg-gryt-border transition-colors hover:bg-gryt-muted motion-reduce:transition-none\" />\n </BaseScrollArea.Scrollbar>\n );\n }\n);\n\nexport const ScrollArea = {\n Root,\n Viewport,\n Scrollbar,\n Content: BaseScrollArea.Content,\n Corner: BaseScrollArea.Corner\n};\n","import { Toggle as BaseToggle } from \"@base-ui/react/toggle\";\nimport { ToggleGroup as BaseToggleGroup } from \"@base-ui/react/toggle-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { disabledState, focusRing } from \"../utils/styles\";\n\ntype ToggleTone = \"primary\" | \"secondary\" | \"neutral\" | \"danger\";\ntype ToggleSize = \"xsmall\" | \"small\" | \"medium\" | \"large\";\n\n// Unpressed reads like IconButton's tinted target; pressed fills. A mute button\n// has to be legible as on or off from across the room, so the two states differ\n// in fill rather than only in colour.\nconst toneStyles: Record<ToggleTone, string> = {\n primary: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-accent data-pressed:text-gryt-on-accent\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-accent\"\n ].join(\" \"),\n secondary: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-secondary data-pressed:text-gryt-on-secondary\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-secondary\"\n ].join(\" \"),\n neutral: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-surface-hover data-pressed:text-gryt-text\"\n ].join(\" \"),\n // For destructive-while-active controls: mic muted, camera off.\n danger: [\n \"text-gryt-muted hover:not-data-disabled:bg-white/8\",\n \"data-pressed:bg-gryt-danger data-pressed:text-gryt-on-danger\",\n \"data-pressed:hover:not-data-disabled:bg-gryt-danger\"\n ].join(\" \")\n};\n\nconst sizeStyles: Record<ToggleSize, string> = {\n xsmall: \"h-8 min-w-8 px-2 text-xs\",\n small: \"h-9 min-w-9 px-2.5 text-sm\",\n medium: \"h-10 min-w-10 px-3 text-sm\",\n large: \"h-12 min-w-12 px-4 text-base\"\n};\n\nexport interface ToggleProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToggle>, \"className\"> {\n tone?: ToggleTone;\n size?: ToggleSize;\n className?: string;\n}\n\nexport const Toggle = forwardRef<HTMLButtonElement, ToggleProps>(\n function Toggle(\n { className, size = \"medium\", tone = \"primary\", ...props },\n ref\n ) {\n return (\n <BaseToggle\n ref={ref}\n className={cn(\n \"gryt-toggle\",\n \"inline-flex shrink-0 items-center justify-center gap-2 border-0 bg-transparent\",\n \"rounded-(--gryt-radius-full) font-medium select-none\",\n // scale rather than transform — see the note in Button.\n \"transition-[scale,background-color,color] duration-(--gryt-dur-spring) ease-spring\",\n \"motion-safe:hover:not-data-disabled:scale-[1.06]\",\n \"motion-safe:active:not-data-disabled:scale-[0.94]\",\n focusRing,\n disabledState,\n sizeStyles[size],\n toneStyles[tone],\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport interface ToggleGroupProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseToggleGroup>, \"className\"> {\n className?: string;\n}\n\n// A rail around a set of Toggles. Base UI handles roving focus, so arrow keys\n// move between items and only one tab stop enters the group.\nexport const ToggleGroup = forwardRef<HTMLDivElement, ToggleGroupProps>(\n function ToggleGroup({ className, ...props }, ref) {\n return (\n <BaseToggleGroup\n ref={ref}\n className={cn(\n \"gryt-toggle-group inline-flex items-center gap-1\",\n \"rounded-(--gryt-radius-full) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n }\n);\n","import { Meter as BaseMeter } from \"@base-ui/react/meter\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type MeterTone = \"primary\" | \"success\" | \"warning\" | \"danger\";\n\nconst toneFill: Record<MeterTone, string> = {\n primary: \"bg-gryt-accent\",\n success: \"bg-gryt-success\",\n warning: \"bg-gryt-warning\",\n danger: \"bg-gryt-danger\"\n};\n\nexport interface MeterProps\n extends Omit<\n ComponentPropsWithoutRef<typeof BaseMeter.Root>,\n \"className\" | \"value\"\n > {\n value: number;\n label?: ReactNode;\n /** Show the formatted value at the end of the label row. */\n showValue?: boolean;\n tone?: MeterTone;\n className?: string;\n}\n\n/**\n * A measurement inside a known range — mic input level, disk used, how full a\n * server is.\n *\n * Deliberately not Progress. Progress says \"this task is 40% done and heading\n * for 100%\"; a meter says \"this is the reading right now\", and a reading at\n * 100% is often the bad case rather than the finished one. They also announce\n * differently to a screen reader, which is the part that actually matters.\n *\n * The indicator moves rather than snapping, but only just — 120ms and ease-out,\n * no spring. This used to have no transition at all, on the grounds that the\n * common caller is a mic level updating every animation frame and easing a\n * value that changes 60 times a second only makes it lag behind the sound.\n * That reasoning holds for the mic and nothing else: disk used, server\n * capacity, a level polled a few times a second all read as broken when they\n * teleport. 120ms is shorter than the gap between polls at 4Hz, so a fast feed\n * still lands on every value it is handed.\n */\nexport function Meter({\n className,\n value,\n label,\n showValue = false,\n tone = \"primary\",\n ...props\n}: MeterProps) {\n return (\n <BaseMeter.Root\n value={value}\n className={cn(\"gryt-meter flex w-full flex-col gap-1.5\", className)}\n {...props}\n >\n {(label || showValue) && (\n <div className=\"flex items-baseline justify-between gap-2\">\n {label ? (\n <BaseMeter.Label className=\"text-sm text-gryt-muted\">\n {label}\n </BaseMeter.Label>\n ) : (\n <span />\n )}\n {showValue && (\n <BaseMeter.Value className=\"font-mono text-xs text-gryt-muted tabular-nums\" />\n )}\n </div>\n )}\n <BaseMeter.Track className=\"h-1.5 w-full overflow-hidden rounded-(--gryt-radius-full) bg-gryt-surface-raised\">\n {/* Short and linear-ish, so the bar moves rather than snapping.\n The note above says no transition, and that was written for a mic\n level updating every frame — easing a value that changes 60 times a\n second only makes it lag. But most meters are not that: disk used,\n how full a server is, a level polled a few times a second, and those\n all read as broken when they teleport. 120ms is under the gap\n between polls at 4Hz, so a fast feed still lands on every value it\n is given; it just gets there over two frames instead of one. */}\n <BaseMeter.Indicator\n className={cn(\n \"h-full rounded-(--gryt-radius-full)\",\n \"transition-[width] duration-120 ease-out motion-reduce:transition-none\",\n toneFill[tone]\n )}\n />\n </BaseMeter.Track>\n </BaseMeter.Root>\n );\n}\n","import { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type AlertDialogPopupProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Popup\n>;\n\n/**\n * A dialog you cannot dismiss by accident — for \"Leave this server?\".\n *\n * Styled identically to Dialog on purpose; the difference is behaviour, not\n * looks. Escape and clicking the backdrop do nothing here, so answering\n * requires picking one of the buttons. Using this where Dialog belongs is worse\n * than not having it, because it takes away the escape people expect.\n */\nconst Popup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n ref={ref}\n className={cn(\n \"gryt-alert-dialog fixed top-1/2 left-1/2 z-50 -translate-x-1/2 -translate-y-1/2\",\n \"flex w-[32rem] max-w-[calc(100vw-3rem)] flex-col gap-4\",\n \"rounded-(--gryt-radius-lg) border border-gryt-border bg-gryt-surface p-5 text-gryt-text\",\n \"outline-none\",\n \"transition-[opacity,scale] duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:scale-[0.98] data-starting-style:opacity-0\",\n \"data-ending-style:scale-[0.98] data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Backdrop = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>\n>(function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-backdrop fixed inset-0 z-50 min-h-dvh bg-black/60\",\n \"backdrop-blur-(--gryt-backdrop-blur)\",\n \"transition-opacity duration-(--gryt-dur-spring) ease-spring motion-reduce:transition-none\",\n \"data-starting-style:opacity-0 data-ending-style:opacity-0\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Title = forwardRef<\n HTMLHeadingElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>\n>(function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-title text-lg font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nconst Description = forwardRef<\n HTMLParagraphElement,\n ComponentPropsWithoutRef<typeof BaseAlertDialog.Description>\n>(function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n ref={ref}\n className={cn(\n \"gryt-alert-dialog-description text-sm leading-6 text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const AlertDialog = {\n Root: BaseAlertDialog.Root,\n Trigger: BaseAlertDialog.Trigger,\n Portal: BaseAlertDialog.Portal,\n Backdrop,\n Popup,\n Title,\n Description,\n Close: BaseAlertDialog.Close\n};\n","import { Combobox as BaseCombobox } from \"@base-ui/react/combobox\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport {\n fieldControl,\n fieldSizes,\n focusRing,\n popupMotion,\n popupSurface\n} from \"../utils/styles\";\n\n/**\n * Shared with Autocomplete, which is the same list wearing different\n * semantics. Exported so the two cannot drift, the way ContextMenu shares\n * Menu's item.\n */\nexport const listboxItemClass = [\n \"flex cursor-default items-center gap-2 rounded-(--gryt-radius-md)\",\n \"px-3 py-2 text-sm text-gryt-text outline-none select-none\",\n // Base UI drives keyboard and pointer highlight through one attribute, so\n // arrow keys and the mouse land on identical styling.\n \"data-highlighted:bg-gryt-surface-raised\",\n \"data-selected:text-gryt-accent-11\",\n \"data-disabled:cursor-not-allowed data-disabled:opacity-50\"\n].join(\" \");\n\n/**\n * The typeahead input on both Combobox and Autocomplete.\n *\n * This is TextField's control, through the same shared constant, so the three\n * places you can type in this library are the same shape. It used to be its own\n * class list asking for `rounded-(--gryt-radius-input)` — a token that has never\n * existed — so it rendered with square corners next to a fully rounded\n * TextField.\n */\nexport const listboxInputClass = [\n fieldControl,\n fieldSizes.medium,\n \"border-gryt-border\",\n focusRing\n].join(\" \");\n\nexport type ComboboxPopupProps = ComponentPropsWithoutRef<\n typeof BaseCombobox.Popup\n>;\n\nconst Input = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Input>\n>(function ComboboxInput({ className, ...props }, ref) {\n return (\n <BaseCombobox.Input\n ref={ref}\n className={cn(\"gryt-combobox-input\", listboxInputClass, className)}\n {...props}\n />\n );\n});\n\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Positioner>\n>(function ComboboxPositioner({ className, sideOffset = 6, ...props }, ref) {\n return (\n <BaseCombobox.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-combobox-positioner outline-none\", className)}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<HTMLDivElement, ComboboxPopupProps>(\n function ComboboxPopup({ className, ...props }, ref) {\n return (\n <BaseCombobox.Popup\n ref={ref}\n className={cn(\n \"gryt-combobox max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Item = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Item>\n>(function ComboboxItem({ className, ...props }, ref) {\n return (\n <BaseCombobox.Item\n ref={ref}\n className={cn(\"gryt-combobox-item\", listboxItemClass, className)}\n {...props}\n />\n );\n});\n\nconst Empty = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseCombobox.Empty>\n>(function ComboboxEmpty({ className, ...props }, ref) {\n return (\n <BaseCombobox.Empty\n ref={ref}\n className={cn(\n \"gryt-combobox-empty px-3 py-2 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\n/**\n * Pick from a list, narrowed by typing. Select with a filter, in effect.\n *\n * Supports multiple selection with chips, which is what a member picker or a\n * role assignment wants. Use Autocomplete instead when the value is free text\n * and the list is only a suggestion.\n */\nexport const Combobox = {\n Root: BaseCombobox.Root,\n Input,\n InputGroup: BaseCombobox.InputGroup,\n Trigger: BaseCombobox.Trigger,\n Icon: BaseCombobox.Icon,\n Clear: BaseCombobox.Clear,\n Value: BaseCombobox.Value,\n Chips: BaseCombobox.Chips,\n Chip: BaseCombobox.Chip,\n ChipRemove: BaseCombobox.ChipRemove,\n Portal: BaseCombobox.Portal,\n Positioner,\n Popup,\n List: BaseCombobox.List,\n Item,\n ItemIndicator: BaseCombobox.ItemIndicator,\n Group: BaseCombobox.Group,\n GroupLabel: BaseCombobox.GroupLabel,\n Empty,\n Separator: BaseCombobox.Separator\n};\n","import { Autocomplete as BaseAutocomplete } from \"@base-ui/react/autocomplete\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { listboxInputClass, listboxItemClass } from \"../Combobox/Combobox\";\nimport { popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * A text input that suggests as you type.\n *\n * The difference from Combobox is what the value is allowed to be: here the\n * typed text is the answer and the list is a suggestion, so a search box or a\n * tag input belongs here. Combobox is for when the value must come from the\n * list. They share item and input styling deliberately — two lists that look\n * different for no reason is worse than one that looks the same.\n */\n\nconst Input = forwardRef<\n HTMLInputElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Input>\n>(function AutocompleteInput({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Input\n ref={ref}\n className={cn(\"gryt-autocomplete-input\", listboxInputClass, className)}\n {...props}\n />\n );\n});\n\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Positioner>\n>(function AutocompletePositioner({ className, sideOffset = 6, ...props }, ref) {\n return (\n <BaseAutocomplete.Positioner\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\"gryt-autocomplete-positioner outline-none\", className)}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Popup>\n>(function AutocompletePopup({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Popup\n ref={ref}\n className={cn(\n \"gryt-autocomplete max-h-64 w-(--anchor-width) overflow-y-auto overscroll-contain p-1 outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Item = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Item>\n>(function AutocompleteItem({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Item\n ref={ref}\n className={cn(\"gryt-autocomplete-item\", listboxItemClass, className)}\n {...props}\n />\n );\n});\n\nconst Empty = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseAutocomplete.Empty>\n>(function AutocompleteEmpty({ className, ...props }, ref) {\n return (\n <BaseAutocomplete.Empty\n ref={ref}\n className={cn(\n \"gryt-autocomplete-empty px-3 py-2 text-sm text-gryt-muted\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Autocomplete = {\n Root: BaseAutocomplete.Root,\n Input,\n InputGroup: BaseAutocomplete.InputGroup,\n Trigger: BaseAutocomplete.Trigger,\n Icon: BaseAutocomplete.Icon,\n Clear: BaseAutocomplete.Clear,\n Value: BaseAutocomplete.Value,\n Portal: BaseAutocomplete.Portal,\n Positioner,\n Popup,\n List: BaseAutocomplete.List,\n Item,\n Group: BaseAutocomplete.Group,\n GroupLabel: BaseAutocomplete.GroupLabel,\n Empty,\n Separator: BaseAutocomplete.Separator\n};\n","import { CheckboxGroup as BaseCheckboxGroup } from \"@base-ui/react/checkbox-group\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type CheckboxGroupProps = ComponentPropsWithoutRef<\n typeof BaseCheckboxGroup\n>;\n\n/**\n * A set of checkboxes sharing one value array.\n *\n * Worth having over a hand-rolled array of Checkboxes for the parent case: give\n * it `allValues` and a checkbox marked `parent` becomes a working\n * indeterminate tri-state, which is fiddly to get right by hand and is exactly\n * what a permissions list needs.\n */\nexport const CheckboxGroup = forwardRef<HTMLDivElement, CheckboxGroupProps>(\n function CheckboxGroup({ className, ...props }, ref) {\n return (\n <BaseCheckboxGroup\n ref={ref}\n className={cn(\"gryt-checkbox-group flex flex-col gap-2\", className)}\n {...props}\n />\n );\n }\n);\n","import { Collapsible as BaseCollapsible } from \"@base-ui/react/collapsible\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing } from \"../utils/styles\";\n\nexport type CollapsibleTriggerProps = ComponentPropsWithoutRef<\n typeof BaseCollapsible.Trigger\n>;\nexport type CollapsiblePanelProps = ComponentPropsWithoutRef<\n typeof BaseCollapsible.Panel\n>;\n\n/**\n * One region that opens and closes — a channel category, an advanced section.\n *\n * Accordion is a set of these that know about each other. Reach for this when\n * there is only one, so nothing has to pretend to be a one-item accordion.\n */\nconst Trigger = forwardRef<HTMLButtonElement, CollapsibleTriggerProps>(\n function CollapsibleTrigger({ className, ...props }, ref) {\n return (\n <BaseCollapsible.Trigger\n ref={ref}\n className={cn(\n \"gryt-collapsible-trigger flex w-full items-center justify-between gap-2\",\n \"rounded-(--gryt-radius-md) border-0 bg-transparent px-2 py-2 text-left\",\n \"text-sm font-medium text-gryt-text select-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Panel = forwardRef<HTMLDivElement, CollapsiblePanelProps>(\n function CollapsiblePanel({ className, ...props }, ref) {\n return (\n <BaseCollapsible.Panel\n ref={ref}\n className={cn(\n \"gryt-collapsible-panel overflow-hidden\",\n // Base UI measures the panel and exposes the height as a variable, so\n // this animates to the content's real height rather than to a guess.\n \"h-(--collapsible-panel-height) transition-[height] duration-(--gryt-dur-spring) ease-spring\",\n \"data-starting-style:h-0 data-ending-style:h-0\",\n \"motion-reduce:transition-none\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nexport const Collapsible = {\n Root: BaseCollapsible.Root,\n Trigger,\n Panel\n};\n","import { Form as BaseForm } from \"@base-ui/react/form\";\nimport { Fieldset as BaseFieldset } from \"@base-ui/react/fieldset\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport type FormProps = ComponentPropsWithoutRef<typeof BaseForm>;\n\n/**\n * Wires server-side errors back to the fields that caused them.\n *\n * Pass `errors` keyed by field name and Base UI routes each message to the\n * matching Field, so a rejected form points at the input rather than printing a\n * paragraph at the top that the user has to map back themselves.\n */\nexport const Form = forwardRef<HTMLFormElement, FormProps>(function Form(\n { className, ...props },\n ref\n) {\n return (\n <BaseForm\n ref={ref}\n className={cn(\"gryt-form flex flex-col gap-(--gryt-space-lg)\", className)}\n {...props}\n />\n );\n});\n\nexport type FieldsetProps = ComponentPropsWithoutRef<typeof BaseFieldset.Root>;\n\nconst FieldsetRoot = forwardRef<HTMLFieldSetElement, FieldsetProps>(\n function Fieldset({ className, ...props }, ref) {\n return (\n <BaseFieldset.Root\n ref={ref}\n className={cn(\n \"gryt-fieldset flex min-w-0 flex-col gap-3 border-0 p-0\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\nconst Legend = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseFieldset.Legend>\n>(function FieldsetLegend({ className, ...props }, ref) {\n return (\n <BaseFieldset.Legend\n ref={ref}\n className={cn(\n \"gryt-fieldset-legend text-sm font-semibold text-gryt-text\",\n className\n )}\n {...props}\n />\n );\n});\n\nexport const Fieldset = { Root: FieldsetRoot, Legend };\n","import { Menubar as BaseMenubar } from \"@base-ui/react/menubar\";\nimport { NavigationMenu as BaseNavigationMenu } from \"@base-ui/react/navigation-menu\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { focusRing, popupMotion, popupSurface } from \"../utils/styles\";\n\n/**\n * A bar of menus that behave as one — File, Edit, View.\n *\n * Once any menu is open, moving along the bar opens the next without a second\n * click, which is the behaviour that separates a menubar from several\n * independent Menus sitting next to each other.\n */\nexport type MenubarProps = ComponentPropsWithoutRef<typeof BaseMenubar>;\n\nexport const Menubar = forwardRef<HTMLDivElement, MenubarProps>(\n function Menubar({ className, ...props }, ref) {\n return (\n <BaseMenubar\n ref={ref}\n className={cn(\n \"gryt-menubar flex items-center gap-1\",\n \"rounded-(--gryt-radius-md) border border-gryt-border bg-gryt-surface p-1\",\n className\n )}\n {...props}\n />\n );\n }\n);\n\n/**\n * Site-level navigation whose items open panels.\n *\n * Distinct from Menubar: the items are links first and the panels can hold\n * layout — a column of sections, a promo — rather than a list of commands. The\n * viewport animates between panels so moving along the bar resizes rather than\n * closing and reopening.\n */\nconst Trigger = forwardRef<\n HTMLButtonElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Trigger>\n>(function NavigationMenuTrigger({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Trigger\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-trigger flex items-center gap-1.5 rounded-(--gryt-radius-md)\",\n \"border-0 bg-transparent px-3 py-2 text-sm font-medium text-gryt-text select-none\",\n \"transition-colors hover:bg-gryt-surface-raised motion-reduce:transition-none\",\n \"data-popup-open:bg-gryt-surface-raised\",\n focusRing,\n className\n )}\n {...props}\n />\n );\n});\n\nconst Popup = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Popup>\n>(function NavigationMenuPopup({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Popup\n ref={ref}\n className={cn(\n \"gryt-navigation-menu-popup outline-none\",\n popupSurface,\n popupMotion,\n className\n )}\n {...props}\n />\n );\n});\n\n// Wrapped rather than re-exported raw, so it carries a class the app can hang a\n// z-index on. Every other popup in here already has one; this was the last\n// positioner without, and a consumer cannot style what it cannot select.\nconst Positioner = forwardRef<\n HTMLDivElement,\n ComponentPropsWithoutRef<typeof BaseNavigationMenu.Positioner>\n>(function NavigationMenuPositioner({ className, ...props }, ref) {\n return (\n <BaseNavigationMenu.Positioner\n ref={ref}\n className={cn(\"gryt-navigation-menu-positioner outline-none\", className)}\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,\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":["isCssVariables","value","key","GrytProvider","children","className","theme","tooltipDelay","style","createGrytTheme","jsx","Tooltip","cn","inputs","twMerge","clsx","toneStyles","sizeStyles","Button","forwardRef","endIcon","size","startIcon","tone","props","ref","jsxs","BaseButton","focusRing","focusRingWithin","fieldControl","fieldSizes","popupSurface","popupMotion","disabledState","toneCheckedFill","toneBg","toneCheckedBorder","toneCheckedBg","IconButton","Surface","elevated","MessageBubble","from","TextField","error","fieldClassName","helperText","label","minRows","multiline","control","Field","Composer","disabled","maxRows","onSubmit","placeholder","submitLabel","innerRef","useRef","resize","useCallback","node","styles","lineHeight","vertical","useLayoutEffect","handleSubmit","event","PaperPlaneTilt","Avatar","alt","fallback","src","BaseAvatar","ConversationItem","active","avatar","subtitle","title","Badge","badgeContent","max","showZero","numeric","hidden","display","Chip","icon","onDelete","X","Checkbox","BaseCheckbox","Check","Radio","BaseRadio","RadioGroup","BaseRadioGroup","Switch","BaseSwitch","DRAG_SLOP","Slider","ariaLabel","dragging","setDragging","useState","origin","useEffect","end","handlePointerDown","handlePointerMove","start","travel","BaseSlider","Select","options","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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,SAAS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