import * as react_jsx_runtime from 'react/jsx-runtime'; import { HTMLProps, ReactNode } from 'react'; import { S as SnapPhysicsConfig } from '../index-xKJw1Yz2.js'; export { D as DragContextFrame, a as SnapPhysicsResult, b as SnapPhysicsState } from '../index-xKJw1Yz2.js'; interface Option { value: string | number; render: (state: { selected: boolean; visuallySelected: boolean; value: string | number; }) => ReactNode; props: Omit, 'children' | 'value'>; } type PickerOption = Option; interface PickerValue { [key: string]: string | number; } interface PickerGroupRootProps extends Omit, 'value' | 'onChange'> { value: TType; onChange: (value: TType, key: string) => void; height?: number; itemHeight?: number; wheelSensitivity?: number; wheelDeltaCap?: number; showHighlightLines?: boolean; } declare function usePickerData(componentName: string): { height: number; itemHeight: number; wheelSensitivity: number; wheelDeltaCap: number; value: PickerValue; optionGroups: { [key: string]: Option[]; }; }; /** * Multi-column picker container with shared state and keyboard navigation. * * Provides context for child PickerColumn components, manages value synchronization, * and handles cross-column keyboard navigation (ArrowLeft/ArrowRight). * * @template TType - Shape of the picker value object (e.g., `{ hours: number; minutes: number }`) * * @param {TType} props.value - Current selected values for all columns * @param {(value: TType, key: string) => void} props.onChange - Callback when any column value changes * @param {number} [props.height=216] - Total picker height in pixels * @param {number} [props.itemHeight=36] - Height of each individual item in pixels * @param {number} [props.wheelSensitivity=1] - Mouse wheel scroll speed multiplier * @param {number} [props.wheelDeltaCap=1.25] - Maximum wheel delta per event (prevents over-scrolling) * @param {boolean} [props.showHighlightLines=true] - Show selection highlight borders * * @example * ```tsx * setTime(value)} * height={216} * itemHeight={36} * > * * * * ``` */ declare function PickerGroupRoot(props: PickerGroupRootProps): react_jsx_runtime.JSX.Element; /** * Gesture event system for picker interactions * * This module defines a unified event-driven interface for all picker gestures, * replacing the previous callback-based approach. This enables: * - Clearer separation of concerns (physics vs orchestration) * - Easier testing (events are serializable) * - Simpler debugging (event logs are readable) * - Flexible consumption (different consumers handle different events) * * @module gestures/types */ /** * Emitted when a drag gesture starts (pointer down + threshold exceeded) */ interface DragStartEvent { type: 'drag:start'; /** Timestamp when drag started */ timestamp: number; /** Source of the drag (pointer, wheel, or keyboard) */ source: 'pointer' | 'wheel' | 'keyboard'; } /** * Emitted when a drag gesture ends (pointer up or momentum settled) */ interface DragEndEvent { type: 'drag:end'; /** Timestamp when drag ended */ timestamp: number; /** Whether the value actually changed during this drag */ hasMoved: boolean; /** Final velocity at end of drag (pixels/second) */ velocity: number; } /** * Emitted when picker hits min/max boundary during scrolling */ interface BoundaryHitEvent { type: 'boundary:hit'; /** Timestamp when boundary was hit */ timestamp: number; /** Which boundary was hit */ boundary: 'min' | 'max'; /** The value at the boundary (first or last option) */ value: string | number | undefined; } /** * Emitted on every frame during scrolling for visual feedback * (e.g., haptic feedback on iOS during rapid scrolling) */ interface VisualValueChangeEvent { type: 'value:visual'; /** Timestamp of the visual change */ timestamp: number; /** The visually centered value (may not be committed yet) */ value: string | number; /** Index of the visually centered item */ index: number; } /** * Emitted when a value is committed (selected and confirmed) */ interface ValueCommitEvent { type: 'value:commit'; /** Timestamp of the commit */ timestamp: number; /** The committed value */ value: string | number; /** Index of the committed item */ index: number; } /** * Emitted when picker settles to final position after momentum/animation * (useful for stronger haptic feedback to indicate completion) */ interface SettleEvent { type: 'value:settle'; /** Timestamp when settle completed */ timestamp: number; /** The settled value */ value: string | number; /** Index of the settled item */ index: number; /** Whether this was after momentum (true) or direct snap (false) */ hadMomentum: boolean; } /** * Union of all gesture events */ type PickerGestureEvent = DragStartEvent | DragEndEvent | BoundaryHitEvent | VisualValueChangeEvent | ValueCommitEvent | SettleEvent; /** * Function signature for gesture event handlers * * @param event - The gesture event * * @example * ```tsx * const handleGesture: PickerGestureHandler = (event) => { * switch (event.type) { * case 'drag:start': * console.log('Drag started at', event.timestamp); * break; * case 'value:commit': * console.log('Value committed:', event.value); * break; * } * }; * * * ``` */ type PickerGestureHandler = (event: PickerGestureEvent) => void; interface PickerColumnProps extends Omit, 'onDragStart' | 'onDragEnd'> { name: string; /** Event-driven gesture handler */ onGesture?: PickerGestureHandler; isPickerOpen?: boolean; snapConfig?: SnapPhysicsConfig; /** Direct options array to bypass O(n²) registration. When provided, children are ignored. */ options?: PickerOption[]; } /** * Individual scrollable picker column with momentum physics and virtualization. * * Must be used inside a PickerGroup component. Handles pointer/touch gestures, * keyboard navigation (arrows, page up/down, home/end), and wheel scrolling. * * Optimized with row virtualization for large datasets (11 visible slots out of 250+ items). * * @param {string} props.name - Unique identifier for this column (matches key in PickerGroup value) * @param {PickerOption[]} [props.options] - Direct options array (bypasses child registration) * @param {boolean} [props.isPickerOpen=true] - Whether picker is active (blocks gestures when closed) * @param {SnapPhysicsConfig} [props.snapConfig] - Optional snap-to-item magnetic physics config * @param {PickerGestureHandler} [props.onGesture] - Callback for gesture events (start/end/settle) * * @example * ```tsx * * ``` */ declare function PickerColumn({ style: styleFromUser, className: classNameFromUser, children, name: key, onGesture, isPickerOpen, snapConfig, options: directOptions, ...restProps }: PickerColumnProps): react_jsx_runtime.JSX.Element; interface PickerItemRenderProps { selected: boolean; visuallySelected: boolean; value: string | number; } interface PickerItemProps extends Omit, 'value' | 'children'> { children: ReactNode | ((renderProps: PickerItemRenderProps) => ReactNode); value: string | number; } /** * Declarative option item for a PickerColumn. Renders nothing but registers itself in parent column. * * Must be used inside a PickerColumn component. Alternative to passing direct `options` array. * * @param {ReactNode | ((props: PickerItemRenderProps) => ReactNode)} props.children - Content to render (static or render function) * @param {string | number} props.value - Unique value for this option * * @example * ```tsx * * 😊 Happy * 😢 Sad * * {({ selected }) => ( * šŸŽ‰ Excited * )} * * * ``` */ declare function PickerItem({ children, value, ...restProps }: PickerItemProps): any; type PickerColumnConfig = { key: string; isPickerOpen: boolean; }; declare function usePickerConfig(componentName: string): PickerColumnConfig; declare const PickerGroup: typeof PickerGroupRoot & { Column: typeof PickerColumn; Item: typeof PickerItem; }; export { PickerColumn, PickerGroup, PickerItem, type PickerOption, SnapPhysicsConfig, PickerGroup as default, usePickerConfig, usePickerData };