Repository navigation
refactor(ui): migrate components from NextUI to Radix UI - #24
Merged
Merged
Conversation
… yet) Lay the groundwork for the NextUI→Radix migration without touching components: - add @radix-ui/colors + react-dialog/switch/select/label deps - tailwind: drop the nextui() plugin + dist content glob; define a 12-step token layer — gray/danger from Radix Colors, primary/secondary from the runtime engine, plus semantic aliases (background/foreground/divider/focus) and the opacity-hover/disabled tokens - globals.css: import the Radix gray/red scales (light/dark scoped to the theme-root class) and seed the built-in teal/orange brand defaults; repoint the swiper vars off --nextui-* - palette.ts: emit a Radix-semantic 12-step ramp (--primary-1..12 + contrast) per role instead of NextUI's DEFAULT/foreground; applyPalette signature unchanged so the Ladle decorator still drives it - providers.tsx: drop NextUIProvider (Primitives are headless; links route via react-router) Refs #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…/ThemeSwitch Introduce the headless-Radix + Tailwind replacements for NextUI primitives, all on the 12-step token scale: - new atoms: Button, Link (react-router-aware), Switch (@radix-ui/react-switch), Alert, Spinner, Modal (@radix-ui/react-dialog), Select (@radix-ui/react-select). Modal + Select portal into the theme root so overlays stay brand/light-dark themed (fixes the embedded-overlay gap noted in providers.tsx). - rebuild Chip on tv() (no NextUI), Fallbacks on the new Spinner/Alert, and ThemeSwitch as a plain icon toggle (drops useSwitch). Refs #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replace the remaining NextUI usage with the new Radix-based primitives and rebind every semantic token class to the Radix 12-step scale: - Navbar: custom top bar from primitives (drops the dead, toggle-less mobile menu); SearchBar: the new Switch; List: a scroll-listener shadow wrapper; EventImages: native <img>; ListItem/ListHeader/EventItem/EventDetails/event: the new Link; EventShare: Modal + a click-to-copy field. - EventRegistration: Modal + native form fields + the Radix Select bridged to react-hook-form via Controller (string↔coerced-Date), Alert for notices. - token rebind across components + stories: default-N/content1 → gray steps, brand tints 10/50/100/900 → 2/3/4/11, text-tiny/small → text-xs/sm, NextUI border-width utilities → Tailwind equivalents. Refs #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The widget no longer imports NextUI anywhere; drop the dependency. Closes the migration from NextUI to Radix Primitives + Tailwind. Closes #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Dialog/Select portaled into getThemeRoot(), which is the document element standalone/in Ladle — and a <div> can't be a valid child of <html>, triggering validateDOMNesting + aria-hidden warnings (caught in Ladle). Add overlayContainer(): the theme root when it's the widget wrapper (keeps overlays brand/theme-scoped), else <body> (still inherits the html-level theme class + vars). Refs #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Button, Link, Switch, Alert, Spinner, Modal, and Select each get a story so the component library previews them (light/dark + brand palette) per DESIGN_SYSTEM. Refs #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…als, gates - reuse the Icons-barrel DownArrowIcon (Select) and AnchorIcon (Link) instead of inline one-off SVGs - route the floating-ui overlays (Dropdown, EventTime) through overlayContainer() too, so every overlay stays brand/light-dark scoped (overlayContainer is now SSR-safe — returns undefined with no DOM) - List scroll-shadow: coalesce scroll/resize to one rAF and bail out of no-op re-renders; passive resize listener - gate the static globals.css brand defaults against buildScale(DEFAULT_SEEDS) (new palette.defaults.test.ts) so the ladder can't silently desync Refs #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- EventRegistration: reset the thank-you state when the footer Cancel/Okay buttons close the modal (they bypass Radix's onOpenChange), so reopening shows the form, not the previous confirmation [HIGH] - EventDetails: the dark month badge used dark:bg-primary-11 (a light text step) as a surface → near-invisible; use a dark component-bg step [MED] - List: drop the inert scroll-shadow machinery — the Panel is the scroll container, so the <ul> never scrolled and no fade ever showed; back to a plain styled <ul> [MED] - Modal: drop the dead data-[state=open]:animate-in (plugin not installed) - Button: loading spinner inherits the button's text colour (currentColor) instead of always grey - SearchBar: guard the eventCount count against a falsy-0 leak - EventImages: drop the redundant h-full on the carousel img Refs #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Spinner: the spinning element was a <span> — an inline box, where CSS
transform (and width/height) is ignored, so animate-spin did nothing. Switch
to the canonical Radix/Tailwind-ecosystem approach: an <svg> with animate-spin
and currentColor (Radix Primitives ships no spinner).
- Link: an explicit `color` now uses Tailwind's `!` modifier so it beats the
global `a { color: inherit !important }` rule; `default` still inherits.
Refs #22
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… preview - Regroup Ladle stories: EventDetails/Map/MapSearch and LanguageSelector/ ThemeSwitch → Molecules; SearchBar → Organisms (story `title` only; the component folders are unchanged). - EventTime story: wrap each example in the "Time Zone" section in a block so the inline-rendering EventTime examples stack on their own lines. - Ladle decorator: give the story wrapper `bg-background` so the whole preview area follows the app theme — so a story's own <ThemeSwitch> visibly flips the background too, not just Ladle's toolbar (Ladle's own chrome stays on its theme, as expected). Refs #22 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Deploying atlas-legacy with
|
| Latest commit: |
3e38493
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://9f3b912c.syatlas.pages.dev |
| Branch Preview URL: | https://refactor-nextui-to-radix.syatlas.pages.dev |
This was referenced Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@nextui-org/reactdependency. ~12 distinct NextUI components across 17 files are replaced with headless-Radix +tailwind-variantsatoms, all consuming a Radix-style 12-step token scale instead of NextUI'sDEFAULT/foreground-only model.@radix-ui/colors, brand primary/secondary from the feat(ui): white-label brand palette for the embedded widget #16 runtime palette engine — so the white-label brand-palette repaint keeps working through every new component (verified: switching tenant palette repaints chips/buttons/links/nav/swiper live, light & dark).@react-ariasubtree NextUI dragged in collapses).Changes
tailwind.config.js(drops thenextui()plugin; addsgray/primary/secondary/danger1–12 + semantic aliases),globals.css(imports the Radix gray/red scales scoped to the theme-root class + seeds the built-in teal/orange defaults),src/config/theme/palette.ts(emits a 12-step--primary/--secondaryramp;applyPalettesignature unchanged so the Ladle decorator still drives it),providers.tsx(dropsNextUIProvider).Button,Link(react-router-aware),Switch,Alert,Spinner,Modal(Dialog),Select— each with a Ladle story.Modal/Selectand the floating-ui overlays (Dropdown/EventTime) now portal into the theme root viasrc/lib/overlay.ts, which fixes the long-standing embedded-overlay theming gap noted inproviders.tsx.Chip/Fallbacks/ThemeSwitch; migrated all molecules/organisms/pages (Navbar, SearchBar, List, EventImages, EventShare, EventDetails, EventRegistration — Modal + native form + Radix Select bridged to react-hook-form viaController).palette.defaults.test.tsgate asserts the staticglobals.cssbrand defaults equalbuildScale(DEFAULT_SEEDS), so the ladder can't silently desync.Verification
ladle:build✓grep -rl "@nextui-org" src tailwind.config.js→ no matches.Manual / visual verification
Driven in Ladle via Playwright (light & dark, with non-default
wemeditate.com/sahajayoga.orgbrand palettes):Two checks the node lane can't cover, for the reviewer: the registration form submit (needs a SahajCloud backend — rendering + select interaction verified in Ladle), and overlay theming inside the actual embedded widget (verified standalone/Ladle; the wrapper-portal path only runs when embedded).
Notes for reviewer
<head>/global-CSS control — plus the existingtailwind-variants+ CSS-var brand engine). Shipped as one PR per request.<div>can't be a child of<html>standalone/Ladle) and the code-review findings (modal thank-you reset, dark badge step, inert scroll-shadow, spinner colour, falsy-0guard).select-allfor manual copy (the same constraint the old NextUISnippethad).security-review(public-bundle threat model) came back clean: all five Radix packages are authentic scoped packages, the transitive surface shrank, overlay portaling improves host-page isolation, and no new HTML/secret sinks were introduced.Follow-up polish (later commits)
<svg>withanimate-spin+currentColor(the previous<span>ring didn't animate:transformis ignored on inline elements).coloruses Tailwind's!modifier so it beats the globala { color: inherit !important }rule (defaultstill inherits).bg-backgroundso a story's own<ThemeSwitch>visibly themes the whole preview area.Closes #22
🤖 Generated with Claude Code