// packages/block-editor/src/components/text-transform-control/index.js
import clsx from "clsx";
import { __ } from "@wordpress/i18n";
import {
  reset,
  formatCapitalize,
  formatLowercase,
  formatUppercase
} from "@wordpress/icons";
import {
  __experimentalToggleGroupControl as ToggleGroupControl,
  __experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon
} from "@wordpress/components";
import { jsx } from "react/jsx-runtime";
var TEXT_TRANSFORMS = [
  {
    label: __("None"),
    value: "none",
    icon: reset
  },
  {
    label: __("Uppercase"),
    value: "uppercase",
    icon: formatUppercase
  },
  {
    label: __("Lowercase"),
    value: "lowercase",
    icon: formatLowercase
  },
  {
    label: __("Capitalize"),
    value: "capitalize",
    icon: formatCapitalize
  }
];
function TextTransformControl({ className, value, onChange }) {
  return /* @__PURE__ */ jsx(
    ToggleGroupControl,
    {
      isDeselectable: true,
      __nextHasNoMarginBottom: true,
      __next40pxDefaultSize: true,
      label: __("Letter case"),
      className: clsx(
        "block-editor-text-transform-control",
        className
      ),
      value,
      onChange: (newValue) => {
        onChange(newValue === value ? void 0 : newValue);
      },
      children: TEXT_TRANSFORMS.map((option) => {
        return /* @__PURE__ */ jsx(
          ToggleGroupControlOptionIcon,
          {
            value: option.value,
            icon: option.icon,
            label: option.label
          },
          option.value
        );
      })
    }
  );
}
export {
  TextTransformControl as default
};
//# sourceMappingURL=index.js.map
