alouette
Version:
A modern, customizable design system built on top of NativeWind v5 with configurable defaults
38 lines • 1.81 kB
TypeScript
import type { Provider, ReactNode } from "react";
import type { Accent } from "../../core/AlouetteConfig";
import type { SegmentedVariant } from "./SelectionContext";
export interface MultiSelectionContextValue {
values: readonly string[];
onToggle: (value: string) => void;
disabled?: boolean;
/** Tighter horizontal padding, for a group holding many options. */
compact?: boolean;
variant?: SegmentedVariant;
}
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 interface MultiSelectionValueProps extends Pick<MultiSelectionGroupProps, "defaultValues" | "disabled" | "onValuesChange" | "values"> {
compact?: boolean;
variant?: SegmentedVariant;
}
export declare function useMultiSelectionValue({ values: controlledValues, defaultValues, onValuesChange, disabled, compact, variant, }: MultiSelectionValueProps): MultiSelectionContextValue;
export {};
//# sourceMappingURL=MultiSelectionContext.d.ts.map