Repository navigation
pakdatakit-react 0.2.0
·
28 commits
to main
since this release
pakdatakit-react 0.2.0 · Package · Docs · Playground
Requires pakdatakit 2.4.0 (for pakdatakit/quality).
Added
PakCheckoutFormandPakKycForm: unstyled checkout and KYC forms with
full name, mobile number, province, district, optional tehsil (tehsil
prop), 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,requiredand
aria-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, with
dir="rtl"andlang="ur"on the form. Any text can be replaced with the
labelsprop.- Controlled (
values/onChange) or uncontrolled (defaultValues) use,
onSubmit(values)with trimmed values,onInvalid(errors),className
and 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/quality
and 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:
pakRulesand
createPakRules({ locale, labels })(register('cnic', pakRules.cnic)),
validatePakField,validatePakForm,useLocationOptions,
applyLocationChangeandsuggestCities.
Changed
CNICInput,PhoneInputandIBANInputare marked as pure, so bundlers
drop the ones you do not use.