"use strict";
const jsxRuntime = require("react/jsx-runtime");
const styles_lib_components_Box_Box_cjs = require("../Box/Box.cjs");
const styles_lib_components_Accordion_AccordionItem_cjs = require("../Accordion/AccordionItem.cjs");
const styles_lib_components_MenuItem_useMenuItem_cjs = require("../MenuItem/useMenuItem.cjs");
const styles_lib_components_MenuItemCheckbox_MenuItemCheckbox_css_cjs = require("./MenuItemCheckbox.css.cjs");
const MenuItemCheckbox = ({
  children,
  onChange,
  checked,
  data,
  badge,
  id
}) => {
  const { menuItemProps, MenuItemChildren } = styles_lib_components_MenuItem_useMenuItem_cjs.useMenuItem({
    onClick: () => onChange(!checked),
    formElement: true,
    data,
    id
  });
  return /* @__PURE__ */ jsxRuntime.jsxs(
    styles_lib_components_Box_Box_cjs.Box,
    {
      ...menuItemProps,
      "aria-checked": checked,
      role: "menuitemcheckbox",
      component: "button",
      type: "button",
      display: "flex",
      alignItems: "center",
      children: [
        /* @__PURE__ */ jsxRuntime.jsx(
          styles_lib_components_Box_Box_cjs.Box,
          {
            component: "span",
            borderRadius: "standard",
            boxShadow: "borderField",
            position: "relative",
            background: { lightMode: "surface" },
            marginRight: "small",
            flexShrink: 0,
            className: styles_lib_components_MenuItemCheckbox_MenuItemCheckbox_css_cjs.checkboxSize,
            children: /* @__PURE__ */ jsxRuntime.jsx(
              styles_lib_components_Box_Box_cjs.Box,
              {
                component: "span",
                position: "absolute",
                inset: 0,
                background: "formAccent",
                borderRadius: "standard",
                transition: "fast",
                opacity: checked ? void 0 : 0,
                children: /* @__PURE__ */ jsxRuntime.jsx(styles_lib_components_Accordion_AccordionItem_cjs.IconTick, { size: "fill" })
              }
            )
          }
        ),
        /* @__PURE__ */ jsxRuntime.jsx(
          MenuItemChildren,
          {
            tone: void 0,
            icon: void 0,
            badge,
            formElement: true,
            children
          }
        )
      ]
    }
  );
};
MenuItemCheckbox.__isMenuItem__ = true;
exports.MenuItemCheckbox = MenuItemCheckbox;
