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,24 @@
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_SELECT_TAG: "select";
type SelectRenderPropArg = {
disabled: boolean;
hover: boolean;
focus: boolean;
active: boolean;
autofocus: boolean;
invalid: boolean;
};
type SelectPropsWeControl = 'aria-labelledby' | 'aria-describedby';
export type SelectProps<TTag extends ElementType = typeof DEFAULT_SELECT_TAG> = Props<TTag, SelectRenderPropArg, SelectPropsWeControl, {
disabled?: boolean;
invalid?: boolean;
autoFocus?: boolean;
}>;
declare function SelectFn<TTag extends ElementType = typeof DEFAULT_SELECT_TAG>(props: SelectProps<TTag>, ref: Ref<HTMLElement>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
export interface _internal_ComponentSelect extends HasDisplayName {
<TTag extends ElementType = typeof DEFAULT_SELECT_TAG>(props: SelectProps<TTag> & RefProp<typeof SelectFn>): React.JSX.Element;
}
export declare let Select: _internal_ComponentSelect;
export {};

View File

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