This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

View File

@@ -0,0 +1,23 @@
import { type ElementType, type Ref } from 'react';
import type { Props } from '../../types.js';
import { type HasDisplayName, type RefProp } from '../../utils/render.js';
declare let DEFAULT_TEXTAREA_TAG: "textarea";
type TextareaRenderPropArg = {
disabled: boolean;
hover: boolean;
focus: boolean;
autofocus: boolean;
invalid: boolean;
};
type TextareaPropsWeControl = 'aria-labelledby' | 'aria-describedby';
export type TextareaProps<TTag extends ElementType = typeof DEFAULT_TEXTAREA_TAG> = Props<TTag, TextareaRenderPropArg, TextareaPropsWeControl, {
disabled?: boolean;
invalid?: boolean;
autoFocus?: boolean;
}>;
declare function TextareaFn<TTag extends ElementType = typeof DEFAULT_TEXTAREA_TAG>(props: TextareaProps<TTag>, ref: Ref<HTMLElement>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
export interface _internal_ComponentTextarea extends HasDisplayName {
<TTag extends ElementType = typeof DEFAULT_TEXTAREA_TAG>(props: TextareaProps<TTag> & RefProp<typeof TextareaFn>): React.JSX.Element;
}
export declare let Textarea: _internal_ComponentTextarea;
export {};

View File

@@ -0,0 +1 @@
"use client";import{useFocusRing as A}from"@react-aria/focus";import{useHover as c}from"@react-aria/interactions";import{useId as E}from'../../hooks/use-id.js';import{useSlot as P}from'../../hooks/use-slot.js';import{useDisabled as R}from'../../internal/disabled.js';import{useProvidedId as g}from'../../internal/id.js';import{forwardRefWithAs as v,mergeProps as _,useRender as D}from'../../utils/render.js';import{useDescribedBy as F}from'../description/description.js';import{useLabelledBy as h}from'../label/label.js';let L="textarea";function H(a,t){let s=E(),l=g(),d=R(),{id:i=l||`headlessui-textarea-${s}`,disabled:e=d||!1,autoFocus:r=!1,invalid:o=!1,...p}=a,n=h(),T=F(),{isFocused:f,focusProps:m}=A({autoFocus:r}),{isHovered:u,hoverProps:b}=c({isDisabled:e}),y=_({ref:t,id:i,"aria-labelledby":n,"aria-describedby":T,"aria-invalid":o?"true":void 0,disabled:e||void 0,autoFocus:r},m,b),x=P({disabled:e,invalid:o,hover:u,focus:f,autofocus:r});return D()({ourProps:y,theirProps:p,slot:x,defaultTag:L,name:"Textarea"})}let M=v(H);export{M as Textarea};