(a) The contract of an insane, a mentally ill, an intellectually disabled, or a mentally incompetent person who has never been adjudicated to be insane, mentally ill, intellectually disabled, or mentally incompetent to the extent that he is incapable of managing his estate as prescribed by this Code is not absolutely void but only voidable, except that a contract made by such person during a lucid interval is valid without ratification.
(b) After the fact that a person is insane, mentally ill, intellectually disabled, or mentally incompetent to the extent that he is incapable of managing his estate has been established by a court of competent jurisdiction in this state and the affairs of such person are vested in a guardian, the power of such person to contract, even though restored to sanity, shall be entirely gone; any contracts made by such person shall be absolutely void until the guardianship is dissolved. One may recover for necessaries furnished an insane person, a mentally ill person, an intellectually disabled person, or a mentally incompetent person upon the same proof as if furnished to minors.