Improve Dialog component to auto close on cancel or on submit Change logic to determine whether a dialog is using the new component Convert some files to TS