{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "textarea",
  "type": "registry:ui",
  "title": "Textarea",
  "description": "Textarea provides its canonical documented behavior.",
  "dependencies": [],
  "registryDependencies": [
    "https://ghost-ui.com/r/ghost-tokens.json",
    "https://ghost-ui.com/r/foundation.json",
    "https://ghost-ui.com/r/tooltip.json"
  ],
  "files": [
    {
      "path": "src/components/ui/textarea.tsx",
      "type": "registry:component",
      "target": "@ui/textarea.tsx",
      "content": "\"use client\";\n\nimport \"./foundation.css\";\nimport * as React from \"react\";\nimport { ResizeGripFrame, TextareaControl, TouchResizeHandle, syncResizeGripFrame } from \"./internal/textarea-control\";\nimport \"./textarea.css\";\n\n/**\n * A general-purpose native multiline control. Labels and business rules stay\n * with Field or the caller; this component only owns textarea presentation.\n * Compose Base UI Field.Control around it when field registration is needed.\n */\nexport type TextareaVariant = \"outline\" | \"ghost\" | \"subtle\";\nexport type TextareaResizeGrip = \"dashed\" | \"inset\" | \"none\";\ntype TextareaControlProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n  /** Visual boundary. `outline` is the default field; `ghost` blends into copy; `subtle` uses a quiet fill. */\n  variant?: TextareaVariant;\n  \"data-variant\"?: TextareaVariant;\n};\nexport type TextareaProps = TextareaControlProps & {\n  /** Choose the native resize corner mark. */\n  resizeGrip?: TextareaResizeGrip;\n};\n\nexport const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(\n  function Textarea({ resizeGrip, className, style, ...props }, ref) {\n    const variant = props.variant ?? props[\"data-variant\"] ?? \"outline\";\n    const effectiveGrip = resizeGrip ?? (variant === \"ghost\" ? \"none\" : \"dashed\");\n    const shellRef = React.useRef<HTMLSpanElement>(null);\n    const controlRef = React.useRef<HTMLTextAreaElement>(null);\n    const setControlRef = React.useCallback((node: HTMLTextAreaElement | null) => {\n      controlRef.current = node;\n      if (typeof ref === \"function\") ref(node);\n      else if (ref) ref.current = node;\n    }, [ref]);\n    React.useLayoutEffect(() => {\n      const shell = shellRef.current;\n      const control = controlRef.current;\n      if (!shell || !control) return;\n      const syncPaintOffsets = () => syncResizeGripFrame(shell, control);\n      syncPaintOffsets();\n      if (typeof ResizeObserver === \"undefined\") return;\n      const observer = new ResizeObserver(syncPaintOffsets);\n      observer.observe(shell);\n      observer.observe(control);\n      return () => observer.disconnect();\n    }, [variant, className, style]);\n    const shellStyle = {\n      width: style?.width,\n      minWidth: style?.minWidth,\n      maxWidth: style?.maxWidth,\n      inlineSize: style?.inlineSize,\n      minInlineSize: style?.minInlineSize,\n      maxInlineSize: style?.maxInlineSize,\n    } as React.CSSProperties;\n    const { width: _width, inlineSize: _inlineSize, minWidth, maxWidth, minInlineSize, maxInlineSize, ...nativeStyle } = style ?? {};\n    const controlStyle = {\n      ...nativeStyle,\n      ...(minWidth && !String(minWidth).includes(\"%\") ? { minWidth } : {}),\n      ...(maxWidth && !String(maxWidth).includes(\"%\") ? { maxWidth } : {}),\n      ...(minInlineSize && !String(minInlineSize).includes(\"%\") ? { minInlineSize } : {}),\n      ...(maxInlineSize && !String(maxInlineSize).includes(\"%\") ? { maxInlineSize } : {}),\n    } as React.CSSProperties;\n    return <span ref={shellRef} className=\"ui-textarea-shell\" data-variant={variant} data-resize-grip={effectiveGrip} data-resize={style?.resize === \"none\" || props.disabled ? \"none\" : undefined} style={shellStyle}><TextareaControl {...props} variant={variant} className={className} ref={setControlRef} style={controlStyle} /><ResizeGripFrame />{effectiveGrip !== \"none\" && <TouchResizeHandle targetRef={controlRef} />}</span>;\n  },\n);\n\nTextarea.displayName = \"Textarea\";\n"
    },
    {
      "path": "src/components/ui/internal/textarea-control.tsx",
      "type": "registry:component",
      "target": "@ui/internal/textarea-control.tsx",
      "content": "\"use client\";\n\nimport \"../foundation.css\";\nimport * as React from \"react\";\nimport { useNativeResize } from \"@/lib/use-native-resize\";\nimport \"../textarea.css\";\nimport { TooltipHint } from \"../tooltip\";\nimport { useValidationTooltip } from \"../validation-tooltip-internal\";\n\n/** One native-sized frame and inset mark shared by Textarea and InputGroup. */\nexport function ResizeGripFrame() {\n  return <svg aria-hidden=\"true\" className=\"ui-resize-grip-frame\" focusable=\"false\"><rect x=\"0.5\" y=\"0.5\" width=\"calc(100% - 1px)\" height=\"calc(100% - 1px)\" /><g className=\"ui-resize-grip-inset\"><path className=\"ui-resize-grip-inset-arm-vertical\" /><path className=\"ui-resize-grip-inset-bend\" /><path className=\"ui-resize-grip-inset-arm-horizontal\" /></g></svg>;\n}\n\nexport function TouchResizeHandle({ targetRef }: { targetRef: React.RefObject<HTMLTextAreaElement | null> }) {\n  const drag = React.useRef<{\n    pointerId: number;\n    x: number;\n    y: number;\n    width: number;\n    height: number;\n    horizontal: boolean;\n    vertical: boolean;\n  } | null>(null);\n\n  return <span\n    aria-hidden=\"true\"\n    className=\"ui-touch-resize-handle\"\n    onPointerDown={event => {\n      const target = targetRef.current;\n      if (!target || drag.current || !event.isPrimary || event.button !== 0) return;\n      const style = target.ownerDocument.defaultView?.getComputedStyle(target);\n      if (!style || !style.resize || style.resize === \"none\" || target.matches(\":disabled\")) return;\n      const verticalWriting = /^(vertical|sideways)/.test(style.writingMode);\n      const horizontal = [\"both\", \"horizontal\", verticalWriting ? \"block\" : \"inline\"].includes(style.resize);\n      const vertical = [\"both\", \"vertical\", verticalWriting ? \"inline\" : \"block\"].includes(style.resize);\n      const { pointerId, clientX: x, clientY: y } = event;\n      event.preventDefault();\n      event.currentTarget.setPointerCapture(pointerId);\n      drag.current = { pointerId, x, y, width: parseFloat(style.width), height: parseFloat(style.height), horizontal, vertical };\n    }}\n    onPointerMove={event => {\n      const start = drag.current;\n      const target = targetRef.current;\n      if (!start || !target || start.pointerId !== event.pointerId) return;\n      if (start.horizontal) target.style.width = `${Math.max(0, start.width + event.clientX - start.x)}px`;\n      if (start.vertical) target.style.height = `${Math.max(0, start.height + event.clientY - start.y)}px`;\n    }}\n    onLostPointerCapture={event => {\n      if (drag.current?.pointerId === event.pointerId) drag.current = null;\n    }}\n  />;\n}\n\nfunction radiusPixels(value: string, extent: number) {\n  const amount = parseFloat(value);\n  if (!Number.isFinite(amount)) return 0;\n  return value.endsWith(\"%\") ? amount * extent / 100 : amount;\n}\n\nexport function syncResizeGripFrame(host: HTMLElement, field: HTMLElement) {\n  const hostRect = host.getBoundingClientRect();\n  const fieldRect = field.getBoundingClientRect();\n  const view = field.ownerDocument.defaultView;\n  if (!view) return;\n  const computed = view.getComputedStyle(field);\n  if (host.classList.contains(\"ui-textarea-shell\")) {\n    host.toggleAttribute(\"data-touch-resizable\", Boolean(computed.resize && computed.resize !== \"none\" && computed.overflow !== \"visible\" && computed.overflow !== \"clip\"));\n  }\n  const [cornerX = \"0\", cornerY = cornerX] = computed.borderBottomRightRadius.trim().split(/\\s+/);\n  const ghost = host.dataset.variant === \"ghost\";\n  const radiusX = ghost ? 0 : radiusPixels(cornerX, fieldRect.width);\n  const radiusY = ghost ? 0 : radiusPixels(cornerY, fieldRect.height);\n  host.style.setProperty(\"--ui-resize-right-offset\", `${hostRect.right - fieldRect.right}px`);\n  host.style.setProperty(\"--ui-resize-bottom-offset\", `${hostRect.bottom - fieldRect.bottom}px`);\n  host.style.setProperty(\"--ui-resize-frame-width\", `${fieldRect.width}px`);\n  host.style.setProperty(\"--ui-resize-frame-height\", `${fieldRect.height}px`);\n  host.style.setProperty(\"--ui-resize-native-radius-x\", `${radiusPixels(cornerX, fieldRect.width)}px`);\n  host.style.setProperty(\"--ui-resize-native-radius-y\", `${radiusPixels(cornerY, fieldRect.height)}px`);\n  const inset = host.querySelector<SVGGElement>(\".ui-resize-grip-inset\");\n  if (inset) {\n    const borderRight = parseFloat(computed.borderRightWidth) || 0;\n    const borderBottom = parseFloat(computed.borderBottomWidth) || 0;\n    const strokeHalf = 2;\n    const gap = ghost ? 4 : Math.min(4, Math.max(0, Math.min(radiusX - borderRight - strokeHalf - 0.5, radiusY - borderBottom - strokeHalf - 0.5)));\n    // Keep the quarter bend drawable when the native radius cannot fit the inset stroke.\n    const bendX = Math.max(0.5, radiusX - borderRight - strokeHalf - gap);\n    const bendY = Math.max(0.5, radiusY - borderBottom - strokeHalf - gap);\n    const insetX = borderRight + gap + strokeHalf;\n    const insetY = borderBottom + gap + strokeHalf;\n    const tangentX = fieldRect.width - insetX - bendX;\n    const tangentY = fieldRect.height - insetY - bendY;\n    const arm = 5;\n    inset.querySelector(\".ui-resize-grip-inset-arm-vertical\")?.setAttribute(\"d\", ghost ? \"\" : `M ${fieldRect.width - insetX} ${tangentY} V ${tangentY - arm}`);\n    inset.querySelector(\".ui-resize-grip-inset-bend\")?.setAttribute(\"d\", ghost ? \"\" : `M ${fieldRect.width - insetX} ${tangentY} A ${bendX} ${bendY} 0 0 1 ${tangentX} ${fieldRect.height - insetY}`);\n    inset.querySelector(\".ui-resize-grip-inset-arm-horizontal\")?.setAttribute(\"d\", ghost\n      ? `M ${fieldRect.width - insetX} ${fieldRect.height - insetY} H ${fieldRect.width - insetX - 16}`\n      : `M ${tangentX} ${fieldRect.height - insetY} H ${tangentX - arm}`);\n  }\n}\n\ntype TextareaControlProps = React.TextareaHTMLAttributes<HTMLTextAreaElement> & {\n  variant?: \"outline\" | \"ghost\" | \"subtle\";\n  \"data-variant\"?: \"outline\" | \"ghost\" | \"subtle\";\n};\n\n/** Internal native control for compositions whose outer owner paints the resize grip. */\nexport const TextareaControl = React.forwardRef<HTMLTextAreaElement, TextareaControlProps>(\n  function TextareaControl({ className, rows = 4, ...props }, ref) {\n    const { variant: variantProp, \"data-variant\": dataVariant, onPointerDown, style, ...nativeProps } = props;\n    const variant = variantProp ?? dataVariant ?? \"outline\";\n    const nativeResize = useNativeResize(onPointerDown, !nativeProps.disabled);\n    const validation = useValidationTooltip<HTMLTextAreaElement>(nativeProps);\n    const rowStyle = { \"--ui-textarea-rows\": rows, ...style } as React.CSSProperties;\n    return <TooltipHint content={validation.message} open={Boolean(validation.message)} onOpenChange={validation.onOpenChange}><textarea ref={ref} rows={rows} style={rowStyle} className={[\"ui-textarea\", className].filter(Boolean).join(\" \")} data-variant={variant} data-resize={style?.resize === \"none\" || nativeProps.disabled ? \"none\" : undefined} data-resizing={nativeResize.resizing || undefined} onPointerDown={nativeResize.onPointerDown} {...nativeProps} {...validation.handlers} aria-invalid={nativeProps[\"aria-invalid\"] ?? (validation.message ? true : undefined)} /></TooltipHint>;\n  },\n);\n"
    },
    {
      "path": "src/components/ui/textarea.css",
      "type": "registry:file",
      "target": "@ui/textarea.css",
      "content": "@import \"./tokens.css\";\n@import \"./resize-grip.css\";\n\n.ui-textarea {\n  --ui-textarea-stroke: var(--input);\n  --ui-resize-color: var(--muted-foreground);\n  --ui-resize-outline: var(--ui-textarea-stroke);\n  --ui-resize-length: var(--space-4);\n  --ui-resize-surface: var(--background);\n  --ui-textarea-min-height: calc(var(--ui-textarea-rows, 4) * 1lh + var(--space-2) + 2px);\n  --ui-input-placeholder-color: var(--input-placeholder-color);\n  display: block;\n  width: 100%;\n  min-width: 0;\n  height: auto;\n  box-sizing: border-box;\n  min-height: var(--ui-textarea-min-height);\n  padding: var(--space-1) var(--space-2);\n  border: 1px solid var(--ui-textarea-stroke);\n  border-radius: var(--radius-lg);\n  background: var(--background);\n  color: var(--foreground);\n  caret-color: var(--foreground);\n  font: var(--font-size-base)/var(--leading-copy) var(--font-sans, \"IBM Plex Sans\", sans-serif);\n  resize: vertical;\n}\n\n.ui-textarea-shell {\n  --ui-resize-color: var(--muted-foreground);\n  --ui-resize-outline: var(--input);\n  --ui-resize-length: var(--space-4);\n  --ui-resize-surface: var(--background);\n  display: block;\n  position: relative;\n  width: 100%;\n  min-width: 0;\n  box-sizing: border-box;\n}\n.ui-text-input-group:is([data-layout=\"multiline\"], [data-layout=\"floating\"]) {\n  --ui-resize-color: var(--muted-foreground);\n  --ui-resize-outline: var(--input);\n  --ui-resize-length: var(--space-4);\n  --ui-resize-surface: var(--background);\n  position: relative;\n}\n.ui-text-input-group-shell[data-layout] {\n  --ui-resize-color: var(--muted-foreground);\n  --ui-resize-outline: var(--input);\n  --ui-resize-length: var(--space-4);\n  --ui-resize-surface: var(--background);\n  display: block;\n  position: relative;\n  width: 100%;\n  min-width: 0;\n  box-sizing: border-box;\n}\n.ui-text-input-group-shell[data-resize-grip=\"none\"][data-resize=\"none\"] { display: contents; }\n.ui-text-input-group-shell[data-variant=\"ghost\"] { --ui-resize-surface: transparent; }\n.ui-text-input-group-shell:has(.ui-textarea[readonly]) { --ui-resize-surface: var(--card); }\n.ui-text-input-group-shell:focus-within { --ui-resize-color: var(--primary); --ui-resize-outline: var(--input-focus-border-color); --ui-inset-grip-color: var(--primary); }\n.ui-text-input-group-shell:has(.ui-input[aria-invalid=\"true\"], .ui-input[data-invalid], .ui-textarea[aria-invalid=\"true\"], .ui-textarea[data-invalid]) { --ui-resize-color: var(--destructive, var(--color-warning)); --ui-resize-outline: var(--destructive, var(--color-warning)); --ui-inset-grip-color: var(--destructive, var(--color-warning)); }\n.ui-text-input-group:is([data-layout=\"multiline\"], [data-layout=\"floating\"]):focus-within { --ui-resize-color: var(--primary); --ui-resize-outline: var(--input-focus-border-color); --ui-inset-grip-color: var(--primary); }\n.ui-text-input-group:is([data-layout=\"multiline\"], [data-layout=\"floating\"]):has(.ui-input[aria-invalid=\"true\"], .ui-input[data-invalid], .ui-textarea[aria-invalid=\"true\"], .ui-textarea[data-invalid]) { --ui-resize-color: var(--destructive, var(--color-warning)); --ui-resize-outline: var(--destructive, var(--color-warning)); --ui-inset-grip-color: var(--destructive, var(--color-warning)); }\n.ui-text-input-group[data-layout][data-variant=\"ghost\"] { --ui-resize-surface: transparent; }\n.ui-text-input-group:has(> .ui-textarea[readonly]) { --ui-resize-surface: var(--card); }\n.ui-textarea-shell::before,\n.ui-textarea-shell::after,\n.ui-text-input-group-shell[data-layout]::before,\n.ui-text-input-group-shell[data-layout]::after {\n  content: \"\";\n  position: absolute;\n  z-index: 1;\n  pointer-events: none;\n}\n.ui-textarea-shell[data-resize-grip=\"dashed\"]::before,\n.ui-text-input-group-shell[data-resize-grip=\"dashed\"]::before {\n  right: var(--ui-resize-right-offset, 0px);\n  bottom: var(--ui-resize-bottom-offset, 0px);\n  width: var(--ui-resize-length);\n  height: var(--ui-resize-length);\n  box-sizing: border-box;\n  border-right: 1px solid var(--ui-resize-surface);\n  border-bottom: 1px solid var(--ui-resize-surface);\n  border-bottom-right-radius: var(--ui-resize-native-radius-x, var(--ui-input-group-radius, var(--radius-lg, 12px)));\n  transition: width var(--ui-resize-duration) var(--ui-resize-easing), height var(--ui-resize-duration) var(--ui-resize-easing);\n}\n.ui-resize-grip-frame {\n  position: absolute;\n  z-index: 2;\n  right: var(--ui-resize-right-offset, 0px);\n  bottom: var(--ui-resize-bottom-offset, 0px);\n  width: var(--ui-resize-frame-width, 100%);\n  height: var(--ui-resize-frame-height, 100%);\n  overflow: visible;\n  color: var(--ui-resize-color);\n  pointer-events: none;\n}\n.ui-resize-grip-frame > rect {\n  display: none;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 1px;\n  stroke-dasharray: 3 3;\n  rx: max(0px, calc(var(--ui-resize-cue-radius, var(--ui-resize-native-radius-x, var(--radius-lg, 12px))) - 0.5px));\n  ry: max(0px, calc(var(--ui-resize-cue-radius, var(--ui-resize-native-radius-y, var(--radius-lg, 12px))) - 0.5px));\n  clip-path: polygon(100% calc(100% - var(--ui-resize-length)), 100% 100%, calc(100% - var(--ui-resize-length)) 100%);\n}\n.ui-resize-grip-frame > .ui-resize-grip-inset {\n  display: none;\n  fill: none;\n  stroke: var(--ui-inset-grip-color, var(--ui-resize-outline));\n  stroke-width: 4px;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n.ui-resize-grip-inset > .ui-resize-grip-inset-arm-vertical,\n.ui-resize-grip-inset > .ui-resize-grip-inset-arm-horizontal {\n  stroke-dasharray: var(--ui-inset-grip-arm-length, 3px) 1000px;\n  transition: stroke-dasharray var(--ui-resize-duration) var(--ui-resize-easing);\n}\n.ui-textarea-shell[data-resize-grip=\"dashed\"] > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-resize-grip=\"dashed\"] > .ui-resize-grip-frame > rect { display: block; }\n.ui-textarea-shell[data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset,\n.ui-text-input-group-shell[data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset { display: block; }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"] > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"] > .ui-resize-grip-frame > rect,\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset { display: none; }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"],\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"] { --ui-resize-length: 21px; }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"] > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"] > .ui-resize-grip-frame > rect { stroke-dashoffset: calc(2px - var(--ui-resize-frame-width, 0px) - var(--ui-resize-frame-height, 0px)); }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"]:has(> .ui-textarea:hover, > .ui-textarea:focus) > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"]:has(.ui-textarea:hover, .ui-textarea:focus):not(:has(.ui-textarea:disabled)) > .ui-resize-grip-frame > rect,\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"]:has(> .ui-textarea:hover, > .ui-textarea:focus) > .ui-resize-grip-frame > .ui-resize-grip-inset,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"]:has(.ui-textarea:hover, .ui-textarea:focus):not(:has(.ui-textarea:disabled)) > .ui-resize-grip-frame > .ui-resize-grip-inset { display: block; }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"]:has(> .ui-textarea:hover),\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"]:has(.ui-textarea:hover) { --ui-resize-length: 21px; }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset { --ui-inset-grip-arm-length: 10px; }\n.ui-textarea-shell[data-resize-grip=\"inset\"]:has(> .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-resize-grip=\"inset\"][data-resizing=\"true\"] > .ui-resize-grip-frame > rect,\n.ui-textarea-shell[data-resize-grip=\"none\"]:has(> .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-resize-grip=\"none\"][data-resizing=\"true\"] > .ui-resize-grip-frame > rect { display: block; }\n.ui-textarea-shell:has(> .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-resizing=\"true\"] > .ui-resize-grip-frame > rect { clip-path: none; }\n.ui-textarea-shell[data-variant=\"ghost\"]:has(> .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resizing=\"true\"] > .ui-resize-grip-frame > rect { clip-path: inset(calc(100% - 1px) 0 0 0); }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"] > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"] > .ui-resize-grip-frame > rect { clip-path: inset(calc(100% - 1px) 0 0 calc(100% - var(--ui-resize-length))); }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"]:has(> .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > rect,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"][data-resizing=\"true\"] > .ui-resize-grip-frame > rect { display: block; clip-path: inset(calc(100% - 1px) 0 0 0); }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"]:has(> .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > .ui-resize-grip-inset,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"][data-resizing=\"true\"] > .ui-resize-grip-frame > .ui-resize-grip-inset { display: block; --ui-inset-grip-arm-length: 14px; }\n.ui-textarea-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"]:has(> .ui-textarea:hover, > .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > .ui-resize-grip-inset,\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"inset\"]:has(.ui-textarea:hover, .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > .ui-resize-grip-inset { --ui-inset-grip-arm-length: 14px; }\n.ui-textarea-shell[data-resize=\"none\"] > .ui-resize-grip-frame,\n.ui-text-input-group-shell[data-resize=\"none\"] > .ui-resize-grip-frame,\n.ui-text-input-group-shell:has(.ui-textarea:disabled) > .ui-resize-grip-frame { display: none; }\n\n.ui-touch-resize-handle { display: none; width: var(--space-6); height: var(--space-6); }\n@media (pointer: coarse) {\n  .ui-textarea-shell[data-touch-resizable]:not([data-resize=\"none\"], :has(.ui-textarea:disabled)) > .ui-touch-resize-handle {\n    display: block;\n    position: absolute;\n    z-index: 3;\n    right: var(--ui-resize-right-offset, 0px);\n    bottom: var(--ui-resize-bottom-offset, 0px);\n    touch-action: none;\n    -webkit-user-select: none;\n    user-select: none;\n  }\n\n  .ui-textarea-shell[data-touch-resizable][data-variant=\"ghost\"][data-resize-grip=\"dashed\"]:where(:not([data-resize=\"none\"], :has(.ui-textarea:disabled))) > .ui-resize-grip-frame > rect,\n  .ui-textarea-shell[data-touch-resizable][data-variant=\"ghost\"][data-resize-grip=\"inset\"]:where(:not([data-resize=\"none\"], :has(.ui-textarea:disabled))) > .ui-resize-grip-frame > .ui-resize-grip-inset { display: block; }\n}\n\n\n.ui-textarea-shell[data-variant=\"ghost\"] { --ui-resize-surface: transparent; }\n.ui-textarea-shell:has(> .ui-textarea[readonly]) { --ui-resize-surface: var(--card); }\n.ui-textarea-shell:has(> .ui-textarea:focus) { --ui-resize-color: var(--primary); --ui-resize-outline: var(--primary); --ui-inset-grip-color: var(--primary); }\n.ui-textarea-shell:has(> .ui-textarea[aria-invalid=\"true\"], > .ui-textarea[data-invalid]) { --ui-resize-color: var(--destructive, var(--color-warning)); --ui-resize-outline: var(--destructive, var(--color-warning)); --ui-inset-grip-color: var(--destructive, var(--color-warning)); }\n.ui-textarea-shell[data-resize-grip=\"inset\"]:has(> .ui-textarea[data-resizing=\"true\"]) > .ui-resize-grip-frame > .ui-resize-grip-inset,\n.ui-text-input-group-shell[data-resize-grip=\"inset\"][data-resizing=\"true\"] > .ui-resize-grip-frame > .ui-resize-grip-inset { --ui-inset-grip-arm-length: 5px; stroke: color-mix(in oklab, var(--ui-resize-outline) 82%, var(--foreground) 18%); }\n.ui-textarea-shell[data-resize=\"none\"]::before,\n.ui-textarea-shell[data-resize=\"none\"]::after,\n.ui-text-input-group-shell[data-resize=\"none\"]::before,\n.ui-text-input-group-shell[data-resize=\"none\"]::after,\n.ui-textarea-shell[data-resize-grip=\"dashed\"]:has(> .ui-textarea[data-resizing=\"true\"])::before,\n.ui-text-input-group-shell[data-resize-grip=\"dashed\"][data-resizing=\"true\"]::before,\n.ui-text-input-group-shell:has(.ui-textarea:disabled)::before,\n.ui-text-input-group-shell:has(.ui-textarea:disabled)::after { display: none; }\n.ui-text-input-group-shell[data-variant=\"ghost\"][data-resize-grip=\"dashed\"]::before { display: none; }\n\n@media (hover: hover) {\n  .ui-textarea-shell[data-resize-grip=\"dashed\"]:where(:hover):where(:not([data-resize=\"none\"])),\n  .ui-text-input-group-shell[data-resize-grip=\"dashed\"]:where(:hover):where(:not([data-resize=\"none\"])):where(:not(:has(.ui-textarea:disabled))) { --ui-resize-length: var(--space-8); }\n  .ui-textarea-shell[data-resize-grip=\"inset\"]:where(:hover):where(:not([data-resize=\"none\"])) > .ui-resize-grip-frame > .ui-resize-grip-inset,\n  .ui-text-input-group-shell[data-resize-grip=\"inset\"]:where(:hover):where(:not([data-resize=\"none\"])):where(:not(:has(.ui-textarea:disabled))) > .ui-resize-grip-frame > .ui-resize-grip-inset { --ui-inset-grip-arm-length: 5px; }\n}\n\n/* Field.Control's input class must not replace native textarea row sizing. */\n.ui-textarea.ui-input:not(.ui-text-input-group-control) {\n  height: auto;\n  min-height: var(--ui-textarea-min-height);\n}\n.ui-field > .ui-textarea-shell > .ui-textarea { line-height: 20px; }\n\n.ui-textarea::-webkit-resizer,\n.ui-text-input-group:is([data-layout=\"multiline\"], [data-layout=\"floating\"])::-webkit-resizer {\n  background: none;\n  border: 0;\n}\n\n.ui-textarea[data-variant=\"ghost\"] {\n  --ui-textarea-min-height: calc(var(--ui-textarea-rows, 4) * 1lh);\n  --ui-resize-surface: transparent;\n  --ui-resize-outline: transparent;\n  background: transparent;\n  padding: 0;\n  border-width: 0;\n  border-radius: 0;\n  border-color: transparent;\n  color: var(--muted-foreground);\n}\n\n.ui-textarea::placeholder {\n  color: var(--ui-input-placeholder-color);\n  opacity: 1;\n}\n\n@media (hover: hover) {\n  .ui-textarea:where(:enabled:hover):where(:not(:focus):not(:focus-visible)) {\n    --ui-input-placeholder-color: var(--muted-foreground);\n  }\n  .ui-textarea[data-variant=\"ghost\"]:hover:where(:not(:disabled):not([readonly])) {\n    color: var(--foreground);\n  }\n}\n\n.ui-textarea[data-variant=\"subtle\"] {\n  --ui-input-subtle-fill: var(--secondary);\n  --ui-input-subtle-edge: color-mix(in oklab, var(--secondary) 50%, var(--input));\n  --ui-input-disabled-subtle-background: var(--input);\n  background: var(--ui-input-subtle-fill);\n  border-color: transparent;\n}\n@supports (color: light-dark(white, black)) {\n  .ui-textarea[data-variant=\"subtle\"] {\n    --ui-input-subtle-edge: light-dark(\n      color-mix(in oklab, var(--palette-100) 50%, var(--palette-200)),\n      color-mix(in oklab, var(--palette-800) 50%, var(--palette-700))\n    );\n    --ui-input-disabled-subtle-background: light-dark(var(--palette-200), var(--palette-800));\n  }\n}\n@media (hover: hover) {\n  .ui-textarea[data-variant=\"subtle\"]:enabled:hover:where(:not(:focus):not(:focus-visible):not([readonly]):not([aria-invalid=\"true\"]):not([data-invalid])) { background: var(--ui-input-subtle-edge); }\n}\n.ui-textarea[data-variant=\"subtle\"]:focus,\n.ui-textarea[data-variant=\"subtle\"]:focus-visible { background: var(--ui-input-subtle-fill); border-color: var(--ui-input-subtle-edge); outline: none; box-shadow: none; }\n.ui-textarea[data-variant=\"subtle\"][aria-invalid=\"true\"],\n.ui-textarea[data-variant=\"subtle\"][data-invalid] { background: var(--ui-input-subtle-fill); border-color: var(--destructive, var(--color-warning)); }\n.ui-text-input-group[data-variant=\"subtle\"] > .ui-textarea { background: transparent; border-color: transparent; }\n\n.ui-textarea[data-variant]:focus,\n.ui-textarea[data-variant]:focus-visible {\n  --ui-textarea-stroke: var(--primary);\n  --ui-resize-color: var(--primary);\n  --ui-input-placeholder-color: color-mix(in oklab, var(--muted-foreground) 80%, var(--foreground));\n  border-color: var(--primary);\n  outline: none;\n  box-shadow: none;\n}\n.ui-textarea[data-variant=\"ghost\"]:focus,\n.ui-textarea[data-variant=\"ghost\"]:focus-visible {\n  border-color: transparent;\n  color: var(--foreground);\n  caret-color: var(--foreground);\n}\n\n.ui-textarea[aria-invalid=\"true\"],\n.ui-textarea[data-invalid] {\n  --ui-textarea-stroke: var(--destructive, var(--color-warning));\n  --ui-resize-color: var(--destructive, var(--color-warning));\n  border-color: var(--destructive, var(--color-warning));\n}\n\n.ui-textarea[aria-invalid=\"true\"]:focus,\n.ui-textarea[aria-invalid=\"true\"]:focus-visible,\n.ui-textarea[data-invalid]:focus,\n.ui-textarea[data-invalid]:focus-visible {\n  border-color: var(--destructive, var(--color-warning));\n  outline: none;\n  box-shadow: none;\n}\n.ui-textarea[data-variant=\"ghost\"][aria-invalid=\"true\"],\n.ui-textarea[data-variant=\"ghost\"][data-invalid],\n.ui-textarea.ui-input[data-variant=\"ghost\"][aria-invalid=\"true\"],\n.ui-textarea.ui-input[data-variant=\"ghost\"][data-invalid] {\n  border-bottom-width: 1px;\n  border-color: var(--destructive, var(--color-warning));\n}\n.ui-textarea[data-variant=\"ghost\"][aria-invalid=\"true\"]:focus,\n.ui-textarea[data-variant=\"ghost\"][data-invalid]:focus,\n.ui-textarea[data-variant=\"ghost\"][aria-invalid=\"true\"]:focus-visible,\n.ui-textarea[data-variant=\"ghost\"][data-invalid]:focus-visible {\n  border-color: var(--destructive, var(--color-warning));\n}\n\n.ui-textarea[readonly]:where(:not([data-variant=\"ghost\"])) {\n  --ui-resize-surface: var(--card);\n  background: var(--card);\n}\n\n.ui-textarea:disabled {\n  cursor: not-allowed;\n  opacity: 0.5;\n}\n\n.ui-textarea[data-variant][data-resizing=\"true\"]:not(.ui-text-input-group-control),\n.ui-text-input-group:is([data-layout=\"multiline\"], [data-layout=\"floating\"])[data-resizing=\"true\"] {\n  border-color: transparent;\n  background: var(--ui-resize-surface, var(--background)) padding-box;\n  box-shadow: none;\n  transition: none;\n}\n\n.ui-textarea[data-resize=\"none\"],\n.ui-text-input-group[data-resize=\"none\"],\n.ui-text-input-group:has(> :disabled) {\n  --ui-resize-length: 0px;\n  --ui-resize-bottom-length: 0px;\n}\n.ui-text-input-group:has(> .ui-textarea:disabled) { resize: none; }\n\n@media (prefers-reduced-motion: reduce) {\n  .ui-textarea-shell::before,\n  .ui-textarea-shell::after,\n  .ui-text-input-group-shell:is([data-layout=\"multiline\"], [data-layout=\"floating\"])::before,\n  .ui-text-input-group-shell:is([data-layout=\"multiline\"], [data-layout=\"floating\"])::after,\n.ui-text-input-group-shell:is([data-layout=\"multiline\"], [data-layout=\"floating\"]) { transition: none; }\n  .ui-textarea-shell[data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset > .ui-resize-grip-inset-arm-vertical,\n  .ui-textarea-shell[data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset > .ui-resize-grip-inset-arm-horizontal,\n  .ui-text-input-group-shell[data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset > .ui-resize-grip-inset-arm-vertical,\n  .ui-text-input-group-shell[data-resize-grip=\"inset\"] > .ui-resize-grip-frame > .ui-resize-grip-inset > .ui-resize-grip-inset-arm-horizontal { transition: none; }\n}\n\n@media (pointer: coarse) {\n  .ui-textarea { font-size: max(16px, 1em); }\n}\n\n/* Error outranks focus in Textarea's existing validation boundary. */\n.ui-textarea[data-variant=\"subtle\"]:focus,\n.ui-textarea[data-variant=\"subtle\"]:focus-visible { background: var(--ui-input-subtle-fill); border-color: var(--ui-input-subtle-edge); }\n.ui-textarea[data-variant=\"subtle\"][aria-invalid=\"true\"]:is(:focus, :focus-visible),\n.ui-textarea[data-variant=\"subtle\"][data-invalid]:is(:focus, :focus-visible) { border-color: var(--destructive, var(--color-warning)); }\n.ui-textarea[data-variant=\"subtle\"][readonly] { background: var(--card); }\n.ui-textarea[data-variant=\"subtle\"]:disabled { background: var(--ui-input-disabled-subtle-background); border-color: transparent; opacity: 1; }\n"
    },
    {
      "path": "src/components/ui/resize-grip.css",
      "type": "registry:file",
      "target": "@ui/resize-grip.css",
      "content": "/* Shared appearance for panel and native-field resize indicators. */\n:where(.ui-resizable-handle, .ui-textarea, .ui-textarea-shell, .ui-text-input-group-shell, .ui-text-input-group, .ui-table__resize-handle, .ui-data-grid__resize) {\n  --ui-resize-grip-weight: 2px;\n  --ui-resize-grip-cap: calc(var(--ui-resize-grip-weight) / 2);\n  --ui-resize-duration: 180ms;\n  --ui-resize-easing: ease-out;\n}\n\n/* Root cause guard: the library owns touch-action inline, but text selection\n   is host-owned. Suppress selection/callout on every resize handle so a\n   mobile drag moves the panel instead of selecting nearby text. */\n:where(.ui-resizable-handle, .ui-table__resize-handle, .ui-data-grid__resize) {\n  touch-action: none;\n  user-select: none;\n  -webkit-user-select: none;\n  -webkit-touch-callout: none;\n  -webkit-tap-highlight-color: transparent;\n}\n\n/* While any separator is dragged, the surrounding surface must not select. */\n:where(\n  .ui-resizable-group:has([data-separator=\"active\"]),\n  .ui-table-wrap:has([data-resizing]),\n  .ui-data-grid:has([data-resizing])\n) {\n  user-select: none;\n  -webkit-user-select: none;\n}\n\n/* Context-free painted line shared by panels, native tables and DataGrid. */\n.ui-resize-grip {\n  display: block;\n  flex: 0 0 auto;\n  width: var(--ui-resize-grip-weight);\n  height: 24px;\n  max-height: 100%;\n  border-radius: 999px;\n  background: var(--muted-foreground);\n  pointer-events: none;\n  transition: width var(--ui-resize-duration) var(--ui-resize-easing), height var(--ui-resize-duration) var(--ui-resize-easing), background var(--ui-resize-duration) var(--ui-resize-easing);\n}\n.ui-resize-grip[data-axis=\"horizontal\"],\n.ui-resizable-handle[aria-orientation=\"horizontal\"] > .ui-resize-grip { width: 24px; max-width: 100%; height: var(--ui-resize-grip-weight); max-height: none; }\n.ui-resize-grip[data-state=\"hover\"],\n.ui-resizable-handle[data-separator=\"hover\"] > .ui-resize-grip { height: 48px; }\n.ui-resize-grip[data-axis=\"horizontal\"][data-state=\"hover\"],\n.ui-resizable-handle[aria-orientation=\"horizontal\"][data-separator=\"hover\"] > .ui-resize-grip { width: 48px; height: var(--ui-resize-grip-weight); }\n.ui-resize-grip[data-state=\"active\"],\n.ui-resizable-handle[data-separator=\"active\"] > .ui-resize-grip { width: 1px; height: 100%; box-sizing: border-box; border-inline-start: 1px dashed var(--primary); border-radius: 0; background: transparent; transition: none; }\n.ui-resize-grip[data-axis=\"horizontal\"][data-state=\"active\"],\n.ui-resizable-handle[aria-orientation=\"horizontal\"][data-separator=\"active\"] > .ui-resize-grip { width: 100%; height: 1px; border-inline-start: 0; border-block-start: 1px dashed var(--primary); }\n:is(.ui-resizable-handle, .ui-table__resize-handle, .ui-data-grid__resize):focus-visible:not([data-separator=\"active\"]) > .ui-resize-grip:not([data-state=\"active\"]) { background: var(--foreground); transition: none; }\n@media (forced-colors: active) {\n  :is(.ui-resizable-handle, .ui-table__resize-handle, .ui-data-grid__resize):focus-visible:not([data-separator=\"active\"]) > .ui-resize-grip:not([data-state=\"active\"]) { background: Highlight; forced-color-adjust: none; }\n}\n@media (prefers-reduced-motion: reduce) { .ui-resize-grip { transition: none; } }\n"
    },
    {
      "path": "src/lib/use-native-resize.ts",
      "type": "registry:lib",
      "target": "@lib/use-native-resize.ts",
      "content": "import { useEffect, useState, type PointerEventHandler } from \"react\";\n\n/** Observe the native corner gesture for presentation only. The browser resizes. */\nexport function useNativeResize<T extends HTMLElement>(onPointerDown?: PointerEventHandler<T>, enabled = true) {\n  const [ownerWindow, setOwnerWindow] = useState<Window | null>(null);\n\n  useEffect(() => {\n    if (!ownerWindow) return;\n    const stop = () => setOwnerWindow(null);\n    const recover = (event: PointerEvent) => { if (event.buttons === 0) stop(); };\n    ownerWindow.addEventListener(\"pointerup\", stop, true);\n    ownerWindow.addEventListener(\"pointercancel\", stop, true);\n    ownerWindow.addEventListener(\"mouseup\", stop, true);\n    ownerWindow.addEventListener(\"blur\", stop);\n    ownerWindow.addEventListener(\"pointermove\", recover, true);\n    return () => {\n      ownerWindow.removeEventListener(\"pointerup\", stop, true);\n      ownerWindow.removeEventListener(\"pointercancel\", stop, true);\n      ownerWindow.removeEventListener(\"mouseup\", stop, true);\n      ownerWindow.removeEventListener(\"blur\", stop);\n      ownerWindow.removeEventListener(\"pointermove\", recover, true);\n    };\n  }, [ownerWindow]);\n\n  const start: PointerEventHandler<T> = (event) => {\n    onPointerDown?.(event);\n    if (!enabled || event.defaultPrevented || event.button !== 0 || event.target !== event.currentTarget) return;\n    const node = event.currentTarget;\n    const view = node.ownerDocument.defaultView;\n    if (!view) return;\n    const style = view.getComputedStyle(node);\n    if (style.resize === \"none\" || !style.resize || style.overflow === \"visible\" || style.overflow === \"clip\") return;\n    const rect = node.getBoundingClientRect();\n    const right = rect.right - (parseFloat(style.borderRightWidth) || 0);\n    const bottom = rect.bottom - (parseFloat(style.borderBottomWidth) || 0);\n    if (event.clientX >= right - 16 && event.clientX <= right && event.clientY >= bottom - 16 && event.clientY <= bottom) setOwnerWindow(view);\n  };\n\n  return { resizing: ownerWindow !== null, onPointerDown: start };\n}\n"
    },
    {
      "path": "src/components/ui/validation-tooltip-internal.ts",
      "type": "registry:component",
      "target": "@ui/validation-tooltip-internal.ts",
      "content": "import * as React from \"react\";\n\ntype Control = HTMLInputElement | HTMLTextAreaElement;\n\nexport function isFirstInvalidControl(control: Control | HTMLSelectElement) {\n  return !control.form || Array.from(control.form.elements).find(element =>\n    \"willValidate\" in element && element.willValidate && \"validity\" in element && !(element.validity as ValidityState).valid,\n  ) === control;\n}\n\n/** Keep native validity and replace only the browser's unstyled bubble. */\nexport function useValidationTooltip<T extends Control>(props: Pick<React.HTMLAttributes<T>, \"onInvalid\" | \"onInput\" | \"onBlur\">, focusTarget?: React.RefObject<HTMLElement | null>) {\n  const [message, setMessage] = React.useState(\"\");\n  const [input, setInput] = React.useState<T | null>(null);\n  const showInvalid = React.useCallback((control: T, event: Pick<Event, \"defaultPrevented\" | \"preventDefault\">) => {\n    if (event.defaultPrevented) return;\n    event.preventDefault();\n    if (!isFirstInvalidControl(control)) { setMessage(\"\"); return; }\n    setMessage(control.validationMessage);\n    (focusTarget?.current ?? control).focus();\n  }, [focusTarget]);\n  React.useEffect(() => {\n    if (!input) return;\n    const invalid = (event: Event) => showInvalid(input, event);\n    const clear = () => setMessage(\"\");\n    input.addEventListener(\"invalid\", invalid);\n    input.addEventListener(\"input\", clear);\n    input.addEventListener(\"change\", clear);\n    return () => {\n      input.removeEventListener(\"invalid\", invalid);\n      input.removeEventListener(\"input\", clear);\n      input.removeEventListener(\"change\", clear);\n    };\n  }, [input, showInvalid]);\n  React.useEffect(() => { if (input?.validity.valid) setMessage(\"\"); });\n  const handlers: typeof props = {\n    onInvalid(event) {\n      props.onInvalid?.(event);\n      showInvalid(event.currentTarget, event);\n    },\n    onInput(event) {\n      setMessage(\"\");\n      props.onInput?.(event);\n    },\n    onBlur(event) {\n      setMessage(\"\");\n      props.onBlur?.(event);\n    },\n  };\n  return {\n    message,\n    inputRef: setInput,\n    onOpenChange: (open: boolean) => { if (!open) setMessage(\"\"); },\n    handlers,\n  };\n}\n"
    }
  ]
}
