Repository navigation
Description
Summary
Migrate the widget's UI components from NextUI v2 (@nextui-org/react) to
Radix UI (Radix Primitives, optionally Radix Themes) so the app can consume
Radix Colors' full 12-step semantics end-to-end. This is the larger, deferred
companion to #16: that ticket adopts Radix Colors as the runtime palette
engine but keeps NextUI, so components only ever consume NextUI's DEFAULT +
foreground model — not Radix's full ramp (step 1/2 app/subtle backgrounds,
step 3/4/5 component bg/hover/active, step 6/7/8 borders/focus, step 9/10
solids, step 11/12 text). Moving the components themselves onto Radix unlocks the
complete, APCA-backed readability guarantee through every layer and removes the
NextUI dependency entirely. Follows #16.
Proposed changes
Replace ~12 distinct NextUI components across ~100 JSX call sites in 16 files with
Radix equivalents (or custom primitives where Radix has no match), and rewire
theming to consume Radix's 12-step semantic steps instead of NextUI's
DEFAULT/foreground.
Components with a direct Radix Primitive / Themes mapping:
- Link (~11) →
@radix-ui/themesLinkor plain anchors wired to
react-router(keep the existing<Link>/useNavigatepattern from
.claude/rules/components.md). - Button (~11) → Radix
Button. - Image (~8) → native
<img>/ RadixAspectRatiowrapper. - Switch (~4) →
@radix-ui/react-switch. - Modal + ModalContent/Header/Body/Footer (~10, in
src/components/organisms/EventRegistration/EventRegistration.tsxand
src/components/molecules/EventShare/EventShare.tsx) →@radix-ui/react-dialog. - Alert (~2) → Radix
Calloutor a custom Tailwind alert. - Form / Select / SelectItem / Input / Textarea (~12, all in
src/components/organisms/EventRegistration/EventRegistration.tsx) →
@radix-ui/react-form+react-select(or@radix-ui/react-select) for the
selects, native inputs/textarea styled with Tailwind. - Snippet (~1,
EventShare.tsx) → custom copy-to-clipboard primitive. - ScrollShadow (~2,
src/components/molecules/List/List.tsx) → custom
scroll-shadow wrapper (CSS mask / scroll listener).
Components with NO direct Radix primitive — build from Radix primitives + Tailwind:
- Chip (~23) —
src/components/atoms/Chip/Chip.tsx(keeps its singletv()). - Spinner (~2) —
src/components/atoms/Fallbacks/Fallbacks.tsx. - Navbar suite (NavbarBrand/Content/Item/Menu, ~6) —
src/components/molecules/Navbar/Navbar.tsx.
NextUI hooks + style utils to replace:
useDisclosure(×2) → RadixDialogcontrolledopen/onOpenChangestate:
src/components/organisms/EventRegistration/EventRegistration.tsx:59,
src/components/molecules/EventShare/EventShare.tsx:29.useSwitch(×1) →@radix-ui/react-switchrender:
src/components/atoms/ThemeSwitch/ThemeSwitch.tsx:21.link as linkStyles(×1) → Tailwind/tv()link variant:
src/components/molecules/Navbar/Navbar.tsx:11.
Providers + build wiring:
- Replace
NextUIProvider(src/providers.tsx:1,16) with Radix'sTheme
provider (if adopting Radix Themes) or nothing (Primitives need no provider);
keepnavigate/useHrefrouting wired for links. - Remove the NextUI Tailwind plugin and content globs from
tailwind.config.js
(import { nextui } from '@nextui-org/theme'line 1, the
@nextui-org/theme/distcontent glob line 173, thenextui({…})plugin entry
line 227) and re-express the design tokens against Radix's 12-step scales. - Drop
@nextui-org/react(package.json:26) and@nextui-org/themefrom
dependencies.
Out of scope (do NOT change):
- Mapbox layer colors —
src/components/organisms/Mapbox/layers.ts:23(#FFFFFF
text) and:75(#888line) are hardcoded and intentionally theme-agnostic. - Theme system —
src/hooks/use-theme.ts(initTheme, the rootlight/dark
class toggle at:37,:64),.ladle/components.tsx. Already library-agnostic;
it stays. The new components must continue to key off the rootlight/dark
class.
Acceptance criteria
-
@nextui-org/reactand@nextui-org/themeare removed frompackage.json;
grep -rl "@nextui-org" src tailwind.config.jsreturns no matches. - All ~100 call sites across the 16 files are replaced with Radix equivalents
or custom Radix-primitive-based components (Chip, Spinner, Navbar built
custom; Modal→Dialog; form suite→@radix-ui/react-form+ select lib). -
useDisclosure(×2) anduseSwitch(×1) NextUI hooks are gone;link as linkStylesis replaced with a Tailwind/tv()variant. - Components consume Radix's 12-step semantic steps (subtle bg / component
bg+hover+active / border+focus / solid / text) rather than only NextUI's
DEFAULT+foreground. - The white-label brand palette from feat(ui): white-label brand palette for the embedded widget #16 still applies correctly through the
new Radix components (per-embedprimaryColor/secondaryColorprops and
client-record palette repaint chips, buttons, links, nav, panels). - Light and dark mode verified in Ladle across atoms, molecules, and organisms;
no visual regression vs. the current NextUI build. - Mapbox layer colors (
layers.ts) and the theme system (use-theme.ts,
.ladle/components.tsx) are unchanged. -
pnpm lint && pnpm typecheck && pnpm test:run && pnpm build && pnpm ladle:buildall pass. - Verified in the running widget via Playwright (atoms/molecules/organisms,
light & dark, with a non-default brand palette applied).
Files affected
16 files import @nextui-org/react:
src/components/atoms/Chip/Chip.tsx(custom rebuild, ~23 sites)src/components/atoms/Fallbacks/Fallbacks.tsx(Spinner, custom)src/components/atoms/Lightbox/Lightbox.stories.tsxsrc/components/atoms/ThemeSwitch/ThemeSwitch.tsx(useSwitch)src/components/molecules/EventImages/EventImages.tsx(Image)src/components/molecules/EventItem/EventItem.tsxsrc/components/molecules/EventShare/EventShare.tsx(Modal, Snippet,useDisclosure)src/components/molecules/List/List.tsx(ScrollShadow)src/components/molecules/List/ListHeader.tsxsrc/components/molecules/ListItem/ListItem.tsxsrc/components/molecules/Navbar/Navbar.tsx(Navbar suite,linkStyles, custom)src/components/molecules/SearchBar/SearchBar.tsxsrc/components/organisms/EventDetails/EventDetails.tsxsrc/components/organisms/EventRegistration/EventRegistration.tsx(Modal + form suite,useDisclosure)src/pages/event.tsxsrc/providers.tsx(NextUIProvider)
Plus build/config:
package.json(remove@nextui-org/react,@nextui-org/theme; add@radix-ui/*)tailwind.config.js(drop NextUI plugin + content globs; rebind tokens to Radix scales)
Token surface: ~74 semantic-token references across ~31 files; no hardcoded
hex/arbitrary colors in components, so the rebind is to semantic steps only.
tv() (tailwind-variants) is used in Dropdown.tsx (×2, token-based) and
Chip.tsx (×1, no colors) — both stay on tv().
References
- Follows feat(ui): white-label brand palette for the embedded widget #16 (
feat(ui): white-label brand palette for the embedded widget)
— adopts Radix Colors at runtime while keeping NextUI; this ticket is its
deferred component-migration sequel. - Radix Colors 12-step scale semantics (app/subtle bg → component bg/hover/active
→ borders/focus → solids → text) with APCA-backed contrast guarantees. - Radix Primitives + Radix Themes for component replacements; Dialog for Modal,
react-formfor the registration form,react-switchfor ThemeSwitch. .claude/rules/components.md— atomic tiers,tv()styling, widget/embedding
constraints the new components must keep.- Rough estimate: ~2–4 weeks; risk concentrated in the custom Chip/Spinner/Navbar
and the EventRegistration form suite.
Metadata
Metadata
Assignees
Labels
Type
Fields
Hold Until
Activity
Ardnived commentedon Jun 30, 2026
Carry-over from #16 / PR #23 — overlay portal theming
PR #23 (white-label palette) scopes the brand CSS vars and the
light/darkclass to the widget's own wrapper, so the embed never mutates the host page's
<html>. NextUI overlays (Modal/Dropdown/Popover) portal todocument.body—outside that wrapper — so in the embedded widget they inherit neither the
brand vars nor the theme class (default-themed, and wrong neutrals in dark mode).
There's no global
portalContaineronNextUIProvider, so #16 left this as aknown limitation (overlays aren't in its ACs). See the note left at the provider
site in
src/providers.tsx.This migration should close the gap. Radix
Dialog/Select/Popoveralsoportal to
document.bodyby default, so when replacing the NextUI overlays:BrandTheme/setThemeRootadopts as the theme root(
src/config/theme/BrandTheme.tsx) — e.g.Dialog.Portal container={…}(andthe equivalent for
Select/Popover), or a single shared portal-containercontext. Then portalled overlays inherit the wrapper-scoped brand palette +
light/darkclass.EventShare.tsx(ShareModal),EventRegistration.tsx(registration Modal + Select),
LanguageSelector.tsx(Dropdown).Suggested extra acceptance criterion:
brand palette and the correct light/dark neutrals — not the default
theme — verified with a non-default
primaryColorin both modes.fix(ui): animate the Spinner (SVG) and let Link colours apply
chore(ladle): regroup stories + fix EventTime layout and theme-switch…
refactor(ui): migrate components from NextUI to Radix UI (#24)