/* * Copyright 2026 Hypergiant Galactic Systems Inc. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ import { ProviderProps } from "../../lib/types.js"; import { CoordinateFieldProps, CoordinateFieldState } from "./types.js"; import * as react2 from "react"; import * as react_jsx_runtime10 from "react/jsx-runtime"; import { ContextValue } from "react-aria-components/slots"; //#region src/components/coordinate-field/context.d.ts /** * CoordinateField Context Architecture * * This file defines two separate contexts following the React Aria component pattern: * * 1. CoordinateFieldContext (Props Context): * - Contains user-provided props for the component * - Used for React Aria's context-based prop merging * - Part of the public composition API * * 2. CoordinateFieldStateContext (State Context): * - Contains derived/computed runtime state * - Used to share state with child components (e.g., CoordinateSegment) * - Primarily for internal use * Separation keeps the public API (props) distinct from internal * implementation details (state), improving maintainability and composition. */ /** * Props Context for CoordinateField component. * * Contains user-provided props (label, format, size, value, onChange, etc.) * and is used by React Aria's useContextProps hook for context-based prop merging. * This enables parent components to provide default props to nested CoordinateField * components, supporting composition patterns. * * Part of the public API - external consumers can use this for component composition. * * @see CoordinateFieldStateContext for internal runtime state */ declare const CoordinateFieldContext: react2.Context>; /** * State Context for CoordinateField component. * * Contains derived/computed runtime state (segmentValues, currentValue, * validationErrors, registerTimeout, etc.) that is shared with child components * like CoordinateSegment. This avoids prop drilling for deeply nested children. * * This follows the React Aria pattern of separating props context (public API) * from state context (internal implementation). While exported for composition * scenarios and testing, this is primarily for internal use. * * @see CoordinateFieldContext for user-provided props * @example * // Used internally by child components * const state = useCoordinateFieldStateContext(); * const { segmentValues, isDisabled, registerTimeout } = state; */ declare const CoordinateFieldStateContext: react2.Context; /** * Provider component for CoordinateField context * Wraps children with CoordinateFieldContext * * @param props - The provider props. * @param props.children - Child components that will receive the coordinate field context. * @returns The coordinate field context provider wrapping children. */ declare function CoordinateFieldProvider({ children, ...props }: ProviderProps): react_jsx_runtime10.JSX.Element; /** * Provider component for CoordinateField state context * Wraps children with CoordinateFieldStateContext * * @param props - The provider props. * @param props.children - Child components that will receive the state context. * @param props.value - The coordinate field state to provide. * @returns The coordinate field state context provider wrapping children. */ declare function CoordinateFieldStateProvider({ children, value }: { children: React.ReactNode; value: CoordinateFieldState; }): react_jsx_runtime10.JSX.Element; /** * Hook to access CoordinateField state context * Must be used within a CoordinateField component * @throws {Error} If used outside of CoordinateField * @returns {CoordinateFieldState} The coordinate field state */ declare const useCoordinateFieldStateContext: () => CoordinateFieldState; //#endregion export { CoordinateFieldContext, CoordinateFieldProvider, CoordinateFieldStateContext, CoordinateFieldStateProvider, useCoordinateFieldStateContext }; //# sourceMappingURL=context.d.ts.map