@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
package/esm/Hero/Hero.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hero.js","names":[],"sources":["../../src/Hero/Hero.tsx"],"sourcesContent":["import React, {forwardRef, Fragment, PropsWithChildren, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport {Grid} from '../Grid'\nimport {Stack} from '../Stack'\nimport {Box} from '../Box'\nimport type {BaseProps} from '../component-helpers'\nimport {AnimationProvider} from '../animation'\n\nimport {HeroContext, heroMediaInlinePositions} from './HeroContext'\nimport type {HeroMediaInlinePositions, HeroAlign, HeroVariant} from './HeroContext'\nimport {\n HeroLabel,\n HeroHeading,\n HeroDescription,\n HeroImage,\n HeroVideo,\n HeroEyebrow,\n HeroPrimaryAction,\n HeroSecondaryAction,\n} from './sub-components'\nimport type {HeroImageProps, HeroVideoProps} from './sub-components'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/hero/base.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './Hero.module.css'\n\nconst testIds = {\n root: 'Hero',\n get video() {\n return `${this.root}-video`\n },\n get grid() {\n return `${this.root}-grid`\n },\n get imageWrapper() {\n return `${this.root}-imageWrapper`\n },\n}\n\nexport type HeroProps = BaseProps<HTMLElement> & {\n align?: HeroAlign\n imageContainerClassName?: string\n imageContainerStyle?: React.CSSProperties\n imageContainerRef?: React.RefObject<HTMLDivElement | null>\n imageBackgroundColor?: 'default' | 'subtle'\n variant?: HeroVariant\n enableAnimation?: boolean\n /**\n * Escape-hatch for inserting custom React components.\n * Warning:\n * This prop isn't advertised in our docs but remains part of the public API for edge-cases.\n * Need to use this prop? Please check in with #primer-brand first to confirm correct usage.\n */\n trailingComponent?: React.FunctionComponent\n 'data-testid'?: string\n}\n\nconst Root = forwardRef<HTMLElement, PropsWithChildren<HeroProps>>(\n (\n {\n className,\n align = 'start',\n children,\n imageContainerClassName,\n imageContainerStyle,\n imageContainerRef,\n imageBackgroundColor,\n variant = 'default',\n trailingComponent: TrailingComponent,\n enableAnimation = false,\n 'data-testid': testId,\n ...rest\n },\n ref,\n ) => {\n const {HeroActions, HeroChildren, HeroImageChild, HeroVideoChild, HeroHeaderChildren, HeroDescriptionChild} =\n useMemo(() => {\n const result = React.Children.toArray(children).reduce<{\n HeroActions: React.ReactElement[]\n HeroImageChild?: React.ReactElement<HeroImageProps>\n HeroVideoChild?: React.ReactElement<HeroVideoProps>\n HeroChildren: React.ReactElement[]\n HeroHeaderChildren: React.ReactElement[]\n HeroDescriptionChild?: React.ReactElement\n }>(\n (acc, child) => {\n if (React.isValidElement(child)) {\n if (child.type === HeroPrimaryAction || child.type === HeroSecondaryAction) {\n acc.HeroActions.push(child)\n } else if (child.type === HeroImage) {\n acc.HeroImageChild = child as React.ReactElement<HeroImageProps>\n } else if (child.type === HeroVideo) {\n acc.HeroVideoChild = child as React.ReactElement<HeroVideoProps>\n } else {\n acc.HeroChildren.push(child)\n if (child.type === HeroLabel || child.type === HeroEyebrow || child.type === HeroHeading) {\n acc.HeroHeaderChildren.push(child)\n } else if (child.type === HeroDescription) {\n acc.HeroDescriptionChild = child\n }\n }\n }\n return acc\n },\n {\n HeroActions: [],\n HeroChildren: [],\n HeroImageChild: undefined,\n HeroVideoChild: undefined,\n HeroHeaderChildren: [],\n HeroDescriptionChild: undefined,\n },\n )\n\n // Prefer Hero.Image - don't show both\n if (result.HeroImageChild && result.HeroVideoChild) {\n result.HeroVideoChild = undefined\n }\n\n return result\n }, [children])\n\n const mediaPositionProp = HeroImageChild?.props.position || HeroVideoChild?.props.position\n\n const mediaPosition = (() => {\n if (variant === 'gridline-expressive' && mediaPositionProp?.startsWith('inline-')) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n `Hero: \"gridline-expressive\" variant does not support \"${mediaPositionProp}\" position. Defaulting to \"block-end\".`,\n )\n }\n return 'block-end'\n }\n return mediaPositionProp || 'block-end'\n })()\n const mediaWrapperHasBorder = HeroImageChild?.props.enableBorder ?? HeroVideoChild?.props.enableBorder ?? true\n const hasInlineMedia = heroMediaInlinePositions.includes(mediaPosition as HeroMediaInlinePositions)\n const inlineMediaPosition = hasInlineMedia ? mediaPosition : undefined\n const mediaChild = HeroImageChild || HeroVideoChild\n const isGridline = variant === 'gridline'\n const isGridlineExpressive = variant === 'gridline-expressive'\n const isBlockEndPosition = mediaPosition === 'block-end' || mediaPosition === 'block-end-padded'\n const isBlockEndPadded = mediaPosition === 'block-end-padded'\n\n const Tag = (isGridline || isGridlineExpressive) && enableAnimation ? AnimationProvider : Fragment\n const tagProps =\n (isGridline || isGridlineExpressive) && enableAnimation\n ? {\n autoStaggerChildren: false,\n animationTrigger: 'immediate' as const,\n }\n : {}\n\n const useContainedLayout = (isGridline || isGridlineExpressive) && isBlockEndPosition\n const useInlineGridline = isGridline && hasInlineMedia\n\n const heroLayoutClass = HeroImageChild ? styles['Hero--layout-image'] : styles['Hero--layout-default']\n const isInlineStart = mediaPosition === 'inline-start' || mediaPosition === 'inline-start-padded'\n\n const renderTrailingComponent = (shouldAnimate: boolean) =>\n TrailingComponent && (\n <Box animate={shouldAnimate ? {variant: 'slide-in-up' as const, delay: 1000, duration: 1000} : undefined}>\n <div className={styles['Hero-trailing']}>\n <TrailingComponent />\n </div>\n </Box>\n )\n\n const renderActions = () => HeroActions.length > 0 && <div className={styles['Hero-actions']}>{HeroActions}</div>\n\n return (\n <Tag {...tagProps}>\n <HeroContext.Provider value={{imagePosition: mediaPosition, variant, align, hasInlineMedia, enableAnimation}}>\n <section\n className={clsx(\n styles.Hero,\n styles[`Hero--variant-${variant}`],\n !hasInlineMedia && styles[`Hero--align-${align}`],\n heroLayoutClass,\n (HeroImageChild || HeroVideoChild) && styles[`Hero--image-pos-${mediaPosition}`],\n (HeroImageChild || HeroVideoChild) && hasInlineMedia && styles['Hero--image-pos-inline'],\n useInlineGridline && styles['Hero--variant-inline-gridline'],\n className,\n )}\n ref={ref}\n aria-labelledby=\"hero-section-brand-heading\"\n data-testid={testId || testIds.root}\n {...rest}\n >\n <Grid\n fullWidth={!useContainedLayout && !useInlineGridline}\n data-testid={testIds.grid}\n className={clsx(\n styles['Hero-grid'],\n styles[`Hero-grid--${mediaPosition}`],\n useContainedLayout && !isGridlineExpressive && styles['Hero-grid--contained'],\n useInlineGridline && styles['Hero-grid--bordered-inline'],\n isGridlineExpressive && styles['Hero-grid--expressive'],\n )}\n >\n {isGridlineExpressive ? (\n <>\n {/* Expressive variant: header column (left) */}\n <Grid.Column\n span={{medium: 12, large: HeroDescriptionChild ? 7 : 6}}\n className={styles['Hero-expressive-header-column']}\n >\n <Stack direction=\"vertical\" gap=\"none\" padding=\"none\" alignItems=\"flex-start\">\n {HeroHeaderChildren}\n </Stack>\n </Grid.Column>\n {/* Expressive variant: body column (right) */}\n <Grid.Column\n span={{medium: 12, large: HeroDescriptionChild ? 5 : 6}}\n className={styles['Hero-expressive-body-column']}\n >\n <Stack direction=\"vertical\" gap=\"none\" padding=\"none\" alignItems=\"flex-start\">\n {HeroDescriptionChild}\n {renderActions()}\n {renderTrailingComponent(enableAnimation)}\n </Stack>\n </Grid.Column>\n </>\n ) : (\n <>\n {/* Standard GridLine variant: text column */}\n {isInlineStart && mediaChild && !useContainedLayout && (\n <Grid.Column\n ref={imageContainerRef}\n span={{large: 6}}\n className={clsx(\n imageBackgroundColor && styles[`Hero-imageContainer--bg-${imageBackgroundColor}`],\n useInlineGridline &&\n inlineMediaPosition?.includes('padded') &&\n styles['Hero-imageContainer--inline-bg-padded'],\n useInlineGridline && styles['Hero-imageContainer--inline-bordered'],\n )}\n >\n <div\n className={clsx(styles['Hero-mediaContainer'], imageContainerClassName)}\n style={imageContainerStyle}\n >\n {mediaChild}\n </div>\n </Grid.Column>\n )}\n <Grid.Column span={{large: mediaChild && hasInlineMedia ? 6 : 12}}>\n <Stack\n className={clsx(\n useInlineGridline && styles['Hero-text-column--inline-gridline'],\n useInlineGridline && styles['Hero-contentColumn--bordered-inline'],\n )}\n direction=\"vertical\"\n gap=\"none\"\n padding=\"none\"\n alignItems={hasInlineMedia ? 'flex-start' : align === 'start' ? 'flex-start' : 'center'}\n justifyContent={hasInlineMedia ? undefined : align === 'start' ? 'flex-start' : 'center'}\n >\n {HeroChildren}\n {renderActions()}\n {renderTrailingComponent(isGridline && enableAnimation)}\n </Stack>\n </Grid.Column>\n {!isInlineStart && mediaChild && !useContainedLayout && (\n <Grid.Column\n ref={imageContainerRef}\n span={{large: hasInlineMedia ? 6 : 12}}\n className={clsx(\n imageBackgroundColor && styles[`Hero-imageContainer--bg-${imageBackgroundColor}`],\n useInlineGridline &&\n inlineMediaPosition?.includes('padded') &&\n styles['Hero-imageContainer--inline-bg-padded'],\n useInlineGridline && styles['Hero-imageContainer--inline-bordered'],\n )}\n >\n <div\n className={clsx(styles['Hero-mediaContainer'], imageContainerClassName)}\n style={imageContainerStyle}\n >\n {mediaChild}\n </div>\n </Grid.Column>\n )}\n </>\n )}\n </Grid>\n {mediaChild && useContainedLayout && (\n <div\n ref={imageContainerRef}\n data-testid={testIds.imageWrapper}\n className={clsx(\n styles['Hero-imageWrapper'],\n isBlockEndPadded && styles['Hero-imageWrapper--block-end-padded'],\n imageContainerClassName,\n imageBackgroundColor && styles[`Hero-imageWrapper--bg-${imageBackgroundColor}`],\n )}\n style={imageContainerStyle}\n >\n <div\n className={clsx(\n styles['Hero-imageWrapper-inner'],\n isBlockEndPadded && styles['Hero-imageWrapper-inner--padded'],\n mediaWrapperHasBorder && styles['Hero-imageWrapper-inner--with-gridline'],\n )}\n >\n {mediaChild}\n </div>\n </div>\n )}\n </section>\n </HeroContext.Provider>\n </Tag>\n )\n },\n)\n\nexport const Hero = Object.assign(Root, {\n Heading: HeroHeading,\n Description: HeroDescription,\n PrimaryAction: HeroPrimaryAction,\n SecondaryAction: HeroSecondaryAction,\n Image: HeroImage,\n Video: HeroVideo,\n Label: HeroLabel,\n Eyebrow: HeroEyebrow,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,QAAQ;AACV,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,eAAe;AACjB,SAAO,GAAG,KAAK,KAAK;;CAEvB,EAoBK,IAAO,GAET,EACE,cACA,WAAQ,SACR,aACA,4BACA,wBACA,sBACA,yBACA,aAAU,WACV,mBAAmB,GACnB,qBAAkB,IAClB,eAAe,GACf,GAAG,KAEL,OACG;CACH,IAAM,EAAC,gBAAa,iBAAc,mBAAgB,mBAAgB,wBAAoB,4BACpF,SAAc;EACZ,IAAM,IAAS,EAAM,SAAS,QAAQ,EAAS,CAAC,QAQ7C,GAAK,OACA,EAAM,eAAe,EAAM,KACzB,EAAM,SAAS,KAAqB,EAAM,SAAS,IACrD,EAAI,YAAY,KAAK,EAAM,GAClB,EAAM,SAAS,IACxB,EAAI,iBAAiB,IACZ,EAAM,SAAS,IACxB,EAAI,iBAAiB,KAErB,EAAI,aAAa,KAAK,EAAM,EACxB,EAAM,SAAS,KAAa,EAAM,SAAS,KAAe,EAAM,SAAS,IAC3E,EAAI,mBAAmB,KAAK,EAAM,GACzB,EAAM,SAAS,MACxB,EAAI,uBAAuB,MAI1B,IAET;GACE,aAAa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1
|
+
{"version":3,"file":"Hero.js","names":[],"sources":["../../src/Hero/Hero.tsx"],"sourcesContent":["import React, {forwardRef, Fragment, PropsWithChildren, useMemo} from 'react'\nimport {clsx} from 'clsx'\nimport {Grid} from '../Grid'\nimport {Stack} from '../Stack'\nimport {Box} from '../Box'\nimport type {BaseProps} from '../component-helpers'\nimport {AnimationProvider} from '../animation'\n\nimport {HeroContext, heroMediaInlinePositions} from './HeroContext'\nimport type {HeroMediaInlinePositions, HeroAlign, HeroVariant} from './HeroContext'\nimport {\n HeroLabel,\n HeroHeading,\n HeroDescription,\n HeroImage,\n HeroVideo,\n HeroEyebrow,\n HeroPrimaryAction,\n HeroSecondaryAction,\n} from './sub-components'\nimport type {HeroImageProps, HeroVideoProps} from './sub-components'\n\n/**\n * Design tokens\n */\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/hero/base.css'\n\n/** * Main Stylesheet (as a CSS Module) */\nimport styles from './Hero.module.css'\n\nconst testIds = {\n root: 'Hero',\n get video() {\n return `${this.root}-video`\n },\n get grid() {\n return `${this.root}-grid`\n },\n get imageWrapper() {\n return `${this.root}-imageWrapper`\n },\n}\n\nexport type HeroProps = BaseProps<HTMLElement> & {\n align?: HeroAlign\n imageContainerClassName?: string\n imageContainerStyle?: React.CSSProperties\n imageContainerRef?: React.RefObject<HTMLDivElement | null>\n imageBackgroundColor?: 'default' | 'subtle'\n variant?: HeroVariant\n enableAnimation?: boolean\n /**\n * Escape-hatch for inserting custom React components.\n * Warning:\n * This prop isn't advertised in our docs but remains part of the public API for edge-cases.\n * Need to use this prop? Please check in with #primer-brand first to confirm correct usage.\n */\n trailingComponent?: React.FunctionComponent\n 'data-testid'?: string\n}\n\nconst Root = forwardRef<HTMLElement, PropsWithChildren<HeroProps>>(\n (\n {\n className,\n align: alignProp = 'start',\n children,\n imageContainerClassName,\n imageContainerStyle,\n imageContainerRef,\n imageBackgroundColor,\n variant = 'default',\n trailingComponent: TrailingComponent,\n enableAnimation = false,\n 'data-testid': testId,\n ...rest\n },\n ref,\n ) => {\n const {HeroActions, HeroChildren, HeroImageChild, HeroVideoChild, HeroHeaderChildren, HeroDescriptionChild} =\n useMemo(() => {\n const result = React.Children.toArray(children).reduce<{\n HeroActions: React.ReactElement[]\n HeroImageChild?: React.ReactElement<HeroImageProps>\n HeroVideoChild?: React.ReactElement<HeroVideoProps>\n HeroChildren: React.ReactElement[]\n HeroHeaderChildren: React.ReactElement[]\n HeroDescriptionChild?: React.ReactElement\n }>(\n (acc, child) => {\n if (React.isValidElement(child)) {\n if (child.type === HeroPrimaryAction || child.type === HeroSecondaryAction) {\n acc.HeroActions.push(child)\n } else if (child.type === HeroImage) {\n acc.HeroImageChild = child as React.ReactElement<HeroImageProps>\n } else if (child.type === HeroVideo) {\n acc.HeroVideoChild = child as React.ReactElement<HeroVideoProps>\n } else {\n acc.HeroChildren.push(child)\n if (child.type === HeroLabel || child.type === HeroEyebrow || child.type === HeroHeading) {\n acc.HeroHeaderChildren.push(child)\n } else if (child.type === HeroDescription) {\n acc.HeroDescriptionChild = child\n }\n }\n }\n return acc\n },\n {\n HeroActions: [],\n HeroChildren: [],\n HeroImageChild: undefined,\n HeroVideoChild: undefined,\n HeroHeaderChildren: [],\n HeroDescriptionChild: undefined,\n },\n )\n\n // Prefer Hero.Image - don't show both\n if (result.HeroImageChild && result.HeroVideoChild) {\n result.HeroVideoChild = undefined\n }\n\n return result\n }, [children])\n\n const mediaPositionProp = HeroImageChild?.props.position || HeroVideoChild?.props.position\n\n const mediaPosition = (() => {\n if (variant === 'gridline-expressive' && mediaPositionProp?.startsWith('inline-')) {\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn(\n `Hero: \"gridline-expressive\" variant does not support \"${mediaPositionProp}\" position. Defaulting to \"block-end\".`,\n )\n }\n return 'block-end'\n }\n return mediaPositionProp || 'block-end'\n })()\n const mediaWrapperHasBorder = HeroImageChild?.props.enableBorder ?? HeroVideoChild?.props.enableBorder ?? true\n const hasInlineMedia = heroMediaInlinePositions.includes(mediaPosition as HeroMediaInlinePositions)\n const inlineMediaPosition = hasInlineMedia ? mediaPosition : undefined\n const mediaChild = HeroImageChild || HeroVideoChild\n const isGridline = variant === 'gridline'\n const isGridlineExpressive = variant === 'gridline-expressive'\n const isBlockEndPosition = mediaPosition === 'block-end' || mediaPosition === 'block-end-padded'\n const isBlockEndPadded = mediaPosition === 'block-end-padded'\n\n const isInvalidGridlineAlignment = isGridlineExpressive && alignProp === 'center'\n const align: HeroAlign = isInvalidGridlineAlignment ? 'start' : alignProp\n\n if (isInvalidGridlineAlignment && (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')) {\n // eslint-disable-next-line no-console\n console.warn('Hero: the \"gridline-expressive\" variant does not support align=\"center\"; using \"start\" instead.')\n }\n\n const Tag = (isGridline || isGridlineExpressive) && enableAnimation ? AnimationProvider : Fragment\n const tagProps =\n (isGridline || isGridlineExpressive) && enableAnimation\n ? {\n autoStaggerChildren: false,\n animationTrigger: 'immediate' as const,\n }\n : {}\n\n const useContainedLayout = (isGridline || isGridlineExpressive) && isBlockEndPosition\n const useInlineGridline = isGridline && hasInlineMedia\n\n const heroLayoutClass = HeroImageChild ? styles['Hero--layout-image'] : styles['Hero--layout-default']\n const isInlineStart = mediaPosition === 'inline-start' || mediaPosition === 'inline-start-padded'\n\n const renderTrailingComponent = (shouldAnimate: boolean) =>\n TrailingComponent && (\n <Box animate={shouldAnimate ? {variant: 'slide-in-up' as const, delay: 1000, duration: 1000} : undefined}>\n <div className={styles['Hero-trailing']}>\n <TrailingComponent />\n </div>\n </Box>\n )\n\n const renderActions = () => HeroActions.length > 0 && <div className={styles['Hero-actions']}>{HeroActions}</div>\n\n return (\n <Tag {...tagProps}>\n <HeroContext.Provider value={{imagePosition: mediaPosition, variant, align, hasInlineMedia, enableAnimation}}>\n <section\n className={clsx(\n styles.Hero,\n styles[`Hero--variant-${variant}`],\n !hasInlineMedia && styles[`Hero--align-${align}`],\n heroLayoutClass,\n (HeroImageChild || HeroVideoChild) && styles[`Hero--image-pos-${mediaPosition}`],\n (HeroImageChild || HeroVideoChild) && hasInlineMedia && styles['Hero--image-pos-inline'],\n useInlineGridline && styles['Hero--variant-inline-gridline'],\n className,\n )}\n ref={ref}\n aria-labelledby=\"hero-section-brand-heading\"\n data-testid={testId || testIds.root}\n {...rest}\n >\n <Grid\n fullWidth={!useContainedLayout && !useInlineGridline}\n data-testid={testIds.grid}\n className={clsx(\n styles['Hero-grid'],\n styles[`Hero-grid--${mediaPosition}`],\n useContainedLayout && !isGridlineExpressive && styles['Hero-grid--contained'],\n useInlineGridline && styles['Hero-grid--bordered-inline'],\n isGridlineExpressive && styles['Hero-grid--expressive'],\n )}\n >\n {isGridlineExpressive ? (\n <>\n {/* Expressive variant: header column (left) */}\n <Grid.Column\n span={{medium: 12, large: HeroDescriptionChild ? 7 : 6}}\n className={styles['Hero-expressive-header-column']}\n >\n <Stack direction=\"vertical\" gap=\"none\" padding=\"none\" alignItems=\"flex-start\">\n {HeroHeaderChildren}\n </Stack>\n </Grid.Column>\n {/* Expressive variant: body column (right) */}\n <Grid.Column\n span={{medium: 12, large: HeroDescriptionChild ? 5 : 6}}\n className={styles['Hero-expressive-body-column']}\n >\n <Stack direction=\"vertical\" gap=\"none\" padding=\"none\" alignItems=\"flex-start\">\n {HeroDescriptionChild}\n {renderActions()}\n {renderTrailingComponent(enableAnimation)}\n </Stack>\n </Grid.Column>\n </>\n ) : (\n <>\n {/* Standard GridLine variant: text column */}\n {isInlineStart && mediaChild && !useContainedLayout && (\n <Grid.Column\n ref={imageContainerRef}\n span={{large: 6}}\n className={clsx(\n imageBackgroundColor && styles[`Hero-imageContainer--bg-${imageBackgroundColor}`],\n useInlineGridline &&\n inlineMediaPosition?.includes('padded') &&\n styles['Hero-imageContainer--inline-bg-padded'],\n useInlineGridline && styles['Hero-imageContainer--inline-bordered'],\n )}\n >\n <div\n className={clsx(styles['Hero-mediaContainer'], imageContainerClassName)}\n style={imageContainerStyle}\n >\n {mediaChild}\n </div>\n </Grid.Column>\n )}\n <Grid.Column span={{large: mediaChild && hasInlineMedia ? 6 : 12}}>\n <Stack\n className={clsx(\n useInlineGridline && styles['Hero-text-column--inline-gridline'],\n useInlineGridline && styles['Hero-contentColumn--bordered-inline'],\n )}\n direction=\"vertical\"\n gap=\"none\"\n padding=\"none\"\n alignItems={hasInlineMedia ? 'flex-start' : align === 'start' ? 'flex-start' : 'center'}\n justifyContent={hasInlineMedia ? undefined : align === 'start' ? 'flex-start' : 'center'}\n >\n {HeroChildren}\n {renderActions()}\n {renderTrailingComponent(isGridline && enableAnimation)}\n </Stack>\n </Grid.Column>\n {!isInlineStart && mediaChild && !useContainedLayout && (\n <Grid.Column\n ref={imageContainerRef}\n span={{large: hasInlineMedia ? 6 : 12}}\n className={clsx(\n imageBackgroundColor && styles[`Hero-imageContainer--bg-${imageBackgroundColor}`],\n useInlineGridline &&\n inlineMediaPosition?.includes('padded') &&\n styles['Hero-imageContainer--inline-bg-padded'],\n useInlineGridline && styles['Hero-imageContainer--inline-bordered'],\n )}\n >\n <div\n className={clsx(styles['Hero-mediaContainer'], imageContainerClassName)}\n style={imageContainerStyle}\n >\n {mediaChild}\n </div>\n </Grid.Column>\n )}\n </>\n )}\n </Grid>\n {mediaChild && useContainedLayout && (\n <div\n ref={imageContainerRef}\n data-testid={testIds.imageWrapper}\n className={clsx(\n styles['Hero-imageWrapper'],\n isBlockEndPadded && styles['Hero-imageWrapper--block-end-padded'],\n imageContainerClassName,\n imageBackgroundColor && styles[`Hero-imageWrapper--bg-${imageBackgroundColor}`],\n )}\n style={imageContainerStyle}\n >\n <div\n className={clsx(\n styles['Hero-imageWrapper-inner'],\n isBlockEndPadded && styles['Hero-imageWrapper-inner--padded'],\n mediaWrapperHasBorder && styles['Hero-imageWrapper-inner--with-gridline'],\n )}\n >\n {mediaChild}\n </div>\n </div>\n )}\n </section>\n </HeroContext.Provider>\n </Tag>\n )\n },\n)\n\nexport const Hero = Object.assign(Root, {\n Heading: HeroHeading,\n Description: HeroDescription,\n PrimaryAction: HeroPrimaryAction,\n SecondaryAction: HeroSecondaryAction,\n Image: HeroImage,\n Video: HeroVideo,\n Label: HeroLabel,\n Eyebrow: HeroEyebrow,\n testIds,\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA8BA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,QAAQ;AACV,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,eAAe;AACjB,SAAO,GAAG,KAAK,KAAK;;CAEvB,EAoBK,IAAO,GAET,EACE,cACA,OAAO,IAAY,SACnB,aACA,4BACA,wBACA,sBACA,yBACA,aAAU,WACV,mBAAmB,GACnB,qBAAkB,IAClB,eAAe,GACf,GAAG,KAEL,MACG;CACH,IAAM,EAAC,gBAAa,kBAAc,mBAAgB,mBAAgB,uBAAoB,4BACpF,QAAc;EACZ,IAAM,IAAS,EAAM,SAAS,QAAQ,EAAS,CAAC,QAQ7C,GAAK,OACA,EAAM,eAAe,EAAM,KACzB,EAAM,SAAS,KAAqB,EAAM,SAAS,IACrD,EAAI,YAAY,KAAK,EAAM,GAClB,EAAM,SAAS,IACxB,EAAI,iBAAiB,IACZ,EAAM,SAAS,IACxB,EAAI,iBAAiB,KAErB,EAAI,aAAa,KAAK,EAAM,EACxB,EAAM,SAAS,KAAa,EAAM,SAAS,KAAe,EAAM,SAAS,IAC3E,EAAI,mBAAmB,KAAK,EAAM,GACzB,EAAM,SAAS,MACxB,EAAI,uBAAuB,MAI1B,IAET;GACE,aAAa,EAAE;GACf,cAAc,EAAE;GAChB,gBAAgB,KAAA;GAChB,gBAAgB,KAAA;GAChB,oBAAoB,EAAE;GACtB,sBAAsB,KAAA;GACvB,CACF;AAOD,SAJI,EAAO,kBAAkB,EAAO,mBAClC,EAAO,iBAAiB,KAAA,IAGnB;IACN,CAAC,EAAS,CAAC,EAEV,IAAoB,GAAgB,M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OACM,CAAA;MAEhB,kBAAC,EAAK,QAAN;OAAa,MAAM,EAAC,OAAO,KAAc,IAAiB,IAAI,IAAG;iBAC/D,kBAAC,GAAD;QACE,WAAW,EACT,KAAqB,EAAO,sCAC5B,KAAqB,EAAO,uCAC7B;QACD,WAAU;QACV,KAAI;QACJ,SAAQ;QACR,YAAY,KAAgC,MAAU,UAAzB,eAAkD;QAC/E,gBAAgB,IAAiB,KAAA,IAAY,MAAU,UAAU,eAAe;kBATlF;SAWG;SACA,GAAe;SACf,EAAwB,KAAc,EAAgB;SACjD;;OACI,CAAA;MACb,CAAC,KAAiB,KAAc,CAAC,KAChC,kBAAC,EAAK,QAAN;OACE,KAAK;OACL,MAAM,EAAC,OAAO,IAAiB,IAAI,IAAG;OACtC,WAAW,EACT,KAAwB,EAAO,2BAA2B,MAC1D,KACE,GAAqB,SAAS,SAAS,IACvC,EAAO,0CACT,KAAqB,EAAO,wCAC7B;iBAED,kBAAC,OAAD;QACE,WAAW,EAAK,EAAO,wBAAwB,EAAwB;QACvE,OAAO;kBAEN;QACG,CAAA;OACM,CAAA;MAEf,EAAA,CAAA;KAEA,CAAA,EACN,KAAc,KACb,kBAAC,OAAD;KACE,KAAK;KACL,eAAa,EAAQ;KACrB,WAAW,EACT,EAAO,sBACP,KAAoB,EAAO,wCAC3B,GACA,KAAwB,EAAO,yBAAyB,KACzD;KACD,OAAO;eAEP,kBAAC,OAAD;MACE,WAAW,EACT,EAAO,4BACP,KAAoB,EAAO,oCAC3B,MAAyB,EAAO,0CACjC;gBAEA;MACG,CAAA;KACF,CAAA,CAEA;;GACW,CAAA;EACnB,CAAA;EAGX,EAEY,IAAO,OAAO,OAAO,GAAM;CACtC,SAAS;CACT,aAAa;CACb,eAAe;CACf,iBAAiB;CACjB,OAAO;CACP,OAAO;CACP,OAAO;CACP,SAAS;CACT;CACD,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import React, { type PropsWithChildren, type ReactElement, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type Icon } from '@primer/octicons-react';
|
|
3
|
+
import type { BaseProps } from '../component-helpers';
|
|
4
|
+
import '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css';
|
|
5
|
+
export type NavListRootProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Accessible label for the navigation landmark.
|
|
8
|
+
*/
|
|
9
|
+
'aria-label': string;
|
|
10
|
+
/**
|
|
11
|
+
* ID of an element that labels the navigation landmark.
|
|
12
|
+
*/
|
|
13
|
+
'aria-labelledby'?: string;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
'data-testid'?: string;
|
|
16
|
+
} & BaseProps<HTMLElement> & Omit<React.HTMLAttributes<HTMLElement>, 'aria-label' | 'aria-labelledby'>;
|
|
17
|
+
type Visual = ReactElement | React.ElementType | Icon;
|
|
18
|
+
type NavListItemAs = 'a' | 'button';
|
|
19
|
+
type NavListItemBaseProps = {
|
|
20
|
+
/**
|
|
21
|
+
* Leading visual rendered before the item label.
|
|
22
|
+
*/
|
|
23
|
+
leadingVisual?: Visual;
|
|
24
|
+
/**
|
|
25
|
+
* Trailing visual rendered after the item label.
|
|
26
|
+
*/
|
|
27
|
+
trailingVisual?: Visual;
|
|
28
|
+
/**
|
|
29
|
+
* Whether nested items should be expanded by default.
|
|
30
|
+
*/
|
|
31
|
+
defaultExpanded?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Controls the nested item expanded state.
|
|
34
|
+
*/
|
|
35
|
+
expanded?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Called when a nested item is expanded or collapsed.
|
|
38
|
+
*/
|
|
39
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Marks the item as disabled. Disabled link items receive `aria-disabled`.
|
|
42
|
+
*/
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
'data-testid'?: string;
|
|
45
|
+
};
|
|
46
|
+
export type NavListItemProps<C extends NavListItemAs = 'a'> = {
|
|
47
|
+
as?: C;
|
|
48
|
+
} & NavListItemBaseProps & PropsWithChildren<BaseProps<HTMLElement>> & Omit<React.ComponentPropsWithoutRef<C>, keyof NavListItemBaseProps | keyof BaseProps<HTMLElement> | 'as' | 'children'>;
|
|
49
|
+
export type NavListSubNavProps = {
|
|
50
|
+
children: ReactNode;
|
|
51
|
+
'data-testid'?: string;
|
|
52
|
+
} & BaseProps<HTMLUListElement> & React.HTMLAttributes<HTMLUListElement>;
|
|
53
|
+
export type NavListGroupProps = {
|
|
54
|
+
/**
|
|
55
|
+
* Heading text for the group.
|
|
56
|
+
*/
|
|
57
|
+
title?: ReactNode;
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
'data-testid'?: string;
|
|
60
|
+
} & BaseProps<HTMLLIElement> & Omit<React.LiHTMLAttributes<HTMLLIElement>, 'title'>;
|
|
61
|
+
/**
|
|
62
|
+
* Use NavList to render vertical navigation links with groups and expandable nested lists.
|
|
63
|
+
* @see https://primer.style/brand/components/NavList
|
|
64
|
+
*/
|
|
65
|
+
export declare const NavList: React.ForwardRefExoticComponent<Omit<NavListRootProps, "ref"> & React.RefAttributes<HTMLElement>> & {
|
|
66
|
+
Item: <C extends NavListItemAs = "a">(props: NavListItemProps<C> & {
|
|
67
|
+
ref?: Ref<HTMLElement>;
|
|
68
|
+
}) => ReactElement | null;
|
|
69
|
+
SubNav: React.ForwardRefExoticComponent<Omit<NavListSubNavProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
70
|
+
Group: React.ForwardRefExoticComponent<Omit<NavListGroupProps, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
71
|
+
testIds: {
|
|
72
|
+
root: string;
|
|
73
|
+
readonly list: string;
|
|
74
|
+
readonly item: string;
|
|
75
|
+
readonly link: string;
|
|
76
|
+
readonly leadingVisual: string;
|
|
77
|
+
readonly trailingVisual: string;
|
|
78
|
+
readonly subNav: string;
|
|
79
|
+
readonly group: string;
|
|
80
|
+
readonly groupTitle: string;
|
|
81
|
+
readonly groupList: string;
|
|
82
|
+
readonly toggle: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export {};
|
|
86
|
+
//# sourceMappingURL=NavList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavList.d.ts","sourceRoot":"","sources":["../../src/NavList/NavList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAaZ,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAA;AAGd,OAAO,EAAmB,KAAK,IAAI,EAAC,MAAM,wBAAwB,CAAA;AAClE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAA;AAEnD,OAAO,4GAA4G,CAAA;AAuCnH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,SAAS,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB,GAAG,SAAS,CAAC,WAAW,CAAC,GACxB,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,YAAY,GAAG,iBAAiB,CAAC,CAAA;AAgD3E,KAAK,MAAM,GAAG,YAAY,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CAAA;AACrD,KAAK,aAAa,GAAG,GAAG,GAAG,QAAQ,CAAA;AAEnC,KAAK,oBAAoB,GAAG;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,E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useId.js";
|
|
3
|
+
import { TriangleDownIcon as n } from "../node_modules/@primer/octicons-react/dist/index.esm.js";
|
|
4
|
+
import '../packages/design-tokens/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes-CGyt2t8f.css';/* empty css */
|
|
5
|
+
import r from "./NavList.module.js";
|
|
6
|
+
import i, { Children as a, createContext as o, forwardRef as s, isValidElement as c, useCallback as l, useContext as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
7
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
8
|
+
//#region src/NavList/NavList.tsx
|
|
9
|
+
var _ = {
|
|
10
|
+
root: "NavList",
|
|
11
|
+
get list() {
|
|
12
|
+
return `${this.root}-list`;
|
|
13
|
+
},
|
|
14
|
+
get item() {
|
|
15
|
+
return `${this.root}-item`;
|
|
16
|
+
},
|
|
17
|
+
get link() {
|
|
18
|
+
return `${this.root}-link`;
|
|
19
|
+
},
|
|
20
|
+
get leadingVisual() {
|
|
21
|
+
return `${this.root}-leading-visual`;
|
|
22
|
+
},
|
|
23
|
+
get trailingVisual() {
|
|
24
|
+
return `${this.root}-trailing-visual`;
|
|
25
|
+
},
|
|
26
|
+
get subNav() {
|
|
27
|
+
return `${this.root}-sub-nav`;
|
|
28
|
+
},
|
|
29
|
+
get group() {
|
|
30
|
+
return `${this.root}-group`;
|
|
31
|
+
},
|
|
32
|
+
get groupTitle() {
|
|
33
|
+
return `${this.root}-group-title`;
|
|
34
|
+
},
|
|
35
|
+
get groupList() {
|
|
36
|
+
return `${this.root}-group-list`;
|
|
37
|
+
},
|
|
38
|
+
get toggle() {
|
|
39
|
+
return `${this.root}-toggle`;
|
|
40
|
+
}
|
|
41
|
+
}, v = 5, y = o(1), b = o({
|
|
42
|
+
expanded: !0,
|
|
43
|
+
level: 2
|
|
44
|
+
}), x = s(({ children: t, className: n, "aria-label": i, "aria-labelledby": o, "data-testid": s, ...c }, l) => {
|
|
45
|
+
let u = f(() => a.toArray(t), [t]), d = f(() => u.some(j), [u]), p = f(() => u.some(M), [u]), m = d ? 1 : 2, g = !d && !p;
|
|
46
|
+
return /* @__PURE__ */ h("nav", {
|
|
47
|
+
ref: l,
|
|
48
|
+
className: e(r.NavList, n),
|
|
49
|
+
"aria-label": i,
|
|
50
|
+
"aria-labelledby": o,
|
|
51
|
+
"data-testid": s || _.root,
|
|
52
|
+
...c,
|
|
53
|
+
children: /* @__PURE__ */ h(y.Provider, {
|
|
54
|
+
value: m,
|
|
55
|
+
children: /* @__PURE__ */ h("ul", {
|
|
56
|
+
className: e(r.NavList__list, g && r["NavList__list--flat"]),
|
|
57
|
+
"data-testid": _.list,
|
|
58
|
+
children: t
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
}), S = s(({ as: o, children: s, className: c, defaultExpanded: p = !1, disabled: x = !1, expanded: S, leadingVisual: C, onClick: w, onExpandedChange: T, trailingVisual: D, "aria-current": O, "data-testid": k, ...j }, M) => {
|
|
63
|
+
let te = o || "a", I = u(y), ne = t(), re = t(), L = f(() => a.toArray(s), [s]), R = f(() => L.filter(E), [L]), z = f(() => L.find(E), [L]), B = f(() => L.filter(N), [L]), V = f(() => z ? L.filter((e) => e !== z) : L, [L, z]), H = V.length > 0, U = !!z, W = I < v, ie = !U, G = z?.props.id ?? ne, K = f(() => ee(z?.props.children), [z?.props.children]), q = S !== void 0, [ae, J] = m(p || K), Y = !!(q ? S : ae), { href: X, id: oe, ...se } = j, Z = oe ?? re, Q = w, ce = f(() => {
|
|
64
|
+
if (B.length > 0) return "NavList.Item: NavList.Group is not supported as a child. Use NavList.SubNav for nested disclosure. NavList.Item will not be rendered.";
|
|
65
|
+
if (U && !W) return "NavList.Item: NavList supports up to 5 levels. Level 5 items cannot contain NavList.SubNav. NavList.Item will not be rendered.";
|
|
66
|
+
if (R.length > 1) return "NavList.Item: Only one NavList.SubNav child is supported. NavList.Item will not be rendered.";
|
|
67
|
+
if (U && !H) return "NavList.Item: A label is required when using NavList.SubNav. NavList.Item will not be rendered.";
|
|
68
|
+
if (U && (X !== void 0 || o !== void 0)) return "NavList.Item: `href` and `as` are not supported when using NavList.SubNav because expandable items render as buttons. NavList.Item will not be rendered.";
|
|
69
|
+
}, [
|
|
70
|
+
o,
|
|
71
|
+
W,
|
|
72
|
+
H,
|
|
73
|
+
U,
|
|
74
|
+
X,
|
|
75
|
+
B.length,
|
|
76
|
+
R.length
|
|
77
|
+
]);
|
|
78
|
+
d(() => {
|
|
79
|
+
K && !q && J(!0);
|
|
80
|
+
}, [K, q]);
|
|
81
|
+
let le = l((e) => {
|
|
82
|
+
q || J(e), T?.(e);
|
|
83
|
+
}, [q, T]), $ = l(() => {
|
|
84
|
+
le(!Y);
|
|
85
|
+
}, [Y, le]), ue = l((e) => {
|
|
86
|
+
if (x) {
|
|
87
|
+
e.preventDefault();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
Q?.(e);
|
|
91
|
+
}, [x, Q]), de = l((e) => {
|
|
92
|
+
A(M, e);
|
|
93
|
+
}, [M]), fe = l((e) => {
|
|
94
|
+
if (x) {
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
Q?.(e), e.defaultPrevented || $();
|
|
99
|
+
}, [
|
|
100
|
+
x,
|
|
101
|
+
Q,
|
|
102
|
+
$
|
|
103
|
+
]);
|
|
104
|
+
if (ce) return F(ce), null;
|
|
105
|
+
let pe = /* @__PURE__ */ g("span", {
|
|
106
|
+
className: r.NavList__labelArea,
|
|
107
|
+
children: [
|
|
108
|
+
P(C, r.NavList__leadingVisual, _.leadingVisual),
|
|
109
|
+
/* @__PURE__ */ h("span", {
|
|
110
|
+
className: r.NavList__label,
|
|
111
|
+
children: V
|
|
112
|
+
}),
|
|
113
|
+
P(D, r.NavList__trailingVisual, _.trailingVisual)
|
|
114
|
+
]
|
|
115
|
+
});
|
|
116
|
+
return /* @__PURE__ */ g("li", {
|
|
117
|
+
className: e(r.NavList__item, r[`NavList__item--level-${I}`], ie && r["NavList__item--leaf"], U && Y && r["NavList__item--expanded"], K && r["NavList__item--has-current-descendant"]),
|
|
118
|
+
"data-testid": k || _.item,
|
|
119
|
+
children: [/* @__PURE__ */ h("div", {
|
|
120
|
+
className: r.NavList__itemContent,
|
|
121
|
+
children: U && W ? /* @__PURE__ */ g("button", {
|
|
122
|
+
ref: de,
|
|
123
|
+
id: Z,
|
|
124
|
+
type: "button",
|
|
125
|
+
className: e(r.NavList__link, r.NavList__accordionButton, x && r["NavList__link--disabled"], c),
|
|
126
|
+
"aria-expanded": Y ? "true" : "false",
|
|
127
|
+
"aria-controls": G,
|
|
128
|
+
"data-testid": _.toggle,
|
|
129
|
+
...se,
|
|
130
|
+
disabled: x,
|
|
131
|
+
onClick: fe,
|
|
132
|
+
children: [/* @__PURE__ */ h(n, {
|
|
133
|
+
className: r.NavList__toggleIcon,
|
|
134
|
+
"aria-hidden": "true"
|
|
135
|
+
}), pe]
|
|
136
|
+
}) : /* @__PURE__ */ h(te, {
|
|
137
|
+
ref: M,
|
|
138
|
+
className: e(r.NavList__link, x && r["NavList__link--disabled"], c),
|
|
139
|
+
"aria-current": O,
|
|
140
|
+
"aria-disabled": x || void 0,
|
|
141
|
+
"data-testid": _.link,
|
|
142
|
+
onClick: ue,
|
|
143
|
+
...j,
|
|
144
|
+
children: pe
|
|
145
|
+
})
|
|
146
|
+
}), z ? /* @__PURE__ */ h(b.Provider, {
|
|
147
|
+
value: {
|
|
148
|
+
expanded: Y,
|
|
149
|
+
labelledBy: Z,
|
|
150
|
+
level: I + 1
|
|
151
|
+
},
|
|
152
|
+
children: i.cloneElement(z, { id: G })
|
|
153
|
+
}) : null]
|
|
154
|
+
});
|
|
155
|
+
}), C = s(({ children: t, className: n, "aria-labelledby": i, "data-testid": a, ...o }, s) => {
|
|
156
|
+
let { expanded: c, labelledBy: f, level: m } = u(b), g = p(null), v = l((e) => {
|
|
157
|
+
e.style.setProperty("--brand-NavList-subNav-height", `${e.scrollHeight}px`);
|
|
158
|
+
}, []), x = l(() => {
|
|
159
|
+
let e = g.current;
|
|
160
|
+
for (; e;) v(e), e = e.parentElement?.closest(`.${r.NavList__subNav}`) ?? null;
|
|
161
|
+
}, [v]), S = l((e) => {
|
|
162
|
+
g.current = e, A(s, e);
|
|
163
|
+
}, [s]);
|
|
164
|
+
return d(() => {
|
|
165
|
+
x();
|
|
166
|
+
}, [
|
|
167
|
+
t,
|
|
168
|
+
c,
|
|
169
|
+
x
|
|
170
|
+
]), d(() => {
|
|
171
|
+
g.current?.toggleAttribute("inert", !c);
|
|
172
|
+
}, [c]), d(() => {
|
|
173
|
+
let e = g.current;
|
|
174
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
175
|
+
let t = new ResizeObserver(x);
|
|
176
|
+
return t.observe(e), () => {
|
|
177
|
+
t.disconnect();
|
|
178
|
+
};
|
|
179
|
+
}, [x]), /* @__PURE__ */ h("ul", {
|
|
180
|
+
ref: S,
|
|
181
|
+
className: e(r.NavList__subNav, c && r["NavList__subNav--expanded"], n),
|
|
182
|
+
"aria-labelledby": i ?? f,
|
|
183
|
+
...o,
|
|
184
|
+
"aria-hidden": c ? void 0 : "true",
|
|
185
|
+
"data-testid": a || _.subNav,
|
|
186
|
+
children: /* @__PURE__ */ h(y.Provider, {
|
|
187
|
+
value: m,
|
|
188
|
+
children: t
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}), w = s(({ title: n, children: o, className: s, "data-testid": l, ...u }, d) => {
|
|
192
|
+
let p = t(), m = f(() => {
|
|
193
|
+
let e = (t) => a.toArray(t).flatMap((t) => D(t) ? [t] : c(t) && t.type === i.Fragment ? e(t.props.children) : []);
|
|
194
|
+
return e(o);
|
|
195
|
+
}, [o]);
|
|
196
|
+
return f(() => {
|
|
197
|
+
let e = (t) => a.toArray(t).some((t) => D(t) ? !1 : c(t) && t.type === i.Fragment ? e(t.props.children) : !0);
|
|
198
|
+
return e(o);
|
|
199
|
+
}, [o]) && F("NavList.Group: Only NavList.Item children are supported. Invalid children will not be rendered. Use NavList.SubNav as a child of NavList.Item for nested disclosure."), /* @__PURE__ */ g("li", {
|
|
200
|
+
ref: d,
|
|
201
|
+
className: e(r.NavList__group, s),
|
|
202
|
+
"data-testid": l || _.group,
|
|
203
|
+
...u,
|
|
204
|
+
children: [n ? /* @__PURE__ */ h("h3", {
|
|
205
|
+
id: p,
|
|
206
|
+
className: r.NavList__groupTitle,
|
|
207
|
+
"data-testid": _.groupTitle,
|
|
208
|
+
children: n
|
|
209
|
+
}) : null, /* @__PURE__ */ h("ul", {
|
|
210
|
+
className: r.NavList__groupList,
|
|
211
|
+
"aria-labelledby": n ? p : void 0,
|
|
212
|
+
"data-testid": _.groupList,
|
|
213
|
+
children: /* @__PURE__ */ h(y.Provider, {
|
|
214
|
+
value: 2,
|
|
215
|
+
children: m
|
|
216
|
+
})
|
|
217
|
+
})]
|
|
218
|
+
});
|
|
219
|
+
}), T = Object.assign(x, {
|
|
220
|
+
Item: S,
|
|
221
|
+
SubNav: C,
|
|
222
|
+
Group: w,
|
|
223
|
+
testIds: _
|
|
224
|
+
});
|
|
225
|
+
function E(e) {
|
|
226
|
+
return c(e) && e.type === C;
|
|
227
|
+
}
|
|
228
|
+
function D(e) {
|
|
229
|
+
return c(e) && e.type === S;
|
|
230
|
+
}
|
|
231
|
+
function O(e) {
|
|
232
|
+
return c(e) && e.type === w;
|
|
233
|
+
}
|
|
234
|
+
function k(e) {
|
|
235
|
+
return !!e && e !== "false";
|
|
236
|
+
}
|
|
237
|
+
function ee(e) {
|
|
238
|
+
return a.toArray(e).some((e) => c(e) ? k(e.props["aria-current"]) ? !0 : ee(e.props.children) : !1);
|
|
239
|
+
}
|
|
240
|
+
function A(e, t) {
|
|
241
|
+
if (e) {
|
|
242
|
+
if (typeof e == "function") {
|
|
243
|
+
e(t);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
e.current = t;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function j(e) {
|
|
250
|
+
return c(e) ? e.type === i.Fragment ? a.toArray(e.props.children).some(j) : a.toArray(e.props.children).some(E) : !1;
|
|
251
|
+
}
|
|
252
|
+
function M(e) {
|
|
253
|
+
return c(e) ? e.type === i.Fragment ? a.toArray(e.props.children).some(M) : O(e) : !1;
|
|
254
|
+
}
|
|
255
|
+
function N(e) {
|
|
256
|
+
return c(e) ? e.type === i.Fragment ? a.toArray(e.props.children).some(N) : O(e) : !1;
|
|
257
|
+
}
|
|
258
|
+
function P(e, t, n) {
|
|
259
|
+
if (!e) return null;
|
|
260
|
+
let r = c(e) ? e : i.createElement(e);
|
|
261
|
+
return c(r) ? /* @__PURE__ */ h("span", {
|
|
262
|
+
className: t,
|
|
263
|
+
"data-testid": n,
|
|
264
|
+
children: i.cloneElement(r, {
|
|
265
|
+
className: r.props.className,
|
|
266
|
+
"aria-hidden": "true",
|
|
267
|
+
focusable: "false"
|
|
268
|
+
})
|
|
269
|
+
}) : null;
|
|
270
|
+
}
|
|
271
|
+
function F(e) {
|
|
272
|
+
(process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") && console.warn(e);
|
|
273
|
+
}
|
|
274
|
+
//#endregion
|
|
275
|
+
export { T as NavList };
|
|
276
|
+
|
|
277
|
+
//# sourceMappingURL=NavList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NavList.js","names":[],"sources":["../../src/NavList/NavList.tsx"],"sourcesContent":["import React, {\n Children,\n createContext,\n forwardRef,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type AriaAttributes,\n type MutableRefObject,\n type PropsWithChildren,\n type ReactElement,\n type ReactNode,\n type Ref,\n} from 'react'\n\nimport {clsx} from 'clsx'\nimport {TriangleDownIcon, type Icon} from '@primer/octicons-react'\nimport type {BaseProps} from '../component-helpers'\nimport {useId} from '../hooks/useId'\nimport '@primer/brand-primitives/lib/design-tokens/css/tokens/functional/components/nav-list/colors-with-modes.css'\n\n/** * Main stylesheet (as a CSS Module) */\nimport styles from './NavList.module.css'\n\nconst testIds = {\n root: 'NavList',\n get list() {\n return `${this.root}-list`\n },\n get item() {\n return `${this.root}-item`\n },\n get link() {\n return `${this.root}-link`\n },\n get leadingVisual() {\n return `${this.root}-leading-visual`\n },\n get trailingVisual() {\n return `${this.root}-trailing-visual`\n },\n get subNav() {\n return `${this.root}-sub-nav`\n },\n get group() {\n return `${this.root}-group`\n },\n get groupTitle() {\n return `${this.root}-group-title`\n },\n get groupList() {\n return `${this.root}-group-list`\n },\n get toggle() {\n return `${this.root}-toggle`\n },\n}\n\nexport type NavListRootProps = {\n /**\n * Accessible label for the navigation landmark.\n */\n 'aria-label': string\n /**\n * ID of an element that labels the navigation landmark.\n */\n 'aria-labelledby'?: string\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLElement> &\n Omit<React.HTMLAttributes<HTMLElement>, 'aria-label' | 'aria-labelledby'>\n\ntype NavListLevel = 1 | 2 | 3 | 4 | 5\n\nconst MaxNavListLevel = 5\nconst NavListLevelContext = createContext<NavListLevel>(1)\nconst NavListSubNavContext = createContext<{\n expanded: boolean\n labelledBy?: string\n level: NavListLevel\n}>({\n expanded: true,\n level: 2,\n})\n\nconst NavListRoot = forwardRef<HTMLElement, NavListRootProps>(\n (\n {children, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'data-testid': testId, ...rest},\n ref,\n ) => {\n const childrenArray = useMemo(() => Children.toArray(children), [children])\n const hasTopLevelSubNav = useMemo(() => childrenArray.some(childHasDirectSubNav), [childrenArray])\n const hasTopLevelGroup = useMemo(() => childrenArray.some(childIsNavListGroupElement), [childrenArray])\n const rootLevel = hasTopLevelSubNav ? 1 : 2\n const hasFlatRootList = !hasTopLevelSubNav && !hasTopLevelGroup\n\n return (\n <nav\n ref={ref}\n className={clsx(styles.NavList, className)}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n data-testid={testId || testIds.root}\n {...rest}\n >\n <NavListLevelContext.Provider value={rootLevel}>\n <ul\n className={clsx(styles.NavList__list, hasFlatRootList && styles['NavList__list--flat'])}\n data-testid={testIds.list}\n >\n {children}\n </ul>\n </NavListLevelContext.Provider>\n </nav>\n )\n },\n)\n\ntype Visual = ReactElement | React.ElementType | Icon\ntype NavListItemAs = 'a' | 'button'\n\ntype NavListItemBaseProps = {\n /**\n * Leading visual rendered before the item label.\n */\n leadingVisual?: Visual\n /**\n * Trailing visual rendered after the item label.\n */\n trailingVisual?: Visual\n /**\n * Whether nested items should be expanded by default.\n */\n defaultExpanded?: boolean\n /**\n * Controls the nested item expanded state.\n */\n expanded?: boolean\n /**\n * Called when a nested item is expanded or collapsed.\n */\n onExpandedChange?: (expanded: boolean) => void\n /**\n * Marks the item as disabled. Disabled link items receive `aria-disabled`.\n */\n disabled?: boolean\n 'data-testid'?: string\n}\n\nexport type NavListItemProps<C extends NavListItemAs = 'a'> = {\n as?: C\n} & NavListItemBaseProps &\n PropsWithChildren<BaseProps<HTMLElement>> &\n Omit<React.ComponentPropsWithoutRef<C>, keyof NavListItemBaseProps | keyof BaseProps<HTMLElement> | 'as' | 'children'>\n\ntype NavListSubNavElement = ReactElement<NavListSubNavProps>\n\nconst NavListItem = forwardRef(\n (\n {\n as,\n children,\n className,\n defaultExpanded = false,\n disabled = false,\n expanded,\n leadingVisual,\n onClick,\n onExpandedChange,\n trailingVisual,\n 'aria-current': ariaCurrent,\n 'data-testid': testId,\n ...rest\n }: NavListItemProps<NavListItemAs>,\n ref: Ref<HTMLElement>,\n ) => {\n const Component = (as || 'a') as React.ElementType\n const level = useContext(NavListLevelContext)\n const subNavId = useId()\n const accordionButtonId = useId()\n const childrenArray = useMemo(() => Children.toArray(children), [children])\n const subNavChildren = useMemo(() => childrenArray.filter(isNavListSubNavElement), [childrenArray])\n const subNav = useMemo(() => childrenArray.find(isNavListSubNavElement), [childrenArray])\n const navListGroupChildren = useMemo(() => childrenArray.filter(childHasNavListGroupElement), [childrenArray])\n const labelChildren = useMemo(\n () => (subNav ? childrenArray.filter(child => child !== subNav) : childrenArray),\n [childrenArray, subNav],\n )\n const hasLabelContent = labelChildren.length > 0\n const hasSubNav = Boolean(subNav)\n const canExpand = level < MaxNavListLevel\n const isLeafItem = !hasSubNav\n const controlledSubNavId = subNav?.props.id ?? subNavId\n const hasCurrentSubNavItem = useMemo(() => hasCurrentDescendant(subNav?.props.children), [subNav?.props.children])\n const isControlled = expanded !== undefined\n const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded || hasCurrentSubNavItem)\n const isExpanded = Boolean(isControlled ? expanded : uncontrolledExpanded)\n const {\n href,\n id: accordionButtonIdProp,\n ...accordionButtonProps\n } = rest as React.ButtonHTMLAttributes<HTMLButtonElement> & {\n href?: string\n }\n const controlledAccordionButtonId = accordionButtonIdProp ?? accordionButtonId\n const itemOnClick = onClick as React.MouseEventHandler<HTMLElement> | undefined\n const invalidMessage = useMemo(() => {\n if (navListGroupChildren.length > 0) {\n return 'NavList.Item: NavList.Group is not supported as a child. Use NavList.SubNav for nested disclosure. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && !canExpand) {\n return 'NavList.Item: NavList supports up to 5 levels. Level 5 items cannot contain NavList.SubNav. NavList.Item will not be rendered.'\n }\n\n if (subNavChildren.length > 1) {\n return 'NavList.Item: Only one NavList.SubNav child is supported. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && !hasLabelContent) {\n return 'NavList.Item: A label is required when using NavList.SubNav. NavList.Item will not be rendered.'\n }\n\n if (hasSubNav && (href !== undefined || as !== undefined)) {\n return 'NavList.Item: `href` and `as` are not supported when using NavList.SubNav because expandable items render as buttons. NavList.Item will not be rendered.'\n }\n }, [as, canExpand, hasLabelContent, hasSubNav, href, navListGroupChildren.length, subNavChildren.length])\n\n useEffect(() => {\n if (hasCurrentSubNavItem && !isControlled) {\n setUncontrolledExpanded(true)\n }\n }, [hasCurrentSubNavItem, isControlled])\n\n const setExpanded = useCallback(\n (value: boolean) => {\n if (!isControlled) {\n setUncontrolledExpanded(value)\n }\n onExpandedChange?.(value)\n },\n [isControlled, onExpandedChange],\n )\n\n const toggleExpanded = useCallback(() => {\n setExpanded(!isExpanded)\n }, [isExpanded, setExpanded])\n\n const handleClick = useCallback(\n (event: React.MouseEvent<HTMLElement>) => {\n if (disabled) {\n event.preventDefault()\n return\n }\n\n itemOnClick?.(event)\n },\n [disabled, itemOnClick],\n )\n\n const setAccordionButtonRef = useCallback(\n (node: HTMLButtonElement | null) => {\n assignRef(ref, node)\n },\n [ref],\n )\n\n const handleAccordionClick = useCallback(\n (event: React.MouseEvent<HTMLButtonElement>) => {\n if (disabled) {\n event.preventDefault()\n return\n }\n\n itemOnClick?.(event)\n\n if (!event.defaultPrevented) {\n toggleExpanded()\n }\n },\n [disabled, itemOnClick, toggleExpanded],\n )\n\n if (invalidMessage) {\n warnNavListValidation(invalidMessage)\n return null\n }\n\n const labelArea = (\n <span className={styles.NavList__labelArea}>\n {renderVisual(leadingVisual, styles.NavList__leadingVisual, testIds.leadingVisual)}\n <span className={styles.NavList__label}>{labelChildren}</span>\n {renderVisual(trailingVisual, styles.NavList__trailingVisual, testIds.trailingVisual)}\n </span>\n )\n\n return (\n <li\n className={clsx(\n styles.NavList__item,\n styles[`NavList__item--level-${level}`],\n isLeafItem && styles['NavList__item--leaf'],\n hasSubNav && isExpanded && styles['NavList__item--expanded'],\n hasCurrentSubNavItem && styles['NavList__item--has-current-descendant'],\n )}\n data-testid={testId || testIds.item}\n >\n <div className={styles.NavList__itemContent}>\n {hasSubNav && canExpand ? (\n <button\n ref={setAccordionButtonRef}\n id={controlledAccordionButtonId}\n type=\"button\"\n className={clsx(\n styles.NavList__link,\n styles.NavList__accordionButton,\n disabled && styles['NavList__link--disabled'],\n className,\n )}\n aria-expanded={isExpanded ? 'true' : 'false'}\n aria-controls={controlledSubNavId}\n data-testid={testIds.toggle}\n {...accordionButtonProps}\n disabled={disabled}\n onClick={handleAccordionClick}\n >\n <TriangleDownIcon className={styles.NavList__toggleIcon} aria-hidden=\"true\" />\n {labelArea}\n </button>\n ) : (\n <Component\n ref={ref}\n className={clsx(styles.NavList__link, disabled && styles['NavList__link--disabled'], className)}\n aria-current={ariaCurrent}\n aria-disabled={disabled || undefined}\n data-testid={testIds.link}\n onClick={handleClick}\n {...rest}\n >\n {labelArea}\n </Component>\n )}\n </div>\n\n {subNav ? (\n <NavListSubNavContext.Provider\n value={{expanded: isExpanded, labelledBy: controlledAccordionButtonId, level: (level + 1) as NavListLevel}}\n >\n {React.cloneElement(subNav, {\n id: controlledSubNavId,\n })}\n </NavListSubNavContext.Provider>\n ) : null}\n </li>\n )\n },\n) as <C extends NavListItemAs = 'a'>(props: NavListItemProps<C> & {ref?: Ref<HTMLElement>}) => ReactElement | null\n\nexport type NavListSubNavProps = {\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLUListElement> &\n React.HTMLAttributes<HTMLUListElement>\n\nconst NavListSubNav = forwardRef<HTMLUListElement, NavListSubNavProps>(\n ({children, className, 'aria-labelledby': ariaLabelledBy, 'data-testid': testId, ...rest}, ref) => {\n const {expanded, labelledBy, level} = useContext(NavListSubNavContext)\n const subNavRef = useRef<HTMLUListElement | null>(null)\n\n const setSubNavHeight = useCallback((subNav: HTMLUListElement) => {\n subNav.style.setProperty('--brand-NavList-subNav-height', `${subNav.scrollHeight}px`)\n }, [])\n\n const setSubNavAndAncestorHeights = useCallback(() => {\n let subNav = subNavRef.current\n\n while (subNav) {\n setSubNavHeight(subNav)\n subNav = subNav.parentElement?.closest<HTMLUListElement>(`.${styles.NavList__subNav}`) ?? null\n }\n }, [setSubNavHeight])\n\n const setSubNavRef = useCallback(\n (node: HTMLUListElement | null) => {\n subNavRef.current = node\n assignRef(ref, node)\n },\n [ref],\n )\n\n useEffect(() => {\n setSubNavAndAncestorHeights()\n }, [children, expanded, setSubNavAndAncestorHeights])\n\n useEffect(() => {\n subNavRef.current?.toggleAttribute('inert', !expanded)\n }, [expanded])\n\n useEffect(() => {\n const subNav = subNavRef.current\n\n if (!subNav || typeof ResizeObserver === 'undefined') {\n return\n }\n\n const resizeObserver = new ResizeObserver(setSubNavAndAncestorHeights)\n resizeObserver.observe(subNav)\n\n return () => {\n resizeObserver.disconnect()\n }\n }, [setSubNavAndAncestorHeights])\n\n return (\n <ul\n ref={setSubNavRef}\n className={clsx(styles.NavList__subNav, expanded && styles['NavList__subNav--expanded'], className)}\n aria-labelledby={ariaLabelledBy ?? labelledBy}\n {...rest}\n aria-hidden={expanded ? undefined : 'true'}\n data-testid={testId || testIds.subNav}\n >\n <NavListLevelContext.Provider value={level}>{children}</NavListLevelContext.Provider>\n </ul>\n )\n },\n)\n\nexport type NavListGroupProps = {\n /**\n * Heading text for the group.\n */\n title?: ReactNode\n children: ReactNode\n 'data-testid'?: string\n} & BaseProps<HTMLLIElement> &\n Omit<React.LiHTMLAttributes<HTMLLIElement>, 'title'>\n\nconst NavListGroup = forwardRef<HTMLLIElement, NavListGroupProps>(\n ({title, children, className, 'data-testid': testId, ...rest}, ref) => {\n const titleId = useId()\n const validChildren = useMemo(() => {\n const getValidChildren = (childrenToValidate: ReactNode): ReactNode[] =>\n Children.toArray(childrenToValidate).flatMap(child => {\n if (isNavListItemElement(child)) {\n return [child]\n }\n\n if (isValidElement(child) && child.type === React.Fragment) {\n return getValidChildren((child as ElementWithChildren).props.children)\n }\n\n return []\n })\n\n return getValidChildren(children)\n }, [children])\n const hasInvalidChild = useMemo(() => {\n const containsInvalidChild = (childrenToValidate: ReactNode): boolean =>\n Children.toArray(childrenToValidate).some(child => {\n if (isNavListItemElement(child)) {\n return false\n }\n\n if (isValidElement(child) && child.type === React.Fragment) {\n return containsInvalidChild((child as ElementWithChildren).props.children)\n }\n\n return true\n })\n\n return containsInvalidChild(children)\n }, [children])\n\n if (hasInvalidChild) {\n warnNavListValidation(\n 'NavList.Group: Only NavList.Item children are supported. Invalid children will not be rendered. Use NavList.SubNav as a child of NavList.Item for nested disclosure.',\n )\n }\n\n return (\n <li ref={ref} className={clsx(styles.NavList__group, className)} data-testid={testId || testIds.group} {...rest}>\n {title ? (\n <h3 id={titleId} className={styles.NavList__groupTitle} data-testid={testIds.groupTitle}>\n {title}\n </h3>\n ) : null}\n <ul\n className={styles.NavList__groupList}\n aria-labelledby={title ? titleId : undefined}\n data-testid={testIds.groupList}\n >\n <NavListLevelContext.Provider value={2}>{validChildren}</NavListLevelContext.Provider>\n </ul>\n </li>\n )\n },\n)\n\n/**\n * Use NavList to render vertical navigation links with groups and expandable nested lists.\n * @see https://primer.style/brand/components/NavList\n */\nexport const NavList = Object.assign(NavListRoot, {\n Item: NavListItem,\n SubNav: NavListSubNav,\n Group: NavListGroup,\n testIds,\n})\n\ntype ElementWithChildren = ReactElement<{children?: ReactNode}>\ntype ElementWithCurrent = ReactElement<{children?: ReactNode; 'aria-current'?: AriaAttributes['aria-current']}>\n\nfunction isNavListSubNavElement(node: ReactNode): node is NavListSubNavElement {\n return isValidElement<NavListSubNavProps>(node) && node.type === NavListSubNav\n}\n\nfunction isNavListItemElement(node: ReactNode): node is ReactElement<NavListItemProps> {\n return isValidElement<NavListItemProps>(node) && node.type === NavListItem\n}\n\nfunction isNavListGroupElement(node: ReactNode): node is ReactElement<NavListGroupProps> {\n return isValidElement<NavListGroupProps>(node) && node.type === NavListGroup\n}\n\nfunction isCurrentValue(value: AriaAttributes['aria-current']) {\n return Boolean(value) && value !== 'false'\n}\n\nfunction hasCurrentDescendant(node: ReactNode): boolean {\n return Children.toArray(node).some(child => {\n if (!isValidElement(child)) return false\n\n const currentChild = child as ElementWithCurrent\n if (isCurrentValue(currentChild.props['aria-current'])) return true\n\n return hasCurrentDescendant((child as ElementWithChildren).props.children)\n })\n}\n\nfunction assignRef<T>(ref: Ref<T> | undefined, value: T | null) {\n if (!ref) return\n\n if (typeof ref === 'function') {\n ref(value)\n return\n }\n\n ;(ref as MutableRefObject<T | null>).current = value\n}\n\nfunction childHasDirectSubNav(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childHasDirectSubNav)\n }\n\n return Children.toArray((node as ElementWithChildren).props.children).some(isNavListSubNavElement)\n}\n\nfunction childIsNavListGroupElement(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childIsNavListGroupElement)\n }\n\n return isNavListGroupElement(node)\n}\n\nfunction childHasNavListGroupElement(node: ReactNode): boolean {\n if (!isValidElement(node)) return false\n\n if (node.type === React.Fragment) {\n return Children.toArray((node as ElementWithChildren).props.children).some(childHasNavListGroupElement)\n }\n\n return isNavListGroupElement(node)\n}\n\nfunction renderVisual(visual: Visual | undefined, className: string, testId: string) {\n if (!visual) return null\n\n const visualElement = isValidElement(visual) ? visual : React.createElement(visual)\n\n if (!isValidElement<{className?: string; ['aria-hidden']?: string; focusable?: string}>(visualElement)) return null\n\n return (\n <span className={className} data-testid={testId}>\n {React.cloneElement(visualElement, {\n className: visualElement.props.className,\n 'aria-hidden': 'true',\n focusable: 'false',\n })}\n </span>\n )\n}\n\nfunction warnNavListValidation(message: string) {\n if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {\n // eslint-disable-next-line no-console\n console.warn(message)\n }\n}\n"],"mappings":";;;;;;;;AA4BA,IAAM,IAAU;CACd,MAAM;CACN,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,OAAO;AACT,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,gBAAgB;AAClB,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,iBAAiB;AACnB,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,SAAS;AACX,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,QAAQ;AACV,SAAO,GAAG,KAAK,KAAK;;CAEtB,IAAI,aAAa;AACf,SA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Ae;GACjC,WAAW,EAAc,MAAM;GAC/B,eAAe;GACf,WAAW;GACZ,CAAC;EACG,CAAA,GATsG;;AAajH,SAAS,EAAsB,GAAiB;AAC9C,EAAA,QAAA,IAAA,aAA6B,iBAAA,QAAA,IAAA,aAA0C,WAErE,QAAQ,KAAK,EAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Primer_Brand__NavList-module__NavList___tuR_C{box-sizing:border-box;font-family:var(--brand-fontStack-sansSerif);color:var(--brand-color-text-default);width:100%;padding-inline-start:var(--base-size-16)}.Primer_Brand__NavList-module__NavList__list___gwquf,.Primer_Brand__NavList-module__NavList__subNav___Q4xI7,.Primer_Brand__NavList-module__NavList__groupList___Mtk4a{margin:0;padding:0;list-style:none}.Primer_Brand__NavList-module__NavList__list___gwquf{flex-direction:column;gap:0;display:flex}.Primer_Brand__NavList-module__NavList__list--flat___xvRQl,.Primer_Brand__NavList-module__NavList__groupList___Mtk4a{--brand-NavList-alignedLabel-paddingInlineStart:var(--base-size-2)}.Primer_Brand__NavList-module__NavList__groupList___Mtk4a{--brand-NavList-item-paddingInlineStart-level-2:var(--base-size-2)}.Primer_Brand__NavList-module__NavList__item___HTVCC,.Primer_Brand__NavList-module__NavList__group___Jnwkd{position:relative}.Primer_Brand__NavList-module__NavList__list___gwquf:not(.Primer_Brand__NavList-module__NavList__list--flat___xvRQl)>.Primer_Brand__NavList-module__NavList__item___HTVCC+.Primer_Brand__NavList-module__NavList__item___HTVCC,.Primer_Brand__NavList-module__NavList__list___gwquf:not(.Primer_Brand__NavList-module__NavList__list--flat___xvRQl)>.Primer_Brand__NavList-module__NavList__item___HTVCC+.Primer_Brand__NavList-module__NavList__group___Jnwkd,.Primer_Brand__NavList-module__NavList__list___gwquf:not(.Primer_Brand__NavList-module__NavList__list--flat___xvRQl)>.Primer_Brand__NavList-module__NavList__group___Jnwkd+.Primer_Brand__NavList-module__NavList__item___HTVCC,.Primer_Brand__NavList-module__NavList__list___gwquf:not(.Primer_Brand__NavList-module__NavList__list--flat___xvRQl)>.Primer_Brand__NavList-module__NavList__group___Jnwkd+.Primer_Brand__NavList-module__NavList__group___Jnwkd{background-image:repeating-linear-gradient(to right, var(--brand-color-border-muted) 0 var(--base-size-2), transparent var(--base-size-2) var(--base-size-4));background-repeat:no-repeat;background-size:100% var(--brand-borderWidth-thin);background-position:0 0}.Primer_Brand__NavList-module__NavList__groupTitle___r47_e{padding:var(--base-size-24) var(--base-size-16) var(--base-size-16);color:var(--brand-color-text-default);font-size:var(--brand-text-size-200);font-weight:var(--brand-text-weight-500);line-height:var(--brand-text-lineHeight-200);letter-spacing:var(--brand-text-letterSpacing-200);margin:0}.Primer_Brand__NavList-module__NavList__groupList___Mtk4a{flex-direction:column;gap:0;padding-block-end:var(--base-size-16);display:flex}.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{align-items:center;gap:var(--base-size-8);min-width:0;display:flex}.Primer_Brand__NavList-module__NavList__link___k0zio{align-items:center;gap:var(--base-size-8);border-radius:var(--brand-borderRadius-medium);min-width:0;color:var(--brand-color-text-muted);font-size:var(--brand-text-size-100);font-weight:var(--brand-text-weight-500);line-height:var(--brand-text-lineHeight-100);letter-spacing:var(--brand-text-letterSpacing-100);transition:background-color var(--brand-animation-duration-fast) var(--brand-animation-easing-default), color var(--brand-animation-duration-fast) var(--brand-animation-easing-default);flex:auto;padding:0;display:flex;position:relative;-webkit-text-decoration:none!important;text-decoration:none!important}.Primer_Brand__NavList-module__NavList__accordionButton___F5tOc{box-sizing:border-box;width:100%;color:var(--brand-color-text-muted);cursor:pointer;text-align:start;background:0 0;border:0;font-family:inherit;position:relative}.Primer_Brand__NavList-module__NavList__link___k0zio:hover{color:var(--brand-color-text-default);background-color:var(--brand-color-canvas-subtle)}.Primer_Brand__NavList-module__NavList__accordionButton___F5tOc:hover{color:var(--brand-color-text-default);background-color:#0000}.Primer_Brand__NavList-module__NavList__item___HTVCC:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n)>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc .Primer_Brand__NavList-module__NavList__labelArea___c4ORu{min-height:var(--base-size-32);order:2;padding-inline-start:var(--base-size-6)}.Primer_Brand__NavList-module__NavList__item___HTVCC:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n)>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc:not(:disabled):hover .Primer_Brand__NavList-module__NavList__labelArea___c4ORu{background-color:var(--brand-color-canvas-subtle)}.Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc:not(:disabled){color:var(--brand-color-text-default)}.Primer_Brand__NavList-module__NavList__item___HTVCC:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n).Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=false]:not(:disabled) .Primer_Brand__NavList-module__NavList__labelArea___c4ORu{background-color:var(--brand-color-canvas-subtle)}.Primer_Brand__NavList-module__NavList__link___k0zio:focus-visible,.Primer_Brand__NavList-module__NavList__accordionButton___F5tOc:focus-visible{outline:var(--brand-borderWidth-thick) solid var(--brand-color-focus);outline-offset:var(--base-size-2)}.Primer_Brand__NavList-module__NavList__subNav___Q4xI7 .Primer_Brand__NavList-module__NavList__link___k0zio:focus-visible,.Primer_Brand__NavList-module__NavList__subNav___Q4xI7 .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc:focus-visible{outline-offset:calc(-1 * var(--base-size-2))}.Primer_Brand__NavList-module__NavList__link___k0zio[aria-current]:not([aria-current=false]){color:var(--brand-color-text-default);background-color:var(--brand-color-canvas-subtle);padding-inline-start:var(--base-size-6)}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n) .Primer_Brand__NavList-module__NavList__link___k0zio[aria-current]:not([aria-current=false]):before{content:"";inset-block:var(--base-size-8);width:var(--base-size-4);border-radius:var(--base-size-2);background-color:var(--brand-NavList-activeIndicator-color);position:absolute;inset-inline-start:0}.Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=false]:not(:disabled):before{content:"";block-size:var(--base-size-16);width:var(--base-size-4);border-radius:var(--base-size-2);background-color:var(--brand-NavList-activeIndicator-color);z-index:1;position:absolute;inset-block-start:50%;transform:translateY(-50%)}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n.Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=false]:before{inset-inline-start:calc(-1 * var(--base-size-8))}.Primer_Brand__NavList-module__NavList__item___HTVCC:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n).Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=false]:before{inset-inline-start:var(--base-size-4)}.Primer_Brand__NavList-module__NavList__item___HTVCC:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n).Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=false]{padding-inline-start:var(--base-size-12)}.Primer_Brand__NavList-module__NavList__item___HTVCC:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n).Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=false] .Primer_Brand__NavList-module__NavList__labelArea___c4ORu{padding-inline-start:var(--base-size-2)}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio[aria-current]:not([aria-current=false]){padding-inline-start:0}.Primer_Brand__NavList-module__NavList__link--disabled___Eg304{color:var(--brand-color-text-disabled);pointer-events:none}.Primer_Brand__NavList-module__NavList__accordionButton___F5tOc:disabled{color:var(--brand-color-text-disabled);cursor:not-allowed}.Primer_Brand__NavList-module__NavList__label___ogBmt{word-break:break-word;min-width:0}.Primer_Brand__NavList-module__NavList__labelArea___c4ORu{align-items:center;gap:var(--base-size-8);border-radius:var(--brand-borderRadius-small);flex:auto;min-width:0;display:flex}.Primer_Brand__NavList-module__NavList__leadingVisual___KqRaq,.Primer_Brand__NavList-module__NavList__trailingVisual___BrZXI{color:inherit;flex:none;display:inline-flex}.Primer_Brand__NavList-module__NavList__trailingVisual___BrZXI{margin-inline-start:auto;margin-inline-end:var(--base-size-6)}.Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF{transform-origin:50%;transition:transform var(--brand-animation-duration-fast) var(--brand-animation-easing-glide);flex:none}.Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=true] .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF{transform:rotate(-180deg)}.Primer_Brand__NavList-module__NavList__subNav___Q4xI7{opacity:0;max-height:0;transform:translateY(calc(-1 * var(--base-size-8)));visibility:hidden;transition:max-height var(--brand-animation-duration-fast) var(--brand-animation-easing-glide), opacity var(--brand-animation-duration-fast) var(--brand-animation-easing-glide), transform var(--brand-animation-duration-fast) var(--brand-animation-easing-glide), visibility 0s linear var(--brand-animation-duration-fast);flex-direction:column;gap:0;margin:0;padding:0;display:flex;overflow:hidden}.Primer_Brand__NavList-module__NavList__subNav--expanded___ap3X8{max-height:none;max-height:var(--brand-NavList-subNav-height,none);opacity:1;visibility:visible;transition:max-height var(--brand-animation-duration-fast) var(--brand-animation-easing-glide), opacity var(--brand-animation-duration-fast) var(--brand-animation-easing-glide), transform var(--brand-animation-duration-fast) var(--brand-animation-easing-glide), visibility 0s linear 0s;transform:translateY(0)}.Primer_Brand__NavList-module__NavList__subNav___Q4xI7[aria-hidden=true] .Primer_Brand__NavList-module__NavList__subNav___Q4xI7{visibility:hidden}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding:var(--base-size-24) var(--base-size-16) var(--base-size-16)}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n.Primer_Brand__NavList-module__NavList__item--expanded___pH_PL{padding-block-end:var(--base-size-16)}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio{font-size:var(--brand-text-size-200);font-weight:var(--brand-text-weight-500);line-height:var(--brand-text-lineHeight-200);order:1}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc{color:var(--brand-color-text-default);min-height:var(--base-size-32);margin-block:calc(-1 * var(--base-size-8));border-radius:var(--brand-borderRadius-small);padding-inline-start:0;padding-inline-end:var(--base-size-6)}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc>*{z-index:1;position:relative}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc:not(:disabled):hover:after,.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc:not(:disabled):active:after,.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n.Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=false]:not(:disabled):after{content:"";z-index:0;border-radius:var(--brand-borderRadius-small);background-color:var(--brand-color-canvas-subtle);pointer-events:none;position:absolute;inset-block:0;inset-inline:0}.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF{order:2;margin-inline-start:auto}.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-2___kXyLx>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-4___k3h0P>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding-block:calc(var(--base-size-8) + var(--base-size-2));padding-inline-end:var(--base-size-16)}.Primer_Brand__NavList-module__NavList__item--level-2___kXyLx>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding-inline-start:var(--brand-NavList-item-paddingInlineStart-level-2,var(--base-size-24))}.Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding-inline-start:var(--base-size-40)}.Primer_Brand__NavList-module__NavList__item--level-4___k3h0P>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding-inline-start:calc(var(--base-size-48) + var(--base-size-8))}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n)>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{min-height:var(--base-size-32);padding-block:0;padding-inline:var(--base-size-16)}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ.Primer_Brand__NavList-module__NavList__item--level-2___kXyLx>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding-inline-start:var(--brand-NavList-alignedLabel-paddingInlineStart,var(--base-size-24))}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ.Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding-inline-start:var(--base-size-40)}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ.Primer_Brand__NavList-module__NavList__item--level-4___k3h0P>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding-inline-start:calc(var(--base-size-48) + var(--base-size-8))}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ.Primer_Brand__NavList-module__NavList__item--level-5___4mJ4N>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR{padding-inline-start:calc(var(--base-size-64) + var(--base-size-8))}.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-2___kXyLx>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-4___k3h0P>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF{order:1}.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-2___kXyLx>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-4___k3h0P>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc{min-height:var(--base-size-32);margin-block:calc(-1 * var(--base-size-8));border-radius:var(--brand-borderRadius-small);padding-inline-start:var(--base-size-8)}.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-2___kXyLx>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-4___k3h0P>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF{position:absolute;inset-block-start:50%;inset-inline-start:calc(-1 * var(--base-size-8));transform:translateY(-50%)}.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-2___kXyLx>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=true] .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=true] .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-4___k3h0P>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=true] .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF{transform:translateY(-50%)rotate(-180deg)}.Primer_Brand__NavList-module__NavList__item___HTVCC:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n).Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__accordionButton___F5tOc[aria-expanded=false] .Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF{inset-inline-start:calc(-1 * var(--base-size-16))}.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-2___kXyLx>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-4___k3h0P>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio,.Primer_Brand__NavList-module__NavList__item___HTVCC.Primer_Brand__NavList-module__NavList__item--level-5___4mJ4N>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio{font-size:var(--brand-text-size-100);line-height:var(--brand-text-lineHeight-100);order:2}.Primer_Brand__NavList-module__NavList__list--flat___xvRQl>.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio{font-size:var(--brand-text-size-200);line-height:var(--brand-text-lineHeight-200);letter-spacing:var(--brand-text-letterSpacing-200)}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n)>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio{min-height:var(--base-size-32);border-radius:var(--brand-borderRadius-small);padding-inline-start:var(--base-size-8)}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n)>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__labelArea___c4ORu{min-height:calc(var(--base-size-32) - var(--brand-borderWidth-thin));margin-block-end:var(--brand-borderWidth-thin);padding-inline-start:var(--base-size-6)}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n) .Primer_Brand__NavList-module__NavList__link___k0zio[aria-current]:not([aria-current=false]){background-color:#0000;padding-inline-start:var(--base-size-8)}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n)>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio:hover .Primer_Brand__NavList-module__NavList__labelArea___c4ORu,.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n) .Primer_Brand__NavList-module__NavList__link___k0zio[aria-current]:not([aria-current=false]) .Primer_Brand__NavList-module__NavList__labelArea___c4ORu{background-color:var(--brand-color-canvas-subtle)}.Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ:not(.Primer_Brand__NavList-module__NavList__item--level-1___gWx1n)>.Primer_Brand__NavList-module__NavList__itemContent___bYaVR .Primer_Brand__NavList-module__NavList__link___k0zio:hover{background-color:#0000;padding-inline-start:var(--base-size-8)}[data-color-mode=dark] .Primer_Brand__NavList-module__NavList___tuR_C{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (prefers-reduced-motion:reduce){.Primer_Brand__NavList-module__NavList___tuR_C,.Primer_Brand__NavList-module__NavList___tuR_C:before,.Primer_Brand__NavList-module__NavList___tuR_C:after,.Primer_Brand__NavList-module__NavList___tuR_C *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import './NavList.module-CZFnt8br.css';var e = {
|
|
2
|
+
NavList: "Primer_Brand__NavList-module__NavList___tuR_C",
|
|
3
|
+
NavList__list: "Primer_Brand__NavList-module__NavList__list___gwquf",
|
|
4
|
+
NavList__subNav: "Primer_Brand__NavList-module__NavList__subNav___Q4xI7",
|
|
5
|
+
NavList__groupList: "Primer_Brand__NavList-module__NavList__groupList___Mtk4a",
|
|
6
|
+
"NavList__list--flat": "Primer_Brand__NavList-module__NavList__list--flat___xvRQl",
|
|
7
|
+
NavList__item: "Primer_Brand__NavList-module__NavList__item___HTVCC",
|
|
8
|
+
NavList__group: "Primer_Brand__NavList-module__NavList__group___Jnwkd",
|
|
9
|
+
NavList__groupTitle: "Primer_Brand__NavList-module__NavList__groupTitle___r47_e",
|
|
10
|
+
NavList__itemContent: "Primer_Brand__NavList-module__NavList__itemContent___bYaVR",
|
|
11
|
+
NavList__link: "Primer_Brand__NavList-module__NavList__link___k0zio",
|
|
12
|
+
NavList__accordionButton: "Primer_Brand__NavList-module__NavList__accordionButton___F5tOc",
|
|
13
|
+
"NavList__item--level-1": "Primer_Brand__NavList-module__NavList__item--level-1___gWx1n",
|
|
14
|
+
NavList__labelArea: "Primer_Brand__NavList-module__NavList__labelArea___c4ORu",
|
|
15
|
+
"NavList__item--has-current-descendant": "Primer_Brand__NavList-module__NavList__item--has-current-descendant___JG7dQ",
|
|
16
|
+
"NavList__item--leaf": "Primer_Brand__NavList-module__NavList__item--leaf___YFNSZ",
|
|
17
|
+
"NavList__link--disabled": "Primer_Brand__NavList-module__NavList__link--disabled___Eg304",
|
|
18
|
+
NavList__label: "Primer_Brand__NavList-module__NavList__label___ogBmt",
|
|
19
|
+
NavList__leadingVisual: "Primer_Brand__NavList-module__NavList__leadingVisual___KqRaq",
|
|
20
|
+
NavList__trailingVisual: "Primer_Brand__NavList-module__NavList__trailingVisual___BrZXI",
|
|
21
|
+
NavList__toggleIcon: "Primer_Brand__NavList-module__NavList__toggleIcon___nlJbF",
|
|
22
|
+
"NavList__subNav--expanded": "Primer_Brand__NavList-module__NavList__subNav--expanded___ap3X8",
|
|
23
|
+
"NavList__item--expanded": "Primer_Brand__NavList-module__NavList__item--expanded___pH_PL",
|
|
24
|
+
"NavList__item--level-2": "Primer_Brand__NavList-module__NavList__item--level-2___kXyLx",
|
|
25
|
+
"NavList__item--level-3": "Primer_Brand__NavList-module__NavList__item--level-3___Z5uiQ",
|
|
26
|
+
"NavList__item--level-4": "Primer_Brand__NavList-module__NavList__item--level-4___k3h0P",
|
|
27
|
+
"NavList__item--level-5": "Primer_Brand__NavList-module__NavList__item--level-5___4mJ4N"
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { e as default };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=NavList.module.js.map
|