Skip to content

v2.0.2: LocalePicker, translatable labels, PhoneInput country control

Latest

Choose a tag to compare

@sapatmohit sapatmohit released this 28 Oct 18:24
791a6c2

Added

  • LocalePicker: new component. A searchable region picker that shows the selected region's currency, date and number formats, and first day of the week. Keyboard accessible and RTL-aware. (#49, @ujwalbajaj)
  • Translatable labels: LanguageSwitcher, PhoneInput, NavBar and TranslationWidget take an optional labels prop for their built-in text: placeholders, empty states, accessible labels and screen reader announcements. Any key you leave out keeps its English default. Each component exports a typed *Labels interface. (#81, @iNerdStack)
  • PhoneInput: displayLocale shows country names through Intl.DisplayNames, and search matches the translated name. (#81)
  • PhoneInput: the selected country can now be controlled with country and onCountryChange. defaultCountry still works for uncontrolled use. (#86, @ujwalbajaj)
  • PhoneInput: typing or pasting a number that starts with + switches to the matching country and removes the dial code, along with the separator after it. Shared codes (+1, +7) keep the current country when it matches. Digits already in the field are never consumed. (#86)
<PhoneInput
  country={country}
  onCountryChange={(c) => setCountry(c.code)}
  labels={{ searchPlaceholder: "Rechercher un pays..." }}
  displayLocale="fr"
/>

Docs

  • Redesigned sidebar, with page content framed in an inset card. (#84)
  • Search dialog now works, through a new /api/search route. (#83)
  • NavBar preview is taller, so its open menus fit, and previews accept stageClassName. (#82, @TanmayNileshShinde)
  • Removed formatter pages redirect to the components overview. (#88)
  • The docs site now runs on Next.js 16.4.2, a security update. (#85)

No breaking changes. searchPlaceholder and emptyMessage still work as aliases of the matching labels keys, and the direct prop wins when both are set.

Full changelog: v2.0.1...v2.0.2