Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
// SPDX-License-Identifier: AGPL-3.0-only
// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
// including ports, remain AGPLv3; serving them over a network requires releasing their source.
import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import type { TextareaHTMLAttributes } from "react";
import { forwardRef } from "react";
import { useFormControl } from "./Form/useFormControl";
import { cn } from "./utils/cn";
import { usePhoneAutoFocus } from "./Viewport";
const textareaVariants = cva(
"flex min-h-[2lh] max-h-[10lh] w-full border border-input bg-transparent shadow-xs transition-[color,box-shadow] placeholder:text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 read-only:bg-muted read-only:cursor-not-allowed dark:aria-invalid:ring-destructive/40",
{
variants: {
size: {
sm: "rounded-md px-3 py-1 text-sm max-md:text-base",
md: "rounded-md px-3 py-2 text-sm max-md:text-base",
lg: "rounded-lg px-4 py-3 text-base"
}
},
defaultVariants: {
size: "md"
}
}
);
export interface TextareaProps
extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "size">,
VariantProps<typeof textareaVariants> {}
const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
({ className, size, ...props }, ref) => {
const autoFocus = usePhoneAutoFocus(props.autoFocus);
const { ariaProps } = useFormControl(props);
return (
<textarea
className={cn(textareaVariants({ size }), className)}
ref={ref}
{...props}
{...ariaProps}
autoFocus={autoFocus}
/>
);
}
);
Textarea.displayName = "Textarea";
export { Textarea };