SAN FRANCISCO — Hewlett-Packard Co. on Tuesday sued a British electronics firm that it claims stole trade secrets underpinning its printers and ink cartridges.

Represented by Morgan, Lewis & Bockius, HP accused Datel Design & Development of reverse-engineering its technology to create ink cartridges that would be compatible with HP printers. Palo Alto-based HP seeks to recover losses of more than $30 million, according to the 10-page complaint filed in the U.S. District Court for the Northern District of California.