Copy Button
Copies code, commands, or identifiers and reports pending, success, and failure in the same action location.
Usage
While data-state="copying" / aria-busy="true", repeated activation is ignored. An empty source sets error without writing the clipboard. data-copy-reset returns the control to ready after success feedback.
Standalone controller
The controller is idempotent; the complete package can instead import @a3s-lab/ui/all once. The host performs permission and business validation through cancelable before-* events.
Contract
Product boundary
Copy must not disguise download, sharing, or authorization. The host explicitly supplies sensitive values; the component never reads the clipboard or protected data on its own.
The component publishes a reusable interaction boundary only. Data fetching, persistence, permission, trusted content, and business entities remain host-owned.
Accessibility
Keyboard Enter/Space activates the native button. Feedback stays in the same control via aria-live. Copying announces busy state without changing control geometry; success and failure remain text, not color alone.
