Trump's act was incredibly foolish but actually legal, given that a President may decide at any time to declassify material and thereafter reveal it to whomever he wishes. But what is legal and what is right are not mutually inclusive.
The damage done by Trump here cannot be understated. US security was directly compromised and will remain that way at least throughout his presidency because foreign intelligence agencies will be far more reluctant to share any intel with the United States.
Such intel shared in the past has prevented terrorist attacks on Americans, American planes, and the homeland itself. But now, with that pipeline turned off, if there is a direct terrorist threat on America, US authorities may not receive warning intel out of fear that sharing it might result in Trump compromising their sources.
As a result, Americans may die because of Trump's carelessness and incompetence.
A great deal has been written about this in the last thirty-six hours. Hands down, the best piece I've read is by Jack Goldsmith, a Harvard Law School professor and former assistant attorney general during George W. Bush's presidency (link here).
Even though he's a Republican, Goldsmith clearly puts country before party as he blasts Trump for what he's done. It's a compelling read and not at all "legalese" -- it's easy reading for the lay reader.
Goldsmith lays out a nine-count indictment of sorts summing up the problem and the damage succinctly. The last count bluntly tells an inconvenient truth: "Trump’s alleged screw-up with the Russians reveals yet again what we have learned many times in the last four months: The successful operation of our government assumes a minimally competent Chief Executive that we now lack."
Read this piece and share it with everyone you know. America is now in a crisis like it has never seen before. Something must be done before it's too late.