"use client";
import { jsx } from "react/jsx-runtime";
import { forwardRef } from "react";
import { ExperimentalChip } from "./Chip.js";
import { useControlled } from "./hooks/useControlled.js";
import { classNames } from "../utils/classNames.js";
const ExperimentalToggleChip = forwardRef(
  ({ checked: controlledChecked, defaultChecked, onChange, className, ...props }, forwardedRef) => {
    const [checked, setChecked] = useControlled(controlledChecked, defaultChecked ?? false, onChange);
    return /* @__PURE__ */ jsx(
      ExperimentalChip,
      {
        ref: forwardedRef,
        role: "checkbox",
        "aria-checked": checked,
        selected: checked ? "checked" : false,
        onClick: () => setChecked(!checked),
        className: classNames(["gds-toggle-chip", className]),
        ...props
      }
    );
  }
);
ExperimentalToggleChip.displayName = "ExperimentalToggleChip";
export {
  ExperimentalToggleChip
};
