UNPKG

beta-parity-react

Version:

Beta Parity React Components

112 lines 3.31 kB
import React from 'react'; import './index.css'; import './variables.css'; declare const sizeMap: Record<'sm' | 'md', string>; /** * Props for the NativeSelect component. * * Extends properties from the `select` element. */ export interface NativeSelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> { /** * The list of options available in the select dropdown. * Each option is an object containing: * - `value`: The value of the option. * - `label`: The text displayed for the option. * - `disabled` (optional): Whether the option is disabled. * * @memberof NativeSelectProps */ options?: { value: string; label: string; disabled?: boolean; }[]; /** * The currently selected value of the select component. * * @memberof NativeSelectProps */ value?: string; /** * The floating label for the select component. * * @memberof NativeSelectProps */ floatingLabel?: string; /** * The size of the select component. * * @default 'md' * @memberof NativeSelectProps */ selectSize?: keyof typeof sizeMap; /** * The theme of the select component. * * @default 'default' * @memberof NativeSelectProps */ theme?: 'default' | 'alternative'; /** * Callback function invoked when the selected value changes. * * @param event - The change event of the select element. * @memberof NativeSelectProps */ onChange?: (e: React.ChangeEvent<HTMLSelectElement>) => void; /** * Callback function invoked when the select component gains focus. * * @param event - The focus event of the select element. * @memberof NativeSelectProps */ onFocus?: (e: React.FocusEvent<HTMLSelectElement>) => void; /** * Callback function invoked when the select component loses focus. * * @param event - The blur event of the select element. * @memberof NativeSelectProps */ onBlur?: (e: React.FocusEvent<HTMLSelectElement>) => void; /** * Callback function invoked when the select component is clicked. * * @param event - The click event of the select element. * @memberof NativeSelectProps */ onclick?: (e: React.MouseEvent<HTMLSelectElement>) => void; } /** * **Parity NativeSelect**. * * @see {@link https://beta-parity-react.vercel.app/select Parity NativeSelect} */ export declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectProps & React.RefAttributes<HTMLSelectElement>>; /** * Props for the NativeOption component. * * Extends properties from the `option` element. */ export interface NativeOptionProps extends React.OptionHTMLAttributes<HTMLOptionElement> { /** * The value of the option. * * @memberof NativeOptionProps */ value?: string; /** * The label of the option. * * @memberof NativeOptionProps */ label?: string; } /** * **Parity NativeOption**. * * @see {@link https://beta-parity-react.vercel.app/select Parity NativeOption} */ export declare const NativeOption: React.ForwardRefExoticComponent<NativeOptionProps & React.RefAttributes<HTMLOptionElement>>; export {}; //# sourceMappingURL=Native.d.ts.map