Repository navigation
v1.1.0
Heads up if you already use this package
NavBar no longer uses next/link. It renders plain <a> elements so the
library works outside Next.js. If you were relying on client-side navigation, pass
your router's link component to restore it:
import Link from "next/link";
<NavBar links={links} linkComponent={Link} />Without that change your nav links still work, but they do a full page load.
NavBarLocale type is gone. Import Locale instead — NavBar and
LanguageSwitcher now share one type.
@babelize/elements/style.css is gone. That subpath never resolved to a real
file, so importing it always errored.
Everything else is backwards compatible: currentLocale, onLocaleChange,
onChange, and showFlag still work as deprecated aliases.
Fix the published package and unify the component API.
The published package now actually resolves. build:lib used plain tsc, which
does not rewrite tsconfig paths, so every compiled component shipped
import { cn } from "@/lib/utils" — an unresolvable specifier. npm install @babelize/elements followed by import { LanguageSwitcher } failed for every
consumer. The build now uses tsup and emits real ESM (dist/index.js) plus real
CJS (dist/index.cjs) with resolved imports and correct extensions. A packaging
smoke test installs the tarball into a bare project on every CI run.
Breaking changes
exports["./style.css"]is removed. It pointed at a file the build never
produced, soimport "@babelize/elements/style.css"was always an error.NavBarno longer importsnext/link. It renders plain<a>elements by
default and acceptslinkComponentfor client-side routing:
<NavBar linkComponent={Link} />.nextis no longer a dependency of any kind,
so the library works in any React app.Localeis now a single shared interface exported once from the package root.
TheNavBarLocalealias is gone —NavBar'sLocaleandLanguageSwitcher's
Localewere two different shapes hidden behind that alias.NavBarprops:currentLocale→value,onLocaleChange→onValueChange.PhoneInputprops:onChange→onValueChange,showFlag→showFlags.
The old names still work for this release and warn as deprecated.
Fixes
PhoneInput'svalueandLanguageSwitcher'sdefaultValueonly seeded
internal state and never synced, so both components were uncontrolled no matter
what the parent passed. All three components now support real controlled mode
viavalueand uncontrolled mode viadefaultValue.LanguageSwitcherfiredonValueChangetwice per selection.- The Gujarati flag emoji used a non-regional-indicator codepoint and rendered as
garbage.
Additions
- All three components forward refs and spread unknown props onto their root
element, soid,name,aria-*, anddata-*now pass through.PhoneInput
forwards its ref to the underlying<input>and acceptsname, making it
usable in plain HTML forms. cnandCOUNTRIESare exported from the package root.next-themesis no longer a runtime dependency; it was only used by the docs site.
Also in this release
Add shadcn-compatible component registry (/r/[name].json + /registry.json) and a bundled CLI (npx @babelize/elements add <component> / list). Components are now styled with plain Tailwind classes instead of CSS-variable design tokens, and the theming docs/theme-switcher demos have been removed.