pakdatakit-react 0.2.0
pakdatakit-react 0.2.0 on its registry
Requires pakdatakit 2.4.0 (for pakdatakit/quality).
PakCheckoutFormandPakKycForm: unstyled checkout and KYC forms with full name, mobile number, province, district, optional tehsil (tehsilprop), city with suggestions from the chosen province, address, nearby place and postal code;PakKycFormadds a required CNIC. The mobile and CNIC fields reusePhoneInputandCNICInput.- Accessible markup: real
<label for>, native<select>s,requiredandaria-required,aria-invalidandaria-describedbyon errors, an error summary withrole="alert"whose links move focus to the field, and focus on the first invalid field after a blocked submit. locale="ur": Urdu labels, placeholders, errors and hints, withdir="rtl"andlang="ur"on the form. Any text can be replaced with thelabelsprop.- Controlled (
values/onChange) or uncontrolled (defaultValues) use,onSubmit(values)with trimmed values,onInvalid(errors),classNameand per-elementclassNames. - Optional delivery hints (
hintsprop,usePakHints): address completeness fromscoreAddress, warning signs fromphoneRiskSignals, and a postal code that belongs to another city. They never block submit, are announced witharia-live="polite", and loadpakdatakit/qualityand the post office directory with a dynamicimport()only when turned on, so the base form bundle stays small. - For react-hook-form and other form libraries:
pakRulesandcreatePakRules({ locale, labels })(register('cnic', pakRules.cnic)),validatePakField,validatePakForm,useLocationOptions,applyLocationChangeandsuggestCities.
Changed
Section titled “Changed”CNICInput,PhoneInputandIBANInputare marked as pure, so bundlers drop the ones you do not use.