Pasta, rice, beans, and grains are all light weight and store for very long periods of time, provided they are kept dry. They do require water to prepare generally. Beans can provide a decent source of protein that is not dependent on refrigeration.
You don't say what kind of trip you are stocking the food for. Is it a long bluewater passage, or a long coastal cruise? The two trips would require very different supplies, as on a coastal trip you have the option of stopping for supplies, water, fuel and other necessities. This is generally not an option on a long bluewater passage.
A few other questions that might help.
Do you have a full galley on the sailboat?
What fuel does the stove use?
Does the boat have a watermaker?
How much potable water tankage does the boat have?
How long is the passage estimated to be?
How many crew are going to be on the passage?
I would also highly recommend that you take a large bottle of multivitamin supplements along, and take one every day of the trip to prevent any nutrient deficiency based diseases... like scurvy.