alouette
Version:
A modern, customizable design system built on top of NativeWind v5 with configurable defaults
31 lines • 1.53 kB
TypeScript
import type { Provider, ReactNode } from "react";
import type { Accent } from "../../core/AlouetteConfig";
export interface MultiSelectionContextValue {
values: readonly string[];
onToggle: (value: string) => void;
disabled?: boolean;
}
export interface MultiSelectionGroupProps {
/** Controlled checked values. */
values?: readonly string[];
/** Initial checked values for uncontrolled usage. */
defaultValues?: readonly string[];
onValuesChange?: (values: string[]) => void;
accent?: Accent;
disabled?: boolean;
"aria-label"?: string;
"aria-labelledby"?: string;
children: ReactNode;
}
interface MultiSelectionContext {
MultiSelectionContextProvider: Provider<MultiSelectionContextValue | undefined>;
useMultiSelection: () => MultiSelectionContextValue;
/** For a child that also renders outside any group (a standalone Checkbox). */
useOptionalMultiSelection: () => MultiSelectionContextValue | undefined;
}
/** One context per group family, so a misplaced child gets a precise error. */
export declare function createMultiSelectionContext(missingProviderMessage: string): MultiSelectionContext;
export type MultiSelectionValueProps = Pick<MultiSelectionGroupProps, "defaultValues" | "disabled" | "onValuesChange" | "values">;
export declare function useMultiSelectionValue({ values: controlledValues, defaultValues, onValuesChange, disabled, }: MultiSelectionValueProps): MultiSelectionContextValue;
export {};
//# sourceMappingURL=MultiSelectionContext.d.ts.map