@headlessui/react
Advanced tools
Comparing version 0.0.0-insiders.07c3a61 to 0.0.0-insiders.07c9f1f
@@ -1,79 +0,135 @@ | ||
import React, { Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import { PropsForFeatures } from '../../utils/render'; | ||
interface ComboboxRenderPropArg<T> { | ||
import React, { type ElementType, type Ref } from 'react'; | ||
import { type ByComparator } from '../../hooks/use-by-comparator.js'; | ||
import { type AnchorProps } from '../../internal/floating.js'; | ||
import type { EnsureArray, Props } from '../../types.js'; | ||
import { type HasDisplayName, type PropsForFeatures, type RefProp } from '../../utils/render.js'; | ||
import { type _internal_ComponentLabel } from '../label/label.js'; | ||
declare let DEFAULT_COMBOBOX_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
type ComboboxRenderPropArg<TValue, TActive = TValue> = { | ||
open: boolean; | ||
disabled: boolean; | ||
activeIndex: number | null; | ||
activeOption: T | null; | ||
} | ||
interface InputRenderPropArg { | ||
activeOption: TActive | null; | ||
value: TValue; | ||
}; | ||
export type ComboboxProps<TValue, TMultiple extends boolean | undefined, TTag extends ElementType = typeof DEFAULT_COMBOBOX_TAG> = Props<TTag, ComboboxRenderPropArg<NoInfer<TValue>>, 'value' | 'defaultValue' | 'multiple' | 'onChange' | 'by', { | ||
value?: TMultiple extends true ? EnsureArray<TValue> : TValue; | ||
defaultValue?: TMultiple extends true ? EnsureArray<NoInfer<TValue>> : NoInfer<TValue>; | ||
onChange?(value: TMultiple extends true ? EnsureArray<NoInfer<TValue>> : NoInfer<TValue> | null): void; | ||
by?: ByComparator<TMultiple extends true ? EnsureArray<NoInfer<TValue>>[number] : NoInfer<TValue>>; | ||
/** @deprecated The `<Combobox />` is now nullable default */ | ||
nullable?: boolean; | ||
multiple?: TMultiple; | ||
disabled?: boolean; | ||
form?: string; | ||
name?: string; | ||
immediate?: boolean; | ||
virtual?: { | ||
options: TMultiple extends true ? EnsureArray<NoInfer<TValue>> : NoInfer<TValue>[]; | ||
disabled?: (value: TMultiple extends true ? EnsureArray<NoInfer<TValue>>[number] : NoInfer<TValue>) => boolean; | ||
} | null; | ||
onClose?(): void; | ||
__demoMode?: boolean; | ||
}>; | ||
declare function ComboboxFn<TValue, TTag extends ElementType = typeof DEFAULT_COMBOBOX_TAG>(props: ComboboxProps<TValue, boolean | undefined, TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_INPUT_TAG: "input"; | ||
type InputRenderPropArg = { | ||
open: boolean; | ||
disabled: boolean; | ||
} | ||
declare type InputPropsWeControl = 'id' | 'role' | 'type' | 'aria-labelledby' | 'aria-expanded' | 'aria-activedescendant' | 'onKeyDown' | 'onChange' | 'displayValue'; | ||
interface ButtonRenderPropArg { | ||
hover: boolean; | ||
focus: boolean; | ||
autofocus: boolean; | ||
}; | ||
type InputPropsWeControl = 'aria-activedescendant' | 'aria-autocomplete' | 'aria-controls' | 'aria-expanded' | 'aria-labelledby' | 'disabled' | 'role'; | ||
export type ComboboxInputProps<TTag extends ElementType = typeof DEFAULT_INPUT_TAG, TType = string> = Props<TTag, InputRenderPropArg, InputPropsWeControl, { | ||
defaultValue?: TType; | ||
disabled?: boolean; | ||
displayValue?(item: TType): string; | ||
onChange?(event: React.ChangeEvent<HTMLInputElement>): void; | ||
autoFocus?: boolean; | ||
}>; | ||
declare function InputFn<TTag extends ElementType = typeof DEFAULT_INPUT_TAG, TType = Parameters<typeof ComboboxRoot>[0]['value']>(props: ComboboxInputProps<TTag, TType>, ref: Ref<HTMLInputElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_BUTTON_TAG: "button"; | ||
type ButtonRenderPropArg = { | ||
open: boolean; | ||
active: boolean; | ||
disabled: boolean; | ||
} | ||
declare type ButtonPropsWeControl = 'id' | 'type' | 'tabIndex' | 'aria-haspopup' | 'aria-controls' | 'aria-expanded' | 'aria-labelledby' | 'disabled' | 'onClick' | 'onKeyDown'; | ||
interface LabelRenderPropArg { | ||
value: any; | ||
focus: boolean; | ||
hover: boolean; | ||
}; | ||
type ButtonPropsWeControl = 'aria-controls' | 'aria-expanded' | 'aria-haspopup' | 'aria-labelledby' | 'disabled' | 'tabIndex'; | ||
export type ComboboxButtonProps<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG> = Props<TTag, ButtonRenderPropArg, ButtonPropsWeControl, { | ||
autoFocus?: boolean; | ||
disabled?: boolean; | ||
}>; | ||
declare function ButtonFn<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: ComboboxButtonProps<TTag>, ref: Ref<HTMLButtonElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_OPTIONS_TAG: "div"; | ||
type OptionsRenderPropArg = { | ||
open: boolean; | ||
disabled: boolean; | ||
} | ||
declare type LabelPropsWeControl = 'id' | 'ref' | 'onClick'; | ||
interface OptionsRenderPropArg { | ||
open: boolean; | ||
} | ||
declare type OptionsPropsWeControl = 'aria-activedescendant' | 'aria-labelledby' | 'hold' | 'id' | 'onKeyDown' | 'role' | 'tabIndex'; | ||
option: any; | ||
}; | ||
type OptionsPropsWeControl = 'aria-labelledby' | 'aria-multiselectable' | 'role' | 'tabIndex'; | ||
declare let OptionsRenderFeatures: number; | ||
interface OptionRenderPropArg { | ||
export type ComboboxOptionsProps<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG> = Props<TTag, OptionsRenderPropArg, OptionsPropsWeControl, PropsForFeatures<typeof OptionsRenderFeatures> & { | ||
hold?: boolean; | ||
anchor?: AnchorProps; | ||
portal?: boolean; | ||
modal?: boolean; | ||
transition?: boolean; | ||
}>; | ||
declare function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(props: ComboboxOptionsProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_OPTION_TAG: "div"; | ||
type OptionRenderPropArg = { | ||
focus: boolean; | ||
/** @deprecated use `focus` instead */ | ||
active: boolean; | ||
selected: boolean; | ||
disabled: boolean; | ||
}; | ||
type OptionPropsWeControl = 'role' | 'tabIndex' | 'aria-disabled' | 'aria-selected'; | ||
export type ComboboxOptionProps<TTag extends ElementType = typeof DEFAULT_OPTION_TAG, TType = string> = Props<TTag, OptionRenderPropArg, OptionPropsWeControl, { | ||
disabled?: boolean; | ||
value: TType; | ||
order?: number; | ||
}>; | ||
declare function OptionFn<TTag extends ElementType = typeof DEFAULT_OPTION_TAG, TType = Parameters<typeof ComboboxRoot>[0]['value']>(props: ComboboxOptionProps<TTag, TType>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
export interface _internal_ComponentCombobox extends HasDisplayName { | ||
<TValue, TMultiple extends boolean | undefined = false, TTag extends ElementType = typeof DEFAULT_COMBOBOX_TAG>(props: ComboboxProps<TValue, TMultiple, TTag> & RefProp<typeof ComboboxFn>): JSX.Element; | ||
} | ||
declare type ComboboxOptionPropsWeControl = 'id' | 'role' | 'tabIndex' | 'aria-disabled' | 'aria-selected' | 'onPointerLeave' | 'onMouseLeave' | 'onPointerMove' | 'onMouseMove'; | ||
export declare let Combobox: (<TTag extends React.ElementType<any> = React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>, TType = string>(props: Props<TTag, ComboboxRenderPropArg<TType>, "value" | "name" | "disabled" | "onChange"> & { | ||
value: TType; | ||
onChange(value: TType): void; | ||
disabled?: boolean | undefined; | ||
__demoMode?: boolean | undefined; | ||
name?: string | undefined; | ||
}, ref: React.Ref<TTag>) => JSX.Element) & { | ||
displayName: string; | ||
} & { | ||
Input: (<TTag_1 extends React.ElementType<any> = "input", TType_1 = unknown>(props: Props<TTag_1, InputRenderPropArg, InputPropsWeControl> & { | ||
displayValue?(item: TType_1): string; | ||
onChange(event: React.ChangeEvent<HTMLInputElement>): void; | ||
}, ref: Ref<HTMLInputElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Button: (<TTag_2 extends React.ElementType<any> = "button">(props: Props<TTag_2, ButtonRenderPropArg, ButtonPropsWeControl>, ref: Ref<HTMLButtonElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Label: (<TTag_3 extends React.ElementType<any> = "label">(props: Props<TTag_3, LabelRenderPropArg, LabelPropsWeControl>, ref: Ref<HTMLLabelElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Options: (<TTag_4 extends React.ElementType<any> = "ul">(props: Props<TTag_4, OptionsRenderPropArg, OptionsPropsWeControl> & (({ | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
})) & { | ||
hold?: boolean | undefined; | ||
}, ref: Ref<HTMLUListElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Option: (<TTag_5 extends React.ElementType<any> = "li", TType_2 = unknown>(props: Props<TTag_5, OptionRenderPropArg, "value" | ComboboxOptionPropsWeControl> & { | ||
disabled?: boolean | undefined; | ||
value: TType_2; | ||
}, ref: Ref<HTMLLIElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
export interface _internal_ComponentComboboxButton extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: ComboboxButtonProps<TTag> & RefProp<typeof ButtonFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentComboboxInput extends HasDisplayName { | ||
<TType, TTag extends ElementType = typeof DEFAULT_INPUT_TAG>(props: ComboboxInputProps<TTag, TType> & RefProp<typeof InputFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentComboboxLabel extends _internal_ComponentLabel { | ||
} | ||
export interface _internal_ComponentComboboxOptions extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(props: ComboboxOptionsProps<TTag> & RefProp<typeof OptionsFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentComboboxOption extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_OPTION_TAG, TType = Parameters<typeof ComboboxRoot>[0]['value']>(props: ComboboxOptionProps<TTag, TType> & RefProp<typeof OptionFn>): JSX.Element; | ||
} | ||
declare let ComboboxRoot: _internal_ComponentCombobox; | ||
export declare let ComboboxButton: _internal_ComponentComboboxButton; | ||
export declare let ComboboxInput: _internal_ComponentComboboxInput; | ||
/** @deprecated use `<Label>` instead of `<ComboboxLabel>` */ | ||
export declare let ComboboxLabel: _internal_ComponentComboboxLabel; | ||
export declare let ComboboxOptions: _internal_ComponentComboboxOptions; | ||
export declare let ComboboxOption: _internal_ComponentComboboxOption; | ||
export declare let Combobox: _internal_ComponentCombobox & { | ||
/** @deprecated use `<ComboboxInput>` instead of `<Combobox.Input>` */ | ||
Input: _internal_ComponentComboboxInput; | ||
/** @deprecated use `<ComboboxButton>` instead of `<Combobox.Button>` */ | ||
Button: _internal_ComponentComboboxButton; | ||
/** @deprecated use `<Label>` instead of `<Combobox.Label>` */ | ||
Label: _internal_ComponentComboboxLabel; | ||
/** @deprecated use `<ComboboxOptions>` instead of `<Combobox.Options>` */ | ||
Options: _internal_ComponentComboboxOptions; | ||
/** @deprecated use `<ComboboxOption>` instead of `<Combobox.Option>` */ | ||
Option: _internal_ComponentComboboxOption; | ||
}; | ||
export {}; |
@@ -1,3 +0,4 @@ | ||
import React, { ReactNode, Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import React, { type ElementType, type ReactNode, type Ref } from 'react'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type RefProp } from '../../utils/render.js'; | ||
interface SharedData { | ||
@@ -8,4 +9,6 @@ slot?: {}; | ||
} | ||
export declare function useDescribedBy(): string | undefined; | ||
interface DescriptionProviderProps extends SharedData { | ||
children: ReactNode; | ||
value?: string | undefined; | ||
} | ||
@@ -16,5 +19,9 @@ export declare function useDescriptions(): [ | ||
]; | ||
export declare let Description: (<TTag extends React.ElementType<any> = "p">(props: Props<TTag, {}, "id">, ref: Ref<HTMLParagraphElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
declare let DEFAULT_DESCRIPTION_TAG: "p"; | ||
export type DescriptionProps<TTag extends ElementType = typeof DEFAULT_DESCRIPTION_TAG> = Props<TTag>; | ||
declare function DescriptionFn<TTag extends ElementType = typeof DEFAULT_DESCRIPTION_TAG>(props: DescriptionProps<TTag>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
export interface _internal_ComponentDescription extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_DESCRIPTION_TAG>(props: DescriptionProps<TTag> & RefProp<typeof DescriptionFn>): JSX.Element; | ||
} | ||
export declare let Description: _internal_ComponentDescription; | ||
export {}; |
@@ -1,43 +0,70 @@ | ||
import React, { MutableRefObject, Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import { PropsForFeatures } from '../../utils/render'; | ||
interface DialogRenderPropArg { | ||
import React, { type ElementType, type MutableRefObject, type Ref } from 'react'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type PropsForFeatures, type RefProp } from '../../utils/render.js'; | ||
import { type _internal_ComponentDescription } from '../description/description.js'; | ||
declare let DEFAULT_DIALOG_TAG: "div"; | ||
type DialogRenderPropArg = { | ||
open: boolean; | ||
} | ||
declare type DialogPropsWeControl = 'id' | 'role' | 'aria-modal' | 'aria-describedby' | 'aria-labelledby' | 'onClick'; | ||
}; | ||
type DialogPropsWeControl = 'aria-describedby' | 'aria-labelledby' | 'aria-modal'; | ||
declare let DialogRenderFeatures: number; | ||
interface OverlayRenderPropArg { | ||
export type DialogProps<TTag extends ElementType = typeof DEFAULT_DIALOG_TAG> = Props<TTag, DialogRenderPropArg, DialogPropsWeControl, PropsForFeatures<typeof DialogRenderFeatures> & { | ||
open?: boolean; | ||
onClose(value: boolean): void; | ||
initialFocus?: MutableRefObject<HTMLElement | null>; | ||
role?: 'dialog' | 'alertdialog'; | ||
autoFocus?: boolean; | ||
transition?: boolean; | ||
__demoMode?: boolean; | ||
}>; | ||
declare function DialogFn<TTag extends ElementType = typeof DEFAULT_DIALOG_TAG>(props: DialogProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_PANEL_TAG: "div"; | ||
type PanelRenderPropArg = { | ||
open: boolean; | ||
} | ||
declare type OverlayPropsWeControl = 'id' | 'aria-hidden' | 'onClick'; | ||
interface TitleRenderPropArg { | ||
}; | ||
export type DialogPanelProps<TTag extends ElementType = typeof DEFAULT_PANEL_TAG> = Props<TTag, PanelRenderPropArg, never, { | ||
transition?: boolean; | ||
}>; | ||
declare function PanelFn<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(props: DialogPanelProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_BACKDROP_TAG: "div"; | ||
type BackdropRenderPropArg = { | ||
open: boolean; | ||
}; | ||
export type DialogBackdropProps<TTag extends ElementType = typeof DEFAULT_BACKDROP_TAG> = Props<TTag, BackdropRenderPropArg, never, { | ||
transition?: boolean; | ||
}>; | ||
declare function BackdropFn<TTag extends ElementType = typeof DEFAULT_BACKDROP_TAG>(props: DialogBackdropProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_TITLE_TAG: "h2"; | ||
type TitleRenderPropArg = { | ||
open: boolean; | ||
}; | ||
export type DialogTitleProps<TTag extends ElementType = typeof DEFAULT_TITLE_TAG> = Props<TTag, TitleRenderPropArg>; | ||
declare function TitleFn<TTag extends ElementType = typeof DEFAULT_TITLE_TAG>(props: DialogTitleProps<TTag>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
export interface _internal_ComponentDialog extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_DIALOG_TAG>(props: DialogProps<TTag> & RefProp<typeof DialogFn>): JSX.Element; | ||
} | ||
declare type TitlePropsWeControl = 'id'; | ||
export declare let Dialog: (<TTag extends React.ElementType<any> = "div">(props: Props<TTag, DialogRenderPropArg, DialogPropsWeControl> & (({ | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
})) & { | ||
open?: boolean | undefined; | ||
onClose(value: boolean): void; | ||
initialFocus?: React.MutableRefObject<HTMLElement | null> | undefined; | ||
__demoMode?: boolean | undefined; | ||
}, ref: Ref<HTMLDivElement>) => JSX.Element) & { | ||
displayName: string; | ||
} & { | ||
Overlay: (<TTag_1 extends React.ElementType<any> = "div">(props: Props<TTag_1, OverlayRenderPropArg, OverlayPropsWeControl>, ref: Ref<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Title: (<TTag_2 extends React.ElementType<any> = "h2">(props: Props<TTag_2, TitleRenderPropArg, "id">, ref: Ref<HTMLHeadingElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Description: (<TTag_3 extends React.ElementType<any> = "p">(props: Props<TTag_3, {}, "id">, ref: React.Ref<HTMLParagraphElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
export interface _internal_ComponentDialogPanel extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(props: DialogPanelProps<TTag> & RefProp<typeof PanelFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentDialogBackdrop extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_BACKDROP_TAG>(props: DialogBackdropProps<TTag> & RefProp<typeof BackdropFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentDialogTitle extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_TITLE_TAG>(props: DialogTitleProps<TTag> & RefProp<typeof TitleFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentDialogDescription extends _internal_ComponentDescription { | ||
} | ||
export declare let DialogPanel: _internal_ComponentDialogPanel; | ||
export declare let DialogBackdrop: _internal_ComponentDialogBackdrop; | ||
export declare let DialogTitle: _internal_ComponentDialogTitle; | ||
/** @deprecated use `<Description>` instead of `<DialogDescription>` */ | ||
export declare let DialogDescription: _internal_ComponentDialogDescription; | ||
export declare let Dialog: _internal_ComponentDialog & { | ||
/** @deprecated use `<DialogPanel>` instead of `<Dialog.Panel>` */ | ||
Panel: _internal_ComponentDialogPanel; | ||
/** @deprecated use `<DialogTitle>` instead of `<Dialog.Title>` */ | ||
Title: _internal_ComponentDialogTitle; | ||
/** @deprecated use `<Description>` instead of `<Dialog.Description>` */ | ||
Description: _internal_ComponentDialogDescription; | ||
}; | ||
export {}; |
@@ -1,56 +0,59 @@ | ||
import React, { Ref, MutableRefObject } from 'react'; | ||
import { Props } from '../../types'; | ||
import { PropsForFeatures } from '../../utils/render'; | ||
interface DisclosureRenderPropArg { | ||
import React, { type ElementType, type MutableRefObject, type Ref } from 'react'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type PropsForFeatures, type RefProp } from '../../utils/render.js'; | ||
declare let DEFAULT_DISCLOSURE_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
type DisclosureRenderPropArg = { | ||
open: boolean; | ||
close(focusableElement?: HTMLElement | MutableRefObject<HTMLElement | null>): void; | ||
} | ||
interface ButtonRenderPropArg { | ||
}; | ||
type DisclosurePropsWeControl = never; | ||
export type DisclosureProps<TTag extends ElementType = typeof DEFAULT_DISCLOSURE_TAG> = Props<TTag, DisclosureRenderPropArg, DisclosurePropsWeControl, { | ||
defaultOpen?: boolean; | ||
}>; | ||
declare function DisclosureFn<TTag extends ElementType = typeof DEFAULT_DISCLOSURE_TAG>(props: DisclosureProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_BUTTON_TAG: "button"; | ||
type ButtonRenderPropArg = { | ||
open: boolean; | ||
} | ||
declare type ButtonPropsWeControl = 'id' | 'type' | 'aria-expanded' | 'aria-controls' | 'onKeyDown' | 'onClick'; | ||
interface PanelRenderPropArg { | ||
hover: boolean; | ||
active: boolean; | ||
disabled: boolean; | ||
focus: boolean; | ||
autofocus: boolean; | ||
}; | ||
type ButtonPropsWeControl = 'aria-controls' | 'aria-expanded'; | ||
export type DisclosureButtonProps<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG> = Props<TTag, ButtonRenderPropArg, ButtonPropsWeControl, { | ||
disabled?: boolean; | ||
autoFocus?: boolean; | ||
}>; | ||
declare function ButtonFn<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: DisclosureButtonProps<TTag>, ref: Ref<HTMLButtonElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_PANEL_TAG: "div"; | ||
type PanelRenderPropArg = { | ||
open: boolean; | ||
close: (focusableElement?: HTMLElement | MutableRefObject<HTMLElement | null>) => void; | ||
}; | ||
type DisclosurePanelPropsWeControl = never; | ||
declare let PanelRenderFeatures: number; | ||
export type DisclosurePanelProps<TTag extends ElementType = typeof DEFAULT_PANEL_TAG> = Props<TTag, PanelRenderPropArg, DisclosurePanelPropsWeControl, { | ||
transition?: boolean; | ||
} & PropsForFeatures<typeof PanelRenderFeatures>>; | ||
declare function PanelFn<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(props: DisclosurePanelProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
export interface _internal_ComponentDisclosure extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_DISCLOSURE_TAG>(props: DisclosureProps<TTag> & RefProp<typeof DisclosureFn>): JSX.Element; | ||
} | ||
declare type PanelPropsWeControl = 'id'; | ||
declare let PanelRenderFeatures: number; | ||
export declare let Disclosure: (<TTag extends React.ElementType<any> = React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>>(props: Omit<import("../../types").PropsOf<TTag>, "as" | "children" | "refName" | "className"> & { | ||
as?: TTag | undefined; | ||
children?: React.ReactNode | ((bag: DisclosureRenderPropArg) => React.ReactElement<any, string | React.JSXElementConstructor<any>>); | ||
refName?: string | undefined; | ||
} & (import("../../types").PropsOf<TTag> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: DisclosureRenderPropArg) => string) | undefined; | ||
} : {}) & { | ||
defaultOpen?: boolean | undefined; | ||
}, ref: React.Ref<TTag>) => JSX.Element) & { | ||
displayName: string; | ||
} & { | ||
Button: (<TTag_1 extends React.ElementType<any> = "button">(props: Props<TTag_1, ButtonRenderPropArg, ButtonPropsWeControl>, ref: Ref<HTMLButtonElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Panel: (<TTag_2 extends React.ElementType<any> = "div">(props: Omit<import("../../types").PropsOf<TTag_2>, "id" | ("as" | "children" | "refName" | "className")> & { | ||
as?: TTag_2 | undefined; | ||
children?: React.ReactNode | ((bag: PanelRenderPropArg) => React.ReactElement<any, string | React.JSXElementConstructor<any>>); | ||
refName?: string | undefined; | ||
} & (import("../../types").PropsOf<TTag_2> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: PanelRenderPropArg) => string) | undefined; | ||
} : {}) & (({ | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
})), ref: Ref<HTMLDivElement>) => JSX.Element) & { | ||
displayName: string; | ||
}; | ||
export interface _internal_ComponentDisclosureButton extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: DisclosureButtonProps<TTag> & RefProp<typeof ButtonFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentDisclosurePanel extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(props: DisclosurePanelProps<TTag> & RefProp<typeof PanelFn>): JSX.Element; | ||
} | ||
export declare let DisclosureButton: _internal_ComponentDisclosureButton; | ||
export declare let DisclosurePanel: _internal_ComponentDisclosurePanel; | ||
export declare let Disclosure: _internal_ComponentDisclosure & { | ||
/** @deprecated use `<DisclosureButton>` instead of `<Disclosure.Button>` */ | ||
Button: _internal_ComponentDisclosureButton; | ||
/** @deprecated use `<DisclosurePanel>` instead of `<Disclosure.Panel>` */ | ||
Panel: _internal_ComponentDisclosurePanel; | ||
}; | ||
export {}; |
@@ -1,15 +0,36 @@ | ||
import { ElementType, MutableRefObject, Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
export declare let FocusTrap: (<TTag extends ElementType<any> = "div">(props: Omit<import("../../types").PropsOf<TTag>, "as" | "children" | "refName" | "className"> & { | ||
as?: TTag | undefined; | ||
children?: import("react").ReactNode | ((bag: any) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>); | ||
refName?: string | undefined; | ||
} & (import("../../types").PropsOf<TTag> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: any) => string) | undefined; | ||
} : {}) & { | ||
initialFocus?: MutableRefObject<HTMLElement | null> | undefined; | ||
}, ref: Ref<HTMLElement>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
import React, { type ElementType, type MutableRefObject, type Ref } from 'react'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type RefProp } from '../../utils/render.js'; | ||
type Containers = (() => Iterable<HTMLElement>) | MutableRefObject<Set<MutableRefObject<HTMLElement | null>>>; | ||
declare let DEFAULT_FOCUS_TRAP_TAG: "div"; | ||
export declare enum FocusTrapFeatures { | ||
/** No features enabled for the focus trap. */ | ||
None = 0, | ||
/** Ensure that we move focus initially into the container. */ | ||
InitialFocus = 1, | ||
/** Ensure that pressing `Tab` and `Shift+Tab` is trapped within the container. */ | ||
TabLock = 2, | ||
/** Ensure that programmatically moving focus outside of the container is disallowed. */ | ||
FocusLock = 4, | ||
/** Ensure that we restore the focus when unmounting the focus trap. */ | ||
RestoreFocus = 8, | ||
/** Initial focus should look for the `data-autofocus` */ | ||
AutoFocus = 16 | ||
} | ||
type FocusTrapRenderPropArg = {}; | ||
type FocusTrapPropsWeControl = never; | ||
export type FocusTrapProps<TTag extends ElementType = typeof DEFAULT_FOCUS_TRAP_TAG> = Props<TTag, FocusTrapRenderPropArg, FocusTrapPropsWeControl, { | ||
initialFocus?: MutableRefObject<HTMLElement | null>; | ||
initialFocusFallback?: MutableRefObject<HTMLElement | null>; | ||
features?: FocusTrapFeatures; | ||
containers?: Containers; | ||
}>; | ||
declare function FocusTrapFn<TTag extends ElementType = typeof DEFAULT_FOCUS_TRAP_TAG>(props: FocusTrapProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
export interface _internal_ComponentFocusTrap extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_FOCUS_TRAP_TAG>(props: FocusTrapProps<TTag> & RefProp<typeof FocusTrapFn>): JSX.Element; | ||
} | ||
export declare let FocusTrap: _internal_ComponentFocusTrap & { | ||
/** @deprecated use `FocusTrapFeatures` instead of `FocusTrap.features` */ | ||
features: typeof FocusTrapFeatures; | ||
}; | ||
export {}; |
@@ -6,2 +6,3 @@ export declare enum Keys { | ||
Backspace = "Backspace", | ||
Delete = "Delete", | ||
ArrowLeft = "ArrowLeft", | ||
@@ -8,0 +9,0 @@ ArrowUp = "ArrowUp", |
@@ -1,25 +0,36 @@ | ||
import React, { ReactNode, Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import React, { type ElementType, type ReactNode, type Ref } from 'react'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type RefProp } from '../../utils/render.js'; | ||
interface SharedData { | ||
slot?: {}; | ||
name?: string; | ||
props?: {}; | ||
props?: Record<string, any>; | ||
} | ||
export declare function useLabelContext(): { | ||
value: string | undefined; | ||
register(value: string): () => void; | ||
} & SharedData; | ||
export declare function useLabelledBy(alwaysAvailableIds?: (string | undefined | null)[]): string | undefined; | ||
interface LabelProviderProps extends SharedData { | ||
children: ReactNode; | ||
value?: string | undefined; | ||
} | ||
export declare function useLabels(): [string | undefined, (props: LabelProviderProps) => JSX.Element]; | ||
export declare let Label: (<TTag extends React.ElementType<any> = "label">(props: Omit<import("../../types").PropsOf<TTag>, "id" | ("as" | "children" | "refName" | "className")> & { | ||
as?: TTag | undefined; | ||
children?: React.ReactNode | ((bag: {}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>); | ||
refName?: string | undefined; | ||
} & (import("../../types").PropsOf<TTag> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: {}) => string) | undefined; | ||
} : {}) & { | ||
passive?: boolean | undefined; | ||
}, ref: Ref<HTMLLabelElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
export declare function useLabels({ inherit }?: { | ||
inherit?: boolean | undefined; | ||
}): [ | ||
string | undefined, | ||
(props: LabelProviderProps & { | ||
inherit?: boolean; | ||
}) => JSX.Element | ||
]; | ||
declare let DEFAULT_LABEL_TAG: "label"; | ||
export type LabelProps<TTag extends ElementType = typeof DEFAULT_LABEL_TAG> = Props<TTag> & { | ||
passive?: boolean; | ||
htmlFor?: string; | ||
}; | ||
declare function LabelFn<TTag extends ElementType = typeof DEFAULT_LABEL_TAG>(props: LabelProps<TTag>, ref: Ref<HTMLLabelElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
export interface _internal_ComponentLabel extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_LABEL_TAG>(props: LabelProps<TTag> & RefProp<typeof LabelFn>): JSX.Element; | ||
} | ||
export declare let Label: _internal_ComponentLabel; | ||
export {}; |
@@ -1,64 +0,121 @@ | ||
import React, { Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import { PropsForFeatures } from '../../utils/render'; | ||
interface ListboxRenderPropArg { | ||
import React, { type ElementType, type Ref } from 'react'; | ||
import { type ByComparator } from '../../hooks/use-by-comparator.js'; | ||
import { type AnchorPropsWithSelection } from '../../internal/floating.js'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type PropsForFeatures, type RefProp } from '../../utils/render.js'; | ||
import { type _internal_ComponentLabel } from '../label/label.js'; | ||
declare let DEFAULT_LISTBOX_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
type ListboxRenderPropArg<T> = { | ||
open: boolean; | ||
disabled: boolean; | ||
} | ||
interface ButtonRenderPropArg { | ||
open: boolean; | ||
invalid: boolean; | ||
value: T; | ||
}; | ||
export type ListboxProps<TTag extends ElementType = typeof DEFAULT_LISTBOX_TAG, TType = string, TActualType = TType> = Props<TTag, ListboxRenderPropArg<TType>, 'value' | 'defaultValue' | 'onChange' | 'by' | 'disabled' | 'horizontal' | 'name' | 'multiple', { | ||
value?: TType; | ||
defaultValue?: TType; | ||
onChange?(value: TType): void; | ||
by?: ByComparator<TActualType>; | ||
disabled?: boolean; | ||
invalid?: boolean; | ||
horizontal?: boolean; | ||
form?: string; | ||
name?: string; | ||
multiple?: boolean; | ||
__demoMode?: boolean; | ||
}>; | ||
declare function ListboxFn<TTag extends ElementType = typeof DEFAULT_LISTBOX_TAG, TType = string, TActualType = TType extends (infer U)[] ? U : TType>(props: ListboxProps<TTag, TType, TActualType>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_BUTTON_TAG: "button"; | ||
type ButtonRenderPropArg = { | ||
disabled: boolean; | ||
} | ||
declare type ButtonPropsWeControl = 'id' | 'type' | 'aria-haspopup' | 'aria-controls' | 'aria-expanded' | 'aria-labelledby' | 'disabled' | 'onKeyDown' | 'onClick'; | ||
interface LabelRenderPropArg { | ||
invalid: boolean; | ||
hover: boolean; | ||
focus: boolean; | ||
autofocus: boolean; | ||
open: boolean; | ||
disabled: boolean; | ||
} | ||
declare type LabelPropsWeControl = 'id' | 'ref' | 'onClick'; | ||
interface OptionsRenderPropArg { | ||
active: boolean; | ||
value: any; | ||
}; | ||
type ButtonPropsWeControl = 'aria-controls' | 'aria-expanded' | 'aria-haspopup' | 'aria-labelledby' | 'disabled'; | ||
export type ListboxButtonProps<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG> = Props<TTag, ButtonRenderPropArg, ButtonPropsWeControl, { | ||
autoFocus?: boolean; | ||
disabled?: boolean; | ||
}>; | ||
declare function ButtonFn<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: ListboxButtonProps<TTag>, ref: Ref<HTMLButtonElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_OPTIONS_TAG: "div"; | ||
type OptionsRenderPropArg = { | ||
open: boolean; | ||
} | ||
declare type OptionsPropsWeControl = 'aria-activedescendant' | 'aria-labelledby' | 'aria-orientation' | 'id' | 'onKeyDown' | 'role' | 'tabIndex'; | ||
}; | ||
type OptionsPropsWeControl = 'aria-activedescendant' | 'aria-labelledby' | 'aria-multiselectable' | 'aria-orientation' | 'role' | 'tabIndex'; | ||
declare let OptionsRenderFeatures: number; | ||
interface OptionRenderPropArg { | ||
export type ListboxOptionsProps<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG> = Props<TTag, OptionsRenderPropArg, OptionsPropsWeControl, { | ||
anchor?: AnchorPropsWithSelection; | ||
portal?: boolean; | ||
modal?: boolean; | ||
transition?: boolean; | ||
} & PropsForFeatures<typeof OptionsRenderFeatures>>; | ||
declare function OptionsFn<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(props: ListboxOptionsProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_OPTION_TAG: "div"; | ||
type OptionRenderPropArg = { | ||
/** @deprecated use `focus` instead */ | ||
active: boolean; | ||
focus: boolean; | ||
selected: boolean; | ||
disabled: boolean; | ||
selectedOption: boolean; | ||
}; | ||
type OptionPropsWeControl = 'aria-disabled' | 'aria-selected' | 'role' | 'tabIndex'; | ||
export type ListboxOptionProps<TTag extends ElementType = typeof DEFAULT_OPTION_TAG, TType = string> = Props<TTag, OptionRenderPropArg, OptionPropsWeControl, { | ||
disabled?: boolean; | ||
value: TType; | ||
}>; | ||
declare function OptionFn<TTag extends ElementType = typeof DEFAULT_OPTION_TAG, TType = Parameters<typeof ListboxRoot>[0]['value']>(props: ListboxOptionProps<TTag, TType>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_SELECTED_OPTION_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
type SelectedOptionRenderPropArg = {}; | ||
type SelectedOptionPropsWeControl = never; | ||
export type ListboxSelectedOptionProps<TTag extends ElementType = typeof DEFAULT_SELECTED_OPTION_TAG> = Props<TTag, SelectedOptionRenderPropArg, SelectedOptionPropsWeControl, { | ||
options: React.ReactNode; | ||
placeholder?: React.ReactNode; | ||
}>; | ||
declare function SelectedFn<TTag extends ElementType = typeof DEFAULT_SELECTED_OPTION_TAG>(props: ListboxSelectedOptionProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
export interface _internal_ComponentListbox extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_LISTBOX_TAG, TType = string, TActualType = TType extends (infer U)[] ? U : TType>(props: ListboxProps<TTag, TType, TActualType> & RefProp<typeof ListboxFn>): JSX.Element; | ||
} | ||
declare type ListboxOptionPropsWeControl = 'id' | 'role' | 'tabIndex' | 'aria-disabled' | 'aria-selected' | 'onPointerLeave' | 'onMouseLeave' | 'onPointerMove' | 'onMouseMove' | 'onFocus'; | ||
export declare let Listbox: (<TTag extends React.ElementType<any> = React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>, TType = string>(props: Props<TTag, ListboxRenderPropArg, "value" | "name" | "disabled" | "onChange" | "horizontal"> & { | ||
value: TType; | ||
onChange(value: TType): void; | ||
disabled?: boolean | undefined; | ||
horizontal?: boolean | undefined; | ||
name?: string | undefined; | ||
}, ref: React.Ref<TTag>) => JSX.Element) & { | ||
displayName: string; | ||
} & { | ||
Button: (<TTag_1 extends React.ElementType<any> = "button">(props: Props<TTag_1, ButtonRenderPropArg, ButtonPropsWeControl>, ref: Ref<HTMLButtonElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Label: (<TTag_2 extends React.ElementType<any> = "label">(props: Props<TTag_2, LabelRenderPropArg, LabelPropsWeControl>, ref: Ref<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Options: (<TTag_3 extends React.ElementType<any> = "ul">(props: Props<TTag_3, OptionsRenderPropArg, OptionsPropsWeControl> & (({ | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
})), ref: Ref<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Option: (<TTag_4 extends React.ElementType<any> = "li", TType_1 = unknown>(props: Props<TTag_4, OptionRenderPropArg, "value" | ListboxOptionPropsWeControl> & { | ||
disabled?: boolean | undefined; | ||
value: TType_1; | ||
}, ref: Ref<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
export interface _internal_ComponentListboxButton extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: ListboxButtonProps<TTag> & RefProp<typeof ButtonFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentListboxLabel extends _internal_ComponentLabel { | ||
} | ||
export interface _internal_ComponentListboxOptions extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_OPTIONS_TAG>(props: ListboxOptionsProps<TTag> & RefProp<typeof OptionsFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentListboxOption extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_OPTION_TAG, TType = Parameters<typeof ListboxRoot>[0]['value']>(props: ListboxOptionProps<TTag, TType> & RefProp<typeof OptionFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentListboxSelectedOption extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_SELECTED_OPTION_TAG>(props: ListboxSelectedOptionProps<TTag> & RefProp<typeof SelectedFn>): JSX.Element; | ||
} | ||
declare let ListboxRoot: _internal_ComponentListbox; | ||
export declare let ListboxButton: _internal_ComponentListboxButton; | ||
/** @deprecated use `<Label>` instead of `<ListboxLabel>` */ | ||
export declare let ListboxLabel: _internal_ComponentListboxLabel; | ||
export declare let ListboxOptions: _internal_ComponentListboxOptions; | ||
export declare let ListboxOption: _internal_ComponentListboxOption; | ||
export declare let ListboxSelectedOption: _internal_ComponentListboxSelectedOption; | ||
export declare let Listbox: _internal_ComponentListbox & { | ||
/** @deprecated use `<ListboxButton>` instead of `<Listbox.Button>` */ | ||
Button: _internal_ComponentListboxButton; | ||
/** @deprecated use `<Label>` instead of `<Listbox.Label>` */ | ||
Label: _internal_ComponentListboxLabel; | ||
/** @deprecated use `<ListboxOptions>` instead of `<Listbox.Options>` */ | ||
Options: _internal_ComponentListboxOptions; | ||
/** @deprecated use `<ListboxOption>` instead of `<Listbox.Option>` */ | ||
Option: _internal_ComponentListboxOption; | ||
/** @deprecated use `<ListboxSelectedOption>` instead of `<Listbox.SelectedOption>` */ | ||
SelectedOption: _internal_ComponentListboxSelectedOption; | ||
}; | ||
export {}; |
@@ -1,51 +0,117 @@ | ||
import React, { Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import { PropsForFeatures } from '../../utils/render'; | ||
interface MenuRenderPropArg { | ||
import React, { type ElementType, type Ref } from 'react'; | ||
import { type AnchorProps } from '../../internal/floating.js'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type RefProp } from '../../utils/render.js'; | ||
declare let DEFAULT_MENU_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
type MenuRenderPropArg = { | ||
open: boolean; | ||
} | ||
interface ButtonRenderPropArg { | ||
close: () => void; | ||
}; | ||
type MenuPropsWeControl = never; | ||
export type MenuProps<TTag extends ElementType = typeof DEFAULT_MENU_TAG> = Props<TTag, MenuRenderPropArg, MenuPropsWeControl, { | ||
__demoMode?: boolean; | ||
}>; | ||
declare function MenuFn<TTag extends ElementType = typeof DEFAULT_MENU_TAG>(props: MenuProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_BUTTON_TAG: "button"; | ||
type ButtonRenderPropArg = { | ||
open: boolean; | ||
} | ||
declare type ButtonPropsWeControl = 'id' | 'type' | 'aria-haspopup' | 'aria-controls' | 'aria-expanded' | 'onKeyDown' | 'onClick'; | ||
interface ItemsRenderPropArg { | ||
active: boolean; | ||
hover: boolean; | ||
focus: boolean; | ||
disabled: boolean; | ||
autofocus: boolean; | ||
}; | ||
type ButtonPropsWeControl = 'aria-controls' | 'aria-expanded' | 'aria-haspopup'; | ||
export type MenuButtonProps<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG> = Props<TTag, ButtonRenderPropArg, ButtonPropsWeControl, { | ||
disabled?: boolean; | ||
autoFocus?: boolean; | ||
}>; | ||
declare function ButtonFn<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: MenuButtonProps<TTag>, ref: Ref<HTMLButtonElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_ITEMS_TAG: "div"; | ||
type ItemsRenderPropArg = { | ||
open: boolean; | ||
} | ||
declare type ItemsPropsWeControl = 'aria-activedescendant' | 'aria-labelledby' | 'id' | 'onKeyDown' | 'role' | 'tabIndex'; | ||
declare let ItemsRenderFeatures: number; | ||
interface ItemRenderPropArg { | ||
}; | ||
type ItemsPropsWeControl = 'aria-activedescendant' | 'aria-labelledby' | 'role' | 'tabIndex'; | ||
export type MenuItemsProps<TTag extends ElementType = typeof DEFAULT_ITEMS_TAG> = Props<TTag, ItemsRenderPropArg, ItemsPropsWeControl, { | ||
anchor?: AnchorProps; | ||
portal?: boolean; | ||
modal?: boolean; | ||
transition?: boolean; | ||
static?: boolean; | ||
unmount?: boolean; | ||
}>; | ||
declare function ItemsFn<TTag extends ElementType = typeof DEFAULT_ITEMS_TAG>(props: MenuItemsProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_ITEM_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
type ItemRenderPropArg = { | ||
/** @deprecated use `focus` instead */ | ||
active: boolean; | ||
focus: boolean; | ||
disabled: boolean; | ||
close: () => void; | ||
}; | ||
type ItemPropsWeControl = 'aria-describedby' | 'aria-disabled' | 'aria-labelledby' | 'role' | 'tabIndex'; | ||
export type MenuItemProps<TTag extends ElementType = typeof DEFAULT_ITEM_TAG> = Props<TTag, ItemRenderPropArg, ItemPropsWeControl, { | ||
disabled?: boolean; | ||
}>; | ||
declare function ItemFn<TTag extends ElementType = typeof DEFAULT_ITEM_TAG>(props: MenuItemProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_SECTION_TAG: "div"; | ||
type SectionRenderPropArg = {}; | ||
type SectionPropsWeControl = 'role' | 'aria-labelledby'; | ||
export type MenuSectionProps<TTag extends ElementType = typeof DEFAULT_SECTION_TAG> = Props<TTag, SectionRenderPropArg, SectionPropsWeControl>; | ||
declare function SectionFn<TTag extends ElementType = typeof DEFAULT_SECTION_TAG>(props: MenuSectionProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_HEADING_TAG: "header"; | ||
type HeadingRenderPropArg = {}; | ||
type HeadingPropsWeControl = 'role'; | ||
export type MenuHeadingProps<TTag extends ElementType = typeof DEFAULT_HEADING_TAG> = Props<TTag, HeadingRenderPropArg, HeadingPropsWeControl>; | ||
declare function HeadingFn<TTag extends ElementType = typeof DEFAULT_HEADING_TAG>(props: MenuHeadingProps<TTag>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_SEPARATOR_TAG: "div"; | ||
type SeparatorRenderPropArg = {}; | ||
type SeparatorPropsWeControl = 'role'; | ||
export type MenuSeparatorProps<TTag extends ElementType = typeof DEFAULT_SEPARATOR_TAG> = Props<TTag, SeparatorRenderPropArg, SeparatorPropsWeControl>; | ||
declare function SeparatorFn<TTag extends ElementType = typeof DEFAULT_SEPARATOR_TAG>(props: MenuSeparatorProps<TTag>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
export interface _internal_ComponentMenu extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_MENU_TAG>(props: MenuProps<TTag> & RefProp<typeof MenuFn>): JSX.Element; | ||
} | ||
declare type MenuItemPropsWeControl = 'id' | 'role' | 'tabIndex' | 'aria-disabled' | 'onPointerLeave' | 'onPointerMove' | 'onMouseLeave' | 'onMouseMove' | 'onFocus'; | ||
export declare let Menu: (<TTag extends React.ElementType<any> = React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>>(props: Props<TTag, MenuRenderPropArg, "1D45E01E-AF44-47C4-988A-19A94EBAF55C">, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
} & { | ||
Button: (<TTag_1 extends React.ElementType<any> = "button">(props: Props<TTag_1, ButtonRenderPropArg, ButtonPropsWeControl>, ref: Ref<HTMLButtonElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Items: (<TTag_2 extends React.ElementType<any> = "div">(props: Props<TTag_2, ItemsRenderPropArg, ItemsPropsWeControl> & (({ | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
})), ref: Ref<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Item: (<TTag_3 extends React.ElementType<any> = React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>>(props: Props<TTag_3, ItemRenderPropArg, MenuItemPropsWeControl> & { | ||
disabled?: boolean | undefined; | ||
onClick?: ((event: { | ||
preventDefault: Function; | ||
}) => void) | undefined; | ||
}, ref: Ref<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
export interface _internal_ComponentMenuButton extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: MenuButtonProps<TTag> & RefProp<typeof ButtonFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentMenuItems extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_ITEMS_TAG>(props: MenuItemsProps<TTag> & RefProp<typeof ItemsFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentMenuItem extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_ITEM_TAG>(props: MenuItemProps<TTag> & RefProp<typeof ItemFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentMenuSection extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_SECTION_TAG>(props: MenuSectionProps<TTag> & RefProp<typeof SectionFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentMenuHeading extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_HEADING_TAG>(props: MenuHeadingProps<TTag> & RefProp<typeof HeadingFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentMenuSeparator extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_SEPARATOR_TAG>(props: MenuSeparatorProps<TTag> & RefProp<typeof SeparatorFn>): JSX.Element; | ||
} | ||
export declare let MenuButton: _internal_ComponentMenuButton; | ||
export declare let MenuItems: _internal_ComponentMenuItems; | ||
export declare let MenuItem: _internal_ComponentMenuItem; | ||
export declare let MenuSection: _internal_ComponentMenuSection; | ||
export declare let MenuHeading: _internal_ComponentMenuHeading; | ||
export declare let MenuSeparator: _internal_ComponentMenuSeparator; | ||
export declare let Menu: _internal_ComponentMenu & { | ||
/** @deprecated use `<MenuButton>` instead of `<Menu.Button>` */ | ||
Button: _internal_ComponentMenuButton; | ||
/** @deprecated use `<MenuItems>` instead of `<Menu.Items>` */ | ||
Items: _internal_ComponentMenuItems; | ||
/** @deprecated use `<MenuItem>` instead of `<Menu.Item>` */ | ||
Item: _internal_ComponentMenuItem; | ||
/** @deprecated use `<MenuSection>` instead of `<Menu.Section>` */ | ||
Section: _internal_ComponentMenuSection; | ||
/** @deprecated use `<MenuHeading>` instead of `<Menu.Heading>` */ | ||
Heading: _internal_ComponentMenuHeading; | ||
/** @deprecated use `<MenuSeparator>` instead of `<Menu.Separator>` */ | ||
Separator: _internal_ComponentMenuSeparator; | ||
}; | ||
export {}; |
@@ -1,60 +0,96 @@ | ||
import React, { Ref, MutableRefObject } from 'react'; | ||
import { Props } from '../../types'; | ||
import { PropsForFeatures } from '../../utils/render'; | ||
interface PopoverRenderPropArg { | ||
import React, { type ElementType, type MouseEventHandler, type MutableRefObject, type Ref } from 'react'; | ||
import { type AnchorProps } from '../../internal/floating.js'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type PropsForFeatures, type RefProp } from '../../utils/render.js'; | ||
type MouseEvent<T> = Parameters<MouseEventHandler<T>>[0]; | ||
declare let DEFAULT_POPOVER_TAG: "div"; | ||
type PopoverRenderPropArg = { | ||
open: boolean; | ||
close(focusableElement?: HTMLElement | MutableRefObject<HTMLElement | null>): void; | ||
} | ||
interface ButtonRenderPropArg { | ||
close(focusableElement?: HTMLElement | MutableRefObject<HTMLElement | null> | MouseEvent<HTMLElement>): void; | ||
}; | ||
type PopoverPropsWeControl = never; | ||
export type PopoverProps<TTag extends ElementType = typeof DEFAULT_POPOVER_TAG> = Props<TTag, PopoverRenderPropArg, PopoverPropsWeControl, { | ||
__demoMode?: boolean; | ||
}>; | ||
declare function PopoverFn<TTag extends ElementType = typeof DEFAULT_POPOVER_TAG>(props: PopoverProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_BUTTON_TAG: "button"; | ||
type ButtonRenderPropArg = { | ||
open: boolean; | ||
} | ||
declare type ButtonPropsWeControl = 'id' | 'type' | 'aria-expanded' | 'aria-controls' | 'onKeyDown' | 'onClick'; | ||
interface OverlayRenderPropArg { | ||
active: boolean; | ||
hover: boolean; | ||
focus: boolean; | ||
disabled: boolean; | ||
autofocus: boolean; | ||
}; | ||
type ButtonPropsWeControl = 'aria-controls' | 'aria-expanded'; | ||
export type PopoverButtonProps<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG> = Props<TTag, ButtonRenderPropArg, ButtonPropsWeControl, { | ||
disabled?: boolean; | ||
autoFocus?: boolean; | ||
}>; | ||
declare function ButtonFn<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: PopoverButtonProps<TTag>, ref: Ref<HTMLButtonElement>): React.JSX.Element; | ||
declare let DEFAULT_BACKDROP_TAG: "div"; | ||
type BackdropRenderPropArg = { | ||
open: boolean; | ||
} | ||
declare type OverlayPropsWeControl = 'id' | 'aria-hidden' | 'onClick'; | ||
declare let OverlayRenderFeatures: number; | ||
interface PanelRenderPropArg { | ||
}; | ||
type BackdropPropsWeControl = 'aria-hidden'; | ||
declare let BackdropRenderFeatures: number; | ||
export type PopoverBackdropProps<TTag extends ElementType = typeof DEFAULT_BACKDROP_TAG> = Props<TTag, BackdropRenderPropArg, BackdropPropsWeControl, { | ||
transition?: boolean; | ||
} & PropsForFeatures<typeof BackdropRenderFeatures>>; | ||
export type PopoverOverlayProps<TTag extends ElementType = typeof DEFAULT_BACKDROP_TAG> = PopoverBackdropProps<TTag>; | ||
declare function BackdropFn<TTag extends ElementType = typeof DEFAULT_BACKDROP_TAG>(props: PopoverBackdropProps<TTag>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_PANEL_TAG: "div"; | ||
type PanelRenderPropArg = { | ||
open: boolean; | ||
close: (focusableElement?: HTMLElement | MutableRefObject<HTMLElement | null>) => void; | ||
}; | ||
type PanelPropsWeControl = 'tabIndex'; | ||
export type PopoverPanelProps<TTag extends ElementType = typeof DEFAULT_PANEL_TAG> = Props<TTag, PanelRenderPropArg, PanelPropsWeControl, { | ||
focus?: boolean; | ||
anchor?: AnchorProps; | ||
portal?: boolean; | ||
modal?: boolean; | ||
transition?: boolean; | ||
static?: boolean; | ||
unmount?: boolean; | ||
}>; | ||
declare function PanelFn<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(props: PopoverPanelProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_GROUP_TAG: "div"; | ||
type GroupRenderPropArg = {}; | ||
type GroupPropsWeControl = never; | ||
export type PopoverGroupProps<TTag extends ElementType = typeof DEFAULT_GROUP_TAG> = Props<TTag, GroupRenderPropArg, GroupPropsWeControl>; | ||
declare function GroupFn<TTag extends ElementType = typeof DEFAULT_GROUP_TAG>(props: PopoverGroupProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
export interface _internal_ComponentPopover extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_POPOVER_TAG>(props: PopoverProps<TTag> & RefProp<typeof PopoverFn>): JSX.Element; | ||
} | ||
declare type PanelPropsWeControl = 'id' | 'onKeyDown'; | ||
declare let PanelRenderFeatures: number; | ||
interface GroupRenderPropArg { | ||
export interface _internal_ComponentPopoverButton extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_BUTTON_TAG>(props: PopoverButtonProps<TTag> & RefProp<typeof ButtonFn>): JSX.Element; | ||
} | ||
declare type GroupPropsWeControl = 'id'; | ||
export declare let Popover: (<TTag extends React.ElementType<any> = "div">(props: Props<TTag, PopoverRenderPropArg, "1D45E01E-AF44-47C4-988A-19A94EBAF55C">, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
} & { | ||
Button: (<TTag_1 extends React.ElementType<any> = "button">(props: Props<TTag_1, ButtonRenderPropArg, ButtonPropsWeControl>, ref: Ref<HTMLButtonElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Overlay: (<TTag_2 extends React.ElementType<any> = "div">(props: Props<TTag_2, OverlayRenderPropArg, OverlayPropsWeControl> & (({ | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
})), ref: Ref<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Panel: (<TTag_3 extends React.ElementType<any> = "div">(props: Props<TTag_3, PanelRenderPropArg, PanelPropsWeControl> & (({ | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
})) & { | ||
focus?: boolean | undefined; | ||
}, ref: Ref<HTMLDivElement>) => JSX.Element) & { | ||
displayName: string; | ||
}; | ||
Group: (<TTag_4 extends React.ElementType<any> = "div">(props: Props<TTag_4, GroupRenderPropArg, "id">, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
}; | ||
export interface _internal_ComponentPopoverBackdrop extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_BACKDROP_TAG>(props: PopoverBackdropProps<TTag> & RefProp<typeof BackdropFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentPopoverPanel extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(props: PopoverPanelProps<TTag> & RefProp<typeof PanelFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentPopoverGroup extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_GROUP_TAG>(props: PopoverGroupProps<TTag> & RefProp<typeof GroupFn>): JSX.Element; | ||
} | ||
export declare let PopoverButton: _internal_ComponentPopoverButton; | ||
/** @deprecated use `<PopoverBackdrop>` instead of `<PopoverOverlay>` */ | ||
export declare let PopoverOverlay: _internal_ComponentPopoverBackdrop; | ||
export declare let PopoverBackdrop: _internal_ComponentPopoverBackdrop; | ||
export declare let PopoverPanel: _internal_ComponentPopoverPanel; | ||
export declare let PopoverGroup: _internal_ComponentPopoverGroup; | ||
export declare let Popover: _internal_ComponentPopover & { | ||
/** @deprecated use `<PopoverButton>` instead of `<Popover.Button>` */ | ||
Button: _internal_ComponentPopoverButton; | ||
/** @deprecated use `<PopoverBackdrop>` instead of `<Popover.Backdrop>` */ | ||
Backdrop: _internal_ComponentPopoverBackdrop; | ||
/** @deprecated use `<PopoverOverlay>` instead of `<Popover.Overlay>` */ | ||
Overlay: _internal_ComponentPopoverBackdrop; | ||
/** @deprecated use `<PopoverPanel>` instead of `<Popover.Panel>` */ | ||
Panel: _internal_ComponentPopoverPanel; | ||
/** @deprecated use `<PopoverGroup>` instead of `<Popover.Group>` */ | ||
Group: _internal_ComponentPopoverGroup; | ||
}; | ||
export {}; |
@@ -1,28 +0,36 @@ | ||
import React, { MutableRefObject, Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
interface PortalRenderPropArg { | ||
import React, { type ElementType, type MutableRefObject, type Ref } from 'react'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type RefProp } from '../../utils/render.js'; | ||
declare let DEFAULT_PORTAL_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
type PortalRenderPropArg = {}; | ||
type PortalPropsWeControl = never; | ||
export type PortalProps<TTag extends ElementType = typeof DEFAULT_PORTAL_TAG> = Props<TTag, PortalRenderPropArg, PortalPropsWeControl, { | ||
enabled?: boolean; | ||
}>; | ||
declare function PortalFn<TTag extends ElementType = typeof DEFAULT_PORTAL_TAG>(props: PortalProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element | null; | ||
declare let DEFAULT_GROUP_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
type GroupRenderPropArg = {}; | ||
type GroupPropsWeControl = never; | ||
export type PortalGroupProps<TTag extends ElementType = typeof DEFAULT_GROUP_TAG> = Props<TTag, GroupRenderPropArg, GroupPropsWeControl, { | ||
target: MutableRefObject<HTMLElement | null>; | ||
}>; | ||
declare function GroupFn<TTag extends ElementType = typeof DEFAULT_GROUP_TAG>(props: PortalGroupProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
export declare function useNestedPortals(): readonly [React.MutableRefObject<HTMLElement[]>, ({ children }: { | ||
children: React.ReactNode; | ||
}) => React.JSX.Element]; | ||
export interface _internal_ComponentPortal extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_PORTAL_TAG>(props: PortalProps<TTag> & RefProp<typeof PortalFn>): JSX.Element; | ||
} | ||
interface GroupRenderPropArg { | ||
export interface _internal_ComponentPortalGroup extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_GROUP_TAG>(props: PortalGroupProps<TTag> & RefProp<typeof GroupFn>): JSX.Element; | ||
} | ||
export declare let Portal: (<TTag extends React.ElementType<any> = React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>>(props: Props<TTag, PortalRenderPropArg, "1D45E01E-AF44-47C4-988A-19A94EBAF55C">, ref: Ref<HTMLElement>) => React.ReactPortal | null) & { | ||
displayName: string; | ||
} & { | ||
Group: (<TTag_1 extends React.ElementType<any> = React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>>(props: Omit<import("../../types").PropsOf<TTag_1>, "as" | "children" | "refName" | "className"> & { | ||
as?: TTag_1 | undefined; | ||
children?: React.ReactNode | ((bag: GroupRenderPropArg) => React.ReactElement<any, string | React.JSXElementConstructor<any>>); | ||
refName?: string | undefined; | ||
} & (import("../../types").PropsOf<TTag_1> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: GroupRenderPropArg) => string) | undefined; | ||
} : {}) & { | ||
target: MutableRefObject<HTMLElement | null>; | ||
}, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
}; | ||
export declare let PortalGroup: _internal_ComponentPortalGroup; | ||
export declare let Portal: _internal_ComponentPortal & { | ||
/** @deprecated use `<PortalGroup>` instead of `<Portal.Group>` */ | ||
Group: _internal_ComponentPortalGroup; | ||
}; | ||
export {}; |
@@ -1,43 +0,85 @@ | ||
import React, { Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
interface RadioGroupRenderPropArg { | ||
} | ||
declare type RadioGroupPropsWeControl = 'role' | 'aria-labelledby' | 'aria-describedby' | 'id'; | ||
interface OptionRenderPropArg { | ||
import React, { type ElementType, type Ref } from 'react'; | ||
import { type ByComparator } from '../../hooks/use-by-comparator.js'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type RefProp } from '../../utils/render.js'; | ||
import { type _internal_ComponentDescription } from '../description/description.js'; | ||
import { type _internal_ComponentLabel } from '../label/label.js'; | ||
declare let DEFAULT_RADIO_GROUP_TAG: "div"; | ||
type RadioGroupRenderPropArg<TType> = { | ||
value: TType; | ||
}; | ||
type RadioGroupPropsWeControl = 'role' | 'aria-labelledby' | 'aria-describedby'; | ||
export type RadioGroupProps<TTag extends ElementType = typeof DEFAULT_RADIO_GROUP_TAG, TType = string> = Props<TTag, RadioGroupRenderPropArg<TType>, RadioGroupPropsWeControl, { | ||
value?: TType; | ||
defaultValue?: TType; | ||
onChange?(value: TType): void; | ||
by?: ByComparator<TType>; | ||
disabled?: boolean; | ||
form?: string; | ||
name?: string; | ||
}>; | ||
declare function RadioGroupFn<TTag extends ElementType = typeof DEFAULT_RADIO_GROUP_TAG, TType = string>(props: RadioGroupProps<TTag, TType>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_OPTION_TAG: "div"; | ||
type OptionRenderPropArg = { | ||
checked: boolean; | ||
/** @deprecated use `focus` instead */ | ||
active: boolean; | ||
hover: boolean; | ||
focus: boolean; | ||
autofocus: boolean; | ||
disabled: boolean; | ||
} | ||
declare type RadioPropsWeControl = 'aria-checked' | 'id' | 'onBlur' | 'onClick' | 'onFocus' | 'ref' | 'role' | 'tabIndex'; | ||
export declare let RadioGroup: (<TTag extends React.ElementType<any> = "div", TType = string>(props: Props<TTag, RadioGroupRenderPropArg, "value" | "name" | "disabled" | "onChange" | RadioGroupPropsWeControl> & { | ||
}; | ||
type OptionPropsWeControl = 'aria-checked' | 'aria-describedby' | 'aria-labelledby' | 'role' | 'tabIndex'; | ||
export type RadioOptionProps<TTag extends ElementType, TType> = Props<TTag, OptionRenderPropArg, OptionPropsWeControl, { | ||
value: TType; | ||
onChange(value: TType): void; | ||
disabled?: boolean | undefined; | ||
name?: string | undefined; | ||
}, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
} & { | ||
Option: (<TTag_1 extends React.ElementType<any> = "div", TType_1 = unknown>(props: Props<TTag_1, OptionRenderPropArg, "value" | "disabled" | RadioPropsWeControl> & { | ||
value: TType_1; | ||
disabled?: boolean | undefined; | ||
}, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
}; | ||
Label: (<TTag_2 extends React.ElementType<any> = "label">(props: Omit<import("../../types").PropsOf<TTag_2>, "id" | ("as" | "children" | "refName" | "className")> & { | ||
as?: TTag_2 | undefined; | ||
children?: React.ReactNode | ((bag: {}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>); | ||
refName?: string | undefined; | ||
} & (import("../../types").PropsOf<TTag_2> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: {}) => string) | undefined; | ||
} : {}) & { | ||
passive?: boolean | undefined; | ||
}, ref: React.Ref<HTMLLabelElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Description: (<TTag_3 extends React.ElementType<any> = "p">(props: Props<TTag_3, {}, "id">, ref: React.Ref<HTMLParagraphElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
disabled?: boolean; | ||
autoFocus?: boolean; | ||
}>; | ||
declare function OptionFn<TTag extends ElementType = typeof DEFAULT_OPTION_TAG, TType = Parameters<typeof RadioGroupRoot>[0]['value']>(props: RadioOptionProps<TTag, TType>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_RADIO_TAG: "span"; | ||
type RadioRenderPropArg = { | ||
checked: boolean; | ||
hover: boolean; | ||
focus: boolean; | ||
autofocus: boolean; | ||
disabled: boolean; | ||
}; | ||
type RadioPropsWeControl = 'aria-checked' | 'aria-describedby' | 'aria-labelledby' | 'role' | 'tabIndex'; | ||
export type RadioProps<TTag extends ElementType = typeof DEFAULT_RADIO_TAG, TType = string> = Props<TTag, RadioRenderPropArg, RadioPropsWeControl, { | ||
value: TType; | ||
disabled?: boolean; | ||
autoFocus?: boolean; | ||
}>; | ||
declare function RadioFn<TTag extends ElementType = typeof DEFAULT_RADIO_TAG, TType = Parameters<typeof RadioGroupRoot>[0]['value']>(props: RadioProps<TTag, TType>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
export interface _internal_ComponentRadioGroup extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_RADIO_GROUP_TAG, TType = string>(props: RadioGroupProps<TTag, TType> & RefProp<typeof RadioGroupFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentRadioOption extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_OPTION_TAG, TType = string>(props: RadioOptionProps<TTag, TType> & RefProp<typeof OptionFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentRadio extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_RADIO_TAG, TType = string>(props: RadioProps<TTag, TType> & RefProp<typeof RadioFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentRadioLabel extends _internal_ComponentLabel { | ||
} | ||
export interface _internal_ComponentRadioDescription extends _internal_ComponentDescription { | ||
} | ||
declare let RadioGroupRoot: _internal_ComponentRadioGroup; | ||
/** @deprecated use `<Radio>` instead of `<RadioGroupOption>` */ | ||
export declare let RadioGroupOption: _internal_ComponentRadioOption; | ||
export declare let Radio: _internal_ComponentRadio; | ||
/** @deprecated use `<Label>` instead of `<RadioGroupLabel>` */ | ||
export declare let RadioGroupLabel: _internal_ComponentRadioLabel; | ||
/** @deprecated use `<Description>` instead of `<RadioGroupDescription>` */ | ||
export declare let RadioGroupDescription: _internal_ComponentRadioDescription; | ||
export declare let RadioGroup: _internal_ComponentRadioGroup & { | ||
/** @deprecated use `<Radio>` instead of `<RadioGroup.Option>` */ | ||
Option: _internal_ComponentRadioOption; | ||
/** @deprecated use `<Radio>` instead of `<RadioGroup.Radio>` */ | ||
Radio: _internal_ComponentRadio; | ||
/** @deprecated use `<Label>` instead of `<RadioGroup.Label>` */ | ||
Label: _internal_ComponentRadioLabel; | ||
/** @deprecated use `<Description>` instead of `<RadioGroup.Description>` */ | ||
Description: _internal_ComponentRadioDescription; | ||
}; | ||
export {}; |
@@ -1,37 +0,58 @@ | ||
import React, { ElementType, Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import React, { type ElementType, type Ref } from 'react'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type RefProp } from '../../utils/render.js'; | ||
import { type _internal_ComponentDescription } from '../description/description.js'; | ||
import { type _internal_ComponentLabel } from '../label/label.js'; | ||
declare let DEFAULT_GROUP_TAG: React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>; | ||
declare function Group<TTag extends ElementType = typeof DEFAULT_GROUP_TAG>(props: Props<TTag>): JSX.Element; | ||
interface SwitchRenderPropArg { | ||
export type SwitchGroupProps<TTag extends ElementType = typeof DEFAULT_GROUP_TAG> = Props<TTag>; | ||
declare function GroupFn<TTag extends ElementType = typeof DEFAULT_GROUP_TAG>(props: SwitchGroupProps<TTag>): React.JSX.Element; | ||
declare let DEFAULT_SWITCH_TAG: "button"; | ||
type SwitchRenderPropArg = { | ||
checked: boolean; | ||
hover: boolean; | ||
focus: boolean; | ||
active: boolean; | ||
autofocus: boolean; | ||
changing: boolean; | ||
disabled: boolean; | ||
}; | ||
type SwitchPropsWeControl = 'aria-checked' | 'aria-describedby' | 'aria-labelledby' | 'role'; | ||
export type SwitchProps<TTag extends ElementType = typeof DEFAULT_SWITCH_TAG> = Props<TTag, SwitchRenderPropArg, SwitchPropsWeControl, { | ||
checked?: boolean; | ||
defaultChecked?: boolean; | ||
onChange?(checked: boolean): void; | ||
name?: string; | ||
value?: string; | ||
form?: string; | ||
autoFocus?: boolean; | ||
disabled?: boolean; | ||
tabIndex?: number; | ||
}>; | ||
declare function SwitchFn<TTag extends ElementType = typeof DEFAULT_SWITCH_TAG>(props: SwitchProps<TTag>, ref: Ref<HTMLButtonElement>): React.JSX.Element; | ||
export interface _internal_ComponentSwitch extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_SWITCH_TAG>(props: SwitchProps<TTag> & RefProp<typeof SwitchFn>): JSX.Element; | ||
} | ||
declare type SwitchPropsWeControl = 'id' | 'role' | 'tabIndex' | 'aria-checked' | 'aria-labelledby' | 'aria-describedby' | 'onClick' | 'onKeyUp' | 'onKeyPress'; | ||
export declare let Switch: (<TTag extends React.ElementType<any> = "button">(props: Props<TTag, SwitchRenderPropArg, "value" | "name" | "onChange" | "checked" | SwitchPropsWeControl> & { | ||
checked: boolean; | ||
onChange(checked: boolean): void; | ||
name?: string | undefined; | ||
value?: string | undefined; | ||
}, ref: Ref<HTMLElement>) => JSX.Element | null) & { | ||
displayName: string; | ||
} & { | ||
Group: typeof Group; | ||
Label: (<TTag_1 extends React.ElementType<any> = "label">(props: Omit<import("../../types").PropsOf<TTag_1>, "id" | ("as" | "children" | "refName" | "className")> & { | ||
as?: TTag_1 | undefined; | ||
children?: React.ReactNode | ((bag: {}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>); | ||
refName?: string | undefined; | ||
} & (import("../../types").PropsOf<TTag_1> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: {}) => string) | undefined; | ||
} : {}) & { | ||
passive?: boolean | undefined; | ||
}, ref: React.Ref<HTMLLabelElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Description: (<TTag_2 extends React.ElementType<any> = "p">(props: Props<TTag_2, {}, "id">, ref: React.Ref<HTMLParagraphElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
export interface _internal_ComponentSwitchGroup extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_GROUP_TAG>(props: SwitchGroupProps<TTag> & RefProp<typeof GroupFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentSwitchLabel extends _internal_ComponentLabel { | ||
} | ||
export interface _internal_ComponentSwitchDescription extends _internal_ComponentDescription { | ||
} | ||
/** @deprecated use `<Field>` instead of `<SwitchGroup>` */ | ||
export declare let SwitchGroup: _internal_ComponentSwitchGroup; | ||
/** @deprecated use `<Label>` instead of `<SwitchLabel>` */ | ||
export declare let SwitchLabel: _internal_ComponentSwitchLabel; | ||
/** @deprecated use `<Description>` instead of `<SwitchDescription>` */ | ||
export declare let SwitchDescription: _internal_ComponentSwitchDescription; | ||
export declare let Switch: _internal_ComponentSwitch & { | ||
/** @deprecated use `<Field>` instead of `<Switch.Group>` */ | ||
Group: _internal_ComponentSwitchGroup; | ||
/** @deprecated use `<Label>` instead of `<Switch.Label>` */ | ||
Label: _internal_ComponentSwitchLabel; | ||
/** @deprecated use `<Description>` instead of `<Switch.Description>` */ | ||
Description: _internal_ComponentSwitchDescription; | ||
}; | ||
export {}; |
@@ -1,63 +0,86 @@ | ||
import React, { Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import { PropsForFeatures } from '../../utils/render'; | ||
interface TabsRenderPropArg { | ||
import React, { type ElementType, type Ref } from 'react'; | ||
import type { Props } from '../../types.js'; | ||
import { type HasDisplayName, type PropsForFeatures, type RefProp } from '../../utils/render.js'; | ||
declare let DEFAULT_TABS_TAG: "div"; | ||
type TabsRenderPropArg = { | ||
selectedIndex: number; | ||
} | ||
interface ListRenderPropArg { | ||
}; | ||
type TabsPropsWeControl = never; | ||
export type TabGroupProps<TTag extends ElementType = typeof DEFAULT_TABS_TAG> = Props<TTag, TabsRenderPropArg, TabsPropsWeControl, { | ||
defaultIndex?: number; | ||
onChange?: (index: number) => void; | ||
selectedIndex?: number; | ||
vertical?: boolean; | ||
manual?: boolean; | ||
}>; | ||
declare function GroupFn<TTag extends ElementType = typeof DEFAULT_TABS_TAG>(props: TabGroupProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element; | ||
declare let DEFAULT_LIST_TAG: "div"; | ||
type ListRenderPropArg = { | ||
selectedIndex: number; | ||
} | ||
declare type ListPropsWeControl = 'role' | 'aria-orientation'; | ||
interface TabRenderPropArg { | ||
}; | ||
type ListPropsWeControl = 'aria-orientation' | 'role'; | ||
export type TabListProps<TTag extends ElementType = typeof DEFAULT_LIST_TAG> = Props<TTag, ListRenderPropArg, ListPropsWeControl, {}>; | ||
declare function ListFn<TTag extends ElementType = typeof DEFAULT_LIST_TAG>(props: TabListProps<TTag>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_TAB_TAG: "button"; | ||
type TabRenderPropArg = { | ||
hover: boolean; | ||
focus: boolean; | ||
active: boolean; | ||
autofocus: boolean; | ||
selected: boolean; | ||
} | ||
declare type TabPropsWeControl = 'id' | 'role' | 'type' | 'aria-controls' | 'aria-selected' | 'tabIndex'; | ||
interface PanelsRenderPropArg { | ||
disabled: boolean; | ||
}; | ||
type TabPropsWeControl = 'aria-controls' | 'aria-selected' | 'role' | 'tabIndex'; | ||
export type TabProps<TTag extends ElementType = typeof DEFAULT_TAB_TAG> = Props<TTag, TabRenderPropArg, TabPropsWeControl, { | ||
autoFocus?: boolean; | ||
disabled?: boolean; | ||
}>; | ||
declare function TabFn<TTag extends ElementType = typeof DEFAULT_TAB_TAG>(props: TabProps<TTag>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_PANELS_TAG: "div"; | ||
type PanelsRenderPropArg = { | ||
selectedIndex: number; | ||
} | ||
interface PanelRenderPropArg { | ||
}; | ||
export type TabPanelsProps<TTag extends ElementType = typeof DEFAULT_PANELS_TAG> = Props<TTag, PanelsRenderPropArg>; | ||
declare function PanelsFn<TTag extends ElementType = typeof DEFAULT_PANELS_TAG>(props: TabPanelsProps<TTag>, ref: Ref<HTMLElement>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null; | ||
declare let DEFAULT_PANEL_TAG: "div"; | ||
type PanelRenderPropArg = { | ||
selected: boolean; | ||
focus: boolean; | ||
}; | ||
type PanelPropsWeControl = 'role' | 'aria-labelledby'; | ||
declare let PanelRenderFeatures: number; | ||
export type TabPanelProps<TTag extends ElementType = typeof DEFAULT_PANEL_TAG> = Props<TTag, PanelRenderPropArg, PanelPropsWeControl, PropsForFeatures<typeof PanelRenderFeatures> & { | ||
id?: string; | ||
tabIndex?: number; | ||
}>; | ||
declare function PanelFn<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(props: TabPanelProps<TTag>, ref: Ref<HTMLElement>): React.JSX.Element | null; | ||
export interface _internal_ComponentTab extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_TAB_TAG>(props: TabProps<TTag> & RefProp<typeof TabFn>): JSX.Element; | ||
} | ||
declare type PanelPropsWeControl = 'id' | 'role' | 'aria-labelledby' | 'tabIndex'; | ||
declare let PanelRenderFeatures: number; | ||
export declare let Tab: (<TTag extends React.ElementType<any> = "button">(props: Props<TTag, TabRenderPropArg, TabPropsWeControl>, ref: Ref<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
} & { | ||
Group: (<TTag_1 extends React.ElementType<any> = React.ExoticComponent<{ | ||
children?: React.ReactNode; | ||
}>>(props: Omit<import("../../types").PropsOf<TTag_1>, "as" | "children" | "refName" | "className"> & { | ||
as?: TTag_1 | undefined; | ||
children?: React.ReactNode | ((bag: TabsRenderPropArg) => React.ReactElement<any, string | React.JSXElementConstructor<any>>); | ||
refName?: string | undefined; | ||
} & (import("../../types").PropsOf<TTag_1> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: TabsRenderPropArg) => string) | undefined; | ||
} : {}) & { | ||
defaultIndex?: number | undefined; | ||
onChange?: ((index: number) => void) | undefined; | ||
selectedIndex?: number | undefined; | ||
vertical?: boolean | undefined; | ||
manual?: boolean | undefined; | ||
}, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
}; | ||
List: (<TTag_2 extends React.ElementType<any> = "div">(props: Props<TTag_2, ListRenderPropArg, ListPropsWeControl> & {}, ref: Ref<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Panels: (<TTag_3 extends React.ElementType<any> = "div">(props: Props<TTag_3, PanelsRenderPropArg, "1D45E01E-AF44-47C4-988A-19A94EBAF55C">, ref: Ref<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
Panel: (<TTag_4 extends React.ElementType<any> = "div">(props: Props<TTag_4, PanelRenderPropArg, PanelPropsWeControl> & (({ | ||
static?: undefined; | ||
} & { | ||
unmount?: boolean | undefined; | ||
}) | ({ | ||
unmount?: undefined; | ||
} & { | ||
static?: boolean | undefined; | ||
})), ref: Ref<HTMLElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>> | null) & { | ||
displayName: string; | ||
}; | ||
export interface _internal_ComponentTabGroup extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_TABS_TAG>(props: TabGroupProps<TTag> & RefProp<typeof GroupFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentTabList extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_LIST_TAG>(props: TabListProps<TTag> & RefProp<typeof ListFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentTabPanels extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_PANELS_TAG>(props: TabPanelsProps<TTag> & RefProp<typeof PanelsFn>): JSX.Element; | ||
} | ||
export interface _internal_ComponentTabPanel extends HasDisplayName { | ||
<TTag extends ElementType = typeof DEFAULT_PANEL_TAG>(props: TabPanelProps<TTag> & RefProp<typeof PanelFn>): JSX.Element; | ||
} | ||
export declare let TabGroup: _internal_ComponentTabGroup; | ||
export declare let TabList: _internal_ComponentTabList; | ||
export declare let TabPanels: _internal_ComponentTabPanels; | ||
export declare let TabPanel: _internal_ComponentTabPanel; | ||
export declare let Tab: _internal_ComponentTab & { | ||
/** @deprecated use `<TabGroup>` instead of `<Tab.Group>` */ | ||
Group: _internal_ComponentTabGroup; | ||
/** @deprecated use `<TabList>` instead of `<Tab.List>` */ | ||
List: _internal_ComponentTabList; | ||
/** @deprecated use `<TabPanels>` instead of `<Tab.Panels>` */ | ||
Panels: _internal_ComponentTabPanels; | ||
/** @deprecated use `<TabPanel>` instead of `<Tab.Panel>` */ | ||
Panel: _internal_ComponentTabPanel; | ||
}; | ||
export {}; |
@@ -1,40 +0,1 @@ | ||
import React, { ElementType, MutableRefObject, Ref } from 'react'; | ||
import { Props } from '../../types'; | ||
import { Features, PropsForFeatures } from '../../utils/render'; | ||
export interface TransitionClasses { | ||
enter?: string; | ||
enterFrom?: string; | ||
enterTo?: string; | ||
entered?: string; | ||
leave?: string; | ||
leaveFrom?: string; | ||
leaveTo?: string; | ||
} | ||
export interface TransitionEvents { | ||
beforeEnter?: () => void; | ||
afterEnter?: () => void; | ||
beforeLeave?: () => void; | ||
afterLeave?: () => void; | ||
} | ||
declare type TransitionChildProps<TTag> = Props<TTag, TransitionChildRenderPropArg> & PropsForFeatures<typeof TransitionChildRenderFeatures> & TransitionClasses & TransitionEvents & { | ||
appear?: boolean; | ||
}; | ||
declare let DEFAULT_TRANSITION_CHILD_TAG: "div"; | ||
declare type TransitionChildRenderPropArg = MutableRefObject<HTMLDivElement>; | ||
declare let TransitionChildRenderFeatures: Features; | ||
declare function Child<TTag extends ElementType = typeof DEFAULT_TRANSITION_CHILD_TAG>(props: TransitionChildProps<TTag>): JSX.Element; | ||
export declare let Transition: (<TTag extends React.ElementType<any> = "div">(props: TransitionChildProps<TTag> & { | ||
show?: boolean | undefined; | ||
appear?: boolean | undefined; | ||
}, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
} & { | ||
Child: typeof Child; | ||
Root: (<TTag extends React.ElementType<any> = "div">(props: TransitionChildProps<TTag> & { | ||
show?: boolean | undefined; | ||
appear?: boolean | undefined; | ||
}, ref: Ref<HTMLElement>) => JSX.Element) & { | ||
displayName: string; | ||
}; | ||
}; | ||
export {}; | ||
export * from '../transition/transition.js'; |
@@ -0,9 +1,25 @@ | ||
/** | ||
* The `useDisposables` hook returns a `disposables` object that is disposed | ||
* when the component is unmounted. | ||
*/ | ||
export declare function useDisposables(): { | ||
enqueue(fn: Function): void; | ||
requestAnimationFrame(callback: FrameRequestCallback): void; | ||
nextFrame(callback: FrameRequestCallback): void; | ||
setTimeout(callback: (...args: any[]) => void, ms?: number | undefined, ...args: any[]): void; | ||
add(cb: () => void): void; | ||
addEventListener<TEventName extends keyof WindowEventMap>(element: Window | Document | HTMLElement, name: TEventName, listener: (event: WindowEventMap[TEventName]) => any, options?: boolean | AddEventListenerOptions | undefined): () => void; | ||
requestAnimationFrame(callback: FrameRequestCallback): () => void; | ||
nextFrame(callback: FrameRequestCallback): () => void; | ||
setTimeout(callback: (...args: any[]) => void, ms?: number | undefined, ...args: any[]): () => void; | ||
microTask(cb: () => void): () => void; | ||
style(node: HTMLElement, property: string, value: string): () => void; | ||
group(cb: (d: { | ||
addEventListener<TEventName extends keyof WindowEventMap>(element: Window | Document | HTMLElement, name: TEventName, listener: (event: WindowEventMap[TEventName]) => any, options?: boolean | AddEventListenerOptions | undefined): () => void; | ||
requestAnimationFrame(callback: FrameRequestCallback): () => void; | ||
nextFrame(callback: FrameRequestCallback): () => void; | ||
setTimeout(callback: (...args: any[]) => void, ms?: number | undefined, ...args: any[]): () => void; | ||
microTask(cb: () => void): () => void; | ||
style(node: HTMLElement, property: string, value: string): () => void; | ||
group(cb: any): () => void; | ||
add(cb: () => void): () => void; | ||
dispose(): void; | ||
}) => void): () => void; | ||
add(cb: () => void): () => void; | ||
dispose(): void; | ||
workQueue(): Promise<void>; | ||
}; |
export declare function useFlags(initialFlags?: number): { | ||
flags: number; | ||
setFlag: (flag: number) => void; | ||
addFlag: (flag: number) => void; | ||
@@ -3,0 +5,0 @@ hasFlag: (flag: number) => boolean; |
@@ -1,1 +0,1 @@ | ||
export declare function useId(): string | undefined; | ||
export { useId } from 'react'; |
@@ -1,2 +0,29 @@ | ||
import { MutableRefObject } from 'react'; | ||
export declare function useInertOthers<TElement extends HTMLElement>(container: MutableRefObject<TElement | null>, enabled?: boolean): void; | ||
/** | ||
* Mark all elements on the page as inert, except for the ones that are allowed. | ||
* | ||
* We move up the tree from the allowed elements, and mark all their siblings as | ||
* inert. If any of the children happens to be a parent of one of the elements, | ||
* then that child will not be marked as inert. | ||
* | ||
* E.g.: | ||
* | ||
* ```html | ||
* <body> <!-- Stop at body --> | ||
* <header></header> <!-- Inert, sibling of parent --> | ||
* <main> <!-- Not inert, parent of allowed element --> | ||
* <div>Sidebar</div> <!-- Inert, sibling of parent --> | ||
* <div> <!-- Not inert, parent of allowed element --> | ||
* <listbox> <!-- Not inert, parent of allowed element --> | ||
* <button></button> <!-- Not inert, allowed element --> | ||
* <options></options> <!-- Not inert, allowed element --> | ||
* </listbox> | ||
* </div> | ||
* </main> | ||
* <footer></footer> <!-- Inert, sibling of parent --> | ||
* </body> | ||
* ``` | ||
*/ | ||
export declare function useInertOthers(enabled: boolean, { allowed, disallowed, }?: { | ||
allowed?: () => (HTMLElement | null)[]; | ||
disallowed?: () => (HTMLElement | null)[]; | ||
}): void; |
@@ -1,2 +0,2 @@ | ||
import { useEffect } from 'react'; | ||
export declare const useIsoMorphicEffect: typeof useEffect; | ||
import { type DependencyList, type EffectCallback } from 'react'; | ||
export declare let useIsoMorphicEffect: (effect: EffectCallback, deps?: DependencyList | undefined) => void; |
@@ -1,2 +0,5 @@ | ||
import { MutableRefObject } from 'react'; | ||
export declare function useOutsideClick(containers: HTMLElement | MutableRefObject<HTMLElement | null> | (MutableRefObject<HTMLElement | null> | HTMLElement | null)[] | Set<HTMLElement>, cb: (event: MouseEvent | PointerEvent, target: HTMLElement) => void): void; | ||
type Container = HTMLElement | null; | ||
type ContainerCollection = Container[] | Set<Container>; | ||
type ContainerInput = Container | ContainerCollection; | ||
export declare function useOutsideClick(enabled: boolean, containers: ContainerInput | (() => ContainerInput), cb: (event: MouseEvent | PointerEvent | FocusEvent | TouchEvent, target: HTMLElement) => void): void; | ||
export {}; |
@@ -1,5 +0,4 @@ | ||
import { MutableRefObject } from 'react'; | ||
export declare function useResolveButtonType<TTag>(props: { | ||
type?: string; | ||
as?: TTag; | ||
}, ref: MutableRefObject<HTMLElement | null>): string | undefined; | ||
}, element: HTMLElement | null): string | undefined; |
/// <reference types="react" /> | ||
export declare function optionalRef<T>(cb: (ref: T) => void, isOptional?: boolean): ((ref: T) => void) & { | ||
[x: symbol]: boolean; | ||
}; | ||
export declare function useSyncRefs<TType>(...refs: (React.MutableRefObject<TType | null> | ((instance: TType) => void) | null)[]): ((value: TType) => void) | undefined; |
@@ -1,8 +0,7 @@ | ||
declare type AcceptNode = (node: HTMLElement) => typeof NodeFilter.FILTER_ACCEPT | typeof NodeFilter.FILTER_SKIP | typeof NodeFilter.FILTER_REJECT; | ||
export declare function useTreeWalker({ container, accept, walk, enabled, }: { | ||
type AcceptNode = (node: HTMLElement) => typeof NodeFilter.FILTER_ACCEPT | typeof NodeFilter.FILTER_SKIP | typeof NodeFilter.FILTER_REJECT; | ||
export declare function useTreeWalker(enabled: boolean, { container, accept, walk, }: { | ||
container: HTMLElement | null; | ||
accept: AcceptNode; | ||
walk(node: HTMLElement): void; | ||
enabled?: boolean; | ||
}): void; | ||
export {}; |
@@ -1,1 +0,1 @@ | ||
export declare function useWindowEvent<TType extends keyof WindowEventMap>(type: TType, listener: (this: Window, ev: WindowEventMap[TType]) => any, options?: boolean | AddEventListenerOptions): void; | ||
export declare function useWindowEvent<TType extends keyof WindowEventMap>(enabled: boolean, type: TType, listener: (ev: WindowEventMap[TType]) => any, options?: boolean | AddEventListenerOptions): void; |
@@ -1,12 +0,25 @@ | ||
export * from './components/combobox/combobox'; | ||
export * from './components/dialog/dialog'; | ||
export * from './components/disclosure/disclosure'; | ||
export * from './components/focus-trap/focus-trap'; | ||
export * from './components/listbox/listbox'; | ||
export * from './components/menu/menu'; | ||
export * from './components/popover/popover'; | ||
export * from './components/portal/portal'; | ||
export * from './components/radio-group/radio-group'; | ||
export * from './components/switch/switch'; | ||
export * from './components/tabs/tabs'; | ||
export * from './components/transitions/transition'; | ||
export * from './components/button/button.js'; | ||
export * from './components/checkbox/checkbox.js'; | ||
export * from './components/close-button/close-button.js'; | ||
export * from './components/combobox/combobox.js'; | ||
export * from './components/data-interactive/data-interactive.js'; | ||
export { Description, type DescriptionProps } from './components/description/description.js'; | ||
export * from './components/dialog/dialog.js'; | ||
export * from './components/disclosure/disclosure.js'; | ||
export * from './components/field/field.js'; | ||
export * from './components/fieldset/fieldset.js'; | ||
export * from './components/focus-trap/focus-trap.js'; | ||
export * from './components/input/input.js'; | ||
export { Label, type LabelProps } from './components/label/label.js'; | ||
export * from './components/legend/legend.js'; | ||
export * from './components/listbox/listbox.js'; | ||
export * from './components/menu/menu.js'; | ||
export * from './components/popover/popover.js'; | ||
export { Portal } from './components/portal/portal.js'; | ||
export * from './components/radio-group/radio-group.js'; | ||
export * from './components/select/select.js'; | ||
export * from './components/switch/switch.js'; | ||
export * from './components/tabs/tabs.js'; | ||
export * from './components/textarea/textarea.js'; | ||
export { useClose } from './internal/close-provider.js'; | ||
export * from './components/transition/transition.js'; |
@@ -1,5 +0,7 @@ | ||
import { ReactNode, ReactElement } from 'react'; | ||
import React, { type ReactElement, type ReactNode } from 'react'; | ||
export declare enum State { | ||
Open = 0, | ||
Closed = 1 | ||
Open = 1, | ||
Closed = 2, | ||
Closing = 4, | ||
Opening = 8 | ||
} | ||
@@ -12,2 +14,5 @@ export declare function useOpenClosed(): State | null; | ||
export declare function OpenClosedProvider({ value, children }: Props): ReactElement; | ||
export declare function ResetOpenClosedProvider({ children }: { | ||
children: React.ReactNode; | ||
}): ReactElement; | ||
export {}; |
@@ -1,2 +0,2 @@ | ||
import { ReactNode } from 'react'; | ||
import React, { type ReactNode } from 'react'; | ||
export declare function usePortalRoot(): boolean; | ||
@@ -7,3 +7,3 @@ interface ForcePortalRootProps { | ||
} | ||
export declare function ForcePortalRoot(props: ForcePortalRootProps): JSX.Element; | ||
export declare function ForcePortalRoot(props: ForcePortalRootProps): React.JSX.Element; | ||
export {}; |
@@ -1,11 +0,10 @@ | ||
import { ReactNode, ReactElement } from 'react'; | ||
declare let __: "1D45E01E-AF44-47C4-988A-19A94EBAF55C"; | ||
export declare type __ = typeof __; | ||
export declare type Expand<T> = T extends infer O ? { | ||
import type { JSXElementConstructor, ReactElement, ReactNode } from 'react'; | ||
export type ReactTag = keyof JSX.IntrinsicElements | JSXElementConstructor<any>; | ||
export type Expand<T> = T extends infer O ? { | ||
[K in keyof O]: O[K]; | ||
} : never; | ||
export declare type PropsOf<TTag = any> = TTag extends React.ElementType ? React.ComponentProps<TTag> : never; | ||
declare type PropsWeControl = 'as' | 'children' | 'refName' | 'className'; | ||
declare type CleanProps<TTag, TOmitableProps extends keyof any = __> = TOmitableProps extends __ ? Omit<PropsOf<TTag>, PropsWeControl> : Omit<PropsOf<TTag>, TOmitableProps | PropsWeControl>; | ||
declare type OurProps<TTag, TSlot = any> = { | ||
export type PropsOf<TTag extends ReactTag> = TTag extends React.ElementType ? Omit<React.ComponentProps<TTag>, 'ref'> : never; | ||
type PropsWeControl = 'as' | 'children' | 'refName' | 'className'; | ||
type CleanProps<TTag extends ReactTag, TOmittableProps extends PropertyKey = never> = Omit<PropsOf<TTag>, TOmittableProps | PropsWeControl>; | ||
type OurProps<TTag extends ReactTag, TSlot> = { | ||
as?: TTag; | ||
@@ -15,12 +14,8 @@ children?: ReactNode | ((bag: TSlot) => ReactElement); | ||
}; | ||
declare type ClassNameOverride<TTag, TSlot = any> = PropsOf<TTag> extends { | ||
className?: any; | ||
} ? { | ||
className?: string | ((bag: TSlot) => string); | ||
type HasProperty<T extends object, K extends PropertyKey> = T extends never ? never : K extends keyof T ? true : never; | ||
type ClassNameOverride<TTag extends ReactTag, TSlot = {}> = true extends HasProperty<PropsOf<TTag>, 'className'> ? { | ||
className?: PropsOf<TTag>['className'] | ((bag: TSlot) => string); | ||
} : {}; | ||
export declare type Props<TTag, TSlot = any, TOmitableProps extends keyof any = __> = CleanProps<TTag, TOmitableProps> & OurProps<TTag, TSlot> & ClassNameOverride<TTag, TSlot>; | ||
declare type Without<T, U> = { | ||
[P in Exclude<keyof T, keyof U>]?: never; | ||
}; | ||
export declare type XOR<T, U> = T | U extends __ ? never : T extends __ ? U : U extends __ ? T : T | U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U; | ||
export type Props<TTag extends ReactTag, TSlot = {}, TOmittableProps extends PropertyKey = never, Overrides = {}> = CleanProps<TTag, TOmittableProps | keyof Overrides> & OurProps<TTag, TSlot> & ClassNameOverride<TTag, TSlot> & Overrides; | ||
export type EnsureArray<T> = T extends any[] ? T : Expand<T>[]; | ||
export {}; |
@@ -23,4 +23,4 @@ export declare enum Focus { | ||
resolveActiveIndex(): number | null; | ||
resolveId(item: TItem): string; | ||
resolveDisabled(item: TItem): boolean; | ||
resolveId(item: TItem, index: number, items: TItem[]): string; | ||
resolveDisabled(item: TItem, index: number, items: TItem[]): boolean; | ||
}): number | null; |
@@ -0,9 +1,24 @@ | ||
export type Disposables = ReturnType<typeof disposables>; | ||
/** | ||
* Disposables are a way to manage event handlers and functions like | ||
* `setTimeout` and `requestAnimationFrame` that need to be cleaned up when they | ||
* are no longer needed. | ||
* | ||
* | ||
* When you register a disposable function, it is added to a collection of | ||
* disposables. Each disposable in the collection provides a `dispose` clean up | ||
* function that can be called when it's no longer needed. There is also a | ||
* `dispose` function on the collection itself that can be used to clean up all | ||
* pending disposables in that collection. | ||
*/ | ||
export declare function disposables(): { | ||
enqueue(fn: Function): void; | ||
requestAnimationFrame(callback: FrameRequestCallback): void; | ||
nextFrame(callback: FrameRequestCallback): void; | ||
setTimeout(callback: (...args: any[]) => void, ms?: number | undefined, ...args: any[]): void; | ||
add(cb: () => void): void; | ||
addEventListener<TEventName extends keyof WindowEventMap>(element: HTMLElement | Window | Document, name: TEventName, listener: (event: WindowEventMap[TEventName]) => any, options?: boolean | AddEventListenerOptions): () => void; | ||
requestAnimationFrame(callback: FrameRequestCallback): () => void; | ||
nextFrame(callback: FrameRequestCallback): () => void; | ||
setTimeout(callback: (...args: any[]) => void, ms?: number | undefined, ...args: any[]): () => void; | ||
microTask(cb: () => void): () => void; | ||
style(node: HTMLElement, property: string, value: string): () => void; | ||
group(cb: (d: typeof this) => void): () => void; | ||
add(cb: () => void): () => void; | ||
dispose(): void; | ||
workQueue(): Promise<void>; | ||
}; |
@@ -0,1 +1,3 @@ | ||
import type { MutableRefObject } from 'react'; | ||
export declare let focusableSelector: string; | ||
export declare enum Focus { | ||
@@ -13,3 +15,5 @@ /** Focus the first non-disabled element */ | ||
/** Prevent scrolling the focusable elements into view */ | ||
NoScroll = 32 | ||
NoScroll = 32, | ||
/** Focus the first focusable element with the `data-autofocus` attribute. */ | ||
AutoFocus = 64 | ||
} | ||
@@ -27,2 +31,3 @@ export declare enum FocusResult { | ||
export declare function getFocusableElements(container?: HTMLElement | null): HTMLElement[]; | ||
export declare function getAutoFocusableElements(container?: HTMLElement | null): HTMLElement[]; | ||
export declare enum FocusableMode { | ||
@@ -35,4 +40,10 @@ /** The element itself must be focusable. */ | ||
export declare function isFocusableElement(element: HTMLElement, mode?: FocusableMode): boolean; | ||
export declare function restoreFocusIfNecessary(element: HTMLElement | null): void; | ||
export declare function focusElement(element: HTMLElement | null): void; | ||
export declare function sortByDomNode<T>(nodes: T[], resolveKey?: (item: T) => HTMLElement | null): T[]; | ||
export declare function focusIn(container: HTMLElement | HTMLElement[], focus: Focus): FocusResult; | ||
export declare function focusFrom(current: HTMLElement | null, focus: Focus): FocusResult; | ||
export declare function focusIn(container: HTMLElement | HTMLElement[], focus: Focus, { sorted, relativeTo, skipElements, }?: Partial<{ | ||
sorted: boolean; | ||
relativeTo: HTMLElement | null; | ||
skipElements: (HTMLElement | MutableRefObject<HTMLElement | null>)[]; | ||
}>): FocusResult; |
@@ -1,3 +0,4 @@ | ||
declare type Entries = [string, string][]; | ||
type Entries = [string, string][]; | ||
export declare function objectToFormEntries(source?: Record<string, any>, parentKey?: string | null, entries?: Entries): Entries; | ||
export declare function attemptSubmit(elementInForm: HTMLElement): void; | ||
export {}; |
@@ -1,4 +0,4 @@ | ||
import { ElementType, ReactElement } from 'react'; | ||
import { Props, XOR, __, Expand } from '../types'; | ||
export declare enum Features { | ||
import { type ElementType, type ReactElement, type Ref } from 'react'; | ||
import type { Expand, Props } from '../types.js'; | ||
export declare enum RenderFeatures { | ||
/** No features at all */ | ||
@@ -24,12 +24,14 @@ None = 0, | ||
} | ||
declare type PropsForFeature<TPassedInFeatures extends Features, TForFeature extends Features, TProps> = { | ||
[P in TPassedInFeatures]: P extends TForFeature ? TProps : __; | ||
}[TPassedInFeatures]; | ||
export declare type PropsForFeatures<T extends Features> = XOR<PropsForFeature<T, Features.Static, { | ||
type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never; | ||
type PropsForFeature<TPassedInFeatures extends RenderFeatures, TForFeature extends RenderFeatures, TProps> = TPassedInFeatures extends TForFeature ? TProps : {}; | ||
export type PropsForFeatures<T extends RenderFeatures> = Expand<UnionToIntersection<PropsForFeature<T, RenderFeatures.Static, { | ||
static?: boolean; | ||
}>, PropsForFeature<T, Features.RenderStrategy, { | ||
}> | PropsForFeature<T, RenderFeatures.RenderStrategy, { | ||
unmount?: boolean; | ||
}>>; | ||
export declare function render<TFeature extends Features, TTag extends ElementType, TSlot>({ props, slot, defaultTag, features, visible, name, }: { | ||
props: Expand<Props<TTag, TSlot, any> & PropsForFeatures<TFeature>>; | ||
}>>>; | ||
export declare function render<TFeature extends RenderFeatures, TTag extends ElementType, TSlot>({ ourProps, theirProps, slot, defaultTag, features, visible, name, mergeRefs, }: { | ||
ourProps: Expand<Props<TTag, TSlot, any> & PropsForFeatures<TFeature>> & { | ||
ref?: Ref<HTMLElement | ElementType>; | ||
}; | ||
theirProps: Expand<Props<TTag, TSlot, any>>; | ||
slot?: TSlot; | ||
@@ -40,4 +42,26 @@ defaultTag: ElementType; | ||
name: string; | ||
mergeRefs?: ReturnType<typeof useMergeRefsFn>; | ||
}): ReactElement<any, string | import("react").JSXElementConstructor<any>> | null; | ||
/** | ||
* This is a singleton hook. **You can ONLY call the returned | ||
* function *once* to produce expected results.** If you need | ||
* to call `mergeRefs()` multiple times you need to create a | ||
* separate function for each invocation. This happens as we | ||
* store the list of `refs` to update and always return the | ||
* same function that refers to that list of refs. | ||
* | ||
* You shouldn't normally read refs during render but this | ||
* should actually be okay because React itself is calling | ||
* the `function` that updates these refs and can only do | ||
* so once the ref that contains the list is updated. | ||
*/ | ||
export declare function useMergeRefsFn(): (...refs: any[]) => ((value: any) => void) | undefined; | ||
export type HasDisplayName = { | ||
displayName: string; | ||
}; | ||
export type RefProp<T extends Function> = T extends (props: any, ref: Ref<infer RefType>) => any ? { | ||
ref?: Ref<RefType>; | ||
} : never; | ||
export declare function mergeProps<T extends Props<any, any>[]>(...listOfProps: T): Props<any, any>; | ||
/** | ||
* This is a hack, but basically we want to keep the full 'API' of the component, but we do want to | ||
@@ -44,0 +68,0 @@ * wrap it in a forwardRef so that we _can_ passthrough the ref |
{ | ||
"name": "@headlessui/react", | ||
"version": "0.0.0-insiders.07c3a61", | ||
"version": "0.0.0-insiders.07c9f1f", | ||
"description": "A set of completely unstyled, fully accessible UI components for React, designed to integrate beautifully with Tailwind CSS.", | ||
@@ -14,5 +14,8 @@ "main": "dist/index.cjs", | ||
"exports": { | ||
"types": { | ||
"import": "./dist/index.d.ts", | ||
"require": "./dist/index.d.cts" | ||
}, | ||
"import": "./dist/headlessui.esm.js", | ||
"require": "./dist/index.cjs", | ||
"types": "./dist/index.d.ts" | ||
"require": "./dist/index.cjs" | ||
}, | ||
@@ -38,18 +41,24 @@ "type": "module", | ||
"lint": "../../scripts/lint.sh", | ||
"playground": "yarn workspace playground-react dev", | ||
"lint-types": "npm run attw -P --workspaces --if-present", | ||
"playground": "npm run dev --workspace=playground-react", | ||
"clean": "rimraf ./dist" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16 || ^17 || ^18", | ||
"react-dom": "^16 || ^17 || ^18" | ||
"react": "^18", | ||
"react-dom": "^18" | ||
}, | ||
"devDependencies": { | ||
"@testing-library/react": "^11.2.3", | ||
"@types/react": "^16.14.2", | ||
"@types/react-dom": "^16.9.10", | ||
"react": "^16.14.0", | ||
"react-dom": "^16.14.0", | ||
"snapshot-diff": "^0.8.1", | ||
"esbuild": "^0.11.18" | ||
"@testing-library/react": "^15.0.7", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"snapshot-diff": "^0.10.0" | ||
}, | ||
"dependencies": { | ||
"@floating-ui/react": "^0.26.16", | ||
"@react-aria/focus": "^3.17.1", | ||
"@react-aria/interactions": "^3.21.3", | ||
"@tanstack/react-virtual": "^3.8.1" | ||
} | ||
} |
@@ -19,7 +19,3 @@ <h3 align="center"> | ||
```sh | ||
# npm | ||
npm install @headlessui/react | ||
# Yarn | ||
yarn add @headlessui/react | ||
``` | ||
@@ -26,0 +22,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
912555
6
299
16402
6
35
4
+ Added@floating-ui/react@^0.26.16
+ Added@react-aria/focus@^3.17.1
+ Added@floating-ui/core@1.6.8(transitive)
+ Added@floating-ui/dom@1.6.12(transitive)
+ Added@floating-ui/react@0.26.27(transitive)
+ Added@floating-ui/react-dom@2.1.2(transitive)
+ Added@floating-ui/utils@0.2.8(transitive)
+ Added@react-aria/focus@3.18.4(transitive)
+ Added@react-aria/interactions@3.22.4(transitive)
+ Added@react-aria/ssr@3.9.6(transitive)
+ Added@react-aria/utils@3.25.3(transitive)
+ Added@react-stately/utils@3.10.4(transitive)
+ Added@react-types/shared@3.25.0(transitive)
+ Added@swc/helpers@0.5.13(transitive)
+ Added@tanstack/react-virtual@3.10.9(transitive)
+ Added@tanstack/virtual-core@3.10.9(transitive)
+ Addedclsx@2.1.1(transitive)
+ Addedtabbable@6.2.0(transitive)
+ Addedtslib@2.8.1(transitive)