54 lines
1.5 KiB
JavaScript
54 lines
1.5 KiB
JavaScript
'use client'
|
|
import {
|
|
StyledMenuItem
|
|
} from "./chunk-M565QO7N.mjs";
|
|
import {
|
|
MenuIcon
|
|
} from "./chunk-HB6KBUMZ.mjs";
|
|
import {
|
|
useMenuOption
|
|
} from "./chunk-SANI5SUM.mjs";
|
|
|
|
// src/menu-item-option.tsx
|
|
import { forwardRef } from "@chakra-ui/system";
|
|
import { cx } from "@chakra-ui/shared-utils";
|
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
var CheckIcon = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 14 14", width: "1em", height: "1em", ...props, children: /* @__PURE__ */ jsx(
|
|
"polygon",
|
|
{
|
|
fill: "currentColor",
|
|
points: "5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"
|
|
}
|
|
) });
|
|
var MenuItemOption = forwardRef(
|
|
(props, ref) => {
|
|
const { icon, iconSpacing = "0.75rem", ...rest } = props;
|
|
const optionProps = useMenuOption(rest, ref);
|
|
return /* @__PURE__ */ jsxs(
|
|
StyledMenuItem,
|
|
{
|
|
...optionProps,
|
|
className: cx("chakra-menu__menuitem-option", rest.className),
|
|
children: [
|
|
icon !== null && /* @__PURE__ */ jsx(
|
|
MenuIcon,
|
|
{
|
|
fontSize: "0.8em",
|
|
marginEnd: iconSpacing,
|
|
opacity: props.isChecked ? 1 : 0,
|
|
children: icon || /* @__PURE__ */ jsx(CheckIcon, {})
|
|
}
|
|
),
|
|
/* @__PURE__ */ jsx("span", { style: { flex: 1 }, children: optionProps.children })
|
|
]
|
|
}
|
|
);
|
|
}
|
|
);
|
|
MenuItemOption.id = "MenuItemOption";
|
|
MenuItemOption.displayName = "MenuItemOption";
|
|
|
|
export {
|
|
MenuItemOption
|
|
};
|
|
//# sourceMappingURL=chunk-B3RAGXFV.mjs.map
|