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_BUTTON_TAG: "button";
type ButtonRenderPropArg = {
disabled: boolean;
hover: boolean;
focus: boolean;
active: boolean;
autofocus: boolean;
};
type ButtonPropsWeControl = never;
export type ButtonProps<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG> = Props<TTag, ButtonRenderPropArg, ButtonPropsWeControl, {
disabled?: boolean;
autoFocus?: boolean;
type?: 'button' | 'submit' | 'reset';
}>;
declare function ButtonFn<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: ButtonProps<TTag>, ref: Ref<HTMLElement>): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
export interface _internal_ComponentButton extends HasDisplayName {
<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: ButtonProps<TTag> & RefProp<typeof ButtonFn>): React.JSX.Element;
}
export declare let Button: _internal_ComponentButton;
export {};

View File

@@ -0,0 +1 @@
"use client";import{useFocusRing as y}from"@react-aria/focus";import{useHover as b}from"@react-aria/interactions";import{useActivePress as P}from'../../hooks/use-active-press.js';import{useSlot as B}from'../../hooks/use-slot.js';import{useDisabled as c}from'../../internal/disabled.js';import{forwardRefWithAs as A,mergeProps as g,useRender as _}from'../../utils/render.js';let R="button";function v(s,n){var r;let p=c(),{disabled:e=p||!1,autoFocus:t=!1,...o}=s,{isFocusVisible:a,focusProps:l}=y({autoFocus:t}),{isHovered:u,hoverProps:i}=b({isDisabled:e}),{pressed:T,pressProps:d}=P({disabled:e}),f=g({ref:n,type:(r=o.type)!=null?r:"button",disabled:e||void 0,autoFocus:t},l,i,d),m=B({disabled:e,hover:u,focus:a,active:T,autofocus:t});return _()({ourProps:f,theirProps:o,slot:m,defaultTag:R,name:"Button"})}let L=A(v);export{L as Button};