) => {
- void this.autoCopy();
- onClick?.(event);
- }}
- onFocus={(event) => {
- this.active = true;
- onFocus?.(event);
- }}
- onBlur={(event) => {
- this.active = false;
- onBlur?.(event);
- }}
- {...props}
- >
- $
-
- {text.slice(0, shownIndex)}
-
-
- Copied!
-
-
- );
- }
-}
+ )}
+ {...props}
+ >
+
+ $
+
+
+ {children}
+
+ {children}
+ {children}
+
+);
+
+CommandLine.displayName = "CommandLine";
diff --git a/registry/new-york/blocks/copy-overlay/example.tsx b/registry/new-york/blocks/copy-overlay/example.tsx
new file mode 100644
index 0000000..4ac9f07
--- /dev/null
+++ b/registry/new-york/blocks/copy-overlay/example.tsx
@@ -0,0 +1,19 @@
+"use client";
+
+import { CopyOverlay } from "./index";
+
+const command = "npx shadcn-helper add @mobx-restful-shadcn/copy-overlay";
+
+export const CopyOverlayExample = () => (
+
+
+
+ $
+
+
+ {command}
+
+ {command}
+
+
+);
diff --git a/registry/new-york/blocks/copy-overlay/index.tsx b/registry/new-york/blocks/copy-overlay/index.tsx
new file mode 100644
index 0000000..238316d
--- /dev/null
+++ b/registry/new-york/blocks/copy-overlay/index.tsx
@@ -0,0 +1,69 @@
+"use client";
+
+import { observable } from "mobx";
+import { observer } from "mobx-react";
+import { Component } from "react";
+import { sleep } from "web-utility";
+
+import { cn } from "@/lib/utils";
+
+export interface CopyOverlayProps {
+ children: string;
+ copiedLabel?: string;
+}
+
+@observer
+export class CopyOverlay extends Component