National IDs for five Gulf countries
@dualkit/format now reads national IDs for the UAE, Saudi Arabia, Kuwait, Qatar and Bahrain. parseNationalId(input, country) returns the digits, the formatted number and what the number encodes: whether a Saudi number is a citizen ID or an Iqama, the birth date in a Kuwait Civil ID, and the birth year and nationality code in a Qatar ID.
Every result has a strength. UAE, Saudi and Kuwait numbers have a check digit, so a checksum result means it matched. Qatar and Bahrain publish no check digit, so their results say shape: the number has the right length and fixed digits, and nothing more. The Saudi check is the Luhn formula that public libraries use, because the Ministry of Interior shares the official one only on request. Oman is not covered yet, because we have not found an official source for its civil number.
The gulf-national-id-input component takes a country prop and groups, checks and sets its placeholder for that country. It still defaults to the UAE. onResult now returns a result for any of the five countries, with country and strength, so code that reads year must check that country is AE first. With no placeholder prop it now shows the example number for that country; pass placeholder="" to turn that off. The demo at /components/gulf has a country picker in English and Arabic. The new Arabic copy is a draft, and it has not had a native review yet.
@dualkit/mcp 0.2.0-beta.0 adds a national_id kind to validate, with a required country. The emirates_id kind still works. Fill Gulf samples in the Figma plugin now fills Saudi, Kuwait, Qatar and Bahrain IDs too, and picks them from layer names such as Iqama, Civil ID, QID and CPR. Every sample ID is made up.
- @dualkit/format 0.3.0-beta.0parseNationalId, plus parseSaudiId, parseKuwaitCivilId, parseQatarId and parseBahrainCpr
- @dualkit/mcp 0.2.0-beta.0validate reads national IDs for five countries
- shadcn registrygulf-national-id-input with a country prop
- Dualkit for FigmaNational ID samples for five countries. Not on Figma Community yet