In my personal experience drag and drop no longer works.
On Xcode 15 (could be even earlier) you can add a local dependency by:
- Go to File > Add Package Dependencies
- Press the “Add local” button at the button of the window
- Choose the folder containing the package
Feedback: FB13306789
I wish the documentation Editing a package dependency as a local package | Apple Developer Documentation is updated to mention the above mentioned steps.