Skip to content

Add the unified AmplHeader to @ampl/kit (v0.3.0)#5

Merged
juancobo merged 5 commits into
mainfrom
release/v0.3.0
May 30, 2026
Merged

Add the unified AmplHeader to @ampl/kit (v0.3.0)#5
juancobo merged 5 commits into
mainfrom
release/v0.3.0

Conversation

@juancobo

Copy link
Copy Markdown
Member

Adds AmplHeader, the shared two-band header for every ampl.tools tool: a white institutional band (AMPL lockup + lab-site nav, owned by the kit, with full/compact sizing) and a deep-plum WORKSHOP band (cross-tool switcher, contextual nav, EN/ES, and a signed-in account chip or sign-in link), plus a hamburger mobile sheet. All tool variation flows through props.

  • New AmplHeader exported from @ampl/kit/ui, with the DEFAULT_TOOLS registry and supporting types.
  • New --color-accent-pale token, an on-dark LocaleSwitcher variant, and a shared sign-out helper.
  • Header navigation, sign-in, and switcher strings in EN and ES (parity enforced).
  • The auth front door now renders AmplHeader (full masthead).
  • SiteHeader is deprecated in favour of AmplHeader but retained for backward compatibility.
  • Documented in CONSUMING.md and the kit README. No database migrations. Bumps @ampl/kit to 0.3.0 (additive, minor).

Copilot AI review requested due to automatic review settings May 30, 2026 22:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds AmplHeader as the unified two-band AMPL header for the kit and wires the auth app root to use it, while preserving the deprecated SiteHeader export for compatibility.

Changes:

  • Introduces the kit/ui/ampl-header component set, default tool registry, public types, mobile sheet, account menu, and shared lab navigation.
  • Adds LocaleSwitcher dark variant, shared sign-out action helper, header/switcher i18n strings, and a new accent-pale theme token.
  • Updates auth root rendering, docs, version metadata, and SSR tests for the new header.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/root.tsx Replaces the old SiteHeader composition with AmplHeader and dark locale switcher.
CONSUMING.md Documents AmplHeader, props, usage patterns, CSP notes, and v0.3.0 release notes.
kit/README.md Adds kit-level AmplHeader usage documentation.
kit/locales/en.ts Adds English header, nav, and switcher strings.
kit/locales/es.ts Adds Spanish header, nav, and switcher strings.
kit/theme.css Adds --color-accent-pale and updates accent-deep usage comments.
kit/ui/AccountWidget.tsx Reuses the shared sign-out URL helper.
kit/ui/LocaleSwitcher.tsx Adds the on-dark visual variant.
kit/ui/index.ts Exports AmplHeader, DEFAULT_TOOLS, and header types; marks SiteHeader deprecated.
kit/ui/lib/sign-out.ts Adds shared logout form action URL builder.
kit/ui/ampl-header/AccountMenu.tsx Adds signed-in account dropdown for the header.
kit/ui/ampl-header/AmplHeader.tsx Adds top-level header composition and mobile sheet state.
kit/ui/ampl-header/InstitutionalBand.tsx Adds logo/lab-nav band and mobile menu toggle.
kit/ui/ampl-header/MobileSheet.tsx Adds hamburger-controlled mobile navigation/account sheet.
kit/ui/ampl-header/ToolSwitcher.tsx Adds cross-tool native disclosure switcher.
kit/ui/ampl-header/WorkshopBand.tsx Adds plum tool band with contextual nav, locale switcher, and auth controls.
kit/ui/ampl-header/index.ts Adds barrel exports for the header module.
kit/ui/ampl-header/lab-nav.ts Adds shared lab-site navigation link registry.
kit/ui/ampl-header/tools.ts Adds default AMPL tool registry.
kit/ui/ampl-header/types.ts Adds public header prop/data contracts.
package.json Bumps package version to 0.3.0.
package-lock.json Syncs lockfile package version.
tests/kit/AmplHeader.test.ts Adds SSR rendering coverage for header states and variants.
tests/kit/LocaleSwitcher.test.ts Adds coverage for default and dark locale switcher variants.
tests/routes/root-header.test.ts Updates root header SSR tests for AmplHeader.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

aria-haspopup="true"
className="flex cursor-pointer list-none items-center gap-[11px] whitespace-nowrap"
>
<span className="font-display text-[12px] uppercase tracking-[1.5px] text-accent-pale">Workshop</span>

{/* Contextual tool nav — desktop only; mobile uses the sheet. */}
{hasNav && (
<nav className="hidden flex-1 items-center gap-[22px] md:flex">

{/* Tool nav */}
{((nav && nav.length > 0) || context) && (
<nav className="mt-5 flex flex-col gap-3 border-t border-white/20 pt-5">
@juancobo juancobo merged commit e6a7e00 into main May 30, 2026
3 checks passed
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.

2 participants