Skip to content

feat(main-page): add MainPage compound component#1148

Merged
ByronDWall merged 14 commits intomainfrom
CRAFT-2167-create-main-page-component
Mar 17, 2026
Merged

feat(main-page): add MainPage compound component#1148
ByronDWall merged 14 commits intomainfrom
CRAFT-2167-create-main-page-component

Conversation

@ByronDWall
Copy link
Contributor

@ByronDWall ByronDWall commented Feb 24, 2026

Summary

  • Adds MainPage compound component for top-level page layouts (replaces AppKit's InfoMainPage, FormMainPage, CustomFormMainPage, TabularMainPage)
  • Sub-components: Root, Header, Title, Subtitle, Actions, Content, Footer — all using semantic HTML landmarks
  • CSS grid layout with collapsible footer row and two-column header grid
  • Full documentation: designer overview with accessibility section, implementation docs with live examples, guidelines with do/don't patterns, consumer test examples, and AppKit migration guide
  • Stories use accessible role-based queries and include autodocs

Test plan

  • Unit tests pass (pnpm test packages/nimbus/src/components/main-page/)
  • Storybook stories render correctly with play function tests
  • TypeScript compiles without errors
  • Live examples in MDX docs render correctly

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nimbus-documentation Ready Ready Preview, Comment Mar 17, 2026 3:51pm
nimbus-storybook Ready Ready Preview, Comment Mar 17, 2026 3:51pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 24, 2026

🦋 Changeset detected

Latest commit: f8c44e1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@commercetools/nimbus Major
@commercetools/nimbus-tokens Major
@commercetools/nimbus-icons Major
@commercetools/nimbus-design-token-ts-plugin Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@tylermorrisford tylermorrisford left a comment

Choose a reason for hiding this comment

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

looks really nice

ByronDWall and others added 7 commits March 9, 2026 10:48
…pe and types

Add OpenSpec proposal and core implementation files for PageContent:
- Types with Root (variant, columns) and Column (sticky) props
- Slot recipe with CSS grid centering and column layout variants
- Slot components via createSlotRecipeContext
- Root and Column sub-components
- Recipe registration and barrel exports

CRAFT-2161

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…actStyleProps

PageContent does not use React Aria internally, so there is no need to
hide `as`, `asChild`, and `css` props from consumers via OmitInternalProps.
Slot components handle style props natively, so extractStyleProps splits
are also unnecessary.

CRAFT-2161

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix barrel imports to use modular @chakra-ui/react/styled-system
- Remove duplicate sticky CSS from recipe (JS handles it in column component)
- Update spec to reflect boolean sticky type with top style prop override
- Add SmokeTest story with full variant × columns matrix
- Add play function to CustomGap story
- Fix overflowY="scroll" to "auto" in dev.mdx

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… types

Create MainPage compound component with Root, Header, Title, Actions,
Content, and Footer sub-components. Content wraps PageContent.Root
internally, forwarding variant and columns props. Uses CSS grid layout
(auto 1fr auto) for the page skeleton with semantic HTML elements
(header, h1, main, footer).

CRAFT-2167

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove OmitInternalProps from MainPage types (no React Aria). Use
asChild on Content slot to merge with PageContent.Root, reducing DOM
nesting while preserving <main> semantics via as="main". Add Storybook
stories covering info page, form page, tabular page, and multi-column
content patterns with play functions.

CRAFT-2167

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ByronDWall and others added 4 commits March 9, 2026 10:56
…olumn

- MainPage.Title now uses Nimbus Heading (h1) with title and subtitle props,
  matching AppKit page title styling
- Add MainPage.Column (re-export of PageContent.Column) to all docs
- Add designer overview (main-page.mdx) with live examples
- Add implementation docs (main-page.dev.mdx) with sub-component examples
- Add guidelines docs (main-page.guidelines.mdx) with do/don't patterns
- Add consumer test examples (main-page.docs.spec.tsx)
- Update stories to test each sub-component explicitly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix slots import path to @chakra-ui/react/styled-system
- Add tags/parameters to stories meta, use accessible role queries
- Add Accessibility section to designer docs (main-page.mdx)
- Rename root props to MainPageRootProps with convenience alias
- Add JSDoc to all ref properties in types
- Update slot docs/templates to use key: pattern matching codebase

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Position title/subtitle in column 1 (left) and actions in column 2 (right)
using gridColumn placement. Add custom elements documentation to dev.mdx,
fix review issues (duplicate H1, relative link, Badge prop), and update
skill templates to remove invalid recipe description field and add
exportName to designer docs frontmatter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ories

Replace placeholder boxes with DataTable (fake product data) in InfoPage,
and FormField+TextInput/MoneyInput in FormPage and WithFooter stories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ries

Add Info, Form, and Tabular main page usage examples to dev docs.
Update recipe spacing tokens and refactor TabularPage story to place
Tabs.Root as outer wrapper with tab list in header.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@misama-ct misama-ct left a comment

Choose a reason for hiding this comment

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

🙇

@ByronDWall ByronDWall merged commit a66d28d into main Mar 17, 2026
8 checks passed
@ByronDWall ByronDWall deleted the CRAFT-2167-create-main-page-component branch March 17, 2026 16:04
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.

4 participants