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/PenModeButton.tsx | 46 ++++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 packages/excalidraw/components/PenModeButton.tsx

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

diff --git a/packages/excalidraw/components/PenModeButton.tsx b/packages/excalidraw/components/PenModeButton.tsx
new file mode 100644
index 0000000..ca5ceb2
--- /dev/null
+++ b/packages/excalidraw/components/PenModeButton.tsx
@@ -0,0 +1,46 @@
+import "./ToolIcon.scss";
+
+import clsx from "clsx";
+import type { ToolButtonSize } from "./ToolButton";
+import { PenModeIcon } from "./icons";
+
+type PenModeIconProps = {
+  title?: string;
+  name?: string;
+  checked: boolean;
+  onChange?(): void;
+  zenModeEnabled?: boolean;
+  isMobile?: boolean;
+  penDetected: boolean;
+};
+
+const DEFAULT_SIZE: ToolButtonSize = "medium";
+
+export const PenModeButton = (props: PenModeIconProps) => {
+  if (!props.penDetected) {
+    return null;
+  }
+
+  return (
+    <label
+      className={clsx(
+        "ToolIcon ToolIcon__penMode",
+        `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">{PenModeIcon}</div>
+    </label>
+  );
+};
-- 
cgit v1.2.3

