From 6ec259a0e71174651bae95d4628138bf6fd68742 Mon Sep 17 00:00:00 2001
From: kj_sh604
Date: Sun, 15 Mar 2026 16:19:35 -0400
Subject: refactor: packages/

---
 packages/excalidraw/components/MagicButton.tsx | 39 ++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 packages/excalidraw/components/MagicButton.tsx

(limited to 'packages/excalidraw/components/MagicButton.tsx')

diff --git a/packages/excalidraw/components/MagicButton.tsx b/packages/excalidraw/components/MagicButton.tsx
new file mode 100644
index 0000000..eedc63b
--- /dev/null
+++ b/packages/excalidraw/components/MagicButton.tsx
@@ -0,0 +1,39 @@
+import type { JSX } from "react";
+import clsx from "clsx";
+import type { ToolButtonSize } from "./ToolButton";
+
+import "./ToolIcon.scss";
+
+const DEFAULT_SIZE: ToolButtonSize = "small";
+
+export const ElementCanvasButton = (props: {
+  title?: string;
+  icon: JSX.Element;
+  name?: string;
+  checked: boolean;
+  onChange?(): void;
+  isMobile?: boolean;
+}) => {
+  return (
+    <label
+      className={clsx(
+        "ToolIcon ToolIcon__MagicButton",
+        `ToolIcon_size_${DEFAULT_SIZE}`,
+        {
+          "is-mobile": props.isMobile,
+        },
+      )}
+      title={`${props.title}`}
+    >
+      <input
+        className="ToolIcon_type_checkbox"
+        type="checkbox"
+        name={props.name}
+        onChange={props.onChange}
+        checked={props.checked}
+        aria-label={props.title}
+      />
+      <div className="ToolIcon__icon">{props.icon}</div>
+    </label>
+  );
+};
-- 
cgit v1.2.3

