"use client"; import { cnb } from "cnbuilder"; import { type CSSProperties, type HTMLAttributes, type InputHTMLAttributes, type LabelHTMLAttributes, type ReactElement, type ReactNode, type Ref, } from "react"; import { type ComponentWithRippleProps } from "../interaction/types.js"; import { useElementInteraction } from "../interaction/useElementInteraction.js"; import { type PropsWithRef } from "../types.js"; import { useEnsuredId } from "../useEnsuredId.js"; import { FormMessageContainer } from "./FormMessageContainer.js"; import { InputToggleIcon } from "./InputToggleIcon.js"; import { Label } from "./Label.js"; import { type InputToggleSize } from "./inputToggleStyles.js"; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { type LabelClassNameOptions } from "./types.js"; import { type FormComponentStates, type FormMessageContainerExtension, } from "./types.js"; /** * @since 6.0.0 */ export interface ConfigurableInputToggleIconProps { /** * @see {@link InputToggleSize} * @defaultValue `"normal"` */ size?: InputToggleSize; /** * The icon to use while unchecked. This defaults to the unchecked * checkbox/radio icon from the `ICON_CONFIG`. * * @defaultValue `getIcon(props.type)` */ icon?: ReactNode; /** * The icon to use while unchecked. This defaults to the unchecked * checkbox/radio icon from the `ICON_CONFIG`. * * @defaultValue `getIcon(``${props.type}Checked``)` */ checkedIcon?: ReactNode; /** * Any props that should be passed to the `` that surrounds the current * icon element. */ iconProps?: PropsWithRef>; /** * Optional style to set on the `` that surrounds the current icon * element. */ iconStyle?: CSSProperties; /** * Optional className to set on the `` that surrounds the current icon * element. */ iconClassName?: string; } /** * @since 6.0.0 */ export interface InputToggleLabelProps { /** * An optional label to display with the checkbox. If this is omitted, it is * recommended to provide an `aria-label` for accessibility. */ label?: ReactNode; /** * Any props that should be passed to the `