@primer/react-brand 0.70.0-rc.4599efb5 → 0.70.0-rc.9ef718be
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/components/NavList/index.md +210 -0
- package/docs/components/index.md +1 -0
- package/docs/getting-started/index.md +3 -0
- package/docs/index.md +4 -2
- package/docs/introduction/index.md +1 -0
- package/docs/introduction/mcp.md +52 -0
- package/esm/Heading/Heading.d.ts +10 -0
- package/esm/Heading/Heading.d.ts.map +1 -1
- package/esm/Heading/Heading.js.map +1 -1
- package/esm/Hero/Hero.d.ts.map +1 -1
- package/esm/Hero/Hero.js +60 -58
- package/esm/Hero/Hero.js.map +1 -1
- package/esm/NavList/NavList.d.ts +86 -0
- package/esm/NavList/NavList.d.ts.map +1 -0
- package/esm/NavList/NavList.js +277 -0
- package/esm/NavList/NavList.js.map +1 -0
- package/esm/NavList/NavList.module-CZFnt8br.css +1 -0
- package/esm/NavList/NavList.module.js +32 -0
- package/esm/NavList/NavList.module.js.map +1 -0
- package/esm/NavList/index.d.ts +2 -0
- package/esm/NavList/index.d.ts.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.esm.js +12 -11
- package/esm/packages/design-tokens/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes-CGyt2t8f.css +1 -0
- package/lib/Heading/Heading.d.ts +10 -0
- package/lib/NavList/NavList.d.ts +85 -0
- package/lib/NavList/index.d.ts +1 -0
- package/lib/css/main.css +605 -67
- package/lib/design-tokens/css/tokens/base/colors/color-scales-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/base/colors/light.css +1 -1
- package/lib/design-tokens/css/tokens/base/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/base/typography/typography.css +1 -1
- package/lib/design-tokens/css/tokens/functional/animation/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/colors/global.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/accordion/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/action-menu/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/anchor-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/bento/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/blinking-cursor/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/breadcrumbs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/button/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/card/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/comparison-table/comparison-table.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/control/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/cta-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/eyebrow-banner/eyebrow-banner.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/faq/faq.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/footer/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/frosted-glass-vfx/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/grid/grid.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/hero/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/icon/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/ide/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/ide/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/image/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/inline-link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/label/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/link/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/logosuite/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/media-playlist/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css +13 -0
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/pricing-options/pricing-options.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/prose/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river/river.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/river-story-scroll/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/section/section.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/statistic/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/sub-nav/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/subdomain-nav-bar/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tabs/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/testimonial/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/text-cursor-animation/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tiles/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/timeline/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/token/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/tooltip/colors.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/base.css +1 -1
- package/lib/design-tokens/css/tokens/functional/components/video-player/colors-with-modes.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/border.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/breakpoints.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-coarse.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size-fine.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/size.css +1 -1
- package/lib/design-tokens/css/tokens/functional/size/viewport.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography-responsive.css +1 -1
- package/lib/design-tokens/css/tokens/functional/typography/typography.css +1 -1
- package/lib/design-tokens/js/module/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/js/module/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/js/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/js/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/js/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/js/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/js/tokens/functional/typography/typography.js +1 -1
- package/lib/design-tokens/scss/tokens/base/colors/light.scss +1 -1
- package/lib/design-tokens/scss/tokens/base/size/size.scss +1 -1
- package/lib/design-tokens/scss/tokens/base/typography/typography.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/animation/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/colors/global.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/bento/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/card/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/card/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/comparison-table/comparison-table.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/eyebrow-banner/eyebrow-banner.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/faq/faq.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/footer/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/frosted-glass-vfx/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/grid/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/grid/grid.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/hero/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/icon/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/ide/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/image/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-link/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/inline-link/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/label/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/link/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/logosuite/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/logosuite/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/media-playlist/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/pricing-options/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/pricing-options/pricing-options.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/prose/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/river/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/river/river.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/section/section.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/statistic/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/sub-nav/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tabs/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tabs/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/testimonial/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/text-cursor-animation/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/timeline/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/timeline/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/token/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/tooltip/colors.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/components/video-player/base.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/border.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/breakpoints.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size-coarse.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size-fine.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/size.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/size/viewport.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/typography/typography-responsive.scss +1 -1
- package/lib/design-tokens/scss/tokens/functional/typography/typography.scss +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/light.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/colors/light.js +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/base/typography/typography.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/animation/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/animation/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/colors/global.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/bento/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/bento/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/card/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/comparison-table/comparison-table.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/eyebrow-banner/eyebrow-banner.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/faq.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/faq/faq.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/footer/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/frosted-glass-vfx/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/grid/grid.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/hero/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/icon/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/ide/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/ide/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/image/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/inline-link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/label/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/link/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/link/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/logosuite/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/media-playlist/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/pricing-options/pricing-options.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/prose/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/prose/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/river.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/river/river.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/section/section.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/section/section.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/statistic/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/statistic/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/sub-nav/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tabs/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/testimonial/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/text-cursor-animation/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/timeline/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/token/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/tooltip/colors.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/components/video-player/base.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/border.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/breakpoints.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-coarse.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size-fine.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/size.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/size/viewport.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography-responsive.js +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.d.ts +1 -1
- package/lib/design-tokens/ts/tokens/functional/typography/typography.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/llms.txt +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: NavList
|
|
3
|
+
description: Use NavList to render vertical navigation with optional expandable groups.
|
|
4
|
+
keywords: ['navigation', 'vertical navigation', 'sidebar', 'nested navigation']
|
|
5
|
+
ready: true
|
|
6
|
+
source: https://github.com/primer/brand/tree/main/packages/react/src/NavList/NavList.tsx
|
|
7
|
+
storybook: '/brand/storybook/?path=/story/components-navlist--playground'
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
import {NavList} from '@primer/react-brand'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Examples
|
|
15
|
+
|
|
16
|
+
### Default
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
<NavList aria-label="Docs navigation">
|
|
20
|
+
<NavList.Item href="#" aria-current="page">
|
|
21
|
+
Overview
|
|
22
|
+
</NavList.Item>
|
|
23
|
+
<NavList.Item href="#">Quickstart</NavList.Item>
|
|
24
|
+
<NavList.Item href="#">Install GitHub Copilot</NavList.Item>
|
|
25
|
+
<NavList.Item href="#">Configure your editor</NavList.Item>
|
|
26
|
+
<NavList.Item href="#">Manage policies</NavList.Item>
|
|
27
|
+
<NavList.Item href="#">Troubleshooting</NavList.Item>
|
|
28
|
+
</NavList>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Groups
|
|
32
|
+
|
|
33
|
+
Use `NavList.Group` to organize related navigation items into labelled groups.
|
|
34
|
+
|
|
35
|
+
```jsx
|
|
36
|
+
<NavList aria-label="Section navigation">
|
|
37
|
+
<NavList.Group title="Products">
|
|
38
|
+
<NavList.Item href="#" aria-current="page">
|
|
39
|
+
Copilot
|
|
40
|
+
</NavList.Item>
|
|
41
|
+
<NavList.Item href="#">Codespaces</NavList.Item>
|
|
42
|
+
<NavList.Item href="#">Actions</NavList.Item>
|
|
43
|
+
<NavList.Item href="#">Packages</NavList.Item>
|
|
44
|
+
</NavList.Group>
|
|
45
|
+
<NavList.Group title="Collaboration">
|
|
46
|
+
<NavList.Item href="#">Pull requests</NavList.Item>
|
|
47
|
+
<NavList.Item href="#">Issues</NavList.Item>
|
|
48
|
+
<NavList.Item href="#">Discussions</NavList.Item>
|
|
49
|
+
</NavList.Group>
|
|
50
|
+
<NavList.Group title="Security">
|
|
51
|
+
<NavList.Item href="#">Overview</NavList.Item>
|
|
52
|
+
<NavList.Item href="#">Secret scanning</NavList.Item>
|
|
53
|
+
<NavList.Item href="#">Code scanning</NavList.Item>
|
|
54
|
+
</NavList.Group>
|
|
55
|
+
</NavList>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Nested disclosure
|
|
59
|
+
|
|
60
|
+
Add `NavList.SubNav` to a `NavList.Item` when an item needs to expand and collapse nested navigation links.
|
|
61
|
+
|
|
62
|
+
```jsx
|
|
63
|
+
<NavList aria-label="Nested navigation">
|
|
64
|
+
<NavList.Group title="Collaboration">
|
|
65
|
+
<NavList.Item defaultExpanded>
|
|
66
|
+
Pull requests
|
|
67
|
+
<NavList.SubNav>
|
|
68
|
+
<NavList.Item href="#" aria-current="page">
|
|
69
|
+
Review pull requests
|
|
70
|
+
</NavList.Item>
|
|
71
|
+
<NavList.Item href="#">Use suggested changes</NavList.Item>
|
|
72
|
+
<NavList.Item href="#">Configure rulesets</NavList.Item>
|
|
73
|
+
</NavList.SubNav>
|
|
74
|
+
</NavList.Item>
|
|
75
|
+
<NavList.Item>
|
|
76
|
+
Branches
|
|
77
|
+
<NavList.SubNav>
|
|
78
|
+
<NavList.Item href="#">Overview</NavList.Item>
|
|
79
|
+
<NavList.Item href="#">Protection rules</NavList.Item>
|
|
80
|
+
</NavList.SubNav>
|
|
81
|
+
</NavList.Item>
|
|
82
|
+
</NavList.Group>
|
|
83
|
+
</NavList>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Up to five navigation levels
|
|
87
|
+
|
|
88
|
+
`NavList` can include up to five levels when a page hierarchy requires it. Use the fewest levels needed; levels one through four can optionally expand or collapse, and level five is reserved for leaf article links.
|
|
89
|
+
|
|
90
|
+
```jsx
|
|
91
|
+
<NavList aria-label="Five-level navigation">
|
|
92
|
+
<NavList.Item defaultExpanded>
|
|
93
|
+
GitHub Copilot
|
|
94
|
+
<NavList.SubNav>
|
|
95
|
+
<NavList.Item defaultExpanded>
|
|
96
|
+
Guides
|
|
97
|
+
<NavList.SubNav>
|
|
98
|
+
<NavList.Item defaultExpanded>
|
|
99
|
+
Agents
|
|
100
|
+
<NavList.SubNav>
|
|
101
|
+
<NavList.Item defaultExpanded>
|
|
102
|
+
Build an agent
|
|
103
|
+
<NavList.SubNav>
|
|
104
|
+
<NavList.Item href="#" aria-current="page">
|
|
105
|
+
Create a tool
|
|
106
|
+
</NavList.Item>
|
|
107
|
+
<NavList.Item href="#">Add memory</NavList.Item>
|
|
108
|
+
<NavList.Item href="#">Debug prompts</NavList.Item>
|
|
109
|
+
<NavList.Item href="#">Deploy safely</NavList.Item>
|
|
110
|
+
</NavList.SubNav>
|
|
111
|
+
</NavList.Item>
|
|
112
|
+
<NavList.Item href="#">Customize an agent</NavList.Item>
|
|
113
|
+
<NavList.Item href="#">Debug an agent</NavList.Item>
|
|
114
|
+
</NavList.SubNav>
|
|
115
|
+
</NavList.Item>
|
|
116
|
+
<NavList.Item>
|
|
117
|
+
Extensions
|
|
118
|
+
<NavList.SubNav>
|
|
119
|
+
<NavList.Item href="#">Install an extension</NavList.Item>
|
|
120
|
+
<NavList.Item href="#">Publish an extension</NavList.Item>
|
|
121
|
+
<NavList.Item href="#">Manage permissions</NavList.Item>
|
|
122
|
+
</NavList.SubNav>
|
|
123
|
+
</NavList.Item>
|
|
124
|
+
</NavList.SubNav>
|
|
125
|
+
</NavList.Item>
|
|
126
|
+
<NavList.Item>
|
|
127
|
+
Administration
|
|
128
|
+
<NavList.SubNav>
|
|
129
|
+
<NavList.Item href="#">Overview</NavList.Item>
|
|
130
|
+
<NavList.Item href="#">Policies</NavList.Item>
|
|
131
|
+
<NavList.Item href="#">Audit log</NavList.Item>
|
|
132
|
+
</NavList.SubNav>
|
|
133
|
+
</NavList.Item>
|
|
134
|
+
</NavList.SubNav>
|
|
135
|
+
</NavList.Item>
|
|
136
|
+
<NavList.Item>
|
|
137
|
+
Code review
|
|
138
|
+
<NavList.SubNav>
|
|
139
|
+
<NavList.Item href="#">Overview</NavList.Item>
|
|
140
|
+
<NavList.Item href="#">Review pull requests</NavList.Item>
|
|
141
|
+
<NavList.Item href="#">Use suggested changes</NavList.Item>
|
|
142
|
+
</NavList.SubNav>
|
|
143
|
+
</NavList.Item>
|
|
144
|
+
</NavList>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### With visuals
|
|
148
|
+
|
|
149
|
+
Use `leadingVisual` and `trailingVisual` to add icons to the label area. Visuals are additive: they do not replace disclosure triangles, change item sizing, or move the active and inactive row alignment.
|
|
150
|
+
|
|
151
|
+
```jsx
|
|
152
|
+
<NavList aria-label="Visual navigation">
|
|
153
|
+
<NavList.Item href="#" aria-current="page" leadingVisual={BookIcon} trailingVisual={<KebabHorizontalIcon />}>
|
|
154
|
+
GitHub Copilot
|
|
155
|
+
</NavList.Item>
|
|
156
|
+
</NavList>
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Accessibility
|
|
160
|
+
|
|
161
|
+
Give each `NavList` a clear `aria-label`, especially when the page includes more than one navigation landmark.
|
|
162
|
+
|
|
163
|
+
Use `aria-current="page"` on the link for the current page. Only apply `aria-current` to leaf items that navigate somewhere, not to disclosure rows with nested items.
|
|
164
|
+
|
|
165
|
+
Keep group titles and disclosure labels short and descriptive. Items with `NavList.SubNav` must include visible label text so people can understand what will expand.
|
|
166
|
+
|
|
167
|
+
## Component props
|
|
168
|
+
|
|
169
|
+
### NavList `Required`
|
|
170
|
+
|
|
171
|
+
| name | type | default | required | description |
|
|
172
|
+
| ----------------- | ----------- | ------- | -------- | ----------------------------------------------------- |
|
|
173
|
+
| `children` | `ReactNode` | | `true` | `NavList.Item` and `NavList.Group` nodes |
|
|
174
|
+
| `aria-label` | `string` | | `true` | Accessible label for the navigation landmark |
|
|
175
|
+
| `aria-labelledby` | `string` | | `false` | ID of the element that labels the navigation landmark |
|
|
176
|
+
| `className` | `string` | | `false` | Sets a custom class on the `nav` element |
|
|
177
|
+
|
|
178
|
+
Forwards all standard HTML attributes for `<nav>` elements.
|
|
179
|
+
|
|
180
|
+
### NavList.Item `Required`
|
|
181
|
+
|
|
182
|
+
| name | type | default | required | description |
|
|
183
|
+
| ------------------ | ------------------------------------------------------------------------- | ------- | -------- | ------------------------------------------------------------------------------------------ |
|
|
184
|
+
| `as` | `'a' \| 'button'` | `'a'` | `false` | Element used for leaf items |
|
|
185
|
+
| `children` | `ReactNode` | | `true` | Item label and optional `NavList.SubNav` for nested disclosure |
|
|
186
|
+
| `href` | `string` | | `false` | URL for leaf items when rendering as an anchor |
|
|
187
|
+
| `aria-current` | `'page' \| 'step' \| 'location' \| 'date' \| 'time' \| 'true' \| 'false'` | | `false` | Marks a leaf item as current |
|
|
188
|
+
| `defaultExpanded` | `boolean` | `false` | `false` | Opens nested `NavList.SubNav` by default |
|
|
189
|
+
| `expanded` | `boolean` | | `false` | Controls the nested `NavList.SubNav` expanded state |
|
|
190
|
+
| `onExpandedChange` | `(expanded) => void` | | `false` | Called when the nested `NavList.SubNav` expanded state changes |
|
|
191
|
+
| `leadingVisual` | `ReactElement \| Icon` | | `false` | Visual rendered before the label |
|
|
192
|
+
| `trailingVisual` | `ReactElement \| Icon` | | `false` | Visual rendered after the label |
|
|
193
|
+
| `disabled` | `boolean` | `false` | `false` | Disables the item. Leaf links receive `aria-disabled`; disclosure buttons receive disabled |
|
|
194
|
+
|
|
195
|
+
Forwards props to the rendered leaf link or disclosure button.
|
|
196
|
+
|
|
197
|
+
### NavList.Group
|
|
198
|
+
|
|
199
|
+
| name | type | default | required | description |
|
|
200
|
+
| ----------- | ----------- | ------- | -------- | ------------------------------------------ |
|
|
201
|
+
| `title` | `ReactNode` | | `false` | Heading text for the group |
|
|
202
|
+
| `children` | `ReactNode` | | `true` | `NavList.Item` nodes |
|
|
203
|
+
| `className` | `string` | | `false` | Sets a custom class on the group list item |
|
|
204
|
+
|
|
205
|
+
### NavList.SubNav
|
|
206
|
+
|
|
207
|
+
| name | type | default | required | description |
|
|
208
|
+
| ----------- | ----------- | ------- | -------- | -------------------------------------- |
|
|
209
|
+
| `children` | `ReactNode` | | `true` | Nested `NavList.Item` nodes |
|
|
210
|
+
| `className` | `string` | | `false` | Sets a custom class on the nested `ul` |
|
package/docs/components/index.md
CHANGED
|
@@ -28,6 +28,7 @@ description: Primer Brand UI components
|
|
|
28
28
|
- [Logo suite](LogoSuite/react.md): Use a logo suite to present a list logos, such as sponsors or vendors.
|
|
29
29
|
- [Media playlist](MediaPlaylist/index.md): Use MediaPlaylist to pair thumbnail-backed media items with a shared playback or media area.
|
|
30
30
|
- [Minimal footer](MinimalFooter/index.md): Use the minimal footer component to provide a global footer featuring legal links, GitHub logomarks and footnotes.
|
|
31
|
+
- [NavList](NavList/index.md): Use NavList to render vertical navigation with optional expandable groups.
|
|
31
32
|
- [Ordered list](OrderedList/react.md): Use the ordered list component to display a list of numbered items.
|
|
32
33
|
- [Pagination](Pagination/index.md): Use Pagination to display a sequence of links that allow navigation to discrete, related pages.
|
|
33
34
|
- [Pillar](Pillar/react.md): Use the pillar component to group related content together.
|
|
@@ -93,3 +93,6 @@ import {Hero} from '@primer/react-brand'
|
|
|
93
93
|
<Hero.SecondaryAction href="#">Secondary action</Hero.SecondaryAction>
|
|
94
94
|
</Hero>
|
|
95
95
|
```
|
|
96
|
+
|
|
97
|
+
> Building with an AI agent? Use the [Primer Brand MCP server](../introduction/mcp.md) to automatically use our
|
|
98
|
+
> components, tokens and patterns correctly.
|
package/docs/index.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Primer Brand docs (v0.70.0-rc.
|
|
1
|
+
# Primer Brand docs (v0.70.0-rc.9ef718be)
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@primer/react-brand@0.70.0-rc.
|
|
3
|
+
These docs are bundled with `@primer/react-brand@0.70.0-rc.9ef718be` and match your installed version.
|
|
4
4
|
|
|
5
5
|
New here? Start with [Getting started](getting-started/index.md) for installation, global
|
|
6
6
|
stylesheet and font setup. Component directories are named after their import (e.g.
|
|
@@ -15,6 +15,7 @@ stylesheet and font setup. Component directories are named after their import (e
|
|
|
15
15
|
|
|
16
16
|
- [Animation](introduction/animation.md): Use animations to add visual interest and interactivity to a web page or application.
|
|
17
17
|
- [Guides](introduction/index.md): Get started with Primer Brand
|
|
18
|
+
- [MCP server](introduction/mcp.md): Help AI agents use Primer Brand correctly with our Model Context Protocol server.
|
|
18
19
|
- [Theming](introduction/theming.md)
|
|
19
20
|
|
|
20
21
|
## Primitives
|
|
@@ -61,6 +62,7 @@ stylesheet and font setup. Component directories are named after their import (e
|
|
|
61
62
|
- [Logo suite](components/LogoSuite/react.md): Use a logo suite to present a list logos, such as sponsors or vendors.
|
|
62
63
|
- [Media playlist](components/MediaPlaylist/index.md): Use MediaPlaylist to pair thumbnail-backed media items with a shared playback or media area.
|
|
63
64
|
- [Minimal footer](components/MinimalFooter/index.md): Use the minimal footer component to provide a global footer featuring legal links, GitHub logomarks and footnotes.
|
|
65
|
+
- [NavList](components/NavList/index.md): Use NavList to render vertical navigation with optional expandable groups.
|
|
64
66
|
- [Ordered list](components/OrderedList/react.md): Use the ordered list component to display a list of numbered items.
|
|
65
67
|
- [Pagination](components/Pagination/index.md): Use Pagination to display a sequence of links that allow navigation to discrete, related pages.
|
|
66
68
|
- [Pillar](components/Pillar/react.md): Use the pillar component to group related content together.
|
|
@@ -6,4 +6,5 @@ description: Get started with Primer Brand
|
|
|
6
6
|
## In this section
|
|
7
7
|
|
|
8
8
|
- [Animation](animation.md): Use animations to add visual interest and interactivity to a web page or application.
|
|
9
|
+
- [MCP server](mcp.md): Help AI agents use Primer Brand correctly with our Model Context Protocol server.
|
|
9
10
|
- [Theming](theming.md)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MCP server
|
|
3
|
+
description: Help AI agents use Primer Brand correctly with our Model Context Protocol server.
|
|
4
|
+
keywords: ['mcp', 'ai', 'agents', 'model context protocol', 'copilot', 'claude code']
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The Primer Brand [MCP server](https://www.npmjs.com/package/@primer/brand-mcp) (`@primer/brand-mcp`) helps AI agents understand and use Primer Brand (`@primer/react-brand`) correctly.
|
|
8
|
+
|
|
9
|
+
It is a version-aware, local (`stdio`) server that reads the docs and metadata of your installed `@primer/react-brand` dependency.
|
|
10
|
+
|
|
11
|
+
> The MCP server requires [Node.js](https://nodejs.org/) 24 or later.
|
|
12
|
+
|
|
13
|
+
## What it provides
|
|
14
|
+
|
|
15
|
+
The server exposes a set of tools that AI agents can call:
|
|
16
|
+
|
|
17
|
+
| Tool | What it does |
|
|
18
|
+
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| `primer_brand_setup` | Configures Primer Brand first-time. Includes `ThemeProvider`, Mona Sans and RSC-directive configuration among other things |
|
|
20
|
+
| `primer_brand_page_design` | Page-design conventions (header/footer, hero media, gridline aesthetic, card grids, labels) and the current-brand reference templates to start from. |
|
|
21
|
+
| `primer_brand_component` | Get a component API information like props, allowed values and named sub-components. |
|
|
22
|
+
| `primer_brand_examples` | Reference examples taken from our Storybook. |
|
|
23
|
+
| `primer_brand_tokens` | Resolve design tokens by intent (color, space, typography) to CSS variables and values. |
|
|
24
|
+
| `primer_brand_asset` | Find Octicons (`@primer/octicons-react`) and Octovisuals (`@primer/octovisuals-react`) more easily |
|
|
25
|
+
| `primer_brand_docs` | Search and read Primer Brand guidance, including principles, accessibility and getting started. |
|
|
26
|
+
| `primer_brand_review` | Check generated JSX and CSS against the design system for unknown components, invalid props, hardcoded values |
|
|
27
|
+
|
|
28
|
+
## Set up in VS Code
|
|
29
|
+
|
|
30
|
+
Add the server to your workspace's `.vscode/mcp.json` (or your user `mcp.json`):
|
|
31
|
+
|
|
32
|
+
```jsonc
|
|
33
|
+
{
|
|
34
|
+
"servers": {
|
|
35
|
+
"Primer Brand": {
|
|
36
|
+
"type": "stdio",
|
|
37
|
+
"command": "npx",
|
|
38
|
+
"args": ["@primer/brand-mcp@latest"]
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Set up in other clients
|
|
45
|
+
|
|
46
|
+
For GitHub Copilot CLI and other `stdio`-enabled MCP clients, run the server directly:
|
|
47
|
+
|
|
48
|
+
```shell
|
|
49
|
+
npx @primer/brand-mcp@latest
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Refer to the [package README](https://github.com/primer/brand/tree/main/packages/mcp) for the latest configuration details.
|
package/esm/Heading/Heading.d.ts
CHANGED
|
@@ -37,7 +37,14 @@ export declare const classMap: {
|
|
|
37
37
|
h6: "6";
|
|
38
38
|
};
|
|
39
39
|
export type HeadingProps = {
|
|
40
|
+
/** Semantic heading level (`h1`–`h6`) only. Use `size` to apply the correct visual size. */
|
|
40
41
|
as?: (typeof HeadingTags)[number];
|
|
42
|
+
/**
|
|
43
|
+
* Controls the visual size, independent of `as`. Should be used whenever as prop is used, as the defaults may not be ideal for all use-cases.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <Heading as="h2" size="4">This h2 will appear visually identical to an h4</Heading>
|
|
47
|
+
*/
|
|
41
48
|
size?: (typeof HeadingSizes)[number];
|
|
42
49
|
weight?: HeadingWeightVariants | ResponsiveWeightMap;
|
|
43
50
|
stretch?: HeadingStretchVariants | ResponsiveStretchMap;
|
|
@@ -45,6 +52,9 @@ export type HeadingProps = {
|
|
|
45
52
|
font?: HeadingFontVariants;
|
|
46
53
|
textWrap?: HeadingTextWrapVariants;
|
|
47
54
|
} & React.HTMLAttributes<HTMLHeadingElement> & BaseProps<HTMLHeadingElement>;
|
|
55
|
+
/**
|
|
56
|
+
* Use the heading component to render titles or subtitle text.
|
|
57
|
+
*/
|
|
48
58
|
export declare const Heading: React.ForwardRefExoticComponent<Omit<React.PropsWithChildren<HeadingProps>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
49
59
|
export {};
|
|
50
60
|
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../src/Heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAA;AAGnE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAGnD,eAAO,MAAM,YAAY,uFAAwF,CAAA;AACjH,eAAO,MAAM,WAAW,+CAAgD,CAAA;AAExE,eAAO,MAAM,cAAc,gGASjB,CAAA;AACV,eAAO,MAAM,cAAc,8CAA+C,CAAA;AAC1E,eAAO,MAAM,oBAAoB,0CAA2C,CAAA;AAC5E,eAAO,MAAM,mBAAmB,mDAAoD,CAAA;AAEpF,eAAO,MAAM,iBAAiB,MAAiB,CAAA;AAC/C,eAAO,MAAM,kBAAkB,aAAyB,CAAA;AAExD,KAAK,qBAAqB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAC5D,KAAK,sBAAsB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAC7D,KAAK,4BAA4B,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AACzE,KAAK,mBAAmB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAC/D,KAAK,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAAA;AAEjD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,CAAC,EAAE,sBAAsB,CAAA;IAC/B,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC,IAAI,CAAC,EAAE,sBAAsB,CAAA;CAC9B,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,OAAO,CAAC,EAAE,4BAA4B,CAAA;IACtC,IAAI,CAAC,EAAE,4BAA4B,CAAA;CACpC,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B,IAAI,CAAC,EAAE,qBAAqB,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,CAAC,EAAE,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;IACjC,IAAI,CAAC,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;IACpC,MAAM,CAAC,EAAE,qBAAqB,GAAG,mBAAmB,CAAA;IACpD,OAAO,CAAC,EAAE,sBAAsB,GAAG,oBAAoB,CAAA;IACvD,aAAa,CAAC,EAAE,4BAA4B,GAAG,0BAA0B,CAAA;IACzE,IAAI,CAAC,EAAE,mBAAmB,CAAA;IAC1B,QAAQ,CAAC,EAAE,uBAAuB,CAAA;CACnC,GAAG,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAC1C,SAAS,CAAC,kBAAkB,CAAC,CAAA;AAE/B,eAAO,MAAM,OAAO,+HA4DnB,CAAA"}
|
|
1
|
+
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../src/Heading/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAA;AAGnE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAGnD,eAAO,MAAM,YAAY,uFAAwF,CAAA;AACjH,eAAO,MAAM,WAAW,+CAAgD,CAAA;AAExE,eAAO,MAAM,cAAc,gGASjB,CAAA;AACV,eAAO,MAAM,cAAc,8CAA+C,CAAA;AAC1E,eAAO,MAAM,oBAAoB,0CAA2C,CAAA;AAC5E,eAAO,MAAM,mBAAmB,mDAAoD,CAAA;AAEpF,eAAO,MAAM,iBAAiB,MAAiB,CAAA;AAC/C,eAAO,MAAM,kBAAkB,aAAyB,CAAA;AAExD,KAAK,qBAAqB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAC5D,KAAK,sBAAsB,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAC7D,KAAK,4BAA4B,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AACzE,KAAK,mBAAmB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAA;AAC/D,KAAK,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAAA;AAEjD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,CAAC,EAAE,sBAAsB,CAAA;IAC/B,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC,IAAI,CAAC,EAAE,sBAAsB,CAAA;CAC9B,CAAA;AAED,KAAK,0BAA0B,GAAG;IAChC,MAAM,CAAC,EAAE,4BAA4B,CAAA;IACrC,OAAO,CAAC,EAAE,4BAA4B,CAAA;IACtC,IAAI,CAAC,EAAE,4BAA4B,CAAA;CACpC,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B,IAAI,CAAC,EAAE,qBAAqB,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;CAOpB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,4FAA4F;IAC5F,EAAE,CAAC,EAAE,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;IACjC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;IACpC,MAAM,CAAC,EAAE,qBAAqB,GAAG,mBAAmB,CAAA;IACpD,OAAO,CAAC,EAAE,sBAAsB,GAAG,oBAAoB,CAAA;IACvD,aAAa,CAAC,EAAE,4BAA4B,GAAG,0BAA0B,CAAA;IACzE,IAAI,CAAC,EAAE,mBAAmB,CAAA;IAC1B,QAAQ,CAAC,EAAE,uBAAuB,CAAA;CACnC,GAAG,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAC1C,SAAS,CAAC,kBAAkB,CAAC,CAAA;AAE/B;;GAEG;AACH,eAAO,MAAM,OAAO,+HA4DnB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.js","names":[],"sources":["../../src/Heading/Heading.tsx"],"sourcesContent":["import React, {PropsWithChildren, forwardRef, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport styles from './Heading.module.css'\nimport type {BaseProps} from '../component-helpers'\nimport {useAnimation} from '../animation'\n\nexport const HeadingSizes = ['display', '1', '2', '3', '4', '5', '6', 'subhead-large', 'subhead-medium'] as const\nexport const HeadingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const\n\nexport const HeadingWeights = [\n 'heavy',\n 'extrabold',\n 'bold',\n 'semibold',\n 'medium',\n 'normal',\n 'light',\n 'extralight',\n] as const\nexport const HeadingStretch = ['condensed', 'normal', 'expanded'] as const\nexport const HeadingLetterSpacing = ['condensed', 'normal', 'none'] as const\nexport const HeadingFontVariants = ['mona-sans', 'hubot-sans', 'monospace'] as const\n\nexport const defaultHeadingTag = HeadingTags[1]\nexport const defaultHeadingFont = HeadingFontVariants[0]\n\ntype HeadingWeightVariants = (typeof HeadingWeights)[number]\ntype HeadingStretchVariants = (typeof HeadingStretch)[number]\ntype HeadingLetterSpacingVariants = (typeof HeadingLetterSpacing)[number]\ntype HeadingFontVariants = (typeof HeadingFontVariants)[number]\ntype HeadingTextWrapVariants = 'wrap' | 'balance'\n\ntype ResponsiveStretchMap = {\n narrow?: HeadingStretchVariants\n regular?: HeadingStretchVariants\n wide?: HeadingStretchVariants\n}\n\ntype ResponsiveLetterSpacingMap = {\n narrow?: HeadingLetterSpacingVariants\n regular?: HeadingLetterSpacingVariants\n wide?: HeadingLetterSpacingVariants\n}\n\ntype ResponsiveWeightMap = {\n narrow?: HeadingWeightVariants\n regular?: HeadingWeightVariants\n wide?: HeadingWeightVariants\n}\n\nexport const classMap = {\n h1: HeadingSizes[1],\n h2: HeadingSizes[2],\n h3: HeadingSizes[3],\n h4: HeadingSizes[4],\n h5: HeadingSizes[5],\n h6: HeadingSizes[6],\n}\n\nexport type HeadingProps = {\n as?: (typeof HeadingTags)[number]\n size?: (typeof HeadingSizes)[number]\n weight?: HeadingWeightVariants | ResponsiveWeightMap\n stretch?: HeadingStretchVariants | ResponsiveStretchMap\n letterSpacing?: HeadingLetterSpacingVariants | ResponsiveLetterSpacingMap\n font?: HeadingFontVariants\n textWrap?: HeadingTextWrapVariants\n} & React.HTMLAttributes<HTMLHeadingElement> &\n BaseProps<HTMLHeadingElement>\n\nexport const Heading = forwardRef<HTMLHeadingElement, PropsWithChildren<HeadingProps>>(\n (\n {\n animate,\n className,\n children,\n as: HeadingComponent = defaultHeadingTag,\n size,\n letterSpacing,\n weight,\n stretch,\n style,\n font = 'mona-sans',\n textWrap = 'balance',\n ...rest\n },\n ref,\n ) => {\n const {classes: animationClasses, styles: animationInlineStyles} = useAnimation(animate)\n\n const buildClass = (type: string, value) => {\n if (!value) return null\n return typeof value === 'string'\n ? styles[`Heading--${type}-${value}`]\n : Object.keys(value)\n .map(viewport => {\n return styles[`Heading-${viewport}--${type}-${value[viewport]}`]\n })\n .join(' ')\n }\n\n const weightClass = useMemo(() => buildClass('weight', weight), [weight])\n const stretchClass = useMemo(() => buildClass('stretch', stretch), [stretch])\n const letterSpacingClass = useMemo(() => buildClass('letter-spacing', letterSpacing), [letterSpacing])\n\n const headingClassNames = clsx(\n animationClasses,\n styles.Heading,\n styles[`Heading-font--${font}`],\n !size && styles[`Heading--${classMap[HeadingComponent]}`],\n size && styles[`Heading--${size}`],\n styles[`Heading--textWrap-${textWrap}`],\n weight && weightClass,\n stretch && stretchClass,\n letterSpacingClass && letterSpacingClass,\n className,\n )\n\n if (!HeadingTags.includes(HeadingComponent)) {\n // eslint-disable-next-line no-console\n console.error(`Heading: 'as' prop must be one of ${HeadingTags.join(', ')}`)\n return null\n }\n\n return (\n <HeadingComponent ref={ref} className={headingClassNames} style={{...animationInlineStyles, ...style}} {...rest}>\n {children}\n </HeadingComponent>\n )\n },\n)\n"],"mappings":";;;;;;AAMA,IAAa,IAAe;CAAC;CAAW;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAiB;CAAiB,EAC3F,IAAc;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;CAAK,EAElD,IAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EACY,IAAiB;CAAC;CAAa;CAAU;CAAW,EACpD,IAAuB;CAAC;CAAa;CAAU;CAAO,EACtD,IAAsB;CAAC;CAAa;CAAc;CAAY,EAE9D,IAAoB,EAAY,IAChC,IAAqB,EAAoB,IA0BzC,IAAW;CACtB,IAAI,EAAa;CACjB,IAAI,EAAa;CACjB,IAAI,EAAa;CACjB,IAAI,EAAa;CACjB,IAAI,EAAa;CACjB,IAAI,EAAa;CAClB,
|
|
1
|
+
{"version":3,"file":"Heading.js","names":[],"sources":["../../src/Heading/Heading.tsx"],"sourcesContent":["import React, {PropsWithChildren, forwardRef, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport styles from './Heading.module.css'\nimport type {BaseProps} from '../component-helpers'\nimport {useAnimation} from '../animation'\n\nexport const HeadingSizes = ['display', '1', '2', '3', '4', '5', '6', 'subhead-large', 'subhead-medium'] as const\nexport const HeadingTags = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const\n\nexport const HeadingWeights = [\n 'heavy',\n 'extrabold',\n 'bold',\n 'semibold',\n 'medium',\n 'normal',\n 'light',\n 'extralight',\n] as const\nexport const HeadingStretch = ['condensed', 'normal', 'expanded'] as const\nexport const HeadingLetterSpacing = ['condensed', 'normal', 'none'] as const\nexport const HeadingFontVariants = ['mona-sans', 'hubot-sans', 'monospace'] as const\n\nexport const defaultHeadingTag = HeadingTags[1]\nexport const defaultHeadingFont = HeadingFontVariants[0]\n\ntype HeadingWeightVariants = (typeof HeadingWeights)[number]\ntype HeadingStretchVariants = (typeof HeadingStretch)[number]\ntype HeadingLetterSpacingVariants = (typeof HeadingLetterSpacing)[number]\ntype HeadingFontVariants = (typeof HeadingFontVariants)[number]\ntype HeadingTextWrapVariants = 'wrap' | 'balance'\n\ntype ResponsiveStretchMap = {\n narrow?: HeadingStretchVariants\n regular?: HeadingStretchVariants\n wide?: HeadingStretchVariants\n}\n\ntype ResponsiveLetterSpacingMap = {\n narrow?: HeadingLetterSpacingVariants\n regular?: HeadingLetterSpacingVariants\n wide?: HeadingLetterSpacingVariants\n}\n\ntype ResponsiveWeightMap = {\n narrow?: HeadingWeightVariants\n regular?: HeadingWeightVariants\n wide?: HeadingWeightVariants\n}\n\nexport const classMap = {\n h1: HeadingSizes[1],\n h2: HeadingSizes[2],\n h3: HeadingSizes[3],\n h4: HeadingSizes[4],\n h5: HeadingSizes[5],\n h6: HeadingSizes[6],\n}\n\nexport type HeadingProps = {\n /** Semantic heading level (`h1`–`h6`) only. Use `size` to apply the correct visual size. */\n as?: (typeof HeadingTags)[number]\n /**\n * Controls the visual size, independent of `as`. Should be used whenever as prop is used, as the defaults may not be ideal for all use-cases.\n *\n * @example\n * <Heading as=\"h2\" size=\"4\">This h2 will appear visually identical to an h4</Heading>\n */\n size?: (typeof HeadingSizes)[number]\n weight?: HeadingWeightVariants | ResponsiveWeightMap\n stretch?: HeadingStretchVariants | ResponsiveStretchMap\n letterSpacing?: HeadingLetterSpacingVariants | ResponsiveLetterSpacingMap\n font?: HeadingFontVariants\n textWrap?: HeadingTextWrapVariants\n} & React.HTMLAttributes<HTMLHeadingElement> &\n BaseProps<HTMLHeadingElement>\n\n/**\n * Use the heading component to render titles or subtitle text.\n */\nexport const Heading = forwardRef<HTMLHeadingElement, PropsWithChildren<HeadingProps>>(\n (\n {\n animate,\n className,\n children,\n as: HeadingComponent = defaultHeadingTag,\n size,\n letterSpacing,\n weight,\n stretch,\n style,\n font = 'mona-sans',\n textWrap = 'balance',\n ...rest\n },\n ref,\n ) => {\n const {classes: animationClasses, styles: animationInlineStyles} = useAnimation(animate)\n\n const buildClass = (type: string, value) => {\n if (!value) return null\n return typeof value === 'string'\n ? styles[`Heading--${type}-${value}`]\n : Object.keys(value)\n .map(viewport => {\n return styles[`Heading-${viewport}--${type}-${value[viewport]}`]\n })\n .join(' ')\n }\n\n const weightClass = useMemo(() => buildClass('weight', weight), [weight])\n const stretchClass = useMemo(() => buildClass('stretch', stretch), [stretch])\n const letterSpacingClass = useMemo(() => buildClass('letter-spacing', letterSpacing), [letterSpacing])\n\n const headingClassNames = clsx(\n animationClasses,\n styles.Heading,\n styles[`Heading-font--${font}`],\n !size && styles[`Heading--${classMap[HeadingComponent]}`],\n size && styles[`Heading--${size}`],\n styles[`Heading--textWrap-${textWrap}`],\n weight && weightClass,\n stretch && stretchClass,\n letterSpacingClass && letterSpacingClass,\n className,\n )\n\n if (!HeadingTags.includes(HeadingComponent)) {\n // eslint-disable-next-line no-console\n console.error(`Heading: 'as' prop must be one of ${HeadingTags.join(', ')}`)\n return null\n }\n\n return (\n <HeadingComponent ref={ref} className={headingClassNames} style={{...animationInlineStyles, ...style}} {...rest}>\n {children}\n </HeadingComponent>\n )\n },\n)\n"],"mappings":";;;;;;AAMA,IAAa,IAAe;CAAC;CAAW;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAiB;CAAiB,EAC3F,IAAc;CAAC;CAAM;CAAM;CAAM;CAAM;CAAM;CAAK,EAElD,IAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,EACY,IAAiB;CAAC;CAAa;CAAU;CAAW,EACpD,IAAuB;CAAC;CAAa;CAAU;CAAO,EACtD,IAAsB;CAAC;CAAa;CAAc;CAAY,EAE9D,IAAoB,EAAY,IAChC,IAAqB,EAAoB,IA0BzC,IAAW;CACtB,IAAI,EAAa;CACjB,IAAI,EAAa;CACjB,IAAI,EAAa;CACjB,IAAI,EAAa;CACjB,IAAI,EAAa;CACjB,IAAI,EAAa;CAClB,EAuBY,IAAU,GAEnB,EACE,YACA,cACA,aACA,IAAI,IAAmB,GACvB,SACA,kBACA,WACA,YACA,UACA,UAAO,aACP,cAAW,WACX,GAAG,KAEL,MACG;CACH,IAAM,EAAC,SAAS,GAAkB,QAAQ,MAAyB,EAAa,EAAQ,EAElF,KAAc,GAAc,MAC3B,IACE,OAAO,KAAU,WACpB,EAAO,YAAY,EAAK,GAAG,OAC3B,OAAO,KAAK,EAAM,CACf,KAAI,MACI,EAAO,WAAW,EAAS,IAAI,EAAK,GAAG,EAAM,MACpD,CACD,KAAK,IAAI,GAPG,MAUf,IAAc,QAAc,EAAW,UAAU,EAAO,EAAE,CAAC,EAAO,CAAC,EACnE,IAAe,QAAc,EAAW,WAAW,EAAQ,EAAE,CAAC,EAAQ,CAAC,EACvE,IAAqB,QAAc,EAAW,kBAAkB,EAAc,EAAE,CAAC,EAAc,CAAC,EAEhG,IAAoB,EACxB,GACA,EAAO,SACP,EAAO,iBAAiB,MACxB,CAAC,KAAQ,EAAO,YAAY,EAAS,OACrC,KAAQ,EAAO,YAAY,MAC3B,EAAO,qBAAqB,MAC5B,KAAU,GACV,KAAW,GACX,KAAsB,GACtB,EACD;AAQD,QANK,EAAY,SAAS,EAAiB,GAOzC,kBAAC,GAAD;EAAuB;EAAK,WAAW;EAAmB,OAAO;GAAC,GAAG;GAAuB,GAAG;GAAM;EAAE,GAAI;EACxG;EACgB,CAAA,IAPnB,QAAQ,MAAM,qCAAqC,EAAY,KAAK,KAAK,GAAG,EACrE;EASZ"}
|
package/esm/Hero/Hero.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hero.d.ts","sourceRoot":"","sources":["../../src/Hero/Hero.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAK7E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAInD,OAAO,KAAK,EAA2B,SAAS,EAAE,WAAW,EAAC,MAAM,eAAe,CAAA;AAanF;;GAEG;AACH,OAAO,2FAA2F,CAAA;AAkBlG,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG;IAC/C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACzC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC1D,oBAAoB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC3C,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAA;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;
|
|
1
|
+
{"version":3,"file":"Hero.d.ts","sourceRoot":"","sources":["../../src/Hero/Hero.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAA;AAK7E,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAInD,OAAO,KAAK,EAA2B,SAAS,EAAE,WAAW,EAAC,MAAM,eAAe,CAAA;AAanF;;GAEG;AACH,OAAO,2FAA2F,CAAA;AAkBlG,MAAM,MAAM,SAAS,GAAG,SAAS,CAAC,WAAW,CAAC,GAAG;IAC/C,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,mBAAmB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACzC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;IAC1D,oBAAoB,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC3C,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAA;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,CAAA;AA8QD,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUf,CAAA"}
|
package/esm/Hero/Hero.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "../node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import { Grid as t } from "../Grid/Grid.js";
|
|
3
|
-
import { AnimationProvider as
|
|
4
|
-
import { Stack as
|
|
5
|
-
import { Box as
|
|
6
|
-
import { HeroContext as
|
|
7
|
-
import
|
|
8
|
-
import { HeroLabel as
|
|
9
|
-
import { HeroHeading as
|
|
10
|
-
import { HeroDescription as
|
|
11
|
-
import { HeroImage as
|
|
12
|
-
import { HeroVideo as
|
|
13
|
-
import { HeroEyebrow as
|
|
14
|
-
import { HeroPrimaryAction as
|
|
15
|
-
import { HeroSecondaryAction as
|
|
3
|
+
import { AnimationProvider as ee } from "../animation/AnimationProvider/AnimationProvider.js";
|
|
4
|
+
import { Stack as n } from "../Stack/Stack.js";
|
|
5
|
+
import { Box as te } from "../Box/Box.js";
|
|
6
|
+
import { HeroContext as ne, heroMediaInlinePositions as r } from "./HeroContext.js";
|
|
7
|
+
import i from "./Hero.module.js";
|
|
8
|
+
import { HeroLabel as a } from "./sub-components/HeroLabel.js";
|
|
9
|
+
import { HeroHeading as o } from "./sub-components/HeroHeading.js";
|
|
10
|
+
import { HeroDescription as s } from "./sub-components/HeroDescription.js";
|
|
11
|
+
import { HeroImage as c } from "./sub-components/HeroImage.js";
|
|
12
|
+
import { HeroVideo as l } from "./sub-components/HeroVideo.js";
|
|
13
|
+
import { HeroEyebrow as u } from "./sub-components/HeroEyebrow.js";
|
|
14
|
+
import { HeroPrimaryAction as d } from "./sub-components/HeroPrimaryAction.js";
|
|
15
|
+
import { HeroSecondaryAction as f } from "./sub-components/HeroSecondaryAction.js";
|
|
16
16
|
import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/hero/base-BDi-g8vJ.css';/* empty css */
|
|
17
|
-
import
|
|
17
|
+
import p, { Fragment as m, forwardRef as h, useMemo as g } from "react";
|
|
18
18
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
19
19
|
//#region src/Hero/Hero.tsx
|
|
20
20
|
var b = {
|
|
@@ -28,9 +28,9 @@ var b = {
|
|
|
28
28
|
get imageWrapper() {
|
|
29
29
|
return `${this.root}-imageWrapper`;
|
|
30
30
|
}
|
|
31
|
-
}, x =
|
|
32
|
-
let { HeroActions:
|
|
33
|
-
let e =
|
|
31
|
+
}, x = h(({ className: h, align: x = "start", children: S, imageContainerClassName: C, imageContainerStyle: w, imageContainerRef: T, imageBackgroundColor: E, variant: D = "default", trailingComponent: O, enableAnimation: k = !1, "data-testid": A, ...j }, M) => {
|
|
32
|
+
let { HeroActions: N, HeroChildren: re, HeroImageChild: P, HeroVideoChild: F, HeroHeaderChildren: I, HeroDescriptionChild: L } = g(() => {
|
|
33
|
+
let e = p.Children.toArray(S).reduce((e, t) => (p.isValidElement(t) && (t.type === d || t.type === f ? e.HeroActions.push(t) : t.type === c ? e.HeroImageChild = t : t.type === l ? e.HeroVideoChild = t : (e.HeroChildren.push(t), t.type === a || t.type === u || t.type === o ? e.HeroHeaderChildren.push(t) : t.type === s && (e.HeroDescriptionChild = t))), e), {
|
|
34
34
|
HeroActions: [],
|
|
35
35
|
HeroChildren: [],
|
|
36
36
|
HeroImageChild: void 0,
|
|
@@ -39,69 +39,71 @@ var b = {
|
|
|
39
39
|
HeroDescriptionChild: void 0
|
|
40
40
|
});
|
|
41
41
|
return e.HeroImageChild && e.HeroVideoChild && (e.HeroVideoChild = void 0), e;
|
|
42
|
-
}, [S]),
|
|
42
|
+
}, [S]), R = P?.props.position || F?.props.position, z = D === "gridline-expressive" && R?.startsWith("inline-") ? (process.env.NODE_ENV !== "production" && console.warn(`Hero: "gridline-expressive" variant does not support "${R}" position. Defaulting to "block-end".`), "block-end") : R || "block-end", ie = P?.props.enableBorder ?? F?.props.enableBorder ?? !0, B = r.includes(z), V = B ? z : void 0, H = P || F, U = D === "gridline", W = D === "gridline-expressive", G = z === "block-end" || z === "block-end-padded", K = z === "block-end-padded", q = W && x === "center", J = q ? "start" : x;
|
|
43
|
+
q && (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") && console.warn("Hero: the \"gridline-expressive\" variant does not support align=\"center\"; using \"start\" instead.");
|
|
44
|
+
let ae = (U || W) && k ? ee : m, oe = (U || W) && k ? {
|
|
43
45
|
autoStaggerChildren: !1,
|
|
44
46
|
animationTrigger: "immediate"
|
|
45
|
-
} : {}, Y = (U || W) && G, X = U && B,
|
|
47
|
+
} : {}, Y = (U || W) && G, X = U && B, se = P ? i["Hero--layout-image"] : i["Hero--layout-default"], Z = z === "inline-start" || z === "inline-start-padded", Q = (e) => O && /* @__PURE__ */ v(te, {
|
|
46
48
|
animate: e ? {
|
|
47
49
|
variant: "slide-in-up",
|
|
48
50
|
delay: 1e3,
|
|
49
51
|
duration: 1e3
|
|
50
52
|
} : void 0,
|
|
51
53
|
children: /* @__PURE__ */ v("div", {
|
|
52
|
-
className:
|
|
54
|
+
className: i["Hero-trailing"],
|
|
53
55
|
children: /* @__PURE__ */ v(O, {})
|
|
54
56
|
})
|
|
55
|
-
}), $ = () =>
|
|
56
|
-
className:
|
|
57
|
-
children:
|
|
57
|
+
}), $ = () => N.length > 0 && /* @__PURE__ */ v("div", {
|
|
58
|
+
className: i["Hero-actions"],
|
|
59
|
+
children: N
|
|
58
60
|
});
|
|
59
|
-
return /* @__PURE__ */ v(
|
|
60
|
-
...
|
|
61
|
-
children: /* @__PURE__ */ v(
|
|
61
|
+
return /* @__PURE__ */ v(ae, {
|
|
62
|
+
...oe,
|
|
63
|
+
children: /* @__PURE__ */ v(ne.Provider, {
|
|
62
64
|
value: {
|
|
63
|
-
imagePosition:
|
|
65
|
+
imagePosition: z,
|
|
64
66
|
variant: D,
|
|
65
|
-
align:
|
|
67
|
+
align: J,
|
|
66
68
|
hasInlineMedia: B,
|
|
67
69
|
enableAnimation: k
|
|
68
70
|
},
|
|
69
71
|
children: /* @__PURE__ */ y("section", {
|
|
70
|
-
className: e(
|
|
71
|
-
ref:
|
|
72
|
+
className: e(i.Hero, i[`Hero--variant-${D}`], !B && i[`Hero--align-${J}`], se, (P || F) && i[`Hero--image-pos-${z}`], (P || F) && B && i["Hero--image-pos-inline"], X && i["Hero--variant-inline-gridline"], h),
|
|
73
|
+
ref: M,
|
|
72
74
|
"aria-labelledby": "hero-section-brand-heading",
|
|
73
75
|
"data-testid": A || b.root,
|
|
74
76
|
...j,
|
|
75
77
|
children: [/* @__PURE__ */ v(t, {
|
|
76
78
|
fullWidth: !Y && !X,
|
|
77
79
|
"data-testid": b.grid,
|
|
78
|
-
className: e(
|
|
80
|
+
className: e(i["Hero-grid"], i[`Hero-grid--${z}`], Y && !W && i["Hero-grid--contained"], X && i["Hero-grid--bordered-inline"], W && i["Hero-grid--expressive"]),
|
|
79
81
|
children: W ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(t.Column, {
|
|
80
82
|
span: {
|
|
81
83
|
medium: 12,
|
|
82
|
-
large:
|
|
84
|
+
large: L ? 7 : 6
|
|
83
85
|
},
|
|
84
|
-
className:
|
|
85
|
-
children: /* @__PURE__ */ v(
|
|
86
|
+
className: i["Hero-expressive-header-column"],
|
|
87
|
+
children: /* @__PURE__ */ v(n, {
|
|
86
88
|
direction: "vertical",
|
|
87
89
|
gap: "none",
|
|
88
90
|
padding: "none",
|
|
89
91
|
alignItems: "flex-start",
|
|
90
|
-
children:
|
|
92
|
+
children: I
|
|
91
93
|
})
|
|
92
94
|
}), /* @__PURE__ */ v(t.Column, {
|
|
93
95
|
span: {
|
|
94
96
|
medium: 12,
|
|
95
|
-
large:
|
|
97
|
+
large: L ? 5 : 6
|
|
96
98
|
},
|
|
97
|
-
className:
|
|
98
|
-
children: /* @__PURE__ */ y(
|
|
99
|
+
className: i["Hero-expressive-body-column"],
|
|
100
|
+
children: /* @__PURE__ */ y(n, {
|
|
99
101
|
direction: "vertical",
|
|
100
102
|
gap: "none",
|
|
101
103
|
padding: "none",
|
|
102
104
|
alignItems: "flex-start",
|
|
103
105
|
children: [
|
|
104
|
-
|
|
106
|
+
L,
|
|
105
107
|
$(),
|
|
106
108
|
Q(k)
|
|
107
109
|
]
|
|
@@ -110,24 +112,24 @@ var b = {
|
|
|
110
112
|
Z && H && !Y && /* @__PURE__ */ v(t.Column, {
|
|
111
113
|
ref: T,
|
|
112
114
|
span: { large: 6 },
|
|
113
|
-
className: e(E &&
|
|
115
|
+
className: e(E && i[`Hero-imageContainer--bg-${E}`], X && V?.includes("padded") && i["Hero-imageContainer--inline-bg-padded"], X && i["Hero-imageContainer--inline-bordered"]),
|
|
114
116
|
children: /* @__PURE__ */ v("div", {
|
|
115
|
-
className: e(
|
|
117
|
+
className: e(i["Hero-mediaContainer"], C),
|
|
116
118
|
style: w,
|
|
117
119
|
children: H
|
|
118
120
|
})
|
|
119
121
|
}),
|
|
120
122
|
/* @__PURE__ */ v(t.Column, {
|
|
121
123
|
span: { large: H && B ? 6 : 12 },
|
|
122
|
-
children: /* @__PURE__ */ y(
|
|
123
|
-
className: e(X &&
|
|
124
|
+
children: /* @__PURE__ */ y(n, {
|
|
125
|
+
className: e(X && i["Hero-text-column--inline-gridline"], X && i["Hero-contentColumn--bordered-inline"]),
|
|
124
126
|
direction: "vertical",
|
|
125
127
|
gap: "none",
|
|
126
128
|
padding: "none",
|
|
127
|
-
alignItems: B ||
|
|
128
|
-
justifyContent: B ? void 0 :
|
|
129
|
+
alignItems: B || J === "start" ? "flex-start" : "center",
|
|
130
|
+
justifyContent: B ? void 0 : J === "start" ? "flex-start" : "center",
|
|
129
131
|
children: [
|
|
130
|
-
|
|
132
|
+
re,
|
|
131
133
|
$(),
|
|
132
134
|
Q(U && k)
|
|
133
135
|
]
|
|
@@ -136,9 +138,9 @@ var b = {
|
|
|
136
138
|
!Z && H && !Y && /* @__PURE__ */ v(t.Column, {
|
|
137
139
|
ref: T,
|
|
138
140
|
span: { large: B ? 6 : 12 },
|
|
139
|
-
className: e(E &&
|
|
141
|
+
className: e(E && i[`Hero-imageContainer--bg-${E}`], X && V?.includes("padded") && i["Hero-imageContainer--inline-bg-padded"], X && i["Hero-imageContainer--inline-bordered"]),
|
|
140
142
|
children: /* @__PURE__ */ v("div", {
|
|
141
|
-
className: e(
|
|
143
|
+
className: e(i["Hero-mediaContainer"], C),
|
|
142
144
|
style: w,
|
|
143
145
|
children: H
|
|
144
146
|
})
|
|
@@ -147,10 +149,10 @@ var b = {
|
|
|
147
149
|
}), H && Y && /* @__PURE__ */ v("div", {
|
|
148
150
|
ref: T,
|
|
149
151
|
"data-testid": b.imageWrapper,
|
|
150
|
-
className: e(
|
|
152
|
+
className: e(i["Hero-imageWrapper"], K && i["Hero-imageWrapper--block-end-padded"], C, E && i[`Hero-imageWrapper--bg-${E}`]),
|
|
151
153
|
style: w,
|
|
152
154
|
children: /* @__PURE__ */ v("div", {
|
|
153
|
-
className: e(
|
|
155
|
+
className: e(i["Hero-imageWrapper-inner"], K && i["Hero-imageWrapper-inner--padded"], ie && i["Hero-imageWrapper-inner--with-gridline"]),
|
|
154
156
|
children: H
|
|
155
157
|
})
|
|
156
158
|
})]
|
|
@@ -158,14 +160,14 @@ var b = {
|
|
|
158
160
|
})
|
|
159
161
|
});
|
|
160
162
|
}), S = Object.assign(x, {
|
|
161
|
-
Heading:
|
|
162
|
-
Description:
|
|
163
|
-
PrimaryAction:
|
|
164
|
-
SecondaryAction:
|
|
165
|
-
Image:
|
|
166
|
-
Video:
|
|
167
|
-
Label:
|
|
168
|
-
Eyebrow:
|
|
163
|
+
Heading: o,
|
|
164
|
+
Description: s,
|
|
165
|
+
PrimaryAction: d,
|
|
166
|
+
SecondaryAction: f,
|
|
167
|
+
Image: c,
|
|
168
|
+
Video: l,
|
|
169
|
+
Label: a,
|
|
170
|
+
Eyebrow: u,
|
|
169
171
|
testIds: b
|
|
170
172
|
});
|
|
171
173
|
//#endregion
|