alouette
Version:
A modern, customizable design system built on top of NativeWind v5 with configurable defaults
79 lines • 2.45 kB
TypeScript
import type { ReactNode } from "react";
import type { AccentOrNeutral } from "../../core/AlouetteConfig";
import { type SVGIconElement } from "../primitives/Icon";
export interface SelectOption {
label: string;
value: string;
disabled?: boolean;
}
/**
* `outlined` is a form field, matching `InputText`. `tonal` is a pill lifted
* off the ground it sits on, the material of a `tonal` button — for a select
* that is chrome rather than a form field (the team or site an app sidebar
* applies to).
*/
export type SelectVariant = "outlined" | "tonal";
export interface SelectProps {
options: SelectOption[];
/** Controlled selected value. */
value?: string;
/** Initial value for uncontrolled usage. */
defaultValue?: string;
onValueChange?: (value: string) => void;
placeholder?: string;
/** Leading glyph standing for what is chosen (a place, a team). */
icon?: SVGIconElement;
/** Defaults to `outlined`. */
variant?: SelectVariant;
disabled?: boolean;
/**
* The field is in error: the trigger takes the danger accent over `accent`
* and is `aria-invalid`. From `FormItem`'s render params, next to
* `describedBy`.
*/
invalid?: boolean;
accent?: AccentOrNeutral;
"aria-label"?: string;
"aria-labelledby"?: string;
/** Web only in effect, like on `InputText`. */
"aria-describedby"?: string;
"aria-required"?: boolean;
testID?: string;
}
export declare const selectTriggerVariants: import("tailwind-variants").TVReturnType<{
variant: {
outlined: string;
tonal: string;
};
disabled: {
true: string;
false: string;
};
}, undefined, string, {
variant: {
outlined: string;
tonal: string;
};
disabled: {
true: string;
false: string;
};
}, undefined, import("tailwind-variants").TVReturnType<{
variant: {
outlined: string;
tonal: string;
};
disabled: {
true: string;
false: string;
};
}, undefined, string, unknown, unknown, undefined>>;
export interface SelectTriggerContentProps {
label?: string;
placeholder?: string;
icon?: SVGIconElement;
variant?: SelectVariant;
disabled?: boolean;
}
export declare function SelectTriggerContent({ label, placeholder, icon, variant, disabled, }: SelectTriggerContentProps): ReactNode;
//# sourceMappingURL=Select.shared.d.ts.map