/** * Type definitions for the Checkbox component. * * @module @mks2508/mks-ui/react/ui/Checkbox/Checkbox.types */ import type { Checkbox as CheckboxPrimitive } from '@base-ui/react/checkbox'; import type { HTMLMotionProps, SVGMotionProps } from 'motion/react'; import type { IBaseConfig, SlotOverrides } from '../../../core/types'; /** * Available style slot names for the Checkbox component. * Each slot maps to a visual region that can be customized via the `slots` prop. * * - `root` - The outer checkbox button element * - `indicator` - The SVG checkmark/indeterminate indicator * * @example * ```tsx * * ``` */ export type CheckboxSlot = 'root' | 'indicator'; /** * Internal context type for Checkbox state management. * Shared between the Checkbox root and its child components via React context. */ export type CheckboxContextType = { /** Whether the checkbox is currently checked. */ isChecked: boolean; /** Callback to update the checked state. */ setIsChecked: ICheckboxProps['onCheckedChange']; /** Whether the checkbox is in an indeterminate state. */ isIndeterminate: boolean | undefined; }; /** * Configuration options for Checkbox behavior and animation. * Extends the base config with checkbox-specific settings. * * @example * ```tsx * * ``` */ export interface ICheckboxConfig extends IBaseConfig { /** * Scale factor applied when the checkbox is tapped. * @defaultValue 0.95 */ tapScale?: number; /** * Scale factor applied when the checkbox is hovered. * @defaultValue 1.05 */ hoverScale?: number; } /** * Props for the Checkbox root component. * Combines Base UI Checkbox.Root props (without `render`) with Motion button props, * plus slot overrides and configuration. * * @example * ```tsx * * ``` */ export type ICheckboxProps = Omit, 'render'> & HTMLMotionProps<'button'> & { /** Partial class overrides for each visual slot. */ slots?: SlotOverrides; /** Behavioral and animation configuration. */ config?: ICheckboxConfig; }; /** * Props for the CheckboxIndicator sub-component. * Extends SVG motion props for the animated checkmark/indeterminate indicator. * * @example * ```tsx * * ``` */ export type ICheckboxIndicatorProps = SVGMotionProps & { /** Partial class overrides for each visual slot. */ slots?: SlotOverrides; }; //# sourceMappingURL=Checkbox.types.d.ts.map