'use client'; import * as React from 'react'; import type { ZestChangeEventDetails } from '../utils/createChangeEventDetails'; import type { ZestEventReasons } from '../utils/reasons'; export interface ToggleGroupContext { value: readonly Value[]; setGroupValue: ( newValue: Value, nextPressed: boolean, eventDetails: ZestChangeEventDetails, ) => void; disabled: boolean; /** * Indicates whether the value has been initialized via `value` or `defaultValue` props. * Used to determine if Toggle should warn users about data inconsistency problems. */ isValueInitialized: boolean; } export const ToggleGroupContext = React.createContext | undefined>( undefined, ); /** * Toggle may be used standalone, so the group context is optional by design. */ export function useToggleGroupContext() { return React.useContext | undefined>(ToggleGroupContext); }