Skip to content

chore(ui): re-sync UI components with the @nebari registry - #22

Merged
jbouder merged 3 commits into
mainfrom
chore/nebari-registry-sync
Sep 4, 2026
Merged

chore(ui): re-sync UI components with the @nebari registry#22
jbouder merged 3 commits into
mainfrom
chore/nebari-registry-sync

Conversation

@jbouder

@jbouder jbouder commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Re-syncs ui/ with the published @nebari registry as part of the cross-repo audit.

Part of nebari-dev/nebari-design#143
Closes #21

What changed

Alias drift (chore(ui): move components to the src/components/ui alias)

  • components.json ui alias @/ui@/components/ui; src/ui/ moved to src/components/ui/ and every import rewritten (tests included).
  • Root tsconfig.json gains the @/* path mapping. shadcn add reads aliases from it and, without the mapping, wrote the installed files to a literal @/ directory instead of src/.
  • avatar.tsx is not a registry item (there is no @nebari/avatar), so it moved out of components/ui/ to the app-owned src/components/avatar.tsx.
  • copyText() was appended to the registry's src/lib/utils.ts; it now lives in src/lib/clipboard.ts so utils.ts is registry-identical.

Registry re-sync (chore(ui): re-sync @nebari registry components)

  • Re-added with --overwrite: alert, badge, button, card, checkbox, code-block, dialog, dropdown-menu, field, input, label, navigation-menu, radio-group, select, slider, spinner, switch, table, tabs, textarea, toast, tooltip, utils, use-theme-preference (hook + theme provider).
  • Newly installed: @nebari/claude-skillui/.claude/skills/nebari-ui/SKILL.md.
  • The registry toast exports the Base UI manager directly (priority is derived from the toast type) instead of toast.success() / toast.error() wrappers; all 20 call sites now use toast.add({ type, title, description }).

Theme (chore(ui): adopt the @nebari/theme surface tokens)

  • src/index.css is rebuilt from the registry globals.css: adds --canvas / --header surface tokens, the --info pair, --zinc-975, --duration-loading and the skeleton pulse animation, and takes the registry's current dark --popover / --muted values.
  • Only two documented departures remain: the branding-driven derivations of --primary-hover and the sidebar tokens (guarded by tests/lib/index-css.test.ts), and the skill's app-defined header tokens (--header-border, --header-action-hover, --notification-badge, --sign-out-foreground) with their @theme inline mappings.
  • Header paints with bg-header text-header-foreground; the page body with bg-canvas. --header-border defaults to var(--border) so the bar renders as the canonical border-border while the headerBorder branding override still works.
  • The public /config.json keys headerBackground / bodyBackground keep their names and are mapped to --header / --canvas in lib/branding.ts, so existing operator branding keeps working. Chart values and docs are unchanged.

Verification

Every registry-owned file was compared byte-for-byte against registry/nebari/ at the time of the sync:

  • Byte-identical: alert, badge, card, checkbox, code-block, field, input, label, radio-group, select, slider, spinner, switch, table, tabs, textarea, tooltip, lib/utils.ts, hooks/use-theme-preference.ts, hooks/theme-provider.tsx, .claude/skills/nebari-ui/SKILL.md.
  • Identical apart from the import alias rewrite shadcn performs (@/ui/…@/components/ui/…): button, dialog, dropdown-menu, navigation-menu, toast.

Gates: npm run build (tsc -b + vite) passes; npm test passes (5 files, 51 tests).

Note for future syncs: any shadcn add of a @nebari item also re-applies the theme item, which appends flattened tokens into src/index.css and duplicates the keyframes inside @theme inline. Revert src/index.css after adding components and merge theme changes by hand (or git checkout src/index.css).

#143 checklist for this repo

  • components.json declares the @nebari registry and style: base-vega
  • ui alias points at @/components/ui; components live in src/components/ui/
  • All installed registry items re-added with --overwrite and verified against the registry
  • @nebari/utils is unmodified (app helpers live outside it)
  • @nebari/use-theme-preference installed and used for theme state
  • @nebari/claude-skill installed at the frontend root
  • @nebari/theme tokens adopted (--canvas, --header, --info, …), with app departures documented in the file header
  • No orphan non-registry files in components/ui/ (avatar moved to src/components/)
  • No hard-coded colors in app code outside components/ui/ (the only rgba(...) is the theme picker's data-checked shadow, verbatim from the skill's header recipe)
  • App header matches the skill's canonical recipe (h-14 pl-4, h-8 w-auto logo with aria-label="Go to homepage", MenuBarActions gap-2, DropdownMenu modal={false}, 248px profile menu, menuitemradio theme picker wired to useTheme, text-sign-out-foreground sign-out). No follow-up issue needed.
  • @base-ui/react at ^1.7.0 (satisfies the registry's ^1.6.0; unchanged)
  • Biome/formatter — this frontend has no lint/format tooling, so nothing to align (out of scope here)

🤖 Generated with Claude Code

jbouder and others added 3 commits September 4, 2026 12:31
Issue nebari-dev/nebari-design#143 calls out the `ui` alias drift in this
repo: components.json pointed `ui` at `@/ui`, so registry components lived
in src/ui/ instead of the conventional src/components/ui/. Move them, point
the alias at `@/components/ui`, and rewrite every import.

Also give the solution-style tsconfig.json the `@/*` path mapping, since
`shadcn add` reads aliases from it and otherwise writes files to a literal
`@/` directory.

While here, separate app-owned code from registry-owned files so the
registry files can be byte-identical:

- avatar.tsx is not a registry item (there is no @nebari/avatar); move it to
  src/components/avatar.tsx.
- copyText() lived in src/lib/utils.ts on top of the registry cn() helper;
  move it to src/lib/clipboard.ts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Re-add every installed registry item with `shadcn add --overwrite` so the
files match the published @Nebari registry: alert, badge, button, card,
checkbox, code-block, dialog, dropdown-menu, field, input, label,
navigation-menu, radio-group, select, slider, spinner, switch, table, tabs,
textarea, toast, tooltip, utils and use-theme-preference. Install the
@nebari/claude-skill so .claude/skills/nebari-ui/SKILL.md ships with the
frontend.

The registry toast no longer wraps the Base UI manager in success()/error()
helpers; it exports the manager itself, with priority derived from the
toast type. Update every caller to `toast.add({ type, title, description })`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Bring src/index.css up to date with the registry theme: the canvas → header
→ card/popover → muted surface stack (`--canvas`, `--header`), the `--info`
feedback pair, the zinc-975 primitive, the skeleton pulse animation and the
registry's current dark popover/muted values.

The file is rebuilt from the registry globals.css with only two documented
departures: the branding-driven derivations of --primary-hover and the
sidebar tokens (guarded by tests/lib/index-css.test.ts), and the
app-defined header tokens from the nebari-ui skill's header token contract
(--header-border, --header-action-hover, --notification-badge,
--sign-out-foreground).

The header now paints with `bg-header` and the page body with `bg-canvas`.
The public branding keys `headerBackground` / `bodyBackground` keep their
names and are mapped onto `--header` / `--canvas` in lib/branding.ts, so
existing /config.json overrides keep working.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jbouder
jbouder merged commit 8be3980 into main Sep 4, 2026
6 checks passed
@jbouder
jbouder deleted the chore/nebari-registry-sync branch September 4, 2026 17:57
jbouder added a commit that referenced this pull request Sep 4, 2026
The body used `bg-background`, which the @Nebari theme now resolves to
zinc-50 (the header layer), so the page rendered light gray. The registry's
page layer is `--canvas` (white in light, zinc-975 in dark), and the skill
documents `--background` as a legacy alias to avoid for page shells.

Follow-up to #22 / nebari-dev/nebari-design#143.

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-sync ui/ with the @nebari design registry

1 participant